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

COVISE Online Documentation

Next

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

This class defines a menu item which can be used as a button to trigger an action. More...

#include <coButtonMenuItem.h>

Inheritance diagram for vrui::coButtonMenuItem:
vrui::coRowMenuItem vrui::coAction vrui::coDragNDrop vrui::coTexturedBackgroundActor vrui::coMenuItem

Public Member Functions

 coButtonMenuItem (const std::string &)
 
 coButtonMenuItem (const std::string &name, const std::string &nameIcon, float texSizeX=0, float texSizeY=0)
 Button with icon. More...
 
virtual ~coButtonMenuItem ()
 Destructor. More...
 
int hit (vruiHit *hit)
 This method is called on intersections of the input device with the slider menu item. More...
 
void miss ()
 Called when input device leaves the element, removes highlight. 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...
 
virtual bool dropOperation (coDragNDrop *)
 
virtual const std::string & getIconName ()
 
virtual float getIconSizeX ()
 
virtual float getIconSizeY ()
 
virtual void setIconSizeX (float x)
 
virtual void setIconSizeY (float y)
 
virtual void setActive (bool a)
 functions activates or deactivates the item More...
 
virtual void selected (bool select)
 MenuItem is selected via joystick. More...
 
virtual void doActionRelease ()
 ActionPress is called via joystick. More...
 
- Public Member Functions inherited from vrui::coRowMenuItem
 coRowMenuItem (const std::string &labelString)
 
 coRowMenuItem (const std::string &symbolicName, const std::string &labelString)
 
virtual ~coRowMenuItem ()
 Destructor. Removes this menu item from the parent menu. More...
 
virtual void setLabel (coLabel *label)
 Set a new label for the menu item. More...
 
coLabelgetLabel ()
 Get the current label. More...
 
void setLabel (const std::string &labelString) override
 this function may be overloaded - it is called by setName() More...
 
coUIElementgetUIElement () override
 return the actual UI Element that represents this menu. More...
 
const char * getClassName () const override
 get the Element's classname More...
 
bool isOfClassName (const char *) const override
 check if the Element or any ancestor is this classname More...
 
void setActive (bool a) override
 activates or deactivates the item More...
 
void selected (bool selected) override
 MenuItem is selected via joystick. More...
 
void setVisible (bool visible) override
 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...
 
- Public Member Functions inherited from vrui::coMenuItem
 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...
 
- Public Member Functions inherited from vrui::coAction
 coAction ()
 Constructor. More...
 
virtual ~coAction ()
 Destructor. More...
 
virtual int hit (vruiHit *hit)=0
 hit is called whenever the node, or any node underneath the node with this action is intersected return ACTION_CALL_ON_MISS if you want miss to be called otherwise return ACTION_DONE More...
 
virtual void miss ()
 miss is called once after a hit, if the node is not intersected anymore More...
 
void setFrame (unsigned int frame)
 INTERNAL set the framecounter (used to produce the miss call) More...
 
unsigned int getFrame () const
 INTERNAL get the framecounter (used to produce the miss call) More...
 
void setNode (vruiNode *)
 INTERNAL set the node this action belongs to. More...
 
void addChild (coAction *)
 INTERNAL add a child action. More...
 
virtual int hitAll (vruiHit *hit)
 INTERNAL same as miss/hit, but do it for all children as well. More...
 
virtual void missAll ()
 INTERNAL same as miss/hit, but do it for all children as well. More...
 
- Public Member Functions inherited from vrui::coDragNDrop
 coDragNDrop ()
 simple constructor More...
 
 coDragNDrop (int)
 constructor with specific media type More...
 
virtual ~coDragNDrop ()
 
int getMediaType ()
 
- Public Member Functions inherited from vrui::coTexturedBackgroundActor
virtual ~coTexturedBackgroundActor ()
 
virtual void texturePointerClicked (coTexturedBackground *, float, float)
 Action listener called when the action button was just clicked. More...
 
virtual void texturePointerReleased (coTexturedBackground *, float, float)
 Action listener called when the action button was just released. More...
 
virtual void texturePointerDragged (coTexturedBackground *, float, float)
 Action listener called when the pointer is moved with the action button down. More...
 
virtual void texturePointerMoved (coTexturedBackground *, float, float)
 Action listener called when the pointer is moved with no button pressed. More...
 
virtual void texturePointerLeft (coTexturedBackground *)
 Action listener called when the pointer left the textured background. More...
 

Protected Attributes

coBackgroundspace
 blank space left of label text, used as a margin More...
 
coTexturedBackgroundicon
 
