home *** CD-ROM | disk | FTP | other *** search
- // TestScale.cpp : implementation file
- //
-
- #include "stdafx.h"
- #include "TestVC.h"
- #include "TestScale.h"
- #include "TestSheet.h"
-
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CTestScale property page
-
- IMPLEMENT_DYNCREATE(CTestScale, CPropertyPage)
-
- CTestScale::CTestScale() : CPropertyPage(CTestScale::IDD)
- {
- //{{AFX_DATA_INIT(CTestScale)
- //}}AFX_DATA_INIT
- }
-
- CTestScale::~CTestScale()
- {
- }
-
- void CTestScale::DoDataExchange(CDataExchange* pDX)
- {
- CPropertyPage::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CTestScale)
- DDX_Control(pDX, IDC_RADIO4, m_vsamples2);
- DDX_Control(pDX, IDC_RADIO3, m_vsamples1);
- DDX_Control(pDX, IDC_RADIO2, m_hsamples2);
- DDX_Control(pDX, IDC_RADIO1, m_hsamples1);
- DDX_Control(pDX, IDC_CHECK4, m_vgrid);
- DDX_Control(pDX, IDC_CHECK3, m_venable);
- DDX_Control(pDX, IDC_CHECK2, m_hgrid);
- DDX_Control(pDX, IDC_CHECK1, m_henable);
- //}}AFX_DATA_MAP
- }
-
- BEGIN_MESSAGE_MAP(CTestScale, CPropertyPage)
- //{{AFX_MSG_MAP(CTestScale)
- ON_BN_CLICKED(IDC_RADIO1, OnRadio1)
- ON_BN_CLICKED(IDC_RADIO2, OnRadio2)
- ON_BN_CLICKED(IDC_RADIO3, OnRadio3)
- ON_BN_CLICKED(IDC_RADIO4, OnRadio4)
- ON_BN_CLICKED(IDC_CHECK1, OnCheck1)
- ON_BN_CLICKED(IDC_CHECK2, OnCheck2)
- ON_BN_CLICKED(IDC_CHECK3, OnCheck3)
- ON_BN_CLICKED(IDC_CHECK4, OnCheck4)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // CTestScale message handlers
-
- BOOL CTestScale::OnInitDialog()
- {
- CPropertyPage::OnInitDialog();
-
- CPropertySheet* pSheet = STATIC_DOWNCAST(CPropertySheet, GetParent());
- CTestSheet* pts = DYNAMIC_DOWNCAST(CTestSheet,pSheet);
- m_player=pts->m_player;
-
- m_henable.SetCheck(m_player->GetVisibleBottomScale());
- m_hgrid.SetCheck(m_player->GetVisibleGridX());
- m_venable.SetCheck(m_player->GetVisibleRightScale());
- m_vgrid.SetCheck(m_player->GetVisibleGridY());
- if (m_player->GetBottomScaleType()==1) {
- m_hsamples1.SetCheck(1);
- m_hsamples2.SetCheck(0);
- } else {
- m_hsamples1.SetCheck(0);
- m_hsamples2.SetCheck(1);
- }
-
- if (m_player->GetRightScaleType()==1) {
- m_vsamples1.SetCheck(1);
- m_vsamples2.SetCheck(0);
- } else {
- m_vsamples1.SetCheck(0);
- m_vsamples2.SetCheck(1);
- }
-
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
-
- void CTestScale::OnOK()
- {
- m_player->SetVisibleBottomScale(m_henable.GetCheck());
- m_player->SetVisibleGridX(m_hgrid.GetCheck());
- m_player->SetVisibleRightScale(m_venable.GetCheck());
- m_player->SetVisibleGridY(m_vgrid.GetCheck());
- if (m_hsamples1.GetCheck()==1) {
- m_player->SetBottomScaleType(1);
- } else {
- m_player->SetBottomScaleType(2);
- }
- if (m_vsamples1.GetCheck()==1) {
- m_player->SetRightScaleType(1);
- } else {
- m_player->SetRightScaleType(2);
- }
-
- CPropertyPage::OnOK();
- }
-
-
- void CTestScale::OnRadio1()
- {
- m_hsamples2.SetCheck(0);
- SetModified();
- }
-
- void CTestScale::OnRadio2()
- {
- m_hsamples1.SetCheck(0);
- SetModified();
- }
-
- void CTestScale::OnRadio3()
- {
- m_vsamples2.SetCheck(0);
- SetModified();
- }
-
- void CTestScale::OnRadio4()
- {
- m_vsamples1.SetCheck(0);
- SetModified();
- }
-
- void CTestScale::OnCheck1()
- {
- SetModified();
- }
-
- void CTestScale::OnCheck2()
- {
- SetModified();
- }
-
- void CTestScale::OnCheck3()
- {
- SetModified();
- }
-
- void CTestScale::OnCheck4()
- {
- SetModified();
- }
-