1
// TortoiseGitMerge - a Diff/Patch program
3 // Copyright (C) 2023 - TortoiseGit
4 // Copyright (C) 2011, 2013, 2020 - TortoiseSVN
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software Foundation,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #include "TortoiseMerge.h"
22 #include "GotoLineDlg.h"
23 #include <afxdialogex.h>
26 // CGotoLineDlg dialog
28 IMPLEMENT_DYNAMIC(CGotoLineDlg
, CStandAloneDialog
)
30 CGotoLineDlg::CGotoLineDlg(CWnd
* pParent
/*=nullptr*/)
31 : CStandAloneDialog(CGotoLineDlg::IDD
, pParent
)
35 CGotoLineDlg::~CGotoLineDlg()
39 void CGotoLineDlg::DoDataExchange(CDataExchange
* pDX
)
41 CStandAloneDialog::DoDataExchange(pDX
);
42 DDX_Text(pDX
, IDC_NUMBER
, m_nLine
);
43 DDX_Control(pDX
, IDC_NUMBER
, m_cNumber
);
47 BEGIN_MESSAGE_MAP(CGotoLineDlg
, CStandAloneDialog
)
53 BOOL
CGotoLineDlg::OnInitDialog()
55 CStandAloneDialog::OnInitDialog();
57 if (!m_sLabel
.IsEmpty())
59 SetDlgItemText(IDC_LINELABEL
, m_sLabel
);
61 SetDlgItemText(IDC_NUMBER
, L
"");
62 GetDlgItem(IDC_NUMBER
)->SetFocus();
68 void CGotoLineDlg::OnOK()
71 if ((m_nLine
< m_nLow
)||(m_nLine
> m_nHigh
))
74 sError
.FormatMessage(IDS_GOTO_OUTOFRANGE
, m_nLow
, m_nHigh
);
75 m_cNumber
.ShowBalloonTip(L
"", sError
);
76 m_cNumber
.SetSel(0, -1);
79 CStandAloneDialog::OnOK();