Overview | All Modules | Tutorial | User's Guide | Programming Guide
Previous

COVISE Online Documentation

Next

Public Member Functions | Protected Attributes | List of all members
vrui::coMenuItem Class Reference

This is the base class of all menu items. More...

#include <coMenuItem.h>

Inheritance diagram for vrui::coMenuItem:
vrui::coMovableBackgroundMenuItem vrui::coRowMenuItem vrui::coToolboxMenuItem vrui::coButtonMenuItem vrui::coCheckboxMenuItem vrui::coLabelMenuItem vrui::coPotiMenuItem vrui::coProgressBarMenuItem vrui::coSliderMenuItem vrui::coSubMenuItem vrui::coIconButtonToolboxItem vrui::coIconToggleButtonToolboxItem vrui::coPotiToolboxItem vrui::coSliderToolboxItem vrui::coSubMenuToolboxItem

Public Member Functions

 coMenuItem (const std::string &name)
 Constructor. More...
 
virtual ~coMenuItem ()
 Destructor. Removes this menu item from the parent menu. More...
 
virtual void setMenuListener (coMenuListener *listener)
 Set a new menu listener to receive menu item events. More...
 
virtual coMenuListenergetMenuListener ()
 Get the menu listener to receive menu item events. More...
 
virtual void setParentMenu (coMenu *parent)
 Set the parent menu in which this menu item is listed. More...
 
virtual void setVisible (bool visible)
 show or hide this menu item., just removes it from the scenegraph in the default implementation, should do something better in the real implementation More...
 
virtual bool isVisible () const
 
virtual void setAttachment (int)
 sets the attachment border More...
 
virtual const char * getName () const
 returns the symbolic name of this menu item. More...
 
virtual coUIElementgetUIElement ()
 return the actual UI Element that represents this menu. More...
 
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
 parent menu which contains More...
 
coMenuListenerlistener
 menu event listener, triggered More...
 
std::string myName
 name of the item (internal 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)

Constructor.

Creates a new menu item.

Parameters
nametext to appear on label

◆ ~coMenuItem()

vrui::coMenuItem::~coMenuItem ( )
virtual

Destructor. Removes this menu item from the parent menu.

Member Function Documentation

◆ doActionPress()

void vrui::coMenuItem::doActionPress ( )
virtual

Action is called via joystick.

if item should do any action if item is pressed via joystick, overwrite this function

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

◆ doActionRelease()

void vrui::coMenuItem::doActionRelease ( )
virtual

Action is called via joystick.

if item should do any action if item is pressed via joystick, overwrite this function

Reimplemented in vrui::coButtonMenuItem, vrui::coCheckboxMenuItem, vrui::coIconButtonToolboxItem, vrui::coIconToggleButtonToolboxItem, vrui::coSliderMenuItem, vrui::coSubMenuItem, and vrui::coSubMenuToolboxItem.

◆ doSecondActionPress()

void vrui::coMenuItem::doSecondActionPress ( )
virtual

second Action for Item

if item should do any action if item is pressed second action via joystick, overwrite this function if not overwritten calls first action (doAction)

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

◆ doSecondActionRelease()

void vrui::coMenuItem::doSecondActionRelease ( )
virtual

second Action for Item

if item should do any action if item is pressed second action via joystick, overwrite this function closes the menu if it has a parent menu

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

◆ getActive()

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

return if item is active

◆ getClassName()

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

◆ getMenuListener()

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

Get the menu listener to receive menu item events.

◆ getName()

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

returns the symbolic name of this menu item.

◆ getParentMenu()

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

get my parent menu

◆ getUIElement()

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

return the actual UI Element that represents this menu.

Reimplemented in vrui::coMovableBackgroundMenuItem, vrui::coToolboxMenuItem, and vrui::coRowMenuItem.

◆ isOfClassName()

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

◆ isVisible()

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

◆ selected()

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()

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()

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

Set a new menu listener to receive menu item events.

◆ 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()

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

Set the parent menu in which this menu item is listed.

◆ setVisible()

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

show or hide this menu item., just removes it from the scenegraph in the default implementation, should do something better in the real implementation

Reimplemented in vrui::coRowMenuItem.

Member Data Documentation

◆ active_

bool vrui::coMenuItem::active_
protected

flag if item is active

◆ listener

coMenuListener* vrui::coMenuItem::listener
protected

menu event listener, triggered

on menu selection

◆ myMenu

coMenu* vrui::coMenuItem::myMenu
protected

parent menu which contains

this menu item

◆ myName

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

name of the item (internal

symbolic name, or displayed as label)

◆ visible

bool vrui::coMenuItem::visible
protected

The documentation for this class was generated from the following files:
PreviousNext

Authors: Martin Aumüller, Ruth Lang, Daniela Rainer, Jürgen Schulze-Döbold, Andreas Werner, Peter Wolf, Uwe Wössner
Copyright © 1993-2009 HLRS, 2004-2009 RRZK, 2005-2009 Visenso
COVISE Version 6.5 Academic