don't generate wxEVT_CONTEXT_MENU messages for right clicks in the list control header
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38644 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2695,15 +2695,26 @@ void wxListCtrl::OnPaint(wxPaintEvent& event)
|
|||||||
WXLRESULT
|
WXLRESULT
|
||||||
wxListCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
|
wxListCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
|
||||||
{
|
{
|
||||||
#ifdef WM_PRINT
|
switch ( nMsg )
|
||||||
if ( nMsg == WM_PRINT )
|
|
||||||
{
|
{
|
||||||
// we should bypass our own WM_PRINT handling as we don't handle
|
#ifdef WM_PRINT
|
||||||
// PRF_CHILDREN flag, so leave it to the native control itself
|
case WM_PRINT:
|
||||||
return MSWDefWindowProc(nMsg, wParam, lParam);
|
// we should bypass our own WM_PRINT handling as we don't handle
|
||||||
}
|
// PRF_CHILDREN flag, so leave it to the native control itself
|
||||||
|
return MSWDefWindowProc(nMsg, wParam, lParam);
|
||||||
#endif // WM_PRINT
|
#endif // WM_PRINT
|
||||||
|
|
||||||
|
case WM_CONTEXTMENU:
|
||||||
|
// because this message is propagated upwards the child-parent
|
||||||
|
// chain, we get it for the right clicks on the header window but
|
||||||
|
// this is confusing in wx as right clicking there already
|
||||||
|
// generates a separate wxEVT_COMMAND_LIST_COL_RIGHT_CLICK event
|
||||||
|
// so just ignore them
|
||||||
|
if ( (HWND)wParam == ListView_GetHeader(GetHwnd()) )
|
||||||
|
return 0;
|
||||||
|
//else: break
|
||||||
|
}
|
||||||
|
|
||||||
return wxControl::MSWWindowProc(nMsg, wParam, lParam);
|
return wxControl::MSWWindowProc(nMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user