]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/minimal/minimal.cpp
Add implicit conversion, remove conversion to bool
[wxWidgets.git] / samples / minimal / minimal.cpp
index 13c3aaeaa0b9b9bbb20b4fc524440cf1fc7443df..09ed8305c2d58b901ff2939b6f5e47992930ece1 100644 (file)
@@ -183,31 +183,17 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
     Close(true);
 }
 
-class MyDialog : public wxDialog
-{
-public:
-    MyDialog(wxWindow *parent)
-        : wxDialog(parent, -1, wxString("Dialog"))
-    {
-        new wxButton(this, wxID_OK);
-
-        Connect(wxID_OK, wxEVT_COMMAND_BUTTON_CLICKED,
-                wxCommandEventHandler(MyDialog::OnOk));
-    }
-
-private:
-    void OnOk(wxCommandEvent& event)
-    {
-        wxMessageDialog *dlg = new wxMessageDialog(this, "Message");
-        dlg->ShowModal();
-        dlg->Destroy();
-
-        event.Skip();
-    }
-};
-
 void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
 {
-    MyDialog dlg(this);
-    dlg.ShowModal();
+    wxMessageBox(wxString::Format(
+                    _T("Welcome to %s!\n")
+                    _T("\n")
+                    _T("This is the minimal wxWidgets sample\n")
+                    _T("running under %s."),
+                    wxVERSION_STRING,
+                    wxGetOsDescription().c_str()
+                 ),
+                 _T("About wxWidgets minimal sample"),
+                 wxOK | wxICON_INFORMATION,
+                 this);
 }