EllipsepropDlg.cpp
上传用户:ywlong9188
上传日期:2022-05-31
资源大小:2656k
文件大小:4k
- // EllipsepropDlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "Colorstatic.h"
- #include "EllipsepropDlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CEllipsepropDlg dialog
- CEllipsepropDlg::CEllipsepropDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CEllipsepropDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CEllipsepropDlg)
- m_nAttr = -1;
- m_nStyle = -1;
- m_nEndAngle = 0;
- m_nStartAngle = 0;
- m_nWidth = 0;
- m_name = _T("");
- //}}AFX_DATA_INIT
- m_bFirst = TRUE;
- }
- void CEllipsepropDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CEllipsepropDlg)
- DDX_Control(pDX, IDC_ELLIPSE_EANGLE, m_cEAngle);
- DDX_Control(pDX, IDC_ELLIPSE_SANGLE, m_cSAngle);
- DDX_Control(pDX, IDC_COMBO1, m_cStyle);
- DDX_Radio(pDX, IDC_ATTR_FILLED, m_nAttr);
- DDX_CBIndex(pDX, IDC_COMBO1, m_nStyle);
- DDX_Text(pDX, IDC_ELLIPSE_EANGLE, m_nEndAngle);
- DDX_Text(pDX, IDC_ELLIPSE_SANGLE, m_nStartAngle);
- DDX_Text(pDX, IDC_ELLIPSE_LINEWIDTH, m_nWidth);
- DDV_MinMaxInt(pDX, m_nWidth, 1, 32);
- DDX_Text(pDX, IDC_ELLIPSE_NAME, m_name);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CEllipsepropDlg, CDialog)
- //{{AFX_MSG_MAP(CEllipsepropDlg)
- ON_EN_CHANGE(IDC_ELLIPSE_LINEWIDTH, OnChangeEllipseLinewidth)
- ON_BN_CLICKED(IDC_ATTR_FILLED, OnAttrFilled)
- ON_BN_CLICKED(IDC_RADIO2, OnRadio2)
- ON_BN_CLICKED(IDC_RADIO3, OnRadio3)
- ON_BN_CLICKED(IDC_RADIO4, OnRadio4)
- ON_BN_CLICKED(IDC_RADIO5, OnRadio5)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CEllipsepropDlg message handlers
- BOOL CEllipsepropDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- // TODO: Add extra initialization here
- m_line.SubclassDlgItem(IDC_ELLIPSE_LINE_COLOR,this);
- m_fill.SubclassDlgItem(IDC_ELLIPSE_FILL_COLOR,this);
-
- if(m_cStyle.GetSafeHwnd() != NULL)
- m_cStyle.EnableWindow(m_nWidth<=1);
-
- if(m_nAttr ==0 || m_nAttr ==1){
- if(m_cSAngle.GetSafeHwnd() != NULL)
- m_cSAngle.EnableWindow(FALSE);
- if(m_cEAngle.GetSafeHwnd() != NULL)
- m_cEAngle.EnableWindow(FALSE);
- }
- else
- {
- if(m_cSAngle.GetSafeHwnd() != NULL)
- m_cSAngle.EnableWindow(TRUE);
- if(m_cEAngle.GetSafeHwnd() != NULL)
- m_cEAngle.EnableWindow(TRUE);
- }
-
-
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void CEllipsepropDlg::OnChangeEllipseLinewidth()
- {
- // 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;
- }
- void CEllipsepropDlg::OnAttrFilled()
- {
- // TODO: Add your control notification handler code here
- if(m_cSAngle.GetSafeHwnd() != NULL)
- m_cSAngle.EnableWindow(FALSE);
- if(m_cEAngle.GetSafeHwnd() != NULL)
- m_cEAngle.EnableWindow(FALSE);
- }
- void CEllipsepropDlg::OnRadio2()
- {
- // TODO: Add your control notification handler code here
- if(m_cSAngle.GetSafeHwnd() != NULL)
- m_cSAngle.EnableWindow(FALSE);
- if(m_cEAngle.GetSafeHwnd() != NULL)
- m_cEAngle.EnableWindow(FALSE);
-
- }
- void CEllipsepropDlg::OnRadio3()
- {
- // TODO: Add your control notification handler code here
- if(m_cSAngle.GetSafeHwnd() != NULL)
- m_cSAngle.EnableWindow(TRUE);
- if(m_cEAngle.GetSafeHwnd() != NULL)
- m_cEAngle.EnableWindow(TRUE);
- }
- void CEllipsepropDlg::OnRadio4()
- {
- // TODO: Add your control notification handler code here
-
- if(m_cSAngle.GetSafeHwnd() != NULL)
- m_cSAngle.EnableWindow(TRUE);
- if(m_cEAngle.GetSafeHwnd() != NULL)
- m_cEAngle.EnableWindow(TRUE);
-
- }
- void CEllipsepropDlg::OnRadio5()
- {
- // TODO: Add your control notification handler code here
- if(m_cSAngle.GetSafeHwnd() != NULL)
- m_cSAngle.EnableWindow(TRUE);
- if(m_cEAngle.GetSafeHwnd() != NULL)
- m_cEAngle.EnableWindow(TRUE);
-
- }