X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/72045d5768a126191a907bc640c28e81a11afdd6..084ad0c2424aa998a640c151f8fa762435364449:/samples/animate/anitest.cpp?ds=sidebyside diff --git a/samples/animate/anitest.cpp b/samples/animate/anitest.cpp index a75e0f0c08..551a36aa4d 100644 --- a/samples/animate/anitest.cpp +++ b/samples/animate/anitest.cpp @@ -29,7 +29,7 @@ #endif #ifndef __WXMSW__ - #include "mondrian.xpm" + #include "sample.xpm" #endif #include "anitest.h" @@ -46,11 +46,11 @@ IMPLEMENT_APP(MyApp) enum { - wxID_PLAY + ID_PLAY = 1 }; BEGIN_EVENT_TABLE(MyFrame, wxFrame) - EVT_MENU(wxID_PLAY, MyFrame::OnPlay) + EVT_MENU(ID_PLAY, MyFrame::OnPlay) EVT_MENU(wxID_STOP, MyFrame::OnStop) EVT_MENU(wxID_ABOUT, MyFrame::OnAbout) EVT_MENU(wxID_EXIT, MyFrame::OnQuit) @@ -75,16 +75,12 @@ bool MyApp::OnInit() { // Create the main frame window - MyFrame* frame = new MyFrame((wxFrame *)NULL, -1, _T("Animation Demo"), - wxPoint(-1, -1), wxSize(500, 400), + MyFrame* frame = new MyFrame((wxFrame *)NULL, wxID_ANY, _T("Animation Demo"), + wxDefaultPosition, wxSize(500, 400), wxDEFAULT_FRAME_STYLE); // Give it an icon -#ifdef __WXMSW__ - frame->SetIcon(wxIcon(_T("mdi_icn"))); -#else - frame->SetIcon(wxIcon( mondrian_xpm )); -#endif + frame->SetIcon(wxICON(sample)); // Make a menubar wxMenu *file_menu = new wxMenu; @@ -95,7 +91,7 @@ bool MyApp::OnInit() file_menu->Append(wxID_EXIT); wxMenu *play_menu = new wxMenu; - play_menu->Append(wxID_PLAY, _T("Play\tCtrl+P"), _T("Play the animation")); + play_menu->Append(ID_PLAY, _T("Play\tCtrl+P"), _T("Play the animation")); play_menu->Append(wxID_STOP, _T("Stop\tCtrl+P"), _T("Stop the animation")); wxMenu *help_menu = new wxMenu; @@ -237,7 +233,7 @@ void MyFrame::OnOpen(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnUpdateUI(wxUpdateUIEvent& WXUNUSED(event) ) { GetMenuBar()->FindItem(wxID_STOP)->Enable(m_animationCtrl->IsPlaying()); - GetMenuBar()->FindItem(wxID_PLAY)->Enable(!m_animationCtrl->IsPlaying()); + GetMenuBar()->FindItem(ID_PLAY)->Enable(!m_animationCtrl->IsPlaying()); } // --------------------------------------------------------------------------- @@ -250,7 +246,7 @@ END_EVENT_TABLE() // Define a constructor for my canvas MyCanvas::MyCanvas(wxWindow *parent, const wxPoint& pos, const wxSize& size) - : wxScrolledWindow(parent, -1, pos, size, + : wxScrolledWindow(parent, wxID_ANY, pos, size, wxSUNKEN_BORDER | wxNO_FULL_REPAINT_ON_RESIZE | wxVSCROLL | wxHSCROLL)