#include "stdafx.h" #include "DimSettingDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif CDimSettingDlg::CDimSettingDlg(CWnd* pParent /*=NULL*/) : CDialog(CDimSettingDlg::IDD, pParent) { //{{AFX_DATA_INIT(CDimSettingDlg) m_nLabelType = 0; m_nLenType = 0; m_nGradientType = 0; m_nDnType = 0; m_nDrawType = 0; //}}AFX_DATA_INIT } void CDimSettingDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CDimSettingDlg) DDX_CBIndex(pDX, IDC_COMBO_DIM_LABEL, m_nLabelType); DDX_CBIndex(pDX, IDC_COMBO_DIM_LEN, m_nLenType); DDX_CBIndex(pDX, IDC_COMBO_DIMGRADIENT, m_nGradientType); DDX_CBIndex(pDX, IDC_COMBO_DN, m_nDnType); DDX_Radio(pDX, IDC_RADIO_DRAW1, m_nDrawType); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CDimSettingDlg, CDialog) //{{AFX_MSG_MAP(CDimSettingDlg) ON_BN_CLICKED(IDC_RADIO_DRAW1, OnRadioDraw) ON_BN_CLICKED(IDC_RADIO_DRAW2, OnRadioDraw2) //}}AFX_MSG_MAP END_MESSAGE_MAP() void CDimSettingDlg::OnRadioDraw() { SetDrawable(); } void CDimSettingDlg::OnRadioDraw2() { SetDrawable(); } void CDimSettingDlg::SetDrawable() { CWnd *pWnd1 = GetDlgItem(IDC_COMBO_DIM_LABEL); if (pWnd1 == NULL) { return; } UpdateData(TRUE); if (m_nDrawType == 0) { pWnd1->EnableWindow(TRUE); } else { pWnd1->EnableWindow(FALSE); } } BOOL CDimSettingDlg::OnInitDialog() { CDialog::OnInitDialog(); SetDrawable(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }