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

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

# Exponent::GUI::Controls::CMenuItemDisplay Class Reference

Inheritance diagram for Exponent::GUI::Controls::CMenuItemDisplay:

List of all members.

## Detailed Description

Displays a single menu item.

Date:
  15/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
  CMenuItemDisplay.hpp,v 1.8 2007/02/08 21:07:54 paul Exp

Definition at line 47 of file CMenuItemDisplay.hpp.

## Public Member Functions

- CMenuItemDisplay (IControlRoot *root, const long uniqueId, const CRect &area, CMenuItem *menuItem, const bool useIcons, const bool selectable, const bool subMenu, const long iconSize)
- virtual void drawControl (CGraphics &graphics)
- virtual const CMenuItem * getMenuItem () const
- virtual CMenuItem * getMutableMenuItem ()
- virtual void mouseIsOver (const bool mouseOver=true)
- virtual void setColours (const SMenuColours &colours)
- virtual void setFont (CFont *font)
- virtual void setMenuItem (CMenuItem *item)
- virtual void useIcons (const bool useIcons=true)
- virtual ~CMenuItemDisplay ()

## Static Public Attributes

- static const long CMENUITEM_DISPLAY_SEPERATOR_WIDTH_FROM_RIGHT = 12
- static const long CMENUITEM_DISPLAY_WIDTH_FROM_LEFT = 24
- static const long CMENUITEM_DISPLAY_WIDTH_FROM_RIGHT = 48

## Protected Attributes

- SMenuColours m_colours
- bool m_hasSelect
- bool m_hasSubMenu
- long m_iconSize
- TAutomaticPointer< CImageLabel > m_imageLabel
- TAutomaticPointer< CMenuItem > m_menuItem
- bool m_mouseOver
- TAutomaticPointer< CMenuItemSelectable > m_selectableControl
- TAutomaticPointer< CMenuItemSubMenuPointer > m_subMenuPointer
- TAutomaticPointer< CTextLabel > m_titleLabel
- bool m_useIcons

## Classes

- class CMenuItemSelectable
    Basic Class to selection tick or x mark. More...
- class CMenuItemSubMenuPointer
    Basic Class to draw the sub menu item pointer. More...

## Constructor & Destructor Documentation

Exponent::GUI::Controls::CMenuItemDisplay::CMenuItemDisplay | ( | IControlRoot * | root,
|  | const long | uniqueId,
|  | const CRect & | area,
|  | CMenuItem * | menuItem,
|  | const bool | useIcons,
|  | const bool | selectable,
|  | const bool | subMenu,
|  | const long | iconSize |
| ) |  |  |

Construction

Parameters:

  | root | The root control
  | uniqueId | The id of this control
  | area | The area of this control
  | menuItem | The menu item to display
  | useIcons | If true icons are drawn, if false they are not
  | selectable | If true the itemis a selectable entry
  | subMenu | If true item has submenu
  | iconSize | The size of the icons if used

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

Destruction

## Member Function Documentation

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

Draw the control

Parameters:

  | graphics | The graphics context

Reimplemented from Exponent::GUI::Controls::CControlPanel.

virtual const CMenuItem* Exponent::GUI::Controls::CMenuItemDisplay::getMenuItem | ( |  | ) | const`[inline, virtual]`

Get the menu item

Return values:

  | const | CMenuItem* The menu item

Definition at line 95 of file CMenuItemDisplay.hpp.

References m_menuItem.

virtual CMenuItem* Exponent::GUI::Controls::CMenuItemDisplay::getMutableMenuItem | ( |  | ) | `[inline, virtual]`

Get the menu item

Return values:

  | CMenuItem* | The menu item

Definition at line 101 of file CMenuItemDisplay.hpp.

References m_menuItem.

virtual void Exponent::GUI::Controls::CMenuItemDisplay::mouseIsOver | ( | const bool | mouseOver = `true` | ) | `[virtual]`

Is the mouse over this control

Parameters:

  | mouseOver | True if you want to spoof mouse over, false otherwise

Note:
  Intended for internal use, though can be called directly

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

Set the colours

Parameters:

  | colours | The menu colours

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

Set the font

Parameters:

  | font | The font to draw with

virtual void Exponent::GUI::Controls::CMenuItemDisplay::setMenuItem | ( | CMenuItem * | item | ) | `[virtual]`

Set the menu item

Parameters:

  | item | The item to display

virtual void Exponent::GUI::Controls::CMenuItemDisplay::useIcons | ( | const bool | useIcons = `true` | ) | `[inline, virtual]`

Use icons

Parameters:

  | useIcons | If true icons are drawn, if false they are not

Definition at line 130 of file CMenuItemDisplay.hpp.

References m_useIcons.

## Member Data Documentation

const long Exponent::GUI::Controls::CMenuItemDisplay::CMENUITEM_DISPLAY_SEPERATOR_WIDTH_FROM_RIGHT = 12`[static]`

Distance for the seperator

Definition at line 61 of file CMenuItemDisplay.hpp.

const long Exponent::GUI::Controls::CMenuItemDisplay::CMENUITEM_DISPLAY_WIDTH_FROM_LEFT = 24`[static]`

Distance from the left

Definition at line 59 of file CMenuItemDisplay.hpp.

const long Exponent::GUI::Controls::CMenuItemDisplay::CMENUITEM_DISPLAY_WIDTH_FROM_RIGHT = 48`[static]`

Distance from the right

Definition at line 60 of file CMenuItemDisplay.hpp.

SMenuColours Exponent::GUI::Controls::CMenuItemDisplay::m_colours`[protected]`

The colours of the menu

Definition at line 237 of file CMenuItemDisplay.hpp.

bool Exponent::GUI::Controls::CMenuItemDisplay::m_hasSelect`[protected]`

Is there a select?

Definition at line 241 of file CMenuItemDisplay.hpp.

bool Exponent::GUI::Controls::CMenuItemDisplay::m_hasSubMenu`[protected]`

Is there a sub menu?

Definition at line 240 of file CMenuItemDisplay.hpp.

long Exponent::GUI::Controls::CMenuItemDisplay::m_iconSize`[protected]`

What is the icon size..

Definition at line 242 of file CMenuItemDisplay.hpp.

TAutomaticPointer<CImageLabel> Exponent::GUI::Controls::CMenuItemDisplay::m_imageLabel`[protected]`

The image label

Definition at line 246 of file CMenuItemDisplay.hpp.

TAutomaticPointer<CMenuItem> Exponent::GUI::Controls::CMenuItemDisplay::m_menuItem`[protected]`

The menu item

Definition at line 244 of file CMenuItemDisplay.hpp.

Referenced by getMenuItem(), and getMutableMenuItem().

bool Exponent::GUI::Controls::CMenuItemDisplay::m_mouseOver`[protected]`

The mouse is over this control

Definition at line 238 of file CMenuItemDisplay.hpp.

TAutomaticPointer<CMenuItemSelectable> Exponent::GUI::Controls::CMenuItemDisplay::m_selectableControl`[protected]`

The selectable tick

Definition at line 248 of file CMenuItemDisplay.hpp.

TAutomaticPointer<CMenuItemSubMenuPointer> Exponent::GUI::Controls::CMenuItemDisplay::m_subMenuPointer`[protected]`

The sub menu arrow pointer

Definition at line 247 of file CMenuItemDisplay.hpp.

TAutomaticPointer<CTextLabel> Exponent::GUI::Controls::CMenuItemDisplay::m_titleLabel`[protected]`

The title label

Definition at line 245 of file CMenuItemDisplay.hpp.

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

Should we draw icons

Definition at line 239 of file CMenuItemDisplay.hpp.

Referenced by useIcons().