00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef INC_MGUI_DLGQUESTION_H
00026 #define INC_MGUI_DLGQUESTION_H
00027
00028 #ifndef INC_MI32_MDLG_H
00029 #include <mi32/mdlg.h>
00030 #endif
00031
00032 #ifndef INC_MGUI_DLGSHELL_H
00033 #include <mgui/dlgshell.h>
00034 #endif
00035
00036 #ifndef INC_MGUI_LISTITEM_H
00037 #include <mgui/listitem.h>
00038 #endif
00039
00040 #ifndef INC_MGUI_CTRL_H
00041 #include <mgui/ctrl.h>
00042 #endif
00043
00044
00045 namespace MGUI {
00046
00047
00048
00049
00050 class DLG_QUESTION : public MGUI::DLGSHELL {
00051 public:
00052
00053 enum TOGGLETYPE {
00054 TOGGLETYPE_NeverAsk,
00055 TOGGLETYPE_AlwaysAsk
00056 };
00057
00058
00059 DLG_QUESTION (
00060 const MISTRING& dlgtitle,
00061 const MISTRING& text,
00062 DLGQ_STYLE style,
00063 INT32 dftresponse,
00064 HELPID helpid = HELPID__None
00065 );
00066
00067
00068 ~DLG_QUESTION (
00069 );
00070
00071
00072
00073 void AddButton (
00074 const MISTRING& text,
00075 INT32 response
00076 );
00077
00078
00079
00080 bool CheckNoShow (
00081 ) const;
00082
00083
00084 INT32 GetResponse (
00085 ) const { return (m_response); }
00086
00087
00088
00089 bool SetupToggle (
00090 const char *IniGroup,
00091 const char *IniName,
00092 const MISTRING& ToggleText,
00093 TOGGLETYPE ToggleType
00094 );
00095
00096 private:
00097
00098 #ifndef GENERATING_DOXYGEN_OUTPUT
00099 class BUTTON : public MGUI::CTRL_PUSHBUTTON {
00100 public:
00101 BUTTON (
00102 DLG_QUESTION *pDlg,
00103 INT32 response
00104 );
00105 BUTTON (
00106 const BUTTON& rhs
00107 );
00108 void Create (
00109 MGUI::LAYOUT_PANE_BASE& ParentPane,
00110 const char *label
00111 ) { CTRL_PUSHBUTTON::Create(ParentPane,label,true); }
00112 void Create (
00113 MGUI::LAYOUT_PANE_BASE& ParentPane,
00114 const MISTRING& label
00115 ) { CTRL_PUSHBUTTON::Create(ParentPane,label,true); }
00116 private:
00117 DLG_QUESTION *m_pDlg;
00118 INT32 m_response;
00119 virtual void OnPressed ();
00120 };
00121
00122 INT32 m_response;
00123 MISTRING m_text;
00124 DLGQ_STYLE m_style;
00125 MILIST<LISTITEM> m_ExtraButtonItems;
00126 char *m_ToggleIniGroup;
00127 char *m_ToggleIniName;
00128 MISTRING m_ToggleText;
00129 TOGGLETYPE m_ToggleType;
00130 CTRL_LABEL m_TextLabel;
00131 CTRL_TOGGLEBUTTON_T<DLG_QUESTION> m_Toggle;
00132 MILIST<BUTTON> m_Buttons;
00133
00134 BUTTON& CreateButtonLow (
00135 const char *label,
00136 DLGRESPONSE response
00137 );
00138
00139 void OnToggle ();
00140
00141 void SetResponse (
00142 INT32 response
00143 ) { m_response = response; }
00144
00145
00146 virtual ERRVALUE v_CreateContent ();
00147 virtual void v_OnCancel ();
00148 virtual void v_OnOK ();
00149
00150 friend class DLG_QUESTION::BUTTON;
00151 #endif // GENERATING_DOXYGEN_OUTPUT
00152 };
00153
00154
00155 }
00156
00157
00158 #endif // INC_MGUI_DLGQUESTION_H