📄 setpixelsize.cpp
字号:
//////////////// ROBOT SOCCER PROGRAM //////////////////
//////////////// By Kim Heung Soo //////////////////
//////////////// IC Lab. 98. 8. 2. //////////////////
// SetPixelSize.cpp : implementation file
//
#include "stdafx.h"
#include "Vision.h"
#include "SetPixelSize.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
// upper and lower ranges of each spin_button_control
#define MIN_LBOUND_BALL_SIZE 0
#define MAX_LBOUND_BALL_SIZE 700
#define MIN_UBOUND_BALL_SIZE 0
#define MAX_UBOUND_BALL_SIZE 700
#define MIN_LBOUND_BIG_TEAM_SIZE 0
#define MAX_LBOUND_BIG_TEAM_SIZE 900
#define MIN_UBOUND_BIG_TEAM_SIZE 0
#define MAX_UBOUND_BIG_TEAM_SIZE 900
#define MIN_LBOUND_SMALL_ID_SIZE 0
#define MAX_LBOUND_SMALL_ID_SIZE 500
#define MIN_UBOUND_SMALL_ID_SIZE 0
#define MAX_UBOUND_SMALL_ID_SIZE 500
#define MIN_LBOUND_OPPONENT_SIZE 0
#define MAX_LBOUND_OPPONENT_SIZE 900
#define MIN_UBOUND_OPPONENT_SIZE 0
#define MAX_UBOUND_OPPONENT_SIZE 900
/////////////////////////////////////////////////////////////////////////////
// CSetPixelSize dialog
CSetPixelSize::CSetPixelSize(CWnd* pParent /*=NULL*/)
: CDialog(CSetPixelSize::IDD, pParent)
{
//{{AFX_DATA_INIT(CSetPixelSize)
//}}AFX_DATA_INIT
}
void CSetPixelSize::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSetPixelSize)
DDX_Control(pDX, IDC_LBOUND_OPPONENT_SPIN, m_cLBoundOpponentSize);
DDX_Control(pDX, IDC_UBOUND_OPPONENT_SPIN, m_cUBoundOpponentSize);
DDX_Control(pDX, IDC_UBOUND_SMALL_ID_SPIN, m_cUBoundSmallIDSize);
DDX_Control(pDX, IDC_UBOUND_BIG_TEAM_SPIN, m_cUBoundBigTeamSize);
DDX_Control(pDX, IDC_LBOUND_SMALL_ID_SPIN, m_cLBoundSmallIDSize);
DDX_Control(pDX, IDC_LBOUND_BIG_TEAM_SPIN, m_cLBoundBigTeamSize);
DDX_Control(pDX, IDC_UBOUND_BALL_SIZE_SPIN, m_cUBoundBallSize);
DDX_Control(pDX, IDC_LBOUND_BALL_SIZE_SPIN, m_cLBoundBallSize);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CSetPixelSize, CDialog)
//{{AFX_MSG_MAP(CSetPixelSize)
ON_NOTIFY(UDN_DELTAPOS, IDC_LBOUND_BALL_SIZE_SPIN, OnDeltaposLboundBallSizeSpin)
ON_NOTIFY(UDN_DELTAPOS, IDC_UBOUND_BALL_SIZE_SPIN, OnDeltaposUboundBallSizeSpin)
ON_BN_CLICKED(IDC_DEFAULT_SET_PIXEL_SIZE, OnDefaultSetPixelSize)
ON_NOTIFY(UDN_DELTAPOS, IDC_LBOUND_BIG_TEAM_SPIN, OnDeltaposLboundBigTeamSpin)
ON_NOTIFY(UDN_DELTAPOS, IDC_LBOUND_SMALL_ID_SPIN, OnDeltaposLboundSmallIdSpin)
ON_NOTIFY(UDN_DELTAPOS, IDC_UBOUND_BIG_TEAM_SPIN, OnDeltaposUboundBigTeamSpin)
ON_NOTIFY(UDN_DELTAPOS, IDC_UBOUND_SMALL_ID_SPIN, OnDeltaposUboundSmallIdSpin)
ON_NOTIFY(UDN_DELTAPOS, IDC_LBOUND_OPPONENT_SPIN, OnDeltaposLboundOpponentSpin)
ON_NOTIFY(UDN_DELTAPOS, IDC_UBOUND_OPPONENT_SPIN, OnDeltaposUboundOpponentSpin)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSetPixelSize message handlers
BOOL CSetPixelSize::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_cLBoundBallSize.SetRange(MIN_LBOUND_BALL_SIZE, MAX_LBOUND_BALL_SIZE);
m_cLBoundBallSize.SetPos(nLBoundBallSize);
m_cUBoundBallSize.SetRange(MIN_UBOUND_BALL_SIZE, MAX_UBOUND_BALL_SIZE);
m_cUBoundBallSize.SetPos(nUBoundBallSize);
m_cLBoundBigTeamSize.SetRange(MIN_LBOUND_BIG_TEAM_SIZE, MAX_LBOUND_BIG_TEAM_SIZE);
m_cLBoundBigTeamSize.SetPos(nLBoundBigTeamSize);
m_cUBoundBigTeamSize.SetRange(MIN_UBOUND_BIG_TEAM_SIZE, MAX_UBOUND_BIG_TEAM_SIZE);
m_cUBoundBigTeamSize.SetPos(nUBoundBigTeamSize);
m_cLBoundSmallIDSize.SetRange(MIN_LBOUND_SMALL_ID_SIZE, MAX_LBOUND_SMALL_ID_SIZE);
m_cLBoundSmallIDSize.SetPos(nLBoundSmallIDSize);
m_cUBoundSmallIDSize.SetRange(MIN_UBOUND_SMALL_ID_SIZE, MAX_UBOUND_SMALL_ID_SIZE);
m_cUBoundSmallIDSize.SetPos(nUBoundSmallIDSize);
m_cLBoundOpponentSize.SetRange(MIN_LBOUND_OPPONENT_SIZE, MAX_LBOUND_OPPONENT_SIZE);
m_cLBoundOpponentSize.SetPos(nLBoundOpponentSize);
m_cUBoundOpponentSize.SetRange(MIN_UBOUND_OPPONENT_SIZE, MAX_UBOUND_OPPONENT_SIZE);
m_cUBoundOpponentSize.SetPos(nUBoundOpponentSize);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CSetPixelSize::OnDefaultSetPixelSize()
{
// TODO: Add your control notification handler code here
m_cLBoundBallSize.SetPos(nDefLBoundBallSize);
nLBoundBallSize = m_cLBoundBallSize.GetPos();
m_cUBoundBallSize.SetPos(nDefUBoundBallSize);
nUBoundBallSize = m_cUBoundBallSize.GetPos();
m_cLBoundBigTeamSize.SetPos(nDefLBoundBigTeamSize);
nLBoundBigTeamSize = m_cLBoundBigTeamSize.GetPos();
m_cUBoundBigTeamSize.SetPos(nDefUBoundBigTeamSize);
nUBoundBigTeamSize = m_cUBoundBigTeamSize.GetPos();
m_cLBoundSmallIDSize.SetPos(nDefLBoundSmallIDSize);
nLBoundSmallIDSize = m_cLBoundSmallIDSize.GetPos();
m_cUBoundSmallIDSize.SetPos(nDefUBoundSmallIDSize);
nUBoundSmallIDSize = m_cUBoundSmallIDSize.GetPos();
m_cLBoundOpponentSize.SetPos(nDefLBoundOpponentSize);
nLBoundOpponentSize = m_cLBoundOpponentSize.GetPos();
m_cUBoundOpponentSize.SetPos(nDefUBoundOpponentSize);
nUBoundOpponentSize = m_cUBoundOpponentSize.GetPos();
}
void CSetPixelSize::OnDeltaposLboundBallSizeSpin(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
// TODO: Add your control notification handler code here
nLBoundBallSize = m_cLBoundBallSize.GetPos();
*pResult = 0;
}
void CSetPixelSize::OnDeltaposLboundBigTeamSpin(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
// TODO: Add your control notification handler code here
nLBoundBigTeamSize = m_cLBoundBigTeamSize.GetPos();
*pResult = 0;
}
void CSetPixelSize::OnDeltaposLboundSmallIdSpin(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
// TODO: Add your control notification handler code here
nLBoundSmallIDSize = m_cLBoundSmallIDSize.GetPos();
*pResult = 0;
}
void CSetPixelSize::OnDeltaposUboundBallSizeSpin(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
// TODO: Add your control notification handler code here
nUBoundBallSize = m_cUBoundBallSize.GetPos();
*pResult = 0;
}
void CSetPixelSize::OnDeltaposUboundBigTeamSpin(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
// TODO: Add your control notification handler code here
nUBoundBigTeamSize = m_cUBoundBigTeamSize.GetPos();
*pResult = 0;
}
void CSetPixelSize::OnDeltaposUboundSmallIdSpin(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
// TODO: Add your control notification handler code here
nUBoundSmallIDSize = m_cUBoundSmallIDSize.GetPos();
*pResult = 0;
}
void CSetPixelSize::OnDeltaposLboundOpponentSpin(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
// TODO: Add your control notification handler code here
nLBoundOpponentSize = m_cLBoundOpponentSize.GetPos();
*pResult = 0;
}
void CSetPixelSize::OnDeltaposUboundOpponentSpin(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
// TODO: Add your control notification handler code here
nUBoundOpponentSize = m_cUBoundOpponentSize.GetPos();
*pResult = 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -