|
#pragma once
// CTBButton
class CTBButton : public CStatic
{
DECLARE_DYNAMIC(CTBButton)
public:
CTBButton();
virtual ~CTBButton();
void SetImage(CBitmap* pBitmap, CSize sizeImage, COLORREF clrImgBkgnd = CLR_DEFAULT)
{
m_pBitmap = pBitmap;
m_sizeImage = sizeImage;
m_clrImgBkgnd = clrImgBkgnd;
if(GetSafeHwnd())
{
Invalidate();
}
}
CBitmap* GetImage()
{
return m_pBitmap;
}
CSize GetImageSize()
{
return m_sizeImage;
}
void SetImageBkgndColor(COLORREF clrImgBkgnd)
{
m_clrImgBkgnd = clrImgBkgnd;
if(GetSafeHwnd())
{
Invalidate();
}
}
COLORREF GetImageBkgndColor()
{
return m_clrImgBkgnd;
}
protected:
DECLARE_MESSAGE_MAP()
COLORREF m_clrImgBkgnd;
CSize m_sizeImage;
CBitmap* m_pBitmap;
BOOL m_bTracking;
BOOL m_bDragging;
public:
afx_msg void OnPaint();
afx_msg void OnStnClicked();
protected:
virtual void PreSubclassWindow();
public:
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnTimer(UINT_PTR nIDEvent);
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
};
|
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.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.