OpendTect-6_4  6.4
uigroup.h
Go to the documentation of this file.
1 #ifndef uigroup_h
2 #define uigroup_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: 21/01/2000
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "uibasemod.h"
16 #include "uiobj.h"
17 #include "uiparent.h"
18 #include "callback.h"
19 
20 
21 class uiGroupBody;
22 class uiParentBody;
23 
24 class uiGroup;
25 class uiGroupObjBody;
26 class uiGroupParentBody;
27 
28 mFDQtclass(QWidget)
29 
30 
31 mClass(uiBase) uiGroupObj : public uiObject
32 {
33 friend class uiGroup;
34 protected:
35  uiGroupObj(uiGroup*,uiParent*,const char*,bool);
36 public:
37 
38  virtual ~uiGroupObj();
39 
40  uiGroup* group() const { return uigrp_; }
41 
42  const ObjectSet<uiBaseObject>* childList() const;
43 
44 protected:
45 
47  uiGroup* uigrp_;
48 
49  void bodyDel( CallBacker* );
50  void grpDel( CallBacker* );
51 };
52 
53 
54 mExpClass(uiBase) uiGroup : public uiParent
55 {
56 friend class uiGroupObjBody;
57 friend class uiGroupParentBody;
58 friend class uiGroupObj;
59 friend class uiMainWin;
60 friend class uiTabStack;
61 public:
62  uiGroup( uiParent* , const char* nm="uiGroup",
63  bool manage=true );
64  virtual ~uiGroup();
65 
66  inline operator const uiGroupObj*() const { return grpobj_; }
67  inline operator uiGroupObj*() { return grpobj_; }
68  inline operator const uiObject&() const { return *grpobj_; }
69  inline operator uiObject&() { return *grpobj_; }
70  inline uiObject* attachObj() { return grpobj_; }
71  inline const uiObject* attachObj() const { return grpobj_; }
72  inline uiParent* parent() { return grpobj_->parent(); }
73  inline const uiParent* parent() const { return grpobj_->parent(); }
74 
75  void setHSpacing( int );
76  void setVSpacing( int );
77  void setSpacing( int s=0 )
78  { setHSpacing(s); setVSpacing(s); }
79  void setBorder( int );
80 
81  void setFrame( bool yn=true );
82  void setNoBackGround();
83 
85  void setHAlignObj( uiObject* o );
86  void setHAlignObj( uiGroup* o )
87  { setHAlignObj(o->mainObject()); }
89  void setHCenterObj( uiObject* o );
91  { setHCenterObj(o->mainObject()); }
92 
94  void setIsMain( bool );
95  virtual uiMainWin* mainwin()
96  { return mainObject() ? mainObject()->mainwin() :0;}
97 
98  static uiGroup* gtDynamicCastToGrp( mQtclass(QWidget*) );
99 
100  void setChildrenSensitive(bool);
101 
103  { return mainObject()->preFinalise(); }
105  { return mainObject()->postFinalise(); }
106 
107 protected:
108 
111 
112  virtual uiObject* mainobject() { return grpobj_; }
113  virtual void attach_( constraintType, uiObject *oth, int margin=-1,
114  bool reciprocal=true);
115 
116  virtual void reDraw_( bool deep ) {}
117 
118  void setShrinkAllowed(bool);
119  bool shrinkAllowed();
120 
121  void bodyDel( CallBacker* );
122  void uiobjDel( CallBacker* );
123 
124  void setFrameStyle(int);
125 
126  void reSizeChildren(const uiObject*,float,float);
127 
128 public:
129  virtual void setSize(const uiSize&);
130 
131 };
132 
133 
134 #endif
Definition: uigroup.h:54
#define mExpClass(module)
Definition: commondefs.h:160
void setHAlignObj(uiGroup *o)
Definition: uigroup.h:86
User interface main window.
Definition: uimainwin.h:36
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
virtual void attach_(constraintType, uiObject *oth, int margin=-1, bool reciprocal=true)
#define mQtclass(cls)
Definition: commondefs.h:229
virtual void setSize(const uiSize &)
uiObject * attachObj()
Definition: uigroup.h:70
friend class uiGroupObjBody
Definition: uigroup.h:56
uiObject * hCenterObj()
void setShrinkAllowed(bool)
uiParent * parent()
Definition: uigroup.h:72
virtual void reDraw_(bool deep)
Definition: uigroup.h:116
The base class for most UI elements.
Definition: uiobj.h:38
Definition: uiparent.h:26
Definition: uigeom.h:25
Definition: callback.h:254
void reSizeChildren(const uiObject *, float, float)
void setHCenterObj(uiObject *o)
void setHSpacing(int)
const uiObject * attachObj() const
Definition: uigroup.h:71
void setSpacing(int s=0)
Definition: uigroup.h:77
void setChildrenSensitive(bool)
void setIsMain(bool)
internal use only. Tells the layout manager it&#39;s a toplevel mngr.
uiGroupParentBody * body_
Definition: uigroup.h:110
const uiParent * parent() const
Definition: uigroup.h:73
void setBorder(int)
uiGroupObj * grpobj_
Definition: uigroup.h:109
Definition: uitabstack.h:33
virtual Notifier< uiBaseObject > & preFinalise()
Definition: uigroup.h:102
friend class uiGroupObj
Definition: uigroup.h:58
void setFrame(bool yn=true)
#define mFDQtclass(cls)
Definition: commondefs.h:228
bool shrinkAllowed()
void uiobjDel(CallBacker *)
void setHAlignObj(uiObject *o)
uiObject * hAlignObj()
const ObjectSet< uiBaseObject > * childList() const
virtual Notifier< uiBaseObject > & postFinalise()
Definition: uigroup.h:104
virtual uiMainWin * mainwin()
Definition: uigroup.h:95
void setVSpacing(int)
Definition: uiparentbody.h:23
virtual uiObject * mainobject()
Definition: uigroup.h:112
uiObject * mainObject()
Definition: uiparent.h:43
virtual ~uiGroup()
constraintType
Definition: uilayout.h:19
void setHCenterObj(uiGroup *o)
Definition: uigroup.h:90
friend class uiGroupParentBody
Definition: uigroup.h:57
void setNoBackGround()
#define mClass(module)
Definition: commondefs.h:164
uiMainWin * mainwin()
static uiGroup * gtDynamicCastToGrp(mQtclass(QWidget *))
uiGroup(uiParent *, const char *nm="uiGroup", bool manage=true)
void setFrameStyle(int)
void bodyDel(CallBacker *)

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