From c79dac2aa1d45096e2e4c1e8423ba35a0885a7a3 Mon Sep 17 00:00:00 2001 From: blikblum Date: Sat, 12 Apr 2008 15:23:12 +0000 Subject: [PATCH] * Fix header drag image paint git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@417 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/virtualtreeview-unstable/VirtualTrees.pas | 11 ++++++++--- components/virtualtreeview-unstable/vtlogger.pas | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/components/virtualtreeview-unstable/VirtualTrees.pas b/components/virtualtreeview-unstable/VirtualTrees.pas index 4fd9c5f5c..f9b6380d5 100644 --- a/components/virtualtreeview-unstable/VirtualTrees.pas +++ b/components/virtualtreeview-unstable/VirtualTrees.pas @@ -6201,7 +6201,7 @@ begin FBackImage.Canvas.Handle, 0, 0, SRCCOPY); if ForceRepaint then - UpdateWindow(FOwner.Handle); + DelphiCompat.UpdateWindow(FOwner.Handle); Inc(FImagePosition.X, -DeltaX); Inc(FImagePosition.Y, -DeltaY); @@ -8835,8 +8835,11 @@ begin SelectClipRgn(Handle, ButtonRgn); DeleteObject(ButtonRgn); + //lclheader + //Under Delphi/VCL, unlike LCL, the hover index is not changed while dragging. + //Here we check if dragging and not draw as hover IsHoverIndex := (Integer(FPositionToIndex[I]) = FHoverIndex) and (hoHotTrack in FHeader.FOptions) and - (coEnabled in FOptions); + (coEnabled in FOptions) and not (hsDragging in FHeader.States); IsDownIndex := Integer(FPositionToIndex[I]) = FDownIndex; if (coShowDropMark in FOptions) and (Integer(FPositionToIndex[I]) = FDropTarget) and (Integer(FPositionToIndex[I]) <> FDragIndex) then @@ -9989,8 +9992,10 @@ begin ImagePos := Treeview.ClientToScreen(Point(DragColumn.Left + Treeview.ComputeRTLOffset(True), 0)) else ImagePos := Treeview.ClientToScreen(Point(DragColumn.Left, 0)); + //lclheader // Column rectangles are given in local window coordinates not client coordinates. - Dec(ImagePos.Y, FHeight); + // The above statement is not valid under LCL + //Dec(ImagePos.Y, FHeight); if hoRestrictDrag in FOptions then FDragImage.MoveRestriction := dmrHorizontalOnly diff --git a/components/virtualtreeview-unstable/vtlogger.pas b/components/virtualtreeview-unstable/vtlogger.pas index c72e850ef..34bf360e9 100644 --- a/components/virtualtreeview-unstable/vtlogger.pas +++ b/components/virtualtreeview-unstable/vtlogger.pas @@ -36,6 +36,7 @@ const lcPanning = 21; lcHeaderOffset = 22; lcSelection = 23; + lcAlphaBlend = 24; var Logger: TLCLLogger;