@@ -60,11 +60,14 @@ namespace eval xdnd {
60
60
# ----------------------------------------------------------------------------
61
61
# Command xdnd::HandleXdndEnter
62
62
# ----------------------------------------------------------------------------
63
- proc xdnd::HandleXdndEnter { path drag_source typelist { data {} } } {
63
+ proc xdnd::HandleXdndEnter { path drag_source typelist time { data {} } } {
64
64
variable _pressedkeys
65
65
variable _actionlist
66
+ variable _typelist
66
67
set _pressedkeys 1
67
68
set _actionlist { copy move link ask private }
69
+ set _typelist $typelist
70
+ # puts "xdnd::HandleXdndEnter: $time"
68
71
::tkdnd::generic::SetDroppedData $data
69
72
::tkdnd::generic::HandleEnter $path $drag_source $typelist $typelist \
70
73
$_actionlist $_pressedkeys
@@ -73,10 +76,16 @@ proc xdnd::HandleXdndEnter { path drag_source typelist { data {} } } {
73
76
# ----------------------------------------------------------------------------
74
77
# Command xdnd::HandleXdndPosition
75
78
# ----------------------------------------------------------------------------
76
- proc xdnd::HandleXdndPosition { drop_target rootX rootY {drag_source {}} } {
79
+ proc xdnd::HandleXdndPosition { drop_target rootX rootY time {drag_source {}} } {
77
80
variable _pressedkeys
81
+ variable _typelist
78
82
variable _last_mouse_root_x; set _last_mouse_root_x $rootX
79
83
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
+ }
80
89
::tkdnd::generic::HandlePosition $drop_target $drag_source \
81
90
$_pressedkeys $rootX $rootY
82
91
};# xdnd::HandleXdndPosition
@@ -96,18 +105,27 @@ proc xdnd::HandleXdndDrop { time } {
96
105
variable _last_mouse_root_x
97
106
variable _last_mouse_root_y
98
107
# # 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 ]
100
111
::tkdnd::generic::HandleDrop {} {} $_pressedkeys \
101
112
$_last_mouse_root_x $_last_mouse_root_y $time
102
113
};# xdnd::HandleXdndDrop
103
114
104
115
# ----------------------------------------------------------------------------
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
106
127
# ----------------------------------------------------------------------------
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 } {
111
129
if {![llength $_common_drag_source_types ]} {
112
130
error " no common data types between the drag source and drop target widgets"
113
131
}
0 commit comments