Skip to content

Class: cCJCommandBarSystem

Properties | Events | Methods | Index of Classes

The main class used to create and manage a menu, toolbar, statusbar system.

Hierarchy

Library: Windows Application Class Library
Package: cCJCommandBarSystem.pkg

Description

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.

The following provides a short introduction to the commandbar system classes. You should refer to the Using Menus, Toolbars and Statusbars for a complete overview of the commandbar system. The Class Reference will provide you with syntactical and usage information about the commandbar system classes.

The Commandbar System Classes

The classes that comprise a commandbar system are:

The cCJCommandBarSystem Class

The cCJCommandBarSystem is used to create the object that manages a commandbar system. It is a subclass of the imported ActiveX class cCJCommandBars. It significantly extends this class, making it much easier to model and build menu systems.

cCJCommandBarSystem properties determine how the entire system will look and behave. A few of these settings are:

The OnCreateCommandBars event is provided to allow you to further customize any of the COM options supported by a commandbar system.

The structure of the child menubar, toolbar, and statusbar objects and their children determines the initial layout of your system. An outline of a commandbar system object structure 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.

The Commandbar System Object Structure

Below is an object outline of a cCJCommandBarSystem object and its children - menubars (cCJMenuBar), toolbars (cCJToolbar), and statusbars (cCJStatusbar).

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  

The Menubar Object Structure

Below is an expanded outline of the menubar object (cCJMenuBar) and its menu item child objects (cCJMenuItem).

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  

The Popup Menu Object Structure

Below is an example of a popup menu object structure. This is an expansion of the "find" menubar branch of this object. The popup menu object and all of its child menu item objects are based on cCJMenuItem.

In this example, all of the menu item classes are subclasses 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  

The Toolbar Object Structure

Below is an example of a toolbar (cCJToolbar) object. This is an expansion of the "find" toolbar branch of this object. The child objects are all subclasses of the cCJMenuItem class. 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  

The Statusbar Object Structure

Below is an expansion of the statusbar object (cCJStatusbar) and all child statusbar pane objects (cCJStatusBarPane).

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  

The Context Menu Object Structure

Below is an example of a context menu object (cCJContextMenu) and its child menu item objects (cCJMenuItem).

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  

Using a Tabbed Workspace Interface

Tabbed workspace views provide an alternate style to the normal MDI view framework. When used, a workspace tab appears as part of the command bar. As views (dbView) are activated, a new tab is created for the view. The view itself will appear as a tabbed workspace view. This is very similar to how the Studio shows files when using tabbed workspaces.

Set pbTabbedWorkspaces to True in your cCJCommandBarSystem object to enable tabbed workspaces.

See Tabbed Workspace Interfaces for more information about implementing this interface.

Windows DPI Scaling and Icon Support

DataFlex provides support for dots per inch (DPI) scaling of icons used in Codejock Toolbars, Menus, and Context Menus.

Set pbAutoResizeIcons to True in your cCJCommandBarSystem object to implement icon scaling in toolbars and menus.

See Windows DPI Scaling and Icon Support for more information about implementing this.

Refer to the Using Menus, Toolbars and Statusbars section for a more detailed overview of the commandbar system classes.

See Also