PolypropDlg.cpp
上传用户:ywlong9188
上传日期:2022-05-31
资源大小:2656k
文件大小:2k
- // PolypropDlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "Proj.h"
- #include "ColorStatic.h"
- #include "PolypropDlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CPolypropDlg dialog
- CPolypropDlg::CPolypropDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CPolypropDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CPolypropDlg)
- m_nStyle = -1;
- m_nWidth = 0;
- m_nAttr = -1;
- m_name = _T("");
- //}}AFX_DATA_INIT
- m_bFirst = TRUE;
- }
- void CPolypropDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CPolypropDlg)
- DDX_Control(pDX, IDC_COMBO1, m_cStyle);
- DDX_CBIndex(pDX, IDC_COMBO1, m_nStyle);
- DDX_Text(pDX, IDC_EDIT1, m_nWidth);
- DDV_MinMaxInt(pDX, m_nWidth, 1, 32);
- DDX_Radio(pDX, IDC_ATTR_FILL, m_nAttr);
- DDX_Text(pDX, IDC_POLY_NAME, m_name);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CPolypropDlg, CDialog)
- //{{AFX_MSG_MAP(CPolypropDlg)
- ON_EN_CHANGE(IDC_EDIT1, OnChangeEdit1)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CPolypropDlg message handlers
- BOOL CPolypropDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- // TODO: Add extra initialization here
- m_lDlg.SubclassDlgItem(IDC_POLY_LINE,this);
- m_fDlg.SubclassDlgItem(IDC_POLY_FILL,this);
- if( m_cStyle.GetSafeHwnd() != NULL)
- m_cStyle.EnableWindow(m_nWidth <= 1);
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void CPolypropDlg::OnChangeEdit1()
- {
- // TODO: Add your control notification handler code here
- if(!m_bFirst){
- UpdateData(TRUE);
-
- }
- if(m_nWidth > 1)
- {
- m_nStyle = 0;
- if(m_cStyle.GetSafeHwnd() != NULL)
- m_cStyle.EnableWindow(FALSE);
- }else{
- if(m_cStyle.GetSafeHwnd() != NULL)
- m_cStyle.EnableWindow(TRUE);
- }
- m_bFirst = FALSE;
-
- }