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

📄 pageb.cpp

📁 reed solomon编码/解码工具
💻 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 + -