//小G,2009.12 //v1.0 #pragma once // CDrawer class CDrawer : public CStatic { DECLARE_DYNAMIC(CDrawer) public: CDrawer(); virtual ~CDrawer(); protected: DECLARE_MESSAGE_MAP() public: UINT m_nBtnNum; UINT m_nOpenWnd; BOOL m_bClick; CTreeCtrl* m_pTreeCtrl; CString *pstrTitle; public: BOOL InitData(UINT nBtnNum, UINT nOpenWnd); public: virtual void DrawItem(LPDRAWITEMSTRUCT /*lpDrawItemStruct*/); public: afx_msg void OnMouseMove(UINT nFlags, CPoint point); public: afx_msg void OnLButtonDown(UINT nFlags, CPoint point); public: BOOL CreatDrawer(UINT nItemNum, CRect& rect, CWnd *pParentWnd, UINT nDefaultOpenedDrawerNum = 3); public: void SetTitle(UINT nItemIndex, CString str); void GetTitle(UINT nItemIndex, CString &str); public: void DrawBtn(); }; // 小G,2009.12 // v1.0 #include "stdafx.h" #include "Locker.h" #include "Drawer.h" // CDrawer IMPLEMENT_DYNAMIC(CDrawer, CStatic) CDrawer::CDrawer() { m_nBtnNum = 5; m_nOpenWnd = 0; m_pTreeCtrl = NULL; m_bClick = false; pstrTitle = NULL; } CDrawer::~CDrawer() { if(NULL != m_pTreeCtrl) m_pTreeCtrl->DestroyWindow(); m_pTreeCtrl = NULL; if(pstrTitle != NULL) { for(int i = 0;i < m_nBtnNum;i ++) { pstrTitle[i].ReleaseBuffer(); } } pstrTit