- Timestamp:
- Feb 3, 2000, 6:13:03 PM (26 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/button.cpp
r2469 r2611 1 /* $Id: button.cpp,v 1.3 0 2000-01-18 20:10:31 sandervlExp $ */1 /* $Id: button.cpp,v 1.31 2000-02-03 17:13:00 cbratschi Exp $ */ 2 2 /* File: button.cpp -- Button type widgets 3 3 * … … 7 7 * Copyright (c) 1999 Christoph Bratschi 8 8 * 9 * WINE version: 9912129 * WINE version: 20000130 10 10 * 11 11 * Status: complete -
trunk/src/user32/menu.cpp
r2582 r2611 1 /* $Id: menu.cpp,v 1.1 4 2000-01-31 22:30:52 sandervlExp $*/1 /* $Id: menu.cpp,v 1.15 2000-02-03 17:13:00 cbratschi Exp $*/ 2 2 /* 3 3 * Menu functions … … 9 9 * Copyright 1999 Christoph Bratschi 10 10 * 11 * WINE version: 99121211 * WINE version: 20000130 12 12 * 13 13 * Status: ??? … … 301 301 302 302 /*********************************************************************** 303 * MENU_GetMenu 304 * 305 * Validate the given menu handle and returns the menu structure pointer. 306 */ 307 POPUPMENU *MENU_GetMenu(HMENU hMenu) 308 { 309 POPUPMENU *menu; 310 menu = (POPUPMENU*)hMenu; 311 if (!IS_A_MENU(menu)) 312 { 313 //ERR("invalid menu handle=%x, ptr=%p, magic=%x\n", hMenu, menu, menu? menu->wMagic:0); 314 menu = NULL; 315 } 316 return menu; 317 } 318 319 /*********************************************************************** 303 320 * MENU_CopySysPopup 304 321 * … … 578 595 UINT i; 579 596 580 if (((*hmenu)==0xffff) || (!(menu = (POPUPMENU*)*hmenu))) return NULL;597 if (((*hmenu)==0xffff) || (!(menu = MENU_GetMenu(*hmenu)))) return NULL; 581 598 if (wFlags & MF_BYPOSITION) 582 599 { … … 623 640 MENUITEM *item; 624 641 if (((*hmenu)==0xffff) || 625 (!(menu = (POPUPMENU*)*hmenu)))642 (!(menu = MENU_GetMenu(*hmenu)))) 626 643 return NO_SELECTED_ITEM; 627 644 item = menu->items; … … 701 718 if (hmenu) 702 719 { 703 POPUPMENU *menu = (POPUPMENU*)hmenu;720 POPUPMENU *menu = MENU_GetMenu(hmenu); 704 721 MENUITEM *item = menu->items; 705 722 LONG menuchar; … … 1320 1337 /* draw menu items */ 1321 1338 1322 menu = (POPUPMENU*)hmenu;1339 menu = MENU_GetMenu(hmenu); 1323 1340 if (menu && menu->nItems) 1324 1341 { … … 1351 1368 HFONT hfontOld = 0; 1352 1369 1353 lppop = (LPPOPUPMENU)getMenu(hwnd);1370 lppop = MENU_GetMenu(getMenu(hwnd)); 1354 1371 if (lppop == NULL || lprect == NULL) 1355 1372 { … … 1493 1510 //hwndOwner, hmenu, id, x, y, xanchor, yanchor); 1494 1511 1495 if (!(menu = (POPUPMENU*)hmenu)) return FALSE;1512 if (!(menu = MENU_GetMenu(hmenu))) return FALSE; 1496 1513 if (menu->FocusedItem != NO_SELECTED_ITEM) 1497 1514 { … … 1601 1618 //TRACE("owner=0x%04x menu=0x%04x index=0x%04x select=0x%04x\n", hwndOwner, hmenu, wIndex, sendMenuSelect); 1602 1619 1603 lppop = (POPUPMENU*)hmenu;1604 if ( !lppop->nItems) return;1620 lppop = MENU_GetMenu(hmenu); 1621 if ((!lppop) || (!lppop->nItems)) return; 1605 1622 1606 1623 if (lppop->FocusedItem == wIndex) return; … … 1668 1685 //TRACE("hwnd=0x%04x hmenu=0x%04x off=0x%04x\n", hwndOwner, hmenu, offset); 1669 1686 1670 menu = (POPUPMENU*)hmenu;1671 if ( !menu->items) return;1687 menu = MENU_GetMenu(hmenu); 1688 if ((!menu) || (!menu->items)) return; 1672 1689 1673 1690 if ( menu->FocusedItem != NO_SELECTED_ITEM ) … … 1741 1758 if (flags & MF_POPUP) 1742 1759 { 1743 POPUPMENU *menu = (POPUPMENU*)(UINT)id;1744 if ( IS_A_MENU(menu)) menu->wFlags |= MF_POPUP;1760 POPUPMENU *menu = MENU_GetMenu((UINT)id); 1761 if (menu) menu->wFlags |= MF_POPUP; 1745 1762 else 1746 1763 { … … 1785 1802 POPUPMENU *menu; 1786 1803 1787 if (!(menu = (POPUPMENU*)hMenu)) 1788 { 1789 //WARN("%04x not a menu handle\n", 1790 // hMenu ); 1804 if (!(menu = MENU_GetMenu(hMenu))) 1791 1805 return NULL; 1792 }1793 1806 1794 1807 /* Find where to insert new item */ … … 1799 1812 /* Some programs specify the menu length to do that */ 1800 1813 pos = menu->nItems; 1801 } 1802 else 1814 } else 1803 1815 { 1804 1816 if (!MENU_FindItem( &hMenu, &pos, flags )) 1805 1817 { 1806 //WARN("item %x not found\n", 1807 // pos ); 1818 //FIXME("item %x not found\n", pos ); 1808 1819 return NULL; 1809 1820 } 1810 if (!(menu = (LPPOPUPMENU)hMenu)) 1811 { 1812 //WARN("%04x not a menu handle\n", 1813 // hMenu); 1821 if (!(menu = MENU_GetMenu(hMenu))) 1814 1822 return NULL; 1815 }1816 1823 } 1817 1824 … … 1952 1959 MENUITEM *item; 1953 1960 1954 menu = (POPUPMENU*)hmenu;1955 1956 if ( menu->FocusedItem == NO_SELECTED_ITEM) return 0;1961 menu = MENU_GetMenu(hmenu); 1962 1963 if ((!menu) || (menu->FocusedItem == NO_SELECTED_ITEM)) return 0; 1957 1964 1958 1965 item = &menu->items[menu->FocusedItem]; … … 1971 1978 BOOL sendMenuSelect ) 1972 1979 { 1973 POPUPMENU *menu = (POPUPMENU*)hmenu;1980 POPUPMENU *menu = MENU_GetMenu(hmenu); 1974 1981 1975 1982 //TRACE("owner=0x%04x hmenu=0x%04x 0x%04x\n", hwndOwner, hmenu, sendMenuSelect); … … 1990 1997 } else return; 1991 1998 1992 submenu = (POPUPMENU*)hsubmenu;1999 submenu = MENU_GetMenu(hsubmenu); 1993 2000 MENU_HideSubPopups( hwndOwner, hsubmenu, FALSE ); 1994 2001 MENU_SelectItem( hwndOwner, hsubmenu, NO_SELECTED_ITEM, sendMenuSelect, 0 ); … … 2025 2032 //TRACE("owner=0x%04x hmenu=0x%04x 0x%04x\n", hwndOwner, hmenu, selectFirst); 2026 2033 2027 if (!(menu = (POPUPMENU*)hmenu)) return hmenu;2034 if (!(menu = MENU_GetMenu(hmenu))) return hmenu; 2028 2035 2029 2036 if (menu->FocusedItem == NO_SELECTED_ITEM) … … 2124 2131 static HMENU MENU_PtMenu(HMENU hMenu,POINT pt,BOOL inMenuBar) 2125 2132 { 2126 POPUPMENU *menu = (POPUPMENU*)hMenu;2133 POPUPMENU *menu = MENU_GetMenu(hMenu); 2127 2134 register UINT ht = menu->FocusedItem; 2128 2135 … … 2165 2172 { 2166 2173 MENUITEM *item; 2167 POPUPMENU *menu = (POPUPMENU*)hMenu;2174 POPUPMENU *menu = MENU_GetMenu(hMenu); 2168 2175 2169 2176 //TRACE("%p hmenu=0x%04x\n", pmt, hMenu); … … 2207 2214 static void MENU_SwitchTracking( MTRACKER* pmt, HMENU hPtMenu, UINT id ) 2208 2215 { 2209 POPUPMENU *ptmenu = (POPUPMENU*)hPtMenu;2210 POPUPMENU *topmenu = (POPUPMENU*)pmt->hTopMenu;2216 POPUPMENU *ptmenu = MENU_GetMenu(hPtMenu); 2217 POPUPMENU *topmenu = MENU_GetMenu(pmt->hTopMenu); 2211 2218 2212 2219 //TRACE("%p hmenu=0x%04x 0x%04x\n", pmt, hPtMenu, id); … … 2237 2244 { 2238 2245 UINT id = 0; 2239 POPUPMENU *ptmenu = (POPUPMENU*)hPtMenu;2246 POPUPMENU *ptmenu = MENU_GetMenu(hPtMenu); 2240 2247 MENUITEM *item; 2241 2248 … … 2278 2285 { 2279 2286 UINT id = 0; 2280 POPUPMENU *ptmenu = (POPUPMENU*)hPtMenu;2287 POPUPMENU *ptmenu = MENU_GetMenu(hPtMenu); 2281 2288 MENUITEM *item; 2282 2289 … … 2315 2322 if( hPtMenu ) 2316 2323 { 2317 ptmenu = (POPUPMENU*)hPtMenu;2324 ptmenu = MENU_GetMenu(hPtMenu); 2318 2325 if( IS_SYSTEM_MENU(ptmenu) ) 2319 2326 id = 0; … … 2344 2351 static LRESULT MENU_DoNextMenu( MTRACKER* pmt, UINT vk ) 2345 2352 { 2346 POPUPMENU *menu = (POPUPMENU*)pmt->hTopMenu;2353 POPUPMENU *menu = MENU_GetMenu(pmt->hTopMenu); 2347 2354 2348 2355 if( (vk == VK_LEFT && menu->FocusedItem == 0 ) || … … 2373 2380 if( vk == VK_LEFT ) 2374 2381 { 2375 menu = (POPUPMENU*)hNewMenu;2382 menu = MENU_GetMenu(hNewMenu); 2376 2383 id = menu->nItems - 1; 2377 2384 } … … 2485 2492 2486 2493 hmenuprev = hmenutmp = pmt->hTopMenu; 2487 menu = (POPUPMENU*)hmenutmp;2494 menu = MENU_GetMenu(hmenutmp); 2488 2495 2489 2496 /* Try to move 1 column left (if possible) */ … … 2534 2541 { 2535 2542 HMENU hmenutmp; 2536 POPUPMENU *menu = (POPUPMENU*)pmt->hTopMenu;2543 POPUPMENU *menu = MENU_GetMenu(pmt->hTopMenu); 2537 2544 UINT nextcol; 2538 2545 … … 2619 2626 2620 2627 fEndMenu = FALSE; 2621 if (!(menu = (POPUPMENU*)hmenu)) return FALSE; 2622 2623 if (wFlags & TPM_BUTTONDOWN) MENU_ButtonDown( &mt, hmenu, wFlags ); 2628 if (!(menu = MENU_GetMenu(hmenu))) return FALSE; 2629 2630 if (wFlags & TPM_BUTTONDOWN) 2631 { 2632 /* Get the result in order to start the tracking or not */ 2633 fRemove = MENU_ButtonDown( &mt, hmenu, wFlags ); 2634 fEndMenu = !fRemove; 2635 } 2624 2636 2625 2637 //EVENT_Capture( mt.hOwnerWnd, HTMENU ); //CB: todo … … 2629 2641 while (!fEndMenu) 2630 2642 { 2631 menu = (POPUPMENU*)mt.hCurrentMenu;2643 menu = MENU_GetMenu(mt.hCurrentMenu); 2632 2644 msg.hwnd = (wFlags & TPM_ENTERIDLEEX && menu->wFlags & MF_POPUP) ? menu->hWnd : 0; 2633 2645 … … 2720 2732 case VK_DOWN: /* If on menu bar, pull-down the menu */ 2721 2733 2722 menu = (POPUPMENU*)mt.hCurrentMenu;2734 menu = MENU_GetMenu(mt.hCurrentMenu); 2723 2735 if (!(menu->wFlags & MF_POPUP)) 2724 2736 mt.hCurrentMenu = MENU_ShowSubPopup(mt.hOwnerWnd, mt.hTopMenu, TRUE, wFlags,&mt.pt); … … 2801 2813 ReleaseCapture(); 2802 2814 2803 menu = (POPUPMENU*)mt.hTopMenu;2815 menu = MENU_GetMenu(mt.hTopMenu); 2804 2816 2805 2817 if( IsWindow( mt.hOwnerWnd ) ) … … 3089 3101 // hwnd, menubarWidth, orgX, orgY ); 3090 3102 3091 if (!(lppop = (LPPOPUPMENU)getMenu(hwnd)))3103 if (!(lppop = MENU_GetMenu(getMenu(hwnd)))) 3092 3104 { 3093 3105 return 0; … … 3184 3196 3185 3197 /* Get the Popupmenu to access the owner menu */ 3186 if (!(menu = (POPUPMENU*)hMenu))3198 if (!(menu = MENU_GetMenu(hMenu))) 3187 3199 return (UINT)-1; 3188 3200 … … 3201 3213 3202 3214 /* Get the parent menu to access*/ 3203 if (!(parentMenu = (POPUPMENU*)menu->hSysMenuOwner))3215 if (!(parentMenu = MENU_GetMenu(menu->hSysMenuOwner))) 3204 3216 return (UINT)-1; 3205 3217 … … 3217 3229 * GetMenuString32A (USER32.268) 3218 3230 */ 3219 INT WINAPI GetMenuStringA(HMENU hMenu, UINT wItemID, 3220 LPSTR str, INT nMaxSiz, UINT wFlags ) 3221 { 3231 INT WINAPI GetMenuStringA( 3232 HMENU hMenu, /* [in] menuhandle */ 3233 UINT wItemID, /* [in] menu item (dep. on wFlags) */ 3234 LPSTR str, /* [out] outbuffer. If NULL, func returns entry length*/ 3235 INT nMaxSiz, /* [in] length of buffer. if 0, func returns entry len*/ 3236 UINT wFlags /* [in] MF_ flags */ 3237 ) { 3222 3238 MENUITEM *item; 3223 3239 … … 3270 3286 // hWnd, hMenu, wItemID, wHilite); 3271 3287 if (!MENU_FindItem( &hMenu, &wItemID, wHilite )) return FALSE; 3272 if (!(menu = (LPPOPUPMENU)hMenu)) return FALSE;3288 if (!(menu = MENU_GetMenu(hMenu))) return FALSE; 3273 3289 if (menu->FocusedItem == wItemID) return TRUE; 3274 3290 MENU_HideSubPopups( hWnd, hMenu, FALSE ); … … 3295 3311 if (item->fType & MF_POPUP) 3296 3312 { 3297 POPUPMENU *menu = (POPUPMENU*)item->hSubMenu;3313 POPUPMENU *menu = MENU_GetMenu(item->hSubMenu); 3298 3314 if (!menu) return -1; 3299 3315 else return (menu->nItems << 8) | ((item->fState|item->fType) & 0xff); … … 3314 3330 INT WINAPI GetMenuItemCount( HMENU hMenu ) 3315 3331 { 3316 LPPOPUPMENU menu = (LPPOPUPMENU)hMenu;3332 LPPOPUPMENU menu = MENU_GetMenu(hMenu); 3317 3333 3318 3334 dprintf(("USER32: GetMenuItemCount")); 3319 3335 3320 if (! IS_A_MENU(menu)) return -1;3336 if (!menu) return -1; 3321 3337 //TRACE("(%04x) returning %d\n", 3322 3338 // hMenu, menu->nItems ); … … 3366 3382 3367 3383 if (flags & MF_POPUP) /* Set the MF_POPUP flag on the popup-menu */ 3368 ( (POPUPMENU *)(HMENU)id)->wFlags |= MF_POPUP;3384 (MENU_GetMenu((HMENU)id))->wFlags |= MF_POPUP; 3369 3385 3370 3386 item->hCheckBit = item->hUnCheckBit = 0; … … 3428 3444 //TRACE("(menu=%04x pos=%04x flags=%04x)\n",hMenu, nPos, wFlags); 3429 3445 if (!(item = MENU_FindItem( &hMenu, &nPos, wFlags ))) return FALSE; 3430 if (!(menu = (LPPOPUPMENU)hMenu)) return FALSE;3446 if (!(menu = MENU_GetMenu(hMenu))) return FALSE; 3431 3447 3432 3448 /* Remove item */ … … 3612 3628 if (hMenu && hMenu != MENU_DefSysPopup) 3613 3629 { 3614 LPPOPUPMENU lppop = (LPPOPUPMENU)hMenu;3630 LPPOPUPMENU lppop = MENU_GetMenu(hMenu); 3615 3631 HWND pTPWnd = MENU_GetTopPopupWnd(); 3616 3632 … … 3618 3634 SetWindowLongA(pTPWnd,0,0); 3619 3635 3620 if (IS_A_MENU( lppop )) 3636 if (!IS_A_MENU(lppop)) lppop = NULL; 3637 if (lppop) 3621 3638 { 3622 3639 lppop->wMagic = 0; /* Mark it as destroyed */ … … 3672 3689 else 3673 3690 { 3674 POPUPMENU *menu = (POPUPMENU*)hSysMenu;3675 if( IS_A_MENU(menu))3691 POPUPMENU *menu = MENU_GetMenu(hSysMenu); 3692 if(menu) 3676 3693 { 3677 3694 if( menu->nItems > 0 && menu->items[0].hSubMenu == MENU_DefSysPopup ) … … 3701 3718 /* Store the dummy sysmenu handle to facilitate the refresh */ 3702 3719 /* of the close button if the SC_CLOSE item change */ 3703 menu = (POPUPMENU*)retvalue;3704 if ( IS_A_MENU(menu))3720 menu = MENU_GetMenu(retvalue); 3721 if (menu) 3705 3722 menu->hSysMenuOwner = hSysMenu; 3706 3723 } … … 3766 3783 LPPOPUPMENU lpmenu; 3767 3784 3768 if (!(lpmenu = (LPPOPUPMENU)hMenu))3785 if (!(lpmenu = MENU_GetMenu(hMenu))) 3769 3786 { 3770 3787 return FALSE; … … 3811 3828 if (!(GetWindowLongA(hWnd,GWL_STYLE) & WS_CHILD) && getMenu(hWnd)) 3812 3829 { 3813 lppop = (LPPOPUPMENU)getMenu(hWnd);3830 lppop = MENU_GetMenu(getMenu(hWnd)); 3814 3831 if (lppop == NULL) 3815 3832 { … … 4095 4112 menu->hSubMenu = lpmii->hSubMenu; 4096 4113 if (menu->hSubMenu) { 4097 POPUPMENU *subMenu = (POPUPMENU*)(UINT)menu->hSubMenu;4098 if ( IS_A_MENU(subMenu)) {4114 POPUPMENU *subMenu = MENU_GetMenu((UINT)menu->hSubMenu); 4115 if (subMenu) { 4099 4116 subMenu->wFlags |= MF_POPUP; 4100 4117 menu->fType |= MF_POPUP; … … 4158 4175 //TRACE("(0x%x,%d,%d)\n", hmenu, uItem, bypos); 4159 4176 4160 if (!(menu = (POPUPMENU*)hmenu)) return FALSE;4177 if (!(menu = MENU_GetMenu(hmenu))) return FALSE; 4161 4178 4162 4179 /* reset all default-item flags */ … … 4207 4224 //TRACE("(0x%x,%d,%d)\n", hmenu, bypos, flags); 4208 4225 4209 if (!(menu = (POPUPMENU*)hmenu)) return -1;4226 if (!(menu = MENU_GetMenu(hmenu))) return -1; 4210 4227 4211 4228 /* find default item */ … … 4326 4343 if(!hwnd) 4327 4344 { 4328 itemMenu = (POPUPMENU*)hMenu;4345 itemMenu = MENU_GetMenu(hMenu); 4329 4346 if (itemMenu == NULL) { 4330 4331 4332 4347 SetLastError(ERROR_INVALID_PARAMETER); 4348 return FALSE; 4349 } 4333 4350 4334 4351 if(itemMenu->hWnd == 0) … … 4338 4355 4339 4356 if ((rect == NULL) || (item == NULL)) { 4340 4357 SetLastError(ERROR_INVALID_PARAMETER); 4341 4358 return FALSE; 4342 4359 } … … 4363 4380 //TRACE("(0x%04x %p)\n", hMenu, lpmi); 4364 4381 4365 if (lpmi && (lpmi->cbSize==sizeof(MENUINFO)) && (menu= (POPUPMENU*)hMenu))4382 if (lpmi && (lpmi->cbSize==sizeof(MENUINFO)) && (menu=MENU_GetMenu(hMenu))) 4366 4383 { 4367 4384 … … 4399 4416 //TRACE("(0x%04x %p)\n", hMenu, lpmi); 4400 4417 4401 if (lpmi && (menu = (POPUPMENU*)hMenu))4418 if (lpmi && (menu = MENU_GetMenu(hMenu))) 4402 4419 { 4403 4420 … … 4432 4449 //TRACE("(0x%04x 0x%08lx)\n", hMenu, dwContextHelpID); 4433 4450 4434 menu = (POPUPMENU*)hMenu;4451 menu = MENU_GetMenu(hMenu); 4435 4452 if (menu) 4436 4453 { … … 4451 4468 //TRACE("(0x%04x)\n", hMenu); 4452 4469 4453 menu = (POPUPMENU*)hMenu;4470 menu = MENU_GetMenu(hMenu); 4454 4471 if (menu) 4455 4472 { -
trunk/src/user32/scroll.cpp
r2469 r2611 1 /* $Id: scroll.cpp,v 1.3 2 2000-01-18 20:10:44 sandervlExp $ */1 /* $Id: scroll.cpp,v 1.33 2000-02-03 17:13:01 cbratschi Exp $ */ 2 2 /* 3 3 * Scrollbar control … … 8 8 * Copyright 1994, 1996 Alexandre Julliard 9 9 * 10 * WINE version: 99103110 * WINE version: 20000130 11 11 * 12 12 * Status: complete … … 1260 1260 // infoPtr->MinVal, infoPtr->MaxVal ); 1261 1261 1262 /* don't change the scrollbar state if SetScrollInfo 1263 * is just called with SIF_DISABLENOSCROLL 1264 */ 1265 if(!(info->fMask & SIF_ALL)) goto done; 1266 1262 1267 /* Check if the scrollbar should be hidden or disabled */ 1263 1268 if (info->fMask & (SIF_RANGE | SIF_PAGE | SIF_DISABLENOSCROLL)) -
trunk/src/user32/win32wbase.cpp
r2569 r2611 1 /* $Id: win32wbase.cpp,v 1.1 49 2000-01-29 20:46:52 sandervlExp $ */1 /* $Id: win32wbase.cpp,v 1.150 2000-02-03 17:13:01 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 651 651 if(!(flags & WIN_NEED_SIZE)) 652 652 { 653 LPARAM lParam;654 655 653 SendInternalMessageA(WM_SIZE, SIZE_RESTORED, 656 654 MAKELONG(rectClient.right-rectClient.left, 657 655 rectClient.bottom-rectClient.top)); 658 656 659 if(getParent()) {//in parent coordinates 660 POINT point; 661 662 point.x = rectClient.left; 663 point.y = rectClient.top; 664 MapWindowPoints(getWindowHandle(), getParent()->getWindowHandle(), &point, 1); 665 666 lParam = MAKELONG(point.x, point.y); 667 } 668 else {//in screen coordinates 669 lParam = MAKELONG(rectWindow.left+rectClient.left, rectWindow.top+rectClient.top); 670 } 671 672 SendInternalMessageA(WM_MOVE, 0, lParam); 657 SendInternalMessageA(WM_MOVE,0,MAKELONG(rectClient.left,rectClient.top)); 673 658 } 674 659 … … 684 669 } 685 670 671 //CB: timew32.exe, blockcad.exe -> children not shown!!! 686 672 if (cs->style & WS_VISIBLE) ShowWindow(sw); 687 673 … … 1280 1266 { 1281 1267 LPCSTR lpsz = (LPCSTR)lParam; 1282 CHAR* oldNameA = windowNameA; 1283 WCHAR* oldNameW = windowNameW;1284 1268 1269 if(windowNameA) free(windowNameA); 1270 if(windowNameW) free(windowNameW); 1285 1271 if (lParam) 1286 1272 { … … 1298 1284 } 1299 1285 dprintf(("WM_SETTEXT of %x to %s\n", Win32Hwnd, lParam)); 1300 if ((dwStyle & WS_CAPTION) && (lstrcmpA(oldNameA,windowNameA) != 0))1301 { 1302 UpdateCaptionText();1286 if ((dwStyle & WS_CAPTION) == WS_CAPTION) 1287 { 1288 HandleNCPaint((HRGN)1); 1303 1289 OSLibWinSetWindowText(OS2HwndFrame,(LPSTR)windowNameA); 1304 1290 } 1305 1306 if(oldNameA) free(oldNameA);1307 if(oldNameW) free(oldNameW);1308 1291 1309 1292 return TRUE; … … 1428 1411 if (!(wpos->flags & SWP_NOMOVE) && !(wpos->flags & SWP_NOCLIENTMOVE)) 1429 1412 { 1430 SendInternalMessageA(WM_MOVE, 0, MAKELONG( wpos->x + rectClient.left, wpos->y +rectClient.top));1413 SendInternalMessageA(WM_MOVE, 0, MAKELONG(rectClient.left,rectClient.top)); 1431 1414 } 1432 1415 if (!(wpos->flags & SWP_NOSIZE) && !(wpos->flags & SWP_NOCLIENTSIZE)) … … 1696 1679 LPWSTR lpsz = (LPWSTR)lParam; 1697 1680 1698 CHAR* oldNameA = windowNameA; 1699 WCHAR* oldNameW = windowNameW; 1700 1681 if(windowNameA) free(windowNameA); 1682 if(windowNameW) free(windowNameW); 1701 1683 if (lParam) 1702 1684 { … … 1714 1696 } 1715 1697 dprintf(("WM_SETTEXT of %x\n",Win32Hwnd)); 1716 if ((dwStyle & WS_CAPTION) && (lstrcmpW(oldNameW,windowNameW) != 0))1717 { 1718 UpdateCaptionText();1698 if ((dwStyle & WS_CAPTION) == WS_CAPTION) 1699 { 1700 HandleNCPaint((HRGN)1); 1719 1701 OSLibWinSetWindowText(OS2HwndFrame,(LPSTR)windowNameA); 1720 1702 } 1721 1722 if(oldNameA) free(oldNameA);1723 if(oldNameW) free(oldNameW);1724 1703 1725 1704 return TRUE; … … 1978 1957 MAKELONG(rectClient.right-rectClient.left, 1979 1958 rectClient.bottom-rectClient.top)); 1980 DWORD lParam; 1981 1982 if(getParent()) {//in parent coordinates 1983 POINT point; 1984 1985 point.x = rectClient.left; 1986 point.y = rectClient.top; 1987 MapWindowPoints(getWindowHandle(), getParent()->getWindowHandle(), &point, 1); 1988 1989 lParam = MAKELONG(point.x, point.y); 1990 } 1991 else {//in screen coordinates 1992 lParam = MAKELONG(rectWindow.left+rectClient.left, rectWindow.top+rectClient.top); 1993 } 1994 SendInternalMessageA(WM_MOVE, 0, lParam); 1959 SendInternalMessageA(WM_MOVE,0,MAKELONG(rectClient.left,rectClient.top)); 1995 1960 } 1996 1961 switch(nCmdShow) -
trunk/src/user32/win32wbase.h
r2552 r2611 1 /* $Id: win32wbase.h,v 1.7 7 2000-01-28 22:26:00 sandervlExp $ */1 /* $Id: win32wbase.h,v 1.78 2000-02-03 17:13:02 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 106 106 ULONG MsgPosChanging(LPARAM lp); 107 107 ULONG MsgPosChanged(LPARAM lp); 108 108 ULONG MsgActivate(BOOL fActivate, BOOL fMinimized, HWND hwnd, HWND hwndOS2Win); 109 109 ULONG MsgSetFocus(HWND hwnd); 110 110 ULONG MsgKillFocus(HWND hwnd); … … 401 401 VOID DrawMinButton(HDC hdc,RECT *rect,BOOL down,BOOL bGrayed); 402 402 VOID DrawCaption(HDC hdc,RECT *rect,BOOL active,BOOL redrawText); 403 VOID UpdateCaptionText();404 403 VOID DoNCPaint(HRGN clip,BOOL suppress_menupaint); 405 404 LONG HandleNCPaint(HRGN clip); -
trunk/src/user32/win32wbasenonclient.cpp
r2577 r2611 1 /* $Id: win32wbasenonclient.cpp,v 1. 7 2000-01-30 18:48:29 sandervlExp $ */1 /* $Id: win32wbasenonclient.cpp,v 1.8 2000-02-03 17:13:03 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 (non-client methods) … … 415 415 if (!PtInRect(&rect,pt)) return HTNOWHERE; 416 416 417 if (!(flags & WIN_MANAGED)) 418 { 419 /* Check borders */ 420 if (HAS_THICKFRAME(dwStyle,dwExStyle)) 421 { 422 InflateRect(&rect,-GetSystemMetrics(SM_CXFRAME),-GetSystemMetrics(SM_CYFRAME)); 423 if (!PtInRect(&rect,pt)) 417 /* Check borders */ 418 if (HAS_THICKFRAME(dwStyle,dwExStyle)) 419 { 420 InflateRect(&rect,-GetSystemMetrics(SM_CXFRAME),-GetSystemMetrics(SM_CYFRAME)); 421 if (!PtInRect(&rect,pt)) 422 { 423 /* Check top sizing border */ 424 if (pt.y < rect.top) 424 425 { 425 /* Check top sizing border */ 426 if (pt.y < rect.top) 427 { 428 if (pt.x < rect.left+GetSystemMetrics(SM_CXSIZE)) return HTTOPLEFT; 429 if (pt.x >= rect.right-GetSystemMetrics(SM_CXSIZE)) return HTTOPRIGHT; 430 return HTTOP; 431 } 432 /* Check bottom sizing border */ 433 if (pt.y >= rect.bottom) 434 { 435 if (pt.x < rect.left+GetSystemMetrics(SM_CXSIZE)) return HTBOTTOMLEFT; 436 if (pt.x >= rect.right-GetSystemMetrics(SM_CXSIZE)) return HTBOTTOMRIGHT; 437 return HTBOTTOM; 438 } 439 /* Check left sizing border */ 440 if (pt.x < rect.left) 441 { 442 if (pt.y < rect.top+GetSystemMetrics(SM_CYSIZE)) return HTTOPLEFT; 443 if (pt.y >= rect.bottom-GetSystemMetrics(SM_CYSIZE)) return HTBOTTOMLEFT; 444 return HTLEFT; 445 } 446 /* Check right sizing border */ 447 if (pt.x >= rect.right) 448 { 449 if (pt.y < rect.top+GetSystemMetrics(SM_CYSIZE)) return HTTOPRIGHT; 450 if (pt.y >= rect.bottom-GetSystemMetrics(SM_CYSIZE)) return HTBOTTOMRIGHT; 451 return HTRIGHT; 452 } 426 if (pt.x < rect.left+GetSystemMetrics(SM_CXSIZE)) return HTTOPLEFT; 427 if (pt.x >= rect.right-GetSystemMetrics(SM_CXSIZE)) return HTTOPRIGHT; 428 return HTTOP; 453 429 } 454 } else /* No thick frame */ 455 { 456 if (HAS_DLGFRAME(dwStyle,dwExStyle)) 457 InflateRect(&rect, -GetSystemMetrics(SM_CXDLGFRAME), -GetSystemMetrics(SM_CYDLGFRAME)); 458 else if (HAS_THINFRAME(dwStyle )) 459 InflateRect(&rect, -GetSystemMetrics(SM_CXBORDER), -GetSystemMetrics(SM_CYBORDER)); 460 if (!PtInRect( &rect, pt )) return HTBORDER; 461 } 462 463 /* Check caption */ 464 465 if ((dwStyle & WS_CAPTION) == WS_CAPTION) 466 { 467 if (dwExStyle & WS_EX_TOOLWINDOW) 468 rect.top += GetSystemMetrics(SM_CYSMCAPTION)-1; 469 else 470 rect.top += GetSystemMetrics(SM_CYCAPTION)-1; 471 if (!PtInRect(&rect,pt)) 430 /* Check bottom sizing border */ 431 if (pt.y >= rect.bottom) 472 432 { 473 /* Check system menu */ 474 if(dwStyle & WS_SYSMENU) 475 { 476 /* Check if there is an user icon */ 477 HICON hIcon = (HICON) GetClassLongA(Win32Hwnd, GCL_HICONSM); 478 if(!hIcon) hIcon = (HICON) GetClassLongA(Win32Hwnd, GCL_HICON); 479 480 /* If there is an icon associated with the window OR */ 481 /* If there is no hIcon specified and this is not a modal dialog, */ 482 /* there is a system menu icon. */ 483 if((hIcon != 0) || (!(dwStyle & DS_MODALFRAME))) 484 rect.left += GetSystemMetrics(SM_CYCAPTION) - 1; 485 } 486 if (pt.x < rect.left) return HTSYSMENU; 487 488 /* Check close button */ 489 if (dwStyle & WS_SYSMENU) 490 rect.right -= GetSystemMetrics(SM_CYCAPTION) - 1; 491 if (pt.x > rect.right) return HTCLOSE; 492 493 /* Check maximize box */ 494 /* In win95 there is automatically a Maximize button when there is a minimize one*/ 495 if ((dwStyle & WS_MAXIMIZEBOX)|| (dwStyle & WS_MINIMIZEBOX)) 496 rect.right -= GetSystemMetrics(SM_CXSIZE) + 1; 497 if (pt.x > rect.right) return HTMAXBUTTON; 498 499 /* Check minimize box */ 500 /* In win95 there is automatically a Maximize button when there is a Maximize one*/ 501 if ((dwStyle & WS_MINIMIZEBOX)||(dwStyle & WS_MAXIMIZEBOX)) 502 rect.right -= GetSystemMetrics(SM_CXSIZE) + 1; 503 504 if (pt.x > rect.right) return HTMINBUTTON; 505 return HTCAPTION; 433 if (pt.x < rect.left+GetSystemMetrics(SM_CXSIZE)) return HTBOTTOMLEFT; 434 if (pt.x >= rect.right-GetSystemMetrics(SM_CXSIZE)) return HTBOTTOMRIGHT; 435 return HTBOTTOM; 506 436 } 437 /* Check left sizing border */ 438 if (pt.x < rect.left) 439 { 440 if (pt.y < rect.top+GetSystemMetrics(SM_CYSIZE)) return HTTOPLEFT; 441 if (pt.y >= rect.bottom-GetSystemMetrics(SM_CYSIZE)) return HTBOTTOMLEFT; 442 return HTLEFT; 443 } 444 /* Check right sizing border */ 445 if (pt.x >= rect.right) 446 { 447 if (pt.y < rect.top+GetSystemMetrics(SM_CYSIZE)) return HTTOPRIGHT; 448 if (pt.y >= rect.bottom-GetSystemMetrics(SM_CYSIZE)) return HTBOTTOMRIGHT; 449 return HTRIGHT; 450 } 451 } 452 } else /* No thick frame */ 453 { 454 if (HAS_DLGFRAME(dwStyle,dwExStyle)) 455 InflateRect(&rect, -GetSystemMetrics(SM_CXDLGFRAME), -GetSystemMetrics(SM_CYDLGFRAME)); 456 else if (HAS_THINFRAME(dwStyle )) 457 InflateRect(&rect, -GetSystemMetrics(SM_CXBORDER), -GetSystemMetrics(SM_CYBORDER)); 458 if (!PtInRect( &rect, pt )) return HTBORDER; 459 } 460 461 /* Check caption */ 462 463 if ((dwStyle & WS_CAPTION) == WS_CAPTION) 464 { 465 if (dwExStyle & WS_EX_TOOLWINDOW) 466 rect.top += GetSystemMetrics(SM_CYSMCAPTION)-1; 467 else 468 rect.top += GetSystemMetrics(SM_CYCAPTION)-1; 469 if (!PtInRect(&rect,pt)) 470 { 471 /* Check system menu */ 472 if(dwStyle & WS_SYSMENU) 473 { 474 /* Check if there is an user icon */ 475 HICON hIcon = (HICON) GetClassLongA(Win32Hwnd, GCL_HICONSM); 476 if(!hIcon) hIcon = (HICON) GetClassLongA(Win32Hwnd, GCL_HICON); 477 478 /* If there is an icon associated with the window OR */ 479 /* If there is no hIcon specified and this is not a modal dialog, */ 480 /* there is a system menu icon. */ 481 if((hIcon != 0) || (!(dwStyle & DS_MODALFRAME))) 482 rect.left += GetSystemMetrics(SM_CYCAPTION) - 1; 483 } 484 if (pt.x < rect.left) return HTSYSMENU; 485 486 /* Check close button */ 487 if (dwStyle & WS_SYSMENU) 488 rect.right -= GetSystemMetrics(SM_CYCAPTION) - 1; 489 if (pt.x > rect.right) return HTCLOSE; 490 491 /* Check maximize box */ 492 /* In win95 there is automatically a Maximize button when there is a minimize one*/ 493 if ((dwStyle & WS_MAXIMIZEBOX)|| (dwStyle & WS_MINIMIZEBOX)) 494 rect.right -= GetSystemMetrics(SM_CXSIZE) + 1; 495 if (pt.x > rect.right) return HTMAXBUTTON; 496 497 /* Check minimize box */ 498 /* In win95 there is automatically a Maximize button when there is a Maximize one*/ 499 if ((dwStyle & WS_MINIMIZEBOX)||(dwStyle & WS_MAXIMIZEBOX)) 500 rect.right -= GetSystemMetrics(SM_CXSIZE) + 1; 501 502 if (pt.x > rect.right) return HTMINBUTTON; 503 return HTCAPTION; 507 504 } 508 505 } … … 557 554 rect->bottom = rectWindow.bottom - rectWindow.top; 558 555 559 if ( (dwStyle & WS_ICONIC) || (flags & WIN_MANAGED)) return;556 if (dwStyle & WS_ICONIC) return; 560 557 561 558 /* Remove frame from rectangle */ … … 618 615 BOOL Win32BaseWindow::DrawSysButton(HDC hdc,RECT *rect) 619 616 { 620 if(!(flags & WIN_MANAGED)) 621 { 622 HICON hIcon; 623 RECT r; 624 625 if (!rect) GetInsideRect(&r); 626 else r = *rect; 627 628 hIcon = (HICON) GetClassLongA(Win32Hwnd, GCL_HICONSM); 629 if(!hIcon) hIcon = (HICON) GetClassLongA(Win32Hwnd, GCL_HICON); 630 631 /* If there is no hIcon specified or this is not a modal dialog, */ 632 /* get the default one. */ 633 if(hIcon == 0) 634 if (!(dwStyle & DS_MODALFRAME)) 635 hIcon = LoadImageA(0, MAKEINTRESOURCEA(OIC_ODINICON), IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR); 636 637 if (hIcon) 638 DrawIconEx(hdc,r.left+2,r.top+2,hIcon, 639 GetSystemMetrics(SM_CXSMICON), 640 GetSystemMetrics(SM_CYSMICON), 641 0, 0, DI_NORMAL); 642 643 return (hIcon != 0); 644 } 645 return FALSE; 617 HICON hIcon; 618 RECT r; 619 620 if (!rect) GetInsideRect(&r); 621 else r = *rect; 622 623 hIcon = (HICON) GetClassLongA(Win32Hwnd, GCL_HICONSM); 624 if(!hIcon) hIcon = (HICON) GetClassLongA(Win32Hwnd, GCL_HICON); 625 626 /* If there is no hIcon specified or this is not a modal dialog, */ 627 /* get the default one. */ 628 if(hIcon == 0) 629 if (!(dwStyle & DS_MODALFRAME)) 630 hIcon = LoadImageA(0, MAKEINTRESOURCEA(OIC_ODINICON), IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR); 631 632 if (hIcon) 633 DrawIconEx(hdc,r.left+2,r.top+2,hIcon, 634 GetSystemMetrics(SM_CXSMICON), 635 GetSystemMetrics(SM_CYSMICON), 636 0, 0, DI_NORMAL); 637 638 return (hIcon != 0); 646 639 } 647 640 //****************************************************************************** … … 696 689 RECT r; 697 690 HDC hdcMem; 698 699 if( !(flags & WIN_MANAGED) ) 700 { 701 BITMAP bmp; 702 HBITMAP hBmp, hOldBmp; 703 704 if (!rect) GetInsideRect(&r); 705 else r = *rect; 706 707 hdcMem = CreateCompatibleDC( hdc ); 708 hBmp = down ? hbitmapCloseD : hbitmapClose; 709 hOldBmp = SelectObject (hdcMem, hBmp); 710 GetObjectA (hBmp, sizeof(BITMAP), &bmp); 711 712 BitBlt (hdc, r.right - (GetSystemMetrics(SM_CYCAPTION) + 1 + bmp.bmWidth) / 2, 713 r.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2, 714 bmp.bmWidth, bmp.bmHeight, hdcMem, 0, 0, SRCCOPY); 715 716 if(bGrayed) 717 DrawGrayButton(hdc,r.right - (GetSystemMetrics(SM_CYCAPTION) + 1 + bmp.bmWidth) / 2 + 2, 718 r.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2 + 2); 719 720 SelectObject (hdcMem, hOldBmp); 721 DeleteDC (hdcMem); 722 } 691 BITMAP bmp; 692 HBITMAP hBmp, hOldBmp; 693 694 if (!rect) GetInsideRect(&r); 695 else r = *rect; 696 697 hdcMem = CreateCompatibleDC( hdc ); 698 hBmp = down ? hbitmapCloseD : hbitmapClose; 699 hOldBmp = SelectObject (hdcMem, hBmp); 700 GetObjectA (hBmp, sizeof(BITMAP), &bmp); 701 702 BitBlt (hdc, r.right - (GetSystemMetrics(SM_CYCAPTION) + 1 + bmp.bmWidth) / 2, 703 r.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2, 704 bmp.bmWidth, bmp.bmHeight, hdcMem, 0, 0, SRCCOPY); 705 706 if(bGrayed) 707 DrawGrayButton(hdc,r.right - (GetSystemMetrics(SM_CYCAPTION) + 1 + bmp.bmWidth) / 2 + 2, 708 r.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2 + 2); 709 710 SelectObject (hdcMem, hOldBmp); 711 DeleteDC (hdcMem); 723 712 } 724 713 //****************************************************************************** … … 728 717 RECT r; 729 718 HDC hdcMem; 730 731 if( !(flags & WIN_MANAGED)) 732 { 733 BITMAP bmp; 734 HBITMAP hBmp,hOldBmp; 735 736 if (!rect) GetInsideRect(&r); 737 else r = *rect; 738 hdcMem = CreateCompatibleDC( hdc ); 739 hBmp = IsZoomed(Win32Hwnd) ? 740 (down ? hbitmapRestoreD : hbitmapRestore ) : 741 (down ? hbitmapMaximizeD: hbitmapMaximize); 742 hOldBmp=SelectObject( hdcMem, hBmp ); 743 GetObjectA (hBmp, sizeof(BITMAP), &bmp); 744 745 if (dwStyle & WS_SYSMENU) 746 r.right -= GetSystemMetrics(SM_CYCAPTION) + 1; 747 748 BitBlt( hdc, r.right - (GetSystemMetrics(SM_CXSIZE) + bmp.bmWidth) / 2, 719 BITMAP bmp; 720 HBITMAP hBmp,hOldBmp; 721 722 if (!rect) GetInsideRect(&r); 723 else r = *rect; 724 hdcMem = CreateCompatibleDC( hdc ); 725 hBmp = IsZoomed(Win32Hwnd) ? 726 (down ? hbitmapRestoreD : hbitmapRestore ) : 727 (down ? hbitmapMaximizeD: hbitmapMaximize); 728 hOldBmp=SelectObject( hdcMem, hBmp ); 729 GetObjectA (hBmp, sizeof(BITMAP), &bmp); 730 731 if (dwStyle & WS_SYSMENU) 732 r.right -= GetSystemMetrics(SM_CYCAPTION) + 1; 733 734 BitBlt( hdc, r.right - (GetSystemMetrics(SM_CXSIZE) + bmp.bmWidth) / 2, 735 r.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2, 736 bmp.bmWidth, bmp.bmHeight, hdcMem, 0, 0, SRCCOPY ); 737 738 if(bGrayed) 739 DrawGrayButton(hdc, r.right - (GetSystemMetrics(SM_CXSIZE) + bmp.bmWidth) / 2 + 2, 740 r.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2 + 2); 741 742 SelectObject (hdcMem, hOldBmp); 743 DeleteDC( hdcMem ); 744 } 745 //****************************************************************************** 746 //****************************************************************************** 747 VOID Win32BaseWindow::DrawMinButton(HDC hdc,RECT *rect,BOOL down,BOOL bGrayed) 748 { 749 RECT r; 750 HDC hdcMem; 751 BITMAP bmp; 752 HBITMAP hBmp,hOldBmp; 753 754 if (!rect) GetInsideRect(&r); 755 else r = *rect; 756 757 hdcMem = CreateCompatibleDC( hdc ); 758 hBmp = down ? hbitmapMinimizeD : hbitmapMinimize; 759 hOldBmp= SelectObject( hdcMem, hBmp ); 760 GetObjectA (hBmp, sizeof(BITMAP), &bmp); 761 762 if (dwStyle & WS_SYSMENU) 763 r.right -= GetSystemMetrics(SM_CYCAPTION) + 1; 764 765 /* In win 95 there is always a Maximize box when there is a Minimize one */ 766 if ((dwStyle & WS_MAXIMIZEBOX) || (dwStyle & WS_MINIMIZEBOX)) 767 r.right -= bmp.bmWidth; 768 769 BitBlt( hdc, r.right - (GetSystemMetrics(SM_CXSIZE) + bmp.bmWidth) / 2, 749 770 r.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2, 750 771 bmp.bmWidth, bmp.bmHeight, hdcMem, 0, 0, SRCCOPY ); 751 772 752 if(bGrayed) 753 DrawGrayButton(hdc, r.right - (GetSystemMetrics(SM_CXSIZE) + bmp.bmWidth) / 2 + 2, 754 r.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2 + 2); 755 756 757 SelectObject (hdcMem, hOldBmp); 758 DeleteDC( hdcMem ); 759 } 760 } 761 //****************************************************************************** 762 //****************************************************************************** 763 VOID Win32BaseWindow::DrawMinButton(HDC hdc,RECT *rect,BOOL down,BOOL bGrayed) 764 { 765 RECT r; 766 HDC hdcMem; 767 768 if( !(flags & WIN_MANAGED)) 769 770 { 771 BITMAP bmp; 772 HBITMAP hBmp,hOldBmp; 773 774 if (!rect) GetInsideRect(&r); 775 else r = *rect; 776 777 hdcMem = CreateCompatibleDC( hdc ); 778 hBmp = down ? hbitmapMinimizeD : hbitmapMinimize; 779 hOldBmp= SelectObject( hdcMem, hBmp ); 780 GetObjectA (hBmp, sizeof(BITMAP), &bmp); 781 782 if (dwStyle & WS_SYSMENU) 783 r.right -= GetSystemMetrics(SM_CYCAPTION) + 1; 784 785 /* In win 95 there is always a Maximize box when there is a Minimize one */ 786 if ((dwStyle & WS_MAXIMIZEBOX) || (dwStyle & WS_MINIMIZEBOX)) 787 r.right -= bmp.bmWidth; 788 789 BitBlt( hdc, r.right - (GetSystemMetrics(SM_CXSIZE) + bmp.bmWidth) / 2, 790 r.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2, 791 bmp.bmWidth, bmp.bmHeight, hdcMem, 0, 0, SRCCOPY ); 792 793 if(bGrayed) 794 DrawGrayButton(hdc, r.right - (GetSystemMetrics(SM_CXSIZE) + bmp.bmWidth) / 2 + 2, 795 r.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2 + 2); 796 797 798 SelectObject (hdcMem, hOldBmp); 799 DeleteDC( hdcMem ); 800 } 773 if(bGrayed) 774 DrawGrayButton(hdc, r.right - (GetSystemMetrics(SM_CXSIZE) + bmp.bmWidth) / 2 + 2, 775 r.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2 + 2); 776 777 778 SelectObject (hdcMem, hOldBmp); 779 DeleteDC( hdcMem ); 801 780 } 802 781 //****************************************************************************** … … 810 789 HDC memDC; 811 790 HBITMAP memBmp,oldBmp; 812 813 if (flags & WIN_MANAGED) return;814 791 815 792 memDC = CreateCompatibleDC(hdc); … … 934 911 //****************************************************************************** 935 912 //****************************************************************************** 936 VOID Win32BaseWindow::UpdateCaptionText()937 {938 BOOL active = flags & WIN_NCACTIVATED;939 HDC hdc;940 RECT rect,r;941 HRGN hrgn;942 943 if (!((dwStyle & WS_CAPTION) == WS_CAPTION)) return;944 945 rect.top = rect.left = 0;946 rect.right = rectWindow.right - rectWindow.left;947 rect.bottom = rectWindow.bottom - rectWindow.top;948 if(!(flags & WIN_MANAGED))949 {950 if (HAS_BIGFRAME( dwStyle, dwExStyle))951 {952 InflateRect(&rect,-2,-2);953 }954 955 if (HAS_THICKFRAME(dwStyle,dwExStyle))956 {957 INT width = GetSystemMetrics(SM_CXFRAME) - GetSystemMetrics(SM_CXEDGE);958 INT height = GetSystemMetrics(SM_CYFRAME) - GetSystemMetrics(SM_CYEDGE);959 960 InflateRect(&rect,-width,-height);961 }962 else if (HAS_DLGFRAME(dwStyle,dwExStyle))963 {964 INT width = GetSystemMetrics(SM_CXDLGFRAME) - GetSystemMetrics(SM_CXEDGE);965 INT height = GetSystemMetrics(SM_CYDLGFRAME) - GetSystemMetrics(SM_CYEDGE);966 967 InflateRect(&rect,-width,-height);968 }969 else if (HAS_THINFRAME(dwStyle))970 {971 }972 973 r = rect;974 if (dwExStyle & WS_EX_TOOLWINDOW)975 {976 r.bottom = rect.top + GetSystemMetrics(SM_CYSMCAPTION);977 }978 else979 {980 r.bottom = rect.top + GetSystemMetrics(SM_CYCAPTION);981 }982 983 //clip the buttons984 if ((dwStyle & WS_SYSMENU) && !(dwExStyle & WS_EX_TOOLWINDOW))985 {986 HICON hIcon;987 988 hIcon = (HICON) GetClassLongA(Win32Hwnd, GCL_HICONSM);989 if(!hIcon) hIcon = (HICON) GetClassLongA(Win32Hwnd, GCL_HICON);990 if (hIcon)991 rect.left += GetSystemMetrics(SM_CYCAPTION) - 1;992 }993 if (dwStyle & WS_SYSMENU)994 {995 rect.right -= GetSystemMetrics(SM_CYCAPTION) - 1;996 997 if ((dwStyle & WS_MAXIMIZEBOX) || (dwStyle & WS_MINIMIZEBOX))998 {999 rect.right -= GetSystemMetrics(SM_CXSIZE) + 1;1000 rect.right -= GetSystemMetrics(SM_CXSIZE) + 1;1001 }1002 }1003 1004 hrgn = CreateRectRgnIndirect(&rect);1005 hdc = GetDCEx(Win32Hwnd,hrgn,DCX_USESTYLE | DCX_WINDOW | DCX_INTERSECTRGN);1006 SelectObject(hdc,GetSysColorPen(COLOR_WINDOWFRAME));1007 DrawCaption(hdc,&r,active,TRUE);1008 DeleteObject(hrgn);1009 ReleaseDC(Win32Hwnd,hdc);1010 }1011 }1012 //******************************************************************************1013 //******************************************************************************1014 913 VOID Win32BaseWindow::DoNCPaint(HRGN clip,BOOL suppress_menupaint) 1015 914 { … … 1034 933 rect.bottom = rectWindow.bottom - rectWindow.top; 1035 934 1036 if ( clip > 1)1037 { 1038 // CB: unknown WINE handling (clip == 1), clip client?1039 GetRgnBox( clip, &rectClip);1040 } 935 if (clip > 1) 936 { 937 //only redraw caption 938 GetRgnBox(clip,&rectClip); 939 } 1041 940 else 1042 941 { … … 1047 946 SelectObject( hdc, GetSysColorPen(COLOR_WINDOWFRAME) ); 1048 947 1049 if(!(flags & WIN_MANAGED)) 1050 { 1051 if (HAS_BIGFRAME( dwStyle, dwExStyle)) 1052 { 1053 DrawEdge (hdc, &rect, EDGE_RAISED, BF_RECT | BF_ADJUST); 1054 } 1055 if (HAS_THICKFRAME( dwStyle, dwExStyle )) 1056 DrawFrame(hdc, &rect, FALSE, active ); 1057 else if (HAS_DLGFRAME( dwStyle, dwExStyle )) 1058 DrawFrame( hdc, &rect, TRUE, active ); 1059 else if (HAS_THINFRAME( dwStyle )) 1060 { 1061 SelectObject( hdc, GetStockObject(NULL_BRUSH) ); 1062 Rectangle( hdc, 0, 0, rect.right, rect.bottom ); 1063 } 1064 1065 if ((dwStyle & WS_CAPTION) == WS_CAPTION) 1066 { 1067 RECT r = rect; 1068 if (dwExStyle & WS_EX_TOOLWINDOW) 1069 { 1070 r.bottom = rect.top + GetSystemMetrics(SM_CYSMCAPTION); 1071 rect.top += GetSystemMetrics(SM_CYSMCAPTION); 1072 } 1073 else 1074 { 1075 r.bottom = rect.top + GetSystemMetrics(SM_CYCAPTION); 1076 rect.top += GetSystemMetrics(SM_CYCAPTION); 1077 } 1078 if( !clip || IntersectRect( &rfuzz, &r, &rectClip ) ) 1079 DrawCaption(hdc,&r,active,FALSE); 1080 } 1081 } 948 if (HAS_BIGFRAME( dwStyle, dwExStyle)) 949 { 950 DrawEdge (hdc, &rect, EDGE_RAISED, BF_RECT | BF_ADJUST); 951 } 952 if (HAS_THICKFRAME( dwStyle, dwExStyle )) 953 DrawFrame(hdc, &rect, FALSE, active ); 954 else if (HAS_DLGFRAME( dwStyle, dwExStyle )) 955 DrawFrame( hdc, &rect, TRUE, active ); 956 else if (HAS_THINFRAME( dwStyle )) 957 { 958 SelectObject( hdc, GetStockObject(NULL_BRUSH) ); 959 Rectangle( hdc, 0, 0, rect.right, rect.bottom ); 960 } 961 962 if ((dwStyle & WS_CAPTION) == WS_CAPTION) 963 { 964 RECT r = rect; 965 if (dwExStyle & WS_EX_TOOLWINDOW) 966 { 967 r.bottom = rect.top + GetSystemMetrics(SM_CYSMCAPTION); 968 rect.top += GetSystemMetrics(SM_CYSMCAPTION); 969 } 970 else 971 { 972 r.bottom = rect.top + GetSystemMetrics(SM_CYCAPTION); 973 rect.top += GetSystemMetrics(SM_CYCAPTION); 974 } 975 if( !clip || IntersectRect( &rfuzz, &r, &rectClip ) ) 976 DrawCaption(hdc,&r,active,FALSE); 977 } 978 1082 979 if (HAS_MENU()) 1083 980 { -
trunk/src/user32/win32wbasepos.cpp
r2521 r2611 1 /* $Id: win32wbasepos.cpp,v 1.1 1 2000-01-26 18:02:38cbratschi Exp $ */1 /* $Id: win32wbasepos.cpp,v 1.12 2000-02-03 17:13:03 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 (nonclient/position methods) … … 59 59 MinMax.ptMaxTrackSize.y = GetSystemMetrics(SM_CYSCREEN); 60 60 61 if (flags & WIN_MANAGED) xinc = yinc = 0; 62 else if (HAS_DLGFRAME( dwStyle, dwExStyle )) 61 if (HAS_DLGFRAME( dwStyle, dwExStyle )) 63 62 { 64 63 xinc = GetSystemMetrics(SM_CXDLGFRAME);
Note:
See TracChangeset
for help on using the changeset viewer.