1 // TortoiseMerge - a Diff/Patch program
\r
3 // Copyright (C) 2006 - Stefan Kueng
\r
5 // This program is free software; you can redistribute it and/or
\r
6 // modify it under the terms of the GNU General Public License
\r
7 // as published by the Free Software Foundation; either version 2
\r
8 // of the License, or (at your option) any later version.
\r
10 // This program is distributed in the hope that it will be useful,
\r
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 // GNU General Public License for more details.
\r
15 // You should have received a copy of the GNU General Public License
\r
16 // along with this program; if not, write to the Free Software Foundation,
\r
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
\r
20 #include "TortoiseMerge.h"
\r
21 #include "FindDlg.h"
\r
26 IMPLEMENT_DYNAMIC(CFindDlg, CDialog)
\r
28 CFindDlg::CFindDlg(CWnd* pParent /*=NULL*/)
\r
29 : CDialog(CFindDlg::IDD, pParent)
\r
30 , m_bTerminating(false)
\r
31 , m_bFindNext(false)
\r
32 , m_bMatchCase(FALSE)
\r
33 , m_bLimitToDiffs(FALSE)
\r
34 , m_bWholeWord(FALSE)
\r
38 CFindDlg::~CFindDlg()
\r
42 void CFindDlg::DoDataExchange(CDataExchange* pDX)
\r
44 CDialog::DoDataExchange(pDX);
\r
45 DDX_Check(pDX, IDC_MATCHCASE, m_bMatchCase);
\r
46 DDX_Check(pDX, IDC_LIMITTODIFFS, m_bLimitToDiffs);
\r
47 DDX_Check(pDX, IDC_WHOLEWORD, m_bWholeWord);
\r
48 DDX_Control(pDX, IDC_FINDCOMBO, m_FindCombo);
\r
52 BEGIN_MESSAGE_MAP(CFindDlg, CDialog)
\r
53 ON_CBN_EDITCHANGE(IDC_FINDCOMBO, &CFindDlg::OnCbnEditchangeFindcombo)
\r
57 // CFindDlg message handlers
\r
59 void CFindDlg::OnCancel()
\r
61 m_bTerminating = true;
\r
63 GetParent()->SendMessage(m_FindMsg);
\r
67 void CFindDlg::PostNcDestroy()
\r
72 void CFindDlg::OnOK()
\r
75 m_FindCombo.SaveHistory();
\r
77 if (m_FindCombo.GetString().IsEmpty())
\r
81 GetParent()->SendMessage(m_FindMsg);
\r
82 m_bFindNext = false;
\r
85 BOOL CFindDlg::OnInitDialog()
\r
87 CDialog::OnInitDialog();
\r
88 m_FindMsg = RegisterWindowMessage(FINDMSGSTRING);
\r
90 m_FindCombo.LoadHistory(_T("Software\\TortoiseMerge\\History\\Find"), _T("Search"));
\r
92 m_FindCombo.SetFocus();
\r
97 void CFindDlg::OnCbnEditchangeFindcombo()
\r
100 GetDlgItem(IDOK)->EnableWindow(!m_FindCombo.GetString().IsEmpty());
\r