OpendTect-6_4  6.4
uiioobjsel.h
Go to the documentation of this file.
1 #ifndef uiioobjsel_h
2 #define uiioobjsel_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 "uiiosel.h"
17 #include "helpview.h"
18 
19 class IOObj;
20 class CtxtIOObj;
21 class IOObjContext;
22 class uiIOObjRetDlg;
23 class uiIOObjInserter;
25 
26 
40 public:
41 
42  mExpClass(uiIo) Setup : public uiIOSelect::Setup
43  {
44  public:
46  : uiIOSelect::Setup(seltext)
47  , confirmoverwr_(true)
48  , withinserters_(true)
49  , withwriteopts_(true)
50  , filldef_(true) {}
51 
52  mDefSetupMemb(bool,confirmoverwr)
53  mDefSetupMemb(bool,withinserters)
54  mDefSetupMemb(bool,withwriteopts)
55  mDefSetupMemb(bool,filldef)
56  };
57 
59  const uiString& seltxt=uiString::emptyString());
60  uiIOObjSel(uiParent*,const IOObjContext&,const Setup&);
61  ~uiIOObjSel();
62 
63  void setInput(const IOObj&);
64  void setInput(const MultiID&);
65  virtual void setEmpty();
66 
67  MultiID key(bool noerr=false) const;
68  const IOObj* ioobj(bool noerr=false) const;
69  IOObj* getIOObj(bool noerr=false);
70 
71  virtual bool fillPar(IOPar&) const;
72  bool fillPar(IOPar&,const char* baseky) const;
73  virtual void usePar(const IOPar&);
74  void usePar(const IOPar&,const char* baseky);
75 
76  void fillEntries();
77  void setConfirmOverwrite( bool yn )
78  { setup_.confirmoverwr_ = yn; }
79  void setHelpKey(const HelpKey& helpkey) { helpkey_=helpkey; }
80 
81  virtual void updateInput();
82  virtual void processInput();
83  virtual bool existingTyped() const
85  { return existingUsrName(getInput()); }
88 
89  virtual MultiID validKey() const;
90  virtual uiObject* endObj(bool left);
91 
92  static IOObjContext getWriteIOObjCtxt(IOObjContext);
93 
94 protected:
95 
97 
100  Setup setup_;
104 
105  void preFinaliseCB(CallBacker*);
106  void doObjSel(CallBacker*);
107  void objInserted(CallBacker*);
108  void survChangedCB(CallBacker*);
109  void initRead();
110 
111  virtual const char* userNameFromKey(const char*) const;
112  virtual void objSel();
113  virtual void commitSucceeded() {}
114 
115  virtual void fillDefault();
116  virtual void newSelection(uiIOObjRetDlg*) {}
117  virtual uiIOObjRetDlg* mkDlg();
118  virtual IOObj* createEntry(const char*);
119  void obtainIOObj();
120  bool existingUsrName(const char*) const;
121  void doCommit(bool) const;
122 
123 private:
124 
125  void init();
126 
127 public: // old style
128 
129  /* Comments for old style only:
130 On creation, the object makes a copy of your CtxtIOObj. When needed, you can do
131 commitInput() to get the selection in your input CtxtIOObj;
132 
133 You *have* to do commitInput() to get any selection! Other functions like
134 processInput() are special stuff for special situations.
135 
136 You have to check commitInput() and issue and error message if necessary. In
137 the new style, this is done if the setup.optional_ flag is false (this is the
138 default).
139 */
140 
142  const uiString& seltxt=uiString::emptyString());
143  uiIOObjSel(uiParent*,CtxtIOObj&,const Setup&);
144  bool commitInput();
145  bool doCommitInput(bool&);
146  CtxtIOObj& ctxtIOObj( bool work=false )
147  { return work ? workctio_ : inctio_; }
148 
149 };
150 
151 
152 #define mWriteIOObjContext(clss) \
153  uiIOObjSel::getWriteIOObjCtxt(mIOObjContext(clss))
154 #define mRWIOObjContext(clss,forread) \
155  (forread ? mIOObjContext(clss) : mWriteIOObjContext(clss))
156 
157 
158 #endif
#define mExpClass(module)
Definition: commondefs.h:160
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
Definition: ioobj.h:58
Definition: uiioobjsel.h:42
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
Dialog letting the user select an object. It returns an IOObj* after successful go().
Definition: uiioobjseldlg.h:22
virtual void newSelection(uiIOObjRetDlg *)
Definition: uiioobjsel.h:116
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
Setup(const uiString &seltext=uiString::emptyString())
Definition: uiioobjsel.h:45
Definition: i_layout.h:28
bool init()
static const uiString & emptyString()
Definition: uistring.h:109
The base class for most UI elements.
Definition: uiobj.h:38
virtual void commitSucceeded()
Definition: uiioobjsel.h:113
Definition: uistring.h:89
CtxtIOObj & ctxtIOObj(bool work=false)
Definition: uiioobjsel.h:146
Definition: uiparent.h:26
Definition: helpview.h:49
Holds an IOObjCtxt plus a pointer to an IOObj and/or an IOPar.
Definition: ctxtioobj.h:142
HelpKey helpkey_
Definition: uiioobjsel.h:101
uiIOObjSelWriteTranslator * wrtrselfld_
Definition: uiioobjsel.h:96
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
CtxtIOObj & inctio_
Definition: uiioobjsel.h:98
inserts a new object into the OD data store.
Definition: uiioobjinserter.h:31
bool inctiomine_
Definition: uiioobjsel.h:102
#define mDefSetupMemb(typ, memb)
Definition: commondefs.h:137
User Interface (UI) element for selection of IOObjs.
Definition: uiioobjsel.h:38
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
void setConfirmOverwrite(bool yn)
Definition: uiioobjsel.h:77
ObjectSet< uiIOObjInserter > inserters_
Definition: uiioobjsel.h:103
Group for selecting output translator.
Definition: uiioobjselwritetransl.h:80
Setup setup_
Definition: uiioobjsel.h:100
CtxtIOObj & workctio_
Definition: uiioobjsel.h:99
void setHelpKey(const HelpKey &helpkey)
Definition: uiioobjsel.h:79
UI element for selection of data objects.
Definition: uiiosel.h:30
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