// SetDlg.cpp : implementation file
//
#include "stdafx.h"
#include "2DIFS.h"
#include "SetDlg.h"
#include "2DIFSDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSetDlg dialog
CSetDlg::CSetDlg(CWnd* pParent /*=NULL*/)
: CDialog(CSetDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CSetDlg)
m_num = 1;
m_N = 0;
m_stepx = 0;
m_stepy = 0;
m_totalsteps = 0;
m_a = 0.0;
m_b = 0.0;
m_c = 0.0;
m_d = 0.16;
m_e = 0.0;
m_f = 0.0;
m_p = 0.01;
//}}AFX_DATA_INIT
// for(int i=0;i<8;i++)
// {
// a[i]=b[i]=c[i]=d[i]=e[i]=f[i]=p[i]=0.0;
// }
}
void CSetDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSetDlg)
DDX_Text(pDX, IDC_M_NUM_EDIT, m_num);
DDV_MinMaxInt(pDX, m_num, 1, 8);
DDX_Text(pDX, IDC_m_N_EDIT, m_N);
DDV_MinMaxInt(pDX, m_N, 1, 8);
DDX_Text(pDX, IDC_X_EDIT1, m_stepx);
DDX_Text(pDX, IDC_Y_EDIT2, m_stepy);
DDX_Text(pDX, IDC_TOTAL_EDIT, m_totalsteps);
DDX_Text(pDX, IDC_A_EDIT, m_a);
DDX_Text(pDX, IDC_B_EDIT, m_b);
DDX_Text(pDX, IDC_C_EDIT, m_c);
DDX_Text(pDX, IDC_D_EDIT, m_d);
DDX_Text(pDX, IDC_E_EDIT, m_e);
DDX_Text(pDX, IDC_F_EDIT, m_f);
DDX_Text(pDX, IDC_P_EDIT, m_p);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CSetDlg, CDialog)
//{{AFX_MSG_MAP(CSetDlg)
ON_BN_CLICKED(IDC_addN_BUTTON, OnaddNBUTTON)
ON_BN_CLICKED(IDC_addn_BUTTON1, OnaddnBUTTON1)
ON_BN_CLICKED(IDC_subn_BUTTON, OnsubnBUTTON)
ON_BN_CLICKED(IDC_subN_BUTTON2, OnsubNBUTTON2)
ON_EN_CHANGE(IDC_A_EDIT, OnChangeAEdit)
ON_EN_CHANGE(IDC_B_EDIT, OnChangeBEdit)
ON_EN_CHANGE(IDC_C_EDIT, OnChangeCEdit)
ON_EN_CHANGE(IDC_D_EDIT, OnChangeDEdit)
ON_EN_CHANGE(IDC_E_EDIT, OnChangeEEdit)
ON_EN_CHANGE(IDC_F_EDIT, OnChangeFEdit)
ON_EN_CHANGE(IDC_P_EDIT, OnChangePEdit)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSetDlg message handlers
void CSetDlg::OnaddNBUTTON()
{
// TODO: Add your control notification handler code here
if(m_N<8) m_N++;
UpdateData(FALSE);
}
void CSetDlg::OnaddnBUTTON1()
{
// TODO: Add your control notification handler code here
if(m_num< m_N)m_num++;
{
m_a= a[m_num-1] ;
m_b= b[m_num-1] ;
m_c= c[m_num-1] ;
m_d= d[m_num-1] ;
m_e= e[m_num-1] ;
m_f= f[m_num-1] ;
m_p= p[m_num-1] ;
}
UpdateData(FALSE);
}
void CSetDlg::OnsubnBUTTON()
{
// TODO: Add your control notification handler code here
if(m_num!=1)m_num--;
{
m_a= a[m_num-1] ;
m_b= b[m_num-1] ;
m_c= c[m_num-1] ;
m_d= d[m_num-1] ;
m_e= e[m_num-1] ;
m_f= f[m_num-1] ;
m_p= p[m_num-1] ;
}
UpdateData(FALSE);
}
void CSetDlg::OnsubNBUTTON2()
{
// TODO: Add your control notification handler code here
if(m_N!=1)m_N--;
UpdateData(FALSE);
}
void CSetDlg::OnChangeAEdit()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function to send the EM_SETEVENTMASK message to the control
// with the ENM_CHANGE flag ORed into the lParam mask.
// TODO: Add your control notification handler code here
UpdateData(TRUE);
a[m_num-1] =m_a;
}
void CSetDlg::OnChangeBEdit()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function to send the EM_SETEVENTMASK message to the control
// with the ENM_CHANGE flag ORed into the lParam mask.
// TODO: Add your control notification handler code here
UpdateData(TRUE);
b[m_num-1] =m_b;
}
void CSetDlg::OnChangeCEdit()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function to send the EM_SETEVENTMASK message to the control
// with the ENM_CHANGE flag ORed into the lParam mask.
// TODO: Add your control notification handler code here
UpdateData(TRUE);
c[m_num-1] =m_c;
}
void CSetDlg::OnChangeDEdit()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function to send the EM_SETEVENTMASK message to the control
// with the ENM_CHANGE flag ORed into the lParam mask.
// TODO: Add your control notification handler code here
UpdateData(TRUE);
d[m_num-1] =m_d;
}
void CSetDlg::OnChangeEEdit()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function to send the EM_SETEVENTMASK message to the control
// with the ENM_CHANGE flag ORed into the lParam mask.
// TODO: Add your control notification handler code here
UpdateData(TRUE);
e[m_num-1] =m_e;
}
void CSetDlg::OnChangeFEdit()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function to send the EM_SETEVENTMASK message to the control
// with the ENM_CHANGE flag ORed into the lParam mask.
// TODO: Add your control notification handler code here
UpdateData(TRUE);
f[m_num-1] =m_f;
}
void CSetDlg::OnChangePEdit()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function to send the EM_SETEVENTMASK message to the control
// with the ENM_CHANGE flag ORed into the lParam mask.
// TODO: Add your control notification handler code here
UpdateData(TRUE);
p[m_num-1]=m_p;
}
BOOL CSetDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_a=a[m_num-1];
m_b=b[m_num-1];
m_c=c[m_num-1];
m_d=d[m_num-1];
m_e=e[m_num-1];
m_f=f[m_num-1];
m_p=p[m_num-1];
UpdateData(FALSE);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
评论0