Changeset 1245 for trunk/src


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

Desktop enable bugfix + CTLCOLOR Wine port

Location:
trunk/src/user32
Files:
5 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}
  • trunk/src/user32/win32wbase.h

    r1209 r1245  
    1 /* $Id: win32wbase.h,v 1.16 1999-10-09 09:45:28 sandervl Exp $ */
     1/* $Id: win32wbase.h,v 1.17 1999-10-11 15:26:06 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    155155         BOOL   IsIconic();
    156156         HWND   GetWindow(UINT uCmd);
    157          BOOL   EnableWindow(BOOL fEnable);
     157 virtual BOOL   EnableWindow(BOOL fEnable);
    158158         BOOL   CloseWindow();
    159159  static HWND   GetActiveWindow();
     
    189189       LRESULT  DefWindowProcW(UINT msg, WPARAM wParam, LPARAM lParam);
    190190
     191       LRESULT  DefWndControlColor(UINT ctlType, HDC hdc);
     192
    191193         void   NotifyParent(UINT Msg, WPARAM wParam, LPARAM lParam);
    192194
  • trunk/src/user32/win32wdesktop.cpp

    r1234 r1245  
    1 /* $Id: win32wdesktop.cpp,v 1.3 1999-10-09 19:12:03 sandervl Exp $ */
     1/* $Id: win32wdesktop.cpp,v 1.4 1999-10-11 15:26:06 sandervl Exp $ */
    22/*
    33 * Win32 Desktop Window for OS/2
     
    6060}
    6161//******************************************************************************
     62//Disabling the desktop is not a good idea (mouse no longer responds)
     63//******************************************************************************
     64BOOL Win32Desktop::EnableWindow(BOOL fEnable)
     65{
     66  return TRUE; //of course we succeeded
     67}
     68//******************************************************************************
    6269//Dummy window procedure. Does nothing.
    6370//******************************************************************************
  • trunk/src/user32/win32wdesktop.h

    r1231 r1245  
    1 /* $Id: win32wdesktop.h,v 1.2 1999-10-09 18:16:57 sandervl Exp $ */
     1/* $Id: win32wdesktop.h,v 1.3 1999-10-11 15:26:07 sandervl Exp $ */
    22/*
    33 * Win32 Desktop Window for OS/2
     
    2323virtual ~Win32Desktop();
    2424
     25 virtual BOOL   EnableWindow(BOOL fEnable);
    2526
    2627protected:
  • trunk/src/user32/wndmsg.cpp

    r949 r1245  
    1 /* $Id: wndmsg.cpp,v 1.3 1999-09-15 23:19:03 sandervl Exp $ */
     1/* $Id: wndmsg.cpp,v 1.4 1999-10-11 15:26:07 sandervl Exp $ */
    22/*
    33 * Win32 window message text function for OS/2
     
    162162    { "WM_USERCHANGED", WM_USERCHANGED, 0},                 // 0x54
    163163    { "WM_NOTIFYFORMAT", WM_NOTIFYFORMAT, 0},               // 0x55
     164    { "WM_STYLECHANGING", WM_STYLECHANGING, 0},             // 0x7C
     165    { "WM_STYLECHANGED", WM_STYLECHANGED, 0},               // 0x7D
     166    { "WM_DISPLAYCHANGE", WM_DISPLAYCHANGE, 0},             // 0x7E
     167    { "WM_GETICON", WM_GETICON, 0},                         // 0x7F
     168    { "WM_SETICON", WM_SETICON, 0},                         // 0x80
    164169    { "WM_NCCREATE", WM_NCCREATE,                           // 0x0081
    165170        MTF_TYPE_NC},
Note: See TracChangeset for help on using the changeset viewer.