1999-07-29 05:11:30 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: bmpbuttn.h
|
|
|
|
// Purpose: wxBitmapButton class
|
1999-10-14 04:43:46 +00:00
|
|
|
// Author: David Webster
|
1999-07-29 05:11:30 +00:00
|
|
|
// Modified by:
|
1999-10-14 04:43:46 +00:00
|
|
|
// Created: 10/13/99
|
1999-07-29 05:11:30 +00:00
|
|
|
// RCS-ID: $Id$
|
1999-10-14 04:43:46 +00:00
|
|
|
// Copyright: (c) David Webster
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1999-07-29 05:11:30 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_BMPBUTTN_H_
|
|
|
|
#define _WX_BMPBUTTN_H_
|
|
|
|
|
|
|
|
#include "wx/button.h"
|
2003-08-31 19:41:52 +00:00
|
|
|
#include "wx/dcclient.h"
|
1999-07-29 05:11:30 +00:00
|
|
|
|
2008-03-26 15:06:00 +00:00
|
|
|
WXDLLIMPEXP_DATA_CORE(extern const char) wxButtonNameStr[];
|
1999-07-29 05:11:30 +00:00
|
|
|
|
|
|
|
#define wxDEFAULT_BUTTON_MARGIN 4
|
|
|
|
|
2008-03-26 15:06:00 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxBitmapButton: public wxBitmapButtonBase
|
1999-07-29 05:11:30 +00:00
|
|
|
{
|
2002-09-09 03:08:12 +00: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 05:11:30 +00:00
|
|
|
|
2002-09-09 03:08:12 +00: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 05:11:30 +00:00
|
|
|
|
2002-09-09 03:08:12 +00:00
|
|
|
virtual void SetLabel(const wxBitmap& rBitmap)
|
|
|
|
{
|
|
|
|
SetBitmapLabel(rBitmap);
|
|
|
|
}
|
1999-07-29 05:11:30 +00:00
|
|
|
|
2002-09-09 03:08:12 +00:00
|
|
|
//
|
|
|
|
// Implementation
|
|
|
|
//
|
|
|
|
virtual bool OS2OnDraw(WXDRAWITEMSTRUCT* pItem);
|
1999-07-29 05:11:30 +00:00
|
|
|
|
2002-09-09 03:08:12 +00:00
|
|
|
private:
|
1999-07-29 05:11:30 +00:00
|
|
|
|
2002-09-09 03:08:12 +00: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 05:11:30 +00:00
|
|
|
|
2002-09-09 03:08:12 +00:00
|
|
|
virtual void SetLabel(const wxString& rsString)
|
|
|
|
{
|
|
|
|
wxButton::SetLabel(rsString);
|
|
|
|
}
|
|
|
|
}; // end of CLASS wxBitmapButton
|
1999-07-29 05:11:30 +00:00
|
|
|
|
2002-09-09 03:08:12 +00:00
|
|
|
#endif // _WX_BMPBUTTN_H_
|
1999-07-29 05:11:30 +00:00
|
|
|
|