Pratt 1.5.6
Sign up to get free protection for your applications and to get access to all the features.
- data/.exrc +61 -0
- data/.gitignore +4 -0
- data/History.txt +6 -0
- data/Manifest.txt +46 -0
- data/Pratt.gemspec +351 -0
- data/README.txt +66 -0
- data/Rakefile +85 -0
- data/TODO +54 -0
- data/VERSION +1 -0
- data/bin/pratt.rb +13 -0
- data/config.rb +34 -0
- data/lib/pratt.rb +527 -0
- data/lib/pratt/array.rb +11 -0
- data/lib/pratt/string.rb +18 -0
- data/models/app.rb +40 -0
- data/models/customer.rb +24 -0
- data/models/payment.rb +22 -0
- data/models/pratt.rb +19 -0
- data/models/project.rb +82 -0
- data/models/whence.rb +70 -0
- data/pkgs/tile-0.8.2.tar.gz +0 -0
- data/pkgs/tile-0.8.2/ANNOUNCE.txt +95 -0
- data/pkgs/tile-0.8.2/ChangeLog +4651 -0
- data/pkgs/tile-0.8.2/Makefile +250 -0
- data/pkgs/tile-0.8.2/Makefile.in +250 -0
- data/pkgs/tile-0.8.2/README.txt +86 -0
- data/pkgs/tile-0.8.2/aclocal.m4 +2 -0
- data/pkgs/tile-0.8.2/altTheme.o +0 -0
- data/pkgs/tile-0.8.2/blink.o +0 -0
- data/pkgs/tile-0.8.2/button.o +0 -0
- data/pkgs/tile-0.8.2/cache.o +0 -0
- data/pkgs/tile-0.8.2/clamTheme.o +0 -0
- data/pkgs/tile-0.8.2/classicTheme.o +0 -0
- data/pkgs/tile-0.8.2/config.log +1330 -0
- data/pkgs/tile-0.8.2/config.status +795 -0
- data/pkgs/tile-0.8.2/configure +15248 -0
- data/pkgs/tile-0.8.2/configure.in +89 -0
- data/pkgs/tile-0.8.2/demos/autocomplete.tcl +59 -0
- data/pkgs/tile-0.8.2/demos/demo.tcl +870 -0
- data/pkgs/tile-0.8.2/demos/dirbrowser.tcl +167 -0
- data/pkgs/tile-0.8.2/demos/dlgtest.tcl +97 -0
- data/pkgs/tile-0.8.2/demos/iconlib.tcl +110 -0
- data/pkgs/tile-0.8.2/demos/repeater.tcl +117 -0
- data/pkgs/tile-0.8.2/demos/toolbutton.tcl +101 -0
- data/pkgs/tile-0.8.2/doc/Geometry.3 +230 -0
- data/pkgs/tile-0.8.2/doc/INDEX.MAP +153 -0
- data/pkgs/tile-0.8.2/doc/Makefile +36 -0
- data/pkgs/tile-0.8.2/doc/TILE.XML +45 -0
- data/pkgs/tile-0.8.2/doc/Theme.3 +34 -0
- data/pkgs/tile-0.8.2/doc/button.n +75 -0
- data/pkgs/tile-0.8.2/doc/checkbutton.n +61 -0
- data/pkgs/tile-0.8.2/doc/combobox.n +98 -0
- data/pkgs/tile-0.8.2/doc/converting.txt +97 -0
- data/pkgs/tile-0.8.2/doc/dialog.n +122 -0
- data/pkgs/tile-0.8.2/doc/entry.n +438 -0
- data/pkgs/tile-0.8.2/doc/frame.n +43 -0
- data/pkgs/tile-0.8.2/doc/html/Geometry.html +304 -0
- data/pkgs/tile-0.8.2/doc/html/Theme.html +48 -0
- data/pkgs/tile-0.8.2/doc/html/button.html +120 -0
- data/pkgs/tile-0.8.2/doc/html/category-index.html +18 -0
- data/pkgs/tile-0.8.2/doc/html/checkbutton.html +94 -0
- data/pkgs/tile-0.8.2/doc/html/combobox.html +164 -0
- data/pkgs/tile-0.8.2/doc/html/converting.txt +97 -0
- data/pkgs/tile-0.8.2/doc/html/dialog.html +159 -0
- data/pkgs/tile-0.8.2/doc/html/entry.html +613 -0
- data/pkgs/tile-0.8.2/doc/html/frame.html +76 -0
- data/pkgs/tile-0.8.2/doc/html/image.html +100 -0
- data/pkgs/tile-0.8.2/doc/html/index.html +25 -0
- data/pkgs/tile-0.8.2/doc/html/keyword-index.html +228 -0
- data/pkgs/tile-0.8.2/doc/html/label.html +133 -0
- data/pkgs/tile-0.8.2/doc/html/labelframe.html +91 -0
- data/pkgs/tile-0.8.2/doc/html/manpage.css +212 -0
- data/pkgs/tile-0.8.2/doc/html/menubutton.html +63 -0
- data/pkgs/tile-0.8.2/doc/html/notebook.html +280 -0
- data/pkgs/tile-0.8.2/doc/html/paned.html +149 -0
- data/pkgs/tile-0.8.2/doc/html/progressbar.html +138 -0
- data/pkgs/tile-0.8.2/doc/html/radiobutton.html +89 -0
- data/pkgs/tile-0.8.2/doc/html/scrollbar.html +221 -0
- data/pkgs/tile-0.8.2/doc/html/separator.html +48 -0
- data/pkgs/tile-0.8.2/doc/html/sizegrip.html +62 -0
- data/pkgs/tile-0.8.2/doc/html/style.html +172 -0
- data/pkgs/tile-0.8.2/doc/html/tile-intro.html +164 -0
- data/pkgs/tile-0.8.2/doc/html/treeview.html +634 -0
- data/pkgs/tile-0.8.2/doc/html/widget.html +342 -0
- data/pkgs/tile-0.8.2/doc/image.n +81 -0
- data/pkgs/tile-0.8.2/doc/internals.txt +409 -0
- data/pkgs/tile-0.8.2/doc/label.n +75 -0
- data/pkgs/tile-0.8.2/doc/labelframe.n +64 -0
- data/pkgs/tile-0.8.2/doc/man.macros +239 -0
- data/pkgs/tile-0.8.2/doc/menubutton.n +41 -0
- data/pkgs/tile-0.8.2/doc/notebook.n +188 -0
- data/pkgs/tile-0.8.2/doc/paned.n +95 -0
- data/pkgs/tile-0.8.2/doc/progressbar.n +79 -0
- data/pkgs/tile-0.8.2/doc/radiobutton.n +57 -0
- data/pkgs/tile-0.8.2/doc/scrollbar.n +160 -0
- data/pkgs/tile-0.8.2/doc/separator.n +30 -0
- data/pkgs/tile-0.8.2/doc/sizegrip.n +53 -0
- data/pkgs/tile-0.8.2/doc/style.n +119 -0
- data/pkgs/tile-0.8.2/doc/tile-intro.n +165 -0
- data/pkgs/tile-0.8.2/doc/tmml.options +4 -0
- data/pkgs/tile-0.8.2/doc/treeview.n +415 -0
- data/pkgs/tile-0.8.2/doc/widget.n +227 -0
- data/pkgs/tile-0.8.2/doc/xml/Geometry.tmml +379 -0
- data/pkgs/tile-0.8.2/doc/xml/INDEX.MAP +153 -0
- data/pkgs/tile-0.8.2/doc/xml/Theme.tmml +63 -0
- data/pkgs/tile-0.8.2/doc/xml/button.tmml +134 -0
- data/pkgs/tile-0.8.2/doc/xml/checkbutton.tmml +119 -0
- data/pkgs/tile-0.8.2/doc/xml/combobox.tmml +184 -0
- data/pkgs/tile-0.8.2/doc/xml/dialog.tmml +195 -0
- data/pkgs/tile-0.8.2/doc/xml/entry.tmml +630 -0
- data/pkgs/tile-0.8.2/doc/xml/frame.tmml +98 -0
- data/pkgs/tile-0.8.2/doc/xml/image.tmml +101 -0
- data/pkgs/tile-0.8.2/doc/xml/label.tmml +154 -0
- data/pkgs/tile-0.8.2/doc/xml/labelframe.tmml +116 -0
- data/pkgs/tile-0.8.2/doc/xml/menubutton.tmml +80 -0
- data/pkgs/tile-0.8.2/doc/xml/notebook.tmml +306 -0
- data/pkgs/tile-0.8.2/doc/xml/paned.tmml +154 -0
- data/pkgs/tile-0.8.2/doc/xml/progressbar.tmml +151 -0
- data/pkgs/tile-0.8.2/doc/xml/radiobutton.tmml +109 -0
- data/pkgs/tile-0.8.2/doc/xml/scrollbar.tmml +233 -0
- data/pkgs/tile-0.8.2/doc/xml/separator.tmml +59 -0
- data/pkgs/tile-0.8.2/doc/xml/sizegrip.tmml +82 -0
- data/pkgs/tile-0.8.2/doc/xml/style.tmml +171 -0
- data/pkgs/tile-0.8.2/doc/xml/tile-intro.tmml +192 -0
- data/pkgs/tile-0.8.2/doc/xml/treeview.tmml +604 -0
- data/pkgs/tile-0.8.2/doc/xml/widget.tmml +372 -0
- data/pkgs/tile-0.8.2/entry.o +0 -0
- data/pkgs/tile-0.8.2/frame.o +0 -0
- data/pkgs/tile-0.8.2/generic/Makefile.in +221 -0
- data/pkgs/tile-0.8.2/generic/TODO +493 -0
- data/pkgs/tile-0.8.2/generic/altTheme.c +1172 -0
- data/pkgs/tile-0.8.2/generic/blink.c +168 -0
- data/pkgs/tile-0.8.2/generic/button.c +858 -0
- data/pkgs/tile-0.8.2/generic/cache.c +354 -0
- data/pkgs/tile-0.8.2/generic/clamTheme.c +974 -0
- data/pkgs/tile-0.8.2/generic/classicTheme.c +518 -0
- data/pkgs/tile-0.8.2/generic/configure +10334 -0
- data/pkgs/tile-0.8.2/generic/configure.in +100 -0
- data/pkgs/tile-0.8.2/generic/entry.c +1922 -0
- data/pkgs/tile-0.8.2/generic/frame.c +648 -0
- data/pkgs/tile-0.8.2/generic/gunk.h +44 -0
- data/pkgs/tile-0.8.2/generic/image.c +416 -0
- data/pkgs/tile-0.8.2/generic/label.c +663 -0
- data/pkgs/tile-0.8.2/generic/layout.c +1215 -0
- data/pkgs/tile-0.8.2/generic/manager.c +554 -0
- data/pkgs/tile-0.8.2/generic/manager.h +91 -0
- data/pkgs/tile-0.8.2/generic/notebook.c +1380 -0
- data/pkgs/tile-0.8.2/generic/paned.c +958 -0
- data/pkgs/tile-0.8.2/generic/pkgIndex.tcl.in +7 -0
- data/pkgs/tile-0.8.2/generic/progress.c +549 -0
- data/pkgs/tile-0.8.2/generic/scale.c +526 -0
- data/pkgs/tile-0.8.2/generic/scroll.c +253 -0
- data/pkgs/tile-0.8.2/generic/scrollbar.c +346 -0
- data/pkgs/tile-0.8.2/generic/separator.c +132 -0
- data/pkgs/tile-0.8.2/generic/square.c +306 -0
- data/pkgs/tile-0.8.2/generic/tagset.c +147 -0
- data/pkgs/tile-0.8.2/generic/tile.c +296 -0
- data/pkgs/tile-0.8.2/generic/tkElements.c +1280 -0
- data/pkgs/tile-0.8.2/generic/tkTheme.c +1708 -0
- data/pkgs/tile-0.8.2/generic/tkTheme.h +419 -0
- data/pkgs/tile-0.8.2/generic/tkThemeInt.h +45 -0
- data/pkgs/tile-0.8.2/generic/tkstate.c +268 -0
- data/pkgs/tile-0.8.2/generic/trace.c +145 -0
- data/pkgs/tile-0.8.2/generic/track.c +174 -0
- data/pkgs/tile-0.8.2/generic/treeview.c +3211 -0
- data/pkgs/tile-0.8.2/generic/ttk.decls +154 -0
- data/pkgs/tile-0.8.2/generic/ttkDecls.h +340 -0
- data/pkgs/tile-0.8.2/generic/ttkStubInit.c +61 -0
- data/pkgs/tile-0.8.2/generic/ttkStubLib.c +70 -0
- data/pkgs/tile-0.8.2/generic/widget.c +785 -0
- data/pkgs/tile-0.8.2/generic/widget.h +263 -0
- data/pkgs/tile-0.8.2/image.o +0 -0
- data/pkgs/tile-0.8.2/label.o +0 -0
- data/pkgs/tile-0.8.2/layout.o +0 -0
- data/pkgs/tile-0.8.2/library/altTheme.tcl +101 -0
- data/pkgs/tile-0.8.2/library/aquaTheme.tcl +62 -0
- data/pkgs/tile-0.8.2/library/button.tcl +85 -0
- data/pkgs/tile-0.8.2/library/clamTheme.tcl +139 -0
- data/pkgs/tile-0.8.2/library/classicTheme.tcl +108 -0
- data/pkgs/tile-0.8.2/library/combobox.tcl +439 -0
- data/pkgs/tile-0.8.2/library/cursors.tcl +36 -0
- data/pkgs/tile-0.8.2/library/defaults.tcl +118 -0
- data/pkgs/tile-0.8.2/library/dialog.tcl +274 -0
- data/pkgs/tile-0.8.2/library/entry.tcl +580 -0
- data/pkgs/tile-0.8.2/library/fonts.tcl +153 -0
- data/pkgs/tile-0.8.2/library/icons.tcl +105 -0
- data/pkgs/tile-0.8.2/library/keynav.tcl +192 -0
- data/pkgs/tile-0.8.2/library/menubutton.tcl +171 -0
- data/pkgs/tile-0.8.2/library/notebook.tcl +193 -0
- data/pkgs/tile-0.8.2/library/paned.tcl +87 -0
- data/pkgs/tile-0.8.2/library/progress.tcl +51 -0
- data/pkgs/tile-0.8.2/library/scale.tcl +54 -0
- data/pkgs/tile-0.8.2/library/scrollbar.tcl +125 -0
- data/pkgs/tile-0.8.2/library/sizegrip.tcl +77 -0
- data/pkgs/tile-0.8.2/library/tile.tcl +211 -0
- data/pkgs/tile-0.8.2/library/treeview.tcl +382 -0
- data/pkgs/tile-0.8.2/library/utils.tcl +254 -0
- data/pkgs/tile-0.8.2/library/winTheme.tcl +77 -0
- data/pkgs/tile-0.8.2/library/xpTheme.tcl +63 -0
- data/pkgs/tile-0.8.2/libtile0.8.2.so +0 -0
- data/pkgs/tile-0.8.2/libttkstub.a +0 -0
- data/pkgs/tile-0.8.2/license.terms +24 -0
- data/pkgs/tile-0.8.2/macosx/aquaTheme.c +1076 -0
- data/pkgs/tile-0.8.2/manager.o +0 -0
- data/pkgs/tile-0.8.2/notebook.o +0 -0
- data/pkgs/tile-0.8.2/paned.o +0 -0
- data/pkgs/tile-0.8.2/pkgIndex.tcl +3 -0
- data/pkgs/tile-0.8.2/progress.o +0 -0
- data/pkgs/tile-0.8.2/scale.o +0 -0
- data/pkgs/tile-0.8.2/scroll.o +0 -0
- data/pkgs/tile-0.8.2/scrollbar.o +0 -0
- data/pkgs/tile-0.8.2/separator.o +0 -0
- data/pkgs/tile-0.8.2/tagset.o +0 -0
- data/pkgs/tile-0.8.2/tclconfig/install-sh +119 -0
- data/pkgs/tile-0.8.2/tclconfig/tcl.m4 +4069 -0
- data/pkgs/tile-0.8.2/tclconfig/teax.m4 +109 -0
- data/pkgs/tile-0.8.2/tests/all.tcl +18 -0
- data/pkgs/tile-0.8.2/tests/bwidget.test +103 -0
- data/pkgs/tile-0.8.2/tests/cbtest.tcl +125 -0
- data/pkgs/tile-0.8.2/tests/combobox.test +51 -0
- data/pkgs/tile-0.8.2/tests/compound.tcl +92 -0
- data/pkgs/tile-0.8.2/tests/entry.test +285 -0
- data/pkgs/tile-0.8.2/tests/entrytest.tcl +78 -0
- data/pkgs/tile-0.8.2/tests/image.test +94 -0
- data/pkgs/tile-0.8.2/tests/labelframe.tcl +41 -0
- data/pkgs/tile-0.8.2/tests/labelframe.test +137 -0
- data/pkgs/tile-0.8.2/tests/layout.test +33 -0
- data/pkgs/tile-0.8.2/tests/misc.test +35 -0
- data/pkgs/tile-0.8.2/tests/nbtest.tcl +66 -0
- data/pkgs/tile-0.8.2/tests/notebook.test +500 -0
- data/pkgs/tile-0.8.2/tests/paned.test +298 -0
- data/pkgs/tile-0.8.2/tests/progress.test +92 -0
- data/pkgs/tile-0.8.2/tests/pwtest.tcl +90 -0
- data/pkgs/tile-0.8.2/tests/sbtest.tcl +79 -0
- data/pkgs/tile-0.8.2/tests/scrollbar.test +77 -0
- data/pkgs/tile-0.8.2/tests/sgtest.tcl +52 -0
- data/pkgs/tile-0.8.2/tests/testutils.tcl +20 -0
- data/pkgs/tile-0.8.2/tests/tile.test +674 -0
- data/pkgs/tile-0.8.2/tests/treetags.test +78 -0
- data/pkgs/tile-0.8.2/tests/treeview.test +563 -0
- data/pkgs/tile-0.8.2/tests/tvtest.tcl +332 -0
- data/pkgs/tile-0.8.2/tests/validate.test +278 -0
- data/pkgs/tile-0.8.2/tile.o +0 -0
- data/pkgs/tile-0.8.2/tkElements.o +0 -0
- data/pkgs/tile-0.8.2/tkTheme.o +0 -0
- data/pkgs/tile-0.8.2/tkstate.o +0 -0
- data/pkgs/tile-0.8.2/tools/genStubs.tcl +861 -0
- data/pkgs/tile-0.8.2/trace.o +0 -0
- data/pkgs/tile-0.8.2/track.o +0 -0
- data/pkgs/tile-0.8.2/treeview.o +0 -0
- data/pkgs/tile-0.8.2/ttkStubInit.o +0 -0
- data/pkgs/tile-0.8.2/ttkStubLib.o +0 -0
- data/pkgs/tile-0.8.2/widget.o +0 -0
- data/pkgs/tile-0.8.2/win/Tile.dsp +261 -0
- data/pkgs/tile-0.8.2/win/makefile.vc +527 -0
- data/pkgs/tile-0.8.2/win/monitor.c +164 -0
- data/pkgs/tile-0.8.2/win/nmakehlp.c +483 -0
- data/pkgs/tile-0.8.2/win/rules.vc +512 -0
- data/pkgs/tile-0.8.2/win/tile.rc +40 -0
- data/pkgs/tile-0.8.2/win/winTheme.c +734 -0
- data/pkgs/tile-0.8.2/win/xpTheme.c +1029 -0
- data/spec/app_spec.rb +48 -0
- data/spec/customer_spec.rb +31 -0
- data/spec/fixtures/graph.expectation +18 -0
- data/spec/payment_spec.rb +19 -0
- data/spec/pratt_spec.rb +148 -0
- data/spec/project_spec.rb +163 -0
- data/spec/rcov.opts +0 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +21 -0
- data/spec/whence_spec.rb +54 -0
- data/tasks/pratt.rb +84 -0
- data/templates/model.eruby +12 -0
- data/templates/spec.eruby +8 -0
- data/views/env.rb +22 -0
- data/views/graph.eruby +20 -0
- data/views/invoice.eruby +148 -0
- data/views/main.rb +92 -0
- data/views/pid.eruby +3 -0
- data/views/pop.rb +94 -0
- data/views/pop2.rb +75 -0
- data/views/raw.eruby +11 -0
- metadata +390 -0
@@ -0,0 +1,139 @@
|
|
1
|
+
#
|
2
|
+
# clamTheme.tcl,v 1.31 2007/11/18 18:09:26 jenglish Exp
|
3
|
+
#
|
4
|
+
# "Clam" theme.
|
5
|
+
#
|
6
|
+
# Inspired by the XFCE family of Gnome themes.
|
7
|
+
#
|
8
|
+
|
9
|
+
namespace eval ttk::theme::clam {
|
10
|
+
variable colors
|
11
|
+
array set colors {
|
12
|
+
-disabledfg "#999999"
|
13
|
+
-frame "#dcdad5"
|
14
|
+
-window "#ffffff"
|
15
|
+
-dark "#cfcdc8"
|
16
|
+
-darker "#bab5ab"
|
17
|
+
-darkest "#9e9a91"
|
18
|
+
-lighter "#eeebe7"
|
19
|
+
-lightest "#ffffff"
|
20
|
+
-selectbg "#4a6984"
|
21
|
+
-selectfg "#ffffff"
|
22
|
+
}
|
23
|
+
|
24
|
+
ttk::style theme settings clam {
|
25
|
+
|
26
|
+
ttk::style configure "." \
|
27
|
+
-background $colors(-frame) \
|
28
|
+
-foreground black \
|
29
|
+
-bordercolor $colors(-darkest) \
|
30
|
+
-darkcolor $colors(-dark) \
|
31
|
+
-lightcolor $colors(-lighter) \
|
32
|
+
-troughcolor $colors(-darker) \
|
33
|
+
-selectbackground $colors(-selectbg) \
|
34
|
+
-selectforeground $colors(-selectfg) \
|
35
|
+
-selectborderwidth 0 \
|
36
|
+
-font TkDefaultFont \
|
37
|
+
;
|
38
|
+
|
39
|
+
ttk::style map "." \
|
40
|
+
-background [list disabled $colors(-frame) \
|
41
|
+
active $colors(-lighter)] \
|
42
|
+
-foreground [list disabled $colors(-disabledfg)] \
|
43
|
+
-selectbackground [list !focus $colors(-darkest)] \
|
44
|
+
-selectforeground [list !focus white] \
|
45
|
+
;
|
46
|
+
# -selectbackground [list !focus "#847d73"]
|
47
|
+
|
48
|
+
ttk::style configure TButton \
|
49
|
+
-anchor center -width -11 -padding 5 -relief raised
|
50
|
+
ttk::style map TButton \
|
51
|
+
-background [list \
|
52
|
+
disabled $colors(-frame) \
|
53
|
+
pressed $colors(-darker) \
|
54
|
+
active $colors(-lighter)] \
|
55
|
+
-lightcolor [list pressed $colors(-darker)] \
|
56
|
+
-darkcolor [list pressed $colors(-darker)] \
|
57
|
+
-bordercolor [list alternate "#000000"] \
|
58
|
+
;
|
59
|
+
|
60
|
+
ttk::style configure Toolbutton \
|
61
|
+
-anchor center -padding 2 -relief flat
|
62
|
+
ttk::style map Toolbutton \
|
63
|
+
-relief [list \
|
64
|
+
disabled flat \
|
65
|
+
selected sunken \
|
66
|
+
pressed sunken \
|
67
|
+
active raised] \
|
68
|
+
-background [list \
|
69
|
+
disabled $colors(-frame) \
|
70
|
+
pressed $colors(-darker) \
|
71
|
+
active $colors(-lighter)] \
|
72
|
+
-lightcolor [list pressed $colors(-darker)] \
|
73
|
+
-darkcolor [list pressed $colors(-darker)] \
|
74
|
+
;
|
75
|
+
|
76
|
+
ttk::style configure TCheckbutton \
|
77
|
+
-indicatorbackground "#ffffff" \
|
78
|
+
-indicatormargin {1 1 4 1} \
|
79
|
+
-padding 2 ;
|
80
|
+
ttk::style configure TRadiobutton \
|
81
|
+
-indicatorbackground "#ffffff" \
|
82
|
+
-indicatormargin {1 1 4 1} \
|
83
|
+
-padding 2 ;
|
84
|
+
ttk::style map TCheckbutton -indicatorbackground \
|
85
|
+
[list disabled $colors(-frame) pressed $colors(-frame)]
|
86
|
+
ttk::style map TRadiobutton -indicatorbackground \
|
87
|
+
[list disabled $colors(-frame) pressed $colors(-frame)]
|
88
|
+
|
89
|
+
ttk::style configure TMenubutton \
|
90
|
+
-width -11 -padding 5 -relief raised
|
91
|
+
|
92
|
+
ttk::style configure TEntry -padding 1 -insertwidth 1
|
93
|
+
ttk::style map TEntry \
|
94
|
+
-background [list readonly $colors(-frame)] \
|
95
|
+
-bordercolor [list focus $colors(-selectbg)] \
|
96
|
+
-lightcolor [list focus "#6f9dc6"] \
|
97
|
+
-darkcolor [list focus "#6f9dc6"] \
|
98
|
+
;
|
99
|
+
|
100
|
+
ttk::style configure TCombobox -padding 1 -insertwidth 1
|
101
|
+
ttk::style map TCombobox \
|
102
|
+
-background [list active $colors(-lighter) \
|
103
|
+
pressed $colors(-lighter)] \
|
104
|
+
-fieldbackground [list {readonly focus} $colors(-selectbg) \
|
105
|
+
readonly $colors(-frame)] \
|
106
|
+
-foreground [list {readonly focus} $colors(-selectfg)] \
|
107
|
+
;
|
108
|
+
|
109
|
+
ttk::style configure TNotebook.Tab -padding {6 2 6 2}
|
110
|
+
ttk::style map TNotebook.Tab \
|
111
|
+
-padding [list selected {6 4 6 2}] \
|
112
|
+
-background [list selected $colors(-frame) {} $colors(-darker)] \
|
113
|
+
-lightcolor [list selected $colors(-lighter) {} $colors(-dark)] \
|
114
|
+
;
|
115
|
+
|
116
|
+
# Treeview:
|
117
|
+
ttk::style configure Heading \
|
118
|
+
-font TkHeadingFont -relief raised -padding {3}
|
119
|
+
ttk::style configure Row -background $colors(-window)
|
120
|
+
ttk::style configure Cell -background $colors(-window)
|
121
|
+
ttk::style map Row \
|
122
|
+
-background [list selected $colors(-selectbg)] \
|
123
|
+
-foreground [list selected $colors(-selectfg)] ;
|
124
|
+
ttk::style map Cell \
|
125
|
+
-background [list selected $colors(-selectbg)] \
|
126
|
+
-foreground [list selected $colors(-selectfg)] ;
|
127
|
+
ttk::style map Item \
|
128
|
+
-background [list selected $colors(-selectbg)] \
|
129
|
+
-foreground [list selected $colors(-selectfg)] ;
|
130
|
+
|
131
|
+
ttk::style configure TLabelframe \
|
132
|
+
-labeloutside true -labelmargins {0 0 0 4} \
|
133
|
+
-borderwidth 2 -relief raised
|
134
|
+
|
135
|
+
ttk::style configure TProgressbar -background $colors(-frame)
|
136
|
+
|
137
|
+
ttk::style configure Sash -sashthickness 6 -gripcount 10
|
138
|
+
}
|
139
|
+
}
|
@@ -0,0 +1,108 @@
|
|
1
|
+
#
|
2
|
+
# classicTheme.tcl,v 1.19 2007/12/08 03:52:01 jenglish Exp
|
3
|
+
#
|
4
|
+
# "classic" Tk theme.
|
5
|
+
#
|
6
|
+
# Implements Tk's traditional Motif-like look and feel.
|
7
|
+
#
|
8
|
+
|
9
|
+
namespace eval ttk::theme::classic {
|
10
|
+
|
11
|
+
variable colors; array set colors {
|
12
|
+
-frame "#d9d9d9"
|
13
|
+
-window "#ffffff"
|
14
|
+
-activebg "#ececec"
|
15
|
+
-troughbg "#c3c3c3"
|
16
|
+
-selectbg "#c3c3c3"
|
17
|
+
-selectfg "#000000"
|
18
|
+
-disabledfg "#a3a3a3"
|
19
|
+
-indicator "#b03060"
|
20
|
+
}
|
21
|
+
|
22
|
+
ttk::style theme settings classic {
|
23
|
+
ttk::style configure "." \
|
24
|
+
-font TkDefaultFont \
|
25
|
+
-background $colors(-frame) \
|
26
|
+
-foreground black \
|
27
|
+
-selectbackground $colors(-selectbg) \
|
28
|
+
-selectforeground $colors(-selectfg) \
|
29
|
+
-troughcolor $colors(-troughbg) \
|
30
|
+
-indicatorcolor $colors(-frame) \
|
31
|
+
-highlightcolor $colors(-frame) \
|
32
|
+
-highlightthickness 1 \
|
33
|
+
-selectborderwidth 1 \
|
34
|
+
-insertwidth 2 \
|
35
|
+
;
|
36
|
+
|
37
|
+
# To match pre-Xft X11 appearance, use:
|
38
|
+
# ttk::style configure . -font {Helvetica 12 bold}
|
39
|
+
|
40
|
+
ttk::style map "." -background \
|
41
|
+
[list disabled $colors(-frame) active $colors(-activebg)]
|
42
|
+
ttk::style map "." -foreground \
|
43
|
+
[list disabled $colors(-disabledfg)]
|
44
|
+
|
45
|
+
ttk::style map "." -highlightcolor [list focus black]
|
46
|
+
|
47
|
+
ttk::style configure TButton \
|
48
|
+
-anchor center -padding "3m 1m" -relief raised -shiftrelief 1
|
49
|
+
ttk::style map TButton -relief [list {!disabled pressed} sunken]
|
50
|
+
|
51
|
+
ttk::style configure TCheckbutton -indicatorrelief raised
|
52
|
+
ttk::style map TCheckbutton \
|
53
|
+
-indicatorcolor [list \
|
54
|
+
pressed $colors(-frame) selected $colors(-indicator)] \
|
55
|
+
-indicatorrelief {selected sunken pressed sunken} \
|
56
|
+
;
|
57
|
+
|
58
|
+
ttk::style configure TRadiobutton -indicatorrelief raised
|
59
|
+
ttk::style map TRadiobutton \
|
60
|
+
-indicatorcolor [list \
|
61
|
+
pressed $colors(-frame) selected $colors(-indicator)] \
|
62
|
+
-indicatorrelief {selected sunken pressed sunken} \
|
63
|
+
;
|
64
|
+
|
65
|
+
ttk::style configure TMenubutton -relief raised -padding "3m 1m"
|
66
|
+
|
67
|
+
ttk::style configure TEntry -relief sunken -padding 1 -font TkTextFont
|
68
|
+
ttk::style map TEntry -fieldbackground \
|
69
|
+
[list readonly $colors(-frame) disabled $colors(-frame)]
|
70
|
+
ttk::style configure TCombobox -padding 1
|
71
|
+
ttk::style map TCombobox -fieldbackground \
|
72
|
+
[list readonly $colors(-frame) disabled $colors(-frame)]
|
73
|
+
|
74
|
+
ttk::style configure TLabelframe -borderwidth 2 -relief groove
|
75
|
+
|
76
|
+
ttk::style configure TScrollbar -relief raised
|
77
|
+
ttk::style map TScrollbar -relief {{pressed !disabled} sunken}
|
78
|
+
|
79
|
+
ttk::style configure TScale -sliderrelief raised
|
80
|
+
ttk::style map TScale -sliderrelief {{pressed !disabled} sunken}
|
81
|
+
|
82
|
+
ttk::style configure TProgressbar -background SteelBlue
|
83
|
+
ttk::style configure TNotebook.Tab \
|
84
|
+
-padding {3m 1m} \
|
85
|
+
-background $colors(-troughbg)
|
86
|
+
ttk::style map TNotebook.Tab -background [list selected $colors(-frame)]
|
87
|
+
|
88
|
+
# Treeview:
|
89
|
+
ttk::style configure Heading -font TkHeadingFont -relief raised
|
90
|
+
ttk::style configure Row -background $colors(-window)
|
91
|
+
ttk::style configure Cell -background $colors(-window)
|
92
|
+
ttk::style map Row \
|
93
|
+
-background [list selected $colors(-selectbg)] \
|
94
|
+
-foreground [list selected $colors(-selectfg)] ;
|
95
|
+
ttk::style map Cell \
|
96
|
+
-background [list selected $colors(-selectbg)] \
|
97
|
+
-foreground [list selected $colors(-selectfg)] ;
|
98
|
+
|
99
|
+
#
|
100
|
+
# Toolbar buttons:
|
101
|
+
#
|
102
|
+
ttk::style configure Toolbutton -padding 2 -relief flat -shiftrelief 2
|
103
|
+
ttk::style map Toolbutton -relief \
|
104
|
+
{disabled flat selected sunken pressed sunken active raised}
|
105
|
+
ttk::style map Toolbutton -background \
|
106
|
+
[list pressed $colors(-troughbg) active $colors(-activebg)]
|
107
|
+
}
|
108
|
+
}
|
@@ -0,0 +1,439 @@
|
|
1
|
+
#
|
2
|
+
# combobox.tcl,v 1.47 2007/11/06 02:14:20 jenglish Exp
|
3
|
+
#
|
4
|
+
# Combobox bindings.
|
5
|
+
#
|
6
|
+
# Each combobox $cb has a child $cb.popdown, which contains
|
7
|
+
# a listbox $cb.popdown.l and a scrollbar. The listbox -listvariable
|
8
|
+
# is set to a namespace variable, which is used to synchronize the
|
9
|
+
# combobox values with the listbox values.
|
10
|
+
#
|
11
|
+
# <<NOTE-WM-TRANSIENT>>:
|
12
|
+
#
|
13
|
+
# Need to set [wm transient] just before mapping the popdown
|
14
|
+
# instead of when it's created, in case a containing frame
|
15
|
+
# has been reparented [#1818441].
|
16
|
+
#
|
17
|
+
# On Windows: setting [wm transient] prevents the parent
|
18
|
+
# toplevel from becoming inactive when the popdown is posted
|
19
|
+
# (Tk 8.4.8+)
|
20
|
+
#
|
21
|
+
# On X11: WM_TRANSIENT_FOR on override-redirect windows
|
22
|
+
# may be used by compositing managers and by EWMH-aware
|
23
|
+
# window managers (even though the older ICCCM spec says
|
24
|
+
# it's meaningless).
|
25
|
+
#
|
26
|
+
# On OSX: [wm transient] does utterly the wrong thing.
|
27
|
+
# Instead, we use [MacWindowStyle "help" "noActivates hideOnSuspend"].
|
28
|
+
# The "noActivates" attribute prevents the parent toplevel
|
29
|
+
# from deactivating when the popdown is posted, and is also
|
30
|
+
# necessary for "help" windows to receive mouse events.
|
31
|
+
# "hideOnSuspend" makes the popdown disappear (resp. reappear)
|
32
|
+
# when the parent toplevel is deactivated (resp. reactivated).
|
33
|
+
# (see [#1814778]). Also set [wm resizable 0 0], to prevent
|
34
|
+
# TkAqua from shrinking the scrollbar to make room for a grow box
|
35
|
+
# that isn't there.
|
36
|
+
#
|
37
|
+
# In order to work around other platform quirks in TkAqua,
|
38
|
+
# [grab] and [focus] are set in <Map> bindings instead of
|
39
|
+
# immediately after deiconifying the window.
|
40
|
+
#
|
41
|
+
|
42
|
+
namespace eval ttk::combobox {
|
43
|
+
variable Values ;# Values($cb) is -listvariable of listbox widget
|
44
|
+
variable State
|
45
|
+
set State(entryPress) 0
|
46
|
+
}
|
47
|
+
|
48
|
+
### Combobox bindings.
|
49
|
+
#
|
50
|
+
# Duplicate the Entry bindings, override if needed:
|
51
|
+
#
|
52
|
+
|
53
|
+
ttk::copyBindings TEntry TCombobox
|
54
|
+
|
55
|
+
bind TCombobox <KeyPress-Down> { ttk::combobox::Post %W }
|
56
|
+
bind TCombobox <KeyPress-Escape> { ttk::combobox::Unpost %W }
|
57
|
+
|
58
|
+
bind TCombobox <ButtonPress-1> { ttk::combobox::Press "" %W %x %y }
|
59
|
+
bind TCombobox <Shift-ButtonPress-1> { ttk::combobox::Press "s" %W %x %y }
|
60
|
+
bind TCombobox <Double-ButtonPress-1> { ttk::combobox::Press "2" %W %x %y }
|
61
|
+
bind TCombobox <Triple-ButtonPress-1> { ttk::combobox::Press "3" %W %x %y }
|
62
|
+
bind TCombobox <B1-Motion> { ttk::combobox::Drag %W %x }
|
63
|
+
|
64
|
+
bind TCombobox <MouseWheel> { ttk::combobox::Scroll %W [expr {%D/-120}] }
|
65
|
+
if {[tk windowingsystem] eq "x11"} {
|
66
|
+
bind TCombobox <ButtonPress-4> { ttk::combobox::Scroll %W -1 }
|
67
|
+
bind TCombobox <ButtonPress-5> { ttk::combobox::Scroll %W 1 }
|
68
|
+
}
|
69
|
+
|
70
|
+
bind TCombobox <<TraverseIn>> { ttk::combobox::TraverseIn %W }
|
71
|
+
|
72
|
+
### Combobox listbox bindings.
|
73
|
+
#
|
74
|
+
bind ComboboxListbox <ButtonRelease-1> { ttk::combobox::LBSelected %W }
|
75
|
+
bind ComboboxListbox <KeyPress-Return> { ttk::combobox::LBSelected %W }
|
76
|
+
bind ComboboxListbox <KeyPress-Escape> { ttk::combobox::LBCancel %W }
|
77
|
+
bind ComboboxListbox <KeyPress-Tab> { ttk::combobox::LBTab %W next }
|
78
|
+
bind ComboboxListbox <<PrevWindow>> { ttk::combobox::LBTab %W prev }
|
79
|
+
bind ComboboxListbox <Destroy> { ttk::combobox::LBCleanup %W }
|
80
|
+
bind ComboboxListbox <Motion> { ttk::combobox::LBHover %W %x %y }
|
81
|
+
bind ComboboxListbox <Map> { focus -force %W }
|
82
|
+
|
83
|
+
switch -- [tk windowingsystem] {
|
84
|
+
win32 {
|
85
|
+
# Dismiss listbox when user switches to a different application.
|
86
|
+
# NB: *only* do this on Windows (see #1814778)
|
87
|
+
bind ComboboxListbox <FocusOut> { ttk::combobox::LBCancel %W }
|
88
|
+
}
|
89
|
+
}
|
90
|
+
|
91
|
+
### Combobox popdown window bindings.
|
92
|
+
#
|
93
|
+
bind ComboboxPopdown <Map> { ttk::combobox::MapPopdown %W }
|
94
|
+
bind ComboboxPopdown <Unmap> { ttk::combobox::UnmapPopdown %W }
|
95
|
+
bind ComboboxPopdown <ButtonPress> \
|
96
|
+
{ ttk::combobox::Unpost [winfo parent %W] }
|
97
|
+
|
98
|
+
### Option database settings.
|
99
|
+
#
|
100
|
+
|
101
|
+
option add *TCombobox*Listbox.font TkTextFont
|
102
|
+
option add *TCombobox*Listbox.relief flat
|
103
|
+
option add *TCombobox*Listbox.highlightThickness 0
|
104
|
+
|
105
|
+
## Platform-specific settings.
|
106
|
+
#
|
107
|
+
switch -- [tk windowingsystem] {
|
108
|
+
x11 {
|
109
|
+
option add *TCombobox*Listbox.background white
|
110
|
+
}
|
111
|
+
aqua {
|
112
|
+
option add *TCombobox*Listbox.borderWidth 0
|
113
|
+
}
|
114
|
+
}
|
115
|
+
|
116
|
+
### Binding procedures.
|
117
|
+
#
|
118
|
+
|
119
|
+
## Press $mode $x $y -- ButtonPress binding for comboboxes.
|
120
|
+
# Either post/unpost the listbox, or perform Entry widget binding,
|
121
|
+
# depending on widget state and location of button press.
|
122
|
+
#
|
123
|
+
proc ttk::combobox::Press {mode w x y} {
|
124
|
+
variable State
|
125
|
+
set State(entryPress) [expr {
|
126
|
+
[$w instate {!readonly !disabled}]
|
127
|
+
&& [string match *textarea [$w identify $x $y]]
|
128
|
+
}]
|
129
|
+
|
130
|
+
focus $w
|
131
|
+
if {$State(entryPress)} {
|
132
|
+
switch -- $mode {
|
133
|
+
s { ttk::entry::Shift-Press $w $x ; # Shift }
|
134
|
+
2 { ttk::entry::Select $w $x word ; # Double click}
|
135
|
+
3 { ttk::entry::Select $w $x line ; # Triple click }
|
136
|
+
"" -
|
137
|
+
default { ttk::entry::Press $w $x }
|
138
|
+
}
|
139
|
+
} else {
|
140
|
+
Post $w
|
141
|
+
}
|
142
|
+
}
|
143
|
+
|
144
|
+
## Drag -- B1-Motion binding for comboboxes.
|
145
|
+
# If the initial ButtonPress event was handled by Entry binding,
|
146
|
+
# perform Entry widget drag binding; otherwise nothing.
|
147
|
+
#
|
148
|
+
proc ttk::combobox::Drag {w x} {
|
149
|
+
variable State
|
150
|
+
if {$State(entryPress)} {
|
151
|
+
ttk::entry::Drag $w $x
|
152
|
+
}
|
153
|
+
}
|
154
|
+
|
155
|
+
## TraverseIn -- receive focus due to keyboard navigation
|
156
|
+
# For editable comboboxes, set the selection and insert cursor.
|
157
|
+
#
|
158
|
+
proc ttk::combobox::TraverseIn {w} {
|
159
|
+
$w instate {!readonly !disabled} {
|
160
|
+
$w selection range 0 end
|
161
|
+
$w icursor end
|
162
|
+
}
|
163
|
+
}
|
164
|
+
|
165
|
+
## SelectEntry $cb $index --
|
166
|
+
# Set the combobox selection in response to a user action.
|
167
|
+
#
|
168
|
+
proc ttk::combobox::SelectEntry {cb index} {
|
169
|
+
$cb current $index
|
170
|
+
$cb selection range 0 end
|
171
|
+
$cb icursor end
|
172
|
+
event generate $cb <<ComboboxSelected>>
|
173
|
+
}
|
174
|
+
|
175
|
+
## Scroll -- Mousewheel binding
|
176
|
+
#
|
177
|
+
proc ttk::combobox::Scroll {cb dir} {
|
178
|
+
$cb instate disabled { return }
|
179
|
+
set max [llength [$cb cget -values]]
|
180
|
+
set current [$cb current]
|
181
|
+
incr current $dir
|
182
|
+
if {$max != 0 && $current == $current % $max} {
|
183
|
+
SelectEntry $cb $current
|
184
|
+
}
|
185
|
+
}
|
186
|
+
|
187
|
+
## LBSelected $lb -- Activation binding for listbox
|
188
|
+
# Set the combobox value to the currently-selected listbox value
|
189
|
+
# and unpost the listbox.
|
190
|
+
#
|
191
|
+
proc ttk::combobox::LBSelected {lb} {
|
192
|
+
set cb [LBMaster $lb]
|
193
|
+
LBSelect $lb
|
194
|
+
Unpost $cb
|
195
|
+
focus $cb
|
196
|
+
}
|
197
|
+
|
198
|
+
## LBCancel --
|
199
|
+
# Unpost the listbox.
|
200
|
+
#
|
201
|
+
proc ttk::combobox::LBCancel {lb} {
|
202
|
+
Unpost [LBMaster $lb]
|
203
|
+
}
|
204
|
+
|
205
|
+
## LBTab -- Tab key binding for combobox listbox.
|
206
|
+
# Set the selection, and navigate to next/prev widget.
|
207
|
+
#
|
208
|
+
proc ttk::combobox::LBTab {lb dir} {
|
209
|
+
set cb [LBMaster $lb]
|
210
|
+
switch -- $dir {
|
211
|
+
next { set newFocus [tk_focusNext $cb] }
|
212
|
+
prev { set newFocus [tk_focusPrev $cb] }
|
213
|
+
}
|
214
|
+
|
215
|
+
if {$newFocus ne ""} {
|
216
|
+
LBSelect $lb
|
217
|
+
Unpost $cb
|
218
|
+
# The [grab release] call in [Unpost] queues events that later
|
219
|
+
# re-set the focus. [update] to make sure these get processed first:
|
220
|
+
update
|
221
|
+
ttk::traverseTo $newFocus
|
222
|
+
}
|
223
|
+
}
|
224
|
+
|
225
|
+
## LBHover -- <Motion> binding for combobox listbox.
|
226
|
+
# Follow selection on mouseover.
|
227
|
+
#
|
228
|
+
proc ttk::combobox::LBHover {w x y} {
|
229
|
+
$w selection clear 0 end
|
230
|
+
$w activate @$x,$y
|
231
|
+
$w selection set @$x,$y
|
232
|
+
}
|
233
|
+
|
234
|
+
## MapPopdown -- <Map> binding for ComboboxPopdown
|
235
|
+
#
|
236
|
+
proc ttk::combobox::MapPopdown {w} {
|
237
|
+
[winfo parent $w] state pressed
|
238
|
+
ttk::globalGrab $w
|
239
|
+
}
|
240
|
+
|
241
|
+
## UnmapPopdown -- <Unmap> binding for ComboboxPopdown
|
242
|
+
#
|
243
|
+
proc ttk::combobox::UnmapPopdown {w} {
|
244
|
+
[winfo parent $w] state !pressed
|
245
|
+
ttk::releaseGrab $w
|
246
|
+
}
|
247
|
+
|
248
|
+
###
|
249
|
+
#
|
250
|
+
|
251
|
+
namespace eval ::ttk::combobox {
|
252
|
+
# @@@ Until we have a proper native scrollbar on Aqua, use
|
253
|
+
# @@@ the regular Tk one. Use ttk::scrollbar on other platforms.
|
254
|
+
variable scrollbar ttk::scrollbar
|
255
|
+
if {[tk windowingsystem] eq "aqua"} {
|
256
|
+
set scrollbar ::scrollbar
|
257
|
+
}
|
258
|
+
}
|
259
|
+
|
260
|
+
## PopdownWindow --
|
261
|
+
# Returns the popdown widget associated with a combobox,
|
262
|
+
# creating it if necessary.
|
263
|
+
#
|
264
|
+
proc ttk::combobox::PopdownWindow {cb} {
|
265
|
+
variable scrollbar
|
266
|
+
|
267
|
+
if {![winfo exists $cb.popdown]} {
|
268
|
+
set popdown [PopdownToplevel $cb.popdown]
|
269
|
+
|
270
|
+
$scrollbar $popdown.sb \
|
271
|
+
-orient vertical -command [list $popdown.l yview]
|
272
|
+
listbox $popdown.l \
|
273
|
+
-listvariable ttk::combobox::Values($cb) \
|
274
|
+
-yscrollcommand [list $popdown.sb set] \
|
275
|
+
-exportselection false \
|
276
|
+
-selectmode browse \
|
277
|
+
-activestyle none \
|
278
|
+
;
|
279
|
+
|
280
|
+
bindtags $popdown.l \
|
281
|
+
[list $popdown.l ComboboxListbox Listbox $popdown all]
|
282
|
+
|
283
|
+
grid $popdown.l $popdown.sb -sticky news
|
284
|
+
grid columnconfigure $popdown 0 -weight 1
|
285
|
+
grid rowconfigure $popdown 0 -weight 1
|
286
|
+
}
|
287
|
+
return $cb.popdown
|
288
|
+
}
|
289
|
+
|
290
|
+
## PopdownToplevel -- Create toplevel window for the combobox popdown
|
291
|
+
#
|
292
|
+
# See also <<NOTE-WM-TRANSIENT>>
|
293
|
+
#
|
294
|
+
proc ttk::combobox::PopdownToplevel {w} {
|
295
|
+
toplevel $w -class ComboboxPopdown
|
296
|
+
wm withdraw $w
|
297
|
+
switch -- [tk windowingsystem] {
|
298
|
+
default -
|
299
|
+
x11 {
|
300
|
+
$w configure -relief solid -borderwidth 1
|
301
|
+
wm overrideredirect $w true
|
302
|
+
}
|
303
|
+
win32 {
|
304
|
+
$w configure -relief solid -borderwidth 1
|
305
|
+
wm overrideredirect $w true
|
306
|
+
}
|
307
|
+
aqua {
|
308
|
+
$w configure -relief solid -borderwidth 0
|
309
|
+
tk::unsupported::MacWindowStyle style $w \
|
310
|
+
help {noActivates hideOnSuspend}
|
311
|
+
wm resizable $w 0 0
|
312
|
+
}
|
313
|
+
}
|
314
|
+
return $w
|
315
|
+
}
|
316
|
+
|
317
|
+
## ConfigureListbox --
|
318
|
+
# Set listbox values, selection, height, and scrollbar visibility
|
319
|
+
# from current combobox values.
|
320
|
+
#
|
321
|
+
proc ttk::combobox::ConfigureListbox {cb} {
|
322
|
+
variable Values
|
323
|
+
|
324
|
+
set popdown [PopdownWindow $cb]
|
325
|
+
set values [$cb cget -values]
|
326
|
+
set current [$cb current]
|
327
|
+
if {$current < 0} {
|
328
|
+
set current 0 ;# no current entry, highlight first one
|
329
|
+
}
|
330
|
+
set Values($cb) $values
|
331
|
+
$popdown.l selection clear 0 end
|
332
|
+
$popdown.l selection set $current
|
333
|
+
$popdown.l activate $current
|
334
|
+
$popdown.l see $current
|
335
|
+
set height [llength $values]
|
336
|
+
if {$height > [$cb cget -height]} {
|
337
|
+
set height [$cb cget -height]
|
338
|
+
grid $popdown.sb
|
339
|
+
} else {
|
340
|
+
grid remove $popdown.sb
|
341
|
+
}
|
342
|
+
$popdown.l configure -height $height
|
343
|
+
}
|
344
|
+
|
345
|
+
## PlacePopdown --
|
346
|
+
# Set popdown window geometry.
|
347
|
+
#
|
348
|
+
# @@@TODO: factor with menubutton::PostPosition
|
349
|
+
#
|
350
|
+
proc ttk::combobox::PlacePopdown {cb popdown} {
|
351
|
+
set x [winfo rootx $cb]
|
352
|
+
set y [winfo rooty $cb]
|
353
|
+
set w [winfo width $cb]
|
354
|
+
set h [winfo height $cb]
|
355
|
+
set postoffset [ttk::style lookup TCombobox -postoffset {} {0 0 0 0}]
|
356
|
+
foreach var {x y w h} delta $postoffset {
|
357
|
+
incr $var $delta
|
358
|
+
}
|
359
|
+
|
360
|
+
set H [winfo reqheight $popdown]
|
361
|
+
if {$y + $h + $H > [winfo screenheight $popdown]} {
|
362
|
+
set Y [expr {$y - $H}]
|
363
|
+
} else {
|
364
|
+
set Y [expr {$y + $h}]
|
365
|
+
}
|
366
|
+
wm geometry $popdown ${w}x${H}+${x}+${Y}
|
367
|
+
}
|
368
|
+
|
369
|
+
## Post $cb --
|
370
|
+
# Pop down the associated listbox.
|
371
|
+
#
|
372
|
+
proc ttk::combobox::Post {cb} {
|
373
|
+
# Don't do anything if disabled:
|
374
|
+
#
|
375
|
+
$cb instate disabled { return }
|
376
|
+
|
377
|
+
# ASSERT: ![$cb instate pressed]
|
378
|
+
|
379
|
+
# Run -postcommand callback:
|
380
|
+
#
|
381
|
+
uplevel #0 [$cb cget -postcommand]
|
382
|
+
|
383
|
+
set popdown [PopdownWindow $cb]
|
384
|
+
ConfigureListbox $cb
|
385
|
+
update idletasks
|
386
|
+
PlacePopdown $cb $popdown
|
387
|
+
# See <<NOTE-WM-TRANSIENT>>
|
388
|
+
switch -- [tk windowingsystem] {
|
389
|
+
x11 - win32 { wm transient $popdown [winfo toplevel $cb] }
|
390
|
+
}
|
391
|
+
|
392
|
+
# Post the listbox:
|
393
|
+
#
|
394
|
+
wm deiconify $popdown
|
395
|
+
raise $popdown
|
396
|
+
}
|
397
|
+
|
398
|
+
## Unpost $cb --
|
399
|
+
# Unpost the listbox.
|
400
|
+
#
|
401
|
+
proc ttk::combobox::Unpost {cb} {
|
402
|
+
if {[winfo exists $cb.popdown]} {
|
403
|
+
wm withdraw $cb.popdown
|
404
|
+
}
|
405
|
+
grab release $cb.popdown ;# in case of stuck or unexpected grab [#1239190]
|
406
|
+
}
|
407
|
+
|
408
|
+
## LBMaster $lb --
|
409
|
+
# Return the combobox main widget that owns the listbox.
|
410
|
+
#
|
411
|
+
proc ttk::combobox::LBMaster {lb} {
|
412
|
+
winfo parent [winfo parent $lb]
|
413
|
+
}
|
414
|
+
|
415
|
+
## LBSelect $lb --
|
416
|
+
# Transfer listbox selection to combobox value.
|
417
|
+
#
|
418
|
+
proc ttk::combobox::LBSelect {lb} {
|
419
|
+
set cb [LBMaster $lb]
|
420
|
+
set selection [$lb curselection]
|
421
|
+
if {[llength $selection] == 1} {
|
422
|
+
SelectEntry $cb [lindex $selection 0]
|
423
|
+
}
|
424
|
+
}
|
425
|
+
|
426
|
+
## LBCleanup $lb --
|
427
|
+
# <Destroy> binding for combobox listboxes.
|
428
|
+
# Cleans up by unsetting the linked textvariable.
|
429
|
+
#
|
430
|
+
# Note: we can't just use { unset [%W cget -listvariable] }
|
431
|
+
# because the widget command is already gone when this binding fires).
|
432
|
+
# [winfo parent] still works, fortunately.
|
433
|
+
#
|
434
|
+
proc ttk::combobox::LBCleanup {lb} {
|
435
|
+
variable Values
|
436
|
+
unset Values([LBMaster $lb])
|
437
|
+
}
|
438
|
+
|
439
|
+
#*EOF*
|