Using Menus, Toolbars and Statusbars

Commandbar Systems

The “commandbar system” is a series of objects that creates a menubar, toolbar, statusbar and context menu environment. The underlying technology for the commandbar system is Codejock Software’s COM Xtreme CommandBars package. These COM classes have been imported using the DataFlex Import Active/x functionality. An additional layer of classes was created to wrap the imported COM classes. This was done to meet the following objectives:

The cCJCommandBarSystem class is used to create a commandbar system. A commandbar system consists of a combination of a menubar, any number of toolbars, a statusbar, and any number of context menus. The commandbar system manages all of these components to ensure that they act and behave in a consistent manner. With the exception of context menus, all other commandbar system components will be nested within the commandbar system.

Menubars, toolbars and context menus all contain “menu item” objects. These are all based on the same class and they can be used interchangeably within menubars, toolbars and context menus. Statusbars contain statusbar pane objects.

Classes

The commandbar system classes are:

Object Structures

A typical object structure of a commandbar system is:

Object oCommandBar is a cCJCommandBarSystem

 

    Object oMenuBar is a cCJMenuBar

        {cCJMenuItem objects…}

    End_Object

 

    Object oToolBar_1 is a cCJToolBar

        {cCJMenuItem objects…}

    End_Object

 

    :

 

    Object oToolBar_n is a cCJToolBar

        {cCJMenuItem objects…}

    End_Object

 

    Object oStatusBar is a cCJStatusBar

        {cCJStatusbarPane objects…}

    End_Object

 

    Object oDesignerMenu is a cCJDesignerMenu

        {cCJMenuItem objects…}

    End_Object

 

End_Object

 

Object oContextMenu_1 is a cCJContextMenu

    {cCJMenuItem objects…}

End_Object

 

:

 

Object oContextMenu_n is a cCJContextMenu

    {cCJMenuItem objects…}

End_Object

Context menus will normally not be placed inside of the commandbar system, they can be placed anywhere else. They will usually be defined near or inside the object that uses it, or out at the desktop level so that all objects may use it.

The {cCJMenuItem objects…} are sets of sibling cCJMenuItem objects. If a cCJMenuItem object is a popup item, it will contain its own set of object {cCJMenuItem objects…}.

The  {cCJStatusbarPane objects…} are sets of sibling cCJStatusbarPane objects.

Commandbar System Object

 

Object oCommandBarSystem is a cCJCommandBarSystem

 

    Object oMenuBar is a cCJMenuBar

        :    

    End_Object

 

    Object oFindToolBar is a cCJToolbar

        :    

    End_Object

        

    Object oFileToolBar is a cCJToolbar

        :    

    End_Object

 

    Object oEditToolBar is a cCJToolbar

        :

    End_Object

    

    Object oStatusBar is a cCJStatusBar

        :

    End_Object

 

    Object oDesignerMenu is a cCJDesignerMenu

        :

    End_Object

 

End_Object

 

Expanded Menubar Branch

 

Object oMenuBar is a cCJMenuBar

    

    Object oFileMenu is a cCJMenuItem

        Set peControlType to xtpControlPopup          

        Set psCaption to "&File"

        :

    End_Object

    

    Object oFindMenu is a cCJMenuItem

        Set peControlType to xtpControlPopup          

        Set psCaption to "&Find"

        :

    End_Object

    

    Object oViewMenu is a cCJMenuItem

        Set peControlType to xtpControlPopup

        Set psCaption to "&View"

        :

    End_Object

    

    Object oReportMenu is a cCJMenuItem

        Set peControlType to xtpControlPopup

        Set psCaption to "&Report"

        :

    End_Object

  

    Object oNavigateMenu is a cCJMenuItem

        Set peControlType to xtpControlPopup      

        Set psCaption to "&Navigate"    

        :

    End_Object

 

    Object oWindowMenu is a cCJMDIWindowsMenuItem

        Set peControlType to xtpControlPopup      

        Set psCaption to "&Window"

        :

    End_Object

    

    Object oHelpMenu is a cCJMenuItem

        Set peControlType to xtpControlPopup    

        Set psCaption to "&Help"

        :

    End_Object

 

End_Object

 

Expanded “Find” Menubar Branch

In this example all of the menu item classes are sub-classes of cCJMenuItem.

Object oFindMenu is a cCJMenuItem

    Set peControlType to xtpControlPopup          

    Set psCaption to "&Find"

 

    Object oFindFirstTool is a cCJFindFirstMenuItem

    End_Object

 

    Object oFindPreviousTool is a cCJFindPreviousMenuItem

    End_Object

 

    Object oFindMenuTool is a cCJFindMenuItem

    End_Object

 

    Object oFindNextTool is a cCJFindNextMenuItem

    End_Object

 

    Object oFindLastTool is a cCJFindLastMenuItem

    End_Object

 

    Object oPromptToolItem is a cCJPromptMenuItem

        Set pbControlBeginGroup to True

    End_Object

 

End_Object

 

Expanded “Find” Toolbar Branch

Note that the same menu items can be used interchangeably in toolbars and popup menus.

Object oFindToolBar is a cCJToolbar

    Set psTitle to "Finding Toolbar"

 

    Object oFindFirstTool is a cCJFindFirstMenuItem

    End_Object

 

    Object oFindPreviousTool is a cCJFindPreviousMenuItem

    End_Object

 

    Object oFindMenuTool is a cCJFindMenuItem

    End_Object

 

    Object oFindNextTool is a cCJFindNextMenuItem

    End_Object

 

    Object oFindLastTool is a cCJFindLastMenuItem

    End_Object

 

    Object oPromptToolItem is a cCJPromptMenuItem

        Set pbControlBeginGroup to True

    End_Object

 

End_Object

 

Expanded Statusbar Object

 

Object oStatusBar is a cCJStatusBar

    

    Object oStatusIdle is a cCJStatusBarPane

        Set piId to sbpIDIdlePane

        Set pbStyleStretch to True

    End_Object

 

    Object oStatusView is a cCJStatusBarPane

        Set phoViewPane to Self

        Set pbStyleStretch to True

    End_Object

    

    Object oStatusCaps is a cCJStatusBarPane

        Set piId to sbpIDCapslock

    End_Object

 

End_Object

 

Context Menu Object

 

Object oEditContextMenu is a cCJContextMenu

    

    Object oUndoMenuItem is a cCJUndoMenuItem

    End_Object

    

    Object oCutMenuItem is a cCJCutMenuItem

        Set pbControlBeginGroup to True

    End_Object

    

    Object oCopyMenuItem is a cCJCopyMenuItem

    End_Object

 

    Object oPasteMenuItem is a cCJPasteMenuItem

    End_Object

 

    Object oDeleteItem is a cCJDeleteEditMenuItem

    End_Object

 

    Object oSelectAllMenuItem is a cCJSelectAllMenuItem

        Set pbControlBeginGroup to True

    End_Object

 

End_Object

 

See Also

Visual Modeling

Commandbar System Attributes

Customizing a Layout

Saving and Restoring a Layout

Automatic Refresh

MDI Main Commandbar System

Non-MDI Commandbar Systems

Context Menus

The Commandbar System COM Creation Process

Menu Items

Combos, Edits and other Complex Controls

Creating Dynamic Menu items

The Additional Codejock Interfaces and Classes

Commandbar System IDs

Images and Imagelists

Windows DPI Scaling and Icon Support

Tabbed Workspace Interface