+// Update the descent value when whe are in a <sub> or <sup>.
+// prevbase is the parent base
+void wxHtmlCell::SetScriptMode(wxHtmlScriptMode mode, long previousBase)
+{
+ m_ScriptMode = mode;
+
+ if (mode == wxHTML_SCRIPT_SUP)
+ m_ScriptBaseline = previousBase - (m_Height + 1) / 2;
+ else if (mode == wxHTML_SCRIPT_SUB)
+ m_ScriptBaseline = previousBase + (m_Height + 1) / 6;
+ else
+ m_ScriptBaseline = 0;
+
+ m_Descent += m_ScriptBaseline;
+}
+
+#if WXWIN_COMPATIBILITY_2_6
+
+struct wxHtmlCellOnMouseClickCompatHelper;
+
+static wxHtmlCellOnMouseClickCompatHelper *gs_helperOnMouseClick = NULL;
+
+// helper for routing calls to new ProcessMouseClick() method to deprecated
+// OnMouseClick() method
+struct wxHtmlCellOnMouseClickCompatHelper
+{
+ 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