penstyle.cpp

来自「一个用c++编写的画图板程序,」· C++ 代码 · 共 60 行

CPP
60
字号
// PenStyle.cpp : implementation file
//

#include "stdafx.h"
#include "MyDrawBoard.h"
#include "PenStyle.h"

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

/////////////////////////////////////////////////////////////////////////////
// CPenStyle dialog


CPenStyle::CPenStyle(CWnd* pParent /*=NULL*/)
	: CDialog(CPenStyle::IDD, pParent)
{
	//{{AFX_DATA_INIT(CPenStyle)
	m_PenWidth = 0;
	//}}AFX_DATA_INIT
}


void CPenStyle::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CPenStyle)
	DDX_Slider(pDX, IDC_SLIDER_PenWidth, m_PenWidth);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CPenStyle, CDialog)
	//{{AFX_MSG_MAP(CPenStyle)
	ON_BN_CLICKED(IDC_BUTTON_PenColor, OnBUTTONPenColor)
	ON_NOTIFY(NM_OUTOFMEMORY, IDC_SLIDER_PenWidth, OnOutofmemorySLIDERPenWidth)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CPenStyle message handlers

void CPenStyle::OnBUTTONPenColor() 
{
	// TODO: Add your control notification handler code here
	CColorDialog cdlg;
	cdlg.DoModal();
	m_PenColor=cdlg.GetColor();
}

void CPenStyle::OnOutofmemorySLIDERPenWidth(NMHDR* pNMHDR, LRESULT* pResult) 
{
	// TODO: Add your control notification handler code here
	
	*pResult = 0;
}

⌨️ 快捷键说明

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