📄 depthdlg.cpp
字号:
// DepthDlg.cpp : implementation file
//
#include "stdafx.h"
#include "MagicScissors.h"
#include "DepthDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDepthDlg dialog
CDepthDlg::CDepthDlg(CWnd* pParent /*=NULL*/)
: CDialog(CDepthDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CDepthDlg)
m_nDepth = 0;
//}}AFX_DATA_INIT
}
void CDepthDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDepthDlg)
DDX_Control(pDX, IDC_SLIDER1, m_DepthSlider);
DDX_Text(pDX, IDC_EDIT1, m_nDepth);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDepthDlg, CDialog)
//{{AFX_MSG_MAP(CDepthDlg)
ON_WM_HSCROLL()
ON_EN_UPDATE(IDC_EDIT1, OnUpdateEdit1)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDepthDlg message handlers
BOOL CDepthDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_DepthSlider.SetRange( 1, 500 );
m_DepthSlider.SetTicFreq( 500 );
m_DepthSlider.SetPos(m_nDepth+250);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDepthDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
// TODO: Add your message handler code here and/or call default
if( pScrollBar->GetDlgCtrlID() == IDC_SLIDER1 )
{
CSliderCtrl* pSlider = (CSliderCtrl*)pScrollBar;
int pos = pSlider->GetPos();
m_nDepth = pos-250;
UpdateData(FALSE);
}
CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
}
void CDepthDlg::OnUpdateEdit1()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function to send the EM_SETEVENTMASK message to the control
// with the ENM_UPDATE flag ORed into the lParam mask.
UpdateData();
m_DepthSlider.SetPos(m_nDepth+250);
UpdateData(FALSE);
// TODO: Add your control notification handler code here
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -