changeset 1473:4468ac1db710

Fixes building on OS/2 and reverted a change where I tried to not show the window while sizing on OS/2, but that seems to break the sizing code... will revisit this soon.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 20 Dec 2011 16:18:46 +0000
parents 1794caee0758
children cd3d7e341467
files os2/dw.c
diffstat 1 files changed, 16 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/os2/dw.c	Tue Dec 20 16:10:13 2011 +0000
+++ b/os2/dw.c	Tue Dec 20 16:18:46 2011 +0000
@@ -6907,7 +6907,7 @@
       _get_window_for_size(handle, &width, &height);
    
    /* Finally set the size */
-   WinSetWindowPos(handle, NULLHANDLE, 0, 0, width, height, SWP_SIZE);
+   WinSetWindowPos(handle, NULLHANDLE, 0, 0, width, height, SWP_SHOW | SWP_SIZE);
 }
 
 /*
@@ -6949,6 +6949,20 @@
    return colors;
 }
 
+/*
+ * Sets the gravity of a given window (widget).
+ * Gravity controls which corner of the screen and window the position is relative to.
+ * Parameters:
+ *          handle: Window (widget) handle.
+ *          horz: DW_GRAV_LEFT (default), DW_GRAV_RIGHT or DW_GRAV_CENTER.
+ *          vert: DW_GRAV_TOP (default), DW_GRAV_BOTTOM or DW_GRAV_CENTER.
+ */
+void API dw_window_set_gravity(HWND handle, int horz, int vert)
+{
+   dw_window_set_data(handle, "_dw_grav_horz", DW_INT_TO_POINTER(horz));
+   dw_window_set_data(handle, "_dw_grav_vert", DW_INT_TO_POINTER(vert));
+}
+
 /* Convert the coordinates based on gravity */
 void _handle_gravity(HWND handle, long *x, long *y, unsigned long width, unsigned long height)
 {
@@ -7011,7 +7025,7 @@
    
    _handle_gravity(handle, &x, &y, width, height);
    /* Finally set the size */
-   WinSetWindowPos(handle, NULLHANDLE, x, y, width, height, SWP_MOVE | SWP_SIZE);
+   WinSetWindowPos(handle, NULLHANDLE, x, y, width, height, SWP_SHOW | SWP_MOVE | SWP_SIZE);
 }
 
 /*