The cWebMenuBar class is used as a wrapper for your web application's menu. The menu bar is designed to host and group your pull-down menus into a bar located in the command bar area of your web application.
A menu bar should be located inside your application's command bar object (see cWebCommandbar). A command bar will contain, at most, one menu bar object (cWebMenuBar) and any number of toolbars (cWebToolBar). Menu bars and toolbars are, in turn, constructed from nested menu item objects (cWebMenuItem).
Object oMenuBar is a cWebMenuBar Object oFileMenu is a cWebMenuItem Set psCaption to "File" Object oClearMenuItem is a cWebMenuClear End_Object Object oSaveMenuItem is a cWebMenuSave End_Object Object oDeleteMenuItem is a cWebMenuDelete End_Object Object oLoginMenuItem is a cWebMenuItem Set psCaption to "Log In" Set pbBeginGroup to True Procedure OnClick Send RequestLogin to ghoWebSessionManager End_Procedure End_Object End_Object Object oViewMenu is a cWebMenuItem Set psCaption to "Views" Object oCustomerMenuItem is a cWebMenuItemLoadView Set psCaption to "Customer Maintenance" Set psLoadViewOnClick to "oCustomers" End_Object Object oOrderMenuItem is a cWebMenuItemLoadView Set psCaption to "Order Entry" Set psLoadViewOnClick to "oOrders" End_Object End_Object Object oThemesMenu is a cWebMenuItem Set psCaption to "Themes" Object oModernSky is a cWebMenuItem Set psCaption to "Modern Sky" Procedure OnClick WebSet psTheme of oWebApp to "Vdf_Modern_Sky" End_Procedure End_Object End_Object End_Object
The above sample demonstrates a menu bar (cWebMenuBar) containing three pull-down menus: "File", "View" and "Theme". Each pull-down menu object and the menu items it contains are implemented by nested menu item objects (cWebMenuItem).
In some cases special subclasses of cWebMenuItem are used, for example cWebMenuSave. These subclasses are pre-fabricated to perform a single task (in this case request the focused view to save a record).
The Web Framework uniquely identifies each web object via a combination of the object hierarchy (object nesting), and object name. This means that web object names must be unique within their parent (i.e. each sibling web object must have a unique name).
Your cWebMenuBar object must be placed within a command bar object (cWebCommandBar).