1 # vim: foldmarker=<<<,>>>
3 ::itk::usual tlc::myscrollbar_win32 {
4 keep -background -cursor -troughcolor
5 keep -activebackground -activerelief
6 keep -highlightcolor -highlightthickness
7 rename -highlightbackground -background background Background
10 proc tlc::myscrollbar_win32 {pathName args} {
11 uplevel tlc::Myscrollbar_win32 [list $pathName] $args
14 class tlc::Myscrollbar_win32 {
20 itk_option define -mode mode ShowMode "fancy" repack
21 itk_option define -orient orient Orient "vertical"
26 method activate {args} {uplevel $w.sb activate $args}
27 # method cget {args} {uplevel $w.sb cget $args}
28 # method configure {args} {uplevel $w.sb configure $args}
29 method delta {args} {uplevel $w.sb delta $args}
30 method fraction {args} {uplevel $w.sb fraction $args}
31 method get {args} {uplevel $w.sb get $args}
32 method identify {args} {uplevel $w.sb identify $args}
49 configbody tlc::Myscrollbar_win32::orient { #<<<1
50 $w.sb configure -orient $itk_option(-orient)
55 body tlc::Myscrollbar_win32::constructor {args} { #<<<1
57 ::set wdb [string range $w 1 end]
59 tlc::Signal #auto shown -name "$this shown"
61 if {$::tcl_platform(platform) == "windows"} {
65 if {[info commands ::ttk::scrollbar] != ""} {
66 ::set sbw "ttk::scrollbar"
69 ::set sbw "blt::tile::scrollbar"
76 itk_component add sb {
82 itk_component add sb {
84 -activebackground [$tlc::theme setting background] \
85 -activerelief raised \
86 -background [$tlc::theme setting background] \
89 -elementborderwidth -1 \
90 -highlightthickness 0 \
97 -troughcolor [$tlc::theme setting textbackground] \
100 keep -command -relief -borderwidth
104 itk_component add blank {
107 #rename -background -hidebg troughColor Background
109 itk_initialize {*}$args
111 $shown attach_output [code $this repack]
115 body tlc::Myscrollbar_win32::set {args} { #<<<1
116 if {[llength $args] == 2} {
117 foreach {first last} $args {break}
120 puts "$w set: first: ($first) last: ($last)"
122 $shown set_state [expr {!($first <= 0.0 && $last >= 1.0)}]
125 puts "$w odd number of args: ($args)"
129 uplevel $w.sb set $args
133 body tlc::Myscrollbar_win32::repack {args} { #<<<1
134 ::set newstate [$shown state]
137 puts "${w}::repack: table children before: ([blt::table search $w])"
139 catch {blt::table forget $w.sb}
140 catch {blt::table forget $w.blank}
142 puts "${w}::repack: table children after: ([blt::table search $w])"
146 puts "${w}::repack: shown: ($newstate) mode: ($itk_option(-mode))"
148 if {$newstate || $itk_option(-mode) == "static"} {
149 blt::table $w $w.sb 1,1 -fill both
150 switch [string index $itk_option(-orient) 0] {
152 blt::table configure $w c1 -width $w.sb
153 blt::table configure $w r1 -height {}
157 blt::table configure $w c1 -width {}
158 blt::table configure $w r1 -height $w.sb
162 switch $itk_option(-mode) {
164 blt::table $w $w.blank 1,1 -fill both
172 switch $itk_option(-mode) {
176 switch [string index $itk_option(-orient) 0] {
178 blt::table configure $w c1 -width $w.sb
179 blt::table configure $w r1 -height {}
183 blt::table configure $w c1 -width {}
184 blt::table configure $w r1 -height $w.sb
190 switch [string index $itk_option(-orient) 0] {
192 blt::table configure $w c1 -width {0 0 0}
193 blt::table configure $w r1 -height {0 0 0}
197 blt::table configure $w c1 -width {0 0 0}
198 blt::table configure $w r1 -height {0 0 0}
204 blt::table arrange $w
208 body tlc::Myscrollbar_win32::shown_ref {} { #<<<1