Class: cCJMenuBar
Properties | Events | Methods | Index of Classes
Used to create a menubar within a commandbar system
Hierarchy
cObject > DfComAutomationObject > cComAutomationObject > cCJCommandBar > cCJAbstractCommandBar > cCJMenuBar
Show full hierarchy and direct subclasses
Library: Windows Application Class Library
Package: cCJCommandBarSystem.pkg
Description
The cCJMenubar class is used to create a menubar within a commandbar system. Only one menubar is allowed within a commandbar system and this object is usually the first child object within the cCJCommandbarSystem object. The menu items within the menubar will based on cCJMenuItem.
Object oCommandbarSystem is a cCJCommandBarSystem
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
:
End_Object
| Col 1 | Col 2 |
|---|---|
| Note: | For an overview on the commandbar system, refer to Using Menus, Toolbars and Statusbars |
Default Menubar Characteristics
By default a menubar will have the following characteristics: It will be the first horizontal bar (peBarPosition=xtpBarTop)It cannot be moved and docked (pbEnableDocking=False, pbGripper=False)It stretches to take the full panel width and that space cannot be shared with other toolbars (peStretched=stStretch)It cannot be closed (pbCloseable=False)It cannot be edited (pbCustomizable=False)When needed, it wraps to the next line (pbHideWrap=False)
The Menubar Creation Process
When the commandbar system is created, the message CreateComInstance is sent to the cCJMenuBar object. This method is used to:
- Create the COM menubar.
- Send the appropriate COM messages.
- Send the OnCreate event. This can be used by developers to customize the creation process
- Create all child menu objects by sending CreateComInstance to all child objects.
Once the COM object is created, it remains statically bound to its cCJMenubar proxy object.
See Also