+// A class demonstrating CreateStdDialogButtonSizer()
+class StdButtonSizerDialog : public wxDialog
+{
+public:
+ StdButtonSizerDialog(wxWindow *parent);
+
+ void OnEvent(wxCommandEvent& event);
+
+private:
+ void EnableDisableControls();
+
+ wxCheckBox *m_chkboxAffirmativeButton;
+ wxRadioButton *m_radiobtnOk,
+ *m_radiobtnYes;
+
+ wxCheckBox *m_chkboxDismissButton;
+ wxRadioButton *m_radiobtnClose,
+ *m_radiobtnCancel;
+
+ wxCheckBox *m_chkboxApply,
+ *m_chkboxNo,
+ *m_chkboxHelp,
+ *m_chkboxNoDefault;
+
+ wxSizer *m_buttonsSizer;
+
+ DECLARE_EVENT_TABLE()
+};
+
+// Test harness for wxMessageDialog.
+class TestMessageBoxDialog : public wxDialog
+{
+public:
+ TestMessageBoxDialog(wxWindow *parent);
+
+ bool Create();
+
+protected:
+ wxString GetBoxTitle() { return m_textTitle->GetValue(); }
+ wxString GetMessage() { return m_textMsg->GetValue(); }
+ long GetStyle();
+
+ void PrepareMessageDialog(wxMessageDialogBase &dlg);
+
+ virtual void AddAdditionalTextOptions(wxSizer *WXUNUSED(sizer)) { }
+ virtual void AddAdditionalFlags(wxSizer *WXUNUSED(sizer)) { }
+
+ void OnApply(wxCommandEvent& event);
+ void OnClose(wxCommandEvent& event);
+ void OnUpdateLabelUI(wxUpdateUIEvent& event);
+ void OnUpdateNoDefaultUI(wxUpdateUIEvent& event);
+
+private:
+ enum
+ {
+ Btn_Yes,
+ Btn_No,
+ Btn_Ok,
+ Btn_Cancel,
+ Btn_Help,
+ Btn_Max
+ };
+
+ struct BtnInfo
+ {
+ int flag;
+ const char *name;
+ };
+
+ static const BtnInfo ms_btnInfo[Btn_Max];
+
+ enum
+ {
+ MsgDlgIcon_No,
+ MsgDlgIcon_None,
+ MsgDlgIcon_Info,
+ MsgDlgIcon_Question,
+ MsgDlgIcon_Warning,
+ MsgDlgIcon_Error,
+ MsgDlgIcon_Max
+ };
+
+ wxTextCtrl *m_textTitle,
+ *m_textMsg,
+ *m_textExtMsg;
+
+ wxCheckBox *m_buttons[Btn_Max];
+ wxTextCtrl *m_labels[Btn_Max];
+
+ wxRadioBox *m_icons;
+
+ wxCheckBox *m_chkNoDefault,
+ *m_chkCentre;
+
+ DECLARE_EVENT_TABLE()
+ wxDECLARE_NO_COPY_CLASS(TestMessageBoxDialog);
+};
+
+#if wxUSE_RICHMSGDLG
+class TestRichMessageDialog : public TestMessageBoxDialog
+{
+public:
+ TestRichMessageDialog(wxWindow *parent);
+
+protected:
+ // overrides method in base class
+ virtual void AddAdditionalTextOptions(wxSizer *sizer);
+ virtual void AddAdditionalFlags(wxSizer *sizer);
+
+ void OnApply(wxCommandEvent& event);
+
+private:
+ wxTextCtrl *m_textCheckBox;
+ wxCheckBox *m_initialValueCheckBox;
+ wxTextCtrl *m_textDetailed;
+
+ DECLARE_EVENT_TABLE()
+};
+#endif // wxUSE_RICHMSGDLG
+
+class TestDefaultActionDialog: public wxDialog
+{
+public:
+ TestDefaultActionDialog( wxWindow *parent );
+
+ void OnListBoxDClick(wxCommandEvent& event);
+ void OnDisableOK(wxCommandEvent& event);
+ void OnDisableCancel(wxCommandEvent& event);
+ void OnCatchListBoxDClick(wxCommandEvent& event);
+ void OnTextEnter(wxCommandEvent& event);
+
+private:
+ bool m_catchListBoxDClick;
+
+private:
+ DECLARE_EVENT_TABLE()
+};
+
+