HelpDemo_Help_GNOME,
HelpDemo_Help_Netscape,
// controls start here (the numbers are, of course, arbitrary)
- HelpDemo_Text = 1000,
+ HelpDemo_Text = 1000
};
// ----------------------------------------------------------------------------
// `Main program' equivalent: the program execution "starts" here
bool MyApp::OnInit()
{
+ if ( !wxApp::OnInit() )
+ return false;
+
// Create a simple help provider to make SetHelpText() do something.
// Note that this must be set before any SetHelpText() calls are made.
#if USE_SIMPLE_HELP_PROVIDER
END_EVENT_TABLE()
MyModalDialog::MyModalDialog(wxWindow *parent)
- : wxDialog()
+ : wxDialog(parent, wxID_ANY, wxString(_T("Modal dialog")))
{
- // Add the context-sensitive help button on the caption for MSW
-#ifdef __WXMSW__
+ // Add the context-sensitive help button on the caption for the platforms
+ // which support it (currently MSW only)
SetExtraStyle(wxDIALOG_EX_CONTEXTHELP);
-#endif
- wxDialog::Create(parent, wxID_ANY, wxString(_T("Modal dialog")));
wxBoxSizer *sizerTop = new wxBoxSizer(wxVERTICAL);
wxBoxSizer *sizerRow = new wxBoxSizer(wxHORIZONTAL);
sizerTop->Add(text, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
sizerTop->Add(sizerRow, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
- SetSizer(sizerTop);
-
- sizerTop->SetSizeHints(this);
- sizerTop->Fit(this);
+ SetSizerAndFit(sizerTop);
btnOK->SetFocus();
btnOK->SetDefault();