home *** CD-ROM | disk | FTP | other *** search
- /******************************************************************/
- /* */
- /* TurboCAD for Windows */
- /* Copyright (c) 1993 - 2001 */
- /* International Microcomputer Software, Inc. */
- /* (IMSI) */
- /* All rights reserved. */
- /* */
- /******************************************************************/
-
- // PaperOrientation.cpp : implementation file
- //
-
- #include "stdafx.h"
- #include "resource.h"
- #include "PaperOrientation.h"
- #include "PaperSpaceWizard.h"
-
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CPaperOrientation property page
-
- IMPLEMENT_DYNCREATE(CPaperOrientation, CPropertyPage)
-
- CPaperOrientation::CPaperOrientation() : CPropertyPage(CPaperOrientation::IDD)
- {
- //{{AFX_DATA_INIT(CPaperOrientation)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
- }
-
- CPaperOrientation::~CPaperOrientation()
- {
- }
-
- void CPaperOrientation::DoDataExchange(CDataExchange* pDX)
- {
- CPropertyPage::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CPaperOrientation)
- // NOTE: the ClassWizard will add DDX and DDV calls here
- //}}AFX_DATA_MAP
- }
-
-
- BEGIN_MESSAGE_MAP(CPaperOrientation, CPropertyPage)
- //{{AFX_MSG_MAP(CPaperOrientation)
- ON_BN_CLICKED(IDC_PORIENTATIONP, OnPorientationp)
- ON_BN_CLICKED(IDC_PORIENTATIONL, OnPorientationl)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // CPaperOrientation message handlers
-
- BOOL CPaperOrientation::OnSetActive()
- {
- CPaperSpaceWizard* pSheet = (CPaperSpaceWizard*)GetParent();
-
- ASSERT_KINDOF(CPropertySheet, pSheet);
- pSheet->SetWizardButtons( PSWIZB_BACK | PSWIZB_FINISH);
- LPTSTR IDB;
- CButton *pRbPortrait = (CButton *) GetDlgItem(IDC_PORIENTATIONP);
- CButton *pRbLandscape = (CButton *) GetDlgItem(IDC_PORIENTATIONL);
- CStatic *pPaperPreview = (CStatic *) GetDlgItem(IDC_PAPERPREVIEW);
-
-
- if (pSheet->m_PSInfo->bPaperOrientation == 0)
- {
- IDB = MAKEINTRESOURCE(IDI_ICONP);
- pRbPortrait->SetCheck(1);
- }
- else
- {
- IDB = MAKEINTRESOURCE(IDI_ICONL);
- pRbLandscape->SetCheck(1);
-
- }
- HICON pIcon = ::LoadIcon (AfxGetResourceHandle(), IDB);
- pPaperPreview->SetIcon (pIcon);
-
- return CPropertyPage::OnSetActive();
- }
-
- void CPaperOrientation::OnPorientationp()
- {
- LPTSTR IDB;
- CStatic *pPaperPreview = (CStatic *) GetDlgItem(IDC_PAPERPREVIEW);
- IDB = MAKEINTRESOURCE(IDI_ICONP);
- HICON pIcon = ::LoadIcon (AfxGetResourceHandle(), IDB);
- pPaperPreview->SetIcon (pIcon);
- DeleteObject(pIcon);
- CPaperSpaceWizard* pSheet = (CPaperSpaceWizard*)GetParent();
- pSheet->m_PSInfo->bPaperOrientation = 0;
- }
-
- void CPaperOrientation::OnPorientationl()
- {
- LPTSTR IDB;
- CStatic *pPaperPreview = (CStatic *) GetDlgItem(IDC_PAPERPREVIEW);
-
- IDB = MAKEINTRESOURCE(IDI_ICONL);
- HICON pIcon = ::LoadIcon (AfxGetResourceHandle(), IDB);
- pPaperPreview->SetIcon (pIcon);
-
- DeleteObject(pIcon);
-
- CPaperSpaceWizard* pSheet = (CPaperSpaceWizard*)GetParent();
-
- pSheet->m_PSInfo->bPaperOrientation = 1;
- }
-
- BOOL CPaperOrientation::OnWizardFinish()
- {
- return CPropertyPage::OnWizardFinish();
- }
-