convolutedlg.cpp

来自「图像编程」· C++ 代码 · 共 73 行

CPP
73
字号
// ConvoluteDlg.cpp : implementation file
//

#include "stdafx.h"
#include "ImageBoard.h"
#include "ConvoluteDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CConvoluteDlg dialog


CConvoluteDlg::CConvoluteDlg(int nMin, int nMax, int nDef, CWnd* pParent /*=NULL*/)
	: CDialog(CConvoluteDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CConvoluteDlg)
	m_strValue = _T("");
	m_nStreng = nDef;
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	m_nMax = nMax;
	m_nMin = nMin;
}


void CConvoluteDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CConvoluteDlg)
	DDX_Control(pDX, IDC_SLIDER1, m_Streng);
	DDX_Text(pDX, IDC_VALUE, m_strValue);
	DDX_Slider(pDX, IDC_SLIDER1, m_nStreng);
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CConvoluteDlg, CDialog)
	//{{AFX_MSG_MAP(CConvoluteDlg)
	ON_WM_HSCROLL()
		// NOTE: the ClassWizard will add message map macros here
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CConvoluteDlg message handlers

BOOL CConvoluteDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	m_Streng.SetRange(m_nMin, m_nMax, TRUE);
	m_strValue.Format("%d", m_nStreng);
	UpdateData(FALSE);
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CConvoluteDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) 
{
	UpdateData();
	m_strValue.Format("%d", m_nStreng);
	UpdateData(FALSE);

	CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
}

⌨️ 快捷键说明

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