X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9ebb7cade2df5aeb8531950d2a79cd57a336bcec..fcb29b233888f7012ca6cf486c8287f5463787e0:/src/generic/htmllbox.cpp diff --git a/src/generic/htmllbox.cpp b/src/generic/htmllbox.cpp index 7e4f8d73e4..8d415e1051 100644 --- a/src/generic/htmllbox.cpp +++ b/src/generic/htmllbox.cpp @@ -405,6 +405,13 @@ void wxHtmlListBox::OnHTMLLinkClicked(const wxHtmlLinkInfo& link) OnLinkClicked(GetItemForCell(link.GetHtmlCell()), link); } +void wxHtmlListBox::OnLinkClicked(size_t WXUNUSED(n), + const wxHtmlLinkInfo& link) +{ + wxHtmlLinkEvent event(GetId(), link); + GetEventHandler()->ProcessEvent(event); +} + wxHtmlOpeningStatus wxHtmlListBox::OnHTMLOpeningURL(wxHtmlURLType WXUNUSED(type), const wxString& WXUNUSED(url), @@ -586,7 +593,7 @@ bool wxSimpleHtmlListBox::Create(wxWindow *parent, wxWindowID id, wxSimpleHtmlListBox::~wxSimpleHtmlListBox() { - wxASSERT(m_items.GetCount() == m_clientData.GetCount()); + wxASSERT(m_items.GetCount() == m_HTMLclientData.GetCount()); if (HasClientObjectData()) { // clear the array of client data objects @@ -595,41 +602,35 @@ wxSimpleHtmlListBox::~wxSimpleHtmlListBox() } m_items.Clear(); - m_clientData.Clear(); + m_HTMLclientData.Clear(); } void wxSimpleHtmlListBox::Clear() { m_items.Clear(); - m_clientData.Clear(); + m_HTMLclientData.Clear(); UpdateCount(); } void wxSimpleHtmlListBox::Delete(unsigned int n) { m_items.RemoveAt(n); - m_clientData.RemoveAt(n); + m_HTMLclientData.RemoveAt(n); UpdateCount(); } void wxSimpleHtmlListBox::Append(const wxArrayString& strings) { - // we know how many items are going to be added - avoid too many reallocs - // m_items.Alloc(strings.GetCount()); - // FIXME: Alloc() will clear all the old contents. - // Suggested fix = make Grow() public and make WX_APPEND_ARRAY take - // care of calling it automatically - // append all given items at once WX_APPEND_ARRAY(m_items, strings); - m_clientData.Add(NULL, strings.GetCount()); + m_HTMLclientData.Add(NULL, strings.GetCount()); UpdateCount(); } int wxSimpleHtmlListBox::DoAppend(const wxString& item) { m_items.Add(item); - m_clientData.Add(NULL); + m_HTMLclientData.Add(NULL); UpdateCount(); return GetCount()-1; } @@ -637,7 +638,7 @@ int wxSimpleHtmlListBox::DoAppend(const wxString& item) int wxSimpleHtmlListBox::DoInsert(const wxString& item, unsigned int pos) { m_items.Insert(item, pos); - m_clientData.Insert(NULL, pos); + m_HTMLclientData.Insert(NULL, pos); UpdateCount(); return pos; } @@ -661,7 +662,7 @@ wxString wxSimpleHtmlListBox::GetString(unsigned int n) const void wxSimpleHtmlListBox::UpdateCount() { - wxASSERT(m_items.GetCount() == m_clientData.GetCount()); + wxASSERT(m_items.GetCount() == m_HTMLclientData.GetCount()); wxHtmlListBox::SetItemCount(m_items.GetCount()); // very small optimization: if you need to add lot of items to