Changeset 7683 for trunk/src


Ignore:
Timestamp:
Dec 26, 2001, 12:35:39 PM (24 years ago)
Author:
sandervl
Message:

WM_CTLCOLOR fix for buttonsbutton.cpp

Location:
trunk/src/user32
Files:
4 edited

Legend:

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

    r7409 r7683  
    1 /* $Id: button.cpp,v 1.44 2001-11-21 11:51:37 sandervl Exp $ */
     1/* $Id: button.cpp,v 1.45 2001-12-26 11:35:38 sandervl Exp $ */
    22/* File: button.cpp -- Button type widgets
    33 *
     
    10281028    if (infoPtr->hFont) SelectObject( hDC, infoPtr->hFont );
    10291029
    1030     /* GetControlBrush16 sends WM_CTLCOLORBTN, plus it returns default brush
    1031      * if parent didn't return valid one. So we kill two hares at once
    1032      */
    1033     hBrush = GetControlBrush( hwnd, hDC, CTLCOLOR_BTN );
    1034 
    1035     /* In order to make things right, draw the rectangle background! */
    1036     if ( !(infoPtr->state & BUTTON_HASFOCUS) && (action == ODA_DRAWENTIRE) )
    1037     {
    1038         colour = GetBkColor(hDC);
    1039         hPen = CreatePen( PS_SOLID, 1, colour );
    1040         if ( hPen )
    1041         {
    1042             hOldBrush = SelectObject( hDC, hBrush );
    1043             hOldPen = SelectObject( hDC, hPen );
    1044             Rectangle( hDC, client.left, client.top, client.right, client.bottom );
    1045             SelectObject( hDC, hOldPen );
    1046             SelectObject( hDC, hOldBrush );
    1047             DeleteObject( hPen );
    1048         }
    1049     }
     1030#ifdef __WIN32OS2__
     1031    //(Auto)Check, (Auto)Radio & (Auto)3State buttons send WM_CTLCOLORSTATIC
     1032    //instead of WM_CTLCOLORBTN (verified in NT4)
     1033    hBrush = SendMessageW( GetParent(hwnd), WM_CTLCOLORSTATIC, hDC, (LPARAM)hwnd );
     1034    if (!hBrush) /* did the app forget to call defwindowproc ? */
     1035        hBrush = DefWindowProcW( GetParent(hwnd), WM_CTLCOLORSTATIC, hDC, (LPARAM)hwnd );
     1036#endif
    10501037
    10511038    if (dwStyle & BS_LEFTTEXT)
     
    10771064    {
    10781065        UINT state;
     1066
     1067        /* Since WM_ERASEBKGND does nothing, first prepare background */
     1068        if (action == ODA_SELECT) FillRect( hDC, &rbox, hBrush );
     1069        else FillRect( hDC, &client, hBrush );
    10791070
    10801071        if (((dwStyle & 0x0f) == BS_RADIOBUTTON) ||
  • trunk/src/user32/dc.cpp

    r7627 r7683  
    1 /* $Id: dc.cpp,v 1.113 2001-12-13 15:32:57 sandervl Exp $ */
     1/* $Id: dc.cpp,v 1.114 2001-12-26 11:35:38 sandervl Exp $ */
    22
    33/*
     
    7878#ifdef DEBUG
    7979#define dprintfRegion(a,b,c) if(DbgEnabledLvl2USER32[DBG_LOCALLOG] == 1) dprintfRegion1(a,b,c)
     80//#define dprintfRegion(a,b,c) dprintfRegion1(a,b,c)
    8081
    8182void dprintfRegion1(HPS hps, HWND hWnd, HRGN hrgnClip)
     
    13161317        dprintf2(("Update region (%d,%d)(%d,%d)", rectl.xLeft, rectl.yBottom, rectl.xRight, rectl.yTop));
    13171318        //TODO: Does this work if RDW_ALLCHILDREN is set??
    1318         if(redraw & RDW_UPDATENOW_W) {
    1319             RECT rectUpdate;
    1320 
    1321             if(redraw & RDW_FRAME_W) {
    1322                 mapOS2ToWin32Rect(wnd->getWindowHeight(), (PRECTLOS2)&rectl, &rectUpdate);
    1323                 wnd->MsgNCPaint(&rectUpdate);
    1324             }
    1325 
    1326             wnd->MsgPaint(0, FALSE);
     1319        if(redraw & RDW_UPDATENOW_W)
     1320        {
     1321            dprintf(("RDW_UPDATENOW -> UpdateWindow"));
     1322            UpdateWindow(wnd->getWindowHandle());
    13271323        }
    13281324        else
     
    13361332    else if((redraw & RDW_INTERNALPAINT_W) && !(redraw & RDW_INVALIDATE_W))
    13371333    {
     1334        dprintf(("Manual redraw"));
    13381335        if(redraw & RDW_UPDATENOW_W) {
    13391336            wnd->MsgPaint(0, FALSE);
  • trunk/src/user32/menu.cpp

    r7516 r7683  
    1 /* $Id: menu.cpp,v 1.43 2001-12-01 16:02:16 sandervl Exp $*/
     1/* $Id: menu.cpp,v 1.44 2001-12-26 11:35:39 sandervl Exp $*/
    22/*
    33 * Menu functions
     
    44364436                                  LPMENUITEMINFOA lpmii)
    44374437{
    4438     dprintf(("USER32: GetMenuItemInfoA"));
     4438    dprintf(("USER32: GetMenuItemInfoA %x %d %d %x", hmenu, item, bypos, lpmii));
    44394439
    44404440    return GetMenuItemInfo_common (hmenu, item, bypos, lpmii, FALSE);
     
    44474447                                  LPMENUITEMINFOW lpmii)
    44484448{
    4449     dprintf(("USER32: GetMenuItemInfoW"));
     4449    dprintf(("USER32: GetMenuItemInfoW %x %d %d %x", hmenu, item, bypos, lpmii));
    44504450
    44514451    return GetMenuItemInfo_common (hmenu, item, bypos,
  • trunk/src/user32/win32wbase.cpp

    r7620 r7683  
    1 /* $Id: win32wbase.cpp,v 1.305 2001-12-12 16:40:44 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.306 2001-12-26 11:35:39 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    21602160  }
    21612161  fInternalMsg = fInternalMsgBackup;
    2162   dprintf2(("SendMessageA %x %x %x %x returned %d", getWindowHandle(), Msg, wParam, lParam, rc));
     2162  dprintf2(("SendMessageA %x %x %x %x returned %x", getWindowHandle(), Msg, wParam, lParam, rc));
    21632163  return rc;
    21642164}
     
    22212221  }
    22222222  fInternalMsg = fInternalMsgBackup;
    2223   dprintf2(("SendMessageW %x %x %x %x returned %d", getWindowHandle(), Msg, wParam, lParam, rc));
     2223  dprintf2(("SendMessageW %x %x %x %x returned %x", getWindowHandle(), Msg, wParam, lParam, rc));
    22242224  return rc;
    22252225}
Note: See TracChangeset for help on using the changeset viewer.