Ignore:
Timestamp:
May 3, 2001, 8:13:10 PM (24 years ago)
Author:
sandervl
Message:

YD: button WM_SETFONT bugfix

File:
1 edited

Legend:

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

    r4674 r5648  
    1 /* $Id: button.cpp,v 1.38 2000-11-22 13:44:49 sandervl Exp $ */
     1/* $Id: button.cpp,v 1.39 2001-05-03 18:13:10 sandervl Exp $ */
    22/* File: button.cpp -- Button type widgets
    33 *
     
    338338  DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);
    339339
     340#ifdef __WIN32OS2__
     341  if ((dwStyle & 0x0f) == BS_GROUPBOX) {
     342    RECT rc;
     343    TEXTMETRICA tm;
     344    HDC  hdc = GetDC(hwnd);
     345    int  fh1 = 0, fh2 = 0;
     346
     347    // select old font (if exists)
     348    if (infoPtr->hFont) {
     349       SelectObject (hdc, infoPtr->hFont);
     350       GetTextMetricsA (hdc, &tm);
     351       fh1 = tm.tmHeight;
     352    }
     353    // select new font (if exists)
     354    if (wParam) {
     355       SelectObject (hdc, wParam);
     356       GetTextMetricsA (hdc, &tm);
     357       fh2 = tm.tmHeight;
     358    }
     359    // Erases top border line and (old) text background
     360    GetClientRect(hwnd, &rc);
     361    rc.bottom = rc.top + max( fh1, fh2) + 1;
     362    HBRUSH hbr = GetControlBrush( hwnd, hdc, CTLCOLOR_STATIC );
     363    FillRect(hdc, &rc, hbr);
     364    ReleaseDC(hwnd,hdc);
     365  }
     366#endif
     367
    340368  infoPtr->hFont = (HFONT)wParam;
    341369  if (lParam && (dwStyle & WS_VISIBLE)) PAINT_BUTTON(hwnd,dwStyle & 0x0f,ODA_DRAWENTIRE);
Note: See TracChangeset for help on using the changeset viewer.