BCGControlBar Pro for MFC
CBCGPCaptionBar

Detailed Description

A CBCGPCaptionBar object is a control bar with a row of "elements": button, text label and image. It can contain only one element of each type in one time. Each element can be aligned to the left or right edges of the control or to the center. A caption bar has top and bottom borders with flat or 3D style.

To create a caption bar, follow these steps:

When you set the button element, you assign a command ID to the button. The caption bar routes WM_COMMAND message with this ID to the parent frame when the user clicks the button.

In addition, the caption bar can work in the "message bar mode". This style was introduced in Microsoft Office 2007. In this mode caption bar displays a bitmap at the left side, message text next to the image and a button (which usually displays some option dialog) next to the text. It's possible to set a tooltip for the image.

To enable the "message bar mode", just call Create() with the fourth parameter bIsMessageBarMode set to TRUE

+ Inheritance diagram for CBCGPCaptionBar:

Public Member Functions

 CreateCreates the Windows control and attaches it to the CBCGPCaptionBar object.
 
 EnableButtonEnables or disables a button, which has been placed on the caption bar.
 
 GetAlignmentReturns alignment of the specified element.
 
 GetBorderSizeReturns border size of a caption bar.
 
 GetButtonRectRetrieves the bounding rectangle of a caption bar's button.
 
 GetLinkTextReturns a hyperlink text.
 
 GetMarginReturns the distance between edges of the caption bar elements and edges of the caption bar control.
 
 GetTextGets the caption bar text.
 
 IsCaptionFontChecks whether the caption (large) font is specified.
 
 IsMessageBarModeTells whether the caption bar works in the "message bar mode".
 
 RemoveBitmapRemoves a bitmap from a caption bar.
 
 RemoveButtonRemoves the button from a caption bar.
 
 RemoveIconRemoves an icon from a caption bar.
 
 RemoveTextRemoves a text label from a caption bar.
 
 SetBitmapSet the bitmap image on the caption bar.
 
 SetBitmapSet the bitmap image on the caption bar.
 
 SetBorderSizeSets the caption bar border size.
 
 SetButtonSets the button on a caption bar.
 
 SetButtonPressedForces a button to stay pressed.
 
 SetButtonToolTipSets tooltip for the button.
 
 SetCaptionFontSpecifies whether caption text is renderred using caption (large) font
 
 SetFlatBorderSets the border style of a caption bar.
 
 SetIconSets an icon on a caption bar.
 
 SetImageIndexSpecifies the index of the active icon. Should work in conjunction with the SetImageList() method.
 
 SetImageListSet the image strip for the caption bar. You can use only one icon from this list at a time.
 
 SetImageToolTipCall this method to set a tooltip for the image.
 
 SetMarginSets the distance between edges of caption bar elements and edges of the caption bar control.
 
 SetMessageBarModeSets "message bar mode".
 
 SetTextSets a text label on a caption bar.
 
- 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.
 
 OnAfterChangeParentCalled by the framework when the parent of a control bar has changed.
 
 OnAfterFloatCalled by the framework when a control bar has floated.
 
 OnBeforeChangeParentCalled by the framework when the parent of the control bar is about to be changed as a result of docking or floating operation.
 
 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.
 
 CanBeClosedDetermines whether the control bar may be hidden.
 
 CanBeResizedDetermines whether this control bar can be resized.
 
 CanFloatDetermines whether the control bar can float.
 
 CanFocusSpecifies whether a control bar can receive focus.
 
 CreateExCreates a Windows control.
 
 EnableDockingEnables docking to the main frame.
 
 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.
 
 GetDockModeReturns the current dock mode for the control bar.
 
 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.
 

Public Attributes

 m_clrBarBackgroundThe background color of the caption bar.
 
 m_clrBarBorderThe color of the caption bar's border.
 
 m_clrBarHyperlinkThe foreground color of the caption bar's hyper-link.
 
 m_clrBarTextThe color of the caption bar's text.
 
- Public Attributes inherited from CBCGPControlBar
 m_recentDockInfoContains the recent docking information.
 

Protected Member Functions

 OnDrawBackgroundCalled by the framework when the background of a caption bar is filled.
 
 OnDrawBorderCalled by the framework when the border of a caption bar is about to be redrawn.
 
 OnDrawButtonCalled by the framework when it displays the caption bar's button.
 
 OnDrawImageCalled by the framework to display an image on the caption bar.
 
 OnDrawTextCalled by the framework to display the caption bar text.
 
- Protected Member Functions inherited from CBCGPControlBar
 OnAfterDockCalled by the framework when a control bar has been docked.
 
 OnBeforeDockCalled by the framework when the control bar is about to be docked.
 

Additional Inherited Members

- Static Public Attributes inherited from CBCGPControlBar
 m_bHandleMinSizeEnables consistent handling of minimal size.