?? dialog0.cpp
字號:
// Dialog0.cpp : implementation file
//
#include "stdafx.h"
#include "遺傳算法.h"
#include "Dialog0.h"
#include "Dialog2.h"
#include "遺傳算法Set.h"
#include "遺傳算法Doc.h"
#include "遺傳算法View.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDialog0 dialog
CDialog0::CDialog0(CWnd* pParent /*=NULL*/)
: CDialog(CDialog0::IDD, pParent)
{
//{{AFX_DATA_INIT(CDialog0)
m_shouru = _T("");
m_shouxian = _T("");
m_xinyu = _T("");
m_xingbie = _T("");
m_nianling = _T("");
//}}AFX_DATA_INIT
}
void CDialog0::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDialog0)
DDX_Text(pDX, IDC_EDIT1, m_shouru);
DDX_Text(pDX, IDC_EDIT2, m_shouxian);
DDX_Text(pDX, IDC_EDIT3, m_xinyu);
DDX_Text(pDX, IDC_EDIT4, m_xingbie);
DDX_Text(pDX, IDC_EDIT5, m_nianling);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDialog0, CDialog)
//{{AFX_MSG_MAP(CDialog0)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDialog0 message handlers
void CDialog0::OnOK()
{
// TODO: Add extra validation here
UpdateData(TRUE);
if(m_shouru == "50-60w")
{
mychrom[0]=1;
mychrom[1]=1;
}
else if(m_shouru == "40-50w")
{
mychrom[0]=1;
mychrom[1]=0;
}
else if(m_shouru == "30-40w")
{
mychrom[0]=0;
mychrom[1]=1;
}
else if(m_shouru == "20-30w")
{
mychrom[0]=0;
mychrom[1]=0;
}
else if(m_shouru == "?")
{
mychrom[0]=2;
mychrom[1]=2;
}
else
{
AfxMessageBox("輸入格式有誤,請重新輸入!");
return;
}
//////////////////////////////
if(m_shouxian=="no")
mychrom[2]=0;
else if(m_shouxian=="yes")
mychrom[2]=1;
else
{
AfxMessageBox("輸入格式有誤,請重新輸入!");
return;
}
////////////////////////////////
if(m_xinyu=="no")
mychrom[3]=0;
else if(m_xinyu=="yes")
mychrom[3]=1;
else
{
AfxMessageBox("輸入格式有誤,請重新輸入!");
return;
}
////////////////////////////////
if(m_xingbie=="woman")
mychrom[4]=0;
else if(m_xingbie=="man")
mychrom[4]=1;
else
{
AfxMessageBox("輸入格式有誤,請重新輸入!");
return;
}
///////////////////////////////
if(m_nianling == "50-59")
{
mychrom[5]=1;
mychrom[6]=1;
}
else if(m_nianling == "40-49")
{
mychrom[5]=1;
mychrom[6]=0;
}
else if(m_nianling == "30-39")
{
mychrom[5]=0;
mychrom[6]=1;
}
else if(m_nianling == "20-29")
{
mychrom[5]=0;
mychrom[6]=0;
}
else
{
AfxMessageBox("輸入格式有誤,請重新輸入!");
return;
}
CDialog::OnOK();
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -