[UPDATE] Set focus on the main editor after double-clicking a search result (scintilla stole the focus on mouse up).

[UPDATE] Updated some MessageBoxes (for the Find dialog).

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@418 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
yniq 2009-02-06 14:19:51 +00:00
parent 214dfbf381
commit e6fd7c8357
2 changed files with 24 additions and 13 deletions

View File

@ -393,15 +393,24 @@ bool Finder::notify(SCNotification *notification)
_scintView.marginClick(notification->position, notification->modifiers);
}
break;
case SCN_DOUBLECLICK:
// remove selection from the finder
int pos = notification->position;
if (pos == INVALID_POSITION)
pos = _scintView.execute(SCI_GETLINEENDPOSITION, notification->line);
_scintView.execute(SCI_SETSEL, pos, pos);
GotoFoundLine();
{
// remove selection from the finder
int pos = notification->position;
if (pos == INVALID_POSITION)
pos = _scintView.execute(SCI_GETLINEENDPOSITION, notification->line);
_scintView.execute(SCI_SETSEL, pos, pos);
GotoFoundLine();
_isDoubleClicked = true;
break;
}
case SCN_PAINTED:
if (_isDoubleClicked)
{
_isDoubleClicked = false;
(*_ppEditView)->getFocus();
}
break;
}
return false;
@ -749,7 +758,7 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP
lstrcpy(result, TEXT("The regular expression to search is formed badly"));
else
wsprintf(result, TEXT("%d occurrences were replaced."), nbReplaced);
::MessageBox(_hSelf, result, TEXT(""), MB_OK);
::MessageBox(_hSelf, result, TEXT("Replace All"), MB_OK);
}
}
return TRUE;
@ -764,8 +773,8 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP
lstrcpy(result, TEXT("The regular expression to search is formed badly.\r\nIs it resulting in nothing?"));
else
wsprintf(result, TEXT("%d match(es) to occurrence(s)"), nbCounted);
::MessageBox(_hSelf, result, TEXT(""), MB_OK);
}
::MessageBox(_hSelf, result, TEXT("Count"), MB_OK);
}
}
return TRUE;
@ -781,7 +790,7 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP
lstrcpy(result, TEXT("The regular expression to search is formed badly.\r\nIs it resulting in nothing?"));
else
wsprintf(result, TEXT("%d match(es) to occurrence(s)"), nbMarked);
::MessageBox(_hSelf, result, TEXT(""), MB_OK);
::MessageBox(_hSelf, result, TEXT("Mark"), MB_OK);
}
}
return TRUE;

View File

@ -86,7 +86,8 @@ private:
class Finder : public DockingDlgInterface {
friend class FindReplaceDlg;
public:
Finder() : DockingDlgInterface(IDD_FINDRESULT), _pMainFoundInfos(&_foundInfos1), _pMainMarkings(&_markings1) {
Finder() : DockingDlgInterface(IDD_FINDRESULT), _pMainFoundInfos(&_foundInfos1), _pMainMarkings(&_markings1), _isDoubleClicked(false)
{
_MarkingsStruct._length = 0;
_MarkingsStruct._markings = NULL;
};
@ -238,6 +239,7 @@ private:
int _lastFileHeaderPos;
int _lastSearchHeaderPos;
bool _isDoubleClicked;
void setFinderReadOnly(bool isReadOnly) {
_scintView.execute(SCI_SETREADONLY, isReadOnly);