Ignore:
Timestamp:
Dec 26, 1999, 6:30:20 PM (26 years ago)
Author:
cbratschi
Message:

non-client fixes, DefWndProc enhancements, several other bugs fixed

File:
1 edited

Legend:

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

    r2185 r2204  
    1 /* $Id: button.cpp,v 1.24 1999-12-21 17:03:42 cbratschi Exp $ */
     1/* $Id: button.cpp,v 1.25 1999-12-26 17:30:14 cbratschi Exp $ */
    22/* File: button.cpp -- Button type widgets
    33 *
     
    219219  BUTTONINFO* infoPtr = (BUTTONINFO*)GetInfoPtr(hwnd);
    220220  DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);
    221 
     221  DWORD style = dwStyle & 0x0F;
     222
     223  if (style == BS_GROUPBOX) return 0;
    222224  SetCapture(hwnd);
    223225  SetFocus(hwnd);
     
    234236  BUTTONINFO* infoPtr = (BUTTONINFO*)GetInfoPtr(hwnd);
    235237  DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);
     238  DWORD style = dwStyle & 0x0F;
    236239  RECT rect;
    237240  POINT pt;
    238241
     242  if (style == BS_GROUPBOX) return 0;
    239243  pt.x = LOWORD(lParam);
    240244  pt.y = HIWORD(lParam);
     
    460464static LRESULT BUTTON_SetStyle(HWND hwnd,WPARAM wParam,LPARAM lParam)
    461465{
    462   DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);
     466  DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE),newStyle;
    463467
    464468  if ((wParam & 0x0f) >= MAX_BTN_TYPE) return 0;
    465   dwStyle = (dwStyle & 0xfffffff0) | (wParam & 0x0000000f);
    466   SetWindowLongA(hwnd,GWL_STYLE,dwStyle);
    467   PAINT_BUTTON(hwnd,dwStyle & 0x0f,ODA_DRAWENTIRE);
     469  newStyle = (dwStyle & 0xfffffff0) | (wParam & 0x0000000f);
     470
     471  if (newStyle != dwStyle)
     472  {
     473    SetWindowLongA(hwnd,GWL_STYLE,newStyle);
     474    PAINT_BUTTON(hwnd,newStyle & 0x0f,ODA_DRAWENTIRE);
     475  }
    468476
    469477  return 0;
     
    542550{
    543551  BUTTONINFO* infoPtr = (BUTTONINFO*)GetInfoPtr(hwnd);
    544   DWORD style = GetWindowLongA(hwnd,GWL_STYLE) & 0x0f;
     552  DWORD style = GetWindowLongA(hwnd,GWL_STYLE) & 0x0F;
    545553
    546554  if (wParam)
Note: See TracChangeset for help on using the changeset viewer.