www.pudn.com > DigtalImageProc.rar > FilterDialog.cpp


// FilterDialog.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "DigtalImageProc.h" 
#include "FilterDialog.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CFilterDialog dialog 
 
 
CFilterDialog::CFilterDialog(CWnd* pParent /*=NULL*/) 
	: CDialog(CFilterDialog::IDD, pParent) 
{ 
	//{{AFX_DATA_INIT(CFilterDialog) 
	m_min = 0; 
	m_max = 0; 
	//}}AFX_DATA_INIT 
} 
 
 
void CFilterDialog::DoDataExchange(CDataExchange* pDX) 
{ 
	CDialog::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(CFilterDialog) 
	DDX_Text(pDX, IDC_EDIT1, m_min); 
	DDX_Text(pDX, IDC_EDIT2, m_max); 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(CFilterDialog, CDialog) 
	//{{AFX_MSG_MAP(CFilterDialog) 
	ON_WM_PAINT() 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CFilterDialog message handlers 
 
void CFilterDialog::SetFilterMode(int var) 
{ 
	mode = var; 
} 
 
void CFilterDialog::OnPaint()  
{ 
	CPaintDC dc(this); // device context for painting 
	//1--Low Pass 2--High Pass other Band Pass 
	// TODO: Add your message handler code here 
	if(mode==1) 
	{ 
		GetDlgItem(IDC_EDIT1)->EnableWindow(FALSE); 
		CWnd *pwnd=GetDlgItem(IDC_EDIT2); 
		GotoDlgCtrl(pwnd); 
	} 
	else if(mode==2) 
	{ 
		GetDlgItem(IDC_EDIT2)->EnableWindow(FALSE); 
		CWnd *pwnd=GetDlgItem(IDC_EDIT1); 
		GotoDlgCtrl(pwnd); 
	} 
	else 
	{ 
		CWnd *pwnd=GetDlgItem(IDC_EDIT1); 
		GotoDlgCtrl(pwnd); 
	} 
	// Do not call CDialog::OnPaint() for painting messages 
} 
 
void CFilterDialog::OnOK()  
{ 
	// TODO: Add extra validation here 
	UpdateData(); 
	CDialog::OnOK(); 
}