• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/tcl-105/tcl_ext/tklib/tklib/modules/tkpiechart/

Lines Matching refs:slice

76 # size is first converted to pixels, then 1 pixel is subtracted since slice size
111 set slice [::stooop::new slice\
117 $canvas addtag pie($this) withtag slice($slice)
118 $canvas addtag pieSlices($this) withtag slice($slice)
119 set ($this,backgroundSlice) $slice
138 # calculate start radian for new slice
141 foreach slice $($this,slices) {
142 set start [expr {$start - $slice::($slice,extent)}]
151 # darken slice top color by 40% to obtain bottom color, as it is done for
153 set slice [::stooop::new slice\
159 # place slice at other slices position in case pie was moved
160 eval $canvas move slice($slice) [$canvas coords pieSlices($this)]
161 $canvas addtag pie($this) withtag slice($slice)
162 $canvas addtag pieSlices($this) withtag slice($slice)
163 lappend ($this,slices) $slice
165 set text "slice [llength $($this,slices)]"
168 set label [pieLabeler::new $labeler $slice -text $text -background $color]
169 set ($this,sliceLabel,$slice) $label
184 $canvas bind slice($slice) <ButtonPress-1>\
188 $canvas bind slice($slice) <Control-ButtonPress-1>\
192 $canvas bind slice($slice) <Shift-ButtonPress-1>\
196 $canvas bind slice($slice) <ButtonRelease-1>\
200 $canvas bind slice($slice) <Control-ButtonRelease-1>\
204 $canvas bind slice($slice) <Shift-ButtonRelease-1>\
207 return $slice
210 proc pie::deleteSlice {this slice} {
211 set index [lsearch -exact $($this,slices) $slice]
213 error "invalid slice $slice for pie $this"
216 set extent $slice::($slice,extent)
217 ::stooop::delete $slice
220 slice::rotate $following $extent
224 pieLabeler::delete $($this,labeler) $($this,sliceLabel,$slice)
226 selector::remove $($this,selector) $($this,sliceLabel,$slice)
228 unset ($this,sliceLabel,$slice)
232 proc pie::sizeSlice {this slice unitShare {valueToDisplay {}}} {
233 set index [lsearch -exact $($this,slices) $slice]
235 error "invalid slice $slice for pie $this"
239 set growth [expr {$newExtent - $slice::($slice,extent)}]
240 switched::configure $slice -startandextent\
241 "[expr {$slice::($slice,start) - $growth}] $newExtent" ;# grow clockwise
243 # update label after slice for it may need slice latest configuration
244 pieLabeler::set $($this,labeler) $($this,sliceLabel,$slice)\
247 pieLabeler::set $($this,labeler) $($this,sliceLabel,$slice) $unitShare
250 foreach slice [lrange $($this,slices) [incr index] end] {
251 slice::rotate $slice $value
260 proc pie::labelSlice {this slice text} {
261 pieLabeler::label $($this,labeler) $($this,sliceLabel,$slice) $text
265 proc pie::sliceLabelTag {this slice} {
266 return canvasLabel($($this,sliceLabel,$slice))
269 proc pie::setSliceBackground {this slice color} {
270 switched::configure $slice -topcolor $color -bottomcolor [darken $color 60]
271 pieLabeler::labelBackground $($this,labeler) $($this,sliceLabel,$slice)\
275 proc pie::setSliceLabelBackground {this slice color} {
276 pieLabeler::labelTextBackground $($this,labeler) $($this,sliceLabel,$slice)\
282 foreach slice $($this,slices) {
284 $($this,sliceLabel,$slice)\
286 lappend list $slice
300 # return current slice (slice or its label under the mouse cursor) if any
303 ([scan $tags slice(%u) slice] > 0) &&\
304 ($slice != $($this,backgroundSlice))\
305 } { ;# ignore background slice
306 return $slice ;# found current slice
309 foreach slice $($this,slices) {
310 if {$($this,sliceLabel,$slice) == $label} {
311 return $slice ;# slice is current through its label
315 return 0 ;# no current slice
345 # update scale of background slice
347 foreach slice $($this,slices) {
348 switched::configure $slice -scale $scale ;# and other slices