Ignore:
Timestamp:
Oct 11, 1999, 5:26:07 PM (26 years ago)
Author:
sandervl
Message:

Desktop enable bugfix + CTLCOLOR Wine port

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/win32wbase.cpp

    r1231 r1245  
    1 /* $Id: win32wbase.cpp,v 1.33 1999-10-09 18:16:57 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.34 1999-10-11 15:26:05 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    912912        return 0; //todo
    913913    case CMD_ACCELERATOR:
    914         // this fit not really windows behavior.
    915         // maybe TranslateAccelerator() is better
    916         dprintf(("accelerator command"));
    917         return SendInternalMessageA(WM_COMMAND, MAKELONG(Id, 0), 0);
     914        // this fit not really windows behavior.
     915        // maybe TranslateAccelerator() is better
     916        dprintf(("accelerator command"));
     917        return SendInternalMessageA(WM_COMMAND, MAKELONG(Id, 0), 0);
    918918  }
    919919  return 0;
     
    14381438//******************************************************************************
    14391439//******************************************************************************
     1440LRESULT Win32BaseWindow::DefWndControlColor(UINT ctlType, HDC hdc)
     1441{
     1442    //SvL: Set background color to default button color (not window (white))
     1443    if(ctlType == CTLCOLOR_BTN)
     1444    {
     1445        SetBkColor(hdc, GetSysColor(COLOR_BTNFACE));
     1446        SetTextColor(hdc, GetSysColor(COLOR_WINDOWTEXT));
     1447        return GetSysColorBrush(COLOR_BTNFACE);
     1448    }
     1449    //SvL: Set background color to default dialog color if window is dialog
     1450    if((ctlType == CTLCOLOR_DLG || ctlType == CTLCOLOR_STATIC) && IsDialog()) {
     1451        SetBkColor(hdc, GetSysColor(COLOR_BTNFACE));
     1452        SetTextColor(hdc, GetSysColor(COLOR_WINDOWTEXT));
     1453        return GetSysColorBrush(COLOR_BTNFACE);
     1454    }
     1455
     1456    if( ctlType == CTLCOLOR_SCROLLBAR)
     1457    {
     1458            HBRUSH hb = GetSysColorBrush(COLOR_SCROLLBAR);
     1459        COLORREF bk = GetSysColor(COLOR_3DHILIGHT);
     1460        SetTextColor( hdc, GetSysColor(COLOR_3DFACE));
     1461        SetBkColor( hdc, bk);
     1462
     1463//TODO?
     1464#if 0
     1465         /* if COLOR_WINDOW happens to be the same as COLOR_3DHILIGHT
     1466          * we better use 0x55aa bitmap brush to make scrollbar's background
     1467          * look different from the window background.
     1468          */
     1469        if (bk == GetSysColor(COLOR_WINDOW)) {
     1470             return CACHE_GetPattern55AABrush();
     1471        }
     1472#endif
     1473        UnrealizeObject( hb );
     1474        return (LRESULT)hb;
     1475    }
     1476
     1477    SetTextColor( hdc, GetSysColor(COLOR_WINDOWTEXT));
     1478
     1479        if ((ctlType == CTLCOLOR_EDIT) || (ctlType == CTLCOLOR_LISTBOX))
     1480        {
     1481            SetBkColor( hdc, GetSysColor(COLOR_WINDOW) );
     1482        }
     1483        else
     1484        {
     1485            SetBkColor( hdc, GetSysColor(COLOR_3DFACE) );
     1486            return (LRESULT)GetSysColorBrush(COLOR_3DFACE);
     1487        }
     1488    return (LRESULT)GetSysColorBrush(COLOR_WINDOW);
     1489}
     1490//******************************************************************************
     1491//******************************************************************************
    14401492LRESULT Win32BaseWindow::DefWindowProcA(UINT Msg, WPARAM wParam, LPARAM lParam)
    14411493{
     
    14691521        return(TRUE);
    14701522
    1471     //SvL: Set background color to default button color (not window (white))
    1472     case WM_CTLCOLORBTN:
    1473         SetBkColor((HDC)wParam, GetSysColor(COLOR_BTNFACE));
    1474         SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
    1475         return GetSysColorBrush(COLOR_BTNFACE);
    1476 
    1477     //SvL: Set background color to default dialog color if window is dialog
    1478     case WM_CTLCOLORDLG:
    1479     case WM_CTLCOLORSTATIC:
    1480         if(IsDialog()) {
    1481             SetBkColor((HDC)wParam, GetSysColor(COLOR_BTNFACE));
    1482             SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
    1483             return GetSysColorBrush(COLOR_BTNFACE);
    1484         }
    1485         //no break
    1486 
    14871523    case WM_CTLCOLORMSGBOX:
    14881524    case WM_CTLCOLOREDIT:
    14891525    case WM_CTLCOLORLISTBOX:
     1526    case WM_CTLCOLORBTN:
     1527    case WM_CTLCOLORDLG:
     1528    case WM_CTLCOLORSTATIC:
    14901529    case WM_CTLCOLORSCROLLBAR:
    1491          SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
    1492          SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
    1493          return GetSysColorBrush(COLOR_BTNFACE);
     1530        return DefWndControlColor(Msg - WM_CTLCOLORMSGBOX, (HDC)wParam);
     1531
     1532    case WM_CTLCOLOR:
     1533            return DefWndControlColor(HIWORD(lParam), (HDC)wParam);
     1534
     1535    case WM_VKEYTOITEM:
     1536    case WM_CHARTOITEM:
     1537             return -1;
    14941538
    14951539    case WM_PARENTNOTIFY:
     
    25312575 Win32BaseWindow *window;
    25322576
    2533    if(hwnd == NULL && windowDesktop) 
    2534         return windowDesktop;
     2577   if(hwnd == NULL && windowDesktop)
     2578    return windowDesktop;
    25352579
    25362580   if(HwGetWindowHandleData(hwnd, (DWORD *)&window) == TRUE) {
     
    25972641        if(window) {
    25982642                return window->getWindowHandle();
    2599         } 
     2643        }
    26002644        else    return hwnd;    //OS/2 window handle
    26012645}
Note: See TracChangeset for help on using the changeset viewer.