Ignore:
Timestamp:
Mar 31, 2015, 5:56:55 PM (11 years ago)
Author:
rousseau
Message:

Fixed button text alignment

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/swt/src/user32/button.cpp

    r9974 r22094  
    186186{
    187187  DWORD style = GetWindowLongA(hwnd,GWL_STYLE) & 0x0f;
    188   //SvL: TODO: NT does something extra for ownerdrawn buttons; check this 
     188  //SvL: TODO: NT does something extra for ownerdrawn buttons; check this
    189189  if(style == BS_OWNERDRAW) {
    190190        return DefWindowProcA(hwnd, WM_ERASEBKGND, wParam, lParam);
     
    590590  if (wParam > maxCheckState[style]) wParam = maxCheckState[style];
    591591#ifndef __WIN32OS2__
    592   //Must clear WS_TABSTOP of control that is already disabled or else 
    593   //multiple control can have this style ((auto)radiobutton) and 
     592  //Must clear WS_TABSTOP of control that is already disabled or else
     593  //multiple control can have this style ((auto)radiobutton) and
    594594  //GetNextDlgTabItem will return the wrong one
    595595  //Happens in Opera preferences dialog (multimedia) where all autoradio
     
    781781  else format = defHorz;
    782782
     783/*
    783784  if (dwStyle & BS_TOP) format |= DT_TOP;
    784785  else if (dwStyle & BS_VCENTER) format |= DT_VCENTER;
    785786  else if (dwStyle & BS_BOTTOM) format |= DT_BOTTOM;
    786787  else format |= defVert;
    787 
     788*/
     789
     790  /*
     791   * BS_CENTER is not a single bit-flag, but is actually BS_LEFT | BS_RIGHT.
     792   * So we need an extra compare to distinguish it.
     793   * TODO: Scan for more occurences like this and other multi-bit flags
     794   */
     795  if ((dwStyle & BS_CENTER) == BS_LEFT) format = DT_LEFT;
     796  else if ((dwStyle & BS_CENTER) == BS_CENTER) format = DT_CENTER;
     797  else if (((dwStyle & BS_RIGHT) == BS_RIGHT) || ((dwExStyle & WS_EX_RIGHT) == BS_RIGHT)) format = DT_RIGHT;
     798  else format = defHorz;
    788799  if (!(dwStyle & BS_MULTILINE)) format |= DT_SINGLELINE;
    789800
     
    11821193
    11831194      if (dwStyle & WS_DISABLED) {
    1184            DrawDisabledText(hDC,text,&rc,format); 
     1195           DrawDisabledText(hDC,text,&rc,format);
    11851196      }
    11861197      else
Note: See TracChangeset for help on using the changeset viewer.