mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:52:56 +00:00
- Enabled CS_PARENTDC style for edit control.
- Minor corrections in [Get/Set]WindowPlacement. - Fixed handling of MDI client info structure. - Bug fixes. svn path=/trunk/; revision=7174
This commit is contained in:
parent
e0fd57122f
commit
5c52558817
6 changed files with 114 additions and 26 deletions
|
@ -294,7 +294,7 @@ const struct builtin_class_descr EDIT_builtin_class =
|
||||||
#ifdef __REACTOS__
|
#ifdef __REACTOS__
|
||||||
L"Edit", /* name */
|
L"Edit", /* name */
|
||||||
/* FIXME: Add CS_PARENTDC when the handling of WM_ERASEBKGND will be fixed! */
|
/* FIXME: Add CS_PARENTDC when the handling of WM_ERASEBKGND will be fixed! */
|
||||||
CS_GLOBALCLASS | CS_DBLCLKS, /* style */
|
CS_GLOBALCLASS | CS_DBLCLKS | CS_PARENTDC, /* style */
|
||||||
(WNDPROC)EditWndProcW, /* procW */
|
(WNDPROC)EditWndProcW, /* procW */
|
||||||
(WNDPROC)EditWndProcA, /* procA */
|
(WNDPROC)EditWndProcA, /* procA */
|
||||||
sizeof(EDITSTATE *), /* extra */
|
sizeof(EDITSTATE *), /* extra */
|
||||||
|
|
|
@ -219,11 +219,11 @@ const struct builtin_class_descr MDICLIENT_builtin_class =
|
||||||
{
|
{
|
||||||
#ifdef __REACTOS__
|
#ifdef __REACTOS__
|
||||||
L"MDIClient", /* name */
|
L"MDIClient", /* name */
|
||||||
CS_GLOBALCLASS, /* style */
|
CS_GLOBALCLASS, /* style */
|
||||||
MDIClientWndProcW, /* procW */
|
MDIClientWndProcW, /* procW */
|
||||||
MDIClientWndProcA, /* procA */
|
MDIClientWndProcA, /* procA */
|
||||||
sizeof(MDICLIENTINFO), /* extra */
|
sizeof(MDICLIENTINFO *), /* extra */
|
||||||
IDC_ARROW, /* cursor */
|
IDC_ARROW, /* cursor */
|
||||||
(HBRUSH)(COLOR_APPWORKSPACE+1) /* brush */
|
(HBRUSH)(COLOR_APPWORKSPACE+1) /* brush */
|
||||||
#else
|
#else
|
||||||
"MDIClient", /* name */
|
"MDIClient", /* name */
|
||||||
|
@ -1340,6 +1340,14 @@ static LRESULT MDIClientWndProc_common( HWND hwnd, UINT message,
|
||||||
|
|
||||||
switch (message)
|
switch (message)
|
||||||
{
|
{
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
case WM_NCCREATE:
|
||||||
|
if (!(ci = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ci))))
|
||||||
|
return FALSE;
|
||||||
|
SetWindowLongPtrW( hwnd, 0, (LONG_PTR)ci );
|
||||||
|
return TRUE;
|
||||||
|
#endif
|
||||||
|
|
||||||
case WM_CREATE:
|
case WM_CREATE:
|
||||||
{
|
{
|
||||||
RECT rect;
|
RECT rect;
|
||||||
|
@ -1413,6 +1421,10 @@ static LRESULT MDIClientWndProc_common( HWND hwnd, UINT message,
|
||||||
DeleteMenu(ci->hWindowMenu,MF_BYPOSITION,ci->idFirstChild--);
|
DeleteMenu(ci->hWindowMenu,MF_BYPOSITION,ci->idFirstChild--);
|
||||||
}
|
}
|
||||||
if (ci->frameTitle) HeapFree( GetProcessHeap(), 0, ci->frameTitle );
|
if (ci->frameTitle) HeapFree( GetProcessHeap(), 0, ci->frameTitle );
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
HeapFree( GetProcessHeap(), 0, ci );
|
||||||
|
SetWindowLongPtrW( hwnd, 0, 0 );
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: window.c,v 1.91 2003/12/19 23:20:05 weiden Exp $
|
/* $Id: window.c,v 1.92 2003/12/22 11:37:32 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
|
||||||
|
|
|
@ -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: painting.c,v 1.49 2003/12/18 21:56:44 weiden Exp $
|
* $Id: painting.c,v 1.50 2003/12/22 11:37:32 navaraf Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -747,12 +747,6 @@ NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* lPs)
|
||||||
NtUserHideCaret(hWnd);
|
NtUserHideCaret(hWnd);
|
||||||
|
|
||||||
DcxFlags = DCX_INTERSECTUPDATE | DCX_WINDOWPAINT | DCX_USESTYLE;
|
DcxFlags = DCX_INTERSECTUPDATE | DCX_WINDOWPAINT | DCX_USESTYLE;
|
||||||
if (IntGetClassLong(Window, GCL_STYLE, FALSE) & CS_PARENTDC)
|
|
||||||
{
|
|
||||||
/* FIXME: Is this correct? */
|
|
||||||
/* Don't clip the output to the update region for CS_PARENTDC window */
|
|
||||||
DcxFlags &= ~DCX_INTERSECTUPDATE;
|
|
||||||
}
|
|
||||||
|
|
||||||
lPs->hdc = NtUserGetDCEx(hWnd, 0, DcxFlags);
|
lPs->hdc = NtUserGetDCEx(hWnd, 0, DcxFlags);
|
||||||
|
|
||||||
|
|
|
@ -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.169 2003/12/19 23:20:06 weiden Exp $
|
/* $Id: window.c,v 1.170 2003/12/22 11:37:32 navaraf Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -1280,18 +1280,20 @@ NtUserCreateWindowEx(DWORD dwExStyle,
|
||||||
/*
|
/*
|
||||||
* Get the size and position of the window.
|
* Get the size and position of the window.
|
||||||
*/
|
*/
|
||||||
#if 0
|
|
||||||
if ((dwStyle & WS_THICKFRAME) || !(dwStyle & (WS_POPUP | WS_CHILD)))
|
if ((dwStyle & WS_THICKFRAME) || !(dwStyle & (WS_POPUP | WS_CHILD)))
|
||||||
{
|
{
|
||||||
|
POINT MaxSize, MaxPos, MinTrack, MaxTrack;
|
||||||
|
|
||||||
/* WinPosGetMinMaxInfo sends the WM_GETMINMAXINFO message */
|
/* WinPosGetMinMaxInfo sends the WM_GETMINMAXINFO message */
|
||||||
WinPosGetMinMaxInfo(WindowObject, &MaxSize, &MaxPos, &MinTrack,
|
WinPosGetMinMaxInfo(WindowObject, &MaxSize, &MaxPos, &MinTrack,
|
||||||
&MaxTrack);
|
&MaxTrack);
|
||||||
x = min(MaxSize.x, y);
|
if (MaxSize.x < nWidth) nWidth = MaxSize.x;
|
||||||
y = min(MaxSize.y, y);
|
if (MaxSize.y < nHeight) nHeight = MaxSize.y;
|
||||||
x = max(MinTrack.x, x);
|
if (nWidth < MinTrack.x ) nWidth = MinTrack.x;
|
||||||
y = max(MinTrack.y, y);
|
if (nHeight < MinTrack.y ) nHeight = MinTrack.y;
|
||||||
|
if (nWidth < 0) nWidth = 0;
|
||||||
|
if (nHeight < 0) nHeight = 0;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
WindowObject->WindowRect.left = x;
|
WindowObject->WindowRect.left = x;
|
||||||
WindowObject->WindowRect.top = y;
|
WindowObject->WindowRect.top = y;
|
||||||
|
@ -2662,6 +2664,12 @@ NtUserGetWindowPlacement(HWND hWnd,
|
||||||
/* FIXME - fill structure */
|
/* FIXME - fill structure */
|
||||||
Safepl.flags = 0;
|
Safepl.flags = 0;
|
||||||
Safepl.showCmd = ((WindowObject->Style & WINDOWOBJECT_RESTOREMAX) ? SW_MAXIMIZE : SW_SHOWNORMAL);
|
Safepl.showCmd = ((WindowObject->Style & WINDOWOBJECT_RESTOREMAX) ? SW_MAXIMIZE : SW_SHOWNORMAL);
|
||||||
|
if (WindowObject->InternalPos)
|
||||||
|
{
|
||||||
|
Safepl.rcNormalPosition = WindowObject->InternalPos->NormalRect;
|
||||||
|
Safepl.ptMinPosition = WindowObject->InternalPos->IconPos;
|
||||||
|
Safepl.ptMaxPosition = WindowObject->InternalPos->MaxPos;
|
||||||
|
}
|
||||||
|
|
||||||
Status = MmCopyToCaller(lpwndpl, &Safepl, sizeof(WINDOWPLACEMENT));
|
Status = MmCopyToCaller(lpwndpl, &Safepl, sizeof(WINDOWPLACEMENT));
|
||||||
if(!NT_SUCCESS(Status))
|
if(!NT_SUCCESS(Status))
|
||||||
|
@ -3050,7 +3058,6 @@ NtUserSetWindowPlacement(HWND hWnd,
|
||||||
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
|
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = MmCopyFromCaller(&Safepl, lpwndpl, sizeof(WINDOWPLACEMENT));
|
Status = MmCopyFromCaller(&Safepl, lpwndpl, sizeof(WINDOWPLACEMENT));
|
||||||
if(!NT_SUCCESS(Status))
|
if(!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
@ -3064,9 +3071,24 @@ NtUserSetWindowPlacement(HWND hWnd,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((WindowObject->Style & (WS_MAXIMIZE | WS_MINIMIZE)) == 0)
|
||||||
|
{
|
||||||
|
WinPosSetWindowPos(WindowObject->Self, NULL,
|
||||||
|
Safepl.rcNormalPosition.left, Safepl.rcNormalPosition.top,
|
||||||
|
Safepl.rcNormalPosition.right - Safepl.rcNormalPosition.left,
|
||||||
|
Safepl.rcNormalPosition.bottom - Safepl.rcNormalPosition.top,
|
||||||
|
SWP_NOZORDER | SWP_NOACTIVATE);
|
||||||
|
}
|
||||||
|
|
||||||
/* FIXME - change window status */
|
/* FIXME - change window status */
|
||||||
WinPosShowWindow(WindowObject->Self, Safepl.showCmd);
|
WinPosShowWindow(WindowObject->Self, Safepl.showCmd);
|
||||||
|
|
||||||
|
if (WindowObject->InternalPos == NULL)
|
||||||
|
WindowObject->InternalPos = ExAllocatePool(PagedPool, sizeof(INTERNALPOS));
|
||||||
|
WindowObject->InternalPos->NormalRect = Safepl.rcNormalPosition;
|
||||||
|
WindowObject->InternalPos->IconPos = Safepl.ptMinPosition;
|
||||||
|
WindowObject->InternalPos->MaxPos = Safepl.ptMaxPosition;
|
||||||
|
|
||||||
IntReleaseWindowObject(WindowObject);
|
IntReleaseWindowObject(WindowObject);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.59 2003/12/21 22:38:38 weiden Exp $
|
/* $Id: winpos.c,v 1.60 2003/12/22 11:37:32 navaraf Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -530,7 +530,67 @@ WinPosDoWinPosChanging(PWINDOW_OBJECT WindowObject,
|
||||||
HWND FASTCALL
|
HWND FASTCALL
|
||||||
WinPosDoOwnedPopups(HWND hWnd, HWND hWndInsertAfter)
|
WinPosDoOwnedPopups(HWND hWnd, HWND hWndInsertAfter)
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
/* FIXME */
|
/* FIXME */
|
||||||
|
return hWndInsertAfter;
|
||||||
|
#endif
|
||||||
|
HWND *List = NULL;
|
||||||
|
HWND Owner = NtUserGetWindow(hWnd, GW_OWNER);
|
||||||
|
LONG Style = NtUserGetWindowLong(hWnd, GWL_STYLE, FALSE);
|
||||||
|
PWINDOW_OBJECT DesktopWindow;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if ((Style & WS_POPUP) && Owner)
|
||||||
|
{
|
||||||
|
/* Make sure this popup stays above the owner */
|
||||||
|
HWND hWndLocalPrev = HWND_TOP;
|
||||||
|
|
||||||
|
if (hWndInsertAfter != HWND_TOP)
|
||||||
|
{
|
||||||
|
DesktopWindow = IntGetWindowObject(IntGetDesktopWindow());
|
||||||
|
List = IntWinListChildren(DesktopWindow);
|
||||||
|
IntReleaseWindowObject(DesktopWindow);
|
||||||
|
if (List != NULL)
|
||||||
|
{
|
||||||
|
for (i = 0; List[i]; i++)
|
||||||
|
{
|
||||||
|
if (List[i] == Owner) break;
|
||||||
|
if (List[i] != hWnd) hWndLocalPrev = List[i];
|
||||||
|
if (hWndLocalPrev == hWndInsertAfter) break;
|
||||||
|
}
|
||||||
|
hWndInsertAfter = hWndLocalPrev;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (Style & WS_CHILD)
|
||||||
|
{
|
||||||
|
return hWndInsertAfter;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!List)
|
||||||
|
{
|
||||||
|
DesktopWindow = IntGetWindowObject(IntGetDesktopWindow());
|
||||||
|
List = IntWinListChildren(DesktopWindow);
|
||||||
|
IntReleaseWindowObject(DesktopWindow);
|
||||||
|
}
|
||||||
|
if (List != NULL)
|
||||||
|
{
|
||||||
|
for (i = 0; List[i]; i++)
|
||||||
|
{
|
||||||
|
DPRINT1("%x\n", List[i]);
|
||||||
|
if (List[i] == hWnd)
|
||||||
|
break;
|
||||||
|
if ((NtUserGetWindowLong(List[i], GWL_STYLE, FALSE) & WS_POPUP) &&
|
||||||
|
NtUserGetWindow(List[i], GW_OWNER) == hWnd)
|
||||||
|
{
|
||||||
|
WinPosSetWindowPos(List[i], hWndInsertAfter, 0, 0, 0, 0,
|
||||||
|
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOSENDCHANGING);
|
||||||
|
hWndInsertAfter = List[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ExFreePool(List);
|
||||||
|
}
|
||||||
|
|
||||||
return hWndInsertAfter;
|
return hWndInsertAfter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue