📄 radiusdialog.cpp
字号:
// RadiusDialog.cpp : implementation file
//
#include "stdafx.h"
#include "Mysdi.h"
#include "RadiusDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CRadiusDialog dialog
CRadiusDialog::CRadiusDialog(CWnd* pParent /*=NULL*/)
: CDialog(CRadiusDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CRadiusDialog)
m_nRadius = 0;
//}}AFX_DATA_INIT
}
void CRadiusDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CRadiusDialog)
DDX_Text(pDX, IDC_EDIT_RADIUS, m_nRadius);
DDV_MinMaxUInt(pDX, m_nRadius, 5, 250);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CRadiusDialog, CDialog)
//{{AFX_MSG_MAP(CRadiusDialog)
ON_BN_CLICKED(IDAPPLY, OnApply)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CRadiusDialog message handlers
void CRadiusDialog::OnOK()
{
// TODO: Add extra validation here
UpdateData(TRUE); // 将编辑框中的数据传递到成员变量
if(m_nRadius>=5 && m_nRadius<=250) // 判断数据是否在规定的范围之内
{
CFrameWnd *pFrame=GetParentFrame(); // 获得父窗口框架
CView* pView=pFrame->GetActiveView(); // 获得当前视图
pView->PostMessage(WM_DIALOG,IDOK); // 向视图发送消息,参数为IDOK
}
// CDialog::OnOK();
}
void CRadiusDialog::OnCancel()
{
// TODO: Add extra cleanup here
CFrameWnd *pFrame=GetParentFrame();
CView* pView=pFrame->GetActiveView();
pView->PostMessage(WM_DIALOG,IDCANCEL); // 向视图发送消息,参数为IDCANCEL
CDialog::OnCancel();
}
void CRadiusDialog::OnApply()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
if(m_nRadius>=5 && m_nRadius<=250)
{
CFrameWnd *pFrame=GetParentFrame();
CView* pView=pFrame->GetActiveView();
pView->PostMessage(WM_DIALOG,IDAPPLY); // 向视图发送消息,参数为IDAPPLY
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -