+{
+public:
+ MyApp() { m_startupProgressStyle = -1; }
+
+ virtual bool OnInit();
+
+#if wxUSE_CMDLINE_PARSER
+ virtual void OnInitCmdLine(wxCmdLineParser& parser);
+ virtual bool OnCmdLineParsed(wxCmdLineParser& parser);
+#endif // wxUSE_CMDLINE_PARSER
+
+protected:
+#if wxUSE_LOG
+ virtual wxAppTraits *CreateTraits() { return new MyAppTraits; }
+#endif // wxUSE_LOG
+
+private:
+ // Flag set to a valid value if command line option "progress" is used,
+ // this allows testing of wxProgressDialog before the main event loop is
+ // started. If this option is not specified it is set to -1 by default
+ // meaning that progress dialog shouldn't be shown at all.
+ long m_startupProgressStyle;
+};
+
+#if USE_MODAL_PRESENTATION
+
+// A custom modeless dialog
+class MyModelessDialog : public wxDialog
+{
+public:
+ MyModelessDialog(wxWindow *parent);
+
+ void OnButton(wxCommandEvent& event);
+ void OnClose(wxCloseEvent& event);
+
+private:
+ DECLARE_EVENT_TABLE()
+};
+
+// A custom modal dialog
+class MyModalDialog : public wxDialog
+{
+public:
+ MyModalDialog(wxWindow *parent);
+
+ void OnButton(wxCommandEvent& event);
+
+private:
+ wxButton *m_btnModal,
+ *m_btnModeless,
+ *m_btnDelete;
+
+ DECLARE_EVENT_TABLE()
+};
+
+#endif // USE_MODAL_PRESENTATION
+
+// 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 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
+ };