QuakeGod
2024-12-24 61deef5cdf96cbfdd6ad45be49e80d597c00ca65
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
// CDialogProgress.cpp: 实现文件
//
 
#include "pch.h"
#include "MTerm1.h"
#include "DialogProgress.h"
#include "afxdialogex.h"
 
 
// CDialogProgress 对话框
 
IMPLEMENT_DYNAMIC(CDialogProgress, CDialogEx)
 
CDialogProgress::CDialogProgress(CWnd* pParent /*=nullptr*/)
    : CDialogEx(IDD_DIALOG_PROGRESS, pParent)
{
 
}
 
CDialogProgress::~CDialogProgress()
{
}
 
void CDialogProgress::DoDataExchange(CDataExchange* pDX)
{
    CDialogEx::DoDataExchange(pDX);
    DDX_Control(pDX, IDC_PROGRESS1, m_progress1);
}
 
 
BEGIN_MESSAGE_MAP(CDialogProgress, CDialogEx)
    ON_WM_TIMER()
END_MESSAGE_MAP()
 
 
// CDialogProgress 消息处理程序
 
 
BOOL CDialogProgress::OnInitDialog()
{
    CDialogEx::OnInitDialog();
 
    // TODO:  在此添加额外的初始化
    this->SetWindowText(m_TitleStr);
    GetDlgItem(IDC_STATIC_HINT)->SetWindowText(m_HintStr);
    m_progress1.SetRange(0, 100);
//    m_progress1.SetRange32(0, 99);
    SetTimer(1, 100, NULL);
    return TRUE;  // return TRUE unless you set the focus to a control
                  // 异常: OCX 属性页应返回 FALSE
}
 
 
void CDialogProgress::OnTimer(UINT_PTR nIDEvent)
{
    // TODO: 在此添加消息处理程序代码和/或调用默认值
    if (nIDEvent == 0){
 
    }
    else if (nIDEvent == 1)    {
        if (m_bAutoPos)
        {
            m_nPreogress++;
        }
    //    m_progress1.SetPos(m_nPreogress);
        //if (m_nPreogress == 100) {
        //    this->OnCancel();
        //}
    }
    CDialogEx::OnTimer(nIDEvent);
}
 
 
int CDialogProgress::SetPos(int nPos)
{
    // TODO: 在此处添加实现代码.
    m_nPreogress = nPos;
    m_progress1.SetPos(nPos);
    return 0;
}
 
 
int CDialogProgress::SetTitle(CString sTitleStr)
{
    // TODO: 在此处添加实现代码.
    m_TitleStr = sTitleStr;
    this->SetWindowText(m_TitleStr);
    return 0;
}
 
int CDialogProgress::SetHintStr(CString sHintStr)
{
    // TODO: 在此处添加实现代码.
    m_HintStr = sHintStr;
    GetDlgItem(IDC_STATIC_HINT)->SetWindowText(m_HintStr);
    return 0;
}