[UPDATE] "Switch to found results window" command now switches back to the current edit view if the focus is already on the found results.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@453 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
yniq 2009-04-23 12:35:46 +00:00
parent c924a47560
commit 9deb93204d
2 changed files with 14 additions and 5 deletions

View File

@ -3238,7 +3238,7 @@ void Notepad_plus::command(int id)
_findReplaceDlg.doDialog((id == IDM_SEARCH_FIND)?FIND_DLG:REPLACE_DLG, _isRTL);
_pEditView->getGenericSelectedText(str, strSize);
_findReplaceDlg.setSearchText(str, _pEditView->getCurrentBuffer()->getUnicodeMode() != uni8Bit);
_findReplaceDlg.setSearchText(str);
setFindReplaceFolderFilter(NULL, NULL);
if (isFirstTime)
@ -3290,6 +3290,10 @@ void Notepad_plus::command(int id)
}
case NPPM_INTERNAL_FOCUS_ON_FOUND_RESULTS:
{
if (GetFocus() == _findReplaceDlg.getHFindResults())
// focus already on found results, switch to current edit view
switchEditViewTo(currentView());
else
_findReplaceDlg.focusOnFinder();
break;
}
@ -7395,7 +7399,7 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
_findReplaceDlg.doDialog(FIND_DLG, _isRTL);
_pEditView->getGenericSelectedText(str, strSize);
_findReplaceDlg.setSearchText(str, _pEditView->getCurrentBuffer()->getUnicodeMode() != uni8Bit);
_findReplaceDlg.setSearchText(str);
if (isFirstTime)
changeDlgLang(_findReplaceDlg.getHSelf(), "Find");
_findReplaceDlg.launchFindInFilesDlg();
@ -9390,7 +9394,6 @@ const TCHAR * Notepad_plus::fileSaveSession(size_t nbFile, TCHAR ** fileNames, c
Session currentSession;
if ((nbFile) && (!fileNames))
{
for (size_t i = 0 ; i < nbFile ; i++)
{
if (PathFileExists(fileNames[i]))

View File

@ -323,7 +323,7 @@ public :
void replaceAllInOpenedDocs();
void findAllIn(InWhat op);
void setSearchText(TCHAR * txt2find, bool isUTF8 = false) {
void setSearchText(TCHAR * txt2find) {
HWND hCombo = ::GetDlgItem(_hSelf, IDFINDWHAT);
if (txt2find && txt2find[0])
{
@ -396,6 +396,12 @@ public :
}
};
HWND getHFindResults() {
if (_pFinder)
return _pFinder->_scintView.getHSelf();
return NULL;
}
void updateFinderScintilla() {
if (_pFinder && _pFinder->isCreated() && _pFinder->isVisible())
{