⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dialogk.cpp

📁 本程序是一个最近邻分类算法的演示程序
💻 CPP
字号:
// Dialogk.cpp : implementation file
//

#include "stdafx.h"
#include "最近邻法分类器.h"
#include "Dialogk.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CDialogk dialog


CDialogk::CDialogk(CWnd* pParent /*=NULL*/)
	: CDialog(CDialogk::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDialogk)
	m_k = 0;
	//}}AFX_DATA_INIT
}


void CDialogk::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDialogk)
	DDX_Control(pDX, IDC_STATIC1, m_c);
	DDX_Text(pDX, IDC_EDIT1, m_k);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDialogk, CDialog)
	//{{AFX_MSG_MAP(CDialogk)
	ON_WM_ERASEBKGND()
	ON_EN_CHANGE(IDC_EDIT1, OnChangeEdit1)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDialogk message handlers

BOOL CDialogk::OnEraseBkgnd(CDC* pDC) 
{
	// TODO: Add your message handler code here and/or call default
	
		CRect rect;
	GetClientRect(rect);
	   
        CDC memdc;
		BITMAP bm1;
        mybitmap.GetObject(sizeof(BITMAP),&bm1);
		memdc.CreateCompatibleDC(pDC);
        CBitmap* oldbitmap=memdc.SelectObject(&mybitmap);
	pDC->StretchBlt(rect.left,rect.top,rect.Width(),rect.Height(),&memdc,0,0,bm1.bmWidth,bm1.bmHeight,SRCCOPY);
	return true;
}

BOOL CDialogk::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	mybitmap.LoadBitmap(IDB_BITMAP1);
	strcpy(m_c.mychar,"k参数的选择:");
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CDialogk::OnChangeEdit1() 
{
	// 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
	UpdateData(true);
}

BEGIN_EVENTSINK_MAP(CDialogk, CDialog)
    //{{AFX_EVENTSINK_MAP(CDialogk)
	ON_EVENT(CDialogk, IDOK, 1 /* Click */, OnClickOk, VTS_NONE)
	//}}AFX_EVENTSINK_MAP
END_EVENTSINK_MAP()

void CDialogk::OnClickOk() 
{
	// TODO: Add your control notification handler code here
	CDialog::OnOK();
}

⌨️ 快捷键说明

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