- Timestamp:
- Jul 11, 2013, 8:52:48 AM (11 years ago)
- Location:
- trunk/gui/scripts
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/vtkglyphviewer.tcl
r3759 r3779 136 136 private variable _start 0 137 137 private variable _title "" 138 private variable _glyph139 private variable _glyphsList ""140 138 141 139 common _downloadPopup; # download options from popup … … 1487 1485 # 1488 1486 itcl::body Rappture::VtkGlyphViewer::RequestLegend {} { 1487 set _legendPending 0 1489 1488 if { ![info exists _fields($_curFldName)] } { 1490 1489 return 1491 1490 } 1492 1491 set fname $_curFldName 1493 set _legendPending 01494 1492 set font "Arial 8" 1495 1493 set lineht [font metrics $font -linespace] … … 2224 2222 set tx [expr $x + 15] 2225 2223 set ty [expr $y - 5] 2226 if { [info exists _glyph($y)] } { 2227 Rappture::Tooltip::text $c [format "$title %g (glyph)" $_glyph($y)] 2228 } else { 2229 Rappture::Tooltip::text $c [format "$title %g" $value] 2230 } 2224 Rappture::Tooltip::text $c [format "$title %g" $value] 2231 2225 Rappture::Tooltip::tooltip show $c +$tx,+$ty 2232 2226 } … … 2330 2324 $c create text $x $y \ 2331 2325 -anchor ne \ 2332 -fill $itk_option(-plotforeground) -tags " zmax legend" \2326 -fill $itk_option(-plotforeground) -tags "vmax legend" \ 2333 2327 -font $font 2334 2328 incr y $lineht … … 2340 2334 $c create text $x [expr {$h-2}] \ 2341 2335 -anchor se \ 2342 -fill $itk_option(-plotforeground) -tags " zmin legend" \2336 -fill $itk_option(-plotforeground) -tags "vmin legend" \ 2343 2337 -font $font 2344 2338 $c bind sensor <Enter> [itcl::code $this EnterLegend %x %y] … … 2346 2340 $c bind sensor <Motion> [itcl::code $this MotionLegend %x %y] 2347 2341 } 2348 $c delete isoline2349 2342 set x2 $x 2350 2343 set iw [image width $_image(legend)] 2351 2344 set ih [image height $_image(legend)] 2352 2345 set x1 [expr $x2 - ($iw*12)/10] 2353 # Draw the glyph on the legend.2354 array unset _glyph2355 2346 2356 2347 $c bind title <ButtonPress> [itcl::code $this Combo post] … … 2361 2352 if { [info exists _limits($_curFldName)] } { 2362 2353 foreach { vmin vmax } $_limits($_curFldName) break 2363 $c itemconfigure zmin -text [format %g $vmin]2364 $c itemconfigure zmax -text [format %g $vmax]2354 $c itemconfigure vmin -text [format %g $vmin] 2355 $c itemconfigure vmax -text [format %g $vmax] 2365 2356 } 2366 2357 set y 2 … … 2372 2363 $c raise title 2373 2364 } 2374 $c coords zmax $x $y2365 $c coords vmax $x $y 2375 2366 incr y $lineht 2376 2367 $c coords colormap $x $y 2377 set ix [image width $_image(legend)]2378 set ih [image height $_image(legend)]2379 2368 $c coords sensor [expr $x - $iw] $y $x [expr $y + $ih] 2380 2369 $c raise sensor 2381 $c coords zmin $x [expr {$h - 2}]2370 $c coords vmin $x [expr {$h - 2}] 2382 2371 } 2383 2372 -
trunk/gui/scripts/vtkisosurfaceviewer.tcl
r3767 r3779 1507 1507 # 1508 1508 itcl::body Rappture::VtkIsosurfaceViewer::RequestLegend {} { 1509 set _legendPending 0 1509 1510 if { ![info exists _fields($_curFldName)] } { 1510 1511 return 1511 1512 } 1512 1513 set fname $_curFldName 1513 set _legendPending 01514 1514 set font "Arial 8" 1515 1515 set lineht [font metrics $font -linespace] … … 2388 2388 $c create text $x $y \ 2389 2389 -anchor ne \ 2390 -fill $itk_option(-plotforeground) -tags " zmax legend" \2390 -fill $itk_option(-plotforeground) -tags "vmax legend" \ 2391 2391 -font $font 2392 2392 incr y $lineht … … 2398 2398 $c create text $x [expr {$h-2}] \ 2399 2399 -anchor se \ 2400 -fill $itk_option(-plotforeground) -tags " zmin legend" \2400 -fill $itk_option(-plotforeground) -tags "vmin legend" \ 2401 2401 -font $font 2402 2402 $c bind sensor <Enter> [itcl::code $this EnterLegend %x %y] … … 2443 2443 if { [info exists _limits($_curFldName)] } { 2444 2444 foreach { vmin vmax } $_limits($_curFldName) break 2445 $c itemconfigure zmin -text [format %g $vmin]2446 $c itemconfigure zmax -text [format %g $vmax]2445 $c itemconfigure vmin -text [format %g $vmin] 2446 $c itemconfigure vmax -text [format %g $vmax] 2447 2447 } 2448 2448 set y 2 … … 2454 2454 $c raise title 2455 2455 } 2456 $c coords zmax $x $y2456 $c coords vmax $x $y 2457 2457 incr y $lineht 2458 2458 $c coords colormap $x $y 2459 set ix [image width $_image(legend)]2460 set ih [image height $_image(legend)]2461 2459 $c coords sensor [expr $x - $iw] $y $x [expr $y + $ih] 2462 2460 $c raise sensor 2463 $c coords zmin $x [expr {$h - 2}]2461 $c coords vmin $x [expr {$h - 2}] 2464 2462 } 2465 2463
Note: See TracChangeset
for help on using the changeset viewer.