Fix typos
[TortoiseGit.git] / src / TortoiseProc / FindDlg.h
blob1c1e151e3fc3bb07312bf3d93e6592c15cde7325
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2011-2018, 2020, 2023 - TortoiseGit
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.
20 #pragma once
22 #include "HistoryCombo.h"
23 #include "StandAloneDlg.h"
24 #include "LoglistCommonResource.h"
25 #include "registry.h"
26 #include "GestureEnabledControl.h"
28 // CFindDlg dialog
30 #define IDT_FILTER 101
32 class CFindDlg : public CResizableStandAloneDialog
34 DECLARE_DYNAMIC(CFindDlg)
36 public:
37 CFindDlg(CWnd* pParent = nullptr); // standard constructor
38 virtual ~CFindDlg();
39 void Create(CWnd* pParent = nullptr) { m_pParent = pParent; CDialog::Create(IDD, pParent); ShowWindow(SW_SHOW); UpdateWindow(); }
41 bool IsTerminating() const { return m_bTerminating; }
42 bool FindNext() const { return m_bFindNext; }
43 bool MatchCase() const { return !!m_bMatchCase; }
44 bool Regex() const { return !!m_bRegex; }
45 bool IsRef() const { return !!m_bIsRef; }
46 CString GetFindString() const { return m_FindString; }
47 void SetFindString(const CString& str) { if (!str.IsEmpty()) { m_FindCombo.SetWindowText(str); } }
48 void RefreshList();
50 // Dialog Data
51 enum { IDD = IDD_FIND };
53 protected:
54 void DoDataExchange(CDataExchange* pDX) override; // DDX/DDV support
55 void OnCancel() override;
56 void PostNcDestroy() override;
57 void OnOK() override;
58 BOOL OnInitDialog() override;
59 afx_msg void OnCbnEditchangeFindcombo();
60 afx_msg void OnNMClickListRef(NMHDR* pNMHDR, LRESULT* pResult);
61 afx_msg void OnEnChangeEditFilter();
62 afx_msg void OnTimer(UINT_PTR nIDEvent);
64 DECLARE_MESSAGE_MAP()
66 UINT m_FindMsg = 0;
67 bool m_bTerminating = false;
68 bool m_bFindNext;
69 BOOL m_bMatchCase;
70 BOOL m_bRegex;
71 bool m_bIsRef;
72 CHistoryCombo m_FindCombo;
73 CString m_FindString;
74 CWnd* m_pParent = nullptr;
75 STRING_VECTOR m_RefList;
76 CRegDWORD m_regMatchCase;
77 CRegDWORD m_regRegex;
79 void AddToList();
81 public:
82 CGestureEnabledControlTmpl<CListCtrl> m_ctrlRefList;
83 CEdit m_ctrlFilter;