X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/619f45aa8a5f7c3baadebb30c31d22399fe609a9..4aab34290a0c966bffc9e529dae5666b5db77c96:/samples/dynamic/dynamic.cpp diff --git a/samples/dynamic/dynamic.cpp b/samples/dynamic/dynamic.cpp index ea9c0e3d06..571e1cfdf8 100644 --- a/samples/dynamic/dynamic.cpp +++ b/samples/dynamic/dynamic.cpp @@ -9,11 +9,6 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(__APPLE__) -#pragma implementation -#pragma interface -#endif - // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" @@ -27,20 +22,20 @@ #include "wx/clntdata.h" -#if defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__) || defined(__WXCOCOA__) +#ifndef __WXMSW__ #include "mondrian.xpm" #endif // Define a new application type class MyApp: public wxApp -{ +{ public: bool OnInit(void); }; // Define a new frame type class MyFrame: public wxFrame -{ +{ public: MyFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h); @@ -48,14 +43,14 @@ public: void OnQuit(wxCommandEvent& event); void OnTest(wxCommandEvent& event); void OnAbout(wxCommandEvent& event); - + protected: wxShadowObject m_shadow; }; // Define another new frame type class MySecondFrame: public MyFrame -{ +{ public: MySecondFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h); }; @@ -76,10 +71,10 @@ bool MyApp::OnInit(void) // Show the frame frame->Show(true); - + // Create the main frame window MySecondFrame *frame2 = new MySecondFrame(NULL, _T("Dynamic wxWidgets App"), 150, 150, 450, 340); - + // Show the frame frame2->Show(true); @@ -94,7 +89,7 @@ bool MyApp::OnInit(void) // Callback from wxShadowObject -int cb_MyFrame_InitStatusbar( void* window, void* param ) +int cb_MyFrame_InitStatusbar( void* window, void* WXUNUSED(param) ) { MyFrame *frame = (MyFrame*) window; frame->SetStatusText( wxT("Hello from MyFrame"), 0 ); @@ -134,7 +129,7 @@ MyFrame::MyFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h): wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MyFrame::OnTest) ); Connect( DYNAMIC_ABOUT, wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MyFrame::OnAbout) ); - + CreateStatusBar(); m_shadow.AddMethod( wxT("OnTest"), &cb_MyFrame_InitStatusbar ); } @@ -164,7 +159,7 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) ) // Callback from wxShadowObject -int cb_MySecondFrame_InitStatusbar( void* window, void* param ) +int cb_MySecondFrame_InitStatusbar( void* window, void* WXUNUSED(param) ) { MySecondFrame *frame = (MySecondFrame*) window; frame->SetStatusText( wxT("Hello from MySecondFrame"), 0 ); @@ -177,4 +172,3 @@ MySecondFrame::MySecondFrame(wxFrame *frame, wxChar *title, int x, int y, int w, { m_shadow.AddMethod( wxT("OnTest"), &cb_MySecondFrame_InitStatusbar ); } -