Class: cWebMenuBar

Properties  Events  Methods    Index of Classes

The Web Framework menu bar container



Library: Web Application Class Library

Package: cWebMenuBar.pkg

Mixins: cWebBaseMenu_mixin


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
        Object oSaveMenuItem is a cWebMenuSave
        Object oDeleteMenuItem is a cWebMenuDelete
        Object oLoginMenuItem is a cWebMenuItem
            Set psCaption to "Log In"
            Set pbBeginGroup to True

            Procedure OnClick
                Send RequestLogin to ghoWebSessionManager

    Object oViewMenu is a cWebMenuItem
        Set psCaption to "Views"
        Object oCustomerMenuItem is a cWebMenuItemLoadView
            Set psCaption to "Customer Maintenance"
            Set psLoadViewOnClick to "oCustomers"
        Object oOrderMenuItem is a cWebMenuItemLoadView
            Set psCaption to "Order Entry"
            Set psLoadViewOnClick to "oOrders"
    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"

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).

Object Name

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).

Object Placement

Your cWebMenuBar object must be placed within a command bar object (cWebCommandBar).

Drag and Drop Support

This control can be used as a valid drop target by registering it as such in a cWebDragDropHelper object.

The supported actions for this control are:
- C_WebDropOnControl

This allows the control to accept data dragged from elsewhere in the control (if configured that way) and can also be used to accept files when registered within a cWebDragDropFileHelper.