📄 showselldlg.cpp
字号:
// ShowSellDlg.cpp : implementation file
//
#include "stdafx.h"
#include "售货系统.h"
#include "ShowSellDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern CDatabase m_database;
extern CString username;
/////////////////////////////////////////////////////////////////////////////
// CShowSellDlg dialog
CShowSellDlg::CShowSellDlg(CWnd* pParent /*=NULL*/)
: CDialog(CShowSellDlg::IDD, pParent)
{
m_account=0;
m_client=0;
isok=true;
//{{AFX_DATA_INIT(CShowSellDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CShowSellDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CShowSellDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CShowSellDlg, CDialog)
//{{AFX_MSG_MAP(CShowSellDlg)
ON_WM_PAINT()
ON_BN_CLICKED(IDSELLOK, OnSellok)
ON_BN_CLICKED(IDSELLCANCEL, OnSellcancel)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CShowSellDlg message handlers
void CShowSellDlg::OnPaint()
{
CPaintDC dc(this); // device context for paintin
CFont m_font;
//设置字体样式
m_font.CreateFont(50,0,0,0,FW_BLACK,FALSE,FALSE,FALSE,
GB2312_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,
DEFAULT_QUALITY,FIXED_PITCH | FF_MODERN,"楷体_GB2312");
CFont* pOldFont=(CFont*)dc.SelectObject(&m_font);
dc.SetBkMode(TRANSPARENT);
CString str;
str.Format("应付金额 : %.2f",m_account);
dc.TextOut(20,20,str);
str.Format("实付金额 : %.2f",m_client);
dc.TextOut(20,120,str);
str.Format("应找余额 : %.2f",m_client-m_account);
dc.TextOut(20,220,str);
}
void CShowSellDlg::OnSellok()
{
CDialog::OnOK();
}
void CShowSellDlg::OnSellcancel()
{
isok=false;
CDialog::OnCancel();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -