don't show the normal context menu while editing an item (#9543)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54011 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1132,16 +1132,29 @@ void MyListCtrl::InsertItemInReportView(int i)
|
|||||||
#if USE_CONTEXT_MENU
|
#if USE_CONTEXT_MENU
|
||||||
void MyListCtrl::OnContextMenu(wxContextMenuEvent& event)
|
void MyListCtrl::OnContextMenu(wxContextMenuEvent& event)
|
||||||
{
|
{
|
||||||
wxPoint point = event.GetPosition();
|
if (GetEditControl() == NULL)
|
||||||
// If from keyboard
|
{
|
||||||
if (point.x == -1 && point.y == -1) {
|
wxPoint point = event.GetPosition();
|
||||||
wxSize size = GetSize();
|
// If from keyboard
|
||||||
point.x = size.x / 2;
|
if ( (point.x == -1) && (point.y == -1) )
|
||||||
point.y = size.y / 2;
|
{
|
||||||
} else {
|
wxSize size = GetSize();
|
||||||
point = ScreenToClient(point);
|
point.x = size.x / 2;
|
||||||
|
point.y = size.y / 2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
point = ScreenToClient(point);
|
||||||
|
}
|
||||||
|
ShowContextMenu(point);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// the user is editing:
|
||||||
|
// allow the text control to display its context menu
|
||||||
|
// if it has one (it has on Windows) rather than display our one
|
||||||
|
event.Skip();
|
||||||
}
|
}
|
||||||
ShowContextMenu(point);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user