Files
envi-code/SourceCode/Code2026/EarthWormMain/CmdGroupWnd.h
T

94 lines
1.7 KiB
C++
Raw Normal View History

2026-10-04 00:04:20 +08:00
#pragma once
2026-09-28 15:28:50 +08:00
#include <afxwin.h>
class CmdGroupWnd : public CWnd
{
public:
enum ETYPE
{
2026-10-04 00:04:20 +08:00
// 以下为内容样式
eIcon = 0, // 图标样式
eList, // 列表样式
ePanel, // 面板样式
2026-09-28 15:28:50 +08:00
2026-10-04 00:04:20 +08:00
// 以下为窗口状态
eMin, // 最小
eMax, // 最大
2026-09-28 15:28:50 +08:00
2026-10-04 00:04:20 +08:00
// 以下为窗口配色样式
eDark, // 黑
eLight, // 亮
2026-09-28 15:28:50 +08:00
eNone,
};
private:
2026-10-04 00:04:20 +08:00
// 窗口宽高
2026-09-28 15:28:50 +08:00
CSize m_szWnd;
2026-10-04 00:04:20 +08:00
// 非客户区高
2026-09-28 15:28:50 +08:00
int m_nNcH;
2026-10-04 00:04:20 +08:00
// 窗口状态
2026-09-28 15:28:50 +08:00
ETYPE m_eWndSta;
2026-10-04 00:04:20 +08:00
// 内容样式
2026-09-28 15:28:50 +08:00
ETYPE m_eContentStyle;
2026-10-04 00:04:20 +08:00
// 窗口配色样式
2026-09-28 15:28:50 +08:00
ETYPE m_eWndStyle;
2026-10-04 00:04:20 +08:00
// 窗口名称
2026-09-28 15:28:50 +08:00
CString m_sWndName;
2026-10-04 00:04:20 +08:00
// 边框厚度
2026-09-28 15:28:50 +08:00
int m_nBorder;
public:
CmdGroupWnd(LPCTSTR pszName
, const ETYPE & ContentStyle
, const ETYPE & WndStyle);
virtual ~CmdGroupWnd();
2026-10-04 00:04:20 +08:00
// pt是pParent上的相对点,不是屏幕点
2026-09-28 15:28:50 +08:00
bool Create(const CRect &rc, CWnd *pParent);
2026-10-04 00:04:20 +08:00
// caption面板底色
2026-09-28 15:28:50 +08:00
COLORREF baseCaptionClr();
2026-10-04 00:04:20 +08:00
// 边框色
2026-09-28 15:28:50 +08:00
COLORREF borderColor();
2026-10-04 00:04:20 +08:00
// 面板底色
2026-09-28 15:28:50 +08:00
COLORREF basePanelClr();
2026-10-04 00:04:20 +08:00
// 改变窗口状态(收缩/展开)
2026-09-28 15:28:50 +08:00
void expandWnd(ETYPE expand);
2026-10-04 00:04:20 +08:00
// 得到bmp资源上的按钮位置
2026-09-28 15:28:50 +08:00
CPoint getNcBtnBmpPos(const ETYPE &conteneStyle, const ETYPE & wndStyle, bool bSelect);
2026-10-04 00:04:20 +08:00
// 得到窗口caption上的按钮绘制位置
2026-09-28 15:28:50 +08:00
CRect getNcBtnWndPos(const ETYPE &btn);
2026-10-04 00:04:20 +08:00
// 重排命令按钮
2026-09-28 15:28:50 +08:00
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);
};