Changeset 51
- Timestamp:
- 16/01/07 14:10:45 (6 years ago)
- Location:
- trunk/OpenYahtzee
- Files:
-
- 7 edited
-
ChangeLog (modified) (1 diff)
-
TODO (modified) (2 diffs)
-
src/MainFrame.cpp (modified) (1 diff)
-
src/SettingsDialog.cpp (modified) (4 diffs)
-
src/SettingsDialog.h (modified) (2 diffs)
-
src/openyahtzee.cpp (modified) (1 diff)
-
src/wxDynamicBitmap.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/OpenYahtzee/ChangeLog
r50 r51 10 10 - Fixed bug #1634542 (undoing of scoring that involves Yahtzee Bonus). 11 11 - Fixed minor misalignment in the UI. 12 - Code refactoring and cleanup. 13 - Redesigned the Settings Dialog. 14 - The main window of the game is now unresizable (fixed size). 12 15 13 16 Open Yahtzee 1.6: -
trunk/OpenYahtzee/TODO
r47 r51 7 7 - Disable the ability to undo the last move of the game. 8 8 - Add abilliy to adjust how many times (avreage) will the dice roll before they stop. 9 - Change the "reset high score" toggle button to a checkbox.10 9 - Multiplayer mode. 11 10 … … 15 14 - Add a frame around the dices. 16 15 - Make the dice roll a couple of times before they stop. 16 - Change the "reset high score" toggle button to a checkbox. 17 17 18 18 -
trunk/OpenYahtzee/src/MainFrame.cpp
r50 r51 239 239 Connect(ID_ROLL, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (MainFrame::OnRollButton)); 240 240 241 for (int i=ID_ACES; i<=ID_SIXES; i++) 242 Connect(i, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (MainFrame::OnUpperButtons)); 241 Connect(ID_ACES,ID_SIXES, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (MainFrame::OnUpperButtons)); 243 242 Connect(ID_THREEOFAKIND, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (MainFrame::On3ofakindButton)); 244 243 Connect(ID_FOUROFAKIND, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (MainFrame::On4ofakindButton)); -
trunk/OpenYahtzee/src/SettingsDialog.cpp
r47 r51 29 29 30 30 SettingsDialog::SettingsDialog(wxWindow* parent, int id): 31 wxDialog(parent, wxID_ANY, wxT("Settin s Dialog"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE)31 wxDialog(parent, wxID_ANY, wxT("Settings Dialog"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE) 32 32 { 33 33 34 34 SetIcon(wxIcon(ICON)); 35 35 36 label_1 = new wxStaticText(this, -1, wxT("High -score table size:"));36 label_1 = new wxStaticText(this, -1, wxT("High score table size:")); 37 37 spin_ctrl = new wxSpinCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS,0,1024,20); 38 button_3 = new wxToggleButton(this, ID_RESETHIGHSCORE, wxT("reset high-score table")); 39 button_1 = new wxButton(this, wxID_OK); 40 button_2 = new wxButton(this, wxID_CANCEL); 38 checkbox_reset = new wxCheckBox(this, ID_RESETHIGHSCORE, wxT("Reset high score table")); 41 39 animate_checkbox = new wxCheckBox(this, ID_ANIMATECHECKBOX, wxT("Animate dice")); 42 40 43 set_properties();41 connect_event_table(); 44 42 do_layout(); 45 43 // end wxGlade 46 44 } 47 45 48 BEGIN_EVENT_TABLE( SettingsDialog, wxDialog)49 EVT_TOGGLEBUTTON(ID_RESETHIGHSCORE, SettingsDialog::OnResetHighScore)50 END_EVENT_TABLE();51 46 52 void SettingsDialog:: set_properties()47 void SettingsDialog::connect_event_table() 53 48 { 54 // begin wxGlade: SettingsDialog::set_properties 55 //SetTitle(wxT("Settings Dialog")); /*unneeded anymore -guy*/ 56 //button_1->SetDefault();/*unneeded anymore -guy*/ 57 // end wxGlade 49 Connect(ID_RESETHIGHSCORE,wxEVT_COMMAND_CHECKBOX_CLICKED,wxCommandEventHandler(SettingsDialog::OnResetHighScore)); 58 50 } 59 51 … … 62 54 { 63 55 wxBoxSizer* top_sizer = new wxBoxSizer(wxVERTICAL); 64 wxBoxSizer* sizer_2 = new wxBoxSizer(wxHORIZONTAL);65 56 wxBoxSizer* highscoresizer = new wxBoxSizer(wxHORIZONTAL); 66 highscoresizer->Add(label_1, 0, wxALL|wxADJUST_MINSIZE, 10); 67 highscoresizer->Add(spin_ctrl, 0, wxALL|wxADJUST_MINSIZE, 10); 57 58 highscoresizer->Add(label_1, 0, wxALL|wxADJUST_MINSIZE, 5); 59 highscoresizer->Add(spin_ctrl, 0, wxALL|wxADJUST_MINSIZE, 5); 68 60 top_sizer->Add(highscoresizer, 0, 0, 0); 69 top_sizer->Add( button_3, 0,wxALL|wxALIGN_RIGHT|wxADJUST_MINSIZE, 10);61 top_sizer->Add(checkbox_reset, 0,wxALL, 5); 70 62 71 top_sizer->Add(animate_checkbox,0,wxALL, 10);63 top_sizer->Add(animate_checkbox,0,wxALL,5); 72 64 73 sizer_2->Add(button_1, 0, wxALL|wxADJUST_MINSIZE, 10); 74 sizer_2->Add(button_2, 0, wxALL|wxADJUST_MINSIZE, 10); 75 top_sizer->Add(sizer_2, 1, 0, 0); 65 top_sizer->Add(CreateButtonSizer(wxOK|wxCANCEL), 1, wxBOTTOM, 10); 76 66 SetAutoLayout(true); 77 67 SetSizer(top_sizer); … … 84 74 void SettingsDialog::OnResetHighScore(wxCommandEvent& event) 85 75 { 86 if(! button_3->GetValue()){87 button_3->SetValue(0);76 if(!checkbox_reset->GetValue()){ 77 checkbox_reset->SetValue(0); 88 78 return; 89 79 } 90 80 91 int answer = wxMessageBox(wxT("Are you sure you want to reset the high -score table? After reseting the high score table, you won't be able to restore it!\nThe new high-score table size will be as specified in this dialog."),wxT("High-score table reset"),wxYES_NO|wxICON_EXCLAMATION);81 int answer = wxMessageBox(wxT("Are you sure you want to reset the high score table? After reseting the high score table, you won't be able to restore it!\n\nThe new high score table size will be as specified in this dialog."),wxT("High-score table reset"),wxYES_NO|wxICON_EXCLAMATION,this); 92 82 93 83 if(answer==wxNO) 94 button_3->SetValue(0);84 checkbox_reset->SetValue(0); 95 85 } 96 86 … … 105 95 SettingsDialogData data; 106 96 data.highscoresize = spin_ctrl->GetValue(); 107 data.reset = button_3->GetValue();97 data.reset = checkbox_reset->GetValue(); 108 98 data.animate = animate_checkbox->GetValue(); 109 99 return data; -
trunk/OpenYahtzee/src/SettingsDialog.h
r46 r51 53 53 private: 54 54 // begin wxGlade: SettingsDialog::methods 55 void set_properties();55 void connect_event_table(); 56 56 void do_layout(); 57 57 // end wxGlade … … 63 63 wxStaticText* label_1; 64 64 wxSpinCtrl* spin_ctrl; 65 wxToggleButton* button_3; //the reset button 66 wxButton* button_1; 67 wxButton* button_2; 65 wxCheckBox* checkbox_reset; //the reset button 68 66 69 67 wxCheckBox* animate_checkbox; 70 71 DECLARE_EVENT_TABLE();72 68 73 69 }; -
trunk/OpenYahtzee/src/openyahtzee.cpp
r38 r51 54 54 55 55 // Create the main application window 56 MainFrame *frame = new MainFrame(wxT("OpenYahtzee"), wxDefaultSize, wxDEFAULT_FRAME_STYLE );56 MainFrame *frame = new MainFrame(wxT("OpenYahtzee"), wxDefaultSize, wxDEFAULT_FRAME_STYLE & (~wxRESIZE_BORDER)); 57 57 58 58 //Show it -
trunk/OpenYahtzee/src/wxDynamicBitmap.h
r48 r51 41 41 wxDynamicBitmap (wxWindow* parent, wxWindowID id, wxBitmap& bitmap, 42 42 const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, 43 long style = 0, const wxString& name = wxPanelNameStr);43 long style = wxNO_BORDER, const wxString& name = wxPanelNameStr); 44 44 virtual void SetBitmap(wxBitmap& bitmap); 45 45 wxBitmap GetBitmap();
Note: See TracChangeset
for help on using the changeset viewer.
