newDialog.cpp
资源名称:DDALine.rar [点击查看]
上传用户:xmsintoyu
上传日期:2022-05-05
资源大小:9731k
文件大小:1k
源码类别:
绘图程序
开发平台:
Visual C++
- // newDialog.cpp : implementation file
- //
- #include "stdafx.h"
- #include "DDALineDoc.h"
- #include "DDALineView.h"
- #include "DDALine.h"
- #include "newDialog.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // newDialog dialog
- newDialog::newDialog(CWnd* pParent /*=NULL*/)
- : CDialog(newDialog::IDD, pParent)
- {
- //{{AFX_DATA_INIT(newDialog)
- m_x0 = 0;
- m_x1 = 0;
- m_y0 = 0;
- m_y1 = 0;
- //}}AFX_DATA_INIT
- }
- void newDialog::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(newDialog)
- DDX_Text(pDX, IDC_X0, m_x0);
- DDX_Text(pDX, IDC_X1, m_x1);
- DDX_Text(pDX, IDC_Y0, m_y0);
- DDX_Text(pDX, IDC_Y1, m_y1);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(newDialog, CDialog)
- //{{AFX_MSG_MAP(newDialog)
- ON_BN_CLICKED(IDC_CLEAR, OnClear)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // newDialog message handlers
- void newDialog::OnClear()
- {
- m_x0=m_x1=m_y0=m_y1=0;
- UpdateData(false);
- }
- void newDialog::OnOK()
- {
- UpdateData(true);
- if(m_x0==m_x1 && m_y0==m_y1)
- {
- AfxMessageBox("两个顶点不能相同!");
- m_x0=m_x1=m_y0=m_y1=0;
- UpdateData(false);
- return;
- }
- CDialog::OnOK();
- }
English
