From: <kr_...@us...> - 2003-10-12 23:15:01
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1:/tmp/cvs-serv17524/port/src/cbits/Win32 Modified Files: Internals.h Window.c Log Message: Initial support for dialogs with restricted minimal size. Only Windows for now. Index: Internals.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Internals.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Internals.h 12 Oct 2003 21:33:46 -0000 1.10 --- Internals.h 12 Oct 2003 23:14:57 -0000 1.11 *************** *** 91,94 **** --- 91,96 ---- HWND hTooltip; HWND hGripWnd; + + SIZE MinTrackSize; } WindowData; Index: Window.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Window.c,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** Window.c 12 Oct 2003 21:33:46 -0000 1.57 --- Window.c 12 Oct 2003 23:14:57 -0000 1.58 *************** *** 158,161 **** --- 158,163 ---- pData->hTooltip = NULL; pData->hGripWnd = NULL; + pData->MinTrackSize.cx = 0; + pData->MinTrackSize.cy = 0; SetWindowLong(hWnd,GWL_USERDATA,(LONG) pData); *************** *** 703,706 **** --- 705,717 ---- } break; + case WM_GETMINMAXINFO: + if (pData) + { + MINMAXINFO *pInfo = (MINMAXINFO *) lParam; + pInfo->ptMinTrackSize.x = pData->MinTrackSize.cx; + pInfo->ptMinTrackSize.y = pData->MinTrackSize.cy; + return 0; + } + break; } *************** *** 1454,1455 **** --- 1465,1481 ---- } } + + void osSetDialogMinSize(WindowHandle dialog, int w, int h) + { + RECT rect; + WindowData *pData = (WindowData *) GetWindowLong(dialog,GWL_USERDATA); + + rect.left = 0; + rect.top = 0; + rect.right = w; + rect.bottom = h; + AdjustWindowRect(&rect, GetWindowLong(dialog, GWL_STYLE), FALSE); + + pData->MinTrackSize.cx = rect.right-rect.left; + pData->MinTrackSize.cy = rect.bottom-rect.top; + } |