1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: bmpbuttn.h
|
|
|
|
// Purpose: wxBitmapButton class
|
1999-10-14 00:43:46 -04:00
|
|
|
// Author: David Webster
|
1999-07-29 01:11:30 -04:00
|
|
|
// Modified by:
|
1999-10-14 00:43:46 -04:00
|
|
|
// Created: 10/13/99
|
1999-07-29 01:11:30 -04:00
|
|
|
// RCS-ID: $Id$
|
1999-10-14 00:43:46 -04:00
|
|
|
// Copyright: (c) David Webster
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_BMPBUTTN_H_
|
|
|
|
#define _WX_BMPBUTTN_H_
|
|
|
|
|
|
|
|
#include "wx/button.h"
|
2003-08-31 15:41:52 -04:00
|
|
|
#include "wx/dcclient.h"
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2006-01-16 09:59:55 -05:00
|
|
|
WXDLLEXPORT_DATA(extern const wxChar) wxButtonNameStr[];
|
1999-07-29 01:11:30 -04:00
|
|
|
|
|
|
|
#define wxDEFAULT_BUTTON_MARGIN 4
|
|
|
|
|
2001-07-06 17:45:11 -04:00
|
|
|
class WXDLLEXPORT wxBitmapButton: public wxBitmapButtonBase
|
1999-07-29 01:11:30 -04:00
|
|
|
{
|
2002-09-08 23:08:12 -04:00
|
|
|
public:
|
|
|
|
inline wxBitmapButton()
|
|
|
|
{
|
|
|
|
m_marginX = wxDEFAULT_BUTTON_MARGIN;
|
|
|
|
m_marginY = wxDEFAULT_BUTTON_MARGIN;
|
|
|
|
}
|
|
|
|
inline wxBitmapButton( wxWindow* pParent
|
|
|
|
,wxWindowID vId
|
|
|
|
,const wxBitmap& rBitmap
|
|
|
|
,const wxPoint& rPos = wxDefaultPosition
|
|
|
|
,const wxSize& rSize = wxDefaultSize
|
|
|
|
,long lStyle = wxBU_AUTODRAW
|
|
|
|
,const wxValidator& rValidator = wxDefaultValidator
|
|
|
|
,const wxString& rsName = wxButtonNameStr
|
|
|
|
)
|
|
|
|
{
|
|
|
|
Create( pParent
|
|
|
|
,vId
|
|
|
|
,rBitmap
|
|
|
|
,rPos
|
|
|
|
,rSize
|
|
|
|
,lStyle
|
|
|
|
,rValidator
|
|
|
|
,rsName
|
|
|
|
);
|
|
|
|
}
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2002-09-08 23:08:12 -04:00
|
|
|
bool Create( wxWindow* pParent
|
|
|
|
,wxWindowID vId
|
|
|
|
,const wxBitmap& rBitmap
|
|
|
|
,const wxPoint& rPos = wxDefaultPosition
|
|
|
|
,const wxSize& rSize = wxDefaultSize
|
|
|
|
,long lStyle = wxBU_AUTODRAW
|
|
|
|
,const wxValidator& rValidator = wxDefaultValidator
|
|
|
|
,const wxString& rsName = wxButtonNameStr
|
|
|
|
);
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2002-09-08 23:08:12 -04:00
|
|
|
virtual void SetLabel(const wxBitmap& rBitmap)
|
|
|
|
{
|
|
|
|
SetBitmapLabel(rBitmap);
|
|
|
|
}
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2002-09-08 23:08:12 -04:00
|
|
|
//
|
|
|
|
// Implementation
|
|
|
|
//
|
|
|
|
virtual bool OS2OnDraw(WXDRAWITEMSTRUCT* pItem);
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2002-09-08 23:08:12 -04:00
|
|
|
private:
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2002-09-08 23:08:12 -04:00
|
|
|
virtual void DrawFace( wxClientDC& rDC
|
|
|
|
,bool bSel
|
|
|
|
);
|
|
|
|
virtual void DrawButtonFocus(wxClientDC& rDC);
|
|
|
|
virtual void DrawButtonDisable( wxClientDC& rDC
|
|
|
|
,wxBitmap& rBmp
|
|
|
|
);
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxBitmapButton)
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2002-09-08 23:08:12 -04:00
|
|
|
virtual void SetLabel(const wxString& rsString)
|
|
|
|
{
|
|
|
|
wxButton::SetLabel(rsString);
|
|
|
|
}
|
|
|
|
}; // end of CLASS wxBitmapButton
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2002-09-08 23:08:12 -04:00
|
|
|
#endif // _WX_BMPBUTTN_H_
|
1999-07-29 01:11:30 -04:00
|
|
|
|