@@ -60,11 +60,14 @@ namespace eval xdnd {
6060# ----------------------------------------------------------------------------
6161# Command xdnd::HandleXdndEnter
6262# ----------------------------------------------------------------------------
63- proc xdnd::HandleXdndEnter { path drag_source typelist { data {} } } {
63+ proc xdnd::HandleXdndEnter { path drag_source typelist time { data {} } } {
6464 variable _pressedkeys
6565 variable _actionlist
66+ variable _typelist
6667 set _pressedkeys 1
6768 set _actionlist { copy move link ask private }
69+ set _typelist $typelist
70+ # puts "xdnd::HandleXdndEnter: $time"
6871 ::tkdnd::generic::SetDroppedData $data
6972 ::tkdnd::generic::HandleEnter $path $drag_source $typelist $typelist \
7073 $_actionlist $_pressedkeys
@@ -73,10 +76,16 @@ proc xdnd::HandleXdndEnter { path drag_source typelist { data {} } } {
7376# ----------------------------------------------------------------------------
7477# Command xdnd::HandleXdndPosition
7578# ----------------------------------------------------------------------------
76- proc xdnd::HandleXdndPosition { drop_target rootX rootY {drag_source {}} } {
79+ proc xdnd::HandleXdndPosition { drop_target rootX rootY time {drag_source {}} } {
7780 variable _pressedkeys
81+ variable _typelist
7882 variable _last_mouse_root_x; set _last_mouse_root_x $rootX
7983 variable _last_mouse_root_y; set _last_mouse_root_y $rootY
84+ # puts "xdnd::HandleXdndPosition: $time"
85+ # # Get the dropped data...
86+ catch {
87+ ::tkdnd::generic::SetDroppedData [GetPositionData $drop_target $_typelist $time ]
88+ }
8089 ::tkdnd::generic::HandlePosition $drop_target $drag_source \
8190 $_pressedkeys $rootX $rootY
8291};# xdnd::HandleXdndPosition
@@ -96,18 +105,27 @@ proc xdnd::HandleXdndDrop { time } {
96105 variable _last_mouse_root_x
97106 variable _last_mouse_root_y
98107 # # Get the dropped data...
99- ::tkdnd::generic::SetDroppedData [GetDroppedData $time ]
108+ ::tkdnd::generic::SetDroppedData [GetDroppedData \
109+ [::tkdnd::generic::GetDragSource] [::tkdnd::generic::GetDropTarget] \
110+ [::tkdnd::generic::GetDragSourceCommonTypes] $time ]
100111 ::tkdnd::generic::HandleDrop {} {} $_pressedkeys \
101112 $_last_mouse_root_x $_last_mouse_root_y $time
102113};# xdnd::HandleXdndDrop
103114
104115# ----------------------------------------------------------------------------
105- # Command xdnd::_GetDroppedData
116+ # Command xdnd::GetPositionData
117+ # ----------------------------------------------------------------------------
118+ proc xdnd::GetPositionData { drop_target typelist time } {
119+ foreach {drop_target common_drag_source_types common_drop_target_types} \
120+ [::tkdnd::generic::FindWindowWithCommonTypes $drop_target $typelist ] {break }
121+ GetDroppedData [::tkdnd::generic::GetDragSource] $drop_target \
122+ $common_drag_source_types $time
123+ };# xdnd::GetPositionData
124+
125+ # ----------------------------------------------------------------------------
126+ # Command xdnd::GetDroppedData
106127# ----------------------------------------------------------------------------
107- proc xdnd::GetDroppedData { time } {
108- set _drag_source [::tkdnd::generic::GetDragSource]
109- set _drop_target [::tkdnd::generic::GetDropTarget]
110- set _common_drag_source_types [::tkdnd::generic::GetDragSourceCommonTypes]
128+ proc xdnd::GetDroppedData { _drag_source _drop_target _common_drag_source_types time } {
111129 if {![llength $_common_drag_source_types ]} {
112130 error " no common data types between the drag source and drop target widgets"
113131 }
0 commit comments