本文整理汇总了C++中Paths::GetLocaleRootPath方法的典型用法代码示例。如果您正苦于以下问题:C++ Paths::GetLocaleRootPath方法的具体用法?C++ Paths::GetLocaleRootPath怎么用?C++ Paths::GetLocaleRootPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Paths
的用法示例。
在下文中一共展示了Paths::GetLocaleRootPath方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnLinkClicked
//---------------------------------------------------------------------------------------
void BooksDlg::OnLinkClicked(wxHtmlLinkEvent& event)
{
const wxHtmlLinkInfo& link = event.GetLinkInfo();
wxString sLocation = link.GetHref();
//study guide
if (sLocation == "lenmus#study-guide")
{
HelpSystem* pHelp = m_appScope.get_help_controller();
pHelp->display_section(10101); //study-guide
//show_html_document("study-guide.htm");
return;
}
//verify if it is a LenMus command link
int iPos = sLocation.Find("lenmus#");
if (iPos == wxNOT_FOUND)
{
// external link
::wxLaunchDefaultBrowser(sLocation);
}
else
{
wxString filename = sLocation.substr(12);
Paths* pPaths = m_appScope.get_paths();
wxString sPath = pPaths->GetBooksPath();
wxFileName oFile(sPath, filename, wxPATH_NATIVE);
if (!oFile.FileExists())
{
//try to use the english version
sPath = pPaths->GetLocaleRootPath();
oFile.AssignDir(sPath);
oFile.AppendDir("en");
oFile.AppendDir("books");
oFile.SetFullName(filename);
if (!oFile.FileExists())
{
wxMessageBox(_("Sorry: File not found!"));
LOMSE_LOG_WARN(str(boost::format("File '%s' not found!")
% oFile.GetFullPath().wx_str() ));
return;
}
}
m_fullName = oFile.GetFullPath();
EndModal(wxID_OK);
}
}
示例2: ShowDocument
//---------------------------------------------------------------------------------------
void WelcomeWindow::ShowDocument(wxString& sDocName)
{
Paths* pPaths = m_appScope.get_paths();
wxString sPath = pPaths->GetLocalePath();
wxFileName oFile(sPath, sDocName, wxPATH_NATIVE);
if (!oFile.FileExists())
{
//try to display the english version
sPath = pPaths->GetLocaleRootPath();
oFile.AssignDir(sPath);
oFile.AppendDir("en");
oFile.SetFullName(sDocName);
if (!oFile.FileExists())
{
wxMessageBox(_("Sorry: File not found!"));
wxLogMessage("[WelcomeWindow::ShowDocument] File %s' not found!",
oFile.GetFullPath().wx_str() );
return;
}
}
::wxLaunchDefaultBrowser( oFile.GetFullPath() );
}
示例3: show_html_document
//---------------------------------------------------------------------------------------
void BooksDlg::show_html_document(const wxString& sDocName)
{
Paths* pPaths = m_appScope.get_paths();
wxString sPath = pPaths->GetLocalePath();
wxFileName oFile(sPath, sDocName, wxPATH_NATIVE);
if (!oFile.FileExists())
{
//try to display the english version
sPath = pPaths->GetLocaleRootPath();
oFile.AssignDir(sPath);
oFile.AppendDir("en");
oFile.SetFullName(sDocName);
if (!oFile.FileExists())
{
wxMessageBox(_("Sorry: File not found!"));
LOMSE_LOG_ERROR(str(boost::format("File %s' not found!")
% oFile.GetFullPath().wx_str() ));
return;
}
}
::wxLaunchDefaultBrowser( oFile.GetFullPath() );
}