Provide (experimental) clang-format file
[TortoiseGit.git] / src / TortoiseProc / FindDlg.h
blobc2505fbff89044dae6f2dd004bba468e87e59b5d
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2011-2017 - 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() {return m_bTerminating;}
42 bool FindNext() {return m_bFindNext;}
43 bool MatchCase() {return !!m_bMatchCase;}
44 bool WholeWord() {return !!m_bWholeWord;}
45 bool Regex() {return !!m_bRegex;}
46 bool IsRef() {return !!m_bIsRef;}
47 CString GetFindString() {return m_FindString;}
48 void SetFindString(const CString& str) { if (!str.IsEmpty()) { m_FindCombo.SetWindowText(str); } }
49 void RefreshList();
51 // Dialog Data
52 enum { IDD = IDD_FIND };
54 protected:
55 virtual void DoDataExchange(CDataExchange* pDX) override; // DDX/DDV support
56 virtual void OnCancel() override;
57 virtual void PostNcDestroy() override;
58 virtual void OnOK() override;
59 virtual BOOL OnInitDialog() override;
60 afx_msg void OnCbnEditchangeFindcombo();
61 afx_msg void OnNMClickListRef(NMHDR* pNMHDR, LRESULT* pResult);
62 afx_msg void OnEnChangeEditFilter();
63 afx_msg void OnTimer(UINT_PTR nIDEvent);
65 DECLARE_MESSAGE_MAP()
67 UINT m_FindMsg;
68 bool m_bTerminating;
69 bool m_bFindNext;
70 BOOL m_bMatchCase;
71 BOOL m_bLimitToDiffs;
72 BOOL m_bWholeWord;
73 BOOL m_bRegex;
74 bool m_bIsRef;
75 CHistoryCombo m_FindCombo;
76 CString m_FindString;
77 CWnd *m_pParent;
78 STRING_VECTOR m_RefList;
79 CRegDWORD m_regMatchCase;
80 CRegDWORD m_regWholeWord;
81 CRegDWORD m_regRegex;
83 void AddToList();
85 public:
86 CGestureEnabledControlTmpl<CListCtrl> m_ctrlRefList;
87 CEdit m_ctrlFilter;