OpenCOVER
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 const char * getClassName () const
 get the Element's classname 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...
 
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

◆ coMenuItem()

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

◆ ~coMenuItem()

virtual vrui::coMenuItem::~coMenuItem ( )
virtual

Member Function Documentation

◆ doActionPress()

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

Action is called via joystick.

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

◆ doActionRelease()

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

◆ doSecondActionPress()

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

◆ doSecondActionRelease()

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

second Action for Item

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

◆ getActive()

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

return if item is active

◆ getClassName()

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

◆ getMenuListener()

virtual coMenuListener * vrui::coMenuItem::getMenuListener ( )
virtual

◆ getName()

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

Reimplemented in opencover::coColorBar.

◆ getParentMenu()

coMenu * vrui::coMenuItem::getParentMenu ( )
inline

get my parent menu

◆ getUIElement()

virtual coUIElement * vrui::coMenuItem::getUIElement ( )
virtual

◆ isOfClassName()

virtual bool vrui::coMenuItem::isOfClassName ( const char *  ) const
virtual

◆ isVisible()

virtual bool vrui::coMenuItem::isVisible ( ) const
virtual

◆ selected()

virtual void vrui::coMenuItem::selected ( bool  select)
virtual

◆ setActive()

virtual void vrui::coMenuItem::setActive ( bool  a)
inlinevirtual

◆ setAttachment()

virtual void vrui::coMenuItem::setAttachment ( int  )
inlinevirtual

◆ setLabel()

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::coLabelSubMenuToolboxItem, and vrui::coRowMenuItem.

◆ setMenuListener()

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

◆ setName()

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

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

◆ setParentMenu()

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

◆ setVisible()

virtual void vrui::coMenuItem::setVisible ( bool  visible)
virtual

Reimplemented in vrui::coRowMenuItem.

Member Data Documentation

◆ active_

bool vrui::coMenuItem::active_
protected

flag if item is active

◆ listener

coMenuListener* vrui::coMenuItem::listener
protected

on menu selection

menu event listener, triggered

◆ myMenu

coMenu* vrui::coMenuItem::myMenu
protected

this menu item

parent menu which contains

◆ myName

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

symbolic name, or displayed as label)

name of the item (internal

◆ visible

bool vrui::coMenuItem::visible
protected

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