📄 resorgprogressdlg.cpp
字号:
/************************************************************************
*
* Resource ID Organiser Core Library
*
* (c) Copyright 2000-2003 by Anna-Jayne Metcalfe (resorg@annasplace.me.uk)
* All rights reserved.
*
************************************************************************
*
* Filename : ResOrgProgressDlg.cpp
*
* Description : CResOrgProgressDlg - Progress Dialog class
*
*
* Compiler : Microsoft Visual C++ 6.0, Service Pack 3 or later
* Microsoft Visual C++ .NET 2002
*
* Target
* Environment : Windows 98/NT/2000/XP
*
* NOTE:
*
* This software is provided "as is" free for personal use. All
* title and copyrights in and to the software, including but not
* limited to any images, text, etc. incorporated into it, are
* owned by Anna-Jayne Metcalfe, except where acknowledged otherwise.
*
* Your may freely to use this code in your own products, PROVIDED
* this notice is not removed or modified.
*
*
* Visit http://www.annasplace.me.uk/resorg for latest updates
*
************************************************************************
*
* MODIFICATION HISTORY:
*
* This is a controlled document. See project configuration
* control tool for latest version and full version history.
*
* $Archive: /Projects/AddIns/ResOrg/ResOrgCore/ResOrgProgressDlg.cpp $
* $Revision: 1 $
* $Date: 7/03/03 17:46 $
* $Author: Anna $
*
* $History: ResOrgProgressDlg.cpp $
*
* ***************** Version 1 *****************
* User: Anna Date: 7/03/03 Time: 17:46
* Created in $/Projects/AddIns/ResOrg/ResOrgCore
*
* $Nokeywords: $
*
************************************************************************/
#include "StdAfx.h"
#include "ResOrgCore_Priv.h"
#include "ResOrgProgressDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CResOrgProgressDlg dialog
CResOrgProgressDlg::CResOrgProgressDlg(CWnd* pParent /*=NULL*/)
: CResOrgProgressDlg_BASE(CResOrgProgressDlg::IDD, pParent)
{
m_sCaption = _T("");
m_nCount = 1;
//{{AFX_DATA_INIT(CResOrgProgressDlg)
m_sMessage = _T("");
//}}AFX_DATA_INIT
}
void CResOrgProgressDlg::DoDataExchange(CDataExchange* pDX)
{
CResOrgProgressDlg_BASE::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CResOrgProgressDlg)
DDX_Control(pDX, IDC_RESORG_PROGRESS_MESSAGE, m_ctrlMessage);
DDX_Control(pDX, IDC_RESORG_PROGRESS_BAR, m_ctrlProgress);
DDX_Text(pDX, IDC_RESORG_PROGRESS_MESSAGE, m_sMessage);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CResOrgProgressDlg, CResOrgProgressDlg_BASE)
//{{AFX_MSG_MAP(CResOrgProgressDlg)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CResOrgProgressDlg virtual overrides
BOOL CResOrgProgressDlg::OnInitDialog(void)
{
CResOrgProgressDlg_BASE::OnInitDialog();
ASSERT(!m_sCaption.IsEmpty() );
SetWindowText(m_sCaption);
CRect rectParent, rectProgress;
CWnd* pParent = GetParent();
pParent->GetWindowRect(rectParent);
GetWindowRect(rectProgress);
CPoint p( rectParent.CenterPoint().x - (rectProgress.Width() / 2),
rectParent.CenterPoint().y - (rectProgress.Height() / 2) );
MoveWindow(p.x, p.y, rectProgress.Width(), rectProgress.Height() );
m_ctrlProgress.SetRange(0, (short)m_nCount);
m_ctrlProgress.SetStep(1);
m_ctrlProgress.SetPos(0);
return TRUE;
}
BOOL CResOrgProgressDlg::Create(CWnd* pParentWnd /*= NULL*/)
{
return CResOrgProgressDlg_BASE::Create(CResOrgProgressDlg::IDD, pParentWnd);
}
/////////////////////////////////////////////////////////////////////////////
// CResOrgProgressDlg operations
bool CResOrgProgressDlg::Initialise(const CString& sCaption, int nCount)
{
m_sCaption = sCaption;
m_nCount = nCount;
return true;
}
bool CResOrgProgressDlg::SetMessage(const CString& sMessage)
{
m_sMessage = sMessage;
if (::IsWindow(m_hWnd))
{
UpdateData(FALSE);
Invalidate(); // So the HTML control background will repaint
RedrawWindow();
m_ctrlProgress.StepIt();
}
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CResOrgProgressDlg message handlers
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -