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

📄 test.cpp

📁 精通MFC程序 设计
💻 CPP
字号:
// Test.cpp : implementation file
//

#include "stdafx.h"
#include "Chapter15.h"
#include "MainFrm.h"
#include "Test.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#include "Chapter15Doc.h"
/////////////////////////////////////////////////////////////////////////////
// CTest dialog


CTest::CTest(CWnd* pParent /*=NULL*/)
	: CDialog(CTest::IDD, pParent)
{
	//{{AFX_DATA_INIT(CTest)
	m_ulong = 0;
	m_ushort = 0;
	m_uthick = 0;
	//}}AFX_DATA_INIT
}


void CTest::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CTest)
	DDX_Text(pDX, IDC_LONG, m_ulong);
	DDX_Text(pDX, IDC_SHORT, m_ushort);
	DDX_Text(pDX, IDC_THICK, m_uthick);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CTest, CDialog)
	//{{AFX_MSG_MAP(CTest)
	ON_BN_CLICKED(IDC_BUTTON_COLOR, OnButtonColor)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CTest message handlers

void CTest::OnButtonColor() 
{
	// TODO: Add your control notification handler code here
	CColorDialog color;
	if(color.DoModal()==IDOK)
	{
		CMainFrame* pMainFrm=(CMainFrame*)AfxGetMainWnd();
		//获取选定线条的颜色
		CChapter15Doc* pDoc=(CChapter15Doc*)pMainFrm->GetActiveDocument();
		pDoc->m_color=color.GetColor();
	}
}

⌨️ 快捷键说明

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