#pragma once #include class CmdGroupWnd : public CWnd { public: enum ETYPE { // 以下为内容样式 eIcon = 0, // 图标样式 eList, // 列表样式 ePanel, // 面板样式 // 以下为窗口状态 eMin, // 最小 eMax, // 最大 // 以下为窗口配色样式 eDark, // 黑 eLight, // 亮 eNone, }; private: // 窗口宽高 CSize m_szWnd; // 非客户区高 int m_nNcH; // 窗口状态 ETYPE m_eWndSta; // 内容样式 ETYPE m_eContentStyle; // 窗口配色样式 ETYPE m_eWndStyle; // 窗口名称 CString m_sWndName; // 边框厚度 int m_nBorder; public: CmdGroupWnd(LPCTSTR pszName , const ETYPE & ContentStyle , const ETYPE & WndStyle); virtual ~CmdGroupWnd(); // pt是pParent上的相对点,不是屏幕点 bool Create(const CRect &rc, CWnd *pParent); // caption面板底色 COLORREF baseCaptionClr(); // 边框色 COLORREF borderColor(); // 面板底色 COLORREF basePanelClr(); // 改变窗口状态(收缩/展开) void expandWnd(ETYPE expand); // 得到bmp资源上的按钮位置 CPoint getNcBtnBmpPos(const ETYPE &conteneStyle, const ETYPE & wndStyle, bool bSelect); // 得到窗口caption上的按钮绘制位置 CRect getNcBtnWndPos(const ETYPE &btn); // 重排命令按钮 void refreshCmdBtn(const ETYPE & contentStyle); // void refreshParent(); // void MoveWindow(LPCRECT lpRect, BOOL bRepaint = TRUE); public: DECLARE_MESSAGE_MAP() afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS* lpncsp); afx_msg void OnNcPaint(); afx_msg void OnPaint(); afx_msg void OnNcLButtonDblClk(UINT nHitTest, CPoint point); afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point); };