ButtonPropDlg.cpp
上传用户:ywlong9188
上传日期:2022-05-31
资源大小:2656k
文件大小:2k
- // ButtonPropDlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "ButtonPropDlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CButtonPropDlg dialog
- CButtonPropDlg::CButtonPropDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CButtonPropDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CButtonPropDlg)
- m_caption = _T("");
- m_sNumber = _T("");
- m_sParam = _T("");
- m_name = _T("");
- m_bType = FALSE;
- m_nState = -1;
- //}}AFX_DATA_INIT
- }
- void CButtonPropDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CButtonPropDlg)
- DDX_Text(pDX, IDC_CAPTION, m_caption);
- DDX_Text(pDX, IDC_NUMBER, m_sNumber);
- DDX_Text(pDX, IDC_PARAM, m_sParam);
- DDX_Text(pDX, IDC_NAME, m_name);
- DDX_Check(pDX, IDC_CHECK1, m_bType);
- DDX_Radio(pDX, IDC_RADIO1, m_nState);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CButtonPropDlg, CDialog)
- //{{AFX_MSG_MAP(CButtonPropDlg)
- ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
- ON_BN_CLICKED(IDC_CHECK1, OnCheck1)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CButtonPropDlg message handlers
- void CButtonPropDlg::OnButton1()
- {
- CFontDialog fDlg( &m_logFont);
- fDlg.m_cf.rgbColors = m_color;
- if( fDlg.DoModal() != IDOK)
- return;
- fDlg.GetCurrentFont( &m_logFont );
- m_color = fDlg.GetColor();
- }
- void CButtonPropDlg::OnCheck1()
- {
- UpdateData(TRUE);
- GetDlgItem(IDC_RADIO1)->EnableWindow(m_bType);
- GetDlgItem(IDC_RADIO2)->EnableWindow(m_bType);
- }
- BOOL CButtonPropDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- GetDlgItem(IDC_RADIO1)->EnableWindow(m_bType);
- GetDlgItem(IDC_RADIO2)->EnableWindow(m_bType);
-
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }