Changeset 21
- Timestamp:
- 17/12/06 17:09:23 (7 years ago)
- Location:
- trunk/OpenYahtzee
- Files:
-
- 4 edited
-
openyahtzee.kdevelop (modified) (3 diffs)
-
openyahtzee.kdevelop.pcs (modified) (previous)
-
openyahtzee.kdevses (modified) (1 diff)
-
src/MainFrame.cpp (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/OpenYahtzee/openyahtzee.kdevelop
r20 r21 14 14 <projectdirectory>.</projectdirectory> 15 15 <absoluteprojectpath>false</absoluteprojectpath> 16 <description ></description>16 <description/> 17 17 </general> 18 18 <kdevautoproject> … … 186 186 </codecompletion> 187 187 <creategettersetter> 188 <prefixGet ></prefixGet>188 <prefixGet/> 189 189 <prefixSet>set</prefixSet> 190 190 <prefixVariable>m_,_</prefixVariable> … … 202 202 <kdevdebugger> 203 203 <general> 204 <programargs ></programargs>205 <gdbpath ></gdbpath>206 <dbgshell ></dbgshell>207 <configGdbScript ></configGdbScript>208 <runShellScript ></runShellScript>209 <runGdbScript ></runGdbScript>204 <programargs/> 205 <gdbpath/> 206 <dbgshell/> 207 <configGdbScript/> 208 <runShellScript/> 209 <runGdbScript/> 210 210 <breakonloadinglibs>true</breakonloadinglibs> 211 211 <separatetty>false</separatetty> -
trunk/OpenYahtzee/openyahtzee.kdevses
r20 r21 2 2 <!DOCTYPE KDevPrjSession> 3 3 <KDevPrjSession> 4 <DocsAndViews NumberOfDocuments=" 7" >4 <DocsAndViews NumberOfDocuments="6" > 5 5 <Doc0 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/SettingsDB.h" > 6 <View0 line="23"Type="Source" />6 <View0 Type="Source" /> 7 7 </Doc0> 8 8 <Doc1 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/openyahtzee.cpp" > 9 <View0 line="0"Type="Source" />9 <View0 Type="Source" /> 10 10 </Doc1> 11 11 <Doc2 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/MainFrame.cpp" > 12 <View0 line=" 86" Type="Source" />12 <View0 line="186" Type="Source" /> 13 13 </Doc2> 14 14 <Doc3 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/ObjectsID.h" > 15 <View0 line="44"Type="Source" />15 <View0 Type="Source" /> 16 16 </Doc3> 17 17 <Doc4 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/MainFrame.h" > 18 <View0 line="80"Type="Source" />18 <View0 Type="Source" /> 19 19 </Doc4> 20 20 <Doc5 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/DBwrapper.h" > 21 21 <View0 line="26" Type="Source" /> 22 22 </Doc5> 23 <Doc6 NumberOfViews="1" URL="file:///usr/include/wx-2.6/wx/gtk/bitmap.h" >24 <View0 line="74" Type="Source" />25 </Doc6>26 23 </DocsAndViews> 27 24 <pluginList> 28 25 <kdevdebugger> 29 <breakpointList> 30 <breakpoint0 location="/home/guy/workspace/OpenYahtzee/src/MainFrame.cpp:228" type="1" tracingFormatString="" traceFormatStringEnabled="0" condition="" tracingEnabled="0" enabled="1" > 31 <tracedExpressions/> 32 </breakpoint0> 33 <breakpoint1 location="/home/guy/workspace/OpenYahtzee/src/MainFrame.cpp:215" type="1" tracingFormatString="" traceFormatStringEnabled="0" condition="" tracingEnabled="0" enabled="1" > 34 <tracedExpressions/> 35 </breakpoint1> 36 </breakpointList> 26 <breakpointList/> 37 27 </kdevdebugger> 38 28 <kdevbookmarks> -
trunk/OpenYahtzee/src/MainFrame.cpp
r20 r21 81 81 gameMenu->Append(ID_NEWGAME,wxT("&New Game\tF2"),wxT("Start a new game")); 82 82 //create the undo button and make it disabled 83 (gameMenu->Append(ID_UNDO,wxT("&Undo"),wxT("Undo the last move")))->Enable(false);83 gameMenu->Append(ID_UNDO,wxT("&Undo"),wxT("Undo the last move")); 84 84 gameMenu->Append(ID_SHOWHIGHSCORE,wxT("High &Scores"),wxT("Show high-scores table")); 85 85 gameMenu->Append(ID_SETTINGS,wxT("Settings"),wxT("Show settings dialog")); … … 183 183 textctrl->SetEditable(false); 184 184 } 185 186 //disable the undo button 187 (GetMenuBar()->FindItem(ID_UNDO))->Enable(false); 188 185 189 186 190 … … 254 258 void MainFrame::OnUndo(wxCommandEvent& event) 255 259 { 256 std::cout<<"in undo"<<std::endl;257 260 m_rolls = m_rollsundo; 258 261 259 //enable the roll button if neccessary 260 if (m_rolls > 0) //we still have remaining rolls 261 ((wxButton*) FindWindow(ID_ROLL)) -> Enable(true); 262 262 //after the user scored the button was enabled, check if it should be disabled 263 if (m_rolls <= 0) //we don't have remaining rolls 264 ((wxButton*) FindWindow(ID_ROLL)) -> Enable(false); 265 266 //restore the 'keep' checkboxes 267 for (int i=0; i<5; i++) 268 ((wxCheckBox*) FindWindow(i + ID_DICE1KEEP)) -> Enable(true); 269 263 270 //reset the users last choice 264 271 FindWindow(m_lastmove)->Enable(true); 272 265 273 //clear the score; 266 274 ((wxTextCtrl*)FindWindow(ID_ACESTEXT + (m_lastmove - ID_ACES)))->SetValue(wxT("")); 267 FindWindow(ID_UNDO)->Enable(false); 268 m_numofplaysleft--; 275 276 (GetMenuBar()->FindItem(ID_UNDO))->Enable(false); 277 //cancel the counting for the choice that was canceled 278 m_numofplaysleft++; 269 279 } 270 280 ///This function enables the undo button and stores the last move 271 281 inline void MainFrame::EnableUndo(int id) 272 282 { 273 FindWindow(ID_UNDO)->Enable(true);283 (GetMenuBar()->FindItem(ID_UNDO))->Enable(true); 274 284 m_lastmove = id; 275 285 } … … 328 338 for (int i=0; i<5; i++) 329 339 ((wxCheckBox*) FindWindow(i + ID_DICE1KEEP)) -> Enable(true); 340 341 //we rolled the dices so undoing isn't allowed 342 (GetMenuBar()->FindItem(ID_UNDO))->Enable(false); 330 343 331 344 } … … 347 360 FindWindow(event.GetId())->Enable(false); 348 361 m_numofplaysleft--; 362 EnableUndo(event.GetId()); 349 363 EndofGame(); 350 364 } … … 382 396 FindWindow(event.GetId())->Enable(false); 383 397 m_numofplaysleft--; 398 EnableUndo(event.GetId()); 384 399 EndofGame(); 385 400 } … … 414 429 FindWindow(event.GetId())->Enable(false); 415 430 m_numofplaysleft--; 431 EnableUndo(event.GetId()); 416 432 EndofGame(); 417 433 } … … 444 460 FindWindow(event.GetId())->Enable(false); 445 461 m_numofplaysleft--; 462 EnableUndo(event.GetId()); 446 463 EndofGame(); 447 464 } … … 471 488 FindWindow(event.GetId())->Enable(false); 472 489 m_numofplaysleft--; 490 EnableUndo(event.GetId()); 473 491 EndofGame(); 474 492 } … … 497 515 FindWindow(event.GetId())->Enable(false); 498 516 m_numofplaysleft--; 517 EnableUndo(event.GetId()); 499 518 EndofGame(); 500 519 } … … 516 535 m_numofplaysleft--; 517 536 ResetRolls(); 537 EnableUndo(event.GetId()); 518 538 EndofGame(); 519 539 } … … 536 556 FindWindow(event.GetId())->Enable(false); 537 557 m_numofplaysleft--; 558 EnableUndo(event.GetId()); 538 559 EndofGame(); 539 560 }
Note: See TracChangeset
for help on using the changeset viewer.
