1
// TortoiseGitMerge - a Diff/Patch program
3 // Copyright (C) 2023 - TortoiseGit
4 // Copyright (C) 2006-2007, 2010, 2013-2014, 2016, 2020 - TortoiseSVN
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software Foundation,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #include "HistoryCombo.h"
24 #include "StandAloneDlg.h"
27 #define REPLACEMSGSTRINGW L"TortoiseGitMerge_FindReplace"
30 * \ingroup TortoiseMerge
31 * Find dialog used in TortoiseMerge.
33 class CFindDlg
: public CStandAloneDialog
35 DECLARE_DYNAMIC(CFindDlg
)
38 CFindDlg(CWnd
* pParent
= nullptr); // standard constructor
40 void Create(CWnd
* pParent
= nullptr, int id
= 0);
41 bool IsTerminating() const { return m_bTerminating
; }
42 bool FindNext() const { return m_bFindNext
; }
43 bool MatchCase() const { return !!m_bMatchCase
; }
44 bool LimitToDiffs() const { return !!m_bLimitToDiffs
; }
45 bool WholeWord() const { return !!m_bWholeWord
; }
46 bool SearchUp() const { return !!m_bSearchUp
; }
47 CString
GetFindString() const { return m_FindCombo
.GetString(); }
48 CString
GetReplaceString() const { return m_ReplaceCombo
.GetString(); }
49 void SetFindString(const CString
& str
) { if (!str
.IsEmpty()) { m_FindCombo
.SetWindowText(str
); } }
50 void SetStatusText(const CString
& str
, COLORREF color
= RGB(0, 0, 255));
51 void SetReadonly(bool bReadonly
);
53 enum { IDD
= IDD_FIND
};
64 void DoDataExchange(CDataExchange
* pDX
) override
; // DDX/DDV support
67 virtual void OnCancel();
68 virtual void PostNcDestroy();
70 BOOL
OnInitDialog() override
;
71 afx_msg
void OnCbnEditchangeFindcombo();
72 afx_msg
void OnBnClickedCount();
73 afx_msg HBRUSH
OnCtlColor(CDC
* pDC
, CWnd
*pWnd
, UINT nCtlColor
);
74 afx_msg
void OnBnClickedReplace();
75 afx_msg
void OnBnClickedReplaceall();
76 void SaveWindowPos(CWnd
* pParent
);
79 bool m_bTerminating
= false;
85 CHistoryCombo m_FindCombo
;
86 CHistoryCombo m_ReplaceCombo
;
88 CWnd
* m_pParent
= nullptr;
89 CRegDWORD m_regMatchCase
;
90 CRegDWORD m_regLimitToDiffs
;
91 CRegDWORD m_regWholeWord
;
92 COLORREF m_clrFindStatus
;