Minor work on scrollbars.

svn path=/trunk/; revision=7183
This commit is contained in:
Filip Navara 2003-12-22 20:22:40 +00:00
parent 6cb2390fa6
commit 6171a32cfa
2 changed files with 32 additions and 12 deletions

View file

@ -1,4 +1,4 @@
/* $Id: defwnd.c,v 1.112 2003/12/20 22:33:45 weiden Exp $ /* $Id: defwnd.c,v 1.113 2003/12/22 20:22:40 navaraf Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user32.dll * PROJECT: ReactOS user32.dll
@ -29,6 +29,7 @@ LRESULT DefWndNCActivate(HWND hWnd, WPARAM wParam);
LRESULT DefWndNCHitTest(HWND hWnd, POINT Point); LRESULT DefWndNCHitTest(HWND hWnd, POINT Point);
LRESULT DefWndNCLButtonDown(HWND hWnd, WPARAM wParam, LPARAM lParam); LRESULT DefWndNCLButtonDown(HWND hWnd, WPARAM wParam, LPARAM lParam);
LRESULT DefWndNCLButtonDblClk(HWND hWnd, WPARAM wParam, LPARAM lParam); LRESULT DefWndNCLButtonDblClk(HWND hWnd, WPARAM wParam, LPARAM lParam);
VOID DefWndTrackScrollBar(HWND hWnd, WPARAM wParam, POINT Point);
/* GLOBALS *******************************************************************/ /* GLOBALS *******************************************************************/
@ -809,6 +810,7 @@ DefWndHandleSysCommand(HWND hWnd, WPARAM wParam, POINT Pt)
case SC_KEYMENU: case SC_KEYMENU:
MenuTrackKbdMenuBar(hWnd, wParam, Pt.x); MenuTrackKbdMenuBar(hWnd, wParam, Pt.x);
break; break;
default: default:
/* FIXME: Implement */ /* FIXME: Implement */
UNIMPLEMENTED; UNIMPLEMENTED;
@ -880,7 +882,7 @@ DefWndHandleWindowPosChanged(HWND hWnd, WINDOWPOS* Pos)
* *
* Default colors for control painting. * Default colors for control painting.
*/ */
static HBRUSH HBRUSH
DefWndControlColor(HDC hDC, UINT ctlType) DefWndControlColor(HDC hDC, UINT ctlType)
{ {
if (CTLCOLOR_SCROLLBAR == ctlType) if (CTLCOLOR_SCROLLBAR == ctlType)

View file

@ -52,9 +52,9 @@ Already defined in makefile now.
* FIXME: This should be moved to a header * FIXME: This should be moved to a header
*/ */
VOID VOID
SCROLL_DrawScrollBar(HWND hWnd, HDC hDC, INT nBar, BOOL arrows, BOOL interior); IntDrawScrollBar(HWND hWnd, HDC hDC, INT nBar);
DWORD DWORD
SCROLL_HitTest( HWND hwnd, INT nBar, POINT pt, BOOL bDragging ); IntScrollHitTest(HWND hWnd, INT nBar, POINT pt, BOOL bDragging);
HPEN STDCALL HPEN STDCALL
GetSysColorPen(int nIndex); GetSysColorPen(int nIndex);
@ -483,15 +483,15 @@ DefWndNCPaint(HWND hWnd, HRGN hRgn)
FillRect(hDC, &TempRect, GetSysColorBrush(COLOR_SCROLLBAR)); FillRect(hDC, &TempRect, GetSysColorBrush(COLOR_SCROLLBAR));
/* FIXME: Correct drawing of size-box with WS_EX_LEFTSCROLLBAR */ /* FIXME: Correct drawing of size-box with WS_EX_LEFTSCROLLBAR */
SCROLL_DrawSizeGrip(hDC, &TempRect); SCROLL_DrawSizeGrip(hDC, &TempRect);
SCROLL_DrawScrollBar(hWnd, hDC, SB_VERT, TRUE, TRUE); IntDrawScrollBar(hWnd, hDC, SB_VERT);
SCROLL_DrawScrollBar(hWnd, hDC, SB_HORZ, TRUE, TRUE); IntDrawScrollBar(hWnd, hDC, SB_HORZ);
} }
else else
{ {
if (Style & WS_VSCROLL) if (Style & WS_VSCROLL)
SCROLL_DrawScrollBar(hWnd, hDC, SB_VERT, TRUE, TRUE); IntDrawScrollBar(hWnd, hDC, SB_VERT);
else if (Style & WS_HSCROLL) else if (Style & WS_HSCROLL)
SCROLL_DrawScrollBar(hWnd, hDC, SB_HORZ, TRUE, TRUE); IntDrawScrollBar(hWnd, hDC, SB_HORZ);
} }
ReleaseDC(hWnd, hDC); ReleaseDC(hWnd, hDC);
@ -790,10 +790,7 @@ DefWndDoScrollBarDown(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Point.x = GET_X_LPARAM(lParam); Point.x = GET_X_LPARAM(lParam);
Point.y = GET_Y_LPARAM(lParam); Point.y = GET_Y_LPARAM(lParam);
hit = SCROLL_HitTest(hWnd, (wParam == HTHSCROLL) ? SB_HORZ : SB_VERT, Point, FALSE); hit = IntScrollHitTest(hWnd, (wParam == HTHSCROLL) ? SB_HORZ : SB_VERT, Point, FALSE);
if(hit)
DPRINT("SCROLL_HitTest() == 0x%x\n", hit);
SendMessageW(hWnd, WM_SYSCOMMAND, Msg + (UINT)wParam, lParam); SendMessageW(hWnd, WM_SYSCOMMAND, Msg + (UINT)wParam, lParam);
} }
@ -967,6 +964,27 @@ DefWndNCLButtonDblClk(HWND hWnd, WPARAM wParam, LPARAM lParam)
return(0); return(0);
} }
VOID
DefWndTrackScrollBar(HWND hWnd, WPARAM wParam, POINT Point)
{
INT ScrollBar;
if ((wParam & 0xfff0) == SC_HSCROLL)
{
if ((wParam & 0x0f) != HTHSCROLL)
return;
ScrollBar = SB_HORZ;
}
else
{
if ((wParam & 0x0f) != HTVSCROLL)
return;
ScrollBar = SB_VERT;
}
/* FIXME */
}
/* PUBLIC FUNCTIONS ***********************************************************/ /* PUBLIC FUNCTIONS ***********************************************************/
/* /*