OpendTect  6.6
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  RCS: $Id$
10 ________________________________________________________________________
11 
12 -*/
13 
14 #include "uitoolsmod.h"
15 #include "uigroup.h"
16 class uiLabel;
17 class uiCheckBox;
18 class BufferStringSet;
19 
33 mExpClass(uiTools) uiCheckList : public uiGroup
34 {
35 public:
36 
37  enum Pol { Unrel, NotAll, OneMinimum, OneOnly, MaybeOne,
38  Chain1st, ChainAll };
39 
42 
43  void setLabel(const uiString&);
44  uiCheckList& addItem(const uiString& txt,const char* iconfnm=0);
47 
48  Pol pol() const { return pol_; }
49  OD::Orientation orientation() const { return orientation_; }
50  inline bool isHor() const { return orientation_ == OD::Horizontal; }
51 
52  int size() const { return boxs_.size(); }
53  bool isChecked(int) const;
54  uiCheckList& setChecked(int,bool);
55  int firstChecked() const;
56  int lastChecked() const;
57 
59  uiCheckBox* clicked() { return clicked_; }
60 
61 protected:
62 
63  const Pol pol_;
69 
70  void setBox(int,bool chkd,bool shw=true);
71 
74 
75  void ensureOne(bool);
76  void handleRadio(bool);
77  void handleChain();
78 
79 public:
80 
81  // use this to do special things, like set tooltips
82  uiCheckBox* box( int idx ) { return boxs_[idx]; }
83  const uiCheckBox* box( int idx ) const { return boxs_[idx]; }
84 
85 };
86 
87 
uiCheckList::setChecked
uiCheckList & setChecked(int, bool)
uiCheckList::changed
Notifier< uiCheckList > changed
Definition: uichecklist.h:58
uiCheckList::box
uiCheckBox * box(int idx)
Definition: uichecklist.h:82
uiStringSet
Definition: uistringset.h:23
ObjectSet< uiCheckBox >
BufferStringSet
Set of BufferString objects.
Definition: bufstringset.h:26
uiCheckList::orientation
OD::Orientation orientation() const
Definition: uichecklist.h:49
uiCheckList::setLabel
void setLabel(const uiString &)
mExpClass
#define mExpClass(module)
Definition: commondefs.h:177
uiCheckBox
Definition: uibutton.h:167
uiCheckList::boxChk
void boxChk(CallBacker *)
uiCheckList::size
int size() const
Definition: uichecklist.h:52
uiCheckList::initObj
void initObj(CallBacker *)
CallBacker
Inherit from this class to be able to send and/or receive CallBacks.
Definition: callback.h:185
uiCheckList::clicked
uiCheckBox * clicked()
Definition: uichecklist.h:59
uiCheckList::pol_
const Pol pol_
Definition: uichecklist.h:63
uiCheckList::ensureOne
void ensureOne(bool)
uigroup.h
uiCheckList::addItems
uiCheckList & addItems(const uiStringSet &)
uiCheckList::grp_
uiGroup * grp_
Definition: uichecklist.h:66
uiCheckList::lastChecked
int lastChecked() const
uiCheckList
Group of check boxes. Ensures a certain policy is honored.
Definition: uichecklist.h:34
uiCheckList::handleRadio
void handleRadio(bool)
uiGroup
Definition: uigroup.h:54
uiCheckList::isHor
bool isHor() const
Definition: uichecklist.h:50
uiCheckList::addItem
uiCheckList & addItem(const uiString &txt, const char *iconfnm=0)
uiCheckList::handleChain
void handleChain()
Notifier< uiCheckList >
uiCheckList::boxs_
ObjectSet< uiCheckBox > boxs_
Definition: uichecklist.h:65
uiCheckList::orientation_
const OD::Orientation orientation_
Definition: uichecklist.h:64
uiCheckList::clicked_
uiCheckBox * clicked_
Definition: uichecklist.h:68
uiCheckList::addItems
uiCheckList & addItems(const BufferStringSet &)
uiCheckList::box
const uiCheckBox * box(int idx) const
Definition: uichecklist.h:83
OD::Vertical
@ Vertical
Definition: oduicommon.h:25
uiCheckList::firstChecked
int firstChecked() const
uiCheckList::Pol
Pol
Definition: uichecklist.h:37
uiCheckList::uiCheckList
uiCheckList(uiParent *, Pol=Unrel, OD::Orientation orient=OD::Vertical)
uiCheckList::Unrel
@ Unrel
Definition: uichecklist.h:37
uiString
String that is able to hold international (UTF-8) strings for the user interface.
Definition: uistring.h:121
uiCheckList::setBox
void setBox(int, bool chkd, bool shw=true)
OD::Horizontal
@ Horizontal
Definition: oduicommon.h:24
uiCheckList::pol
Pol pol() const
Definition: uichecklist.h:48
uiLabel
Definition: uilabel.h:24
OD::Orientation
Orientation
Fundamental orientation in 2D UIs.
Definition: oduicommon.h:23
uiParent
Definition: uiparent.h:26
uiCheckList::lbl_
uiLabel * lbl_
Definition: uichecklist.h:67
uiCheckList::isChecked
bool isChecked(int) const

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