📄 nnodedlg.cpp
字号:
// nNodeDlg.cpp : implementation file
//
#include "stdafx.h"
#include "ANNdemo.h"
#include "nNodeDlg.h"
#include <fstream.h>
#include <assert.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CnNodeDlg dialog
CnNodeDlg::CnNodeDlg(CWnd* pParent /*=NULL*/)
: CDialog(CnNodeDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CnNodeDlg)
m_nNodeinput = 0;
m_nNodeoutput= 0;
//}}AFX_DATA_INIT
}
void CnNodeDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CnNodeDlg)
DDX_Control(pDX, IDC_nLayer_LIST, m_nLayer);
DDX_Text(pDX, IDC_nNodeinput_EDIT, m_nNodeinput);
DDV_MinMaxInt(pDX, m_nNodeinput, 0, 10000);
DDX_Text(pDX, IDC_nNodeoutput_EDIT, m_nNodeoutput);
DDV_MinMaxInt(pDX, m_nNodeoutput, 0, 10000);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CnNodeDlg, CDialog)
//{{AFX_MSG_MAP(CnNodeDlg)
ON_LBN_SELCHANGE(IDC_nLayer_LIST, OnSelchangenLayerLIST)
ON_EN_CHANGE(IDC_nNodeinput_EDIT, OnChangenNodeinputEDIT)
ON_BN_CLICKED(ID_Save_Button, OnSaveButton)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CnNodeDlg message handlers
BOOL CnNodeDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
CString str;
for (int i=1;i<nLay_num-1;i++)
{
str.Format(_T("第%d隐层节点数"), i);
m_nLayer.AddString( str );
}
str.Format(_T("输出层节点数"));
m_nLayer.AddString( str );
str.Format(_T("输入层节点数"));
m_nLayer.InsertString(0,str);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CnNodeDlg::OnSelchangenLayerLIST()
{
// TODO: Add your control notification handler code here
m_cursel=m_nLayer.GetCurSel();
m_nNodeoutput=nNodes[m_cursel];
m_nNodeinput=0;
UpdateData(0);
}
void CnNodeDlg::OnChangenNodeinputEDIT()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
m_cursel=m_nLayer.GetCurSel();
UpdateData(1);
nNodes[m_cursel]=m_nNodeinput;
}
void CnNodeDlg::OnSaveButton()
{
// TODO: Add your control notification handler code here
OnOK();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -