]> git.saurik.com Git - wxWidgets.git/blobdiff - demos/life/life.cpp
Cleaned up some comments, reorganized some code
[wxWidgets.git] / demos / life / life.cpp
index 35bcc5b6b47514cf86f9a4980a0358a004f7e703..eff085f3d46b809c28a7134c75908772a5e983ba 100644 (file)
@@ -194,9 +194,9 @@ LifeFrame::LifeFrame() : wxFrame((wxFrame *)0, -1, _("Life!"), wxPoint(200, 200)
     SetIcon(wxICON(mondrian));
 
     // menu bar
-    wxMenu *menuFile = new wxMenu("", wxMENU_TEAROFF);
-    wxMenu *menuView = new wxMenu("", wxMENU_TEAROFF);
-    wxMenu *menuGame = new wxMenu("", wxMENU_TEAROFF);
+    wxMenu *menuFile = new wxMenu(_T(""), wxMENU_TEAROFF);
+    wxMenu *menuView = new wxMenu(_T(""), wxMENU_TEAROFF);
+    wxMenu *menuGame = new wxMenu(_T(""), wxMENU_TEAROFF);
 
     menuFile->Append(ID_NEW, _("&New"), _("Start a new game"));
     menuFile->Append(ID_OPEN, _("&Open..."), _("Open an existing Life pattern"));
@@ -355,16 +355,17 @@ void LifeFrame::UpdateUI()
     // start / stop
     GetToolBar()->EnableTool(ID_START, !m_running);
     GetToolBar()->EnableTool(ID_STOP,  m_running);
-    GetMenuBar()->GetMenu(2)->Enable(ID_START, !m_running);
-    GetMenuBar()->GetMenu(2)->Enable(ID_STEP,  !m_running);
-    GetMenuBar()->GetMenu(2)->Enable(ID_STOP,  m_running);
+    GetMenuBar()->Enable(ID_START, !m_running);
+    GetMenuBar()->Enable(ID_STEP,  !m_running);
+    GetMenuBar()->Enable(ID_STOP,  m_running);
+    GetMenuBar()->Enable(ID_TOPSPEED, !m_topspeed);
 
     // zooming
     int cellsize = m_canvas->GetCellSize();
     GetToolBar()->EnableTool(ID_ZOOMIN,  cellsize < 32);
     GetToolBar()->EnableTool(ID_ZOOMOUT, cellsize > 1);
-    GetMenuBar()->GetMenu(1)->Enable(ID_ZOOMIN,  cellsize < 32);
-    GetMenuBar()->GetMenu(1)->Enable(ID_ZOOMOUT, cellsize > 1);
+    GetMenuBar()->Enable(ID_ZOOMIN,  cellsize < 32);
+    GetMenuBar()->Enable(ID_ZOOMOUT, cellsize > 1);
 }
 
 // Event handlers -----------------------------------------------------------
@@ -1057,7 +1058,7 @@ void LifeCanvas::OnScroll(wxScrollWinEvent& event)
     else
     if (type == wxEVT_SCROLLWIN_PAGEDOWN)
     {
-        scrollinc = -10;
+        scrollinc = +10;
     }
     else
     if (type == wxEVT_SCROLLWIN_THUMBTRACK)