本文整理汇总了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());
}
示例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);
}
}
示例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);
}
示例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();
}
示例5: wxLaunchDefaultBrowser
void CConfigurationDialog::OnTextURLEvent(wxTextUrlEvent& event)
{
if(event.GetMouseEvent().LeftIsDown())
{
wxTextCtrl* pTextCtrl = (wxTextCtrl*)event.GetEventObject();
wxLaunchDefaultBrowser(pTextCtrl->GetRange(event.GetURLStart(), event.GetURLEnd()));
}
}
示例6: wxLaunchDefaultBrowser
void ZLauncherFrame::OnClickLink(wxWebViewEvent& evt)
{
// Open the link on the default browser
wxLaunchDefaultBrowser(evt.GetURL());
// Stop navigation
evt.Veto();
}
示例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 );
}
示例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;
}
示例9: init_static
void HelpButton::OpenPage(wxString const& pageID) {
init_static();
wxString page = (*pages)[pageID];
wxString section;
page = page.BeforeFirst('#', §ion);
wxLaunchDefaultBrowser(wxString::Format("http://docs.aegisub.org/3.1/%s/#%s", page, section));
}
示例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."));
}
示例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();
}
示例12: OpenPoeditWeb
void PoeditApp::OpenPoeditWeb(const wxString& path)
{
wxLaunchDefaultBrowser
(
wxString::Format("http://poedit.net%s?fromVersion=%s",
path,
GetAppVersion())
);
}
示例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);
}
示例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 );
}
示例15: wxLaunchDefaultBrowser
void frmScanforDevices::OnHtmlwindow3LinkClicked(wxHtmlLinkEvent& event)
{
if (event.GetLinkInfo().GetHref().StartsWith(_("http://"))) {
wxLaunchDefaultBrowser(event.GetLinkInfo().GetHref());
event.Skip(false);
return;
}
event.Skip();
}