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,298 @@
|
|
1
|
+
#
|
2
|
+
# paned.test,v 1.6 2007/11/25 17:17:10 jenglish Exp
|
3
|
+
#
|
4
|
+
|
5
|
+
package require Tk
|
6
|
+
package require tcltest ; namespace import -force tcltest::*
|
7
|
+
loadTestedCommands
|
8
|
+
|
9
|
+
lappend auto_path .
|
10
|
+
package require tile
|
11
|
+
|
12
|
+
proc propagate-geometry {} { update idletasks }
|
13
|
+
|
14
|
+
# Basic sanity checks:
|
15
|
+
#
|
16
|
+
test paned-1.0 "Setup" -body {
|
17
|
+
ttk::panedwindow .pw
|
18
|
+
} -result .pw
|
19
|
+
|
20
|
+
test paned-1.1 "Make sure empty panedwindow doesn't crash" -body {
|
21
|
+
pack .pw -expand true -fill both
|
22
|
+
update
|
23
|
+
}
|
24
|
+
|
25
|
+
test paned-1.2 "Add a pane" -body {
|
26
|
+
.pw add [ttk::frame .pw.f1]
|
27
|
+
winfo manager .pw.f1
|
28
|
+
} -result "panedwindow"
|
29
|
+
|
30
|
+
test paned-1.3 "Steal pane" -body {
|
31
|
+
pack .pw.f1 -side bottom
|
32
|
+
winfo manager .pw.f1
|
33
|
+
} -result "pack"
|
34
|
+
|
35
|
+
test paned-1.4 "Make sure empty panedwindow still doesn't crash" -body {
|
36
|
+
update
|
37
|
+
}
|
38
|
+
|
39
|
+
test paned-1.5 "Remanage pane" -body {
|
40
|
+
#XXX .pw insert 0 .pw.f1
|
41
|
+
.pw add .pw.f1
|
42
|
+
winfo manager .pw.f1
|
43
|
+
} -result "panedwindow"
|
44
|
+
|
45
|
+
test paned-1.6 "Forget pane" -body {
|
46
|
+
.pw forget .pw.f1
|
47
|
+
winfo manager .pw.f1
|
48
|
+
} -result ""
|
49
|
+
|
50
|
+
test paned-1.7 "Make sure empty panedwindow still still doesn't crash" -body {
|
51
|
+
update
|
52
|
+
}
|
53
|
+
|
54
|
+
test paned-1.8 "Re-forget pane" -body {
|
55
|
+
.pw forget .pw.f1
|
56
|
+
} -returnCodes 1 -result ".pw.f1 is not managed by .pw"
|
57
|
+
|
58
|
+
test paned-1.end "Cleanup" -body {
|
59
|
+
destroy .pw
|
60
|
+
}
|
61
|
+
|
62
|
+
# Resize behavior:
|
63
|
+
#
|
64
|
+
test paned-2.1 "..." -body {
|
65
|
+
ttk::panedwindow .pw -orient horizontal
|
66
|
+
|
67
|
+
.pw add [listbox .pw.l1]
|
68
|
+
.pw add [listbox .pw.l2]
|
69
|
+
.pw add [listbox .pw.l3]
|
70
|
+
.pw add [listbox .pw.l4]
|
71
|
+
|
72
|
+
pack .pw -expand true -fill both
|
73
|
+
update
|
74
|
+
set w1 [winfo width .]
|
75
|
+
|
76
|
+
# This should make the window shrink:
|
77
|
+
destroy .pw.l2
|
78
|
+
|
79
|
+
update
|
80
|
+
set w2 [winfo width .]
|
81
|
+
|
82
|
+
expr {$w2 < $w1}
|
83
|
+
} -result 1
|
84
|
+
|
85
|
+
test paned-2.2 "..., cont'd" -body {
|
86
|
+
|
87
|
+
# This should keep the window from shrinking:
|
88
|
+
wm geometry . [wm geometry .]
|
89
|
+
|
90
|
+
set rw2 [winfo reqwidth .pw]
|
91
|
+
|
92
|
+
destroy .pw.l1
|
93
|
+
update
|
94
|
+
|
95
|
+
set w3 [winfo width .]
|
96
|
+
set rw3 [winfo reqwidth .pw]
|
97
|
+
|
98
|
+
expr {$w3 == $w2 && $rw3 < $rw2}
|
99
|
+
# problem: [winfo reqwidth] shrinks, but sashes haven't moved
|
100
|
+
# since we haven't gotten a ConfigureNotify.
|
101
|
+
# How to (a) check for this, and (b) fix it?
|
102
|
+
} -result 1
|
103
|
+
|
104
|
+
test paned-2.3 "..., cont'd" -body {
|
105
|
+
|
106
|
+
.pw add [listbox .pw.l5]
|
107
|
+
update
|
108
|
+
set rw4 [winfo reqwidth .pw]
|
109
|
+
|
110
|
+
expr {$rw4 > $rw3}
|
111
|
+
} -result 1
|
112
|
+
|
113
|
+
test paned-2.end "Cleanup" -body { destroy .pw }
|
114
|
+
|
115
|
+
#
|
116
|
+
# ...
|
117
|
+
#
|
118
|
+
test paned-3.0 "configure pane" -body {
|
119
|
+
ttk::panedwindow .pw
|
120
|
+
.pw add [listbox .pw.lb1]
|
121
|
+
.pw add [listbox .pw.lb2]
|
122
|
+
.pw pane 1 -weight 2
|
123
|
+
.pw pane 1 -weight
|
124
|
+
} -result 2
|
125
|
+
|
126
|
+
test paned-3.1 "configure pane -- errors" -body {
|
127
|
+
.pw pane 1 -weight -4
|
128
|
+
} -returnCodes 1 -match glob -result "-weight must be nonnegative"
|
129
|
+
|
130
|
+
test paned-3.2 "add pane -- errors" -body {
|
131
|
+
.pw add [ttk::label .pw.l] -weight -1
|
132
|
+
} -returnCodes 1 -match glob -result "-weight must be nonnegative"
|
133
|
+
|
134
|
+
|
135
|
+
test paned-3.end "cleanup" -body { destroy .pw }
|
136
|
+
|
137
|
+
|
138
|
+
test paned-4.1 "forget" -body {
|
139
|
+
pack [ttk::panedwindow .pw -orient vertical] -expand true -fill both
|
140
|
+
.pw add [label .pw.l1 -text "L1"]
|
141
|
+
.pw add [label .pw.l2 -text "L2"]
|
142
|
+
.pw add [label .pw.l3 -text "L3"]
|
143
|
+
.pw add [label .pw.l4 -text "L4"]
|
144
|
+
|
145
|
+
update
|
146
|
+
|
147
|
+
.pw forget .pw.l1
|
148
|
+
.pw forget .pw.l2
|
149
|
+
.pw forget .pw.l3
|
150
|
+
.pw forget .pw.l4
|
151
|
+
update
|
152
|
+
}
|
153
|
+
|
154
|
+
test paned-4.2 "forget forgotten" -body {
|
155
|
+
.pw forget .pw.l1
|
156
|
+
} -returnCodes 1 -result ".pw.l1 is not managed by .pw"
|
157
|
+
|
158
|
+
# checkorder $winlist --
|
159
|
+
# Ensure that Y coordinates windows in $winlist are strictly increasing.
|
160
|
+
#
|
161
|
+
proc checkorder {winlist} {
|
162
|
+
set pos -1
|
163
|
+
set positions [list]
|
164
|
+
foreach win $winlist {
|
165
|
+
lappend positions [set nextpos [winfo y $win]]
|
166
|
+
if {$nextpos <= $pos} {
|
167
|
+
error "window $win out of order ($positions)"
|
168
|
+
}
|
169
|
+
set pos $nextpos
|
170
|
+
}
|
171
|
+
}
|
172
|
+
|
173
|
+
test paned-4.3 "insert command" -body {
|
174
|
+
.pw insert end .pw.l1
|
175
|
+
.pw insert end .pw.l3
|
176
|
+
.pw insert 1 .pw.l2
|
177
|
+
.pw insert end .pw.l4
|
178
|
+
|
179
|
+
update;
|
180
|
+
checkorder {.pw.l1 .pw.l2 .pw.l3 .pw.l4}
|
181
|
+
}
|
182
|
+
|
183
|
+
test paned-4.END "cleanup" -body {
|
184
|
+
destroy .pw
|
185
|
+
}
|
186
|
+
|
187
|
+
# See #1292219
|
188
|
+
|
189
|
+
test paned-5.1 "Propagate Map/Unmap state to children" -body {
|
190
|
+
set result [list]
|
191
|
+
pack [ttk::panedwindow .pw]
|
192
|
+
.pw add [ttk::button .pw.b]
|
193
|
+
update
|
194
|
+
|
195
|
+
lappend result [winfo ismapped .pw] [winfo ismapped .pw.b]
|
196
|
+
|
197
|
+
pack forget .pw
|
198
|
+
update
|
199
|
+
lappend result [winfo ismapped .pw] [winfo ismapped .pw.b]
|
200
|
+
|
201
|
+
set result
|
202
|
+
} -result [list 1 1 0 0] -cleanup {
|
203
|
+
destroy .pw
|
204
|
+
}
|
205
|
+
|
206
|
+
### sashpos tests.
|
207
|
+
#
|
208
|
+
proc sashpositions {pw} {
|
209
|
+
set positions [list]
|
210
|
+
set npanes [llength [winfo children $pw]]
|
211
|
+
for {set i 0} {$i < $npanes - 1} {incr i} {
|
212
|
+
lappend positions [$pw sashpos $i]
|
213
|
+
}
|
214
|
+
return $positions
|
215
|
+
}
|
216
|
+
|
217
|
+
test paned-sashpos-setup "Setup for sash position test" -body {
|
218
|
+
ttk::style theme use default
|
219
|
+
ttk::style configure -sashthickness 5
|
220
|
+
|
221
|
+
ttk::panedwindow .pw
|
222
|
+
.pw add [frame .pw.f1 -width 20 -height 20]
|
223
|
+
.pw add [frame .pw.f2 -width 20 -height 20]
|
224
|
+
.pw add [frame .pw.f3 -width 20 -height 20]
|
225
|
+
.pw add [frame .pw.f4 -width 20 -height 20]
|
226
|
+
|
227
|
+
propagate-geometry
|
228
|
+
list [winfo reqwidth .pw] [winfo reqheight .pw]
|
229
|
+
} -result [list 20 [expr {20*4 + 5*3}]]
|
230
|
+
|
231
|
+
test paned-sashpos-attempt-restore "Attempt to set sash positions" -body {
|
232
|
+
# This is not expected to succeed, since .pw isn't large enough yet.
|
233
|
+
#
|
234
|
+
.pw sashpos 0 30
|
235
|
+
.pw sashpos 1 60
|
236
|
+
.pw sashpos 2 90
|
237
|
+
|
238
|
+
list [winfo reqwidth .pw] [winfo reqheight .pw] [sashpositions .pw]
|
239
|
+
} -result [list 20 95 [list 0 5 10]]
|
240
|
+
|
241
|
+
test paned-sashpos-restore "Set height then sash positions" -body {
|
242
|
+
# Setting sash positions after setting -height _should_ succeed.
|
243
|
+
#
|
244
|
+
.pw configure -height 120
|
245
|
+
.pw sashpos 0 30
|
246
|
+
.pw sashpos 1 60
|
247
|
+
.pw sashpos 2 90
|
248
|
+
list [winfo reqwidth .pw] [winfo reqheight .pw] [sashpositions .pw]
|
249
|
+
} -result [list 20 120 [list 30 60 90]]
|
250
|
+
|
251
|
+
test paned-sashpos-cleanup "Clean up" -body { destroy .pw }
|
252
|
+
|
253
|
+
test paned-propagation-setup "Setup." -body {
|
254
|
+
ttk::style theme use default
|
255
|
+
ttk::style configure -sashthickness 5
|
256
|
+
wm geometry . {}
|
257
|
+
ttk::panedwindow .pw -orient vertical
|
258
|
+
|
259
|
+
frame .pw.f1 -width 100 -height 50
|
260
|
+
frame .pw.f2 -width 100 -height 50
|
261
|
+
|
262
|
+
list [winfo reqwidth .pw.f1] [winfo reqheight .pw.f1]
|
263
|
+
} -result [list 100 50]
|
264
|
+
|
265
|
+
test paned-propagation-1 "Initial request size" -body {
|
266
|
+
.pw add .pw.f1
|
267
|
+
.pw add .pw.f2
|
268
|
+
propagate-geometry
|
269
|
+
list [winfo reqwidth .pw] [winfo reqheight .pw]
|
270
|
+
} -result [list 100 105]
|
271
|
+
|
272
|
+
test paned-propagation-2 "Slave change before map" -body {
|
273
|
+
.pw.f1 configure -width 200 -height 100
|
274
|
+
propagate-geometry
|
275
|
+
list [winfo reqwidth .pw] [winfo reqheight .pw]
|
276
|
+
} -result [list 200 155]
|
277
|
+
|
278
|
+
test paned-propagation-3 "Map window" -body {
|
279
|
+
pack .pw -expand true -fill both
|
280
|
+
update
|
281
|
+
list [winfo width .pw] [winfo height .pw] [.pw sashpos 0]
|
282
|
+
} -result [list 200 155 100]
|
283
|
+
|
284
|
+
test paned-propagation-4 "Slave change after map, off-axis" -body {
|
285
|
+
.pw.f1 configure -width 100 ;# should be granted
|
286
|
+
propagate-geometry
|
287
|
+
list [winfo reqwidth .pw] [winfo reqheight .pw] [.pw sashpos 0]
|
288
|
+
} -result [list 100 155 100]
|
289
|
+
|
290
|
+
test paned-propagation-5 "Slave change after map, on-axis" -body {
|
291
|
+
.pw.f1 configure -height 50 ;# should be denied
|
292
|
+
propagate-geometry
|
293
|
+
list [winfo reqwidth .pw] [winfo reqheight .pw] [.pw sashpos 0]
|
294
|
+
} -result [list 100 155 100]
|
295
|
+
|
296
|
+
test paned-propagation-cleanup "Clean up." -body { destroy .pw }
|
297
|
+
|
298
|
+
tcltest::cleanupTests
|
@@ -0,0 +1,92 @@
|
|
1
|
+
#
|
2
|
+
# progress.test,v 1.4 2005/09/12 03:17:48 jenglish Exp
|
3
|
+
#
|
4
|
+
|
5
|
+
package require Tk
|
6
|
+
package require tcltest ; namespace import -force tcltest::*
|
7
|
+
loadTestedCommands
|
8
|
+
|
9
|
+
lappend auto_path .
|
10
|
+
package require tile
|
11
|
+
|
12
|
+
|
13
|
+
test progress-1.1 "Setup" -body {
|
14
|
+
ttk::progressbar .pb
|
15
|
+
} -result .pb
|
16
|
+
|
17
|
+
test progress-1.2 "Linked variable" -body {
|
18
|
+
set PB 50
|
19
|
+
.pb configure -variable PB
|
20
|
+
.pb cget -value
|
21
|
+
} -result 50
|
22
|
+
|
23
|
+
test progress-1.3 "Change linked variable" -body {
|
24
|
+
set PB 80
|
25
|
+
.pb cget -value
|
26
|
+
} -result 80
|
27
|
+
|
28
|
+
test progress-1.4 "Set linked variable to bad value" -body {
|
29
|
+
set PB "bogus"
|
30
|
+
.pb instate invalid
|
31
|
+
} -result 1
|
32
|
+
|
33
|
+
test progress-1.4.1 "Set linked variable back to a good value" -body {
|
34
|
+
set PB 80
|
35
|
+
.pb instate invalid
|
36
|
+
} -result 0
|
37
|
+
|
38
|
+
test progress-1.5 "Set -variable to illegal variable" -body {
|
39
|
+
set BAD "bogus"
|
40
|
+
.pb configure -variable BAD
|
41
|
+
.pb instate invalid
|
42
|
+
} -result 1
|
43
|
+
|
44
|
+
test progress-1.6 "Unset -variable" -body {
|
45
|
+
unset -nocomplain UNSET
|
46
|
+
.pb configure -variable UNSET
|
47
|
+
.pb instate disabled
|
48
|
+
} -result 1
|
49
|
+
|
50
|
+
test progress-2.0 "step command" -body {
|
51
|
+
.pb configure -variable {} ;# @@@
|
52
|
+
.pb configure -value 5 -maximum 10 -mode determinate
|
53
|
+
.pb step
|
54
|
+
.pb cget -value
|
55
|
+
} -result 6.0
|
56
|
+
|
57
|
+
test progress-2.1 "step command, with stepamount" -body {
|
58
|
+
.pb step 3
|
59
|
+
.pb cget -value
|
60
|
+
} -result 9.0
|
61
|
+
|
62
|
+
test progress-2.2 "step wraps at -maximum in determinate mode" -body {
|
63
|
+
.pb step
|
64
|
+
.pb cget -value
|
65
|
+
} -result 0.0
|
66
|
+
|
67
|
+
test progress-2.3 "step doesn't wrap in indeterminate mode" -body {
|
68
|
+
.pb configure -value 8 -maximum 10 -mode indeterminate
|
69
|
+
.pb step
|
70
|
+
.pb step
|
71
|
+
.pb step
|
72
|
+
.pb cget -value
|
73
|
+
} -result 11.0
|
74
|
+
|
75
|
+
test progress-2.4 "step with linked variable" -body {
|
76
|
+
.pb configure -variable PB ;# @@@
|
77
|
+
set PB 5
|
78
|
+
.pb step
|
79
|
+
set PB
|
80
|
+
} -result 6.0
|
81
|
+
|
82
|
+
test progress-2.5 "error in write trace" -body {
|
83
|
+
trace variable PB w { error "YIPES!" ;# }
|
84
|
+
.pb step
|
85
|
+
set PB ;# NOTREACHED
|
86
|
+
} -cleanup { unset PB } -returnCodes 1 -match glob -result "*YIPES!"
|
87
|
+
|
88
|
+
test progress-end "Cleanup" -body {
|
89
|
+
destroy .pb
|
90
|
+
}
|
91
|
+
|
92
|
+
tcltest::cleanupTests
|
@@ -0,0 +1,90 @@
|
|
1
|
+
# [20 Mar 2005] - interactive test for Tile panedwindow widget
|
2
|
+
|
3
|
+
package require tile
|
4
|
+
|
5
|
+
option add *Text.height 10
|
6
|
+
option add *Listbox.height 5
|
7
|
+
option add *Listbox.width 20
|
8
|
+
option add *Panedwindow.opaqueResize 1
|
9
|
+
option add *Panedwindow.OpaqueResize 1
|
10
|
+
|
11
|
+
bind PWTestListbox <ButtonPress-1> {focus %W}
|
12
|
+
bind PWTestListbox <KeyPress-t> { %W configure -height 10 }
|
13
|
+
bind PWTestListbox <KeyPress-s> { %W configure -height 5 }
|
14
|
+
bind PWTestListbox <KeyPress-n> { %W configure -width 20 }
|
15
|
+
bind PWTestListbox <KeyPress-w> { %W configure -width 40 }
|
16
|
+
|
17
|
+
proc pwtest.listbox {w args} {
|
18
|
+
eval [linsert $args 0 listbox $w]
|
19
|
+
bindtags $w [list $w PWTestListbox [winfo class $w] [winfo toplevel $w] all]
|
20
|
+
return $w
|
21
|
+
}
|
22
|
+
|
23
|
+
ttk::panedwindow .pw -orient vertical
|
24
|
+
#panedwindow .pw -opaqueresize true -orient vertical
|
25
|
+
|
26
|
+
#frame .pw
|
27
|
+
#proc .pw-add {win} { pack $win -side top -expand false -fill x }
|
28
|
+
|
29
|
+
.pw add [ttk::frame .pw.f1] -weight 1;#$ -stretch always
|
30
|
+
.pw add [ttk::frame .pw.f2] -weight 1;#$ -stretch always
|
31
|
+
.pw add [set w3 [pwtest.listbox .pw.f3]] -weight 1;#$ -stretch always
|
32
|
+
.pw add [ttk::frame .pw.f4] -weight 1;#$ -stretch always
|
33
|
+
|
34
|
+
pack [set w1 [pwtest.listbox .pw.f1.l]] -expand true -fill both
|
35
|
+
pack [set w2 [pwtest.listbox .pw.f2.l]] -expand true -fill both
|
36
|
+
#X pack [set w3 [pwtest.listbox .pw.f3.l]] -expand true -fill both
|
37
|
+
pack [set w4 [pwtest.listbox .pw.f4.l]] -expand true -fill both
|
38
|
+
|
39
|
+
pack [label .l -textvariable ::element] -side bottom -expand false -fill x
|
40
|
+
pack .pw -expand true -fill both -side top
|
41
|
+
|
42
|
+
bind .pw <Motion> { set ::element "[%W identify %x %y] - %x,%y" }
|
43
|
+
|
44
|
+
bind . <KeyPress-Escape> [list destroy .]
|
45
|
+
#- bind . <KeyPress-h> [list .pw configure -orient horizontal]
|
46
|
+
#- bind . <KeyPress-v> [list .pw configure -orient vertical]
|
47
|
+
|
48
|
+
bind PWTestListbox <KeyPress-f> [list pwtest.forget .pw %W]
|
49
|
+
bind PWTestListbox <KeyPress-r> [list pwtest.remember .pw]
|
50
|
+
|
51
|
+
proc pwtest.forget {pw slave} {
|
52
|
+
global $pw
|
53
|
+
$pw forget $slave
|
54
|
+
lappend $pw $slave
|
55
|
+
}
|
56
|
+
proc pwtest.remember {pw} {
|
57
|
+
global $pw
|
58
|
+
foreach slave [set $pw] {
|
59
|
+
$pw add $slave
|
60
|
+
}
|
61
|
+
set $pw [list]
|
62
|
+
}
|
63
|
+
|
64
|
+
foreach w [list $w1 $w2 $w3] {
|
65
|
+
foreach string {abc def ghi jkl mno pqr stu vwx yz} {
|
66
|
+
$w insert end $string
|
67
|
+
}
|
68
|
+
}
|
69
|
+
|
70
|
+
proc pwtest.save-config {pw} {
|
71
|
+
update idletasks;
|
72
|
+
lappend config [winfo width $pw] [winfo height $pw]
|
73
|
+
set i -1;
|
74
|
+
foreach _ [lrange [$pw panes] 1 end] {
|
75
|
+
lappend config [$pw sashpos [incr i]]
|
76
|
+
}
|
77
|
+
return $config
|
78
|
+
}
|
79
|
+
|
80
|
+
proc pwtest.restore-config {pw config} {
|
81
|
+
$pw configure -width [lindex $config 0] -height [lindex $config 1]
|
82
|
+
set i -1
|
83
|
+
foreach sashpos [lrange $config 2 end] {
|
84
|
+
$pw sashpos [incr i] $sashpos
|
85
|
+
}
|
86
|
+
}
|
87
|
+
|
88
|
+
bind all <Control-KeyPress-s> { set ::A [pwtest.save-config .pw] }
|
89
|
+
bind all <Control-KeyPress-r> { pwtest.restore-config .pw $::A }
|
90
|
+
|