Skip to content

Latest commit

 

History

History
148 lines (96 loc) · 4.73 KB

cmfcribbonundobutton-class.md

File metadata and controls

148 lines (96 loc) · 4.73 KB
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: CMFCRibbonUndoButton Class
CMFCRibbonUndoButton Class
11/04/2016
CMFCRibbonUndoButton
AFXRIBBONUNDOBUTTON/CMFCRibbonUndoButton
AFXRIBBONUNDOBUTTON/CMFCRibbonUndoButton::CMFCRibbonUndoButton
AFXRIBBONUNDOBUTTON/CMFCRibbonUndoButton::AddUndoAction
AFXRIBBONUNDOBUTTON/CMFCRibbonUndoButton::CleanUpUndoList
AFXRIBBONUNDOBUTTON/CMFCRibbonUndoButton::GetActionNumber
AFXRIBBONUNDOBUTTON/CMFCRibbonUndoButton::HasMenu
CMFCRibbonUndoButton [MFC], CMFCRibbonUndoButton
CMFCRibbonUndoButton [MFC], AddUndoAction
CMFCRibbonUndoButton [MFC], CleanUpUndoList
CMFCRibbonUndoButton [MFC], GetActionNumber
CMFCRibbonUndoButton [MFC], HasMenu
5c42adf7-871d-4239-901e-47ae7fb816fc

CMFCRibbonUndoButton Class

The CMFCRibbonUndoButton class implements a drop-down list button that contains the most recent user commands. Users can select one or more of the most recent commands from the drop-down list to either redo or undo them.

Syntax

class CMFCRibbonUndoButton : public CMFCRibbonGallery

Members

Public Constructors

Name Description
CMFCRibbonUndoButton::CMFCRibbonUndoButton Constructs a new CMFCRibbonUndoButton object by using the command ID that you specify, text label and images from the image list of the parent object.

Public Methods

Name Description
CMFCRibbonUndoButton::AddUndoAction Adds a new action to the list of actions.
CMFCRibbonUndoButton::CleanUpUndoList Clears the action list, which is the drop-down list.
CMFCRibbonUndoButton::GetActionNumber Determines the number of items that a user selected from the drop-down list.
CMFCRibbonUndoButton::HasMenu Indicates whether the object contains a menu.

Remarks

The CMFCRibbonUndoButton class uses a stack to represent the drop-down list.

Example

The following example demonstrates how to construct an object of the CMFCRibbonUndoButton class, and add a new action to the list of actions. This code snippet is part of the Ribbon Gadgets sample.

[!code-cppNVC_MFC_RibbonGadgets#2]

Inheritance Hierarchy

CObject

CMFCRibbonBaseElement

CMFCRibbonButton

CMFCRibbonGallery

CMFCRibbonUndoButton

Requirements

Header: afxribbonundobutton.h

CMFCRibbonUndoButton::AddUndoAction

Adds a new action to the list of actions.

void AddUndoAction(LPCTSTR lpszLabel);

Parameters

lpszLabel
[in] The action label that will be displayed in the drop-down list.

CMFCRibbonUndoButton::CleanUpUndoList

Clears the action list, which is the drop-down list.

void CleanUpUndoList();

CMFCRibbonUndoButton::CMFCRibbonUndoButton

Constructs a new CMFCRibbonUndoButton object by using the command ID that you specify, text label and images from the image list of the parent object.

CMFCRibbonUndoButton(
    UINT nID,
    LPCTSTR lpszText,
    int nSmallImageIndex=-1,
    int nLargeImageIndex=-1);

CMFCRibbonUndoButton(
    UINT nID,
    LPCTSTR lpszText,
    HICON hIcon);

Parameters

nID
[in] Specifies the command identifier.

lpszText
[in] Specifies the text label of the button.

nSmallImageIndex
[in] Zero-based index in the image list of the parent object for the button's small image.

nLargeImageIndex
[in] Zero-based index in the image list of the parent object for the of button's large image.

hIcon
[in] A handle to an icon that you can use as a button's image.

CMFCRibbonUndoButton::GetActionNumber

Determines the number of items that a user selected from the drop-down list.

int GetActionNumber() const;

Return Value

The number of items that a user selected.

CMFCRibbonUndoButton::HasMenu

Indicates whether the object contains a menu.

virtual BOOL HasMenu() const;

Return Value

Always returns TRUE.

Remarks

See also

Hierarchy Chart
Classes
CMFCRibbonGallery Class
CMFCRibbonButton Class