CalDlg.cpp
资源名称:ebd_src.zip [点击查看]
上传用户:kelijie
上传日期:2007-01-01
资源大小:123k
文件大小:2k
源码类别:
图形图象
开发平台:
Visual C++
- // CalDlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "ebdlib2.h"
- #include "CalDlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CCalDlg dialog
- CCalDlg::CCalDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CCalDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CCalDlg)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
- m_iOperand = OPERAND_ADD;
- }
- void CCalDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CCalDlg)
- // NOTE: the ClassWizard will add DDX and DDV calls here
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CCalDlg, CDialog)
- //{{AFX_MSG_MAP(CCalDlg)
- ON_BN_CLICKED(IDC_ADD, OnAdd)
- ON_BN_CLICKED(IDC_DVD, OnDvd)
- ON_BN_CLICKED(IDC_MUL, OnMul)
- ON_BN_CLICKED(IDC_SUB, OnSub)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CCalDlg message handlers
- void CCalDlg::OnAdd()
- {
- // TODO: Add your control notification handler code here
- m_iOperand = OPERAND_ADD;
- SetCheckBox();
- }
- void CCalDlg::OnDvd()
- {
- // TODO: Add your control notification handler code here
- m_iOperand = OPERAND_DVD;
- SetCheckBox();
- }
- void CCalDlg::OnMul()
- {
- // TODO: Add your control notification handler code here
- m_iOperand = OPERAND_MUL;
- SetCheckBox();
- }
- void CCalDlg::OnSub()
- {
- // TODO: Add your control notification handler code here
- m_iOperand = OPERAND_SUB;
- SetCheckBox();
- }
- BOOL CCalDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
- // TODO: Add extra initialization here
- SetCheckBox();
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void CCalDlg::SetCheckBox(void)
- {
- ((CButton*)GetDlgItem(IDC_ADD))->SetCheck(m_iOperand == OPERAND_ADD ? TRUE : FALSE);
- ((CButton*)GetDlgItem(IDC_SUB))->SetCheck(m_iOperand == OPERAND_SUB ? TRUE : FALSE);
- ((CButton*)GetDlgItem(IDC_MUL))->SetCheck(m_iOperand == OPERAND_MUL ? TRUE : FALSE);
- ((CButton*)GetDlgItem(IDC_DVD))->SetCheck(m_iOperand == OPERAND_DVD ? TRUE : FALSE);
- }
English
