www.pudn.com > mfcopentree.rar > Plandlg.cpp


// Plandlg.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "mfcopen.h" 
#include "Plandlg.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CPlandlg dialog 
 
 
CPlandlg::CPlandlg(CWnd* pParent /*=NULL*/) 
	: CDialog(CPlandlg::IDD, pParent) 
{ 
	//{{AFX_DATA_INIT(CPlandlg) 
	m_fa = 0.0f; 
	m_fb = 0.0f; 
	m_fc = 0.0f; 
	m_fd = 0.0f; 
	//}}AFX_DATA_INIT 
} 
 
 
void CPlandlg::DoDataExchange(CDataExchange* pDX) 
{ 
	CDialog::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(CPlandlg) 
	DDX_Control(pDX, IDC_SLIDER1, m_slider); 
	DDX_Text(pDX, IDC_EDIT1, m_fa); 
	DDX_Text(pDX, IDC_EDIT2, m_fb); 
	DDX_Text(pDX, IDC_EDIT3, m_fc); 
	DDX_Text(pDX, IDC_EDIT4, m_fd); 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(CPlandlg, CDialog) 
	//{{AFX_MSG_MAP(CPlandlg) 
	ON_WM_HSCROLL() 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CPlandlg message handlers 
 
BOOL CPlandlg::OnInitDialog()  
{ 
	CDialog::OnInitDialog(); 
	 
	// TODO: Add extra initialization here 
	m_slider.SetRange(0, 100); 
	m_slider.SetPos(0); 
 
	 
	return TRUE;  // return TRUE unless you set the focus to a control 
	              // EXCEPTION: OCX Property Pages should return FALSE 
} 
 
void CPlandlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)  
{ 
	// TODO: Add your message handler code here and/or call default 
	m_fd = m_slider.GetPos()/100.0f; 
 
	CDialog::OnHScroll(nSBCode, nPos, pScrollBar); 
} 
 
BOOL CPlandlg::PreTranslateMessage(MSG* pMsg)  
{ 
	// TODO: Add your specialized code here and/or call the base class 
	if(pMsg->message == WM_KEYDOWN) 
	{ 
		UINT mes = (int)(pMsg->wParam); 
		if(mes == VK_RETURN) 
			CDialog::OnOK(); 
	}	 
	return CDialog::PreTranslateMessage(pMsg); 
}