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

📄 axisdlg.cpp

📁 This is my assignment for my tutor s Class. and many problems exist,so you should comprhend it and i
💻 CPP
字号:
// AxisDlg.cpp : implementation file
//

#include "stdafx.h"
#include "FilmDesign.h"
#include "AxisDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CAxisDlg dialog


CAxisDlg::CAxisDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CAxisDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CAxisDlg)
	m_Axis_Startx = 0;
	m_Axis_Starty = 0;
	m_InterValx = 10.0f;
	m_Intervaly = 10.0f;
	m_Axis_Endx = 100;
	m_Axis_Endy = 100;
	m_Lable_x = _T("x");
	m_Lable_y = _T("y");
	m_Axis_Width = 3;
	m_Centerx = 0;
	m_Centery = 0;
	//}}AFX_DATA_INIT
	m_Colorx=RGB(0,0,0);
	m_Colory=RGB(0,0,0);
}	


void CAxisDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CAxisDlg)
	DDX_Control(pDX, IDC_BUTTON_COLORY, m_Ctrl_Colory);
	DDX_Control(pDX, IDC_BUTTON_COLORX, m_Ctrl_Colorx);
	DDX_Text(pDX, IDC_AXIS_STARTX, m_Axis_Startx);
	DDV_MinMaxLong(pDX, m_Axis_Startx, 0, 3000);
	DDX_Text(pDX, IDC_AXIS_STARTY, m_Axis_Starty);
	DDV_MinMaxLong(pDX, m_Axis_Starty, 0, 100);
	DDX_Text(pDX, IDC_LABLE_INTERVALX, m_InterValx);
	DDV_MinMaxDouble(pDX, m_InterValx, 1., 500.);
	DDX_Text(pDX, IDC_LABLE_INTERVALY, m_Intervaly);
	DDV_MinMaxDouble(pDX, m_Intervaly, 0.1, 50.);
	DDX_Text(pDX, IDC_AXIS_ENDX, m_Axis_Endx);
	DDV_MinMaxLong(pDX, m_Axis_Endx, 100, 5000);
	DDX_Text(pDX, IDC_AXIS_ENDY, m_Axis_Endy);
	DDV_MinMaxLong(pDX, m_Axis_Endy, 0, 100);
	DDX_Text(pDX, IDC_LABLE_TEXTX, m_Lable_x);
	DDX_Text(pDX, IDC_LABLE_TEXTY, m_Lable_y);
	DDX_Text(pDX, IDC_WIDTH, m_Axis_Width);
	DDV_MinMaxInt(pDX, m_Axis_Width, 0, 10);
	DDX_Text(pDX, IDC_AXIS_CENTER_X, m_Centerx);
	DDV_MinMaxLong(pDX, m_Centerx, 0, 300);
	DDX_Text(pDX, IDC_AXIS_CENTER_Y, m_Centery);
	DDV_MinMaxLong(pDX, m_Centery, 500, 1000);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CAxisDlg, CDialog)
	//{{AFX_MSG_MAP(CAxisDlg)
	ON_BN_CLICKED(IDC_BUTTON_COLORX, OnButtonColorx)
	ON_BN_CLICKED(IDC_BUTTON_COLORY, OnButtonColory)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CAxisDlg message handlers


void CAxisDlg::OnButtonColorx() 
{
	// TODO: Add your control notification handler code here
	CColorDialog dlg;
	int response=dlg.DoModal();
	if(response==IDOK)
	{
		m_Colorx=dlg.GetColor();
	
	}

}
void CAxisDlg::OnButtonColory() 
{
	// TODO: Add your control notification handler code here
		CColorDialog dlg;
	int response=dlg.DoModal();
	if(response==IDOK)
	{
		 m_Colory=dlg.GetColor();
	}
		
	
	
}

void CAxisDlg::OnOK() 
{
	// TODO: Add extra validation here
    this->UpdateData(true);
	CDialog::OnOK();
}

COLORREF CAxisDlg::GetColorx()
{
   return m_Colorx;
}

COLORREF CAxisDlg::GetColory()
{
   return m_Colory;
}


void CAxisDlg::SetColorx(COLORREF color)
{
	m_Colorx=color;

}

void CAxisDlg::SetColory(COLORREF color)
{
	m_Colory=color;

}

⌨️ 快捷键说明

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