home *** CD-ROM | disk | FTP | other *** search
/ PC User 2003 May / Disc 2 / PCU0503CD2.iso / Crystal / Samples / CPP / 32bit / Mycall / WINDOWOP.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-18  |  4.2 KB  |  112 lines

  1. // WindowOptions.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "MYCALL.h"
  6. #include "mycalldc.h"
  7. #include "WindowOp.h"
  8.  
  9. #ifdef _DEBUG
  10. #define new DEBUG_NEW
  11. #undef THIS_FILE
  12. static char THIS_FILE[] = __FILE__;
  13. #endif
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // WindowOptions property page
  17.  
  18. IMPLEMENT_DYNCREATE(WindowOptions, CPropertyPage)
  19.  
  20. WindowOptions::WindowOptions() : CPropertyPage(WindowOptions::IDD)
  21. {
  22.     //{{AFX_DATA_INIT(WindowOptions)
  23.     m_hasGroupTree = FALSE;
  24.     m_canDrillDown = FALSE;
  25.     m_hasNavigationControls = FALSE;
  26.     m_hasCancelButton = FALSE;
  27.     m_hasPrintButton = FALSE;
  28.     m_hasExportButton = FALSE;
  29.     m_hasZoomControl = FALSE;
  30.     m_hasCloseButton = FALSE;
  31.     m_hasProgressControls = FALSE;
  32.     m_hasSearchButton = FALSE;
  33.     m_hasPrintSetupButton = FALSE;
  34.     m_hasRefreshButton = FALSE;
  35.     //}}AFX_DATA_INIT
  36. }
  37.  
  38. WindowOptions::~WindowOptions()
  39. {
  40. }
  41.  
  42. void WindowOptions::DoDataExchange(CDataExchange* pDX)
  43. {
  44.     CPropertyPage::DoDataExchange(pDX);
  45.     //{{AFX_DATA_MAP(WindowOptions)
  46.     DDX_Check(pDX, IDC_CHECK1, m_hasGroupTree);
  47.     DDX_Check(pDX, IDC_CHECK2, m_canDrillDown);
  48.     DDX_Check(pDX, IDC_CHECK3, m_hasNavigationControls);
  49.     DDX_Check(pDX, IDC_CHECK4, m_hasCancelButton);
  50.     DDX_Check(pDX, IDC_CHECK6, m_hasPrintButton);
  51.     DDX_Check(pDX, IDC_CHECK7, m_hasExportButton);
  52.     DDX_Check(pDX, IDC_CHECK8, m_hasZoomControl);
  53.     DDX_Check(pDX, IDC_CHECK9, m_hasCloseButton);
  54.     DDX_Check(pDX, IDC_CHECK10, m_hasProgressControls);
  55.     DDX_Check(pDX, IDC_CHECK11, m_hasSearchButton);
  56.     DDX_Check(pDX, IDC_CHECK12, m_hasPrintSetupButton);
  57.     DDX_Check(pDX, IDC_CHECK13, m_hasRefreshButton);
  58.     //}}AFX_DATA_MAP
  59.         if(pDX->m_bSaveAndValidate){
  60.             m_windowOptions.StructSize = PE_SIZEOF_WINDOW_OPTIONS;
  61.             m_windowOptions.hasGroupTree = m_hasGroupTree;            
  62.             m_windowOptions.canDrillDown = m_canDrillDown;             
  63.             m_windowOptions.hasNavigationControls = m_hasNavigationControls;    
  64.             m_windowOptions.hasCancelButton = m_hasCancelButton;          
  65.             m_windowOptions.hasPrintButton =  m_hasPrintButton;         
  66.             m_windowOptions.hasExportButton = m_hasExportButton;         
  67.             m_windowOptions.hasZoomControl = m_hasZoomControl;           
  68.             m_windowOptions.hasCloseButton = m_hasCloseButton;          
  69.             m_windowOptions.hasProgressControls = m_hasProgressControls;      
  70.             m_windowOptions.hasSearchButton = m_hasSearchButton;         
  71.             m_windowOptions.hasPrintSetupButton = m_hasPrintSetupButton;     
  72.             m_windowOptions.hasRefreshButton = m_hasRefreshButton;         
  73.         
  74.         if(PESetWindowOptions((m_myCallDoc->m_crpeJob->GetJobHandle()), &m_windowOptions))
  75.                 m_myCallDoc->m_statusString = "Successful PESetWindowOptions Call";
  76.         else
  77.                 m_myCallDoc->m_statusString.Format("PESetWindowOptions Error %d", m_myCallDoc->m_crpeJob->GetErrorCode() );
  78.         }
  79. }    
  80.  
  81.  
  82. BEGIN_MESSAGE_MAP(WindowOptions, CPropertyPage)
  83.     //{{AFX_MSG_MAP(WindowOptions)
  84.     //}}AFX_MSG_MAP
  85. END_MESSAGE_MAP()
  86.  
  87. /////////////////////////////////////////////////////////////////////////////
  88. // WindowOptions message handlers
  89.  
  90. BOOL WindowOptions::OnInitDialog() 
  91. {
  92.     CPropertyPage::OnInitDialog();
  93.     
  94.     // TODO: Add extra initialization here
  95.     m_windowOptions.StructSize = PE_SIZEOF_WINDOW_OPTIONS;
  96.     PEGetWindowOptions((m_myCallDoc->m_crpeJob->GetJobHandle()), &m_windowOptions);
  97.     m_hasGroupTree = m_windowOptions.hasGroupTree;            
  98.     m_canDrillDown = m_windowOptions.canDrillDown;             
  99.     m_hasNavigationControls = m_windowOptions.hasNavigationControls;    
  100.     m_hasCancelButton = m_windowOptions.hasCancelButton;          
  101.     m_hasPrintButton = m_windowOptions.hasPrintButton;         
  102.     m_hasExportButton = m_windowOptions.hasExportButton;      
  103.     m_hasZoomControl = m_windowOptions.hasZoomControl;           
  104.     m_hasCloseButton = m_windowOptions.hasCloseButton;          
  105.     m_hasProgressControls = m_windowOptions.hasProgressControls;      
  106.     m_hasSearchButton = m_windowOptions.hasSearchButton;         
  107.     m_hasPrintSetupButton = m_windowOptions.hasPrintSetupButton;     
  108.     m_hasRefreshButton = m_windowOptions.hasRefreshButton;         
  109.     return TRUE;  // return TRUE unless you set the focus to a control
  110.                   // EXCEPTION: OCX Property Pages should return FALSE
  111. }
  112.