Skip to content

Commit

Permalink
Fixed issue #458: If the Virtual TreeView control is placed on a cont…
Browse files Browse the repository at this point in the history
…rol that has the StyleEx flag WS_EX_COMPOSITED set, horizontal scrolloing does not update the header
  • Loading branch information
Joachim Marder committed Dec 8, 2015
1 parent 61bd1d2 commit b97a9f9
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions Source/VirtualTrees.pas
Original file line number Diff line number Diff line change
Expand Up @@ -17424,13 +17424,9 @@ procedure TBaseVirtualTree.WMNCPaint(var Message: TWMNCPaint);
DC := GetDCEx(Handle, Message.Rgn, Flags or DCX_INTERSECTRGN);

if DC <> 0 then
begin
if hoVisible in FHeader.FOptions then
begin
R := FHeaderRect;
FHeader.FColumns.PaintHeader(DC, R, -FEffectiveOffsetX);
end;
try
OriginalWMNCPaint(DC);
finally
ReleaseDC(Handle, DC);
end;
if (((tsUseThemes in FStates) and not VclStyleEnabled) or (VclStyleEnabled and (seBorder in StyleElements))) then
Expand All @@ -17443,19 +17439,31 @@ procedure TBaseVirtualTree.WMNCPaint(var Message: TWMNCPaint);
//----------------------------------------------------------------------------------------------------------------------

procedure TBaseVirtualTree.WMPaint(var Message: TWMPaint);

var
DC: HDC;
begin
if tsVCLDragging in FStates then
ImageList_DragShowNolock(False);
if csPaintCopy in ControlState then
FUpdateRect := ClientRect
else
GetUpdateRect(Handle, FUpdateRect, True);

inherited;

if tsVCLDragging in FStates then
ImageList_DragShowNolock(True);

if hoVisible in FHeader.FOptions then
begin
DC := GetDCEx(Handle, 0, DCX_CACHE or DCX_CLIPSIBLINGS or DCX_WINDOW or DCX_VALIDATE);
if DC <> 0 then
try
FHeader.FColumns.PaintHeader(DC, FHeaderRect, -FEffectiveOffsetX);
finally
ReleaseDC(Handle, DC);
end;
end;//if header visible
end;

//----------------------------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit b97a9f9

Please sign in to comment.