OSDN Git Service

Enable Submodule Add dialog resizable
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / SubmoduleAddDlg.cpp
1 // SubmoduleAddDlg.cpp : implementation file\r
2 //\r
3 \r
4 #include "stdafx.h"\r
5 #include "resource.h"\r
6 #include "SubmoduleAddDlg.h"\r
7 \r
8 \r
9 // CSubmoduleAddDlg dialog\r
10 \r
11 IMPLEMENT_DYNAMIC(CSubmoduleAddDlg, CResizableStandAloneDialog)\r
12 \r
13 CSubmoduleAddDlg::CSubmoduleAddDlg(CWnd* pParent /*=NULL*/)\r
14         : CResizableStandAloneDialog(CSubmoduleAddDlg::IDD, pParent)\r
15         , m_bBranch(FALSE)\r
16         , m_strBranch(_T(""))\r
17 {\r
18 \r
19 }\r
20 \r
21 CSubmoduleAddDlg::~CSubmoduleAddDlg()\r
22 {\r
23 }\r
24 \r
25 void CSubmoduleAddDlg::DoDataExchange(CDataExchange* pDX)\r
26 {\r
27         CDialog::DoDataExchange(pDX);\r
28         DDX_Control(pDX, IDC_COMBOBOXEX_REPOSITORY, m_Repository);\r
29         DDX_Control(pDX, IDC_COMBOBOXEX_PATH, m_PathCtrl);\r
30         DDX_Check(pDX, IDC_BRANCH_CHECK, m_bBranch);\r
31         DDX_Text(pDX, IDC_SUBMODULE_BRANCH, m_strBranch);\r
32 }\r
33 \r
34 \r
35 BEGIN_MESSAGE_MAP(CSubmoduleAddDlg, CResizableStandAloneDialog)\r
36         ON_COMMAND(IDC_REP_BROWSE,                      OnRepBrowse)\r
37         ON_COMMAND(IDC_BUTTON_PATH_BROWSE,      OnPathBrowse)\r
38         ON_COMMAND(IDC_BRANCH_CHECK,            OnBranchCheck)\r
39 END_MESSAGE_MAP()\r
40 \r
41 \r
42 // CSubmoduleAddDlg message handlers\r
43 \r
44 BOOL CSubmoduleAddDlg::OnInitDialog()\r
45 {\r
46         CResizableStandAloneDialog::OnInitDialog();\r
47 \r
48         AddAnchor(IDOK,BOTTOM_RIGHT);\r
49         AddAnchor(IDCANCEL,BOTTOM_RIGHT);\r
50         AddAnchor(IDC_GROUP_SUBMODULE,TOP_LEFT,BOTTOM_RIGHT);\r
51         AddAnchor(IDC_COMBOBOXEX_REPOSITORY,TOP_LEFT,TOP_RIGHT);\r
52         AddAnchor(IDC_COMBOBOXEX_PATH,TOP_LEFT,TOP_RIGHT);\r
53         AddAnchor(IDC_REP_BROWSE,TOP_RIGHT);\r
54         AddAnchor(IDC_BUTTON_PATH_BROWSE,TOP_RIGHT);    \r
55         AddAnchor(IDC_BRANCH_CHECK,BOTTOM_LEFT);\r
56         AddAnchor(IDC_SUBMODULE_BRANCH,BOTTOM_LEFT,BOTTOM_RIGHT);\r
57 \r
58 \r
59         AddOthersToAnchor();\r
60 \r
61         EnableSaveRestore(_T("SubmoduleAddDlg"));\r
62 \r
63         m_Repository.SetURLHistory(true);\r
64         m_PathCtrl.SetPathHistory(true);\r
65 \r
66         return TRUE;\r
67 }\r
68 \r
69 void CSubmoduleAddDlg::OnRepBrowse()\r
70 {\r
71 }\r
72 void CSubmoduleAddDlg::OnPathBrowse()\r
73 {\r
74 }\r
75 void CSubmoduleAddDlg::OnBranchCheck()\r
76 {\r
77         this->UpdateData();\r
78         if(this->m_bBranch)\r
79         {\r
80                 this->GetDlgItem(IDC_SUBMODULE_BRANCH)->ShowWindow(TRUE);               \r
81         }else\r
82         {\r
83                 this->GetDlgItem(IDC_SUBMODULE_BRANCH)->ShowWindow(FALSE);              \r
84         }\r
85 }