📄 status.cpp
字号:
// Status.cpp : implementation file
//
#include "stdafx.h"
#include "Status.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CStatus dialog
CStatus::CStatus(CWnd* pParent /*=NULL*/)
: CDialog(CStatus::IDD, pParent)
{
//{{AFX_DATA_INIT(CStatus)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CStatus::AddString(LPCTSTR lpszString)
{
m_StatusList.AddString(lpszString);
// Scroll down.
m_StatusList.SetCurSel(m_StatusList.GetCount()-1);
// Clear the selection.
m_StatusList.SetCurSel(-1);
SetFocus();
}
void CStatus::Reset()
{
m_StatusList.ResetContent();
}
void CStatus::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CStatus)
DDX_Control(pDX, IDOK, m_OKButton);
DDX_Control(pDX, IDC_PROGRESS1, m_Progress);
DDX_Control(pDX, IDC_LIST1, m_StatusList);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CStatus, CDialog)
//{{AFX_MSG_MAP(CStatus)
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CStatus message handlers
void CStatus::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
{
CDialog::OnPaint();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -