📄 dialogkk.cpp
字号:
// Dialogkk.cpp : implementation file
//
#include "stdafx.h"
#include "最近邻法分类器.h"
#include "Dialogkk.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDialogkk dialog
CDialogkk::CDialogkk(CWnd* pParent /*=NULL*/)
: CDialog(CDialogkk::IDD, pParent)
{
//{{AFX_DATA_INIT(CDialogkk)
m_k1 = 0;
m_k2 = 0;
//}}AFX_DATA_INIT
}
void CDialogkk::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDialogkk)
DDX_Control(pDX, IDC_STATIC2, m_c2);
DDX_Control(pDX, IDC_STATIC1, m_c1);
DDX_Text(pDX, IDC_EDIT1, m_k1);
DDX_Text(pDX, IDC_EDIT2, m_k2);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDialogkk, CDialog)
//{{AFX_MSG_MAP(CDialogkk)
ON_WM_ERASEBKGND()
ON_EN_CHANGE(IDC_EDIT1, OnChangeEdit1)
ON_EN_CHANGE(IDC_EDIT2, OnChangeEdit2)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDialogkk message handlers
BOOL CDialogkk::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
mybitmap.LoadBitmap(IDB_BITMAP1);
strcpy(m_c1.mychar,"k参数的选择(请填写奇数):");
strcpy(m_c2.mychar,"k`参数的选择(请填写大于k/2的整数):");
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
BOOL CDialogkk::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;
}
BEGIN_EVENTSINK_MAP(CDialogkk, CDialog)
//{{AFX_EVENTSINK_MAP(CDialogkk)
ON_EVENT(CDialogkk, IDOK, 1 /* Click */, OnClickOk, VTS_NONE)
//}}AFX_EVENTSINK_MAP
END_EVENTSINK_MAP()
void CDialogkk::OnClickOk()
{
// TODO: Add your control notification handler code here
CDialog::OnOK();
}
void CDialogkk::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.
UpdateData(true);
// TODO: Add your control notification handler code here
}
void CDialogkk::OnChangeEdit2()
{
// 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.
UpdateData(true);
// TODO: Add your control notification handler code here
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -