OpenCOVER
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
vrui::coMenuItem Class Reference

#include <coMenuItem.h>

Inheritance diagram for vrui::coMenuItem:
Inheritance graph
[legend]
Collaboration diagram for vrui::coMenuItem:
Collaboration graph
[legend]

Public Member Functions

 coMenuItem (const std::string &name)
 
virtual ~coMenuItem ()
 
virtual void setMenuListener (coMenuListener *listener)
 
virtual coMenuListenergetMenuListener ()
 
virtual void setParentMenu (coMenu *parent)
 
virtual void setVisible (bool visible)
 
virtual bool isVisible () const
 
virtual void setAttachment (int)
 sets the attachment border More...
 
virtual const char * getName () const
 
virtual coUIElementgetUIElement ()
 
virtual coMenuItemgetTwin ()
 
virtual void setTwin (coMenuItem *twin)
 get the twin MenuItem More...
 
virtual bool updateContentBool (bool)
 set the twin MenuItem More...
 
virtual bool updateContentPressed ()
 for boolean state transfers More...
 
virtual bool updateContentReleased ()
 for boolean state transfers More...
 
virtual bool updateContentInt (int)
 for boolean state transfers More...
 
virtual bool updateContentFloat (float)
 for discrete state transfers More...
 
virtual bool updateContentRange (float, float, float, bool, float)
 for floating point state transfers between fixed boundaries More...
 
virtual bool updateContentPointer (void *)
 
virtual const char * getClassName () const
 The 'updateContent()' methods are activated if the item's content should be changed from outside. The proper reaction is to transfer the new content into the item's internal state and update its representation immediately.
Several content types are known, the item has to convert or ignore them depending on it's own content.
These methods are to be called by the 'twin' item (see 'myTwin' attribute).
The return value indicates if the update was sucessful (accepted type, etc...). More...
 
virtual bool isOfClassName (const char *) const
 check if the Element or any ancestor is this classname More...
 
coMenugetParentMenu ()
 get my parent menu More...
 
void setName (const std::string &newName, bool updateTwins=true)
 set my name - items with labels must call this when changing label More...
 
virtual void setActive (bool a)
 functions activates or deactivates the item More...
 
virtual bool getActive ()
 return if item is active More...
 
virtual void setLabel (const std::string &newName)
 this function may be overloaded - it is called by setName() More...
 
virtual void selected (bool select)
 MenuItem is selected via joystick. More...
 
virtual void doActionPress ()
 Action is called via joystick. More...
 
virtual void doActionRelease ()
 Action is called via joystick. More...
 
virtual void doSecondActionPress ()
 second Action for Item More...
 
virtual void doSecondActionRelease ()
 second Action for Item More...
 

Protected Attributes

bool visible
 
coMenumyMenu
 this menu item More...
 
coMenuListenerlistener
 on menu selection More...
 
std::string myName
 symbolic name, or displayed as label) More...
 
coMenuItemmyTwin
 pointer to a cloned 'twin' version (toolbar/menu) of this item. On changes the current content state should be forwarded to the twin so it can update is representation to it. (see 'updateContent()' methods) More...
 
bool active_
 flag if item is active More...
 

Detailed Description

This is the base class of all menu items. It stores the action listener which is to be called when a menu item is selected by the user.

See Also
coMenuListener

Constructor & Destructor Documentation

vrui::coMenuItem::coMenuItem ( const std::string &  name)
virtual vrui::coMenuItem::~coMenuItem ( )
virtual

Member Function Documentation

virtual void vrui::coMenuItem::doActionPress ( )
virtual

Action is called via joystick.

Reimplemented in vrui::coSliderToolboxItem, vrui::coSliderMenuItem, vrui::coPotiToolboxItem, and vrui::coPotiMenuItem.

virtual void vrui::coMenuItem::doActionRelease ( )
virtual
virtual void vrui::coMenuItem::doSecondActionPress ( )
virtual
virtual void vrui::coMenuItem::doSecondActionRelease ( )
virtual

second Action for Item

Reimplemented in vrui::coSliderMenuItem, vrui::coSubMenuItem, and vrui::coToolboxMenuItem.

virtual bool vrui::coMenuItem::getActive ( )
inlinevirtual

return if item is active

virtual const char* vrui::coMenuItem::getClassName ( ) const
virtual

The 'updateContent()' methods are activated if the item's content should be changed from outside. The proper reaction is to transfer the new content into the item's internal state and update its representation immediately.
Several content types are known, the item has to convert or ignore them depending on it's own content.
These methods are to be called by the 'twin' item (see 'myTwin' attribute).
The return value indicates if the update was sucessful (accepted type, etc...).

get the Element's classname

Reimplemented in opencover::coColorBar, vrui::coSubMenuItem, vrui::coPotiMenuItem, vrui::coSubMenuToolboxItem, vrui::coPotiToolboxItem, vrui::coSliderMenuItem, vrui::coIconToggleButtonToolboxItem, vrui::coCheckboxMenuItem, vrui::coSliderToolboxItem, vrui::coIconButtonToolboxItem, vrui::coButtonMenuItem, vrui::coRowMenuItem, vrui::coIconSubMenuToolboxItem, vrui::coMovableBackgroundMenuItem, vrui::coLabelSubMenuToolboxItem, vrui::coToolboxMenuItem, vrui::coProgressBarMenuItem, and vrui::coLabelMenuItem.

virtual coMenuListener* vrui::coMenuItem::getMenuListener ( )
virtual
virtual const char* vrui::coMenuItem::getName ( ) const
virtual
coMenu* vrui::coMenuItem::getParentMenu ( )
inline

get my parent menu

virtual coMenuItem* vrui::coMenuItem::getTwin ( )
virtual
virtual coUIElement* vrui::coMenuItem::getUIElement ( )
virtual
virtual bool vrui::coMenuItem::isOfClassName ( const char *  ) const
virtual
virtual bool vrui::coMenuItem::isVisible ( ) const
virtual
virtual void vrui::coMenuItem::selected ( bool  select)
virtual
virtual void vrui::coMenuItem::setActive ( bool  a)
inlinevirtual
virtual void vrui::coMenuItem::setAttachment ( int  )
inlinevirtual
virtual void vrui::coMenuItem::setLabel ( const std::string &  newName)
virtual

this function may be overloaded - it is called by setName()

Reimplemented in vrui::coSliderToolboxItem, vrui::coRowMenuItem, and vrui::coLabelSubMenuToolboxItem.

virtual void vrui::coMenuItem::setMenuListener ( coMenuListener listener)
virtual

Reimplemented in opencover::BoxSelection.

void vrui::coMenuItem::setName ( const std::string &  newName,
bool  updateTwins = true 
)

set my name - items with labels must call this when changing label

virtual void vrui::coMenuItem::setParentMenu ( coMenu parent)
virtual
virtual void vrui::coMenuItem::setTwin ( coMenuItem twin)
virtual

get the twin MenuItem

virtual void vrui::coMenuItem::setVisible ( bool  visible)
virtual
virtual bool vrui::coMenuItem::updateContentBool ( bool  )
virtual
virtual bool vrui::coMenuItem::updateContentFloat ( float  )
virtual
virtual bool vrui::coMenuItem::updateContentInt ( int  )
virtual

for boolean state transfers

virtual bool vrui::coMenuItem::updateContentPointer ( void *  )
virtual

Reimplemented in vrui::coSubMenuToolboxItem.

virtual bool vrui::coMenuItem::updateContentPressed ( )
virtual

for boolean state transfers

Reimplemented in vrui::coPotiMenuItem, and vrui::coPotiToolboxItem.

virtual bool vrui::coMenuItem::updateContentRange ( float  ,
float  ,
float  ,
bool  ,
float   
)
virtual

for floating point state transfers between fixed boundaries

for floating point state transfers

Reimplemented in vrui::coSliderMenuItem, vrui::coSliderToolboxItem, vrui::coPotiMenuItem, and vrui::coPotiToolboxItem.

virtual bool vrui::coMenuItem::updateContentReleased ( )
virtual

Member Data Documentation

bool vrui::coMenuItem::active_
protected

flag if item is active

coMenuListener* vrui::coMenuItem::listener
protected

on menu selection

menu event listener, triggered

coMenu* vrui::coMenuItem::myMenu
protected

this menu item

parent menu which contains

std::string vrui::coMenuItem::myName
protected

symbolic name, or displayed as label)

name of the item (internal

coMenuItem* vrui::coMenuItem::myTwin
protected

pointer to a cloned 'twin' version (toolbar/menu) of this item. On changes the current content state should be forwarded to the twin so it can update is representation to it. (see 'updateContent()' methods)

bool vrui::coMenuItem::visible
protected

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