Changeset 5215 for trunk/src/user32/win32wbasepos.cpp
- Timestamp:
- Feb 20, 2001, 4:40:23 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/win32wbasepos.cpp
r4945 r5215 1 /* $Id: win32wbasepos.cpp,v 1.1 8 2001-01-14 17:15:47sandervl Exp $ */1 /* $Id: win32wbasepos.cpp,v 1.19 2001-02-20 15:40:23 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 (nonclient/position methods) … … 39 39 #include <win\hook.h> 40 40 41 #define DBG_LOCALLOG 41 #define DBG_LOCALLOG DBG_win32wbasepos 42 42 #include "dbglocal.h" 43 43 … … 54 54 55 55 /* Compute default values */ 56 57 MinMax.ptMaxSize.x = GetSystemMetrics(SM_CXSCREEN); 58 MinMax.ptMaxSize.y = GetSystemMetrics(SM_CYSCREEN); 59 MinMax.ptMinTrackSize.x = GetSystemMetrics(SM_CXMINTRACK); 60 MinMax.ptMinTrackSize.y = GetSystemMetrics(SM_CYMINTRACK); 61 MinMax.ptMaxTrackSize.x = GetSystemMetrics(SM_CXSCREEN); 62 MinMax.ptMaxTrackSize.y = GetSystemMetrics(SM_CYSCREEN); 56 MinMax.ptMaxPosition.x = 0; 57 MinMax.ptMaxPosition.y = 0; 58 59 if(!(getStyle() & (WS_POPUP | WS_CHILD))) { 60 RECT rect; 61 OSLibWinGetMaxPosition(getOS2WindowHandle(), &rect); 62 MinMax.ptMaxPosition.x = rect.left; 63 MinMax.ptMaxPosition.y = rect.top; 64 65 MinMax.ptMaxSize.x = rect.right - rect.left; 66 MinMax.ptMaxSize.y = rect.bottom - rect.top; 67 MinMax.ptMinTrackSize.x = GetSystemMetrics(SM_CXMINTRACK); 68 MinMax.ptMinTrackSize.y = GetSystemMetrics(SM_CYMINTRACK); 69 MinMax.ptMaxTrackSize.x = GetSystemMetrics(SM_CXSCREEN); 70 MinMax.ptMaxTrackSize.y = GetSystemMetrics(SM_CYSCREEN); 71 } 72 else { 73 MinMax.ptMaxSize.x = GetSystemMetrics(SM_CXSCREEN); 74 MinMax.ptMaxSize.y = GetSystemMetrics(SM_CYSCREEN); 75 MinMax.ptMinTrackSize.x = GetSystemMetrics(SM_CXMINTRACK); 76 MinMax.ptMinTrackSize.y = GetSystemMetrics(SM_CYMINTRACK); 77 MinMax.ptMaxTrackSize.x = GetSystemMetrics(SM_CXSCREEN); 78 MinMax.ptMaxTrackSize.y = GetSystemMetrics(SM_CYSCREEN); 79 } 63 80 64 81 if (HAS_DLGFRAME( dwStyle, dwExStyle )) … … 75 92 yinc += GetSystemMetrics(SM_CYFRAME); 76 93 } 77 94 //SvL: Wine has no 'else', but I'm seeing different behaviour in NT 78 95 // and it doesn't make much sense either as a window can have 79 96 // only one kind of border (see drawing code) 80 97 else 81 98 if (dwStyle & WS_BORDER) 82 99 { … … 95 112 { 96 113 #endif 97 MinMax.ptMaxPosition.x = -xinc;98 MinMax.ptMaxPosition.y = -yinc;114 MinMax.ptMaxPosition.x -= xinc; 115 MinMax.ptMaxPosition.y -= yinc; 99 116 // } 100 117 … … 138 155 if((winpos->flags & (SWP_FRAMECHANGED | SWP_NOSIZE)) != SWP_NOSIZE ) 139 156 { 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 157 params.rgrc[0] = *newWindowRect; 158 if(calcValidRect) 159 { 160 winposCopy = *winpos; 161 params.rgrc[1] = *oldWindowRect; 162 params.rgrc[2] = *oldClientRect; 163 //client rectangel must be in parent coordinates 164 OffsetRect(¶ms.rgrc[2], rectWindow.left, rectWindow.top); 165 166 params.lppos = &winposCopy; 167 } 168 result = SendInternalMessageA(WM_NCCALCSIZE, calcValidRect, (LPARAM)¶ms ); 169 170 /* If the application send back garbage, ignore it */ 171 if(params.rgrc[0].left <= params.rgrc[0].right && params.rgrc[0].top <= params.rgrc[0].bottom) 172 { 173 *newClientRect = params.rgrc[0]; 174 //client rectangle now in parent coordinates; convert to 'frame' coordinates 175 OffsetRect(newClientRect, -rectWindow.left, -rectWindow.top); 176 } 160 177 161 178 /* FIXME: WVR_ALIGNxxx */ … … 169 186 } 170 187 else 171 if(!(winpos->flags & SWP_NOMOVE) && 188 if(!(winpos->flags & SWP_NOMOVE) && 172 189 (newClientRect->left != rectClient.left || newClientRect->top != rectClient.top)) { 173 190 winpos->flags &= ~SWP_NOCLIENTMOVE; … … 206 223 POINT size; 207 224 208 size.x = rectWindow.left; 225 size.x = rectWindow.left; 209 226 size.y = rectWindow.top; 210 227 211 228 if(IsRectEmpty(&windowpos.rcNormalPosition)) { 212 229 CopyRect(&windowpos.rcNormalPosition, &rectWindow); 213 230 } 214 231 if(!HOOK_CallHooksA(WH_CBT, HCBT_MINMAX, getWindowHandle(), cmd)) 215 232 { 216 217 218 219 220 221 222 223 224 225 226 227 233 if(getStyle() & WS_MINIMIZE ) 234 { 235 if(!SendInternalMessageA(WM_QUERYOPEN, 0, 0L)) 236 return (SWP_NOSIZE | SWP_NOMOVE); 237 } 238 switch( cmd ) 239 { 240 case SW_MINIMIZE: 241 if( getStyle() & WS_MAXIMIZE) 242 { 243 setFlags(getFlags() | WIN_RESTORE_MAX); 244 setStyle(getStyle() & ~WS_MAXIMIZE); 228 245 } 229 else 230 231 232 233 234 235 236 237 246 else setFlags(getFlags() & ~WIN_RESTORE_MAX); 247 248 setStyle(getStyle() | WS_MINIMIZE); 249 250 SetRect(lpRect, windowpos.ptMinPosition.x, windowpos.ptMinPosition.y, 251 GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON) ); 252 break; 253 254 case SW_MAXIMIZE: 238 255 GetMinMaxInfo(&size, &windowpos.ptMaxPosition, NULL, NULL ); 239 256 240 241 242 243 257 if(getStyle() & WS_MINIMIZE ) 258 { 259 setStyle(getStyle() & ~WS_MINIMIZE); 260 } 244 261 setStyle(getStyle() | WS_MAXIMIZE); 245 262 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 } 264 else 265 if( !(getStyle() & WS_MAXIMIZE) ) 266 267 elsesetStyle(getStyle() & ~WS_MAXIMIZE);268 269 270 271 272 lpRect->right -= lpRect->left; 273 274 275 276 } 263 SetRect(lpRect, windowpos.ptMaxPosition.x, windowpos.ptMaxPosition.y, 264 size.x, size.y ); 265 break; 266 267 case SW_RESTORE: 268 if(getStyle() & WS_MINIMIZE) 269 { 270 setStyle(getStyle() & ~WS_MINIMIZE); 271 272 if( getFlags() & WIN_RESTORE_MAX) 273 { 274 /* Restore to maximized position */ 275 GetMinMaxInfo(&size, &windowpos.ptMaxPosition, NULL, NULL); 276 setStyle(getStyle() | WS_MAXIMIZE); 277 SetRect(lpRect, windowpos.ptMaxPosition.x, windowpos.ptMaxPosition.y, size.x, size.y); 278 break; 279 } 280 } 281 else 282 if( !(getStyle() & WS_MAXIMIZE) ) 283 return 0; 284 else setStyle(getStyle() & ~WS_MAXIMIZE); 285 286 /* Restore to normal position */ 287 288 *lpRect = windowpos.rcNormalPosition; 289 lpRect->right -= lpRect->left; 290 lpRect->bottom -= lpRect->top; 291 break; 292 } 293 } 277 294 else swpFlags |= SWP_NOSIZE | SWP_NOMOVE; 278 295
Note:
See TracChangeset
for help on using the changeset viewer.