summaryrefslogtreecommitdiffstats
path: root/library/tkdnd_windows.tcl
diff options
context:
space:
mode:
authorpetasis <petasis@f3661a36-4baa-549a-d6c7-40e0ffef350e>2012-11-27 18:52:35 (GMT)
committerpetasis <petasis@f3661a36-4baa-549a-d6c7-40e0ffef350e>2012-11-27 18:52:35 (GMT)
commit9dfeac405ca61c25ea88efba2be219a4acea295d (patch)
treec39576d2ea35fc020d5f37438510928fdab69f02 /library/tkdnd_windows.tcl
parent4035a38e552ebb50a78905de531a47ff4f9ea1e7 (diff)
downloadtkdnd-9dfeac405ca61c25ea88efba2be219a4acea295d.zip
tkdnd-9dfeac405ca61c25ea88efba2be219a4acea295d.tar.gz
tkdnd-9dfeac405ca61c25ea88efba2be219a4acea295d.tar.bz2
XDND: %X & %Y for drop events
Diffstat (limited to 'library/tkdnd_windows.tcl')
-rw-r--r--library/tkdnd_windows.tcl17
1 files changed, 16 insertions, 1 deletions
diff --git a/library/tkdnd_windows.tcl b/library/tkdnd_windows.tcl
index 32b0187..d839216 100644
--- a/library/tkdnd_windows.tcl
+++ b/library/tkdnd_windows.tcl
@@ -46,6 +46,9 @@ namespace eval olednd {
variable _common_drag_source_types {}
variable _common_drop_target_types {}
variable _unhandled_types {}
+
+ variable _last_mouse_root_x 0
+ variable _last_mouse_root_y 0
};# namespace olednd
# ----------------------------------------------------------------------------
@@ -60,6 +63,10 @@ proc olednd::_HandleDragEnter { drop_target typelist actionlist pressedkeys
variable _action; set _action {}
variable _common_drag_source_types; set _common_drag_source_types {}
variable _common_drop_target_types; set _common_drop_target_types {}
+
+ variable _last_mouse_root_x; set _last_mouse_root_x $rootX
+ variable _last_mouse_root_y; set _last_mouse_root_y $rootY
+
# puts "olednd::_HandleDragEnter: drop_target=$drop_target,\
# typelist=$typelist, actionlist=$actionlist,\
# pressedkeys=$pressedkeys, rootX=$rootX, rootY=$rootY"
@@ -119,6 +126,10 @@ proc olednd::_HandleDragOver { drop_target pressedkeys rootX rootY } {
variable _action
variable _common_drag_source_types
variable _common_drop_target_types
+
+ variable _last_mouse_root_x; set _last_mouse_root_x $rootX
+ variable _last_mouse_root_y; set _last_mouse_root_y $rootY
+
# puts "olednd::_HandleDragOver: drop_target=$drop_target,\
# pressedkeys=$pressedkeys, rootX=$rootX, rootY=$rootY"
@@ -156,6 +167,9 @@ proc olednd::_HandleDragLeave { drop_target } {
variable _action
variable _common_drag_source_types
variable _common_drop_target_types
+ variable _last_mouse_root_x
+ variable _last_mouse_root_y
+
if {![llength $_common_drag_source_types]} {return}
foreach var {_types _typelist _actionlist _pressedkeys _action
_common_drag_source_types _common_drop_target_types} {
@@ -164,7 +178,8 @@ proc olednd::_HandleDragLeave { drop_target } {
set cmd [bind $drop_target <<DropLeave>>]
if {[string length $cmd]} {
- set cmd [string map [list %W $drop_target %X 0 %Y 0 \
+ set cmd [string map [list %W $drop_target \
+ %X $_last_mouse_root_x %Y $_last_mouse_root_y \
%CST \{$_common_drag_source_types\} \
%CTT \{$_common_drop_target_types\} \
%ST \{$_typelist\} %TT \{$_types\} \