home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 13
/
mediashare_13.zip
/
mediashare_13
/
ZIPPED
/
PROGRAM
/
WTJ9403.ZIP
/
WILDASS
/
SOURCE
/
ICONBTN.H
< prev
next >
Wrap
C/C++ Source or Header
|
1993-08-12
|
1KB
|
57 lines
// iconbtn.h
//
// class interface to the icon button class
// an icon button is an ownerdraw (self-drawn)
// button that is capable of displaying an icon that
// is associated to a windows executable
//
// if no path to an executable is given, no icon is painted
// if the executable doesnt contain an icon, no icon is painted
//
// the icon that is painted might be changed to another icon
//
// update: 1.00 02-Aug.93 tw
// 1.01 10-Aug-93 tw added drag n drop
// dropinfo is routed to the parent
#ifndef _INC_ICONBTNH
#define _INC_ICONBTNH
class CIconButton : public CButton
{
private:
enum
{
cxFrame = 8, // 4 pixel frame on each side
cyFrame = 8
};
HICON m_hIcon;
int m_cxIcon,
m_cyIcon,
m_cxButton,
m_cyButton;
public:
CIconButton();
void Create( CWnd * pParent, const CPoint& rPos, UINT nID, const char * pszIconFile=0 );
void SetIcon( HICON hIcon );
static UINT Width();
protected:
virtual void DrawItem( LPDRAWITEMSTRUCT lp );
afx_msg void OnDropFiles( HDROP hDrop );
private:
// Helper fxns
void DrawEntire( CDC * pDC );
void DrawUpState( CDC * pDC );
void DrawDownState( CDC * pDC );
DECLARE_MESSAGE_MAP()
};
#endif // INC_ICNBTNH