It is currently Fri May 24, 2013 3:21 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 332 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 23  Next
Author Message
 Post subject:
PostPosted: Fri Apr 20, 2007 8:50 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Wed Oct 29, 2003 4:35 pm
Posts: 9870
Location: Beyond the pale...
Sorry about that! :)

egrid_SetOptions() was getting a little out of hand. Of course egrid_SetOption() is a lot more flexible and easily extended for future use.

It shouldn't take you long to ammend your code to use egrid_AddRows() etc.

_________________
I may look like a mule, but I'm not a complete ass.

eScript
Arctic Reports
nxSoftware


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 20, 2007 8:52 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 525
Location: Germany
It seem to work all after changing. :D

_________________
PS: Sorry for my bad English. My native language is German.

My PureBasic-Project: EasySetup - SetupMaker for your programs
[Windows 7 x64] [PB V5.0x]


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 16, 2007 5:02 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon May 29, 2006 11:29 am
Posts: 238
Location: BARCELONA - SPAIN
Hi,

Anybody knows how to add 2 grids to an SplitterGadget?
Here are an example code.

:o When i create the SplitterGadget, the grids remain disabled and the
SplitterGadget doesn't run.

Thanks


Code:
#Grid_Items_1=1
#Grid_Items_2=2
#SplitterH=3

