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

📄 buttomarray.cpp

📁 对测井数据显示、编辑、处理
💻 CPP
字号:
// ButtomArray.cpp: implementation of the CButtomArray class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "welldataprocess.h"
#include "ButtomArray.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CButtomArray::CButtomArray()
{

}

CButtomArray::~CButtomArray()
{

}

void CButtomArray::Draw(CDC *pDC)
{
	int nCount = GetSize();

	for (int i=0;i<nCount;i++)
		(*this)[i]->Draw (pDC);
}

CButtomUnit* CButtomArray::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;
}

int CButtomArray::AddButtomRect(COLORREF color, CRect rect, CString strName)
{
	CButtomUnit *pRectUnit = new CButtomUnit(color, rect, strName);
	return Add(pRectUnit);

}

void CButtomArray::SetActive(int nIndex)
{
	int nCount = GetSize();
	int i;
	for(i = 0; i < nCount; i ++)
	{
		(*this)[i]->m_bSelect = FALSE;
	}

	for (i=0;i<nCount;i++)
	{
		if(i == nIndex)
		  (*this)[i]->m_bSelect = TRUE;	
	}

}

int CButtomArray::GetActiveIndex()
{
	int nCount = GetSize();
	int i;
	for (i=0;i<nCount;i++)
	{
		if((*this)[i]->m_bSelect)
		  return i;
	}
	return -1;	
}

⌨️ 快捷键说明

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