%HI_PopUpMenu_AddItem( INT in type, TEXT in text, INT in itemId, INT in parentId [, BOOL in bEnabled, BOOL in bChecked, HBJ in bitmapHBJ, HBJ in bitmapCheckedHBJ, TEXT in tooltip] )
type | Item type. Possible values:
|
text | Item text. |
itemId | Unique identifier. |
parentId | Unique identifier of the parent popup menu (popup menu one level above). |
bEnabled | Enable/disable the item. |
bChecked | Select/unselect the item. |
bitmapHBJ | Object of Bitmap type. |
bitmapCheckedHBJ | Object of Bitmap type. |
tooltip | Menu item tooltip. |
The parameter type defines the type of the item to be inserted. For each item (except Menu separator type), there must be defined an unique identifier (the parameter id) within defined menu (that compounds of all defined popup menus). If the item is inserted into a nested popup menu (e.g. the item "Text 1.1" in the figure above), the parameter parentId contains id of the item in the parent popup menu:
; definition of the item "Text 2"
%HI_PopUpMenu_AddItem(1, "Text 2", 2, 0, @TRUE, @FALSE, 0, 0)
; definition of the item "Text 2.1"
%HI_PopUpMenu_AddItem(0, "Text 2.1", 21, 2, @TRUE, @FALSE, 0, 0)
The parameter bEnabled enables (the value @TRUE), or disables (the value @FALSE) the item. In the figure above, the item "Text 2.2.2".
The parameter bChecked selects (the value @TRUE) the item. In the figure above, the item "Text 2.2.1".
The parameters bitmapHBJ and bitmapCheckedHBJ are the reference to objects of Bitmap type, that will be used (if are defined) if the item is selected (checked), or is not selected (unchecked).
In script, items defined by the function %HI_PopUpMenu_AddItem may not be organized as they will be displayed in the popup menu - they will be automatically organized before showing the menu.
Regulations:
; create an empty popup menu
%HI_PopUpMenu_Create(300,300)
%HI_PopUpMenu_AddItem(0, "Text 1", 1, 0, @TRUE, @FALSE, 0, 0) %HI_PopUpMenu_AddItem(1, "Text 2", 2, 0, @TRUE, @FALSE, 0, Bitmapa.BMP\HBJ)
%HI_PopUpMenu_AddItem(0, "Text 2.1", 21, 2, @TRUE, @FALSE, 0, 0)
%HI_PopUpMenu_AddItem(0, "Text 2.1.1", 211, 21, @TRUE, @FALSE, 0, 0)
%HI_PopUpMenu_AddItem(0, "Text 2.1.2", 212, 21, @TRUE, @FALSE, 0, 0)
%HI_PopUpMenu_AddItem(1, "Text 2.2", 22, 2, @TRUE, @FALSE, 0, 0)
%HI_PopUpMenu_AddItem(0, "Text 2.2.1", 221, 22, @TRUE, @TRUE, 0, 0) %HI_PopUpMenu_AddItem(0, "Text 2.2.2", 222, 22, @FALSE, @FALSE, 0, 0,)
%HI_PopUpMenu_AddItem(0, "Text 2.3", 23, 2, @TRUE, @FALSE, 0, 0)
%HI_PopUpMenu_AddItem(2, "Text 3", 3, 0, @TRUE, @FALSE, 0, 0) %HI_PopUpMenu_AddItem(0, "Text 4", 4, 0, @TRUE, @FALSE, 0, 0)
; show popup menu %HI_PopUpMenu_Show()
Pridať komentár