OpendTect-6_4  6.4
uiiosel.h
Go to the documentation of this file.
1 #ifndef uiiosel_h
2 #define uiiosel_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: A.H. Bril
9  Date: April 2001
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "uitoolsmod.h"
16 #include "uigroup.h"
17 #include "bufstringset.h"
18 #include "uistrings.h"
19 class uiLabel;
20 class uiButton;
21 class uiCheckBox;
22 class uiComboBox;
23 
24 
30 mExpClass(uiTools) uiIOSelect : public uiGroup
32 public:
33 
34  mExpClass(uiTools) Setup
35  {
36  public:
38  : seltxt_(seltext)
39  , withclear_(false)
40  , buttontxt_(uiStrings::sSelect())
41  , optional_(false)
42  , keepmytxt_(false) {}
43 
44  mDefSetupMemb(uiString,seltxt)
45  mDefSetupMemb(uiString,buttontxt)
46  mDefSetupMemb(bool,withclear)
47  mDefSetupMemb(bool,optional)
48  mDefSetupMemb(bool,keepmytxt)
49  };
50 
51  uiIOSelect(uiParent*,const Setup&,const CallBack&);
52  ~uiIOSelect();
53 
54  // before finalise:
55  void addExtSelBut(uiButton*);
56 
57  bool isEmpty() const;
58  const char* getInput() const;
59  const char* getKey() const;
60  void setInput(const char* key);
62  void setInputText(const char*);
64  void setEntries(const BufferStringSet& keys,
65  const BufferStringSet& names);
66 
67  int nrItems() const;
68  int getCurrentItem() const;
69  void setCurrentItem(int);
70  const char* getItem(int) const;
71  bool isChecked() const;
72  void setChecked(bool yn);
73 
74  virtual void updateHistory(IOPar&) const;
75  virtual void getHistory(const IOPar&);
76  void addToHistory(const char*);
77  void addToHistory(const BufferStringSet&);
78 
79  virtual void setEmpty();
80  virtual void processInput() {}
81  void setReadOnly(bool readonly=true);
82 
83  void doSel(CallBacker*);
86 
89 
90  const uiString& labelText() const;
91  void setLabelText(const uiString&);
92  void setLabelSelectable(bool yn=true);
93 
95 
96  uiComboBox* inpBox() { return inp_; }
97  virtual uiObject* endObj(bool left);
98 
99 protected:
100 
103  bool selok_;
106 
108  uiButton* selbut_;
112 
113  void optCheck(CallBacker*);
114  void selDone(CallBacker*);
117 
118  virtual const char* userNameFromKey( const char* s ) const { return s; }
121 
122  int nrSpec() const;
123  void checkState() const;
124  void updateFromEntries();
125  bool haveEntry(const char*) const;
126 
127  virtual void objSel() {}
129 
130  void doFinalise(CallBacker*);
131 };
132 
133 
136 public:
137  uiIOFileSelect(uiParent*,const uiString& txt,
138  bool for_read,
139  const char* inp=0,
140  bool withclear=false);
141 
142  void setFilter( const char* f ) { filter = f; }
143  void selectDirectory( bool yn=true ) { seldir = yn; }
144 
145  bool fillPar(IOPar&) const;
146  void usePar(const IOPar&);
147 
148  // Some standard types of files
149  static IOPar& ixtablehistory();
150  static IOPar& tmpstoragehistory();
151 
152 protected:
153 
154  void doFileSel(CallBacker*);
155  bool forread;
157  bool seldir;
158 
159 };
160 
161 #endif
Definition: uigroup.h:54
#define mExpClass(module)
Definition: commondefs.h:160
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
Setup(const uiString &seltext=uiString::emptyString())
Definition: uiiosel.h:37
void setHSzPol(SzPolicy)
uiLabel * lbl_
Definition: uiiosel.h:110
CallBack doselcb_
Definition: uiiosel.h:105
virtual void setReadOnly(bool yn=true)
BufferString filter
Definition: uiiosel.h:156
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
Definition: i_layout.h:28
uiCheckBox * optbox_
Definition: uiiosel.h:111
Definition: uistrings.h:24
static const uiString & emptyString()
Definition: uistring.h:109
BufferStringSet entries_
Definition: uiiosel.h:101
The base class for most UI elements.
Definition: uiobj.h:38
Combo box.
Definition: uicombobox.h:32
void selectDirectory(bool yn=true)
Definition: uiiosel.h:143
Definition: uistring.h:89
Definition: uiparent.h:26
Set of BufferString objects.
Definition: bufstringset.h:28
virtual const char * userNameFromKey(const char *s) const
Definition: uiiosel.h:118
bool keepmytxt_
Definition: uiiosel.h:104
Notifier< uiIOSelect > optionalChecked
Definition: uiiosel.h:88
SzPolicy
How should the object&#39;s size behave? Undef : use default. Small : 1 base sz. Medium : 2* base sz + 1...
Definition: uiobj.h:58
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
bool haveempty_
Definition: uiiosel.h:102
virtual void objSel()
notification when user selects from combo
Definition: uiiosel.h:127
#define mDefSetupMemb(typ, memb)
Definition: commondefs.h:137
uiComboBox * inp_
Definition: uiiosel.h:107
uiButton * selbut_
Definition: uiiosel.h:108
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
virtual void processInput()
Definition: uiiosel.h:80
Notifier< uiIOSelect > selectionDone
Definition: uiiosel.h:87
uiComboBox * inpBox()
Definition: uiiosel.h:96
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
ObjectSet< uiButton > extselbuts_
Definition: uiiosel.h:109
Definition: uilabel.h:24
bool forread
Definition: uiiosel.h:155
bool seldir
Definition: uiiosel.h:157
void setCurrentItem(int)
bool selok_
Definition: uiiosel.h:103
bool isEmpty(const NLAModel *mdl)
Definition: uiiosel.h:134
void setEmpty()
CallBacks object-oriented (object + method).
Definition: callback.h:57
Definition: uibutton.h:134
void setFilter(const char *f)
Definition: uiiosel.h:142
Definition: uiiosel.h:34
UI element for selection of data objects.
Definition: uiiosel.h:30

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