Implement LIST_KEY_DOWN support, and move new functions into wxABI_VERSION.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44060 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -331,7 +331,6 @@ class WXDLLEXPORT wxListCtrl: public wxControl
|
||||
bool HasCurrent() const { return m_current != (long)-1; }
|
||||
|
||||
void OnLeftDown(wxMouseEvent& event);
|
||||
void OnRightDown(wxMouseEvent& event);
|
||||
void OnDblClick(wxMouseEvent& event);
|
||||
|
||||
void FinishEditing(wxTextCtrl *text)
|
||||
@@ -344,6 +343,8 @@ class WXDLLEXPORT wxListCtrl: public wxControl
|
||||
virtual int GetScrollPos(int orient) const;
|
||||
|
||||
#if wxABI_VERSION >= 20801
|
||||
void OnRightDown(wxMouseEvent& event);
|
||||
void OnChar(wxKeyEvent& event);
|
||||
virtual void SetFocus();
|
||||
#endif
|
||||
|
||||
|
@@ -508,6 +508,7 @@ BEGIN_EVENT_TABLE(wxListCtrl, wxControl)
|
||||
EVT_LEFT_DOWN(wxListCtrl::OnLeftDown)
|
||||
EVT_LEFT_DCLICK(wxListCtrl::OnDblClick)
|
||||
EVT_RIGHT_DOWN(wxListCtrl::OnRightDown)
|
||||
EVT_CHAR(wxListCtrl::OnChar)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
// ============================================================================
|
||||
@@ -611,6 +612,13 @@ void wxListCtrl::OnLeftDown(wxMouseEvent& event)
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void wxListCtrl::OnDblClick(wxMouseEvent& event)
|
||||
{
|
||||
m_current = -1;
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
#if wxABI_VERSION >= 20801
|
||||
void wxListCtrl::OnRightDown(wxMouseEvent& event)
|
||||
{
|
||||
wxListEvent le( wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, GetId() );
|
||||
@@ -629,17 +637,31 @@ void wxListCtrl::OnRightDown(wxMouseEvent& event)
|
||||
le.m_item.m_itemId = item;
|
||||
GetItem(le.m_item);
|
||||
}
|
||||
GetEventHandler()->ProcessEvent(le);
|
||||
}
|
||||
|
||||
GetEventHandler()->ProcessEvent(le);
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void wxListCtrl::OnDblClick(wxMouseEvent& event)
|
||||
void wxListCtrl::OnChar(wxKeyEvent& event)
|
||||
{
|
||||
m_current = -1;
|
||||
event.Skip();
|
||||
wxListEvent le( wxEVT_COMMAND_LIST_KEY_DOWN, GetId() );
|
||||
le.SetEventObject(this);
|
||||
le.m_code = event.GetKeyCode();
|
||||
le.m_itemIndex = -1;
|
||||
|
||||
if (m_current != -1)
|
||||
{
|
||||
le.m_itemIndex = m_current;
|
||||
if (!IsVirtual())
|
||||
{
|
||||
le.m_item.m_itemId = m_current;
|
||||
GetItem(le.m_item);
|
||||
}
|
||||
GetEventHandler()->ProcessEvent(le);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
bool wxListCtrl::Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
|
Reference in New Issue
Block a user