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
|
|
|
|
// 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
|
|
|
|
|
|
|
WXDLLEXPORT_DATA(extern const char*) wxButtonNameStr;
|
|
|
|
|
|
|
|
#define wxDEFAULT_BUTTON_MARGIN 4
|
|
|
|
|
2001-07-06 21:45:11 +00:00
|
|
|
class WXDLLEXPORT 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 void SetDefault();
|
|
|
|
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
|
|
|
|