Example #1
0
void HtmlOutputPane::OnBeforeLoad(IHtmlWndBeforeLoadEvent& event) {
    const wxString url = event.GetURL();
	if (url == wxT("about:blank")) return;

	if (url.StartsWith(wxT("txmt://open"))) {
		m_opener.OpenTxmtUrl(url);

		// Don't try to open it in browser
		event.Cancel(true);
		return;
	}
	
	if (url.StartsWith(wxT("tm-file://"))) {
		wxString path = url.substr(10);

#ifdef __WXMSW__
		path = eDocumentPath::CygwinPathToWin(path); // path may be in unix format, so we have to convert it
#endif

		DecodePath(path); // Spaces transformed to %20 in paths confuses ie
		m_browser->LoadUrl(path);

		// Don't try to open it in browser
		event.Cancel(true);
		return;
	}
}
Example #2
0
void BundleManager::OnBeforeLoad(IHtmlWndBeforeLoadEvent& event) {
    const wxString url = event.GetURL();
	if (url == wxT("about:blank")) return;

	wxLaunchDefaultBrowser(url);

	// Don't try to open it in inline browser
	event.Cancel(true);
}
Example #3
0
void FindInProjectDlg::OnBeforeLoad(IHtmlWndBeforeLoadEvent& event) {
    const wxString url = event.GetURL();
    if (url.StartsWith(wxT("txmt://open"))) {
        m_parentFrame.OpenTxmtUrl(url);

        // Don't try to open it in browser
        event.Cancel(true);
        return;
    }
}