Changeset 2440 for trunk/src/user32/new/win32wbasenonclient.cpp
- Timestamp:
- Jan 14, 2000, 6:48:33 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.