Changeset 87b1c46 in tol for tolbase/lib/toltk/graph.tcl
- Timestamp:
- Nov 15, 2016, 9:03:42 AM (10 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 4592f76
- Parents:
- 06f7d3d
- File:
-
- 1 edited
-
tolbase/lib/toltk/graph.tcl (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tolbase/lib/toltk/graph.tcl
r06f7d3d r87b1c46 1 1 #///////////////////////////////////////////////////////////////////////////// 2 2 # FILE : graph.tcl 3 # PURPOSE : This file is part of BLTToolkit3 # PURPOSE : This file is part of RBC Toolkit 4 4 #///////////////////////////////////////////////////////////////////////////// 5 5 6 # force bltload7 8 if { [info command "_ blt_InitStack"] eq "" } {9 blt::graph .__g__10 Blt_ZoomStack .__g__6 # force rbc load 7 8 if { [info command "_rbc_InitStack"] eq "" } { 9 rbc::graph .__g__ 10 Rbc_ZoomStack .__g__ 11 11 destroy .__g__ 12 rename blt::InitStack _blt_InitStack12 rename rbc::InitStack _rbc_InitStack 13 13 } 14 14 … … 25 25 } 26 26 27 if { [ catch { blt::busy patched } ] } {28 rename :: blt::busy _blt_busy29 interp alias {} :: blt::busy {} Busy_Patched30 puts "interp alias {} :: blt::busy {} Busy_Patched"27 if { [ catch { rbc::busy patched } ] } { 28 rename ::rbc::busy _rbc_busy 29 interp alias {} ::rbc::busy {} Busy_Patched 30 puts "interp alias {} ::rbc::busy {} Busy_Patched" 31 31 } 32 32 … … 39 39 # scroll 40 40 41 proc Blt_ViewMode { graph mode } {42 global zoomInfo 43 44 if { ![ blt::ClearMode $graph $mode] } return41 proc Rbc_ViewMode { graph mode } { 42 global zoomInfo 43 44 if { ![rbc::ClearMode $graph $mode] } return 45 45 46 46 set zoomInfo($graph,mode) $mode … … 48 48 if { [string equal $mode "scroll"] } { 49 49 # limpio el stack 50 blt::InitStack $graph $mode51 bind scroll-$graph <ButtonPress-1> { blt::SetScrollPoint %W %x %y }52 bind scroll-$graph <ButtonRelease-1> { blt::SetScrollPoint %W %x %y }50 rbc::InitStack $graph $mode 51 bind scroll-$graph <ButtonPress-1> { rbc::SetScrollPoint %W %x %y } 52 bind scroll-$graph <ButtonRelease-1> { rbc::SetScrollPoint %W %x %y } 53 53 # este evento posiblemente ya no hara falta 54 54 bind scroll-$graph <ButtonPress-3> { 55 55 if { [%W inside %x %y] } { 56 blt::ResetScroll %W57 } 58 } 59 blt::AddBindTag $graph scroll-$graph56 rbc::ResetScroll %W 57 } 58 } 59 rbc::AddBindTag $graph scroll-$graph 60 60 } elseif { [regexp "zoom-*" $mode] } { 61 61 puts "mode = $mode" 62 bind zoom-$graph <ButtonPress-1> { blt::SetZoomPoint %W %x %y }62 bind zoom-$graph <ButtonPress-1> { rbc::SetZoomPoint %W %x %y } 63 63 if { [string equal $mode zoom-frame] } { 64 bind zoom-$graph <ButtonRelease-1> { blt::SetZoomPoint %W %x %y }64 bind zoom-$graph <ButtonRelease-1> { rbc::SetZoomPoint %W %x %y } 65 65 } else { 66 66 bind zoom-$graph <ButtonRelease-1> "" … … 68 68 bind zoom-$graph <ButtonPress-3> { 69 69 if { [%W inside %x %y] } { 70 blt::ResetZoom %W71 } 72 } 73 blt::AddBindTag $graph zoom-$graph74 } 75 } 76 77 proc blt::RemoveBindTag { widget args } {70 rbc::ResetZoom %W 71 } 72 } 73 rbc::AddBindTag $graph zoom-$graph 74 } 75 } 76 77 proc rbc::RemoveBindTag { widget args } { 78 78 set oldTagList [bindtags $widget] 79 79 foreach tag $args { … … 85 85 } 86 86 87 proc blt::InitStack { graph {mode zoom-frame} } {87 proc rbc::InitStack { graph {mode zoom-frame} } { 88 88 global zoomInfo 89 89 90 _ blt_InitStack $graph90 _rbc_InitStack $graph 91 91 # this is to allow zoom in, out scroll 92 92 … … 95 95 96 96 97 proc blt::SetZoomScale { graph scale } {97 proc rbc::SetZoomScale { graph scale } { 98 98 global zoomInfo 99 99 … … 101 101 } 102 102 103 proc blt::ClearMode { graph newmode } {103 proc rbc::ClearMode { graph newmode } { 104 104 global zoomInfo 105 105 … … 111 111 if { [string equal $zoomInfo($graph,mode) "scroll"] } { 112 112 eval $graph marker delete [$graph marker names "scroll*"] 113 blt::RemoveBindTag $graph "scroll-region-$graph" "scroll-$graph"113 rbc::RemoveBindTag $graph "scroll-region-$graph" "scroll-$graph" 114 114 } else { 115 115 eval $graph marker delete [$graph marker names "zoom*"] 116 blt::RemoveBindTag $graph "select-region-$graph" "zoom-$graph"117 } 118 } else { 119 blt::InitStack $graph ""116 rbc::RemoveBindTag $graph "select-region-$graph" "zoom-$graph" 117 } 118 } else { 119 rbc::InitStack $graph "" 120 120 } 121 121 return 1 122 122 } 123 123 124 proc blt::ZoomScale { graph } {124 proc rbc::ZoomScale { graph } { 125 125 global zoomInfo 126 126 … … 166 166 } 167 167 168 proc blt::SetZoomPoint { graph x y } {168 proc rbc::SetZoomPoint { graph x y } { 169 169 global zoomInfo zoomMod 170 170 if { ![info exists zoomInfo($graph,corner)] } { 171 blt::InitStack $graph172 } 173 blt::GetCoords $graph $x $y $zoomInfo($graph,corner)174 175 #puts blt::SetZoomPoint171 rbc::InitStack $graph 172 } 173 rbc::GetCoords $graph $x $y $zoomInfo($graph,corner) 174 175 #puts rbc::SetZoomPoint 176 176 177 177 if { [string compare $zoomInfo($graph,mode) "zoom-frame"] } { 178 blt::ZoomScale $graph178 rbc::ZoomScale $graph 179 179 return 180 180 } … … 186 186 } 187 187 bind select-region-$graph <${modifier}Motion> { 188 blt::GetCoords %W %x %y B189 # blt::MarkPoint $graph B190 blt::Box %W188 rbc::GetCoords %W %x %y B 189 #rbc::MarkPoint $graph B 190 rbc::Box %W 191 191 } 192 192 if { $zoomInfo($graph,corner) == "A" } { … … 196 196 # First corner selected, start watching motion events 197 197 198 # blt::MarkPoint $graph A199 blt::ZoomTitleNext $graph200 201 blt::AddBindTag $graph select-region-$graph198 #rbc::MarkPoint $graph A 199 rbc::ZoomTitleNext $graph 200 201 rbc::AddBindTag $graph select-region-$graph 202 202 set zoomInfo($graph,corner) B 203 203 } else { 204 204 # Delete the modal binding 205 blt::RemoveBindTag $graph select-region-$graph206 blt::PushZoom $graph205 rbc::RemoveBindTag $graph select-region-$graph 206 rbc::PushZoom $graph 207 207 set zoomInfo($graph,corner) A 208 208 } 209 209 } 210 210 211 proc blt::SetScrollPoint { graph x y } {211 proc rbc::SetScrollPoint { graph x y } { 212 212 global zoomInfo 213 213 214 blt::GetCoords $graph $x $y A214 rbc::GetCoords $graph $x $y A 215 215 bind scroll-region-$graph <Any-Motion> { 216 blt::GetCoords %W %x %y B217 # blt::MarkPoint $graph B218 blt::Scroll %W216 rbc::GetCoords %W %x %y B 217 #rbc::MarkPoint $graph B 218 rbc::Scroll %W 219 219 } 220 220 if { $zoomInfo($graph,corner) == "A" } { … … 224 224 # First corner selected, start watching motion events 225 225 226 # blt::MarkPoint $graph A227 blt::ScrollTitle $graph228 229 blt::AddBindTag $graph scroll-region-$graph226 #rbc::MarkPoint $graph A 227 rbc::ScrollTitle $graph 228 229 rbc::AddBindTag $graph scroll-region-$graph 230 230 set zoomInfo($graph,corner) B 231 231 } else { … … 235 235 } 236 236 237 proc blt::Scroll { graph } {237 proc rbc::Scroll { graph } { 238 238 global zoomInfo 239 239 … … 257 257 } 258 258 259 proc blt::ResetScroll { graph } {259 proc rbc::ResetScroll { graph } { 260 260 global zoomInfo 261 261 262 262 eval $graph marker delete [$graph marker names "scroll*"] 263 blt::RemoveBindTag $graph scroll-region-$graph263 rbc::RemoveBindTag $graph scroll-region-$graph 264 264 set zoomInfo($graph,corner) A 265 265 } 266 266 267 proc blt::ScrollTitle { graph } {267 proc rbc::ScrollTitle { graph } { 268 268 if { [$graph cget -invertxy] } { 269 269 set coords "-Inf -Inf"
Note: See TracChangeset
for help on using the changeset viewer.
