OpendTect-6_4  6.4
uitoolbar.h
Go to the documentation of this file.
1 #ifndef uitoolbar_h
2 #define uitoolbar_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: A.H. Lammertink
9  Date: 30/05/2001
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "uibasemod.h"
16 
17 #include "uiaction.h"
18 #include "uiparent.h"
19 #include "uitoolbutton.h"
20 
21 mFDQtclass(QAction)
22 mFDQtclass(QToolBar)
23 
24 class MenuItem;
25 class uiButton;
26 class uiIcon;
27 class uiObject;
28 class i_ToolBarMessenger;
29 
30 
32 {
33 friend class i_ToolBarMessenger;
34 public:
36  /*
37  Toolbars can be created on docks,
38  */
40  {
41  Left=0x1,
42  Right=0x2,
43  Top=0x4,
44  Bottom=0x8,
45  None=0,
46  All=0xf
47  };
48 
49  uiToolBar(uiParent*,const uiString& nm,
50  ToolBarArea d=Top,bool newline=false);
51  ~uiToolBar();
52 
53  uiParent* parent() { return parent_; }
54 
55  int addButton(const uiToolButtonSetup&);
56  int addButton(const char* fnm,const uiString& tooltip,
57  const CallBack& =CallBack(),
58  bool toggle=false,int id=-1);
59  int addButton(const MenuItem&);
60  void addObject(uiObject*);
61 
62  void setLabel(const uiString&);
63 
64  void setToggle(int id, bool);
65  void setIcon(int id,const char*);
66  void setIcon(int id,const uiIcon&);
67  void setToolTip(int id,const uiString&);
68  void setShortcut(int id,const char*);
69  void turnOn(int id,bool yn);
71  bool isOn(int id) const;
73  void setSensitive(int id,bool yn);
75  void setSensitive(bool yn);
77  bool isSensitive() const;
78  OD::Orientation getOrientation() const;
79 
80  void setButtonMenu(int,uiMenu*,
83 
84  virtual void display(bool yn=true,bool s=false,bool m=false);
88  void setToolBarMenuAction(uiAction*);
92  void translateText();
93 
94  bool isHidden() const;
95  bool isVisible() const;
96 
97  void addSeparator() { insertSeparator(); }
98 
99  void clear();
100 
101  uiString getDispNm();
102 
104  ToolBarArea prefArea() const { return tbarea_; }
105  mQtclass(QToolBar*) qwidget() { return qtoolbar_; }
106 
107  static ObjectSet<uiToolBar>& toolBars();
108 
111 
112 protected:
113 
114  void doInsertMenu(mQtclass(QMenu)*,
115  mQtclass(QAction)* before);
116  void doInsertAction(mQtclass(QAction)*,
117  mQtclass(QAction)* before);
118  void doInsertSeparator(mQtclass(QAction)* before);
119  void doRemoveAction(mQtclass(QAction)*);
120  void doClear();
121  void handleFinalise(bool pre);
122 
124 
125  mQtclass(QToolBar*) qtoolbar_;
126  i_ToolBarMessenger* msgr_;
127 
128  ToolBarArea tbarea_;
129  ObjectSet<uiObject> addedobjects_;
130 
131  uiString label_;
132  int getButtonID(mQtclass(QAction*));
133 
134  uiParent* parent_;
135  friend class uiMainWinBody;
136 
137 public:
139  void getEntityList(ObjectSet<const CallBacker>&) const;
140 
141  void addButton(uiButton*);
143 };
144 
145 #endif
Definition: uitoolbar.h:31
#define mExpClass(module)
Definition: commondefs.h:160
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
void turnOn(int flag)
Overrides the envirnonment variable.
PopupMode
Definition: uitoolbutton.h:28
#define mQtclass(cls)
Definition: commondefs.h:229
ToolBarArea
ToolBar Dock Identifier.
Definition: uitoolbar.h:39
To the right of the central uiGroup.
Definition: uitoolbar.h:42
Helper class for uiToolBar to relay Qt&#39;s messages.
Definition: i_qtoolbar.h:26
uiParent * parent()
Definition: uitoolbar.h:53
ToolBarArea prefArea() const
Definition: uitoolbar.h:104
bool isHidden(const char *)
Definition: uitoolbutton.h:28
void clear(std::ios &)
The base class for most UI elements.
Definition: uiobj.h:38
Definition: uistring.h:89
Definition: uiparent.h:26
Notifier< uiToolBar > orientationChanged
Definition: uitoolbar.h:110
void addSeparator()
Definition: uitoolbar.h:97
FixedString None()
Definition: keystrs.h:90
Definition: uitoolbutton.h:76
Definition: menuhandler.h:76
bool isOn(int flag=0xffff)
mFDQtclass(QAction) mFDQtclass(QToolBar) class MenuItem
FixedString All()
Definition: keystrs.h:36
Definition: uimenu.h:65
uiAction * toolbarmenuaction_
Definition: uitoolbar.h:123
CNotifier< uiToolBar, int > buttonClicked
Definition: uitoolbar.h:109
CallBacks object-oriented (object + method).
Definition: callback.h:57
mQtclass(QToolBar *) qwidget()
Definition: uitoolbar.h:105
friend class uiToolBar
Definition: i_qtoolbar.h:29
static ToolBarArea pluginArea()
Definition: uitoolbar.h:103
Definition: uiaction.h:152
Orientation
Fundamental orientation in 2D UIs.
Definition: oduicommon.h:23

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019