/
bear
/
aot
Обзор
Документация
Войти
/
bear
/
aot
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Source/windows/RossDev/ProgressForm.cpp
97 строк
2 KB
sokirko74
distribute over folders
01 дек 2021, 21:21
01 дек 2021, 21:21
9bdfb1a
Код
Авторство
О чём код?
// ProgressForm.cpp : implementation file // #include "StdAfx.h" #include "RossDev.h" #include "resource.h" #include "ProgressForm.h" #include "SemanticStrView.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CProgressForm dialog CProgressForm::CProgressForm(CWnd* pParent /*=NULL*/) : CDialog(CProgressForm::IDD, pParent) { //{{AFX_DATA_INIT(CProgressForm) m_Statis = _T(""); //}}AFX_DATA_INIT } void CProgressForm::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CProgressForm) DDX_Control(pDX, IDC_PROGRESSBAR, m_ProgressCtrl); DDX_Text(pDX, IDC_Statis, m_Statis); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CProgressForm, CDialog) //{{AFX_MSG_MAP(CProgressForm) ON_WM_TIMER() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CProgressForm message handlers extern bool ThreadFinish; void CProgressForm::OnTimer(UINT_PTR dummy) { if (ThreadFinish) EndDialog(0); if (m_CurrentPos == -1) { if (GetSemBuilder().GetScrollMax() > 0) { m_Max = GetSemBuilder().GetScrollMax(); m_ProgressCtrl.SetRange(0, m_Max); m_CurrentPos = 0; }; } else { if (GetSemBuilder().GetScrollCurrent() > m_CurrentPos) { m_CurrentPos = GetSemBuilder().GetScrollCurrent(); m_ProgressCtrl.SetPos(m_CurrentPos); m_Statis.Format ("%i/%i", m_CurrentPos, m_Max); UpdateData(FALSE); }; }; CDialog::OnTimer(dummy); } BOOL CProgressForm::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here m_CurrentPos = -1; m_Max = 0; SetTimer(2, 1000, 0); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CProgressForm::OnCancel() { // TODO: Add extra cleanup here GetSemBuilder().m_RusStr.m_bShouldBeStopped = true; //CDialog::OnCancel(); }