Revision: 54621
          http://brlcad.svn.sourceforge.net/brlcad/?rev=54621&view=rev
Author:   bob1961
Date:     2013-03-12 14:11:51 +0000 (Tue, 12 Mar 2013)
Log Message:
-----------
Added an escape mechanism to Archer's display window.

Modified Paths:
--------------
    brlcad/trunk/src/tclscripts/archer/Archer.tcl
    brlcad/trunk/src/tclscripts/archer/ArcherCore.tcl
    brlcad/trunk/src/tclscripts/archer/GeometryEditFrame.tcl

Modified: brlcad/trunk/src/tclscripts/archer/Archer.tcl
===================================================================
--- brlcad/trunk/src/tclscripts/archer/Archer.tcl       2013-03-12 14:11:48 UTC 
(rev 54620)
+++ brlcad/trunk/src/tclscripts/archer/Archer.tcl       2013-03-12 14:11:51 UTC 
(rev 54621)
@@ -251,6 +251,7 @@
        method doAboutArcher {}
        method doarcherHelp {}
        method handleConfigure {}
+       method handleDisplayEscape {_dm}
        method launchDisplayMenuBegin {_dm _m _x _y}
        method launchDisplayMenuEnd {}
        method fbActivePaneCallback {_pane}
@@ -2208,6 +2209,10 @@
     ArcherCore::initGed
     activateMenusEtc
     setActivePane ur
+
+    foreach dm {ul ur ll lr} {
+       $itk_component(ged) pane_bind $dm <Escape> [::itcl::code $this 
handleDisplayEscape $dm]
+    }
 }
 
 
@@ -4120,6 +4125,16 @@
     bind [namespace tail $this] <Configure> {}
 }
 
+::itcl::body Archer::handleDisplayEscape {_dm} {
+    set editView [getEditView]
+
+    if {$editView == ""} {
+       return
+    }
+
+    $editView clearEditState 0 1
+}
+
 ::itcl::body Archer::launchDisplayMenuBegin {_dm _m _x _y} {
     set mCurrentPaneName $_dm
     tk_popup $_m $_x $_y
@@ -6321,8 +6336,6 @@
        return
     }
 
-    clearEditState
-
     if {$GeometryEditFrame::mEditClass != 
$GeometryEditFrame::EDIT_CLASS_SCALE} {
        initEdit
     }
@@ -6356,7 +6369,7 @@
 
     if {$GeometryEditFrame::mEditClass != 
$GeometryEditFrame::EDIT_CLASS_TRANS} {
        initEdit
-    } elseif {[regexp {arb[45678]} $mSelectedObjType] || $mSelectedObjType == 
"pipe"} {
+    } elseif {$GeometryEditFrame::mEditMode > 0 && ([regexp {arb[45678]} 
$mSelectedObjType] || $mSelectedObjType == "pipe")} {
        $itk_component($mSelectedObjType\View) initTranslate
        $itk_component(ged) rect lwidth 0
        return

Modified: brlcad/trunk/src/tclscripts/archer/ArcherCore.tcl
===================================================================
--- brlcad/trunk/src/tclscripts/archer/ArcherCore.tcl   2013-03-12 14:11:48 UTC 
(rev 54620)
+++ brlcad/trunk/src/tclscripts/archer/ArcherCore.tcl   2013-03-12 14:11:51 UTC 
(rev 54621)
@@ -4749,10 +4749,6 @@
     set mSelectedObjPath [getTreePath $snode]
     set mSelectedObj $mNode2Text($snode)
 
-    if {$mPrevSelectedObjPath == $mSelectedObjPath} {
-       return 1
-    }
-
     # label the object if it's being drawn
     set mRenderMode [gedCmd how $mSelectedObjPath]
 
@@ -4764,6 +4760,10 @@
        }
     }
 
+    if {$mPrevSelectedObjPath == $mSelectedObjPath} {
+       return 1
+    }
+
     if {!$mEnableAffectedNodeHighlight} {
        return 0
     }
@@ -6384,7 +6384,7 @@
 ::itcl::body ArcherCore::oscale {args} {
     set result [eval gedWrapper oscale 0 0 1 0 $args]
 
-    if {[llength $args] == 5} {
+    if {[llength $args] == 2} {
        redrawObj [lindex $args 0] 0
     }
 

Modified: brlcad/trunk/src/tclscripts/archer/GeometryEditFrame.tcl
===================================================================
--- brlcad/trunk/src/tclscripts/archer/GeometryEditFrame.tcl    2013-03-12 
14:11:48 UTC (rev 54620)
+++ brlcad/trunk/src/tclscripts/archer/GeometryEditFrame.tcl    2013-03-12 
14:11:51 UTC (rev 54621)
@@ -65,7 +65,7 @@
        proc validateColorComp {c}
        proc validateColor {color}
 
-       method clearEditState {{_clearModeOnly 0}}
+       method clearEditState {{_clearModeOnly 0} {_initFlag 0}}
        method childsite {{site upper}}
 
        method initGeometry {gdata}
@@ -245,7 +245,7 @@
 # ------------------------------------------------------------
 
 
-::itcl::body GeometryEditFrame::clearEditState {{_clearModeOnly 0}} {
+::itcl::body GeometryEditFrame::clearEditState {{_clearModeOnly 0} {_initFlag 
0}} {
     set mEditMode 0
 
     if {$_clearModeOnly} {
@@ -254,6 +254,12 @@
 
     clearAllTables
     set itk_option(-prevGeometryObject) ""
+
+    if {$_initFlag} {
+       set mEditParam1 ""
+       set mEditCommand ""
+       initEditState
+    }
 }
 
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to