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
To fix this problem we will have to proceed by trial and error. On Linux the PropertyGrid look like :
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
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
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 :
Code: Select all
AddPropertyGridTextGadget(PropertyGridID, SectionNo, Description.s = "", Flags = 0, P_ItemGadgetHeight = #PropertyGrid_DefaultItemHeight)
By default the height value is 20 pixel for Windows, 30 for Linux and 25 for MacOS, but you can put any value to fit your needs, the gadgets will be relocated according to their specified heights. The TextGadget() don't adjust it's height automatically in the multi-line text case. In contrary, the ImageGadget() adjust it's size when the Image size are different of the gadget size. We should ask Fred and/or Freak about this behaviour.
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)
It's the next step in the development but it will take a while because will become very busy in the coming days.
Best regards
Guimauve