Mercurial > dwindows
comparison win/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 | 7b735226ab94 |
children | 0676561865ac |
comparison
equal
deleted
inserted
replaced
1428:7826031d48ce | 1429:fbaec6e5df63 |
---|---|
6727 if ( height == 0 ) height = usedy; | 6727 if ( height == 0 ) height = usedy; |
6728 SetWindowPos(handle, (HWND)NULL, 0, 0, width, height, SWP_SHOWWINDOW | SWP_NOZORDER | SWP_NOMOVE); | 6728 SetWindowPos(handle, (HWND)NULL, 0, 0, width, height, SWP_SHOWWINDOW | SWP_NOZORDER | SWP_NOMOVE); |
6729 } | 6729 } |
6730 | 6730 |
6731 /* | 6731 /* |
6732 * Gets the size the system thinks the widget should be. | |
6733 * Parameters: | |
6734 * handle: Window handle of the item to be back. | |
6735 * width: Width in pixels of the item or NULL if not needed. | |
6736 * height: Height in pixels of the item or NULL if not needed. | |
6737 */ | |
6738 void API dw_window_get_preferred_size(HWND handle, int *width, int *height) | |
6739 { | |
6740 _control_size(handle, width, height); | |
6741 } | |
6742 | |
6743 /* | |
6732 * Returns the width of the screen. | 6744 * Returns the width of the screen. |
6733 */ | 6745 */ |
6734 int API dw_screen_width(void) | 6746 int API dw_screen_width(void) |
6735 { | 6747 { |
6736 return screenx; | 6748 return screenx; |