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

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