Use correct length for buffer
[TortoiseGit.git] / src / TortoiseProc / FindDlg.h
blob01101fad4c1ebee2730cabea337461725c77e697
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2011-2016 - 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"
27 // CFindDlg dialog
29 #define IDT_FILTER 101
31 class CFindDlg : public CResizableStandAloneDialog
33 DECLARE_DYNAMIC(CFindDlg)
35 public:
36 CFindDlg(CWnd* pParent = nullptr); // standard constructor
37 virtual ~CFindDlg();
38 void Create(CWnd* pParent = nullptr) { m_pParent = pParent; CDialog::Create(IDD, pParent); ShowWindow(SW_SHOW); UpdateWindow(); }
40 bool IsTerminating() {return m_bTerminating;}
41 bool FindNext() {return m_bFindNext;}
42 bool MatchCase() {return !!m_bMatchCase;}
43 bool WholeWord() {return !!m_bWholeWord;}
44 bool Regex() {return !!m_bRegex;}
45 bool IsRef() {return !!m_bIsRef;}
46 CString GetFindString() {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 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
55 virtual void OnCancel();
56 virtual void PostNcDestroy();
57 virtual void OnOK();
58 virtual BOOL OnInitDialog();
59 afx_msg void OnCbnEditchangeFindcombo();
61 DECLARE_MESSAGE_MAP()
63 UINT m_FindMsg;
64 bool m_bTerminating;
65 bool m_bFindNext;
66 BOOL m_bMatchCase;
67 BOOL m_bLimitToDiffs;
68 BOOL m_bWholeWord;
69 BOOL m_bRegex;
70 bool m_bIsRef;
71 CHistoryCombo m_FindCombo;
72 CString m_FindString;
73 CWnd *m_pParent;
74 STRING_VECTOR m_RefList;
75 CRegDWORD m_regMatchCase;
76 CRegDWORD m_regWholeWord;
77 CRegDWORD m_regRegex;
79 void AddToList();
81 public:
82 CListCtrl m_ctrlRefList;
83 CEdit m_ctrlFilter;
84 afx_msg void OnNMClickListRef(NMHDR *pNMHDR, LRESULT *pResult);
85 afx_msg void OnEnChangeEditFilter();
86 afx_msg void OnTimer(UINT_PTR nIDEvent);