📄 pageserno.cpp
字号:
// PageSerNo.cpp : implementation file
//
#include "stdafx.h"
#include "MyGame.h"
#include "PageSerNo.h"
#include "MyGameDoc.h"
#include "MyGameView.h"
#include "GameSetup.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CPageSerNo property page
IMPLEMENT_DYNCREATE(CPageSerNo, CPropertyPageEx)
CPageSerNo::CPageSerNo() : CPropertyPageEx(CPageSerNo::IDD)
{
//{{AFX_DATA_INIT(CPageSerNo)
//}}AFX_DATA_INIT
}
CPageSerNo::~CPageSerNo()
{
}
void CPageSerNo::DoDataExchange(CDataExchange* pDX)
{
CPropertyPageEx::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPageSerNo)
DDX_Control(pDX, IDC_EDIT3, m_wndHeightEdit);
DDX_Control(pDX, IDC_EDIT1, m_wndWidthEdit);
DDX_Control(pDX, IDC_SLIDER2, m_wndHeight);
DDX_Control(pDX, IDC_SLIDER1, m_wndWidth);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPageSerNo, CPropertyPageEx)
//{{AFX_MSG_MAP(CPageSerNo)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPageSerNo message handlers
void CPageSerNo::OnOK()
{
// TODO: Add your specialized code here and/or call the base class
CMyGameView *pParentWnd = (CMyGameView *)( ((CGameSetup *)GetParent())->m_pParentWnd);
pParentWnd->m_iColumnCount = m_wndWidth.GetPos();
pParentWnd->m_iRowCount = m_wndHeight.GetPos();
pParentWnd->m_iGameType = GAME_NUMBER_STRING;
CPropertyPageEx::OnOK();
}
BOOL CPageSerNo::OnInitDialog()
{
CPropertyPageEx::OnInitDialog();
//
CMyGameView *pParentWnd = (CMyGameView *)( ((CGameSetup *)GetParent())->m_pParentWnd);
m_iBoxWidth = pParentWnd->m_iColumnCount;
m_iBoxHeight = pParentWnd->m_iRowCount;
m_wndWidth.SetRange(3,10);
m_wndHeight.SetRange(3,10);
// m_wndWidth.SetBuddy(&m_wndWidthEdit);
// m_wndHeight.SetBuddy(&m_wndHeightEdit);
m_wndWidth.SetPos(m_iBoxWidth);
m_wndHeight.SetPos(m_iBoxHeight);
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -