fir_dialog.cpp
来自「对医院的药品进行管理」· C++ 代码 · 共 116 行
CPP
116 行
// fir_dialog.cpp : implementation file
//
#include "stdafx.h"
#include "医药管理系统.h"
#include "fir_dialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// fir_dialog dialog
fir_dialog::fir_dialog(CWnd* pParent /*=NULL*/)
: CDialog(fir_dialog::IDD, pParent)
{
//{{AFX_DATA_INIT(fir_dialog)
m_sUser = _T("");
m_sPass = _T("");
//}}AFX_DATA_INIT
}
void fir_dialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(fir_dialog)
DDX_Text(pDX, IDC_EDIT1, m_sUser);
DDX_Text(pDX, IDC_EDIT2, m_sPass);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(fir_dialog, CDialog)
//{{AFX_MSG_MAP(fir_dialog)
ON_WM_PAINT()
ON_WM_SETCURSOR()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// fir_dialog message handlers
void fir_dialog::OnOK()
{
// TODO: Add extra validation here
EndDialog(0);
CDialog::OnOK();
}
BOOL fir_dialog::OnInitDialog()
{
CDialog::OnInitDialog();
// 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 fir_dialog::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CPaintDC dc(this);
CRect rect;
GetWindowRect(&rect);
CDC memDC;
CBitmap cBitmap;
CBitmap* pOldMemBmp=NULL;
cBitmap.LoadBitmap(IDB_BITMAP1);
memDC.CreateCompatibleDC(&dc);
pOldMemBmp=memDC.SelectObject(&cBitmap);
dc.BitBlt(0,0,rect.Width(),rect.Height()-170,&memDC,0,0,SRCCOPY);
if(pOldMemBmp)memDC.SelectObject(pOldMemBmp);
CDialog::OnPaint();
}
// TODO: Add your message handler code here
// Do not call CDialog::OnPaint() for painting messages
}
BOOL fir_dialog::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
// TODO: Add your message handler code here and/or call default
return CDialog::OnSetCursor(pWnd, nHitTest, message);
}
HCURSOR fir_dialog::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?