Changeset 5115 for branches/1.3/gui/scripts/isomarker.tcl
- Timestamp:
- Mar 9, 2015 8:04:58 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3/gui/scripts/isomarker.tcl
r4848 r5115 1 # -*- mode: tcl; indent-tabs-mode: nil -*- 1 # -*- mode: tcl; indent-tabs-mode: nil -*- 2 2 3 3 # ---------------------------------------------------------------------- … … 24 24 private variable _canvas "" 25 25 private variable _nvobj ""; # Parent nanovis object. 26 private variable _tf ""; # Transfer function that this marker is 26 private variable _tf ""; # Transfer function that this marker is 27 27 # associated with. 28 28 private variable _activeMotion 0 … … 31 31 private common _activeIcon [Rappture::icon nvlegendmark2] 32 32 33 constructor {c obj tf args} { 33 constructor {c obj tf args} { 34 34 set _canvas $c 35 35 set _nvobj $obj … … 52 52 [itcl::code $this HandleEvent "end" %x %y] 53 53 } 54 destructor { 54 destructor { 55 55 $_canvas delete $this 56 56 } … … 76 76 } 77 77 } 78 public method screenpos { } { 78 public method screenpos { } { 79 79 set x [relval] 80 80 if { $x < 0.0 } { 81 81 set x 0.0 82 82 } elseif { $x > 1.0 } { 83 set x 1.0 83 set x 1.0 84 84 } 85 set low 10 85 set low 10 86 86 set w [winfo width $_canvas] 87 87 set high [expr {$w - 10}] … … 102 102 public method relval { {x "-get"} } { 103 103 if { $x == "-get" } { 104 array set limits [$_nvobj limits $_tf] 104 array set limits [$_nvobj limits $_tf] 105 105 if { $limits(vmax) == $limits(vmin) } { 106 106 if { $limits(vmax) == 0.0 } { … … 113 113 return [expr {($_value-$limits(vmin))/ 114 114 ($limits(vmax) - $limits(vmin))}] 115 } 116 array set limits [$_nvobj limits $_tf] 115 } 116 array set limits [$_nvobj limits $_tf] 117 117 if { $limits(vmax) == $limits(vmin) } { 118 118 set limits(vmin) 0.0 … … 121 121 if { [catch {expr $limits(vmax) - $limits(vmin)} r] != 0 } { 122 122 return 0.0 123 } 123 } 124 124 absval [expr {($x * $r) + $limits(vmin)}] 125 125 } … … 136 136 } 137 137 start { 138 $_canvas raise $_tick 138 $_canvas raise $_tick 139 139 set _activePress 1 140 140 activate yes
Note: See TracChangeset
for help on using the changeset viewer.