From bfb359fd22e61faaca3a6e49ad3b7a81f2d71551 Mon Sep 17 00:00:00 2001 From: "N.N." Date: Thu, 27 Jan 2005 14:42:55 +0000 Subject: cyclone alpha52 and toxy alpha15 (see notes.txt for cyclone, toxy and shared) svn path=/trunk/externals/miXed/; revision=2550 --- test/toxy/kb.wid | 3 --- test/toxy/multiscale.wid | 6 +----- test/toxy/setup.wid | 49 ++++++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 46 insertions(+), 12 deletions(-) (limited to 'test/toxy') diff --git a/test/toxy/kb.wid b/test/toxy/kb.wid index 901db15..b3bd051 100644 --- a/test/toxy/kb.wid +++ b/test/toxy/kb.wid @@ -208,9 +208,6 @@ proc ::toxy::kbset {path target remote args} { ::toxy::kb .- .| . .#oct .#size -# undo the "bind Canvas <1> {+focus %W}" from the setup.wid -bind .- {focus .^.c} - #@ new set ::toxy::kbchord(.|) {} diff --git a/test/toxy/multiscale.wid b/test/toxy/multiscale.wid index bff9c4f..063146b 100644 --- a/test/toxy/multiscale.wid +++ b/test/toxy/multiscale.wid @@ -35,8 +35,7 @@ proc ::toxy::multiscale {path cvpath target remote count lo hi res dx dy bg} { } set id [$path create window $px $py -width $dx -height $dy \ -anchor nw -window $path.s$ndx -tags $path.s$ndx] -# ::toxy::master $path.s$ndx $path $cvpath $target - ::toxy::master $path.s$ndx $cvpath $target + ::toxy::subwidget $path.s$ndx $path $cvpath $target incr px $dx } } @@ -51,6 +50,3 @@ proc ::toxy::multiscale {path cvpath target remote count lo hi res dx dy bg} { #. @list ::toxy::multiscale_list .- .#n .#2 .#1 ::toxy::multiscale .- .^.c .| . .#n .#lo .#hi .#res .#dx .#dy .#bg - -# undo the "bind Canvas <1> {+focus %W}" from the setup.wid -bind .- {focus .^.c} diff --git a/test/toxy/setup.wid b/test/toxy/setup.wid index 98fe7fb..1d544c9 100644 --- a/test/toxy/setup.wid +++ b/test/toxy/setup.wid @@ -1,4 +1,4 @@ -package provide toxywidgets 0.1.0.14 +package provide toxywidgets 0.1.0.15 # LATER keep standard widget setup in a .tcl file (transfered into a .wiq), and # glue separate .wid files with standard widget definitions into another .wiq @@ -81,8 +81,15 @@ proc ::toxy::item_destroy {path varname} { } proc ::toxy::item_getconfig {path target} { - pd $target.rp _config $target.rp [$path cget -bg] \ - [winfo reqwidth $path] [winfo reqheight $path] \ + set wd [winfo reqwidth $path] + set ht [winfo reqheight $path] + if {$wd < 2 || $ht < 2} { +# LATER rethink + update idletasks + set wd [winfo width $path] + set ht [winfo height $path] + } + pd $target.rp _config $target.rp [$path cget -bg] $wd $ht \ [catch {$path config -state normal}]\; } @@ -185,7 +192,6 @@ proc ::toxy::master_motion {target cvpath x y} { } proc ::toxy::master {path cvpath target} { -# FIXME subitem handling in megawidgets bind $path "::toxy::master_release $target $cvpath %X %Y %b" bind $path <1> "::toxy::item_click $target $cvpath %X %Y %b 0" bind $path "::toxy::item_click $target $cvpath %X %Y %b 1" @@ -202,6 +208,41 @@ proc ::toxy::master {path cvpath target} { bind $path "::toxy::master_motion $target $cvpath %X %Y" bind $path "::toxy::item_inout $target 1" bind $path "::toxy::item_inout $target 0" + + if {[catch {$path config -state normal}] == 0} { + bind $path <> "$path config -state disabled" + bind $path <> "$path config -state normal" + } + + if {[winfo class $path] == "Canvas"} { +# undo the "bind Canvas <1> {+focus %W}" from above + bind $path "focus $cvpath" + } +} + +# to be called explicitly from type initializer, LATER rethink +proc ::toxy::subwidget {path parent cvpath target} { + bind $path "::toxy::master_release $target $cvpath %X %Y %b" + bind $path <1> "::toxy::item_click $target $cvpath %X %Y %b 0" + bind $path "::toxy::item_click $target $cvpath %X %Y %b 1" + bind $path "::toxy::item_click $target $cvpath %X %Y %b 2" + bind $path "::toxy::item_click $target $cvpath %X %Y %b 3" + bind $path "::toxy::item_click $target $cvpath %X %Y %b 4" + bind $path "::toxy::item_click $target $cvpath %X %Y %b 5" + bind $path "::toxy::item_click $target $cvpath %X %Y %b 6" + bind $path \ + "::toxy::item_click $target $cvpath %X %Y %b 7" + bind $path <3> "::toxy::item_click $target $cvpath %X %Y %b 8" + + bind $path "::toxy::master_motion $target $cvpath %X %Y" + bind $path "::toxy::master_motion $target $cvpath %X %Y" + bind $path "::toxy::item_inout $target 1" + bind $path "::toxy::item_inout $target 0" + + if {[catch {$path config -state normal}] == 0} { + bind $parent <> "+$path config -state disabled" + bind $parent <> "+$path config -state normal" + } } # standard widget types, LATER move to separate .wid files -- cgit v1.2.1