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

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

# Exponent::GUI::Windowing::CMenuWindow Class Reference

Inheritance diagram for Exponent::GUI::Windowing::CMenuWindow:

List of all members.

## Detailed Description

Specialised window for showing menus.

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
  CMenuWindow.hpp,v 1.5 2007/02/08 21:07:54 paul Exp

Definition at line 41 of file CMenuWindow.hpp.

## Public Member Functions

- virtual void closePopupWindow ()
- CMenuWindow (const CRect &size, CWindowAttributes *attributes, CMenu *menu, const bool useIcons=true, IMenuListener *listener=NULL)
- virtual void gainedFocus (IWindow *window)
- virtual void handleMenuClosing (const CMenuEvent &event)
- virtual void handleMenuOpening (const CMenuEvent &event)
- virtual void handleMenuSelection (const CMenuEvent &event)
- void killSubWindow ()
- void lauchSubWindow (CSubMenuMenuItem *item, IControl *control)
- virtual void lostFocus (IWindow *window)
- virtual void openPopupWindow (const CPoint &point)
- void preLauchSubWindow (const bool launching=true)
- virtual void registerMenuListener (IMenuListener *listener)
- virtual void setCurrentSelection (const long selection=CMENU_WINDOW_NO_SELECTION)
- virtual void setFont (CFont *font)
- virtual void setMenu (CMenu *menu)
- virtual void setMenuAndSize (CMenu *menu)
- virtual void setMenuColours (const SMenuColours &colours)
- virtual void setMinimumWidth (const long width)
- virtual void setParentMenuWindow (CMenuWindow *menuWindow)
- virtual void useIcons (const bool icons=true)
- virtual ~CMenuWindow ()

## Static Public Attributes

- static const long CMENU_WINDOW_NO_SELECTION = -1

## Protected Attributes

- bool m_closingWindow
- IMenuListener * m_menuListener
- CDimension * m_mySizeOnInitialise
- bool m_openingSubMenuWindow
- CMenuWindow * m_parentMenuWindow
- CMenuWindow * m_subWindow
- bool m_useIcons
- WindowGroupRef m_windowGroup

## Classes

- class CMenuRoot
    Replacement control root that is specific to a menu window.
    Does lots of handy stuff associated with menus, such as determining its own size. More...

## Constructor & Destructor Documentation

Exponent::GUI::Windowing::CMenuWindow::CMenuWindow | ( | const CRect & | size,
|  | CWindowAttributes * | attributes,
|  | CMenu * | menu,
|  | const bool | useIcons = `true`,
|  | IMenuListener * | listener = `NULL` |
| ) |  |  |

Construction

Parameters:

  | size | The size of the window
  | attributes | The attributes of the window
  | menu | The menu that will be displayed
  | useIcons | If true menu will display menu item icons (if available)
  | listener | The listener for menu events

virtual Exponent::GUI::Windowing::CMenuWindow::~CMenuWindow | ( |  | ) | `[virtual]`

Destruction

## Member Function Documentation

virtual void Exponent::GUI::Windowing::CMenuWindow::closePopupWindow | ( |  | ) | `[virtual]`

Close the popup

virtual void Exponent::GUI::Windowing::CMenuWindow::gainedFocus | ( | IWindow * | window | ) | `[virtual]`

Window gained the focus

Parameters:

  | window | The window that gained the focus

Reimplemented from Exponent::GUI::Windowing::CWindow.

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

Handle a menu closing

Parameters:

  | event | The event for the menu that closed

Note:
  Intended for internal use only

virtual void Exponent::GUI::Windowing::CMenuWindow::handleMenuOpening | ( | const CMenuEvent & | event | ) | `[virtual]`

Handle a menu opening

Parameters:

  | event | The event for the menu that opened

Note:
  Intended for internal use only

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

Handle a menu selection

Parameters:

  | event | The menu had something selected

Note:
  Intended for internal use only

void Exponent::GUI::Windowing::CMenuWindow::killSubWindow | ( |  | ) |

Kill a sub window

void Exponent::GUI::Windowing::CMenuWindow::lauchSubWindow | ( | CSubMenuMenuItem * | item,
|  | IControl * | control |
| ) |  |  |

Launch a child window

Parameters:

  | item | The sub menu item that will form the new window
  | control | The control that will be used on the sub window

virtual void Exponent::GUI::Windowing::CMenuWindow::lostFocus | ( | IWindow * | window | ) | `[virtual]`

Window lost the focus

Parameters:

  | window | The window that lost focus

Reimplemented from Exponent::GUI::Windowing::CWindow.

virtual void Exponent::GUI::Windowing::CMenuWindow::openPopupWindow | ( | const CPoint & | point | ) | `[virtual]`

Open the popup

Parameters:

  | point | The *global* window position tht you would like this window to open at

void Exponent::GUI::Windowing::CMenuWindow::preLauchSubWindow | ( | const bool | launching = `true` | ) | `[inline]`

Prepare for a child window to be lauched

Parameters:

  | launching | are we launching a sub menu window

Definition at line 184 of file CMenuWindow.hpp.

References m_openingSubMenuWindow.

virtual void Exponent::GUI::Windowing::CMenuWindow::registerMenuListener | ( | IMenuListener * | listener | ) | `[inline, virtual]`

Register the menu listener

Parameters:

  | listener | The menu event listener

Definition at line 103 of file CMenuWindow.hpp.

References m_menuListener.

virtual void Exponent::GUI::Windowing::CMenuWindow::setCurrentSelection | ( | const long | selection = `CMENU_WINDOW_NO_SELECTION` | ) | `[virtual]`

Set the selected entry

Parameters:

  | selection | If CMENU_WINDOW_NO_SELECTION Then nothing is selected, else the entry

virtual void Exponent::GUI::Windowing::CMenuWindow::setFont | ( | CFont * | font | ) | `[virtual]`

Set the font

Note:
  recalculates size

Parameters:

  | font | The font to use

virtual void Exponent::GUI::Windowing::CMenuWindow::setMenu | ( | CMenu * | menu | ) | `[virtual]`

Set the menu

Parameters:

  | menu | The menu to be displayed

virtual void Exponent::GUI::Windowing::CMenuWindow::setMenuAndSize | ( | CMenu * | menu | ) | `[virtual]`

Set the menu and recalculate the size of control root and this window to fit

Parameters:

  | menu | The menu to be displayed

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

Set the window colours

Parameters:

  | colours | The colours of the menu items

virtual void Exponent::GUI::Windowing::CMenuWindow::setMinimumWidth | ( | const long | width | ) | `[virtual]`

Set the minimum Width

Parameters:

  | width | The minimum menu width in pixels

Note:
  The window will always be >= width

virtual void Exponent::GUI::Windowing::CMenuWindow::setParentMenuWindow | ( | CMenuWindow * | menuWindow | ) | `[inline, virtual]`

Set the parentWindow

Parameters:

  | menuWindow | The menu window

Definition at line 178 of file CMenuWindow.hpp.

References m_parentMenuWindow.

virtual void Exponent::GUI::Windowing::CMenuWindow::useIcons | ( | const bool | icons = `true` | ) | `[virtual]`

Use icons

Parameters:

  | icons | If true then menu items will have icons shown (if they have them) if false, no icons are shown

## Member Data Documentation

const long Exponent::GUI::Windowing::CMenuWindow::CMENU_WINDOW_NO_SELECTION = -1`[static]`

The window has nothing selected

Definition at line 53 of file CMenuWindow.hpp.

bool Exponent::GUI::Windowing::CMenuWindow::m_closingWindow`[protected]`

Are we closing the window

Definition at line 386 of file CMenuWindow.hpp.

IMenuListener* Exponent::GUI::Windowing::CMenuWindow::m_menuListener`[protected]`

Listener for menu actions

Definition at line 377 of file CMenuWindow.hpp.

Referenced by registerMenuListener().

CDimension* Exponent::GUI::Windowing::CMenuWindow::m_mySizeOnInitialise`[protected]`

The size of the menu window on initialise

Definition at line 378 of file CMenuWindow.hpp.

bool Exponent::GUI::Windowing::CMenuWindow::m_openingSubMenuWindow`[protected]`

Are we currently opening a sub window

Definition at line 381 of file CMenuWindow.hpp.

Referenced by preLauchSubWindow().

CMenuWindow* Exponent::GUI::Windowing::CMenuWindow::m_parentMenuWindow`[protected]`

The parent menu

Definition at line 380 of file CMenuWindow.hpp.

Referenced by setParentMenuWindow().

CMenuWindow* Exponent::GUI::Windowing::CMenuWindow::m_subWindow`[protected]`

The sub window

Definition at line 379 of file CMenuWindow.hpp.

bool Exponent::GUI::Windowing::CMenuWindow::m_useIcons`[protected]`

Should icons be used?

Definition at line 382 of file CMenuWindow.hpp.

WindowGroupRef Exponent::GUI::Windowing::CMenuWindow::m_windowGroup`[protected]`

Menu window group

Definition at line 387 of file CMenuWindow.hpp.