File: idnd.tcl

package info (click to toggle)
blt 3.0~1%2B08570046%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 45,556 kB
  • sloc: ansic: 278,852; tcl: 96,434; sh: 3,410; makefile: 2,026; cpp: 374
file content (33 lines) | stat: -rw-r--r-- 744 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

proc ContinueColumnMove { tv x1 y1 x2 y2 } {
  set col [$tv column find $x1 $y1 $x2 $y2]
  set token [.dnd cget -token]
  if  { $col == $token } {
    return "-1"
  }
  if { $col == -1 } {
    $tv column move deactivate $token
  } else {
    $tv column move activate $token $col
  }
  return $col
}

proc FinishColumnMove { tv colName } {
  set col [$tv column index $colName]
  if { $col == -1 } {
    $tv column move cancel $token
    .dnd cancel 
  } else {
    $tv column move finish $token $col
    .dnd forget 
  }
}

proc StartColumnMove { tv column } {
  blt::dnd .dnd -icon $icon -image $image \
      -motioncommand [list ContinueColumnMove $tv] \
      -dropcommand [list FinishColumnMove $tv] \
      -token $column
  .dnd start
}