这篇教程C++ wxGetHomeDir函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中wxGetHomeDir函数的典型用法代码示例。如果您正苦于以下问题:C++ wxGetHomeDir函数的具体用法?C++ wxGetHomeDir怎么用?C++ wxGetHomeDir使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了wxGetHomeDir函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: filevoid frmReport::OnBrowseFile(wxCommandEvent &ev){ if (rbHtml->GetValue()) {#ifdef __WXMSW__ wxFileDialog file(this, _("Select output filename"), wxGetHomeDir(), txtHtmlFile->GetValue(), _("HTML files (*.html)|*.html|All files (*.*)|*.*"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT);#else wxFileDialog file(this, _("Select output filename"), wxGetHomeDir(), txtHtmlFile->GetValue(), _("HTML files (*.html)|*.html|All files (*)|*"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT);#endif if (file.ShowModal() == wxID_OK) { txtHtmlFile->SetValue(file.GetPath()); OnChange(ev); } } else {#ifdef __WXMSW__ wxFileDialog file(this, _("Select output filename"), wxGetHomeDir(), txtXmlFile->GetValue(), _("XML files (*.xml)|*.xml|All files (*.*)|*.*"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT);#else wxFileDialog file(this, _("Select output filename"), wxGetHomeDir(), txtXmlFile->GetValue(), _("XML files (*.xml)|*.xml|All files (*)|*"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT);#endif if (file.ShowModal() == wxID_OK) { txtXmlFile->SetValue(file.GetPath()); OnChange(ev); } }}
开发者ID:apolyton,项目名称:pgadmin3,代码行数:35,
示例2: get_pluckerhome_directory// Looks up the root directory, as needed by get_plucker_directory.// Don't use this function directly, use a get_plucker_directory() instead.wxString get_pluckerhome_directory(){ wxString pluckerhome_directory; #if defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) bool pluckerhome_exists; pluckerhome_exists = wxGetEnv( wxT( "PLUCKERHOME" ), &pluckerhome_directory ); if ( ! pluckerhome_exists ) { pluckerhome_directory = wxGetHomeDir() << wxT( "/.plucker" ); }#endif #ifdef __WXMAC__ bool pluckerhome_exists; pluckerhome_exists = wxGetEnv( wxT( "PLUCKERHOME" ), &pluckerhome_directory ); if ( ! pluckerhome_exists ) { pluckerhome_directory = wxGetHomeDir() << wxT( "/Library/Plucker" ); }#endif #ifdef __WXMSW__ bool pluckerhome_exists; pluckerhome_exists = wxGetEnv( wxT( "PLUCKERHOME" ), &pluckerhome_directory ); if ( ! pluckerhome_exists ) { pluckerhome_directory = wxGetHomeDir() << wxT( "/Application Data/Plucker" ); }#endif return pluckerhome_directory;}
开发者ID:TimofonicJunkRoom,项目名称:plucker-1,代码行数:35,
示例3: wxGetCwdbool wxTerminal::CheckForCD( const wxString &command, wxString &path ){ if ( command.IsEmpty() ) return false; // Returning true tells caller there's nothing else to do if ( command.Left(2) != wxT("cd") ) return false; // Not a cd attempt so return false so that RunCommand takes over if ( wxIsalpha( command.GetChar(2) ) ) return false; // This must be a real command beginning with cd??? if ( command == wxT("cd.") || command == wxT("cd .") ) { path = wxGetCwd(); return true; } if ( command == wxT("cd") || command == wxT("cd~") || command == wxT("cd ~") ) { path = wxGetHomeDir(); return true; } else if ( command.Find(wxT("&&")) != wxNOT_FOUND ) { // a complex command: cd <somewhere> && ... return false; } else { // Otherwise it should be a real dir. Remove the initial cd, plus any white-space path = command.Mid( 2 ); path << wxFileName::GetPathSeparator(); path.Trim(false); wxFileName fn(path); fn.MakeAbsolute(m_workingDir); fn.Normalize(); if( fn.DirExists() ) { path = fn.GetFullPath(); return true; } return false; }}
开发者ID:RVictor,项目名称:EmbeddedLite,代码行数:34,
示例4: WXUNUSEDvoid MyFrame::FileOpenGeneric(wxCommandEvent& WXUNUSED(event) ){ wxGenericFileDialog dialog ( this, _T("Testing open file dialog"), wxEmptyString, wxEmptyString, _T("C++ files (*.cpp;*.h)|*.cpp;*.h") ); dialog.SetDirectory(wxGetHomeDir()); if (dialog.ShowModal() == wxID_OK) { wxString info; info.Printf(_T("Full file name: %s/n") _T("Path: %s/n") _T("Name: %s"), dialog.GetPath().c_str(), dialog.GetDirectory().c_str(), dialog.GetFilename().c_str()); wxMessageDialog dialog2(this, info, _T("Selected file")); dialog2.ShowModal(); }}
开发者ID:gitrider,项目名称:wxsj2,代码行数:26,
示例5: getPathAttachment/*This function transforms mnemonic pathes to real oneFor example %USERPROFILE%/MyBudget will be transformed to C:/Users/James/MyBudget*/const wxString mmex::getPathAttachment(const wxString &attachmentsFolder){ if (attachmentsFolder == wxEmptyString) return wxEmptyString; wxString AttachmentsFolder = attachmentsFolder; const wxString sep = wxFileName::GetPathSeparator(); const wxString LastDBPath = Model_Setting::instance().getLastDbPath(); const wxString& LastDBFolder = wxFileName::FileName(LastDBPath).GetPath() + sep; const wxString& UserFolder = mmex::GetUserDir(false).GetPath() + sep; if (attachmentsFolder.StartsWith(ATTACHMENTS_FOLDER_USERPROFILE, &AttachmentsFolder)) AttachmentsFolder.Prepend(wxGetHomeDir() + sep); else if (attachmentsFolder.StartsWith(ATTACHMENTS_FOLDER_DOCUMENTS, &AttachmentsFolder)) AttachmentsFolder.Prepend(wxStandardPaths::Get().GetDocumentsDir() + sep); else if (attachmentsFolder.StartsWith(ATTACHMENTS_FOLDER_DATABASE, &AttachmentsFolder)) AttachmentsFolder.Prepend(LastDBFolder); else if (attachmentsFolder.StartsWith(ATTACHMENTS_FOLDER_APPDATA, &AttachmentsFolder)) AttachmentsFolder.Prepend(UserFolder); if (AttachmentsFolder.Last() != sep) AttachmentsFolder.Append(sep); if (Model_Infotable::instance().GetBoolInfo("ATTACHMENTSSUBFOLDER", true)) AttachmentsFolder += wxString::Format("MMEX_%s_Attachments%s", wxFileName::FileName(LastDBPath).GetName(), sep); return AttachmentsFolder;}
开发者ID:omalleypat,项目名称:moneymanagerex,代码行数:31,
示例6: wxGetHomeDirvoid frmExport::OnBrowseFile(wxCommandEvent &ev){ wxString directory; wxString filename; if (txtFilename->GetValue().IsEmpty()) directory = wxGetHomeDir(); else { directory = wxFileName(txtFilename->GetValue()).GetPath(); filename = wxFileName(txtFilename->GetValue()).GetFullName(); }#ifdef __WXMSW__ wxFileDialog file(this, _("Select export filename"), directory, filename, _("CSV files (*.csv)|*.csv|Data files (*.dat)|*.dat|All files (*.*)|*.*"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT);#else wxFileDialog file(this, _("Select export filename"), directory, filename, _("CSV files (*.csv)|*.csv|Data files (*.dat)|*.dat|All files (*)|*"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT);#endif if (file.ShowModal() == wxID_OK) { txtFilename->SetValue(file.GetPath()); OnChange(ev); }}
开发者ID:lhcezar,项目名称:pgadmin3,代码行数:27,
示例7: wxASSERT_MSGbool wxSingleInstanceChecker::Create(const wxString& name, const wxString& path){ wxASSERT_MSG( !m_impl, wxT("calling wxSingleInstanceChecker::Create() twice?") ); // must have the file name to create a lock file wxASSERT_MSG( !name.empty(), wxT("lock file name can't be empty") ); m_impl = new wxSingleInstanceCheckerImpl; wxString fullname = path; if ( fullname.empty() ) { fullname = wxGetHomeDir(); } if ( fullname.Last() != wxT('/') ) { fullname += wxT('/'); } fullname << name; return m_impl->Create(fullname);}
开发者ID:70michal19,项目名称:dolphin,代码行数:26,
示例8: wxGetHomeDirvoid CGameListCtrl::BrowseForDirectory(){ wxString dirHome; wxGetHomeDir(&dirHome); // browse wxDirDialog dialog(this, _("Browse for a directory to add"), dirHome, wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST); if (dialog.ShowModal() == wxID_OK) { std::string sPath(dialog.GetPath().mb_str()); std::vector<std::string>::iterator itResult = std::find( SConfig::GetInstance().m_ISOFolder.begin(), SConfig::GetInstance().m_ISOFolder.end(), sPath); if (itResult == SConfig::GetInstance().m_ISOFolder.end()) { SConfig::GetInstance().m_ISOFolder.push_back(sPath); SConfig::GetInstance().SaveSettings(); } Update(); }}
开发者ID:Everscent,项目名称:dolphin-emu,代码行数:25,
示例9: wxGetHomeDirwxString wxGetHomeDir(){ wxString home; wxGetHomeDir(&home); return home;}
开发者ID:252525fb,项目名称:rpcs3,代码行数:7,
示例10: WXUNUSEDwxChar *wxGetUserHome(const wxString& WXUNUSED(user)){ // VZ: the old code here never worked for user != "" anyhow! Moreover, it // returned sometimes a malloc()'d pointer, sometimes a pointer to a // static buffer and sometimes I don't even know what. static wxString s_home; return (wxChar *)wxGetHomeDir(&s_home);}
开发者ID:252525fb,项目名称:rpcs3,代码行数:9,
示例11: dirvoid COptions::InitSettingsDir(){ wxFileName fn; wxString dir(GetOption(OPTION_DEFAULT_SETTINGSDIR)); if (!dir.empty()) { wxStringTokenizer tokenizer(dir, _T("///"), wxTOKEN_RET_EMPTY_ALL); dir = _T(""); while (tokenizer.HasMoreTokens()) { wxString token = tokenizer.GetNextToken(); if (token[0] == '$') { if (token[1] == '$') token = token.Mid(1); else { wxString value; if (wxGetEnv(token.Mid(1), &value)) token = value; } } dir += token; const wxChar delimiter = tokenizer.GetLastDelimiter(); if (delimiter) dir += delimiter; } fn = wxFileName(dir, _T("")); fn.Normalize(wxPATH_NORM_ALL, wxGetApp().GetDefaultsDir()); } else {#ifdef __WXMSW__ wxChar buffer[MAX_PATH * 2 + 1]; if (SUCCEEDED(SHGetFolderPath(0, CSIDL_APPDATA, 0, SHGFP_TYPE_CURRENT, buffer))) { fn = wxFileName(buffer, _T("")); fn.AppendDir(_T("FileZilla")); } else { // Fall back to directory where the executable is if (GetModuleFileName(0, buffer, MAX_PATH * 2)) fn = buffer; }#else fn = wxFileName(wxGetHomeDir(), _T("")); fn.AppendDir(_T(".filezilla"));#endif } if (!fn.DirExists()) wxMkdir(fn.GetPath(), 0700); SetOption(OPTION_DEFAULT_SETTINGSDIR, fn.GetPath());}
开发者ID:jplee,项目名称:MILF,代码行数:57,
示例12: wxGetUserHomewxString wxGetUserHome(const wxString& user){ wxString home; if (user.empty() || user == wxGetUserId()) wxGetHomeDir(&home); return home;}
开发者ID:yinglang,项目名称:newton-dynamics,代码行数:9,
示例13: DrawServervoid DrawApp::StartInstanceServer(FrameManager *frmmgr, ConfigManager *cfgmgr) { m_server = new DrawServer(frmmgr, cfgmgr); wxString service = wxGetHomeDir() + _T("/.draw3_socket"); if (m_server->Create(service) == false) { wxLogError(_T("Failed to start server")); delete m_server; }}
开发者ID:Strongc,项目名称:szarp,代码行数:10,
|