Older Newer
Thu, 12 Dec 2019 09:10:02 . . . . SyneRyder [Add example, return value and See Also links]


Changes by last author:

Added:
= createPopupMenu =

== Syntax ==

int createPopupMenu();

== Return ==

A pointer to the created menu object.

== Description ==

Creates a new popup menu.

== Comment ==

You'll need to use insertMenuItem to add menu items and trackPopupMenu to display it. Afterward using the menu, you must destroy it using destroyMenu.

== Example ==

<code>

%ffp

ctl[0]: PUSHBUTTON, "Click Me!"

OnCtl(n): {

if (n==0 && e == FME_CLICKED){

int menu=0;

menu = createPopupMenu();

insertMenuItem(menu, 1, "Do This",MFS_ENABLED , NULL);

insertMenuItem(menu, 2, "Do That",MFS_ENABLED | MFS_DEFAULT, NULL);

insertMenuItem(menu, 3, "Do Nothing",MFS_ENABLED, NULL);

Info("Selection: %d", trackPopupMenu (menu, 1, 0,0,0) );

destroyMenu(menu);

}

return false;

}

</code>

== See Also ==

insertMenuItem, trackPopupMenu, destroyMenu