Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Mon Jan 23, 2012 12:22 am Post subject: |
|
|
The following script creates a form and then adds a menu and a popupmenu to it.
Code: |
function popupblaclick(sender)
showMessage('Popup bla was clicked')
end
function bla2click(sender)
showMessage('bla2 was clicked')
end
f=createForm()
mmenu=createMainMenu(f)
mmenu_items=menu_getItems(mmenu)
mi=createMenuItem(mmenu)
menuItem_setCaption(mi,'bla')
mi2=createMenuItem(mmenu) --cerate a submenu of bla
menuItem_setCaption(mi2,'bla2')
menuItem_onClick(mi2,bla2click)
menuItem_add(mi, mi2) --add bla2 to bla
menuItem_add(mmenu_items, mi) --add bla and bla->bla2
--this is all that's needed for a main menu
--now the popup menu
pmenu=createPopupMenu(f)
pmenu_items=menu_getItems(pmenu)
mi3=createMenuItem(pmenu)
menuItem_setCaption(mi3,'popup bla')
menuItem_onClick(mi3,popupblaclick)
menuItem_add(pmenu_items, mi3)
control_setPopupMenu(f, pmenu)
|
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|