summaryrefslogtreecommitdiffstats
path: root/tests/ttk
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@noemail.net>2009-05-14 00:53:03 (GMT)
committerpatthoyts <patthoyts@noemail.net>2009-05-14 00:53:03 (GMT)
commitad51098537494d7106d448a7bd31d00a1bb2938e (patch)
treece1858139a85cb202f0ab4ed0983c33143debec5 /tests/ttk
parent85267696387aab7d33c59ce7399d421c42042ec0 (diff)
downloadtk-ad51098537494d7106d448a7bd31d00a1bb2938e.zip
tk-ad51098537494d7106d448a7bd31d00a1bb2938e.tar.gz
tk-ad51098537494d7106d448a7bd31d00a1bb2938e.tar.bz2
Backported support for the Vista theme.
This requires the vsapi element engine, the hover state and the theme script definition. FossilOrigin-Name: 90871e2c7b40dd873cc2394fb2fab60c8809fdc6
Diffstat (limited to 'tests/ttk')
-rw-r--r--tests/ttk/vsapi.test48
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/ttk/vsapi.test b/tests/ttk/vsapi.test
new file mode 100644
index 0000000..7000e3e
--- /dev/null
+++ b/tests/ttk/vsapi.test
@@ -0,0 +1,48 @@
+# -*- tcl -*-
+# $Id: vsapi.test,v 1.1.2.2 2009/05/14 00:53:04 patthoyts Exp $
+#
+
+package require Tk 8.5
+package require tcltest ; namespace import -force tcltest::*
+loadTestedCommands
+
+testConstraint xpnative \
+ [expr {[lsearch -exact [ttk::style theme names] xpnative] != -1}]
+
+test vsapi-1.1 "WINDOW WP_SMALLCLOSEBUTTON" -constraints {xpnative} -body {
+ ttk::style element create smallclose vsapi \
+ WINDOW 19 {disabled 4 pressed 3 active 2 {} 1}
+ ttk::style layout CloseButton {CloseButton.smallclose -sticky news}
+ ttk::button .b -style CloseButton
+ pack .b -expand true -fill both
+ list [winfo reqwidth .b] [winfo reqheight .b]
+} -cleanup { destroy .b } -result [list 13 13]
+
+test vsapi-1.2 "EXPLORERBAR EBP_HEADERPIN" -constraints {xpnative} -body {
+ ttk::style element create pin vsapi \
+ EXPLORERBAR 3 {
+ {pressed !selected} 3
+ {active !selected} 2
+ {pressed selected} 6
+ {active selected} 5
+ {selected} 4
+ {} 1
+ }
+ ttk::style layout Explorer.Pin {Explorer.Pin.pin -sticky news}
+ ttk::checkbutton .pin -style Explorer.Pin
+ pack .pin -expand true -fill both
+ list [winfo reqwidth .pin] [winfo reqheight .pin]
+} -cleanup { destroy .pin } -result [list 16 16]
+
+test vsapi-1.3 "EXPLORERBAR EBP_HEADERCLOSE" -constraints {xpnative} -body {
+ ttk::style element create headerclose vsapi \
+ EXPLORERBAR 2 {pressed 3 active 2 {} 1}
+ ttk::style layout Explorer.CloseButton {
+ Explorer.CloseButton.headerclose -sticky news
+ }
+ ttk::button .b -style Explorer.CloseButton
+ pack .b -expand true -fill both
+ list [winfo reqwidth .b] [winfo reqheight .b]
+} -cleanup { destroy .b } -result [list 16 16]
+
+tcltest::cleanupTests