X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/568cb54317248b65f91f744585dea8de09364f72..dfc5454127ac2195e10deebb216d82c674e757df:/src/msw/window.cpp?ds=sidebyside diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 1569498479..db9a0969bd 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -1924,7 +1924,7 @@ bool wxWindow::MSWProcessMessage(WXMSG* pMsg) // WM_GETDLGCODE: if the control wants it for itself, don't process it // (except for Ctrl-Tab combination which is always processed) - LONG lDlgCode; + LONG lDlgCode = 0; if ( bProcess && !bCtrlDown ) { lDlgCode = ::SendMessage(msg->hwnd, WM_GETDLGCODE, 0, 0); } @@ -1933,7 +1933,7 @@ bool wxWindow::MSWProcessMessage(WXMSG* pMsg) if ( bProcess ) { switch ( msg->wParam ) { case VK_TAB: - if ( lDlgCode & DLGC_WANTTAB ) + if ( lDlgCode & DLGC_WANTTAB ) // this is FALSE for Ctrl-Tab bProcess = FALSE; else bForward = !(::GetKeyState(VK_SHIFT) & 0x100); @@ -2061,7 +2061,7 @@ void wxWindow::MSWOnWindowPosChanging(void *WXUNUSED(lpPos)) } // Deal with child commands from buttons etc. -bool wxWindow::MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND WXUNUSED(control)) +bool wxWindow::MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control) { #if WXDEBUG > 1 wxDebugMsg("wxWindow::MSWOnCommand\n"); @@ -2093,27 +2093,11 @@ bool wxWindow::MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND WXUNUSED(control)) } else { -#if WXDEBUG > 1 - wxDebugMsg("Could not find item!\n"); - char buf[100]; - wxDebugMsg("Item ids for this panel:\n"); - - wxNode *current = GetChildren()->First(); - while (current) - { - wxObject *obj = (wxObject *)current->Data() ; - if (obj->IsKindOf(CLASSINFO(wxControl))) - { - wxControl *item = (wxControl *)current->Data(); - sprintf(buf, " %d\n", (int)item->m_windowId); - wxDebugMsg(buf); - } - current = current->Next(); - } - wxYield(); -#endif - return FALSE; + wxWindow *win = wxFindWinFromHandle(control); + if (win) + return win->MSWCommand(cmd, id); } + return FALSE; } long wxWindow::MSWOnSysCommand(WXWPARAM wParam, WXLPARAM lParam) @@ -4397,7 +4381,18 @@ void wxWindow::OnIdle(wxIdleEvent& event) { // Generate a LEAVE event m_mouseInWindow = FALSE; - MSWOnMouseLeave(pt.x, pt.y, 0); + + int state; + if (::GetKeyState(VK_SHIFT) != 0) + state |= MK_SHIFT; + if (::GetKeyState(VK_CONTROL) != 0) + state |= MK_CONTROL; + + // Unfortunately the mouse button and keyboard state may have changed + // by the time the OnIdle function is called, so 'state' may be + // meaningless. + + MSWOnMouseLeave(pt.x, pt.y, state); } } UpdateWindowUI();