1 // TortoiseSVN - a Windows shell extension for easy version control
\r
3 // Copyright (C) 2003-2008 - TortoiseSVN
\r
5 // This program is free software; you can redistribute it and/or
\r
6 // modify it under the terms of the GNU General Public License
\r
7 // as published by the Free Software Foundation; either version 2
\r
8 // of the License, or (at your option) any later version.
\r
10 // This program is distributed in the hope that it will be useful,
\r
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 // GNU General Public License for more details.
\r
15 // You should have received a copy of the GNU General Public License
\r
16 // along with this program; if not, write to the Free Software Foundation,
\r
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
\r
21 #include "TortoiseProc.h"
\r
23 #include ".\urldlg.h"
\r
25 IMPLEMENT_DYNAMIC(CURLDlg, CResizableStandAloneDialog)
\r
26 CURLDlg::CURLDlg(CWnd* pParent /*=NULL*/)
\r
27 : CResizableStandAloneDialog(CURLDlg::IDD, pParent)
\r
35 void CURLDlg::DoDataExchange(CDataExchange* pDX)
\r
37 CResizableStandAloneDialog::DoDataExchange(pDX);
\r
38 DDX_Control(pDX, IDC_URLCOMBO, m_URLCombo);
\r
42 BEGIN_MESSAGE_MAP(CURLDlg, CResizableStandAloneDialog)
\r
47 BOOL CURLDlg::OnInitDialog()
\r
49 CResizableStandAloneDialog::OnInitDialog();
\r
51 m_URLCombo.SetURLHistory(TRUE);
\r
52 m_URLCombo.LoadHistory(_T("Software\\TortoiseGit\\History\\repoURLS"), _T("url"));
\r
53 m_URLCombo.SetCurSel(0);
\r
54 m_URLCombo.SetFocus();
\r
57 GetWindowRect(&rect);
\r
58 m_height = rect.bottom - rect.top;
\r
59 AddAnchor(IDC_LABEL, TOP_LEFT);
\r
60 AddAnchor(IDC_URLCOMBO, TOP_LEFT, TOP_RIGHT);
\r
61 AddAnchor(IDOK, BOTTOM_RIGHT);
\r
62 AddAnchor(IDCANCEL, BOTTOM_RIGHT);
\r
63 EnableSaveRestore(_T("URLDlg"));
\r
67 void CURLDlg::OnOK()
\r
69 if (m_URLCombo.IsWindowEnabled())
\r
71 m_URLCombo.SaveHistory();
\r
72 m_url = m_URLCombo.GetString();
\r
76 CResizableStandAloneDialog::OnOK();
\r
80 void CURLDlg::OnSizing(UINT fwSide, LPRECT pRect)
\r
82 // don't allow the dialog to be changed in height
\r
86 case WMSZ_BOTTOMLEFT:
\r
87 case WMSZ_BOTTOMRIGHT:
\r
88 pRect->bottom = pRect->top + m_height;
\r
93 pRect->top = pRect->bottom - m_height;
\r
96 CResizableStandAloneDialog::OnSizing(fwSide, pRect);
\r