OpendTect-6_4  6.4
uiioobjselgrp.h
Go to the documentation of this file.
1 #ifndef uiioobjselgrp_h
2 #define uiioobjselgrp_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 "uiiomod.h"
16 #include "uigroup.h"
17 #include "multiid.h"
18 #include "bufstringset.h"
19 
20 
21 class IOObj;
22 class CtxtIOObj;
23 class Translator;
24 class IOObjContext;
25 class uiGenInput;
26 class uiIOObjManipGroup;
27 class uiIOObjSelGrp;
28 class uiIOObjSelGrpManipSubj;
29 class uiListBox;
30 class uiButton;
31 class uiToolButton;
32 class uiIOObjInserter;
33 class uiListBoxChoiceIO;
35 
36 
48 public:
49 
51  {
52  public:
54  : choicemode_(cm)
55  , allowreloc_(false)
56  , allowremove_(true)
57  , allowsetdefault_(false)
58  , withinserters_(true)
59  , withwriteopts_(true)
60  , confirmoverwrite_(true) {}
61 
62  mDefSetupMemb(OD::ChoiceMode,choicemode);
63  mDefSetupMemb(bool,allowreloc);
64  mDefSetupMemb(bool,allowremove);
65  mDefSetupMemb(bool,allowsetdefault);
66  mDefSetupMemb(bool,withinserters);
67  mDefSetupMemb(bool,withwriteopts);
68  mDefSetupMemb(bool,confirmoverwrite);
69 
70  inline bool isMultiChoice() const
71  { return ::isMultiChoice( choicemode_ ); }
72 
73  };
74 
75 # define mDefuiIOObjSelGrpConstructors(ctxtclss) \
76  uiIOObjSelGrp(uiParent*,const ctxtclss&); \
77  uiIOObjSelGrp(uiParent*,const ctxtclss&, \
78  const uiString& seltxt); \
79  uiIOObjSelGrp(uiParent*,const ctxtclss&, \
80  const Setup&); \
81  uiIOObjSelGrp(uiParent*,const ctxtclss&, \
82  const uiString& seltxt,const Setup&)
83 
86  ~uiIOObjSelGrp();
87 
88  bool isEmpty() const;
89  int size() const;
90  inline bool isMultiChoice() const { return setup_.isMultiChoice(); }
91 
92  // mostly interesting for read
93  int currentItem() const;
94  MultiID currentID() const;
95  int nrChosen() const;
96  bool isChosen(int) const;
97  const MultiID& chosenID(int idx=0) const;
98  void getChosen(TypeSet<MultiID>&) const;
99  void getChosen(BufferStringSet&) const;
100  void setCurrent(int);
101  void setCurrent(const MultiID&);
102  void setChosen(int,bool yn=true);
103  void setChosen(const TypeSet<MultiID>&);
104  void chooseAll(bool yn=true);
105 
106  bool updateCtxtIOObj();
107  const CtxtIOObj& getCtxtIOObj() const { return ctio_; }
108  const IOObjContext& getContext() const;
109  void setContext(const IOObjContext&);
110  void setDefTranslator(const Translator*);
111 
112  uiGroup* getTopGroup() { return topgrp_; }
113  uiGenInput* getNameField() { return nmfld_; }
114  uiGenInput* getFilterField() { return filtfld_; }
115  uiListBox* getListField() { return listfld_; }
116  uiIOObjManipGroup* getManipGroup();
117  const ObjectSet<MultiID>& getIOObjIds() const { return ioobjids_; }
118 
119  void setConfirmOverwrite( bool yn )
120  { setup_.confirmoverwrite_ = yn; }
121  void setAskedToOverwrite( bool yn )
122  { asked2overwrite_ = yn; }
123  bool askedToOverwrite() const { return asked2overwrite_; }
124  void setSurveyDefaultSubsel(const char* subsel);
125 
126  virtual bool fillPar(IOPar&) const;
127  virtual void usePar(const IOPar&);
128 
135  void fullUpdate(const MultiID& kpselected);
136  void fullUpdate(int);
137 
138 protected:
139 
148 
152  uiIOObjSelGrpManipSubj* manipgrpsubj;
158  uiGroup* topgrp_;
159 
160  void fillListBox();
161  IOObj* getIOObj(int);
162  virtual bool createEntry(const char*);
163  IOObj* updStatusBarInfo(bool);
164  void triggerStatusMsg(const char*);
165 
166  void setInitial(CallBacker*);
167  void selChg(CallBacker*);
168  void choiceChg(CallBacker*);
169  void filtChg(CallBacker*);
170  void objInserted(CallBacker*);
171  void nameAvCB(CallBacker*);
172  void delPress(CallBacker*);
173  void makeDefaultCB(CallBacker*);
174  void readChoiceDone(CallBacker*);
175  void writeChoiceReq(CallBacker*);
176 
177 private:
178 
179  void init(const uiString& st=uiString::emptyString());
180  void mkTopFlds(const uiString&);
181  void mkWriteFlds();
182  void mkManipulators();
183 
184  void newOutputNameCB(CallBacker*);
185 
186  friend class uiIOObjSelDlg;
187  friend class uiIOObjSelGrpManipSubj;
188 
189 };
190 
191 
192 #endif
Definition: uigroup.h:54
#define mExpClass(module)
Definition: commondefs.h:160
uiGenInput * getNameField()
Definition: uiioobjselgrp.h:113
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
ChoiceMode
What to choose from any list-type UI object.
Definition: oduicommon.h:42
Definition: ioobj.h:58
Definition: uiioobjselgrp.h:50
uiGroup * topgrp_
Definition: uiioobjselgrp.h:158
uiGroup * getTopGroup()
Definition: uiioobjselgrp.h:112
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
Notifier< uiIOObjSelGrp > newStatusMsg
Definition: uiioobjselgrp.h:131
CtxtIOObj & ctio_
Definition: uiioobjselgrp.h:140
BufferString surveydefaultsubsel_
Definition: uiioobjselgrp.h:145
Notifier< uiIOObjSelGrp > selectionChanged
Definition: uiioobjselgrp.h:129
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
bool init()
uiListBox * listfld_
Definition: uiioobjselgrp.h:149
void setConfirmOverwrite(bool yn)
Definition: uiioobjselgrp.h:119
Definition: oduicommon.h:45
const CtxtIOObj & getCtxtIOObj() const
Definition: uiioobjselgrp.h:107
Setup(OD::ChoiceMode cm=OD::ChooseOnlyOne)
Definition: uiioobjselgrp.h:53
static const uiString & emptyString()
Definition: uistring.h:109
Definition: uistring.h:89
uiToolButton * mkdefbut_
Definition: uiioobjselgrp.h:154
uiGenInput * nmfld_
Definition: uiioobjselgrp.h:150
Set of BufferString objects.
Definition: bufstringset.h:28
uiIOObjSelWriteTranslator * wrtrselfld_
Definition: uiioobjselgrp.h:153
Holds an IOObjCtxt plus a pointer to an IOObj and/or an IOPar.
Definition: ctxtioobj.h:142
uiGenInput * getFilterField()
Definition: uiioobjselgrp.h:114
Definition: uiioobjseldlg.h:35
List Box.
Definition: uilistbox.h:75
bool askedToOverwrite() const
Definition: uiioobjselgrp.h:123
#define mDefuiIOObjSelGrpConstructors(ctxtclss)
Definition: uiioobjselgrp.h:75
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
Notifier< uiIOObjSelGrp > itemChosen
Definition: uiioobjselgrp.h:130
BufferStringSet ioobjnms_
Definition: uiioobjselgrp.h:143
Allows save/restore of chosen items for a uiListBox.
Definition: uilistboxchoiceio.h:36
Buttongroup to manipulate an IODirEntryList.
Definition: uiioobjmanip.h:84
BufferStringSet dispnms_
Definition: uiioobjselgrp.h:144
uiGenInput * filtfld_
Definition: uiioobjselgrp.h:151
inserts a new object into the OD data store.
Definition: uiioobjinserter.h:31
General Input Element.
Definition: uigeninput.h:58
ObjectSet< uiIOObjInserter > inserters_
Definition: uiioobjselgrp.h:157
#define mDefSetupMemb(typ, memb)
Definition: commondefs.h:137
uiIOObjSelGrpManipSubj * manipgrpsubj
Definition: uiioobjselgrp.h:152
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
uiListBox * getListField()
Definition: uiioobjselgrp.h:115
Setup setup_
Definition: uiioobjselgrp.h:141
I/O Interpreter class for a certain object type.
Definition: transl.h:123
bool isMultiChoice() const
Definition: uiioobjselgrp.h:90
void setAskedToOverwrite(bool yn)
Definition: uiioobjselgrp.h:121
ObjectSet< const char > iconnms_
Definition: uiioobjselgrp.h:147
bool asked2overwrite_
Definition: uiioobjselgrp.h:146
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
Group for selecting output translator.
Definition: uiioobjselwritetransl.h:80
Definition: uitoolbutton.h:22
const ObjectSet< MultiID > & getIOObjIds() const
Definition: uiioobjselgrp.h:117
ObjectSet< MultiID > ioobjids_
Definition: uiioobjselgrp.h:142
ObjectSet< uiButton > insertbuts_
Definition: uiioobjselgrp.h:156
void selChg(CallBacker *)
bool isEmpty(const NLAModel *mdl)
bool isMultiChoice() const
Definition: uiioobjselgrp.h:70
bool isMultiChoice(OD::ChoiceMode cm)
Definition: oduicommon.h:90
uiListBoxChoiceIO * lbchoiceio_
Definition: uiioobjselgrp.h:155
Basic group for letting the user select an object.
Definition: uiioobjselgrp.h:46
Compound key consisting of ints.
Definition: multiid.h:25
Holds the context for selecting and/or creating IOObjs.
Definition: ctxtioobj.h:62

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