Ensure that wxListCtrl::HitTest finds correct index under qt
This commit is contained in:
@@ -1515,7 +1515,8 @@ void MyListCtrl::OnContextMenu(wxContextMenuEvent& event)
|
||||
{
|
||||
point = ScreenToClient(point);
|
||||
}
|
||||
ShowContextMenu(point);
|
||||
int flags;
|
||||
ShowContextMenu(point, HitTest(point, flags));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1527,10 +1528,12 @@ void MyListCtrl::OnContextMenu(wxContextMenuEvent& event)
|
||||
}
|
||||
#endif
|
||||
|
||||
void MyListCtrl::ShowContextMenu(const wxPoint& pos)
|
||||
void MyListCtrl::ShowContextMenu(const wxPoint& pos, long item)
|
||||
{
|
||||
wxMenu menu;
|
||||
|
||||
wxString itemNumber;
|
||||
itemNumber.Printf("Item %ld", item);
|
||||
menu.Append(wxID_ANY, itemNumber);
|
||||
menu.Append(wxID_ABOUT, "&About");
|
||||
menu.AppendSeparator();
|
||||
menu.Append(wxID_EXIT, "E&xit");
|
||||
|
Reference in New Issue
Block a user