X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a9b4940a1f8eef8eb3e7ff65ed45f1daf14c2d9..8f4d9fcd9a1133442aa733e978231b01956e641b:/src/generic/htmllbox.cpp diff --git a/src/generic/htmllbox.cpp b/src/generic/htmllbox.cpp index a9d2f468c3..91be6e7ac7 100644 --- a/src/generic/htmllbox.cpp +++ b/src/generic/htmllbox.cpp @@ -28,6 +28,8 @@ #include "wx/dcclient.h" #endif //WX_PRECOMP +#if wxUSE_HTML + #include "wx/htmllbox.h" #include "wx/html/htmlcell.h" @@ -144,6 +146,8 @@ public: private: const wxHtmlListBox& m_hlbox; + + DECLARE_NO_COPY_CLASS(wxHtmlListBoxStyle) }; @@ -159,6 +163,9 @@ END_EVENT_TABLE() // implementation // ============================================================================ +IMPLEMENT_ABSTRACT_CLASS(wxHtmlListBox, wxVListBox) + + // ---------------------------------------------------------------------------- // wxHtmlListBox creation // ---------------------------------------------------------------------------- @@ -262,6 +269,14 @@ void wxHtmlListBox::RefreshAll() wxVListBox::RefreshAll(); } +void wxHtmlListBox::SetItemCount(size_t count) +{ + // the items are going to change, forget the old ones + m_cache->Clear(); + + wxVListBox::SetItemCount(count); +} + // ---------------------------------------------------------------------------- // wxHtmlListBox implementation of wxVListBox pure virtuals // ---------------------------------------------------------------------------- @@ -289,7 +304,7 @@ void wxHtmlListBox::OnDrawItem(wxDC& dc, const wxRect& rect, size_t n) const // note that we can't stop drawing exactly at the window boundary as then // even the visible cells part could be not drawn, so always draw the // entire cell - cell->Draw(dc, rect.x, rect.y, 0, INT_MAX, htmlRendInfo); + cell->Draw(dc, rect.x+2, rect.y+2, 0, INT_MAX, htmlRendInfo); } wxCoord wxHtmlListBox::OnMeasureItem(size_t n) const @@ -299,6 +314,7 @@ wxCoord wxHtmlListBox::OnMeasureItem(size_t n) const wxHtmlCell *cell = m_cache->Get(n); wxCHECK_MSG( cell, 0, _T("this cell should be cached!") ); - return cell->GetHeight() + cell->GetDescent(); + return cell->GetHeight() + cell->GetDescent() + 4; } +#endif