diff options
author | treectrl <treectrl> | 2006-10-27 22:52:30 (GMT) |
---|---|---|
committer | treectrl <treectrl> | 2006-10-27 22:52:30 (GMT) |
commit | f92154d570a77f79d2ab1570879799f41062bd35 (patch) | |
tree | 0e038d82dd81ec8f5f3c4cc0d5d1c72c5c31129c | |
parent | 1da771a67bdf3ebb1b1b5bf4a8eaec2882caa9f6 (diff) | |
download | tktreectrl-f92154d570a77f79d2ab1570879799f41062bd35.zip tktreectrl-f92154d570a77f79d2ab1570879799f41062bd35.tar.gz tktreectrl-f92154d570a77f79d2ab1570879799f41062bd35.tar.bz2 |
Tweaked column drag-and-drop behaviour: when the pointer is over a column adjacent to the dragged column a drop is indicated without having to move the cursor to the left or right half of the adjacent column.
-rw-r--r-- | library/treectrl.tcl | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/library/treectrl.tcl b/library/treectrl.tcl index 2cf21ff..dd731dc 100644 --- a/library/treectrl.tcl +++ b/library/treectrl.tcl @@ -1,4 +1,4 @@ -# RCS: @(#) $Id: treectrl.tcl,v 1.29 2006/10/26 03:04:16 treectrl Exp $ +# RCS: @(#) $Id: treectrl.tcl,v 1.30 2006/10/27 22:52:30 treectrl Exp $ bind TreeCtrl <Motion> { TreeCtrl::CursorCheck %W %x %y @@ -228,6 +228,7 @@ proc ::TreeCtrl::ColumnCanResizeLeft {w column} { # Arguments: # w The treectrl widget. # column The column. +# before The column to place 'column' before. proc ::TreeCtrl::ColumnCanMoveHere {w column before} { if {[$w column compare $column == $before] || @@ -606,8 +607,15 @@ proc ::TreeCtrl::Motion1 {w x y} { if {[lindex $id 0] eq "header"} { set column [lindex $id 1] set before $column + set prev [$w column id "$Priv(column) prev visible"] + set next [$w column id "$Priv(column) next visible"] if {[$w column compare $column == "tail"]} { set side left + } elseif {$prev ne "" && [$w column compare $prev == $column]} { + set side left + } elseif {$next ne "" && [$w column compare $next == $column]} { + set before [$w column id "$column next visible"] + set side right } else { scan [$w column bbox $column] "%d %d %d %d" x1 y1 x2 y2 if {$x < $x1 + ($x2 - $x1) / 2} { |