WaitDlgmy.cpp
资源名称:11111111.rar [点击查看]
上传用户:fujunqh
上传日期:2021-05-10
资源大小:7090k
文件大小:3k
源码类别:
多国语言处理
开发平台:
Visual C++
- // WaitDlgmy.cpp : implementation file
- //
- #include "stdafx.h"
- #include "WaitDlgmy.h"
- #include "TestSegExDlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CWaitDlgmy dialog
- CWaitDlgmy::CWaitDlgmy(CWnd* pParent /*=NULL*/)
- : CDialog(CWaitDlgmy::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CWaitDlgmy)
- m_strProcInfo = _T("");
- //}}AFX_DATA_INIT
- }
- void CWaitDlgmy::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CWaitDlgmy)
- DDX_Control(pDX, IDC_BTN_PAUSE, m_btnPause);
- DDX_Control(pDX, IDC_PROGRESS1, m_progTreat);
- DDX_Text(pDX, IDC_STATIC_INFO, m_strProcInfo);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CWaitDlgmy, CDialog)
- //{{AFX_MSG_MAP(CWaitDlgmy)
- ON_BN_CLICKED(IDC_BTN_PAUSE, OnBtnPause)
- ON_BN_CLICKED(IDC_BTN_STOP, OnBtnStop)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CWaitDlgmy message handlers
- void CWaitDlgmy::SetRange(int nLower, int nUpper)
- {
- m_progTreat.SetRange32(nLower, nUpper);
- }
- int CWaitDlgmy::SetPos(int nPos)
- {
- int nLower, nUpper;
- m_progTreat.GetRange(nLower, nUpper);
- m_strProcInfo.Format("%d of %d", nPos - nLower + 1, nUpper - nLower + 1);
- UpdateData(FALSE);
- return m_progTreat.SetPos(nPos);
- }
- BOOL CWaitDlgmy::DestroyWindow()
- {
- // TODO: Add your specialized code here and/or call the base class
- CTestSegExDlg* pParent = (CTestSegExDlg*)GetParent();
- pParent->EnableWindow(TRUE);
- return CDialog::DestroyWindow();
- }
- BOOL CWaitDlgmy::OnInitDialog()
- {
- CDialog::OnInitDialog();
- CTestSegExDlg* pParent = (CTestSegExDlg*)GetParent();
- pParent->EnableWindow(FALSE);
- // TODO: Add extra initialization here
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void CWaitDlgmy::OnBtnPause()
- {
- // TODO: Add your control notification handler code here
- CTestSegExDlg* pParent = (CTestSegExDlg*)GetParent();
- CString strText;
- m_btnPause.GetWindowText(strText);
- if(strText.Compare("暂停") == 0)
- {
- pParent->SetPauseFlag(true);
- m_btnPause.SetWindowText("继续");
- }
- else
- {
- pParent->SetPauseFlag(FALSE);
- m_btnPause.SetWindowText("暂停");
- }
- }
- void CWaitDlgmy::OnBtnStop()
- {
- // TODO: Add your control notification handler code here
- CTestSegExDlg* pParent = (CTestSegExDlg*)GetParent();
- pParent->SetStopFlag();
- }