OpendTect  6.3
uivarwizard.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: Feb 2010
9 ________________________________________________________________________
10 
11 -*/
12 
13 #include "uitoolsmod.h"
14 #include "iopar.h"
15 #include "notify.h"
16 #include "uistring.h"
17 class uiParent;
18 class uiVarWizardDlg;
19 
20 
27 mExpClass(uiTools) uiVarWizard : public CallBacker
29 public:
30 
32  virtual ~uiVarWizard() {}
33 
34  IOPar& pars() { return pars_; }
35  const IOPar& pars() const { return pars_; }
36  int state() const { return state_; }
37 
39 
40  static int cCancelled() { return 0; }
41  static int cFinished() { return 1; }
42  static int cWait4Dialog() { return 2; }
43 
44  virtual void raiseCurrent() = 0;
45 
46 protected:
47 
50  int state_;
52 
53  virtual void doPart() = 0;
54  virtual void closeDown();
55 
56  void nextAction();
57  static bool mustLeave(uiVarWizardDlg*);
58 };
59 
60 #define mSetVWState(st) \
61  { state_ = st; nextAction(); return; }
62 
63 #define mLaunchVWDialogOnly(dlg,clss,fn) \
64  dlg->windowClosed.notify( mCB(this,clss,fn) ); \
65  dlg->setDeleteOnClose( true ); dlg->go()
66 
67 #define mLaunchVWDialog(dlg,clss,fn) \
68  mLaunchVWDialogOnly(dlg,clss,fn); \
69  mSetVWState( cWait4Dialog() )
70 
71 #define mHandleVWCancel(dlg,backstate) \
72  if ( !dlg ) return; \
73  if ( !dlg->uiResult() ) \
74  { \
75  const bool doleave = mustLeave(dlg); \
76  dlg = 0; \
77  mSetVWState( doleave ? cCancelled() : ((int)backstate) ); \
78  }
#define mExpClass(module)
Definition: commondefs.h:157
Inherit from this class to be able to send and/or receive CallBacks.
Definition: callback.h:182
static int cCancelled()
Definition: uivarwizard.h:40
uiParent * parent_
Definition: uivarwizard.h:48
#define mODTextTranslationClass(clss)
Definition: uistring.h:37
friend class uiVarWizard
Definition: uivarwizarddlg.h:40
int state_
Definition: uivarwizard.h:50
'Server' for flexible wizards.
Definition: uivarwizard.h:27
IOPar pars_
Definition: uivarwizard.h:49
Definition: uiparent.h:24
IOPar & pars()
Definition: uivarwizard.h:34
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:53
Dialog in flexible wizard series.
Definition: uivarwizarddlg.h:20
virtual ~uiVarWizard()
Definition: uivarwizard.h:32
static int cWait4Dialog()
Definition: uivarwizard.h:42
int state() const
Definition: uivarwizard.h:36
static int cFinished()
Definition: uivarwizard.h:41
const IOPar & pars() const
Definition: uivarwizard.h:35
Notifier< uiVarWizard > processEnded
Definition: uivarwizard.h:38
int afterfinishedstate_
Definition: uivarwizard.h:51
IOPar & pars_
Definition: uivarwizarddlg.h:34

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