starvelocitydialog.cpp

来自「在mdi client窗口的客户区域显示移动的星星的程序」· C++ 代码 · 共 58 行

CPP
58
字号
// StarVelocityDialog.cpp : implementation file
//

#include "StdAfx.h"
#include "Starz.h"
#include "StarzView.h"
#include "StarVelocityDialog.h"

#include <assert.h>

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

/////////////////////////////////////////////////////////////////////////////
// CStarVelocityDialog dialog

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

CStarVelocityDialog::CStarVelocityDialog(CWnd* pParent)
	: CDialog(CStarVelocityDialog::IDD, pParent)
{
	//{{AFX_DATA_INIT(CStarVelocityDialog)
	velocity = 0;
	//}}AFX_DATA_INIT

	CStarzView* view = DYNAMIC_DOWNCAST(CStarzView, pParent);
	assert(view);
	this->velocity = view->getVelocity();
}

void CStarVelocityDialog::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CStarVelocityDialog)
	DDX_Text(pDX, IDC_VELOCITY, velocity);
	DDV_MinMaxInt(pDX, velocity, 1, 1000);
	//}}AFX_DATA_MAP
}

/////////////////////////////////////////////////////////////////////////////
// CStarVelocityDialog message handlers

BOOL CStarVelocityDialog::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	((CSpinButtonCtrl*)this->GetDlgItem(IDC_VELOCITYSPIN))->SetRange(1, 1000);
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

⌨️ 快捷键说明

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