📄 dlgwkinputtx3.cpp
字号:
// DlgWkInputTx3.cpp : implementation file
//
#include "stdafx.h"
#include "Kvip.h"
#include "DlgWkInputTx3.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgWkInputTx3 dialog
CDlgWkInputTx3::CDlgWkInputTx3(CWnd* pParent /*=NULL*/)
: CDialog(CDlgWkInputTx3::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgWkInputTx3)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_pListDoc = NULL;
m_strCode = _T("");
}
void CDlgWkInputTx3::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgWkInputTx3)
DDX_Control(pDX, IDC_MASTER, m_Master);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgWkInputTx3, CDialog)
//{{AFX_MSG_MAP(CDlgWkInputTx3)
ON_BN_CLICKED(IDC_APPEND, OnAppend)
ON_BN_CLICKED(IDC_EDIT, OnEdit)
ON_BN_CLICKED(IDC_DELETE, OnDelete)
ON_NOTIFY(NM_CLICK, IDC_MASTER, OnClickMaster)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgWkInputTx3 message handlers
BOOL CDlgWkInputTx3::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
if (pMsg->message == WM_KEYDOWN &&
pMsg->wParam == 27) //禁止ESC退出
return true;
return CDialog::PreTranslateMessage(pMsg);
}
BOOL CDlgWkInputTx3::OnInitDialog()
{
CDialog::OnInitDialog();
// m_Master.SetHeadings(_T("日期,1, 80; 说明,1 , 300; 编号,1, 100;ID,1,0"));
m_Master.SetGridLines(TRUE);
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDlgWkInputTx3::OnAppend()
{
// TODO: Add your control notification handler code here
if(m_pListDoc==NULL)return;
CEdit *pCode = (CEdit*)m_pListDoc->GetClass(_T("SA_CODE"));
ASSERT(pCode);
pCode->SetWindowText(m_strCode);
if (m_pListDoc->New())
{
m_pListDoc->UpdateData(false);
m_pListDoc->Reset();
}
}
void CDlgWkInputTx3::OnEdit()
{
// TODO: Add your control notification handler code here
if(m_pListDoc==NULL)return;
m_pListDoc->UpdateData(FALSE);
}
void CDlgWkInputTx3::OnDelete()
{
// TODO: Add your control notification handler code here
if(m_pListDoc==NULL)return;
m_pListDoc->Delete(false);
}
void CDlgWkInputTx3::OnClickMaster(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
*pResult = 0;
int nItem = m_Master.GetSelected();
if(nItem < 0 || m_pListDoc == NULL) return;
m_pListDoc->UpdateData();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -