Fix treeview with checkboxes creation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch fixes the creation of treeview with checkboxes.
Although this patch can be applied independently from my previous ones
(the UpdateDispInfo one), the diff was made on top of the previous one.
So the line number may not be correct.

a+

Maxime

Changelog:
	* Fix the creation of treeview with checkboxes. Now they display fine.


-- 
Maxime Bellengà <maxime.bellenge@laposte.net>
--- wine/dlls/comctl32/treeview.c	2003-08-16 17:33:06.000000000 +0200
+++ wine/dlls/comctl32/treeviewmax.c	2003-08-16 17:30:26.000000000 +0200
@@ -4825,14 +4825,16 @@
     {
 	RECT rc;
 	HBITMAP hbm, hbmOld;
-	HDC hdc;
+	HDC hdc,hdcScreen;
 	int nIndex;
 
 	infoPtr->himlState =
 	    ImageList_Create(16, 16, ILC_COLOR | ILC_MASK, 3, 0);
 
-	hdc = CreateCompatibleDC(0);
-	hbm = CreateCompatibleBitmap(hdc, 48, 16);
+	hdcScreen = CreateDCA("DISPLAY", NULL, NULL, NULL);
+
+	hdc = CreateCompatibleDC(hdcScreen);
+	hbm = CreateCompatibleBitmap(hdcScreen, 48, 16);
 	hbmOld = SelectObject(hdc, hbm);
 
 	rc.left  = 0;   rc.top    = 0;
@@ -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);
+
 	DeleteObject(hbm);
 	DeleteDC(hdc);
+	DeleteDC(hdcScreen);
 
 	infoPtr->stateImageWidth = 16;
 	infoPtr->stateImageHeight = 16;

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux