+ wxHtmlCellOnMouseClickCompatHelper(wxHtmlWindowInterface *window_,
+ const wxPoint& pos_,
+ const wxMouseEvent& event_)
+ : window(window_), pos(pos_), event(event_), retval(false)
+ {
+ }
+
+ bool CallOnMouseClick(wxHtmlCell *cell)
+ {
+ wxHtmlCellOnMouseClickCompatHelper *oldHelper = gs_helperOnMouseClick;
+ gs_helperOnMouseClick = this;
+ cell->OnMouseClick
+ (
+ window ? window->GetHTMLWindow() : NULL,
+ pos.x, pos.y,
+ event
+ );
+ gs_helperOnMouseClick = oldHelper;
+ return retval;
+ }
+
+ wxHtmlWindowInterface *window;
+ const wxPoint& pos;
+ const wxMouseEvent& event;
+ bool retval;
+};
+#endif // WXWIN_COMPATIBILITY_2_6
+
+bool wxHtmlCell::ProcessMouseClick(wxHtmlWindowInterface *window,
+ const wxPoint& pos,
+ const wxMouseEvent& event)
+{
+ wxCHECK_MSG( window, false, _T("window interface must be provided") );
+
+#if WXWIN_COMPATIBILITY_2_6
+ // NB: this hack puts the body of ProcessMouseClick() into OnMouseClick()
+ // (for which it has to pass the arguments and return value via a
+ // helper variable because these two methods have different
+ // signatures), so that old code overriding OnMouseClick will continue
+ // to work
+ wxHtmlCellOnMouseClickCompatHelper compat(window, pos, event);
+ return compat.CallOnMouseClick(this);
+}
+
+void wxHtmlCell::OnMouseClick(wxWindow *, int, int, const wxMouseEvent& event)
+{
+ wxCHECK_RET( gs_helperOnMouseClick, _T("unexpected call to OnMouseClick") );
+ wxHtmlWindowInterface *window = gs_helperOnMouseClick->window;
+ const wxPoint& pos = gs_helperOnMouseClick->pos;
+#endif // WXWIN_COMPATIBILITY_2_6
+
+ wxHtmlLinkInfo *lnk = GetLink(pos.x, pos.y);
+ bool retval = false;
+
+ if (lnk)