1 #ifndef FILEPANE_H_INCLUDED
2 #define FILEPANE_H_INCLUDED
3 
4 #include "includes.h"
5 
6 enum
7 {
8     FP_PROJECT = 0,
9     FP_FOLDER,
10     FP_SOURCE,
11     FP_INCLUDE,
12     FP_OTHER,
13     FP_SIZE
14 };
15 
16 typedef struct _TAG_ITEMPARAM
17 {
18     std::string sName;
19     std::string sPath;
20 } ItemParam;
21 
22 class FilePane
23 {
24 public:
25     FilePane(HWND hWnd);
26     ~FilePane();
27     int LoadDefaultPane();
28     int LoadProject(const char *szPath);
29     int LoadProject(std::string &sPath);
30     int AddSourceFile(std::string &sName, std::string &sPath);
31     int AddSourceFile(const char *szName, const char *szPath);
32     int AddIncludeFile(std::string &sName, std::string &sPath);
33     int AddIncludeFile(const char *szName, const char *szPath);
34     int AddOtherFile(std::string &sName, std::string &sPath);
35     int AddOtherFile(const char *szName, const char *szPath);
36     int Resize(RECT &rc);
37     int Resize(int x, int y, int cx, int cy);
38     int GetCurSelPath(char *szBuff, int iMax);
IsOpen()39     bool IsOpen() {return m_bHaveProject;}
40     int NewProject(const char *szName, const char *szPath);
41     int NewProject(std::string &sName, std::string &sPath);
42     int RemoveSelected();
43 
44 private:
45     int CreateTreeView();
46     void CreateImageList();
47     void DeleteNodes(HTREEITEM hRoot);
48     HTREEITEM AddItem(HTREEITEM hParent, std::string &sItem, int iType, ItemParam *pIP = NULL, bool bSort = true);
49     HTREEITEM AddItem(HTREEITEM hParent, const char *szItem, int iType, ItemParam *pIP = NULL, bool bSort = true);
50     int UpdateItem(HTREEITEM hItem, const char *szItem, ItemParam *pIP = NULL);
51     int WriteProject();
52 
53     HIMAGELIST m_hImgList;
54     HTREEITEM m_hTreeRoot;
55     HTREEITEM m_hTreeSource;
56     HTREEITEM m_hTreeInclude;
57     HTREEITEM m_hTreeOther;
58 
59     HWND m_hParent;
60     HWND m_hTree;
61 
62     //std::string m_sProj;
63     //LList<std::string> m_fileList;
64     int m_anImages[FP_SIZE];
65     bool m_bHaveProject;
66 };
67 
68 #endif
69