当前位置: 首页>>代码示例>>C++>>正文


C++ wxLaunchDefaultBrowser函数代码示例

本文整理汇总了C++中wxLaunchDefaultBrowser函数的典型用法代码示例。如果您正苦于以下问题:C++ wxLaunchDefaultBrowser函数的具体用法?C++ wxLaunchDefaultBrowser怎么用?C++ wxLaunchDefaultBrowser使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了wxLaunchDefaultBrowser函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: wxLaunchDefaultBrowser

/* MainWindow::onHTMLLinkClicked
 * Called when a link is clicked on the HTML Window, so that
 * external (http) links are opened in the default browser
 *******************************************************************/
void MainWindow::onHTMLLinkClicked(wxEvent& e)
{
	wxHtmlLinkEvent& ev = (wxHtmlLinkEvent&)e;
	string href = ev.GetLinkInfo().GetHref();

	if (href.StartsWith("http://"))
		wxLaunchDefaultBrowser(ev.GetLinkInfo().GetHref());
	else if (href.StartsWith("recent://"))
	{
		// Recent file
		string rs = href.Right(1);
		unsigned long index = 0;
		rs.ToULong(&index);
		index++;

		panel_archivemanager->handleAction(S_FMT("aman_recent%lu", index));
	}
	else if (href.StartsWith("action://"))
	{
		// Action
		if (href.EndsWith("open"))
			theApp->doAction("aman_open");
		else if (href.EndsWith("newwad"))
			theApp->doAction("aman_newwad");
		else if (href.EndsWith("newzip"))
			theApp->doAction("aman_newzip");
		else if (href.EndsWith("newmap"))
			theApp->doAction("aman_newmap");
		else if (href.EndsWith("reloadstartpage"))
			createStartPage();
	}
	else
		html_startpage->OnLinkClicked(ev.GetLinkInfo());
}
开发者ID:jonrimmer,项目名称:SLADE,代码行数:38,代码来源:MainWindow.cpp

示例2: DisplayPgAdminHelp

void DisplayPgAdminHelp(const wxString &helpTopic)
{
	static wxHelpControllerBase *helpCtl = 0;
	static bool firstCall = true;

	// Startup the main help system
	if (firstCall)
	{
		firstCall = false;
		wxString helpdir = docPath + wxT("/") + settings->GetCanonicalLanguageName();

		if (!wxFile::Exists(helpdir + wxT("/pgadmin3.hhp")) &&
#if defined(__WXMSW__) || wxUSE_LIBMSPACK
		        !wxFile::Exists(helpdir + wxT("/pgadmin3.chm")) &&
#endif
		        !wxFile::Exists(helpdir + wxT("/pgadmin3.zip")))
			helpdir = docPath + wxT("/en_US");

#ifdef __WXMSW__
#ifndef __WXDEBUG__
		if (wxFile::Exists(helpdir + wxT("/pgadmin3.chm")))
		{
			helpCtl = new wxCHMHelpController();
			helpCtl->Initialize(helpdir + wxT("/pgadmin3"));
		}
		else
#endif
#endif
#if wxUSE_LIBMSPACK
			if (wxFile::Exists(helpdir + wxT("/pgadmin3.chm")) ||
			        wxFile::Exists(helpdir + wxT("/pgadmin3.hhp")) || wxFile::Exists(helpdir + wxT("/pgadmin3.zip")))
#else
			if (wxFile::Exists(helpdir + wxT("/pgadmin3.hhp")) || wxFile::Exists(helpdir + wxT("/pgadmin3.zip")))
#endif
			{
				helpCtl = new wxHtmlHelpController();
				helpCtl->Initialize(helpdir + wxT("/pgadmin3"));
			}
	}

	wxString page;
	int hashPos = helpTopic.Find('#');
	if (hashPos < 0)
		page = helpTopic + wxT(".html");
	else
		page = helpTopic.Left(hashPos) + wxT(".html") + helpTopic.Mid(hashPos);

	if (helpCtl)
	{
		if (helpTopic == wxT("index.html"))
			helpCtl->DisplayContents();
		else
			helpCtl->DisplaySection(page);
	}
	else
	{
		wxLaunchDefaultBrowser(page);
	}
}
开发者ID:swflb,项目名称:pgadmin3,代码行数:59,代码来源:misc.cpp

