📄 mybutton.cpp
字号:
// MyButton.cpp : implementation file
//
#include "stdafx.h"
#include "xsp.h"
#include "MyButton.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMyButton
CMyButton::CMyButton()
{
}
CMyButton::~CMyButton()
{
}
BEGIN_MESSAGE_MAP(CMyButton, CButton)
//{{AFX_MSG_MAP(CMyButton)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMyButton message handlers
void CMyButton::PaintNeedle(POINT p1, POINT p2, unsigned char color)
{
POINT pp1,pp2;
dc=this->GetDC();
CPen pen(PS_SOLID,1,RGB(255,0,0));
CPen* pOldPen = (CPen*)dc->SelectObject(&pen);
pp1.x=p1.x/10;
pp1.y=p1.y/10;
pp2.x=p2.x/10;
pp2.y=p2.y/10;
dc->MoveTo(pp1);
dc->LineTo(pp2);
/*dc->MoveTo(pp2.x-5,pp2.y);
dc->LineTo(pp2.x+10,pp2.y);
dc->MoveTo(pp2.x,pp2.y-5);
dc->LineTo(pp2.x,pp2.y+10);
dc->MoveTo(pp2);*/
dc->SelectObject(pOldPen);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -