BCGSuite for MFC
CBCGPMenuButton

Detailed Description

The CBCGPMenuButton class provides the functionality of button that shows popup menu when clicked and redirects a selected command to the parent.

The CBCGPMenuButton object inherits the abilities of the CBCGPButton objects and in addition has a special "pressed" state that can be controlled by the m_bStayPressed member variable. The popup menu may appear from the right or bottom side of the button. Its appearance is controlled by the m_bRightArrow member variable.

You can use CBCGPMenuButton class like a regular CButton class. When you're setting up the CBCGPMenuButton object you need to provide it with the popup menu handle and call the SizeToContent() member function, because the button's size should be adjusted to properly show a small arrow. You should process BN_CLICKED or BN_DOUBLECLICKED as usual (unless you didn't call EnablePopupDialog() method). The selected menu item ID can be obtained from the m_nMenuResult member variable.

See also
CBCGPButton
+ Inheritance diagram for CBCGPMenuButton:

Public Member Functions

 CBCGPMenuButtonConstructs a CBCGPMenuButton object.
 
 ClosePopupDlgCalled by the framework when the popup dialog is closed.
 
 EnablePopupDialogEnables the popup dialog associated with this button.
 
 EnablePopupDialogEnables the popup dialog associated with this button.
 
 OnBeforeShowPopupDlgCalled by the framework before the popup dialog is displayed.
 
 SetupMenuSets up the menu button content and appearance.
 
 SizeToContentChanges the size of the button's control according to its text and image size.
 
- Public Member Functions inherited from CBCGPButton
 CleanUpFrees the allocated resources
 
 ClearNumericNotificationBadgeClears the numeric notification badge.
 
 EnableFullTextTooltipAllows to show tooltip even if there is enough space for the text on the button
 
 EnableMenuFontEnables or disables using of the menu font when displaying the button's text
 
 GetDescriptionGets a description.
 
 GetNumericNotificationBadgeGets a notification badge numeric value.
 
 GetNumericNotificationBadgeColorGets a notification badge background color.
 
 GetTooltipObtain the button's tooltip.
 
 GetToolTipCtrlGets a reference to the embedded tooltip control
 
 GetTooltipDescriptionObtain the button's description.
 
 IsAutoCheckTells whether a buttons is an auto-check or auto-radio button.
 
 IsAutorepeatCommandModeDetermines whether a button is working in autorepeat mode.
 
 IsCheckBoxTells whether a button is a check-box button.
 
 IsHighlightedDetermines whether the button is highlighted
 
 IsPressedDetermines whether the button is pressed
 
 IsPushedDetermines whether the button is pushed
 
 IsRadioButtonTells whether a button is a radio button.
 
 SetAutorepeatModePuts a button in the autorepeat mode.
 
 SetCheckedImageSpecifies an image to be displayed on the checked button
 
 SetCheckedImageSpecifies an image to be displayed on the checked button
 
 SetCheckedImageSpecifies an image to be displayed on the checked button
 
 SetDescriptionSpecified a new description.
 
 SetFaceColorSets a new background color
 
 SetImageSpecifies an image to be displayed on the button
 
 SetImageSpecifies an image to be displayed on the button
 
 SetImageSpecifies an image to be displayed on the button
 
 SetMouseCursorSpecifies a new cursor hand image to be displayed on the button
 
 SetMouseCursorHandSpecifies a new cursor hand image to be displayed on the button
 
 SetNumericNotificationBadgeSets a numeric notification badge.
 
 SetStdImageSet the button's image to be a standard image taken from CBCGPMenuImages
 
 SetTextColorSpecifies a new text color for non-selected button's state
 
 SetTextHotColorSpecifies a new text color for selected button state
 
 SetTooltipSpecifies a new tooltip
 

Public Attributes

 m_bOSMenuSpecifies whether to show the default system menu or BCGControlBar Library menu
 
 m_bRightArrowDetermines the arrow direction.
 
 m_bStayPressedDetermines the menu button state when after the user has released the button.
 
 m_hMenuA handle to Windows menu.
 
 m_nMenuResultA menu-item identifier.
 
- Public Attributes inherited from CBCGPButton
 m_bDrawFocusIf nonzero, a focus rectangle is drawn around the button's text and image when the button receives focus
 
 m_bHighlightCheckedSpecifies whether to highlight buttons with the style BS_CHECKBOX or not when the mouse is hovered over.
 
 m_bOnGlassSpecifies whether a control is located on the "glass" (DWM) area of the parent window.
 
 m_bRighImageIf nonzero, the button's image is shown from the right side
 
 m_bTopImageIf nonzero, the button's image is shown on top
 
 m_bTransparentIf non-zero, the button is transparent.
 
 m_bVisualManagerStyleSpecifies whether a control has a Visual Manager style look.
 
 m_nAlignStyleSpecifies alignment of the button's text label.
 
 m_nFlatStyleSpecifies the button's flat style.
 

Additional Inherited Members

- Public Types inherited from CBCGPButton
enum  AlignStyle
 
enum  FlatStyle
 
- Static Public Member Functions inherited from CBCGPButton
 EnableWinXPThemeAllows to draw button borders using the current Windows theme.
 
- Static Public Attributes inherited from CBCGPButton
 m_bDontSetCaptureIf this global flag is TRUE, SetCapture/ReleaseCapture methods are never called for all CBCGPButton controls.
 
- Protected Member Functions inherited from CBCGPButton
 OnDrawBorderCalled by the framework when the button's border should be redrawn
 
 OnDrawFocusRectCalled when a button has focus to redraw the focus rectangle
 
 OnDrawImageCalled when a button's image should be redrawn.
 
 OnDrawTextCalled when a button's text should be redrawn
 
 OnFillBackgroundCalled by the framework when the button's background should be filled
 
 SelectFontCalled when a new font is about to be selected