// 601Dlg.cpp : implementation file
//
/*****************************************
有关滑动控件的使用
作者:冰点工作室 小鹰
*****************************************/
#include "stdafx.h"
#include "601.h"
#include "601Dlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMy601Dlg dialog
CMy601Dlg::CMy601Dlg(CWnd* pParent /*=NULL*/)
: CDialog(CMy601Dlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CMy601Dlg)
m_Int = 0;
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CMy601Dlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMy601Dlg)
DDX_Control(pDX, IDC_SLIDER1, m_Slider);
DDX_Text(pDX, IDC_EDIT1, m_Int);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CMy601Dlg, CDialog)
//{{AFX_MSG_MAP(CMy601Dlg)
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_NOTIFY(NM_CUSTOMDRAW, IDC_SLIDER1, OnCustomdrawSlider1)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMy601Dlg message handlers
BOOL CMy601Dlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
m_Slider.SetRange(-100,100);//初始化可用范围为-100到100
m_Slider.SetTicFreq(10);//初始化刻度为每10个单位一个
return TRUE; // return TRUE unless you set the focus to a control
}
// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void CMy601Dlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CMy601Dlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
void CMy601Dlg::OnCustomdrawSlider1(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
m_Int=m_Slider.GetPos();
UpdateData(FALSE);
*pResult = 0;
}
SLIDERT601
需积分: 3 27 浏览量
2008-05-09
10:51:18
上传
评论
收藏 10KB ZIP 举报
xiasongchuan
- 粉丝: 2
- 资源: 1
最新资源
- 小程序版基于深度学习识别午休有无在睡觉-不含数据集图片-含逐行注释和说明文档.zip
- 小程序版python语言pytorch框架的图像分类是否是蚂蚁识别-不含数据集图片-含逐行注释和说明文档.zip
- 小程序版基于深度学习对马铃薯病变识别-不含数据集图片-含逐行注释和说明文档.zip
- 小程序版python语言pytorch框架的图像分类是否发生火灾识别-不含数据集图片-含逐行注释和说明文档.zip
- 小程序版通过CNN训练识别有机物质和无机物质-不含数据集图片-含逐行注释和说明文档.zip
- 通过Google API赋能大模型,打造智能邮件助理
- 小程序版基于人工智能的卷积网络训练识别是否是蜜蜂-不含数据集图片-含逐行注释和说明文档.zip
- Multisim14.0多谐振荡器清零法仿真
- 小程序版python语言pytorch框架的图像分类不同瓶子识别-不含数据集图片-含逐行注释和说明文档.zip
- 小程序版python语言pytorch框架训练识别开车有无打电话-不含数据集图片-含逐行注释和说明文档.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
评论0