⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cpen.cpp

📁 基于Windml2.0的窗口系统原代码 , 以及和MFC CDC兼容的CDC
💻 CPP
字号:
#include "cpen.h"
#include "assert.h"
#include "CWMLHelp.h"

//##ModelId=40501B860356
CPen::CPen()
{
	m_nPenStyle = PS_SOLID;

	m_nWidth = 1;

	m_crColor = IND_BLACK;	
}

//##ModelId=40501B860357
CPen::CPen(int nPenStyle, int nWidth, COLORREF crColor)
{
	m_nPenStyle = nPenStyle;
	m_nWidth = nWidth;
	
	if(crColor < 0)
		m_crColor = 0;
	else
		m_crColor = CWMLHelp::GetColor(crColor);	
}

//##ModelId=40501B860361
CPen::~CPen()
{
	DeleteObject();	
}

//##ModelId=40501B860363
const CPen &CPen::operator=(const CPen &right)
{	
	m_nPenStyle = right.m_nPenStyle;

	m_nWidth = right.m_nWidth;

	m_crColor = right.m_crColor;	
	
	return *this;
}

//##ModelId=40501B86036A
bool CPen::CreatePen(int nPenStyle, int nWidth, COLORREF crColor)
{
	m_nPenStyle = nPenStyle;

	m_nWidth = nWidth;

	if(crColor < 0)
		m_crColor = 0;
	else
		m_crColor = CWMLHelp::GetColor(crColor);	
			
	return true;
}

//##ModelId=40501B860375
bool CPen::CreatePenIndirect(LPLOGPEN lpLogPen)
{
	m_nPenStyle = lpLogPen->lopnStyle;
	
    m_nWidth = lpLogPen->lopnWidth.x;
    
    m_crColor = CWMLHelp::GetColor(lpLogPen->lopnColor);
    
    return true;
}

//##ModelId=40501B86037E
bool CPen::CreateStockObject(int index)
{
	switch(index)
	{
		case BLACK_PEN:
			m_crColor = IND_BLACK;
			break;
		case WHITE_PEN:
			m_crColor = IND_WHITE;
			break;
		default:
			assert(false);
	}
	
	return true;
	
}

//##ModelId=3FC70480003E
bool CPen::DeleteObject()
{
	return true;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -