diff options
author | petasis <petasis@f3661a36-4baa-549a-d6c7-40e0ffef350e> | 2009-12-29 19:52:49 (GMT) |
---|---|---|
committer | petasis <petasis@f3661a36-4baa-549a-d6c7-40e0ffef350e> | 2009-12-29 19:52:49 (GMT) |
commit | de6a3dda7195f115bba0f887efced8ec53ee5295 (patch) | |
tree | 183574036385997ad124b77b43c5f4b73e13c13a /library/tkdnd_unix.tcl | |
parent | 840aa5c632239a01f074c01557ea5b927b16e49c (diff) | |
download | tkdnd-de6a3dda7195f115bba0f887efced8ec53ee5295.zip tkdnd-de6a3dda7195f115bba0f887efced8ec53ee5295.tar.gz tkdnd-de6a3dda7195f115bba0f887efced8ec53ee5295.tar.bz2 |
Diffstat (limited to 'library/tkdnd_unix.tcl')
-rw-r--r-- | library/tkdnd_unix.tcl | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/library/tkdnd_unix.tcl b/library/tkdnd_unix.tcl index b44e946..fcc7f27 100644 --- a/library/tkdnd_unix.tcl +++ b/library/tkdnd_unix.tcl @@ -39,6 +39,7 @@ namespace eval xdnd { variable _types {} variable _typelist {} + variable _codelist {} variable _actionlist {} variable _pressedkeys {} variable _action {} @@ -108,6 +109,7 @@ proc xdnd::_HandleXdndPosition { drop_target rootX rootY } { ## Call the <<DropLeave>> event. set cmd [bind $_drop_target <<DropLeave>>] if {[string length $cmd]} { + set _codelist $_typelist set cmd [string map [list %W $_drop_target %X $rootX %Y $rootY \ %CST \{$_common_drag_source_types\} \ %CTT \{$_common_drop_target_types\} \ @@ -116,7 +118,9 @@ proc xdnd::_HandleXdndPosition { drop_target rootX rootY } { %b \{$_pressedkeys\} %m \{$_pressedkeys\} \ %D \{\} %e <<DropLeave>> \ %L \{$_typelist\} %% % \ - %t \{$_typelist\} %T \{\}] $cmd] + %t \{$_typelist\} %T \{[lindex $_common_drag_source_types 0]\} \ + %c \{$_codelist\} %C \{[lindex $_codelist 0]\} \ + ] $cmd] uplevel \#0 $cmd } } @@ -132,6 +136,7 @@ proc xdnd::_HandleXdndPosition { drop_target rootX rootY } { set cmd [bind $drop_target <<DropEnter>>] if {[string length $cmd]} { focus $drop_target + set _codelist $_typelist set cmd [string map [list %W $drop_target %X $rootX %Y $rootY \ %CST \{$_common_drag_source_types\} \ %CTT \{$_common_drop_target_types\} \ @@ -140,7 +145,9 @@ proc xdnd::_HandleXdndPosition { drop_target rootX rootY } { %b \{$_pressedkeys\} %m \{$_pressedkeys\} \ %D \{\} %e <<DropEnter>> \ %L \{$_typelist\} %% % \ - %t \{$_typelist\} %T \{\}] $cmd] + %t \{$_typelist\} %T \{[lindex $_common_drag_source_types 0]\} \ + %c \{$_codelist\} %C \{[lindex $_codelist 0]\} \ + ] $cmd] set _action [uplevel \#0 $cmd] } } @@ -157,6 +164,7 @@ proc xdnd::_HandleXdndPosition { drop_target rootX rootY } { ## Drop target supports at least one type. Send a <<DropPosition>>. set cmd [bind $drop_target <<DropPosition>>] if {[string length $cmd]} { + set _codelist $_typelist set cmd [string map [list %W $drop_target %X $rootX %Y $rootY \ %CST \{$_common_drag_source_types\} \ %CTT \{$_common_drop_target_types\} \ @@ -165,7 +173,9 @@ proc xdnd::_HandleXdndPosition { drop_target rootX rootY } { %b \{$_pressedkeys\} %m \{$_pressedkeys\} \ %D \{\} %e <<DropPosition>> \ %L \{$_typelist\} %% % \ - %t \{$_typelist\} %T \{\}] $cmd] + %t \{$_typelist\} %T \{[lindex $_common_drag_source_types 0]\} \ + %c \{$_codelist\} %C \{[lindex $_codelist 0]\} \ + ] $cmd] set _action [uplevel \#0 $cmd] } } @@ -191,6 +201,7 @@ proc xdnd::_HandleXdndLeave { } { if {[info exists _drop_target] && [string length $_drop_target]} { set cmd [bind $_drop_target <<DropLeave>>] if {[string length $cmd]} { + set _codelist $_typelist set cmd [string map [list %W $_drop_target %X 0 %Y 0 \ %CST \{$_common_drag_source_types\} \ %CTT \{$_common_drop_target_types\} \ @@ -199,7 +210,9 @@ proc xdnd::_HandleXdndLeave { } { %b \{$_pressedkeys\} %m \{$_pressedkeys\} \ %D \{\} %e <<DropLeave>> \ %L \{$_typelist\} %% % \ - %t \{$_typelist\} %T \{\}] $cmd] + %t \{$_typelist\} %T \{[lindex $_common_drag_source_types 0]\} \ + %c \{$_codelist\} %C \{[lindex $_codelist 0]\} \ + ] $cmd] set _action [uplevel \#0 $cmd] } } @@ -242,6 +255,7 @@ proc xdnd::_HandleXdndDrop { time } { set type [_platform_independent_type $type] set cmd [bind $_drop_target <<Drop:$type>>] if {[string length $cmd]} { + set _codelist $_typelist set cmd [string map [list %W $_drop_target %X $rootX %Y $rootY \ %CST \{$_common_drag_source_types\} \ %CTT \{$_common_drop_target_types\} \ @@ -250,12 +264,15 @@ proc xdnd::_HandleXdndDrop { time } { %b \{$_pressedkeys\} %m \{$_pressedkeys\} \ %D \{$data\} %e <<Drop:$type>> \ %L \{$_typelist\} %% % \ - %t \{$_typelist\} %T \{\}] $cmd] + %t \{$_typelist\} %T \{[lindex $_common_drag_source_types 0]\} \ + %c \{$_codelist\} %C \{[lindex $_codelist 0]\} \ + ] $cmd] return [uplevel \#0 $cmd] } } set cmd [bind $_drop_target <<Drop>>] if {[string length $cmd]} { + set _codelist $_typelist set cmd [string map [list %W $_drop_target %X $rootX %Y $rootY \ %CST \{$_common_drag_source_types\} \ %CTT \{$_common_drop_target_types\} \ @@ -264,7 +281,9 @@ proc xdnd::_HandleXdndDrop { time } { %b \{$_pressedkeys\} %m \{$_pressedkeys\} \ %D \{$data\} %e <<Drop>> \ %L \{$_typelist\} %% % \ - %t \{$_typelist\} %T \{\}] $cmd] + %t \{$_typelist\} %T \{[lindex $_common_drag_source_types 0]\} \ + %c \{$_codelist\} %C \{[lindex $_codelist 0]\} \ + ] $cmd] set _action [uplevel \#0 $cmd] } # Return values: XdndActionCopy, XdndActionMove, XdndActionLink, |