[NEW] Add "follow current doc" checkbox in Find in file dialog.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@477 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
Don Ho 2009-05-21 16:59:34 +00:00
parent 7c0e0823da
commit e4975230a4
5 changed files with 27 additions and 6 deletions

View File

@ -316,7 +316,8 @@ void FindReplaceDlg::fillFindHistory()
::SendDlgItemMessage(_hSelf, IDD_FINDINFILES_INHIDDENDIR_CHECK, BM_SETCHECK, findHistory._isFifInHiddenFolder, 0);
::SendDlgItemMessage(_hSelf, IDD_FINDINFILES_RECURSIVE_CHECK, BM_SETCHECK, findHistory._isFifRecuisive, 0);
::SendDlgItemMessage(_hSelf, IDD_FINDINFILES_FOLDERFOLLOWSDOC_CHECK, BM_SETCHECK, findHistory._isFolderFollowDoc, 0);
::SendDlgItemMessage(_hSelf, IDNORMAL, BM_SETCHECK, findHistory._searchMode == FindHistory::normal, 0);
::SendDlgItemMessage(_hSelf, IDEXTENDED, BM_SETCHECK, findHistory._searchMode == FindHistory::extended, 0);
::SendDlgItemMessage(_hSelf, IDREGEXP, BM_SETCHECK, findHistory._searchMode == FindHistory::regExpr, 0);
@ -683,7 +684,7 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP
if (isCheckedOrNot(IDC_TRANSPARENT_LOSSFOCUS_RADIO))
{
if (LOWORD(wParam) == WA_INACTIVE && Window::isVisible())
if (LOWORD(wParam) == WA_INACTIVE && isVisible())
{
int percent = ::SendDlgItemMessage(_hSelf, IDC_PERCENTAGE_SLIDER, TBM_GETPOS, 0, 0);
(NppParameters::getInstance())->SetTransparent(_hSelf, percent);
@ -1047,6 +1048,22 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP
}
return TRUE;
case IDD_FINDINFILES_FOLDERFOLLOWSDOC_CHECK :
{
if (_currentStatus == FINDINFILES_DLG)
findHistory._isFolderFollowDoc = isCheckedOrNot(IDD_FINDINFILES_FOLDERFOLLOWSDOC_CHECK);
if (findHistory._isFolderFollowDoc)
{
NppParameters *pNppParam = NppParameters::getInstance();
const TCHAR * dir = pNppParam->getWorkingDir();
::SetDlgItemText(_hSelf, IDD_FINDINFILES_DIR_COMBO, dir);
}
}
return TRUE;
case IDD_FINDINFILES_BROWSE_BUTTON :
{
if (_currentStatus == FINDINFILES_DLG)
@ -1707,6 +1724,7 @@ void FindReplaceDlg::enableFindInFilesControls(bool isEnable)
::ShowWindow(::GetDlgItem(_hSelf, IDD_FINDINFILES_GOBACK_BUTTON), isEnable?SW_SHOW:SW_HIDE);
::ShowWindow(::GetDlgItem(_hSelf, IDD_FINDINFILES_RECURSIVE_CHECK), isEnable?SW_SHOW:SW_HIDE);
::ShowWindow(::GetDlgItem(_hSelf, IDD_FINDINFILES_INHIDDENDIR_CHECK), isEnable?SW_SHOW:SW_HIDE);
::ShowWindow(::GetDlgItem(_hSelf, IDD_FINDINFILES_FOLDERFOLLOWSDOC_CHECK), isEnable?SW_SHOW:SW_HIDE);
}
void FindReplaceDlg::getPatterns(vector<generic_string> & patternVect)

View File

@ -45,8 +45,10 @@ BEGIN
RTEXT "Dir&ectory :",IDD_FINDINFILES_DIR_STATIC,7,76,40,8
COMBOBOX IDD_FINDINFILES_DIR_COMBO,49,74,141,150,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_TABSTOP
PUSHBUTTON "...",IDD_FINDINFILES_BROWSE_BUTTON,193,74,15,13
CONTROL "In all su&b-folders",IDD_FINDINFILES_RECURSIVE_CHECK, "Button", BS_AUTOCHECKBOX | WS_TABSTOP,218,73,94,15
CONTROL "In &hidden folders",IDD_FINDINFILES_INHIDDENDIR_CHECK, "Button", BS_AUTOCHECKBOX | WS_TABSTOP,218,87,94,15
CONTROL "Follow current doc",IDD_FINDINFILES_FOLDERFOLLOWSDOC_CHECK, "Button", BS_AUTOCHECKBOX | WS_TABSTOP,218,73,94,15
CONTROL "In all su&b-folders",IDD_FINDINFILES_RECURSIVE_CHECK, "Button", BS_AUTOCHECKBOX | WS_TABSTOP,218,87,94,15
CONTROL "In &hidden folders",IDD_FINDINFILES_INHIDDENDIR_CHECK, "Button", BS_AUTOCHECKBOX | WS_TABSTOP,218,101,94,15
CONTROL "Match &whole word only",IDWHOLEWORD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,88,140,15
CONTROL "Match &case",IDMATCHCASE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,100,140,15
CONTROL "Wra&p around",IDWRAP,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,6,112,110,15

View File

@ -58,6 +58,7 @@
#define IDD_FINDINFILES_RECURSIVE_CHECK 1658
#define IDD_FINDINFILES_INHIDDENDIR_CHECK 1659
#define IDD_FINDINFILES_REPLACEINFILES 1660
#define IDD_FINDINFILES_FOLDERFOLLOWSDOC_CHECK 1661
#define IDD_FINDRESULT 1670

View File

@ -1402,7 +1402,7 @@ BOOL CALLBACK PrintSettings2Dlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM
varList.push_back(strCouple(TEXT("Full file name path"), TEXT("$(FULL_CURRENT_PATH)")));
varList.push_back(strCouple(TEXT("File name"), TEXT("$(FILE_NAME)")));
varList.push_back(strCouple(TEXT("File directory"), TEXT("$(FULL_CURRENT_PATH)")));
varList.push_back(strCouple(TEXT("File directory"), TEXT("$(CURRENT_DIRECTORY)")));
varList.push_back(strCouple(TEXT("Page"), TEXT("$(CURRENT_PRINTING_PAGE)")));
varList.push_back(strCouple(TEXT("Short date format"), TEXT("$(SHORT_DATE)")));
varList.push_back(strCouple(TEXT("Long date format"), TEXT("$(LONG_DATE)")));

View File

@ -198,7 +198,7 @@ int main(int argc, char *argv[])
if (pXmlSrc) delete pXmlSrc;
if (pXmlDest) delete pXmlDest;
printf("Update Failure");
printf(msg);
return -1;
}