cObject
---cUIObject
------DfComUIObject
---------DfInPlaceComObject
------------DfComActiveXControl
---------------cComActiveXControl
------------------cCJCommandBars
---------------------cCJCommandBarSystem
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 items 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 classes that comprise a commandbar system are:
Class | Purpose |
---|---|
cCJCommandBarSystem | This controls the commandbar system |
cCJMenuBar | This represents the menubar, normally located at the top of your panel. One menubar is permitted per commandbar system. |
cCJToolbar | This is used to create toolbars. Multiple toolbars are allowed. |
cCJContextMenu | This used to create context menus. |
cCJMenuItem | This is used to create the items within menubars, toolbars and context menus. There are two types of menu items, buttons and popups. Buttons are used for making menu selections such as Save or Exit. Popups are used to pop-up a menu of additional menu items. Popup menu items will contain child cCJMenuItem objects. A menu item's control type (popup, non-popup, button, combo, checkbox, etc.) is determined by a property (peControlType). |
cCJStatusbar | This is used to create the statusbar that appears at the bottom of your frame. |
cCJStatusbarPane | This is used to create pane objects within a statusbar object. |
cCJDesignerMenu | This is used to contain a list of menu items that can be used by the end user to create custom menus. |
The cCJCommandBarSystem is used to create the object that manages a commandbar system. It is a sub-class of the imported active/x cCJCommandBars class. 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 {cCJMenuiItem objects} End_Object Object oToolBar_1 is a cCJToolBar {cCJMenuiItem objects} End_Object : Object oToolBar_n is a cCJToolBar {cCJMenuiItem objects} End_Object Object oStatusBar is a cCJStatusBar {cCJStatusbarPane objects} End_Object Object oDesignerMenu is a cCJDesignerMenu {cCJMenuiItem objects} End_Object End_Object Object oContextMenu_1 is a cCJContextMenu {cCJMenuiItem objects} End_Object : Object oContextMenu_n is a cCJContextMenu {cCJMenuiItem 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.
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
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
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 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
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 sub-classes 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
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
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
Tabbed workspace views provides 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.
DataFlex provides support for dot 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.
Note: | Refer to the Using Menus, Toolbars and Statusbars section for a more detailed overview of the commandbar system classes. |
cCJMenuBar | cCJToolbar | cCJContextMenu | cCJMenuItem | cCJStatusBar | cCJStatusbarPane | cCJDesignerMenu