📄 engcolorsel.cpp
字号:
// EngColorSel.cpp : implementation file
//
#include "stdafx.h"
#include "EngColorSel.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CEngColorSel
CEngColorSel::CEngColorSel()
{
m_crColor=RGB(255,255,255);
}
CEngColorSel::~CEngColorSel()
{
}
BEGIN_MESSAGE_MAP(CEngColorSel, CStatic)
//{{AFX_MSG_MAP(CEngColorSel)
ON_WM_PAINT()
ON_WM_LBUTTONDOWN()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CEngColorSel message handlers
void CEngColorSel::OnPaint()
{
CPaintDC dc(this); // device context for painting
CRect rect;
GetClientRect(&rect);
dc.FillSolidRect(rect,m_crColor);
// Do not call CStatic::OnPaint() for painting messages
}
void CEngColorSel::SetColor(COLORREF color)
{
m_crColor=color;
}
COLORREF CEngColorSel::GetColor()
{
return m_crColor;
}
void CEngColorSel::OnLButtonDown(UINT nFlags, CPoint point)
{
CColorDialog ccd(m_crColor);
if(ccd.DoModal()==IDOK)
{
m_crColor=ccd.GetColor();
Invalidate();
}
CStatic::OnLButtonDown(nFlags, point);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -