twain3.0/huagao/CIndicatorDlg.cpp

74 lines
1.4 KiB
C++

// CIndicatorDlg.cpp: 实现文件
//
#include "stdafx.h"
#include "CIndicatorDlg.h"
#include "afxdialogex.h"
#include "resource.h"
// CIndicatorDlg 对话框
IMPLEMENT_DYNAMIC(CIndicatorDlg, CDialogEx)
CIndicatorDlg::CIndicatorDlg(std::function<void()> stop, CWnd* pParent /*=nullptr*/)
: CDialogEx(IDD_INDICATOR, pParent)
, m_stop(stop)
{
}
CIndicatorDlg::~CIndicatorDlg()
{
}
void CIndicatorDlg::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
}
BOOL CIndicatorDlg::OnInitDialog()
{
#ifdef LANXUM
//GetDlgItem(IDC_BTNSTOPSCAN)->ShowWindow(SW_HIDE);
#endif // LANXUM
return 0;
}
BEGIN_MESSAGE_MAP(CIndicatorDlg, CDialogEx)
ON_BN_CLICKED(IDC_BTNSTOPSCAN, &CIndicatorDlg::OnBnClickedBtnstopscan)
ON_WM_CLOSE()
END_MESSAGE_MAP()
// CIndicatorDlg 消息处理程序
void CIndicatorDlg::setindicatortext(int aquire, int updata)
{
//wchar_t text[260] = { 0 };
CString str;
str.Format(L"扫描\t\t\t\t%d 页\n上传\t\t\t\t%d 面", aquire, updata);
//_stprintf(text, L"扫描\t\t\t\t%d 页\n上传\t\t\t\t%d 面", aquire,updata);
// GetDlgItem(IDC_STATIC_TIPS)->SetWindowTextW(str);
SetDlgItemText(IDC_STATIC_TIPS,str);
}
void CIndicatorDlg::OnBnClickedBtnstopscan()
{
// TODO: 在此添加控件通知处理程序代码
if (m_stop)
m_stop();
}
void CIndicatorDlg::OnClose()
{
// TODO: 在此添加消息处理程序代码和/或调用默认值
if (m_stop)
m_stop();
CDialogEx::OnClose();
}