Update of /cvsroot/htoolkit/port/src/cbits/Win32
In directory sc8-pr-cvs1:/tmp/cvs-serv10989/src/cbits/Win32
Modified Files:
Frame.c Internals.h Notebook.c Util.c
Log Message:
Use system defined font (DEFAULT_GUI_FONT) for controls instead of hard coded constant value
Index: Frame.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Frame.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** Frame.c 15 Aug 2003 21:24:54 -0000 1.14
--- Frame.c 24 Aug 2003 14:39:00 -0000 1.15
***************
*** 37,41 ****
notifyAllHandlesForDestroy(pData->pMenuHandlesMap);
handleProcessDestroy();
- DeleteObject(pData->hControlFont);
free(pData->lpszAppName);
free(pData->lpszAppVersion);
--- 37,40 ----
***************
*** 48,83 ****
int nLen;
LOGFONT lf;
- HFONT hControlFont;
-
- // Globally, we create a logical font that is used in all controls.
- lf.lfHeight = -8;
- lf.lfWidth = 0;
- lf.lfWeight = 400;
- lf.lfItalic = FALSE;
- lf.lfUnderline = FALSE;
- lf.lfStrikeOut = FALSE;
- lf.lfEscapement = 0;
- lf.lfOrientation = 0;
- lf.lfCharSet = DEFAULT_CHARSET;
- lf.lfOutPrecision = OUT_DEFAULT_PRECIS;
- lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
- lf.lfQuality = DEFAULT_QUALITY;
- lf.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
- strcpy(lf.lfFaceName, "MS Sans Serif");
- hControlFont = CreateFontIndirect (&lf);
-
- if (!hControlFont)
- return -1;
pData = (FrameData *) malloc(sizeof(FrameData));
! if (!pData)
! {
! DeleteObject(hControlFont);
! return -1;
! }
pData->hClientWnd = NULL;
pData->DocumentInterface = DocumentInterface;
- pData->hControlFont = hControlFont;
pData->lpszAppName = NULL;
pData->lpszAppVersion = NULL;
--- 47,56 ----
int nLen;
LOGFONT lf;
pData = (FrameData *) malloc(sizeof(FrameData));
! if (!pData) return -1;
pData->hClientWnd = NULL;
pData->DocumentInterface = DocumentInterface;
pData->lpszAppName = NULL;
pData->lpszAppVersion = NULL;
***************
*** 91,95 ****
{
free(pData);
- DeleteObject(hControlFont);
return -1;
}
--- 64,67 ----
Index: Internals.h
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Internals.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Internals.h 17 Aug 2003 18:15:08 -0000 1.6
--- Internals.h 24 Aug 2003 14:39:00 -0000 1.7
***************
*** 65,69 ****
HWND hClientWnd;
int DocumentInterface;
- HFONT hControlFont;
LPSTR lpszAppName;
LPSTR lpszAppVersion;
--- 65,68 ----
Index: Notebook.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Notebook.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Notebook.c 24 Aug 2003 13:57:34 -0000 1.1
--- Notebook.c 24 Aug 2003 14:39:00 -0000 1.2
***************
*** 122,126 ****
{
LONG lStyle;
- FrameData *pFrameData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA);
lStyle = GetWindowLong(notebook, GWL_STYLE);
--- 122,125 ----
***************
*** 137,141 ****
SendMessage(notebook, WM_SETFONT, (WPARAM)NULL, TRUE);
SetWindowLong(notebook, GWL_STYLE, lStyle);
! SendMessage(notebook, WM_SETFONT, (WPARAM)pFrameData->hControlFont, MAKELPARAM (TRUE,0));
ResizeNotebookPages(notebook);
--- 136,140 ----
SendMessage(notebook, WM_SETFONT, (WPARAM)NULL, TRUE);
SetWindowLong(notebook, GWL_STYLE, lStyle);
! SendMessage(notebook, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), MAKELPARAM (TRUE,0));
ResizeNotebookPages(notebook);
***************
*** 166,170 ****
{
TCITEM item;
- HWND hNotebookPage;
int nOldIndex;
--- 165,168 ----
Index: Util.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Util.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** Util.c 24 Aug 2003 13:57:34 -0000 1.19
--- Util.c 24 Aug 2003 14:39:00 -0000 1.20
***************
*** 218,222 ****
{
HWND hParent;
- FrameData *pFrameData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA);
if (!hWnd)
--- 218,221 ----
***************
*** 226,230 ****
}
! SendMessage(hWnd, WM_SETFONT, (WPARAM)pFrameData->hControlFont, MAKELPARAM (TRUE,0));
hParent = GetParent(hWnd);
--- 225,229 ----
}
! SendMessage(hWnd, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), MAKELPARAM (TRUE,0));
hParent = GetParent(hWnd);
|