Exemplo n.º 1
0
void CConfigDlg::LoadFromReg()
{
    SelectPlaylist();

    CButton *shuffle = (CButton*)GetDlgItem( IDC_CHECK_SHUFFLE );
    shuffle->SetCheck( (((bool)m_reg[_T("Shuffle")])?BST_CHECKED:BST_UNCHECKED) );

	m_secondsSlider.SetPos( m_reg[_T("IncreaseTime")] );
	m_increase.SetCheck( (((bool)m_reg[_T("IncreaseVolume")]) ? BST_CHECKED : BST_UNCHECKED) );
	OnBnClickedIncreaseCheck();

    ((CButton*)GetDlgItem(IDC_DO_MUTE))->SetCheck( (((bool)m_reg[_T("MuteOnReturn")]) ? BST_CHECKED : BST_UNCHECKED) );

    ((CButton*)GetDlgItem(IDC_ENABLE_SNOOZE))->SetCheck( (((bool)m_reg[_T("EnableSnooze")]) ? BST_CHECKED : BST_UNCHECKED) );
    OnBnClickedEnableSnooze();

    CButton *runatstartup = (CButton*)GetDlgItem( IDC_STARTUP_CHECK );
    RegMap t(HKEY_CURRENT_USER);
    t = t[_T("Software")][_T("Microsoft")][_T("Windows")][_T("CurrentVersion")][_T("Run")];
    runatstartup->SetCheck( ((t.has_key(_T("iSnooze")))?BST_CHECKED:BST_UNCHECKED) );

    long st = 0xff & (long)m_reg[_T("SnoozeTime")];
    if( st < 1 ) st = 1; if( st > 60 ) st = 60;
    TCHAR tm[4];
    _stprintf( tm, _T("%d"), st );
    GetDlgItem(IDC_SNOOZE_TIME)->SetWindowText( tm );

    m_minimize.SetCheck( (((bool)m_reg[_T("MinimizeOnAlarm")])?BST_CHECKED:BST_UNCHECKED) );

	//LoadTimeFromReg();
	LoadAlarmsFromReg();
	FillAlarmsList();
	SetTimeDlg();
}
Exemplo n.º 2
0
BOOL CALLBACK SetTimeDlgProc( HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam )
{
	switch( iMessage )
	{
	case WM_INITDIALOG:
		{
			PrintTimeDlg( hDlg );
			break;
		}
	case WM_COMMAND:
		switch( wParam )
		{
		case IDOK:
			{
				if( SetTimeDlg( hDlg ) == FALSE )
				{
					return TRUE;
				}
				EndDialog( hDlg, 0 );
				return TRUE;
			}
		case IDCANCEL:
			{
				EndDialog( hDlg, 0 );
				return TRUE;
			}
		case IDCLEAR:
			{
				CTime tTime = CTime::GetCurrentTime();
				g_AccountMng.m_nYear = tTime.GetYear() - 1;
				g_AccountMng.m_nMonth = tTime.GetMonth();
				g_AccountMng.m_nDay = tTime.GetDay();
				g_AccountMng.m_nHour = tTime.GetHour();
				g_AccountMng.m_nMinute = tTime.GetMinute();
				PrintTimeDlg( hDlg );
				return TRUE;
			}
		}
		break;
	}
	return FALSE;
}
Exemplo n.º 3
0
void CConfigDlg::OnCbnSelchangeAlarmCombo()
{
	SetTimeDlg();
}