Browse Source

[NEW_FEATURE] Auto check "In selection" in Find Replace dialog while there's a selection in the text zone.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@13 f5eea248-9336-0410-98b8-ebc06183d4e3
pull/343/head^2
donho 18 years ago
parent
commit
dd759bfa42
  1. 19
      PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp

19
PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp

@ -319,14 +319,23 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP
case WM_ACTIVATE :
{
CharacterRange cr = (*_ppEditView)->getSelection();
bool isSelected = (cr.cpMax - cr.cpMin) != 0;
if (!isSelected)
int nbSelected = cr.cpMax - cr.cpMin;
int checkVal;
if (nbSelected <= 64)
{
::SendDlgItemMessage(_hSelf, IDC_IN_SELECTION_CHECK, BM_SETCHECK, BST_UNCHECKED, 0);
checkVal = BST_UNCHECKED;
_isInSelection = false;
}
::EnableWindow(::GetDlgItem(_hSelf, IDC_IN_SELECTION_CHECK), isSelected);
else
{
checkVal = BST_CHECKED;
_isInSelection = true;
}
::SendDlgItemMessage(_hSelf, IDC_IN_SELECTION_CHECK, BM_SETCHECK, checkVal, 0);
::EnableWindow(::GetDlgItem(_hSelf, IDC_IN_SELECTION_CHECK), nbSelected);
if (isCheckedOrNot(IDC_TRANSPARENT_LOSSFOCUS_RADIO))
{
if (wParam == WA_INACTIVE)

Loading…
Cancel
Save