www.pudn.com > IPFlood.rar > SetupGlobalDlg.cpp
// SetupGlobalDlg.cpp : implementation file
//
#include "stdafx.h"
#include "IPFlood.h"
#include "SetupGlobalDlg.h"
#include "SetupDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSetupGlobalDlg dialog
CSetupGlobalDlg::CSetupGlobalDlg(CWnd* pParent /*=NULL*/)
: CDialog(CSetupGlobalDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CSetupGlobalDlg)
m_pps = 1000;
m_number = 0;
m_FillVal = 219;
m_FillSpecial = FALSE;
m_FillRandom = TRUE;
//}}AFX_DATA_INIT
}
void CSetupGlobalDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSetupGlobalDlg)
DDX_Control(pDX, IDC_SENDMACIP, m_SendMACIP);
DDX_Text(pDX, IDC_PPS, m_pps);
DDX_Text(pDX, IDC_NUMBER, m_number);
DDX_Text(pDX, IDC_FILLVAL, m_FillVal);
DDV_MinMaxByte(pDX, m_FillVal, 0, 255);
DDX_Check(pDX, IDC_FILLSPECIAL, m_FillSpecial);
DDX_Check(pDX, IDC_FILLRANDOM, m_FillRandom);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CSetupGlobalDlg, CDialog)
//{{AFX_MSG_MAP(CSetupGlobalDlg)
ON_BN_CLICKED(IDC_FILLRANDOM, OnFillrandom)
ON_BN_CLICKED(IDC_FILLSPECIAL, OnFillspecial)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSetupGlobalDlg message handlers
void CSetupGlobalDlg::OnCancel()
{
// TODO: Add extra cleanup here
m_pps = 1000;
m_number = 0;
m_FillSpecial = FALSE;
m_FillRandom = TRUE;
m_FillVal=219;
GetDlgItem(IDC_FILLRANDOM)->EnableWindow(true);
GetDlgItem(IDC_FILLSPECIAL)->EnableWindow(false);
GetDlgItem(IDC_FILLVAL)->EnableWindow(false);
UpdateData(false);
}
BOOL CSetupGlobalDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
GetDlgItem(IDC_FILLSPECIAL)->EnableWindow(false);
GetDlgItem(IDC_FILLVAL)->EnableWindow(false);
m_SendMACIP.InsertString (0,_T("0: 802.3Ö¡"));
m_SendMACIP.InsertString (1,_T("1: IP±¨ÎÄ"));
m_SendMACIP.SetCurSel (1);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CSetupGlobalDlg::OnFillrandom()
{
// TODO: Add your control notification handler code here
m_FillRandom=!m_FillRandom;
if(m_FillRandom)
{ m_FillSpecial=false;
GetDlgItem(IDC_FILLSPECIAL)->EnableWindow(false);
GetDlgItem(IDC_FILLVAL)->EnableWindow(false);
}else
{ m_FillSpecial=true;
GetDlgItem(IDC_FILLRANDOM)->EnableWindow(false);
GetDlgItem(IDC_FILLSPECIAL)->EnableWindow(true);
GetDlgItem(IDC_FILLVAL)->EnableWindow(true);
}
UpdateData(false);
}
void CSetupGlobalDlg::OnFillspecial()
{
// TODO: Add your control notification handler code here
m_FillSpecial=!m_FillSpecial;
if(m_FillSpecial)
{ m_FillRandom=false;
GetDlgItem(IDC_FILLRANDOM)->EnableWindow(false);
GetDlgItem(IDC_FILLVAL)->EnableWindow(true);
}else
{ m_FillRandom=true;
GetDlgItem(IDC_FILLSPECIAL)->EnableWindow(false);
GetDlgItem(IDC_FILLRANDOM)->EnableWindow(true);
GetDlgItem(IDC_FILLVAL)->EnableWindow(false);
}
UpdateData(false);
}