radiusdialog.cpp

来自「这个是我们学校用的VC++教案」· C++ 代码 · 共 62 行

CPP
62
字号
// RadiusDialog.cpp : implementation file
//

#include "stdafx.h"
#include "Mysdi.h"
#include "RadiusDialog.h"

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

/////////////////////////////////////////////////////////////////////////////
// CRadiusDialog dialog


CRadiusDialog::CRadiusDialog(CWnd* pParent /*=NULL*/)
	: CDialog(CRadiusDialog::IDD, pParent)
{
	//{{AFX_DATA_INIT(CRadiusDialog)
	//}}AFX_DATA_INIT
}


void CRadiusDialog::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CRadiusDialog)
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CRadiusDialog, CDialog)
	//{{AFX_MSG_MAP(CRadiusDialog)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CRadiusDialog message handlers

BOOL CRadiusDialog::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	CString strRadius;
	strRadius.Format("%d",100);
	CEdit *pEdit=(CEdit*)GetDlgItem(IDC_EDIT_RADIUS);   // 取得编辑框控件临时对象的指针
	pEdit->SetWindowText(strRadius);  // 设置编辑框显示的初始值
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CRadiusDialog::OnOK() 
{
	// TODO: Add extra validation here
	m_nDiaCtlRdu=GetDlgItemInt(IDC_EDIT_RADIUS);   // 接收编辑框数据
	CDialog::OnOK();
}

⌨️ 快捷键说明

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