popupMenu

User Interface Controls > Common Properties > Layout > Types > PopupMenu

 

   

Creating User Interfaces - Quick Navigation

A popup menu is a custom right-click menu (RCMenu) that can be displayed anywhere on screen.

The syntax is:

PopupMenu <RCMenu> [pos:<Point2>] [rollout:<Rollout>] [align:<key>] 	 

This method will popup a menu anywhere on the screen.

<RCMenu> : Any RCMenu defined. It does not have to be registered.

[pos:<Point2>] : The point where to put the menu up, either relative to the Rollout or the screen. (Default:popup from current mouse position.)

[rollout:<Rollout>] : This will make the menu popup from a rollouts local coordinate system. Specifying undefined will popup the menu relative to the upper left corner of the screen. (Default:undefined)

[align:<key>] : Can be one of the following (default: #align_topleft ):

#align_topleft #align_topcenter #align_topright #align_bottomleft #align_bottomcenter #align_bottomright #align_vcenterleft #align_vcentercenter #align_vcenterright 

NOTE:The scope of execution can affect the timing of popupMenu() evaluation. It calls an external win32 function that gets evaluated after the local scope in which popupMenu() is called is finished. This means that code following popupMenu() can execute before the menu appears, if it is in the same scope. To prevent this behavior, you can add a call to windows.processPostedMessages() immediately following popupMenu() to force it to execute in order.

See Also