hi all,
the diff below (against 0.36) patches Tab/Shift-Tab behaviour:
. clears the actual binding for shift-tab
. restores the bindings in iemgui_dialog window (the same could be done in other dialogs, but let this patch be tested by others first).
Also included are the two fixes previously reported:
. tcl/tk 8.4 map event fix
. mozilla/netscape fix
Krzysztof
--- ../src/u_main.tk 2002-11-28 06:58:14.000000000 +0100 +++ pd.tk 2003-06-07 15:07:00.000000000 +0200 @@ -34,7 +34,7 @@ # "text" dialogs below. Also we have to get rid of tab's changing the focus.
bind all <Key-Tab> "" -bind all <Shift-Key-Tab> "" +bind all <<PrevWindow>> "" bind Text <Control-t> {} bind Text <Control-s> {} # puts stderr [bind all] @@ -234,6 +234,7 @@
proc menu_documentation {} { global help_directory + global pd_nt
set filename [tk_getOpenFile -defaultextension .pd \ -filetypes { {{documentation} {.pd .txt .htm}} } \ @@ -831,7 +832,7 @@ bind $name.c <KeyRelease> {pdtk_canvas_keyup %W %K %A} bind $name.c <Motion> {pdtk_canvas_motion %W %x %y 0} bind $name.c <Alt-Motion> {pdtk_canvas_motion %W %x %y 4} - bind $name.c <Map> {pdtk_canvas_map %W %s} + bind $name.c <Map> {pdtk_canvas_map %W 0} # bind $name.c <Unmap> {puts stderr map} focus $name.c # puts stderr "all done" @@ -2187,6 +2188,14 @@ label $id.space5 -text "" pack $id.space5 -side top
+ if {[info tclversion] < 8.4} { + bind $id <Key-Tab> {tkTabToWindow [tk_focusNext %W]} + bind $id <<PrevWindow>> {tkTabToWindow [tk_focusPrev %W]} + } else { + bind $id <Key-Tab> {tk::TabToWindow [tk_focusNext %W]} + bind $id <<PrevWindow>> {tk::TabToWindow [tk_focusPrev %W]} + } + bind $id.dim.w_ent <KeyPress-Return> [concat iemgui_ok $id] bind $id.dim.h_ent <KeyPress-Return> [concat iemgui_ok $id]
another variant of the same (the rtt was 30 min, btw...):
--- ../src/u_main.tk 2002-11-28 06:58:14.000000000 +0100 +++ pd.tk 2003-06-07 15:31:34.000000000 +0200 @@ -33,8 +33,11 @@ # for Text objects to get control-s and control-t to do what we want for # "text" dialogs below. Also we have to get rid of tab's changing the focus.
+namespace eval pdtk {set tab_binding [bind all <Key-Tab>]} +namespace eval pdtk {set shifttab_binding [bind all <<PrevWindow>>]} + bind all <Key-Tab> "" -bind all <Shift-Key-Tab> "" +bind all <<PrevWindow>> "" bind Text <Control-t> {} bind Text <Control-s> {} # puts stderr [bind all] @@ -234,6 +237,7 @@
proc menu_documentation {} { global help_directory + global pd_nt
set filename [tk_getOpenFile -defaultextension .pd \ -filetypes { {{documentation} {.pd .txt .htm}} } \ @@ -831,7 +835,7 @@ bind $name.c <KeyRelease> {pdtk_canvas_keyup %W %K %A} bind $name.c <Motion> {pdtk_canvas_motion %W %x %y 0} bind $name.c <Alt-Motion> {pdtk_canvas_motion %W %x %y 4} - bind $name.c <Map> {pdtk_canvas_map %W %s} + bind $name.c <Map> {pdtk_canvas_map %W 0} # bind $name.c <Unmap> {puts stderr map} focus $name.c # puts stderr "all done" @@ -2187,6 +2191,9 @@ label $id.space5 -text "" pack $id.space5 -side top
+ bind $id <Key-Tab> $pdtk::tab_binding + bind $id <<PrevWindow>> $pdtk::shifttab_binding + bind $id.dim.w_ent <KeyPress-Return> [concat iemgui_ok $id] bind $id.dim.h_ent <KeyPress-Return> [concat iemgui_ok $id]
Zowee, it works...
thanks Miller
On Sat, Jun 07, 2003 at 04:03:39PM +0200, Krzysztof Czaja wrote:
another variant of the same (the rtt was 30 min, btw...):
--- ../src/u_main.tk 2002-11-28 06:58:14.000000000 +0100 +++ pd.tk 2003-06-07 15:31:34.000000000 +0200 @@ -33,8 +33,11 @@ # for Text objects to get control-s and control-t to do what we want for # "text" dialogs below. Also we have to get rid of tab's changing the focus.
+namespace eval pdtk {set tab_binding [bind all <Key-Tab>]} +namespace eval pdtk {set shifttab_binding [bind all <<PrevWindow>>]}
- bind all <Key-Tab> ""
-bind all <Shift-Key-Tab> "" +bind all <<PrevWindow>> "" bind Text <Control-t> {} bind Text <Control-s> {} # puts stderr [bind all] @@ -234,6 +237,7 @@
proc menu_documentation {} { global help_directory
global pd_nt
set filename [tk_getOpenFile -defaultextension .pd \ -filetypes { {{documentation} {.pd .txt .htm}} } \
@@ -831,7 +835,7 @@ bind $name.c <KeyRelease> {pdtk_canvas_keyup %W %K %A} bind $name.c <Motion> {pdtk_canvas_motion %W %x %y 0} bind $name.c <Alt-Motion> {pdtk_canvas_motion %W %x %y 4}
- bind $name.c <Map> {pdtk_canvas_map %W %s}
- bind $name.c <Map> {pdtk_canvas_map %W 0} # bind $name.c <Unmap> {puts stderr map} focus $name.c # puts stderr "all done"
@@ -2187,6 +2191,9 @@ label $id.space5 -text "" pack $id.space5 -side top
- bind $id <Key-Tab> $pdtk::tab_binding
- bind $id <<PrevWindow>> $pdtk::shifttab_binding
bind $id.dim.w_ent <KeyPress-Return> [concat iemgui_ok $id] bind $id.dim.h_ent <KeyPress-Return> [concat iemgui_ok $id]
PD-dev mailing list PD-dev@iem.kug.ac.at http://iem.kug.ac.at/cgi-bin/mailman/listinfo/pd-dev