- // Make a menu bar
- wxMenu* gameMenu = new wxMenu;
- gameMenu->Append(NEW_GAME, "&New", "Start a new game");
- gameMenu->Append(SCORES, "&Scores...", "Displays scores");
- gameMenu->Append(EXIT, "E&xit", "Exits Forty Thieves");
-
- wxMenu* editMenu = new wxMenu;
- editMenu->Append(UNDO, "&Undo", "Undo the last move");
- editMenu->Append(REDO, "&Redo", "Redo a move that has been undone");
-
- wxMenu* optionsMenu = new wxMenu;
- optionsMenu->Append(RIGHT_BUTTON_UNDO,
- "&Right button undo",
- "Enables/disables right mouse button undo and redo",
- TRUE
- );
- optionsMenu->Append(HELPING_HAND,
- "&Helping hand",
- "Enables/disables hand cursor when a card can be moved",
- TRUE
- );
- optionsMenu->Append(LARGE_CARDS,
- "&Large cards",
- "Enables/disables large cards for high resolution displays",
- TRUE
- );
- optionsMenu->Check(HELPING_HAND, TRUE);
- optionsMenu->Check(RIGHT_BUTTON_UNDO, TRUE);
- optionsMenu->Check(LARGE_CARDS, largecards ? TRUE : FALSE);
-
- wxMenu* helpMenu = new wxMenu;
- helpMenu->Append(ABOUT, "&About", "Displays program version information");
-
- m_menuBar = new wxMenuBar;
- m_menuBar->Append(gameMenu, "&Game");
- m_menuBar->Append(editMenu, "&Edit");
- m_menuBar->Append(optionsMenu, "&Options");
- m_menuBar->Append(helpMenu, "&Help");
-
- SetMenuBar(m_menuBar);
-
- if (largecards)
- Card::SetScale(1.3);
-
- m_canvas = new FortyCanvas(this, 0, 0, 400, 400);
- wxLayoutConstraints* constr = new wxLayoutConstraints;
- constr->left.SameAs(this, wxLeft);
- constr->top.SameAs(this, wxTop);
- constr->right.SameAs(this, wxRight);
- constr->height.SameAs(this, wxHeight);
- m_canvas->SetConstraints(constr);
-
- CreateStatusBar();
-}
-
-FortyFrame::~FortyFrame()
-{
+ // Make a menu bar
+ wxMenu* gameMenu = new wxMenu;
+ gameMenu->Append(wxID_NEW, wxGetStockLabel(wxID_NEW), wxT("Start a new game"));
+ gameMenu->Append(SCORES, wxT("&Scores..."), wxT("Displays scores"));
+ gameMenu->Append(wxID_EXIT, wxGetStockLabel(wxID_EXIT), wxT("Exits Forty Thieves"));
+
+ wxMenu* editMenu = new wxMenu;
+ editMenu->Append(wxID_UNDO, wxGetStockLabel(wxID_UNDO), wxT("Undo the last move"));
+ editMenu->Append(wxID_REDO, wxGetStockLabel(wxID_REDO), wxT("Redo a move that has been undone"));
+
+ wxMenu* optionsMenu = new wxMenu;
+ optionsMenu->Append(RIGHT_BUTTON_UNDO,
+ wxT("&Right button undo"),
+ wxT("Enables/disables right mouse button undo and redo"),
+ true
+ );
+ optionsMenu->Append(HELPING_HAND,
+ wxT("&Helping hand"),
+ wxT("Enables/disables hand cursor when a card can be moved"),
+ true
+ );
+ optionsMenu->Append(LARGE_CARDS,
+ wxT("&Large cards"),
+ wxT("Enables/disables large cards for high resolution displays"),
+ true
+ );
+ optionsMenu->Check(HELPING_HAND, true);
+ optionsMenu->Check(RIGHT_BUTTON_UNDO, true);
+ optionsMenu->Check(LARGE_CARDS, largecards ? true : false);
+
+ wxMenu* helpMenu = new wxMenu;
+ helpMenu->Append(wxID_HELP_CONTENTS, wxT("&Help Contents"), wxT("Displays information about playing the game"));
+ helpMenu->Append(wxID_ABOUT, wxT("&About"), wxT("About Forty Thieves"));
+
+ m_menuBar = new wxMenuBar;
+ m_menuBar->Append(gameMenu, wxT("&Game"));
+ m_menuBar->Append(editMenu, wxT("&Edit"));
+ m_menuBar->Append(optionsMenu, wxT("&Options"));
+ m_menuBar->Append(helpMenu, wxT("&Help"));
+
+ SetMenuBar(m_menuBar);
+
+ if (largecards)
+ Card::SetScale(1.3);
+
+ m_canvas = new FortyCanvas(this, wxDefaultPosition, size);
+
+ wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
+ topsizer->Add( m_canvas, 1, wxEXPAND | wxALL, 0);
+ SetSizer( topsizer );
+
+#if wxUSE_STATUSBAR
+ CreateStatusBar();
+#endif // wxUSE_STATUSBAR
+
+ topsizer->SetSizeHints( this );