root/trunk/AddNewProjectFilesPage.cpp

Revision 5, 1.9 kB (checked in by qbert, 3 years ago)

Initial ( and last :( ) commit

Line 
1 // AddNewProjectFilesPage.cpp : implementation file
2 //
3
4 #include "stdafx.h"
5 #include "Elephant.h"
6 #include "AddNewProjectFilesPage.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 // CAddNewProjectFilesPage dialog
16
17
18 CAddNewProjectFilesPage::CAddNewProjectFilesPage(CWnd* pParent /*=NULL*/)
19
20 {
21     //{{AFX_DATA_INIT(CAddNewProjectFilesPage)
22         // NOTE: the ClassWizard will add member initialization here
23     //}}AFX_DATA_INIT
24 }
25
26
27 void CAddNewProjectFilesPage::DoDataExchange(CDataExchange* pDX)
28 {
29     CDialog::DoDataExchange(pDX);
30     //{{AFX_DATA_MAP(CAddNewProjectFilesPage)
31     DDX_Control(pDX, IDC_LIST1, m_files);
32     DDX_Control(pDX, IDC_BUTTON3, m_remove);
33     DDX_Control(pDX, IDC_BUTTON1, m_add);
34     //}}AFX_DATA_MAP
35 }
36
37
38 BEGIN_MESSAGE_MAP(CAddNewProjectFilesPage, CDialog)
39     //{{AFX_MSG_MAP(CAddNewProjectFilesPage)
40     ON_BN_CLICKED(IDC_BUTTON1, OnAdd)
41     ON_BN_CLICKED(IDC_BUTTON3, OnRemove)
42     //}}AFX_MSG_MAP
43 END_MESSAGE_MAP()
44
45 /////////////////////////////////////////////////////////////////////////////
46 // CAddNewProjectFilesPage message handlers
47
48 BOOL CAddNewProjectFilesPage::OnInitDialog()
49 {
50     CDialog::OnInitDialog();
51 // 
52     SetupButton(&m_add);
53     SetupButton(&m_remove);
54
55     m_files.InsertColumn(0,"File Path",LVCFMT_LEFT,280,0);
56
57     SetupListCtrl(&m_files);
58    
59     return TRUE;  // return TRUE unless you set the focus to a control
60                   // EXCEPTION: OCX Property Pages should return FALSE
61 }
62
63 void CAddNewProjectFilesPage::OnAdd()
64 {
65     vector<string> files;
66     GetFilesFromCFileDialog(Globals::lastDir,files);
67    
68     for ( int i = 0, count = m_files.GetItemCount();i < files.size();i++ ,count++)
69     {
70        
71         m_files.InsertItem(count,files[i].c_str() );
72     }
73    
74    
75 }
76
77 void CAddNewProjectFilesPage::OnRemove()
78 {
79     DeleteAllSelectedItems(&m_files)    ;
80 }
Note: See TracBrowser for help on using the browser.