+void wxHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link)
+{
+ const wxMouseEvent *e = link.GetEvent();
+ if (e == NULL || e->LeftUp())
+ LoadPage(link.GetHref());
+}
+
+void wxHtmlWindow::OnCellClicked(wxHtmlCell *cell,
+ wxCoord x, wxCoord y,
+ const wxMouseEvent& event)
+{
+ wxCHECK_RET( cell, _T("can't be called with NULL cell") );
+
+ cell->OnMouseClick(this, x, y, event);
+}
+
+void wxHtmlWindow::OnCellMouseHover(wxHtmlCell * WXUNUSED(cell),
+ wxCoord WXUNUSED(x), wxCoord WXUNUSED(y))
+{
+ // do nothing here
+}
+
+void wxHtmlWindow::OnEraseBackground(wxEraseEvent& WXUNUSED(event))
+{
+}
+
+void wxHtmlWindow::OnPaint(wxPaintEvent& WXUNUSED(event))
+{
+ wxPaintDC dc(this);
+
+ if (m_tmpCanDrawLocks > 0 || m_Cell == NULL) return;
+
+ int x, y;
+ GetViewStart(&x, &y);
+ wxRect rect = GetUpdateRegion().GetBox();
+ wxSize sz = GetSize();
+
+ wxMemoryDC dcm;
+ if ( !m_backBuffer )
+ m_backBuffer = new wxBitmap(sz.x, sz.y);
+ dcm.SelectObject(*m_backBuffer);
+ dcm.SetBackground(wxBrush(GetBackgroundColour(), wxSOLID));
+ dcm.Clear();
+ PrepareDC(dcm);
+ dcm.SetMapMode(wxMM_TEXT);
+ dcm.SetBackgroundMode(wxTRANSPARENT);
+
+ wxHtmlRenderingInfo rinfo;
+ wxDefaultHtmlRenderingStyle rstyle;
+ rinfo.SetSelection(m_selection);
+ rinfo.SetStyle(&rstyle);
+ m_Cell->Draw(dcm, 0, 0,
+ y * wxHTML_SCROLL_STEP + rect.GetTop(),
+ y * wxHTML_SCROLL_STEP + rect.GetBottom(),
+ rinfo);
+
+//#define DEBUG_HTML_SELECTION
+#ifdef DEBUG_HTML_SELECTION
+ {
+ int xc, yc, x, y;
+ wxGetMousePosition(&xc, &yc);
+ ScreenToClient(&xc, &yc);
+ CalcUnscrolledPosition(xc, yc, &x, &y);
+ wxHtmlCell *at = m_Cell->FindCellByPos(x, y);
+ wxHtmlCell *before =
+ m_Cell->FindCellByPos(x, y, wxHTML_FIND_NEAREST_BEFORE);
+ wxHtmlCell *after =
+ m_Cell->FindCellByPos(x, y, wxHTML_FIND_NEAREST_AFTER);
+
+ dcm.SetBrush(*wxTRANSPARENT_BRUSH);
+ dcm.SetPen(*wxBLACK_PEN);
+ if (at)
+ dcm.DrawRectangle(at->GetAbsPos(),
+ wxSize(at->GetWidth(),at->GetHeight()));
+ dcm.SetPen(*wxGREEN_PEN);
+ if (before)
+ dcm.DrawRectangle(before->GetAbsPos().x+1, before->GetAbsPos().y+1,
+ before->GetWidth()-2,before->GetHeight()-2);
+ dcm.SetPen(*wxRED_PEN);
+ if (after)
+ dcm.DrawRectangle(after->GetAbsPos().x+2, after->GetAbsPos().y+2,
+ after->GetWidth()-4,after->GetHeight()-4);