Simple PropertyGrid
Re: Simple PropertyGrid
Hello Andre,
The [+/-] button is a tiny ImageGadget() and generate Event when clicked. It's possible to create a procedure to get the handle of this ImageGadget() and/or return it when the section is created. But sorry I can't do it tonight because I have just drink my 3rd glass of home made wine with something like 29% of alcohol in it and it's impossible to concentrate on programming. Maybe tomorrow I will update my code once again.
And maybe next week-end I will add a html help file to present the lib because it become more and more complicated and I'm almost lost my self (and I have created it) so I imagine for other it can be difficult to use it.
Best regards
Guimauve
The [+/-] button is a tiny ImageGadget() and generate Event when clicked. It's possible to create a procedure to get the handle of this ImageGadget() and/or return it when the section is created. But sorry I can't do it tonight because I have just drink my 3rd glass of home made wine with something like 29% of alcohol in it and it's impossible to concentrate on programming. Maybe tomorrow I will update my code once again.
And maybe next week-end I will add a html help file to present the lib because it become more and more complicated and I'm almost lost my self (and I have created it) so I imagine for other it can be difficult to use it.
Best regards
Guimauve
Dear Optimist, Pessimist,
and Realist,
While you guys were
busy arguing about the
glass of water, I DRANK IT !
Sincerely,
the Opportunist
and Realist,
While you guys were
busy arguing about the
glass of water, I DRANK IT !
Sincerely,
the Opportunist
Re: Simple PropertyGrid
Hello everyone,
OK a little update
http://pages.videotron.com/gsaumure/fil ... Gadget.zip
And sorry for the delay, a real life issue took me all of my free time in the past few days.
Next time I will add the ImageGadget() and few more command.
Best regards
Guimauve
OK a little update
Code: Select all
; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
; Change for V1.1.3 :
;
; Enhancement : The Use of "EnableExplicit" is now supported
; Modified : AddPropertyGridSection() now return the Open/Close button handle
; Added : GetPropertyGridSectionOpenCloseHandle() to get the Open/Close button handle
;
; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
And sorry for the delay, a real life issue took me all of my free time in the past few days.
Next time I will add the ImageGadget() and few more command.
Best regards
Guimauve
Dear Optimist, Pessimist,
and Realist,
While you guys were
busy arguing about the
glass of water, I DRANK IT !
Sincerely,
the Opportunist
and Realist,
While you guys were
busy arguing about the
glass of water, I DRANK IT !
Sincerely,
the Opportunist
- Andre
- PureBasic Team
- Posts: 2137
- Joined: Fri Apr 25, 2003 6:14 pm
- Location: Germany (Saxony, Deutscheinsiedel)
- Contact:
Re: Simple PropertyGrid
Thanks again, Guimauve, for this latest update!
I was able now to include the PropertyGrid properly into my project source, and I'm able to handle the open/close button myself
Some minor issues I found:
- creating a listicon gadget with AddPropertyGridListIconGadget() will get the 'TitleWidth' as parameter, which should be used for setting the width of the listicon itself and the width of the first column => it would be nice, if the column width is set around 20 pixel smaller than listicon width, to avoid a not needed scrollbar
- if one or several property sections is/are opened, there should be some space between them for a better look => could be standard I think, or at least make it optionally
And another feature request:
- Would it be possible to make the AddPropertyGridTextGadget() make auto-adjust its height according to the gadget content (means give it a greater height, if there is a longer text to display)? Or at least add an optional parameter to be able to set the gadget height by the programmer (plus a Setxxxx() procedure to set/change the height later)?
- Even better would be, if the AddPropertyGridSection() would recognize the needed space (height of the included TextGadget), if the is a longer text to display. Or again, add at least an (optional) parameter to be able to set the height....
Here is a screenshot of my application, which shows the above issues:

I know, these are very specific wishes, probably too much for a more general solution thought especially for using it in preferences windows, etc.... But if it would be possible, I will be very happy...
Thank you!
I was able now to include the PropertyGrid properly into my project source, and I'm able to handle the open/close button myself

