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

📄 homeset.cpp

📁 机械手IPC控制器伺服运动程序
💻 CPP
字号:
// HomeSet.cpp : implementation file
//

#include "stdafx.h"
#include "alfa.h"
#include "HomeSet.h"
#include "Main.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CHomeSet dialog

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


void CHomeSet::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CHomeSet)
	DDX_Control(pDX, IDC_LIST1, m_list);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CHomeSet, CDialog)
	//{{AFX_MSG_MAP(CHomeSet)
	ON_LBN_SELCHANGE(IDC_LIST1, OnSelchangeList1)
	ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
	ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
	ON_BN_CLICKED(IDC_BUTTON4, OnButton4)
	ON_BN_CLICKED(IDC_BUTTON5, OnButton5)
	ON_BN_CLICKED(IDC_BUTTON6, OnButton6)
	ON_BN_CLICKED(IDC_BUTTON17, OnButton17)
	ON_WM_SHOWWINDOW()
	ON_LBN_SETFOCUS(IDC_LIST1, OnSetfocusList1)
//	ON_BN_CLICKED(IDC_CHKACT, OnChkact)
//	ON_BN_CLICKED(IDC_CHECK10, OnCheck10)
//	ON_BN_CLICKED(IDC_CHKYACT, OnChkyact)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CHomeSet message handlers

BOOL CHomeSet::OnInitDialog() 
{
	CDialog::OnInitDialog();
	h_SkinDialog.SubClassDialog(m_hWnd);
	// TODO: Add extra initialization here
// Chiu Added_B 95/03/03 
	CFont font;
	font.CreatePointFont(200,"Arial");
	GetDlgItem(IDC_LIST1)->SetFont(&font);
// Chiu Added_E 95/03/03
	m_list.AddString("MZ");
	m_list.AddString("MX");
	m_list.AddString("SZ");
	m_list.AddString("SX");
	m_list.AddString("Y");
	GetDlgItem(IDC_BUTTON2)->EnableWindow(FALSE);
	GetDlgItem(IDC_BUTTON3)->EnableWindow(FALSE);
	GetDlgItem(IDC_BUTTON4)->EnableWindow(FALSE);
	GetDlgItem(IDC_BUTTON5)->EnableWindow(FALSE);
	GetDlgItem(IDC_BUTTON6)->EnableWindow(FALSE);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}


void CHomeSet::OnSelchangeList1() 
{
	// TODO: Add your control notification handler code here
	if(m_list.GetCurSel()<0) return;
	posOld=m_list.GetCurSel();
	m_list.GetText(m_list.GetCurSel(),strOld);
	GetDlgItem(IDC_BUTTON2)->EnableWindow(TRUE);
	GetDlgItem(IDC_BUTTON3)->EnableWindow(TRUE);
	GetDlgItem(IDC_BUTTON4)->EnableWindow(TRUE);
	GetDlgItem(IDC_BUTTON5)->EnableWindow(TRUE);
	GetDlgItem(IDC_BUTTON6)->EnableWindow(TRUE);
}


void CHomeSet::OnButton2() 
{
	// TODO: Add your control notification handler code here
	posNew=0;
	m_list.GetText(0,strNew);
	if(posOld!=posNew)
	{
		m_list.DeleteString(posNew);
		m_list.InsertString(posNew,strOld);
		m_list.DeleteString(posOld);
		m_list.InsertString(posOld,strNew);
		m_list.SetCurSel(posNew);
		posOld=posNew;
	}
}


void CHomeSet::OnButton3() 
{
	// TODO: Add your control notification handler code here
	posNew=1;
	m_list.GetText(posNew,strNew);
	if(posOld!=posNew)
	{
		m_list.DeleteString(posNew);
		m_list.InsertString(posNew,strOld);
		m_list.DeleteString(posOld);
		m_list.InsertString(posOld,strNew);
		m_list.SetCurSel(posNew);
		posOld=posNew;
	}
}


void CHomeSet::OnButton4() 
{
	// TODO: Add your control notification handler code here
	posNew=2;
	m_list.GetText(posNew,strNew);
	if(posOld!=posNew)
	{
		m_list.DeleteString(posNew);
		m_list.InsertString(posNew,strOld);
		m_list.DeleteString(posOld);
		m_list.InsertString(posOld,strNew);
		m_list.SetCurSel(posNew);
		posOld=posNew;
	}
}


void CHomeSet::OnButton5() 
{
	// TODO: Add your control notification handler code here
	posNew=3;
	m_list.GetText(posNew,strNew);
	if(posOld!=posNew)
	{
		m_list.DeleteString(posNew);
		m_list.InsertString(posNew,strOld);
		m_list.DeleteString(posOld);
		m_list.InsertString(posOld,strNew);
		m_list.SetCurSel(posNew);
		posOld=posNew;
	}
}


void CHomeSet::OnButton6() 
{
	// TODO: Add your control notification handler code here
	posNew=4;
	m_list.GetText(posNew,strNew);
	if(posOld!=posNew)
	{
		m_list.DeleteString(posNew);
		m_list.InsertString(posNew,strOld);
		m_list.DeleteString(posOld);
		m_list.InsertString(posOld,strNew);
		m_list.SetCurSel(posNew);
		posOld=posNew;
	}
}


void CHomeSet::OnButton17() 
{
	// TODO: Add your control notification handler code here
	ShowWindow(FALSE);
	CMain * main=(CMain *)GetParent();
	main->dlghome->ShowWindow(TRUE);
}


void CHomeSet::OnShowWindow(BOOL bShow, UINT nStatus) 
{
	CDialog::OnShowWindow(bShow, nStatus);
	// TODO: Add your message handler code here
	if(bShow==1)
	{
		CMain * main=(CMain *)GetParent();
		main->dlgcur =this;
	}
}


void CHomeSet::OnSetfocusList1() 
{
	// TODO: Add your control notification handler code here
	
}

//void CHomeSet::OnChkact() 
//{
	// TODO: Add your control notification handler code here
//	if(actsel==0) actsel=1;
//	else actsel=0;
//}

//void CHomeSet::OnCheck10() 
//{
	// TODO: Add your control notification handler code here
//	if(zactsel==0) zactsel=1;
//	else zactsel=0;
//}

//void CHomeSet::OnChkyact() 
//{
	// TODO: Add your control notification handler code here
//	if(yactsel==0) yactsel=1;
//	else yactsel=0;
//}

⌨️ 快捷键说明

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