OpendTect-6_4  6.4
uichecklist.h
Go to the documentation of this file.
1 #ifndef uichecklist_h
2 #define uichecklist_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Bert
9  Date: Sep 2011
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "uitoolsmod.h"
16 #include "uigroup.h"
17 class uiLabel;
18 class uiCheckBox;
19 class BufferStringSet;
20 
34 mExpClass(uiTools) uiCheckList : public uiGroup
35 {
36 public:
37 
38  enum Pol { Unrel, NotAll, OneMinimum, OneOnly, MaybeOne,
39  Chain1st, ChainAll };
40 
41  uiCheckList(uiParent*,Pol=Unrel,
43 
44  void setLabel(const uiString&);
45  uiCheckList& addItem(const uiString& txt,const char* iconfnm=0);
46  uiCheckList& addItems(const BufferStringSet&);
47  uiCheckList& addItems(const uiStringSet&);
48 
49  Pol pol() const { return pol_; }
50  OD::Orientation orientation() const { return orientation_; }
51  inline bool isHor() const { return orientation_ == OD::Horizontal; }
52 
53  int size() const { return boxs_.size(); }
54  bool isChecked(int) const;
55  uiCheckList& setChecked(int,bool);
56  int firstChecked() const;
57  int lastChecked() const;
58 
60  uiCheckBox* clicked() { return clicked_; }
61 
62 protected:
63 
64  const Pol pol_;
67  uiGroup* grp_;
70 
71  void setBox(int,bool chkd,bool shw=true);
72 
73  void initObj(CallBacker*);
74  void boxChk(CallBacker*);
75 
76  void ensureOne(bool);
77  void handleRadio(bool);
78  void handleChain();
79 
80 public:
81 
82  // use this to do special things, like set tooltips
83  uiCheckBox* box( int idx ) { return boxs_[idx]; }
84  const uiCheckBox* box( int idx ) const { return boxs_[idx]; }
85 
86 };
87 
88 
89 #endif
Definition: uigroup.h:54
#define mExpClass(module)
Definition: commondefs.h:160
Notifier< uiCheckList > changed
Definition: uichecklist.h:59
OD::Orientation orientation() const
Definition: uichecklist.h:50
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
uiCheckBox * box(int idx)
Definition: uichecklist.h:83
bool isHor() const
Definition: uichecklist.h:51
Group of check boxes. Ensures a certain policy is honored.
Definition: uichecklist.h:34
int size() const
Definition: uichecklist.h:53
Definition: oduicommon.h:25
Definition: uistring.h:89
uiGroup * grp_
Definition: uichecklist.h:67
Definition: uiparent.h:26
Set of BufferString objects.
Definition: bufstringset.h:28
Pol pol() const
Definition: uichecklist.h:49
const Pol pol_
Definition: uichecklist.h:64
ObjectSet< uiCheckBox > boxs_
Definition: uichecklist.h:66
const OD::Orientation orientation_
Definition: uichecklist.h:65
uiCheckBox * clicked()
Definition: uichecklist.h:60
Definition: oduicommon.h:26
Pol
Definition: uichecklist.h:38
uiCheckBox * clicked_
Definition: uichecklist.h:69
Definition: uichecklist.h:38
Definition: uilabel.h:24
Definition: uistring.h:218
uiLabel * lbl_
Definition: uichecklist.h:68
const uiCheckBox * box(int idx) const
Definition: uichecklist.h:84
Definition: uibutton.h:134
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