X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3dd4e4e05cc46ffc653730715e527af7b18b9caf..c3d434725bd76bc0306b9751e722ed70bd776876:/samples/minimal/minimal.cpp?ds=sidebyside diff --git a/samples/minimal/minimal.cpp b/samples/minimal/minimal.cpp index 602c65241f..4dcb4bf9df 100644 --- a/samples/minimal/minimal.cpp +++ b/samples/minimal/minimal.cpp @@ -5,8 +5,8 @@ // Modified by: // Created: 04/01/98 // RCS-ID: $Id$ -// Copyright: (c) Julian Smart and Markus Holzem -// Licence: wxWindows license +// Copyright: (c) Julian Smart +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -70,6 +70,8 @@ public: void OnQuit(wxCommandEvent& event); void OnAbout(wxCommandEvent& event); + void OnPaint(wxPaintEvent& event); + private: // any class wishing to process wxWindows events must use this macro DECLARE_EVENT_TABLE() @@ -85,11 +87,6 @@ enum // menu items Minimal_Quit = 1, Minimal_About, - Minimal_Test1, - Minimal_Test2, - - // controls start here (the numbers are, of course, arbitrary) - Minimal_Text = 1000, }; // ---------------------------------------------------------------------------- @@ -149,22 +146,27 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) SetIcon(wxICON(mondrian)); // create a menu bar - wxMenu *menuFile = new wxMenu; + wxMenu *menuFile = new wxMenu("", wxMENU_TEAROFF); - menuFile->Append(Minimal_About, "&About..."); + menuFile->Append(Minimal_About, "&About...\tCtrl-A", "Show about dialog"); menuFile->AppendSeparator(); - menuFile->Append(Minimal_Quit, "E&xit"); + menuFile->Append(Minimal_Quit, "E&xit\tAlt-X", "Quit this program"); // now append the freshly created menu to the menu bar... - wxMenuBar *menuBar = new wxMenuBar; + wxMenuBar *menuBar = new wxMenuBar(); menuBar->Append(menuFile, "&File"); // ... and attach this menu bar to the frame SetMenuBar(menuBar); + (void)new wxTextCtrl(this, -1, "Hi!", wxPoint(20, 20), + wxSize(100, 30)); + +#if wxUSE_STATUSBAR // create a status bar just for fun (by default with 1 pane only) CreateStatusBar(2); SetStatusText("Welcome to wxWindows!"); +#endif // wxUSE_STATUSBAR } @@ -178,6 +180,18 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { - wxMessageBox("This is a minimal sample\nA second line in the message box", - "About Minimal", wxOK | wxICON_INFORMATION, this); + wxString msg; + msg.Printf( _T("This is the about dialog of minimal sample.\n") + _T("Welcome to %s") +#ifdef wxBETA_NUMBER + _T(" (beta %d)!") +#endif // wxBETA_NUMBER + , wxVERSION_STRING +#ifdef wxBETA_NUMBER + , wxBETA_NUMBER +#endif // wxBETA_NUMBER + ); + + wxMessageBox(msg, "About Minimal", wxOK | wxICON_INFORMATION, this); } +