Changeset 3642 for trunk/gui/scripts/gauge.tcl
- Timestamp:
- May 9, 2013, 11:29:37 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/gauge.tcl
r3510 r3642 20 20 option add *Gauge.sampleWidth 30 widgetDefault 21 21 option add *Gauge.sampleHeight 20 widgetDefault 22 option add *Gauge.borderWidth 2 widgetDefault 23 option add *Gauge.relief sunken widgetDefault 22 24 option add *Gauge.valuePosition "right" widgetDefault 23 25 option add *Gauge.textBackground #cccccc widgetDefault … … 57 59 private variable _value 0 ;# value for this widget 58 60 59 blt::bitmap define GaugeArrow-up {60 #define up_width 861 #define up_height 462 static unsigned char up_bits[] = {63 0x10, 0x38, 0x7c, 0xfe};64 }65 blt::bitmap define GaugeArrow-down {66 #define arrow_width 867 #define arrow_height 468 static unsigned char arrow_bits[] = {69 0xfe, 0x7c, 0x38, 0x10};70 }71 72 61 blt::bitmap define GaugeArrow { 73 62 #define arrow_width 9 … … 87 76 # ---------------------------------------------------------------------- 88 77 itcl::body Rappture::Gauge::constructor {args} { 78 itk_option remove hull.borderwidth hull.relief 79 component hull configure -borderwidth 0 80 89 81 itk_component add icon { 90 82 canvas $itk_interior.icon -width 1 -height 1 \ … … 93 85 usual 94 86 ignore -highlightthickness -highlightbackground -highlightcolor 95 }96 pack $itk_component(icon) -side left87 ignore -borderwidth -relief 88 } 97 89 bind $itk_component(icon) <Configure> [itcl::code $this _redraw] 98 90 99 91 itk_component add -protected vframe { 100 92 frame $itk_interior.vframe 93 } { 94 keep -borderwidth -relief 101 95 } 102 96 103 97 itk_component add value { 104 label $itk_component(vframe).value - borderwidth 1 -width 7 \105 - textvariable [itcl::scope _value]98 label $itk_component(vframe).value -width 7 \ 99 -borderwidth 1 -relief flat -textvariable [itcl::scope _value] 106 100 } { 107 101 rename -background -textbackground textBackground Background … … 146 140 147 141 itk_component add spinup { 148 button $itk_component(spinner).up - bitmap GaugeArrow-up\142 button $itk_component(spinner).up -image [Rappture::icon intplus] \ 149 143 -borderwidth 1 -relief raised -highlightthickness 0 \ 150 144 -command [itcl::code $this bump 1] … … 152 146 usual 153 147 ignore -borderwidth -highlightthickness 154 } 155 pack $itk_component(spinup) -side top -expand yes -fill both 148 rename -background -buttonbackground buttonBackground Background 149 } 150 pack $itk_component(spinup) -side left -expand yes -fill both 156 151 157 152 itk_component add spindn { 158 button $itk_component(spinner).down - bitmap GaugeArrow-down\153 button $itk_component(spinner).down -image [Rappture::icon intminus] \ 159 154 -borderwidth 1 -relief raised -highlightthickness 0 \ 160 155 -command [itcl::code $this bump -1] … … 162 157 usual 163 158 ignore -borderwidth -highlightthickness 164 } 165 pack $itk_component(spindn) -side bottom -expand yes -fill both 159 rename -background -buttonbackground buttonBackground Background 160 } 161 pack $itk_component(spindn) -side right -expand yes -fill both 166 162 167 163 168 164 itk_component add presets { 169 165 button $itk_component(vframe).psbtn -bitmap GaugeArrow \ 170 -borderwidth 1 -highlightthickness 0 -relief flat166 -borderwidth 1 -highlightthickness 0 -relief raised 171 167 } { 172 168 usual 173 169 ignore -borderwidth -relief -highlightthickness 174 rename -background -textbackground textBackground Background175 170 } 176 171 … … 470 465 $itk_component($comp) configure -relief solid 471 466 } else { 472 $itk_component($comp) configure -relief flat 467 if {$comp eq "presets"} { 468 $itk_component($comp) configure -relief raised 469 } else { 470 $itk_component($comp) configure -relief flat 471 } 473 472 } 474 473 } … … 560 559 } 561 560 unpost { 562 $itk_component(presets) configure -relief flat561 $itk_component(presets) configure -relief raised 563 562 } 564 563 select { … … 600 599 601 600 if {"" != $itk_option(-image) || "" != $itk_option(-spectrum)} { 602 pack $itk_component(icon) -side $pos 601 pack $itk_component(icon) -side $pos -padx 2 603 602 } 604 603 }
Note: See TracChangeset
for help on using the changeset viewer.