mirror of http://192.168.1.51:8099/lmh188/twain3.0
127 lines
3.2 KiB
C++
127 lines
3.2 KiB
C++
|
// CFeedPaperPage.cpp: 实现文件
|
|||
|
//
|
|||
|
|
|||
|
#include "stdafx.h"
|
|||
|
#include "CFeedPaperPage.h"
|
|||
|
#include "afxdialogex.h"
|
|||
|
#include "resource.h"
|
|||
|
|
|||
|
|
|||
|
|
|||
|
// CFeedPaperPage 对话框
|
|||
|
|
|||
|
IMPLEMENT_DYNAMIC(CFeedPaperPage, CTabPageSSL)
|
|||
|
|
|||
|
CFeedPaperPage::CFeedPaperPage(CWnd* pParent /*=nullptr*/)
|
|||
|
: CTabPageSSL(IDD_PAGEFEEDPAPER, pParent)
|
|||
|
, m_radioGroupScanMode(0)
|
|||
|
, m_cbDoublePaper(FALSE)
|
|||
|
, m_cbStaple(FALSE)
|
|||
|
, m_cbRotation(FALSE)
|
|||
|
, m_cbSkew(FALSE)
|
|||
|
{
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
CFeedPaperPage::~CFeedPaperPage()
|
|||
|
{
|
|||
|
}
|
|||
|
|
|||
|
void CFeedPaperPage::DoDataExchange(CDataExchange* pDX)
|
|||
|
{
|
|||
|
CTabPageSSL::DoDataExchange(pDX);
|
|||
|
DDX_Radio(pDX, IDC_RDCONSISTSCAN, m_radioGroupScanMode);
|
|||
|
DDX_Check(pDX, IDC_CKULTRSONICDETECT, m_cbDoublePaper);
|
|||
|
DDX_Check(pDX, IDC_CKBINDINGDETECT, m_cbStaple);
|
|||
|
DDX_Check(pDX, IDC_CKBACKROTATION, m_cbRotation);
|
|||
|
DDX_Check(pDX, IDC_CKSKEWDETECT, m_cbSkew);
|
|||
|
DDX_Control(pDX, IDC_CMBORENTATION, m_cmBoxOrentation);
|
|||
|
DDX_Control(pDX, IDC_SLDDETECTLEVEL, m_sldSkrewDetecttion);
|
|||
|
DDX_Control(pDX, IDC_EDSCANNUM, m_editNum);
|
|||
|
}
|
|||
|
|
|||
|
BOOL CFeedPaperPage::OnInitDialog()
|
|||
|
{
|
|||
|
CTabPageSSL::OnInitDialog();
|
|||
|
|
|||
|
m_radioGroupScanMode = 0;
|
|||
|
|
|||
|
OnInitcmBoxOrentation(0);
|
|||
|
m_sldSkrewDetecttion.SetSlideRange(1, 5);
|
|||
|
m_sldSkrewDetecttion.SetSlidePos(3);
|
|||
|
return true;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
|
|||
|
BEGIN_MESSAGE_MAP(CFeedPaperPage, CTabPageSSL)
|
|||
|
ON_BN_CLICKED(IDC_RDCONSISTSCAN, &CFeedPaperPage::OnBnClickedScanMode)
|
|||
|
ON_BN_CLICKED(IDC_RDSPECIFYSCANNUM, &CFeedPaperPage::OnBnClickedScanMode)
|
|||
|
ON_BN_CLICKED(IDC_CKSKEWDETECT, &CFeedPaperPage::OnBnClickedCkskewdetect)
|
|||
|
END_MESSAGE_MAP()
|
|||
|
|
|||
|
BOOL CFeedPaperPage::PreTranslateMessage(MSG* pMsg)
|
|||
|
{
|
|||
|
// TODO: 在此添加专用代码和/或调用基类
|
|||
|
if (pMsg->message == WM_CHAR)
|
|||
|
{
|
|||
|
CEdit* pEdit = (CEdit*)GetDlgItem(IDC_EDSCANNUM);
|
|||
|
if (pMsg->hwnd == pEdit->m_hWnd)
|
|||
|
{
|
|||
|
CString strText;
|
|||
|
pEdit->GetWindowText(strText);
|
|||
|
int length = strText.GetLength();
|
|||
|
if ((pMsg->wParam >= '0' && pMsg->wParam <= '9' || pMsg->wParam == '\b'))
|
|||
|
return CDialog::PreTranslateMessage(pMsg);
|
|||
|
else
|
|||
|
return true;
|
|||
|
}
|
|||
|
}
|
|||
|
return CDialog::PreTranslateMessage(pMsg);
|
|||
|
}
|
|||
|
|
|||
|
// CFeedPaperPage 消息处理程序
|
|||
|
void CFeedPaperPage::OnBnClickedScanMode()
|
|||
|
{
|
|||
|
UpdateData(TRUE);
|
|||
|
CButton* m_tempBtn = ((CButton*)GetDlgItem(IDC_RDCONSISTSCAN));
|
|||
|
m_editNum.SetWindowText(m_tempBtn->GetCheck()==TRUE?_T("-1"):_T("1"));
|
|||
|
m_editNum.EnableWindow(m_radioGroupScanMode);
|
|||
|
}
|
|||
|
|
|||
|
void CFeedPaperPage::FeedPaperPageUpdate(int val)
|
|||
|
{
|
|||
|
CButton* m_tempBtn = (CButton*)(GetDlgItem(IDC_CKBACKROTATION));
|
|||
|
int ival = (val == 3 ? 2 : (val == 0 ? 0 : 1));
|
|||
|
m_tempBtn->SetCheck(0);
|
|||
|
m_tempBtn->EnableWindow(ival != 0);
|
|||
|
}
|
|||
|
|
|||
|
void CFeedPaperPage::FeedAutoDescrewUpdate(int val)
|
|||
|
{
|
|||
|
CComboBox* m_temp = (CComboBox*)(GetDlgItem(IDC_CMBORENTATION));
|
|||
|
if (16 == val)
|
|||
|
{
|
|||
|
m_temp->SetCurSel(4);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
void CFeedPaperPage::OnInitcmBoxOrentation(int selectIndex)
|
|||
|
{
|
|||
|
m_cmBoxOrentation.InsertString(0, _T("0°"));
|
|||
|
m_cmBoxOrentation.InsertString(1, _T("90°"));
|
|||
|
m_cmBoxOrentation.InsertString(2, _T("180°"));
|
|||
|
m_cmBoxOrentation.InsertString(3, _T("-90°"));
|
|||
|
m_cmBoxOrentation.InsertString(4, _T("自动文本方向识别°"));
|
|||
|
m_cmBoxOrentation.SetCurSel(selectIndex);
|
|||
|
}
|
|||
|
|
|||
|
void CFeedPaperPage::OnBnClickedCkskewdetect()
|
|||
|
{
|
|||
|
// TODO: 在此添加控件通知处理程序代码
|
|||
|
UpdateData(TRUE);
|
|||
|
if (m_cbSkew != 1)
|
|||
|
m_sldSkrewDetecttion.SetPos(3);
|
|||
|
m_sldSkrewDetecttion.EnableWindow(m_cbSkew);
|
|||
|
}
|