summaryrefslogtreecommitdiffstats
path: root/Source/MFCDialog/PropertyList.cpp
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2001-06-05 21:26:48 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2001-06-05 21:26:48 (GMT)
commit9c149dda8124ed87ebcf381abf8723128bc5cfc8 (patch)
tree45eeeeefa5f6158f41c736bead519a6fe7f1e20b /Source/MFCDialog/PropertyList.cpp
parent8e281e5d5f1d59fc404f2cd694d4e871c001e3a1 (diff)
downloadCMake-9c149dda8124ed87ebcf381abf8723128bc5cfc8.zip
CMake-9c149dda8124ed87ebcf381abf8723128bc5cfc8.tar.gz
CMake-9c149dda8124ed87ebcf381abf8723128bc5cfc8.tar.bz2
ENH: add better path chooser dialog
Diffstat (limited to 'Source/MFCDialog/PropertyList.cpp')
-rw-r--r--Source/MFCDialog/PropertyList.cpp37
1 files changed, 6 insertions, 31 deletions
diff --git a/Source/MFCDialog/PropertyList.cpp b/Source/MFCDialog/PropertyList.cpp
index 407278e..903ca45 100644
--- a/Source/MFCDialog/PropertyList.cpp
+++ b/Source/MFCDialog/PropertyList.cpp
@@ -3,6 +3,7 @@
#include "stdafx.h"
#include "PropertyList.h"
+#include "PathDialog.h"
#include "../cmCacheManager.h"
#define IDC_PROPCMBBOX 712
@@ -366,20 +367,6 @@ void CPropertyList::OnCheckBox()
m_Dirty = true;
}
-// Insane Microsoft way of setting the initial directory
-// for the Shbrowseforfolder function...
-// SetSelProc
-// Callback procedure to set the initial selection of the browser.
-
-int CALLBACK SetSelProc( HWND hWnd, UINT uMsg, LPARAM lParam, LPARAM
- lpData )
-{
- if (uMsg==BFFM_INITIALIZED)
- {
- ::SendMessage(hWnd, BFFM_SETSELECTION, TRUE, lpData );
- }
- return 0;
-}
void CPropertyList::OnButton()
{
@@ -471,24 +458,12 @@ void CPropertyList::OnButton()
initialDir = currPath.Left(endSlash);
}
initialDir.Replace("/", "\\");
- char szPathName[4096];
- BROWSEINFO bi;
- bi.lpfn = SetSelProc;
- bi.lParam = (LPARAM)(LPCSTR) initialDir;
-
- bi.hwndOwner = m_hWnd;
- bi.pidlRoot = NULL;
- bi.pszDisplayName = (LPTSTR)szPathName;
- bi.lpszTitle = "Select Directory";
- bi.ulFlags = BIF_EDITBOX | BIF_RETURNONLYFSDIRS;
-
- LPITEMIDLIST pidl = SHBrowseForFolder(&bi);
-
- BOOL bSuccess = SHGetPathFromIDList(pidl, szPathName);
- CString SelectedFile;
- if(bSuccess)
+ CString title = "Setting Cache Value: ";
+ title += pItem->m_propName;
+ CPathDialog dlg("Select Path", title, initialDir);
+ if(dlg.DoModal()==IDOK)
{
- SelectedFile = szPathName;
+ CString SelectedFile = dlg.GetPathName();
m_btnCtrl.ShowWindow(SW_HIDE);
pItem->m_curValue = SelectedFile;
m_Dirty = true;