add the HTML string of the selected item to wxSimpleHtmlListBox events (closes #10159)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57643 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -302,6 +302,14 @@ protected:
|
|||||||
virtual wxString OnGetItem(size_t n) const
|
virtual wxString OnGetItem(size_t n) const
|
||||||
{ return m_items[n]; }
|
{ return m_items[n]; }
|
||||||
|
|
||||||
|
virtual void InitEvent(wxCommandEvent& event, int n)
|
||||||
|
{
|
||||||
|
// we're not a virtual control and we can include the string
|
||||||
|
// of the item which was clicked:
|
||||||
|
event.SetString(m_items[n]);
|
||||||
|
wxVListBox::InitEvent(event, n);
|
||||||
|
}
|
||||||
|
|
||||||
wxArrayString m_items;
|
wxArrayString m_items;
|
||||||
wxArrayPtrVoid m_HTMLclientData;
|
wxArrayPtrVoid m_HTMLclientData;
|
||||||
|
|
||||||
|
|||||||
@@ -249,6 +249,7 @@ protected:
|
|||||||
|
|
||||||
// send the wxEVT_COMMAND_LISTBOX_SELECTED event
|
// send the wxEVT_COMMAND_LISTBOX_SELECTED event
|
||||||
void SendSelectedEvent();
|
void SendSelectedEvent();
|
||||||
|
virtual void InitEvent(wxCommandEvent& event, int n);
|
||||||
|
|
||||||
// common implementation of SelectAll() and DeselectAll()
|
// common implementation of SelectAll() and DeselectAll()
|
||||||
bool DoSelectAll(bool select);
|
bool DoSelectAll(bool select);
|
||||||
|
|||||||
@@ -261,15 +261,19 @@ bool wxVListBox::DoSetCurrent(int current)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxVListBox::InitEvent(wxCommandEvent& event, int n)
|
||||||
|
{
|
||||||
|
event.SetEventObject(this);
|
||||||
|
event.SetInt(n);
|
||||||
|
}
|
||||||
|
|
||||||
void wxVListBox::SendSelectedEvent()
|
void wxVListBox::SendSelectedEvent()
|
||||||
{
|
{
|
||||||
wxASSERT_MSG( m_current != wxNOT_FOUND,
|
wxASSERT_MSG( m_current != wxNOT_FOUND,
|
||||||
_T("SendSelectedEvent() shouldn't be called") );
|
_T("SendSelectedEvent() shouldn't be called") );
|
||||||
|
|
||||||
wxCommandEvent event(wxEVT_COMMAND_LISTBOX_SELECTED, GetId());
|
wxCommandEvent event(wxEVT_COMMAND_LISTBOX_SELECTED, GetId());
|
||||||
event.SetEventObject(this);
|
InitEvent(event, m_current);
|
||||||
event.SetInt(m_current);
|
|
||||||
|
|
||||||
(void)GetEventHandler()->ProcessEvent(event);
|
(void)GetEventHandler()->ProcessEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -708,9 +712,7 @@ void wxVListBox::OnLeftDClick(wxMouseEvent& eventMouse)
|
|||||||
if ( item == m_current )
|
if ( item == m_current )
|
||||||
{
|
{
|
||||||
wxCommandEvent event(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, GetId());
|
wxCommandEvent event(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, GetId());
|
||||||
event.SetEventObject(this);
|
InitEvent(event, item);
|
||||||
event.SetInt(item);
|
|
||||||
|
|
||||||
(void)GetEventHandler()->ProcessEvent(event);
|
(void)GetEventHandler()->ProcessEvent(event);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user