?? recordadddlg.cpp
字號:
// RecordAddDlg.cpp : implementation file
//
#include "stdafx.h"
#include "Abc.h"
#include "RecordAddDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CRecordAddDlg dialog
CRecordAddDlg::CRecordAddDlg(CWnd* pParent /*=NULL*/)
: CDialog(CRecordAddDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CRecordAddDlg)
m_strEnglish = _T("");
m_strChinese = _T("");
//}}AFX_DATA_INIT
}
void CRecordAddDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CRecordAddDlg)
DDX_Text(pDX, IDC_EDIT1, m_strEnglish);
DDX_Text(pDX, IDC_EDIT2, m_strChinese);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CRecordAddDlg, CDialog)
//{{AFX_MSG_MAP(CRecordAddDlg)
ON_BN_CLICKED(IDC_SELF_PASTE, OnSelfPaste)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CRecordAddDlg message handlers
void CRecordAddDlg::OnSelfPaste()
{
// TODO: Add your control notification handler code here
if(!IsClipboardFormatAvailable(CF_TEXT))
{
AfxMessageBox(IDS_ERROR_FORMAT,MB_OK|MB_ICONEXCLAMATION);
return;
}
HGLOBAL hglb;
CString strText;;
OpenClipboard();
hglb = GetClipboardData(CF_TEXT);
if (hglb != NULL)
{
CString strText =(LPTSTR)GlobalLock(hglb);
if (!strText.IsEmpty())
{
strText.TrimLeft();
strText.TrimRight();
int n=strText.Find('\n');
int m=strText.Find(' ');
int i=-1;
if(n>=0)
i=n;
else if(m>=0)
i=m;
else
;
if(i>=0)
{
m_strEnglish=strText.Left(i);
m_strEnglish.TrimRight();
m_strChinese=strText.Right(strText.GetLength()-i-1);
m_strChinese.TrimLeft();
UpdateData(FALSE);
}
else
{
m_strEnglish=strText;
m_strChinese.Empty();
UpdateData(FALSE);
}
GlobalUnlock(hglb);
}
}
CloseClipboard();
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -