Changeset 398 for trunk/src/user32/new/win32wnd.cpp
- Timestamp:
- Jul 26, 1999, 10:03:49 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/win32wnd.cpp
r397 r398 1 /* $Id: win32wnd.cpp,v 1.2 3 1999-07-26 09:01:34sandervl Exp $ */1 /* $Id: win32wnd.cpp,v 1.24 1999-07-26 20:03:49 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Code for OS/2 … … 44 44 ((style & WS_BORDER) || HAS_THICKFRAME(style) || HAS_DLGFRAME(style,exStyle)) 45 45 46 #define IS_OVERLAPPED(style) \ 47 !(style & (WS_CHILD | WS_POPUP)) 48 46 49 //****************************************************************************** 47 50 //****************************************************************************** … … 65 68 isUnicode = FALSE; 66 69 fCreated = FALSE; 70 fFirstShow = TRUE; 67 71 68 72 memset(windowNameA, 0, MAX_WINDOW_NAMELENGTH); … … 431 435 maxPos.x = rectWindow.left; maxPos.y = rectWindow.top; 432 436 437 fCreated = TRUE; //Allow WM_SIZE messages now 433 438 if(SendInternalMessage(WM_NCCREATE, 0, (LPARAM)cs) ) 434 439 { 435 //doesn't work right, messes up client rectangle440 //doesn't work right, messes up client rectangle 436 441 #if 0 437 442 SendNCCalcSize(FALSE, &rectWindow, NULL, NULL, 0, &rectClient ); … … 455 460 HOOK_CallHooks16( WH_SHELL, HSHELL_WINDOWCREATED, hwnd, 0 ); 456 461 #endif 457 fCreated = TRUE;458 462 SetLastError(0); 459 463 return TRUE; 460 464 } 461 465 } 466 fCreated = FALSE; 462 467 OSLibWinSetWindowULong(OS2Hwnd, OFFSET_WIN32WNDPTR, 0); 463 468 OSLibWinSetWindowULong(OS2Hwnd, OFFSET_WIN32PM_MAGIC, 0); … … 473 478 * state. 474 479 */ 475 UINT Win32Window::MinMaximize(UINT 16 cmd, LPRECT16lpRect )480 UINT Win32Window::MinMaximize(UINT cmd, LPRECT lpRect ) 476 481 { 477 482 UINT swpFlags = 0; … … 516 521 517 522 case SW_MAXIMIZE: 518 CONV_POINT16TO32( &lpPos->ptMaxPos, &pt );519 523 WINPOS_GetMinMaxInfo( wndPtr, &size, &pt, NULL, NULL ); 520 CONV_POINT32TO16( &pt, &lpPos->ptMaxPos );521 524 522 525 if( dwStyle & WS_MINIMIZE ) … … 779 782 ULONG Win32Window::MsgActivate(BOOL fActivate, HWND hwnd) 780 783 { 784 if(SendInternalMessageA(WM_NCACTIVATE, fActivate, 0) == FALSE) 785 { 786 if(!fActivate) { 787 return 1; 788 } 789 } 781 790 return SendInternalMessageA(WM_ACTIVATE, (fActivate) ? WA_ACTIVE : WA_INACTIVE, hwnd); 782 791 } … … 815 824 ULONG Win32Window::MsgSetFocus(HWND hwnd) 816 825 { 826 if(hwnd == 0) { 827 //other app lost focus 828 SendInternalMessageA(WM_ACTIVATEAPP, TRUE, 0); //TODO: Need thread id from hwnd app 829 } 817 830 return SendInternalMessageA(WM_SETFOCUS, hwnd, 0); 818 831 } … … 821 834 ULONG Win32Window::MsgKillFocus(HWND hwnd) 822 835 { 836 if(hwnd == 0) { 837 //other app lost focus 838 SendInternalMessageA(WM_ACTIVATEAPP, FALSE, 0); //TODO: Need thread id from hwnd app 839 } 823 840 return SendInternalMessageA(WM_KILLFOCUS, hwnd, 0); 824 841 } … … 872 889 return 1; 873 890 } 891 if(win32msg == WM_MBUTTONDBLCLK || win32msg == WM_RBUTTONDBLCLK || win32msg == WM_LBUTTONDBLCLK) { 892 if(!(windowClass->getClassLongA(GCL_STYLE) & CS_DBLCLKS)) { 893 return 1; 894 } 895 } 874 896 SendInternalMessageA(win32ncmsg, lastHitTestVal, MAKELONG(x, y)); //TODO: 875 897 return SendInternalMessageA(win32msg, 0, MAKELONG(x, y)); … … 1343 1365 ULONG showstate = 0; 1344 1366 1345 dprintf(("ShowWindow %x", nCmdShow)); 1346 switch(nCmdShow) 1347 { 1367 dprintf(("ShowWindow %x", nCmdShow)); 1368 if(fFirstShow) { 1369 if(isFrameWindow() && IS_OVERLAPPED(getStyle())) { 1370 SendMessageA(WM_SIZE, SIZE_RESTORED, 1371 MAKELONG(rectClient.right-rectClient.left, 1372 rectClient.bottom-rectClient.top)); 1373 SendMessageA(WM_MOVE, 0, MAKELONG( rectClient.left, rectClient.top ) ); 1374 1375 } 1376 fFirstShow = FALSE; 1377 } 1378 switch(nCmdShow) 1379 { 1348 1380 case SW_SHOW: 1349 1381 case SW_SHOWDEFAULT: //todo … … 1377 1409 showstate = SWPOS_RESTORE | SWPOS_ACTIVATE | SWPOS_SHOW; 1378 1410 break; 1379 }1380 return OSLibWinShowWindow(OS2HwndFrame, showstate);1411 } 1412 return OSLibWinShowWindow(OS2HwndFrame, showstate); 1381 1413 } 1382 1414 //****************************************************************************** … … 1391 1423 hwndInsertAfter = HWNDOS_BOTTOM; 1392 1424 break; 1393 case HWND_TOPMOST: //TODO :1425 case HWND_TOPMOST: //TODO 1394 1426 case HWND_NOTOPMOST: //TODO: 1395 1427 case HWND_TOP: … … 1402 1434 PRECT clientRect = window->getClientRect(); 1403 1435 1404 #if 01436 #if 1 1405 1437 if(x+cx > clientRect->right - clientRect->left) { 1438 dprintf(("Adjusting cx from %d to %d", cx, (clientRect->right - clientRect->left) - x)); 1406 1439 cx = (clientRect->right - clientRect->left) - x; 1407 1440 } 1408 1441 if(y+cy > clientRect->bottom - clientRect->top) { 1442 dprintf(("Adjusting cy from %d to %d", cy, (clientRect->bottom - clientRect->top) - y)); 1409 1443 cy = (clientRect->bottom - clientRect->top) - y; 1410 1444 } 1411 1445 #endif 1446 //Correct coordinates if parent is a frame window (border adjustment) 1412 1447 //TODO: Not quite right (Solitaire child window placement slightly wrong) 1413 if (HAS_DLGFRAME(window->getStyle(), window->getExStyle() )) 1414 { 1415 x += GetSystemMetrics(SM_CXDLGFRAME); 1416 y -= GetSystemMetrics(SM_CYDLGFRAME); 1417 } 1418 else 1419 { 1420 if (HAS_THICKFRAME(window->getStyle())) 1448 if (window->isFrameWindow() && !(fuFlags & SWP_NOMOVE)) { 1449 if (HAS_DLGFRAME(window->getStyle(), window->getExStyle() )) 1421 1450 { 1422 x += GetSystemMetrics(SM_CX FRAME);1423 y -= GetSystemMetrics(SM_CY FRAME);1451 x += GetSystemMetrics(SM_CXDLGFRAME); 1452 y -= GetSystemMetrics(SM_CYDLGFRAME); 1424 1453 } 1425 if (window->getStyle() & WS_BORDER)1454 else 1426 1455 { 1427 x += GetSystemMetrics(SM_CXBORDER); 1428 y -= GetSystemMetrics(SM_CYBORDER); 1456 if (HAS_THICKFRAME(window->getStyle())) 1457 { 1458 x += GetSystemMetrics(SM_CXFRAME); 1459 y -= GetSystemMetrics(SM_CYFRAME); 1460 } 1461 else 1462 if (window->getStyle() & WS_BORDER) 1463 { 1464 x += GetSystemMetrics(SM_CXBORDER); 1465 y -= GetSystemMetrics(SM_CYBORDER); 1466 } 1429 1467 } 1430 1468 } … … 1615 1653 //****************************************************************************** 1616 1654 //****************************************************************************** 1617 BOOL Win32Window::BringWindowToTop()1618 {1619 return SetWindowPos(HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE );1620 }1621 //******************************************************************************1622 //******************************************************************************1623 1655 HWND Win32Window::GetActiveWindow() 1624 1656 {
Note:
See TracChangeset
for help on using the changeset viewer.