- xtimer_demo.zip
- src
- vs2005
- vs6
- Release
- XTimer.exe
- XTimer.dsp
- XTimer.dsw
- wav files
- 4beeps.wav
- alarm1.wav
- alarm2.wav
- alarmclock.wav
- alert.wav
- beeps.wav
- bell.wav
- buzzer.wav
- chirp.wav
- ding.wav
- dingdong.wav
- fanfare.wav
- gong.wav
- ohoh.wav
- onebell.wav
- quackquack.wav
- ringer.wav
- the_timer_has_expired_f.wav
- the_timer_has_expired_m.wav
- trumpet.wav
- xtimer_sounds.zip
- alarmclock.wav
- alert.wav
- buzzer.wav
- divedive.wav
- europolice.wav
- quackquack.wav
- siren.wav
|
// XTimerDlg.h Version 1.3 - article available at http://www.codeproject.com/tools/xtimer.asp
//
// Author: Hans Dietrich
// hdietrich@gmail.com
//
// License:
// This software is released into the public domain. You are free to use
// it in any way you like, except that you may not sell this source code.
//
// This software is provided "as is" with no expressed or implied warranty.
// I accept no liability for any damage or loss of business that this
// software may cause.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef XTIMERDLG_H
#define XTIMERDLG_H
#include "StaticCounter.h"
#include "hightime.h"
#include "BtnST.h"
//=============================================================================
class CXTimerDlg : public CDialog
//=============================================================================
{
// Construction
public:
CXTimerDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CXTimerDlg)
enum { IDD = IDD_XTIMER_DIALOG };
CStaticCounter m_Time;
CButtonST m_btnStart;
CButtonST m_btnReset;
CButtonST m_btnMore;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CXTimerDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
CBrush m_brush;
CHighTime m_StartTime;
int m_nTimerSeconds; // used in timer mode - no. of
// seconds for timer to run
CString m_strSoundFile;
BOOL m_bTimerStarted; // timer is running - used for
// context menu display
BOOL m_bTimer; // TRUE = countdown timer mode
// FALSE = stopwatch mode
BOOL m_bPlaySound; // TRUE = play sound file or play
// default sound
int m_nPlayOnce; // 0 = play sound once;
// 1 = play sound until stopped
BOOL m_bContinuousPlay; // TRUE = in continuous play mode
CHighTimeSpan m_TimeLeft; // for timer
CHighTimeSpan m_TimeElapsed; // for stopwatch
void LoadMenu(CPoint point);
void LoadProfile();
void PlaySoundFile();
void Reset();
void RestoreWindowPos(HWND hWnd, LPCTSTR lpszEntry);
void SaveProfile();
void SaveWindowPos(HWND hWnd, LPCTSTR lpszEntry, UINT nShowCmd);
void SetWindowText();
// Generated message map functions
//{{AFX_MSG(CXTimerDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
afx_msg void OnStart();
afx_msg void OnStop();
afx_msg void OnReset();
afx_msg void OnAbout();
afx_msg void OnMore();
afx_msg void OnXTimer();
afx_msg void OnStopwatch();
afx_msg void OnTimerOptions();
afx_msg void OnNcLButtonDblClk(UINT nHitTest, CPoint point);
afx_msg void OnDestroy();
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
//}}AFX_MSG
afx_msg void OnQuickTimer(UINT nID);
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif //XTIMERDLG_H
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I attended St. Michael's College of the University of Toronto, with the intention of becoming a priest. A friend in the University's Computer Science Department got me interested in programming, and I have been hooked ever since.
Recently, I have moved to Los Angeles where I am doing consulting and development work.
For consulting and custom software development, please see
www.hdsoft.org.