128 lines
2.5 KiB
C++
128 lines
2.5 KiB
C++
#include "stdafx.h"
|
|
#include "AECElSetupDlg.h"
|
|
#include "earthwormdef.h"
|
|
|
|
#ifdef _DEBUG
|
|
#define new DEBUG_NEW
|
|
#undef THIS_FILE
|
|
static char THIS_FILE[] = __FILE__;
|
|
#endif
|
|
|
|
AECElSetupDlg::AECElSetupDlg(CWnd* pParent /*=NULL*/)
|
|
: CDialog(AECElSetupDlg::IDD, pParent)
|
|
{
|
|
//{{AFX_DATA_INIT(AECElSetupDlg)
|
|
m_sBomEl = _T("");
|
|
m_sCenEl = _T("");
|
|
m_sEl = _T("");
|
|
m_sTopEl = _T("");
|
|
m_nElGroup = 0;
|
|
//}}AFX_DATA_INIT
|
|
}
|
|
|
|
void AECElSetupDlg::DoDataExchange(CDataExchange* pDX)
|
|
{
|
|
CDialog::DoDataExchange(pDX);
|
|
//{{AFX_DATA_MAP(AECElSetupDlg)
|
|
DDX_Control(pDX, IDC_EDITTOPEL, m_wndTopEl);
|
|
DDX_Control(pDX, IDC_EDITEL, m_wndEl);
|
|
DDX_Control(pDX, IDC_EDITCENEL, m_wndCenEl);
|
|
DDX_Control(pDX, IDC_EDITBOMEL, m_wndBomEl);
|
|
DDX_Text(pDX, IDC_EDITBOMEL, m_sBomEl);
|
|
DDX_Text(pDX, IDC_EDITCENEL, m_sCenEl);
|
|
DDX_Text(pDX, IDC_EDITEL, m_sEl);
|
|
DDX_Text(pDX, IDC_EDITTOPEL, m_sTopEl);
|
|
DDX_Radio(pDX, IDC_RADSYB, m_nElGroup);
|
|
//}}AFX_DATA_MAP
|
|
}
|
|
|
|
BEGIN_MESSAGE_MAP(AECElSetupDlg, CDialog)
|
|
//{{AFX_MSG_MAP(AECElSetupDlg)
|
|
ON_BN_CLICKED(IDC_RADCSEL, OnRadcsel)
|
|
//}}AFX_MSG_MAP
|
|
ON_BN_CLICKED(IDOK, &AECElSetupDlg::OnBnClickedOk)
|
|
ON_BN_CLICKED(IDC_RADSHT, &AECElSetupDlg::OnBnClickedRadsht)
|
|
ON_BN_CLICKED(IDC_RADSYB, &AECElSetupDlg::OnBnClickedRadsyb)
|
|
END_MESSAGE_MAP()
|
|
|
|
BOOL AECElSetupDlg::OnInitDialog()
|
|
{
|
|
CDialog::OnInitDialog();
|
|
|
|
if (m_nElGroup < 1)
|
|
{
|
|
m_sBomEl = _T("");
|
|
m_sCenEl = _T("");
|
|
m_sEl = _T("");
|
|
m_sTopEl = _T("");
|
|
|
|
m_wndTopEl.EnableWindow(FALSE);
|
|
m_wndEl.EnableWindow(FALSE);
|
|
m_wndCenEl.EnableWindow(FALSE);
|
|
m_wndBomEl.EnableWindow(FALSE);
|
|
}
|
|
CheckRadioButton(IDC_RADSYB,IDC_RADCSEL,IDC_RADSYB + m_nElGroup);
|
|
UpdateData(FALSE);
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
void AECElSetupDlg::OnOK()
|
|
{
|
|
UpdateData(TRUE);
|
|
|
|
if (m_nElGroup == 1)
|
|
{
|
|
m_sEl = PIPE_EL;
|
|
m_sTopEl = PIPE_TOP_EL;
|
|
m_sCenEl = PIPE_CEN_EL;
|
|
m_sBomEl = PIPE_BOM_EL;
|
|
}
|
|
CDialog::OnOK();
|
|
}
|
|
|
|
void AECElSetupDlg::OnRadcsel()
|
|
{
|
|
UpdateData();
|
|
|
|
if (m_nElGroup == 2)
|
|
{
|
|
m_wndEl.EnableWindow(TRUE);
|
|
m_wndEl.SetFocus();
|
|
m_wndTopEl.EnableWindow(TRUE);
|
|
m_wndCenEl.EnableWindow(TRUE);
|
|
m_wndBomEl.EnableWindow(TRUE);
|
|
}
|
|
}
|
|
|
|
void AECElSetupDlg::OnBnClickedOk()
|
|
{
|
|
OnOK();
|
|
}
|
|
|
|
void AECElSetupDlg::OnBnClickedRadsht()
|
|
{
|
|
UpdateData();
|
|
|
|
if (m_nElGroup == 1)
|
|
{
|
|
m_wndEl.EnableWindow(FALSE);
|
|
m_wndTopEl.EnableWindow(FALSE);
|
|
m_wndCenEl.EnableWindow(FALSE);
|
|
m_wndBomEl.EnableWindow(FALSE);
|
|
}
|
|
}
|
|
|
|
void AECElSetupDlg::OnBnClickedRadsyb()
|
|
{
|
|
UpdateData();
|
|
|
|
if (m_nElGroup == 0)
|
|
{
|
|
m_wndEl.EnableWindow(FALSE);
|
|
m_wndTopEl.EnableWindow(FALSE);
|
|
m_wndCenEl.EnableWindow(FALSE);
|
|
m_wndBomEl.EnableWindow(FALSE);
|
|
}
|
|
}
|