Doc: Fix broken link
[TortoiseGit.git] / src / TortoiseMerge / FindDlg.h
blob0f1c9d870a889a0245ededf55cf5e35f753895f8
1 // TortoiseGitMerge - a Diff/Patch program
3 // Copyright (C) 2006-2007, 2010, 2013-2014, 2016 - TortoiseSVN
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software Foundation,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 #pragma once
20 #include "resource.h"
21 #include <afxcmn.h>
22 #include "HistoryCombo.h"
23 #include "registry.h"
25 #define REPLACEMSGSTRINGW L"TortoiseGitMerge_FindReplace"
27 /**
28 * \ingroup TortoiseMerge
29 * Find dialog used in TortoiseMerge.
31 class CFindDlg : public CDialog
33 DECLARE_DYNAMIC(CFindDlg)
35 public:
36 CFindDlg(CWnd* pParent = nullptr); // standard constructor
37 virtual ~CFindDlg();
38 void Create(CWnd* pParent = nullptr, int id = 0);
39 bool IsTerminating() {return m_bTerminating;}
40 bool FindNext() {return m_bFindNext;}
41 bool MatchCase() {return !!m_bMatchCase;}
42 bool LimitToDiffs() {return !!m_bLimitToDiffs;}
43 bool WholeWord() {return !!m_bWholeWord;}
44 bool SearchUp() { return !!m_bSearchUp; }
45 CString GetFindString() { return m_FindCombo.GetString(); }
46 CString GetReplaceString() { return m_ReplaceCombo.GetString(); }
47 void SetFindString(const CString& str) { if (!str.IsEmpty()) { m_FindCombo.SetWindowText(str); } }
48 void SetStatusText(const CString& str, COLORREF color = RGB(0, 0, 255));
49 void SetReadonly(bool bReadonly);
50 // Dialog Data
51 enum { IDD = IDD_FIND };
53 enum FindType
55 Find,
56 Count,
57 Replace,
58 ReplaceAll
61 protected:
62 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
64 DECLARE_MESSAGE_MAP()
65 virtual void OnCancel();
66 virtual void PostNcDestroy();
67 virtual void OnOK();
68 virtual BOOL OnInitDialog();
69 afx_msg void OnCbnEditchangeFindcombo();
70 afx_msg void OnBnClickedCount();
71 afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd *pWnd, UINT nCtlColor);
72 afx_msg void OnBnClickedReplace();
73 afx_msg void OnBnClickedReplaceall();
74 void SaveWindowPos(CWnd* pParent);
75 private:
76 UINT m_FindMsg;
77 bool m_bTerminating;
78 bool m_bFindNext;
79 BOOL m_bMatchCase;
80 BOOL m_bLimitToDiffs;
81 BOOL m_bWholeWord;
82 BOOL m_bSearchUp;
83 CHistoryCombo m_FindCombo;
84 CHistoryCombo m_ReplaceCombo;
85 CStatic m_FindStatus;
86 CWnd * m_pParent;
87 CRegDWORD m_regMatchCase;
88 CRegDWORD m_regLimitToDiffs;
89 CRegDWORD m_regWholeWord;
90 COLORREF m_clrFindStatus;
91 bool m_bReadonly;
92 int m_id;