SmsManager/DLG_Filt_Modify.cpp
2025-01-14 10:46:18 +08:00

111 lines
2.6 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// DLG_Filt_Modify.cpp : implementation file
//
#include "stdafx.h"
#include "smsmanager.h"
#include "DLG_Filt_Modify.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// DLG_Filt_Modify dialog
DLG_Filt_Modify::DLG_Filt_Modify(CWnd* pParent /*=NULL*/)
: CDialog(DLG_Filt_Modify::IDD, pParent)
{
//{{AFX_DATA_INIT(DLG_Filt_Modify)
m_strWord = _T("");
m_strBegin = _T("");
m_bSDisable = FALSE;
m_lFStep = -1;
//}}AFX_DATA_INIT
memset( &m_Filt,0,sizeof(m_Filt));
}
void DLG_Filt_Modify::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(DLG_Filt_Modify)
DDX_Control(pDX, IDC_FILT_MODIFY_BEGIN, m_L_Begin);
DDX_Text(pDX, IDC_FILT_MODIFY_WORD, m_strWord);
DDV_MaxChars(pDX, m_strWord, 28);
DDX_CBString(pDX, IDC_FILT_MODIFY_BEGIN, m_strBegin);
DDV_MaxChars(pDX, m_strBegin, 10);
DDX_Check(pDX, IDC_FILT_MODIFY_SDISABLE, m_bSDisable);
DDX_CBIndex(pDX, IDC_FILT_MODIFY_FSTEP, m_lFStep);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(DLG_Filt_Modify, CDialog)
//{{AFX_MSG_MAP(DLG_Filt_Modify)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// DLG_Filt_Modify message handlers
BOOL DLG_Filt_Modify::OnInitDialog()
{
CDialog::OnInitDialog();
m_strWord = m_Filt.szWord;
m_strBegin.Format( _T("%d") , m_Filt.lFiltBegin );
m_bSDisable = m_Filt.bSDisable;
m_lFStep = m_Filt.lFStep;
UpdateData(false);
m_L_Begin.SetWindowText(m_strBegin);
CButton * pButton;
if ( m_Filt.szFilt[0] == '1' )
{
pButton = (CButton *)GetDlgItem(IDC_FILE_MODIFY_MH);
}
else
{
pButton = (CButton *)GetDlgItem(IDC_FILE_MODIFY_JC);
}
pButton->SetCheck(true);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void DLG_Filt_Modify::SetParam(ANS_Filt2_SeeData filt)
{
m_Filt = filt;
}
ANS_Filt2_SeeData DLG_Filt_Modify::GetParam()
{
return m_Filt;
}
void DLG_Filt_Modify::OnOK()
{
UpdateData(true);
if ( m_strWord.GetLength()<=0 )
{
MessageBox( _T("<EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!") , _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>") , MB_ICONWARNING );
GetDlgItem(IDC_FILT_MODIFY_WORD)->SetFocus();
return ;
}
_tcscpy( m_Filt.szWord , m_strWord );
m_Filt.lFiltBegin = _ttol(m_strBegin);
m_Filt.bSDisable = m_bSDisable;
CButton * pButton = (CButton *)GetDlgItem(IDC_FILE_MODIFY_MH);
if ( pButton->GetCheck() )
_tcscpy( m_Filt.szFilt , _T("1") ); //ģ<><C4A3>
else
_tcscpy( m_Filt.szFilt , _T("0") ); //<2F><>ȷ
m_Filt.lFStep = m_lFStep;
CDialog::OnOK();
}