OSDN Git Service

Add MFC Tab Control and Rebase Dialog.
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / RebaseDlg.cpp
1 // RebaseDlg.cpp : implementation file\r
2 //\r
3 \r
4 #include "stdafx.h"\r
5 #include "TortoiseProc.h"\r
6 #include "RebaseDlg.h"\r
7 \r
8 \r
9 // CRebaseDlg dialog\r
10 \r
11 IMPLEMENT_DYNAMIC(CRebaseDlg, CResizableStandAloneDialog)\r
12 \r
13 CRebaseDlg::CRebaseDlg(CWnd* pParent /*=NULL*/)\r
14         : CResizableStandAloneDialog(CRebaseDlg::IDD, pParent)\r
15     , m_bPickAll(FALSE)\r
16     , m_bSquashAll(FALSE)\r
17     , m_bEditAll(FALSE)\r
18 {\r
19 \r
20 }\r
21 \r
22 CRebaseDlg::~CRebaseDlg()\r
23 {\r
24 }\r
25 \r
26 void CRebaseDlg::DoDataExchange(CDataExchange* pDX)\r
27 {\r
28     CDialog::DoDataExchange(pDX);\r
29     DDX_Control(pDX, IDC_REBASE_PROGRESS, m_ProgressBar);\r
30     DDX_Control(pDX, IDC_STATUS_STATIC, m_CtrlStatusText);\r
31     DDX_Check(pDX, IDC_PICK_ALL, m_bPickAll);\r
32     DDX_Check(pDX, IDC_SQUASH_ALL, m_bSquashAll);\r
33     DDX_Check(pDX, IDC_EDIT_ALL, m_bEditAll);\r
34 }\r
35 \r
36 \r
37 BEGIN_MESSAGE_MAP(CRebaseDlg, CResizableStandAloneDialog)\r
38     ON_BN_CLICKED(IDC_PICK_ALL, &CRebaseDlg::OnBnClickedPickAll)\r
39     ON_BN_CLICKED(IDC_SQUASH_ALL, &CRebaseDlg::OnBnClickedSquashAll)\r
40     ON_BN_CLICKED(IDC_EDIT_ALL, &CRebaseDlg::OnBnClickedEditAll)\r
41     ON_BN_CLICKED(IDC_REBASE_SPLIT, &CRebaseDlg::OnBnClickedRebaseSplit)\r
42 END_MESSAGE_MAP()\r
43 \r
44 BOOL CRebaseDlg::OnInitDialog()\r
45 {\r
46         CResizableStandAloneDialog::OnInitDialog();\r
47 \r
48         CRect rectDummy;\r
49         //IDC_REBASE_DUMY_TAB\r
50         \r
51         CWnd *pwnd=this->GetDlgItem(IDC_REBASE_DUMY_TAB);\r
52         pwnd->GetWindowRect(&rectDummy);\r
53         \r
54         if (!m_ctrlTabCtrl.Create(CMFCTabCtrl::STYLE_FLAT, rectDummy, this, 0))\r
55         {\r
56                 TRACE0("Failed to create output tab window\n");\r
57                 return FALSE;      // fail to create\r
58         }\r
59         m_ctrlTabCtrl.SetResizeMode(CMFCTabCtrl::RESIZE_NO);\r
60         // Create output panes:\r
61         //const DWORD dwStyle = LBS_NOINTEGRALHEIGHT | WS_CHILD | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL;\r
62         const DWORD dwStyle =LVS_REPORT | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_OWNERDATA | WS_BORDER | WS_TABSTOP |LVS_SINGLESEL |WS_CHILD | WS_VISIBLE;\r
63 \r
64         if (! this->m_FileListCtrl.Create(dwStyle,rectDummy,&this->m_ctrlTabCtrl,0) )\r
65         {\r
66                 TRACE0("Failed to create output windows\n");\r
67                 return FALSE;      // fail to create\r
68         }\r
69 \r
70         if( ! this->m_LogMessageCtrl.Create(_T("Scintilla"),_T("source"),0,rectDummy,&m_ctrlTabCtrl,0,0) )\r
71         {\r
72                 TRACE0("Failed to create log message control");\r
73                 return FALSE;\r
74         }\r
75 \r
76         m_ctrlTabCtrl.AddTab(&m_FileListCtrl,_T("Modified File"));\r
77         m_ctrlTabCtrl.AddTab(&m_LogMessageCtrl,_T("Log Message"),1);\r
78 \r
79         return TRUE;\r
80 }\r
81 // CRebaseDlg message handlers\r
82 \r
83 void CRebaseDlg::OnBnClickedPickAll()\r
84 {\r
85     // TODO: Add your control notification handler code here\r
86 }\r
87 \r
88 void CRebaseDlg::OnBnClickedSquashAll()\r
89 {\r
90     // TODO: Add your control notification handler code here\r
91 }\r
92 \r
93 void CRebaseDlg::OnBnClickedEditAll()\r
94 {\r
95     // TODO: Add your control notification handler code here\r
96 }\r
97 \r
98 void CRebaseDlg::OnBnClickedRebaseSplit()\r
99 {\r
100     // TODO: Add your control notification handler code here\r
101 }\r