void wxHtmlCell::OnMouseClick(wxWindow *, int, int, const wxMouseEvent& event)
{
    wxCHECK_RET( gs_helperOnMouseClick, wxT("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)
    {
        wxHtmlLinkInfo lnk2(*lnk);
        lnk2.SetEvent(&event);
        lnk2.SetHtmlCell(this);

        window->OnHTMLLinkClicked(lnk2);
        retval = true;
    }

#if WXWIN_COMPATIBILITY_2_6
    gs_helperOnMouseClick->retval = retval;
#else
    return retval;
#endif // WXWIN_COMPATIBILITY_2_6
}
Exemple #2
0
void wxHtmlCell::OnMouseClick(wxWindow *parent, int x, int y,
                              const wxMouseEvent& event)
{
    wxHtmlLinkInfo *lnk = GetLink(x, y);
    if (lnk != NULL)
    {
        wxHtmlLinkInfo lnk2(*lnk);
        lnk2.SetEvent(&event);
        lnk2.SetHtmlCell(this);

        // note : this cast is legal because parent is *always* wxHtmlWindow
        wxStaticCast(parent, wxHtmlWindow)->OnLinkClicked(lnk2);
    }
}