Skip to content

Customizing a Layout

The end user can customize the layout of a command bar system. At the most basic level, a user can dock toolbars to the top, bottom, left, and right sides of the panel or create floating menus. They can arrange toolbars in any order they wish and choose to hide any toolbar. By default, all of these options are enabled for toolbars and disabled in menu bars. Properties exist to change any of these defaults (see pbEnableDocking, pbGripper, pbCloseable, pbVisible).

In addition, users can customize the contents of the menus. A customize option exists that allows users to:

  • Move, copy, and delete existing menu and toolbar items
  • Create new toolbars
  • Add new menu items from a customize popup dialog

Menu customization is enabled by setting the pbEnableCustomization property to true. When enabled, a user may enter customize mode by right-clicking in a menu bar or toolbar and selecting “Customize” from the context menu. A customize dialog will appear, and the menu system will be in customize mode. Be careful about enabling full menu customization and what kind of customization is allowed. By default, the classes tend to be more restrictive about the menu bar, disallowing hiding, moving, and modifying, while toolbars are more relaxed about this.

While in customize mode, the user can move menu items to the popup menu or toolbar of their choice by selecting a menu item and dragging it to another location. They can copy menu items by dragging the item while holding down the Ctrl key. Menu items are deleted by dragging them off of the menu. Properties exist to disable this kind of customization at the menu bar and toolbar level (pbCustomizable). By default, toolbars enable customization while menu bars do not. Customization can also be disabled at the individual menu item level (pbControlFlagNoMovable).

The customize dialog is used to create new toolbars and to add new menus to a toolbar or menu. The “Commands” tab page in this dialog will contain a list of designer menu items that can be added to your menus. These designer menu items are placed in the customize dialog by creating cCJMenuItem objects within the cCJDesignerMenu object, or by setting any cCJMenuItem’s pbAddToDesignerMenu property to true.

The customize dialog and the customization behaviors are a standard part of the Codejock command bar system.

The RestoreLayout method can be called to restore a command bar system back to its initial design-time layout. A menu item object based on the cCJRestoreMenusMenuItem class object can be added that allows the user to perform this restore. This is useful if they find they need to undo some of the benefits of their customization.

Special Note

By default, end user customization is disabled.

See Also