1 // TortoiseGitMerge - a Diff/Patch program
3 // Copyright (C) 2006, 2011-2012 - TortoiseSVN
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
)
31 , m_bTerminating(false)
34 , m_bLimitToDiffs(FALSE
)
44 void CFindDlg::DoDataExchange(CDataExchange
* pDX
)
46 CDialog::DoDataExchange(pDX
);
47 DDX_Check(pDX
, IDC_MATCHCASE
, m_bMatchCase
);
48 DDX_Check(pDX
, IDC_LIMITTODIFFS
, m_bLimitToDiffs
);
49 DDX_Check(pDX
, IDC_WHOLEWORD
, m_bWholeWord
);
50 DDX_Control(pDX
, IDC_FINDCOMBO
, m_FindCombo
);
54 BEGIN_MESSAGE_MAP(CFindDlg
, CDialog
)
55 ON_CBN_EDITCHANGE(IDC_FINDCOMBO
, &CFindDlg::OnCbnEditchangeFindcombo
)
59 // CFindDlg message handlers
61 void CFindDlg::OnCancel()
63 m_bTerminating
= true;
65 m_pParent
->SendMessage(m_FindMsg
);
67 GetParent()->SendMessage(m_FindMsg
);
71 void CFindDlg::PostNcDestroy()
79 m_FindCombo
.SaveHistory();
81 if (m_FindCombo
.GetString().IsEmpty())
85 m_pParent
->SendMessage(m_FindMsg
);
87 GetParent()->SendMessage(m_FindMsg
);
91 BOOL
CFindDlg::OnInitDialog()
93 CDialog::OnInitDialog();
94 m_FindMsg
= RegisterWindowMessage(FINDMSGSTRING
);
96 m_FindCombo
.DisableTrimming();
97 m_FindCombo
.LoadHistory(_T("Software\\TortoiseGitMerge\\History\\Find"), _T("Search"));
99 m_FindCombo
.SetFocus();
104 void CFindDlg::OnCbnEditchangeFindcombo()
107 GetDlgItem(IDOK
)->EnableWindow(!m_FindCombo
.GetString().IsEmpty());