// 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);
}
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);
}
// 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");
}
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)
{
// 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();