Some minor issues I found:
- creating a listicon gadget with AddPropertyGridListIconGadget() will get the 'TitleWidth' as parameter, which should be used for setting the width of the listicon itself and the width of the first column => it would be nice, if the column width is set around 20 pixel smaller than listicon width, to avoid a not needed scrollbar
- if one or several property sections is/are opened, there should be some space between them for a better look => could be standard I think, or at least make it optionally
And another feature request:
- Would it be possible to make the AddPropertyGridTextGadget() make auto-adjust its height according to the gadget content (means give it a greater height, if there is a longer text to display)? Or at least add an optional parameter to be able to set the gadget height by the programmer (plus a Setxxxx() procedure to set/change the height later)?
- Even better would be, if the AddPropertyGridSection() would recognize the needed space (height of the included TextGadget), if the is a longer text to display. Or again, add at least an (optional) parameter to be able to set the height....
Here is a screenshot of my application, which shows the above issues:

I know, these are very specific wishes, probably too much for a more general solution thought especially for using it in preferences windows, etc.... But if it would be possible, I will be very happy...

Thank you!
Re: Simple PropertyGrid
Hello Andre,
I glad to help you by upgrading my code but due to real life issue, I have to reduce PureBasic programming time from 7 days a week to only 1 or 2 days (mostly the week-end) every week.
It's not possible to auto-adjust the TextGadget() height when the line is to long and split on two line (The TexteGadget does not support this either). But it's possible to set the height manually to compensate for the extra height needed. Can you replace the previous AddPropertyGridTextGadget() by this one and tell me if it work.
About the ListIcon I will see what I can do, I hope tomorrow.
Best regards
Guimauve
I glad to help you by upgrading my code but due to real life issue, I have to reduce PureBasic programming time from 7 days a week to only 1 or 2 days (mostly the week-end) every week.
It's not possible to auto-adjust the TextGadget() height when the line is to long and split on two line (The TexteGadget does not support this either). But it's possible to set the height manually to compensate for the extra height needed. Can you replace the previous AddPropertyGridTextGadget() by this one and tell me if it work.
Code: Select all
Procedure AddPropertyGridTextGadget(PropertyGridID, SectionNo, Description.s = "", Flags = 0, P_ItemGadgetHeight = #PropertyGrid_DefaultItemHeight)
Protected *PropertyGridDataA.PropertyGridData = GetGadgetData(PropertyGridID)
If *PropertyGridDataA <> #Null
If SectionNo >= 0 And SectionNo <= ListPropertyGridDataItemsSize(*PropertyGridDataA) - 1
If SelectPropertyGridDataItemsElement(*PropertyGridDataA, SectionNo)
AddPropertyGridItemSubItemsElement(GetPropertyGridDataItems(*PropertyGridDataA))
OpenGadgetList(PropertyGridID)
SetPropertyGridSubItemDescriptionGadget(GetPropertyGridItemSubItems(GetPropertyGridDataItems(*PropertyGridDataA)), TextGadget(#PB_Any, 0, 0, 0, 0, Description, Flags))
SetPropertyGridSubItemDescriptionGadgetHeight(GetPropertyGridItemSubItems(GetPropertyGridDataItems(*PropertyGridDataA)), P_ItemGadgetHeight)
SetPropertyGridSubItemItemGadget(GetPropertyGridItemSubItems(GetPropertyGridDataItems(*PropertyGridDataA)), -1)
SetPropertyGridSubItemItemGadgetHeight(GetPropertyGridItemSubItems(GetPropertyGridDataItems(*PropertyGridDataA)), P_ItemGadgetHeight)
CloseGadgetList()
Private_Update_PropertyGrid(PropertyGridID)
ProcedureReturn GetPropertyGridSubItemDescriptionGadget(GetPropertyGridItemSubItems(GetPropertyGridDataItems(*PropertyGridDataA)))
EndIf
EndIf
EndIf
EndProcedure
Best regards
Guimauve
Dear Optimist, Pessimist,
and Realist,
While you guys were
busy arguing about the
glass of water, I DRANK IT !
Sincerely,
the Opportunist
and Realist,
While you guys were
busy arguing about the
glass of water, I DRANK IT !
Sincerely,
the Opportunist
- Andre
- PureBasic Team
- Posts: 2137
- Joined: Fri Apr 25, 2003 6:14 pm
- Location: Germany (Saxony, Deutscheinsiedel)
- Contact:
Re: Simple PropertyGrid
Thanks Guimauve, for this extended procedures! It works just fine and is useful for my needs 
Two more suggestion / feature requests from me:
1) It would be nice to have a DeletePropertyGridGadget(GadgetID) or similar named function, with which I could delete a specific gadget from inside a PropertyGadgetSection. Currently it seems I need to clear the complete section and build all gadgets (without the not needed) again...
2) As I'm using also the PropertyGridSections for displaying informations, there are probably no more gadgets inside the section. Then the possibility to open/close the section is useless and should be avoided. Here would be a third option beside the [+] and [-] images a nice addition, e.g. [o] => means there is nothing more to display and the PropertyGridSection is closed and could also not be opened by the user by clicking on this image...

Two more suggestion / feature requests from me:
1) It would be nice to have a DeletePropertyGridGadget(GadgetID) or similar named function, with which I could delete a specific gadget from inside a PropertyGadgetSection. Currently it seems I need to clear the complete section and build all gadgets (without the not needed) again...
2) As I'm using also the PropertyGridSections for displaying informations, there are probably no more gadgets inside the section. Then the possibility to open/close the section is useless and should be avoided. Here would be a third option beside the [+] and [-] images a nice addition, e.g. [o] => means there is nothing more to display and the PropertyGridSection is closed and could also not be opened by the user by clicking on this image...
Re: Simple PropertyGrid
Hello Andre,
I'm sorry to announce another delay about my next upgrade. I know it is not pleasant to have to wait for someone else to finish is work to
complete our. Unfortunately, I have many real life issue to deal with and I don't have the time to program properly. Maybe next week-end ...
Again I'm very sorry about the extra delay.
Best regards
Guimauve
I'm sorry to announce another delay about my next upgrade. I know it is not pleasant to have to wait for someone else to finish is work to
complete our. Unfortunately, I have many real life issue to deal with and I don't have the time to program properly. Maybe next week-end ...
Again I'm very sorry about the extra delay.
Best regards
Guimauve
Dear Optimist, Pessimist,
and Realist,
While you guys were
busy arguing about the
glass of water, I DRANK IT !
Sincerely,
the Opportunist
and Realist,
While you guys were
busy arguing about the
glass of water, I DRANK IT !
Sincerely,
the Opportunist
Re: Simple PropertyGrid
Hello everyone,
Good news, 4 new commands, Bad news few element requested by Andre are not implemented yet (the 3rd state for the Open/Close button, ListIcon column width adjustment).
For the moment I run out of idea about how I can do it efficiently so I prefer to spend more time solve all remaining issues.
The new source code can be downloaded here : http://pages.videotron.com/gsaumure/fil ... Gadget.zip
Best regards
Guimauve
Good news, 4 new commands, Bad news few element requested by Andre are not implemented yet (the 3rd state for the Open/Close button, ListIcon column width adjustment).
For the moment I run out of idea about how I can do it efficiently so I prefer to spend more time solve all remaining issues.
The new source code can be downloaded here : http://pages.videotron.com/gsaumure/fil ... Gadget.zip
Best regards
Guimauve
Dear Optimist, Pessimist,
and Realist,
While you guys were
busy arguing about the
glass of water, I DRANK IT !
Sincerely,
the Opportunist
and Realist,
While you guys were
busy arguing about the
glass of water, I DRANK IT !
Sincerely,
the Opportunist
Re: Simple PropertyGrid
Nice work -- glad to see it's development moving on.
- Andre
- PureBasic Team
- Posts: 2137
- Joined: Fri Apr 25, 2003 6:14 pm
- Location: Germany (Saxony, Deutscheinsiedel)
- Contact:
Re: Simple PropertyGrid
Hi Guimauve,
thanks again, not tested yet. I need some more sleep today after the interview "late-night session" yesterday...
About the "third possibility" I could imagine, that the "easiest" solution could be the following:
- include a 3rd image type, maybe [o] or [/], or just use the existing [-]
- create each new GridSection with this 3rd image type as standard and save a GridSection "state" like "#GridSectionContent = #False" (empty) for each GridSection, which will cause it to not react on mouse-clicks
- change the image automatically to [+] and the GridSection state to "#GridSectionContent = #True", as soon there is added at least one item gadget to the GridSection, and then react on mouse-clicks on [+] and [-]
thanks again, not tested yet. I need some more sleep today after the interview "late-night session" yesterday...

About the "third possibility" I could imagine, that the "easiest" solution could be the following:
- include a 3rd image type, maybe [o] or [/], or just use the existing [-]
- create each new GridSection with this 3rd image type as standard and save a GridSection "state" like "#GridSectionContent = #False" (empty) for each GridSection, which will cause it to not react on mouse-clicks
- change the image automatically to [+] and the GridSection state to "#GridSectionContent = #True", as soon there is added at least one item gadget to the GridSection, and then react on mouse-clicks on [+] and [-]
Re: Simple PropertyGrid
Hello everyone,
Sorry for the long delay but it's the first day I have nothing to do except programming. OK this the V1.1.5 with the triple state Open/Close button, I think the empty section handling is OK but not bulletproof for the moment. Feel free to test and report back.
@Andre : About the ListIconGadget() column width correction, I think I got it, but on Linux with the previous version example I don't have any horizontal scroll bar for this gadget, I think it's a Mac OS issue. Can you try and report back please.
The new source code can be downloaded here : http://pages.videotron.com/gsaumure/fil ... Gadget.zip
Best regards
Guimauve
Sorry for the long delay but it's the first day I have nothing to do except programming. OK this the V1.1.5 with the triple state Open/Close button, I think the empty section handling is OK but not bulletproof for the moment. Feel free to test and report back.
@Andre : About the ListIconGadget() column width correction, I think I got it, but on Linux with the previous version example I don't have any horizontal scroll bar for this gadget, I think it's a Mac OS issue. Can you try and report back please.
The new source code can be downloaded here : http://pages.videotron.com/gsaumure/fil ... Gadget.zip
Best regards
Guimauve
Dear Optimist, Pessimist,
and Realist,
While you guys were
busy arguing about the
glass of water, I DRANK IT !
Sincerely,
the Opportunist
and Realist,
While you guys were
busy arguing about the
glass of water, I DRANK IT !
Sincerely,
the Opportunist
- Andre
- PureBasic Team
- Posts: 2137
- Joined: Fri Apr 25, 2003 6:14 pm
- Location: Germany (Saxony, Deutscheinsiedel)
- Contact:
Re: Simple PropertyGrid
Hi Guimauve,
no problem with the delay - thanks a lot for your further improvements!
The following screenshot is showing the new "triple state" and the reduced listicon width in action (on MacOS, I've not tested it on Windows). All seems to work very well!

Some minor issues remaining - for my wishlist
:
- a cosmetic one: before each 2nd, 3rd, etc. PropertyGridSection should be some space (ca. 10 pixel?), just like between section title and first gadget inside
- if there is any possibility: let me adjust the height of the section title (TextGadget), so that I'm able to display a multi-line text as title string
- provide a function able to expand PropertyGridSections (specific section as well all at once)
- provide a function able to collapse PropertyGridSections (specific section as well all -opened- at once)
Thanks again for your effort!
no problem with the delay - thanks a lot for your further improvements!
The following screenshot is showing the new "triple state" and the reduced listicon width in action (on MacOS, I've not tested it on Windows). All seems to work very well!


Some minor issues remaining - for my wishlist

- a cosmetic one: before each 2nd, 3rd, etc. PropertyGridSection should be some space (ca. 10 pixel?), just like between section title and first gadget inside
- if there is any possibility: let me adjust the height of the section title (TextGadget), so that I'm able to display a multi-line text as title string
- provide a function able to expand PropertyGridSections (specific section as well all at once)
- provide a function able to collapse PropertyGridSections (specific section as well all -opened- at once)
Thanks again for your effort!
Re: Simple PropertyGrid
To fix this problem we will have to proceed by trial and error. On Linux the PropertyGrid look like :Andre wrote:Some minor issues remaining - for my wishlist:
- a cosmetic one: before each 2nd, 3rd, etc. PropertyGridSection should be some space (ca. 10 pixel?), just like between section title and first gadget inside

Can you replace the Private_RelocatePropertyGridSubItem() procedure by this one :
Code: Select all
Procedure Private_RelocatePropertyGridSubItem(*PropertyGridSubItemA.PropertyGridSubItem, Index, Width, Height)
CompilerSelect #PB_Compiler_OS
CompilerCase #PB_OS_Windows
If GetPropertyGridSubItemItemGadget(*PropertyGridSubItemA) <> -1
ResizeGadget(GetPropertyGridSubItemDescriptionGadget(*PropertyGridSubItemA), 20, Index, width >> 1 - 40, GetPropertyGridSubItemDescriptionGadgetHeight(*PropertyGridSubItemA) - 1)
Else
ResizeGadget(GetPropertyGridSubItemDescriptionGadget(*PropertyGridSubItemA), 20, Index, width - 42, GetPropertyGridSubItemDescriptionGadgetHeight(*PropertyGridSubItemA) - 1)
If GetPropertyGridSubItemReduceWidth(*PropertyGridSubItemA) = #True
SetGadgetItemAttribute(GetPropertyGridSubItemDescriptionGadget(*PropertyGridSubItemA), -1, #PB_ListIcon_ColumnWidth, width - 62, 0)
EndIf
EndIf
If IsGadget(GetPropertyGridSubItemItemGadget(*PropertyGridSubItemA))
ResizeGadget(GetPropertyGridSubItemItemGadget(*PropertyGridSubItemA), width >> 1 - 19, Index, width >> 1 - 4, GetPropertyGridSubItemItemGadgetHeight(*PropertyGridSubItemA) - 1)
If GetPropertyGridSubItemReduceWidth(*PropertyGridSubItemA) = #True
SetGadgetItemAttribute(GetPropertyGridSubItemItemGadget(*PropertyGridSubItemA), -1, #PB_ListIcon_ColumnWidth, width >> 1 - 39, 0)
EndIf
EndIf
CompilerCase #PB_OS_Linux
If GetPropertyGridSubItemItemGadget(*PropertyGridSubItemA) <> -1
ResizeGadget(GetPropertyGridSubItemDescriptionGadget(*PropertyGridSubItemA), 20, Index - 12, width >> 1 - 40, GetPropertyGridSubItemDescriptionGadgetHeight(*PropertyGridSubItemA) - 1)
Else
ResizeGadget(GetPropertyGridSubItemDescriptionGadget(*PropertyGridSubItemA), 20, Index - 12, width - 42, GetPropertyGridSubItemDescriptionGadgetHeight(*PropertyGridSubItemA) - 1)
If GetPropertyGridSubItemReduceWidth(*PropertyGridSubItemA) = #True
SetGadgetItemAttribute(GetPropertyGridSubItemDescriptionGadget(*PropertyGridSubItemA), -1, #PB_ListIcon_ColumnWidth, width - 62, 0)
EndIf
EndIf
If IsGadget(GetPropertyGridSubItemItemGadget(*PropertyGridSubItemA))
ResizeGadget(GetPropertyGridSubItemItemGadget(*PropertyGridSubItemA), width >> 1 - 19, Index - 12, width >> 1 - 4, GetPropertyGridSubItemItemGadgetHeight(*PropertyGridSubItemA) - 1)
If GetPropertyGridSubItemReduceWidth(*PropertyGridSubItemA) = #True
SetGadgetItemAttribute(GetPropertyGridSubItemItemGadget(*PropertyGridSubItemA), -1, #PB_ListIcon_ColumnWidth, width >> 1 - 39, 0)
EndIf
EndIf
CompilerCase #PB_OS_MacOS
If GetPropertyGridSubItemItemGadget(*PropertyGridSubItemA) <> -1
ResizeGadget(GetPropertyGridSubItemDescriptionGadget(*PropertyGridSubItemA), 20, Index - 12, width >> 1 - 40, GetPropertyGridSubItemDescriptionGadgetHeight(*PropertyGridSubItemA) - 1)
Else
ResizeGadget(GetPropertyGridSubItemDescriptionGadget(*PropertyGridSubItemA), 20, Index - 12, width - 40, GetPropertyGridSubItemDescriptionGadgetHeight(*PropertyGridSubItemA) - 1)
If GetPropertyGridSubItemReduceWidth(*PropertyGridSubItemA) = #True
SetGadgetItemAttribute(GetPropertyGridSubItemDescriptionGadget(*PropertyGridSubItemA), -1, #PB_ListIcon_ColumnWidth, width - 62, 0)
EndIf
EndIf
If IsGadget(GetPropertyGridSubItemItemGadget(*PropertyGridSubItemA))
ResizeGadget(GetPropertyGridSubItemItemGadget(*PropertyGridSubItemA), width >> 1 - 19, Index - 12, width >> 1 - 4, GetPropertyGridSubItemItemGadgetHeight(*PropertyGridSubItemA) - 1)
If GetPropertyGridSubItemReduceWidth(*PropertyGridSubItemA) = #True
SetGadgetItemAttribute(GetPropertyGridSubItemItemGadget(*PropertyGridSubItemA), -1, #PB_ListIcon_ColumnWidth, width >> 1 - 39, 0)
EndIf
EndIf
CompilerEndSelect
EndProcedure
In fact the TextGadget() it's self can't deal the multi-line text automatically. The best I can do is overriding the default gadget height by putting a different value for the fourth parameter of this procedure :Andre wrote:- if there is any possibility: let me adjust the height of the section title (TextGadget), so that I'm able to display a multi-line text as title string
Code: Select all
AddPropertyGridTextGadget(PropertyGridID, SectionNo, Description.s = "", Flags = 0, P_ItemGadgetHeight = #PropertyGrid_DefaultItemHeight)
It's the next step in the development but it will take a while because will become very busy in the coming days.Andre wrote:- provide a function able to expand PropertyGridSections (specific section as well all at once)
- provide a function able to collapse PropertyGridSections (specific section as well all -opened- at once)
Best regards
Guimauve
Dear Optimist, Pessimist,
and Realist,
While you guys were
busy arguing about the
glass of water, I DRANK IT !
Sincerely,
the Opportunist
and Realist,
While you guys were
busy arguing about the
glass of water, I DRANK IT !
Sincerely,
the Opportunist
- Andre
- PureBasic Team
- Posts: 2137
- Joined: Fri Apr 25, 2003 6:14 pm
- Location: Germany (Saxony, Deutscheinsiedel)
- Contact:
Re: Simple PropertyGrid
Hi Guimauve,
the changed code is now setting the space at the bottom of each section, but removes the spaces at top of each section (first gadget immediately is below the section title). See the new screenshot in comparison to the previous one:

About setting a greater height for the section title I can image another optional parameter to the related procedure, like this:
Then I could calculate the needed height (of the text to display as "section title") myself before, and (if needed) pass a greater value at creating the section....
Inside the section I already use the AddPropertyGridTextGadget() function with its optional height parameter to adjust the TextGadget to a greater height if needed.
the changed code is now setting the space at the bottom of each section, but removes the spaces at top of each section (first gadget immediately is below the section title). See the new screenshot in comparison to the previous one:

About setting a greater height for the section title I can image another optional parameter to the related procedure, like this:
Code: Select all
AddPropertyGridSection(PropertyGridID, SectionName.s, IsOpen.b = #True, SectionTitleHeight = #PropertyGrid_DefaultItemHeight)
Inside the section I already use the AddPropertyGridTextGadget() function with its optional height parameter to adjust the TextGadget to a greater height if needed.
Re: Simple PropertyGrid
Hello Andre,
Try with this one :
About the TextGadget() used to display the Section name, will see what I can do. Stay in touch !
Best regards
Guimauve
Try with this one :
Code: Select all
Procedure Private_RelocatePropertyGridSubItem(*PropertyGridSubItemA.PropertyGridSubItem, Index, Width, Height)
CompilerSelect #PB_Compiler_OS
CompilerCase #PB_OS_Windows
If GetPropertyGridSubItemItemGadget(*PropertyGridSubItemA) <> -1
ResizeGadget(GetPropertyGridSubItemDescriptionGadget(*PropertyGridSubItemA), 20, Index, width >> 1 - 40, GetPropertyGridSubItemDescriptionGadgetHeight(*PropertyGridSubItemA) - 1)
Else
ResizeGadget(GetPropertyGridSubItemDescriptionGadget(*PropertyGridSubItemA), 20, Index, width - 42, GetPropertyGridSubItemDescriptionGadgetHeight(*PropertyGridSubItemA) - 1)
If GetPropertyGridSubItemReduceWidth(*PropertyGridSubItemA) = #True
SetGadgetItemAttribute(GetPropertyGridSubItemDescriptionGadget(*PropertyGridSubItemA), -1, #PB_ListIcon_ColumnWidth, width - 62, 0)
EndIf
EndIf
If IsGadget(GetPropertyGridSubItemItemGadget(*PropertyGridSubItemA))
ResizeGadget(GetPropertyGridSubItemItemGadget(*PropertyGridSubItemA), width >> 1 - 19, Index, width >> 1 - 4, GetPropertyGridSubItemItemGadgetHeight(*PropertyGridSubItemA) - 1)
If GetPropertyGridSubItemReduceWidth(*PropertyGridSubItemA) = #True
SetGadgetItemAttribute(GetPropertyGridSubItemItemGadget(*PropertyGridSubItemA), -1, #PB_ListIcon_ColumnWidth, width >> 1 - 39, 0)
EndIf
EndIf
CompilerCase #PB_OS_Linux
If GetPropertyGridSubItemItemGadget(*PropertyGridSubItemA) <> -1
ResizeGadget(GetPropertyGridSubItemDescriptionGadget(*PropertyGridSubItemA), 20, Index - 12, width >> 1 - 40, GetPropertyGridSubItemDescriptionGadgetHeight(*PropertyGridSubItemA) - 1)
Else
ResizeGadget(GetPropertyGridSubItemDescriptionGadget(*PropertyGridSubItemA), 20, Index - 12, width - 42, GetPropertyGridSubItemDescriptionGadgetHeight(*PropertyGridSubItemA) - 1)
If GetPropertyGridSubItemReduceWidth(*PropertyGridSubItemA) = #True
SetGadgetItemAttribute(GetPropertyGridSubItemDescriptionGadget(*PropertyGridSubItemA), -1, #PB_ListIcon_ColumnWidth, width - 62, 0)
EndIf
EndIf
If IsGadget(GetPropertyGridSubItemItemGadget(*PropertyGridSubItemA))
ResizeGadget(GetPropertyGridSubItemItemGadget(*PropertyGridSubItemA), width >> 1 - 19, Index - 12, width >> 1 - 4, GetPropertyGridSubItemItemGadgetHeight(*PropertyGridSubItemA) - 1)
If GetPropertyGridSubItemReduceWidth(*PropertyGridSubItemA) = #True
SetGadgetItemAttribute(GetPropertyGridSubItemItemGadget(*PropertyGridSubItemA), -1, #PB_ListIcon_ColumnWidth, width >> 1 - 39, 0)
EndIf
EndIf
CompilerCase #PB_OS_MacOS
If GetPropertyGridSubItemItemGadget(*PropertyGridSubItemA) <> -1
ResizeGadget(GetPropertyGridSubItemDescriptionGadget(*PropertyGridSubItemA), 20, Index - 6, width >> 1 - 40, GetPropertyGridSubItemDescriptionGadgetHeight(*PropertyGridSubItemA) - 1)
Else
ResizeGadget(GetPropertyGridSubItemDescriptionGadget(*PropertyGridSubItemA), 20, Index - 6, width - 40, GetPropertyGridSubItemDescriptionGadgetHeight(*PropertyGridSubItemA) - 1)
If GetPropertyGridSubItemReduceWidth(*PropertyGridSubItemA) = #True
SetGadgetItemAttribute(GetPropertyGridSubItemDescriptionGadget(*PropertyGridSubItemA), -1, #PB_ListIcon_ColumnWidth, width - 62, 0)
EndIf
EndIf
If IsGadget(GetPropertyGridSubItemItemGadget(*PropertyGridSubItemA))
ResizeGadget(GetPropertyGridSubItemItemGadget(*PropertyGridSubItemA), width >> 1 - 19, Index - 6, width >> 1 - 4, GetPropertyGridSubItemItemGadgetHeight(*PropertyGridSubItemA) - 1)
If GetPropertyGridSubItemReduceWidth(*PropertyGridSubItemA) = #True
SetGadgetItemAttribute(GetPropertyGridSubItemItemGadget(*PropertyGridSubItemA), -1, #PB_ListIcon_ColumnWidth, width >> 1 - 39, 0)
EndIf
EndIf
CompilerEndSelect
EndProcedure
Best regards
Guimauve
Dear Optimist, Pessimist,
and Realist,
While you guys were
busy arguing about the
glass of water, I DRANK IT !
Sincerely,
the Opportunist
and Realist,
While you guys were
busy arguing about the
glass of water, I DRANK IT !
Sincerely,
the Opportunist
- Andre
- PureBasic Team
- Posts: 2137
- Joined: Fri Apr 25, 2003 6:14 pm
- Location: Germany (Saxony, Deutscheinsiedel)
- Contact:
Re: Simple PropertyGrid
Thanks Guimauve! 
This newest update of the Private_RelocatePropertyGridSubItem() procedure works now like I would: there is some space at top and at bottom of each (opened) section.


This newest update of the Private_RelocatePropertyGridSubItem() procedure works now like I would: there is some space at top and at bottom of each (opened) section.
ThanksGuimauve wrote:About the TextGadget() used to display the Section name, will see what I can do. Stay in touch !
