description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Learn more about: CMFCRibbonSeparator Class |
CMFCRibbonSeparator Class |
11/04/2016 |
|
|
bedb1a53-cb07-4c3c-be12-698c5409e7cf |
Implements the ribbon separator.
class CMFCRibbonSeparator : public CMFCRibbonBaseElement
Name | Description |
---|---|
CMFCRibbonSeparator::CMFCRibbonSeparator | Constructs a CMFCRibbonSeparator object. |
Name | Description |
---|---|
CMFCRibbonSeparator::AddToListBox | Adds a separator to the Commands list in the Customize dialog box. (Overrides CMFCRibbonBaseElement::AddToListBox.) |
CMFCRibbonSeparator::CreateObject |
Used by the framework to create a dynamic instance of this class type. |
CMFCRibbonSeparator::GetThisClass |
Used by the framework to obtain a pointer to the CRuntimeClass object that is associated with this class type. |
Name | Description |
---|---|
CMFCRibbonSeparator::CopyFrom | A copy method that sets a separator's member variables from another object. |
CMFCRibbonSeparator::GetRegularSize | Returns the size of a separator. |
CMFCRibbonSeparator::IsSeparator | Indicates whether this is a separator. |
CMFCRibbonSeparator::IsTabStop | Indicates whether this is a tab stop. |
CMFCRibbonSeparator::OnDraw | Called by the system to draw the separator on either the ribbon or the Quick Access Toolbar. |
CMFCRibbonSeparator::OnDrawOnList | Called by the system to draw the separator on the Commands list. |
A ribbon separator is a vertical or horizontal line that logically separates ribbon elements. A separator can be drawn on the ribbon control, the main application menu, the ribbon status bar, and the Quick Access Toolbar.
To use a separator in your application, construct the new object and add it to the main application menu as shown here:
CMFCRibbonMainPanel* pMainPanel = m_wndRibbonBar.AddMainCategory(_T("Main Menu"),
IDB_FILESMALL,
IDB_FILELARGE);
...
pMainPanel->Add(new CMFCRibbonSeparator(TRUE));
Call CMFCRibbonPanel::AddSeparator to add separators to ribbon panels. The separators are allocated and added internally by the AddSeparator
method.
Header: afxbaseribbonelement.h
Adds a separator to the Commands list in the Customize dialog box.
virtual int AddToListBox(
CMFCRibbonCommandsListBox* pWndListBox,
BOOL bDeep);
pWndListBox
[in] A pointer to the Commands list where the separator is added.
bDeep
[in] Ignored.
Zero-based index to the string in the list box specified by pWndListBox.
Constructs a CMFCRibbonSeparator
object.
CMFCRibbonSeparator(BOOL bIsHoriz = FALSE);
bIsHoriz
[in] If TRUE, the separator is horizontal; if FALSE, the separator is vertical.
Horizontal separators are used in application menus. Vertical separators are used in toolbars.
The following example demonstrates how to construct an object of the CMFCRibbonSeparator
class.
[!code-cppNVC_MFC_RibbonApp#19]
A copy method that sets a separator's member variables from another object.
virtual void CopyFrom(const CMFCRibbonBaseElement& src);
Src
[in] The source ribbon element to copy from.
Returns the size of a separator.
virtual CSize GetRegularSize(CDC* pDC);
pDC
[in] A pointer to a device content.
The size of the separator on the given device context.
Indicates whether this is a separator.
virtual BOOL IsSeparator() const;
Always TRUE for this class.
Indicates whether this is a tab stop.
virtual BOOL IsTabStop() const;
Always FALSE for this class.
A ribbon separator is not a tab stop.
Called by the system to draw the separator on either the ribbon or the Quick Access Toolbar.
virtual void OnDraw(CDC* pDC);
pDC
[in] A pointer to a device context.
Called by the system to draw the separator on the Commands list.
virtual void OnDrawOnList(
CDC* pDC,
CString strText,
int nTextOffset,
CRect rect,
BOOL bIsSelected,
BOOL bHighlighted);
pDC
[in] A pointer to a device context.
strText
[in] Text displayed on the list.
nTextOffset
[in] Spacing between the text and the left side of the bounding rectangle.
rect
[in] Specifies the bounding rectangle.
bIsSelected
[in] Ignored.
bHighlighted
[in] Ignored.