Udostępnij za pośrednictwem


CMFCRibbonPanel Class

Implements a panel that contains a set of ribbon elements. When the panel is drawn, it displays as many elements as possible, given the size of the panel.

class CMFCRibbonPanel : public CObject

Members

Protected Constructors

Name

Description

CMFCRibbonPanel::CMFCRibbonPanel

Constructs and initializes a CMFCRibbonPanel object.

Public Methods

Name

Description

CMFCRibbonPanel::Add

Adds a ribbon element to the panel.

CMFCRibbonPanel::AddSeparator

Adds a separator to the ribbon panel.

CMFCRibbonPanel::AddToolBar

Adds a toolbar to the ribbon panel.

CMFCRibbonPanel::EnableLaunchButton

Enables or disables the display of a launch button.

CMFCRibbonPanel::FindByData

 

CMFCRibbonPanel::FindByID

Returns an element identified by a specified command ID.

CMFCRibbonPanel::GetCaptionHeight

 

CMFCRibbonPanel::GetCount

Returns the number of elements in the ribbon panel.

CMFCRibbonPanel::GetData

Returns the user-defined data associated with the panel.

CMFCRibbonPanel::GetDefaultButton

 

CMFCRibbonPanel::GetDroppedDown

 

CMFCRibbonPanel::GetElement

Returns the ribbon element located at a specified index.

CMFCRibbonPanel::GetElements

Retrieves all elements that are contained in the ribbon panel.

CMFCRibbonPanel::GetElementsByID

 

CMFCRibbonPanel::GetHighlighted

 

CMFCRibbonPanel::GetIndex

 

CMFCRibbonPanel::GetItemIDsList

 

CMFCRibbonPanel::GetLaunchButton

 

CMFCRibbonPanel::GetName

 

CMFCRibbonPanel::GetParentButton

 

CMFCRibbonPanel::GetParentCategory

Returns the parent category of the ribbon panel.

CMFCRibbonPanel::GetParentMenuBar

 

CMFCRibbonPanel::GetPreferedMenuLocation

 

CMFCRibbonPanel::GetPressed

 

CMFCRibbonPanel::GetRect

 

CMFCRibbonPanel::HasElement

 

CMFCRibbonPanel::HitTest

 

CMFCRibbonPanel::HitTestEx

 

CMFCRibbonPanel::Insert

Inserts a ribbon element at the given position.

CMFCRibbonPanel::InsertSeparator

Inserts a separator at the given position.

CMFCRibbonPanel::IsCenterColumnVert

Specifies whether all panel elements should be centered (aligned) vertically, by column.

CMFCRibbonPanel::IsCollapsed

 

CMFCRibbonPanel::IsHighlighted

 

CMFCRibbonPanel::IsJustifyColumns

Specifies whether all panel columns have the same width.

CMFCRibbonPanel::IsMainPanel

 

CMFCRibbonPanel::IsMenuMode

 

CMFCRibbonPanel::OnKey

 

CMFCRibbonPanel::RecalcWidths

 

CMFCRibbonPanel::Remove

Removes and optionally deletes an element located at the specified index.

CMFCRibbonPanel::RemoveAll

Removes all elements from the ribbon panel.

CMFCRibbonPanel::Replace

Replaces one element with another based on their respective index values.

CMFCRibbonPanel::ReplaceByID

Replaces one element with another based on a specified command ID.

CMFCRibbonPanel::SetCenterColumnVert

Orders the panel to align elements vertically, by column.

CMFCRibbonPanel::SetData

Associates user-defined data with the ribbon panel.

CMFCRibbonPanel::SetElementMenu

Assigns a popup menu to the element that has the given command ID.

CMFCRibbonPanel::SetElementRTC

Adds a ribbon element specified by the provided runtime class information to the ribbon panel.

CMFCRibbonPanel::SetElementRTCByID

Adds a ribbon element specified by the provided runtime class information to the ribbon panel.

CMFCRibbonPanel::SetJustifyColumns

Enables or disables column justification.

CMFCRibbonPanel::SetKeys

Sets the keyboard shortcut that displays the ribbon panel.

CMFCRibbonPanel::ShowPopup

 

Remarks

Ribbon panels are logical groupings of related tasks that you create within ribbon categories. As the size of the ribbon changes, the panel layout automatically adjusts to display as many elements as possible.

You can get a ribbon panels that is contained in a ribbon category by calling the CMFCRibbonCategory::GetPanel method.

Example

The following example demonstrates how to configure a CMFCRibbonPanel object by using various methods in the CMFCRibbonPanel class. The example shows how to set the keyboard shortcut that displays the ribbon panel, align elements in the panel vertically by column, enable column justification, and enable the display of the launch button. This code snippet is part of the MSOffice2007Demo Sample: MFC Office Application.

// CMFCRibbonCategory* pCategory 
    // CMFCToolBarImages m_PanelImages
    CMFCRibbonPanel* pPanelClipboard = pCategory->AddPanel(_T("Clipboard"), m_PanelImages.ExtractIcon(1));
    pPanelClipboard->SetKeys(_T("zc"));
    pPanelClipboard->SetCenterColumnVert();
    pPanelClipboard->SetJustifyColumns();
    pPanelClipboard->EnableLaunchButton(ID_WRITE_CLIPBOARD, 0);

Inheritance Hierarchy

CObject

   CMFCRibbonPanel

Requirements

Header: afxRibbonPanel.h

See Also

Concepts

MFC Hierarchy Chart

Reference

CObject Class

CMFCRibbonCategory Class

CMFCRibbonBaseElement Class

Other Resources

Classes (MFC Feature Pack)