X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ee710d75b89a7b172389c67267c7737952f0ba5c..14236c1b6189600712e61e451302d59882d32078:/demos/life/life.cpp diff --git a/demos/life/life.cpp b/demos/life/life.cpp index cd6c32d693..2d6950a106 100644 --- a/demos/life/life.cpp +++ b/demos/life/life.cpp @@ -67,7 +67,7 @@ // -------------------------------------------------------------------------- // IDs for the controls and the menu commands. Exluding those already defined -// by wxWindows, such as wxID_NEW. +// by wxWidgets, such as wxID_NEW. enum { // timer @@ -99,7 +99,7 @@ enum }; // -------------------------------------------------------------------------- -// event tables and other macros for wxWindows +// event tables and other macros for wxWidgets // -------------------------------------------------------------------------- // Event tables @@ -154,7 +154,7 @@ IMPLEMENT_APP(LifeApp) // some shortcuts #define ADD_TOOL(id, bmp, tooltip, help) \ - toolBar->AddTool(id, bmp, wxNullBitmap, false, -1, -1, (wxObject *)0, tooltip, help) + toolBar->AddTool(id, bmp, wxNullBitmap, false, wxDefaultCoord, wxDefaultCoord, (wxObject *)NULL, tooltip, help) // -------------------------------------------------------------------------- @@ -261,9 +261,11 @@ LifeFrame::LifeFrame() : wxFrame( (wxFrame *) NULL, wxID_ANY, toolBar->Realize(); toolBar->EnableTool(ID_STOP, false); // must be after Realize() ! +#if wxUSE_STATUSBAR // status bar CreateStatusBar(2); SetStatusText(_("Welcome to Life!")); +#endif // wxUSE_STATUSBAR // game and timer m_life = new Life(); @@ -294,7 +296,7 @@ LifeFrame::LifeFrame() : wxFrame( (wxFrame *) NULL, wxID_ANY, wxSlider *slider = new wxSlider(panel2, ID_SLIDER, 5, 1, 10, wxDefaultPosition, - wxSize(200, -1), + wxSize(200, wxDefaultCoord), wxSL_HORIZONTAL | wxSL_AUTOTICKS); UpdateInfoText(); @@ -304,9 +306,13 @@ LifeFrame::LifeFrame() : wxFrame( (wxFrame *) NULL, wxID_ANY, wxBoxSizer *sizer2 = new wxBoxSizer(wxVERTICAL); wxBoxSizer *sizer3 = new wxBoxSizer(wxVERTICAL); +#if wxUSE_STATLINE sizer1->Add( new wxStaticLine(panel1, wxID_ANY), 0, wxGROW ); +#endif // wxUSE_STATLINE sizer1->Add( m_canvas, 1, wxGROW | wxALL, 2 ); +#if wxUSE_STATLINE sizer1->Add( new wxStaticLine(panel1, wxID_ANY), 0, wxGROW ); +#endif // wxUSE_STATLINE panel1->SetSizer( sizer1 ); sizer1->Fit( panel1 ); @@ -884,10 +890,12 @@ void LifeCanvas::OnMouse(wxMouseEvent& event) wxInt32 i = XToCell( event.GetX() ); wxInt32 j = YToCell( event.GetY() ); +#if wxUSE_STATUSBAR // set statusbar text wxString msg; msg.Printf(_("Cell: (%d, %d)"), i, j); ((LifeFrame *) wxGetApp().GetTopWindow())->SetStatusText(msg, 1); +#endif // wxUSE_STATUSBAR // NOTE that wxMouseEvent::LeftDown() and wxMouseEvent::LeftIsDown() // have different semantics. The first one is used to signal that the