- // Initialize child subwindow members.
- BombsCanvas = NULL;
-
- SetIcon(wxICON(bombs));
-
- CreateStatusBar();
-
- // Create a menu bar for the frame
- wxMenuBar *menuBar1 = new wxMenuBar;
- wxMenu *menu1 = new wxMenu;
- menu1->Append(IDM_EXIT, _T("E&xit")); // , "Quit the program");
- menu1->AppendSeparator();
- menu1->Append(IDM_ABOUT, _T("&About...")); // , "Infos on wxBombs");
- menuBar1->Append(menu1, _T("&File"));
- wxMenu *menu2 = new wxMenu;
- menu2->Append(IDM_RESTART, _T("&Restart")); // , "Clear the play field");
- menu2->AppendSeparator();
- menu2->Append(IDM_EASY, _T("&Easy"), wxEmptyString, TRUE); // "10x10 play field", TRUE);
- menu2->Append(IDM_MEDIUM, _T("&Medium"), wxEmptyString, TRUE); // "15x15 play field", TRUE);
- menu2->Append(IDM_DIFFICULT, _T("&Difficult"), wxEmptyString, TRUE); // "25x20 play field", TRUE);
- menuBar1->Append(menu2, _T("&Game"));
- SetMenuBar(menuBar1);
- menuBar=menuBar1;
- menuBar->Check(wxGetApp().level, TRUE);
-
- // Create child subwindows.
- BombsCanvas = new BombsCanvasClass(this);
-
- // Ensure the subwindows get resized o.k.
-// OnSize(width, height);
-
- // Centre frame on the screen.
- Centre(wxBOTH);
-
- // Show the frame.
- Show(TRUE);
+ m_game = game;
+ m_easyCorner = false;
+ m_lastLevel = bombsID_EASY;
+
+ SetIcon(wxICON(bombs));
+
+#if wxUSE_STATUSBAR
+ CreateStatusBar();
+#endif
+
+ // Create a menu bar for the frame
+ wxMenuBar *menuBar = new wxMenuBar;
+ wxMenu *menuFile = new wxMenu;
+ wxMenu *menuLevel = new wxMenu;
+ menuLevel->AppendRadioItem(bombsID_EASY, wxT("&Easy (10x10)\tCtrl-1"));
+ menuLevel->AppendRadioItem(bombsID_MEDIUM, wxT("&Medium (15x15)\tCtrl-2"));
+ menuLevel->AppendRadioItem(bombsID_HARD, wxT("&Hard (25x20)\tCtrl-3"));
+
+ 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();
+ menuFile->Append(wxID_EXIT, wxGetStockLabel(wxID_EXIT), wxT("Quits the application"));
+
+ menuBar->Append(menuFile, wxT("&File"));
+
+
+ wxMenu *menuHelp = new wxMenu;
+ menuHelp->Append(wxID_ABOUT, wxT("&About"),
+ wxT("Displays the program information") );
+
+ menuBar->Append(menuHelp, wxT("&Help"));
+
+ SetMenuBar(menuBar);
+
+ // Create child subwindows.
+ m_canvas = new BombsCanvas(this, m_game);
+
+ // Ensure the subwindows get resized o.k.
+ // OnSize(width, height);
+
+ // Centre frame on the screen.
+ Centre(wxBOTH);
+
+ // Show the frame.
+ Show();