X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3125528da34187c181866b0eae8d951fd6b308d4..abefd7eebac853dfc6a9b8939fa6fb8bc5dafcf6:/samples/minimal/minimal.cpp diff --git a/samples/minimal/minimal.cpp b/samples/minimal/minimal.cpp index e5eb0633d1..c30f96946a 100644 --- a/samples/minimal/minimal.cpp +++ b/samples/minimal/minimal.cpp @@ -35,7 +35,7 @@ // ---------------------------------------------------------------------------- // the application icon (under Windows and OS/2 it is in resources) -#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__) +#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__) || defined(__WXX11__) #include "mondrian.xpm" #endif @@ -61,7 +61,8 @@ class MyFrame : public wxFrame { public: // ctor(s) - MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size); + MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, + long style = wxDEFAULT_FRAME_STYLE); // event handlers (these functions should _not_ be virtual) void OnQuit(wxCommandEvent& event); @@ -137,8 +138,8 @@ bool MyApp::OnInit() // ---------------------------------------------------------------------------- // frame constructor -MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) - : wxFrame(NULL, -1, title, pos, size) +MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, long style) + : wxFrame(NULL, -1, title, pos, size, style) { // set the frame icon SetIcon(wxICON(mondrian)); @@ -180,9 +181,33 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { +#if 1 + wxDialog dialog( this, -1, "Test", wxDefaultPosition, wxDefaultSize, + wxDEFAULT_DIALOG_STYLE | wxCLIP_CHILDREN | wxRESIZE_BORDER ); + wxDialog *parent = &dialog; + + wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL ); + + wxStaticBox *item2 = new wxStaticBox( parent, -1, "Text" ); + wxStaticBoxSizer *item1 = new wxStaticBoxSizer( item2, wxVERTICAL ); + + wxCheckBox *item3 = new wxCheckBox( parent, -1, "Check", wxDefaultPosition, wxDefaultSize, 0 ); + item1->Add( item3, 0, wxALIGN_CENTRE|wxALL, 5 ); + + item0->Add( item1, 0, wxALIGN_CENTRE|wxALL, 10 ); + + parent->SetAutoLayout( TRUE ); + parent->SetSizer( item0 ); + item0->Fit( parent ); + item0->SetSizeHints( parent ); + + dialog.ShowModal(); + +#else wxString msg; msg.Printf( _T("This is the about dialog of minimal sample.\n") _T("Welcome to %s"), wxVERSION_STRING); wxMessageBox(msg, _T("About Minimal"), wxOK | wxICON_INFORMATION, this); +#endif }