[brlcad-commits] SF.net SVN: brlcad:[54706] brlcad/trunk/src/tclscripts/lod/LODDialog.tcl
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <n_...@us...> - 2013-03-14 21:21:30
|
Revision: 54706 http://brlcad.svn.sourceforge.net/brlcad/?rev=54706&view=rev Author: n_reed Date: 2013-03-14 21:21:23 +0000 (Thu, 14 Mar 2013) Log Message: ----------- add a checkbutton for toggling live update Modified Paths: -------------- brlcad/trunk/src/tclscripts/lod/LODDialog.tcl Modified: brlcad/trunk/src/tclscripts/lod/LODDialog.tcl =================================================================== --- brlcad/trunk/src/tclscripts/lod/LODDialog.tcl 2013-03-14 20:57:30 UTC (rev 54705) +++ brlcad/trunk/src/tclscripts/lod/LODDialog.tcl 2013-03-14 21:21:23 UTC (rev 54706) @@ -40,10 +40,12 @@ public { variable lodon 0 variable redrawOnZoom 0 + variable liveUpdate variable pointsScale 1.0 variable curvesScale 1.0 method disableLODWidgets {} + method disableUpdateButton {} method updatePointsValue {newVal} method updateCurvesValue {newVal} method redrawOnZoom {} @@ -133,6 +135,13 @@ -command "$this redraw" } {} + itk_component add liveUpdateCheckbutton { + ttk::checkbutton $itk_component(lodFrame).liveUpdateCheckbutton \ + -text "Live Update" \ + -variable [::itcl::scope liveUpdate] \ + -command "$this disableUpdateButton" + } {} + itk_component add zoomUpdateCheckbutton { ttk::checkbutton $itk_component(lodFrame).zoomUpdateCheckbutton \ -text "Redraw Wireframes After Every Zoom" \ @@ -163,6 +172,8 @@ -stick nesw grid $itk_component(lodFrame).updateButton - \ -sticky sw -padx 3 -pady 3 + grid $itk_component(lodFrame).liveUpdateCheckbutton \ + -sticky w -padx 3 -pady 3 grid $itk_component(lodFrame).zoomUpdateCheckbutton \ -sticky w -padx 3 -pady 3 @@ -189,6 +200,7 @@ $itk_component(lodFrame).curvesScale state !disabled $itk_component(lodFrame).curvesLabel state !disabled $itk_component(lodFrame).updateButton state !disabled + $itk_component(lodFrame).liveUpdateCheckbutton state !disabled $itk_component(lodFrame).zoomUpdateCheckbutton state !disabled lod on } else { @@ -199,19 +211,36 @@ $itk_component(lodFrame).curvesScale state disabled $itk_component(lodFrame).curvesLabel state disabled $itk_component(lodFrame).updateButton state disabled + $itk_component(lodFrame).liveUpdateCheckbutton state disabled $itk_component(lodFrame).zoomUpdateCheckbutton state disabled lod off } } +::itcl::body LODDialog::disableUpdateButton {} { + if {$liveUpdate} { + $itk_component(lodFrame).updateButton state disabled + } else { + $itk_component(lodFrame).updateButton state !disabled + } +} + ::itcl::body LODDialog::updatePointsValue {newVal} { set pointsScale [format %.1f $newVal] lod scale points $pointsScale + + if {$liveUpdate} { + redraw + } } ::itcl::body LODDialog::updateCurvesValue {newVal} { set curvesScale [tcl::mathfunc::round $newVal] lod scale curves $curvesScale + + if {$liveUpdate} { + redraw + } } ::itcl::body LODDialog::redrawOnZoom {} { @@ -227,7 +256,7 @@ if {$prefix != ""} { foreach obj [eval $prefix gedCmd who] { - eval $prefix gedCmd redraw $obj + eval $prefix gedCmd draw $obj } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |