- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# Exponent::GUI::Controls::CComboBox Class Reference

Inheritance diagram for Exponent::GUI::Controls::CComboBox:

List of all members.

## Detailed Description

Displays text in a box area on click opens up a popup menu.

Date:
  17/04/2005

Author:
  Paul Chana

Version:
  1.0.0 Initial version

Note:
  All contents of this source code are copyright 2005 Exp Digital Uk.
  This source file is covered by the licence conditions of the Infinity API. You should have recieved a copy
  with the source code. If you didnt, please refer to http://www.expdigital.co.uk All content is the Intellectual property of Exp Digital Uk.
  Certain sections of this code may come from other sources. They are credited where applicable.
  If you have comments, suggestions or bug reports please visit http://support.expdigital.co.uk

Id
  CComboBox.hpp,v 1.6 2007/02/08 21:07:54 paul Exp

Definition at line 41 of file CComboBox.hpp.

## Public Member Functions

- CComboBox (IControlRoot *root, const long uniqueId, const CRect &area, const CString &text, CMenu *menu, IActionListener *listener)
- virtual void drawControl (CGraphics &graphics)
- const CMenuItem * getLastMenuItem () const
- CMenu * getMenu ()
- virtual CMenuItem * getMenuItem (const long index)
- virtual CMenuWindow * getMenuWindow ()
- virtual long getSelectedIndex () const
- virtual void handleLeftButtonDown (CMouseEvent &event)
- virtual void handleMenuClosing (const CMenuEvent &event)
- virtual void handleMenuOpening (const CMenuEvent &event)
- virtual void handleMenuSelection (const CMenuEvent &event)
- virtual void setDownImage (IImage *downImage)
- virtual void setFont (CFont *font)
- virtual void setMenu (CMenu *menu)
- virtual void setMenuColours (const SMenuColours &colours)
- virtual void setMenuWindowAttributes (CWindowAttributes *windowAttributes, const bool useIcons=true)
- virtual void setSelectedIndex (const long index)
- virtual ~CComboBox ()

## Protected Attributes

- IImage * m_downImage
- CMenu * m_menu
- CMenuWindow * m_menuWindow
- long m_selectedIndex
- CMenuItem * m_selectedItem
- bool m_state
- bool m_useIcons
- CWindowAttributes * m_windowAttributes

## Constructor & Destructor Documentation

Exponent::GUI::Controls::CComboBox::CComboBox | ( | IControlRoot * | root,
|  | const long | uniqueId,
|  | const CRect & | area,
|  | const CString & | text,
|  | CMenu * | menu,
|  | IActionListener * | listener |
| ) |  |  |

Construction

Parameters:

  | root | The root control that this control is being added to
  | uniqueId | The unique Identifier of this control or CCONTROL_NO_ID_REQUIRED if no id is required
  | area | The area of this control relative to the root controls top left
  | text | The default text to display
  | menu | The menu to display on click
  | listener | The action listener

virtual Exponent::GUI::Controls::CComboBox::~CComboBox | ( |  | ) | `[virtual]`

Destruction

## Member Function Documentation

virtual void Exponent::GUI::Controls::CComboBox::drawControl | ( | CGraphics & | graphics | ) | `[virtual]`

Draw the control

Parameters:

  | graphics | The graphics context

Reimplemented from Exponent::GUI::Controls::CTextLabel.

const CMenuItem* Exponent::GUI::Controls::CComboBox::getLastMenuItem | ( |  | ) | const`[inline]`

Get the selected menu item

Return values:

  | const | CMenuItem* The last menu item recieved, may be NULL

Definition at line 144 of file CComboBox.hpp.

References m_selectedItem.

CMenu* Exponent::GUI::Controls::CComboBox::getMenu | ( |  | ) | `[inline]`

Get the menu

Return values:

  | CMenu* | The menu

Definition at line 113 of file CComboBox.hpp.

References m_menu.

virtual CMenuItem* Exponent::GUI::Controls::CComboBox::getMenuItem | ( | const long | index | ) | `[virtual]`

Get the menu item at an index

Parameters:

  | index | The index of the menu item required

Return values:

  | CMenuItem* | The item or null on error

virtual CMenuWindow* Exponent::GUI::Controls::CComboBox::getMenuWindow | ( |  | ) | `[inline, virtual]`

