don't let WM_RBUTTONDOWN reach def window proc as it would enter a local modal message loop waiting for WM_RBUTTONUO and hose our event generation

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33361 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2005-04-05 22:59:22 +00:00
parent dd932cbe1c
commit fbd8ac5236
2 changed files with 14 additions and 7 deletions

View File

@ -425,6 +425,7 @@ public:
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
virtual WXLRESULT MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
virtual bool MSWCommand(WXUINT param, WXWORD id);
virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);

View File

@ -2275,13 +2275,6 @@ WXLRESULT wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPara
// newly selected item
::SelectItem(GetHwnd(), htItem);
::SetFocus(GetHwnd(), htItem);
// default WM_RBUTTONUP handler enters modal loop inside
// DefWindowProc() waiting for WM_RBUTTONDOWN and then sends
// the resulting WM_CONTEXTMENU to the parent window, not us,
// which completely breaks everything so simply don't let it
// see this message at all
processed = true;
break;
#if !wxUSE_CHECKBOXES_IN_MULTI_SEL_TREE
@ -2541,6 +2534,19 @@ WXLRESULT wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPara
return rc;
}
WXLRESULT
wxTreeCtrl::MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
{
// default WM_RBUTTONDOWN handler enters modal loop inside DefWindowProc()
// waiting for WM_RBUTTONUP and then sends the resulting WM_CONTEXTMENU to
// the parent window, not us, which completely breaks everything so simply
// don't let it see this message at all
if ( nMsg == WM_RBUTTONDOWN )
return 0;
return wxControl::MSWDefWindowProc(nMsg, wParam, lParam);
}
// process WM_NOTIFY Windows message
bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
{