Context Menus
The Visual Designer models context menu objects separately from any other visual objects that are modeled in the same file. For example, if you have a View component containing a context menu, then the Visual Designer will model the View while any object belonging to the View is selected. However, the Visual Designer will switch to modeling the context menu when any object containing the context menu is selected.
To switch the Visual Designer over to modeling a context menu, select it (or one of its child objects) in the Code Explorer. Whatever was being modeled in the Visual Designer previously will be replaced by a representation of the selected context menu. To switch back, simply select an object belonging to the original view in the Code Explorer.
The Visual Designer supports multiple context menu objects per file. Context menus may be declared outside any other object or inside a View or some other object. Only one context menu can be modeled at a time.
Creating a Context Menu
To create a context menu, use the Class Palette to drag and drop a cCJContextMenu class onto the Visual Designer canvas.
- The context menu will be created in whatever container object you drop it. For example, if you drop a context menu on a tab page of a tab dialog, it is created in that tab page.
- To create a context menu outside any other object, drop it into the white client area of the Visual Designer. For example, if you are modeling a View, then you can drop it to the white area outside the
dbViewobject in the Visual Designer. - If the file that you are editing does not have any visually modeled objects, then first create a Visual Designer canvas for the file by opening the Visual Designer View. See View Menu for more information.
Editing a Context Menu
Once created, a context menu may be edited in the Visual Designer just like a normal menu. For more information, refer to the help on visually modeling menus.