Page 4 of 23
Posted: Sun May 20, 2007 1:54 pm
by srod
QuimV wrote:
srod, Thank you for your help.
Could you give me an idea about when will be the update available?
Thanks again.
I'm working on it now, but it's proving just as problematic as I thought it would!

I've removed the container, but getting the parent control to behave itself is proving 'challenging'!
I'll beat it into submission one way or the other though!
To be honest though, I do not think that this will fix your problem with PureLVSort and the splitter. We'll see.
Posted: Sun May 20, 2007 3:05 pm
by srod
@QuimV: I've made the alterations and your original sort routine works fine now. The splitter gadget still flickers a lot, but this is because of all the custom drawing which an egrid utilises (let alone 2 of them in a splitter!

). For this reason I still recommend a customised splitter which only resizes the gadgets when the user releases the mouse etc.
@Thorsten; rest easy, no commands have been altered.

You will however have to alter any customised resizing code to now operate directly on the egrid rather than it's now non-existant container. In fact there is nothing stopping you now using PB's ResizeGadget() command on an egrid.
I won't be able to upload the new versions until later as I now have to check the dll version works and alter the help manuals etc.
Expect an announcement later.
Posted: Sun May 20, 2007 4:26 pm
by srod
Update 20th May 2007.
Have altered the library internals such that an egrid no longer sits within it's own custom container.
This now removes some of the restrictions imposed by previous versions of the library on the ways in which you can intermix PB's gadget commands and egrids.
For example, this means that you can, if you wish, now use PB's internal ResizeGadget(), GadgetX() etc. commands (although there are still custom egrid commands for these).
This shouldn't break any code other than those which used to specifically use the aforementioned container.
egrid forum:
http://egrid.aceboard.com/
egrid website:
http://www.purecoder.net/egrid.htm
Posted: Sun May 20, 2007 8:19 pm
by QuimV
srod,

It runs fine (sort properly).
Thank You very very much.
Posted: Sun May 20, 2007 8:21 pm
by srod
You're welcome QuimV.

Posted: Mon May 21, 2007 10:55 pm
by QuimV
@srod,
I'm using egrid in a project and just have found the next curious behaviour.
Inside my egrid-CallBack, I assign a gray backcolour to every row with a value of "1" in the column 6. Otherwise I assign a white backcolour to the row.
All is running fine until I sort the column 6 of the egrid. After that, the rows colored with gray colour remain colored, and in the same position that it had, although the column 6 don't has value "1". It seems that internally the egrid remains unchanged and is changed the egrid that is shown, that is different from the internal egrid.
Is that possible?
Posted: Mon May 21, 2007 11:04 pm
by srod
Not sure what you mean, although I suspect your callback is at fault.
Can you p.m. the code to me please?
**EDIT: a quick test; works okay here.
The following seems to do what you're after. It's a bit of a hack at the minute and, if you type into a cell in the shaded column, you might see some re-colouring problems (the same kind of problems which you might see in your own code).
This is not a bug and is simply due to the fact that egrid is not equipped to change the colour of a cell whilst you are physically typing into the cell itself. However, having said this, the CellCallback function can easily remedy this. Let's concentrate on the sort issue first however.
Code: Select all
DisableExplicit
;*****************************************FONT DATA****************************************
Enumeration
#head1
#head2
#main
EndEnumeration
;******************************************************************************************
Procedure.l MyCellCallBack(egrid, uMsg, *cellinfo.egridCellInfo)
Protected result
Static oldcol, oldrow
Select uMsg
Case #egrid_FormatCell
If *cellinfo\column=2
If egrid_GetCellText(1, 2, *cellinfo\row)="1"
*cellinfo\backcolour=#Yellow
EndIf
EndIf
Default
result = #True ;This accounts for all messages we have decided not to process.
EndSelect
ProcedureReturn result
EndProcedure
;******************************************************************************************
;*************************************WINDOW + GADGET LIST*********************************
If OpenWindow(0,0,0,640,300,"egrid4 demo 5.",#PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget|#PB_Window_Maximize|#PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
;******************************************************************************************
;********************************************EGRID*****************************************
;Create an egrid with resizable columns.
egrid_CreateGrid(1, WindowWidth(0)/4, WindowHeight(0)/8, WindowWidth(0)/2, WindowHeight(0)/2,28,#egrid_HeaderDragDrop|#egrid_Gridlines, #egrid_ResizeColumnsTrue)
;******************************************************************************************
egrid_CreateCellCallback(1, @MyCellCallBack())
egrid_SetHeaderHeight(1, 26)
egrid_setOption(1, #egrid_HeaderBorderColour, #Red)
egrid_setOption(1, #egrid_SelectionBorderColour, #Blue)
egrid_setOption(1, #egrid_SelectionBorderWidth, 2)
;********************************************TEXT GADGET***********************************
;***************************************ADD COLUMNS AND ROWS TO EGRID**********************************
For b=0 To 4
egrid_AddColumn(1,b,"Col " + Str(b),60)
Next
egrid_AddRows(1,-1, 100)
For b=0 To 4
egrid_SetCellText(1, 2,b, "1")
Next
PureLVSORT_SelectGadgetToSort(1,#PureLVSORT_ShowClickedHeader_Text)
;*****************************************EVENT LOOP***************************************
Repeat
EventID = WaitWindowEvent()
Select EventID
Case #PB_Event_Gadget
Select EventGadget()
EndSelect
EndSelect
Until EventID = #PB_Event_CloseWindow
EndIf
End
Posted: Tue May 22, 2007 9:59 am
by QuimV

Hi srod,
Finally, I have discovered the bug!
The bug was that I use 2 egrids in the same window, and both, during the execution of a procedure, due to an error coding a variable, had the same ID number.
Now all is running fine.
Thanks a lot for your fast and amiable help.
QuimV
Posted: Fri May 25, 2007 4:11 am
by Holly
Hi srod,
I just purchased egrid 5. How do I register it? Are there docs that come with it?
Thanks.
Holly
Posted: Fri May 25, 2007 9:25 am
by srod
Hi Holly,
I've just fallen out of bed, so just need a few moments before sorting out your registration.
The package (which I assume you've already downloaded) comes with a .chm help manual.
Regards.
Posted: Fri May 25, 2007 2:28 pm
by Holly
I found the .chm manual and received your email.
Thanks.
Holly
Posted: Fri Jun 01, 2007 1:07 pm
by srod
1st June 2007.
Thanks to ABBKlaus and Gnozal for the new version of Tailbite, there is now a version of egrid which will work with the new version of Purebasic.
See the egrid site for the download.
Posted: Fri Jun 01, 2007 1:28 pm
by Brice Manuel
Wow, that was fast.
Posted: Fri Jun 01, 2007 1:57 pm
by srod
Brice Manuel wrote:Wow, that was fast.
You sound like my girlfriend!

Posted: Fri Jun 01, 2007 1:59 pm
by Dare
srod wrote:Brice Manuel wrote:Wow, that was fast.
You sound like my girlfriend!

