X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/88a1b6485f3f2d300012cde053c572f21f1f8bd3..fcb29b233888f7012ca6cf486c8287f5463787e0:/src/generic/htmllbox.cpp?ds=sidebyside diff --git a/src/generic/htmllbox.cpp b/src/generic/htmllbox.cpp index e0b3fd08f1..8d415e1051 100644 --- a/src/generic/htmllbox.cpp +++ b/src/generic/htmllbox.cpp @@ -46,6 +46,9 @@ FORCE_WXHTML_MODULES() // small border always added to the cells: static const wxCoord CELL_BORDER = 2; +const wxChar wxHtmlListBoxNameStr[] = wxT("htmlListBox"); +const wxChar wxSimpleHtmlListBoxNameStr[] = wxT("simpleHtmlListBox"); + // ============================================================================ // private classes // ============================================================================ @@ -301,7 +304,7 @@ void wxHtmlListBox::CacheItem(size_t n) const // set the cell's ID to item's index so that CellCoordsToPhysical() // can quickly find the item: - cell->SetId(wxString::Format(_T("%u"), n)); + cell->SetId(wxString::Format(_T("%lu"), (unsigned long)n)); cell->Layout(GetClientSize().x - 2*GetMargins().x); @@ -402,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), @@ -541,4 +551,125 @@ void wxHtmlListBox::OnLeftDown(wxMouseEvent& event) } } + +// ---------------------------------------------------------------------------- +// wxSimpleHtmlListBox +// ---------------------------------------------------------------------------- + +bool wxSimpleHtmlListBox::Create(wxWindow *parent, wxWindowID id, + const wxPoint& pos, + const wxSize& size, + int n, const wxString choices[], + long style, + const wxValidator& validator, + const wxString& name) +{ + if (!wxHtmlListBox::Create(parent, id, pos, size, style, name)) + return false; + + SetValidator(validator); + for (int i=0; iIsFrozen()) + RefreshAll(); +} + #endif // wxUSE_HTML