- Timestamp:
- Jun 21, 2010, 2:16:16 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/blt4/gui/scripts/xyprint.tcl
r1771 r1774 70 70 private method ResetSettings { } 71 71 private method GetOutput {} 72 private method Done { state }72 private method SetWaitVariable { state } 73 73 private method SetLayoutOption { option } 74 74 private method GetAxisType { axis } … … 112 112 button $itk_interior.ok -text "Save" \ 113 113 -highlightthickness 0 \ 114 -command [itcl::code $this Done 1] \114 -command [itcl::code $this SetWaitVariable 1] \ 115 115 -compound left \ 116 116 -image [Rappture::icon download] … … 119 119 button $itk_interior.cancel -text "Cancel" \ 120 120 -highlightthickness 0 \ 121 -command [itcl::code $this Done 0] \121 -command [itcl::code $this SetWaitVariable 0] \ 122 122 -compound left \ 123 123 -image [Rappture::icon cancel] … … 158 158 159 159 itcl::body Rappture::XyPrint::reset {} { 160 Done 0161 } 162 163 itcl::body Rappture::XyPrint:: Done { state } {160 SetWaitVariable 0 161 } 162 163 itcl::body Rappture::XyPrint::SetWaitVariable { state } { 164 164 set _wait($this) $state 165 165 } … … 171 171 RestoreSettings $toolName $plotName 172 172 InitializeSettings 173 set _wait($this)0173 SetWaitVariable 0 174 174 tkwait variable [itcl::scope _wait($this)] 175 SaveSettings $toolName $plotName 175 176 set output "" 176 177 if { $_wait($this) } { 177 178 set output [GetOutput] 178 179 } 179 SaveSettings $toolName $plotName180 180 DestroySettings 181 181 return $output … … 395 395 396 396 itcl::body Rappture::XyPrint::SetOption { opt } { 397 set new $_settings($this-graph -$opt)398 set old [$_clone cget -$opt]399 set code [catch [list $_clone configure -$opt $new] err]397 set new $_settings($this-graph$opt) 398 set old [$_clone cget $opt] 399 set code [catch [list $_clone configure $opt $new] err] 400 400 if { $code != 0 } { 401 401 bell 402 402 global errorInfo 403 403 puts stderr "$err: $errorInfo" 404 set _settings($this-graph -$opt) $old405 $_clone configure -$opt $old404 set _settings($this-graph$opt) $old 405 $_clone configure $opt $old 406 406 } 407 407 } 408 408 409 409 itcl::body Rappture::XyPrint::SetComponentOption { comp opt } { 410 set new $_settings($this-$comp -$opt)411 set old [$_clone $comp cget -$opt]412 set code [catch [list $_clone $comp configure -$opt $new] err]410 set new $_settings($this-$comp$opt) 411 set old [$_clone $comp cget $opt] 412 set code [catch [list $_clone $comp configure $opt $new] err] 413 413 if { $code != 0 } { 414 414 bell 415 415 global errorInfo 416 416 puts stderr "$err: $errorInfo" 417 set _settings($this-$comp -$opt) $old418 $_clone $comp configure -$opt $old417 set _settings($this-$comp$opt) $old 418 $_clone $comp configure $opt $old 419 419 } 420 420 } 421 421 422 422 itcl::body Rappture::XyPrint::SetNamedComponentOption { comp name opt } { 423 set new $_settings($this-$comp -$opt)424 set old [$_clone $comp cget $name -$opt]425 set code [catch [list $_clone $comp configure $name -$opt $new] err]423 set new $_settings($this-$comp$opt) 424 set old [$_clone $comp cget $name $opt] 425 set code [catch [list $_clone $comp configure $name $opt $new] err] 426 426 if { $code != 0 } { 427 427 bell 428 428 global errorInfo 429 429 puts stderr "$err: $errorInfo" 430 set _settings($this-$comp -$opt) $old431 $_clone $comp configure $name -$opt $old430 set _settings($this-$comp$opt) $old 431 $_clone $comp configure $name $opt $old 432 432 } 433 433 } … … 514 514 set _settings($this-element-color) [$_clone element cget $elem -color] 515 515 set _settings($this-element-dashes) [$_clone element cget $elem -dashes] 516 set _settings($this-element-hide) [$_clone element cget $elem -hide]516 #set _settings($this-element-hide) [$_clone element cget $elem -hide] 517 517 set _settings($this-element-label) [$_clone element cget $elem -label] 518 518 set page $itk_component(legend_page) … … 663 663 set _settings($this-legend-position) [$page.position current] 664 664 set _settings($this-legend-anchor) [$page.anchor current] 665 foreach option { hide position anchorborderwidth } {665 foreach option { -hide -position -anchor -borderwidth } { 666 666 SetComponentOption legend $option 667 667 } … … 1075 1075 set _settings($this-legend-anchor) [$page.anchor current] 1076 1076 1077 foreach option { hide position anchorborderwidth } {1077 foreach option { -hide -position -anchor -borderwidth } { 1078 1078 SetComponentOption legend $option 1079 1079 } … … 1092 1092 set page $itk_component(axis_page) 1093 1093 $_clone configure -plotpad${type} $_settings($this-axis-plotpad) 1094 foreach option { grid min max loose title stepsizesubdivisions } {1094 foreach option { -grid -min -max -loose -title -stepsize -subdivisions } { 1095 1095 SetNamedComponentOption axis $axis $option 1096 1096 } … … 1119 1119 set _settings($this-element-symbol) [$page.symbol current] 1120 1120 set _settings($this-element-dashes) [$page.dashes current] 1121 foreach option { symbol color dashes hidelabel } {1121 foreach option { -symbol -color -dashes -label } { 1122 1122 SetNamedComponentOption element $elem $option 1123 1123 } … … 1338 1338 # Element settings 1339 1339 foreach elem [$_clone element show] { 1340 append out " if \{ \[preview element exists \"$elem\"\] \} \{\n" 1341 append out " preview element configure \"$elem\"" 1342 foreach opt { -symbol -color -dashes -hide -label } { 1340 set label [$_clone element cget $elem -label] 1341 if { $label == "" } { 1342 continue 1343 } 1344 append out " if \{ \[preview element exists \"$label\"\] \} \{\n" 1345 append out " preview element configure \"$label\"" 1346 foreach opt { -symbol -color -dashes -label } { 1343 1347 set value [list [$_clone element cget $elem $opt]] 1344 1348 append out " $opt $value"
Note: See TracChangeset
for help on using the changeset viewer.