OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
scenetooltoggle2.hpp
Go to the documentation of this file.
1 #ifndef CSV_WIDGET_SCENETOOL_TOGGLE2_H
2 #define CSV_WIDGET_SCENETOOL_TOGGLE2_H
3 
4 #include "scenetool.hpp"
5 
6 #include <map>
7 
8 class QHBoxLayout;
9 class QRect;
10 
11 namespace CSVWidget
12 {
13  class SceneToolbar;
14  class PushButton;
15 
19  class SceneToolToggle2 : public SceneTool
20  {
21  Q_OBJECT
22 
23  struct ButtonDesc
24  {
25  unsigned int mButtonId;
26  unsigned int mMask;
27  QString mName;
28  int mIndex;
29  };
30 
31  std::string mCompositeIcon;
32  std::string mSingleIcon;
34  QHBoxLayout *mLayout;
35  std::map<PushButton *, ButtonDesc> mButtons; // widget, id
37  int mIconSize;
38  QString mToolTip;
40 
41  void adjustToolTip();
42 
43  void adjustIcon();
44 
45  public:
46 
52  SceneToolToggle2 (SceneToolbar *parent, const QString& toolTip,
53  const std::string& compositeIcon, const std::string& singleIcon);
54 
55  virtual void showPanel (const QPoint& position);
56 
61  void addButton (unsigned int buttonId, unsigned int mask,
62  const QString& name, const QString& tooltip = "", bool disabled = false);
63 
64  unsigned int getSelectionMask() const;
65 
67  void setSelectionMask (unsigned int selection);
68 
69  signals:
70 
71  void selectionChanged();
72 
73  private slots:
74 
75  void selected();
76  };
77 }
78 
79 #endif
std::map< PushButton *, ButtonDesc > mButtons
Definition: scenetooltoggle2.hpp:35
SceneToolToggle2(SceneToolbar *parent, const QString &toolTip, const std::string &compositeIcon, const std::string &singleIcon)
Definition: scenetooltoggle2.cpp:56
static const struct @2 signals[]
QString mToolTip
Definition: scenetooltoggle2.hpp:38
int mButtonSize
Definition: scenetooltoggle2.hpp:36
int mIconSize
Definition: scenetooltoggle2.hpp:37
int mIndex
Definition: scenetooltoggle2.hpp:28
std::string mCompositeIcon
Definition: scenetooltoggle2.hpp:31
unsigned int mMask
Definition: scenetooltoggle2.hpp:26
void setSelectionMask(unsigned int selection)
Definition: scenetooltoggle2.cpp:124
std::string mSingleIcon
Definition: scenetooltoggle2.hpp:32
Definition: pushbutton.hpp:13
unsigned int getSelectionMask() const
Definition: scenetooltoggle2.cpp:112
QWidget * mPanel
Definition: scenetooltoggle2.hpp:33
Tool base class.
Definition: scenetool.hpp:11
void addButton(unsigned int buttonId, unsigned int mask, const QString &name, const QString &tooltip="", bool disabled=false)
Definition: scenetooltoggle2.cpp:80
QHBoxLayout * mLayout
Definition: scenetooltoggle2.hpp:34
PushButton * mFirst
Definition: scenetooltoggle2.hpp:39
void adjustIcon()
Definition: scenetooltoggle2.cpp:42
Multi-Toggle tool.
Definition: scenetooltoggle2.hpp:19
virtual void showPanel(const QPoint &position)
Definition: scenetooltoggle2.cpp:71
unsigned int mButtonId
Definition: scenetooltoggle2.hpp:25
Definition: scenetoolbar.hpp:12
void selected()
Definition: scenetooltoggle2.cpp:134
Definition: scenetooltoggle2.hpp:23
void adjustToolTip()
Definition: scenetooltoggle2.cpp:14
QString mName
Definition: scenetooltoggle2.hpp:27
const char * name
Definition: crashcatcher.cpp:59