Bug fixes.

svn path=/trunk/; revision=7193
This commit is contained in:
Filip Navara 2003-12-23 08:48:59 +00:00
parent 47a02358b6
commit 6e39aab608
5 changed files with 67 additions and 52 deletions

View file

@ -1,4 +1,4 @@
/* $Id: defwnd.c,v 1.113 2003/12/22 20:22:40 navaraf Exp $ /* $Id: defwnd.c,v 1.114 2003/12/23 08:48:59 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
@ -898,11 +898,19 @@ DefWndControlColor(HDC hDC, UINT ctlType)
*/ */
if (bk == GetSysColor(COLOR_WINDOW)) if (bk == GetSysColor(COLOR_WINDOW))
{ {
#if 0 /* FIXME */ static const WORD wPattern55AA[] =
return CACHE_GetPattern55AABrush(); {
#else 0x5555, 0xaaaa, 0x5555, 0xaaaa,
return NULL; 0x5555, 0xaaaa, 0x5555, 0xaaaa
#endif };
static HBITMAP hPattern55AABitmap = NULL;
static HBRUSH hPattern55AABrush = NULL;
if (hPattern55AABrush == NULL)
{
hPattern55AABitmap = CreateBitmap(8, 8, 1, 1, wPattern55AA);
hPattern55AABrush = CreatePatternBrush(hPattern55AABitmap);
}
return hPattern55AABrush;
} }
UnrealizeObject(hb); UnrealizeObject(hb);
return hb; return hb;

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: scrollbar.c,v 1.21 2003/12/22 20:44:02 weiden Exp $ /* $Id: scrollbar.c,v 1.22 2003/12/23 08:48:59 navaraf Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -135,30 +135,18 @@ IntGetScrollBarRect (PWINDOW_OBJECT Window, INT nBar, PRECT lprect)
switch (nBar) switch (nBar)
{ {
case SB_HORZ: case SB_HORZ:
lprect->left = ClientRect.left - WindowRect.left + 1; lprect->left = ClientRect.left - WindowRect.left;
lprect->top = ClientRect.bottom - WindowRect.top; lprect->top = ClientRect.bottom - WindowRect.top;
lprect->right = ClientRect.right - WindowRect.left - 1; lprect->right = ClientRect.right - WindowRect.left;
lprect->bottom = lprect->top + NtUserGetSystemMetrics (SM_CYHSCROLL); lprect->bottom = lprect->top + NtUserGetSystemMetrics (SM_CYHSCROLL);
if (Window->Style & WS_BORDER)
{
lprect->left--;
lprect->right++;
}
vertical = FALSE; vertical = FALSE;
break; break;
case SB_VERT: case SB_VERT:
lprect->left = (ClientRect.right - WindowRect.left); lprect->left = ClientRect.right - WindowRect.left;
lprect->top = (ClientRect.top - WindowRect.top) + 1; lprect->top = ClientRect.top - WindowRect.top;
lprect->right = (lprect->left + NtUserGetSystemMetrics (SM_CXVSCROLL)); lprect->right = lprect->left + NtUserGetSystemMetrics(SM_CXVSCROLL);
lprect->bottom = (ClientRect.bottom - WindowRect.top) - 1; lprect->bottom = ClientRect.bottom - WindowRect.top;
if (Window->Style & WS_BORDER)
{
lprect->top--;
lprect->bottom++;
}
else if (Window->Style & WS_HSCROLL)
lprect->bottom++;
vertical = TRUE; vertical = TRUE;
break; break;
@ -363,9 +351,6 @@ IntSetScrollInfo(PWINDOW_OBJECT Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bRedr
else else
Mask = lpsi->fMask; Mask = lpsi->fMask;
if(Action)
*Action = 0;
if(Mask & SIF_DISABLENOSCROLL) if(Mask & SIF_DISABLENOSCROLL)
{ {
/* FIXME */ /* FIXME */
@ -380,8 +365,8 @@ IntSetScrollInfo(PWINDOW_OBJECT Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bRedr
psi->nMin = 0; psi->nMin = 0;
psi->nMax = 0; psi->nMax = 0;
Chg = TRUE; Chg = TRUE;
if(Action) // if(Action)
*Action |= SBU_SCROLLBOX; // *Action |= SBU_SCROLLBOX;
} }
else else
{ {
@ -392,8 +377,8 @@ IntSetScrollInfo(PWINDOW_OBJECT Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bRedr
psi->nMin = lpsi->nMin; psi->nMin = lpsi->nMin;
psi->nMax = lpsi->nMax; psi->nMax = lpsi->nMax;
Chg = TRUE; Chg = TRUE;
if(Action) // if(Action)
*Action |= SBU_SCROLLBOX; // *Action |= SBU_SCROLLBOX;
} }
} }
} }
@ -409,8 +394,8 @@ IntSetScrollInfo(PWINDOW_OBJECT Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bRedr
if(old != psi->nPage) if(old != psi->nPage)
{ {
Chg = TRUE; Chg = TRUE;
if(Action) // if(Action)
*Action |= SBU_SCROLLBOX; // *Action |= SBU_SCROLLBOX;
} }
} }
@ -426,8 +411,8 @@ IntSetScrollInfo(PWINDOW_OBJECT Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bRedr
if(old != psi->nPos) if(old != psi->nPos)
{ {
Chg = TRUE; Chg = TRUE;
if(Action) // if(Action)
*Action |= SBU_SCROLLBOX; // *Action |= SBU_SCROLLBOX;
} }
} }
@ -596,6 +581,9 @@ IntSetScrollInfo(PWINDOW_OBJECT Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bRedr
#endif #endif
} }
if (bRedraw)
IntSendMessage(Window->Self, WM_NCPAINT, 1, 0, TRUE);
/* Return current position */ /* Return current position */
return Info->nPos; return Info->nPos;
#endif #endif
@ -1017,8 +1005,7 @@ NtUserSetScrollInfo(
} }
/* Ported from WINE20020904 (SCROLL_ShowScrollBar) */ /* Ported from WINE20020904 (SCROLL_ShowScrollBar) */
DWORD DWORD STDCALL
STDCALL
NtUserShowScrollBar(HWND hWnd, int wBar, DWORD bShow) NtUserShowScrollBar(HWND hWnd, int wBar, DWORD bShow)
{ {
PWINDOW_OBJECT Window = IntGetWindowObject(hWnd); PWINDOW_OBJECT Window = IntGetWindowObject(hWnd);
@ -1039,22 +1026,34 @@ NtUserShowScrollBar(HWND hWnd, int wBar, DWORD bShow)
if (wBar == SB_BOTH || wBar == SB_HORZ) if (wBar == SB_BOTH || wBar == SB_HORZ)
{ {
if (bShow) if (bShow)
{
Window->Style |= WS_HSCROLL; Window->Style |= WS_HSCROLL;
if (!Window->pHScroll)
IntCreateScrollBar(Window, SB_HORZ);
}
else else
{
Window->Style &= ~WS_HSCROLL; Window->Style &= ~WS_HSCROLL;
} }
}
if (wBar == SB_BOTH || wBar == SB_VERT) if (wBar == SB_BOTH || wBar == SB_VERT)
{ {
if (bShow) if (bShow)
{
Window->Style |= WS_VSCROLL; Window->Style |= WS_VSCROLL;
if (!Window->pVScroll)
IntCreateScrollBar(Window, SB_VERT);
}
else else
{
Window->Style &= ~WS_VSCROLL; Window->Style &= ~WS_VSCROLL;
} }
}
/* Frame has been changed, let the window redraw itself */ /* Frame has been changed, let the window redraw itself */
WinPosSetWindowPos(hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | WinPosSetWindowPos(hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED); SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED | SWP_NOSENDCHANGING);
IntReleaseWindowObject(Window); IntReleaseWindowObject(Window);
return TRUE; return TRUE;

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: windc.c,v 1.46 2003/12/14 19:39:50 gvg Exp $ /* $Id: windc.c,v 1.47 2003/12/23 08:48:59 navaraf Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -462,6 +462,8 @@ NtUserGetDCEx(HWND hWnd, HANDLE ClipRegion, ULONG Flags)
{ {
Dce->hClipRgn = UnsafeIntCreateRectRgnIndirect(&Window->WindowRect); Dce->hClipRgn = UnsafeIntCreateRectRgnIndirect(&Window->WindowRect);
} }
NtGdiOffsetRgn(Dce->hClipRgn, -Window->WindowRect.left,
-Window->WindowRect.top);
} }
else if (NULL != ClipRegion) else if (NULL != ClipRegion)
{ {

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: window.c,v 1.171 2003/12/22 14:34:25 weiden Exp $ /* $Id: window.c,v 1.172 2003/12/23 08:48:59 navaraf Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -1310,9 +1310,15 @@ NtUserCreateWindowEx(DWORD dwExStyle,
/* Initialize the window's scrollbars */ /* Initialize the window's scrollbars */
if (dwStyle & WS_VSCROLL) if (dwStyle & WS_VSCROLL)
IntCreateScrollBar(WindowObject, SB_VERT); {
WindowObject->Style &= ~WS_VSCROLL;
NtUserShowScrollBar(WindowObject->Self, SB_VERT, TRUE);
}
if (dwStyle & WS_HSCROLL) if (dwStyle & WS_HSCROLL)
IntCreateScrollBar(WindowObject, SB_HORZ); {
WindowObject->Style &= ~WS_HSCROLL;
NtUserShowScrollBar(WindowObject->Self, SB_HORZ, TRUE);
}
/* Send a NCCREATE message. */ /* Send a NCCREATE message. */
Cs.cx = nWidth; Cs.cx = nWidth;

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: winpos.c,v 1.61 2003/12/22 15:30:21 navaraf Exp $ /* $Id: winpos.c,v 1.62 2003/12/23 08:48:59 navaraf Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -758,8 +758,8 @@ WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
/* /*
* Only allow CSRSS to mess with the desktop window * Only allow CSRSS to mess with the desktop window
*/ */
if (Wnd == IntGetDesktopWindow() if (Wnd == IntGetDesktopWindow() &&
&& Window->OwnerThread->ThreadsProcess != PsGetCurrentProcess()) Window->OwnerThread->ThreadsProcess != PsGetCurrentProcess())
{ {
return FALSE; return FALSE;
} }
@ -1051,7 +1051,7 @@ WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
} }
} }
/* FIXME: Check some conditions before doing this. */ if ((WinPos.flags & SWP_AGG_STATUSFLAGS) != SWP_AGG_NOPOSCHANGE)
IntSendWINDOWPOSCHANGEDMessage(WinPos.hwnd, &WinPos); IntSendWINDOWPOSCHANGEDMessage(WinPos.hwnd, &WinPos);
IntReleaseWindowObject(Window); IntReleaseWindowObject(Window);