CMFCCustomizeButton Class

Supports a menu command or a toolbar button that starts a customization dialog box.

class CMFCCustomizeButton : public CMFCToolBarMenuButton

Members

Public Constructors

Name

Description

CMFCCustomizeButton::CMFCCustomizeButton

Constructs a CMFCCustomizeButton object.

CMFCCustomizeButton::~CMFCCustomizeButton

Destructor.

Public Methods

Name

Description

CMFCCustomizeButton::AddInvisibleButton

Adds a button to the list of invisible buttons on the parent toolbar.

CMFCCustomizeButton::CanBeStored

Determines whether the button can be stored.

CMFCCustomizeButton::CopyFrom

Copies the properties of another toolbar button to the current button. (Overrides CMFCToolBarMenuButton::CopyFrom.)

CMFCCustomizeButton::CreateObject

Used by the framework to create a dynamic instance of this class type.

CMFCCustomizeButton::CreatePopupMenu

Creates a Customize dialog box.

CMFCCustomizeButton::GetCustomizeCmdId

Retrieves the custom command ID of the button.

CMFCCustomizeButton::GetCustomizeText

Retrieves the text of the button.

CMFCCustomizeButton::GetExtraSize

Retrieves the extra size of the button.

CMFCCustomizeButton::GetInvisibleButtons

Retrieves the list of invisible buttons on the parent toolbar.

CMFCCustomizeButton::GetParentToolbar

Retrieves the parent toolbar of the button.

CMFCCustomizeButton::GetThisClass

Used by the framework to obtain a pointer to the CRuntimeClass object that is associated with this class type.

CMFCCustomizeButton::InvokeCommand

Posts the WM_COMMAND message to the owner of the parent toolbar of the Customize button.

CMFCCustomizeButton::IsDefaultDraw

Determines whether the button is drawn by default.

CMFCCustomizeButton::IsEditable

Determines whether the button is editable.

CMFCCustomizeButton::IsEmptyMenuAllowed

Determines whether the button can have an empty pop-up menu.

CMFCCustomizeButton::IsMenuRightAlign

Indicates whether the menu is right-aligned or left-aligned.

CMFCCustomizeButton::IsPipeStyle

Determines whether the background of the button is owner-drawn.

CMFCCustomizeButton::OnCalculateSize

Called by the framework to calculate the size of the button for a specified device context and docking state. (Overrides CMFCToolBarMenuButton::OnCalculateSize.)

CMFCCustomizeButton::OnCancelMode

Called by the framework to cancel any internal mode. (Overrides CMFCToolBarMenuButton::OnCancelMode.)

CMFCCustomizeButton::OnChangeParentWnd

Called by the framework when it inserts a button into a new toolbar. (Overrides CMFCToolBarMenuButton::OnChangeParentWnd.)

CMFCCustomizeButton::OnDraw

Called by the framework to draw the button by using the specified styles and options. (Overrides CMFCToolBarMenuButton::OnDraw.)

CMFCCustomizeButton::SetDefaultDraw

Specifies whether the button is drawn by default.

CMFCCustomizeButton::SetExtraSize

Specifies the extra size of the button.

CMFCCustomizeButton::SetMenuRightAlign

Specifies whether the menu is right-aligned or left-aligned.

CMFCCustomizeButton::SetPipeStyle

Specifies whether the background of the button is owner-drawn.

Remarks

This class supports the MFC framework infrastructure and is not intended to be used directly from your code.

The framework uses this class to display the customization dialog box. To enable this button in your application, call the CMFCToolBar::EnableCustomizeButton method.

For more information about the customization dialog box, see CMFCToolBarsCustomizeDialog Class.

Example

The following example demonstrates how to retrieve a CMFCCustomizeButton object from a CMFCPopupMenu object, specify that the button is drawn by default, specify the extra size of the button, specify that the menu is right-aligned, and specify that the background of the button is owner-drawn. This code snippet is part of the CustomPages Sample: MFC Toolbar Customization Dialog Application.

// CMFCPopupMenu* pPopupMenu
        CMFCCustomizeButton* pCustom = (CMFCCustomizeButton*)pPopupMenu->GetParentButton();
        pCustom->SetDefaultDraw(true);
        pCustom->SetExtraSize(10,10);
        pCustom->SetMenuRightAlign(true);
        pCustom->SetPipeStyle(false);

Inheritance Hierarchy

CObject

   CMFCToolBarButton

      CMFCToolBarMenuButton

         CMFCCustomizeButton

Requirements

Header: afxcustomizebutton.h

See Also

Concepts

MFC Hierarchy Chart

Reference

CMFCToolBar::EnableCustomizeButton

CMFCToolBarsCustomizeDialog Class

Other Resources

Classes (MFC Feature Pack)