BCGControlBar Pro for MFC
CBCGPRibbonButton

Detailed Description

The CBCGPRibbonButton class implements the functionality of a button, which can be placed on any ribbon bar element (panel, Quick Access Toolbar, popup, floaty).

To use a ribbon button in application just construct the button object and add it to the desired panel.

Copy
CBCGPRibbonPanel* pPanel = pCategory->AddPanel(
_T("Clipboard"), // Panel name
m_PanelIcons.ExtractIcon (0)); // Panel icon
// Create the first button to Panel ("Paste"):
CBCGPRibbonButton* pPasteButton = new CBCGPRibbonButton(ID_EDIT_PASTE, _T("Paste"), -1, 0);
// The third parameter (-1) tells that this button does not have a small icon.
// Therefore the "Paste" button will be always displayed with large icon.
// Associate a popup menu with the "Paste" button:
pPasteButton->SetMenu (IDR_CONTEXT_MENU);
// Add other buttons to the panel. These buttons have small icons only:
pPanel->Add (new CBCGPRibbonButton(ID_EDIT_CUT, _T("Cut"), 1));
pPanel->Add (new CBCGPRibbonButton(ID_EDIT_COPY, _T("Copy"), 2));
pPanel->Add (new CBCGPRibbonButton(ID_EDIT_PAINT, _T("Paint"), 9));
+ Inheritance diagram for CBCGPRibbonButton:

Public Member Functions

 CBCGPRibbonButtonConstruct ribbon button object.
 
 CBCGPRibbonButtonConstruct ribbon button object.
 
 CBCGPRibbonButtonConstruct ribbon button object.
 
 AddSubItemAllows to create a popup menu on the fly by dynamically adding new ribbon elements.
 
 ClosePopupDlgCalled by the framework when the popup dialog is closed.
 
 EnablePopupDialogEnables the popup dialog associated with this button.
 
 EnablePopupDialogEnables the popup dialog associated with this button.
 
 FindSubItemIndexByIDReturns index of sub-item by its command ID.
 
 GetImageIndexReturns button's image index in associated image list.
 
 GetMenuReturns a handle to Windows menu assigned to button.
 
 IsDefaultCommandTells whether button can execute its default command.
 
 IsRightAlignMenuTells whether the menu is right aligned, or not.
 
 OnBeforeShowPopupDlgCalled by the framework before the popup dialog is displayed.
 
 OnClickCalled by the framework when user clicks a button.
 
 RemoveAllSubItemsRemoves all menu items from popup menu.
 
 RemoveSubItemRemoves a sub-item.
 
 SetAlwaysLargeImageEnables or disables transition to collapsed state.
 
 SetDefaultCommandTells the button that it can execute its default command.
 
 SetImageIndexSets button's image index in associated image list.
 
 SetMenuAssigns a popup menu to ribbon button.
 
 SetMenuAssigns a popup menu to ribbon button.
 
 SetRightAlignMenuSets popup menu alignment.
 
- Public Member Functions inherited from CBCGPBaseRibbonElement
 CanBeRemovedFromQATTells whether ribbon element can be removed from QAT.
 
 CanBeResizedInGroupVerticallyTells whether a ribbon element can be vertically resized in the parent group.
 
 GetApplicationModesGets application modes where this control is visible.
 
 GetCursorAllows to specify a Ribbon control's custom mouse cursor.
 
 GetDataRetrieves a user-defined data associated with ribbon element.
 
 GetDescriptionReturns ribbon element description.
 
 GetIDReturns ribbon element command ID.
 
 GetKeysReturns key tip associated with ribbon element.
 
 GetMenuKeysReturns key tips associated with split button.
 
 GetRectReturns bounding rectangle of ribbon element.
 
 GetSizeReturns current size of ribbon element.
 
 GetTextReturns ribbon element text.
 
 IsBackstageViewModeTells whether a ribbon element works in "backstage view" mode.
 
 IsCheckedTells whether ribbon element is checked.
 
 IsCompactModeTells whether ribbon element is in compact mode.
 
 IsDisabledTells whether ribbon element is disabled.
 
 IsFocusedTells whether ribbon element is focused.
 
 IsHighlightedTells whether ribbon element is highlighted.
 
 IsPressedTells whether ribbon element is pressed.
 
 SetDataAssociates a user-defined data with ribbon element.
 
 SetIDSets command ID of ribbon element.
 
 SetKeysSets a key tip for ribbon element.
 
 SetToolTipTextSets tooltip text for ribbon element.
 

Additional Inherited Members

- Public Types inherited from CBCGPBaseRibbonElement
enum  RibbonElementLocation
 
- Protected Member Functions inherited from CBCGPBaseRibbonElement
 OnBeforeDestroyParentMenuBarCalled by the framework before the parent menu windo is destroyed.
 
 OnProcessKeyCalled by the framework when a ribbon element should process keyboard input.
 
 OnSetFocusCalled by the framework when a ribbon element receives or loses the input focus.