Ignore:
Timestamp:
Nov 13, 1999, 5:42:43 PM (26 years ago)
Author:
cbratschi
Message:

merged with wine-991031, fixed edit bugs

File:
1 edited

Legend:

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

    r1525 r1724  
    1 /* $Id: button.cpp,v 1.16 1999-10-30 18:40:43 cbratschi Exp $ */
     1/* $Id: button.cpp,v 1.17 1999-11-13 16:42:40 cbratschi Exp $ */
    22/* File: button.cpp -- Button type widgets
    33 *
     
    77 * Copyright (c) 1999 Christoph Bratschi
    88 *
    9  * WINE version: 990923
     9 * WINE version: 991031
    1010 */
    1111
     
    201201static LRESULT BUTTON_LButtonDown(HWND hwnd,WPARAM wParam,LPARAM lParam)
    202202{
     203  BUTTONINFO* infoPtr = (BUTTONINFO*)GetInfoPtr(hwnd);
     204
    203205  SetCapture(hwnd);
    204206  SetFocus(hwnd);
    205207  SendMessageA(hwnd,BM_SETSTATE,TRUE,0);
     208  infoPtr->state |= BUTTON_BTNPRESSED;
    206209
    207210  return 0;
     
    217220  pt.y = HIWORD(lParam);
    218221
     222  if (!(infoPtr->state & BUTTON_BTNPRESSED)) return 0;
     223  infoPtr->state &= BUTTON_NSTATES;
     224  if (!(infoPtr->state & BUTTON_HIGHLIGHTED))
     225  {
     226    ReleaseCapture();
     227    return 0;
     228  }
     229  SendMessageA(hwnd,BM_SETSTATE,FALSE,0);
    219230  ReleaseCapture();
    220   if (!(infoPtr->state & BUTTON_HIGHLIGHTED)) return 0;
    221   SendMessageA(hwnd,BM_SETSTATE,FALSE,0);
    222231  GetClientRect(hwnd,&rect);
    223232  if (PtInRect(&rect,pt))
     
    246255}
    247256
     257static LRESULT BUTTON_CaptureChanged(HWND hwnd,WPARAM wParam,LPARAM lParam)
     258{
     259  BUTTONINFO* infoPtr = (BUTTONINFO*)GetInfoPtr(hwnd);
     260
     261  if (infoPtr->state & BUTTON_BTNPRESSED)
     262  {
     263    infoPtr->state &= BUTTON_NSTATES;
     264    if (infoPtr->state & BUTTON_HIGHLIGHTED)
     265      SendMessageA( hwnd, BM_SETSTATE, FALSE, 0 );
     266  }
     267
     268  return 0;
     269}
     270
    248271static LRESULT BUTTON_MouseMove(HWND hwnd,WPARAM wParam,LPARAM lParam)
    249272{
     
    542565    case WM_LBUTTONUP:
    543566      return BUTTON_LButtonUp(hwnd,wParam,lParam);
     567
     568    case WM_CAPTURECHANGED:
     569      return BUTTON_CaptureChanged(hwnd,wParam,lParam);
    544570
    545571    case WM_MOUSEMOVE:
     
    10741100
    10751101    SetBkColor( hDC, GetSysColor( COLOR_BTNFACE ) );
    1076     FillRect( hDC,  &dis.rcItem, GetSysColorBrush( COLOR_BTNFACE ) );
    10771102
    10781103    dprintf(("OWNERDRAW button %x, enabled %d", hwnd, !(dwStyle & WS_DISABLED)));
Note: See TracChangeset for help on using the changeset viewer.