|
|
|
@ -1022,27 +1022,25 @@ intptr_t CALLBACK FindInFinderDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR
|
|
|
|
|
NppDarkMode::autoSubclassAndThemeChildControls(_hSelf);
|
|
|
|
|
|
|
|
|
|
initFromOptions();
|
|
|
|
|
|
|
|
|
|
goToCenter(SWP_SHOWWINDOW | SWP_NOSIZE);
|
|
|
|
|
}
|
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
|
|
case WM_CTLCOLOREDIT:
|
|
|
|
|
{
|
|
|
|
|
if (NppDarkMode::isEnabled())
|
|
|
|
|
{
|
|
|
|
|
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case WM_CTLCOLORLISTBOX:
|
|
|
|
|
{
|
|
|
|
|
return NppDarkMode::onCtlColor(reinterpret_cast<HDC>(wParam));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case WM_CTLCOLORDLG:
|
|
|
|
|
case WM_CTLCOLORSTATIC:
|
|
|
|
|
{
|
|
|
|
|
if (NppDarkMode::isEnabled())
|
|
|
|
|
{
|
|
|
|
|
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case WM_PRINTCLIENT:
|
|
|
|
@ -1058,7 +1056,7 @@ intptr_t CALLBACK FindInFinderDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR
|
|
|
|
|
{
|
|
|
|
|
if (NppDarkMode::isEnabled())
|
|
|
|
|
{
|
|
|
|
|
RECT rc = {};
|
|
|
|
|
RECT rc{};
|
|
|
|
|
getClientRect(rc);
|
|
|
|
|
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
|
|
|
|
return TRUE;
|
|
|
|
@ -1211,22 +1209,18 @@ intptr_t CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
|
|
|
|
|
|
|
|
|
|
case WM_CTLCOLOREDIT:
|
|
|
|
|
{
|
|
|
|
|
if (NppDarkMode::isEnabled())
|
|
|
|
|
{
|
|
|
|
|
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case WM_CTLCOLORLISTBOX:
|
|
|
|
|
{
|
|
|
|
|
return NppDarkMode::onCtlColor(reinterpret_cast<HDC>(wParam));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case WM_CTLCOLORDLG:
|
|
|
|
|
case WM_CTLCOLORSTATIC:
|
|
|
|
|
{
|
|
|
|
|
if (NppDarkMode::isEnabled())
|
|
|
|
|
{
|
|
|
|
|
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case WM_PRINTCLIENT:
|
|
|
|
@ -1242,7 +1236,7 @@ intptr_t CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
|
|
|
|
|
{
|
|
|
|
|
if (NppDarkMode::isEnabled())
|
|
|
|
|
{
|
|
|
|
|
RECT rc = {};
|
|
|
|
|
RECT rc{};
|
|
|
|
|
getClientRect(rc);
|
|
|
|
|
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
|
|
|
|
return TRUE;
|
|
|
|
@ -1810,10 +1804,10 @@ intptr_t CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
|
|
|
|
|
case IDD_FINDINFILES_FIND_BUTTON:
|
|
|
|
|
{
|
|
|
|
|
setStatusbarMessage(TEXT(""), FSNoMessage);
|
|
|
|
|
const int filterSize = 512;
|
|
|
|
|
constexpr int filterSize = 512;
|
|
|
|
|
TCHAR filters[filterSize + 1] = { '\0' };
|
|
|
|
|
filters[filterSize] = '\0';
|
|
|
|
|
TCHAR directory[MAX_PATH];
|
|
|
|
|
TCHAR directory[MAX_PATH]{};
|
|
|
|
|
::GetDlgItemText(_hSelf, IDD_FINDINFILES_FILTERS_COMBO, filters, filterSize);
|
|
|
|
|
addText2Combo(filters, ::GetDlgItem(_hSelf, IDD_FINDINFILES_FILTERS_COMBO));
|
|
|
|
|
_options._filters = filters;
|
|
|
|
@ -1859,9 +1853,9 @@ intptr_t CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
|
|
|
|
|
std::lock_guard<std::mutex> lock(findOps_mutex);
|
|
|
|
|
|
|
|
|
|
setStatusbarMessage(TEXT(""), FSNoMessage);
|
|
|
|
|
const int filterSize = 512;
|
|
|
|
|
TCHAR filters[filterSize];
|
|
|
|
|
TCHAR directory[MAX_PATH];
|
|
|
|
|
constexpr int filterSize = 512;
|
|
|
|
|
TCHAR filters[filterSize]{};
|
|
|
|
|
TCHAR directory[MAX_PATH]{};
|
|
|
|
|
::GetDlgItemText(_hSelf, IDD_FINDINFILES_FILTERS_COMBO, filters, filterSize);
|
|
|
|
|
addText2Combo(filters, ::GetDlgItem(_hSelf, IDD_FINDINFILES_FILTERS_COMBO));
|
|
|
|
|
_options._filters = filters;
|
|
|
|
@ -1900,8 +1894,8 @@ intptr_t CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
|
|
|
|
|
std::lock_guard<std::mutex> lock(findOps_mutex);
|
|
|
|
|
|
|
|
|
|
setStatusbarMessage(TEXT(""), FSNoMessage);
|
|
|
|
|
const int filterSize = 512;
|
|
|
|
|
TCHAR filters[filterSize];
|
|
|
|
|
constexpr int filterSize = 512;
|
|
|
|
|
TCHAR filters[filterSize]{};
|
|
|
|
|
::GetDlgItemText(_hSelf, IDD_FINDINFILES_FILTERS_COMBO, filters, filterSize);
|
|
|
|
|
addText2Combo(filters, ::GetDlgItem(_hSelf, IDD_FINDINFILES_FILTERS_COMBO));
|
|
|
|
|
_options._filters = filters;
|
|
|
|
@ -2911,7 +2905,7 @@ int FindReplaceDlg::processRange(ProcessOperation op, FindReplaceInfo & findRepl
|
|
|
|
|
intptr_t nbChar = lend - lstart;
|
|
|
|
|
|
|
|
|
|
// use the static buffer
|
|
|
|
|
TCHAR lineBuf[SC_SEARCHRESULT_LINEBUFFERMAXLENGTH];
|
|
|
|
|
TCHAR lineBuf[SC_SEARCHRESULT_LINEBUFFERMAXLENGTH]{};
|
|
|
|
|
|
|
|
|
|
if (nbChar > SC_SEARCHRESULT_LINEBUFFERMAXLENGTH - 3)
|
|
|
|
|
lend = lstart + SC_SEARCHRESULT_LINEBUFFERMAXLENGTH - 4;
|
|
|
|
@ -2952,7 +2946,7 @@ int FindReplaceDlg::processRange(ProcessOperation op, FindReplaceInfo & findRepl
|
|
|
|
|
intptr_t nbChar = lend - lstart;
|
|
|
|
|
|
|
|
|
|
// use the static buffer
|
|
|
|
|
TCHAR lineBuf[SC_SEARCHRESULT_LINEBUFFERMAXLENGTH];
|
|
|
|
|
TCHAR lineBuf[SC_SEARCHRESULT_LINEBUFFERMAXLENGTH]{};
|
|
|
|
|
|
|
|
|
|
if (nbChar > SC_SEARCHRESULT_LINEBUFFERMAXLENGTH - 3)
|
|
|
|
|
lend = lstart + SC_SEARCHRESULT_LINEBUFFERMAXLENGTH - 4;
|
|
|
|
@ -4231,7 +4225,7 @@ void FindReplaceDlg::enableFindInFilesFunc()
|
|
|
|
|
_currentStatus = FINDINFILES_DLG;
|
|
|
|
|
gotoCorrectTab();
|
|
|
|
|
::MoveWindow(::GetDlgItem(_hSelf, IDCANCEL), _findInFilesClosePos.left + _deltaWidth, _findInFilesClosePos.top, _findInFilesClosePos.right, _findInFilesClosePos.bottom, TRUE);
|
|
|
|
|
TCHAR label[MAX_PATH];
|
|
|
|
|
TCHAR label[MAX_PATH]{};
|
|
|
|
|
_tab.getCurrentTitle(label, MAX_PATH);
|
|
|
|
|
::SetWindowText(_hSelf, label);
|
|
|
|
|
setDefaultButton(IDD_FINDINFILES_FIND_BUTTON);
|
|
|
|
@ -4245,7 +4239,7 @@ void FindReplaceDlg::enableFindInProjectsFunc()
|
|
|
|
|
_currentStatus = FINDINPROJECTS_DLG;
|
|
|
|
|
gotoCorrectTab();
|
|
|
|
|
::MoveWindow(::GetDlgItem(_hSelf, IDCANCEL), _findInFilesClosePos.left + _deltaWidth, _findInFilesClosePos.top, _findInFilesClosePos.right, _findInFilesClosePos.bottom, TRUE);
|
|
|
|
|
TCHAR label[MAX_PATH];
|
|
|
|
|
TCHAR label[MAX_PATH]{};
|
|
|
|
|
_tab.getCurrentTitle(label, MAX_PATH);
|
|
|
|
|
::SetWindowText(_hSelf, label);
|
|
|
|
|
setDefaultButton(IDD_FINDINFILES_FIND_BUTTON);
|
|
|
|
@ -4285,7 +4279,7 @@ void FindReplaceDlg::enableMarkFunc()
|
|
|
|
|
::MoveWindow(::GetDlgItem(_hSelf, IDC_REPLACEINSELECTION), _replaceInSelFramePos.left + _deltaWidth, _replaceInSelFramePos.top, _replaceInSelFramePos.right, _replaceInSelFramePos.bottom, TRUE);
|
|
|
|
|
::MoveWindow(::GetDlgItem(_hSelf, IDCANCEL), _markClosePos.left + _deltaWidth, _markClosePos.top, _markClosePos.right, _markClosePos.bottom, TRUE);
|
|
|
|
|
|
|
|
|
|
TCHAR label[MAX_PATH];
|
|
|
|
|
TCHAR label[MAX_PATH]{};
|
|
|
|
|
_tab.getCurrentTitle(label, MAX_PATH);
|
|
|
|
|
::SetWindowText(_hSelf, label);
|
|
|
|
|
setDefaultButton(IDCMARKALL);
|
|
|
|
@ -4395,7 +4389,7 @@ void FindReplaceDlg::drawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
|
|
|
|
|
bgColor = getCtrlBgColor(_statusBar.getHSelf());
|
|
|
|
|
}
|
|
|
|
|
::SetBkColor(lpDrawItemStruct->hDC, bgColor);
|
|
|
|
|
RECT rect;
|
|
|
|
|
RECT rect{};
|
|
|
|
|
_statusBar.getClientRect(rect);
|
|
|
|
|
|
|
|
|
|
if (NppDarkMode::isEnabled())
|
|
|
|
@ -4407,7 +4401,7 @@ void FindReplaceDlg::drawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
|
|
|
|
|
|
|
|
|
|
if (_statusbarTooltipMsg.length() == 0) return;
|
|
|
|
|
|
|
|
|
|
SIZE size;
|
|
|
|
|
SIZE size{};
|
|
|
|
|
::GetTextExtentPoint32(lpDrawItemStruct->hDC, ptStr, lstrlen(ptStr), &size);
|
|
|
|
|
int s = (rect.bottom - rect.top) & 0x70; // limit s to available icon sizes and avoid uneven scalings
|
|
|
|
|
if (s > 0)
|
|
|
|
@ -4800,7 +4794,7 @@ void Finder::copy()
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
size_t fromLine, toLine;
|
|
|
|
|
size_t fromLine = 0, toLine = 0;
|
|
|
|
|
{
|
|
|
|
|
const pair<size_t, size_t> lineRange = _scintView.getSelectionLinesRange();
|
|
|
|
|
fromLine = lineRange.first;
|
|
|
|
@ -5121,7 +5115,7 @@ intptr_t CALLBACK Finder::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam
|
|
|
|
|
|
|
|
|
|
case WM_SIZE :
|
|
|
|
|
{
|
|
|
|
|
RECT rc;
|
|
|
|
|
RECT rc{};
|
|
|
|
|
getClientRect(rc);
|
|
|
|
|
_scintView.reSizeTo(rc);
|
|
|
|
|
break;
|
|
|
|
@ -5335,7 +5329,7 @@ intptr_t CALLBACK FindIncrementDlg::run_dlgProc(UINT message, WPARAM wParam, LPA
|
|
|
|
|
{
|
|
|
|
|
if (NppDarkMode::isEnabled())
|
|
|
|
|
{
|
|
|
|
|
RECT rcClient = {};
|
|
|
|
|
RECT rcClient{};
|
|
|
|
|
GetClientRect(_hSelf, &rcClient);
|
|
|
|
|
::FillRect(reinterpret_cast<HDC>(wParam), &rcClient, NppDarkMode::getDarkerBackgroundBrush());
|
|
|
|
|
return TRUE;
|
|
|
|
@ -5371,7 +5365,7 @@ void FindIncrementDlg::markSelectedTextInc(bool enable, FindOption *opt)
|
|
|
|
|
if (range.cpMin == range.cpMax)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
TCHAR text2Find[FINDREPLACE_MAXLENGTH];
|
|
|
|
|
TCHAR text2Find[FINDREPLACE_MAXLENGTH]{};
|
|
|
|
|
(*(_pFRDlg->_ppEditView))->getGenericSelectedText(text2Find, FINDREPLACE_MAXLENGTH, false); //do not expand selection (false)
|
|
|
|
|
opt->_str2Search = text2Find;
|
|
|
|
|
_pFRDlg->markAllInc(opt);
|
|
|
|
@ -5579,7 +5573,7 @@ void Progress::setPercent(unsigned percent, const TCHAR* fileName, int nbHitsSoF
|
|
|
|
|
{
|
|
|
|
|
::PostMessage(_hPBar, PBM_SETPOS, percent, 0);
|
|
|
|
|
::SendMessage(_hPathText, WM_SETTEXT, 0, reinterpret_cast<LPARAM>(fileName));
|
|
|
|
|
TCHAR str[16];
|
|
|
|
|
TCHAR str[16]{};
|
|
|
|
|
_itow(nbHitsSoFar, str, 10);
|
|
|
|
|
::SendMessage(_hRunningHitsText, WM_SETTEXT, 0, reinterpret_cast<LPARAM>(str));
|
|
|
|
|
}
|
|
|
|
@ -5593,7 +5587,7 @@ void Progress::setInfo(const TCHAR* info, int nbHitsSoFar) const
|
|
|
|
|
::SendMessage(_hPathText, WM_SETTEXT, 0, reinterpret_cast<LPARAM>(info));
|
|
|
|
|
if (nbHitsSoFar != -1)
|
|
|
|
|
{
|
|
|
|
|
TCHAR str[16];
|
|
|
|
|
TCHAR str[16]{};
|
|
|
|
|
_itow(nbHitsSoFar, str, 10);
|
|
|
|
|
::SendMessage(_hRunningHitsText, WM_SETTEXT, 0, reinterpret_cast<LPARAM>(str));
|
|
|
|
|
}
|
|
|
|
@ -5773,7 +5767,7 @@ LRESULT APIENTRY Progress::wndProc(HWND hwnd, UINT umsg, WPARAM wparam, LPARAM l
|
|
|
|
|
{
|
|
|
|
|
if (NppDarkMode::isEnabled())
|
|
|
|
|
{
|
|
|
|
|
RECT rc = {};
|
|
|
|
|
RECT rc{};
|
|
|
|
|
GetClientRect(hwnd, &rc);
|
|
|
|
|
::FillRect(reinterpret_cast<HDC>(wparam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
|
|
|
|
}
|
|
|
|
|