Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | Public Attributes | List of all members
om::gui::objects::MenuItem::Delegate Class Reference

A class that contains function objects that recieve menu item events. More...

#include <omGUIMenuItem.h>

Public Member Functions

 Delegate ()
 Create a new menu item delegate with no function callbacks set. More...
 
 Delegate (const Function< void(MenuItem &)> &newSelect)
 Create a new menu item delegate that responds to the specified function when the item is selected. More...
 

Public Attributes

Function< void(MenuItem &)> select
 A function object that is called whenever an attached menu item is selected by the user. More...
 
UserData data
 An object that stores an opaque pointer to delegate data. More...
 

Detailed Description

A class that contains function objects that recieve menu item events.

Any menu-item-related event that might be processed has an appropriate callback function object. Each callback function is called by the GUI event thread whenever such an event is received. If a callback function in the delegate is not initialized, a menu item simply ignores it.

It must be noted that the callback functions are asynchronous and not thread-safe. Thus, it is necessary to perform any additional synchronization externally.

Constructor & Destructor Documentation

om::gui::objects::MenuItem::Delegate::Delegate ( )
inline

Create a new menu item delegate with no function callbacks set.

om::gui::objects::MenuItem::Delegate::Delegate ( const Function< void(MenuItem &)> &  newSelect)
inline

Create a new menu item delegate that responds to the specified function when the item is selected.

Member Data Documentation

Function<void ( MenuItem& )> om::gui::objects::MenuItem::Delegate::select

A function object that is called whenever an attached menu item is selected by the user.

UserData om::gui::objects::MenuItem::Delegate::data

An object that stores an opaque pointer to delegate data.


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