Mercurial > dwindows
comparison os2/dw.c @ 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 | 31dc5b4f6cfc |
children | 5dbb931bac5a |
comparison
equal
deleted
inserted
replaced
1043:49a53cf864c1 | 1044:59343c7493a3 |
---|---|
4079 * handle: The window (widget) handle. | 4079 * handle: The window (widget) handle. |
4080 * fontname: Name and size of the font in the form "size.fontname" | 4080 * fontname: Name and size of the font in the form "size.fontname" |
4081 */ | 4081 */ |
4082 int API dw_window_set_font(HWND handle, char *fontname) | 4082 int API dw_window_set_font(HWND handle, char *fontname) |
4083 { | 4083 { |
4084 return WinSetPresParam(handle, PP_FONTNAMESIZE, strlen(fontname)+1, fontname); | 4084 HWND group = (HWND)dw_window_get_data(handle, "_dw_group"); |
4085 return WinSetPresParam(group ? group : handle, PP_FONTNAMESIZE, strlen(fontname)+1, fontname); | |
4085 } | 4086 } |
4086 | 4087 |
4087 /* | 4088 /* |
4088 * Gets the font used by a specified window (widget) handle. | 4089 * Gets the font used by a specified window (widget) handle. |
4089 * Parameters: | 4090 * Parameters: |
4091 * fontname: Name and size of the font in the form "size.fontname" | 4092 * fontname: Name and size of the font in the form "size.fontname" |
4092 */ | 4093 */ |
4093 char * API dw_window_get_font(HWND handle) | 4094 char * API dw_window_get_font(HWND handle) |
4094 { | 4095 { |
4095 char *str = (char *)alloca(50); | 4096 char *str = (char *)alloca(50); |
4096 if(str && WinQueryPresParam(handle, PP_FONTNAMESIZE, 0, NULL, 50, str, QPF_NOINHERIT)) | 4097 HWND group = (HWND)dw_window_get_data(handle, "_dw_group"); |
4098 if(str && WinQueryPresParam(group ? group : handle, PP_FONTNAMESIZE, 0, NULL, 50, str, QPF_NOINHERIT)) | |
4097 return strdup(str); | 4099 return strdup(str); |
4098 return NULL; | 4100 return NULL; |
4099 } | 4101 } |
4100 | 4102 |
4101 /* Internal version */ | 4103 /* Internal version */ |
4411 | 4413 |
4412 WinSetWindowPtr(newbox->hwnd, QWP_USER, newbox); | 4414 WinSetWindowPtr(newbox->hwnd, QWP_USER, newbox); |
4413 dw_window_set_color(newbox->hwnd, DW_CLR_PALEGRAY, DW_CLR_PALEGRAY); | 4415 dw_window_set_color(newbox->hwnd, DW_CLR_PALEGRAY, DW_CLR_PALEGRAY); |
4414 dw_window_set_color(newbox->grouphwnd, DW_CLR_BLACK, DW_CLR_PALEGRAY); | 4416 dw_window_set_color(newbox->grouphwnd, DW_CLR_BLACK, DW_CLR_PALEGRAY); |
4415 dw_window_set_font(newbox->grouphwnd, DefaultFont); | 4417 dw_window_set_font(newbox->grouphwnd, DefaultFont); |
4418 dw_window_set_data(newbox->hwnd, "_dw_group", newbox->grouphwnd); | |
4416 return newbox->hwnd; | 4419 return newbox->hwnd; |
4417 } | 4420 } |
4418 | 4421 |
4419 /* | 4422 /* |
4420 * Create a new MDI Frame to be packed. | 4423 * Create a new MDI Frame to be packed. |