本文整理汇总了C++中CBrowseFolder类的典型用法代码示例。如果您正苦于以下问题:C++ CBrowseFolder类的具体用法?C++ CBrowseFolder怎么用?C++ CBrowseFolder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CBrowseFolder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MessageBox
void CCloneDlg::OnBnClickedCloneBrowseUrl()
{
CBrowseFolder browseFolder;
browseFolder.m_style = BIF_EDITBOX | BIF_NEWDIALOGSTYLE | BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS;
CString strCloneDirectory;
int sel = (int)this->m_BrowseUrl.GetCurrentEntry();
this->m_regBrowseUrl = sel;
if( sel == 1 )
{
CString str;
m_URLCombo.GetWindowText(str);
str.Trim();
if (str.IsEmpty())
{
CMessageBox::Show(GetSafeHwnd(), IDS_PROC_CLONE_URLDIREMPTY, IDS_APPNAME, MB_ICONERROR);
return;
}
if (CAppUtils::ExploreTo(GetSafeHwnd(), str) && (int)ShellExecute(nullptr, _T("open"), str, nullptr, nullptr, SW_SHOW) <= 32)
MessageBox(CFormatMessageWrapper(), _T("TortoiseGit"), MB_ICONERROR);
return;
}
this->m_URLCombo.GetWindowTextW(strCloneDirectory);
if (browseFolder.Show(GetSafeHwnd(), strCloneDirectory) == CBrowseFolder::OK)
{
this->m_URLCombo.SetWindowTextW(strCloneDirectory);
}
}
示例2: OnBnClickedDirectorybrowse
void COpenDlg::OnBnClickedDirectorybrowse()
{
CBrowseFolder folderBrowser;
UpdateData();
folderBrowser.m_style = BIF_EDITBOX | BIF_NEWDIALOGSTYLE | BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS;
folderBrowser.Show(GetSafeHwnd(), m_sPatchDirectory, m_sPatchDirectory);
UpdateData(FALSE);
}
示例3: OnBnClickedChooseButton
void CFileSearchDlg::OnBnClickedChooseButton()
{
CBrowseFolder dlg;
CString path;
m_DirectoryEdit.GetWindowText(path);
if (dlg.Show(m_hWnd, path, path) == CBrowseFolder::retVal::OK) {
m_DirectoryEdit.SetWindowText(path);
}
}
示例4: GetDlgItemText
void CSetBugTraqAdv::OnBnClickedBugTraqbrowse()
{
CBrowseFolder browser;
CString sPath;
GetDlgItemText(IDC_BUGTRAQPATH, sPath);
browser.SetInfo(CString(MAKEINTRESOURCE(IDS_SETTINGS_BUGTRAQ_SELECTFOLDERPATH)));
browser.m_style = BIF_EDITBOX | BIF_NEWDIALOGSTYLE | BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS;
if (browser.Show(m_hWnd, sPath) == CBrowseFolder::OK)
SetDlgItemText(IDC_BUGTRAQPATH, sPath);
}
示例5: OnRepBrowse
void CSubmoduleAddDlg::OnRepBrowse()
{
CBrowseFolder browseFolder;
browseFolder.m_style = BIF_EDITBOX | BIF_NEWDIALOGSTYLE | BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS;
CString strDirectory;
this->m_Repository.GetWindowTextW(strDirectory);
if (browseFolder.Show(GetSafeHwnd(), strDirectory) == CBrowseFolder::OK)
{
this->m_Repository.SetWindowTextW(strDirectory);
}
}
示例6: OnPathBrowse
void CSubmoduleAddDlg::OnPathBrowse()
{
CBrowseFolder browseFolder;
browseFolder.m_style = BIF_EDITBOX | BIF_NEWDIALOGSTYLE | BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS;
CString strDirectory;
this->m_PathCtrl.GetWindowTextW(strDirectory);
if (browseFolder.Show(GetSafeHwnd(), strDirectory,g_Git.m_CurrentDir) == CBrowseFolder::OK)
{
this->m_PathCtrl.SetWindowTextW(strDirectory);
}
}
示例7: OnBnClickedCloneDirBrowse
void CCloneDlg::OnBnClickedCloneDirBrowse()
{
CBrowseFolder browseFolder;
browseFolder.m_style = BIF_EDITBOX | BIF_NEWDIALOGSTYLE | BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS;
CString strCloneDirectory = this->m_Directory;
if (browseFolder.Show(GetSafeHwnd(), strCloneDirectory) == CBrowseFolder::OK)
{
UpdateData(TRUE);
m_Directory = strCloneDirectory;
UpdateData(FALSE);
}
}
示例8: OnBnClickedBrowsecheckoutpath
void CSetDialogs::OnBnClickedBrowsecheckoutpath()
{
CBrowseFolder browser;
browser.m_style = BIF_EDITBOX | BIF_NEWDIALOGSTYLE | BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS;
CString strCheckoutDirectory;
if (browser.Show(GetSafeHwnd(), strCheckoutDirectory) == CBrowseFolder::OK)
{
UpdateData(TRUE);
m_sDefaultCheckoutPath = strCheckoutDirectory;
UpdateData(FALSE);
SetModified();
}
}
示例9: OnBnClickedButtonDir
void CFormatPatchDlg::OnBnClickedButtonDir()
{
CBrowseFolder browseFolder;
browseFolder.m_style = BIF_EDITBOX | BIF_NEWDIALOGSTYLE | BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS;
CString strCloneDirectory;
this->UpdateData(TRUE);
strCloneDirectory=m_Dir;
if (browseFolder.Show(GetSafeHwnd(), strCloneDirectory) == CBrowseFolder::OK)
{
m_Dir=strCloneDirectory;
this->UpdateData(FALSE);
}
}
示例10: UpdateData
void CSetHooksAdv::OnBnClickedHookbrowse()
{
UpdateData();
CBrowseFolder browser;
CString sPath;
browser.SetInfo(CString(MAKEINTRESOURCE(IDS_SETTINGS_HOOKS_SELECTFOLDERPATH)));
browser.m_style = BIF_EDITBOX | BIF_NEWDIALOGSTYLE | BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS;
if (browser.Show(m_hWnd, sPath) == CBrowseFolder::OK)
{
m_sPath = sPath;
UpdateData(FALSE);
}
}
示例11: OnBrowseDir
void CSetMainPage::OnBrowseDir()
{
CBrowseFolder browseFolder;
browseFolder.m_style = BIF_EDITBOX | BIF_NEWDIALOGSTYLE | BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS;
CString dir;
this->UpdateData(TRUE);
dir=this->m_sMsysGitPath;
if (browseFolder.Show(GetSafeHwnd(), dir) == CBrowseFolder::OK)
{
m_sMsysGitPath=dir;
this->UpdateData(FALSE);
OnMsysGitPathModify();
}
SetModified(TRUE);
}
示例12: OnBnClickedCheckoutdirectoryBrowse
void CExportDlg::OnBnClickedCheckoutdirectoryBrowse()
{
m_tooltips.Pop(); // hide the tooltips
//
// Create a folder browser dialog. If the user selects OK, we should update
// the local data members with values from the controls, copy the checkout
// directory from the browse folder, then restore the local values into the
// dialog controls.
//
CBrowseFolder browseFolder;
browseFolder.m_style = BIF_EDITBOX | BIF_NEWDIALOGSTYLE | BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS;
CString strCheckoutDirectory = m_strExportDirectory;
if (browseFolder.Show(GetSafeHwnd(), strCheckoutDirectory) == CBrowseFolder::OK)
{
UpdateData(TRUE);
m_strExportDirectory = strCheckoutDirectory;
m_sExportDirOrig = m_strExportDirectory;
m_bAutoCreateTargetName = !(PathIsDirectoryEmpty(m_sExportDirOrig) || !PathFileExists(m_sExportDirOrig));
UpdateData(FALSE);
DialogEnableWindow(IDOK, !m_strExportDirectory.IsEmpty());
}
}
示例13: ShellExecute
void CCloneDlg::OnBnClickedCloneBrowseUrl()
{
CBrowseFolder browseFolder;
browseFolder.m_style = BIF_EDITBOX | BIF_NEWDIALOGSTYLE | BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS;
CString strCloneDirectory;
int sel = (int)this->m_BrowseUrl.GetCurrentEntry();
this->m_regBrowseUrl = sel;
if( sel == 1 )
{
CString str;
m_URLCombo.GetWindowText(str);
ShellExecute(NULL, _T("open"), str.Trim(), NULL,NULL, SW_SHOW);
return ;
}
this->m_URLCombo.GetWindowTextW(strCloneDirectory);
if (browseFolder.Show(GetSafeHwnd(), strCloneDirectory) == CBrowseFolder::OK)
{
this->m_URLCombo.SetWindowTextW(strCloneDirectory);
}
}
示例14: switch
//.........这里部分代码省略.........
{
int index = m_cFileList.GetNextSelectedItem(pos);
CString cmd = _T("/command:log");
cmd += _T(" /path:\"")+m_arFilteredList[index]->GetWinPathString()+_T("\" ");
cmd += _T(" /endrev:")+m_rev1.m_CommitHash.ToString();
CAppUtils::RunTortoiseProc(cmd);
}
}
break;
case ID_SAVEAS:
{
if (m_cFileList.GetSelectedCount() > 0)
{
CString temp;
CTGitPath savePath;
CString pathSave;
if (!CAppUtils::FileOpenSave(pathSave, NULL, IDS_REPOBROWSE_SAVEAS, IDS_COMMONFILEFILTER, false, m_hWnd))
{
break;
}
savePath = CTGitPath(pathSave);
// now open the selected file for writing
try
{
CStdioFile file(savePath.GetWinPathString(), CFile::typeBinary | CFile::modeReadWrite | CFile::modeCreate);
// temp.Format(IDS_FILEDIFF_CHANGEDLISTINTRO, (LPCTSTR)m_path1.GetGitPathString(), (LPCTSTR)m_rev1.ToString(), (LPCTSTR)m_path2.GetGitPathString(), (LPCTSTR)m_rev2.ToString());
file.WriteString(temp + _T("\n"));
POSITION pos = m_cFileList.GetFirstSelectedItemPosition();
while (pos)
{
int index = m_cFileList.GetNextSelectedItem(pos);
CTGitPath* fd = m_arFilteredList[index];
file.WriteString(fd->GetGitPathString());
file.WriteString(_T("\n"));
}
file.Close();
}
catch (CFileException* pE)
{
pE->ReportError();
}
}
}
break;
case ID_CLIPBOARD_PATH:
{
CopySelectionToClipboard();
}
break;
case ID_CLIPBOARD_ALL:
{
CopySelectionToClipboard(TRUE);
}
break;
case ID_EXPORT:
{
// export all changed files to a folder
CBrowseFolder browseFolder;
browseFolder.m_style = BIF_EDITBOX | BIF_NEWDIALOGSTYLE | BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS;
if (browseFolder.Show(GetSafeHwnd(), m_strExportDir) == CBrowseFolder::OK)
{
POSITION pos = m_cFileList.GetFirstSelectedItemPosition();
while (pos)
{
int index = m_cFileList.GetNextSelectedItem(pos);
CTGitPath* fd = m_arFilteredList[index];
// we cannot export directories or folders
if (fd->m_Action == CTGitPath::LOGACTIONS_DELETED || fd->IsDirectory())
continue;
CAppUtils::CreateMultipleDirectory(m_strExportDir + _T("\\") + fd->GetDirectory().GetWinPathString());
CString filename = m_strExportDir + _T("\\") + fd->GetWinPathString();
if(m_rev1.m_CommitHash.ToString() == GIT_REV_ZERO)
{
if(!CopyFile(g_Git.m_CurrentDir + _T("\\") + fd->GetWinPath(), filename, false))
{
MessageBox(CFormatMessageWrapper(), _T("TortoiseGit"), MB_OK | MB_ICONERROR);
return;
}
}
else
{
if(g_Git.GetOneFile(m_rev1.m_CommitHash, *fd, filename))
{
CString out;
out.Format(_T("Fail checkout one file %s;%s"), m_rev1.m_CommitHash.ToString(), fd->GetWinPath());
CMessageBox::Show(NULL, out, _T("TortoiseGit"), MB_OK);
return;
}
}
}
}
}
break;
}
}
}
示例15: switch
//.........这里部分代码省略.........
}
break;
case ID_UNIFIEDDIFF:
{
CTSVNPath diffFile = CTempFiles::Instance().GetTempFilePath(false);
POSITION pos = m_cFileList.GetFirstSelectedItemPosition();
while (pos)
{
int index = m_cFileList.GetNextSelectedItem(pos);
CFileDiffDlg::FileDiff fd = m_arFilteredList[index];
CTSVNPath url1 = CTSVNPath(m_path1.GetSVNPathString() + _T("/") + fd.path.GetSVNPathString());
CTSVNPath url2 = m_bDoPegDiff ? url1 : CTSVNPath(m_path2.GetSVNPathString() + _T("/") + fd.path.GetSVNPathString());
if (m_bDoPegDiff)
{
PegDiff(url1, m_peg, m_rev1, m_rev2, CTSVNPath(), m_depth, m_bIgnoreancestry, false, true, CString(), true, diffFile);
}
else
{
Diff(url1, m_rev1, url2, m_rev2, CTSVNPath(), m_depth, m_bIgnoreancestry, false, true, CString(), true, diffFile);
}
}
CAppUtils::StartUnifiedDiffViewer(diffFile, CString(), false);
}
break;
case ID_BLAME:
{
POSITION pos = m_cFileList.GetFirstSelectedItemPosition();
while (pos)
{
int index = m_cFileList.GetNextSelectedItem(pos);
DoDiff(index, true);
}
}
break;
case ID_SAVEAS:
if (m_cFileList.GetSelectedCount() > 0)
{
CTSVNPath savePath;
CString pathSave;
if (!CAppUtils::FileOpenSave(pathSave, NULL, IDS_REPOBROWSE_SAVEAS, IDS_COMMONFILEFILTER, false, m_hWnd))
{
break;
}
savePath = CTSVNPath(pathSave);
// now open the selected file for writing
try
{
CStdioFile file(savePath.GetWinPathString(), CFile::typeBinary | CFile::modeReadWrite | CFile::modeCreate);
CString temp;
temp.FormatMessage(IDS_FILEDIFF_CHANGEDLISTINTRO, (LPCTSTR)m_path1.GetSVNPathString(), (LPCTSTR)m_rev1.ToString(), (LPCTSTR)m_path2.GetSVNPathString(), (LPCTSTR)m_rev2.ToString());
file.WriteString(temp + _T("\n"));
POSITION pos = m_cFileList.GetFirstSelectedItemPosition();
while (pos)
{
int index = m_cFileList.GetNextSelectedItem(pos);
FileDiff fd = m_arFilteredList[index];
file.WriteString(fd.path.GetSVNPathString());
file.WriteString(_T("\n"));
}
file.Close();
}
catch (CFileException* pE)
{
pE->ReportError();
pE->Delete();
}
}
break;
case ID_CLIPBOARD:
CopySelectionToClipboard();
break;
case ID_EXPORT:
{
// export all changed files to a folder
CBrowseFolder browseFolder;
browseFolder.m_style = BIF_EDITBOX | BIF_NEWDIALOGSTYLE | BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS;
if (browseFolder.Show(GetSafeHwnd(), m_strExportDir) == CBrowseFolder::OK)
{
m_arSelectedFileList.RemoveAll();
POSITION pos = m_cFileList.GetFirstSelectedItemPosition();
while (pos)
{
int index = m_cFileList.GetNextSelectedItem(pos);
CFileDiffDlg::FileDiff fd = m_arFilteredList[index];
m_arSelectedFileList.Add(fd);
}
m_pProgDlg = new CProgressDlg();
InterlockedExchange(&m_bThreadRunning, TRUE);
if (AfxBeginThread(ExportThreadEntry, this)==NULL)
{
InterlockedExchange(&m_bThreadRunning, FALSE);
OnCantStartThread();
}
}
}
break;
}
}