OpendTect-6_4  6.4
uivarwizard.h
Go to the documentation of this file.
1 #ifndef uivarwizard_h
2 #define uivarwizard_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Bert
9  Date: Feb 2010
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "uitoolsmod.h"
16 #include "iopar.h"
17 #include "uistring.h"
18 class uiParent;
19 class uiVarWizardDlg;
20 
21 
28 mExpClass(uiTools) uiVarWizard : public CallBacker
30 public:
31 
33  virtual ~uiVarWizard() {}
34 
35  IOPar& pars() { return pars_; }
36  const IOPar& pars() const { return pars_; }
37  int state() const { return state_; }
38 
40 
41  static int cCancelled() { return 0; }
42  static int cFinished() { return 1; }
43  static int cWait4Dialog() { return 2; }
44 
45  virtual void raiseCurrent() = 0;
46 
47 protected:
48 
51  int state_;
53 
54  virtual void doPart() = 0;
55  virtual void closeDown();
56 
57  void nextAction();
58  static bool mustLeave(uiVarWizardDlg*);
59 };
60 
61 #define mSetVWState(st) \
62  { state_ = st; nextAction(); return; }
63 
64 #define mLaunchVWDialogOnly(dlg,clss,fn) \
65  dlg->windowClosed.notify( mCB(this,clss,fn) ); \
66  dlg->setDeleteOnClose( true ); dlg->go()
67 
68 #define mLaunchVWDialog(dlg,clss,fn) \
69  mLaunchVWDialogOnly(dlg,clss,fn); \
70  mSetVWState( cWait4Dialog() )
71 
72 #define mHandleVWCancel(dlg,backstate) \
73  if ( !dlg ) return; \
74  if ( !dlg->uiResult() ) \
75  { \
76  const bool doleave = mustLeave(dlg); \
77  dlg = 0; \
78  mSetVWState( doleave ? cCancelled() : ((int)backstate) ); \
79  }
80 
81 
82 
83 #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
static int cCancelled()
Definition: uivarwizard.h:41
uiParent * parent_
Definition: uivarwizard.h:49
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
friend class uiVarWizard
Definition: uivarwizarddlg.h:42
int state_
Definition: uivarwizard.h:51
'Server' for flexible wizards.
Definition: uivarwizard.h:28
IOPar pars_
Definition: uivarwizard.h:50
Definition: uiparent.h:26
IOPar & pars()
Definition: uivarwizard.h:35
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
Dialog in flexible wizard series.
Definition: uivarwizarddlg.h:22
virtual ~uiVarWizard()
Definition: uivarwizard.h:33
static int cWait4Dialog()
Definition: uivarwizard.h:43
int state() const
Definition: uivarwizard.h:37
static int cFinished()
Definition: uivarwizard.h:42
const IOPar & pars() const
Definition: uivarwizard.h:36
Notifier< uiVarWizard > processEnded
Definition: uivarwizard.h:39
int afterfinishedstate_
Definition: uivarwizard.h:52
IOPar & pars_
Definition: uivarwizarddlg.h:36

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