root/trunk/BackupProjectDlg.cpp

Revision 5, 2.4 kB (checked in by qbert, 6 years ago)

Initial ( and last :( ) commit

Line 
1 // BackupProjectDlg.cpp : implementation file
2 //
3
4 #include "stdafx.h"
5 #include "Elephant.h"
6 #include "BackupProjectDlg.h"
7
8 #ifdef _DEBUG
9 #define new DEBUG_NEW
10 #undef THIS_FILE
11 static char THIS_FILE[] = __FILE__;
12 #endif
13
14 /////////////////////////////////////////////////////////////////////////////
15 // CBackupProjectDlg dialog
16
17
18 CBackupProjectDlg::CBackupProjectDlg(CWnd* pParent /*=NULL*/)
19     : CXTResizeDialog(CBackupProjectDlg::IDD, pParent)
20 {
21     //{{AFX_DATA_INIT(CBackupProjectDlg)
22     //}}AFX_DATA_INIT
23 }
24
25
26 void CBackupProjectDlg::DoDataExchange(CDataExchange* pDX)
27 {
28     CXTResizeDialog::DoDataExchange(pDX);
29     //{{AFX_DATA_MAP(CBackupProjectDlg)
30     DDX_Control(pDX, IDC_STATIC1, m_s1);
31     DDX_Control(pDX, IDC_LIST1, m_constants);
32     DDX_Control(pDX, IDC_EDIT2, m_name);
33     DDX_Control(pDX, IDC_EDIT1, m_path);
34     DDX_Control(pDX, IDC_BUTTON1, m_browse);
35     //}}AFX_DATA_MAP
36 }
37
38
39 BEGIN_MESSAGE_MAP(CBackupProjectDlg, CXTResizeDialog)
40     //{{AFX_MSG_MAP(CBackupProjectDlg)
41     ON_WM_SIZE()
42     ON_BN_CLICKED(IDC_BUTTON3, OnBackup)
43     ON_WM_DESTROY()
44     //}}AFX_MSG_MAP
45 END_MESSAGE_MAP()
46
47 /////////////////////////////////////////////////////////////////////////////
48 // CBackupProjectDlg message handlers
49
50 BOOL CBackupProjectDlg::OnInitDialog()
51 {
52     CXTResizeDialog::OnInitDialog();
53    
54     // TODO: Add extra initialization here
55     SetupButton(&m_browse);
56     m_name.SetText("Backup file name [ constants below ].");
57     m_path.SetText("Path to folder.");
58
59
60     m_constants.InsertColumn(0,"Constant Name",LVCFMT_LEFT,180);
61     m_constants.InsertColumn(1,"Current Value",LVCFMT_LEFT,240);
62
63     SetupListCtrl(&m_constants);
64     SetupTitle(&m_s1);
65
66     SetResize(IDC_BUTTON3 ,SZ_BOTTOM_RIGHT,SZ_BOTTOM_RIGHT);
67     SetResize(IDC_BUTTON1 ,SZ_TOP_RIGHT,SZ_TOP_RIGHT);
68     SetResize(IDC_EDIT1 ,SZ_TOP_LEFT,SZ_TOP_RIGHT);
69     SetResize(IDC_EDIT2,SZ_TOP_LEFT,SZ_TOP_RIGHT);
70     SetResize(IDC_LIST1 ,SZ_TOP_LEFT,SZ_BOTTOM_RIGHT);
71
72     LoadPlacement("CBackupProjectDlg");
73     return TRUE;  // return TRUE unless you set the focus to a control
74                   // EXCEPTION: OCX Property Pages should return FALSE
75 }
76
77 void CBackupProjectDlg::OnSize(UINT nType, int cx, int cy)
78 {
79     CXTResizeDialog::OnSize(nType, cx, cy);
80    
81     m_constants.SetColumnWidth(1,cx-180);
82    
83 }
84
85 void CBackupProjectDlg::OnBackup()
86 {
87    
88     EndDialog(1);
89        
90    
91 }
92
93 void CBackupProjectDlg::OnDestroy()
94 {
95     CXTResizeDialog::OnDestroy();
96     SavePlacement("CBackupProjectDlg");
97     // TODO: Add your message handler code here
98    
99 }
Note: See TracBrowser for help on using the browser.