- #include "resource.h"
- //图纸层类
- class CFileLayer: public CObject
- {
- private:
- CString m_name;
- BOOL m_show; //图层显示标记
- BOOL m_locked; //图层锁定标记
- public:
- CFileLayer(CString m_name, BOOL show, BOOL locked);
- CFileLayer()
- {}
- DECLARE_SERIAL(CFileLayer)
- void Serialize(CArchive& ar);
- operator =(const CFileLayer& Layer);
- public:
- BOOL IsShow();
- BOOL IsLocked();
- void SetShow(BOOL flag);
- void SetLocked(BOOL flag);
- void SetName(CString name);
- CString GetName();
- };
- ////////////////////////////////////////////////////////////////////////////////////////////
- class CManageFileLayer:public CObject
- {
- private:
- CObArray m_LayerArray;
- public:
- CManageFileLayer();
- ~CManageFileLayer();
- void Serialize(CArchive& ar);
- public:
- UINT GetLayerNum();
- void AddLayer(CString m_name, BOOL show, BOOL locked); //增加图层
- void DelLayer(CString name); //删除图层,参数为图层名
- CFileLayer* GetLayer(int index); //获取图层指针
- CFileLayer* GetLayer(CString name); //获取图层指针,参数为图层名
- private:
- CString CurrentLayerName; //当前图层名
- public:
- void SetCurrentLayerName(CString name); //设置当前图层名
- CString GetCurrentLayerName(); //获取当前图层名
- };
- /////////////////////////////////////////////////////////////////////////////
- #define ICON_LOCKFLAG 1
- #define ICON_UNLOCKFLAG 2
- #define ICON_SHOWFLAG 3
- #define ICON_HIDEFLAG 4
- #define ICON_CURRENTFLAG 5
- #define ICON_NOCURRENTFLAG 6
- // CFileLayerDlg dialog
- class CFileLayerDlg : public CDialog
- {
- // Construction
- public:
- CFileLayerDlg(CWnd* pParent = NULL); // standard constructor
- private:
- BOOL NewFlag;
- CManageFileLayer* pManageFileLayer;
- CString FileName;
- public:
- void Create(CString name, CManageFileLayer* pManageLayer);
- // Dialog Data
- //{{AFX_DATA(CFileLayerDlg)
- enum { IDD = IDD_MANAGELAYER };
- CStatic m_name;
- CListCtrl m_LayerList;
- //}}AFX_DATA
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CFileLayerDlg)
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
- // Implementation
- protected:
- // Generated message map functions
- //{{AFX_MSG(CFileLayerDlg)
- virtual BOOL OnInitDialog();
- afx_msg void OnNew();
- afx_msg void OnDelete();
- afx_msg void OnDblclkLayerlist(NMHDR* pNMHDR, LRESULT* pResult);
- afx_msg void OnEndlabeleditLayerlist(NMHDR* pNMHDR, LRESULT* pResult);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };