📄 rectlinearray.cpp
字号:
// RectLineArray.cpp: implementation of the CRectLineArray class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "WellDataProcess.h"
#include "RectLineArray.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CRectLineArray::CRectLineArray()
{
}
CRectLineArray::~CRectLineArray()
{
Clear();
}
int CRectLineArray::AddLine(CPoint point,int nWidth)
{
CRectLineUnit* pLine = new CRectLineUnit(point,nWidth);
return Add(pLine);
}
void CRectLineArray::Draw(CDC* pDC)
{
int nCount = GetSize();
CPen pen(PS_SOLID,1,RGB(255,0,0));
CPen* pOldPen = pDC->SelectObject (&pen);
for (int i=0;i<nCount;i++)
(*this)[i]->Draw (pDC);
pDC->SelectObject (pOldPen);
}
int CRectLineArray::AddLine(int x,int y,int nWidth)
{
CRectLineUnit* pLine = new CRectLineUnit(x,y,nWidth);
return Add(pLine);
}
CRectLineUnit* CRectLineArray::HitTest(CPoint point)
{
int nCount = GetSize();
int i;
for(i = 0; i < nCount; i ++)
{
(*this)[i]->m_bSelect = FALSE;
}
for (i=0;i<nCount;i++)
{
if ((*this)[i]->HitTest (point))
return (*this)[i];
}
return NULL;
}
void CRectLineArray::Clear()
{
int nCount = GetSize();
for (int i=0;i<nCount;i++)
{
CRectLineUnit* pLine = (*this)[i];
if (pLine == NULL)
continue;
delete pLine;
}
RemoveAll();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -