www.pudn.com > resize.rar > ProptDlg.cpp


// ProptDlg.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "resize.h" 
#include "ProptDlg.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CProptDlg dialog 
 
 
CProptDlg::CProptDlg(CWnd* pParent /*=NULL*/) 
	: CDialog(CProptDlg::IDD, pParent) 
{ 
	//{{AFX_DATA_INIT(CProptDlg) 
	m_prpt = 100; 
	//}}AFX_DATA_INIT 
	// 
	 
	//m_slider->SetRange(0,100,true); 
	//m_slider.SetPos(100); 
} 
 
 
void CProptDlg::DoDataExchange(CDataExchange* pDX) 
{ 
	CDialog::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(CProptDlg) 
	DDX_Text(pDX, IDC_EDIT1, m_prpt); 
	DDV_MinMaxInt(pDX, m_prpt, 0, 100); 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(CProptDlg, CDialog) 
	//{{AFX_MSG_MAP(CProptDlg) 
	ON_WM_VSCROLL() 
	ON_WM_HSCROLL() 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CProptDlg message handlers 
 
BOOL CProptDlg::OnInitDialog()  
{ 
	CDialog::OnInitDialog(); 
	 
	// TODO: Add extra initialization here 
	m_slider = (CSliderCtrl *) GetDlgItem(IDC_SLIDER1); 
	m_slider->SetRange(25,100,true); 
	m_slider->SetPos(100); 
	 
	return TRUE;  // return TRUE unless you set the focus to a control 
	              // EXCEPTION: OCX Property Pages should return FALSE 
} 
 
void CProptDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)  
{ 
	// TODO: Add your message handler code here and/or call default 
	m_slider = (CSliderCtrl *) pScrollBar; 
	m_prpt = m_slider->GetPos(); 
	UpdateData(0); 
	 
	CDialog::OnHScroll(nSBCode, nPos, pScrollBar); 
}