1 // TortoiseMerge - a Diff/Patch program
3 // Copyright (C) 2006 - Stefan Kueng
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 #include "TortoiseMerge.h"
26 IMPLEMENT_DYNAMIC(CFindDlg
, CDialog
)
28 CFindDlg::CFindDlg(CWnd
* pParent
/*=NULL*/)
29 : CDialog(CFindDlg::IDD
, pParent
)
30 , m_bTerminating(false)
33 , m_bLimitToDiffs(FALSE
)
42 void CFindDlg::DoDataExchange(CDataExchange
* pDX
)
44 CDialog::DoDataExchange(pDX
);
45 DDX_Check(pDX
, IDC_MATCHCASE
, m_bMatchCase
);
46 DDX_Check(pDX
, IDC_LIMITTODIFFS
, m_bLimitToDiffs
);
47 DDX_Check(pDX
, IDC_WHOLEWORD
, m_bWholeWord
);
48 DDX_Control(pDX
, IDC_FINDCOMBO
, m_FindCombo
);
52 BEGIN_MESSAGE_MAP(CFindDlg
, CDialog
)
53 ON_CBN_EDITCHANGE(IDC_FINDCOMBO
, &CFindDlg::OnCbnEditchangeFindcombo
)
57 // CFindDlg message handlers
59 void CFindDlg::OnCancel()
61 m_bTerminating
= true;
63 GetParent()->SendMessage(m_FindMsg
);
67 void CFindDlg::PostNcDestroy()
75 m_FindCombo
.SaveHistory();
77 if (m_FindCombo
.GetString().IsEmpty())
81 GetParent()->SendMessage(m_FindMsg
);
85 BOOL
CFindDlg::OnInitDialog()
87 CDialog::OnInitDialog();
88 m_FindMsg
= RegisterWindowMessage(FINDMSGSTRING
);
90 m_FindCombo
.LoadHistory(_T("Software\\TortoiseMerge\\History\\Find"), _T("Search"));
92 m_FindCombo
.SetFocus();
97 void CFindDlg::OnCbnEditchangeFindcombo()
100 GetDlgItem(IDOK
)->EnableWindow(!m_FindCombo
.GetString().IsEmpty());