Changeset 151 for trunk


Ignore:
Timestamp:
21/02/08 18:58:18 (6 years ago)
Author:
guyru
Message:

use standard identifiers for the new game and undo menu items

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/MainFrame.cpp

    r140 r151  
    1 // $Header$ 
    21/*************************************************************************** 
    32 *   Copyright (C) 2006-2008 by Guy Rutenberg   * 
     
    10099         
    101100        //disable the undo button 
    102         (GetMenuBar()->FindItem(ID_UNDO))->Enable(false); 
     101        (GetMenuBar()->FindItem(wxID_UNDO))->Enable(false); 
    103102 
    104103        ConnectEventTable(); 
     
    132131 
    133132        //insert menu items into menu Game 
    134         gameMenu->Append(ID_NEWGAME,wxT("&New Game\tF2"),wxT("Start a new game")); 
    135         //create the undo button and make it disabled 
    136         gameMenu->Append(ID_UNDO,wxT("&Undo\tCTRL+Z"),wxT("Undo the last move")); 
     133        gameMenu->Append(wxID_NEW,wxT("&New Game\tF2"),wxT("Start a new game")); 
     134        gameMenu->Append(wxID_UNDO,wxT("&Undo\tCTRL+Z"),wxT("Undo the last move")); 
    137135        gameMenu->Append(ID_SHOWHIGHSCORE,wxT("High &Scores"),wxT("Show high-scores table")); 
    138136        gameMenu->Append(ID_SETTINGS,wxT("Settings"),wxT("Show settings dialog")); 
    139137        gameMenu->Append(ID_THEMES,wxT("Dice Theme..."),wxT("Select a dice theme")); 
    140         gameMenu->Append(wxID_EXIT, wxT("E&xit\tAlt-X"), 
    141                         wxT("Quit this program")); 
     138        gameMenu->Append(wxID_EXIT); 
    142139         
    143140        // Declare the menu-bar and append the freshly created menus to the menu bar... 
     
    331328        Connect(ID_CHECK_FOR_UPDATES, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnCheckForUpdates)); 
    332329        Connect(ID_SENDCOMMENT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnSendComment)); 
    333         Connect(ID_NEWGAME, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnNewGame)); 
    334         Connect(ID_UNDO, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnUndo)); 
     330        Connect(wxID_NEW, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnNewGame)); 
     331        Connect(wxID_UNDO, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnUndo)); 
    335332        Connect(ID_SHOWHIGHSCORE, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnShowHighscore)); 
    336333        Connect(ID_SETTINGS, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnSettings)); 
     
    424421{ 
    425422        //disable the undo button so it won't be enabled when a new game is started. 
    426         (GetMenuBar()->FindItem(ID_UNDO))->Enable(false); 
     423        (GetMenuBar()->FindItem(wxID_UNDO))->Enable(false); 
    427424         
    428425        ResetRolls(); 
     
    483480        CalculateSubTotal(); 
    484481 
    485         (GetMenuBar()->FindItem(ID_UNDO))->Enable(false); 
     482        (GetMenuBar()->FindItem(wxID_UNDO))->Enable(false); 
    486483        //cancel the counting for the choice that was canceled 
    487484        m_numofplaysleft++; 
     
    495492{ 
    496493        if (m_numofplaysleft) { 
    497                 (GetMenuBar()->FindItem(ID_UNDO))->Enable(true); 
     494                (GetMenuBar()->FindItem(wxID_UNDO))->Enable(true); 
    498495                m_lastmove = id; 
    499496        } 
     
    664661         
    665662        //we rolled the dices so undoing isn't allowed 
    666         (GetMenuBar()->FindItem(ID_UNDO))->Enable(false); 
     663        (GetMenuBar()->FindItem(wxID_UNDO))->Enable(false); 
    667664        m_yahtzeebonus = false; //if we scored yahtzee bonus before we don't care anymore. 
    668665         
  • trunk/src/ObjectsID.h

    r137 r151  
    2424enum { 
    2525        ID_PANEL, 
    26         ID_NEWGAME, 
    27         ID_UNDO, 
    2826        ID_SHOWHIGHSCORE, 
    2927        ID_SETTINGS, 
Note: See TracChangeset for help on using the changeset viewer.