+fix: Find/Replace dialog is master of MarkOccurrences until closed

This commit is contained in:
Rainer Kottenhoff 2019-05-25 21:33:20 +02:00
parent 2bcd7eec67
commit 0709e1d841

View File

@ -5081,6 +5081,8 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
// switch off normal mark occurrences
Settings.MarkOccurrences = 0;
Settings.MarkOccurrencesMatchVisible = false;
EnableCmd(GetMenu(Globals.hwndMain), IDM_VIEW_MARKOCCUR_ONOFF, false);
//EnableCmd(GetMenu(Globals.hwndMain), IDM_VIEW_MARKOCCUR_VISIBLE, false);
// Load MRUs
for (int i = 0; i < MRU_Count(Globals.pMRUfind); i++) {
@ -5149,15 +5151,11 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
if (sg_pefrData->bMarkOccurences) {
CheckDlgButton(hwnd, IDC_ALL_OCCURRENCES, BST_CHECKED);
EnableCmd(GetMenu(Globals.hwndMain), IDM_VIEW_MARKOCCUR_ONOFF, false);
EnableCmd(GetMenu(Globals.hwndMain), IDM_VIEW_MARKOCCUR_VISIBLE, false);
}
else {
CheckDlgButton(hwnd, IDC_ALL_OCCURRENCES, BST_UNCHECKED);
EditClearAllOccurrenceMarkers(sg_pefrData->hwnd);
}
EnableCmd(GetMenu(Globals.hwndMain), IDM_VIEW_MARKOCCUR_VISIBLE, Settings.MarkOccurrencesMatchVisible);
if (sg_pefrData->fuFlags & SCFIND_REGEXP) {
CheckDlgButton(hwnd, IDC_FINDTRANSFORMBS, BST_CHECKED);
@ -5258,8 +5256,8 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
Settings.MarkOccurrences = s_SaveMarkOccurrences;
Settings.MarkOccurrencesMatchVisible = s_SaveMarkMatchVisible;
EnableCmd(GetMenu(Globals.hwndMain), IDM_VIEW_MARKOCCUR_ONOFF, true);
EnableCmd(GetMenu(Globals.hwndMain), IDM_VIEW_MARKOCCUR_VISIBLE, true);
EnableCmd(GetMenu(Globals.hwndMain), IDM_VIEW_MARKOCCUR_ONOFF, Settings.MarkOccurrences);
//EnableCmd(GetMenu(Globals.hwndMain), IDM_VIEW_MARKOCCUR_VISIBLE, Settings.MarkOccurrencesMatchVisible);
Globals.iReplacedOccurrences = 0;
Globals.FindReplaceMatchFoundState = FND_NOP;
@ -5546,14 +5544,10 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
if (IsButtonChecked(hwnd, IDC_ALL_OCCURRENCES))
{
DialogEnableWindow(hwnd, IDC_TOGGLE_VISIBILITY, true);
EnableCmd(GetMenu(Globals.hwndMain), IDM_VIEW_MARKOCCUR_ONOFF, false);
EnableCmd(GetMenu(Globals.hwndMain), IDM_VIEW_MARKOCCUR_VISIBLE, false);
_DelayMarkAll(hwnd, 0, s_InitialSearchStart);
}
else { // switched OFF
DialogEnableWindow(hwnd, IDC_TOGGLE_VISIBILITY, false);
EnableCmd(GetMenu(Globals.hwndMain), IDM_VIEW_MARKOCCUR_ONOFF, true);
EnableCmd(GetMenu(Globals.hwndMain), IDM_VIEW_MARKOCCUR_VISIBLE, true);
EditClearAllOccurrenceMarkers(sg_pefrData->hwnd);
InvalidateRect(GetDlgItem(hwnd, IDC_FINDTEXT), NULL, true);
}