OSDN Git Service

Complete Send mail coding and mail send have some problem.
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / URLDlg.cpp
1 // TortoiseSVN - a Windows shell extension for easy version control\r
2 \r
3 // Copyright (C) 2003-2008 - TortoiseSVN\r
4 \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
9 \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
14 \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
18 //\r
19 #include "stdafx.h"\r
20 \r
21 #include "TortoiseProc.h"\r
22 #include "URLDlg.h"\r
23 #include ".\urldlg.h"\r
24 \r
25 IMPLEMENT_DYNAMIC(CURLDlg, CResizableStandAloneDialog)\r
26 CURLDlg::CURLDlg(CWnd* pParent /*=NULL*/)\r
27         : CResizableStandAloneDialog(CURLDlg::IDD, pParent)\r
28 {\r
29 }\r
30 \r
31 CURLDlg::~CURLDlg()\r
32 {\r
33 }\r
34 \r
35 void CURLDlg::DoDataExchange(CDataExchange* pDX)\r
36 {\r
37         CResizableStandAloneDialog::DoDataExchange(pDX);\r
38         DDX_Control(pDX, IDC_URLCOMBO, m_URLCombo);\r
39 }\r
40 \r
41 \r
42 BEGIN_MESSAGE_MAP(CURLDlg, CResizableStandAloneDialog)\r
43         ON_WM_SIZING()\r
44 END_MESSAGE_MAP()\r
45 \r
46 \r
47 BOOL CURLDlg::OnInitDialog()\r
48 {\r
49         CResizableStandAloneDialog::OnInitDialog();\r
50 \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
55 \r
56         RECT rect;\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
64         return FALSE;\r
65 }\r
66 \r
67 void CURLDlg::OnOK()\r
68 {\r
69         if (m_URLCombo.IsWindowEnabled())\r
70         {\r
71                 m_URLCombo.SaveHistory();\r
72                 m_url = m_URLCombo.GetString();\r
73                 UpdateData();\r
74         }\r
75 \r
76         CResizableStandAloneDialog::OnOK();\r
77 }\r
78 \r
79 \r
80 void CURLDlg::OnSizing(UINT fwSide, LPRECT pRect)\r
81 {\r
82         // don't allow the dialog to be changed in height\r
83         switch (fwSide)\r
84         {\r
85         case WMSZ_BOTTOM:\r
86         case WMSZ_BOTTOMLEFT:\r
87         case WMSZ_BOTTOMRIGHT:\r
88                 pRect->bottom = pRect->top + m_height;\r
89                 break;\r
90         case WMSZ_TOP:\r
91         case WMSZ_TOPLEFT:\r
92         case WMSZ_TOPRIGHT:\r
93                 pRect->top = pRect->bottom - m_height;\r
94                 break;\r
95         }\r
96         CResizableStandAloneDialog::OnSizing(fwSide, pRect);    \r
97 }\r