Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
web:contextmenu [2018/11/01 16:54]
agcyphers [Methods]
web:contextmenu [2018/11/01 16:58]
agcyphers [Examples]
Line 43: Line 43:
 === Styles === === Styles ===
 GraffitiWebContextMenuItems have a Style property, to which you can assign a WebStyle. If this is the top-level item used in the AddMenu call, then that style is used to style the backdrop of the contextmenu and all sub-menus. If it is an item within the top-level or sub- menu, then it is used to style the individual item. GraffitiWebContextMenuItems have a Style property, to which you can assign a WebStyle. If this is the top-level item used in the AddMenu call, then that style is used to style the backdrop of the contextmenu and all sub-menus. If it is an item within the top-level or sub- menu, then it is used to style the individual item.
 +
 +=== Unbound Menus ===
 +To create an unbound menu (one which is not attached to a control), you simply call the AddMenu overloaded method:
 +<code xojo>dim unattachedMenu as new GraffitiWebContextMenuItem( "​unattachedMenu"​ )
 +unattachedMenu.Children.Append( new GraffitiWebContextMenuItem( "​unattached1",​ "Item 1" ) )
 +unattachedMenu.Children.Append( new GraffitiWebContextMenuItem( "​unattached2",​ "Item 2" ) )
 +gwcmDemo.AddMenu( "​unattachedMenu",​ unattachedMenu )
 +</​code>​
 +
 +And to show this menu:
 +<code xojo>​gwcmDemo.ShowMenu( "​unattachedMenu"​ )</​code>​