mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 22:56:00 +00:00
[User32]
- Sync port MDI with wine. - Add patch from wine bug 9435. - Commented out wine code. svn path=/trunk/; revision=61713
This commit is contained in:
parent
93b5f39fd8
commit
a63ee8722e
1 changed files with 44 additions and 12 deletions
|
@ -123,6 +123,7 @@ typedef struct
|
||||||
UINT nTotalCreated;
|
UINT nTotalCreated;
|
||||||
UINT mdiFlags;
|
UINT mdiFlags;
|
||||||
UINT sbRecalc; /* SB_xxx flags for scrollbar fixup */
|
UINT sbRecalc; /* SB_xxx flags for scrollbar fixup */
|
||||||
|
DWORD initialStyle; /* Style when window was created */ // See http://bugs.winehq.org/show_bug.cgi?id=9435
|
||||||
HBITMAP hBmpClose; /* ReactOS modification */
|
HBITMAP hBmpClose; /* ReactOS modification */
|
||||||
} MDICLIENTINFO;
|
} MDICLIENTINFO;
|
||||||
|
|
||||||
|
@ -914,12 +915,18 @@ static BOOL MDI_AugmentFrameMenu( HWND frame, HWND hChild )
|
||||||
(LPCWSTR)HBMMENU_MBAR_CLOSE : (LPCWSTR)HBMMENU_MBAR_CLOSE_D );
|
(LPCWSTR)HBMMENU_MBAR_CLOSE : (LPCWSTR)HBMMENU_MBAR_CLOSE_D );
|
||||||
|
|
||||||
/* The system menu is replaced by the child icon */
|
/* The system menu is replaced by the child icon */
|
||||||
hIcon = (HICON)GetClassLongPtrW(hChild, GCLP_HICONSM);
|
/* hIcon = (HICON)GetClassLongPtrW(hChild, GCLP_HICONSM);
|
||||||
if (!hIcon)
|
if (!hIcon)
|
||||||
hIcon = (HICON)GetClassLongPtrW(hChild, GCLP_HICON);
|
hIcon = (HICON)GetClassLongPtrW(hChild, GCLP_HICON);
|
||||||
if (!hIcon)
|
if (!hIcon)
|
||||||
hIcon = LoadIconW(NULL, IDI_APPLICATION);
|
hIcon = LoadIconW(NULL, IDI_APPLICATION);
|
||||||
|
*/
|
||||||
//// End
|
//// End
|
||||||
|
hIcon = (HICON)SendMessageW(hChild, WM_GETICON, ICON_SMALL, 0);
|
||||||
|
if (!hIcon)
|
||||||
|
hIcon = (HICON)SendMessageW(hChild, WM_GETICON, ICON_BIG, 0);
|
||||||
|
if (!hIcon)
|
||||||
|
hIcon = LoadImageW(0, MAKEINTRESOURCEW(IDI_WINLOGO), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
|
||||||
if (hIcon)
|
if (hIcon)
|
||||||
{
|
{
|
||||||
HDC hMemDC;
|
HDC hMemDC;
|
||||||
|
@ -1140,6 +1147,7 @@ LRESULT WINAPI MDIClientWndProc_common( HWND hwnd, UINT message, WPARAM wParam,
|
||||||
ci->nTotalCreated = 0;
|
ci->nTotalCreated = 0;
|
||||||
ci->frameTitle = NULL;
|
ci->frameTitle = NULL;
|
||||||
ci->mdiFlags = 0;
|
ci->mdiFlags = 0;
|
||||||
|
ci->initialStyle = cs->style;
|
||||||
ci->hFrameMenu = GetMenu(cs->hwndParent);
|
ci->hFrameMenu = GetMenu(cs->hwndParent);
|
||||||
|
|
||||||
if (!ci->hBmpClose) ci->hBmpClose = CreateMDIMenuBitmap();
|
if (!ci->hBmpClose) ci->hBmpClose = CreateMDIMenuBitmap();
|
||||||
|
@ -1231,8 +1239,11 @@ LRESULT WINAPI MDIClientWndProc_common( HWND hwnd, UINT message, WPARAM wParam,
|
||||||
|
|
||||||
case WM_MDINEXT: /* lParam != 0 means previous window */
|
case WM_MDINEXT: /* lParam != 0 means previous window */
|
||||||
{
|
{
|
||||||
HWND next = MDI_GetWindow( ci, (HWND)wParam, !lParam, 0 );
|
HWND hwnd = wParam ? WIN_GetFullHandle((HWND)wParam) : ci->hwndActiveChild;
|
||||||
|
HWND next = MDI_GetWindow( ci, hwnd, !lParam, 0 );
|
||||||
MDI_SwitchActiveChild( ci, next, TRUE );
|
MDI_SwitchActiveChild( ci, next, TRUE );
|
||||||
|
if(!lParam)
|
||||||
|
SetWindowPos(hwnd, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1431,7 +1442,7 @@ LRESULT WINAPI DefFrameProcW( HWND hwnd, HWND hwndMDIClient,
|
||||||
case SC_NEXTWINDOW:
|
case SC_NEXTWINDOW:
|
||||||
case SC_PREVWINDOW:
|
case SC_PREVWINDOW:
|
||||||
case SC_RESTORE:
|
case SC_RESTORE:
|
||||||
return SendMessageW( ci->hwndActiveChild, WM_SYSCOMMAND,
|
return SendMessageW( ci->hwndChildMaximized, WM_SYSCOMMAND,
|
||||||
wParam, lParam);
|
wParam, lParam);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1563,7 +1574,7 @@ LRESULT WINAPI DefMDIChildProcW( HWND hwnd, UINT message,
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case WM_MENUCHAR:
|
case WM_MENUCHAR:
|
||||||
return 0x00010000; /* MDI children don't have menu bars */
|
return MAKELRESULT( 0, MNC_CLOSE ); /* MDI children don't have menu bars */
|
||||||
|
|
||||||
case WM_CLOSE:
|
case WM_CLOSE:
|
||||||
SendMessageW( client, WM_MDIDESTROY, (WPARAM)hwnd, 0 );
|
SendMessageW( client, WM_MDIDESTROY, (WPARAM)hwnd, 0 );
|
||||||
|
@ -1593,10 +1604,10 @@ LRESULT WINAPI DefMDIChildProcW( HWND hwnd, UINT message,
|
||||||
return SendMessageW( GetParent(client), message, wParam, lParam);
|
return SendMessageW( GetParent(client), message, wParam, lParam);
|
||||||
break;
|
break;
|
||||||
case SC_NEXTWINDOW:
|
case SC_NEXTWINDOW:
|
||||||
SendMessageW( client, WM_MDINEXT, 0, 0);
|
SendMessageW( client, WM_MDINEXT, (WPARAM)ci->hwndActiveChild, 0);
|
||||||
return 0;
|
return 0;
|
||||||
case SC_PREVWINDOW:
|
case SC_PREVWINDOW:
|
||||||
SendMessageW( client, WM_MDINEXT, 0, 1);
|
SendMessageW( client, WM_MDINEXT, (WPARAM)ci->hwndActiveChild, 1);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1604,7 +1615,7 @@ LRESULT WINAPI DefMDIChildProcW( HWND hwnd, UINT message,
|
||||||
case WM_SHOWWINDOW:
|
case WM_SHOWWINDOW:
|
||||||
#ifndef __REACTOS__
|
#ifndef __REACTOS__
|
||||||
case WM_SETVISIBLE:
|
case WM_SETVISIBLE:
|
||||||
#endif
|
#endif //// Commented out r57663
|
||||||
/*if (ci->hwndChildMaximized) ci->mdiFlags &= ~MDIF_NEEDUPDATE;
|
/*if (ci->hwndChildMaximized) ci->mdiFlags &= ~MDIF_NEEDUPDATE;
|
||||||
else*/ MDI_PostUpdate(client, ci, SB_BOTH+1);
|
else*/ MDI_PostUpdate(client, ci, SB_BOTH+1);
|
||||||
break;
|
break;
|
||||||
|
@ -1802,8 +1813,10 @@ void WINAPI CalcChildScroll( HWND hwnd, INT scroll )
|
||||||
SCROLLINFO info;
|
SCROLLINFO info;
|
||||||
RECT childRect, clientRect;
|
RECT childRect, clientRect;
|
||||||
HWND *list;
|
HWND *list;
|
||||||
|
MDICLIENTINFO *ci;
|
||||||
WINDOWINFO WindowInfo;
|
WINDOWINFO WindowInfo;
|
||||||
|
|
||||||
|
ci = get_client_info(hwnd);
|
||||||
GetClientRect( hwnd, &clientRect );
|
GetClientRect( hwnd, &clientRect );
|
||||||
SetRectEmpty( &childRect );
|
SetRectEmpty( &childRect );
|
||||||
|
|
||||||
|
@ -1821,6 +1834,7 @@ void WINAPI CalcChildScroll( HWND hwnd, INT scroll )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ERR("CalcChildScroll 1\n");
|
||||||
if ((list = WIN_ListChildren( hwnd )))
|
if ((list = WIN_ListChildren( hwnd )))
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -1831,6 +1845,7 @@ void WINAPI CalcChildScroll( HWND hwnd, INT scroll )
|
||||||
{
|
{
|
||||||
HeapFree( GetProcessHeap(), 0, list );
|
HeapFree( GetProcessHeap(), 0, list );
|
||||||
ShowScrollBar( hwnd, SB_BOTH, FALSE );
|
ShowScrollBar( hwnd, SB_BOTH, FALSE );
|
||||||
|
ERR("CalcChildScroll 2\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (style & WS_VISIBLE)
|
if (style & WS_VISIBLE)
|
||||||
|
@ -1839,13 +1854,15 @@ void WINAPI CalcChildScroll( HWND hwnd, INT scroll )
|
||||||
GetWindowRect( list[i], &rect );
|
GetWindowRect( list[i], &rect );
|
||||||
OffsetRect(&rect, -WindowInfo.rcClient.left,
|
OffsetRect(&rect, -WindowInfo.rcClient.left,
|
||||||
-WindowInfo.rcClient.top);
|
-WindowInfo.rcClient.top);
|
||||||
|
//WIN_GetRectangles( list[i], COORDS_PARENT, &rect, NULL );
|
||||||
|
ERR("CalcChildScroll L\n");
|
||||||
UnionRect( &childRect, &rect, &childRect );
|
UnionRect( &childRect, &rect, &childRect );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HeapFree( GetProcessHeap(), 0, list );
|
HeapFree( GetProcessHeap(), 0, list );
|
||||||
}
|
}
|
||||||
UnionRect( &childRect, &clientRect, &childRect );
|
UnionRect( &childRect, &clientRect, &childRect );
|
||||||
|
ERR("CalcChildScroll 3\n");
|
||||||
/* set common info values */
|
/* set common info values */
|
||||||
info.cbSize = sizeof(info);
|
info.cbSize = sizeof(info);
|
||||||
info.fMask = SIF_POS | SIF_RANGE | SIF_PAGE;
|
info.fMask = SIF_POS | SIF_RANGE | SIF_PAGE;
|
||||||
|
@ -1864,14 +1881,29 @@ void WINAPI CalcChildScroll( HWND hwnd, INT scroll )
|
||||||
info.nMax = childRect.right;
|
info.nMax = childRect.right;
|
||||||
info.nPos = 0;
|
info.nPos = 0;
|
||||||
info.nPage = 1 + clientRect.right - clientRect.left;
|
info.nPage = 1 + clientRect.right - clientRect.left;
|
||||||
|
//info.nMax = childRect.right - clientRect.right;
|
||||||
|
//info.nPos = clientRect.left - childRect.left;
|
||||||
|
if (ci->initialStyle & WS_HSCROLL)
|
||||||
SetScrollInfo(hwnd, SB_HORZ, &info, TRUE);
|
SetScrollInfo(hwnd, SB_HORZ, &info, TRUE);
|
||||||
if (scroll == SB_HORZ) break;
|
if (scroll == SB_HORZ)
|
||||||
|
{
|
||||||
|
ERR("CalcChildScroll H\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ERR("CalcChildScroll B\n");
|
||||||
|
}
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case SB_VERT:
|
case SB_VERT:
|
||||||
info.nMin = childRect.top;
|
info.nMin = childRect.top;
|
||||||
info.nMax = childRect.bottom;
|
info.nMax = childRect.bottom;
|
||||||
info.nPos = 0;
|
info.nPos = 0;
|
||||||
info.nPage = 1 + clientRect.bottom - clientRect.top;
|
info.nPage = 1 + clientRect.bottom - clientRect.top;
|
||||||
|
//info.nMax = childRect.bottom - clientRect.bottom;
|
||||||
|
//info.nPos = clientRect.top - childRect.top;
|
||||||
|
ERR("CalcChildScroll V\n");
|
||||||
|
if (ci->initialStyle & WS_VSCROLL)
|
||||||
SetScrollInfo(hwnd, SB_VERT, &info, TRUE);
|
SetScrollInfo(hwnd, SB_VERT, &info, TRUE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue