diff win/dw.c @ 67:ab9b0fa6c66e

Focus fixes and removal of several hack in the OS/2 code base.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 22 Jan 2002 10:55:20 +0000
parents a6801a2260af
children 8d6100960adf
line wrap: on
line diff
--- a/win/dw.c	Mon Jan 14 02:10:31 2002 +0000
+++ b/win/dw.c	Tue Jan 22 10:55:20 2002 +0000
@@ -3005,7 +3005,7 @@
 	SetParent(handle, newparent);
 }
 
-HFONT _aquire_font(char *fontname)
+HFONT _acquire_font(HWND handle, char *fontname)
 {
 	HFONT hfont;
 	int z, size = 9;
@@ -3015,6 +3015,9 @@
 		hfont = GetStockObject(DEFAULT_GUI_FONT);
 	else
 	{
+#if 0
+		HDC hDC = GetDC(handle);
+#endif
 		for(z=0;z<strlen(fontname);z++)
 		{
 			if(fontname[z]=='.')
@@ -3022,6 +3025,9 @@
 		}
 		size = atoi(fontname) + 5;
 
+#if 0
+		lf.lfHeight = -MulDiv(size, GetDeviceCaps(hDC, LOGPIXELSY), 72);
+#endif
 		lf.lfHeight = size;
 		lf.lfWidth = 0;
 		lf.lfEscapement = 0;
@@ -3038,6 +3044,9 @@
 		strcpy(lf.lfFaceName, &fontname[z+1]);
 
 		hfont = CreateFontIndirect(&lf);
+#if 0
+		ReleaseDC(handle, hDC);
+#endif
 	}
 	return hfont;
 }
@@ -3050,7 +3059,7 @@
  */
 int dw_window_set_font(HWND handle, char *fontname)
 {
-	HFONT hfont = _aquire_font(fontname);
+	HFONT hfont = _acquire_font(handle, fontname);
 	ColorInfo *cinfo;
 
 	cinfo = (ColorInfo *)GetWindowLong(handle, GWL_USERDATA);
@@ -3073,7 +3082,7 @@
 			SetWindowLong(handle, GWL_USERDATA, (ULONG)cinfo);
 		}
 	}
-	SendMessage(handle, WM_SETFONT, (WPARAM)hfont, FALSE);
+	SendMessage(handle, WM_SETFONT, (WPARAM)hfont, (LPARAM)TRUE);
 	return 0;
 }
 
@@ -5421,8 +5430,8 @@
 
 	if(!hSmall || !hLarge)
 	{
-		hSmall = ImageList_Create(16, 16, ILC_COLOR16, ICON_INDEX_LIMIT, 0);
-		hLarge = ImageList_Create(32, 32, ILC_COLOR16, ICON_INDEX_LIMIT, 0);
+		hSmall = ImageList_Create(16, 16, ILC_COLOR16 | ILC_MASK, ICON_INDEX_LIMIT, 0);
+		hLarge = ImageList_Create(32, 32, ILC_COLOR16 | ILC_MASK, ICON_INDEX_LIMIT, 0);
 	}
 	for(z=0;z<ICON_INDEX_LIMIT;z++)
 	{
@@ -5939,7 +5948,7 @@
 
 		if(cinfo)
 		{
-			hFont = _aquire_font(cinfo->fontname);
+			hFont = _acquire_font(handle, cinfo->fontname);
 			mustdelete = 1;
 		}
 	}
@@ -5986,7 +5995,7 @@
 
 		if(cinfo)
 		{
-			hFont = _aquire_font(cinfo->fontname);
+			hFont = _acquire_font(handle, cinfo->fontname);
 			mustdelete = 1;
 		}
 	}