dabodemo Commit Revision 274 Date: 2005-08-31 11:25:40 -0700 (Wed, 31 Aug 2005) Author: paul
Changed: U trunk/minesweeper.py
Log: Fixed minesweeper to not start the timer on a new game if the player switches to a different window (pref, about, other application) and back. Swapped the location of the Pause button so it doesn't result in such a drastic change on the toolbar in pause/resume cycle.
Diff: Modified: trunk/minesweeper.py =================================================================== --- trunk/minesweeper.py 2005-08-31 15:38:23 UTC (rev 273) +++ trunk/minesweeper.py 2005-08-31 18:25:40 UTC (rev 274) @@ -478,7 +478,7 @@ def onDeactivate(self, evt): ## pause the game automatically when form loses focus - if not self.pausebutton.Value and self.board._GameInProgress: + if not self.pausebutton.Value and self.board._GameInProgress and self.board.StopWatch.Running: self._autopause = True self.pausebutton.Value = True self.pausebutton.raiseEvent(dEvents.Hit) @@ -548,17 +548,18 @@ tb.appendSeparator() - tb.appendControl(dabo.ui.dLabel(tb, Caption="Mines:", FontSize=9)) - self.tbMines = tb.appendControl(dabo.ui.dTextBox(tb, Width=30, ReadOnly=True)) - - tb.appendSeparator() - self.pausebutton = tb.appendControl(dabo.ui.dToggleButton(tb, Caption="Pause", ToolTipText="Pause/Resume", StatusText="Pause/Resume the game"), bindfunc=self.onPause) + tb.appendSeparator() + tb.appendControl(dabo.ui.dLabel(tb, Caption="Mines:", FontSize=9)) + self.tbMines = tb.appendControl(dabo.ui.dTextBox(tb, Width=30, ReadOnly=True)) + + + class PreferenceDialog(dabo.ui.dOkCancelDialog): def initProperties(self): self.AutoSize = False
©2005 Paul McNett |