]> git.saurik.com Git - wxWidgets.git/commitdiff
Compensate the usage of selecting already selected menu items by explicit 'New game...
authorWłodzimierz Skiba <abx@abx.art.pl>
Tue, 10 May 2005 19:22:06 +0000 (19:22 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Tue, 10 May 2005 19:22:06 +0000 (19:22 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34010 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

demos/bombs/bombs.cpp
demos/bombs/bombs.h
demos/bombs/bombs1.cpp
demos/bombs/game.cpp
demos/bombs/game.h

index f1d0883bb8149e7db4ac74161c09eee016a6da54..4501d80832630f1c03f6c1328350531c9f13f74b 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        bombs.cpp
 // Purpose:     Bombs game
 // Author:      P. Foggia 1996
-// Modified by: Wlodzimierz Skiba (ABX) 2003
+// Modified by: Wlodzimierz Skiba (ABX) since 2003
 // Created:     1996
 // RCS-ID:      $Id$
 // Copyright:   (c) 1996 P. Foggia
@@ -61,9 +61,10 @@ bool BombsApp::OnInit()
 }
 
 BEGIN_EVENT_TABLE(BombsFrame, wxFrame)
-    EVT_MENU(bombsID_EASY,       BombsFrame::OnNewEasyGame)
-    EVT_MENU(bombsID_MEDIUM,     BombsFrame::OnNewMediumGame)
-    EVT_MENU(bombsID_HARD,       BombsFrame::OnNewHardGame)
+    EVT_MENU(wxID_NEW,           BombsFrame::OnNewGame)
+    EVT_MENU(bombsID_EASY,       BombsFrame::OnEasyGame)
+    EVT_MENU(bombsID_MEDIUM,     BombsFrame::OnMediumGame)
+    EVT_MENU(bombsID_HARD,       BombsFrame::OnHardGame)
     EVT_MENU(bombsID_EASYCORNER, BombsFrame::OnEasyCorner)
     EVT_MENU(wxID_EXIT,          BombsFrame::OnExit)
     EVT_MENU(wxID_ABOUT,         BombsFrame::OnAbout)
@@ -91,8 +92,8 @@ BombsFrame::BombsFrame(BombsGame *game)
     menuLevel->AppendRadioItem(bombsID_MEDIUM, wxT("&Medium (15x15)\tCtrl-2"));
     menuLevel->AppendRadioItem(bombsID_HARD, wxT("&Hard (25x20)\tCtrl-3"));
 
-    menuFile->Append(bombsID_NEWGAME, wxT("&New Game"),
-        menuLevel, wxT("Starts a new game"));
+    menuFile->Append(wxID_NEW, wxT("&New game\tCtrl-N"));
+    menuFile->Append(bombsID_LEVEL, wxT("&Level"),menuLevel, wxT("Starts a new game"));
     menuFile->AppendCheckItem(bombsID_EASYCORNER, wxT("&Easy corner"));
 
     menuFile->AppendSeparator();
@@ -177,17 +178,22 @@ void BombsFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
         wxT("About wxBombs") );
 }
 
-void BombsFrame::OnNewEasyGame(wxCommandEvent& WXUNUSED(event))
+void BombsFrame::OnNewGame(wxCommandEvent& WXUNUSED(event))
+{
+    NewGame(m_lastLevel, true);
+}
+
+void BombsFrame::OnEasyGame(wxCommandEvent& WXUNUSED(event))
 {
     NewGame(bombsID_EASY, true);
 }
 
-void BombsFrame::OnNewMediumGame(wxCommandEvent& WXUNUSED(event))
+void BombsFrame::OnMediumGame(wxCommandEvent& WXUNUSED(event))
 {
     NewGame(bombsID_MEDIUM, true);
 }
 
-void BombsFrame::OnNewHardGame(wxCommandEvent& WXUNUSED(event))
+void BombsFrame::OnHardGame(wxCommandEvent& WXUNUSED(event))
 {
     NewGame(bombsID_HARD, true);
 }
index dbe4a3072529a56242433209b513b036cf40eb97..c7b511633d63ffda9d6b6ad8d8c76e23231dcf97 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        bombs.h
 // Purpose:     Bombs game
 // Author:      P. Foggia 1996
-// Modified by: Wlodzimierz Skiba (ABX) 2003
+// Modified by: Wlodzimierz Skiba (ABX) since 2003
 // Created:     1996
 // RCS-ID:      $Id$
 // Copyright:   (c) 1996 P. Foggia
@@ -45,9 +45,10 @@ public:
 
 private:
 
-    void OnNewEasyGame(wxCommandEvent& event);
-    void OnNewMediumGame(wxCommandEvent& event);
-    void OnNewHardGame(wxCommandEvent& event);
+    void OnNewGame(wxCommandEvent& event);
+    void OnEasyGame(wxCommandEvent& event);
+    void OnMediumGame(wxCommandEvent& event);
+    void OnHardGame(wxCommandEvent& event);
 
     void OnEasyCorner(wxCommandEvent& event);
 
@@ -68,7 +69,7 @@ private:
 // App specific menu identifiers
 enum
 {
-    bombsID_NEWGAME = wxID_HIGHEST,
+    bombsID_LEVEL = wxID_HIGHEST,
     bombsID_EASY,
     bombsID_MEDIUM,
     bombsID_HARD,
index e6daa2560737137dadf288f446cbb53bae57df9b..a7724d1d2434c875782ea1d24dcad83e6cb8b390 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        bombs1.cpp
 // Purpose:     Bombs game
 // Author:      P. Foggia 1996
-// Modified by: Wlodzimierz Skiba (ABX) 2003
+// Modified by: Wlodzimierz Skiba (ABX) since 2003
 // Created:     1996
 // RCS-ID:      $Id$
 // Copyright:   (c) 1996 P. Foggia
index eed0dc622ccf99558ae95b75b0649f1f7f5c339d..6a76fea09b6f8d2358e99aa6c2de4f41ea88f503 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        bombs1.cpp
 // Purpose:     Implementation of the class BombsGame
 // Author:      P. Foggia 1996
-// Modified by: Wlodzimierz Skiba (ABX) 2003
+// Modified by: Wlodzimierz Skiba (ABX) since 2003
 // Created:     1996
 // RCS-ID:      $Id$
 // Copyright:   (c) 1996 P. Foggia
index 636d024e8e68065e6f9722cc93e6501c7c2318ac..d32f597855561bb81d050b8420b4928b51cc5a73 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        game.h
 // Purpose:     Bombs game
 // Author:      P. Foggia 1996
-// Modified by: Wlodzimierz Skiba (ABX) 2003
+// Modified by: Wlodzimierz Skiba (ABX) since 2003
 // Created:     1996
 // RCS-ID:      $Id$
 // Copyright:   (c) 1996 P. Foggia