00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00020 #ifndef __vtkKWMessageDialog_h
00021 #define __vtkKWMessageDialog_h
00022
00023 #include "vtkKWDialog.h"
00024
00025 class vtkKWApplication;
00026 class vtkKWCheckButton;
00027 class vtkKWFrame;
00028 class vtkKWMessage;
00029 class vtkKWLabel;
00030 class vtkKWPushButton;
00031
00032 class KWWIDGETS_EXPORT vtkKWMessageDialog : public vtkKWDialog
00033 {
00034 public:
00035 static vtkKWMessageDialog* New();
00036 vtkTypeRevisionMacro(vtkKWMessageDialog,vtkKWDialog);
00037 void PrintSelf(ostream& os, vtkIndent indent);
00038
00040 virtual void Create(vtkKWApplication *app);
00041
00043
00044 virtual void SetText(const char *);
00045 virtual void SetTextWidth(int);
00046 virtual int GetTextWidth();
00048
00050
00051 enum
00052 {
00053 StyleMessage = 0,
00054 StyleYesNo,
00055 StyleOkCancel,
00056 StyleOkOtherCancel,
00057 StyleCancel
00058 };
00059
00060 vtkSetMacro(Style,int);
00061 vtkGetMacro(Style,int);
00062 void SetStyleToMessage()
00063 { this->SetStyle(vtkKWMessageDialog::StyleMessage); };
00064 void SetStyleToYesNo()
00065 { this->SetStyle(vtkKWMessageDialog::StyleYesNo); };
00066 void SetStyleToOkCancel()
00067 { this->SetStyle(vtkKWMessageDialog::StyleOkCancel); };
00068 void SetStyleToOkOtherCancel()
00069 { this->SetStyle(vtkKWMessageDialog::StyleOkOtherCancel); };
00070 void SetStyleToCancel()
00071 { this->SetStyle(vtkKWMessageDialog::StyleCancel); };
00073
00075
00076 vtkSetStringMacro(DialogName);
00077 vtkGetStringMacro(DialogName);
00079
00081
00082 enum
00083 {
00084 RememberYes = 0x00002,
00085 RememberNo = 0x00004,
00086 ErrorIcon = 0x00008,
00087 WarningIcon = 0x00010,
00088 QuestionIcon = 0x00020,
00089 YesDefault = 0x00040,
00090 NoDefault = 0x00080,
00091 OkDefault = 0x00100,
00092 CancelDefault = 0x00200,
00093 Beep = 0x00400,
00094 PackVertically = 0x00800,
00095 InvokeAtPointer = 0x01000
00096 };
00097
00098 vtkSetMacro(Options, int);
00099 vtkGetMacro(Options, int);
00101
00103
00105 vtkSetStringMacro(OKButtonText);
00106 vtkGetStringMacro(OKButtonText);
00108
00110
00112 vtkSetStringMacro(CancelButtonText);
00113 vtkGetStringMacro(CancelButtonText);
00115
00117
00119 vtkSetStringMacro(OtherButtonText);
00120 vtkGetStringMacro(OtherButtonText);
00122
00124
00128 static void PopupMessage(vtkKWApplication *app, vtkKWWindowBase *masterWin,
00129 const char* title,
00130 const char* message, int options = 0);
00131 static int PopupYesNo(vtkKWApplication *app, vtkKWWindowBase *masterWin,
00132 const char* title,
00133 const char* message, int options = 0);
00134 static int PopupYesNo(vtkKWApplication *app, vtkKWWindowBase *masterWin,
00135 const char* name,
00136 const char* title, const char* message,
00137 int options = 0);
00138 static int PopupOkCancel(vtkKWApplication *app, vtkKWWindowBase *masterWin,
00139 const char* title,
00140 const char* message, int options = 0);
00142
00144
00145 vtkGetObjectMacro(TopFrame, vtkKWFrame);
00146 vtkGetObjectMacro(MessageDialogFrame, vtkKWFrame);
00147 vtkGetObjectMacro(BottomFrame, vtkKWFrame);
00149
00151 virtual void SetIcon();
00152
00154
00155 vtkGetObjectMacro(OKButton, vtkKWPushButton);
00156 vtkGetObjectMacro(CancelButton, vtkKWPushButton);
00157 vtkGetObjectMacro(OtherButton, vtkKWPushButton);
00159
00161 virtual void Other();
00162
00164
00171 static int RestoreMessageDialogResponseFromRegistry(
00172 vtkKWApplication *app, const char *dialogname);
00173 static void SaveMessageDialogResponseToRegistry(
00174 vtkKWApplication *app, const char *dialogname, int response);
00176
00178
00183 virtual int PreInvoke();
00184 virtual void PostInvoke();
00186
00187 protected:
00188 vtkKWMessageDialog();
00189 ~vtkKWMessageDialog();
00190
00191 int Style;
00192 int Default;
00193 int Options;
00194 char *DialogName;
00195 char *DialogText;
00196
00197 vtkSetStringMacro(DialogText);
00198 vtkGetStringMacro(DialogText);
00199
00200 vtkKWFrame *TopFrame;
00201 vtkKWFrame *MessageDialogFrame;
00202 vtkKWFrame *BottomFrame;
00203 vtkKWMessage *Message;
00204 vtkKWFrame *ButtonFrame;
00205 vtkKWPushButton *OKButton;
00206 vtkKWPushButton *CancelButton;
00207 vtkKWPushButton *OtherButton;
00208 vtkKWLabel *Icon;
00209 vtkKWFrame *OKFrame;
00210 vtkKWFrame *CancelFrame;
00211 vtkKWFrame *OtherFrame;
00212 vtkKWCheckButton *CheckButton;
00213
00216 int GetRememberMessage();
00217
00218 char* OKButtonText;
00219 char* CancelButtonText;
00220 char* OtherButtonText;
00221
00222 private:
00223 vtkKWMessageDialog(const vtkKWMessageDialog&);
00224 void operator=(const vtkKWMessageDialog&);
00225 };
00226
00227
00228 #endif