00001
00032 #ifndef INC_MI32_MIDIALOG_H
00033 #define INC_MI32_MIDIALOG_H
00034
00035 #ifndef INC_MI32_XDEFNS_H
00036 #include <mi32/xdefns.h>
00037 #endif
00038
00039 struct BUTTONITEM;
00040
00041
00042 #ifndef NO_DEPRECATED
00052 DEPRECATED class MIDIALOG {
00053 public:
00054
00055
00056
00057 enum BUTTONS {
00058 BUTTONS_Default = 0x00,
00059 BUTTON_OK = 0x01,
00060 BUTTON_Cancel = 0x02,
00061 BUTTON_Apply = 0x04,
00062 BUTTON_Close = 0x08
00063 };
00064
00065
00066
00068 MIDIALOG (
00069 );
00070
00072 virtual ~MIDIALOG (
00073 ) = 0;
00074
00075
00076
00078 void Close (
00079 bool notify = true
00080 );
00081
00083 ERRVALUE CreateModeless (
00084 MDLGPARENT dlgparent
00085 );
00086
00090 ERRVALUE DoModal (
00091 MDLGPARENT dlgparent
00092 );
00093
00095 bool IsCreated (
00096 ) const {
00097 return (m_form != 0);
00098 }
00099
00101 bool IsOpen (
00102 ) const {
00103 #ifndef WIN32_NATIVE
00104 return (m_form != 0 && XtIsManaged(m_form));
00105 #else
00106 return (false);
00107 #endif
00108 }
00109
00111 ERRVALUE Open (
00112 );
00113
00115 void SetApplySensitive (
00116 bool sensitive
00117 ) const {
00118 #ifndef WIN32_NATIVE
00119 MxSetSensitive(m_ApplyPB,sensitive);
00120 #endif
00121 return;
00122 }
00123
00124 protected:
00125
00126
00127
00131 virtual const char* GetDialogHelpID (
00132 ) const = 0;
00133
00137 virtual const char* GetDialogName (
00138 ) const = 0;
00139
00145 virtual void OnApply (
00146 );
00147
00155 virtual void OnCancel (
00156 );
00157
00159 virtual void OnClose (
00160 );
00161
00168 virtual ERRVALUE OnInitDialog (
00169 Widget form
00170 ) = 0;
00171
00179 virtual void OnOK (
00180 );
00181
00186 virtual void OnOpen (
00187 );
00188
00189
00190
00194 Widget CreateButtonRow (
00195 const BUTTONITEM* ButtonItems,
00196 void *cbdata = 0,
00197 void *userdata = 0
00198 );
00199
00208 Widget CreateButtons (
00209 BUTTONS buttons = BUTTONS_Default
00210 );
00211
00213 Widget GetMainForm (
00214 ) const {
00215 return (m_form);
00216 }
00217
00219 void SetupButtonApply (
00220 BUTTONITEM& bi
00221 );
00222
00224 void SetupButtonCancel (
00225 BUTTONITEM& bi
00226 );
00227
00229 void SetupButtonClose (
00230 BUTTONITEM& bi
00231 );
00232
00234 void SetupButtonOK (
00235 BUTTONITEM& bi
00236 );
00237
00238 private:
00239 #ifndef GENERATING_DOXYGEN_OUTPUT
00241 Widget m_form;
00242 Widget m_ApplyPB;
00243 bool m_IsModal;
00244 ERRVALUE m_RetValue;
00245
00246
00247
00249 ERRVALUE CreateDialog (
00250 MDLGPARENT dlgparent,
00251 bool modal = false
00252 );
00253
00254 static void CB_Apply (Widget, MIDIALOG*, void*);
00255 static void CB_Cancel (Widget, MIDIALOG*, void*);
00256 static void CB_Destroy (Widget, MIDIALOG*, void*);
00257 static void CB_OK (Widget, MIDIALOG*, void*);
00258
00259 MXXTCB_ADD(MIDIALOG);
00260 MXXTCB_REMOVE(MIDIALOG);
00261
00262
00263
00264 MIDIALOG (
00265 const MIDIALOG& rhs
00266 );
00267
00268 MIDIALOG& operator= (
00269 const MIDIALOG& rhs
00270 );
00271 #endif // GENERATING_DOXYGEN_OUTPUT
00272
00273 };
00274
00275 #ifndef GENERATING_DOXYGEN_OUTPUT
00276 DEFINE_ENUM_OP_BITWISE(MIDIALOG::BUTTONS)
00277 #endif
00278
00279 #endif
00280
00281
00282 #endif // INC_MI32_MIDIALOG_H