Revision: 54575
          http://brlcad.svn.sourceforge.net/brlcad/?rev=54575&view=rev
Author:   bob1961
Date:     2013-03-08 17:20:16 +0000 (Fri, 08 Mar 2013)
Log Message:
-----------
Added "Save as png ..." menu items to the display menus.

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

Modified: brlcad/trunk/src/tclscripts/archer/Archer.tcl
===================================================================
--- brlcad/trunk/src/tclscripts/archer/Archer.tcl       2013-03-08 17:03:43 UTC 
(rev 54574)
+++ brlcad/trunk/src/tclscripts/archer/Archer.tcl       2013-03-08 17:20:16 UTC 
(rev 54575)
@@ -3876,6 +3876,11 @@
        -label "Refresh" \
        -command [::itcl::code $this refreshDisplay] \
        -state disabled
+    $itk_component(${_prefix}displaymenu) add separator
+    $itk_component(${_prefix}displaymenu) add command \
+       -label "Save as png ..." \
+       -command [::itcl::code $this doPng] \
+       -state disabled
 
     buildModesMenu $_prefix
     updateUtilityMenu
@@ -5342,6 +5347,9 @@
                -helpstr "Clear the display"
            command refresh -label "Refresh" \
                -helpstr "Refresh the display"
+           separator sep1
+           command save_png -label "Save as png ..." \
+               -helpstr "Save the display as png"
        }
 
     $itk_component(menubar) menuconfigure .display.standard \
@@ -5389,6 +5397,9 @@
     $itk_component(menubar) menuconfigure .display.refresh \
        -command [::itcl::code $this refreshDisplay] \
        -state disabled
+    $itk_component(menubar) menuconfigure .display.save_png \
+       -command [::itcl::code $this doPng] \
+       -state disabled
 }
 
 
@@ -5934,6 +5945,7 @@
                $itk_component(${prefix}displaymenu) entryconfigure "Center..." 
-state normal
                $itk_component(${prefix}displaymenu) entryconfigure "Clear" 
-state normal
                $itk_component(${prefix}displaymenu) entryconfigure "Refresh" 
-state normal
+               $itk_component(${prefix}displaymenu) entryconfigure "Save as 
png ..." -state normal
 
                $itk_component(${prefix}modesmenu) entryconfigure "Active Pane" 
-state normal
                $itk_component(${prefix}modesmenu) entryconfigure "Quad View" 
-state normal
@@ -5962,6 +5974,7 @@
            $itk_component(menubar) menuconfigure .display.center -state normal
            $itk_component(menubar) menuconfigure .display.clear -state normal
            $itk_component(menubar) menuconfigure .display.refresh -state normal
+           $itk_component(menubar) menuconfigure .display.save_png -state 
normal
 
            $itk_component(menubar) menuconfigure .modes.activepane -state 
normal
            $itk_component(menubar) menuconfigure .modes.quad -state normal

Modified: brlcad/trunk/src/tclscripts/archer/ArcherCore.tcl
===================================================================
--- brlcad/trunk/src/tclscripts/archer/ArcherCore.tcl   2013-03-08 17:03:43 UTC 
(rev 54574)
+++ brlcad/trunk/src/tclscripts/archer/ArcherCore.tcl   2013-03-08 17:20:16 UTC 
(rev 54575)
@@ -3848,17 +3848,20 @@
                      -title "Export Geometry to PNG" \
                      -initialdir $mLastSelectedDir -filetypes $typelist]
 
-    if {$filename != ""} {
-       set mLastSelectedDir [file dirname $finename]
+    if {$filename == ""} {
+       return
+    }
 
-       #XXX Hack! Hack! Hack!
-       #XXX The png command below needs to be modified to draw
-       #XXX into an off screen buffer to avoid occlusion
-       raise .
+    set mLastSelectedDir [file dirname $filename]
 
-       update
-       after idle [::itcl::code $this png $filename]
-    }
+    #XXX Hack! Hack! Hack!
+    #XXX The png command below needs to be modified to draw
+    #XXX into an off screen buffer to avoid occlusion
+    ::update idletasks
+    after 1000
+    refreshDisplay
+
+    $itk_component(ged) png $filename
 }
 
 ::itcl::body ArcherCore::setActivePane {_pane} {

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