If OpenWindow(0, 0, 0, 545, 445, "Grids", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
  egrid_CreateGrid(#Grid_Items_1, 1, 24, 545, 222,20,#egrid_GridLines|#egrid_HeaderDragDrop|#egrid_AlwaysShowSelection, #egrid_ResizeColumnsTrue|#egrid_MultiLineText)
  egrid_CreateGrid(#Grid_Items_2, 1, 247, 545, 222,20,#egrid_GridLines|#egrid_HeaderDragDrop|#egrid_AlwaysShowSelection, #egrid_ResizeColumnsTrue|#egrid_MultiLineText)
  egrid_SetHeaderHeight(#Grid_Items_1, 20)
  egrid_SetHeaderHeight(#Grid_Items_2, 20)
 
  For c=0 To 10
    egrid_AddColumn(#Grid_Items_1, c, "C", 100)
    egrid_AddColumn(#Grid_Items_2, c, "C", 100)
  Next c
 
  egrid_AddRows(#Grid_Items_1, -1, 10)
  egrid_AddRows(#Grid_Items_2, -1, 10)

  ;This two lines doesn't run fine
  SplitterGadget(#SplitterH,1,24,545,445,#Grid_Items_1,#Grid_Items_2,#PB_Splitter_Separator)
  SetGadgetState(#SplitterH, 247)

  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf

_________________
QuimV


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 16, 2007 5:09 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 4715
Location: Berlin - Germany
The Splitter resizes the egrid, use this:
Code:
#Grid_Items_1=1
#Grid_Items_2=2
#SplitterH=3

If OpenWindow(0, 0, 0, 545, 445, "Grids", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
  egrid_CreateGrid(#Grid_Items_1, 1, 24, 0, 0,20,#egrid_GridLines|#egrid_HeaderDragDrop|#egrid_AlwaysShowSelection, #egrid_ResizeColumnsTrue|#egrid_MultiLineText)
  egrid_CreateGrid(#Grid_Items_2, 1, 247, 0, 0,20,#egrid_GridLines|#egrid_HeaderDragDrop|#egrid_AlwaysShowSelection, #egrid_ResizeColumnsTrue|#egrid_MultiLineText)
  egrid_SetHeaderHeight(#Grid_Items_1, 20)
  egrid_SetHeaderHeight(#Grid_Items_2, 20)
 
  For c=0 To 10
    egrid_AddColumn(#Grid_Items_1, c, "C", 100)
    egrid_AddColumn(#Grid_Items_2, c, "C", 100)
  Next c
 
  egrid_AddRows(#Grid_Items_1, -1, 10)
  egrid_AddRows(#Grid_Items_2, -1, 10)

  ;This two lines doesn't run fine
  SplitterGadget(#SplitterH,1,24,545,445,#Grid_Items_1,#Grid_Items_2,#PB_Splitter_Separator)
  SetGadgetState(#SplitterH, 247)

  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf

_________________
PureBasic 5.11 | Windows 7 SP1 (x64) | Mageia 3 (x64) | RealSource

The use of EnableExplicit is free of charge and avoids errors.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 16, 2007 5:26 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon May 29, 2006 11:29 am
Posts: 238
Location: BARCELONA - SPAIN
:D
Thanks a lot, ts-soft.
But, how do you know that?
Have you found any new documentation about egrid v.5?
Thanks again.

_________________
QuimV


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 16, 2007 5:29 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon May 29, 2006 11:29 am
Posts: 238
Location: BARCELONA - SPAIN
I just see it now, in the SplitterGadget() help of PB.
Thanks.

_________________
QuimV


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 16, 2007 8:57 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Wed Oct 29, 2003 4:35 pm
Posts: 9870
Location: Beyond the pale...
Curious, the splitter gadget should not work at all with egrids!

An egrid sits in it's own container and should not be resized by any means other than the egrid_Resize() command.

That it even works is very surprising! Still the amount of flicker does suggest that not everything is running smoothly.

To be honest you'd be best using a custom splitter which only resizes the egrid at the end of the appropriate mouse operation (like the PB IDE).

Also, thanks to messing around with the splitters, I have found an obscure bug in the egrid library. You mght notice some very odd behaviour if you use a vertical splitter! :) I've fixed it, but it's not worth updating all the libraries just yet.

Again though, I strongly advise against using a PB splitter with egrids.

I think for the next update I'll aim to remove the container completely. This may, however, break some egrid user's code. The container is a left over from the dark early days of my PB career when I didn't know my arse from my elbow! I now know it's that thing I talk out of! :wink:

_________________
I may look like a mule, but I'm not a complete ass.

eScript
Arctic Reports
nxSoftware


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 18, 2007 12:33 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon May 29, 2006 11:29 am
Posts: 238
Location: BARCELONA - SPAIN
srod,

:? Another disfunction sorting grids embedded in a SplitterGadget.
Any idea about a solution o workaround in order to sort ...

Thanks in advanced.

Here it is the test code:

Code:
#Grid_Items_1=1
#Grid_Items_2=2
#SplitterH=3

If OpenWindow(0, 0, 0, 545, 445, "Grids", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
  egrid_CreateGrid(#Grid_Items_1, 1, 24, 0, 0,20,#egrid_GridLines|#egrid_HeaderDragDrop|#egrid_AlwaysShowSelection, #egrid_ResizeColumnsTrue|#egrid_MultiLineText)
  egrid_CreateGrid(#Grid_Items_2, 1, 247, 0, 0,20,#egrid_GridLines|#egrid_HeaderDragDrop|#egrid_AlwaysShowSelection, #egrid_ResizeColumnsTrue|#egrid_MultiLineText)
  egrid_SetHeaderHeight(#Grid_Items_1, 20)
  egrid_SetHeaderHeight(#Grid_Items_2, 20)
 
  For c=0 To 10
    egrid_AddColumn(#Grid_Items_1, c, "C", 100)
    egrid_AddColumn(#Grid_Items_2, c, "C", 100)
  Next c
 
  egrid_AddRows(#Grid_Items_1, -1, 10)
  egrid_AddRows(#Grid_Items_2, -1, 10)
 
  egrid_SetCellText(#Grid_Items_1, 0, 0, "a")
  egrid_SetCellText(#Grid_Items_1, 0, 1, "c")
  egrid_SetCellText(#Grid_Items_1, 0, 2, "b")

  ;This line INVALIDE the function PureLVSORT_SortListIconNow. The function doesn't work
  SplitterGadget(#SplitterH,1,24,545,445,#Grid_Items_1,#Grid_Items_2,#PB_Splitter_Separator)
  SetGadgetState(#SplitterH, 247)

  PureLVSORT_SortListIconNow(#Grid_Items_1, 0, 1)

  ret = PureLVSORT_SelectGadgetToSort(#Grid_Items_1,#PureLVSORT_ShowClickedHeader_Text) ;
  Select ret
    Case #PureLVSORT_Ok                   ; Success
      Debug "#PureLVSORT_Ok"
    Case #PureLVSORT_NotAGadget          ; Specified gadget does not exist
      Debug "#PureLVSORT_NotAGadget"
    Case #PureLVSORT_MemoryAllocationProblem   ; Memory allocation failed
      Debug "#PureLVSORT_MemoryAllocationProblem"
    Case #PureLVSORT_UndefinedGadget   ; Specified gadget was not initialized with PureLVSORT_SelectGadgetToSort()
      Debug "#PureLVSORT_UndefinedGadget"
    Default
      Debug "Default. ret = " + Str(ret)
  EndSelect

  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf

_________________
QuimV


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 18, 2007 1:10 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Wed Oct 29, 2003 4:35 pm
Posts: 9870
Location: Beyond the pale...
I warned you about the splitter! :)

Is it the same with a normal listicon in a splitter?

_________________
I may look like a mule, but I'm not a complete ass.

eScript
Arctic Reports
nxSoftware


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 18, 2007 1:27 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Wed Oct 29, 2003 4:35 pm
Posts: 9870
Location: Beyond the pale...
A workaround:

Code:

XIncludeFile "egrid5.pb"
DisableExplicit


#Grid_Items_1=1
#Grid_Items_2=2
#SplitterH=3

If OpenWindow(0, 0, 0, 545, 445, "Grids", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
  egrid_CreateGrid(#Grid_Items_1, 1, 24, 0, 0,20,#egrid_GridLines|#egrid_HeaderDragDrop|#egrid_AlwaysShowSelection, #egrid_ResizeColumnsTrue|#egrid_MultiLineText)
  egrid_CreateGrid(#Grid_Items_2, 1, 247, 0, 0,20,#egrid_GridLines|#egrid_HeaderDragDrop|#egrid_AlwaysShowSelection, #egrid_ResizeColumnsTrue|#egrid_MultiLineText)
  egrid_SetHeaderHeight(#Grid_Items_1, 20)
  egrid_SetHeaderHeight(#Grid_Items_2, 20)
 
  For c=0 To 10
    egrid_AddColumn(#Grid_Items_1, c, "C", 100)
    egrid_AddColumn(#Grid_Items_2, c, "C", 100)
  Next c
 
  egrid_AddRows(#Grid_Items_1, -1, 10)
  egrid_AddRows(#Grid_Items_2, -1, 10)
 
  egrid_SetCellText(#Grid_Items_1, 0, 0, "a")
  egrid_SetCellText(#Grid_Items_1, 0, 1, "c")
  egrid_SetCellText(#Grid_Items_1, 0, 2, "b")

  ret = PureLVSORT_SelectGadgetToSort(#Grid_Items_1,#PureLVSORT_ShowClickedHeader_Text) ;

  ;This line INVALIDE the function PureLVSORT_SortListIconNow. The function doesn't work
  SplitterGadget(#SplitterH,1,24,545,445,#Grid_Items_1,#Grid_Items_2,#PB_Splitter_Separator)
  SetGadgetState(#SplitterH, 247)

  PureLVSORT_SortListIconNow(#Grid_Items_1, 0, 1)
  Select ret
    Case #PureLVSORT_Ok                   ; Success
      Debug "#PureLVSORT_Ok"
    Case #PureLVSORT_NotAGadget          ; Specified gadget does not exist
      Debug "#PureLVSORT_NotAGadget"
    Case #PureLVSORT_MemoryAllocationProblem   ; Memory allocation failed
      Debug "#PureLVSORT_MemoryAllocationProblem"
    Case #PureLVSORT_UndefinedGadget   ; Specified gadget was not initialized with PureLVSORT_SelectGadgetToSort()
      Debug "#PureLVSORT_UndefinedGadget"
    Default
      Debug "Default. ret = " + Str(ret)
  EndSelect
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf


One last time though, don't use a PB splitter gadget with egrids! I will not be held responsible for the outcome! :wink:

I need to alter egrid in order for things like PB Splitter gadgets to work properly etc. Bit busy at the moment though.

_________________
I may look like a mule, but I'm not a complete ass.

eScript
Arctic Reports
nxSoftware


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 19, 2007 10:57 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon May 29, 2006 11:29 am
Posts: 238
Location: BARCELONA - SPAIN
Hi srod,

About your question "Is it the same with a normal listicon in a splitter?".

The answer is that, with normal listicons, splitter and sort functions work together fine.

Thanks for your workaround but i can't apply it because he user can activate and deactivate sort function after the splittargadget creation. I mean that firt is created splittergadget and then the user can try to use or not sort functions.

Thanks for your help.

_________________
QuimV


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 20, 2007 12:15 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Wed Oct 29, 2003 4:35 pm
Posts: 9870
Location: Beyond the pale...
Okay, I'll try and update egrid to remove these problems and make it a little more compatible with Purebasic gadgets. I'm not sure if the splitter will behave itself even then, such is the complexity of an egrid.

I might end up breaking all existing code though; in fact I'm quite sure that I will. :?

(srod looks gingerly out of the window for the lynch mob headed by Thorsten...) :)

_________________
I may look like a mule, but I'm not a complete ass.

eScript
Arctic Reports
nxSoftware


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 20, 2007 12:27 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 525
Location: Germany
Please!!! Change no important existing commands. :?
I have to change 49 egrids in 4 programs (respectively tools)!!!

_________________
PS: Sorry for my bad English. My native language is German.

My PureBasic-Project: EasySetup - SetupMaker for your programs
[Windows 7 x64] [PB V5.0x]


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 20, 2007 12:33 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Wed Oct 29, 2003 4:35 pm
Posts: 9870
Location: Beyond the pale...
The only command which might change is the egrid_CreateGrid() command, and even here I'm unsure as yet. I need to tear out the container I used for the egrid and redirect all code from the container to the parent window/control.

It will mean, however, Thorsten that those fixes you employed to get some resizing libraries to work with egrid will no longer be valid as there will no longer be a container control to worry about. Instead you can point the resizing libraries directly at the egrid concerned.

So, for most code, things should be somewhat simpler. Only your code might be unduly affected.

I'll try and be gentle though! :)

_________________
I may look like a mule, but I'm not a complete ass.

eScript
Arctic Reports
nxSoftware


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 20, 2007 1:17 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon May 29, 2006 11:29 am
Posts: 238
Location: BARCELONA - SPAIN
:D srod, Thank you for your help.

Could you give me an idea about when will be the update available?

Thanks again.

_________________
QuimV


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 332 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 23  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye