Ignore:
Timestamp:
May 7, 2002, 3:28:13 PM (23 years ago)
Author:
sandervl
Message:

PF: SetParent mustn't change WS_CHILD; experimental getParent change; listbox/combobox fixes for MFC applications

File:
1 edited

Legend:

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

    r8301 r8377  
    1 /* $Id: listbox.cpp,v 1.28 2002-04-24 08:56:16 sandervl Exp $ */
     1/* $Id: listbox.cpp,v 1.29 2002-05-07 13:28:12 sandervl Exp $ */
    22/*
    33 * Listbox controls
     
    17711771
    17721772    if (descr->style & LBS_MULTICOLUMN) return 0;
     1773    dprintf(("We are handling scroll"));
    17731774    switch(LOWORD(wParam))
    17741775    {
     
    20382039      if (!PtInRect(&screenRect,screenMousePos))
    20392040      {
     2041        dprintf(("Scrollbar hittest - plain branch"));
    20402042        ReleaseCapture();
     2043        LISTBOX_SetCaretIndex( hwnd, pDescr, pDescr->lphc->droppedIndex, FALSE );
    20412044        LISTBOX_SetSelection( hwnd, pDescr, pDescr->lphc->droppedIndex, FALSE, FALSE );
    20422045#ifdef __WIN32OS2__
    20432046        COMBO_RollupListbox(pDescr->lphc);
    20442047 
    2045        /* @@PF Previous code is all wrong here. Here we are supposed to close
     2048         /* @@PF Previous code is all wrong here. Here we are supposed to close
    20462049         and only close dropdown, instead flip, flips it. This happens because
    20472050         previous code did not pay attention to the fact that combobox can be
     
    20522055#endif
    20532056        return 0;
    2054       } else
     2057      }
     2058      else
    20552059      {
    2056         /* Check to see the NC is a scrollbar */
    2057         INT nHitTestType = SendMessageA(hwnd,WM_NCHITTEST,0,MAKELONG(screenMousePos.x,screenMousePos.y));
    2058 
    2059         /* Windows sends this message when a scrollbar is clicked
    2060          */
    2061         if (nHitTestType != HTCLIENT)
    2062         {
    2063           SendMessageA(hwnd,(msg == WM_LBUTTONDOWN) ? WM_NCLBUTTONDOWN:WM_NCLBUTTONDBLCLK,nHitTestType,MAKELONG(screenMousePos.x,screenMousePos.y));
    2064         }
    2065 
    2066         /* Resume the Capture after scrolling is complete
    2067          */
    2068         if (hWndOldCapture)
    2069         {
    2070           SetCapture(hWndOldCapture);
    2071         }
     2060            INT nHitTestType=0;
     2061            LONG style = GetWindowLongA( hwnd, GWL_STYLE );
     2062            /* Check Vertical scroll bar */
     2063            if (style & WS_VSCROLL)
     2064            {
     2065                clientRect.right += GetSystemMetrics(SM_CXVSCROLL);
     2066                if (PtInRect( &clientRect, mousePos ))
     2067                {
     2068                    nHitTestType = HTVSCROLL;
     2069                }
     2070            }
     2071              /* Check horizontal scroll bar */
     2072            if (style & WS_HSCROLL)
     2073            {
     2074                clientRect.bottom += GetSystemMetrics(SM_CYHSCROLL);
     2075                if (PtInRect( &clientRect, mousePos ))
     2076                {
     2077                    nHitTestType = HTHSCROLL;
     2078                }
     2079            }
     2080            /* Windows sends this message when a scrollbar is clicked
     2081             */
     2082
     2083            if(nHitTestType != 0)
     2084            {
     2085                SendMessageW(hwnd, WM_NCLBUTTONDOWN, nHitTestType,
     2086                    MAKELONG(screenMousePos.x, screenMousePos.y));
     2087            }
     2088            /* Resume the Capture after scrolling is complete
     2089             */
     2090            if(hWndOldCapture != 0)
     2091            {
     2092                SetCapture(hWndOldCapture);
     2093            }
     2094
    20722095      }
    20732096    }
Note: See TracChangeset for help on using the changeset viewer.