BCGControlBar Pro for MFC

Detailed Description

The CBCGPToolBar class extends the MFC toolbar control by providing support for a number of features:

  • Full customization
  • High DPI support
  • Visual Theme support
  • Drag and drop buttons between toolbars and menus
  • Large icons support
  • "Pager" button (allows to see out of screen commands)
  • "Locked" toolbars
  • Auto-build keyboard shortcuts names in menus and ToolTips
  • Rebar support
  • Text below images
  • Built-in combo box buttons
  • Built-in edit box buttons
  • Built-in color picker
  • Built-in roll-up buttons (similar to CorelDraw)
  • Microsoft Office look
  • Transparent toolbars with background image

CBCGPToolBar is the base class for several important BCGControlBar Library classes CBCGPMenuBar, CBCGPPopupMenuBar, CBCGPDropDownToolBar.

To incorporate CBCGPToolBar into your application, you need to perform the following steps:

  • Embed a CBCGPToolBar object into the main frame window.
  • When processing WM_CREATE message for the main frame window call either Create() or CreateEx() and specify the desired toolbar styles.
  • Call CBCGPBaseControlBar::EnableDocking and specify the desired docking style.
  • If you need to insert into the toolbar some "non-standard" button (meaning, a CBCGPToolbarButton - derived object, like combo box button), you need to reserve some dummy button at the design time and then replace the dummy button at runtime by the ReplaceButton() function.
    See also
    CBCGPMenuBar
+ Inheritance diagram for CBCGPToolBar:

Public Types

enum  CustomizeButtonStyle
 

