Mercurial > dwindows
changeset 1044:59343c7493a3
Changes so dw_window_get/set_font() work on groupboxes on OS/2.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Fri, 27 May 2011 04:33:58 +0000 |
parents | 49a53cf864c1 |
children | 625fa470dcf0 |
files | os2/dw.c |
diffstat | 1 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/os2/dw.c Thu May 26 20:43:54 2011 +0000 +++ b/os2/dw.c Fri May 27 04:33:58 2011 +0000 @@ -4081,7 +4081,8 @@ */ int API dw_window_set_font(HWND handle, char *fontname) { - return WinSetPresParam(handle, PP_FONTNAMESIZE, strlen(fontname)+1, fontname); + HWND group = (HWND)dw_window_get_data(handle, "_dw_group"); + return WinSetPresParam(group ? group : handle, PP_FONTNAMESIZE, strlen(fontname)+1, fontname); } /* @@ -4093,7 +4094,8 @@ char * API dw_window_get_font(HWND handle) { char *str = (char *)alloca(50); - if(str && WinQueryPresParam(handle, PP_FONTNAMESIZE, 0, NULL, 50, str, QPF_NOINHERIT)) + HWND group = (HWND)dw_window_get_data(handle, "_dw_group"); + if(str && WinQueryPresParam(group ? group : handle, PP_FONTNAMESIZE, 0, NULL, 50, str, QPF_NOINHERIT)) return strdup(str); return NULL; } @@ -4413,6 +4415,7 @@ dw_window_set_color(newbox->hwnd, DW_CLR_PALEGRAY, DW_CLR_PALEGRAY); dw_window_set_color(newbox->grouphwnd, DW_CLR_BLACK, DW_CLR_PALEGRAY); dw_window_set_font(newbox->grouphwnd, DefaultFont); + dw_window_set_data(newbox->hwnd, "_dw_group", newbox->grouphwnd); return newbox->hwnd; }