CMFCRibbonBaseElement Class
The CMFCRibbonBaseElement class is the base class for all elements that you can add to a ribbon bar. Examples of ribbon elements are ribbon buttons, ribbon check boxes, and ribbon combo boxes.
class CMFCRibbonBaseElement : public CObject
Members
Public Constructors
Name |
Description |
---|---|
CMFCRibbonBaseElement |
Constructs a CMFCRibbonBaseElement object. |
Public Methods
Name |
Description |
---|---|
Adds a keytip for the ribbon element to an array of keytips. |
|
Adds a ribbon element to the specified ribbon commands list box. |
|
Indicates whether the ribbon element can be added to the quick access toolbar. |
|
Indicates whether the size of the ribbon element can be compact. |
|
Indicates whether the height of the ribbon element can increase vertically to the height of a ribbon row. |
|
Indicates whether the width of the ribbon element can change. |
|
Cleans up the dimension settings for the ribbon element. |
|
Closes the popup menu for the ribbon element. |
|
Copies the state of the specified CMFCRibbonBaseElement to the current object. |
|
Destroys the ribbon element. |
|
Draws the image for the ribbon element. |
|
Returns the specified pointer to the ribbon element if it points to the current object. |
|
Retrieves a pointer to the ribbon element if it contains the specified data. |
|
Retrieves a pointer to the ribbon element if that element is identified by the specified command ID. |
|
Retrieves a pointer to the ribbon element if its original ribbon element matches the specified ribbon element. |
|
Returns the compact size of the ribbon element. |
|
Retrieves the user-defined data associated with the ribbon element. |
|
Returns the description of the ribbon element. |
|
Retrieves a pointer to the ribbon element if its pop-up menu is dropped down. |
|
Adds the current ribbon element to the specified array. |
|
Adds the current ribbon element to the specified array if the current ribbon element contains the specified command ID. |
|
Retrieves a pointer to the ribbon element if it is highlighted. |
|
Returns the command ID of the ribbon element. |
|
Returns the image size of the ribbon element. |
|
Returns the size of the ribbon element in its intermediate state. |
|
Returns the keytip associated with the ribbon element. |
|
Retrieves the keytip boundary rectangle for the ribbon element. |
|
Retrieves the size of the keytip text. |
|
Indicates the display location of the ribbon element in a ribbon group. |
|
Returns the keytips associated with a button. |
|
Retrieves the notification command ID for the ribbon element. |
|
Retrieves the original ribbon element. |
|
Retrieves the ribbon category for the ribbon element. |
|
Retrieves the ribbon panel that contains the ribbon element. |
|
Retrieves the parent ribbon bar for the ribbon element. |
|
Retrieves the parent window for the ribbon element. |
|
Retrieves a pointer to the ribbon element if the user currently presses it. |
|
Retrieves the command ID of the ribbon element when it is located in the quick access toolbar. |
|
Returns the bounding rectangle of the ribbon element. |
|
Returns the regular size of the ribbon element. |
|
Returns the current size of the ribbon element. |
|
Returns the text associated with the ribbon element. |
|
Returns tooltip text of the ribbon element. |
|
Retrieves the top level ribbon bar for the ribbon element. |
|
Specifies whether the ribbon element has a compact mode. |
|
Specifies whether the ribbon element has an intermediate mode. |
|
Specifies whether the ribbon element has a large mode. |
|
Indicates whether the ribbon element has a menu. |
|
Retrieves a pointer to the ribbon element if the specified point is located in it. |
|
Indicates whether the ribbon element is aligned vertically with other ribbon elements. |
|
Indicates whether the ribbon element image size is always large. |
|
Indicates whether the ribbon element is in auto repeat mode. |
|
Specifies whether the ribbon element is checked. |
|
Specifies whether the ribbon element is in a compact mode. |
|
|
|
Specifies whether the ribbon element is disabled. |
|
Determines whether the ribbon element displays a popup menu and is dropped down. |
|
Specifies whether the ribbon element has the focus. |
|
Indicates whether the ribbon element is contained in a ribbon gallery. |
|
Specifies whether ribbon element is highlighted. |
|
Indicates whether the current image for the ribbon element is intermediate size. |
|
Indicates whether the current image for the ribbon element is large sized. |
|
Indicates whether the ribbon element is contained in a menu. |
|
Indicates whether the user has clicked the ribbon element. |
|
Indicates whether the ribbon element is contained in the quick access toolbar. |
|
Indicates whether the ribbon element is a display separator. |
|
Indicates whether the ribbon element is contained in a group that displays a common border. |
|
Indicates whether the tooltip is displayed under the ribbon element. |
|
Indicates whether the ribbon element can be selected with the keyboard. |
|
Indicates whether the text for the ribbon element is displayed on the right. |
|
Indicates whether the ribbon element is currently displayed. |
|
Indicates whether the display heigth of the ribbon element is the same as the display height of the ribbon panel that contains it. |
|
Sends a command notification to the parent window of the ribbon element. |
|
Notifies the parent window of the ribbon bar when a user highlights a ribbon element that is located in a list. |
|
Adds the ribbon element to the specified quick access toolbar. |
|
Updates the tooltip for the ribbon element. |
|
Updates the ribbon element in response to sustained user input. |
|
Calculates the size of the text for the ribbon element. |
|
Called by the framework when the highlight changes for a ribbon element that is located in a menu. |
|
Called by the framework to draw the ribbon element. |
|
Called by the framework to draw the keytip for the ribbon element. |
|
Called by the framework when the menu image for the ribbon element is drawn. |
|
Called by the framework to draw the ribbon element in a commands list box. |
|
Called by the framework when the user presses a keytip and the ribbon element has the focus. |
|
Called by the framework when the layout changes direction. |
|
Called by the framework to show or hide the ribbon element. |
|
Called by the framework when the ribbon element is going to display a popup menu. |
|
Updates the display for the ribbon element. |
|
Sets the accessibility data for the ribbon element. |
|
Sets the display size for the ribbon element. |
|
Associates a data item with the ribbon element. |
|
|
|
Sets the description for the ribbon element. |
|
Sets the command ID of the ribbon element. |
|
Sets the initial display size for the ribbon element. |
|
Sets a keytip for the ribbon element. |
|
Sets the original ribbon element for the ribbon element. |
|
Sets the parent category for the ribbon element. |
|
Sets the parent menu container for the ribbon element. |
|
Sets the parent ribbon bar for the ribbon element. |
|
Sets the dimensions fot he display rectangle for the ribbon element. |
|
Sets the text for the ribbon element. |
|
Sets the text for the ribbon element to display on the right. |
|
Sets the tooltip text for the ribbon element. |
|
Sets the visibility state of the ribbon element. |
|
Stretches the width of the ribbon element. |
|
Changes the display height of the ribbon element to the specified row height. |
|
Updates the tooltip text by using the command resource for the ribbon element. |
Protected Methods
Name |
Description |
---|---|
Called by the framework when the user presses a shortcut key. |
|
Called by the framework when a ribbon element receives or loses the input focus. |
Remarks
The CMFCRibbonBaseElement class defines the properties that are common to all ribbon elements that include command ID, text label, tooltip text, element description, and state (which can be focused, highlighted, pressed, disabled, checked, or dropped down).
The image size of a ribbon element is defined by the RibbonImageType member, which can be one of the following values:
RibbonImageLarge
RibbonImageSmall
Depending on its size, a ribbon element displays either a small or large image.
Example
The following example demonstrates how to use various methods in the CMFCRibbonBaseElement class. The example shows how to get a CMFCRibbonBaseElement object from a CMFCRibbonStatusBar class, set the description for the ribbon element, set the text, set a keytip, and set the tooltip text for the ribbon element. This code snippet is part of the DrawClient Sample: MFC Ribbon-Based OLE Object Drawing Application.
// CMFCRibbonStatusBar m_wndStatusBar
CMFCRibbonBaseElement* pPane = m_wndStatusBar.FindByID(nID);
...
pPane->SetDescription(_T("a pane"));
// CString strText
pPane->SetText(strText);
pPane->SetKeys(_T("p"));
pPane->SetToolTipText(_T("this is a pane"));
Inheritance Hierarchy
Requirements
Header: afxbaseribbonelement.h