Public Member Functions

 AdjustLayoutRecalculates and adjusts the size and location of a toolbar.
 
 AllowChangeTextLabelsReturns nonzero if the toolbar object permits to display text labels below images on the toolbar buttons.
 
 AreTextLabelsTells whether toolbar buttons should display text labels below images.
 
 ButtonToIndexGiven a pointer to CBCGPToolbarButton object returns the button's index.
 
 CanBeClosedReturns nonzero if the toolbar can be closed by the user.
 
 CanBeRestoredReturns nonzero if the application can revert a toolbar to its original state after customization.
 
 CommandToIndexGiven a toolbar button's command ID returns the button's index.
 
 CreateCreates the control bar control and attaches it to a CBCGPToolBar object.
 
 CreateExCreates a CBCGPToolBar object with additional styles.
 
 EnableCustomizeButtonEnables or disables an additional "customize" button on the toolbar.
 
 EnableCustomizeButtonEnables or disables an additional "customize" button on the toolbar.
 
 EnableLargeIconsEnables and disables large icons (images) on toolbar buttons.
 
 EnableTextLabelsEnables and disables text labels below toolbar button's images.
 
 GetAllButtonsGives read-only access to the internal list of toolbar buttons.
 
 GetButtonGiven an index returns a toolbar button.
 
 GetButtonInfoGiven an index of toolbar button, returns an information about this button.
 
 GetButtonSizeReturns the current size of a toolbar's buttons.
 
 GetButtonStyleReturns a style of a toolbar button.
 
 GetButtonTextReturns a text label of a toolbar button.
 
 GetButtonTextReturns a text label of a toolbar button.
 
 GetColumnWidthReturns the width of toolbar buttons.
 
 GetControlValueRetrieves the toolbar item value (e.g., text of the edit box).
 
 GetCountReturns a number of buttons on a toolbar.
 
 GetGrayDisabledButtonsTells whether the images of the toolbar's disabled buttons should be grayed out or taken from the collection of disabled images.
 
 GetHighlightedButtonReturns a highlighted toolbar button.
 
 GetHotBorderTells whether the border presentation appears or not.
 
 GetHwndLastFocusReturns a handle to window that previously had the input focus.
 
 GetImageSizeRetrieves the size of toolbar images.
 
 GetImagesOffsetRetrieves the offset of the toolbar images in the shared (global) collection of toolbar images.
 
 GetItemIDGiven a toolbar button's index retrieves the button's command ID.
 
 GetItemRectGiven a toolbar button's index returns the button's bounding rectangle.
 
 GetRouteCommandsViaFrameDetermines whether the toolbar commands are routed via its direct owner (if not NULL) or via the parent frame.
 
 GetRowHeightReturns the height of toolbar buttons.
 
 HideEmptyMenusSpecifies whether toolbar/menu bar items with an empty items should be hidden.
 
 HitTestDetermines which toolbar button is at a specified position.
 
 InsertButtonInserts a button into list of toolbar buttons.
 
 InsertSeparatorInsets the separator at a specified position.
 
 IsButtonExtraSizeAvailableDetermines whether the toolbar can display buttons with the extra border size.
 
 IsHideEmptyMenusTells whether toolbar/menu bar items with an empty items should be hidden.
 
 IsToolBarImagesInDropDownMenusTells whether toolbar images should be displayed in drop-down menus.
 
 IsUserDefinedDetermines whether a toolbar is the user-defined toolbar.
 
 LoadBitmapLoads toolbar images from the application resources.
 
 LoadBitmapExLoads toolbar images from the application resources including large images.
 
 LoadStateLoads a toolbar state from the Windows registry.
 
 LoadToolBarLoads toolbar from the resources.
 
 LoadToolBarExLoads toolbar images from the resources using CBCGPToolBarParams helper that allows to handle large images.
 
 OnChangeHotCalled when a toolbar's currently selected button is about to change.
 
 OnCreateButtoncalled by the framework to create a toolbar button or control from the XML node.
 
 OnFillBackgroundCalled when a toolbar's background has been filled.
 
 OnResetCalled when a toolbar is reverted to its original state.
 
 OnSetDefaultButtonTextCalled when a toolbar button's default text is being restored.
 
 OnUserToolTipCalled when a toolbar button's tooltip is about to be displayed.
 
 RemoveAllButtonsRemoves all buttons from a toolbar.
 
 RemoveButtonRemoves a button from a toolbar.
 
 RemoveStateFromRegistryRemoves a toolbar's state from the Windows registry.
 
 ReplaceButtonReplaces a toolbar button with another toolbar button.
 
 ResetImagesReset all toolbar images except user-defined to the default state.
 
 RestoreOriginalstateRestores an original state of a toolbar.
 
 SaveStateStores a toolbar's state into the Windows registry.
 
 SetButtonInfoSets properties for a toolbar button.
 
 SetButtonsRemoves existing buttons from a toolbar and inserts a collection of new buttons.
 
 SetButtonStyleSets a new style for a toolbar button.
 
 SetButtonTextSets a new text label for a toolbar button.
 
 SetGrayDisabledButtonsSets a special mode, when images of disabled buttons are grayed or taken from a collection of disabled images.
 
 SetHeightCall this function to set the height of a toolbar.
 
 SetHotBorderSets a flag indicating whether toolbar buttons are hot-tracked or not.
 
 SetLockedSizesSets the size of locked toolbar buttons and locked images.
 
 SetPermamentSets a flag indicating that a toolbar is permanent and can't be closed.
 
 SetRouteCommandsViaFrameSets a flag indicating whether the toolbar commands are routed via its direct owner (if not NULL) or via the parent frame.
 
 SetToolBarBtnTextSets a new text label to the specified toolbar button, and specifies whether the toolbar button's text and image should be displayed or not.
 
 SetUseToolBarImagesInDropDownMenusSpecifies whether toolbar images should be used in drop-down menus.
 
- Public Member Functions inherited from CBCGPControlBar
 AdjustSizeImmediateImmediately recalculates layout of a control bar.
 
 CalcInsideRectCalculates the inside rectangle of a control bar taking into account the borders and grippers.
 
 CanBeDockedDetermines whether a control bar can be docked at the specified dock bar.
 
 CanBeTabbedDocumentTells whether control bar can be converted to tabbed document.
 
 CreateCreates the Windows control bar and attaches it to the CBCGPControlBar object.
 
 CreateDefaultMiniframeCreates a mini-frame window for a control bar when it's being floated.
 
 CreateExCreates the Windows control bar and attaches it to the CBCGPControlBar object.
 
 DockControlBarDocks the control bar to a dock bar.
 
 DoesAllowSiblingBarsIndicates whether it is possible to dock another control bar at the same row where this control bar is docked.
 
 FloatControlBarMakes the control bar floating.
 
 GetBordersReturns the width of the control bar borders.
 
 GetExclusiveRowModeTells whether the control bar is in exclusive row mode or not.
 
 OnBeforeFloatCalled by the framework when a control bar is about to float.
 
 OnPressCloseButtonCalled by the framework when user presses the close button on control bar's caption.
 
 SetBordersSets the border values of the control bar.
 
 SetBordersSets the border values of the control bar.
 
 SetExclusiveRowModeEnables or disables the exclusive row mode.
 
 SetMiniFrameRTCSets the runtime class information about the default mini-frame window.
 
 ToggleAutoHideToggles autohide mode.
 