示例3: wxT

/**
 * 選択したテキストでヤフー検索
 */
void ThreadContentWindow::SearchSelectWordByYahoo(wxCommandEvent& event) 
{
     // 検索方法の元ネタは右:http://developer.yahoo.co.jp/other/query_parameters/search/websearch.html
     wxString url = wxT("http://search.yahoo.co.jp/search?p=");
     url += m_selectedText;
     url += wxT("&ei=UTF-8");
     wxLaunchDefaultBrowser(url);
}
开发者ID:Hiroyuki-Nagata,项目名称:JaneClone,代码行数:11,代码来源:threadcontentwindow.cpp

示例4: wxLaunchDefaultBrowser

void CWizardAttach::OnFinished( wxWizardExEvent& event ) {

    if (IsAccountManagerWizard) {
        // Attached to an account manager
        if (!GetReturnURL().empty() && GetAttachedToProjectSuccessfully()) {
            wxLaunchDefaultBrowser(GetReturnURL());
        }
    } else {
        // Attached to a project
        if (GetAccountCreatedSuccessfully() && GetAttachedToProjectSuccessfully()) {
            wxLaunchDefaultBrowser(GetProjectURL() + wxT("account_finish.php?auth=") + GetProjectAuthenticator());
        }
    }

    // Let the framework clean things up.
    event.Skip();
}
开发者ID:Ocode,项目名称:boinc,代码行数:17,代码来源:WizardAttach.cpp

示例5: wxLaunchDefaultBrowser

void CConfigurationDialog::OnTextURLEvent(wxTextUrlEvent& event)
{
	if(event.GetMouseEvent().LeftIsDown())
	{
		wxTextCtrl* pTextCtrl = (wxTextCtrl*)event.GetEventObject();
		wxLaunchDefaultBrowser(pTextCtrl->GetRange(event.GetURLStart(), event.GetURLEnd()));
	}
}
开发者ID:Arkshine,项目名称:open-steamworks,代码行数:8,代码来源:ConfigurationDialog.cpp

示例6: wxLaunchDefaultBrowser

void ZLauncherFrame::OnClickLink(wxWebViewEvent& evt)
{
	// Open the link on the default browser
	wxLaunchDefaultBrowser(evt.GetURL());

	// Stop navigation
	evt.Veto();
}
开发者ID:TheZoc,项目名称:ZPatcher,代码行数:8,代码来源:ZLauncherFrame.cpp

示例7: getAllMatches

void StyleDialog::OnStyleWebReport ( wxCommandEvent& event )
{
	std::vector<ContextMatch> v;
	getAllMatches ( v );

	sort ( v.begin(), v.end(), reportCompareFunction );

	// temporary file should be in default temporary folder
	wxString tempNameWide = wxFileName::CreateTempFileName ( _T ( "" ) );
	if ( tempNameWide.empty() )
		return;
	tempNameWide.Replace ( _T ( ".tmp" ), _T ( "_report.html" ), true );
	tempFiles.insert ( tempNameWide );
	std::string tempNameUtf8 = ( const char * ) tempNameWide.mb_str ( wxConvUTF8 );
	std::ofstream ofs ( tempNameUtf8.c_str() );
	if ( !ofs )
		return;

	WrapExpat we;

	ofs << XHTML_START;
	ofs << "<body><h2>";
	ofs << fileName.mb_str ( wxConvUTF8 );
	ofs << "</h2><table><tr>";
	ofs << "<td><b align=\"right\">No.</b></td>";
	ofs << "<td align=\"right\"><b>Context</b></td>";
	ofs << "<td align=\"center\"><b>Match</b></td>";
	ofs << "<td align=\"left\"><b>Context</b></td>";
	ofs << "<td><b>Suggestion</b></td><td><b>Report</b></td></tr>";
	std::vector<ContextMatch>::iterator it;
	int matchCount = 0;
	for ( it = v.begin(); it != v.end(); ++it )
	{
		ofs << "<tr><td align=\"right\">";
		ofs << ++matchCount;
		ofs << "</td>";
		ofs << "<td align=\"right\">";
		ofs << we.xmliseTextNode ( it->prelog );
		ofs << "</td><td align=\"center\"><font color=\"red\"><b>";
		ofs << we.xmliseTextNode ( it->match );
		ofs << "</b></font></td><td align=\"left\">";
		ofs << we.xmliseTextNode ( it->postlog );
		ofs << "</td><td><font color=\"green\"><b>";
		ofs << we.xmliseTextNode ( it->replace );
		ofs << "</b></font></td><td>";
		ofs << we.xmliseTextNode ( it->report );
		ofs << "</td></tr>";
	}
	ofs << "</table></body>";
	ofs << XHTML_END;
	ofs.close();

	// display file in browser
	if ( !wxFileExists ( tempNameWide ) )
		return;

	wxLaunchDefaultBrowser ( tempNameWide );
}
开发者ID:aurex-linux,项目名称:xmlcopyeditor,代码行数:58,代码来源:styledialog.cpp

