OpenCOVER
coIconToggleButtonToolboxItem.h
Go to the documentation of this file.
1/* This file is part of COVISE.
2
3 You can use it under the terms of the GNU Lesser General Public License
4 version 2.1 or later, see lgpl-2.1.txt.
5
6 * License: LGPL 2+ */
7
8#ifndef CO_ICONTOGGLEBUTTON_TOOLBOXITEM_H
9#define CO_ICONTOGGLEBUTTON_TOOLBOXITEM_H
10
12#include <OpenVRUI/coAction.h>
13
14#include <OpenVRUI/coButton.h>
15
16#include <string>
17
18namespace vrui
19{
20
25 : public coToolboxMenuItem,
26 public coButtonActor,
27 public coAction
28{
29private:
30 bool pressed;
31
32protected:
34
35public:
36 coIconToggleButtonToolboxItem(const std::string &);
38 virtual int hit(vruiHit *);
39 virtual void miss();
40
41 virtual void selected(bool select);
42 virtual void doActionRelease();
43
44 void setState(bool newState, bool generateEvent);
45 void setState(bool newState)
46 {
47 setState(newState, false);
48 }
49 bool getState();
50
51 // not really used but there because of coButton Constructor :-/
52 virtual void buttonEvent(coButton *)
53 {
54 }
55
57 virtual const char *getClassName() const;
59 virtual bool isOfClassName(const char *) const;
60
62 virtual void setActive(bool a);
63};
64}
65#endif
collaborative interface manager
Definition: coVRCommunication.h:41
Definition: coAction.h:26
Action listener for events triggered by coButton.
Definition: coButton.h:24
Definition: coButton.h:37
Definition: coButton.h:125
Definition: coIconToggleButtonToolboxItem.h:28
void setState(bool newState)
Definition: coIconToggleButtonToolboxItem.h:45
virtual void selected(bool select)
MenuItem is selected via joystick.
void setState(bool newState, bool generateEvent)
virtual void doActionRelease()
Action is called via joystick.
virtual void setActive(bool a)
functions activates or deactivates the item
coIconToggleButtonToolboxItem(const std::string &)
virtual bool isOfClassName(const char *) const
check if the Element or any ancestor is this classname
virtual const char * getClassName() const
get the Element's classname
coToggleButton * myButton
Definition: coIconToggleButtonToolboxItem.h:33
virtual void buttonEvent(coButton *)
Definition: coIconToggleButtonToolboxItem.h:52
Definition: coToolboxMenuItem.h:26
Definition: vruiHit.h:21