+ // erase the background: for compatibility, we must generate the event to
+ // allow the user-defined handlers to do it
+ wxEraseEvent eraseEvent(GetId(), dc);
+ eraseEvent.SetEventObject(this);
+ if ( !ProcessWindowEvent(eraseEvent) )
+ {
+ // erase background ourselves
+ DoEraseBackground(*dc);
+ }
+ //else: background erased by the user-defined handler
+
+
+ // draw the HTML window contents
+ dc->SetMapMode(wxMM_TEXT);
+ dc->SetBackgroundMode(wxBRUSHSTYLE_TRANSPARENT);
+
+ wxHtmlRenderingInfo rinfo;
+ wxDefaultHtmlRenderingStyle rstyle;
+ rinfo.SetSelection(m_selection);
+ rinfo.SetStyle(&rstyle);
+ m_Cell->Draw(*dc, 0, 0,
+ y * wxHTML_SCROLL_STEP + rect.GetTop(),
+ y * wxHTML_SCROLL_STEP + rect.GetBottom(),
+ rinfo);
+
+#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);
+
+ dc->SetBrush(*wxTRANSPARENT_BRUSH);
+ dc->SetPen(*wxBLACK_PEN);
+ if (at)
+ dc->DrawRectangle(at->GetAbsPos(),
+ wxSize(at->GetWidth(),at->GetHeight()));
+ dc->SetPen(*wxGREEN_PEN);
+ if (before)
+ dc->DrawRectangle(before->GetAbsPos().x+1, before->GetAbsPos().y+1,
+ before->GetWidth()-2,before->GetHeight()-2);
+ dc->SetPen(*wxRED_PEN);
+ if (after)
+ dc->DrawRectangle(after->GetAbsPos().x+2, after->GetAbsPos().y+2,
+ after->GetWidth()-4,after->GetHeight()-4);
+ }
+#endif // DEBUG_HTML_SELECTION
+
+ if ( dc != &dcPaint )
+ {
+ dc->SetDeviceOrigin(0,0);
+ dcPaint.Blit(0, rect.GetTop(),
+ sz.x, rect.GetBottom() - rect.GetTop() + 1,
+ dc,
+ 0, rect.GetTop());