ccMenuButton

09/09/99

Author: Daniel.Lindh@Home.se
ICQ: 7983755
HOMEPAGE: home.bip.net/CyberCow

Copyright © Cyber Cow 1995 - 1999.
All Rights Reserved.

OverView
Class Members
Base Class CButtonST

 

Overview

#include <ccMenuButton.h>

Hierarchy Chart


A Button Ctrl. When you press it you will get a floating menu at the right side.
The button will be flat button whith a arrow to the right

 

Class Members

Properties

Public:

clearMenu

Clear the floating menu.

addMenuItem

Add a menu item and associate it to a command ID.

enableMenuItemCheck

Set or remove a check before a menu item.

Implementation

Public:

showMenu

Show the floating menu

 

ccMenuButton::clearMenu

void clearMenu();

Return Value:

None

Arguments:

None

Remarks:

Clear the floating menu.

Example:

ccMenuButton m_handButton;

m_handButton.SubclassDlgItem(IDC_HAND256, this);

m_handButton.clearMenu();

 

ccMenuButton::addMenuItem

void addMenuItem(CString asText, UINT nIDNewItem);

Return Value:

None

Arguments:

asText

The text on the menu item.

nIDNewItem

Specifies the command ID

Remarks:

Add a menu item and associate it to a command ID.

Example:

ccMenuButton m_handButton;

m_handButton.SubclassDlgItem(IDC_HAND256, this);

m_handButton.clearMenu();

m_handButton.addMenuItem("open", ID_OPEN);

 

ccMenuButton::enableMenuItemCheck

bool enableMenuItemCheck(int aiMenuItem, BOOL abEnable);

Return Value:

BOOL

True if succeded. False if failed.

Arguments:

aiMenuItem

Specifies the command ID of the menu item who should be enabled or disabled.

abEnable

True if the menu item should be enabled, false if it should be disabled.

Remarks:

Set or remove a check before a menu item.

Example:

ccMenuButton m_handButton;

m_handButton.SubclassDlgItem(IDC_HAND256, this);

m_handButton.clearMenu();

m_handButton.addMenuItem("open", ID_OPEN);

m_handButton.enableMenuItemCheck( ID_OPEN, TRUE );

 

ccMenuButton::showMenu

int showMenu();

Return Value:

int

The command ID of the selected menu item. If no item where selected -1 will be returned.

Arguments:

None

Remarks:

Show the floating menu

Example:

void dialog::OnMenuButton

{

   if ( m_handButton.showMenu() == ID_OPEN )

   {

      ...

   }

}