OpendTect-6_4  6.4
uimsg.h
Go to the documentation of this file.
1 #ifndef uimsg_H
2 #define uimsg_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: 26/04/2000
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "uibasemod.h"
16 #include "gendefs.h"
17 #include "uistring.h"
18 class MouseCursorChanger;
19 class uiMainWin;
20 class uiStatusBar;
21 mFDQtclass(QWidget)
22 class BufferStringSet;
23 class FileMultiString;
24 class uiParent;
25 
26 
29 
30 friend class uiMain;
31 mGlobal(uiBase) friend uiMsg& uiMSG();
32 
33 public:
34 
35  // Messages
36  void message(const uiString&,
37  const uiString& part2=uiString::emptyString(),
38  const uiString& part3=uiString::emptyString());
39  bool message(const uiString&,
40  const uiString& part2,
41  const uiString& part3,
42  bool withdontshowatain );
46  void warning(const uiString&,
47  const uiString& part2=uiString::emptyString(),
48  const uiString& part3=uiString::emptyString());
49  bool warning(const uiString&,
50  const uiString& part2,
51  const uiString& part3,
52  bool withdontshowatain );
56  void error(const uiString&,
57  const uiString& part2=uiString::emptyString(),
58  const uiString& part3=uiString::emptyString());
59  bool error(const uiString&,
60  const uiString& part2,
61  const uiString& part3,
62  bool withdontshowatain );
66  void errorWithDetails(const FileMultiString&);
70  void errorWithDetails(const uiStringSet&,
71  const uiString& firstmsg);
72  void errorWithDetails(const uiStringSet&);
73  void errorWithDetails(const BufferStringSet&);
74 
75  // Interaction
76  int question(const uiString&,
77  const uiString& textyes,
78  const uiString& textno,
79  const uiString& textcncl,
80  const uiString& caption,
81  bool* dontaskagain);
85  int question(const uiString&,
86  const uiString& textyes=uiString::emptyString(),
87  const uiString& textno=uiString::emptyString(),
88  const uiString& textcncl=uiString::emptyString(),
89  const uiString& caption=uiString::emptyString());
90  int askSave(const uiString&,bool cancelbut=true);
92  int askRemove(const uiString&,bool cancelbut=false);
94  int askContinue(const uiString&);
96  int askOverwrite(const uiString&);
98  int ask2D3D(const uiString&,bool cancelbut=false);
100 
101  bool askGoOn(const uiString&,bool withyesno=true);
103  bool askGoOn(const uiString& msg,const uiString& textyes,
104  const uiString& textno);
105  int askGoOnAfter(const uiString&,
106  const uiString& cnclmsg=uiString::emptyString(),
107  const uiString& textyes=uiString::emptyString(),
108  const uiString& textno=uiString::emptyString());
109  bool askGoOn(const uiString&,bool withyesno,
110  bool* dontaskagain);
115  bool askGoOn(const uiString& msg,const uiString& textyes,
116  const uiString& textno,
117  bool* dontaskagain);
121  int askGoOnAfter(const uiString&,
122  const uiString& cnclmsg,
123  const uiString& textyes,
124  const uiString& textno,
125  bool* dontaskagain);
130  bool showMsgNextTime(const uiString&,
131  const uiString& msg=uiString::emptyString());
134 
135  static void setNextCaption(const uiString&);
138 
139  uiMainWin* setMainWin(uiMainWin*);
140 
141  bool toStatusbar(uiString,int fld=0,int msec=-1);
143  uiStatusBar* statusBar();
144 
145  void about(const uiString&);
146  void aboutOpendTect(const uiString&);
147 
148  enum Icon { NoIcon, Information, Warning, Critical, Question };
149  int showMessageBox(Icon icon,QWidget* parent,
150  const uiString& txt,const uiString& yestxtinp,
151  const uiString& notxtinp,const uiString& cncltxtinp,
153  int showMessageBox(Icon icon,QWidget* parent,
154  const uiString& txt,const uiString& yestxtinp,
155  const uiString& notxtinp,const uiString& cncltxtinp,
156  const uiString& title,
157  bool* notagain);
158 
159  static uiString sDontShowAgain();
160 
161 protected:
162 
163  uiMsg();
164 
165  mQtclass(QWidget*) popParnt();
166 
167  static uiMsg* theinst_;
168 
169 private:
170 
171  int beginCmdRecEvent( const char* wintitle );
172  void endCmdRecEvent(int refnr,int retval,const char* buttxt0,
173  const char* buttxt1=0,const char* buttxt2=0);
174 
176 };
177 
178 mGlobal(uiBase) uiMsg& uiMSG();
179 
180 
183 {
184 public:
186  : isset_( np )
187  , oldparent_( 0 )
188  {
189  if ( np ) oldparent_ = ::uiMSG().setMainWin( np );
190  }
191 
193  { if ( isset_ ) ::uiMSG().setMainWin( oldparent_ ); }
194 protected:
196  bool isset_;
197 };
198 
199 
200 
211 {
212 public:
213 
214  uiUserShowWait(uiParent*,const uiString&,int sbfld=0);
215  ~uiUserShowWait() { readyNow(); }
216 
217  void setMessage(const uiString&);
218  void readyNow();
219 
220 protected:
221 
224  const int fldidx_;
225 
226 };
227 
228 
229 
230 #endif
Sets the uiMSG's main window temporary during the scope of the object.
Definition: uimsg.h:182
#define mExpClass(module)
Definition: commondefs.h:160
Definition: oduicommon.h:63
User interface main window.
Definition: uimainwin.h:36
uiMainWin * oldparent_
Definition: uimsg.h:195
#define mQtclass(cls)
Definition: commondefs.h:229
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
#define mGlobal(module)
Definition: commondefs.h:163
uiStatusBar * sb_
Definition: uimsg.h:222
Definition: uimsg.h:27
uiMainWin * uimainwin_
Definition: uimsg.h:175
~uiUserShowWait()
Definition: uimsg.h:215
Definition: uimsg.h:148
uiMainWin * setMainWin(uiMainWin *)
return old
static const uiString & emptyString()
Definition: uistring.h:109
Definition: uistring.h:89
Icon
Definition: uimsg.h:148
Definition: uiparent.h:26
Set of BufferString objects.
Definition: bufstringset.h:28
uiMsgMainWinSetter(uiMainWin *np)
Definition: uimsg.h:185
bool isset_
Definition: uimsg.h:196
Definition: uistatusbar.h:26
SeparString with backquotes as separators, use in most ascii files.
Definition: separstr.h:119
void message(const char *)
default: to stderr
uiMsg & uiMSG()
~uiMsgMainWinSetter()
Definition: uimsg.h:192
tells user something is happening.
Definition: uimsg.h:210
MouseCursorChanger * mcc_
Definition: uimsg.h:223
uiParent const uiString & title
pops a selector box to select a new font
Definition: uifont.h:27
Definition: uimain.h:30
static uiMsg * theinst_
Definition: uimsg.h:167
mFDQtclass(QWidget) class BufferStringSet
Definition: uibody.h:18
Class to automatically change cursor, and change it back automatically when class is running out of s...
Definition: mousecursor.h:141
Definition: uistring.h:218
const int fldidx_
Definition: uimsg.h:224

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