- Timestamp:
- Jan 14, 2000, 6:48:33 PM (26 years ago)
- Location:
- trunk/src/user32/new
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/win32wbase.cpp
r2437 r2440 1 /* $Id: win32wbase.cpp,v 1.4 1 2000-01-14 14:45:17 sandervlExp $ */1 /* $Id: win32wbase.cpp,v 1.42 2000-01-14 17:48:32 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 1253 1253 { 1254 1254 LPCSTR lpsz = (LPCSTR)lParam; 1255 1256 if(windowNameA) free(windowNameA); 1257 if(windowNameW) free(windowNameW); 1255 CHAR* oldNameA = windowNameA; 1256 WCHAR* oldNameW = windowNameW; 1258 1257 1259 1258 if (lParam) … … 1272 1271 } 1273 1272 dprintf(("WM_SETTEXT of %x to %s\n", Win32Hwnd, lParam)); 1274 if ( dwStyle & WS_CAPTION)1275 { 1276 //CB: optimize!1277 HandleNCPaint(0);1278 } 1279 /* //CB: endless loop in trackbar.exe -> to fix 1280 if( OS2HwndFrame && (dwStyle & WS_CAPTION) == WS_CAPTION)1281 return OSLibWinSetWindowText(OS2HwndFrame,(LPSTR)windowNameA);1282 */ 1273 if ((dwStyle & WS_CAPTION) && (lstrcmpA(oldNameA,windowNameA) != 0)) 1274 { 1275 UpdateCaptionText(); 1276 OSLibWinSetWindowText(OS2HwndFrame,(LPSTR)windowNameA); 1277 } 1278 1279 if(oldNameA) free(oldNameA); 1280 if(oldNameW) free(oldNameW); 1281 1283 1282 return TRUE; 1284 1283 } … … 1679 1678 LPWSTR lpsz = (LPWSTR)lParam; 1680 1679 1681 if(windowNameA) free(windowNameA);1682 if(windowNameW) free(windowNameW);1680 CHAR* oldNameA = windowNameA; 1681 WCHAR* oldNameW = windowNameW; 1683 1682 1684 1683 if (lParam) … … 1696 1695 wndNameLength = 0; 1697 1696 } 1698 1699 if(OS2HwndFrame && (dwStyle & WS_CAPTION) == WS_CAPTION) 1700 return OSLibWinSetWindowText(OS2HwndFrame,(LPSTR)windowNameA); 1697 dprintf(("WM_SETTEXT of %x\n",Win32Hwnd)); 1698 if ((dwStyle & WS_CAPTION) && (lstrcmpW(oldNameW,windowNameW) != 0)) 1699 { 1700 UpdateCaptionText(); 1701 OSLibWinSetWindowText(OS2HwndFrame,(LPSTR)windowNameA); 1702 } 1703 1704 if(oldNameA) free(oldNameA); 1705 if(oldNameW) free(oldNameW); 1701 1706 1702 1707 return TRUE; -
trunk/src/user32/new/win32wbase.h
r2437 r2440 1 /* $Id: win32wbase.h,v 1.2 8 2000-01-14 14:45:18 sandervlExp $ */1 /* $Id: win32wbase.h,v 1.29 2000-01-14 17:48:33 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 114 114 ULONG MsgPaint(ULONG tmp1, BOOL select = TRUE); 115 115 ULONG MsgEraseBackGround(HDC hdc); 116 116 ULONG MsgHitTest(ULONG x, ULONG y); 117 117 ULONG MsgNCPaint(); 118 118 ULONG MsgFormatFrame(WINDOWPOS *lpWndPos); … … 189 189 HMENU GetMenu() { return hMenu; }; 190 190 VOID SetMenu(HMENU newMenu) { hMenu = newMenu; }; 191 191 void SetSysMenu(HMENU hSystemMenu) { hSysMenu = hSystemMenu; }; 192 192 HMENU GetSysMenu() { return hSysMenu; } 193 193 … … 400 400 VOID DrawMaxButton(HDC hdc,BOOL down,BOOL bGrayed); 401 401 VOID DrawMinButton(HDC hdc,BOOL down,BOOL bGrayed); 402 VOID DrawCaption(HDC hdc,RECT *rect,BOOL active); 402 VOID DrawCaption(HDC hdc,RECT *rect,BOOL active,BOOL redrawText); 403 VOID UpdateCaptionText(); 403 404 VOID DoNCPaint(HRGN clip,BOOL suppress_menupaint); 404 405 LONG HandleNCPaint(HRGN clip); -
trunk/src/user32/new/win32wbasenonclient.cpp
r2435 r2440 1 /* $Id: win32wbasenonclient.cpp,v 1. 6 2000-01-14 13:16:58 sandervlExp $ */1 /* $Id: win32wbasenonclient.cpp,v 1.7 2000-01-14 17:48:33 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 (non-client methods) … … 789 789 } 790 790 //****************************************************************************** 791 //****************************************************************************** 792 VOID Win32BaseWindow::DrawCaption(HDC hdc,RECT *rect,BOOL active) 791 // redrawText: only redraws text 792 //****************************************************************************** 793 VOID Win32BaseWindow::DrawCaption(HDC hdc,RECT *rect,BOOL active,BOOL redrawText) 793 794 { 794 795 RECT r = *rect; … … 850 851 if ((dwStyle & WS_SYSMENU) && !(dwExStyle & WS_EX_TOOLWINDOW)) 851 852 { 852 if ( DrawSysButton(hdc,FALSE))853 if (redrawText || DrawSysButton(hdc,FALSE)) 853 854 r.left += GetSystemMetrics(SM_CYCAPTION) - 1; 854 855 } … … 858 859 UINT state; 859 860 860 /* Go get the sysmenu */ 861 state = GetMenuState(hSysMenu, SC_CLOSE, MF_BYCOMMAND); 862 863 /* Draw a grayed close button if disabled and a normal one if SC_CLOSE is not there */ 864 DrawCloseButton(hdc, FALSE, 865 ((((state & MF_DISABLED) || (state & MF_GRAYED))) && (state != 0xFFFFFFFF))); 861 if (!redrawText) 862 { 863 /* Go get the sysmenu */ 864 state = GetMenuState(hSysMenu, SC_CLOSE, MF_BYCOMMAND); 865 866 /* Draw a grayed close button if disabled and a normal one if SC_CLOSE is not there */ 867 DrawCloseButton(hdc, FALSE, 868 ((((state & MF_DISABLED) || (state & MF_GRAYED))) && (state != 0xFFFFFFFF))); 869 } 866 870 r.right -= GetSystemMetrics(SM_CYCAPTION) - 1; 867 871 … … 871 875 /* But if the menu item is not in the menu they're disabled*/ 872 876 873 DrawMaxButton(hdc, FALSE, (!(dwStyle & WS_MAXIMIZEBOX))); 877 if (!redrawText) 878 DrawMaxButton(hdc, FALSE, (!(dwStyle & WS_MAXIMIZEBOX))); 874 879 r.right -= GetSystemMetrics(SM_CXSIZE) + 1; 875 880 876 DrawMinButton(hdc, FALSE, (!(dwStyle & WS_MINIMIZEBOX))); 877 r.right -= GetSystemMetrics(SM_CXSIZE) + 1; 881 if (!redrawText) 882 DrawMinButton(hdc, FALSE, (!(dwStyle & WS_MINIMIZEBOX))); 883 r.right -= GetSystemMetrics(SM_CXSIZE) + 1; 878 884 } 879 885 } … … 890 896 hFont = CreateFontIndirectA (&nclm.lfCaptionFont); 891 897 hOldFont = SelectObject (hdc, hFont); 892 if (active) SetTextColor( hdc, GetSysColor( COLOR_CAPTIONTEXT ) ); 893 else SetTextColor( hdc, GetSysColor( COLOR_INACTIVECAPTIONTEXT ) ); 898 SetTextColor(hdc,GetSysColor(active ? COLOR_CAPTIONTEXT:COLOR_INACTIVECAPTIONTEXT)); 894 899 SetBkMode( hdc, TRANSPARENT ); 895 900 r.left += 2; … … 897 902 DT_SINGLELINE | DT_VCENTER | DT_NOPREFIX | DT_LEFT ); 898 903 DeleteObject (SelectObject (hdc, hOldFont)); 904 } 905 } 906 //****************************************************************************** 907 //****************************************************************************** 908 VOID Win32BaseWindow::UpdateCaptionText() 909 { 910 BOOL active = flags & WIN_NCACTIVATED; 911 HDC hdc; 912 RECT rect,r; 913 HRGN hrgn; 914 915 if (!((dwStyle & WS_CAPTION) == WS_CAPTION)) return; 916 917 rect.top = rect.left = 0; 918 rect.right = rectWindow.right - rectWindow.left; 919 rect.bottom = rectWindow.bottom - rectWindow.top; 920 if(!(flags & WIN_MANAGED)) 921 { 922 if (HAS_BIGFRAME( dwStyle, dwExStyle)) 923 { 924 InflateRect(&rect,-2,-2); 925 } 926 927 if (HAS_THICKFRAME(dwStyle,dwExStyle)) 928 { 929 INT width = GetSystemMetrics(SM_CXFRAME) - GetSystemMetrics(SM_CXEDGE); 930 INT height = GetSystemMetrics(SM_CYFRAME) - GetSystemMetrics(SM_CYEDGE); 931 932 InflateRect(&rect,-width,-height); 933 } 934 else if (HAS_DLGFRAME(dwStyle,dwExStyle)) 935 { 936 INT width = GetSystemMetrics(SM_CXDLGFRAME) - GetSystemMetrics(SM_CXEDGE); 937 INT height = GetSystemMetrics(SM_CYDLGFRAME) - GetSystemMetrics(SM_CYEDGE); 938 939 InflateRect(&rect,-width,-height); 940 } 941 else if (HAS_THINFRAME(dwStyle)) 942 { 943 } 944 945 r = rect; 946 if (dwExStyle & WS_EX_TOOLWINDOW) 947 { 948 r.bottom = rect.top + GetSystemMetrics(SM_CYSMCAPTION); 949 } 950 else 951 { 952 r.bottom = rect.top + GetSystemMetrics(SM_CYCAPTION); 953 } 954 955 //clip the buttons 956 if ((dwStyle & WS_SYSMENU) && !(dwExStyle & WS_EX_TOOLWINDOW)) 957 { 958 HICON hIcon; 959 960 hIcon = (HICON) GetClassLongA(Win32Hwnd, GCL_HICONSM); 961 if(!hIcon) hIcon = (HICON) GetClassLongA(Win32Hwnd, GCL_HICON); 962 if (hIcon) 963 rect.left += GetSystemMetrics(SM_CYCAPTION) - 1; 964 } 965 if (dwStyle & WS_SYSMENU) 966 { 967 rect.right -= GetSystemMetrics(SM_CYCAPTION) - 1; 968 969 if ((dwStyle & WS_MAXIMIZEBOX) || (dwStyle & WS_MINIMIZEBOX)) 970 { 971 rect.right -= GetSystemMetrics(SM_CXSIZE) + 1; 972 rect.right -= GetSystemMetrics(SM_CXSIZE) + 1; 973 } 974 } 975 976 hrgn = CreateRectRgnIndirect(&rect); 977 hdc = GetDCEx(Win32Hwnd,hrgn,DCX_USESTYLE | DCX_WINDOW | DCX_INTERSECTRGN); 978 SelectObject(hdc,GetSysColorPen(COLOR_WINDOWFRAME)); 979 DrawCaption(hdc,&r,active,TRUE); 980 DeleteObject(hrgn); 981 ReleaseDC(Win32Hwnd,hdc); 899 982 } 900 983 } … … 922 1005 923 1006 if( clip > 1 ) 1007 { 1008 //CB: unknown WINE handling (clip == 1), clip client? 924 1009 GetRgnBox( clip, &rectClip ); 925 else1010 } else 926 1011 { 927 1012 clip = 0; … … 961 1046 } 962 1047 if( !clip || IntersectRect( &rfuzz, &r, &rectClip ) ) 963 DrawCaption(hdc, &r, active);1048 DrawCaption(hdc,&r,active,FALSE); 964 1049 } 965 1050 }
Note:
See TracChangeset
for help on using the changeset viewer.