# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1306470838 0 # Node ID 59343c7493a315b75caaadeba5838aaad93d5ad1 # Parent 49a53cf864c172395f0ca46f67174223a111bf77 Changes so dw_window_get/set_font() work on groupboxes on OS/2. diff -r 49a53cf864c1 -r 59343c7493a3 os2/dw.c --- 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; }