GG: GG::MenuItem Struct Reference

GG

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

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Attributes | List of all members
GG::MenuItem Struct Reference

`#include <Menu.h>`

## Public Attributes
std::string | label
int | item_ID
bool | disabled
bool | checked
std::vector< MenuItem > | next_level

## Signal Types
typedef boost::signal< void(int)> | SelectedIDSignalType
typedef boost::signal< void()> | SelectedSignalType

## Slot Types
typedef SelectedIDSignalType::slot_type | SelectedIDSlotType
typedef SelectedSignalType::slot_type | SelectedSlotType

## Structors
| MenuItem ()
| MenuItem (const std::string &str, int id, bool disable, bool check)
| MenuItem (const std::string &str, int id, bool disable, bool check, const SelectedIDSlotType &slot)
| MenuItem (const std::string &str, int id, bool disable, bool check, const SelectedSlotType &slot)
template<class T1 , class T2 >
| MenuItem (const std::string &str, int id, bool disable, bool check, void(T1::*slot)(int), T2 *obj)
template<class T1 , class T2 >
| MenuItem (const std::string &str, int id, bool disable, bool check, void(T1::*slot)(), T2 *obj)
virtual | ~MenuItem ()

## Accessors
boost::shared_ptr < SelectedIDSignalType > | SelectedIDSignal
boost::shared_ptr < SelectedSignalType > | SelectedSignal

## Detailed Description

Serves as a single menu entry in a GG::MenuBar or GG::PopupMenu.

May include a submenu. All legal item_IDs are positive (and so non-zero); any item_ID <= 0 is considered invalid. Each MenuItem has a signal that is emmitted with its menu_ID member whenever it is selected. Such signals may be emitted even when the menu_ID is 0. These signals allow each MenuItem to be attached directly to code that should be executed when that item is selected.

Definition at line 50 of file Menu.h.

## Constructor & Destructor Documentation

GG::MenuItem::MenuItem | ( | const std::string & | str,
|  | int | id,
|  | bool | disable,
|  | bool | check,
|  | const SelectedIDSlotType & | slot
| ) |  |

Ctor that allows direct attachment of this item's signal to a "slot" function or functor

GG::MenuItem::MenuItem | ( | const std::string & | str,
|  | int | id,
|  | bool | disable,
|  | bool | check,
|  | const SelectedSlotType & | slot
| ) |  |

Ctor that allows direct attachment of this item's signal to a "slot" function or functor

template<class T1 , class T2 >

GG::MenuItem::MenuItem | ( | const std::string & | str,
|  | int | id,
|  | bool | disable,
|  | bool | check,
|  | void(T1::*)(int) | slot,
|  | T2 * | obj
| ) |  |

Ctor that allows direct attachment of this item's signal to a "slot" member function of a specific object

Definition at line 309 of file Menu.h.

References SelectedIDSignal.

template<class T1 , class T2 >

GG::MenuItem::MenuItem | ( | const std::string & | str,
|  | int | id,
|  | bool | disable,
|  | bool | check,
|  | void(T1::*)() | slot,
|  | T2 * | obj
| ) |  |

Ctor that allows direct attachment of this item's signal to a "slot" member function of a specific object

Definition at line 319 of file Menu.h.

References SelectedSignal.

The documentation for this struct was generated from the following file:

- Menu.h