- 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
|
// XButtonXP.h Version 1.2
//
// Author: Hans Dietrich
// hdietrich@gmail.com
//
// 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 XBUTTONXP_H
#define XBUTTONXP_H
#include "uxtheme.h"
#include "OddButton.h"
/////////////////////////////////////////////////////////////////////////////
// CXButtonXP window
class CXButtonXP : public COddButton
{
// Construction
public:
CXButtonXP();
virtual ~CXButtonXP();
// Attributes
public:
enum ICON_ALIGNMENT
{
CENTER = 0,
LEFT,
RIGHT
};
void SetIconAlignment(ICON_ALIGNMENT ia)
{
m_eIconAlignment = ia;
RedrawWindow();
}
BOOL GetToggle() { return m_bIsToggle; }
void SetToggle(BOOL bIsToggle)
{
m_bIsToggle = bIsToggle;
m_bToggled = FALSE;
RedrawWindow();
}
BOOL GetToggleState() { return m_bToggled; }
void SetToggleState(BOOL bToggled) { m_bToggled = bToggled; RedrawWindow(); }
void EnableTheming(BOOL bEnable)
{
m_bEnableTheming = bEnable;
if (m_bEnableTheming)
{
TRACE(_T("Theming will be enabled only on XP and only ")
_T("if the app is themed with a manifest file.\n"));
}
RedrawWindow();
}
BOOL IsThemed();
// Operations
public:
void SetIcon(UINT nIDResource, ICON_ALIGNMENT ia = LEFT);
void SetIcon(HICON hIcon, ICON_ALIGNMENT ia = LEFT);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CXButtonXP)
public:
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
protected:
virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
// Implementation
protected:
void DrawIcon(CDC *pDC,
BOOL bHasText,
RECT& rectItem,
RECT& rectText,
BOOL bIsPressed,
BOOL bIsDisabled);
void PrepareImageRect(BOOL bHasText,
RECT& rectItem,
RECT& rectText,
BOOL bIsPressed,
DWORD dwWidth,
DWORD dwHeight,
RECT& rectImage);
BOOL m_bFirstTime;
BOOL m_bMouseOverButton;
HTHEME m_hTheme;
HICON m_hIcon;
ICON_ALIGNMENT m_eIconAlignment;
BOOL m_bToggled;
BOOL m_bIsToggle;
BOOL m_bLButtonDown;
BOOL m_bSent;
BOOL m_bEnableTheming;
// Generated message map functions
//{{AFX_MSG(CXButtonXP)
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
afx_msg void OnTimer(UINT nIDEvent);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // XBUTTONXP_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.