Changeset 1786 for branches/blt4/gui/scripts/xyprint.tcl
- Timestamp:
- Jul 2, 2010, 3:40:08 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/blt4/gui/scripts/xyprint.tcl
r1777 r1786 46 46 private common _oldSettingsFile "~/.rpsettings" 47 47 private common _settingsFile "~/.rp_settings" 48 48 49 public method print { graph toolName plotName } 49 50 public method reset {} 50 51 51 private method CopyOptions { cmd orig clone }52 private method CopyOptions { cmd orig clone {exclude {}}} 52 53 private method CloneGraph { orig } 53 54 … … 132 133 0,0 $itk_component(preview) -cspan 2 -fill both \ 133 134 1,0 $itk_component(tabs) -fill both -cspan 2 \ 134 2,1 $itk_component(cancel) -padx 2 -pady 2 -width .9i \135 2,0 $itk_component(ok) -padx 2 -pady 2 -width .9i 135 2,1 $itk_component(cancel) -padx 2 -pady 2 -width .9i -fill y \ 136 2,0 $itk_component(ok) -padx 2 -pady 2 -width .9i -fill y 136 137 blt::table configure $itk_interior r1 -resize none 137 138 blt::table configure $itk_interior r1 -resize both … … 268 269 } 269 270 270 itcl::body Rappture::XyPrint::CopyOptions { cmd orig clone } {271 itcl::body Rappture::XyPrint::CopyOptions { cmd orig clone {exclude {}} } { 271 272 set all [eval $orig $cmd] 272 273 set configLine $clone 274 foreach name $exclude { 275 set ignore($name) 1 276 } 273 277 foreach arg $cmd { 274 278 lappend configLine $arg … … 281 285 set initial [lindex $option 3] 282 286 set current [lindex $option 4] 283 if { $switch == "-data"} {287 if { [info exists ignore($switch)] } { 284 288 continue 285 289 } … … 322 326 foreach marker [$orig marker names] { 323 327 $_clone marker create [$orig marker type $marker] -name $marker 324 CopyOptions [list marker configure $marker] $orig $_clone 328 CopyOptions [list marker configure $marker] $orig $_clone -name 325 329 } 326 330 # Element component 327 331 foreach elem [$orig element names] { 328 332 $_clone element create $elem 329 CopyOptions [list element configure $elem] $orig $_clone 333 CopyOptions [list element configure $elem] $orig $_clone -data 330 334 if { [$_clone element cget $elem -hide] } { 331 335 $_clone element configure $elem -label "" … … 340 344 # Crosshairs component 341 345 CopyOptions {crosshairs configure} $orig $_clone 346 347 # Create markers representing lines at zero for the x and y axis. 348 $_clone marker create line -name x-zero \ 349 -coords "0 -Inf 0 Inf" -dashes 1 -hide yes 350 $_clone marker create line -name y-zero \ 351 -coords "-Inf 0 Inf 0" -dashes 1 -hide yes 342 352 } 343 353 … … 386 396 -titlefont $_fonts($axis-title) 387 397 } 388 #$_clone yaxis configure -rotate 90389 #$_clone y2axis configure -rotate 270390 398 foreach elem [$_clone element names] { 391 $_clone element configure $elem -linewidth 1 \ 392 -pixels 3 393 } 394 # Create markers representing lines at zero for the x and y axis. 395 $_clone marker create line -name x-zero \ 396 -coords "0 -Inf 0 Inf" -dashes 1 -hide yes 397 $_clone marker create line -name y-zero \ 398 -coords "-Inf 0 Inf 0" -dashes 1 -hide yes 399 if { [$_clone element cget $elem -linewidth] > 1 } { 400 $_clone element configure $elem -linewidth 1 -pixels 3 401 } 402 } 399 403 } 400 404 … … 496 500 itcl::body Rappture::XyPrint::GetAxis {} { 497 501 set axis $_settings($this-axis-selected) 498 foreach option { grid min max loose title stepsizesubdivisions } {499 set _settings($this-axis -$option) [$_clone axis cget $axis -$option]502 foreach option { -grid -min -max -loose -title -stepsize -subdivisions } { 503 set _settings($this-axis$option) [$_clone axis cget $axis $option] 500 504 } 501 505 set type [GetAxisType $axis] … … 1260 1264 1261 1265 itcl::body Rappture::XyPrint::SetLayoutOption { opt } { 1262 set new [Inches2Pixels $_settings($this-layout -$opt)]1263 $_clone configure -$opt $new1266 set new [Inches2Pixels $_settings($this-layout$opt)] 1267 $_clone configure $opt $new 1264 1268 } 1265 1269 1266 1270 itcl::body Rappture::XyPrint::ApplyLayoutSettings {} { 1267 foreach opt { width height leftmargin rightmargin topmargin bottommargin } { 1268 set old [$_clone cget -$opt] 1271 foreach opt { -width -height -leftmargin -rightmargin -topmargin 1272 -bottommargin } { 1273 set old [$_clone cget $opt] 1269 1274 set code [catch { SetLayoutOption $opt } err] 1270 1275 if { $code != 0 } { … … 1272 1277 global errorInfo 1273 1278 puts stderr "$err: $errorInfo" 1274 set _settings($this-layout -$opt) [Pixels2Inches $old]1275 $_clone configure -$opt [Pixels2Inches $old]1279 set _settings($this-layout$opt) [Pixels2Inches $old] 1280 $_clone configure $opt [Pixels2Inches $old] 1276 1281 } 1277 1282 }
Note: See TracChangeset
for help on using the changeset viewer.