[CHANGE_BEHAVIOUR] Set current working directory in browser, if Find in files combo is empty.
git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@436 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
22cae478e8
commit
c81c6ab82a
|
@ -58,7 +58,7 @@ void writeLog(const TCHAR *logFileName, const char *log2write)
|
|||
fclose(f);
|
||||
}
|
||||
|
||||
void folderBrowser(HWND parent, int outputCtrlID)
|
||||
void folderBrowser(HWND parent, int outputCtrlID, const TCHAR *defaultStr)
|
||||
{
|
||||
// This code was copied and slightly modifed from:
|
||||
// http://www.bcbdev.com/faqs/faq62.htm
|
||||
|
@ -83,6 +83,9 @@ void folderBrowser(HWND parent, int outputCtrlID)
|
|||
info.lpfn = BrowseCallbackProc;
|
||||
TCHAR directory[MAX_PATH];
|
||||
::GetDlgItemText(parent, outputCtrlID, directory, sizeof(directory));
|
||||
if (!directory[0] && defaultStr)
|
||||
info.lParam = reinterpret_cast<LPARAM>(defaultStr);
|
||||
else
|
||||
info.lParam = reinterpret_cast<LPARAM>(directory);
|
||||
|
||||
// Execute the browsing dialog.
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
#define COPYDATA_FILENAMES COPYDATA_FILENAMESA
|
||||
#endif
|
||||
|
||||
void folderBrowser(HWND parent, int outputCtrlID);
|
||||
void folderBrowser(HWND parent, int outputCtrlID, const TCHAR *defaultStr = NULL);
|
||||
|
||||
// Set a call back with the handle after init to set the path.
|
||||
// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/callbackfunctions/browsecallbackproc.asp
|
||||
|
|
|
@ -740,7 +740,7 @@ BufferID Notepad_plus::doOpen(const TCHAR *fileName, bool isReadOnly)
|
|||
{
|
||||
//::MessageBox(_hSelf, fileName, TEXT("Dir"), MB_OK);
|
||||
vector<generic_string> fileNames;
|
||||
vector<wstring> patterns;
|
||||
vector<generic_string> patterns;
|
||||
patterns.push_back(TEXT("*.*"));
|
||||
|
||||
generic_string fileNameStr = fileName;
|
||||
|
@ -1632,7 +1632,10 @@ bool Notepad_plus::replaceInFiles()
|
|||
|
||||
vector<generic_string> patterns2Match;
|
||||
if (_findReplaceDlg.getFilters() == TEXT(""))
|
||||
_findReplaceDlg.setFindInFilesDirFilter(NULL, TEXT("*.*"));
|
||||
{
|
||||
NppParameters *pNppParam = NppParameters::getInstance();
|
||||
_findReplaceDlg.setFindInFilesDirFilter(pNppParam->getWorkingDir(), TEXT("*.*"));
|
||||
}
|
||||
_findReplaceDlg.getPatterns(patterns2Match);
|
||||
vector<generic_string> fileNames;
|
||||
|
||||
|
@ -1710,7 +1713,10 @@ bool Notepad_plus::findInFiles()
|
|||
|
||||
vector<generic_string> patterns2Match;
|
||||
if (_findReplaceDlg.getFilters() == TEXT(""))
|
||||
_findReplaceDlg.setFindInFilesDirFilter(NULL, TEXT("*.*"));
|
||||
{
|
||||
NppParameters *pNppParam = NppParameters::getInstance();
|
||||
_findReplaceDlg.setFindInFilesDirFilter(pNppParam->getWorkingDir(), TEXT("*.*"));
|
||||
}
|
||||
_findReplaceDlg.getPatterns(patterns2Match);
|
||||
vector<generic_string> fileNames;
|
||||
|
||||
|
@ -9654,7 +9660,7 @@ void Notepad_plus::setFindReplaceFolderFilter(const TCHAR *dir, const TCHAR *fil
|
|||
generic_string fltr;
|
||||
NppParameters *pNppParam = NppParameters::getInstance();
|
||||
|
||||
// get current direcroty and current language file extensions in case they are not provided.
|
||||
// get current language file extensions in case they are not provided.
|
||||
|
||||
if (!dir)
|
||||
{
|
||||
|
|
|
@ -1023,7 +1023,7 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP
|
|||
case IDD_FINDINFILES_BROWSE_BUTTON :
|
||||
{
|
||||
if (_currentStatus == FINDINFILES_DLG)
|
||||
folderBrowser(_hSelf, IDD_FINDINFILES_DIR_COMBO);
|
||||
folderBrowser(_hSelf, IDD_FINDINFILES_DIR_COMBO, _directory.c_str());
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
|
|
|
@ -345,7 +345,7 @@ public :
|
|||
if (dir)
|
||||
{
|
||||
_directory = dir;
|
||||
::SetDlgItemText(_hSelf, IDD_FINDINFILES_DIR_COMBO, dir);
|
||||
//::SetDlgItemText(_hSelf, IDD_FINDINFILES_DIR_COMBO, dir);
|
||||
}
|
||||
if (filters)
|
||||
{
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
#ifndef RESOURCE_H
|
||||
#define RESOURCE_H
|
||||
|
||||
#define NOTEPAD_PLUS_VERSION TEXT("Notepad++ v5.2")
|
||||
#define VERSION_VALUE TEXT("5.2\0") // should be X.Y : ie. if VERSION_DIGITALVALUE == 4, 7, 1, 0 , then X = 4, Y = 71
|
||||
#define VERSION_DIGITALVALUE 5, 2, 0, 0
|
||||
#define NOTEPAD_PLUS_VERSION TEXT("Notepad++ v5.3")
|
||||
#define VERSION_VALUE TEXT("5.3\0") // should be X.Y : ie. if VERSION_DIGITALVALUE == 4, 7, 1, 0 , then X = 4, Y = 71
|
||||
#define VERSION_DIGITALVALUE 5, 3, 0, 0
|
||||
|
||||
#ifdef UNICODE
|
||||
#define UNICODE_ANSI_MODE TEXT("(UNICODE)")
|
||||
|
|
Loading…
Reference in New Issue