newcolordepth.cpp

来自「Visual C++编程宝典随书光盘里的代码」· C++ 代码 · 共 61 行

CPP
61
字号
// NewColorDepth.cpp : implementation file
//

#include "stdafx.h"
#include "ImageView.h"
#include "NewColorDepth.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CNewColorDepth dialog


CNewColorDepth::CNewColorDepth(CWnd* pParent /*=NULL*/)
	: CDialog(CNewColorDepth::IDD, pParent)
{
	//{{AFX_DATA_INIT(CNewColorDepth)
	m_nNewColorDepth = -1;
	//}}AFX_DATA_INIT
	m_nCurrentColorDepth = -1;
}


void CNewColorDepth::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CNewColorDepth)
	DDX_Radio(pDX, IDC_RADIO1, m_nNewColorDepth);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CNewColorDepth, CDialog)
	//{{AFX_MSG_MAP(CNewColorDepth)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CNewColorDepth message handlers

BOOL CNewColorDepth::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	CenterWindow();
	if( m_nCurrentColorDepth != -1 ){
		if( m_nCurrentColorDepth < 0 ) m_nCurrentColorDepth = 0;
		else if( m_nCurrentColorDepth > 3 ) m_nCurrentColorDepth = 3;
		static int cd[] = { IDC_RADIO1, IDC_RADIO2, IDC_RADIO3, IDC_RADIO4 };
		CWnd *pWnd = GetDlgItem( cd[m_nCurrentColorDepth] );
		if( pWnd != NULL ) pWnd->EnableWindow( FALSE );
		}
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?