Mercurial > dwindows
comparison os2/dw.c @ 1429:fbaec6e5df63
Added dw_window_get_preferred_size() which attempts to determine the size the system wants for the widget. This is useful when creating nice looking layouts.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sun, 04 Dec 2011 20:11:38 +0000 |
parents | 7826031d48ce |
children | feb0429278e2 |
comparison
equal
deleted
inserted
replaced
1428:7826031d48ce | 1429:fbaec6e5df63 |
---|---|
7001 { | 7001 { |
7002 WinSetWindowPos(handle, NULLHANDLE, 0, 0, width, height, SWP_SHOW | SWP_SIZE); | 7002 WinSetWindowPos(handle, NULLHANDLE, 0, 0, width, height, SWP_SHOW | SWP_SIZE); |
7003 } | 7003 } |
7004 | 7004 |
7005 /* | 7005 /* |
7006 * Gets the size the system thinks the widget should be. | |
7007 * Parameters: | |
7008 * handle: Window handle of the item to be back. | |
7009 * width: Width in pixels of the item or NULL if not needed. | |
7010 * height: Height in pixels of the item or NULL if not needed. | |
7011 */ | |
7012 void API dw_window_get_preferred_size(HWND handle, int *width, int *height) | |
7013 { | |
7014 _control_size(handle, width, height); | |
7015 } | |
7016 | |
7017 /* | |
7006 * Returns the width of the screen. | 7018 * Returns the width of the screen. |
7007 */ | 7019 */ |
7008 int API dw_screen_width(void) | 7020 int API dw_screen_width(void) |
7009 { | 7021 { |
7010 return WinQuerySysValue(HWND_DESKTOP,SV_CXSCREEN); | 7022 return WinQuerySysValue(HWND_DESKTOP,SV_CXSCREEN); |