?? pageb.cpp
字號:
// PageB.cpp : implementation file
//
#include "stdafx.h"
#include "DLG.h"
#include "PageB.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern CString msg;
/////////////////////////////////////////////////////////////////////////////
// CPageB dialog
CPageB::CPageB(CWnd* pParent /*=NULL*/)
: CDialog(CPageB::IDD, pParent)
{
//{{AFX_DATA_INIT(CPageB)
//}}AFX_DATA_INIT
}
void CPageB::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPageB)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPageB, CDialog)
//{{AFX_MSG_MAP(CPageB)
ON_BN_CLICKED(IDC_BUTTON_ADD, OnButtonAdd)
ON_BN_CLICKED(IDC_BUTTON_DEL, OnButtonDel)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPageB message handlers
BOOL CPageB::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
CRect rc(0, 0, 0, 0);
GetParent()->GetClientRect(&rc);
((CTabCtrl*)GetParent())->AdjustRect(false, &rc);
MoveWindow(&rc);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CPageB::OnButtonAdd()
{
// TODO: Add your control notification handler code here
CEdit * pEd_msg=(CEdit*)this->GetDlgItem(IDC_EDIT_MSG);
pEd_msg->GetWindowText(msg);
// msg += '\0';
int len = msg.GetLength();
if (len == 0) {
return;
}
if (len > msgLEN) {
msg.Empty();
this->MessageBox("The input message length is limited to 128.", NULL, MB_ICONEXCLAMATION | MB_ICONWARNING);
return;
}
CEdit * pEd_code=(CEdit*)this->GetDlgItem(IDC_EDIT_CODE);
CString str;
str.Empty();
for (int i = 0; i < len; i++) {
CString temp;
temp.Empty();
temp.Format("%#x", LPCTSTR(msg[i]));
str += temp;
if ((i+1)%14 == 0) {
str += "\r\n";
}else {
str += " ";
}
}
pEd_code->SetWindowText(str);
}
void CPageB::OnButtonDel()
{
// TODO: Add your control notification handler code here
CEdit * pEd_msg=(CEdit*)this->GetDlgItem(IDC_EDIT_MSG);
msg.Empty();
pEd_msg->SetWindowText(msg);
CEdit * pEd_code=(CEdit*)this->GetDlgItem(IDC_EDIT_CODE);
pEd_code->SetWindowText(msg);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -