📄 mfcsaverdlg.cpp
字号:
// MfcSaverDlg.cpp : implementation file
//
#include "StdAfx.h"
#include "MfcSaver.h"
#include "MfcSaverDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
BEGIN_MESSAGE_MAP(CMfcSaverDlg, CB14Dlg)
//{{AFX_MSG_MAP(CMfcSaverDlg)
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
CMfcSaverDlg::CMfcSaverDlg()
{
//{{AFX_DATA_INIT(CMfcSaverDlg)
//}}AFX_DATA_INIT
}
BOOL CMfcSaverDlg::OnInitDialog()
{
CB14Dlg::OnInitDialog();
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
//
// As with most MFC dialog boxes, the DoDataExchange() is where all the work
// happens. There's no easy DDX_Trackbar thing to set up the control, so
// we do it ourselves. See how the SaveOptions() and RestoreOptions() are
// called on the CMfcSaver to keep those options persistent.
//
void CMfcSaverDlg::DoDataExchange(CDataExchange* pDX)
{
CB14Dlg::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMfcSaverDlg)
//}}AFX_DATA_MAP
CMfcSaver* pSaver = (CMfcSaver*)AfxGetScreenSaverWnd();
if (!pSaver)
return;
CSliderCtrl* pSlider;
if (!pDX->m_bSaveAndValidate)
{
pSaver->RestoreOptions();
pSlider = (CSliderCtrl*)GetDlgItem(IDC_SLIDER1);
pSlider->SetRange(1, 50);
pSlider->SetPos(pSaver->GetIconCount());
pSlider = (CSliderCtrl*)GetDlgItem(IDC_SLIDER2);
pSlider->SetRange(1, 50);
pSlider->SetPos(pSaver->GetIconSpeed());
}
else
{
pSlider = (CSliderCtrl*)GetDlgItem(IDC_SLIDER1);
pSaver->SetIconCount(pSlider->GetPos());
pSlider = (CSliderCtrl*)GetDlgItem(IDC_SLIDER2);
pSaver->SetIconSpeed(pSlider->GetPos());
pSaver->SaveOptions();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -