showprogressdlg.cpp
来自「某个实验事编写粗糙集智能信息处理的程序」· C++ 代码 · 共 91 行
CPP
91 行
// ShowProgressDlg.cpp : implementation file
//
#include "stdafx.h"
#include "RSet.h"
#include "ShowProgressDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CShowProgressDlg dialog
CShowProgressDlg::CShowProgressDlg(CWnd* pParent /*=NULL*/)
: CDialog(CShowProgressDlg::IDD, pParent)
{
m_pView=NULL;
//{{AFX_DATA_INIT(CShowProgressDlg)
m_nPercent = _T("");
//}}AFX_DATA_INIT
}
CShowProgressDlg::CShowProgressDlg(CView* pView)
{
m_pView=pView;
}
void CShowProgressDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CShowProgressDlg)
DDX_Control(pDX, IDC_PROGRESS, m_progress);
DDX_Text(pDX, IDC_PERCENT, m_nPercent);
//}}AFX_DATA_MAP
}
void CShowProgressDlg::SetPosition(int progress )
{
m_progress.SetPos(progress);
m_nPercent.Format("%d%%",progress);
UpdateData(false);
}
BEGIN_MESSAGE_MAP(CShowProgressDlg, CDialog)
//{{AFX_MSG_MAP(CShowProgressDlg)
//}}AFX_MSG_MAP
ON_MESSAGE(WM_KYLIN_PROGRESS,OnKylinProgress)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CShowProgressDlg message handlers
BOOL CShowProgressDlg::Create()
{
return CDialog::Create(CShowProgressDlg::IDD);
}
BOOL CShowProgressDlg::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
return CDialog::Create(IDD, pParentWnd);
}
BOOL CShowProgressDlg::OnInitDialog()
{
CDialog::OnInitDialog();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CShowProgressDlg::OnCancel()
{
/* if(m_pView!=NULL) //非模态对话框
{
DestroyWindow();
}
else
CDialog::OnCancel();
*/
}
void CShowProgressDlg::OnKylinProgress(WPARAM wParam,LPARAM lParam)
{
SetPosition((int)wParam);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?