//{{AFX_INCLUDES()

//}}AFX_INCLUDES
#if !defined(AFX_YTVCLOCK_DIAL_H__FDFCAE60_92ED_44A8_A6BE_18FC3C8CBC8D__INCLUDED_)
#define AFX_YTVCLOCK_DIAL_H__FDFCAE60_92ED_44A8_A6BE_18FC3C8CBC8D__INCLUDED_
//#include "ytvclockalarm1.h"
#include "dtpicker.h"
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// YtvClockDial.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// YtvClockDial form view

#ifndef __AFXEXT_H__
#include <afxext.h>
#endif
#include "resource.h"
class YtvClockDial : public CDialog
{
public:
friend UINT CALLBACK YtvCCHookProcDial(
  HWND hdlg,      // handle to the dialog box window
  UINT uiMsg,     // message identifier
  WPARAM wParam,  // message parameter
  LPARAM lParam   // message parameter
);
    static DWORD ms_uInstNumber;
	CString m_strInstNumber;
	RECT m_mwrect;
	RECT m_rectPosition;
	BOOL m_bAdjast;
	BOOL m_bYtvClockDialAutoCreate;
	YtvClockDial(); 
	YtvClockDial(HWND hw,const char* caption=NULL); 
	virtual ~YtvClockDial();
	void Init();
	void Exit();
	void SizeControls(int cx, int cy);
	RECT m_rectFixedPosition;
	CMenu m_menu;
	CMenu *m_pmenu;
	BOOL m_bMoveFixed;
	BOOL m_bSizeFixed;
	char* m_pszCaption;
	BOOL m_bModeless;
    CString m_strPath; 
    HWND m_hSheetWnd;  
	BOOL m_bModifiedFlag;
	int m_nLeftClockPos;
	int m_nTopClockPos;
	BOOL m_bClockFullScreen;
	POINT m_pointOldClockPos;
	void MaxRestoreClock();
	void HideShowOnTimer(BOOL bShowWhenTimer);
	//{{AFX_DATA(YtvClockDial)
	enum { IDD = IDD_YTV_DIAL_CLOCK };
	CButton	m_btOK;
	CButton	m_checkSetProfTimer;
	CStatic	m_stSBMP;
	CStatic	m_stSdOnOff;
	CButton	m_btUpdateAlarms;
	CStatic	m_stListAlarms;
	CButton	m_btAddAlarm;
	CComboBox	m_comboListTimerCircles;
	CButton	m_btStartTimer;
	CDateTimeCtrl	m_ctrlDate;	
	CYtvClockAlarm	m_ctrlClock;
	CListBox	m_ctrlListAlarms;
	BOOL	m_bSetProfTimer;
	CString	m_strcomboListTimerCircles;
	//}}AFX_DATA
	HBITMAP m_hd;
    HBITMAP m_hf;
	HBITMAP m_hu;
	BOOL NotTimer();
	int m_nTimeShift;
	BOOL m_bSayAlarmName;
	BOOL m_bSayAlarmTime;
	BOOL m_bSayMessageText;
	BOOL m_bDefaultSetting;
	void FillTimeSpans();
	void SetTimerColors(unsigned short colornumber);
friend UINT CALLBACK YtvCFHookProcDial(
  HWND hdlg,      // handle to the dialog box window
  UINT uiMsg,     // message identifier
  WPARAM wParam,  // message parameter
  LPARAM lParam   // message parameter
);

// Attributes
public:
	char m_szSetting[257];
	BOOL m_bClockRunning;
	BOOL m_bDisplayAlarmTime;
	BOOL m_bDigitalFace;
	BOOL m_b12hour;
	BOOL m_bShowSeconds;
	BOOL m_bShowMessageBox;
	BOOL m_bPlayAlarmSound;
	enum EN_TYPEOFFACE{
		   DIGITAL_FONT,
           DIGITAL_SEGMENT,		  
		   ANALOG_LEFT,
	       ANALOG_CENTERED,
		   TIMER_RING_ROUNDED,
		   TIMER_RAY_ROUNDED,
		   TIMER_MULTI_PLANK
	} m_enTypeofFace;
	COLORREF m_clrpTimerColor[20];
    COLORREF m_clrBackgroundClock;
    COLORREF m_clrBackgroundAlarm;
	COLORREF m_clrForegroundClock;
    COLORREF m_clrForegroundAlarm;
	COLORREF m_clrForeLineClock;
	COLORREF m_clrForeLineAlarm;
	COLORREF m_clrBackLineClock;
	COLORREF m_clrBackLineAlarm;
// Operations
public:
  virtual BOOL Create(HWND hParentWnd,const char* caption=NULL);
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(YtvClockDial)
	public:
    virtual BOOL OnInitDialog();	
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	virtual void PreSubclassWindow();
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual void PostNcDestroy();
	//}}AFX_VIRTUAL

// Implementation
protected:
public:	
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif
    static DWORD m_uNextAlarmId;
	DWORD m_uNextAlarmNumber;
	// Generated message map functions
	//{{AFX_MSG(YtvClockDial)
	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
	afx_msg void OnUpdateYtvset24alarm(CCmdUI* pCmdUI);
	afx_msg void OnYtvset24alarm();
	afx_msg void OnBtytvAddalarm();
	afx_msg void OnDblclkListAlarms();
	afx_msg void OnSetAnalogClock();
	afx_msg void OnUpdateSetAnalogClock(CCmdUI* pCmdUI);
	afx_msg void OnUpdateSetDigitalClock(CCmdUI* pCmdUI);
	afx_msg void OnSetDigitalClock();
	afx_msg void OnSetBackgroundColorAlarm();
	afx_msg void OnSetBackgroundColorClock();
	afx_msg void OnSetClockLineColor();
	afx_msg void OnSetForegroundColorAlarm();
	afx_msg void OnSetForegroundColorClock();
	afx_msg void OnSetHandsAlarmColor();
	afx_msg void OnUpdateShowSeconds(CCmdUI* pCmdUI);
	afx_msg void OnShowSeconds();
	afx_msg void OnUpdate24Hours(CCmdUI* pCmdUI);
	afx_msg void On24Hours();
	afx_msg void OnBackLineColorClock();
	afx_msg void OnBackDrawColorAlarm();
	afx_msg void OnUpdateMatrixDigital(CCmdUI* pCmdUI);
	afx_msg void OnMatrixDigital();
	afx_msg void OnUpdateDigitalFont(CCmdUI* pCmdUI);
	afx_msg void OnDigitalFont();
	afx_msg void OnUpdateAnalogCentered(CCmdUI* pCmdUI);
	afx_msg void OnAnalogCentered();
	afx_msg void OnUpdateAnalogLeftAlighned(CCmdUI* pCmdUI);
	afx_msg void OnAnalogLeftAlighned();
	afx_msg void OnSetClockFont();
	afx_msg void OnSettings();
	afx_msg void OnYtvSetTimeShift();
	afx_msg void OnUpdateYtvSetTimeShift(CCmdUI* pCmdUI);
	afx_msg void OnClose();
	afx_msg void OnCurrentAlarmYtvclockalarm(DATE DateTime, long AlarmId, long AlarmNumber, LPCTSTR AlarmName);
	afx_msg void OnDateChangedYtvclockalarm(DATE Date);
	afx_msg void OnAlarmStartYtvclockalarm(DATE DateTime, long AlarmId);
	afx_msg void OnAlarmEndYtvclockalarm(DATE DateTime, long AlarmId);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnUpdateYtvShowNextAlarmTime(CCmdUI* pCmdUI);
	afx_msg void OnYtvShowNextAlarmTime();
	afx_msg void OnUpdateYtvRunClock(CCmdUI* pCmdUI);
	afx_msg void OnYtvRunClock();
	afx_msg void OnUpdateOnAlarmShowMessageBox(CCmdUI* pCmdUI);
	afx_msg void OnOnAlarmShowMessageBox();
	afx_msg void OnSetAlarmMessageBoxText();
	afx_msg void OnUpdatePlaySoundAtAlarm(CCmdUI* pCmdUI);
	afx_msg void OnPlaySoundAtAlarm();
	afx_msg void OnSetAlarmSound();
	afx_msg void OnCancelSoundPlay();
	afx_msg void OnUpdateSayTime(CCmdUI* pCmdUI);
	afx_msg void OnSayTime();
	afx_msg void OnUpdateSayAlarmName(CCmdUI* pCmdUI);
	afx_msg void OnSayAlarmName();
	afx_msg void OnUpdateDefaultSettings(CCmdUI* pCmdUI);
	afx_msg void OnDefaultSettings();
	afx_msg void OnUpdateCurrentSettings(CCmdUI* pCmdUI);
	afx_msg void OnCurrentSettings();
	afx_msg void OnUpdateGetDefaultSettings(CCmdUI* pCmdUI);
	afx_msg void OnGetDefaultSettings();
	afx_msg void OnUpdateGetCustomSetting(CCmdUI* pCmdUI);
	afx_msg void OnGetCustomSetting();
	afx_msg void OnStaticbmpsound();
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
	afx_msg void OnUpdateSetVoice(CCmdUI* pCmdUI);
	afx_msg void OnSetVoice();
	afx_msg void OnUpdateSayMessage(CCmdUI* pCmdUI);
	afx_msg void OnSayMessage();
	afx_msg void OnTimeExpiredYtvclockalarm(long AlarmId);
	afx_msg void OnResetTimeSpanAlarm();
	afx_msg void OnAddAlarm();
	afx_msg void OnUpdateAlarm();
	afx_msg void OnSetRoundedTimer();
	afx_msg void OnUpdateSetRoundedTimer(CCmdUI* pCmdUI);
	afx_msg void OnStartTimer();
	afx_msg void OnSetRoundedRingTimer();
	afx_msg void OnUpdateSetRoundedRingTimer(CCmdUI* pCmdUI);
	afx_msg void OnSetProfTimer();
	afx_msg void OnEditchangeComboListNumberMinCircle();
	afx_msg void OnUpdateSetMultiPlankTimer(CCmdUI* pCmdUI);
	afx_msg void OnSetMultiPlankTimer();
	afx_msg void OnUpdateTimerLevel1Color(CCmdUI* pCmdUI);
	afx_msg void OnTimerLevel1Color();
	afx_msg void OnUpdateSetHandsStrpesLengthWidths(CCmdUI* pCmdUI);
	afx_msg void OnSetHandsStrpesLengthWidths();
	afx_msg void OnUpdateSetTimeSpanForPeriods(CCmdUI* pCmdUI);
	afx_msg void OnSetTimeSpanForPeriods();
	afx_msg void OnUpdateTimerLevel2Color(CCmdUI* pCmdUI);
	afx_msg void OnTimerLevel2Color();
	afx_msg void OnUpdateTimerLevel0Color(CCmdUI* pCmdUI);
	afx_msg void OnTimerLevel0Color();
	afx_msg void OnMove(int x, int y);
	afx_msg void OnUpdateClockFullScreen(CCmdUI* pCmdUI);
	afx_msg void OnClockFullScreen();
	virtual void OnOK();
	virtual void OnCancel();
	afx_msg void OnUpdateDoNotResize(CCmdUI* pCmdUI);
	afx_msg void OnDoNotResize();
	afx_msg void OnUpdateYtvStopMove(CCmdUI* pCmdUI);
	afx_msg void OnYtvStopMove();
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnUpdateCloseWindowWithoutSave(CCmdUI* pCmdUI);
	afx_msg void OnCloseWindowWithoutSave();
	afx_msg void OnUpdateClosewindowAndSave(CCmdUI* pCmdUI);
	afx_msg void OnClosewindowAndSave();
	afx_msg void OnUpdateYtvstopTimer(CCmdUI* pCmdUI);
	afx_msg void OnYtvstopTimer();
	afx_msg void OnUpdateUseProfTimer(CCmdUI* pCmdUI);
	afx_msg void OnUseProfTimer();
	DECLARE_EVENTSINK_MAP()
	//}}AFX_MSG
	afx_msg LRESULT YtvAdjust(WPARAM wp, LPARAM lp);
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_YTVCLOCK_DIAL_H__FDFCAE60_92ED_44A8_A6BE_18FC3C8CBC8D__INCLUDED_)
