
I'm currently trying, if it makes sense to use it in my application. This way I came across a question: are the currently supported gadget types the only ones, which are usually included in the properties section?
Or would it be also (easily) possible to support further gadget types?
I have added a procedure for adding a listicon to a properties section. This is easy enough to do, but the problem is: it's also displayed only with "one line" (= the same gadget height than the other ones), but it should be displayed with an adjustable height (at least several the height of one current gadget).
Can this be done with the current code, or does it need a complete rework to support this?
This is what I've added at the moment:
1) Function for adding a listicon:
Code: Select all
Procedure AddPropertyGridListIconGadget(PropertyGridID, SectionNo, Description.s = "", Title.s = "", TitleWidth = 100, Flags = 0)
*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)), StringGadget(#PB_Any, 0, 0, 0, 0, Description, #PB_String_ReadOnly))
SetPropertyGridSubItemItemGadget(GetPropertyGridItemSubItems(GetPropertyGridDataItems(*PropertyGridDataA)), ListIconGadget(#PB_Any, 0, 0, 0, 100, Title, TitleWidth, Flags)) ; <= height of 100 is ignored by the properties section!
CloseGadgetList()
EndIf
EndIf
Private_Update_PropertyGrid(PropertyGridID)
EndIf
EndProcedure
Code: Select all
....
AddPropertyGridProgressBarGadget(#PropertyGrid, SectionID, "ProgressBar")
AddPropertyGridListIconGadget(#PropertyGrid, SectionID, "ListIcon", "Column 1")
SetPropertyGridSectionItemGadgetState(#PropertyGrid, SectionID, 0, 1)
; Add items to the combobox (GadgetID = 2):
AddPropertyGridGadgetItems(#PropertyGrid, SectionID, 2, 0, "ComboBox Item 0")
AddPropertyGridGadgetItems(#PropertyGrid, SectionID, 2, 1, "ComboBox Item 1")
AddPropertyGridGadgetItems(#PropertyGrid, SectionID, 2, 2, "ComboBox Item 2")
AddPropertyGridGadgetItems(#PropertyGrid, SectionID, 2, 3, "ComboBox Item 3")
; Add items to the listicon (GadgetID = 7):
AddPropertyGridGadgetItems(#PropertyGrid, SectionID, 7, 0, "ListIcon Item 0")
AddPropertyGridGadgetItems(#PropertyGrid, SectionID, 7, 1, "ListIcon Item 1")
AddPropertyGridGadgetItems(#PropertyGrid, SectionID, 7, 2, "ListIcon Item 2")
.....