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

📄 input.cpp

📁 这是树上的代码
💻 CPP
字号:
// INPUT.cpp : implementation file
//

#include "stdafx.h"
#include "空间曲面.h"
#include "INPUT.h"

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

/////////////////////////////////////////////////////////////////////////////
// INPUT dialog


INPUT::INPUT(CWnd* pParent /*=NULL*/)
	: CDialog(INPUT::IDD, pParent)
{
	i=1;
	//{{AFX_DATA_INIT(INPUT)
	m_Int1 = 0;
	m_Int2 = 0;
	m_m = 0;
	m_n = _T("");
	m_x = _T("");
	m_y = _T("");
	m_z = _T("");
	//}}AFX_DATA_INIT
}


void INPUT::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(INPUT)
	DDX_Control(pDX, IDC_SLIDER2, m_Slider2);
	DDX_Control(pDX, IDC_SLIDER1, m_Slider1);
	DDX_Control(pDX, IDC_EDIT4, m_no);
	DDX_Text(pDX, IDC_EDIT1, m_Int1);
	DDX_Text(pDX, IDC_EDIT2, m_Int2);
	DDX_Text(pDX, IDC_EDIT3, m_m);
	DDX_Text(pDX, IDC_EDIT4, m_n);
	DDX_Text(pDX, IDC_EDIT5, m_x);
	DDX_Text(pDX, IDC_EDIT6, m_y);
	DDX_Text(pDX, IDC_EDIT7, m_z);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(INPUT, CDialog)
	//{{AFX_MSG_MAP(INPUT)
	ON_NOTIFY(NM_CUSTOMDRAW, IDC_SLIDER1, OnCustomdrawSlider1)
	ON_WM_PAINT()
	ON_NOTIFY(NM_CUSTOMDRAW, IDC_SLIDER2, OnCustomdrawSlider2)
	ON_WM_CTLCOLOR()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// INPUT message handlers

void INPUT::OnCancel() 
{
	// TODO: Add extra cleanup here
	UpdateData(true);
    m=m_m;
    x[i]=atof(m_x);
    y[i]=atof(m_y);
    z[i++]=atof(m_z);
    m_n.Format("%ld",i);
    m_x=" ";
    m_y=" ";
    m_z=" ";
    UpdateData(false);
	//CDialog::OnCancel();
}

void INPUT::OnOK() 
{
	// TODO: Add extra validation here
	
	CDialog::OnOK();
}

BOOL INPUT::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
    m_Brush=CreateSolidBrush(RGB(232,228,232));
	m_no.SetReadOnly(true);
	m_n.Format("%ld",i);
	UpdateData(false);

    SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon
	m_Slider1.SetRange(0,90);//初始化可用范围为-0到90
	m_Slider1.SetTicFreq(5);//初始化刻度值
    m_Slider2.SetRange(0,90);//初始化可用范围为-0到90
	m_Slider2.SetTicFreq(5);//初始化刻度值
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void INPUT::OnCustomdrawSlider1(NMHDR* pNMHDR, LRESULT* pResult) 
{
	// TODO: Add your control notification handler code here
	CClientDC *pDC=new CClientDC(this);
	UpdateData(TRUE);
	m_Int1=m_Slider1.GetPos();
	//a=m_Input;
	UpdateData(FALSE); 
	*pResult = 0;
}

void INPUT::OnPaint() 
{
	CPaintDC dc(this); // device context for painting
	
	// TODO: Add your message handler code here
	
	// Do not call CDialog::OnPaint() for painting messages
}

void INPUT::OnCustomdrawSlider2(NMHDR* pNMHDR, LRESULT* pResult) 
{
	// TODO: Add your control notification handler code here
	CClientDC *pDC=new CClientDC(this);
	UpdateData(TRUE);
	m_Int2=m_Slider2.GetPos();
	//b=m_Input;
	UpdateData(FALSE); 
	*pResult = 0;
}

HBRUSH INPUT::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
{
	HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
	//hbr=CreateSolidBrush(RGB(190,200,250));
	// TODO: Change any attributes of the DC here
	return m_Brush;
	// TODO: Return a different brush if the default is not desired
	return hbr;
}

⌨️ 快捷键说明

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