- Timestamp:
- Jan 15, 2000, 3:18:18 PM (26 years ago)
- Location:
- trunk/src/user32/new
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/menu.cpp
r2433 r2444 1 /* $Id: menu.cpp,v 1. 9 2000-01-13 20:11:36 sandervlExp $*/1 /* $Id: menu.cpp,v 1.10 2000-01-15 14:18:16 cbratschi Exp $*/ 2 2 /* 3 3 * Menu functions … … 1029 1029 //debug_print_menuitem("MENU_DrawMenuItem: ", lpitem, ""); 1030 1030 1031 if (lpitem->fType & MF_SYSMENU) 1032 { 1033 if( !IsIconic(hwnd) ) 1034 { 1035 Win32BaseWindow *win32wnd = Win32BaseWindow::GetWindowFromHandle(hwnd); 1036 1037 if (win32wnd) win32wnd->DrawSysButton(hdc,lpitem->fState & (MF_HILITE | MF_MOUSESELECT)); 1038 } 1039 1040 return; 1041 } 1031 if (lpitem->fType & MF_SYSMENU) return; 1042 1032 1043 1033 if (lpitem->fType & MF_OWNERDRAW) … … 1074 1064 1075 1065 if ((lpitem->fState & MF_HILITE) && !(IS_BITMAP_ITEM(lpitem->fType))) 1076 if (menuBar)1077 DrawEdge(hdc, &rect, BDR_SUNKENOUTER, BF_RECT);1078 else1079 1066 FillRect( hdc, &rect, GetSysColorBrush(COLOR_HIGHLIGHT) ); 1080 1067 else { … … 1385 1372 } 1386 1373 1387 FillRect(hDC, lprect, GetSysColorBrush(COLOR_MENU) ); 1388 1389 SelectObject( hDC, GetSysColorPen(COLOR_3DFACE)); 1390 MoveToEx( hDC, lprect->left, lprect->bottom,NULL); 1391 LineTo( hDC, lprect->right, lprect->bottom ); 1374 HDC memDC; 1375 HBITMAP memBmp,oldBmp; 1376 RECT r; 1377 HFONT oldMemFont; 1378 1379 memDC = CreateCompatibleDC(hDC); 1380 r = *lprect; 1381 r.right -= r.left; 1382 r.bottom -= r.top; 1383 r.left = r.top = 0; 1384 memBmp = CreateCompatibleBitmap(hDC,r.right,r.bottom+1); 1385 oldBmp = SelectObject(memDC,memBmp); 1386 oldMemFont = SelectObject(memDC,hMenuFont); 1387 1388 FillRect(memDC,&r,GetSysColorBrush(COLOR_MENU)); 1389 1390 SelectObject(memDC,GetSysColorPen(COLOR_3DFACE)); 1391 MoveToEx(memDC,r.left,r.bottom,NULL); 1392 LineTo(memDC,r.right,r.bottom); 1392 1393 1393 1394 if (lppop->nItems == 0) 1394 1395 { 1395 1396 goto END;1397 }1398 1399 for (i = 0; i < lppop->nItems; i++)1400 {1396 retvalue = GetSystemMetrics(SM_CYMENU); 1397 } else 1398 { 1399 for (i = 0; i < lppop->nItems; i++) 1400 { 1401 OffsetRect(&lppop->items[i].rect,-lprect->left,-lprect->top); 1401 1402 MENU_DrawMenuItem( hwnd,getMenu(hwnd), GetWindow(hwnd,GW_OWNER), 1402 hDC, &lppop->items[i], lppop->Height, TRUE, ODA_DRAWENTIRE ); 1403 } 1404 retvalue = lppop->Height; 1403 memDC, &lppop->items[i], lppop->Height, TRUE, ODA_DRAWENTIRE ); 1404 OffsetRect(&lppop->items[i].rect,lprect->left,lprect->top); 1405 } 1406 retvalue = lppop->Height; 1407 } 1408 1409 BitBlt(hDC,lprect->left,lprect->top,lprect->right-lprect->left,lprect->bottom-lprect->top+1,memDC,0,0,SRCCOPY); 1410 SelectObject(memDC,oldBmp); 1411 if (oldMemFont) SelectObject(memDC,oldMemFont); 1412 DeleteObject(memBmp); 1413 DeleteDC(memDC); 1405 1414 1406 1415 END: … … 2103 2112 * Walks menu chain trying to find a menu pt maps to. 2104 2113 */ 2105 static HMENU MENU_PtMenu( HMENU hMenu, POINT pt)2114 static HMENU MENU_PtMenu(HMENU hMenu,POINT pt,BOOL inMenuBar) 2106 2115 { 2107 2116 POPUPMENU *menu = (POPUPMENU*)hMenu; … … 2112 2121 (menu->items[ht].fType & MF_POPUP) && 2113 2122 (menu->items[ht].fState & MF_MOUSESELECT)) 2114 ? (UINT) MENU_PtMenu(menu->items[ht].hSubMenu, pt) : 0;2123 ? (UINT) MENU_PtMenu(menu->items[ht].hSubMenu,pt,inMenuBar) : 0; 2115 2124 2116 2125 if( !ht ) /* check the current window (avoiding WM_HITTEST) */ … … 2126 2135 else 2127 2136 { 2128 ht = ( ht == HTSYSMENU) ? (UINT)(getSysMenu(menu->hWnd))2129 : ( ht == HTMENU) ? (UINT)(getMenu(menu->hWnd)) : 0;2137 ht = ((ht == HTSYSMENU) && !inMenuBar) ? (UINT)(getSysMenu(menu->hWnd)) 2138 : ((ht == HTMENU) && inMenuBar) ? (UINT)(getMenu(menu->hWnd)) : 0; 2130 2139 } 2131 2140 } … … 2402 2411 if( hNewWnd != pmt->hOwnerWnd ) 2403 2412 { 2404 ReleaseCapture(); 2413 ReleaseCapture(); 2405 2414 pmt->hOwnerWnd = hNewWnd; 2406 2415 SetCapture(pmt->hOwnerWnd); //SvL: Don't know if this is good enough 2407 2416 //EVENT_Capture( pmt->hOwnerWnd, HTMENU ); //CB: todo 2408 2417 } … … 2568 2577 * Menu tracking code. 2569 2578 */ 2570 static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y, 2571 HWND hwnd, const RECT *lprect ) 2579 static INT MENU_TrackMenu(HMENU hmenu,UINT wFlags,INT x,INT y,HWND hwnd,BOOL inMenuBar,const RECT *lprect) 2572 2580 { 2573 2581 MSG msg; … … 2606 2614 * clear that menu loop is not over yet. */ 2607 2615 // if (!GetMessageA(&msg,msg.hwnd,0,0)) break; 2608 2616 //SvL: Getting messages for only the menu delays background paints (i.e. VPBuddy logo) 2609 2617 if (!GetMessageA(&msg,0,0,0)) break; 2610 2618 TranslateMessage( &msg ); … … 2619 2627 /* Find a menu for this mouse event */ 2620 2628 POINT pt = msg.pt; 2621 hmenu = MENU_PtMenu( mt.hTopMenu, pt ); 2629 2630 hmenu = MENU_PtMenu(mt.hTopMenu,pt,inMenuBar); 2622 2631 2623 2632 switch(msg.message) … … 2828 2837 void MENU_TrackMouseMenuBar( HWND hWnd, INT ht, POINT pt ) 2829 2838 { 2830 HMENU hMenu = (ht == HTSYSMENU) ? getSysMenu(hWnd):getMenu(hWnd);2839 HMENU hMenu = (ht == 0) ? getMenu(hWnd):getSysMenu(hWnd); 2831 2840 UINT wFlags = TPM_ENTERIDLEEX | TPM_BUTTONDOWN | TPM_LEFTALIGN | TPM_LEFTBUTTON; 2832 2841 … … 2836 2845 { 2837 2846 MENU_InitTracking( hWnd, hMenu, FALSE, wFlags ); 2838 MENU_TrackMenu( hMenu, wFlags, pt.x, pt.y, hWnd, NULL );2847 MENU_TrackMenu( hMenu, wFlags, pt.x, pt.y, hWnd,ht == 0, NULL ); 2839 2848 MENU_ExitTracking(hWnd); 2840 2849 } … … 2895 2904 PostMessageA( hWnd, WM_KEYDOWN, VK_DOWN, 0L ); 2896 2905 2897 MENU_TrackMenu( hTrackMenu, wFlags, 0, 0, hWnd, NULL );2906 MENU_TrackMenu( hTrackMenu, wFlags, 0, 0, hWnd,TRUE, NULL ); 2898 2907 } 2899 2908 … … 2924 2933 2925 2934 if (MENU_ShowPopup( hWnd, hMenu, 0, x, y, 0, 0 )) 2926 ret = MENU_TrackMenu( hMenu, wFlags | TPM_POPUPMENU, 0, 0, hWnd, lpRect );2935 ret = MENU_TrackMenu( hMenu, wFlags | TPM_POPUPMENU, 0, 0, hWnd,FALSE, lpRect ); 2927 2936 MENU_ExitTracking(hWnd); 2928 2937 … … 3311 3320 3312 3321 if (IS_STRING_ITEM(flags) && str) 3313 3322 dprintf(("USER32: InsertMenuA %x %d %x %d %s", hMenu, pos, flags, id, str)); 3314 3323 // TRACE("hMenu %04x, pos %d, flags %08x, " 3315 3324 // "id %04x, str '%s'\n", 3316 3325 // hMenu, pos, flags, id, str ); 3317 3326 else // TRACE("hMenu %04x, pos %d, flags %08x, " 3318 3327 dprintf(("USER32: InsertMenuA %x %d %x %d %x", hMenu, pos, flags, id, str)); 3319 3328 // "id %04x, str %08lx (not a string)\n", 3320 3329 // hMenu, pos, flags, id, (DWORD)str ); … … 3445 3454 if (IS_STRING_ITEM(flags)) 3446 3455 { 3447 3456 dprintf(("USER32: ModifyMenuA, %x %d %x %d %s", hMenu, pos, flags, id, str)); 3448 3457 //TRACE("%04x %d %04x %04x '%s'\n", 3449 3458 // hMenu, pos, flags, id, str ? str : "#NULL#" ); … … 3452 3461 else 3453 3462 { 3454 3463 dprintf(("USER32: ModifyMenuA, %x %d %x %d %x", hMenu, pos, flags, id, str)); 3455 3464 //TRACE("%04x %d %04x %04x %08lx\n", 3456 3465 // hMenu, pos, flags, id, (DWORD)str ); -
trunk/src/user32/new/oslibwin.cpp
r2437 r2444 1 /* $Id: oslibwin.cpp,v 1.3 7 2000-01-14 14:45:16 sandervlExp $ */1 /* $Id: oslibwin.cpp,v 1.38 2000-01-15 14:18:16 cbratschi Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 51 51 HWND OSLibWinCreateWindow(HWND hwndParent,ULONG dwWinStyle, 52 52 char *pszName, HWND Owner, ULONG fHWND_BOTTOM, HWND *hwndFrame, 53 ULONG id, BOOL fTaskList )53 ULONG id, BOOL fTaskList,BOOL saveBits) 54 54 { 55 55 HWND hwndClient; … … 75 75 76 76 dwClientStyle = dwWinStyle & ~(WS_TABSTOP | WS_GROUP | WS_CLIPSIBLINGS); 77 if (saveBits) dwWinStyle |= WS_SAVEBITS; 77 78 78 79 dwFrameStyle |= FCF_NOBYTEALIGN; … … 92 93 93 94 if (*hwndFrame) { 94 hwndClient = WinCreateWindow (*hwndFrame, WIN32_STDCLASS,95 hwndClient = WinCreateWindow (*hwndFrame,saveBits ? WIN32_STDCLASS:WIN32_STDCLASS2, 95 96 NULL, dwClientStyle, 0, 0, 0, 0, 96 97 *hwndFrame, HWND_TOP, FID_CLIENT, NULL, NULL); -
trunk/src/user32/new/oslibwin.h
r2437 r2444 1 /* $Id: oslibwin.h,v 1.3 0 2000-01-14 14:45:16 sandervlExp $ */1 /* $Id: oslibwin.h,v 1.31 2000-01-15 14:18:17 cbratschi Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 39 39 HWND OSLibWinCreateWindow(HWND hwndParent,ULONG dwWinStyle, 40 40 char *pszName, HWND Owner, ULONG fBottom, 41 HWND *hwndFrame, ULONG id, BOOL fTaskList );41 HWND *hwndFrame, ULONG id, BOOL fTaskList,BOOL saveBits); 42 42 43 43 BOOL OSLibWinConvertStyle(ULONG dwStyle, ULONG *dwExStyle, ULONG *OSWinStyle, ULONG *OSFrameStyle, ULONG *borderWidth, ULONG *borderHeight); -
trunk/src/user32/new/win32wbase.cpp
r2440 r2444 1 /* $Id: win32wbase.cpp,v 1.4 2 2000-01-14 17:48:32cbratschi Exp $ */1 /* $Id: win32wbase.cpp,v 1.43 2000-01-15 14:18:17 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 530 530 (owner) ? owner->getOS2WindowHandle() : OSLIB_HWND_DESKTOP, 531 531 (hwndLinkAfter == HWND_BOTTOM) ? TRUE : FALSE, 532 &OS2HwndFrame, 0, fTaskList );532 &OS2HwndFrame, 0, fTaskList,windowClass->getStyle() & CS_SAVEBITS); 533 533 if(OS2Hwnd == 0) { 534 534 dprintf(("Window creation failed!!")); … … 1504 1504 1505 1505 case WM_NCRBUTTONUP: 1506 return HandleNCRButtonUp(wParam,lParam); 1507 1506 1508 case WM_NCMBUTTONUP: 1507 1509 return 0; -
trunk/src/user32/new/win32wbase.h
r2440 r2444 1 /* $Id: win32wbase.h,v 1. 29 2000-01-14 17:48:33cbratschi Exp $ */1 /* $Id: win32wbase.h,v 1.30 2000-01-15 14:18:18 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 385 385 LONG HandleNCLButtonDown(WPARAM wParam,LPARAM lParam); 386 386 LONG HandleNCLButtonDblClk(WPARAM wParam,LPARAM lParam); 387 LONG HandleNCRButtonUp(WPARAM wParam,LPARAM lParam); 387 388 BOOL WindowNeedsWMBorder(); 388 389 VOID AdjustRectOuter(LPRECT rect,BOOL menu); … … 393 394 public: 394 395 LONG HandleNCHitTest(POINT pt); 395 BOOL DrawSysButton(HDC hdc,BOOL down);396 396 BOOL GetSysPopupPos(RECT* rect); 397 397 private: 398 BOOL DrawSysButton(HDC hdc,RECT *rect); 398 399 BOOL DrawGrayButton(HDC hdc,int x,int y); 399 VOID DrawCloseButton(HDC hdc, BOOL down,BOOL bGrayed);400 VOID DrawMaxButton(HDC hdc, BOOL down,BOOL bGrayed);401 VOID DrawMinButton(HDC hdc, BOOL down,BOOL bGrayed);400 VOID DrawCloseButton(HDC hdc,RECT *rect,BOOL down,BOOL bGrayed); 401 VOID DrawMaxButton(HDC hdc,RECT *rect,BOOL down,BOOL bGrayed); 402 VOID DrawMinButton(HDC hdc,RECT *rect,BOOL down,BOOL bGrayed); 402 403 VOID DrawCaption(HDC hdc,RECT *rect,BOOL active,BOOL redrawText); 403 404 VOID UpdateCaptionText(); -
trunk/src/user32/new/win32wbasenonclient.cpp
r2440 r2444 1 /* $Id: win32wbasenonclient.cpp,v 1. 7 2000-01-14 17:48:33cbratschi Exp $ */1 /* $Id: win32wbasenonclient.cpp,v 1.8 2000-01-15 14:18:18 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 (non-client methods) … … 74 74 WORD wStateChange; 75 75 76 //CB: only caption is changed on activation 77 if (!(dwStyle & WS_CAPTION)) return TRUE; 78 76 79 if( wParam ) wStateChange = !(flags & WIN_NCACTIVATED); 77 80 else wStateChange = flags & WIN_NCACTIVATED; … … 115 118 hdc = GetWindowDC(Win32Hwnd); 116 119 if (wParam == HTMINBUTTON) 117 DrawMinButton(hdc, TRUE,FALSE);120 DrawMinButton(hdc,NULL,TRUE,FALSE); 118 121 else 119 DrawMaxButton(hdc, TRUE,FALSE);122 DrawMaxButton(hdc,NULL,TRUE,FALSE); 120 123 do 121 124 { … … 127 130 { 128 131 if (wParam == HTMINBUTTON) 129 DrawMinButton(hdc, pressed,FALSE);132 DrawMinButton(hdc,NULL,pressed,FALSE); 130 133 else 131 DrawMaxButton(hdc, pressed,FALSE);134 DrawMaxButton(hdc,NULL,pressed,FALSE); 132 135 } 133 136 } while (msg.message != WM_LBUTTONUP); 134 137 if (wParam == HTMINBUTTON) 135 DrawMinButton(hdc, FALSE,FALSE);138 DrawMinButton(hdc,NULL,FALSE,FALSE); 136 139 else 137 DrawMaxButton(hdc, FALSE,FALSE);140 DrawMaxButton(hdc,NULL,FALSE,FALSE); 138 141 ReleaseCapture(); 139 142 ReleaseDC(Win32Hwnd,hdc); … … 164 167 hdc = GetWindowDC(Win32Hwnd); 165 168 SetCapture(Win32Hwnd); 166 DrawCloseButton(hdc, TRUE,FALSE);169 DrawCloseButton(hdc,NULL,TRUE,FALSE); 167 170 do 168 171 { … … 172 175 pressed = (HandleNCHitTest(msg.pt) == wParam); 173 176 if (pressed != oldstate) 174 DrawCloseButton(hdc, pressed,FALSE);177 DrawCloseButton(hdc,NULL,pressed,FALSE); 175 178 } while (msg.message != WM_LBUTTONUP); 176 DrawCloseButton(hdc, FALSE,FALSE);179 DrawCloseButton(hdc,NULL,FALSE,FALSE); 177 180 ReleaseCapture(); 178 181 ReleaseDC(Win32Hwnd,hdc); … … 244 247 if(dwStyle & WS_SYSMENU ) 245 248 { 246 if( !(dwStyle & WS_MINIMIZE) )247 {248 HDC hDC = GetWindowDC(Win32Hwnd);249 DrawSysButton(hDC,TRUE);250 ReleaseDC(Win32Hwnd,hDC);251 }252 249 SendInternalMessageA(WM_SYSCOMMAND,SC_MOUSEMENU+HTSYSMENU,lParam); 253 250 } … … 606 603 //****************************************************************************** 607 604 //****************************************************************************** 608 BOOL Win32BaseWindow::DrawSysButton(HDC hdc, BOOL down)605 BOOL Win32BaseWindow::DrawSysButton(HDC hdc,RECT *rect) 609 606 { 610 607 if(!(flags & WIN_MANAGED)) 611 608 { 612 609 HICON hIcon; 613 RECT rect; 614 615 GetInsideRect(&rect); 610 RECT r; 611 612 if (!rect) GetInsideRect(&r); 613 else r = *rect; 616 614 617 615 hIcon = (HICON) GetClassLongA(Win32Hwnd, GCL_HICONSM); … … 625 623 626 624 if (hIcon) 627 DrawIconEx (hdc, rect.left + 2, rect.top + 2,hIcon,628 629 630 625 DrawIconEx(hdc,r.left+2,r.top+2,hIcon, 626 GetSystemMetrics(SM_CXSMICON), 627 GetSystemMetrics(SM_CYSMICON), 628 0, 0, DI_NORMAL); 631 629 632 630 return (hIcon != 0); … … 683 681 //****************************************************************************** 684 682 //****************************************************************************** 685 VOID Win32BaseWindow::DrawCloseButton(HDC hdc, BOOL down,BOOL bGrayed)686 { 687 RECT r ect;683 VOID Win32BaseWindow::DrawCloseButton(HDC hdc,RECT *rect,BOOL down,BOOL bGrayed) 684 { 685 RECT r; 688 686 HDC hdcMem; 689 687 … … 693 691 HBITMAP hBmp, hOldBmp; 694 692 695 GetInsideRect(&rect); 693 if (!rect) GetInsideRect(&r); 694 else r = *rect; 696 695 697 696 hdcMem = CreateCompatibleDC( hdc ); … … 700 699 GetObjectA (hBmp, sizeof(BITMAP), &bmp); 701 700 702 BitBlt (hdc, r ect.right - (GetSystemMetrics(SM_CYCAPTION) + 1 + bmp.bmWidth) / 2,703 r ect.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2,701 BitBlt (hdc, r.right - (GetSystemMetrics(SM_CYCAPTION) + 1 + bmp.bmWidth) / 2, 702 r.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2, 704 703 bmp.bmWidth, bmp.bmHeight, hdcMem, 0, 0, SRCCOPY); 705 704 706 705 if(bGrayed) 707 DrawGrayButton(hdc,r ect.right - (GetSystemMetrics(SM_CYCAPTION) + 1 + bmp.bmWidth) / 2 + 2,708 r ect.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2 + 2);706 DrawGrayButton(hdc,r.right - (GetSystemMetrics(SM_CYCAPTION) + 1 + bmp.bmWidth) / 2 + 2, 707 r.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2 + 2); 709 708 710 709 SelectObject (hdcMem, hOldBmp); … … 714 713 //****************************************************************************** 715 714 //****************************************************************************** 716 VOID Win32BaseWindow::DrawMaxButton(HDC hdc, BOOL down,BOOL bGrayed)717 { 718 RECT r ect;715 VOID Win32BaseWindow::DrawMaxButton(HDC hdc,RECT *rect,BOOL down,BOOL bGrayed) 716 { 717 RECT r; 719 718 HDC hdcMem; 720 719 … … 724 723 HBITMAP hBmp,hOldBmp; 725 724 726 GetInsideRect(&rect); 725 if (!rect) GetInsideRect(&r); 726 else r = *rect; 727 727 hdcMem = CreateCompatibleDC( hdc ); 728 728 hBmp = IsZoomed(Win32Hwnd) ? … … 733 733 734 734 if (dwStyle & WS_SYSMENU) 735 r ect.right -= GetSystemMetrics(SM_CYCAPTION) + 1;736 737 BitBlt( hdc, r ect.right - (GetSystemMetrics(SM_CXSIZE) + bmp.bmWidth) / 2,738 r ect.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2,735 r.right -= GetSystemMetrics(SM_CYCAPTION) + 1; 736 737 BitBlt( hdc, r.right - (GetSystemMetrics(SM_CXSIZE) + bmp.bmWidth) / 2, 738 r.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2, 739 739 bmp.bmWidth, bmp.bmHeight, hdcMem, 0, 0, SRCCOPY ); 740 740 741 741 if(bGrayed) 742 DrawGrayButton(hdc, r ect.right - (GetSystemMetrics(SM_CXSIZE) + bmp.bmWidth) / 2 + 2,743 r ect.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2 + 2);742 DrawGrayButton(hdc, r.right - (GetSystemMetrics(SM_CXSIZE) + bmp.bmWidth) / 2 + 2, 743 r.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2 + 2); 744 744 745 745 … … 750 750 //****************************************************************************** 751 751 //****************************************************************************** 752 VOID Win32BaseWindow::DrawMinButton(HDC hdc, BOOL down,BOOL bGrayed)753 { 754 RECT r ect;752 VOID Win32BaseWindow::DrawMinButton(HDC hdc,RECT *rect,BOOL down,BOOL bGrayed) 753 { 754 RECT r; 755 755 HDC hdcMem; 756 756 … … 761 761 HBITMAP hBmp,hOldBmp; 762 762 763 GetInsideRect(&rect); 763 if (!rect) GetInsideRect(&r); 764 else r = *rect; 764 765 765 766 hdcMem = CreateCompatibleDC( hdc ); … … 769 770 770 771 if (dwStyle & WS_SYSMENU) 771 r ect.right -= GetSystemMetrics(SM_CYCAPTION) + 1;772 r.right -= GetSystemMetrics(SM_CYCAPTION) + 1; 772 773 773 774 /* In win 95 there is always a Maximize box when there is a Minimize one */ 774 775 if ((dwStyle & WS_MAXIMIZEBOX) || (dwStyle & WS_MINIMIZEBOX)) 775 r ect.right += -1 - (GetSystemMetrics(SM_CXSIZE) + bmp.bmWidth) / 2;776 777 BitBlt( hdc, r ect.right - (GetSystemMetrics(SM_CXSIZE) + bmp.bmWidth) / 2,778 r ect.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2,776 r.right -= bmp.bmWidth; 777 778 BitBlt( hdc, r.right - (GetSystemMetrics(SM_CXSIZE) + bmp.bmWidth) / 2, 779 r.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2, 779 780 bmp.bmWidth, bmp.bmHeight, hdcMem, 0, 0, SRCCOPY ); 780 781 781 782 if(bGrayed) 782 DrawGrayButton(hdc, r ect.right - (GetSystemMetrics(SM_CXSIZE) + bmp.bmWidth) / 2 + 2,783 r ect.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2 + 2);783 DrawGrayButton(hdc, r.right - (GetSystemMetrics(SM_CXSIZE) + bmp.bmWidth) / 2 + 2, 784 r.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2 + 2); 784 785 785 786 … … 793 794 VOID Win32BaseWindow::DrawCaption(HDC hdc,RECT *rect,BOOL active,BOOL redrawText) 794 795 { 795 RECT r = *rect ;796 RECT r = *rect,r2; 796 797 char buffer[256]; 797 798 HPEN hPrevPen; 799 HDC memDC; 800 HBITMAP memBmp,oldBmp; 798 801 799 802 if (flags & WIN_MANAGED) return; 800 803 801 hPrevPen = SelectObject( hdc, GetSysColorPen(COLOR_3DFACE) ); 802 MoveToEx( hdc, r.left, r.bottom - 1, NULL ); 803 LineTo( hdc, r.right, r.bottom - 1 ); 804 SelectObject( hdc, hPrevPen ); 804 memDC = CreateCompatibleDC(hdc); 805 r.right -= r.left; 806 r.bottom -= r.top; 807 r.left = r.top = 0; 808 r2 = r; 809 memBmp = CreateCompatibleBitmap(hdc,r.right,r.bottom); 810 oldBmp = SelectObject(memDC,memBmp); 811 812 hPrevPen = SelectObject(memDC,GetSysColorPen(COLOR_3DFACE)); 813 MoveToEx(memDC,r.left,r.bottom-1,NULL); 814 LineTo(memDC,r.right,r.bottom-1); 815 SelectObject(memDC,hPrevPen); 805 816 r.bottom--; 806 817 … … 810 821 811 822 if (startColor == endColor) 812 FillRect( hdc,&r,GetSysColorBrush(startColor));823 FillRect(memDC,&r,GetSysColorBrush(startColor)); 813 824 else 814 825 { … … 831 842 r2.left = r2.right; 832 843 r2.right = r.left+w*x/steps; 833 FillRect( hdc,&r2,brush);844 FillRect(memDC,&r2,brush); 834 845 DeleteObject(brush); 835 846 } 836 847 } 837 } else FillRect( hdc,&r,GetSysColorBrush(active ? COLOR_ACTIVECAPTION:COLOR_INACTIVECAPTION));848 } else FillRect(memDC,&r,GetSysColorBrush(active ? COLOR_ACTIVECAPTION:COLOR_INACTIVECAPTION)); 838 849 839 850 if (!hbitmapClose) … … 851 862 if ((dwStyle & WS_SYSMENU) && !(dwExStyle & WS_EX_TOOLWINDOW)) 852 863 { 853 if (redrawText || DrawSysButton( hdc,FALSE))864 if (redrawText || DrawSysButton(memDC,&r)) 854 865 r.left += GetSystemMetrics(SM_CYCAPTION) - 1; 855 866 } … … 865 876 866 877 /* Draw a grayed close button if disabled and a normal one if SC_CLOSE is not there */ 867 DrawCloseButton( hdc,FALSE,878 DrawCloseButton(memDC,&r2,FALSE, 868 879 ((((state & MF_DISABLED) || (state & MF_GRAYED))) && (state != 0xFFFFFFFF))); 869 880 } … … 876 887 877 888 if (!redrawText) 878 DrawMaxButton( hdc, FALSE,(!(dwStyle & WS_MAXIMIZEBOX)));889 DrawMaxButton(memDC,&r2,FALSE,(!(dwStyle & WS_MAXIMIZEBOX))); 879 890 r.right -= GetSystemMetrics(SM_CXSIZE) + 1; 880 891 881 892 if (!redrawText) 882 DrawMinButton( hdc,FALSE, (!(dwStyle & WS_MINIMIZEBOX)));893 DrawMinButton(memDC,&r2,FALSE, (!(dwStyle & WS_MINIMIZEBOX))); 883 894 r.right -= GetSystemMetrics(SM_CXSIZE) + 1; 884 895 } … … 889 900 NONCLIENTMETRICSA nclm; 890 901 HFONT hFont, hOldFont; 902 891 903 nclm.cbSize = sizeof(NONCLIENTMETRICSA); 892 904 SystemParametersInfoA (SPI_GETNONCLIENTMETRICS, 0, &nclm, 0); … … 895 907 else 896 908 hFont = CreateFontIndirectA (&nclm.lfCaptionFont); 897 hOldFont = SelectObject ( hdc, hFont);898 SetTextColor( hdc,GetSysColor(active ? COLOR_CAPTIONTEXT:COLOR_INACTIVECAPTIONTEXT));899 SetBkMode( hdc, TRANSPARENT );909 hOldFont = SelectObject (memDC, hFont); 910 SetTextColor(memDC,GetSysColor(active ? COLOR_CAPTIONTEXT:COLOR_INACTIVECAPTIONTEXT)); 911 SetBkMode(memDC, TRANSPARENT ); 900 912 r.left += 2; 901 DrawTextA( hdc, buffer, -1, &r,913 DrawTextA(memDC, buffer, -1, &r, 902 914 DT_SINGLELINE | DT_VCENTER | DT_NOPREFIX | DT_LEFT ); 903 DeleteObject (SelectObject (hdc, hOldFont)); 904 } 915 DeleteObject (SelectObject (memDC, hOldFont)); 916 } 917 918 BitBlt(hdc,rect->left,rect->top,rect->right-rect->left,rect->bottom-rect->top,memDC,0,0,SRCCOPY); 919 SelectObject(memDC,oldBmp); 920 DeleteObject(memBmp); 921 DeleteDC(memDC); 905 922 } 906 923 //****************************************************************************** … … 1054 1071 r.bottom = rect.top + GetSystemMetrics(SM_CYMENU); 1055 1072 1056 rect.top += MENU_DrawMenuBar( hdc, &r, Win32Hwnd, suppress_menupaint ) +1;1073 rect.top += MENU_DrawMenuBar(hdc,&r,Win32Hwnd,suppress_menupaint)+1; 1057 1074 } 1058 1075 … … 1168 1185 return 0; 1169 1186 } 1187 //****************************************************************************** 1188 //****************************************************************************** 1189 LONG Win32BaseWindow::HandleNCRButtonUp(WPARAM wParam,LPARAM lParam) 1190 { 1191 if (wParam == HTCAPTION) 1192 { 1193 if (GetActiveWindow() != Win32Hwnd) 1194 SetActiveWindow(); 1195 1196 if ((GetActiveWindow() == Win32Hwnd) && (dwStyle & WS_SYSMENU)) 1197 { 1198 SendInternalMessageA(WM_SYSCOMMAND,SC_MOUSEMENU+HTCAPTION,lParam); 1199 } 1200 } 1201 1202 return 0; 1203 } 1170 1204 /*********************************************************************** 1171 1205 * NC_HandleSysCommand … … 1173 1207 * Handle a WM_SYSCOMMAND message. Called from DefWindowProc(). 1174 1208 * 1175 * TODO: Not done (see #if 0)1176 1209 */ 1177 1210 LONG Win32BaseWindow::HandleSysCommand(WPARAM wParam,POINT *pt32) … … 1179 1212 UINT uCommand = wParam & 0xFFF0; 1180 1213 1181 /* //CB: don't need this, perhaps recycle for menus1182 if ((getStyle() & WS_CHILD) && (uCommand != SC_KEYMENU))1183 ScreenToClient(getParent()->getWindowHandle(), pt32 );1184 */1185 1214 switch (uCommand) 1186 1215 { -
trunk/src/user32/new/winprop.cpp
r2290 r2444 1 /* $Id: winprop.cpp,v 1. 3 2000-01-01 14:57:39cbratschi Exp $ */1 /* $Id: winprop.cpp,v 1.4 2000-01-15 14:18:18 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Property apis for OS/2 … … 43 43 { 44 44 #ifdef DEBUG 45 WriteLog("USER32: EnumPropsExW \n");45 WriteLog("USER32: EnumPropsExW DOES NOT WORK\n"); 46 46 #endif 47 47 // NOTE: This will not work as is (needs UNICODE support) … … 55 55 { 56 56 #ifdef DEBUG 57 WriteLog("USER32: EnumPropsW \n");57 WriteLog("USER32: EnumPropsW DOES NOT WORK\n"); 58 58 #endif 59 59 // NOTE: This will not work as is (needs UNICODE support) … … 72 72 if(!window) { 73 73 dprintf(("GetPropA, window %x not found", hwnd)); 74 74 SetLastError(ERROR_INVALID_WINDOW_HANDLE); 75 75 return 0; 76 76 } … … 109 109 if(!window) { 110 110 dprintf(("RemovePropA, window %x not found", hwnd)); 111 111 SetLastError(ERROR_INVALID_WINDOW_HANDLE); 112 112 return 0; 113 113 } … … 145 145 if(!window) { 146 146 dprintf(("SetPropA, window %x not found", hwnd)); 147 147 SetLastError(ERROR_INVALID_WINDOW_HANDLE); 148 148 return 0; 149 149 }
Note:
See TracChangeset
for help on using the changeset viewer.