Enabling the Pop Menu fix to peek at all the command messages. Required adding a secondary DoMessage to wxApp. Some textctrl work as well.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10460 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Webster 2001-06-08 15:24:37 +00:00
parent 153b1416a4
commit 3febf6845f
5 changed files with 56 additions and 13 deletions

View File

@ -120,11 +120,20 @@ wxAcceleratorTable::wxAcceleratorTable(
USHORT uVirt = AF_CHAR; USHORT uVirt = AF_CHAR;
if (vaEntries[i].GetFlags() & wxACCEL_ALT) if (vaEntries[i].GetFlags() & wxACCEL_ALT)
{
uVirt |= AF_ALT; uVirt |= AF_ALT;
uVirt |= AF_VIRTUALKEY;
}
if (vaEntries[i].GetFlags() & wxACCEL_SHIFT) if (vaEntries[i].GetFlags() & wxACCEL_SHIFT)
{
uVirt |= AF_SHIFT; uVirt |= AF_SHIFT;
uVirt |= AF_VIRTUALKEY;
}
if (vaEntries[i].GetFlags() & wxACCEL_CTRL) if (vaEntries[i].GetFlags() & wxACCEL_CTRL)
{
uVirt |= AF_CONTROL; uVirt |= AF_CONTROL;
uVirt |= AF_VIRTUALKEY;
}
bool bIsVirtual; bool bIsVirtual;
USHORT uKey = wxCharCodeWXToOS2( vaEntries[i].GetKeyCode() USHORT uKey = wxCharCodeWXToOS2( vaEntries[i].GetKeyCode()

View File

@ -787,15 +787,24 @@ bool wxApp::DoMessage()
} }
#endif // wxUSE_THREADS #endif // wxUSE_THREADS
//
// Process the message // Process the message
if (!ProcessMessage((WXMSG *)&svCurrentMsg)) //
{ DoMessage((WXMSG *)&svCurrentMsg);
::WinDispatchMsg(vHabmain, (PQMSG)&svCurrentMsg);
}
} }
return TRUE; return TRUE;
} // end of wxApp::DoMessage } // end of wxApp::DoMessage
void wxApp::DoMessage(
WXMSG* pMsg
)
{
if (!ProcessMessage((WXMSG *)&svCurrentMsg))
{
::WinDispatchMsg(vHabmain, (PQMSG)&svCurrentMsg);
}
} // end of wxApp::DoMessage
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// //
// Keep trying to process messages until WM_QUIT // Keep trying to process messages until WM_QUIT

View File

@ -341,15 +341,9 @@ void wxFrame::DoGetPosition(
POINTL vPoint; POINTL vPoint;
::WinQueryWindowRect(m_hFrame, &vRect); ::WinQueryWindowRect(m_hFrame, &vRect);
vPoint.x = vRect.xLeft;
// *pX = vRect.xRight - vRect.xLeft;
// OS/2 is backwards [WIN32 it is vRect.yTop] *pY = vRect.yTop - vRect.yBottom;
//
vPoint.y = vRect.yBottom;
*pX = vPoint.x;
*pY = vPoint.y;
} // end of wxFrame::DoGetPosition } // end of wxFrame::DoGetPosition
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@ -1356,6 +1350,7 @@ bool wxFrame::HandleSize(
// restore all child frames too // restore all child frames too
// //
IconizeChildFrames(FALSE); IconizeChildFrames(FALSE);
(void)SendIconizeEvent(FALSE);
// //
// fall through // fall through
@ -1370,6 +1365,7 @@ bool wxFrame::HandleSize(
// Iconize all child frames too // Iconize all child frames too
// //
IconizeChildFrames(TRUE); IconizeChildFrames(TRUE);
(void)SendIconizeEvent();
m_bIconized = TRUE; m_bIconized = TRUE;
break; break;
} }

View File

@ -1810,6 +1810,26 @@ void wxWindow::GetCaretPos(
// popup menu // popup menu
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
static void wxYieldForCommandsOnly()
{
//
// Peek all WM_COMMANDs (it will always return WM_QUIT too but we don't
// want to process it here)
//
QMSG vMsg;
while (::WinPeekMsg( vHabmain
,&vMsg
,(HWND)0
,WM_COMMAND
,WM_COMMAND
,PM_REMOVE
) && vMsg.msg != WM_QUIT)
{
wxTheApp->DoMessage((WXMSG*)&vMsg);
}
}
bool wxWindow::DoPopupMenu( bool wxWindow::DoPopupMenu(
wxMenu* pMenu wxMenu* pMenu
, int nX , int nX
@ -1836,7 +1856,14 @@ bool wxWindow::DoPopupMenu(
,0L ,0L
,PU_MOUSEBUTTON2DOWN | PU_MOUSEBUTTON2 | PU_KEYBOARD ,PU_MOUSEBUTTON2DOWN | PU_MOUSEBUTTON2 | PU_KEYBOARD
); );
wxYield(); // we need to do it righ now as otherwise the events are never going to be
// sent to wxCurrentPopupMenu from HandleCommand()
//
// note that even eliminating (ugly) wxCurrentPopupMenu global wouldn't
// help and we'd still need wxYieldForCommandsOnly() as the menu may be
// destroyed as soon as we return (it can be a local variable in the caller
// for example) and so we do need to process the event immediately
wxYieldForCommandsOnly();
wxCurrentPopupMenu = NULL; wxCurrentPopupMenu = NULL;
pMenu->SetInvokingWindow(NULL); pMenu->SetInvokingWindow(NULL);

View File

@ -11163,6 +11163,8 @@ EXPORTS
DoMessage__5wxAppFv DoMessage__5wxAppFv
;wxExit() ;wxExit()
wxExit__Fv wxExit__Fv
;wxApp::DoMessage(void**)
DoMessage__5wxAppFPPv
;wxApp::Dispatch() ;wxApp::Dispatch()
Dispatch__5wxAppFv Dispatch__5wxAppFv
;wxEntry(int,char**) ;wxEntry(int,char**)