X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d6c9c1b71e069396bbe3850862de9aa10e6812e0..15248e43a93d885f3202554202f529bd1b1e10a4:/samples/minimal/minimal.cpp?ds=sidebyside diff --git a/samples/minimal/minimal.cpp b/samples/minimal/minimal.cpp index 7f1ab0047c..d51eb10f59 100644 --- a/samples/minimal/minimal.cpp +++ b/samples/minimal/minimal.cpp @@ -16,9 +16,10 @@ // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- + #ifdef __GNUG__ - #pragma implementation "minimal.cpp" - #pragma interface "minimal.cpp" +// #pragma implementation "minimal.cpp" +// #pragma interface "minimal.cpp" #endif // For compilers that support precompilation, includes "wx/wx.h". @@ -38,7 +39,7 @@ // resources // ---------------------------------------------------------------------------- // the application icon -#if defined(__WXGTK__) || defined(__WXMOTIF__) +#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) #include "mondrian.xpm" #endif @@ -67,16 +68,6 @@ public: MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size); // event handlers (these functions should _not_ be virtual) - void OnPaint(wxPaintEvent& event) - { - wxPaintDC dc(this); - dc.DrawRectangle(20, 20, 100, 100); - dc.SetPen(*wxRED_PEN); - dc.SetDeviceOrigin(20, 20); - dc.SetClippingRegion(0, 0, 100, 100); - dc.DrawLine(0, 0, 1000, 1000); - } - void OnQuit(wxCommandEvent& event); void OnAbout(wxCommandEvent& event); @@ -105,7 +96,6 @@ enum // handlers) which process them. It can be also done at run-time, but for the // simple menu events like this the static method is much simpler. BEGIN_EVENT_TABLE(MyFrame, wxFrame) - EVT_PAINT(MyFrame::OnPaint) EVT_MENU(Minimal_Quit, MyFrame::OnQuit) EVT_MENU(Minimal_About, MyFrame::OnAbout) END_EVENT_TABLE() @@ -117,6 +107,7 @@ END_EVENT_TABLE() // not wxApp) IMPLEMENT_APP(MyApp) + // ============================================================================ // implementation // ============================================================================ @@ -159,6 +150,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) // set the frame icon SetIcon(wxICON(mondrian)); +#if wxUSE_MENUS // create a menu bar wxMenu *menuFile = new wxMenu("", wxMENU_TEAROFF); @@ -175,6 +167,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) // ... and attach this menu bar to the frame SetMenuBar(menuBar); +#endif // wxUSE_MENUS #if wxUSE_STATUSBAR // create a status bar just for fun (by default with 1 pane only)