- Public Member Functions inherited from CBCGPBaseControlBar
 AddControlBarAdds a control bar to docking manager.
 
 AdjustDockingLayoutRedirects a call to docking manager to adjust docking layout.
 
 CanAcceptBarDetermines whether another control bar can be docked to this control bar.
 
 CanAutoHideDetermines whether the control bar can be switched to autohide mode.
 
 CanBeAttachedCalled by the framework to determine if the control bar can be docked to another control bar or frame window.
 
 CanBeResizedDetermines whether this control bar can be resized.
 
 CanFloatDetermines whether the control bar can float.
 
 CreateExCreates a Windows control.
 
 DoesAllowDynInsertBeforeDetermines whether it is possible to dynamically insert a control bar before this control bar.
 
 EnableGripperEnables/disables the control caption (gripper).
 
 GetBarIconReturns control bar icon.
 
 GetBarStyleReturns the control bar style.
 
 GetBCGStyleReturns the library specific control bar styles.
 
 GetCaptionHeightReturns the gripper (caption) height.
 
 GetCurrentAlignmentReturns the current control bar alignment.
 
 GetDockRowReturns a pointer to a dock bar row.
 
 GetDockSiteReturns a pointer to dock site.
 
 GetEnabledAlignmentReturns the enabled alignment.
 
 GetParentMiniFrameReturns a pointer to the parent mini-frame window.
 
 GetParentTabWndRetrieves a pointer to the parent tabbed window.
 
 HideInPrintPreviewModeTells the framework whether control bar should be hidden in print preview mode.
 
 IsDockedDetermines whether the control bar is docked or not.
 
 IsHorizontalDetermines whether the control bar is docked horizontally.
 
 IsMDITabbedTells whether control bar is placed on MDI child window as tabbed document.
 
 IsVisibleDetermines whether a control bar is visible or not.
 
 OnControlBarContextMenuCalled by the framework when it needs to build a menu with the list of control bars.
 
 OnRemoveFromMiniFrameCalled by the framework when a control bar is being removed from its parent mini-frame window.
 
 SetBarAlignmentSets the current alignment for a control bar.
 
 SetBarStyleSets a control bar style
 
 SetDockModeSets a new docking method for a control bar.
 
 ShowControlBarShows or hides a control bar.
 

