Changeset 2666 for trunk/src/user32/win32wbasenonclient.cpp
- Timestamp:
- Feb 5, 2000, 8:45:19 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/win32wbasenonclient.cpp
r2611 r2666 1 /* $Id: win32wbasenonclient.cpp,v 1. 8 2000-02-03 17:13:03cbratschi Exp $ */1 /* $Id: win32wbasenonclient.cpp,v 1.9 2000-02-05 19:45:19 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 (non-client methods) … … 629 629 if (!(dwStyle & DS_MODALFRAME)) 630 630 hIcon = LoadImageA(0, MAKEINTRESOURCEA(OIC_ODINICON), IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR); 631 631 //CB: todo: add icons (including Odin icon) to user32.rc 632 632 if (hIcon) 633 633 DrawIconEx(hdc,r.left+2,r.top+2,hIcon, … … 780 780 } 781 781 //****************************************************************************** 782 // redrawText: only redraws text 783 //****************************************************************************** 784 VOID Win32BaseWindow::DrawCaption(HDC hdc,RECT *rect,BOOL active,BOOL redrawText) 782 //****************************************************************************** 783 VOID Win32BaseWindow::DrawHelpButton(HDC hdc,RECT *rect,BOOL down,BOOL bGrayed) 784 { 785 RECT r; 786 HDC hdcMem; 787 BITMAP bmp; 788 HBITMAP hBmp,hOldBmp; 789 790 if (!rect) GetInsideRect(&r); 791 else r = *rect; 792 #if 0 //CB: todo 793 hdcMem = CreateCompatibleDC( hdc ); 794 hBmp = down ? hbitmapMinimizeD : hbitmapMinimize; 795 hOldBmp= SelectObject( hdcMem, hBmp ); 796 GetObjectA (hBmp, sizeof(BITMAP), &bmp); 797 798 if (dwStyle & WS_SYSMENU) 799 r.right -= GetSystemMetrics(SM_CYCAPTION) + 1; 800 801 /* In win 95 there is always a Maximize box when there is a Minimize one */ 802 if ((dwStyle & WS_MAXIMIZEBOX) || (dwStyle & WS_MINIMIZEBOX)) 803 r.right -= bmp.bmWidth; 804 805 BitBlt( hdc, r.right - (GetSystemMetrics(SM_CXSIZE) + bmp.bmWidth) / 2, 806 r.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2, 807 bmp.bmWidth, bmp.bmHeight, hdcMem, 0, 0, SRCCOPY ); 808 809 if(bGrayed) 810 DrawGrayButton(hdc, r.right - (GetSystemMetrics(SM_CXSIZE) + bmp.bmWidth) / 2 + 2, 811 r.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2 + 2); 812 813 814 SelectObject (hdcMem, hOldBmp); 815 DeleteDC( hdcMem ); 816 #endif 817 } 818 //****************************************************************************** 819 //****************************************************************************** 820 VOID Win32BaseWindow::DrawCaption(HDC hdc,RECT *rect,BOOL active) 785 821 { 786 822 RECT r = *rect,r2; … … 850 886 if ((dwStyle & WS_SYSMENU) && !(dwExStyle & WS_EX_TOOLWINDOW)) 851 887 { 852 if ( redrawText ||DrawSysButton(memDC,&r))888 if (DrawSysButton(memDC,&r)) 853 889 r.left += GetSystemMetrics(SM_CYCAPTION) - 1; 854 890 } 855 891 892 //CB: todo: integrate help button 893 856 894 if (dwStyle & WS_SYSMENU) 857 895 { 858 896 UINT state; 859 897 860 if (!redrawText) 861 { 862 /* Go get the sysmenu */ 863 state = GetMenuState(hSysMenu, SC_CLOSE, MF_BYCOMMAND); 864 865 /* Draw a grayed close button if disabled and a normal one if SC_CLOSE is not there */ 866 DrawCloseButton(memDC,&r2,FALSE, 867 ((((state & MF_DISABLED) || (state & MF_GRAYED))) && (state != 0xFFFFFFFF))); 868 } 898 /* Go get the sysmenu */ 899 state = GetMenuState(hSysMenu, SC_CLOSE, MF_BYCOMMAND); 900 901 /* Draw a grayed close button if disabled and a normal one if SC_CLOSE is not there */ 902 DrawCloseButton(memDC,&r2,FALSE, 903 ((((state & MF_DISABLED) || (state & MF_GRAYED))) && (state != 0xFFFFFFFF))); 869 904 r.right -= GetSystemMetrics(SM_CYCAPTION) - 1; 870 905 … … 874 909 /* But if the menu item is not in the menu they're disabled*/ 875 910 876 if (!redrawText) 877 DrawMaxButton(memDC,&r2,FALSE,(!(dwStyle & WS_MAXIMIZEBOX))); 911 DrawMaxButton(memDC,&r2,FALSE,(!(dwStyle & WS_MAXIMIZEBOX))); 878 912 r.right -= GetSystemMetrics(SM_CXSIZE) + 1; 879 913 880 if (!redrawText) 881 DrawMinButton(memDC,&r2,FALSE, (!(dwStyle & WS_MINIMIZEBOX))); 914 DrawMinButton(memDC,&r2,FALSE, (!(dwStyle & WS_MINIMIZEBOX))); 882 915 r.right -= GetSystemMetrics(SM_CXSIZE) + 1; 883 916 } … … 974 1007 } 975 1008 if( !clip || IntersectRect( &rfuzz, &r, &rectClip ) ) 976 DrawCaption(hdc,&r,active ,FALSE);1009 DrawCaption(hdc,&r,active); 977 1010 } 978 1011
Note:
See TracChangeset
for help on using the changeset viewer.