| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | |
| | |
| | |
| |
|
| | if {[tk windowingsystem] eq "aqua"} { |
| |
|
| | bind Radiobutton <Enter> { |
| | tk::ButtonEnter %W |
| | } |
| | bind Radiobutton <1> { |
| | tk::ButtonDown %W |
| | } |
| | bind Radiobutton <ButtonRelease-1> { |
| | tk::ButtonUp %W |
| | } |
| | bind Checkbutton <Enter> { |
| | tk::ButtonEnter %W |
| | } |
| | bind Checkbutton <1> { |
| | tk::ButtonDown %W |
| | } |
| | bind Checkbutton <ButtonRelease-1> { |
| | tk::ButtonUp %W |
| | } |
| | bind Checkbutton <Leave> { |
| | tk::ButtonLeave %W |
| | } |
| | } |
| | if {"win32" eq [tk windowingsystem]} { |
| | bind Checkbutton <equal> { |
| | tk::CheckRadioInvoke %W select |
| | } |
| | bind Checkbutton <plus> { |
| | tk::CheckRadioInvoke %W select |
| | } |
| | bind Checkbutton <minus> { |
| | tk::CheckRadioInvoke %W deselect |
| | } |
| | bind Checkbutton <1> { |
| | tk::CheckRadioDown %W |
| | } |
| | bind Checkbutton <ButtonRelease-1> { |
| | tk::ButtonUp %W |
| | } |
| | bind Checkbutton <Enter> { |
| | tk::CheckRadioEnter %W |
| | } |
| | bind Checkbutton <Leave> { |
| | tk::ButtonLeave %W |
| | } |
| |
|
| | bind Radiobutton <1> { |
| | tk::CheckRadioDown %W |
| | } |
| | bind Radiobutton <ButtonRelease-1> { |
| | tk::ButtonUp %W |
| | } |
| | bind Radiobutton <Enter> { |
| | tk::CheckRadioEnter %W |
| | } |
| | } |
| | if {"x11" eq [tk windowingsystem]} { |
| | bind Checkbutton <Return> { |
| | if {!$tk_strictMotif} { |
| | tk::CheckInvoke %W |
| | } |
| | } |
| | bind Radiobutton <Return> { |
| | if {!$tk_strictMotif} { |
| | tk::CheckRadioInvoke %W |
| | } |
| | } |
| | bind Checkbutton <1> { |
| | tk::CheckInvoke %W |
| | } |
| | bind Radiobutton <1> { |
| | tk::CheckRadioInvoke %W |
| | } |
| | bind Checkbutton <Enter> { |
| | tk::CheckEnter %W |
| | } |
| | bind Radiobutton <Enter> { |
| | tk::ButtonEnter %W |
| | } |
| | bind Checkbutton <Leave> { |
| | tk::CheckLeave %W |
| | } |
| | } |
| |
|
| | bind Button <space> { |
| | tk::ButtonInvoke %W |
| | } |
| | bind Checkbutton <space> { |
| | tk::CheckRadioInvoke %W |
| | } |
| | bind Radiobutton <space> { |
| | tk::CheckRadioInvoke %W |
| | } |
| | bind Button <<Invoke>> { |
| | tk::ButtonInvoke %W |
| | } |
| | bind Checkbutton <<Invoke>> { |
| | tk::CheckRadioInvoke %W |
| | } |
| | bind Radiobutton <<Invoke>> { |
| | tk::CheckRadioInvoke %W |
| | } |
| |
|
| | bind Button <FocusIn> {} |
| | bind Button <Enter> { |
| | tk::ButtonEnter %W |
| | } |
| | bind Button <Leave> { |
| | tk::ButtonLeave %W |
| | } |
| | bind Button <1> { |
| | tk::ButtonDown %W |
| | } |
| | bind Button <ButtonRelease-1> { |
| | tk::ButtonUp %W |
| | } |
| |
|
| | bind Checkbutton <FocusIn> {} |
| |
|
| | bind Radiobutton <FocusIn> {} |
| | bind Radiobutton <Leave> { |
| | tk::ButtonLeave %W |
| | } |
| |
|
| | if {"win32" eq [tk windowingsystem]} { |
| |
|
| | |
| | |
| | |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | proc ::tk::ButtonEnter w { |
| | variable ::tk::Priv |
| | if {[$w cget -state] ne "disabled"} { |
| |
|
| | |
| | |
| |
|
| | set Priv($w,relief) [$w cget -relief] |
| | if {$Priv(buttonWindow) eq $w} { |
| | $w configure -relief sunken -state active |
| | set Priv($w,prelief) sunken |
| | } elseif {[set over [$w cget -overrelief]] ne ""} { |
| | $w configure -relief $over |
| | set Priv($w,prelief) $over |
| | } |
| | } |
| | set Priv(window) $w |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | proc ::tk::ButtonLeave w { |
| | variable ::tk::Priv |
| | if {[$w cget -state] ne "disabled"} { |
| | $w configure -state normal |
| | } |
| |
|
| | |
| | |
| |
|
| | if {[info exists Priv($w,relief)]} { |
| | if {[info exists Priv($w,prelief)] && \ |
| | $Priv($w,prelief) eq [$w cget -relief]} { |
| | $w configure -relief $Priv($w,relief) |
| | } |
| | unset -nocomplain Priv($w,relief) Priv($w,prelief) |
| | } |
| |
|
| | set Priv(window) "" |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | proc ::tk::ButtonDown w { |
| | variable ::tk::Priv |
| |
|
| | |
| | |
| | |
| |
|
| | if {![info exists Priv($w,relief)]} { |
| | set Priv($w,relief) [$w cget -relief] |
| | } |
| |
|
| | if {[$w cget -state] ne "disabled"} { |
| | set Priv(buttonWindow) $w |
| | $w configure -relief sunken -state active |
| | set Priv($w,prelief) sunken |
| |
|
| | |
| | after cancel $Priv(afterId) |
| | set delay [$w cget -repeatdelay] |
| | set Priv(repeated) 0 |
| | if {$delay > 0} { |
| | set Priv(afterId) [after $delay [list tk::ButtonAutoInvoke $w]] |
| | } |
| | } |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | proc ::tk::ButtonUp w { |
| | variable ::tk::Priv |
| | if {$Priv(buttonWindow) eq $w} { |
| | set Priv(buttonWindow) "" |
| |
|
| | |
| |
|
| | if {[info exists Priv($w,relief)]} { |
| | if {[info exists Priv($w,prelief)] && \ |
| | $Priv($w,prelief) eq [$w cget -relief]} { |
| | $w configure -relief $Priv($w,relief) |
| | } |
| | unset -nocomplain Priv($w,relief) Priv($w,prelief) |
| | } |
| |
|
| | |
| | after cancel $Priv(afterId) |
| |
|
| | if {$Priv(window) eq $w && [$w cget -state] ne "disabled"} { |
| | $w configure -state normal |
| |
|
| | |
| | |
| | if { $Priv(repeated) == 0 } { |
| | uplevel #0 [list $w invoke] |
| | } |
| | } |
| | } |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | proc ::tk::CheckRadioEnter w { |
| | variable ::tk::Priv |
| | if {[$w cget -state] ne "disabled"} { |
| | if {$Priv(buttonWindow) eq $w} { |
| | $w configure -state active |
| | } |
| | if {[set over [$w cget -overrelief]] ne ""} { |
| | set Priv($w,relief) [$w cget -relief] |
| | set Priv($w,prelief) $over |
| | $w configure -relief $over |
| | } |
| | } |
| | set Priv(window) $w |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | proc ::tk::CheckRadioDown w { |
| | variable ::tk::Priv |
| | if {![info exists Priv($w,relief)]} { |
| | set Priv($w,relief) [$w cget -relief] |
| | } |
| | if {[$w cget -state] ne "disabled"} { |
| | set Priv(buttonWindow) $w |
| | set Priv(repeated) 0 |
| | $w configure -state active |
| | } |
| | } |
| |
|
| | } |
| |
|
| | if {"x11" eq [tk windowingsystem]} { |
| |
|
| | |
| | |
| | |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | proc ::tk::ButtonEnter {w} { |
| | variable ::tk::Priv |
| | if {[$w cget -state] ne "disabled"} { |
| | |
| | $w configure -state active |
| |
|
| | |
| | |
| |
|
| | set Priv($w,relief) [$w cget -relief] |
| | if {$Priv(buttonWindow) eq $w} { |
| | $w configure -relief sunken |
| | set Priv($w,prelief) sunken |
| | } elseif {[set over [$w cget -overrelief]] ne ""} { |
| | $w configure -relief $over |
| | set Priv($w,prelief) $over |
| | } |
| | } |
| | set Priv(window) $w |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | proc ::tk::ButtonLeave w { |
| | variable ::tk::Priv |
| | if {[$w cget -state] ne "disabled"} { |
| | $w configure -state normal |
| | } |
| |
|
| | |
| | |
| |
|
| | if {[info exists Priv($w,relief)]} { |
| | if {[info exists Priv($w,prelief)] && \ |
| | $Priv($w,prelief) eq [$w cget -relief]} { |
| | $w configure -relief $Priv($w,relief) |
| | } |
| | unset -nocomplain Priv($w,relief) Priv($w,prelief) |
| | } |
| |
|
| | set Priv(window) "" |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | proc ::tk::ButtonDown w { |
| | variable ::tk::Priv |
| |
|
| | |
| | |
| | |
| |
|
| | if {![info exists Priv($w,relief)]} { |
| | set Priv($w,relief) [$w cget -relief] |
| | } |
| |
|
| | if {[$w cget -state] ne "disabled"} { |
| | set Priv(buttonWindow) $w |
| | $w configure -relief sunken |
| | set Priv($w,prelief) sunken |
| |
|
| | |
| | after cancel $Priv(afterId) |
| | set delay [$w cget -repeatdelay] |
| | set Priv(repeated) 0 |
| | if {$delay > 0} { |
| | set Priv(afterId) [after $delay [list tk::ButtonAutoInvoke $w]] |
| | } |
| | } |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | proc ::tk::ButtonUp w { |
| | variable ::tk::Priv |
| | if {$w eq $Priv(buttonWindow)} { |
| | set Priv(buttonWindow) "" |
| |
|
| | |
| |
|
| | if {[info exists Priv($w,relief)]} { |
| | if {[info exists Priv($w,prelief)] && \ |
| | $Priv($w,prelief) eq [$w cget -relief]} { |
| | $w configure -relief $Priv($w,relief) |
| | } |
| | unset -nocomplain Priv($w,relief) Priv($w,prelief) |
| | } |
| |
|
| | |
| | after cancel $Priv(afterId) |
| |
|
| | if {$Priv(window) eq $w && [$w cget -state] ne "disabled"} { |
| | |
| | |
| | if { $Priv(repeated) == 0 } { |
| | uplevel #0 [list $w invoke] |
| | } |
| | } |
| | } |
| | } |
| |
|
| | } |
| |
|
| | if {[tk windowingsystem] eq "aqua"} { |
| |
|
| | |
| | |
| | |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | proc ::tk::ButtonEnter {w} { |
| | variable ::tk::Priv |
| | if {[$w cget -state] ne "disabled"} { |
| |
|
| | |
| |
|
| | if {$Priv(buttonWindow) eq $w} { |
| | $w configure -state active |
| | } elseif {[set over [$w cget -overrelief]] ne ""} { |
| | set Priv($w,relief) [$w cget -relief] |
| | set Priv($w,prelief) $over |
| | $w configure -relief $over |
| | } |
| | } |
| | set Priv(window) $w |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | proc ::tk::ButtonLeave w { |
| | variable ::tk::Priv |
| | if {$w eq $Priv(buttonWindow)} { |
| | $w configure -state normal |
| | } |
| |
|
| | |
| | |
| |
|
| | if {[info exists Priv($w,relief)]} { |
| | if {[info exists Priv($w,prelief)] && \ |
| | $Priv($w,prelief) eq [$w cget -relief]} { |
| | $w configure -relief $Priv($w,relief) |
| | } |
| | unset -nocomplain Priv($w,relief) Priv($w,prelief) |
| | } |
| |
|
| | set Priv(window) "" |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | proc ::tk::ButtonDown w { |
| | variable ::tk::Priv |
| |
|
| | if {[$w cget -state] ne "disabled"} { |
| | set Priv(buttonWindow) $w |
| | $w configure -state active |
| |
|
| | |
| | after cancel $Priv(afterId) |
| | set Priv(repeated) 0 |
| | if { ![catch {$w cget -repeatdelay} delay] } { |
| | if {$delay > 0} { |
| | set Priv(afterId) [after $delay [list tk::ButtonAutoInvoke $w]] |
| | } |
| | } |
| | } |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | proc ::tk::ButtonUp w { |
| | variable ::tk::Priv |
| | if {$Priv(buttonWindow) eq $w} { |
| | set Priv(buttonWindow) "" |
| | $w configure -state normal |
| |
|
| | |
| |
|
| | if {[info exists Priv($w,relief)]} { |
| | if {[info exists Priv($w,prelief)] && \ |
| | $Priv($w,prelief) eq [$w cget -relief]} { |
| | $w configure -relief $Priv($w,relief) |
| | } |
| | unset -nocomplain Priv($w,relief) Priv($w,prelief) |
| | } |
| |
|
| | |
| | after cancel $Priv(afterId) |
| |
|
| | if {$Priv(window) eq $w && [$w cget -state] ne "disabled"} { |
| | |
| | |
| | if { $Priv(repeated) == 0 } { |
| | uplevel #0 [list $w invoke] |
| | } |
| | } |
| | } |
| | } |
| |
|
| | } |
| |
|
| | |
| | |
| | |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | proc ::tk::ButtonInvoke w { |
| | if {[winfo exists $w] && [$w cget -state] ne "disabled"} { |
| | set oldRelief [$w cget -relief] |
| | set oldState [$w cget -state] |
| | $w configure -state active -relief sunken |
| | after 100 [list ::tk::ButtonInvokeEnd $w $oldState $oldRelief] |
| | } |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | proc ::tk::ButtonInvokeEnd {w oldState oldRelief} { |
| | if {[winfo exists $w]} { |
| | $w configure -state $oldState -relief $oldRelief |
| | uplevel #0 [list $w invoke] |
| | } |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | proc ::tk::ButtonAutoInvoke {w} { |
| | variable ::tk::Priv |
| | after cancel $Priv(afterId) |
| | set delay [$w cget -repeatinterval] |
| | if {$Priv(window) eq $w} { |
| | incr Priv(repeated) |
| | uplevel #0 [list $w invoke] |
| | } |
| | if {$delay > 0} { |
| | set Priv(afterId) [after $delay [list tk::ButtonAutoInvoke $w]] |
| | } |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | proc ::tk::CheckRadioInvoke {w {cmd invoke}} { |
| | if {[$w cget -state] ne "disabled"} { |
| | uplevel #0 [list $w $cmd] |
| | } |
| | } |
| |
|
| | |
| | |
| | |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | proc ::tk::CheckInvoke {w} { |
| | variable ::tk::Priv |
| | if {[$w cget -state] ne "disabled"} { |
| | |
| | |
| |
|
| | if {![$w cget -indicatoron] && [info exist Priv($w,selectcolor)]} { |
| | if {[$w cget -selectcolor] eq $Priv($w,aselectcolor)} { |
| | $w configure -selectcolor $Priv($w,selectcolor) |
| | } else { |
| | $w configure -selectcolor $Priv($w,aselectcolor) |
| | } |
| | } |
| | uplevel #0 [list $w invoke] |
| | } |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | proc ::tk::CheckEnter {w} { |
| | variable ::tk::Priv |
| | if {[$w cget -state] ne "disabled"} { |
| | |
| | $w configure -state active |
| |
|
| | |
| | |
| |
|
| | set Priv($w,relief) [$w cget -relief] |
| | if {$Priv(buttonWindow) eq $w} { |
| | $w configure -relief sunken |
| | set Priv($w,prelief) sunken |
| | } elseif {[set over [$w cget -overrelief]] ne ""} { |
| | $w configure -relief $over |
| | set Priv($w,prelief) $over |
| | } |
| |
|
| | |
| |
|
| | if {![$w cget -indicatoron] && [$w cget -selectcolor] ne ""} { |
| | set Priv($w,selectcolor) [$w cget -selectcolor] |
| | lassign [winfo rgb $w [$w cget -selectcolor]] r1 g1 b1 |
| | lassign [winfo rgb $w [$w cget -activebackground]] r2 g2 b2 |
| | set Priv($w,aselectcolor) \ |
| | [format "#%04x%04x%04x" [expr {($r1+$r2)/2}] \ |
| | [expr {($g1+$g2)/2}] [expr {($b1+$b2)/2}]] |
| | |
| | if {[uplevel #0 [list set [$w cget -variable]]] |
| | eq [$w cget -onvalue]} { |
| | $w configure -selectcolor $Priv($w,aselectcolor) |
| | } |
| | } |
| | } |
| | set Priv(window) $w |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | proc ::tk::CheckLeave {w} { |
| | variable ::tk::Priv |
| | if {[$w cget -state] ne "disabled"} { |
| | $w configure -state normal |
| | } |
| |
|
| | |
| | |
| |
|
| | if {![$w cget -indicatoron] && [info exist Priv($w,selectcolor)]} { |
| | if {[$w cget -selectcolor] eq $Priv($w,selectcolor) |
| | || ([info exist Priv($w,aselectcolor)] && |
| | [$w cget -selectcolor] eq $Priv($w,aselectcolor))} { |
| | $w configure -selectcolor $Priv($w,selectcolor) |
| | } |
| | } |
| | unset -nocomplain Priv($w,selectcolor) Priv($w,aselectcolor) |
| |
|
| | |
| | |
| |
|
| | if {[info exists Priv($w,relief)]} { |
| | if {[info exists Priv($w,prelief)] && \ |
| | $Priv($w,prelief) eq [$w cget -relief]} { |
| | $w configure -relief $Priv($w,relief) |
| | } |
| | unset -nocomplain Priv($w,relief) Priv($w,prelief) |
| | } |
| |
|
| | set Priv(window) "" |
| | } |
| |
|
| | return |
| | |
| | |
| | |
| | |
| | |
| |
|