Exemplo n.º 1
0
//! Link is in format: "protocol://action?name=value&name=value...etc.
void PrintableHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link)
{
    wxString addr = link.GetHref();
    URI uri(addr);
    if (uri.protocol == "info")    // not really a link
        return;
    if (uri.protocol != "fr") // call default handler for other protocols
    {
        wxHtmlWindow::OnLinkClicked(link);
        return;
    }

    // open in new tab if control/command key is down
    // open in new window if shift key is down
    bool openInTab;
    if (wxPlatformInfo::Get().GetOperatingSystemId() & wxOS_MAC)
        openInTab = ::wxGetKeyState(WXK_COMMAND);
    else
        openInTab = ::wxGetKeyState(WXK_CONTROL);
    if (openInTab)
        uri.addParam("target=new_tab");
    else if (::wxGetKeyState(WXK_SHIFT))
        uri.addParam("target=new");

    if (!getURIProcessor().handleURI(uri))
        notImplementedMessage(this);
}
Exemplo n.º 2
0
void PrintableHtmlWindow::OnMenuNewWindow(wxCommandEvent& WXUNUSED(event))
{
    wxString addr = tempLinkM;
    URI uri(addr);
    // we don't support "new window" for non-fr protocols
    if (uri.protocol != "fr")
        return;
    uri.addParam("target=new");
    if (!getURIProcessor().handleURI(uri))
        notImplementedMessage(this);
}
Exemplo n.º 3
0
URIHandler::URIHandler() :
    processorM(0)
{
    getURIProcessor().addHandler(this);
}