Ignore:
Timestamp:
Oct 8, 1999, 11:26:08 PM (26 years ago)
Author:
cbratschi
Message:

merged with WINE, other fixes

File:
1 edited

Legend:

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

    r1184 r1203  
    1 /* $Id: button.cpp,v 1.4 1999-10-08 12:10:26 cbratschi Exp $ */
     1/* $Id: button.cpp,v 1.5 1999-10-08 21:23:07 cbratschi Exp $ */
    22/* File: button.cpp -- Button type widgets
    33 *
     
    66 * Copyright (C) 1994 Alexandre Julliard
    77 * Copyright (c) 1999 Christoph Bratschi
     8 *
     9 * WINE version: 990923
    810 */
    911
     
    467469        dwStyle &= ~WS_TABSTOP;
    468470
    469       if (oldStyle != dwStyle) SetWindowLongA(hwnd,GWL_STYLE,dwStyle);
     471      //if (oldStyle != dwStyle) SetWindowLongA(hwnd,GWL_STYLE,dwStyle);
    470472    }
    471473    infoPtr->state = (infoPtr->state & ~3) | wParam;
     
    930932    if (action == ODA_DRAWENTIRE || action == ODA_SELECT)
    931933    {
    932         HDC hMemDC = CreateCompatibleDC( hDC );
    933         int x = 0, y = 0;
    934         delta = (rbox.bottom - rbox.top - checkBoxHeight) >> 1;
    935 
    936         if (action == ODA_SELECT) FillRect( hDC, &rbox, hBrush );
    937         else FillRect( hDC, &client, hBrush );
    938 
    939         if (infoPtr->state & BUTTON_HIGHLIGHTED) x += 2 * checkBoxWidth;
    940         if (infoPtr->state & (BUTTON_CHECKED | BUTTON_3STATE)) x += checkBoxWidth;
     934        UINT state;
     935
    941936        if (((dwStyle & 0x0f) == BS_RADIOBUTTON) ||
    942             ((dwStyle & 0x0f) == BS_AUTORADIOBUTTON)) y += checkBoxHeight;
    943         else if (infoPtr->state & BUTTON_3STATE) y += 2 * checkBoxHeight;
    944 
    945         SelectObject( hMemDC, hbitmapCheckBoxes );
    946         BitBlt( hDC, rbox.left, rbox.top + delta, checkBoxWidth,
    947                   checkBoxHeight, hMemDC, x, y, SRCCOPY );
    948         DeleteDC( hMemDC );
     937            ((dwStyle & 0x0f) == BS_AUTORADIOBUTTON)) state = DFCS_BUTTONRADIO;
     938        else if (infoPtr->state & BUTTON_3STATE) state = DFCS_BUTTON3STATE;
     939        else state = DFCS_BUTTONCHECK;
     940
     941        if (infoPtr->state & (BUTTON_CHECKED | BUTTON_3STATE)) state |= DFCS_CHECKED;
     942
     943        if (infoPtr->state & BUTTON_HIGHLIGHTED) state |= DFCS_PUSHED;
     944
     945        if (dwStyle & WS_DISABLED) state |= DFCS_INACTIVE;
     946
     947        DrawFrameControl( hDC, &rbox, DFC_BUTTON, state );
    949948
    950949        if( text && action != ODA_SELECT )
     
    960959            DrawTextA( hDC, text, -1, &rtext,
    961960                         DT_SINGLELINE | DT_VCENTER );
    962             textLen = 0; /* skip DrawText() below */
    963961          }
    964962        }
Note: See TracChangeset for help on using the changeset viewer.