Fix treeview with checkboxes creation

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


Sorry, I sent the last mail a bit quickly.

The rest of the patch is important in my opinion because without it, the
drawing is done black and white. So you can reduce the patch to that
only line but it is not what I wanted. 

-       hdc = CreateCompatibleDC(0);
-       hbm = CreateCompatibleBitmap(hdc, 48, 16);

hbm is a 1 bit per pixel bitmap

+       hdcScreen = CreateDCA("DISPLAY", NULL, NULL, NULL);
+
+       hdc = CreateCompatibleDC(hdcScreen);
+       hbm = CreateCompatibleBitmap(hdcScreen, 48, 16);

hbm has now a screen compliant depth

In a treeview, the checkbox is not B/W. If there is another way to do it
please tell me. But I think this part of the patch is important

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