1) This only creates one softkey menu. If we create more then one, this cause

windows to be hidden between new window creations.  See bug 314552.

2) This also makes a improvement to mouse taps in a context menu.  Now we only
test for tab-and-hold (a "Gesture") when we are not displaying a context menu.
If we don't do this, the check for the gesture makes the context menu go away.

3) We also hide the software input panel when we are creating a dialog or a
window.  This insures that the windows ce SIP button never blocks the view of a
XUL implemented SIP.

windows ce. r=dveditz
This commit is contained in:
dougt%meer.net 2005-11-02 19:20:31 +00:00
Родитель fe28a7e35e
Коммит 35b1677294
1 изменённых файлов: 48 добавлений и 12 удалений

Просмотреть файл

@ -198,6 +198,7 @@ static inline PRBool IsAlphaTranslucencySupported() { return pUpdateLayeredWindo
#ifdef WINCE #ifdef WINCE
static PRBool gSoftKeyMenuBar = PR_FALSE;
static PRBool gUseOkayButton = PR_FALSE; static PRBool gUseOkayButton = PR_FALSE;
static PRBool gOverrideHWKeys = PR_TRUE; static PRBool gOverrideHWKeys = PR_TRUE;
@ -292,6 +293,11 @@ static void UnmapHardwareButtons()
void CreateSoftKeyMenuBar(HWND wnd) void CreateSoftKeyMenuBar(HWND wnd)
{ {
if (gSoftKeyMenuBar)
return;
gSoftKeyMenuBar = PR_TRUE;
SHMENUBARINFO mbi; SHMENUBARINFO mbi;
ZeroMemory(&mbi, sizeof(SHMENUBARINFO)); ZeroMemory(&mbi, sizeof(SHMENUBARINFO));
mbi.cbSize = sizeof(SHMENUBARINFO); mbi.cbSize = sizeof(SHMENUBARINFO);
@ -301,8 +307,9 @@ void CreateSoftKeyMenuBar(HWND wnd)
SHCreateMenuBar(&mbi); SHCreateMenuBar(&mbi);
// Hide this so that no one has to see it! HWND mb = SHFindMenuBar(wnd);
SetWindowPos(SHFindMenuBar(wnd), HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE); if (mb)
SetWindowPos(mb, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE);
} }
#endif #endif
@ -4492,17 +4499,20 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT
//RelayMouseEvent(msg,wParam, lParam); //RelayMouseEvent(msg,wParam, lParam);
{ {
#ifdef WINCE #ifdef WINCE
SHRGINFO shrg; if (!gRollupListener && !gRollupWidget)
shrg.cbSize = sizeof(shrg);
shrg.hwndClient = mWnd;
shrg.ptDown.x = LOWORD(lParam);
shrg.ptDown.y = HIWORD(lParam);
shrg.dwFlags = SHRG_RETURNCMD | SHRG_NOANIMATION;
if (SHRecognizeGesture(&shrg) == GN_CONTEXTMENU)
{ {
result = DispatchMouseEvent(NS_MOUSE_RIGHT_BUTTON_DOWN, wParam); SHRGINFO shrg;
result = DispatchMouseEvent(NS_MOUSE_RIGHT_BUTTON_UP, wParam); shrg.cbSize = sizeof(shrg);
break; shrg.hwndClient = mWnd;
shrg.ptDown.x = LOWORD(lParam);
shrg.ptDown.y = HIWORD(lParam);
shrg.dwFlags = SHRG_RETURNCMD;
if (SHRecognizeGesture(&shrg) == GN_CONTEXTMENU)
{
result = DispatchMouseEvent(NS_MOUSE_RIGHT_BUTTON_DOWN, wParam);
result = DispatchMouseEvent(NS_MOUSE_RIGHT_BUTTON_UP, wParam);
break;
}
} }
#endif #endif
// check whether IME window do mouse operation // check whether IME window do mouse operation
@ -4677,6 +4687,32 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT
GetRootAccessible(); GetRootAccessible();
} }
#endif #endif
#ifdef WINCE
// On Windows CE, we have a window that overlaps
// the ISP button. In this case, we should always
// try to hide it when we are activated
if (mWindowType == eWindowType_dialog || mWindowType == eWindowType_toplevel) {
// This should work on all platforms, but it doesn't...
SHFullScreen(mWnd, SHFS_HIDESIPBUTTON);
// So do it the hard way....
HWND hWndSIP = FindWindow( _T( "SipWndClass" ), NULL );
if (hWndSIP)
{
ShowWindow( hWndSIP, SW_HIDE );
SetWindowPos(hWndSIP, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
}
hWndSIP = FindWindow( _T( "MS_SIPBUTTON" ), NULL );
if (hWndSIP)
{
ShowWindow( hWndSIP, SW_HIDE );
SetWindowPos(hWndSIP, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
}
}
#endif
break; break;
case WM_KILLFOCUS: case WM_KILLFOCUS: