这篇教程C++ wxFileNameFromPath函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中wxFileNameFromPath函数的典型用法代码示例。如果您正苦于以下问题:C++ wxFileNameFromPath函数的具体用法?C++ wxFileNameFromPath怎么用?C++ wxFileNameFromPath使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了wxFileNameFromPath函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: DlgAddNewCmdbool DnDialogFile::OnDropFiles(wxCoord, wxCoord, const wxArrayString& filenames){ //只有一个文件时弹出添加命令窗口 if (filenames.Count() == 1) { wxString cmd = filenames[0]; cmd.Replace('//','/'); DlgAddNewCmd* dlg=new DlgAddNewCmd(NULL); dlg->cmdLine->SetValue(cmd); dlg->cmdName->SetValue(wxFileNameFromPath(cmd)); cmd.Clear(); if (dlg->ShowModal() == wxID_OK) m_pOwner->ReLoadCmds(); dlg->Destroy(); return true; } //多个文件时自动批量添加; for(int i = filenames.Count() - 1 ; i>=0; --i) { wxString cmd = filenames[i]; cmd.Replace("//","/"); g_config->AddCmd(cmd,wxFileNameFromPath(cmd)); } m_pOwner->ReLoadCmds(); return true; //多个文件时自动批量添加;}
开发者ID:sunclx,项目名称:ALMRun,代码行数:27,
示例2: wxFileSelectorvoid Config::OnMpBrowse(wxCommandEvent& event){ wxConfig *config = (wxConfig *)wxConfig::Get(); wxString dd; config->Read(wxT("maxima"), &dd);#if defined __WXMSW__ wxString file = wxFileSelector(_("Select Maxima program"), wxPathOnly(dd), wxFileNameFromPath(dd), wxEmptyString, _("Bat files (*.bat)|*.bat|All|*"), wxFD_OPEN);#else wxString file = wxFileSelector(_("Select Maxima program"), wxPathOnly(dd), wxFileNameFromPath(dd), wxEmptyString, _("All|*"), wxFD_OPEN);#endif if (file.Length()) { if (file.Right(8) == wxT("wxmaxima") || file.Right(12) == wxT("wxmaxima.exe") || file.Right(12) == wxT("wxMaxima.exe")) wxMessageBox(_("Invalid entry for Maxima program./n/nPlease enter the path to Maxima program again."), _("Error"), wxOK|wxICON_ERROR); else m_maximaProgram->SetValue(file); }}
开发者ID:benibela,项目名称:wxmaxima,代码行数:28,
示例3: SetTitlevoid cbDiffEditor::updateTitle(){ //SetTitle(...) calls Manager::Get()->GetEditorManager() which can fail during shutdown if(!Manager::Get()->IsAppShuttingDown()) SetTitle(_T("Diff: ") + (diffctrl_->LeftModified() ? _("*") : _("")) + wxFileNameFromPath(leftFile_) + _T(" ") + (diffctrl_->RightModified() ? _("*") : _("")) + wxFileNameFromPath(rightFile_));}
开发者ID:danselmi,项目名称:cbDiff,代码行数:9,
示例4: fnamevoid wxFileCtrl::GoToParentDir(){ if (!IsTopMostDir(m_dirName)) { size_t len = m_dirName.Len(); if (wxEndsWithPathSeparator(m_dirName)) m_dirName.Remove( len-1, 1 ); wxString fname( wxFileNameFromPath(m_dirName) ); m_dirName = wxPathOnly( m_dirName );#if defined(__DOS__) || defined(__WINDOWS__) || defined(__OS2__) if (!m_dirName.empty()) { if (m_dirName.Last() == wxT('.')) m_dirName = wxEmptyString; }#elif defined(__UNIX__) if (m_dirName.empty()) m_dirName = wxT("/");#endif UpdateFiles(); long id = FindItem( 0, fname ); if (id != wxNOT_FOUND) { ignoreChanges = true; SetItemState( id, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED ); EnsureVisible( id ); ignoreChanges = false; } }}
开发者ID:BackupTheBerlios,项目名称:wxbeos-svn,代码行数:30,
示例5: matchFileName//普通匹配文件名bool ThreadWork::matchFileName( wxString &path ){ if( wxFileNameFromPath( path ).Find(parItems[1]) != wxNOT_FOUND ) return true; return false;}
开发者ID:mrwid,项目名称:KumquatRoot2,代码行数:8,
示例6: wxFileSelectorvoid MyFrame::OnSnapshotToBMP(wxCommandEvent &){ wxString filename = wxFileSelector( wxT("Save Image"), wxPathOnly(m_bmp_filename), wxFileNameFromPath(m_bmp_filename), wxT("*.bmp"), wxT("BMP files (*.bmp)|*.bmp"), wxFD_SAVE|wxFD_OVERWRITE_PROMPT, this); if (filename == wxEmptyString) { SetupVideoMenus(); return; } wxString extension = filename.AfterLast('.').Lower(); if (m_captureMenu->IsChecked(ID_NOPREVIEWONCAP)) { m_vidCapWin->Preview(false); m_vidCapWin->Overlay(false); } bool saved = false; if (extension == wxT("bmp")) saved = m_vidCapWin->SnapshotToBMP( filename ); if (saved) m_bmp_filename = filename; SetupVideoMenus();}
开发者ID:stahta01,项目名称:wxCode_components,代码行数:33,
示例7: wxFindFirstFilewxString wxFindFirstFile(const wxString& spec, int flags){ wxFileName::SplitPath(spec, &gs_dirPath, NULL, NULL); if ( gs_dirPath.empty() ) gs_dirPath = wxT("."); if ( !wxEndsWithPathSeparator(gs_dirPath ) ) gs_dirPath << wxFILE_SEP_PATH; gs_dir.reset(new wxDir(gs_dirPath)); if ( !gs_dir->IsOpened() ) { wxLogSysError(_("Cannot enumerate files '%s'"), spec); return wxEmptyString; } int dirFlags; switch (flags) { case wxDIR: dirFlags = wxDIR_DIRS; break; case wxFILE: dirFlags = wxDIR_FILES; break; default: dirFlags = wxDIR_DIRS | wxDIR_FILES; break; } wxString result; gs_dir->GetFirst(&result, wxFileNameFromPath(spec), dirFlags); if ( result.empty() ) return result; return gs_dirPath + result;}
开发者ID:mheinsen,项目名称:wxWidgets,代码行数:31,
示例8: filenamevoid DeviceFrame::OnDeviceOpenSound(wxCommandEvent &) { wxString filename(GetSoundFile()); if (filename.empty()) { return; } audiere::SampleSourcePtr source = audiere::OpenSampleSource(wxString2CStr(filename)); if (!source) { wxMessageBox( wxT("Could not open source: ") + filename, wxT("Open Sound"), wxOK | wxCENTRE, this); return; } audiere::OutputStreamPtr stream = audiere::OpenSound(m_device, source); if (!stream) { wxMessageBox( wxT("Could not open sound: ") + filename, wxT("Open Sound"), wxOK | wxCENTRE, this); return; } // get the basename of the path for the window title wxString basename = wxFileNameFromPath(filename); new StreamFrame(this, wxT("Sound: ") + basename, stream.get(), source.get());}
开发者ID:NovaCygni,项目名称:aur-mirror,代码行数:26,
示例9: ChooseInputFilevoid ChooseInputFile(bool force){#if wxUSE_FILEDLG if (force || InputFile.empty()) { wxString s = wxFileSelector(_T("Choose LaTeX input file"), wxPathOnly(InputFile), wxFileNameFromPath(InputFile), _T("tex"), _T("*.tex")); if (!s.empty()) { // Different file, so clear index entries. ClearKeyWordTable(); ResetContentsLevels(0); passNumber = 1; errorCount = 0; InputFile = s; wxString str = wxFileNameFromPath(InputFile); wxString buf; buf.Printf(_T("Tex2RTF [%s]"), str.c_str()); frame->SetTitle((wxChar *)buf.c_str()); OutputFile = wxEmptyString; } }#else wxUnusedVar(force);#endif // wxUSE_FILEDLG}
开发者ID:BackupTheBerlios,项目名称:wxbeos-svn,代码行数:26,
示例10: switch// Update the column content of the item at _Indexvoid CGameListCtrl::UpdateItemAtColumn(long _Index, int column){ GameListItem& rISOFile = *m_ISOFiles[_Index]; switch(column) { case COLUMN_PLATFORM: { SetItemColumnImage(_Index, COLUMN_PLATFORM, m_PlatformImageIndex[rISOFile.GetPlatform()]); break; } case COLUMN_BANNER: { int ImageIndex = -1; if (rISOFile.GetBitmap().IsOk()) ImageIndex = m_imageListSmall->Add(rISOFile.GetBitmap()); SetItemColumnImage(_Index, COLUMN_BANNER, ImageIndex); break; } case COLUMN_TITLE: { wxString name = StrToWxStr(rISOFile.GetName()); int disc_number = rISOFile.GetDiscNumber() + 1; if (disc_number > 1 && name.Lower().find(wxString::Format("disc %i", disc_number)) == std::string::npos && name.Lower().find(wxString::Format("disc%i", disc_number)) == std::string::npos) { name = wxString::Format(_("%s (Disc %i)"), name.c_str(), disc_number); } SetItem(_Index, COLUMN_TITLE, name, -1); break; } case COLUMN_MAKER: SetItem(_Index, COLUMN_MAKER, StrToWxStr(rISOFile.GetCompany()), -1); break; case COLUMN_FILENAME: SetItem(_Index, COLUMN_FILENAME, wxFileNameFromPath(StrToWxStr(rISOFile.GetFileName())), -1); break; case COLUMN_EMULATION_STATE: SetItemColumnImage(_Index, COLUMN_EMULATION_STATE, m_EmuStateImageIndex[rISOFile.GetEmuState()]); break; case COLUMN_COUNTRY: SetItemColumnImage(_Index, COLUMN_COUNTRY, m_FlagImageIndex[rISOFile.GetCountry()]); break; case COLUMN_SIZE: SetItem(_Index, COLUMN_SIZE, NiceSizeFormat(rISOFile.GetFileSize()), -1); break; case COLUMN_ID: SetItem(_Index, COLUMN_ID, rISOFile.GetUniqueID(), -1); break; }}
开发者ID:LordNed,项目名称:dolphin,代码行数:61,
示例11: docTitlevoid ecConfigToolView::OnChangeFilename(){ if (wxGetApp().GetTopWindow() && GetDocument()) { wxString docTitle(wxFileNameFromPath(GetDocument()->GetFilename())); wxStripExtension(docTitle); GetDocument()->SetTitle(docTitle); wxString name(GetDocument()->GetFilename()); wxStripExtension(name); ((ecConfigToolDoc*) GetDocument())->SetInstallTree(name + wxT("_install")); ((ecConfigToolDoc*) GetDocument())->SetBuildTree(name + wxT("_build")); wxString title; wxString modifiedMarker; if (GetDocument()->IsModified()) modifiedMarker = wxT("*"); title = docTitle + modifiedMarker + wxString(wxT(" - ")) + wxGetApp().GetSettings().GetAppName(); ((wxFrame*) wxGetApp().GetTopWindow())->SetTitle(title); }}
开发者ID:Robertysc,项目名称:ecos,代码行数:25,
示例12: wxFileNameFromPathbool TranslationMemoryUpdater::Update(const wxArrayString& files){ m_progress->SetGaugeMax((int)files.GetCount()); m_progress->ResetGauge(); bool res = true; wxString f; size_t cnt = files.GetCount(); for (size_t i = 0; i < cnt; i++) { f = files[i]; m_progress->UpdateMessage(wxString(_("Scanning file: ")) + wxFileNameFromPath(f)); if (f.Matches("*.po")) res = UpdateFromPO(f); else if (f.Matches("*.mo")) res = UpdateFromMO(f);#if HAVE_RPM else if (f.Matches("*.rpm")) res = UpdateFromRPM(f);#endif m_progress->UpdateGauge(); wxYield(); if (m_progress->Cancelled()) return false; } return res;}
开发者ID:AdeebNqo,项目名称:poedit,代码行数:29,
示例13: WXUNUSED void MainFrame::OnMenuCompile(wxCommandEvent& WXUNUSED(e)) { TerminalWidget* terminalWidget = static_cast<TerminalWidget*>(m_mgr.GetPane("pane_output").window); wxString executablePath = wxStandardPaths::Get().GetExecutablePath(); wxString executableDir = wxPathOnly(executablePath); wxString compilerPath = wxPathOnly(executableDir) + "//TDM-GCC-32//bin//"; if (!wxFileExists(compilerPath + "g++.exe")) compilerPath = executableDir + "//TDM-GCC-32//bin//"; if (!wxFileExists(compilerPath + "g++.exe")) { wxMessageBox("Error, cannot find the compiler. Are you sure there is " "'TDM-GCC-32' folder in '" + executableDir + "' ?", "SimplyCpp error", wxICON_ERROR, this); return; } wxExecuteEnv env; env.cwd = wxPathOnly(((EditorWidget*)m_notebook->GetCurrentPage())->GetFileName()); env.env.insert(wxStringToStringHashMap_wxImplementation_Pair("PATH", compilerPath)); wxString fileName = wxFileNameFromPath(((EditorWidget*)m_notebook->GetCurrentPage())->GetFileName()); wxString exeName = wxString(fileName); exeName.Replace(".cpp", ".exe"); terminalWidget->RunCommand(compilerPath + "g++.exe " + fileName + " -s -o " + exeName, env); }
开发者ID:Aceix,项目名称:SimplyCpp,代码行数:29,
示例14: wxFileNameFromPath// Return just the filename, not the path (basename)wxChar *wxFileNameFromPath (wxChar *path){ wxString p = path; wxString n = wxFileNameFromPath(p); return path + p.length() - n.length();}
开发者ID:mheinsen,项目名称:wxWidgets,代码行数:8,
示例15: OpenPaintMDIChildFramevoid SubMainFrame::OpenFile(wxString strFilename){ OpenPaintMDIChildFrame *childFrame = new OpenPaintMDIChildFrame(this, wxID_ANY, wxFileNameFromPath(strFilename)); if(childFrame && childFrame->Open(strFilename)) { AddFileToHistory(strFilename); wxLogDebug(wxT("Opened file: %s") , strFilename); }}
开发者ID:murdockq,项目名称:OpenPaint,代码行数:9,
示例16: wxTwxString wxcXmlResourceCmp::GetInternalFileName(const wxString& name, const wxArrayString& flist){ wxString name2 = name; name2.Replace(wxT(":"), wxT("_")); name2.Replace(wxT("/"), wxT("_")); name2.Replace(wxT("//"), wxT("_")); name2.Replace(wxT("*"), wxT("_")); name2.Replace(wxT("?"), wxT("_")); wxString s = wxFileNameFromPath(m_outputCppFile) + wxT("$") + name2; if(wxFileExists(s) && flist.Index(s) == wxNOT_FOUND) { for(int i = 0;; i++) { s.Printf(wxFileNameFromPath(m_outputCppFile) + wxT("$%03i-") + name2, i); if(!wxFileExists(s) || flist.Index(s) != wxNOT_FOUND) break; } } return s;}
开发者ID:eranif,项目名称:codelite,代码行数:19,
示例17: re///正则方式匹配文件名bool ThreadWork::regexMatchFileName( wxString &path ){ wxRegEx re( parItems[1], wxRE_ADVANCED ); if( !re.IsValid() ) return false; if( re.Matches( wxFileNameFromPath( path ) ) ) return true; return false;}
开发者ID:mrwid,项目名称:KumquatRoot2,代码行数:12,
示例18: wxFileNameFromPathwxString AudacityProject::GetName(){ wxString name = wxFileNameFromPath(mFileName); // Chop off the extension int len = name.Len(); if (len > 4 && name.Mid(len - 4) == ".aup") name = name.Mid(0, len - 4); return name;}
开发者ID:ruthmagnus,项目名称:audacity,代码行数:11,
示例19: WXUNUSEDvoid MyFrame::OnViewLatex(wxCommandEvent& WXUNUSED(event)){ ChooseInputFile(); if (!InputFile.empty() && wxFileExists(InputFile)) { textWindow->LoadFile(InputFile); wxChar buf[300]; wxString str(wxFileNameFromPath(OutputFile)); wxSnprintf(buf, sizeof(buf), _T("Tex2RTF [%s]"), (const wxChar*) str.c_str()); frame->SetTitle(buf); }}
开发者ID:BackupTheBerlios,项目名称:wxbeos-svn,代码行数:12,
示例20: ifvoid Properties::onPropertyChanging(wxPropertyGridEvent& event, Map* map){ if (event.GetPropertyName() == "Name") { map->setName(event.GetValue().GetString().c_str()); } else if (event.GetPropertyName() == "Texture") { map->setTexture(wxFileNameFromPath(event.GetValue().GetString()).c_str()); } City::getSingleton().updateViews(map);}
开发者ID:wojciech-holisz,项目名称:3d-city,代码行数:13,
示例21: wxGetApp/*** This method is responsible for setting everything up in the doc/view framework* and opening the request file for editing in a new notebook tab.* @param path Path to the filename being opened*/void HtMainFrame::DoOpenFile (const wxString &path){ wxDocManager *docm = wxGetApp().doc_manager.get(); // TODO: fazer as checagens no arquivo antes de tentar abrir. // Ex: verificar se ele pode ser aberto como leitura/escrita, se o usuário tem permiss C++ wxFocusEventHandler函数代码示例 C++ wxFileName函数代码示例
|