1 // TortoiseMerge - a Diff/Patch program
3 // Copyright (C) 2013-2014 - 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"
21 #include "RegexFilterDlg.h"
22 #include <afxdialogex.h>
26 // CRegexFilterDlg dialog
28 IMPLEMENT_DYNAMIC(CRegexFilterDlg
, CDialogEx
)
30 CRegexFilterDlg::CRegexFilterDlg(CWnd
* pParent
/*=NULL*/)
31 : CDialogEx(CRegexFilterDlg::IDD
, pParent
)
38 CRegexFilterDlg::~CRegexFilterDlg()
42 void CRegexFilterDlg::DoDataExchange(CDataExchange
* pDX
)
44 CDialogEx::DoDataExchange(pDX
);
45 DDX_Text(pDX
, IDC_NAME
, m_sName
);
46 DDX_Text(pDX
, IDC_REGEX
, m_sRegex
);
47 DDX_Text(pDX
, IDC_REPLACE
, m_sReplace
);
51 BEGIN_MESSAGE_MAP(CRegexFilterDlg
, CDialogEx
)
55 // CRegexFilterDlg message handlers
58 BOOL
CRegexFilterDlg::OnInitDialog()
60 CDialogEx::OnInitDialog();
64 GetDlgItem(IDC_NAME
)->SetFocus();
65 return FALSE
; // return TRUE unless you set the focus to a control
66 // EXCEPTION: OCX Property Pages should return FALSE
69 void CRegexFilterDlg::OnOK()
75 std::wregex r1
= std::wregex(m_sRegex
);
76 UNREFERENCED_PARAMETER(r1
);
78 catch (std::exception
)
80 ShowEditBalloon(IDC_REGEX
, IDS_ERR_INVALIDREGEX
, IDS_ERR_ERROR
);
87 void CRegexFilterDlg::ShowEditBalloon(UINT nIdControl
, UINT nIdText
, UINT nIdTitle
, int nIcon
)
89 CString text
= CString(MAKEINTRESOURCE(nIdText
));
90 CString title
= CString(MAKEINTRESOURCE(nIdTitle
));
92 bt
.cbStruct
= sizeof(bt
);
96 SendDlgItemMessage(nIdControl
, EM_SHOWBALLOONTIP
, 0, (LPARAM
)&bt
);