4 # ----------------------------------------------------------------------
5 # Bindings for the BLT drag&drop command
6 # ----------------------------------------------------------------------
7 # AUTHOR: George Howlett
8 # Bell Labs Innovations for Lucent Technologies
10 # http://www.tcltk.com/blt
11 # ----------------------------------------------------------------------
12 # Copyright (c) 1998 Lucent Technologies, Inc.
13 # ======================================================================
15 # Permission to use, copy, modify, and distribute this software and its
16 # documentation for any purpose and without fee is hereby granted,
17 # provided that the above copyright notice appear in all copies and that
18 # both that the copyright notice and warranty disclaimer appear in
19 # supporting documentation, and that the names of Lucent Technologies
20 # any of their entities not be used in advertising or publicity
21 # pertaining to distribution of the software without specific, written
24 # Lucent Technologies disclaims all warranties with regard to this
25 # software, including all implied warranties of merchantability and
26 # fitness. In no event shall Lucent be liable for any special, indirect
27 # or consequential damages or any damages whatsoever resulting from loss
28 # of use, data or profits, whether in an action of contract, negligence
29 # or other tortuous action, arising out of or in connection with the use
30 # or performance of this software.
32 # ======================================================================
34 if { $tcl_version >= 8.0 } {
39 for { set i 1 } { $i <= 5 } { incr i } {
40 bind BltDndButton$i <ButtonPress-$i> [list $cmd select %W %X %Y %t]
41 bind BltDndButton$i <B$i-Motion> [list $cmd drag %W %X %Y]
42 bind BltDndButton$i <ButtonRelease-$i> [list $cmd drop %W %X %Y]
45 # ----------------------------------------------------------------------
49 # Invoked from C whenever a new drag&drop source is created.
50 # Sets up the default bindings for the drag&drop source.
52 # <ButtonPress-?> Starts the drag operation.
53 # <B?-Motion> Updates the drag.
54 # <ButtonRelease-?> Drop the data on the target.
57 # widget source widget
58 # button Mouse button used to activate drag.
59 # cmd "dragdrop" or "blt::dragdrop"
61 # ----------------------------------------------------------------------
63 proc blt::DndInit { widget button } {
66 lappend tagList BltDndButton$button
68 foreach tag [bindtags $widget] {
69 if { ![string match BltDndButton* $tag] } {
73 bindtags $widget $tagList
76 proc blt::DndStdDrop { widget args } {
78 set fmt [lindex $info(formats) 0]
83 proc blt::PrintInfo { array } {
87 if { $info(state) & 0x01 } {
90 if { $info(state) & 0x02 } {
93 if { $info(state) & 0x04 } {
96 if { $info(state) & 0x08 } {
99 if { $info(state) & 0x10 } {