123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- // BarDlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "IDE.h"
- #include "BarDlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- extern void DrawColorButton(LPDRAWITEMSTRUCT lpDIS,COLORREF clrButton);
- /////////////////////////////////////////////////////////////////////////////
- // CBarPage
- IMPLEMENT_DYNCREATE(CBarPage, CPropertyPage)
- CBarPage::CBarPage() : CPropertyPage(CBarPage::IDD)
- {
- //{{AFX_DATA_INIT(CBarPage)
- m_nLowwer = 0;
- m_nUpper = 0;
- m_strVar1 = _T("");
- m_strVar2 = _T("");
- m_strVar3 = _T("");
- //}}AFX_DATA_INIT
- }
- CBarPage::~CBarPage()
- {
- }
- void CBarPage::DoDataExchange(CDataExchange* pDX)
- {
- CPropertyPage::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CBarDlg)
- DDX_Text(pDX, IDC_LOWWER, m_nLowwer);
- DDX_Text(pDX, IDC_UPPER, m_nUpper);
- DDX_Text(pDX, IDC_VAR1, m_strVar1);
- DDX_Text(pDX, IDC_VAR2, m_strVar2);
- DDX_Text(pDX, IDC_VAR3, m_strVar3);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CBarPage, CPropertyPage)
- //{{AFX_MSG_MAP(CBarPage)
- ON_BN_CLICKED(IDC_BAR1COLOR, OnBar1color)
- ON_BN_CLICKED(IDC_BAR3COLOR, OnBar3color)
- ON_BN_CLICKED(IDC_BAR2COLOR, OnBar2color)
- ON_BN_CLICKED(IDC_SELVAR1, OnVar1)
- ON_BN_CLICKED(IDC_SELVAR2, OnVar2)
- ON_BN_CLICKED(IDC_SELVAR3, OnVar3)
- ON_BN_CLICKED(IDC_BARGRIDCOLOR, OnBargridcolor)
- ON_WM_DRAWITEM()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CBarPage message handlers
- void CBarPage::OnBar1color()
- {
- CColorDialog dlg(m_clrBar1);
- if(dlg.DoModal()==IDOK)
- {
- m_clrBar1 = dlg.GetColor();
- CButton* pButton = (CButton *)GetDlgItem(IDC_BAR1COLOR);
- pButton->ShowWindow(SW_HIDE);
- pButton->ShowWindow(SW_SHOW);
- }
- }
- void CBarPage::OnBar3color()
- {
- CColorDialog dlg(m_clrBar3);
- if(dlg.DoModal()==IDOK)
- {
- m_clrBar3 = dlg.GetColor();
- CButton* pButton = (CButton *)GetDlgItem(IDC_BAR3COLOR);
- pButton->ShowWindow(SW_HIDE);
- pButton->ShowWindow(SW_SHOW);
- }
- }
- void CBarPage::OnBar2color()
- {
- CColorDialog dlg(m_clrBar2);
- if(dlg.DoModal()==IDOK)
- {
- m_clrBar2 = dlg.GetColor();
- CButton* pButton = (CButton *)GetDlgItem(IDC_BAR2COLOR);
- pButton->ShowWindow(SW_HIDE);
- pButton->ShowWindow(SW_SHOW);
- }
- }
- void CBarPage::OnVar1()
- {
-
- }
- void CBarPage::OnVar2()
- {
-
- }
- void CBarPage::OnVar3()
- {
-
- }
- void CBarPage::OnBargridcolor()
- {
- }
- void CBarPage::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)
- {
- switch(nIDCtl)
- {
- case IDC_BAR1COLOR:
- DrawColorButton(lpDrawItemStruct,m_clrBar1);
- break;
- case IDC_BAR2COLOR:
- DrawColorButton(lpDrawItemStruct,m_clrBar2);
- break;
- case IDC_BAR3COLOR:
- DrawColorButton(lpDrawItemStruct,m_clrBar3);
- break;
- }
- CPropertyPage::OnDrawItem(nIDCtl, lpDrawItemStruct);
- }
|