- Main Page
- Classes
- Files
- Related Pages

- Class List
- Class Hierarchy
- Class Members

# COptionMenu Class Reference

a popup menu control More...

`#include <vstcontrols.h>`

Inheritance diagram for COptionMenu:

List of all members.

## Public Types
enum | { MAX_ENTRY = 1024 }
## Public Member Functions
| COptionMenu (const CRect &size, CControlListener *listener, long tag, CBitmap *background=0, CBitmap *bgWhenClick=0, const long style=0)
virtual | ~COptionMenu ()
virtual void | setValue (float val)
virtual bool | addEntry (COptionMenu *subMenu, char *txt)
virtual bool | addEntry (char *txt, long index=-1)
virtual long | getCurrent (char *txt=0, bool countSeparator=true) const
virtual bool | setCurrent (long index, bool countSeparator=true)
virtual bool | getEntry (long index, char *txt) const
virtual bool | setEntry (long index, char *txt)
virtual bool | removeEntry (long index)
virtual bool | removeAllEntry ()
virtual long | getNbEntries () const
virtual long | getIndex (char *txt) const
virtual bool | checkEntry (long index, bool state)
virtual bool | checkEntryAlone (long index)
virtual bool | isCheckEntry (long index) const
virtual void | draw (CDrawContext *pContext)
| called if the view should draw itself
virtual void | mouse (CDrawContext *pContext, CPoint &where, long button=-1)
| called if a mouse click event occurs
virtual void | takeFocus (CDrawContext *pContext=0)
| called if view should take focus
virtual void | looseFocus (CDrawContext *pContext=0)
| called if view should loose focus
virtual void | setNbItemsPerColumn (long val)
virtual long | getNbItemsPerColumn () const
long | getLastResult () const
COptionMenu * | getLastItemMenu (long &idxInMenu) const
void | setScheme (COptionMenuScheme *s)
virtual COptionMenuScheme * | getScheme () const
virtual void | setPrefixNumbers (long preCount)
COptionMenu * | getSubMenu (long idx) const
## Protected Member Functions
COptionMenu * | getItemMenu (long idx, long &idxInMenu, long &offsetIdx)
void | removeItems ()
void * | appendItems (long &offsetIdx)
bool | allocateMenu (long nb)
bool | allocateSubMenu (long nb)
## Protected Attributes
void * | platformControl
char ** | entry
COptionMenu ** | submenuEntry
bool * | check
long | nbEntries
long | nbSubMenus
long | currentIndex
CBitmap * | bgWhenClick
long | lastButton
long | nbItemsPerColumn
long | nbAllocated
long | nbSubMenuAllocated
long | lastResult
long | prefixNumbers
COptionMenu * | lastMenu
COptionMenuScheme * | scheme

## Detailed Description

a popup menu control

Define a rectangle view where a text-value can be displayed with a given font and color. The text-value is centered in the given rect. A pixmap can be used as background, a second pixmap can be used when the option menu is popuped. There are 2 styles with or without a shadowed text. When a mouse click occurs, a popup menu is displayed.

## Member Enumeration Documentation

anonymous enum

  | Enumerator:
  MAX_ENTRY |

## Constructor & Destructor Documentation

COptionMenu::COptionMenu | ( | const CRect & | size,
|  | CControlListener * | listener,
|  | long | tag,
|  | CBitmap * | background = `0`,
|  | CBitmap * | bgWhenClick = `0`,
|  | const long | style = `0`
| ) |

COptionMenu::~COptionMenu | ( |  | ) | `[virtual]`

## Member Function Documentation

bool COptionMenu::addEntry | ( | char * | txt,
|  | long | index = `-1`
| ) | `[virtual]`

bool COptionMenu::addEntry | ( | COptionMenu * | subMenu,
|  | char * | txt
| ) | `[virtual]`

bool COptionMenu::allocateMenu | ( | long | nb | ) | `[protected]`

bool COptionMenu::allocateSubMenu | ( | long | nb | ) | `[protected]`

void * COptionMenu::appendItems | ( | long & | offsetIdx | ) | `[protected]`

bool COptionMenu::checkEntry | ( | long | index,
|  | bool | state
| ) | `[virtual]`

bool COptionMenu::checkEntryAlone | ( | long | index | ) | `[virtual]`

void COptionMenu::draw | ( | CDrawContext * | pContext | ) | `[virtual]`

| called if the view should draw itself Reimplemented from CParamDisplay.

long COptionMenu::getCurrent | ( | char * | txt = `0`,
|  | bool | countSeparator = `true`
| ) | const`[virtual]`

bool COptionMenu::getEntry | ( | long | index,
|  | char * | txt
| ) | const`[virtual]`

long COptionMenu::getIndex | ( | char * | txt | ) | const`[virtual]`

COptionMenu * COptionMenu::getItemMenu | ( | long | idx,
|  | long & | idxInMenu,
|  | long & | offsetIdx
| ) | `[protected]`

COptionMenu * COptionMenu::getLastItemMenu | ( | long & | idxInMenu | ) | const

long COptionMenu::getLastResult | ( |  | ) | const`[inline]`

virtual long COptionMenu::getNbEntries | ( |  | ) | const`[inline, virtual]`

virtual long COptionMenu::getNbItemsPerColumn | ( |  | ) | const`[inline, virtual]`

virtual COptionMenuScheme* COptionMenu::getScheme | ( |  | ) | const`[inline, virtual]`

COptionMenu * COptionMenu::getSubMenu | ( | long | idx | ) | const

bool COptionMenu::isCheckEntry | ( | long | index | ) | const`[virtual]`

void COptionMenu::looseFocus | ( | CDrawContext * | pContext = `0` | ) | `[virtual]`

| called if view should loose focus Reimplemented from CView.

void COptionMenu::mouse | ( | CDrawContext * | pContext,
|  | CPoint & | where,
|  | long | button = `-1`
| ) | `[virtual]`

| called if a mouse click event occurs Reimplemented from CView.

bool COptionMenu::removeAllEntry | ( |  | ) | `[virtual]`

bool COptionMenu::removeEntry | ( | long | index | ) | `[virtual]`

void COptionMenu::removeItems | ( |  | ) | `[protected]`

bool COptionMenu::setCurrent | ( | long | index,
|  | bool | countSeparator = `true`
| ) | `[virtual]`

bool COptionMenu::setEntry | ( | long | index,
|  | char * | txt
| ) | `[virtual]`

virtual void COptionMenu::setNbItemsPerColumn | ( | long | val | ) | `[inline, virtual]`

void COptionMenu::setPrefixNumbers | ( | long | preCount | ) | `[virtual]`

void COptionMenu::setScheme | ( | COptionMenuScheme * | s | ) | `[inline]`

void COptionMenu::setValue | ( | float | val | ) | `[virtual]`

| Reimplemented from CControl.

void COptionMenu::takeFocus | ( | CDrawContext * | pContext = `0` | ) | `[virtual]`

| called if view should take focus Reimplemented from CView.

## Member Data Documentation

CBitmap* COptionMenu::bgWhenClick`[protected]`

bool* COptionMenu::check`[protected]`

long COptionMenu::currentIndex`[protected]`

char** COptionMenu::entry`[protected]`

long COptionMenu::lastButton`[protected]`

COptionMenu* COptionMenu::lastMenu`[protected]`

long COptionMenu::lastResult`[protected]`

long COptionMenu::nbAllocated`[protected]`

long COptionMenu::nbEntries`[protected]`

long COptionMenu::nbItemsPerColumn`[protected]`

long COptionMenu::nbSubMenuAllocated`[protected]`

long COptionMenu::nbSubMenus`[protected]`

void* COptionMenu::platformControl`[protected]`

long COptionMenu::prefixNumbers`[protected]`

COptionMenuScheme* COptionMenu::scheme`[protected]`

COptionMenu** COptionMenu::submenuEntry`[protected]`

The documentation for this class was generated from the following files:

- vstcontrols.h
- vstcontrols.cpp

Empty

Copyright ©2006 Steinberg Media Technologies. All Rights Reserved.