AddGadgetItem()
Syntax
Result = AddGadgetItem(#Gadget, Position, Text$ [, ImageID [, Flags]])Description
Add an item to the specified #Gadget. An optional ImageID() can be specified for any gadgets which support it (like ListIconGadget()). 'Result' is only supported in combination with MDIGadget() (see below).
The following gadgets are supported:
- ComboBoxGadget()
- EditorGadget()
- ListIconGadget() : supports the ImageID. The image must be in the standard 16x16 icon size.
- ListViewGadget()
- MDIGadget() : ImageID can contain an icon for the childwindow titlebar. Flags can specify the new window flags.
- PanelGadget() : supports the ImageID.
- TreeGadget() : supports the ImageID. The image must be in the standard 16x16 icon size. 'Flags' is required and specifies the new sublevel.
The position specifies the item index where the new item should be inserted. To add the item at the start, use an index of 0. To add this item to the end of the current item list, use a value of -1. Remember that when you add an item that all current items which come after the new one will have their positions increased by 1.
For the MDIGadget() the 'Position' parameter specifies the #Window number for the new MDI childwindow. #PB_Any can be used, in which case the returnvalue will be the new number assigned by PB. The 'Flags' parameter can be used to specifiy the flags for the new window (see OpenWindow()). The #PB_Window_Borderless, #PB_Window_Screencentered and #PB_Window_WindowCentered flags are not supported for MDI windows.
For the TreeGadget() the 'Flags' parameter is always required. It specifies the new sublevel for the item. If the sublevel is greater than that of the previous item, the new one will become this item's child. If it is lower, it will be added after the parent of the previous item.
Supported OS
All