Add an option to the TortoiseGitMerge settings dialog to specify the number of contex...
[TortoiseGit.git] / src / TortoiseMerge / FindDlg.h
blob0db7a1f3e644579a5ba7186fc78e79442ac904b2
1 // TortoiseGitMerge - a Diff/Patch program
3 // Copyright (C) 2006-2007, 2010, 2013-2014 - 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 = NULL); // standard constructor
37 virtual ~CFindDlg();
38 void Create(CWnd * pParent = NULL) {CDialog::Create(IDD, pParent);ShowWindow(SW_SHOW);UpdateWindow();}
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 private:
75 UINT m_FindMsg;
76 bool m_bTerminating;
77 bool m_bFindNext;
78 BOOL m_bMatchCase;
79 BOOL m_bLimitToDiffs;
80 BOOL m_bWholeWord;
81 BOOL m_bSearchUp;
82 CHistoryCombo m_FindCombo;
83 CHistoryCombo m_ReplaceCombo;
84 CStatic m_FindStatus;
85 CWnd * m_pParent;
86 CRegDWORD m_regMatchCase;
87 CRegDWORD m_regLimitToDiffs;
88 CRegDWORD m_regWholeWord;
89 COLORREF m_clrFindStatus;
90 bool m_bReadonly;