Don't generate wxEVT_LIST_ITEM_RIGHT_CLICK outside of item area
Make wxGenericListCtrl used under wxGTK and wxOSX behave the same as the native wxMSW wxListCtrl and wxTreeCtrl under all platforms and only generate ITEM_RIGHT_CLICK events when an item was actually clicked, i.e. don't generate them for the clicks completely outside of the client area. Closes #4711.
This commit is contained in:
committed by
Vadim Zeitlin
parent
2bd179a2fc
commit
aa4aa74154
@@ -150,6 +150,7 @@ wxGTK:
|
|||||||
- Fix clearing of wxComboBox with wxCB_READONLY (Chuddah).
|
- Fix clearing of wxComboBox with wxCB_READONLY (Chuddah).
|
||||||
- Fix setting "pressed" bitmap for wxToggleButton (Kevin B. McCarty).
|
- Fix setting "pressed" bitmap for wxToggleButton (Kevin B. McCarty).
|
||||||
- Fix GTK+ warnings for wxFileDialog with wxFD_MULTIPLE style.
|
- Fix GTK+ warnings for wxFileDialog with wxFD_MULTIPLE style.
|
||||||
|
- Don't generate wxEVT_LIST_ITEM_RIGHT_CLICK outside of item area (Igor Korot).
|
||||||
|
|
||||||
wxMSW:
|
wxMSW:
|
||||||
|
|
||||||
|
@@ -936,6 +936,8 @@ wxBEGIN_EVENT_TABLE(MyListCtrl, wxListCtrl)
|
|||||||
EVT_LIST_ITEM_ACTIVATED(LIST_CTRL, MyListCtrl::OnActivated)
|
EVT_LIST_ITEM_ACTIVATED(LIST_CTRL, MyListCtrl::OnActivated)
|
||||||
EVT_LIST_ITEM_FOCUSED(LIST_CTRL, MyListCtrl::OnFocused)
|
EVT_LIST_ITEM_FOCUSED(LIST_CTRL, MyListCtrl::OnFocused)
|
||||||
|
|
||||||
|
EVT_LIST_ITEM_RIGHT_CLICK(LIST_CTRL, MyListCtrl::OnItemRightClick)
|
||||||
|
|
||||||
EVT_LIST_COL_CLICK(LIST_CTRL, MyListCtrl::OnColClick)
|
EVT_LIST_COL_CLICK(LIST_CTRL, MyListCtrl::OnColClick)
|
||||||
EVT_LIST_COL_RIGHT_CLICK(LIST_CTRL, MyListCtrl::OnColRightClick)
|
EVT_LIST_COL_RIGHT_CLICK(LIST_CTRL, MyListCtrl::OnColRightClick)
|
||||||
EVT_LIST_COL_BEGIN_DRAG(LIST_CTRL, MyListCtrl::OnColBeginDrag)
|
EVT_LIST_COL_BEGIN_DRAG(LIST_CTRL, MyListCtrl::OnColBeginDrag)
|
||||||
@@ -1118,6 +1120,13 @@ void MyListCtrl::OnFocused(wxListEvent& event)
|
|||||||
event.Skip();
|
event.Skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MyListCtrl::OnItemRightClick(wxListEvent& event)
|
||||||
|
{
|
||||||
|
LogEvent(event, wxT("OnItemRightClick"));
|
||||||
|
|
||||||
|
event.Skip();
|
||||||
|
}
|
||||||
|
|
||||||
void MyListCtrl::OnListKeyDown(wxListEvent& event)
|
void MyListCtrl::OnListKeyDown(wxListEvent& event)
|
||||||
{
|
{
|
||||||
long item;
|
long item;
|
||||||
|
@@ -61,6 +61,7 @@ public:
|
|||||||
void OnListKeyDown(wxListEvent& event);
|
void OnListKeyDown(wxListEvent& event);
|
||||||
void OnActivated(wxListEvent& event);
|
void OnActivated(wxListEvent& event);
|
||||||
void OnFocused(wxListEvent& event);
|
void OnFocused(wxListEvent& event);
|
||||||
|
void OnItemRightClick(wxListEvent& event);
|
||||||
void OnCacheHint(wxListEvent& event);
|
void OnCacheHint(wxListEvent& event);
|
||||||
|
|
||||||
void OnChar(wxKeyEvent& event);
|
void OnChar(wxKeyEvent& event);
|
||||||
|
@@ -2432,8 +2432,6 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event )
|
|||||||
// outside of any item
|
// outside of any item
|
||||||
if (event.RightDown())
|
if (event.RightDown())
|
||||||
{
|
{
|
||||||
SendNotify( (size_t) -1, wxEVT_LIST_ITEM_RIGHT_CLICK, event.GetPosition() );
|
|
||||||
|
|
||||||
wxContextMenuEvent evtCtx(
|
wxContextMenuEvent evtCtx(
|
||||||
wxEVT_CONTEXT_MENU,
|
wxEVT_CONTEXT_MENU,
|
||||||
GetParent()->GetId(),
|
GetParent()->GetId(),
|
||||||
|
Reference in New Issue
Block a user