Changeset 2857 for trunk/src/user32
- Timestamp:
- Feb 22, 2000, 6:07:43 PM (26 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/loadres.cpp
r2804 r2857 1 /* $Id: loadres.cpp,v 1.2 3 2000-02-16 14:34:21 sandervlExp $ */1 /* $Id: loadres.cpp,v 1.24 2000-02-22 17:07:40 cbratschi Exp $ */ 2 2 3 3 /* … … 29 29 #include <win\cursoricon.h> 30 30 31 #define DBG_LOCALLOG 31 #define DBG_LOCALLOG DBG_loadres 32 32 #include "dbglocal.h" 33 33 … … 255 255 case OBM_OLD_LFARROW: 256 256 case OBM_CHECK: 257 257 case OBM_RADIOCHECK: 258 258 case OBM_CHECKBOXES: 259 259 case OBM_BTNCORNERS: … … 270 270 case OBM_RGARROWI: 271 271 case OBM_LFARROWI: 272 272 case OBM_CLOSED: 273 273 case OBM_OLD_CLOSE: 274 274 case OBM_BTSIZE: … … 276 276 case OBM_OLD_ZOOM: 277 277 case OBM_OLD_RESTORE: 278 case OBM_CONTEXTHELP: 279 case OBM_CONTEXTHELPD: 278 280 return TRUE; 279 281 … … 361 363 } 362 364 else { 363 // 364 // hbitmap = CreateBitmap(fix_info->bmiHeader.biWidth,365 // if(fix_info->bmiHeader.biBitCount == 1) { 366 // hbitmap = CreateBitmap(fix_info->bmiHeader.biWidth, 365 367 // fix_info->bmiHeader.biHeight, 366 // fix_info->bmiHeader.biPlanes, 367 // fix_info->bmiHeader.biBitCount, 368 // fix_info->bmiHeader.biPlanes, 369 // fix_info->bmiHeader.biBitCount, 368 370 // (PVOID)bits); 369 // 370 // 371 371 // } 372 // else { 373 hbitmap = CreateDIBitmap(hdc, &fix_info->bmiHeader, CBM_INIT, 372 374 bits, fix_info, DIB_RGB_COLORS ); 373 // 375 // } 374 376 } 375 377 ReleaseDC( 0, hdc ); … … 384 386 //TODO: No support for RT_NEWBITMAP 385 387 //****************************************************************************** 386 //******************************************************************************387 //TODO: No support for RT_NEWBITMAP388 //******************************************************************************389 388 HBITMAP WIN32API LoadBitmapA(HINSTANCE hinst, LPCSTR lpszBitmap) 390 389 { … … 395 394 if(IsSystemBitmap((ULONG)lpszBitmap)) 396 395 { 397 398 } 399 } 400 if(!hBitmap) 401 396 hBitmap = LoadBitmapA(hInstanceUser32, lpszBitmap, 0, 0, 0); 397 } 398 } 399 if(!hBitmap) 400 hBitmap = LoadBitmapA(hinst, lpszBitmap, 0, 0, 0); 402 401 403 402 dprintf(("LoadBitmapA returned %08xh\n", hBitmap)); -
trunk/src/user32/syscolor.cpp
r2804 r2857 1 /* $Id: syscolor.cpp,v 1.1 8 2000-02-16 14:34:35 sandervlExp $ */1 /* $Id: syscolor.cpp,v 1.19 2000-02-22 17:07:40 cbratschi Exp $ */ 2 2 3 3 /* … … 13 13 * Copyright David W. Metcalfe, 1993 14 14 * Copyright Alexandre Julliard, 1994 15 * Copyright 1997 Bertho A. Stultiens 15 16 * 16 17 * … … 24 25 #include "options.h" 25 26 26 #define DBG_LOCALLOG 27 #define DBG_LOCALLOG DBG_syscolor 27 28 #include "dbglocal.h" 28 29 … … 109 110 (PALETTEINDEX(GetNearestPaletteIndex(STOCK_DEFAULT_PALETTE,(color)))) 110 111 112 static const WORD wPattern55AA[] = 113 { 114 0x5555, 0xaaaa, 0x5555, 0xaaaa, 115 0x5555, 0xaaaa, 0x5555, 0xaaaa 116 }; 117 118 static HBRUSH hPattern55AABrush = 0; 119 static HBITMAP hPattern55AABitmap = 0; 120 111 121 static void SYSCOLOR_SetColor( int index, COLORREF color ) 112 122 { … … 277 287 return USEWINCOLORS; 278 288 } 289 /********************************************************************* 290 * CACHE_GetPattern55AABrush 291 */ 292 HBRUSH CACHE_GetPattern55AABrush(void) 293 { 294 if (!hPattern55AABrush) 295 hPattern55AABrush = CreatePatternBrush(CACHE_GetPattern55AABitmap()); 296 return hPattern55AABrush; 297 } 298 /********************************************************************* 299 * CACHE_GetPattern55AABitmap 300 */ 301 HBITMAP CACHE_GetPattern55AABitmap(void) 302 { 303 if (!hPattern55AABitmap) 304 hPattern55AABitmap = CreateBitmap( 8, 8, 1, 1, wPattern55AA ); 305 return hPattern55AABitmap; 306 } -
trunk/src/user32/syscolor.h
r2469 r2857 1 /* $Id: syscolor.h,v 1.1 0 2000-01-18 20:08:13 sandervlExp $ */1 /* $Id: syscolor.h,v 1.11 2000-02-22 17:07:40 cbratschi Exp $ */ 2 2 3 3 /* … … 22 22 extern BOOL SYSCOLOR_GetUseWinColors(VOID); 23 23 24 HBRUSH CACHE_GetPattern55AABrush(void); 25 HBITMAP CACHE_GetPattern55AABitmap(void); 26 24 27 #endif /* __WINE_SYSCOLOR_H */ -
trunk/src/user32/text.cpp
r2804 r2857 1 /* $Id: text.cpp,v 1. 7 2000-02-16 14:34:35 sandervlExp $ */1 /* $Id: text.cpp,v 1.8 2000-02-22 17:07:40 cbratschi Exp $ */ 2 2 3 3 /* … … 6 6 * Copyright 1999 Christoph Bratschi 7 7 * 8 * Copyright 1997 Bertho A. Stultiens9 8 * Copyright 1993, 1994 Alexandre Julliard 10 9 * … … 14 13 #include "winuser.h" 15 14 #include "user32.h" 15 #include "syscolor.h" 16 16 17 #define DBG_LOCALLOG 17 #define DBG_LOCALLOG DBG_text 18 18 #include "dbglocal.h" 19 19 20 20 //WINE parts: wine-991031 21 22 static const WORD wPattern55AA[] =23 {24 0x5555, 0xaaaa, 0x5555, 0xaaaa,25 0x5555, 0xaaaa, 0x5555, 0xaaaa26 };27 28 static HBRUSH hPattern55AABrush = 0;29 static HBITMAP hPattern55AABitmap = 0;30 31 /*********************************************************************32 * CACHE_GetPattern55AABitmap33 */34 HBITMAP CACHE_GetPattern55AABitmap(void)35 {36 if (!hPattern55AABitmap)37 hPattern55AABitmap = CreateBitmap( 8, 8, 1, 1, wPattern55AA );38 return hPattern55AABitmap;39 }40 41 /*********************************************************************42 * CACHE_GetPattern55AABrush43 */44 HBRUSH CACHE_GetPattern55AABrush(void)45 {46 if (!hPattern55AABrush)47 hPattern55AABrush = CreatePatternBrush(CACHE_GetPattern55AABitmap());48 return hPattern55AABrush;49 }50 21 51 22 INT WIN32API DrawTextA(HDC hDC,LPCSTR lpString,INT nCount,PRECT lpRect,UINT nFormat) … … 56 27 57 28 if(nFormat == 0x828) { 58 29 bla = 1; 59 30 } 60 31 return InternalDrawTextExA(hDC,lpString,nCount,lpRect,nFormat,NULL,FALSE); -
trunk/src/user32/uitools.cpp
r2852 r2857 1 /* $Id: uitools.cpp,v 1.2 4 2000-02-21 17:25:29cbratschi Exp $ */1 /* $Id: uitools.cpp,v 1.25 2000-02-22 17:07:40 cbratschi Exp $ */ 2 2 /* 3 3 * User Interface Functions … … 15 15 #include "user32.h" 16 16 #include "win32wbase.h" 17 #include "syscolor.h" 17 18 18 19 #define DBG_LOCALLOG DBG_uitools 19 20 #include "dbglocal.h" 20 21 static const WORD wPattern_AA55[8] = { 0xaaaa, 0x5555, 0xaaaa, 0x5555,22 0xaaaa, 0x5555, 0xaaaa, 0x5555 };23 21 24 22 /* These tables are used in: … … 616 614 if(GetSysColor(COLOR_BTNHIGHLIGHT) == RGB(255, 255, 255)) 617 615 { 618 HBITMAP hbm = CreateBitmap(8, 8, 1, 1, wPattern_AA55);616 COLORREF bg; 619 617 HBRUSH hbsave; 620 HBRUSH hb = CreatePatternBrush(hbm);621 COLORREF bg;622 618 623 619 FillRect(dc, rect, GetSysColorBrush(COLOR_BTNFACE)); 624 620 bg = SetBkColor(dc, RGB(255, 255, 255)); 625 hbsave = (HBRUSH)SelectObject(dc, hb);621 hbsave = (HBRUSH)SelectObject(dc,CACHE_GetPattern55AABrush()); 626 622 PatBlt(dc, rect->left, rect->top, rect->right-rect->left, rect->bottom-rect->top, 0x00FA0089); 627 623 SelectObject(dc, hbsave); 628 624 SetBkColor(dc, bg); 629 DeleteObject(hb);630 DeleteObject(hbm);631 625 } 632 626 else … … 1529 1523 if(flags & (DSS_UNION|DSS_DISABLED)) 1530 1524 { 1531 WORD wPattern55AA[] = { 0x5555, 0xaaaa, 0x5555, 0xaaaa, 0x5555, 0xaaaa, 0x5555, 0xaaaa }; 1532 HBITMAP hPattern55AABitmap = CreateBitmap( 8, 8, 1, 1, wPattern55AA ); 1533 HBRUSH hPattern55AABrush = CreatePatternBrush(hPattern55AABitmap); 1534 1535 hbsave = (HBRUSH)SelectObject(memdc, hPattern55AABrush); 1525 hbsave = (HBRUSH)SelectObject(memdc,CACHE_GetPattern55AABrush()); 1536 1526 if(!hbsave) goto cleanup; 1537 1527 tmp = PatBlt(memdc, 0, 0, cx, cy, 0x00FA0089); -
trunk/src/user32/user32.rc
r2834 r2857 1 /* $Id: user32.rc,v 1. 9 2000-02-20 18:28:34cbratschi Exp $ */1 /* $Id: user32.rc,v 1.10 2000-02-22 17:07:41 cbratschi Exp $ */ 2 2 /* converted from WINE */ 3 3 … … 28 28 /* Odin bitmaps */ 29 29 30 #define OBM_ HELP 3273031 32 OBM_ HELP BITMAP LOADONCALL DISCARDABLE33 { 34 35 36 37 38 39 40 41 42 43 44 45 46 47 } 48 49 #define OBM_ HELPD 3272950 51 OBM_ HELPD BITMAP LOADONCALL DISCARDABLE30 #define OBM_CONTEXTHELP 32730 31 32 OBM_CONTEXTHELP BITMAP LOADONCALL DISCARDABLE 33 { 34 '42 4D C8 00 00 00 00 00 00 00 26 00 00 00 0C 00' 35 '00 00 10 00 0E 00 01 00 04 00 C2 C2 C2 02 02 02' 36 'FE FE FE 82 82 82 DE DE DE 00 00 00 00 00 00 00' 37 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 38 '00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11' 39 '11 11 23 33 33 33 33 33 33 31 24 00 00 00 00 00' 40 '00 31 24 00 00 01 10 00 00 31 24 00 00 01 10 00' 41 '00 31 24 00 00 00 00 00 00 31 24 00 00 01 10 00' 42 '00 31 24 00 00 01 10 00 00 31 24 00 00 00 11 00' 43 '00 31 24 00 01 10 01 10 00 31 24 00 01 10 01 10' 44 '00 31 24 00 00 11 11 00 00 31 24 44 44 44 44 44' 45 '44 31 22 22 22 22 22 22 22 21 44 44 44 44 44 31' 46 '22 22 22 22 22 22 22 21' 47 } 48 49 #define OBM_CONTEXTHELPD 32729 50 51 OBM_CONTEXTHELPD BITMAP LOADONCALL DISCARDABLE 52 52 { 53 53 '42 4D C8 00 00 00 00 00 00 00 26 00 00 00 0C 00' -
trunk/src/user32/win32dlg.cpp
r2803 r2857 1 /* $Id: win32dlg.cpp,v 1.4 4 2000-02-16 14:28:22 sandervlExp $ */1 /* $Id: win32dlg.cpp,v 1.45 2000-02-22 17:07:41 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Dialog Code for OS/2 … … 25 25 #include "syscolor.h" 26 26 27 #define DBG_LOCALLOG 27 #define DBG_LOCALLOG DBG_win32dlg 28 28 #include "dbglocal.h" 29 29 … … 162 162 cs.cy = rect.bottom; 163 163 cs.style = dlgInfo.style & ~WS_VISIBLE; 164 164 165 if(!isUnicode) { 165 166 if(dlgInfo.caption) { … … 177 178 } 178 179 cs.dwExStyle = dlgInfo.exStyle; 180 if (dlgInfo.style & DS_CONTEXTHELP) cs.dwExStyle |= WS_EX_CONTEXTHELP; 179 181 180 182 fIsDialog = TRUE; -
trunk/src/user32/win32wbase.cpp
r2852 r2857 1 /* $Id: win32wbase.cpp,v 1.16 6 2000-02-21 17:25:31cbratschi Exp $ */1 /* $Id: win32wbase.cpp,v 1.167 2000-02-22 17:07:42 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 1203 1203 SetBkColor( hdc, bk); 1204 1204 1205 //TODO?1206 #if 01207 1205 /* if COLOR_WINDOW happens to be the same as COLOR_3DHILIGHT 1208 1206 * we better use 0x55aa bitmap brush to make scrollbar's background … … 1212 1210 return CACHE_GetPattern55AABrush(); 1213 1211 } 1214 #endif 1212 1215 1213 UnrealizeObject( hb ); 1216 1214 return (LRESULT)hb; … … 1707 1705 1708 1706 case WM_HELP: 1709 1710 1707 if (getParent()) getParent()->SendInternalMessageA(Msg,wParam,lParam); 1708 break; 1711 1709 1712 1710 case WM_NOTIFY: -
trunk/src/user32/win32wbase.h
r2852 r2857 1 /* $Id: win32wbase.h,v 1.8 4 2000-02-21 17:25:31cbratschi Exp $ */1 /* $Id: win32wbase.h,v 1.85 2000-02-22 17:07:43 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 384 384 LONG HandleWindowPosChanging(WINDOWPOS *winpos); 385 385 LONG HandleNCActivate(WPARAM wParam); 386 VOID TrackMinMax Box(WORD wParam);386 VOID TrackMinMaxHelpBox(WORD wParam); 387 387 VOID TrackCloseButton(WORD wParam); 388 388 VOID TrackScrollBar(WPARAM wParam,POINT pt); … … 404 404 VOID DrawMaxButton(HDC hdc,RECT *rect,BOOL down,BOOL bGrayed); 405 405 VOID DrawMinButton(HDC hdc,RECT *rect,BOOL down,BOOL bGrayed); 406 VOID Draw HelpButton(HDC hdc,RECT *rect,BOOL down,BOOL bGrayed);406 VOID DrawContextHelpButton(HDC hdc,RECT *rect,BOOL down,BOOL bGrayed); 407 407 VOID DrawCaption(HDC hdc,RECT *rect,BOOL active); 408 408 VOID DoNCPaint(HRGN clip,BOOL suppress_menupaint); -
trunk/src/user32/win32wbasenonclient.cpp
r2852 r2857 1 /* $Id: win32wbasenonclient.cpp,v 1.1 3 2000-02-21 17:25:32cbratschi Exp $ */1 /* $Id: win32wbasenonclient.cpp,v 1.14 2000-02-22 17:07:43 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 (non-client methods) … … 48 48 49 49 static INT bitmapW = 16,bitmapH = 14; 50 static HBITMAP hbitmapClose = 0;51 static HBITMAP hbitmapCloseD = 0;52 static HBITMAP hbitmapMinimize = 0;53 static HBITMAP hbitmapMinimizeD = 0;54 static HBITMAP hbitmapMaximize = 0;55 static HBITMAP hbitmapMaximizeD = 0;56 static HBITMAP hbitmapRestore = 0;57 static HBITMAP hbitmapRestoreD = 0;58 static HBITMAP hbitmap Help= 0;59 static HBITMAP hbitmap HelpD= 0;50 static HBITMAP hbitmapClose = 0; 51 static HBITMAP hbitmapCloseD = 0; 52 static HBITMAP hbitmapMinimize = 0; 53 static HBITMAP hbitmapMinimizeD = 0; 54 static HBITMAP hbitmapMaximize = 0; 55 static HBITMAP hbitmapMaximizeD = 0; 56 static HBITMAP hbitmapRestore = 0; 57 static HBITMAP hbitmapRestoreD = 0; 58 static HBITMAP hbitmapContextHelp = 0; 59 static HBITMAP hbitmapContextHelpD = 0; 60 60 61 61 BYTE lpGrayMask[] = { 0xAA, 0xA0, … … 96 96 //****************************************************************************** 97 97 //****************************************************************************** 98 VOID Win32BaseWindow::TrackMinMax Box(WORD wParam)98 VOID Win32BaseWindow::TrackMinMaxHelpBox(WORD wParam) 99 99 { 100 100 MSG msg; … … 110 110 /* Check if the sysmenu item for minimize is there */ 111 111 state = GetMenuState(hSysMenu,SC_MINIMIZE,MF_BYCOMMAND); 112 } else 112 } else if (wParam == HTMAXBUTTON) 113 113 { 114 114 /* If the style is not present, do nothing */ … … 117 117 /* Check if the sysmenu item for maximize is there */ 118 118 state = GetMenuState(hSysMenu, SC_MAXIMIZE, MF_BYCOMMAND); 119 } 119 } else state = 0; 120 120 SetCapture(Win32Hwnd); 121 121 hdc = GetWindowDC(Win32Hwnd); 122 122 if (wParam == HTMINBUTTON) 123 123 DrawMinButton(hdc,NULL,TRUE,FALSE); 124 else if (wParam == HTMAXBUTTON) 125 DrawMaxButton(hdc,NULL,TRUE,FALSE); 124 126 else 125 Draw MaxButton(hdc,NULL,TRUE,FALSE);127 DrawContextHelpButton(hdc,NULL,TRUE,FALSE); 126 128 do 127 129 { … … 134 136 if (wParam == HTMINBUTTON) 135 137 DrawMinButton(hdc,NULL,pressed,FALSE); 138 else if (wParam == HTMAXBUTTON) 139 DrawMaxButton(hdc,NULL,pressed,FALSE); 136 140 else 137 Draw MaxButton(hdc,NULL,pressed,FALSE);141 DrawContextHelpButton(hdc,NULL,pressed,FALSE); 138 142 } 139 143 } while (msg.message != WM_LBUTTONUP); 140 144 if (wParam == HTMINBUTTON) 141 145 DrawMinButton(hdc,NULL,FALSE,FALSE); 146 else if (wParam == HTMAXBUTTON) 147 DrawMaxButton(hdc,NULL,FALSE,FALSE); 142 148 else 143 Draw MaxButton(hdc,NULL,FALSE,FALSE);149 DrawContextHelpButton(hdc,NULL,FALSE,FALSE); 144 150 ReleaseCapture(); 145 151 ReleaseDC(Win32Hwnd,hdc); … … 148 154 if ((!pressed) || (state == 0xFFFFFFFF)) 149 155 return; 156 150 157 if (wParam == HTMINBUTTON) 151 158 SendInternalMessageA(WM_SYSCOMMAND,SC_MINIMIZE,*(LPARAM*)&msg.pt); 159 else if (wParam == HTMAXBUTTON) 160 SendInternalMessageA(WM_SYSCOMMAND,IsZoomed(Win32Hwnd) ? SC_RESTORE:SC_MAXIMIZE,*(LPARAM*)&msg.pt); 152 161 else 153 SendInternalMessageA(WM_SYSCOMMAND, IsZoomed(Win32Hwnd) ? SC_RESTORE:SC_MAXIMIZE,*(LPARAM*)&msg.pt);162 SendInternalMessageA(WM_SYSCOMMAND,SC_CONTEXTHELP,*(LPARAM*)&msg.pt); 154 163 } 155 164 //****************************************************************************** … … 280 289 case HTMINBUTTON: 281 290 case HTMAXBUTTON: 282 TrackMinMaxBox(wParam); 291 case HTHELP: 292 TrackMinMaxHelpBox(wParam); 283 293 break; 284 294 … … 717 727 if (dwExStyle & WS_EX_TOOLWINDOW) 718 728 { 719 RECT toolRect; 729 RECT toolRect; 720 730 INT iBmpHeight = 11; /* Windows does not use SM_CXSMSIZE and SM_CYSMSIZE */ 721 INT iBmpWidth = 11; /* it uses 11x11 for the close button in tool window */ 731 INT iBmpWidth = 11; /* it uses 11x11 for the close button in tool window */ 722 732 INT iCaptionHeight = GetSystemMetrics(SM_CYSMCAPTION); 723 733 … … 826 836 //****************************************************************************** 827 837 //****************************************************************************** 828 VOID Win32BaseWindow::Draw HelpButton(HDC hdc,RECT *rect,BOOL down,BOOL bGrayed)838 VOID Win32BaseWindow::DrawContextHelpButton(HDC hdc,RECT *rect,BOOL down,BOOL bGrayed) 829 839 { 830 840 RECT r; … … 837 847 838 848 hdcMem = CreateCompatibleDC(hdc); 839 hBmp = down ? hbitmap HelpD : hbitmapHelp;849 hBmp = down ? hbitmapContextHelpD : hbitmapContextHelp; 840 850 hOldBmp = SelectObject(hdcMem,hBmp); 841 851 GetObjectA(hBmp,sizeof(BITMAP),&bmp); … … 915 925 { 916 926 if (!(hbitmapClose = LoadBitmapA(0,MAKEINTRESOURCEA(OBM_CLOSE)))) return; 917 hbitmapCloseD = LoadBitmapA(0,MAKEINTRESOURCEA(OBM_CLOSED));918 hbitmapMinimize = LoadBitmapA(0,MAKEINTRESOURCEA(OBM_REDUCE));919 hbitmapMinimizeD = LoadBitmapA(0,MAKEINTRESOURCEA(OBM_REDUCED));920 hbitmapMaximize = LoadBitmapA(0,MAKEINTRESOURCEA(OBM_ZOOM));921 hbitmapMaximizeD = LoadBitmapA(0,MAKEINTRESOURCEA(OBM_ZOOMD));922 hbitmapRestore = LoadBitmapA(0,MAKEINTRESOURCEA(OBM_RESTORE));923 hbitmapRestoreD = LoadBitmapA(0,MAKEINTRESOURCEA(OBM_RESTORED));924 hbitmap Help = LoadBitmapA(0,MAKEINTRESOURCEA(OBM_HELP));925 hbitmap HelpD = LoadBitmapA(0,MAKEINTRESOURCEA(OBM_HELPD));927 hbitmapCloseD = LoadBitmapA(0,MAKEINTRESOURCEA(OBM_CLOSED)); 928 hbitmapMinimize = LoadBitmapA(0,MAKEINTRESOURCEA(OBM_REDUCE)); 929 hbitmapMinimizeD = LoadBitmapA(0,MAKEINTRESOURCEA(OBM_REDUCED)); 930 hbitmapMaximize = LoadBitmapA(0,MAKEINTRESOURCEA(OBM_ZOOM)); 931 hbitmapMaximizeD = LoadBitmapA(0,MAKEINTRESOURCEA(OBM_ZOOMD)); 932 hbitmapRestore = LoadBitmapA(0,MAKEINTRESOURCEA(OBM_RESTORE)); 933 hbitmapRestoreD = LoadBitmapA(0,MAKEINTRESOURCEA(OBM_RESTORED)); 934 hbitmapContextHelp = LoadBitmapA(0,MAKEINTRESOURCEA(OBM_CONTEXTHELP)); 935 hbitmapContextHelpD = LoadBitmapA(0,MAKEINTRESOURCEA(OBM_CONTEXTHELPD)); 926 936 } 927 937 … … 946 956 if (dwExStyle & WS_EX_CONTEXTHELP) 947 957 { 948 Draw HelpButton(memDC,&r2,FALSE,FALSE);949 r.right -= GetSystemMetrics(SM_CXSIZE) +1;958 DrawContextHelpButton(memDC,&r2,FALSE,FALSE); 959 r.right -= GetSystemMetrics(SM_CXSIZE)+1; 950 960 } 951 961 … … 1083 1093 r.top = r.bottom - GetSystemMetrics(SM_CYHSCROLL) + 1; 1084 1094 FillRect( hdc, &r, GetSysColorBrush(COLOR_SCROLLBAR) ); 1095 //CB: todo: child window have sometimes a size grip (i.e. Notepad) 1096 // WS_SIZEBOX isn't set in these cases 1085 1097 if (!(dwStyle & WS_CHILD)) 1086 1098 { … … 1280 1292 return SendInternalMessageA(WM_CLOSE,0,0); 1281 1293 1294 case SC_CONTEXTHELP: 1295 { 1296 //CB: todo 1297 break; 1298 } 1299 1282 1300 case SC_VSCROLL: 1283 1301 case SC_HSCROLL: … … 1336 1354 * Author : Patrick Haller [Thu, 1998/02/26 11:55] 1337 1355 *****************************************************************************/ 1338 1339 BOOL WIN32API DrawCaption (HWND hwnd, 1340 HDC hdc, 1341 const RECT *lprc, 1342 UINT wFlags) 1343 { 1344 dprintf(("USER32:DrawCaption (%08xh,%08xh,%08xh,%08xh) not implemented.\n", 1345 hwnd, 1346 hdc, 1347 lprc, 1348 wFlags)); 1349 1350 return FALSE; 1356 BOOL WIN32API DrawCaption (HWND hwnd,HDC hdc,const RECT *lprc,UINT wFlags) 1357 { 1358 dprintf(("USER32: DrawCaption")); 1359 1360 return DrawCaptionTempA(hwnd,hdc,lprc,0,0,NULL,wFlags & 0x1F); 1361 } 1362 //****************************************************************************** 1363 // CB: this code is a subset of Win32BaseWindow::DrawCaption 1364 // todo: move Win32BaseWindow:DrawCaption to this function 1365 //****************************************************************************** 1366 BOOL WIN32API DrawCaptionTemp(HWND hwnd,HDC hdc,const RECT *rect,HFONT hFont,HICON hIcon,LPWSTR str,UINT uFlags,BOOL unicode) 1367 { 1368 RECT rc = *rect; 1369 1370 /* drawing background */ 1371 if (uFlags & DC_INBUTTON) 1372 { 1373 FillRect (hdc, &rc, GetSysColorBrush (COLOR_3DFACE)); 1374 1375 if (uFlags & DC_ACTIVE) 1376 { 1377 HBRUSH hbr = SelectObject (hdc, CACHE_GetPattern55AABrush ()); 1378 PatBlt (hdc, rc.left, rc.top, 1379 rc.right-rc.left, rc.bottom-rc.top, 0xFA0089); 1380 SelectObject (hdc, hbr); 1381 } 1382 } else 1383 { 1384 FillRect (hdc, &rc, GetSysColorBrush ((uFlags & DC_ACTIVE) ? 1385 COLOR_ACTIVECAPTION : COLOR_INACTIVECAPTION)); 1386 } 1387 1388 /* drawing icon */ 1389 if ((uFlags & DC_ICON) && !(uFlags & DC_SMALLCAP)) 1390 { 1391 POINT pt; 1392 1393 pt.x = rc.left + 2; 1394 pt.y = (rc.bottom + rc.top - GetSystemMetrics(SM_CYSMICON)) / 2; 1395 1396 if (hIcon) 1397 { 1398 DrawIconEx (hdc, pt.x, pt.y, hIcon, GetSystemMetrics(SM_CXSMICON), 1399 GetSystemMetrics(SM_CYSMICON), 0, 0, DI_NORMAL); 1400 } else 1401 { 1402 Win32BaseWindow *win32wnd = Win32BaseWindow::GetWindowFromHandle(hwnd); 1403 1404 if (!win32wnd) return 0; 1405 1406 /* Get small icon. */ 1407 HICON hAppIcon = win32wnd->GetSmallIcon(); 1408 1409 /* if no small icon and no large icon, use class small icon */ 1410 if (!hAppIcon && !win32wnd->GetIcon()) 1411 hAppIcon = (HICON) GetClassLongA(hwnd, GCL_HICONSM); 1412 1413 /* otherwise use the large icon it */ 1414 if (!hAppIcon) hAppIcon = win32wnd->GetIcon(); 1415 1416 /* if all else fails, use the application icon. */ 1417 if(!hAppIcon) hAppIcon = (HICON) GetClassLongA(hwnd, GCL_HICON); 1418 1419 DrawIconEx (hdc, pt.x, pt.y, hAppIcon, GetSystemMetrics(SM_CXSMICON), 1420 GetSystemMetrics(SM_CYSMICON), 0, 0, DI_NORMAL); 1421 } 1422 1423 rc.left += (rc.bottom - rc.top); 1424 } 1425 1426 /* drawing text */ 1427 if (uFlags & DC_TEXT) 1428 { 1429 HFONT hOldFont; 1430 1431 if (uFlags & DC_INBUTTON) 1432 SetTextColor (hdc, GetSysColor (COLOR_BTNTEXT)); 1433 else if (uFlags & DC_ACTIVE) 1434 SetTextColor (hdc, GetSysColor (COLOR_CAPTIONTEXT)); 1435 else 1436 SetTextColor (hdc, GetSysColor (COLOR_INACTIVECAPTIONTEXT)); 1437 1438 SetBkMode (hdc, TRANSPARENT); 1439 1440 if (hFont) 1441 hOldFont = SelectObject (hdc, hFont); 1442 else 1443 { 1444 NONCLIENTMETRICSA nclm; 1445 HFONT hNewFont; 1446 1447 nclm.cbSize = sizeof(NONCLIENTMETRICSA); 1448 SystemParametersInfoA (SPI_GETNONCLIENTMETRICS, 0, &nclm, 0); 1449 hNewFont = CreateFontIndirectA ((uFlags & DC_SMALLCAP) ? 1450 &nclm.lfSmCaptionFont : &nclm.lfCaptionFont); 1451 hOldFont = SelectObject (hdc, hNewFont); 1452 } 1453 1454 if (str) 1455 { 1456 if (unicode) 1457 DrawTextW(hdc,str,-1,&rc,DT_SINGLELINE | DT_VCENTER | DT_NOPREFIX | DT_LEFT); 1458 else 1459 DrawTextA(hdc,(LPSTR)str,-1,&rc,DT_SINGLELINE | DT_VCENTER | DT_NOPREFIX | DT_LEFT); 1460 } else 1461 { 1462 CHAR szText[128]; 1463 INT nLen; 1464 1465 nLen = GetWindowTextA (hwnd, szText, 128); 1466 DrawTextA (hdc, szText, nLen, &rc, 1467 DT_SINGLELINE | DT_VCENTER | DT_NOPREFIX | DT_LEFT); 1468 } 1469 1470 if (hFont) 1471 SelectObject (hdc, hOldFont); 1472 else 1473 DeleteObject (SelectObject (hdc, hOldFont)); 1474 } 1475 1476 /* drawing focus ??? */ 1477 //if (uFlags & 0x2000) 1478 // FIXME("undocumented flag (0x2000)!\n"); 1479 1480 return 0; 1351 1481 } 1352 1482 /*********************************************************************** … … 1359 1489 * Failure: 1360 1490 */ 1361 1362 BOOL WIN32API DrawCaptionTempA(HWND hwnd, 1363 HDC hdc, 1364 const RECT *rect, 1365 HFONT hFont, 1366 HICON hIcon, 1367 LPCSTR str, 1368 UINT uFlags) 1369 { 1370 RECT rc = *rect; 1371 1372 dprintf(("USER32: DrawCaptionTempA(%08xh,%08xh,%08xh,%08xh,%08xh,%08xh,%08xh)\n", 1373 hwnd, 1374 hdc, 1375 rect, 1376 hFont, 1377 hIcon, 1378 str, 1379 uFlags)); 1380 1381 /* drawing background */ 1382 if (uFlags & DC_INBUTTON) 1383 { 1384 O32_FillRect (hdc, 1385 &rc, 1386 GetSysColorBrush (COLOR_3DFACE)); 1387 1388 if (uFlags & DC_ACTIVE) 1389 { 1390 HBRUSH hbr = O32_SelectObject (hdc, 1391 GetSysColorBrush (COLOR_ACTIVECAPTION)); 1392 O32_PatBlt (hdc, 1393 rc.left, 1394 rc.top, 1395 rc.right - rc.left, 1396 rc.bottom - rc.top, 1397 0xFA0089); 1398 1399 O32_SelectObject (hdc, 1400 hbr); 1401 } 1402 } 1403 else 1404 { 1405 O32_FillRect (hdc, 1406 &rc, 1407 GetSysColorBrush ((uFlags & DC_ACTIVE) ? 1408 COLOR_ACTIVECAPTION : COLOR_INACTIVECAPTION)); 1409 } 1410 1411 1412 /* drawing icon */ 1413 if ((uFlags & DC_ICON) && !(uFlags & DC_SMALLCAP)) 1414 { 1415 POINT pt; 1416 1417 pt.x = rc.left + 2; 1418 pt.y = (rc.bottom + rc.top - O32_GetSystemMetrics(SM_CYSMICON)) / 2; 1419 1420 if (hIcon) 1421 { 1422 DrawIconEx (hdc, 1423 pt.x, 1424 pt.y, 1425 hIcon, 1426 O32_GetSystemMetrics(SM_CXSMICON), 1427 O32_GetSystemMetrics(SM_CYSMICON), 1428 0, 1429 0, 1430 DI_NORMAL); 1431 } 1432 else 1433 { 1434 /* @@@PH 1999/06/08 not ported yet, just don't draw any icon 1435 WND *wndPtr = WIN_FindWndPtr(hwnd); 1436 HICON hAppIcon = 0; 1437 1438 if (wndPtr->class->hIconSm) 1439 hAppIcon = wndPtr->class->hIconSm; 1440 else 1441 if (wndPtr->class->hIcon) 1442 hAppIcon = wndPtr->class->hIcon; 1443 1444 DrawIconEx (hdc, 1445 pt.x, 1446 pt.y, 1447 hAppIcon, 1448 GetSystemMetrics(SM_CXSMICON), 1449 GetSystemMetrics(SM_CYSMICON), 1450 0, 1451 0, 1452 DI_NORMAL); 1453 1454 WIN_ReleaseWndPtr(wndPtr); 1455 */ 1456 } 1457 1458 rc.left += (rc.bottom - rc.top); 1459 } 1460 1461 /* drawing text */ 1462 if (uFlags & DC_TEXT) 1463 { 1464 HFONT hOldFont; 1465 1466 if (uFlags & DC_INBUTTON) 1467 O32_SetTextColor (hdc, 1468 O32_GetSysColor (COLOR_BTNTEXT)); 1469 else 1470 if (uFlags & DC_ACTIVE) 1471 O32_SetTextColor (hdc, 1472 O32_GetSysColor (COLOR_CAPTIONTEXT)); 1473 else 1474 O32_SetTextColor (hdc, 1475 O32_GetSysColor (COLOR_INACTIVECAPTIONTEXT)); 1476 1477 O32_SetBkMode (hdc, 1478 TRANSPARENT); 1479 1480 if (hFont) 1481 hOldFont = O32_SelectObject (hdc, 1482 hFont); 1483 else 1484 { 1485 NONCLIENTMETRICSA nclm; 1486 HFONT hNewFont; 1487 1488 nclm.cbSize = sizeof(NONCLIENTMETRICSA); 1489 O32_SystemParametersInfo (SPI_GETNONCLIENTMETRICS, 1490 0, 1491 &nclm, 1492 0); 1493 hNewFont = O32_CreateFontIndirect ((uFlags & DC_SMALLCAP) ? 1494 &nclm.lfSmCaptionFont : &nclm.lfCaptionFont); 1495 hOldFont = O32_SelectObject (hdc, 1496 hNewFont); 1497 } 1498 1499 if (str) 1500 DrawTextA (hdc, 1501 str, 1502 -1, 1503 &rc, 1504 DT_SINGLELINE | DT_VCENTER | DT_NOPREFIX | DT_LEFT); 1505 else 1506 { 1507 CHAR szText[128]; 1508 INT nLen; 1509 1510 nLen = O32_GetWindowText (Win32BaseWindow::Win32ToOS2FrameHandle(hwnd), 1511 szText, 1512 128); 1513 1514 DrawTextA (hdc, 1515 szText, 1516 nLen, 1517 &rc, 1518 DT_SINGLELINE | DT_VCENTER | DT_NOPREFIX | DT_LEFT); 1519 } 1520 1521 if (hFont) 1522 O32_SelectObject (hdc, 1523 hOldFont); 1524 else 1525 O32_DeleteObject (O32_SelectObject (hdc, 1526 hOldFont)); 1527 } 1528 1529 /* drawing focus ??? */ 1530 if (uFlags & 0x2000) 1531 { 1532 dprintf(("USER32: DrawCaptionTempA undocumented flag (0x2000)!\n")); 1533 } 1534 1535 return 0; 1491 BOOL WIN32API DrawCaptionTempA(HWND hwnd,HDC hdc,const RECT *rect,HFONT hFont,HICON hIcon,LPCSTR str,UINT uFlags) 1492 { 1493 dprintf(("USER32: DrawCaptionTempA")); 1494 1495 return DrawCaptionTemp(hwnd,hdc,rect,hFont,hIcon,(LPWSTR)str,uFlags,FALSE); 1536 1496 } 1537 1497 /*********************************************************************** … … 1544 1504 * Failure: 1545 1505 */ 1546 1547 BOOL WIN32API DrawCaptionTempW (HWND hwnd, 1548 HDC hdc, 1549 const RECT *rect, 1550 HFONT hFont, 1551 HICON hIcon, 1552 LPCWSTR str, 1553 UINT uFlags) 1554 { 1555 LPSTR strAscii = UnicodeToAsciiString((LPWSTR)str); 1556 1557 BOOL res = DrawCaptionTempA (hwnd, 1558 hdc, 1559 rect, 1560 hFont, 1561 hIcon, 1562 strAscii, 1563 uFlags); 1564 1565 FreeAsciiString(strAscii); 1566 1567 return res; 1568 } 1569 1506 BOOL WIN32API DrawCaptionTempW (HWND hwnd,HDC hdc,const RECT *rect,HFONT hFont,HICON hIcon,LPCWSTR str,UINT uFlags) 1507 { 1508 dprintf(("USER32: DrawCaptionTempA")); 1509 1510 return DrawCaptionTemp(hwnd,hdc,rect,hFont,hIcon,(LPWSTR)str,uFlags,TRUE); 1511 } 1512
Note:
See TracChangeset
for help on using the changeset viewer.