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

📄 autokey.cpp

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

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

/////////////////////////////////////////////////////////////////////////////
// CAutoKey dialog


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


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


BEGIN_MESSAGE_MAP(CAutoKey, CDialog)
	//{{AFX_MSG_MAP(CAutoKey)
	ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
	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_BUTTON7, OnButton7)
	ON_BN_CLICKED(IDC_BUTTON8, OnButton8)
	ON_BN_CLICKED(IDC_BUTTON9, OnButton9)
	ON_BN_CLICKED(IDC_BUTTON10, OnButton10)
	ON_BN_CLICKED(IDC_BUTTON12, OnButton12)
	ON_BN_CLICKED(IDC_BUTTON11, OnButton11)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CAutoKey message handlers

BOOL CAutoKey::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	CMain * main=(CMain *)GetForegroundWindow();
	edit=(CEdit *)main->dlgauto->GetDlgItem(IDC_EDIT1);
	m_num=main->dlgauto->m_num;
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CAutoKey::OnButton1() 
{
	// TODO: Add your control notification handler code here
	m_num.Insert(m_num.GetLength(),"1");
	edit->SetWindowText(m_num);
}

void CAutoKey::OnButton2() 
{
	// TODO: Add your control notification handler code here
	m_num.Insert(m_num.GetLength(),"2");
	edit->SetWindowText(m_num);
}

void CAutoKey::OnButton3() 
{
	// TODO: Add your control notification handler code here
	m_num.Insert(m_num.GetLength(),"3");
	edit->SetWindowText(m_num);
}

void CAutoKey::OnButton4() 
{
	// TODO: Add your control notification handler code here
	m_num.Insert(m_num.GetLength(),"4");
	edit->SetWindowText(m_num);
}

void CAutoKey::OnButton5() 
{
	// TODO: Add your control notification handler code here
	m_num.Insert(m_num.GetLength(),"5");
	edit->SetWindowText(m_num);
}

void CAutoKey::OnButton6() 
{
	// TODO: Add your control notification handler code here
	m_num.Insert(m_num.GetLength(),"6");
	edit->SetWindowText(m_num);
}

void CAutoKey::OnButton7() 
{
	// TODO: Add your control notification handler code here
	m_num.Insert(m_num.GetLength(),"7");
	edit->SetWindowText(m_num);
}

void CAutoKey::OnButton8() 
{
	// TODO: Add your control notification handler code here
	m_num.Insert(m_num.GetLength(),"8");
	edit->SetWindowText(m_num);
}

void CAutoKey::OnButton9() 
{
	// TODO: Add your control notification handler code here
	m_num.Insert(m_num.GetLength(),"9");
	edit->SetWindowText(m_num);
}

void CAutoKey::OnButton10() 
{
	// TODO: Add your control notification handler code here
	m_num.Insert(m_num.GetLength(),"0");
	edit->SetWindowText(m_num);
}

void CAutoKey::OnButton12() 
{
	// TODO: Add your control notification handler code here
	m_num=m_num.Left(m_num.GetLength()-1);
	edit->SetWindowText(m_num);
}

void CAutoKey::OnButton11() 
{
	// TODO: Add your control notification handler code here
	EndDialog(1);
}

⌨️ 快捷键说明

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