From: <kr_...@us...> - 2003-08-24 19:02:48
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1:/tmp/cvs-serv18393/port/src/cbits/Win32 Modified Files: Canvas.c Font.c Log Message: The new defaultFontDef function now returns the default font which is specified in Windows. The defaultPen function is renamed to windowPen and now the window and dialog pens have colors whichs are given from Windows settings. Index: Canvas.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Canvas.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Canvas.c 13 Jul 2003 16:12:43 -0000 1.8 --- Canvas.c 24 Aug 2003 19:02:45 -0000 1.9 *************** *** 596,597 **** --- 596,611 ---- } /* osGetScaleFactor */ + unsigned int osGetDialogColor() + { + return GetSysColor(COLOR_3DFACE); + } + + unsigned int osGetWindowColor() + { + return GetSysColor(COLOR_WINDOW); + } + + unsigned int osGetTextColor() + { + return GetSysColor(COLOR_WINDOWTEXT); + } Index: Font.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Font.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Font.c 21 Jan 2003 22:01:12 -0000 1.1 --- Font.c 24 Aug 2003 19:02:45 -0000 1.2 *************** *** 152,161 **** } ! FontHandle osCreateFont(char *face, int size, int weight, int style, BOOL IsUnderlined, BOOL IsStriked) { LOGFONT lf; HDC hDC; ! if (style != 0 && style != 1) return NULL; --- 152,161 ---- } ! FontHandle osCreateFont(char *face, int size, int weight, int style) { LOGFONT lf; HDC hDC; ! if (style & FONT_OBLIQUE) return NULL; *************** *** 167,175 **** DeleteDC(hDC); ! lf.lfHeight = -size; ! lf.lfWeight = weight; ! lf.lfItalic = style ? TRUE : FALSE; ! lf.lfUnderline = IsUnderlined; ! lf.lfStrikeOut = IsStriked; lf.lfWidth = 0; lf.lfEscapement = 0; --- 167,175 ---- DeleteDC(hDC); ! lf.lfHeight = -size; ! lf.lfWeight = weight; ! lf.lfItalic = (style & FONT_TYPE_MASK) != 0; ! lf.lfUnderline = (style & FONT_UNDERLINED) != 0; ! lf.lfStrikeOut = (style & FONT_STRIKED) != 0; lf.lfWidth = 0; lf.lfEscapement = 0; *************** *** 286,301 **** void osDefaultFontDef(char **face, int *size, int *weight, int *style) { ! *face = "Times"; ! *size = 10; ! *weight = 400; ! *style = 0; ! } ! void osDialogFontDef(char **face, int *size, int *weight, int *style) ! { ! *face = "MS Sans Serif"; ! *size = 8; ! *weight = 400; *style = 0; } --- 286,300 ---- void osDefaultFontDef(char **face, int *size, int *weight, int *style) { ! LOGFONT lf; ! GetObject(GetStockObject(DEFAULT_GUI_FONT), sizeof(LOGFONT), &lf); ! *face = lf.lfFaceName; ! *size = -lf.lfHeight; ! *weight = lf.lfWeight; ! *style = 0; + if (lf.lfItalic) *style |= FONT_ITALIC; + if (lf.lfUnderline) *style |= FONT_UNDERLINED; + if (lf.lfStrikeOut) *style |= FONT_STRIKED; } |