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

📄 joyspeed.cpp

📁 这是一个俄罗斯方块的源代码
💻 CPP
字号:
// JOYSPEED.cpp : implementation file
//

#include "stdafx.h"
#include "俄罗斯方块.h"
#include "JOYSPEED.h"
#include <Mmsystem.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// JOYSPEED dialog


JOYSPEED::JOYSPEED(CWnd* pParent /*=NULL*/)
	: CDialog(JOYSPEED::IDD, pParent)
{
	//{{AFX_DATA_INIT(JOYSPEED)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void JOYSPEED::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(JOYSPEED)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(JOYSPEED, CDialog)
	//{{AFX_MSG_MAP(JOYSPEED)
	ON_BN_CLICKED(IDC_JOYCANCEL, OnJoycancel)
	ON_BN_CLICKED(IDC_JOYOK, OnJoyok)
	ON_BN_CLICKED(IDC_JOYINIT, OnJoyinit)
	ON_BN_CLICKED(IDC_TWOWINDOW, OnTwowindow)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// JOYSPEED message handlers

void JOYSPEED::OnJoycancel() 
{
	// TODO: Add your control notification handler code here
	JOYSPEED::EndDialog(0);
}

BOOL JOYSPEED::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	Two.SubclassDlgItem(IDC_TWOWINDOW,this);
	if (TempTwoWindow)
		JOYSPEED::CheckDlgButton(IDC_TWOWINDOW,1);
	else
		JOYSPEED::CheckDlgButton(IDC_TWOWINDOW,0);
    Speed.SubclassDlgItem(IDC_JOYSLIDER,this);
	Speed.SetRange(0,100);
	Speed.SetPos(100-JOYSPEED::JoySpeed);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void JOYSPEED::OnJoyok() 
{
	// TODO: Add your control notification handler code here
	TwoWindow=TempTwoWindow;
	JOYSPEED::JoySpeed=100-Speed.GetPos();
	//::joyReleaseCapture(JOYSTICKID1);
	::joySetCapture(JOYSPEED::m_hWnd,JOYSTICKID1,100-JOYSPEED::JoySpeed,FALSE);
	JOYSPEED::EndDialog(0);
}

void JOYSPEED::OnJoyinit() 
{
	// TODO: Add your control notification handler code here
	JOYSPEED::JoySpeed=50;
	Speed.SetPos(50);
}

void JOYSPEED::OnTwowindow() 
{
	// TODO: Add your control notification handler code here
	TempTwoWindow=1-TempTwoWindow;
}

⌨️ 快捷键说明

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