Get the menu window

Return values:

  | CMenuWindow* | The menu window being used

Definition at line 132 of file CComboBox.hpp.

References m_menuWindow.

virtual long Exponent::GUI::Controls::CComboBox::getSelectedIndex | ( |  | ) | const`[inline, virtual]`

Get the selected index

Return values:

  | long | The index the user has selected from the menu

Definition at line 138 of file CComboBox.hpp.

References m_selectedIndex.

virtual void Exponent::GUI::Controls::CComboBox::handleLeftButtonDown | ( | CMouseEvent & | event | ) | `[virtual]`

Handle left button being clicked

Parameters:

  | event | The event to handle

Reimplemented from Exponent::GUI::Controls::CControl.

virtual void Exponent::GUI::Controls::CComboBox::handleMenuClosing | ( | const CMenuEvent & | event | ) | `[virtual]`

Handle a menu closing

Parameters:

  | event | The event to handle

virtual void Exponent::GUI::Controls::CComboBox::handleMenuOpening | ( | const CMenuEvent & | event | ) | `[inline, virtual]`

Handle a menu opening

Parameters:

  | event | The event to handle

Definition at line 87 of file CComboBox.hpp.

virtual void Exponent::GUI::Controls::CComboBox::handleMenuSelection | ( | const CMenuEvent & | event | ) | `[virtual]`

Handle a menu selection

Parameters:

  | event | The event to handle

virtual void Exponent::GUI::Controls::CComboBox::setDownImage | ( | IImage * | downImage | ) | `[virtual]`

Set the down image

Parameters:

  | downImage | The image to display when the menu is open

virtual void Exponent::GUI::Controls::CComboBox::setFont | ( | CFont * | font | ) | `[virtual]`

Set the text info

Parameters:

  | font | The font to display

virtual void Exponent::GUI::Controls::CComboBox::setMenu | ( | CMenu * | menu | ) | `[virtual]`

Set the menu

Parameters:

  | menu | The menu to display

virtual void Exponent::GUI::Controls::CComboBox::setMenuColours | ( | const SMenuColours & | colours | ) | `[virtual]`

Set the window colours

Parameters:

  | colours | The menu colours to use

virtual void Exponent::GUI::Controls::CComboBox::setMenuWindowAttributes | ( | CWindowAttributes * | windowAttributes,
|  | const bool | useIcons = `true` |
| ) |  |  | `[virtual]`

Set menu window attributes

Parameters:

  | windowAttributes | The attributes for the menu window
  | useIcons | If true icons are displayed for menu items, if false they are not

virtual void Exponent::GUI::Controls::CComboBox::setSelectedIndex | ( | const long | index | ) | `[virtual]`

Set the selected index

Parameters:

  | index | The index of the text to display from themeu in the text area

## Member Data Documentation

IImage* Exponent::GUI::Controls::CComboBox::m_downImage`[protected]`

Image to use when down

Definition at line 187 of file CComboBox.hpp.

CMenu* Exponent::GUI::Controls::CComboBox::m_menu`[protected]`

The menu

Definition at line 181 of file CComboBox.hpp.

Referenced by getMenu().

CMenuWindow* Exponent::GUI::Controls::CComboBox::m_menuWindow`[protected]`

Popup menu window

Definition at line 182 of file CComboBox.hpp.

Referenced by getMenuWindow().

long Exponent::GUI::Controls::CComboBox::m_selectedIndex`[protected]`

Selected index of the combo box

Definition at line 185 of file CComboBox.hpp.

Referenced by getSelectedIndex().

CMenuItem* Exponent::GUI::Controls::CComboBox::m_selectedItem`[protected]`

The currently selected menu item

Definition at line 188 of file CComboBox.hpp.

Referenced by getLastMenuItem().

bool Exponent::GUI::Controls::CComboBox::m_state`[protected]`

Current state (true = down)

Definition at line 186 of file CComboBox.hpp.

bool Exponent::GUI::Controls::CComboBox::m_useIcons`[protected]`

Should menu use icons

Definition at line 184 of file CComboBox.hpp.

CWindowAttributes* Exponent::GUI::Controls::CComboBox::m_windowAttributes`[protected]`

Attributes of window

Definition at line 183 of file CComboBox.hpp.