Doc: Fix broken link
[TortoiseGit.git] / src / TortoiseMerge / GotoLineDlg.cpp
blobc37f4651c3c4d2d7fce2bc4174ec3f039b0497fb
1 // TortoiseGitMerge - a Diff/Patch program
3 // Copyright (C) 2011, 2013 - 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.
19 #include "stdafx.h"
20 #include "TortoiseMerge.h"
21 #include "GotoLineDlg.h"
22 #include <afxdialogex.h>
25 // CGotoLineDlg dialog
27 IMPLEMENT_DYNAMIC(CGotoLineDlg, CDialogEx)
29 CGotoLineDlg::CGotoLineDlg(CWnd* pParent /*=nullptr*/)
30 : CDialogEx(CGotoLineDlg::IDD, pParent)
31 , m_nLine(0)
32 , m_nLow(-1)
33 , m_nHigh(-1)
37 CGotoLineDlg::~CGotoLineDlg()
41 void CGotoLineDlg::DoDataExchange(CDataExchange* pDX)
43 CDialogEx::DoDataExchange(pDX);
44 DDX_Text(pDX, IDC_NUMBER, m_nLine);
45 DDX_Control(pDX, IDC_NUMBER, m_cNumber);
49 BEGIN_MESSAGE_MAP(CGotoLineDlg, CDialogEx)
50 END_MESSAGE_MAP()
55 BOOL CGotoLineDlg::OnInitDialog()
57 CDialogEx::OnInitDialog();
59 if (!m_sLabel.IsEmpty())
61 SetDlgItemText(IDC_LINELABEL, m_sLabel);
63 SetDlgItemText(IDC_NUMBER, L"");
64 GetDlgItem(IDC_NUMBER)->SetFocus();
66 return FALSE;
70 void CGotoLineDlg::OnOK()
72 UpdateData();
73 if ((m_nLine < m_nLow)||(m_nLine > m_nHigh))
75 CString sError;
76 sError.Format(IDS_GOTO_OUTOFRANGE, m_nLow, m_nHigh);
77 m_cNumber.ShowBalloonTip(L"", sError);
78 m_cNumber.SetSel(0, -1);
79 return;
81 CDialogEx::OnOK();