summaryrefslogtreecommitdiff
path: root/cad/src/temporary_commands
diff options
context:
space:
mode:
authorNinad Sathaye <ninad@nanorex.com>2008-09-22 18:49:59 +0000
committerNinad Sathaye <ninad@nanorex.com>2008-09-22 18:49:59 +0000
commit704b5ce4223b3eaed41662029eb6739857ce66d3 (patch)
tree94491fd417e27006553024826bec1ef1b0a37689 /cad/src/temporary_commands
parent106b98bf1933fb8e60bc668af5909d09291ac10b (diff)
downloadnanoengineer-theirix-704b5ce4223b3eaed41662029eb6739857ce66d3.tar.gz
nanoengineer-theirix-704b5ce4223b3eaed41662029eb6739857ce66d3.zip
updated command porting status and misc cleanup
Diffstat (limited to 'cad/src/temporary_commands')
-rw-r--r--cad/src/temporary_commands/RotateAboutPoint_Command.py35
1 files changed, 30 insertions, 5 deletions
diff --git a/cad/src/temporary_commands/RotateAboutPoint_Command.py b/cad/src/temporary_commands/RotateAboutPoint_Command.py
index 28bcb0ad6..eefd4a34f 100644
--- a/cad/src/temporary_commands/RotateAboutPoint_Command.py
+++ b/cad/src/temporary_commands/RotateAboutPoint_Command.py
@@ -85,10 +85,15 @@ class RotateAboutPoint_GraphicsMode(Line_GraphicsMode):
if not USE_COMMAND_STACK:
self.command.restore_gui()
else:
- print_compact_stack("bug: %s.leftUp doesn't handle the case" \
- "where mouseclicklimit is not specified. Ideally it should" \
- "call most of the code in self.command_will_exit")%(self)
-
+ try:
+ self.command._f_results_for_caller_and_prepare_for_new_input()
+ except AttributeError:
+ print_compact_traceback(
+ "bug: command %s has no attr"\
+ "'_f_results_for_caller_and_prepare_for_new_input'.")
+ self.command.mouseClickPoints = []
+ self.resetVariables()
+
self.glpane.gl_update()
return
@@ -124,7 +129,7 @@ class RotateAboutPoint_GraphicsMode(Line_GraphicsMode):
class RotateAboutPoint_Command(Line_Command):
#Temporary attr 'command_porting_status. See baseCommand for details.
- command_porting_status = "PARTIAL: GraphicsMode.leftUp calls restore_gui and corre case in new command API not handled"
+ command_porting_status = None #fully ported
GraphicsMode_class = RotateAboutPoint_GraphicsMode
@@ -206,6 +211,26 @@ class RotateAboutPoint_Command(Line_Command):
# note: superclass Line_Command.init_gui sets self._results_callback,
# and superclass restore_gui calls it with this method's return value
return ()
+
+
+ def _f_results_for_caller_and_prepare_for_new_input(self):
+ """
+ This is called only from GraphicsMode.leftUp()
+ Give results for the caller of this request command and then prepare for
+ next input (mouse click points) from the user. Note that this is called
+ from RotateAboutPoint_GraphiceMode.leftUp() only when the mouseClickLimit
+ is not specified (i.e. the command is not exited automatically after
+ 'n' number of mouseclicks)
+
+ @see: RotateAboutPoint_GraphiceMode.leftUp()
+ """
+ if self._results_callback:
+ # note: see comment in command_will_exit version of this code
+ params = self._results_for_request_command_caller()
+ self._results_callback( params)
+
+ self.command.mouseClickPoints = []
+ self.graphiceMode.resetVariables()
pass # end of class RotateAboutPoint_Command