Static Public Member Functions

 AddBasicCommandAdds a command to a list of basic commands.
 
 AddToolBarForImageCollectionLoads a bitmap with toolbar images from the resources and adds it to the collection of toolbar images.
 
 AutoGrayInactiveImagesEnables a mode when disabled images are generated automatically by the library.
 
 CleanUpImagesFrees the system resources allocated for toolbar images.
 
 EnableContentDialogsForControlsInMenuEnables displaying the dialogs with the corresponding toolbar control from the menu item with control's ID.
 
 EnableQuickCustomizationEnables and disables the "quick" customization of toolbars by pressing the "Alt" key and dragging a button to a new location.
 
 GetAllToolbarsGives read-only access to all toolbars in the application.
 
 GetBasicCommandsGives read-only access to the global collection of basic commands defined in the application.
 
 GetColdImagesReturns a pointer to collection of cold images.
 
 GetCommandButtonsReturns a collection of buttons with the same command ID form all the application toolbars.
 
 GetDefaultImageReturns an index of the default image for a toolbar button with the specified command ID.
 
 GetDisabledImagesReturns a pointer to collection of disabled images.
 
 GetDisabledMenuImagesReturns a pointer to collection of disabled menu images.
 
 GetHotTextColorRetrieves a text color of a toolbar button in highlighted state.
 
 GetImagesRetrieves a pointer to the collection of toolbar images.
 
 GetLargeColdImagesReturns a pointer to collection of large cold images.
 
 GetLargeDisabledImagesReturns a pointer to collection of large disabled images.
 
 GetLargeImagesReturns a pointer to collection of large images.
 
 GetMenuButtonSizeRetrieves the size of menu buttons.
 
 GetMenuImagesReturns a pointer to collection of menu images.
 
 GetMenuImageSizeRetrieves the size of menu images.
 
 GetShowTooltipsDetermines whether tool tips are shown for toolbar buttons.
 
 GetUserImagesReturns a pointer to the global collection of user-defined toolbar images.
 
 IsAutoGrayInactiveImagesTells whether the option "automatic gray of inactive images" is enabled or disabled.
 
 IsBasicCommandDetermines whether the specified command is a basic command.
 
 IsCommandPermittedDetermines whether the command is allowed to be executed or not.
 
 IsCommandRarelyUsedDetermines whether the specified command is rarely used or not.
 
 IsCustomizeModeTells whether the framework is in the customization mode or not.
 
 IsGrayDisabledImagesTells whether the toolbar disabled images should be grayed or not.
 
 IsLargeIconsTells whether the application toolbars currently display large icons.
 
 IsLastCommandFromButtonDetermines whether the last command was sent from a toolbar button.
 
 IsLook2000Tells whether the application's GUI elements have Microsoft Office 2000 look and feel.
 
 LoadParametersLoads general (global) toolbar parameters from the Windows registry.
 
 ResetAllRestores all toolbars to an original state.
 
 ResetAllImagesResets all images.
 
 SetBasicCommandsSets basic commands.
 
 SetCommandUsageOptionsAllows to customize the appearance method of recently used menus.
 
 SetCustomizeModeSwitches the customize mode for all toolbars on and off.
 
 SetGrayDisabledImagesSpecifies whether the toolbar disabled images should be grayed or not.
 
 SetHotTextColorSets the text color for selected toolbar buttons to the specified color.
 
 SetLargeIconsSets a flag indicating whether toolbar buttons display large icons or regular icons.
 
 SetLook2000Sets a flag indicating whether the application GUI elements have Microsoft Office 2000 look and feel.
 
 SetMenuSizesSets the size of buttons and their images for toolbars working in the "menu mode".
 
 SetNonPermittedCommandsSets a list of commands, which are not allowed to be executed by the user.
 
 SetShowTooltipsTurns tool tips on and off.
 
 SetSizesSets sizes for all toolbar buttons and images.
 
 SetUserImagesSets user-defined images.
 

Static Public Attributes

 m_bDontScaleImagesPrevents image scaling when image sizes don't match button sizes.
 
 m_bDPIAwareControlWidthsIf this global member is TRUE, toolbar control (such as combo boxes or edit boxes) widthes width will be automatically scaled according to current DPI.
 
 m_dblLargeImageRatioSpecifies the ratio for large images.
 
- Static Public Attributes inherited from CBCGPControlBar
 m_bHandleMinSizeEnables consistent handling of minimal size.
 

Protected Member Functions

 AllowShowOnListCalled by the framework to receive permission from a toolbar object to display the object in the list box on the toolbar customization page.
 
 CalcMaxButtonHeightCalculates the maximal button height.
 
 DoPaintCalled to repaint a portion of the toolbar.
 
 DrawButtonCalled when a toolbar's button need to be repainted.
 
 DrawSeparatorCalled when a separator need to be repainted.
 
- Protected Member Functions inherited from CBCGPControlBar
 OnBeforeDockCalled by the framework when the control bar is about to be docked.
 

Protected Attributes

 m_bDontScaleLockedPrevents scaling of locked images when image sizes don't match button sizes.
 

Additional Inherited Members

- Public Attributes inherited from CBCGPControlBar
 m_recentDockInfoContains the recent docking information.