Changeset 57 for trunk/gui/scripts/curve.tcl
- Timestamp:
- Sep 19, 2005 8:27:37 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/curve.tcl
r56 r57 32 32 private variable _curve "" ;# lib obj representing this curve 33 33 private variable _comp2xy ;# maps component name => x,y vectors 34 private variable _hints ;# cache of hints stored in XML 34 35 35 36 private common _counter 0 ;# counter for unique vector names … … 108 109 109 110 # ---------------------------------------------------------------------- 110 # USAGE: limits x|xl og|y|ylog111 # USAGE: limits x|xlin|xlog|y|ylin|ylog 111 112 # 112 113 # Returns the {min max} limits for the specified axis. … … 116 117 set max "" 117 118 switch -- $which { 118 x { set pos 0; set log 0; set axis xaxis }119 x - xlin { set pos 0; set log 0; set axis xaxis } 119 120 xlog { set pos 0; set log 1; set axis xaxis } 120 y - v{ set pos 1; set log 0; set axis yaxis }121 y - ylin - v - vlin { set pos 1; set log 0; set axis yaxis } 121 122 ylog - vlog { set pos 1; set log 1; set axis yaxis } 122 123 default { 123 error "bad option \"$which\": should be x, xl og, y, ylog, v, vlog"124 error "bad option \"$which\": should be x, xlin, xlog, y, ylin, ylog, v, vlin, vlog" 124 125 } 125 126 } … … 184 185 # ---------------------------------------------------------------------- 185 186 itcl::body Rappture::Curve::hints {{keyword ""}} { 186 foreach {key path} { 187 group about.group 188 label about.label 189 color about.color 190 style about.style 191 xlabel xaxis.label 192 xunits xaxis.units 193 xscale xaxis.scale 194 xmin xaxis.min 195 xmax xaxis.max 196 ylabel yaxis.label 197 yunits yaxis.units 198 yscale yaxis.scale 199 ymin yaxis.min 200 ymax yaxis.max 201 } { 202 set str [$_curve get $path] 203 if {"" != $str} { 204 set hints($key) $str 205 } 206 } 207 208 if {[info exists hints(xlabel)] && "" != $hints(xlabel) 209 && [info exists hints(xunits)] && "" != $hints(xunits)} { 210 set hints(xlabel) "$hints(xlabel) ($hints(xunits))" 211 } 212 if {[info exists hints(ylabel)] && "" != $hints(ylabel) 213 && [info exists hints(yunits)] && "" != $hints(yunits)} { 214 set hints(ylabel) "$hints(ylabel) ($hints(yunits))" 215 } 216 217 if {[info exists hints(group)] && [info exists hints(label)]} { 218 # pop-up help for each curve 219 set hints(tooltip) $hints(label) 187 if {![info exists _hints]} { 188 foreach {key path} { 189 group about.group 190 label about.label 191 color about.color 192 style about.style 193 xlabel xaxis.label 194 xunits xaxis.units 195 xscale xaxis.scale 196 xmin xaxis.min 197 xmax xaxis.max 198 ylabel yaxis.label 199 yunits yaxis.units 200 yscale yaxis.scale 201 ymin yaxis.min 202 ymax yaxis.max 203 } { 204 set str [$_curve get $path] 205 if {"" != $str} { 206 set _hints($key) $str 207 } 208 } 209 210 if {[info exists _hints(xlabel)] && "" != $_hints(xlabel) 211 && [info exists _hints(xunits)] && "" != $_hints(xunits)} { 212 set _hints(xlabel) "$_hints(xlabel) ($_hints(xunits))" 213 } 214 if {[info exists _hints(ylabel)] && "" != $_hints(ylabel) 215 && [info exists _hints(yunits)] && "" != $_hints(yunits)} { 216 set _hints(ylabel) "$_hints(ylabel) ($_hints(yunits))" 217 } 218 219 if {[info exists _hints(group)] && [info exists _hints(label)]} { 220 # pop-up help for each curve 221 set _hints(tooltip) $_hints(label) 222 } 220 223 } 221 224 222 225 if {$keyword != ""} { 223 if {[info exists hints($keyword)]} {224 return $ hints($keyword)226 if {[info exists _hints($keyword)]} { 227 return $_hints($keyword) 225 228 } 226 229 return "" 227 230 } 228 return [array get hints]231 return [array get _hints] 229 232 } 230 233
Note: See TracChangeset
for help on using the changeset viewer.