home *** CD-ROM | disk | FTP | other *** search
- // openopt.cpp : implementation file
- //
-
- #include "stdafx.h"
- #include "mfcdemo.h"
- #include "openopt.h"
-
- #ifdef _DEBUG
- #undef THIS_FILE
- static char BASED_CODE THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // COpenOptDlg dialog
-
-
- COpenOptDlg::COpenOptDlg(CWnd* pParent /*=NULL*/)
- : CDialog(COpenOptDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(COpenOptDlg)
- m_nBitsPerPixel = 0;
- m_nPage = 1;
- //}}AFX_DATA_INIT
- }
-
-
- void COpenOptDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(COpenOptDlg)
- DDX_Text(pDX, IDC_EDIT1, m_nPage);
- //}}AFX_DATA_MAP
- }
-
-
- BEGIN_MESSAGE_MAP(COpenOptDlg, CDialog)
- //{{AFX_MSG_MAP(COpenOptDlg)
- 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_RADIO5, OnRadio5)
- ON_BN_CLICKED(IDC_RADIO6, OnRadio6)
- ON_BN_CLICKED(IDC_RADIO7, OnRadio7)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
-
- /////////////////////////////////////////////////////////////////////////////
- // COpenOptDlg message handlers
-
- BOOL COpenOptDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- switch(m_nBitsPerPixel)
- {
- case 1:
- CheckDlgButton (IDC_RADIO1, TRUE);
- break;
- case 4:
- CheckDlgButton (IDC_RADIO2, TRUE);
- break;
- case 8:
- CheckDlgButton (IDC_RADIO3, TRUE);
- break;
- case 16:
- CheckDlgButton (IDC_RADIO4, TRUE);
- break;
- case 24:
- CheckDlgButton (IDC_RADIO5, TRUE);
- break;
- case 32:
- CheckDlgButton (IDC_RADIO6, TRUE);
- break;
- default:
- CheckDlgButton (IDC_RADIO7, TRUE);
- break;
- }
-
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
-
-
- void COpenOptDlg::OnRadio1()
- {
- m_nBitsPerPixel = 1;
- }
-
- void COpenOptDlg::OnRadio2()
- {
- m_nBitsPerPixel = 4;
- }
-
- void COpenOptDlg::OnRadio3()
- {
- m_nBitsPerPixel = 8;
- }
-
- void COpenOptDlg::OnRadio4()
- {
- m_nBitsPerPixel = 16;
- }
-
- void COpenOptDlg::OnRadio5()
- {
- m_nBitsPerPixel = 24;
- }
-
- void COpenOptDlg::OnRadio6()
- {
- m_nBitsPerPixel = 32;
- }
-
- void COpenOptDlg::OnRadio7()
- {
- m_nBitsPerPixel = 0;
- }
-