1 // NewCylDlg.cpp : implementation file
7 static char THIS_FILE[] = __FILE__;
12 #include "NewCylDlg.h"
14 //#include "OcafApp.h"
16 /////////////////////////////////////////////////////////////////////////////
19 CNewCylDlg::CNewCylDlg(CWnd* pParent /*=NULL*/)
20 : CDialog(CNewCylDlg::IDD, pParent)
22 //{{AFX_DATA_INIT(CNewCylDlg)
24 m_Name = _T("Cylinder");
32 void CNewCylDlg::DoDataExchange(CDataExchange* pDX)
34 CDialog::DoDataExchange(pDX);
35 //{{AFX_DATA_MAP(CNewCylDlg)
36 DDX_Text(pDX, IDC_H, m_h);
37 DDX_Text(pDX, IDC_NAME, m_Name);
38 DDX_Text(pDX, IDC_R, m_r);
39 DDX_Text(pDX, IDC_X, m_x);
40 DDX_Text(pDX, IDC_Y, m_y);
41 DDX_Text(pDX, IDC_Z, m_z);
46 BEGIN_MESSAGE_MAP(CNewCylDlg, CDialog)
47 //{{AFX_MSG_MAP(CNewCylDlg)
51 /////////////////////////////////////////////////////////////////////////////
52 // CNewCylDlg message handlers
54 void CNewCylDlg::OnOK()
57 if( (m_h<=Precision::Confusion()) || (m_r<=Precision::Confusion()) )
59 MessageBox("Radius and height of a cylinder should be srictly positives.", "New box",MB_ICONEXCLAMATION);
66 void CNewCylDlg::InitFields(Standard_Real x, Standard_Real y, Standard_Real z, Standard_Real r, Standard_Real h, const TCollection_ExtendedString &Name)
73 TCollection_AsciiString AsciiName(Name);
74 m_Name=AsciiName.ToCString();