示例8: activate_link

static gboolean activate_link(GtkAboutDialog*, const char* link, void* dontIgnore)
{
    if (dontIgnore)
    {
        wxLaunchDefaultBrowser(wxGTK_CONV_BACK_SYS(link));
        return true;
    }
    return false;
}
开发者ID:CodeSmithyIDE,项目名称:wxWidgets,代码行数:9,代码来源:aboutdlg.cpp

示例9: init_static

void HelpButton::OpenPage(wxString const& pageID) {
	init_static();

	wxString page = (*pages)[pageID];
	wxString section;
	page = page.BeforeFirst('#', &section);

	wxLaunchDefaultBrowser(wxString::Format("http://docs.aegisub.org/3.1/%s/#%s", page, section));
}
开发者ID:liloneum,项目名称:Aegisub,代码行数:9,代码来源:help_button.cpp

示例10: WXUNUSED

void ScreenshotFrame::OnSeeScreenshots(wxCommandEvent& WXUNUSED(event))
{
    wxString defaultDir = AutoCaptureMechanism::GetDefaultDirectoryAbsPath();

    if (wxFileName::DirExists(defaultDir))
        wxLaunchDefaultBrowser(defaultDir);
    else
        wxMessageBox(_("There isn't any screenshots yet."));
}
开发者ID:3v1n0,项目名称:wxWidgets,代码行数:9,代码来源:screenshot_main.cpp

示例11: CharPositionFromPointClose

/* TextEditor::onMouseDown
 * Called when a mouse button is clicked
 *******************************************************************/
void TextEditor::onMouseDown(wxMouseEvent& e)
{
	e.Skip();

	// No language, no checks
	if (!language)
		return;

	// Check for ctrl+left (web lookup)
	if (e.LeftDown() && e.GetModifiers() == wxMOD_CMD)
	{
		int pos = CharPositionFromPointClose(e.GetX(), e.GetY());
		string word = GetTextRange(WordStartPosition(pos, true), WordEndPosition(pos, true));

		if (!word.IsEmpty())
		{
			// TODO: Reimplement for word lists
			//// Check for keyword
			//if (language->isKeyword(word))
			//{
			//	string url = language->getKeywordLink();
			//	if (!url.IsEmpty())
			//	{
			//		url.Replace("%s", word);
			//		wxLaunchDefaultBrowser(url);
			//	}
			//}

			//// Check for constant
			//else if (language->isConstant(word))
			//{
			//	string url = language->getConstantLink();
			//	if (!url.IsEmpty())
			//	{
			//		url.Replace("%s", word);
			//		wxLaunchDefaultBrowser(url);
			//	}
			//}

			// Check for function
			if (language->isFunction(word))
			{
				string url = language->getFunctionLink();
				if (!url.IsEmpty())
				{
					url.Replace("%s", word);
					wxLaunchDefaultBrowser(url);
				}
			}

			hideCalltip();
		}
	}

	if (e.RightDown() || e.LeftDown())
		hideCalltip();
}
开发者ID:Gaerzi,项目名称:SLADE,代码行数:60,代码来源:TextEditor.cpp

示例12: OpenPoeditWeb

void PoeditApp::OpenPoeditWeb(const wxString& path)
{
    wxLaunchDefaultBrowser
    (
        wxString::Format("http://poedit.net%s?fromVersion=%s",
                         path,
                         GetAppVersion())
    );
}
开发者ID:mfloryan,项目名称:poedit,代码行数:9,代码来源:edapp.cpp

示例13: wxLaunchDefaultBrowser

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);
}
开发者ID:dxtravi,项目名称:e,代码行数:9,代码来源:BundleManager.cpp

示例14: fileName

/* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RUN_FREEROUTE
 */
void DIALOG_FREEROUTE::OnLaunchButtonClick( wxCommandEvent& event )
{
    wxString url;
    wxString command;
    wxFileName fileName( FindKicadFile( wxT( "freeroute.jnlp" ) ), wxPATH_UNIX );

    if( fileName.FileExists() )
    {
        wxString javaWebStartCommand = wxT( "javaws" );

        // Find the Java web start application on Windows.
#ifdef __WINDOWS__
        // If you thought the registry was brain dead before, now you have to deal with
        // accessing it in either 64 or 32 bit mode depending on the build version of
        // Windows and the build version of KiCad.

        // This key works for 32 bit Java on 32 bit Windows and 64 bit Java on 64 bit Windows.
        wxRegKey key( wxRegKey::HKLM, wxT( "SOFTWARE\\JavaSoft\\Java Web Start" ),
                      wxIsPlatform64Bit() ? wxRegKey::WOW64ViewMode_64 :
                      wxRegKey::WOW64ViewMode_Default );

        // It's possible that 32 bit Java is installed on 64 bit Windows.
        if( !key.Exists() && wxIsPlatform64Bit() )
            key.SetName( wxRegKey::HKLM, wxT( "SOFTWARE\\Wow6432Node\\JavaSoft\\Java Web Start" ) );

        if( !key.Exists() )
        {
            ::wxMessageBox( _( "It appears that the Java run time environment is not "
                               "installed on this computer.  Java is required to use "
                               "FreeRoute." ),
                            _( "Pcbnew Error" ), wxOK | wxICON_ERROR );
            return;
        }

        key.Open( wxRegKey::Read );

        // Get the current version of java installed to determine the executable path.
        wxString value;
        key.QueryValue( wxT( "CurrentVersion" ), value );
        key.SetName( key.GetName() + wxT( "\\" ) + value );
        key.QueryValue( wxT( "Home" ), value );
        javaWebStartCommand = value + wxFileName::GetPathSeparator() + javaWebStartCommand;
#endif

        // Wrap FullFileName in double quotes in case it has C:\Program Files in it.
        // The space is interpreted as an argument separator.
        command << javaWebStartCommand << wxChar( ' ' ) << wxChar( '"' )
                << fileName.GetFullPath() << wxChar( '"' );
        ProcessExecute( command );
        return;
    }

    url = m_FreerouteURLName->GetValue() + wxT( "/java/freeroute.jnlp" );

    wxLaunchDefaultBrowser( url );
}
开发者ID:james-sakalaukus,项目名称:kicad,代码行数:58,代码来源:dialog_freeroute_exchange.cpp

示例15: wxLaunchDefaultBrowser

void frmScanforDevices::OnHtmlwindow3LinkClicked(wxHtmlLinkEvent& event)
{
    if (event.GetLinkInfo().GetHref().StartsWith(_("http://"))) {
        wxLaunchDefaultBrowser(event.GetLinkInfo().GetHref());
        event.Skip(false);
        return;
    }

    event.Skip();
}
开发者ID:BlueAndi,项目名称:vscp_software,代码行数:10,代码来源:frmscanfordevices.cpp


注:本文中的wxLaunchDefaultBrowser函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。