// AlarmSetDlg.cpp : implementation file
//
#include "stdafx.h"
#include "deskclock.h"
#include "AlarmSetDlg.h"
#include "BeepSetDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/
//////////////////////////////////////////////////////////////////////////// // AlarmSetDlg dialog
AlarmSetDlg::AlarmSetDlg(CWnd* pParent /*=NULL*/)
: CDialog(AlarmSetDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(AlarmSetDlg)
m_bSound = TRUE;
m_bMusic = 0;
m_strAlarmMusic = _T("");
m_pickerTime = 0;
//}}AFX_DATA_INIT
SYSTEMTIME time;
GetLocalTime(&time);
m_pickerTime = time;
m_hour = time.wHour;
m_minute = time.wMinute;
m_second = time.wSecond;
}
void AlarmSetDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(AlarmSetDlg)
DDX_Text(pDX, IDC_HO, m_hour);
DDX_Text(pDX, IDC_MI, m_minute);
DDX_Text(pDX, IDC_SE, m_second);
DDX_Check(pDX, IDC_BMUSIC, m_bSound);
DDX_Radio(pDX, IDC_MUSIC, m_bMusic);
DDX_Text(pDX, IDC_PATHMUSIC, m_strAlarmMusic);
DDX_DateTimeCtrl(pDX, IDC_DATETIMEPICKER2, m_pickerTime);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(AlarmSetDlg, CDialog)
//{{AFX_MSG_MAP(AlarmSetDlg)
ON_BN_CLICKED(IDC_MUSIC, OnMusic)
ON_BN_CLICKED(IDC_BEEP, OnBeep)
ON_BN_CLICKED(IDC_BMUSIC, OnBmusic)
ON_BN_CLICKED(IDC_SMUSIC, OnSelectMusic)
ON_BN_CLICKED(IDC_SBEEP, OnSelectBeep)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// AlarmSetDlg message handlers
BOOL AlarmSetDlg::OnInitDialog()
{
CDialog::OnInitDialog();
/
/ TODO: Add extra initialization here
SetEnable();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE }
void AlarmSetDlg::SetEnable()
{
if(m_bSound)
{
GetDlgItem(IDC_MUSIC)->EnableWindow(true);
GetDlgItem(IDC_BEEP)->EnableWindow(true);
if(!m_bMusic)
{
GetDlgItem(IDC_PATHMUSIC)->EnableWindow(true);
GetDlgItem(IDC_SMUSIC)->EnableWindow(true);
GetDlgItem(IDC_SBEEP)->EnableWindow(false);
}
else
{
GetDlgItem(IDC_PATHMUSIC)->EnableWindow(false);
GetDlgItem(IDC_SMUSIC)->EnableWindow(false);
GetDlgItem(IDC_SBEEP)->EnableWindow(true);
}
}
else
{
GetDlgItem(IDC_PATHMUSIC)->EnableWindow(false);
GetDlgItem(IDC_SMUSIC)->EnableWindow(false);
GetDlgItem(IDC_SBEEP)->EnableWindow(false);
GetDlgItem(IDC_MUSIC)->EnableWindow(false);
GetDlgItem(IDC_BEEP)->EnableWindow(false);
html特效代码天气时钟}
}
void AlarmSetDlg::OnMusic()
{
// TODO: Add your control notification handler code here
UpdateData(true);
SetEnable();
}
void AlarmSetDlg::OnBeep()
{
// TODO: Add your control notification handler code here
UpdateData(true);
SetEnable();
}
void AlarmSetDlg::OnBmusic()
{
// TODO: Add your control notification handler code here
UpdateData(true);
SetEnable();
}
void AlarmSetDlg::OnSelectMusic()
{
// TODO: Add your control notification handler code here
CFileDialog dlg(TRUE,"wave",NULL,NULL,"wave file(*.wav)|*.WAV",NULL);
if (dlg.DoModal()==IDOK)
{
m_strAlarmMusic = dlg.GetPathName();
UpdateData(false);
}
}
void AlarmSetDlg::OnSelectBeep()
{
// TODO: Add your control notification handler code here
BeepSetDlg dlg;
dlg.m_typeBeep = m_typeBeep;
if(dlg.DoModal() == IDOK)
{
m_typeBeep = dlg.m_typeBeep;
}
}
// BackSetDlg.cpp : implementation file
//
#include "stdafx.h"
#include "deskclock.h"
#include "BackSetDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
///////////////////////////////////////////////////////////////////////////// // BackSetDlg dialog
BackSetDlg::BackSetDlg(CWnd* pParent /*=NULL*/)
: CDialog(BackSetDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(BackSetDlg)
m_bPicture = 0;
m_strBk = _T("");
m_bBkStre = -1;
/
/}}AFX_DATA_INIT
}
void BackSetDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(BackSetDlg)
DDX_Radio(pDX, IDC_COLOR, m_bPicture);
DDX_Text(pDX, IDC_EDITPICTURE, m_strBk);
DDX_Radio(pDX, IDC_CENTER, m_bBkStre);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(BackSetDlg, CDialog)
//{{AFX_MSG_MAP(BackSetDlg)
ON_BN_CLICKED(IDC_COLOR, OnColor)
ON_BN_CLICKED(IDC_RADIO2, OnRadio2)
ON_WM_PAINT()
ON_BN_CLICKED(IDC_BKCOLOR, OnBkcolor)
ON_BN_CLICKED(IDC_BKPICTURE, OnBkpicture)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// BackSetDlg message handlers
BOOL BackSetDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
SetEnable();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE }
void BackSetDlg::SetEnable()
{
if(!m_bPicture)
{
GetDlgItem(IDC_BKCOLOR)->EnableWindow(true);
GetDlgItem(IDC_BKPICTURE)->EnableWindow(false);
GetDlgItem(IDC_EDITPICTURE)->EnableWindow(false);
GetDlgItem(IDC_STRE)->EnableWindow(false);

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。