LinepropDlg.cpp
上传用户:ywlong9188
上传日期:2022-05-31
资源大小:2656k
文件大小:2k
- // LinepropDlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "ColorStatic.h"
- #include "LinepropDlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CLinepropDlg dialog
- CLinepropDlg::CLinepropDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CLinepropDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CLinepropDlg)
- m_nStyle = -1;
- m_penSize = 0;
- m_name = _T("");
- m_exPos = 0;
- m_eyPos = 0;
- m_sxPos = 0;
- m_syPos = 0;
- //}}AFX_DATA_INIT
-
- m_bFirst = TRUE;
- }
- void CLinepropDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CLinepropDlg)
- DDX_Control(pDX, IDC_PEN_STYLE, m_cCon);
- DDX_CBIndex(pDX, IDC_PEN_STYLE, m_nStyle);
- DDX_Text(pDX, IDC_PENSIZE, m_penSize);
- DDV_MinMaxInt(pDX, m_penSize, 1, 32);
- DDX_Text(pDX, IDC_LINE_NAME, m_name);
- DDX_Text(pDX, IDC_EX_POS, m_exPos);
- DDX_Text(pDX, IDC_EY_POS, m_eyPos);
- DDX_Text(pDX, IDC_SX_POS, m_sxPos);
- DDX_Text(pDX, IDC_SY_POS, m_syPos);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CLinepropDlg, CDialog)
- //{{AFX_MSG_MAP(CLinepropDlg)
- ON_EN_CHANGE(IDC_PENSIZE, OnChangePensize)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CLinepropDlg message handlers
- BOOL CLinepropDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- // TODO: Add extra initialization here
-
- m_cDlg.SubclassDlgItem(IDC_LINE_COLOR,this);
-
- if(m_cCon.GetSafeHwnd() != NULL)
- m_cCon.EnableWindow(m_penSize <= 1);
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void CLinepropDlg::OnChangePensize()
- {
- // TODO: Add your control notification handler code here
- if(!m_bFirst){
- UpdateData(TRUE);
- }
- if(m_penSize > 1)
- {
- m_nStyle = 0;
- if(m_cCon.GetSafeHwnd() != NULL)
- m_cCon.EnableWindow(FALSE);
-
- }else{
- if(m_cCon.GetSafeHwnd() != NULL)
- m_cCon.EnableWindow(TRUE);
- }
- m_bFirst = FALSE;
- }