1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2003-2008 - 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.
21 #include "TortoiseProc.h"
24 IMPLEMENT_DYNAMIC(CURLDlg
, CResizableStandAloneDialog
)
25 CURLDlg::CURLDlg(CWnd
* pParent
/*=nullptr*/)
26 : CResizableStandAloneDialog(CURLDlg::IDD
, pParent
)
35 void CURLDlg::DoDataExchange(CDataExchange
* pDX
)
37 CResizableStandAloneDialog::DoDataExchange(pDX
);
38 DDX_Control(pDX
, IDC_URLCOMBO
, m_URLCombo
);
42 BEGIN_MESSAGE_MAP(CURLDlg
, CResizableStandAloneDialog
)
47 BOOL
CURLDlg::OnInitDialog()
49 CResizableStandAloneDialog::OnInitDialog();
51 m_URLCombo
.SetURLHistory(TRUE
);
52 m_URLCombo
.LoadHistory(_T("Software\\TortoiseGit\\History\\repoURLS"), _T("url"));
53 m_URLCombo
.SetCurSel(0);
54 m_URLCombo
.SetFocus();
58 m_height
= rect
.bottom
- rect
.top
;
59 AddAnchor(IDC_LABEL
, TOP_LEFT
);
60 AddAnchor(IDC_URLCOMBO
, TOP_LEFT
, TOP_RIGHT
);
61 AddAnchor(IDOK
, BOTTOM_RIGHT
);
62 AddAnchor(IDCANCEL
, BOTTOM_RIGHT
);
63 EnableSaveRestore(_T("URLDlg"));
69 if (m_URLCombo
.IsWindowEnabled())
71 m_URLCombo
.SaveHistory();
72 m_url
= m_URLCombo
.GetString();
76 CResizableStandAloneDialog::OnOK();
80 void CURLDlg::OnSizing(UINT fwSide
, LPRECT pRect
)
82 // don't allow the dialog to be changed in height
87 case WMSZ_BOTTOMRIGHT
:
88 pRect
->bottom
= pRect
->top
+ m_height
;
93 pRect
->top
= pRect
->bottom
- m_height
;
96 CResizableStandAloneDialog::OnSizing(fwSide
, pRect
);