// 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
}
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)
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();
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);
}
// 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
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);
// App specific menu identifiers
enum
{
- bombsID_NEWGAME = wxID_HIGHEST,
+ bombsID_LEVEL = wxID_HIGHEST,
bombsID_EASY,
bombsID_MEDIUM,
bombsID_HARD,