summaryrefslogtreecommitdiff
path: root/cad/src/temporary_commands
diff options
context:
space:
mode:
authorBruce Smith <bruce@nanorex.com>2008-08-18 16:45:05 +0000
committerBruce Smith <bruce@nanorex.com>2008-08-18 16:45:05 +0000
commit6c34b1ae66db413f2f179da281f6081683d0462e (patch)
tree23ebb1480dff0a45affed4d402eedcfef02d8dd5 /cad/src/temporary_commands
parent281d084a4eebc83b2f0021bfab9a57918d405a1f (diff)
downloadnanoengineer-6c34b1ae66db413f2f179da281f6081683d0462e.tar.gz
nanoengineer-6c34b1ae66db413f2f179da281f6081683d0462e.zip
move some ok_btn_clicked/cancel_btn_clicked methods to superclass
Diffstat (limited to 'cad/src/temporary_commands')
-rw-r--r--cad/src/temporary_commands/TemporaryCommand.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/cad/src/temporary_commands/TemporaryCommand.py b/cad/src/temporary_commands/TemporaryCommand.py
index 36173bb6e..7c07ff51b 100644
--- a/cad/src/temporary_commands/TemporaryCommand.py
+++ b/cad/src/temporary_commands/TemporaryCommand.py
@@ -33,18 +33,15 @@ class TemporaryCommand_preMixin(commonCommand):
class ESC_to_exit_GraphicsMode_preMixin(commonGraphicsMode):
"""
- A pre-Mixin class for GraphicsModes which overrides their keyPress method
- to call self.command.Done() when the ESC key is pressed,
- but delegate all other keypresses to the superclass.
- NOTE: The default mode or command will override this implementation
- (i.e. while in default command which is 'Select chunks', hitting Escape key
- will not exit that command. This is intentional)
+ A pre-mixin class for GraphicsModes which overrides their keyPress method
+ to call self.command.Done() when the ESC key is pressed
+ if self.command.should_exit_when_ESC_key_pressed() returns true,
+ or to call assy.selectNone otherwise,
+ but which delegates all other keypresses to the superclass.
"""
def keyPress(self, key):
- # ESC - Exit our command.
+ # ESC - Exit our command, if it permits exit due to ESC key.
if key == Qt.Key_Escape:
- #Escape key to exit should not exit the command if it's the
- #default command [ninad 080709]
if self.command.should_exit_when_ESC_key_pressed():
self.command.Done(exit_using_done_or_cancel_button = False)
else:
@@ -62,7 +59,7 @@ class ESC_to_exit_GraphicsMode_preMixin(commonGraphicsMode):
class Overdrawing_GraphicsMode_preMixin(commonGraphicsMode):
"""
- A pre-Mixin class for GraphicsModes which overrides their Draw method
+ A pre-mixin class for GraphicsModes which overrides their Draw method
to do the saved prior command's drawing
(perhaps in addition to their own, if they subclass this
and further extend its Draw method, or if they do incremental