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

📄 cell.cpp

📁 一款用C++制作的矩阵运算器,不但可以直接用于矩阵计算.而且对想提高C++编程的朋友很有帮助。
💻 CPP
字号:
// Cell.cpp : implementation file
//

#include "stdafx.h"
#include "matrixcalculator.h"
#include "Cell.h"

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

/////////////////////////////////////////////////////////////////////////////
// CCell

//DEL CCell::CCell()
//DEL {
//DEL }

//DEL CCell::~CCell()
//DEL {
//DEL }
///////////////////////////////
////////自定义函数
////////////////////////////////
//DEL void CCell::OnSetfocus() //当用户操作单元格时,改变单元格的外观
//DEL {
//DEL 	SetFocus=TRUE;//SetFocus为BOOL型的变量
//DEL   CDC* pDC=this->GetWindowDC();
//DEL     this->OnEraseBkgnd(pDC);//改变单元格外观
//DEL }

//DEL BOOL CCell::OnEraseBkgnd(CDC* pDC) //改变单元格外观,重载OnEraseBkgnd函数
//DEL  { 
//DEL 	RECT rect;
//DEL   CPen Pen;
//DEL   CBrush Brush;
//DEL   LOGBRUSH LogBrush;
//DEL   if(SetFocus==TRUE)//当用户操作单元格时,为单元格加上一个黑色边框
//DEL   { 
//DEL 	Pen.CreatePen(PS_SOLID,2,RGB(0,0,0));//设置线条宽度为两个像素
//DEL   LogBrush.lbColor=RGB(0,0,0);
//DEL   LogBrush.lbStyle=BS_HOLLOW;
//DEL   Brush.CreateBrushIndirect(&&LogBrush);
//DEL   pDC-〉SelectObject(&&Pen);
//DEL   pDC-〉SelectObject(&&Brush);
//DEL   this-〉GetClientRect(&&rect);
//DEL   pDC-〉Rectangle(&&rect); //为单元格加黑色边框
//DEL    } else
//DEL      //当用户操作另外的单元格,消除黑色边框
//DEL   {
//DEL 	Pen.CreatePen(PS_SOLID,2,RGB(255,255,255));//创建白色的Pen以覆盖边框
//DEL   LogBrush.lbColor=RGB(0,0,0);
//DEL   LogBrush.lbStyle=BS_HOLLOW;
//DEL   Brush.CreateBrushIndirect(&&LogBrush);
//DEL   pDC-〉SelectObject(&&Pen);
//DEL   pDC-〉SelectObject(&&Brush);
//DEL   this-〉GetClientRect(&&rect);
//DEL   pDC-〉Rectangle(&&rect); 
//DEL }
//DEL    return CEdit::OnEraseBkgnd(pDC); 
//DEL }


//DEL void CCell::OnKillfocus()//用户焦点离开单元格,消除黑色边框
//DEL   { SetFocus=FALSE;
//DEL 
//DEL    CDC* pDC=this->GetWindowDC();
//DEL    this->OnEraseBkgnd(pDC); 
//DEL }





BEGIN_MESSAGE_MAP(CCell, CEdit)
	//{{AFX_MSG_MAP(CCell)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CCell message handlers

⌨️ 快捷键说明

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