- Protected Attributes inherited from vrui::coRowMenuItem
coMenuContainercontainer
 container to store menu elements More...
 
coColoredBackgroundbackground
 menu item background which changes its color when menu item is selected More...
 
coLabellabel
 label text More...
 
- Protected Attributes inherited from vrui::coMenuItem
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...
 
- Protected Attributes inherited from vrui::coAction
std::string actionName
 name of this action this can be used to distinguish betwenn different types of actions like touch and intersection actions More...
 
- Protected Attributes inherited from vrui::coDragNDrop
int mediaType
 this objects media type More...
 
vruiTransformNodedragNode
 this is the pfDCS that should be used for drag visualisation More...
 

Additional Inherited Members

- Public Types inherited from vrui::coAction
enum  Result { ACTION_DONE = 0x00 , ACTION_CALL_ON_MISS = 0x01 , ACTION_UNDEF = 0x02 }
 
- Public Types inherited from vrui::coDragNDrop
enum  { MEDIA_UNKNOWN = 0 , MEDIA_MENUITEM }
 the known media types More...
 
- Protected Member Functions inherited from vrui::coDragNDrop
bool processHit ()
 this one checks if drag'n'drop is operated (like a 'hit()' operation) More...
 
void dragOperation ()
 those two do the work and return if it worked :) More...
 
virtual bool dropOperation (coDragNDrop *)=0
 
- Static Protected Attributes inherited from vrui::coRowMenuItem
static const int LEFTMARGIN = 30
 size of margin at left edge of menu item More...
 

Detailed Description

This class defines a menu item which can be used as a button to trigger an action.

The events are processed by coAction.

Constructor & Destructor Documentation

◆ coButtonMenuItem() [1/2]

vrui::coButtonMenuItem::coButtonMenuItem ( const std::string &  )

◆ coButtonMenuItem() [2/2]

vrui::coButtonMenuItem::coButtonMenuItem ( const std::string &  name,
const std::string &  nameIcon,
float  texSizeX = 0,
float  texSizeY = 0 
)

Button with icon.

Constructor.

Parameters
namelabel string
nameIconfilename of icon needs <filename>.rgb, <filename>-selected.rgb and <filename>-disabled.rgb
texSizeXsize of icon, if 0 fit to background
texSizeYsize of icon, if 0 fit to background

◆ ~coButtonMenuItem()

vrui::coButtonMenuItem::~coButtonMenuItem ( )
virtual

Destructor.

Member Function Documentation

◆ doActionRelease()

void vrui::coButtonMenuItem::doActionRelease ( )
virtual

ActionPress is called via joystick.

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

Reimplemented from vrui::coMenuItem.

◆ dropOperation()

virtual bool vrui::coButtonMenuItem::dropOperation ( coDragNDrop )
inlinevirtual

Implements vrui::coDragNDrop.

◆ getClassName()

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

get the Element's classname

Reimplemented from vrui::coMenuItem.

◆ getIconName()

virtual const std::string & vrui::coButtonMenuItem::getIconName ( )
inlinevirtual

◆ getIconSizeX()

float vrui::coButtonMenuItem::getIconSizeX ( )
virtual

◆ getIconSizeY()

float vrui::coButtonMenuItem::getIconSizeY ( )
virtual

◆ hit()

int vrui::coButtonMenuItem::hit ( vruiHit hit)
virtual

This method is called on intersections of the input device with the slider menu item.

Returns
ACTION_CALL_ON_MISS

Implements vrui::coAction.

◆ isOfClassName()

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

check if the Element or any ancestor is this classname

Reimplemented from vrui::coMenuItem.

◆ miss()

void vrui::coButtonMenuItem::miss ( )
virtual

Called when input device leaves the element, removes highlight.

Reimplemented from vrui::coAction.

◆ selected()

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

MenuItem is selected via joystick.

if item should do any action if joystick selects the item, overwrite this function

Reimplemented from vrui::coMenuItem.

◆ setActive()

void vrui::coButtonMenuItem::setActive ( bool  a)
virtual

functions activates or deactivates the item

Reimplemented from vrui::coMenuItem.

◆ setIconSizeX()

void vrui::coButtonMenuItem::setIconSizeX ( float  x)
virtual

◆ setIconSizeY()

void vrui::coButtonMenuItem::setIconSizeY ( float  y)
virtual

Member Data Documentation

◆ icon

coTexturedBackground* vrui::coButtonMenuItem::icon
protected

◆ space

coBackground* vrui::coButtonMenuItem::space
protected

blank space left of label text, used as a margin


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