mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 17:05:46 +00:00
Scrollbar implementation
svn path=/trunk/; revision=7625
This commit is contained in:
parent
eb5f406f20
commit
fa6209cc0f
4 changed files with 736 additions and 170 deletions
File diff suppressed because it is too large
Load diff
14
reactos/lib/user32/include/scroll.h
Normal file
14
reactos/lib/user32/include/scroll.h
Normal file
|
@ -0,0 +1,14 @@
|
|||
/* $Id: scroll.h,v 1.1 2004/01/14 21:28:24 gvg Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS user32.dll
|
||||
* FILE: include/user32.h
|
||||
* PURPOSE: Global user32 definitions
|
||||
*/
|
||||
|
||||
#ifndef USER32_SCROLL_H_INCLUDED
|
||||
#define USER32_SCROLL_H_INCLUDED
|
||||
|
||||
extern VOID FASTCALL ScrollTrackScrollBar(HWND Wnd, INT SBType, POINT Pt);
|
||||
|
||||
#endif
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: defwnd.c,v 1.121 2004/01/12 20:38:59 gvg Exp $
|
||||
/* $Id: defwnd.c,v 1.122 2004/01/14 21:28:24 gvg Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS user32.dll
|
||||
|
@ -16,8 +16,9 @@
|
|||
#include <window.h>
|
||||
#include <user32/wininternal.h>
|
||||
#include <string.h>
|
||||
#include <menu.h>
|
||||
#include <cursor.h>
|
||||
#include <menu.h>
|
||||
#include <scroll.h>
|
||||
#include <winpos.h>
|
||||
|
||||
#define NDEBUG
|
||||
|
@ -29,7 +30,6 @@ LRESULT DefWndNCActivate(HWND hWnd, WPARAM wParam);
|
|||
LRESULT DefWndNCHitTest(HWND hWnd, POINT Point);
|
||||
LRESULT DefWndNCLButtonDown(HWND hWnd, WPARAM wParam, LPARAM lParam);
|
||||
LRESULT DefWndNCLButtonDblClk(HWND hWnd, WPARAM wParam, LPARAM lParam);
|
||||
VOID DefWndTrackScrollBar(HWND hWnd, WPARAM wParam, POINT Point);
|
||||
|
||||
/* GLOBALS *******************************************************************/
|
||||
|
||||
|
@ -748,6 +748,36 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam)
|
|||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* DefWndTrackScrollBar
|
||||
*
|
||||
* Track a mouse button press on the horizontal or vertical scroll-bar.
|
||||
*/
|
||||
STATIC VOID
|
||||
DefWndTrackScrollBar(HWND Wnd, WPARAM wParam, POINT Pt)
|
||||
{
|
||||
INT ScrollBar;
|
||||
|
||||
if (SC_HSCROLL == (wParam & 0xfff0))
|
||||
{
|
||||
if (HTHSCROLL != (wParam & 0x0f))
|
||||
{
|
||||
return;
|
||||
}
|
||||
ScrollBar = SB_HORZ;
|
||||
}
|
||||
else /* SC_VSCROLL */
|
||||
{
|
||||
if (HTVSCROLL != (wParam & 0x0f))
|
||||
{
|
||||
return;
|
||||
}
|
||||
ScrollBar = SB_VERT;
|
||||
}
|
||||
ScrollTrackScrollBar(Wnd, ScrollBar, Pt );
|
||||
}
|
||||
|
||||
|
||||
LRESULT
|
||||
DefWndHandleSysCommand(HWND hWnd, WPARAM wParam, POINT Pt)
|
||||
{
|
||||
|
@ -792,6 +822,10 @@ DefWndHandleSysCommand(HWND hWnd, WPARAM wParam, POINT Pt)
|
|||
case SC_KEYMENU:
|
||||
MenuTrackKbdMenuBar(hWnd, wParam, Pt.x);
|
||||
break;
|
||||
case SC_VSCROLL:
|
||||
case SC_HSCROLL:
|
||||
DefWndTrackScrollBar(hWnd, wParam, Pt);
|
||||
break;
|
||||
|
||||
default:
|
||||
/* FIXME: Implement */
|
||||
|
@ -867,6 +901,7 @@ DefWndHandleWindowPosChanged(HWND hWnd, WINDOWPOS* Pos)
|
|||
HBRUSH
|
||||
DefWndControlColor(HDC hDC, UINT ctlType)
|
||||
{
|
||||
#if 0 /* FIXME: Re-enable when pattern brushes are implemented */
|
||||
if (CTLCOLOR_SCROLLBAR == ctlType)
|
||||
{
|
||||
HBRUSH hb = GetSysColorBrush(COLOR_SCROLLBAR);
|
||||
|
@ -897,6 +932,7 @@ DefWndControlColor(HDC hDC, UINT ctlType)
|
|||
UnrealizeObject(hb);
|
||||
return hb;
|
||||
}
|
||||
#endif
|
||||
|
||||
SetTextColor(hDC, GetSysColor(COLOR_WINDOWTEXT));
|
||||
|
||||
|
|
|
@ -715,7 +715,7 @@ DefWndNCHitTest(HWND hWnd, POINT Point)
|
|||
TempRect2.left += GetSystemMetrics(SM_CXVSCROLL);
|
||||
else
|
||||
TempRect2.right -= GetSystemMetrics(SM_CXVSCROLL);
|
||||
if (PtInRect(&TempRect, Point))
|
||||
if (PtInRect(&TempRect2, Point))
|
||||
return HTHSCROLL;
|
||||
|
||||
TempRect.top = TempRect2.top;
|
||||
|
@ -755,19 +755,6 @@ DefWndNCHitTest(HWND hWnd, POINT Point)
|
|||
return HTNOWHERE;
|
||||
}
|
||||
|
||||
VOID
|
||||
DefWndDoScrollBarDown(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
POINT Point;
|
||||
DWORD hit;
|
||||
Point.x = GET_X_LPARAM(lParam);
|
||||
Point.y = GET_Y_LPARAM(lParam);
|
||||
|
||||
hit = IntScrollHitTest(hWnd, (wParam == HTHSCROLL) ? SB_HORZ : SB_VERT, Point, FALSE);
|
||||
|
||||
SendMessageW(hWnd, WM_SYSCOMMAND, Msg + (UINT)wParam, lParam);
|
||||
}
|
||||
|
||||
VOID
|
||||
DefWndDoButton(HWND hWnd, WPARAM wParam)
|
||||
{
|
||||
|
@ -879,14 +866,12 @@ DefWndNCLButtonDown(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
|||
}
|
||||
case HTHSCROLL:
|
||||
{
|
||||
DefWndDoScrollBarDown(hWnd, SC_HSCROLL, HTHSCROLL, lParam);
|
||||
//SendMessageW(hWnd, WM_SYSCOMMAND, SC_HSCROLL + HTHSCROLL, lParam);
|
||||
SendMessageW(hWnd, WM_SYSCOMMAND, SC_HSCROLL + HTHSCROLL, lParam);
|
||||
break;
|
||||
}
|
||||
case HTVSCROLL:
|
||||
{
|
||||
DefWndDoScrollBarDown(hWnd, SC_VSCROLL, HTVSCROLL, lParam);
|
||||
//SendMessageW(hWnd, WM_SYSCOMMAND, SC_VSCROLL + HTVSCROLL, lParam);
|
||||
SendMessageW(hWnd, WM_SYSCOMMAND, SC_VSCROLL + HTVSCROLL, lParam);
|
||||
break;
|
||||
}
|
||||
case HTMINBUTTON:
|
||||
|
|
Loading…
Reference in a new issue