errordlg.cpp

来自「多层神经网络范例 http://www.codeproject.com/cpp」· C++ 代码 · 共 66 行

CPP
66
字号
// ErrorDlg.cpp : implementation file
//

#include "stdafx.h"
#include "MultiLayerPerceptron.h"
#include "ErrorDlg.h"
#include ".\errordlg.h"


// CErrorDlg dialog

IMPLEMENT_DYNAMIC(CErrorDlg, CDialog)
CErrorDlg::CErrorDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CErrorDlg::IDD, pParent)
{
}

CErrorDlg::~CErrorDlg()
{
}

void CErrorDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_SMARTGRAPH1, m_errorGraph);
}


BEGIN_MESSAGE_MAP(CErrorDlg, CDialog)
	ON_WM_SIZE()
END_MESSAGE_MAP()


// CErrorDlg message handlers

BOOL CErrorDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	m_errorGraph.SetParentWnd(m_hWnd);
	m_errorGraph.put_Title(_T("Error Graph"));
	m_errorGraph.put_xLable(_T("Number of iterations"));
	m_errorGraph.put_yLable(_T("Total RMS error"));
	m_errorGraph.SetData(0,0,0,0);

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}

void CErrorDlg::OnSize(UINT nType, int cx, int cy)
{
	CDialog::OnSize(nType, cx, cy);
	RECT rc,rc2;
	GetClientRect(&rc);
	rc.bottom -= 30;
	//if(m_errorGraph.m_hWndOwner)
    m_errorGraph.MoveWindow(&rc);
	rc2.top = rc.bottom; rc2.left = rc.left; rc2.right = rc2.left + 40; rc2.bottom = rc2.top + 30;
	CWnd* pwnd = GetDlgItem(IDOK);
	if(pwnd)
        pwnd->MoveWindow(&rc2);
	m_errorGraph.UpdateGraph();
	Invalidate();
	// TODO: Add your message handler code here
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?