Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If the Virtual TreeView control is placed on a control that has the StyleEx flag WS_EX_COMPOSITED set, horizontal scrolloing does not update the header #458

Closed
vincentparrett opened this issue Jan 21, 2015 · 1 comment
Assignees
Labels
Milestone

Comments

@vincentparrett
Copy link
Contributor

From [email protected] on August 08, 2014 01:13:01

Seen on Windows 8.1 with V5.4.0. Will add repro later.

Original issue: http://code.google.com/p/virtual-treeview/issues/detail?id=458

@SaschaSchaefer
Copy link

I found the reason for this behavior.
Some interestiong posts regarding similar problems that I found during my research are:
"http://forums.codeguru.com/showthread.php?525163-GDI-Problem-BitBlt()-Doesn-t-Seem-To-Be-Doing-Anything" and "http://stackoverflow.com/questions/1842377/double-buffer-common-controls".

The virtual tree draws the header when it receives a WM_NCPAINT message. During the actual drawing, it creates a bitmap first and then uses BitBlt to copy the bitmap to the canvas, using GetDCEx to obtain the device context.
However, I found that all painting via a HDC needs to be done in WM_PAINT (source: https://groups.google.com/forum/#!topic/microsoft.public.win32.programmer.ui/hZer0Xidf3A)

Using that info, I moved the code to draw the header to TBaseVirtualTree.WMPaint() for testing purposes, which effectively resovled the issue of the non-updating header. See below for example code that I moved to the end of WMPaint:

procedure TBaseVirtualTree.WMPaint(var Message: TWMPaint);
   ...
   R := FHeaderRect;
   Flags := DCX_CACHE or DCX_CLIPSIBLINGS or DCX_WINDOW or DCX_VALIDATE;
   DC := GetDCEx(Handle, 0, Flags);
   FHeader.FColumns.PaintHeader(DC, R, -FEffectiveOffsetX);
   ReleaseDC(Handle, DC);
end;

joachimmarder pushed a commit that referenced this issue Dec 8, 2015
…rol that has the StyleEx flag WS_EX_COMPOSITED set, horizontal scrolloing does not update the header
@joachimmarder joachimmarder added this to the Version 6.3 milestone Dec 8, 2015
ValtsS pushed a commit to ValtsS/Virtual-TreeView that referenced this issue Jan 25, 2019
…ed on a control that has the StyleEx flag WS_EX_COMPOSITED set, horizontal scrolloing does not update the header

# Conflicts:
#	Source/VirtualTrees.pas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants