CS-Grid-Gadget: New Release V 2.3 / PB4
Okay, here is my first release of CS-Grid in a PB4 compatible version.
At this release, there are no new features. Just a little bug fixed and adapted version.
I updated the links in the first post as follows:
Here is the link as User-Lib, incl. example:
http://www.xideas.de/purebasic/csgridgadget.zip
Here is the link for to the sources, incl. example:
http://www.xideas.de/purebasic/CS-Grid2-1-SOURCE.zip
Here is the link for to the new PB4 compatible sources, incl. example:
http://www.xideas.de/purebasic/CS-Grid2 ... SOURCE.zip
Enjoy it!
CSAUER
At this release, there are no new features. Just a little bug fixed and adapted version.
I updated the links in the first post as follows:
Here is the link as User-Lib, incl. example:
http://www.xideas.de/purebasic/csgridgadget.zip
Here is the link for to the sources, incl. example:
http://www.xideas.de/purebasic/CS-Grid2-1-SOURCE.zip
Here is the link for to the new PB4 compatible sources, incl. example:
http://www.xideas.de/purebasic/CS-Grid2 ... SOURCE.zip
Enjoy it!
CSAUER
- Thorsten1867
- Addict
- Posts: 1372
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
I tried CSGrid, but every time I get the error 'Invalid memory access'.
Code: Select all
#Win = 0
#CSGrid = 1
If OpenWindow(#Win, 0, 0, 800, 400, #PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_ScreenCentered, "CS-Grid-Gadget")
CreateGadgetList(WindowID())
CSGridGadget(#CSGrid,10,10,743,300,5,5)
CSGridGadget_SetAutoRedraw(#CSGrid,-1)
CSGridGadget_SetColCaptionVisibility(#CSGrid,1)
CSGridGadget_SetColCaption(#CSGrid,0,"String")
CSGridGadget_SetColCaption(#CSGrid,1,"Long")
CSGridGadget_SetRowCaptionVisibility(#CSGrid,1)
CSGridGadget_SetColDataType(#CSGrid,0,0)
CSGridGadget_SetCellValue(#CSGrid,0,0,"TESTING")
CSGridGadget_SetColInputType(#CSGrid,0,32)
CSGridGadget_SetColDataType(#CSGrid,1,1)
CSGridGadget_SetAutoRedraw(#CSGrid,1)
Repeat
main_EventID = WaitWindowEvent()
Select main_EventID
Case #PB_Event_SizeWindow
CSGridGadget_Resize(#CSGrid,10,10,743,300)
Default
CSGridGadget_EventHandling(main_EventID)
EndSelect
Until main_EventID = #PB_Event_CloseWindow
CSGridGadget_FreeGadget(#CSGrid)
EndIf
Translated with http://www.DeepL.com/Translator
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Dear Thorsten,
if you initialize the Grid by using a constant, you get a problem - I never solved so far. If you use #PB_Any instead, your program runs great (if you use PB 3.x).
So you need to replace:
by
Cheers,
CSAUER
if you initialize the Grid by using a constant, you get a problem - I never solved so far. If you use #PB_Any instead, your program runs great (if you use PB 3.x).
So you need to replace:
Code: Select all
CSGridGadget(#CSGrid,10,10,743,300,5,5)
Code: Select all
CSGrid = CSGridGadget(#PB_Any,10,10,743,300,5,5)
CSAUER
- Thorsten1867
- Addict
- Posts: 1372
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
Sorry, it's not possible to use for every gadget a global variable. My program has over 20.000 rows of code. I'm afraid I must use an other gridgadget.
Thanks for your help.
Thanks for your help.
Translated with http://www.DeepL.com/Translator
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Nice Grid but i have found a bug.
Open the example and compile it.
After compile and start it, go in the first row and the 3. colum. In this you see the vaule "139.6548".
Now press ENTER and again ENTER.
Now you see the bug.
regrads,
Nico
Open the example and compile it.
After compile and start it, go in the first row and the 3. colum. In this you see the vaule "139.6548".
Now press ENTER and again ENTER.
Now you see the bug.
regrads,
Nico
my live space
@Nicolaus: I tested it, but I found no bug. In this cell you can find the value 139.6548. If I press enter, I get the same value inside the edit-box. Maybe you have got a but caused by float-conversion (comma instead dot). This will be improved in the next version, I will release in a couple of days.
@Thorsten1867: Maybe you can help me to solve the problem, then you would be able to use it.
My problem is as following:
- The value "Gadget" comes with a value "#PB_Any" or a constant
- I create a container-gadget on this way:
- In case of a constant I do following, to store the constant-value
- In every case I want to access the gadget, I get problems, if it has been declared with a constant value. Example:
Or
- A solution could be:
But this doesn't bring the expected solution.
This is a point I don't understand. The response-value of ContainerGadget should be similar, even if I use #PB_Any oder a constant.
You can test your example with the open source. There you can trace the problem.
Thanks for you help in advance.
@Thorsten1867: Maybe you can help me to solve the problem, then you would be able to use it.
My problem is as following:
- The value "Gadget" comes with a value "#PB_Any" or a constant
- I create a container-gadget on this way:
Code: Select all
response = ContainerGadget(Gadget,x,y,width,height,image)
Code: Select all
if Gadget <> #PB_Any
GadgetID = Gadget
endif
Code: Select all
FreeGadget(response)
Code: Select all
OpenGadgetList(response)
Code: Select all
if GadgetID > -1
OpenGadgetList(GadgetID)
else
OpenGadgetList(response)
endif
This is a point I don't understand. The response-value of ContainerGadget should be similar, even if I use #PB_Any oder a constant.
You can test your example with the open source. There you can trace the problem.
Thanks for you help in advance.
I do something similar and it works fine:
now gadgetID definitely contains the ID rather than the windows handle.
So you can use etc.
Code: Select all
gadgetID = ContainerGadget(Gadget,x,y,width,height,image)
If Gadget<> #PB_Any
gadgetID=Gadget
endif
So you can use
Code: Select all
FreeGadget(gadgetID)
I may look like a mule, but I'm not a complete ass.
Thanks srod. This was the piece of hint, I needed.
I did not believe, that GadgetID can be handled similar to the response value. Now it works. You can expect this feature with the upcoming version.
Your new version of your grid is looking amazing. So I have to spend some more work on mine.
Cheers
CSAUER
I did not believe, that GadgetID can be handled similar to the response value. Now it works. You can expect this feature with the upcoming version.
Your new version of your grid is looking amazing. So I have to spend some more work on mine.

Cheers
CSAUER
Yes, the result of using #PB_Any is the gadget#, whereas the result of using a static id instead is the windows handle, so you just need to check for the absence of #PB_any etc.CSAUER wrote:I did not believe, that GadgetID can be handled similar to the response value. Now it works. You can expect this feature with the upcoming version.
CSAUER wrote:Your new version of your grid is looking amazing. So I have to spend some more work on mine.

It's all good stuff.
Yours has the potential to be far more flexible since you are not relying on a ListIcon etc. but drawing natively to a bitmap etc. Grids within grids are quite feasible with your method.
Apart from introducing more cell types (progress bars for example) I think I've taken my grid as far as I can since it is based upon a ListIcon. A grid within a grid, whilst technically possible, would be a horrendous proposition.

Anyhow, keep up the good work there.
I may look like a mule, but I'm not a complete ass.
Yes, it is on my todo list. But actually I release herewith an new version 2.3 which does not support this feature. Maybe in the next version, but I can not say, when it will come, as I am running out of time and I just wanted to release the bug fixed and extended version a long time ago.
Here are the major features and changes:
- completely compatible with version 2.2
- constant value on declaration now possible (as alternative of #PB_Any)
- cutting text on small width (orientation dependent)
- variable height of rows
- manual orientation of column headers
- manual width of row header
- manual background color for rows and/or columns
- new format: date (allows automatic date formatting)
- new format: pic (allows implementation of pictures as a value of cells - windows only)
- new inputs: combo, trackbar, combo, IP
- now released: details / sub objects
each row can have its own details screen, which can be just a gadget, a container or a sub classed CS-Grid (!)
- optimized: Column size adjustment, display sums, grid rendering, formatting, rounding, scrolling, keyboard entry
Of course, there is additionally an updated help file, but I am not able to provide a userlib, as i don't know how to provide public constants so far. Maybe if you could provide a hint to me, then I would release it.
I did not test it on other platforms, but a Mac OS X report will follow.
Here you can find the link to the sources:
http://www.xideas.de/PureBasic/CS-Grid2 ... ources.zip
Here is a screenshot of a working grid inside a grid:

Have fun.
Comments recommended.
Cheers,
CSAUER
Here are the major features and changes:
- completely compatible with version 2.2
- constant value on declaration now possible (as alternative of #PB_Any)
- cutting text on small width (orientation dependent)
- variable height of rows
- manual orientation of column headers
- manual width of row header
- manual background color for rows and/or columns
- new format: date (allows automatic date formatting)
- new format: pic (allows implementation of pictures as a value of cells - windows only)
- new inputs: combo, trackbar, combo, IP
- now released: details / sub objects
each row can have its own details screen, which can be just a gadget, a container or a sub classed CS-Grid (!)
- optimized: Column size adjustment, display sums, grid rendering, formatting, rounding, scrolling, keyboard entry
Of course, there is additionally an updated help file, but I am not able to provide a userlib, as i don't know how to provide public constants so far. Maybe if you could provide a hint to me, then I would release it.
I did not test it on other platforms, but a Mac OS X report will follow.
Here you can find the link to the sources:
http://www.xideas.de/PureBasic/CS-Grid2 ... ources.zip
Here is a screenshot of a working grid inside a grid:

Have fun.
Comments recommended.
Cheers,
CSAUER
Hi, looks good but I'm still finding the same 'erratic' behaviour that I previously reported, particularly with the selection jumping around.
For example, double click the first check mark to select it. Now double click the second; no problem so far. Now double click the third (which I presume has been disabled) and the fourth checkbox is altered, or sometimes the date gadget in the adjacent cell is activated!
Unless it's just my machine -which is barmy at the best of times!
For example, double click the first check mark to select it. Now double click the second; no problem so far. Now double click the third (which I presume has been disabled) and the fourth checkbox is altered, or sometimes the date gadget in the adjacent cell is activated!
Unless it's just my machine -which is barmy at the best of times!

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