You've already forked lazarus-ccr
* Call PrepareDrag in non windows
* Dont offset the Start point in PrepareDrag * Add some logger call to debug header dragging git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1099 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -9638,9 +9638,7 @@ begin
|
|||||||
if I > NoColumn then
|
if I > NoColumn then
|
||||||
Invalidate(FColumns[I]);
|
Invalidate(FColumns[I]);
|
||||||
//todo: implement drag image under gtk
|
//todo: implement drag image under gtk
|
||||||
{$ifdef Windows}
|
|
||||||
PrepareDrag(P, FDragStart);
|
PrepareDrag(P, FDragStart);
|
||||||
{$endif}
|
|
||||||
FStates := FStates - [hsDragPending] + [hsDragging];
|
FStates := FStates - [hsDragPending] + [hsDragging];
|
||||||
HandleHeaderMouseMove := True;
|
HandleHeaderMouseMove := True;
|
||||||
Result := 0;
|
Result := 0;
|
||||||
@ -9909,11 +9907,16 @@ begin
|
|||||||
with TLMLButtonUp(Message) do
|
with TLMLButtonUp(Message) do
|
||||||
P := Treeview.ClientToScreen(Point(XPos, YPos));
|
P := Treeview.ClientToScreen(Point(XPos, YPos));
|
||||||
GetWindowRect(Treeview.Handle, R);
|
GetWindowRect(Treeview.Handle, R);
|
||||||
|
Logger.Send([lcDrag],'Header - EndDrag / R',R);
|
||||||
with FColumns do
|
with FColumns do
|
||||||
begin
|
begin
|
||||||
|
Logger.Send([lcDrag],'Header - EndDrag / FDropTarget: %d FDragIndex: %d FDragIndexPosition: %d',
|
||||||
|
[FDropTarget, FDragIndex, FColumns[FDragIndex].Position]);
|
||||||
|
Logger.Send([lcDrag],'Header - EndDrag / FDropBefore', FColumns.FDropBefore);
|
||||||
FDragImage.EndDrag;
|
FDragImage.EndDrag;
|
||||||
if (FDropTarget > -1) and (FDropTarget <> FDragIndex) and PtInRect(R, P) then
|
if (FDropTarget > -1) and (FDropTarget <> FDragIndex) and PtInRect(R, P) then
|
||||||
begin
|
begin
|
||||||
|
Logger.Send([lcDrag],'Header - EndDrag / FDropTargetPosition', FColumns[FDropTarget].Position);
|
||||||
OldPosition := FColumns[FDragIndex].Position;
|
OldPosition := FColumns[FDragIndex].Position;
|
||||||
if FColumns.FDropBefore then
|
if FColumns.FDropBefore then
|
||||||
begin
|
begin
|
||||||
@ -10132,7 +10135,6 @@ begin
|
|||||||
// Determine initial position of drag image (screen coordinates).
|
// Determine initial position of drag image (screen coordinates).
|
||||||
FColumns.FDropTarget := NoColumn;
|
FColumns.FDropTarget := NoColumn;
|
||||||
Start := Treeview.ScreenToClient(Start);
|
Start := Treeview.ScreenToClient(Start);
|
||||||
Inc(Start.Y, FHeight);
|
|
||||||
FColumns.FDragIndex := FColumns.ColumnFromPosition(Start);
|
FColumns.FDragIndex := FColumns.ColumnFromPosition(Start);
|
||||||
DragColumn := FColumns[FColumns.FDragIndex];
|
DragColumn := FColumns[FColumns.FDragIndex];
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user