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,89 @@
|
|
1
|
+
#
|
2
|
+
# configure.in,v 1.39 2007/12/16 18:20:55 jenglish Exp
|
3
|
+
#
|
4
|
+
|
5
|
+
AC_REVISION(1.39)
|
6
|
+
AC_INIT([tile],[0.8.2])
|
7
|
+
AC_CONFIG_AUX_DIR(tclconfig)
|
8
|
+
|
9
|
+
# Usual Tcl stuff:
|
10
|
+
#
|
11
|
+
TEA_INIT([3.6])
|
12
|
+
TEA_PATH_TCLCONFIG
|
13
|
+
TEA_LOAD_TCLCONFIG
|
14
|
+
TEA_PATH_TKCONFIG
|
15
|
+
TEA_LOAD_TKCONFIG
|
16
|
+
|
17
|
+
TEA_PREFIX
|
18
|
+
|
19
|
+
TEA_SETUP_COMPILER
|
20
|
+
|
21
|
+
TEA_ADD_SOURCES([])
|
22
|
+
#TEA_ADD_HEADERS([])
|
23
|
+
TEA_ADD_INCLUDES([-I. -I\"`${CYGPATH} ${srcdir}/generic`\"])
|
24
|
+
#TEA_ADD_LIBS([])
|
25
|
+
#TEA_ADD_CFLAGS([])
|
26
|
+
#TEA_ADD_STUB_SOURCES([])
|
27
|
+
#TEA_ADD_TCL_SOURCES([])
|
28
|
+
|
29
|
+
TEA_PRIVATE_TCL_HEADERS
|
30
|
+
TEA_PRIVATE_TK_HEADERS
|
31
|
+
|
32
|
+
# Build stuff:
|
33
|
+
#
|
34
|
+
TEA_ENABLE_THREADS
|
35
|
+
TEA_ENABLE_SHARED
|
36
|
+
TEA_ENABLE_SYMBOLS
|
37
|
+
TEA_CONFIG_CFLAGS
|
38
|
+
|
39
|
+
TEA_PATH_X
|
40
|
+
|
41
|
+
# Platform-specific stuff:
|
42
|
+
#
|
43
|
+
case "${TEA_WINDOWINGSYSTEM}" in
|
44
|
+
win32)
|
45
|
+
CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb"
|
46
|
+
TEA_ADD_LIBS([gdi32.lib user32.lib])
|
47
|
+
TEA_ADD_SOURCES([\$(WIN_OBJECTS)])
|
48
|
+
# Check if we have uxtheme.h for xpnative look
|
49
|
+
AC_CHECK_HEADER([uxtheme.h], [AC_DEFINE(HAVE_UXTHEME_H)],
|
50
|
+
[AC_MSG_NOTICE([xpnative theme will be unavailable])],
|
51
|
+
[#include <windows.h>])
|
52
|
+
;;
|
53
|
+
aqua)
|
54
|
+
TEA_ADD_INCLUDES([-I${TK_TOP_DIR_NATIVE}/macosx])
|
55
|
+
TEA_ADD_LIBS([-framework Carbon])
|
56
|
+
TEA_ADD_SOURCES([\$(MACOSX_OBJECTS)])
|
57
|
+
;;
|
58
|
+
x11)
|
59
|
+
;;
|
60
|
+
esac;
|
61
|
+
|
62
|
+
CLEANFILES="$CLEANFILES pkgIndex.tcl"
|
63
|
+
AC_SUBST(CLEANFILES)
|
64
|
+
|
65
|
+
AC_DEFINE(USE_TCL_STUBS,[1],[Should always be 1])
|
66
|
+
AC_DEFINE(USE_TK_STUBS,[1],[Should always be 1])
|
67
|
+
AC_DEFINE(BUILD_tile,[1],[Set to 1 when building package])
|
68
|
+
|
69
|
+
TEA_MAKE_LIB
|
70
|
+
|
71
|
+
# Fix PKG_STUB_LIB_FILE:
|
72
|
+
# + base name is "ttkstub", not "tilestub"
|
73
|
+
# + do not include version number in library name
|
74
|
+
#
|
75
|
+
if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then
|
76
|
+
PKG_STUB_LIB_FILE=ttkstub.lib
|
77
|
+
else
|
78
|
+
PKG_STUB_LIB_FILE=libttkstub.a
|
79
|
+
fi;
|
80
|
+
|
81
|
+
TEA_PROG_WISH
|
82
|
+
|
83
|
+
CONFIGURE_OUTPUTS="Makefile config.cache config.log config.status"
|
84
|
+
AC_SUBST(CONFIGURE_OUTPUTS)
|
85
|
+
|
86
|
+
AC_CONFIG_FILES([Makefile])
|
87
|
+
AC_OUTPUT
|
88
|
+
|
89
|
+
#*EOF*
|
@@ -0,0 +1,59 @@
|
|
1
|
+
#
|
2
|
+
# autocomplete.tcl,v 1.1 2005/01/28 01:25:19 muonics Exp
|
3
|
+
#
|
4
|
+
# Demonstration of inline auto-completion for Tile combobox widgets.
|
5
|
+
#
|
6
|
+
# Usage:
|
7
|
+
#
|
8
|
+
# enableAutoComplete path ?presorted?
|
9
|
+
#
|
10
|
+
# path may be an individual window to enable auto-completion for only
|
11
|
+
# that window, or TCombobox to enable it for all comboboxes.
|
12
|
+
#
|
13
|
+
# By default, the values list is assumed to be pre-sorted to optimize
|
14
|
+
# the search. If it is not presorted, pass 0 in for the second arg,
|
15
|
+
# and the list will be sorted before the search at the cost of some
|
16
|
+
# overhead.
|
17
|
+
#
|
18
|
+
|
19
|
+
namespace eval tile::combobox {
|
20
|
+
namespace export enableAutocomplete
|
21
|
+
}
|
22
|
+
|
23
|
+
## enableAutocomplete
|
24
|
+
#
|
25
|
+
# Enable inline auto-completion for the specified combobox widget.
|
26
|
+
#
|
27
|
+
proc tile::combobox::enableAutocomplete { w {presorted 1} } {
|
28
|
+
bind $w <KeyPress> [namespace code [list DoAutoComplete %W %A $presorted]]
|
29
|
+
}
|
30
|
+
|
31
|
+
## DoAutoComplete
|
32
|
+
#
|
33
|
+
# Perform inline auto-completion of typed text in the combobox.
|
34
|
+
#
|
35
|
+
proc tile::combobox::DoAutoComplete { w s presorted } {
|
36
|
+
set old [$w get]
|
37
|
+
tile::entry::Insert $w $s
|
38
|
+
set new [$w get]
|
39
|
+
|
40
|
+
# Only auto-complete if the string length has changed due to insertion.
|
41
|
+
|
42
|
+
if {[string length $old] != [string length $new]} {
|
43
|
+
set values [$w cget -values]
|
44
|
+
|
45
|
+
if {!$presorted} {
|
46
|
+
set values [lsort -dictionary $values]
|
47
|
+
}
|
48
|
+
|
49
|
+
set match [lsearch -inline $values $new*]
|
50
|
+
|
51
|
+
if {[string length $match]} {
|
52
|
+
$w delete 0 end
|
53
|
+
$w insert end $match
|
54
|
+
$w selection range [string length $new] end
|
55
|
+
$w icursor [string length $new]
|
56
|
+
}
|
57
|
+
}
|
58
|
+
}
|
59
|
+
|
@@ -0,0 +1,870 @@
|
|
1
|
+
#
|
2
|
+
# demo.tcl,v 1.114 2007/12/13 20:14:02 jenglish Exp
|
3
|
+
#
|
4
|
+
# Tile widget set -- widget demo
|
5
|
+
#
|
6
|
+
package require Tk
|
7
|
+
|
8
|
+
eval destroy [winfo children .] ;# in case script is re-sourced
|
9
|
+
|
10
|
+
### Load auxilliary scripts.
|
11
|
+
#
|
12
|
+
variable demodir [file dirname [info script]]
|
13
|
+
lappend auto_path . $demodir
|
14
|
+
package require tile
|
15
|
+
package require keynav
|
16
|
+
|
17
|
+
source [file join $demodir iconlib.tcl]
|
18
|
+
source [file join $demodir repeater.tcl]
|
19
|
+
|
20
|
+
# This forces an update of the available packages list.
|
21
|
+
# It's required for package names to find the themes in demos/themes/*.tcl
|
22
|
+
eval [package unknown] Tcl [package provide Tcl]
|
23
|
+
|
24
|
+
### Global options and bindings.
|
25
|
+
#
|
26
|
+
option add *Button.default normal
|
27
|
+
option add *Text.background white
|
28
|
+
option add *Entry.background white
|
29
|
+
option add *tearOff false
|
30
|
+
|
31
|
+
# See toolbutton.tcl.
|
32
|
+
#
|
33
|
+
option add *Toolbar.relief groove
|
34
|
+
option add *Toolbar.borderWidth 2
|
35
|
+
option add *Toolbar.Button.Pad 2
|
36
|
+
option add *Toolbar.Button.default disabled
|
37
|
+
option add *Toolbar*takeFocus 0
|
38
|
+
|
39
|
+
# ... for debugging:
|
40
|
+
bind all <ButtonPress-3> { set ::W %W }
|
41
|
+
bind all <Control-ButtonPress-3> { focus %W }
|
42
|
+
|
43
|
+
# Stealth feature:
|
44
|
+
#
|
45
|
+
if {![catch {package require Img 1.3}]} {
|
46
|
+
bind all <Control-Shift-Alt-KeyPress-S> screenshot
|
47
|
+
proc screenshot {} {
|
48
|
+
image create photo ScreenShot -format window -data .
|
49
|
+
bell
|
50
|
+
# Gamma looks off if we use PNG ...
|
51
|
+
# Looks even worse if we use GIF ...
|
52
|
+
ScreenShot write screenshot.png -format png
|
53
|
+
image delete ScreenShot
|
54
|
+
bell
|
55
|
+
}
|
56
|
+
}
|
57
|
+
|
58
|
+
### Global data.
|
59
|
+
#
|
60
|
+
|
61
|
+
foreach theme [lsort [ttk::themes]] {
|
62
|
+
lappend THEMELIST $theme [string totitle $theme]
|
63
|
+
}
|
64
|
+
|
65
|
+
# Generate icons (see also: iconlib.tcl):
|
66
|
+
#
|
67
|
+
foreach {icon data} [array get ::ImgData] {
|
68
|
+
set ::ICON($icon) [image create photo -data $data]
|
69
|
+
}
|
70
|
+
|
71
|
+
variable ROOT "."
|
72
|
+
variable BASE [ttk::frame .base]
|
73
|
+
pack $BASE -side top -expand true -fill both
|
74
|
+
|
75
|
+
array set ::V {
|
76
|
+
COMPOUND top
|
77
|
+
CONSOLE 0
|
78
|
+
MENURADIO1 One
|
79
|
+
PBMODE determinate
|
80
|
+
SELECTED 1
|
81
|
+
CHOICE 2
|
82
|
+
SCALE 50
|
83
|
+
VSCALE 0
|
84
|
+
}
|
85
|
+
|
86
|
+
### Utilities.
|
87
|
+
#
|
88
|
+
|
89
|
+
## foreachWidget varname widget script --
|
90
|
+
# Execute $script with $varname set to each widget in the hierarchy.
|
91
|
+
#
|
92
|
+
proc foreachWidget {varname Q script} {
|
93
|
+
upvar 1 $varname w
|
94
|
+
while {[llength $Q]} {
|
95
|
+
set QN [list]
|
96
|
+
foreach w $Q {
|
97
|
+
uplevel 1 $script
|
98
|
+
foreach child [winfo children $w] {
|
99
|
+
lappend QN $child
|
100
|
+
}
|
101
|
+
}
|
102
|
+
set Q $QN
|
103
|
+
}
|
104
|
+
}
|
105
|
+
|
106
|
+
## sbstub $sb -- stub -command option for a scrollbar.
|
107
|
+
# Updates the scrollbar's position.
|
108
|
+
#
|
109
|
+
proc sbstub {sb cmd number {units units}} { sbstub.$cmd $sb $number $units }
|
110
|
+
proc sbstub.moveto {sb number _} { $sb set $number [expr {$number + 0.5}] }
|
111
|
+
proc sbstub.scroll {sb number units} {
|
112
|
+
if {$units eq "pages"} {
|
113
|
+
set delta 0.2
|
114
|
+
} else {
|
115
|
+
set delta 0.05
|
116
|
+
}
|
117
|
+
set current [$sb get]
|
118
|
+
set new0 [expr {[lindex $current 0] + $delta*$number}]
|
119
|
+
set new1 [expr {[lindex $current 1] + $delta*$number}]
|
120
|
+
$sb set $new0 $new1
|
121
|
+
}
|
122
|
+
|
123
|
+
## sbset $sb -- auto-hide scrollbar
|
124
|
+
# Scrollable widget -[xy]scrollcommand prefix.
|
125
|
+
# Sets the scrollbar, auto-hides/shows.
|
126
|
+
# Scrollbar must be controlled by the grid geometry manager.
|
127
|
+
#
|
128
|
+
proc sbset {sb first last} {
|
129
|
+
if {$first <= 0 && $last >= 1} {
|
130
|
+
grid remove $sb
|
131
|
+
} else {
|
132
|
+
grid $sb
|
133
|
+
}
|
134
|
+
$sb set $first $last
|
135
|
+
}
|
136
|
+
|
137
|
+
## scrolled -- create a widget with attached scrollbars.
|
138
|
+
#
|
139
|
+
proc scrolled {class w args} {
|
140
|
+
set sf "${w}_sf"
|
141
|
+
|
142
|
+
frame $sf
|
143
|
+
eval [linsert $args 0 $class $w]
|
144
|
+
scrollbar $sf.hsb -orient horizontal -command [list $w xview]
|
145
|
+
scrollbar $sf.vsb -orient vertical -command [list $w yview]
|
146
|
+
|
147
|
+
configure.scrolled $sf $w
|
148
|
+
return $sf
|
149
|
+
}
|
150
|
+
|
151
|
+
## ttk::scrolled -- create a widget with attached Tile scrollbars.
|
152
|
+
#
|
153
|
+
proc ttk::scrolled {class w args} {
|
154
|
+
set sf "${w}_sf"
|
155
|
+
|
156
|
+
ttk::frame $sf
|
157
|
+
eval [linsert $args 0 $class $w]
|
158
|
+
ttk::scrollbar $sf.hsb -orient horizontal -command [list $w xview]
|
159
|
+
ttk::scrollbar $sf.vsb -orient vertical -command [list $w yview]
|
160
|
+
|
161
|
+
configure.scrolled $sf $w
|
162
|
+
return $sf
|
163
|
+
}
|
164
|
+
|
165
|
+
## configure.scrolled -- common factor of [scrolled] and [ttk::scrolled]
|
166
|
+
#
|
167
|
+
proc configure.scrolled {sf w} {
|
168
|
+
$w configure -xscrollcommand [list $sf.hsb set]
|
169
|
+
$w configure -yscrollcommand [list $sf.vsb set]
|
170
|
+
|
171
|
+
grid $w -in $sf -row 0 -column 0 -sticky nwse
|
172
|
+
grid $sf.hsb -row 1 -column 0 -sticky we
|
173
|
+
grid $sf.vsb -row 0 -column 1 -sticky ns
|
174
|
+
|
175
|
+
grid columnconfigure $sf 0 -weight 1
|
176
|
+
grid rowconfigure $sf 0 -weight 1
|
177
|
+
}
|
178
|
+
|
179
|
+
### Toolbars.
|
180
|
+
#
|
181
|
+
proc makeToolbars {} {
|
182
|
+
set buttons [list open new save]
|
183
|
+
set checkboxes [list bold italic]
|
184
|
+
|
185
|
+
#
|
186
|
+
# Tile toolbar:
|
187
|
+
#
|
188
|
+
set tb [ttk::frame $::BASE.tbar_styled -class Toolbar]
|
189
|
+
set i 0
|
190
|
+
foreach icon $buttons {
|
191
|
+
set b [ttk::button $tb.tb[incr i] \
|
192
|
+
-text $icon -image $::ICON($icon) -compound $::V(COMPOUND) \
|
193
|
+
-style Toolbutton]
|
194
|
+
grid $b -row 0 -column $i -sticky news
|
195
|
+
}
|
196
|
+
ttk::separator $tb.sep -orient vertical
|
197
|
+
grid $tb.sep -row 0 -column [incr i] -sticky news -padx 2 -pady 2
|
198
|
+
foreach icon $checkboxes {
|
199
|
+
set b [ttk::checkbutton $tb.cb[incr i] \
|
200
|
+
-variable ::V($icon) \
|
201
|
+
-text $icon -image $::ICON($icon) -compound $::V(COMPOUND) \
|
202
|
+
-style Toolbutton]
|
203
|
+
grid $b -row 0 -column $i -sticky news
|
204
|
+
}
|
205
|
+
|
206
|
+
ttk::menubutton $tb.compound \
|
207
|
+
-text "toolbar" -image $::ICON(file) -compound $::V(COMPOUND)
|
208
|
+
$tb.compound configure -menu [makeCompoundMenu $tb.compound.menu]
|
209
|
+
grid $tb.compound -row 0 -column [incr i] -sticky news
|
210
|
+
|
211
|
+
grid columnconfigure $tb [incr i] -weight 1
|
212
|
+
|
213
|
+
#
|
214
|
+
# Standard toolbar:
|
215
|
+
#
|
216
|
+
set tb [frame $::BASE.tbar_orig -class Toolbar]
|
217
|
+
set i 0
|
218
|
+
foreach icon $buttons {
|
219
|
+
set b [button $tb.tb[incr i] \
|
220
|
+
-text $icon -image $::ICON($icon) -compound $::V(COMPOUND) \
|
221
|
+
-relief flat -overrelief raised]
|
222
|
+
grid $b -row 0 -column $i -sticky news
|
223
|
+
}
|
224
|
+
frame $tb.sep -borderwidth 1 -width 2 -relief sunken
|
225
|
+
grid $tb.sep -row 0 -column [incr i] -sticky news -padx 2 -pady 2
|
226
|
+
foreach icon $checkboxes {
|
227
|
+
set b [checkbutton $tb.cb[incr i] -variable ::V($icon) \
|
228
|
+
-text $icon -image $::ICON($icon) -compound $::V(COMPOUND) \
|
229
|
+
-indicatoron false \
|
230
|
+
-selectcolor {} \
|
231
|
+
-relief flat \
|
232
|
+
-overrelief raised \
|
233
|
+
-offrelief flat]
|
234
|
+
grid $b -row 0 -column $i -sticky news
|
235
|
+
}
|
236
|
+
|
237
|
+
menubutton $tb.compound \
|
238
|
+
-text "toolbar" -image $::ICON(file) -compound $::V(COMPOUND) \
|
239
|
+
-indicatoron true
|
240
|
+
$tb.compound configure -menu [makeCompoundMenu $tb.compound.menu]
|
241
|
+
grid $tb.compound -row 0 -column [incr i] -sticky news
|
242
|
+
|
243
|
+
grid columnconfigure $tb [incr i] -weight 1
|
244
|
+
}
|
245
|
+
|
246
|
+
#
|
247
|
+
# Toolbar -compound control:
|
248
|
+
#
|
249
|
+
proc makeCompoundMenu {menu} {
|
250
|
+
variable compoundStrings {text image none top bottom left right center}
|
251
|
+
menu $menu
|
252
|
+
foreach string $compoundStrings {
|
253
|
+
$menu add radiobutton \
|
254
|
+
-label [string totitle $string] \
|
255
|
+
-variable ::V(COMPOUND) -value $string \
|
256
|
+
-command changeToolbars ;
|
257
|
+
}
|
258
|
+
return $menu
|
259
|
+
}
|
260
|
+
|
261
|
+
proc changeToolbars {} {
|
262
|
+
foreachWidget w [list $::BASE.tbar_styled $::BASE.tbar_orig] {
|
263
|
+
catch { $w configure -compound $::V(COMPOUND) }
|
264
|
+
}
|
265
|
+
}
|
266
|
+
|
267
|
+
makeToolbars
|
268
|
+
|
269
|
+
### Theme control panel.
|
270
|
+
#
|
271
|
+
proc makeThemeControl {c} {
|
272
|
+
ttk::labelframe $c -text "Theme" -padding {6 0}
|
273
|
+
foreach {theme name} $::THEMELIST {
|
274
|
+
set b [ttk::radiobutton $c.s$theme -text $name \
|
275
|
+
-variable ::ttk::currentTheme -value $theme \
|
276
|
+
-command [list ttk::setTheme $theme]]
|
277
|
+
pack $b -side top -expand false -fill x
|
278
|
+
}
|
279
|
+
return $c
|
280
|
+
}
|
281
|
+
makeThemeControl $::BASE.control
|
282
|
+
|
283
|
+
### Notebook widget.
|
284
|
+
#
|
285
|
+
set nb [ttk::notebook $::BASE.nb]
|
286
|
+
ttk::notebook::enableTraversal $nb
|
287
|
+
|
288
|
+
### Main demo pane.
|
289
|
+
#
|
290
|
+
# Side-by comparison of Tile vs. core widgets.
|
291
|
+
#
|
292
|
+
|
293
|
+
|
294
|
+
set pw [ttk::panedwindow $nb.client -orient horizontal]
|
295
|
+
$nb add $pw -text "Demo" -underline 0 -padding 6
|
296
|
+
set l [ttk::labelframe $pw.l -text "Themed" -padding 6 -underline 1]
|
297
|
+
set r [labelframe $pw.r -text "Standard" -padx 6 -pady 6]
|
298
|
+
$pw add $l -weight 1; $pw add $r -weight 1
|
299
|
+
|
300
|
+
## menubuttonMenu -- demo menu for menubutton widgets.
|
301
|
+
#
|
302
|
+
proc menubuttonMenu {menu} {
|
303
|
+
menu $menu
|
304
|
+
foreach dir {above below left right flush} {
|
305
|
+
$menu add command -label [string totitle $dir] \
|
306
|
+
-command [list [winfo parent $menu] configure -direction $dir]
|
307
|
+
}
|
308
|
+
$menu add cascade -label "Submenu" -menu [set submenu [menu $menu.submenu]]
|
309
|
+
$submenu add command -label "Subcommand 1"
|
310
|
+
$submenu add command -label "Subcommand 2"
|
311
|
+
$submenu add command -label "Subcommand 3"
|
312
|
+
$menu add separator
|
313
|
+
$menu add command -label "Quit" -command [list destroy .]
|
314
|
+
|
315
|
+
return $menu
|
316
|
+
}
|
317
|
+
|
318
|
+
## Main demo pane - themed widgets.
|
319
|
+
#
|
320
|
+
ttk::checkbutton $l.cb -text "Checkbutton" -variable ::V(SELECTED) -underline 2
|
321
|
+
ttk::radiobutton $l.rb1 -text "One" -variable ::V(CHOICE) -value 1 -underline 0
|
322
|
+
ttk::radiobutton $l.rb2 -text "Two" -variable ::V(CHOICE) -value 2
|
323
|
+
ttk::radiobutton $l.rb3 -text "Three" -variable ::V(CHOICE) -value 3 -under 0
|
324
|
+
ttk::button $l.button -text "Button" -underline 0
|
325
|
+
|
326
|
+
ttk::menubutton $l.mb -text "Menubutton" -underline 2
|
327
|
+
$l.mb configure -menu [menubuttonMenu $l.mb.menu]
|
328
|
+
|
329
|
+
set ::entryText "Entry widget"
|
330
|
+
ttk::entry $l.e -textvariable ::entryText
|
331
|
+
$l.e selection range 6 end
|
332
|
+
|
333
|
+
set ltext [ttk::scrolled text $l.t -width 12 -height 5 -wrap none]
|
334
|
+
|
335
|
+
grid $l.cb -sticky ew
|
336
|
+
grid $l.rb1 -sticky ew
|
337
|
+
grid $l.rb2 -sticky ew
|
338
|
+
grid $l.rb3 -sticky ew
|
339
|
+
grid $l.button -sticky ew -padx 2 -pady 2
|
340
|
+
grid $l.mb -sticky ew -padx 2 -pady 2
|
341
|
+
grid $l.e -sticky ew -padx 2 -pady 2
|
342
|
+
grid $ltext -sticky news
|
343
|
+
|
344
|
+
grid columnconfigure $l 0 -weight 1
|
345
|
+
grid rowconfigure $l 7 -weight 1 ; # text widget (grid is a PITA)
|
346
|
+
|
347
|
+
## Main demo pane - core widgets.
|
348
|
+
#
|
349
|
+
checkbutton $r.cb -text "Checkbutton" -variable ::V(SELECTED)
|
350
|
+
radiobutton $r.rb1 -text "One" -variable ::V(CHOICE) -value 1
|
351
|
+
radiobutton $r.rb2 -text "Two" -variable ::V(CHOICE) -value 2 -underline 1
|
352
|
+
radiobutton $r.rb3 -text "Three" -variable ::V(CHOICE) -value 3
|
353
|
+
button $r.button -text "Button"
|
354
|
+
menubutton $r.mb -text "Menubutton" -underline 3 -takefocus 1
|
355
|
+
$r.mb configure -menu [menubuttonMenu $r.mb.menu]
|
356
|
+
# Add -indicatoron control:
|
357
|
+
set ::V(rmbIndicatoron) [$r.mb cget -indicatoron]
|
358
|
+
$r.mb.menu insert 0 checkbutton -label "Indicator?" \
|
359
|
+
-variable ::V(rmbIndicatoron) \
|
360
|
+
-command "$r.mb configure -indicatoron \$::V(rmbIndicatoron)" ;
|
361
|
+
$r.mb.menu insert 1 separator
|
362
|
+
|
363
|
+
entry $r.e -textvariable ::entryText
|
364
|
+
|
365
|
+
set rtext [scrolled text $r.t -width 12 -height 5 -wrap none]
|
366
|
+
|
367
|
+
grid $r.cb -sticky ew
|
368
|
+
grid $r.rb1 -sticky ew
|
369
|
+
grid $r.rb2 -sticky ew
|
370
|
+
grid $r.rb3 -sticky ew
|
371
|
+
grid $r.button -sticky ew -padx 2 -pady 2
|
372
|
+
grid $r.mb -sticky ew -padx 2 -pady 2
|
373
|
+
grid $r.e -sticky ew -padx 2 -pady 2
|
374
|
+
grid $rtext -sticky news
|
375
|
+
|
376
|
+
grid columnconfigure $r 0 -weight 1
|
377
|
+
grid rowconfigure $r 7 -weight 1 ; # text widget
|
378
|
+
|
379
|
+
#
|
380
|
+
# Add some text to the text boxes:
|
381
|
+
#
|
382
|
+
|
383
|
+
set cb $::BASE.tbar_orig.cb5
|
384
|
+
set txt "checkbutton $cb \\\n"
|
385
|
+
foreach copt [$cb configure] {
|
386
|
+
if {[llength $copt] == 5} {
|
387
|
+
append txt " [lindex $copt 0] [lindex $copt 4] \\\n"
|
388
|
+
}
|
389
|
+
}
|
390
|
+
append txt " ;\n"
|
391
|
+
|
392
|
+
$l.t insert end $txt
|
393
|
+
$r.t insert end $txt
|
394
|
+
|
395
|
+
### Scales and sliders pane.
|
396
|
+
#
|
397
|
+
proc scales.pane {scales} {
|
398
|
+
ttk::frame $scales
|
399
|
+
|
400
|
+
ttk::panedwindow $scales.pw -orient horizontal
|
401
|
+
set l [ttk::labelframe $scales.styled -text "Themed" -padding 6]
|
402
|
+
set r [labelframe $scales.orig -text "Standard" -padx 6 -pady 6]
|
403
|
+
|
404
|
+
ttk::scale $l.scale -orient horizontal -from 0 -to 100 -variable ::V(SCALE)
|
405
|
+
ttk::scale $l.vscale -orient vertical -from 100 -to 0 -variable ::V(VSCALE)
|
406
|
+
ttk::progressbar $l.progress -orient horizontal -maximum 100
|
407
|
+
ttk::progressbar $l.vprogress -orient vertical -maximum 100
|
408
|
+
if {1} {
|
409
|
+
$l.scale configure -command [list $l.progress configure -value]
|
410
|
+
$l.vscale configure -command [list $l.vprogress configure -value]
|
411
|
+
} else {
|
412
|
+
# This would also work, but the Tk scale widgets
|
413
|
+
# in the right hand pane cause some interference when
|
414
|
+
# in autoincrement/indeterminate mode.
|
415
|
+
#
|
416
|
+
$l.progress configure -variable ::V(SCALE)
|
417
|
+
$l.vprogress configure -variable ::V(VSCALE)
|
418
|
+
}
|
419
|
+
|
420
|
+
$l.scale set 50
|
421
|
+
$l.vscale set 50
|
422
|
+
|
423
|
+
ttk::label $l.lmode -text "Progress bar mode:"
|
424
|
+
ttk::radiobutton $l.pbmode0 -variable ::V(PBMODE) \
|
425
|
+
-text determinate -value determinate -command [list pbMode $l]
|
426
|
+
ttk::radiobutton $l.pbmode1 -variable ::V(PBMODE) \
|
427
|
+
-text indeterminate -value indeterminate -command [list pbMode $l]
|
428
|
+
proc pbMode {l} {
|
429
|
+
variable V
|
430
|
+
$l.progress configure -mode $V(PBMODE)
|
431
|
+
$l.vprogress configure -mode $V(PBMODE)
|
432
|
+
}
|
433
|
+
|
434
|
+
ttk::button $l.start -text "Start" -command [list pbStart $l]
|
435
|
+
proc pbStart {l} {
|
436
|
+
set ::V(PBMODE) indeterminate; pbMode $l
|
437
|
+
$l.progress start 10
|
438
|
+
$l.vprogress start
|
439
|
+
}
|
440
|
+
|
441
|
+
ttk::button $l.stop -text "Stop" -command [list pbStop $l]
|
442
|
+
proc pbStop {l} {
|
443
|
+
$l.progress stop
|
444
|
+
$l.vprogress stop
|
445
|
+
}
|
446
|
+
|
447
|
+
grid $l.scale -columnspan 2 -sticky ew
|
448
|
+
grid $l.progress -columnspan 2 -sticky ew
|
449
|
+
grid $l.vscale $l.vprogress -sticky nws
|
450
|
+
|
451
|
+
grid $l.lmode -sticky we -columnspan 2
|
452
|
+
grid $l.pbmode0 -sticky we -columnspan 2
|
453
|
+
grid $l.pbmode1 -sticky we -columnspan 2
|
454
|
+
grid $l.start -sticky we -columnspan 2
|
455
|
+
grid $l.stop -sticky we -columnspan 2
|
456
|
+
|
457
|
+
grid columnconfigure $l 0 -weight 1
|
458
|
+
grid columnconfigure $l 1 -weight 1
|
459
|
+
|
460
|
+
grid rowconfigure $l 99 -weight 1
|
461
|
+
|
462
|
+
scale $r.scale -orient horizontal -from 0 -to 100 -variable ::V(SCALE)
|
463
|
+
scale $r.vscale -orient vertical -from 100 -to 0 -variable ::V(VSCALE)
|
464
|
+
grid $r.scale -sticky news
|
465
|
+
grid $r.vscale -sticky nws
|
466
|
+
|
467
|
+
grid rowconfigure $r 99 -weight 1
|
468
|
+
grid columnconfigure $r 0 -weight 1
|
469
|
+
|
470
|
+
##
|
471
|
+
$scales.pw add $l -weight 1
|
472
|
+
$scales.pw add $r -weight 1
|
473
|
+
pack $scales.pw -expand true -fill both
|
474
|
+
|
475
|
+
return $scales
|
476
|
+
}
|
477
|
+
$nb add [scales.pane $nb.scales] -text Scales -sticky nwes -padding 6
|
478
|
+
|
479
|
+
### Combobox demo pane.
|
480
|
+
#
|
481
|
+
proc combobox.pane {cbf} {
|
482
|
+
ttk::frame $cbf
|
483
|
+
set values [list abc def ghi jkl mno pqr stu vwx yz]
|
484
|
+
pack \
|
485
|
+
[ttk::combobox $cbf.cb1 -values $values -textvariable ::COMBO] \
|
486
|
+
[ttk::combobox $cbf.cb2 -values $values -textvariable ::COMBO ] \
|
487
|
+
[ttk::combobox $cbf.cb3 -values $values -textvariable ::COMBO ] \
|
488
|
+
-side top -padx 2 -pady 2 -expand false -fill x;
|
489
|
+
$cbf.cb1 configure -state readonly
|
490
|
+
$cbf.cb3 configure -height 5
|
491
|
+
$cbf.cb1 current 3
|
492
|
+
return $cbf
|
493
|
+
}
|
494
|
+
$nb add [combobox.pane $nb.combos] -text "Combobox" -underline 7
|
495
|
+
|
496
|
+
### Treeview widget demo pane.
|
497
|
+
#
|
498
|
+
proc tree.pane {w} {
|
499
|
+
ttk::frame $w
|
500
|
+
pack [ttk::scrolled ttk::treeview $w.t -columns [list Class]] \
|
501
|
+
-expand true -fill both
|
502
|
+
|
503
|
+
$w.t heading #0 -text "Widget"
|
504
|
+
$w.t heading Class -text "Class"
|
505
|
+
|
506
|
+
# Populate tree:
|
507
|
+
#
|
508
|
+
$w.t insert {} 0 -id . -text "Main Window" \
|
509
|
+
-values [list [winfo class .]]
|
510
|
+
populateTree $w.t .
|
511
|
+
|
512
|
+
bind $w.t <KeyPress-F5> [list refreshTree %W]
|
513
|
+
|
514
|
+
return $w
|
515
|
+
}
|
516
|
+
|
517
|
+
# populateTree $tv $id --
|
518
|
+
# Recursively add child nodes to treeview widget.
|
519
|
+
#
|
520
|
+
proc populateTree {tv id} {
|
521
|
+
if {![winfo exists $id]} {
|
522
|
+
$tv delete $id
|
523
|
+
return ""
|
524
|
+
}
|
525
|
+
|
526
|
+
# Replace tree item children with current list of child windows.
|
527
|
+
#
|
528
|
+
$tv delete [$tv children $id]
|
529
|
+
foreach child [winfo children $id] {
|
530
|
+
$tv insert $id end -id $child -text [winfo name $child] \
|
531
|
+
-values [list [winfo class $child]]
|
532
|
+
populateTree $tv $child
|
533
|
+
}
|
534
|
+
return $id
|
535
|
+
}
|
536
|
+
|
537
|
+
# refreshTree -- <KeyPress-F5> binding for treeview demo.
|
538
|
+
# Recompute children.
|
539
|
+
#
|
540
|
+
|
541
|
+
proc refreshTree {tv} {
|
542
|
+
set id [$tv focus]
|
543
|
+
$tv item [populateTree $tv $id] -open true
|
544
|
+
}
|
545
|
+
|
546
|
+
$nb add [tree.pane $nb.tree] -text "Tree" -sticky news
|
547
|
+
|
548
|
+
### Other demos.
|
549
|
+
#
|
550
|
+
$nb add [ttk::frame $nb.others] -text "Others" -underline 4
|
551
|
+
|
552
|
+
set Timers(StateMonitor) {}
|
553
|
+
set Timers(FocusMonitor) {}
|
554
|
+
|
555
|
+
set others $::BASE.nb.others
|
556
|
+
|
557
|
+
ttk::label $others.m -justify left -wraplength 300
|
558
|
+
bind ShowDescription <Enter> { $BASE.nb.others.m configure -text $Desc(%W) }
|
559
|
+
bind ShowDescription <Leave> { $BASE.nb.others.m configure -text "" }
|
560
|
+
|
561
|
+
foreach {command label description} {
|
562
|
+
trackStates "Widget states..."
|
563
|
+
"Display/modify widget state bits"
|
564
|
+
|
565
|
+
scrollbarResizeDemo "Scrollbar resize behavior..."
|
566
|
+
"Shows how Tile and standard scrollbars differ when they're sized too large"
|
567
|
+
|
568
|
+
trackFocus "Track keyboard focus..."
|
569
|
+
"Display the name of the widget that currently has focus"
|
570
|
+
|
571
|
+
repeatDemo "Repeating buttons"
|
572
|
+
"Demonstrates custom classes (see demos/repeater.tcl)"
|
573
|
+
|
574
|
+
} {
|
575
|
+
set b [ttk::button $others.$command -text $label -command $command]
|
576
|
+
set Desc($b) $description
|
577
|
+
bindtags $b [lreplace [bindtags $b] end 0 ShowDescription]
|
578
|
+
|
579
|
+
pack $b -side top -expand false -fill x -padx 6 -pady 6
|
580
|
+
}
|
581
|
+
|
582
|
+
pack $others.m -side bottom -expand true -fill both
|
583
|
+
|
584
|
+
|
585
|
+
### Scrollbar resize demo.
|
586
|
+
#
|
587
|
+
proc scrollbarResizeDemo {} {
|
588
|
+
set t .scrollbars
|
589
|
+
destroy $t
|
590
|
+
toplevel $t ; wm geometry $t 200x200
|
591
|
+
frame $t.f -height 200
|
592
|
+
grid \
|
593
|
+
[ttk::scrollbar $t.f.tsb -command [list sbstub $t.f.tsb]] \
|
594
|
+
[scrollbar $t.f.sb -command [list sbstub $t.f.sb]] \
|
595
|
+
-sticky news
|
596
|
+
|
597
|
+
$t.f.sb set 0 0.5 ;# prevent backwards-compatibility mode for old SB
|
598
|
+
|
599
|
+
grid columnconfigure $t.f 0 -weight 1
|
600
|
+
grid columnconfigure $t.f 1 -weight 1
|
601
|
+
grid rowconfigure $t.f 0 -weight 1
|
602
|
+
pack $t.f -expand true -fill both
|
603
|
+
}
|
604
|
+
|
605
|
+
### Track focus demo.
|
606
|
+
#
|
607
|
+
proc trackFocus {} {
|
608
|
+
global Focus
|
609
|
+
set t .focus
|
610
|
+
destroy $t
|
611
|
+
toplevel $t
|
612
|
+
wm title $t "Keyboard focus"
|
613
|
+
set i 0
|
614
|
+
foreach {label variable} {
|
615
|
+
"Focus widget:" Focus(Widget)
|
616
|
+
"Class:" Focus(WidgetClass)
|
617
|
+
"Next:" Focus(WidgetNext)
|
618
|
+
"Grab:" Focus(Grab)
|
619
|
+
"Status:" Focus(GrabStatus)
|
620
|
+
} {
|
621
|
+
grid [ttk::label $t.l$i -text $label -anchor e] \
|
622
|
+
[ttk::label $t.v$i -textvariable $variable \
|
623
|
+
-width 40 -anchor w -relief groove] \
|
624
|
+
-sticky ew;
|
625
|
+
incr i
|
626
|
+
}
|
627
|
+
grid columnconfigure $t 1 -weight 1
|
628
|
+
grid rowconfigure $t $i -weight 1
|
629
|
+
|
630
|
+
bind $t <Destroy> {after cancel $Timers(FocusMonitor)}
|
631
|
+
FocusMonitor
|
632
|
+
}
|
633
|
+
|
634
|
+
proc FocusMonitor {} {
|
635
|
+
global Focus
|
636
|
+
|
637
|
+
set Focus(Widget) [focus]
|
638
|
+
if {$::Focus(Widget) ne ""} {
|
639
|
+
set Focus(WidgetClass) [winfo class $Focus(Widget)]
|
640
|
+
set Focus(WidgetNext) [tk_focusNext $Focus(Widget)]
|
641
|
+
} else {
|
642
|
+
set Focus(WidgetClass) [set Focus(WidgetNext) ""]
|
643
|
+
}
|
644
|
+
|
645
|
+
set Focus(Grab) [grab current]
|
646
|
+
if {$Focus(Grab) ne ""} {
|
647
|
+
set Focus(GrabStatus) [grab status $Focus(Grab)]
|
648
|
+
} else {
|
649
|
+
set Focus(GrabStatus) ""
|
650
|
+
}
|
651
|
+
|
652
|
+
set ::Timers(FocusMonitor) [after 200 FocusMonitor]
|
653
|
+
}
|
654
|
+
|
655
|
+
### Widget states demo.
|
656
|
+
#
|
657
|
+
variable Widget .tbar_styled.tb1
|
658
|
+
|
659
|
+
bind all <Control-Shift-ButtonPress-1> { TrackWidget %W ; break }
|
660
|
+
|
661
|
+
proc TrackWidget {w} {
|
662
|
+
set ::Widget $w ;
|
663
|
+
if {[winfo exists .states]} {
|
664
|
+
UpdateStates
|
665
|
+
} else {
|
666
|
+
trackStates
|
667
|
+
}
|
668
|
+
}
|
669
|
+
|
670
|
+
variable states [list \
|
671
|
+
active disabled focus pressed selected readonly \
|
672
|
+
background alternate invalid]
|
673
|
+
|
674
|
+
proc trackStates {} {
|
675
|
+
variable states
|
676
|
+
set t .states
|
677
|
+
destroy $t; toplevel $t ; wm title $t "Widget states"
|
678
|
+
|
679
|
+
set tf [ttk::frame $t.f] ; pack $tf -expand true -fill both
|
680
|
+
|
681
|
+
ttk::label $tf.info -text "Press Control-Shift-Button-1 on any widget"
|
682
|
+
|
683
|
+
ttk::label $tf.lw -text "Widget:" -anchor e -relief groove
|
684
|
+
ttk::label $tf.w -textvariable ::Widget -anchor w -relief groove
|
685
|
+
|
686
|
+
grid $tf.info - -sticky ew -padx 6 -pady 6
|
687
|
+
grid $tf.lw $tf.w -sticky ew
|
688
|
+
|
689
|
+
foreach state $states {
|
690
|
+
ttk::checkbutton $tf.s$state \
|
691
|
+
-text $state \
|
692
|
+
-variable ::State($state) \
|
693
|
+
-command [list ChangeState $state] ;
|
694
|
+
grid x $tf.s$state -sticky nsew
|
695
|
+
}
|
696
|
+
|
697
|
+
grid columnconfigure $tf 1 -weight 1
|
698
|
+
|
699
|
+
grid x [ttk::frame $tf.cmd] -sticky nse
|
700
|
+
grid x \
|
701
|
+
[ttk::button $tf.cmd.close -text Close -command [list destroy $t]] \
|
702
|
+
-padx 4 -pady {6 4};
|
703
|
+
grid columnconfigure $tf.cmd 0 -weight 1
|
704
|
+
|
705
|
+
bind $t <KeyPress-Escape> [list event generate $tf.cmd.close <<Invoke>>]
|
706
|
+
bind $t <Destroy> { after cancel $::Timers(StateMonitor) }
|
707
|
+
StateMonitor
|
708
|
+
}
|
709
|
+
|
710
|
+
proc StateMonitor {} {
|
711
|
+
if {$::Widget ne ""} { UpdateStates }
|
712
|
+
set ::Timers(StateMonitor) [after 200 StateMonitor]
|
713
|
+
}
|
714
|
+
|
715
|
+
proc UpdateStates {} {
|
716
|
+
variable states
|
717
|
+
variable State
|
718
|
+
variable Widget
|
719
|
+
|
720
|
+
foreach state $states {
|
721
|
+
if {[catch {set State($state) [$Widget instate $state]}]} {
|
722
|
+
# Not a Tile widget:
|
723
|
+
.states.f.s$state state disabled
|
724
|
+
} else {
|
725
|
+
.states.f.s$state state !disabled
|
726
|
+
}
|
727
|
+
}
|
728
|
+
}
|
729
|
+
|
730
|
+
proc ChangeState {state} {
|
731
|
+
variable State
|
732
|
+
variable Widget
|
733
|
+
if {$Widget ne ""} {
|
734
|
+
if {$State($state)} {
|
735
|
+
$Widget state $state
|
736
|
+
} else {
|
737
|
+
$Widget state !$state
|
738
|
+
}
|
739
|
+
}
|
740
|
+
}
|
741
|
+
|
742
|
+
### Repeating button demo.
|
743
|
+
#
|
744
|
+
|
745
|
+
proc repeatDemo {} {
|
746
|
+
set top .repeatDemo
|
747
|
+
if {![catch { wm deiconify $top ; raise $top }]} { return }
|
748
|
+
toplevel $top
|
749
|
+
wm title $top "Repeating button"
|
750
|
+
keynav::enableMnemonics $top
|
751
|
+
|
752
|
+
set f [ttk::frame .repeatDemo.f]
|
753
|
+
ttk::button $f.b -class Repeater -text "Press and hold" \
|
754
|
+
-command [list $f.p step]
|
755
|
+
ttk::progressbar $f.p -orient horizontal -maximum 10
|
756
|
+
|
757
|
+
ttk::separator $f.sep -orient horizontal
|
758
|
+
set cmd [ttk::frame $f.cmd]
|
759
|
+
pack \
|
760
|
+
[ttk::button $cmd.close -text Close -command [list destroy $top]] \
|
761
|
+
-side right -padx 6;
|
762
|
+
|
763
|
+
pack $f.cmd -side bottom -expand false -fill x -padx 6 -pady 6
|
764
|
+
pack $f.sep -side bottom -expand false -fill x -padx 6 -pady 6
|
765
|
+
pack $f.b -side left -expand false -fill none -padx 6 -pady 6
|
766
|
+
pack $f.p -side right -expand true -fill x -padx 6 -pady 6
|
767
|
+
|
768
|
+
$f.b configure -underline 0
|
769
|
+
$cmd.close configure -underline 0
|
770
|
+
bind $top <KeyPress-Escape> [list event generate $cmd.close <<Invoke>>]
|
771
|
+
|
772
|
+
pack $f -expand true -fill both
|
773
|
+
}
|
774
|
+
|
775
|
+
|
776
|
+
### Command box.
|
777
|
+
#
|
778
|
+
set cmd [ttk::frame $::BASE.command]
|
779
|
+
ttk::button $cmd.close -text Close -underline 0 -command [list destroy .]
|
780
|
+
ttk::button $cmd.help -text Help -command showHelp
|
781
|
+
|
782
|
+
proc showHelp {} {
|
783
|
+
if {![winfo exists .helpDialog]} {
|
784
|
+
lappend detail "Tile version [package provide tile]"
|
785
|
+
lappend detail "Tile library: $::tile::library"
|
786
|
+
lappend detail "[package ifneeded tile [package provide tile]]"
|
787
|
+
lappend detail "Tk version: $::tk_patchLevel"
|
788
|
+
lappend detail "Tk library: $::tk_library"
|
789
|
+
ttk::dialog .helpDialog -type ok -icon info \
|
790
|
+
-message "Tile demo" -detail [join $detail \n]
|
791
|
+
}
|
792
|
+
}
|
793
|
+
|
794
|
+
grid x $cmd.close $cmd.help -pady 6 -padx 6
|
795
|
+
grid columnconfigure $cmd 0 -weight 1
|
796
|
+
|
797
|
+
## Status bar (to demonstrate size grip)
|
798
|
+
#
|
799
|
+
set statusbar [ttk::frame $BASE.statusbar]
|
800
|
+
pack [ttk::sizegrip $statusbar.grip] -side right -anchor se
|
801
|
+
|
802
|
+
## Accelerators:
|
803
|
+
#
|
804
|
+
bind $::ROOT <KeyPress-Escape> [list event generate $cmd.close <<Invoke>>]
|
805
|
+
bind $::ROOT <<Help>> [list event generate $cmd.help <<Invoke>>]
|
806
|
+
keynav::enableMnemonics $::ROOT
|
807
|
+
|
808
|
+
### Menubar.
|
809
|
+
#
|
810
|
+
set menu [menu $::BASE.menu]
|
811
|
+
$::ROOT configure -menu $menu
|
812
|
+
$menu add cascade -label "File" -underline 0 -menu [menu $menu.file]
|
813
|
+
$menu.file add command -label "Open" -underline 0 \
|
814
|
+
-compound left -image $::ICON(open)
|
815
|
+
$menu.file add command -label "Save" -underline 0 \
|
816
|
+
-compound left -image $::ICON(save)
|
817
|
+
$menu.file add separator
|
818
|
+
$menu.file add checkbutton -label "Checkbox" -underline 0 \
|
819
|
+
-variable ::V(SELECTED)
|
820
|
+
$menu.file add cascade -label "Choices" -underline 1 \
|
821
|
+
-menu [menu $menu.file.choices]
|
822
|
+
foreach {label value} {One 1 Two 2 Three 3} {
|
823
|
+
$menu.file.choices add radiobutton \
|
824
|
+
-label $label -variable ::V(CHOICE) -value $value
|
825
|
+
}
|
826
|
+
|
827
|
+
$menu.file insert end separator
|
828
|
+
if {[tk windowingsystem] ne "x11"} {
|
829
|
+
$menu.file insert end checkbutton -label Console -underline 5 \
|
830
|
+
-variable ::V(CONSOLE) -command toggleconsole
|
831
|
+
proc toggleconsole {} {
|
832
|
+
if {$::V(CONSOLE)} {console show} else {console hide}
|
833
|
+
}
|
834
|
+
}
|
835
|
+
$menu.file add command -label "Exit" -underline 1 \
|
836
|
+
-command [list event generate $cmd.close <<Invoke>>]
|
837
|
+
|
838
|
+
# Add Theme menu.
|
839
|
+
#
|
840
|
+
proc makeThemeMenu {menu} {
|
841
|
+
menu $menu
|
842
|
+
foreach {theme name} $::THEMELIST {
|
843
|
+
$menu add radiobutton -label $name \
|
844
|
+
-variable ::ttk::currentTheme -value $theme \
|
845
|
+
-command [list ttk::setTheme $theme]
|
846
|
+
}
|
847
|
+
return $menu
|
848
|
+
}
|
849
|
+
|
850
|
+
$menu add cascade -label "Theme" -underline 3 -menu [makeThemeMenu $menu.theme]
|
851
|
+
|
852
|
+
## Tools menu.
|
853
|
+
#
|
854
|
+
$menu add cascade -label "Tools" -underline 3 -menu [menu $menu.tools]
|
855
|
+
$menu.tools add command -label "Track focus" -command trackFocus
|
856
|
+
$menu.tools add command -label "Widget states" -command trackStates
|
857
|
+
|
858
|
+
### Main window layout.
|
859
|
+
#
|
860
|
+
|
861
|
+
pack $BASE.statusbar -side bottom -expand false -fill x
|
862
|
+
pack $BASE.command -side bottom -expand false -fill x
|
863
|
+
pack $BASE.tbar_styled -side top -expand false -fill x
|
864
|
+
pack $BASE.tbar_orig -side top -expand false -fill x
|
865
|
+
pack $BASE.control -side left -expand false -fill y -padx 6 -pady 6
|
866
|
+
pack $BASE.nb -side left -expand true -fill both -padx 6 -pady 6
|
867
|
+
|
868
|
+
wm title $ROOT "Tile demo"
|
869
|
+
wm iconname $ROOT "Tile demo"
|
870
|
+
update; wm deiconify $ROOT
|