+void MyFrame::OnUpdateItem(wxCommandEvent& WXUNUSED(event))
+{
+ if (GetMyBox())
+ GetMyBox()->UpdateFirstItem();
+}
+
+void MyFrame::OnGetItemRect(wxCommandEvent& WXUNUSED(event))
+{
+ static const int ITEM = 10;
+ const wxRect r = m_hlbox->GetItemRect(ITEM);
+ wxLogMessage("Rect of item %d: (%d, %d)-(%d, %d)",
+ ITEM, r.x, r.y, r.x + r.width, r.y + r.height);
+}
+
+void MyFrame::OnSetBgCol(wxCommandEvent& WXUNUSED(event))
+{
+ wxColour col = wxGetColourFromUser(this, m_hlbox->GetBackgroundColour());
+ if ( col.IsOk() )
+ {
+ m_hlbox->SetBackgroundColour(col);
+ m_hlbox->Refresh();
+
+#if wxUSE_STATUSBAR
+ SetStatusText(wxT("Background colour changed."));
+#endif // wxUSE_STATUSBAR
+ }
+}
+
+void MyFrame::OnSetSelBgCol(wxCommandEvent& WXUNUSED(event))
+{
+ wxColour col = wxGetColourFromUser(this, m_hlbox->GetSelectionBackground());
+ if ( col.IsOk() )
+ {
+ m_hlbox->SetSelectionBackground(col);
+ m_hlbox->Refresh();
+
+#if wxUSE_STATUSBAR
+ SetStatusText(wxT("Selection background colour changed."));
+#endif // wxUSE_STATUSBAR
+ }
+}
+
+void MyFrame::OnSetSelFgCol(wxCommandEvent& event)
+{
+ if (GetMyBox())
+ {
+ GetMyBox()->SetChangeSelFg(!event.IsChecked());
+ GetMyBox()->Refresh();
+ }
+}
+
+void MyFrame::OnClear(wxCommandEvent& WXUNUSED(event))
+{
+ m_hlbox->Clear();
+}
+
+void MyFrame::OnHtmlLinkClicked(wxHtmlLinkEvent &event)
+{
+ wxLogMessage(wxT("The url '%s' has been clicked!"), event.GetLinkInfo().GetHref().c_str());
+
+ if (GetMyBox())
+ {
+ GetMyBox()->m_linkClicked = true;
+ GetMyBox()->RefreshRow(1);
+ }
+}
+
+void MyFrame::OnHtmlCellHover(wxHtmlCellEvent &event)
+{
+ wxLogMessage(wxT("Mouse moved over cell %p at %d;%d"),
+ event.GetCell(), event.GetPoint().x, event.GetPoint().y);
+}
+
+void MyFrame::OnHtmlCellClicked(wxHtmlCellEvent &event)
+{
+ wxLogMessage(wxT("Click over cell %p at %d;%d"),
+ event.GetCell(), event.GetPoint().x, event.GetPoint().y);
+
+ // if we don't skip the event, OnHtmlLinkClicked won't be called!
+ event.Skip();
+}
+