[BUG_FIXED] (Author: Andreas Jonsson) Fix canceling shutdown make Notepad++ quit w/o saving files bug.
[ENHANCEMENT] (Author: Andreas Jonsson) Check "Begin/End select" menuitem when active. [ENHANCEMENT] (Author: Andreas Jonsson) Clear Replace dialog status bar before processing any action. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1119 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
d56b2eef66
commit
9795408fa8
|
@ -1476,8 +1476,9 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||||
|
|
||||||
case WM_ENDSESSION:
|
case WM_ENDSESSION:
|
||||||
{
|
{
|
||||||
::DestroyWindow(hwnd);
|
if(wParam == TRUE)
|
||||||
return TRUE;
|
::DestroyWindow(hwnd);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
case WM_DESTROY:
|
case WM_DESTROY:
|
||||||
|
|
|
@ -321,7 +321,10 @@ void Notepad_plus::command(int id)
|
||||||
|
|
||||||
case IDM_EDIT_BEGINENDSELECT:
|
case IDM_EDIT_BEGINENDSELECT:
|
||||||
{
|
{
|
||||||
_pEditView->beginOrEndSelect();
|
if(_pEditView->beginEndSelectedIsStarted())
|
||||||
|
::CheckMenuItem(_mainMenuHandle, IDM_EDIT_BEGINENDSELECT, MF_BYCOMMAND | MF_UNCHECKED);
|
||||||
|
else
|
||||||
|
::CheckMenuItem(_mainMenuHandle, IDM_EDIT_BEGINENDSELECT, MF_BYCOMMAND | MF_CHECKED);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -682,6 +682,7 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP
|
||||||
break;
|
break;
|
||||||
case IDOK : // Find Next : only for FIND_DLG and REPLACE_DLG
|
case IDOK : // Find Next : only for FIND_DLG and REPLACE_DLG
|
||||||
{
|
{
|
||||||
|
setStatusbarMessage(TEXT(""), FSNoMessage);
|
||||||
bool isUnicode = (*_ppEditView)->getCurrentBuffer()->getUnicodeMode() != uni8Bit;
|
bool isUnicode = (*_ppEditView)->getCurrentBuffer()->getUnicodeMode() != uni8Bit;
|
||||||
|
|
||||||
HWND hFindCombo = ::GetDlgItem(_hSelf, IDFINDWHAT);
|
HWND hFindCombo = ::GetDlgItem(_hSelf, IDFINDWHAT);
|
||||||
|
@ -695,9 +696,9 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP
|
||||||
FindStatus findStatus = FSFound;
|
FindStatus findStatus = FSFound;
|
||||||
processFindNext(_options._str2Search.c_str(), _env, &findStatus);
|
processFindNext(_options._str2Search.c_str(), _env, &findStatus);
|
||||||
if (findStatus == FSEndReached)
|
if (findStatus == FSEndReached)
|
||||||
setStatusbarMessage(TEXT("Find: Found the 1st occurrence from the top. The end of document has been reached."), FSEndReached);
|
setStatusbarMessage(TEXT("Find: Found the 1st occurrence from the top. The end of the document has been reached."), FSEndReached);
|
||||||
else if (findStatus == FSTopReached)
|
else if (findStatus == FSTopReached)
|
||||||
setStatusbarMessage(TEXT("Find: Found the 1st occurrence from the bottom. The begin of document has been reached."), FSTopReached);
|
setStatusbarMessage(TEXT("Find: Found the 1st occurrence from the bottom. The beginning of the document has been reached."), FSTopReached);
|
||||||
|
|
||||||
nppParamInst->_isFindReplacing = false;
|
nppParamInst->_isFindReplacing = false;
|
||||||
}
|
}
|
||||||
|
@ -707,6 +708,7 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP
|
||||||
{
|
{
|
||||||
if (_currentStatus == REPLACE_DLG)
|
if (_currentStatus == REPLACE_DLG)
|
||||||
{
|
{
|
||||||
|
setStatusbarMessage(TEXT(""), FSNoMessage);
|
||||||
bool isUnicode = (*_ppEditView)->getCurrentBuffer()->getUnicodeMode() != uni8Bit;
|
bool isUnicode = (*_ppEditView)->getCurrentBuffer()->getUnicodeMode() != uni8Bit;
|
||||||
HWND hFindCombo = ::GetDlgItem(_hSelf, IDFINDWHAT);
|
HWND hFindCombo = ::GetDlgItem(_hSelf, IDFINDWHAT);
|
||||||
HWND hReplaceCombo = ::GetDlgItem(_hSelf, IDREPLACEWITH);
|
HWND hReplaceCombo = ::GetDlgItem(_hSelf, IDREPLACEWITH);
|
||||||
|
@ -726,6 +728,7 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP
|
||||||
{
|
{
|
||||||
if (_currentStatus == FIND_DLG)
|
if (_currentStatus == FIND_DLG)
|
||||||
{
|
{
|
||||||
|
setStatusbarMessage(TEXT(""), FSNoMessage);
|
||||||
bool isUnicode = (*_ppEditView)->getCurrentBuffer()->getUnicodeMode() != uni8Bit;
|
bool isUnicode = (*_ppEditView)->getCurrentBuffer()->getUnicodeMode() != uni8Bit;
|
||||||
HWND hFindCombo = ::GetDlgItem(_hSelf, IDFINDWHAT);
|
HWND hFindCombo = ::GetDlgItem(_hSelf, IDFINDWHAT);
|
||||||
combo2ExtendedMode(IDFINDWHAT);
|
combo2ExtendedMode(IDFINDWHAT);
|
||||||
|
@ -742,6 +745,7 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP
|
||||||
|
|
||||||
case IDC_FINDALL_CURRENTFILE :
|
case IDC_FINDALL_CURRENTFILE :
|
||||||
{
|
{
|
||||||
|
setStatusbarMessage(TEXT(""), FSNoMessage);
|
||||||
bool isUnicode = (*_ppEditView)->getCurrentBuffer()->getUnicodeMode() != uni8Bit;
|
bool isUnicode = (*_ppEditView)->getCurrentBuffer()->getUnicodeMode() != uni8Bit;
|
||||||
HWND hFindCombo = ::GetDlgItem(_hSelf, IDFINDWHAT);
|
HWND hFindCombo = ::GetDlgItem(_hSelf, IDFINDWHAT);
|
||||||
combo2ExtendedMode(IDFINDWHAT);
|
combo2ExtendedMode(IDFINDWHAT);
|
||||||
|
@ -757,6 +761,7 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP
|
||||||
|
|
||||||
case IDD_FINDINFILES_FIND_BUTTON :
|
case IDD_FINDINFILES_FIND_BUTTON :
|
||||||
{
|
{
|
||||||
|
setStatusbarMessage(TEXT(""), FSNoMessage);
|
||||||
const int filterSize = 256;
|
const int filterSize = 256;
|
||||||
TCHAR filters[filterSize+1];
|
TCHAR filters[filterSize+1];
|
||||||
filters[filterSize] = '\0';
|
filters[filterSize] = '\0';
|
||||||
|
@ -787,6 +792,7 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP
|
||||||
|
|
||||||
case IDD_FINDINFILES_REPLACEINFILES :
|
case IDD_FINDINFILES_REPLACEINFILES :
|
||||||
{
|
{
|
||||||
|
setStatusbarMessage(TEXT(""), FSNoMessage);
|
||||||
const int filterSize = 256;
|
const int filterSize = 256;
|
||||||
TCHAR filters[filterSize];
|
TCHAR filters[filterSize];
|
||||||
TCHAR directory[MAX_PATH];
|
TCHAR directory[MAX_PATH];
|
||||||
|
@ -828,6 +834,7 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP
|
||||||
{
|
{
|
||||||
if (_currentStatus == REPLACE_DLG)
|
if (_currentStatus == REPLACE_DLG)
|
||||||
{
|
{
|
||||||
|
setStatusbarMessage(TEXT(""), FSNoMessage);
|
||||||
bool isUnicode = (*_ppEditView)->getCurrentBuffer()->getUnicodeMode() != uni8Bit;
|
bool isUnicode = (*_ppEditView)->getCurrentBuffer()->getUnicodeMode() != uni8Bit;
|
||||||
HWND hFindCombo = ::GetDlgItem(_hSelf, IDFINDWHAT);
|
HWND hFindCombo = ::GetDlgItem(_hSelf, IDFINDWHAT);
|
||||||
_options._str2Search = getTextFromCombo(hFindCombo, isUnicode);
|
_options._str2Search = getTextFromCombo(hFindCombo, isUnicode);
|
||||||
|
@ -847,6 +854,7 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP
|
||||||
{
|
{
|
||||||
if (_currentStatus == REPLACE_DLG)
|
if (_currentStatus == REPLACE_DLG)
|
||||||
{
|
{
|
||||||
|
setStatusbarMessage(TEXT(""), FSNoMessage);
|
||||||
if ((*_ppEditView)->getCurrentBuffer()->isReadOnly())
|
if ((*_ppEditView)->getCurrentBuffer()->isReadOnly())
|
||||||
{
|
{
|
||||||
generic_string errMsg = TEXT("Replace: Cannot replace text. The current document is read only.");
|
generic_string errMsg = TEXT("Replace: Cannot replace text. The current document is read only.");
|
||||||
|
@ -891,6 +899,7 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP
|
||||||
{
|
{
|
||||||
if (_currentStatus == FIND_DLG)
|
if (_currentStatus == FIND_DLG)
|
||||||
{
|
{
|
||||||
|
setStatusbarMessage(TEXT(""), FSNoMessage);
|
||||||
bool isUnicode = (*_ppEditView)->getCurrentBuffer()->getUnicodeMode() != uni8Bit;
|
bool isUnicode = (*_ppEditView)->getCurrentBuffer()->getUnicodeMode() != uni8Bit;
|
||||||
HWND hFindCombo = ::GetDlgItem(_hSelf, IDFINDWHAT);
|
HWND hFindCombo = ::GetDlgItem(_hSelf, IDFINDWHAT);
|
||||||
updateCombo(IDFINDWHAT);
|
updateCombo(IDFINDWHAT);
|
||||||
|
@ -921,6 +930,7 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP
|
||||||
{
|
{
|
||||||
if (_currentStatus == MARK_DLG)
|
if (_currentStatus == MARK_DLG)
|
||||||
{
|
{
|
||||||
|
setStatusbarMessage(TEXT(""), FSNoMessage);
|
||||||
bool isUnicode = (*_ppEditView)->getCurrentBuffer()->getUnicodeMode() != uni8Bit;
|
bool isUnicode = (*_ppEditView)->getCurrentBuffer()->getUnicodeMode() != uni8Bit;
|
||||||
HWND hFindCombo = ::GetDlgItem(_hSelf, IDFINDWHAT);
|
HWND hFindCombo = ::GetDlgItem(_hSelf, IDFINDWHAT);
|
||||||
_options._str2Search = getTextFromCombo(hFindCombo, isUnicode);
|
_options._str2Search = getTextFromCombo(hFindCombo, isUnicode);
|
||||||
|
|
|
@ -281,6 +281,9 @@ public:
|
||||||
void restoreCurrentFold();
|
void restoreCurrentFold();
|
||||||
|
|
||||||
void beginOrEndSelect();
|
void beginOrEndSelect();
|
||||||
|
bool beginEndSelectedIsStarted() const {
|
||||||
|
return _beginSelectPosition != -1;
|
||||||
|
};
|
||||||
|
|
||||||
int getCurrentDocLen() const {
|
int getCurrentDocLen() const {
|
||||||
return int(execute(SCI_GETLENGTH));
|
return int(execute(SCI_GETLENGTH));
|
||||||
|
|
Loading…
Reference in New Issue