- Timestamp:
- Nov 17, 2011, 2:29:45 PM (13 years ago)
- Location:
- trunk/gui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/xyprint.tcl
r2654 r2693 291 291 # Axis component 292 292 foreach axis [$orig axis names] { 293 if { $axis == "z" } { 294 continue 295 } 293 296 if { [$orig axis cget $axis -hide] } { 294 297 continue … … 379 382 set _settings($this-axis-title-fontslant) roman 380 383 foreach axis [$_clone axis names] { 384 if { $axis == "z" } { 385 continue 386 } 381 387 if { [$_clone axis cget $axis -hide] } { 382 388 continue … … 398 404 -titlefont $titlefont 399 405 } 406 set count 0 400 407 foreach elem [$_clone element names] { 401 408 if { [$_clone element type $elem] == "bar" } { 402 409 continue 403 410 } 411 incr count 404 412 if { [$_clone element cget $elem -linewidth] > 1 } { 405 413 $_clone element configure $elem -linewidth 1 -pixels 3 406 414 } 415 } 416 if { $count == 0 } { 417 # There are no "line" elements in the graph. 418 # Remove the symbol and dashes controls. 419 set page $itk_component(legend_page) 420 # May have already been forgotten. 421 catch { 422 blt::table forget $page.symbol_l 423 blt::table forget $page.symbol 424 blt::table forget $page.dashes_l 425 blt::table forget $page.dashes 426 } 407 427 } 408 428 } -
trunk/gui/scripts/xyresult.tcl
r2388 r2693 15 15 package require Itk 16 16 package require BLT 17 18 option add *XyResult.width 3i widgetDefault 19 option add *XyResult.height 3i widgetDefault 20 option add *XyResult.gridColor #d9d9d9 widgetDefault 21 option add *XyResult.activeColor blue widgetDefault 22 option add *XyResult.dimColor gray widgetDefault 23 option add *XyResult.controlBackground gray widgetDefault 24 option add *XyResult.font \ 25 -*-helvetica-medium-r-normal-*-12-* widgetDefault 17 26 18 27 set autocolors { … … 51 60 } 52 61 53 option add *XyResult.width 3i widgetDefault54 option add *XyResult.height 3i widgetDefault55 option add *XyResult.gridColor #d9d9d9 widgetDefault56 option add *XyResult.activeColor blue widgetDefault57 option add *XyResult.dimColor gray widgetDefault58 option add *XyResult.controlBackground gray widgetDefault59 option add *XyResult.font \60 -*-helvetica-medium-r-normal-*-12-* widgetDefault61 62 option add *XyResult.autoColors $autocolors widgetDefault 62 63 option add *XyResult*Balloon*Entry.background white widgetDefault … … 97 98 98 99 private variable _dispatcher "" ;# dispatcher for !events 99 private variable _dlist "" ;# list of data objectobjects100 private variable _dataobj2color ;# maps data object=> plotting color101 private variable _dataobj2width ;# maps data object=> line width102 private variable _dataobj2dashes ;# maps data object=> BLT -dashes list103 private variable _dataobj2raise ;# maps data object=> raise flag 0/1104 private variable _dataobj2desc ;# maps data object=> description of data105 private variable _elem2dataobj ;# maps graph element => data object100 private variable _dlist "" ;# list of dataobj objects 101 private variable _dataobj2color ;# maps dataobj => plotting color 102 private variable _dataobj2width ;# maps dataobj => line width 103 private variable _dataobj2dashes ;# maps dataobj => BLT -dashes list 104 private variable _dataobj2raise ;# maps dataobj => raise flag 0/1 105 private variable _dataobj2desc ;# maps dataobj => description of data 106 private variable _elem2dataobj ;# maps graph element => dataobj 106 107 private variable _label2axis ;# maps axis label => axis ID 107 108 private variable _limits ;# axis limits: x-min, x-max, etc. … … 170 171 -outline black -fill red -color black 171 172 172 #173 173 # Add bindings so you can mouse over points to see values: 174 174 # … … 293 293 set params(-width) 0 294 294 } 295 296 295 # if the color is "auto", then select a color from -autocolors 297 if { $params(-color) == "auto" || $params(-color) == "autoreset"} {296 if { $params(-color) == "auto" || $params(-color) == "autoreset" } { 298 297 if {$params(-color) == "autoreset"} { 299 298 set _autoColorI 0 300 299 } 301 set color [lindex $itk_option(-autocolors) $_autoColorI] 302 if {"" == $color} { set color black } 300 set color [lindex $itk_option(-autocolors) $_autoColorI] 301 if { "" == $color} { 302 set color black 303 } 303 304 set params(-color) $color 304 305 305 # set up for next auto color 306 306 if {[incr _autoColorI] >= [llength $itk_option(-autocolors)]} { … … 320 320 set params(-color) [Rappture::color::brightness \ 321 321 $params(-color) $params(-brightness)] 322 323 322 set bg [$itk_component(plot) cget -plotbackground] 324 323 foreach {h s v} [Rappture::color::RGBtoHSV $bg] break … … 359 358 lappend top $obj 360 359 } else { 361 lappend bottom $obj 360 lappend bottom $obj 362 361 } 363 362 } … … 369 368 # USAGE: delete ?<dataobj1> <dataobj2> ...? 370 369 # 371 # Clients use this to delete a data object from the plot. If no data objects372 # are specified, then all data objects are deleted.370 # Clients use this to delete a dataobj from the plot. If no dataobjs 371 # are specified, then all dataobjs are deleted. 373 372 # ---------------------------------------------------------------------- 374 373 itcl::body Rappture::XyResult::delete {args} { … … 377 376 } 378 377 379 # delete all specified data objects378 # delete all specified dataobjs 380 379 set changed 0 381 380 foreach dataobj $args { … … 383 382 if {$pos >= 0} { 384 383 set _dlist [lreplace $_dlist $pos $pos] 385 catch {unset _dataobj2color($dataobj)}386 catch {unset _dataobj2width($dataobj)}387 catch {unset _dataobj2dashes($dataobj)}388 catch {unset _dataobj2raise($dataobj)}384 array unset _dataobj2color $dataobj 385 array unset _dataobj2width $dataobj 386 array unset _dataobj2dashes $dataobj 387 array unset _dataobj2raise $dataobj 389 388 foreach elem [array names _elem2dataobj] { 390 389 if {$_elem2dataobj($elem) == $dataobj} { 391 unset _elem2dataobj($elem)390 array unset _elem2dataobj $elem 392 391 } 393 392 } … … 412 411 # Sets the default limits for the overall plot according to the 413 412 # limits of the data for all of the given <dataobj> objects. This 414 # accounts for all data objects--even those not showing on the screen.415 # Because of this, the limits are appropriate for all data objects as413 # accounts for all dataobjs--even those not showing on the screen. 414 # Because of this, the limits are appropriate for all dataobjs as 416 415 # the user scans through data in the ResultSet viewer. 417 416 # ---------------------------------------------------------------------- … … 431 430 catch {unset _limits} 432 431 foreach dataobj $args { 433 # find the axes for this data object(e.g., {x y2})432 # find the axes for this dataobj (e.g., {x y2}) 434 433 foreach {map(x) map(y)} [GetAxes $dataobj] break 435 436 434 foreach axis {x y} { 437 435 # get defaults for both linear and log scales … … 440 438 set id $map($axis)$type 441 439 foreach {min max} [$dataobj limits $axis$type] break 440 set amin [$dataobj hints ${axis}min] 441 set amax [$dataobj hints ${axis}max] 442 if { $amin != "" } { 443 set min $amin 444 } 445 if { $amax != "" } { 446 set max $amax 447 } 442 448 if {"" != $min && "" != $max} { 443 449 if {![info exists _limits($id-min)]} { … … 454 460 } 455 461 } 456 457 462 if {[$dataobj hints ${axis}scale] == "log"} { 458 463 Axis scale $map($axis) log … … 497 502 button $inner.go -text [Rappture::filexfer::label download] \ 498 503 -command [lindex $args 0] 499 pack $inner.go - pady 4504 pack $inner.go -side bottom -pady 4 500 505 } else { 501 506 set inner [$popup component inner] … … 675 680 676 681 # 677 # Plot all of the data objects.682 # Plot all of the dataobjs. 678 683 # 679 684 set count 0 … … 681 686 set label [$dataobj hints label] 682 687 foreach {mapx mapy} [GetAxes $dataobj] break 683 684 688 foreach comp [$dataobj components] { 685 689 set xv [$dataobj mesh $comp] … … 694 698 } 695 699 } 696 697 700 if {[info exists _dataobj2width($dataobj)]} { 698 701 set lwidth $_dataobj2width($dataobj) … … 1521 1524 # ---------------------------------------------------------------------- 1522 1525 itcl::body Rappture::XyResult::GetAxes {dataobj} { 1526 # rebuild if needed, so we know about the axes 1523 1527 if 0 { 1524 1528 # Don't do this. Given dataobj may be deleted in the rebuild -
trunk/gui/src/Makefile.in
r2202 r2693 47 47 48 48 LIBS = \ 49 -L../../src/core -lrappture \50 49 -L$(libdir) $(TCL_LIB_SPEC) $(TK_LIB_SPEC) $(TK_XLIBSW) -lm 51 50
Note: See TracChangeset
for help on using the changeset viewer.