Pratt 1.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,51 @@
|
|
|
1
|
+
#
|
|
2
|
+
# progress.tcl,v 1.5 2006/01/16 15:34:09 jenglish Exp
|
|
3
|
+
#
|
|
4
|
+
# Tile widget set: progress bar utilities.
|
|
5
|
+
#
|
|
6
|
+
|
|
7
|
+
namespace eval ttk::progressbar {
|
|
8
|
+
variable Timers ;# Map: widget name -> after ID
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
# Autoincrement --
|
|
12
|
+
# Periodic callback procedure for autoincrement mode
|
|
13
|
+
#
|
|
14
|
+
proc ttk::progressbar::Autoincrement {pb steptime stepsize} {
|
|
15
|
+
variable Timers
|
|
16
|
+
|
|
17
|
+
if {![winfo exists $pb]} {
|
|
18
|
+
# widget has been destroyed -- cancel timer
|
|
19
|
+
unset -nocomplain Timers($pb)
|
|
20
|
+
return
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
$pb step $stepsize
|
|
24
|
+
|
|
25
|
+
set Timers($pb) [after $steptime \
|
|
26
|
+
[list ttk::progressbar::Autoincrement $pb $steptime $stepsize] ]
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
# ttk::progressbar::start --
|
|
30
|
+
# Start autoincrement mode. Invoked by [$pb start] widget code.
|
|
31
|
+
#
|
|
32
|
+
proc ttk::progressbar::start {pb {steptime 50} {stepsize 1}} {
|
|
33
|
+
variable Timers
|
|
34
|
+
if {![info exists Timers($pb)]} {
|
|
35
|
+
Autoincrement $pb $steptime $stepsize
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
# ttk::progressbar::stop --
|
|
40
|
+
# Cancel autoincrement mode. Invoked by [$pb stop] widget code.
|
|
41
|
+
#
|
|
42
|
+
proc ttk::progressbar::stop {pb} {
|
|
43
|
+
variable Timers
|
|
44
|
+
if {[info exists Timers($pb)]} {
|
|
45
|
+
after cancel $Timers($pb)
|
|
46
|
+
unset Timers($pb)
|
|
47
|
+
}
|
|
48
|
+
$pb configure -value 0
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# scale.tcl - Copyright (C) 2004 Pat Thoyts <patthoyts@users.sourceforge.net>
|
|
2
|
+
#
|
|
3
|
+
# Bindings for the TScale widget
|
|
4
|
+
#
|
|
5
|
+
# scale.tcl,v 1.11 2006/11/05 18:40:48 jenglish Exp
|
|
6
|
+
|
|
7
|
+
namespace eval ttk::scale {
|
|
8
|
+
variable State
|
|
9
|
+
array set State {
|
|
10
|
+
dragging 0
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
bind TScale <ButtonPress-1> { ttk::scale::Press %W %x %y }
|
|
15
|
+
bind TScale <B1-Motion> { ttk::scale::Drag %W %x %y }
|
|
16
|
+
bind TScale <ButtonRelease-1> { ttk::scale::Release %W %x %y }
|
|
17
|
+
|
|
18
|
+
proc ttk::scale::Press {w x y} {
|
|
19
|
+
variable State
|
|
20
|
+
set State(dragging) 0
|
|
21
|
+
|
|
22
|
+
switch -glob -- [$w identify $x $y] {
|
|
23
|
+
*track -
|
|
24
|
+
*trough {
|
|
25
|
+
if {[$w get $x $y] <= [$w get]} {
|
|
26
|
+
ttk::Repeatedly Increment $w -1
|
|
27
|
+
} else {
|
|
28
|
+
ttk::Repeatedly Increment $w 1
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
*slider {
|
|
32
|
+
set State(dragging) 1
|
|
33
|
+
set State(initial) [$w get]
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
proc ttk::scale::Drag {w x y} {
|
|
39
|
+
variable State
|
|
40
|
+
if {$State(dragging)} {
|
|
41
|
+
$w set [$w get $x $y]
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
proc ttk::scale::Release {w x y} {
|
|
46
|
+
variable State
|
|
47
|
+
set State(dragging) 0
|
|
48
|
+
ttk::CancelRepeat
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
proc ttk::scale::Increment {w delta} {
|
|
52
|
+
if {![winfo exists $w]} return
|
|
53
|
+
$w set [expr {[$w get] + $delta}]
|
|
54
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
#
|
|
2
|
+
# scrollbar.tcl,v 1.19 2007/12/12 16:53:10 jenglish Exp
|
|
3
|
+
#
|
|
4
|
+
# Bindings for TScrollbar widget
|
|
5
|
+
#
|
|
6
|
+
|
|
7
|
+
# Still don't have a working ttk::scrollbar under OSX -
|
|
8
|
+
# Swap in a [tk::scrollbar] on that platform,
|
|
9
|
+
# unless user specifies -class or -style.
|
|
10
|
+
#
|
|
11
|
+
if {[tk windowingsystem] eq "aqua"} {
|
|
12
|
+
rename ::ttk::scrollbar ::ttk::_scrollbar_
|
|
13
|
+
proc ttk::scrollbar {w args} {
|
|
14
|
+
set constructor ::scrollbar
|
|
15
|
+
foreach {option _} $args {
|
|
16
|
+
if {$option eq "-class" || $option eq "-style"} {
|
|
17
|
+
set constructor ::ttk::_scrollbar_
|
|
18
|
+
break
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return [eval [linsert $args 0 $constructor $w]]
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
namespace eval ttk::scrollbar {
|
|
26
|
+
variable State
|
|
27
|
+
# State(xPress) --
|
|
28
|
+
# State(yPress) -- initial position of mouse at start of drag.
|
|
29
|
+
# State(first) -- value of -first at start of drag.
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
bind TScrollbar <ButtonPress-1> { ttk::scrollbar::Press %W %x %y }
|
|
33
|
+
bind TScrollbar <B1-Motion> { ttk::scrollbar::Drag %W %x %y }
|
|
34
|
+
bind TScrollbar <ButtonRelease-1> { ttk::scrollbar::Release %W %x %y }
|
|
35
|
+
|
|
36
|
+
bind TScrollbar <ButtonPress-2> { ttk::scrollbar::Jump %W %x %y }
|
|
37
|
+
bind TScrollbar <B2-Motion> { ttk::scrollbar::Drag %W %x %y }
|
|
38
|
+
bind TScrollbar <ButtonRelease-2> { ttk::scrollbar::Release %W %x %y }
|
|
39
|
+
|
|
40
|
+
proc ttk::scrollbar::Scroll {w n units} {
|
|
41
|
+
set cmd [$w cget -command]
|
|
42
|
+
if {$cmd ne ""} {
|
|
43
|
+
uplevel #0 $cmd scroll $n $units
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
proc ttk::scrollbar::Moveto {w fraction} {
|
|
48
|
+
set cmd [$w cget -command]
|
|
49
|
+
if {$cmd ne ""} {
|
|
50
|
+
uplevel #0 $cmd moveto $fraction
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
proc ttk::scrollbar::Press {w x y} {
|
|
55
|
+
variable State
|
|
56
|
+
|
|
57
|
+
set State(xPress) $x
|
|
58
|
+
set State(yPress) $y
|
|
59
|
+
|
|
60
|
+
switch -glob -- [$w identify $x $y] {
|
|
61
|
+
*uparrow -
|
|
62
|
+
*leftarrow {
|
|
63
|
+
ttk::Repeatedly Scroll $w -1 units
|
|
64
|
+
}
|
|
65
|
+
*downarrow -
|
|
66
|
+
*rightarrow {
|
|
67
|
+
ttk::Repeatedly Scroll $w 1 units
|
|
68
|
+
}
|
|
69
|
+
*thumb {
|
|
70
|
+
set State(first) [lindex [$w get] 0]
|
|
71
|
+
}
|
|
72
|
+
*trough {
|
|
73
|
+
set f [$w fraction $x $y]
|
|
74
|
+
if {$f < [lindex [$w get] 0]} {
|
|
75
|
+
# Clicked in upper/left trough
|
|
76
|
+
ttk::Repeatedly Scroll $w -1 pages
|
|
77
|
+
} elseif {$f > [lindex [$w get] 1]} {
|
|
78
|
+
# Clicked in lower/right trough
|
|
79
|
+
ttk::Repeatedly Scroll $w 1 pages
|
|
80
|
+
} else {
|
|
81
|
+
# Clicked on thumb (???)
|
|
82
|
+
set State(first) [lindex [$w get] 0]
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
proc ttk::scrollbar::Drag {w x y} {
|
|
89
|
+
variable State
|
|
90
|
+
if {![info exists State(first)]} {
|
|
91
|
+
# Initial buttonpress was not on the thumb,
|
|
92
|
+
# or something screwy has happened. In either case, ignore:
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
set xDelta [expr {$x - $State(xPress)}]
|
|
96
|
+
set yDelta [expr {$y - $State(yPress)}]
|
|
97
|
+
Moveto $w [expr {$State(first) + [$w delta $xDelta $yDelta]}]
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
proc ttk::scrollbar::Release {w x y} {
|
|
101
|
+
variable State
|
|
102
|
+
unset -nocomplain State(xPress) State(yPress) State(first)
|
|
103
|
+
ttk::CancelRepeat
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
# scrollbar::Jump -- ButtonPress-2 binding for scrollbars.
|
|
107
|
+
# Behaves exactly like scrollbar::Press, except that
|
|
108
|
+
# clicking in the trough jumps to the the selected position.
|
|
109
|
+
#
|
|
110
|
+
proc ttk::scrollbar::Jump {w x y} {
|
|
111
|
+
variable State
|
|
112
|
+
|
|
113
|
+
switch -glob -- [$w identify $x $y] {
|
|
114
|
+
*thumb -
|
|
115
|
+
*trough {
|
|
116
|
+
set State(first) [$w fraction $x $y]
|
|
117
|
+
Moveto $w $State(first)
|
|
118
|
+
set State(xPress) $x
|
|
119
|
+
set State(yPress) $y
|
|
120
|
+
}
|
|
121
|
+
default {
|
|
122
|
+
Press $w $x $y
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#
|
|
2
|
+
# sizegrip.tcl,v 1.3 2006/11/05 18:40:48 jenglish Exp
|
|
3
|
+
#
|
|
4
|
+
# Tile widget set -- sizegrip widget bindings.
|
|
5
|
+
#
|
|
6
|
+
# Dragging a sizegrip widget resizes the containing toplevel.
|
|
7
|
+
#
|
|
8
|
+
# NOTE: the sizegrip widget must be in the lower right hand corner.
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
option add *TSizegrip.cursor $::ttk::Cursors(seresize)
|
|
12
|
+
|
|
13
|
+
namespace eval ttk::sizegrip {
|
|
14
|
+
variable State
|
|
15
|
+
array set State {
|
|
16
|
+
pressed 0
|
|
17
|
+
pressX 0
|
|
18
|
+
pressY 0
|
|
19
|
+
width 0
|
|
20
|
+
height 0
|
|
21
|
+
widthInc 1
|
|
22
|
+
heightInc 1
|
|
23
|
+
toplevel {}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
bind TSizegrip <ButtonPress-1> { ttk::sizegrip::Press %W %X %Y }
|
|
28
|
+
bind TSizegrip <B1-Motion> { ttk::sizegrip::Drag %W %X %Y }
|
|
29
|
+
bind TSizegrip <ButtonRelease-1> { ttk::sizegrip::Release %W %X %Y }
|
|
30
|
+
|
|
31
|
+
proc ttk::sizegrip::Press {W X Y} {
|
|
32
|
+
variable State
|
|
33
|
+
|
|
34
|
+
set top [winfo toplevel $W]
|
|
35
|
+
|
|
36
|
+
# Sanity-checks:
|
|
37
|
+
# If a negative X or Y position was specified for [wm geometry],
|
|
38
|
+
# just bail out -- there's no way to handle this cleanly.
|
|
39
|
+
#
|
|
40
|
+
if {[scan [wm geometry $top] "%dx%d+%d+%d" width height _x _y] != 4} {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
# Account for gridded geometry:
|
|
45
|
+
#
|
|
46
|
+
set grid [wm grid $top]
|
|
47
|
+
if {[llength $grid]} {
|
|
48
|
+
set State(widthInc) [lindex $grid 2]
|
|
49
|
+
set State(heightInc) [lindex $grid 3]
|
|
50
|
+
} else {
|
|
51
|
+
set State(widthInc) [set State(heightInc) 1]
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
set State(toplevel) $top
|
|
55
|
+
set State(pressX) $X
|
|
56
|
+
set State(pressY) $Y
|
|
57
|
+
set State(width) $width
|
|
58
|
+
set State(height) $height
|
|
59
|
+
set State(pressed) 1
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
proc ttk::sizegrip::Drag {W X Y} {
|
|
63
|
+
variable State
|
|
64
|
+
if {!$State(pressed)} { return }
|
|
65
|
+
set w [expr {$State(width) + ($X - $State(pressX))/$State(widthInc)}]
|
|
66
|
+
set h [expr {$State(height) + ($Y - $State(pressY))/$State(heightInc)}]
|
|
67
|
+
if {$w <= 0} { set w 1 }
|
|
68
|
+
if {$h <= 0} { set h 1 }
|
|
69
|
+
wm geometry $State(toplevel) ${w}x${h}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
proc ttk::sizegrip::Release {W X Y} {
|
|
73
|
+
variable State
|
|
74
|
+
set State(pressed) 0
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
#*EOF*
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
#
|
|
2
|
+
# tile.tcl,v 1.104 2006/12/13 17:05:25 jenglish Exp
|
|
3
|
+
#
|
|
4
|
+
# Tile widget set initialization script.
|
|
5
|
+
#
|
|
6
|
+
|
|
7
|
+
namespace eval tile {} ;# Old namespace, being phased out
|
|
8
|
+
namespace eval ttk {} ;# New official namespace
|
|
9
|
+
|
|
10
|
+
### Source library scripts.
|
|
11
|
+
#
|
|
12
|
+
|
|
13
|
+
namespace eval tile {
|
|
14
|
+
if {![info exists library]} {
|
|
15
|
+
variable library [file dirname [info script]]
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
source [file join $tile::library keynav.tcl]
|
|
20
|
+
source [file join $tile::library fonts.tcl]
|
|
21
|
+
source [file join $tile::library cursors.tcl]
|
|
22
|
+
source [file join $tile::library icons.tcl]
|
|
23
|
+
source [file join $tile::library utils.tcl]
|
|
24
|
+
|
|
25
|
+
### Deprecated aliases.
|
|
26
|
+
#
|
|
27
|
+
|
|
28
|
+
## ttk::deprecated $old $new --
|
|
29
|
+
# Define $old command as a deprecated alias for $new command
|
|
30
|
+
# $old and $new must be fully namespace-qualified.
|
|
31
|
+
#
|
|
32
|
+
proc ttk::deprecated {old new} {
|
|
33
|
+
interp alias {} $old {} ttk::do'deprecate $old $new
|
|
34
|
+
}
|
|
35
|
+
## do'deprecate --
|
|
36
|
+
# Implementation procedure for deprecated commands --
|
|
37
|
+
# issue a warning (once), then re-alias old to new.
|
|
38
|
+
#
|
|
39
|
+
proc ttk::do'deprecate {old new args} {
|
|
40
|
+
deprecated'warning $old $new
|
|
41
|
+
interp alias {} $old {} $new
|
|
42
|
+
uplevel 1 [linsert $args 0 $new]
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
## deprecated'warning --
|
|
46
|
+
# Gripe about use of deprecated commands.
|
|
47
|
+
#
|
|
48
|
+
proc ttk::deprecated'warning {old new} {
|
|
49
|
+
puts stderr "$old deprecated -- use $new instead"
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
### Backward compatibility:
|
|
53
|
+
#
|
|
54
|
+
|
|
55
|
+
## 0.7.X compatibility: renamed in 0.8.0
|
|
56
|
+
#
|
|
57
|
+
ttk::deprecated ::ttk::paned ::ttk::panedwindow
|
|
58
|
+
ttk::deprecated ::tile::availableThemes ::ttk::themes
|
|
59
|
+
ttk::deprecated ::tile::setTheme ::ttk::setTheme
|
|
60
|
+
#Not yet: ttk::deprecated ::style ::ttk::style
|
|
61
|
+
interp alias {} ::style {} ::ttk::style
|
|
62
|
+
|
|
63
|
+
ttk::deprecated ::tile::defineImage ::ttk::defineImage
|
|
64
|
+
ttk::deprecated ::tile::stockIcon ::ttk::stockIcon
|
|
65
|
+
|
|
66
|
+
ttk::deprecated ::tile::CopyBindings ::ttk::copyBindings
|
|
67
|
+
|
|
68
|
+
### Exported routines:
|
|
69
|
+
#
|
|
70
|
+
namespace eval ttk {
|
|
71
|
+
|
|
72
|
+
namespace export style
|
|
73
|
+
|
|
74
|
+
# All widget constructor commands are exported:
|
|
75
|
+
variable widgets {
|
|
76
|
+
button checkbutton radiobutton menubutton label entry
|
|
77
|
+
frame labelframe scrollbar
|
|
78
|
+
notebook progressbar combobox separator
|
|
79
|
+
panedwindow treeview sizegrip
|
|
80
|
+
scale
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
variable wc
|
|
84
|
+
foreach wc $widgets {
|
|
85
|
+
namespace export $wc
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
### ttk::ThemeChanged --
|
|
90
|
+
# Called from [style theme use].
|
|
91
|
+
# Sends a <<ThemeChanged>> virtual event to all widgets.
|
|
92
|
+
#
|
|
93
|
+
proc ttk::ThemeChanged {} {
|
|
94
|
+
set Q .
|
|
95
|
+
while {[llength $Q]} {
|
|
96
|
+
set QN [list]
|
|
97
|
+
foreach w $Q {
|
|
98
|
+
event generate $w <<ThemeChanged>>
|
|
99
|
+
foreach child [winfo children $w] {
|
|
100
|
+
lappend QN $child
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
set Q $QN
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
### Public API.
|
|
108
|
+
#
|
|
109
|
+
|
|
110
|
+
## ttk::themes --
|
|
111
|
+
# Return list of themes registered in the package database.
|
|
112
|
+
#
|
|
113
|
+
proc ttk::themes {} {
|
|
114
|
+
set themes [list]
|
|
115
|
+
|
|
116
|
+
foreach pkg [lsearch -inline -all -glob [package names] ttk::theme::*] {
|
|
117
|
+
lappend themes [lindex [split $pkg :] end]
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return $themes
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
## ttk::setTheme $theme --
|
|
124
|
+
# Set the current theme to $theme, loading it if necessary.
|
|
125
|
+
#
|
|
126
|
+
proc ttk::setTheme {theme} {
|
|
127
|
+
variable currentTheme
|
|
128
|
+
if {[lsearch [style theme names] $theme] < 0} {
|
|
129
|
+
package require ttk::theme::$theme
|
|
130
|
+
}
|
|
131
|
+
style theme use $theme
|
|
132
|
+
set currentTheme $theme
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
### Load widget bindings.
|
|
136
|
+
#
|
|
137
|
+
source [file join $tile::library button.tcl]
|
|
138
|
+
source [file join $tile::library menubutton.tcl]
|
|
139
|
+
source [file join $tile::library scrollbar.tcl]
|
|
140
|
+
source [file join $tile::library scale.tcl]
|
|
141
|
+
source [file join $tile::library progress.tcl]
|
|
142
|
+
source [file join $tile::library notebook.tcl]
|
|
143
|
+
source [file join $tile::library paned.tcl]
|
|
144
|
+
source [file join $tile::library entry.tcl]
|
|
145
|
+
source [file join $tile::library combobox.tcl] ;# dependency: entry.tcl
|
|
146
|
+
source [file join $tile::library treeview.tcl]
|
|
147
|
+
source [file join $tile::library sizegrip.tcl]
|
|
148
|
+
source [file join $tile::library dialog.tcl]
|
|
149
|
+
|
|
150
|
+
## Label and Labelframe bindings:
|
|
151
|
+
# (not enough to justify their own file...)
|
|
152
|
+
#
|
|
153
|
+
bind TLabelframe <<Invoke>> { ttk::traverseTo [tk_focusNext %W] }
|
|
154
|
+
bind TLabel <<Invoke>> { ttk::traverseTo [tk_focusNext %W] }
|
|
155
|
+
|
|
156
|
+
### Load settings for built-in themes:
|
|
157
|
+
#
|
|
158
|
+
proc ttk::LoadThemes {} {
|
|
159
|
+
variable ::tile::library
|
|
160
|
+
|
|
161
|
+
# "default" always present:
|
|
162
|
+
uplevel #0 [list source [file join $library defaults.tcl]]
|
|
163
|
+
|
|
164
|
+
set builtinThemes [style theme names]
|
|
165
|
+
foreach {theme script} {
|
|
166
|
+
classic classicTheme.tcl
|
|
167
|
+
alt altTheme.tcl
|
|
168
|
+
clam clamTheme.tcl
|
|
169
|
+
winnative winTheme.tcl
|
|
170
|
+
xpnative xpTheme.tcl
|
|
171
|
+
aqua aquaTheme.tcl
|
|
172
|
+
} {
|
|
173
|
+
if {[lsearch -exact $builtinThemes $theme] >= 0} {
|
|
174
|
+
uplevel #0 [list source [file join $library $script]]
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
ttk::LoadThemes; rename ::ttk::LoadThemes {}
|
|
180
|
+
|
|
181
|
+
### Select platform-specific default theme:
|
|
182
|
+
#
|
|
183
|
+
# Notes:
|
|
184
|
+
# + On OSX, aqua theme is the default
|
|
185
|
+
# + On Windows, xpnative takes precedence over winnative if available.
|
|
186
|
+
# + On X11, users can use the X resource database to
|
|
187
|
+
# specify a preferred theme (*TkTheme: themeName);
|
|
188
|
+
# otherwise "default" is used.
|
|
189
|
+
#
|
|
190
|
+
|
|
191
|
+
proc ttk::DefaultTheme {} {
|
|
192
|
+
set preferred [list aqua xpnative winnative]
|
|
193
|
+
|
|
194
|
+
set userTheme [option get . tkTheme TkTheme]
|
|
195
|
+
if {$userTheme != {} && ![catch {
|
|
196
|
+
uplevel #0 [list package require ttk::theme::$userTheme]
|
|
197
|
+
}]} {
|
|
198
|
+
return $userTheme
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
foreach theme $preferred {
|
|
202
|
+
if {[package provide ttk::theme::$theme] != ""} {
|
|
203
|
+
return $theme
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return "default"
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
ttk::setTheme [ttk::DefaultTheme] ; rename ttk::DefaultTheme {}
|
|
210
|
+
|
|
211
|
+
#*EOF*
|