summaryrefslogtreecommitdiffstats
path: root/library/ttk/combobox.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'library/ttk/combobox.tcl')
-rw-r--r--library/ttk/combobox.tcl25
1 files changed, 18 insertions, 7 deletions
diff --git a/library/ttk/combobox.tcl b/library/ttk/combobox.tcl
index 5094300..581c227 100644
--- a/library/ttk/combobox.tcl
+++ b/library/ttk/combobox.tcl
@@ -1,5 +1,5 @@
#
-# $Id: combobox.tcl,v 1.15 2008/11/22 22:07:34 patthoyts Exp $
+# $Id: combobox.tcl,v 1.16 2008/11/29 00:43:48 patthoyts Exp $
#
# Combobox bindings.
#
@@ -61,6 +61,8 @@ bind TCombobox <Double-ButtonPress-1> { ttk::combobox::Press "2" %W %x %y }
bind TCombobox <Triple-ButtonPress-1> { ttk::combobox::Press "3" %W %x %y }
bind TCombobox <B1-Motion> { ttk::combobox::Drag %W %x }
bind TCombobox <Motion> { ttk::combobox::Motion %W %x %y }
+bind TCombobox <Enter> {%W instate !disabled {%W state active}}
+bind TCombobox <Leave> {%W state !active}
bind TCombobox <MouseWheel> { ttk::combobox::Scroll %W [expr {%D/-120}] }
if {[tk windowingsystem] eq "x11"} {
@@ -279,7 +281,9 @@ proc ttk::combobox::PopdownWindow {cb} {
variable scrollbar
if {![winfo exists $cb.popdown]} {
- set popdown [PopdownToplevel $cb.popdown]
+ set poplevel [PopdownToplevel $cb.popdown]
+
+ set popdown [ttk::frame $poplevel.f -style ComboboxPopdownFrame]
$scrollbar $popdown.sb \
-orient vertical -command [list $popdown.l yview]
@@ -294,9 +298,14 @@ proc ttk::combobox::PopdownWindow {cb} {
bindtags $popdown.l \
[list $popdown.l ComboboxListbox Listbox $popdown all]
- grid $popdown.l $popdown.sb -sticky news
+ grid $popdown.l -row 0 -column 0 -padx {1 0} -pady 1 -sticky nsew
+ grid $popdown.sb -row 0 -column 1 -padx {0 1} -pady 1 -sticky ns
grid columnconfigure $popdown 0 -weight 1
grid rowconfigure $popdown 0 -weight 1
+
+ grid $popdown -sticky news -padx 0 -pady 0
+ grid rowconfigure $poplevel 0 -weight 1
+ grid columnconfigure $poplevel 0 -weight 1
}
return $cb.popdown
}
@@ -311,11 +320,11 @@ proc ttk::combobox::PopdownToplevel {w} {
switch -- [tk windowingsystem] {
default -
x11 {
- $w configure -relief solid -borderwidth 1
+ $w configure -relief flat -borderwidth 0
wm overrideredirect $w true
}
win32 {
- $w configure -relief solid -borderwidth 1
+ $w configure -relief flat -borderwidth 0
wm overrideredirect $w true
}
aqua {
@@ -335,7 +344,7 @@ proc ttk::combobox::PopdownToplevel {w} {
proc ttk::combobox::ConfigureListbox {cb} {
variable Values
- set popdown [PopdownWindow $cb]
+ set popdown [PopdownWindow $cb].f
set values [$cb cget -values]
set current [$cb current]
if {$current < 0} {
@@ -350,8 +359,10 @@ proc ttk::combobox::ConfigureListbox {cb} {
if {$height > [$cb cget -height]} {
set height [$cb cget -height]
grid $popdown.sb
+ grid configure $popdown.l -padx {1 0}
} else {
grid remove $popdown.sb
+ grid configure $popdown.l -padx 1
}
$popdown.l configure -height $height
}
@@ -424,7 +435,7 @@ proc ttk::combobox::Unpost {cb} {
# Return the combobox main widget that owns the listbox.
#
proc ttk::combobox::LBMaster {lb} {
- winfo parent [winfo parent $lb]
+ winfo parent [winfo parent [winfo parent $lb]]
}
## LBSelect $lb --