Fix treeview with checkboxes creation

Maxime Bellengé maxime.bellenge at laposte.net
Mon Aug 18 12:11:53 CDT 2003


Yes it is exactly what is it supposed to do, the location of the
SelectObject is the problem. You can only select a HBITMAP in only one
DC. As ImageList_AddMasked performs a SelectObject with hbm, you have to
deselect it first. 

Without that, the paint of the checkboxes in the treeview are messed up.

Maxime

On Sun, 2003-08-17 at 05:40, Dmitry Timoshkov wrote:
> "Maxime Bellengé" <maxime.bellenge at laposte.net> wrote:
> 
> > Changelog:
> > * Fix the creation of treeview with checkboxes. Now they display fine.
> 
> The only real change in this patch is the following snippet. Could you
> retest and send only that chunk alone?
> 
> @@ -4848,12 +4850,14 @@
>   DrawFrameControl(hdc, &rc, DFC_BUTTON,
>                     DFCS_BUTTONCHECK|DFCS_FLAT|DFCS_CHECKED);
> 
> + SelectObject(hdc, hbmOld);
>   nIndex = ImageList_AddMasked(infoPtr->himlState, hbm,
>                                 GetSysColor(COLOR_WINDOW));
>   TRACE("chckbox index %d\n", nIndex);
> - SelectObject(hdc, hbmOld);
> 
> --
> Dmitry.
-- 
Maxime Bellengé <maxime.bellenge at laposte.net>




More information about the wine-devel mailing list