www.pudn.com > subject_1_113294.rar > Element.cpp, change:2002-05-25,size:1787b


// Element.cpp: implementation of the CElement class. 
// 
////////////////////////////////////////////////////////////////////// 
 
#include "stdafx.h" 
#include "Paint.h" 
#include "Element.h" 
 
#ifdef _DEBUG 
#undef THIS_FILE 
static char THIS_FILE[]=__FILE__; 
#define new DEBUG_NEW 
#endif 
 
////////////////////////////////////////////////////////////////////// 
// Construction/Destruction 
////////////////////////////////////////////////////////////////////// 
 
CElement::CElement() 
{ 
	LineStyle=0; 
	LineWidth=1; 
	LineColor=RGB(0,0,0); 
	FillMode=-1; 
	FillColor=RGB(0,0,0); 
	m_ExRect.left=0; 
	m_ExRect.right=0; 
	m_ExRect.top=0; 
	m_ExRect.bottom=0; 
	IsSelected=false; 
	IsFilled=false; 
} 
 
CElement::~CElement() 
{ 
} 
 
void CElement::Serialize(CArchive &ar) 
{ 
	if(ar.IsStoring()) 
	{ 
		ar<<LineStyle; 
		ar<<LineWidth; 
		ar<<LineColor; 
		ar<<FillMode; 
		ar<<FillColor; 
		ar<<m_ExRect; 
		int temp=IsSelected; 
		ar<<temp; 
		temp=IsFilled; 
		ar<<temp; 
	} 
	else 
	{ 
		ar>>LineStyle; 
		ar>>LineWidth; 
		ar>>LineColor; 
		ar>>FillMode; 
		ar>>FillColor; 
		ar>>m_ExRect; 
		int temp; 
		ar>>temp; 
		IsSelected=(bool)temp; 
		ar>>temp; 
		IsFilled=(bool)temp; 
	} 
 
} 
 
void CElement::SetLineStyle(int Style) 
{ 
	this->LineStyle=Style; 
} 
 
void CElement::SetLineColor(COLORREF Color) 
{ 
	this->LineColor=Color; 
} 
 
void CElement::SetLineWidth(int Width) 
{ 
	this->LineWidth=Width; 
} 
 
void CElement::SetLine(int Style,int Width,COLORREF Color) 
{ 
	this->LineStyle=Style; 
	this->LineWidth=Width; 
	this->LineColor=Color; 
} 
 
void CElement::SetIsFill(bool Flag) 
{ 
	this->IsFilled=Flag; 
} 
 
void CElement::SetFillMode(int Mode) 
{ 
	this->FillMode=Mode; 
} 
 
void CElement::SetFillColor(COLORREF Color) 
{ 
	this->FillColor=Color; 
}