1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: bmpbuttn.h
|
|
|
|
// Purpose: wxBitmapButton class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
1998-08-07 19:52:45 -04:00
|
|
|
// Copyright: (c) Julian Smart
|
1999-11-25 17:59:22 -05:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-07 19:52:45 -04:00
|
|
|
#ifndef _WX_BMPBUTTN_H_
|
|
|
|
#define _WX_BMPBUTTN_H_
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface "bmpbuttn.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/button.h"
|
1999-11-25 17:59:22 -05:00
|
|
|
#include "wx/bitmap.h"
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
#define wxDEFAULT_BUTTON_MARGIN 4
|
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
class WXDLLEXPORT wxBitmapButton: public wxBitmapButtonBase
|
1998-05-20 10:12:05 -04:00
|
|
|
{
|
1999-07-28 17:01:04 -04:00
|
|
|
public:
|
2001-06-26 16:59:19 -04:00
|
|
|
wxBitmapButton()
|
|
|
|
{ m_marginX = m_marginY = wxDEFAULT_BUTTON_MARGIN; }
|
|
|
|
wxBitmapButton(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxBitmap& bitmap,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxBU_AUTODRAW,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxButtonNameStr)
|
1999-07-28 17:01:04 -04:00
|
|
|
{
|
|
|
|
Create(parent, id, bitmap, pos, size, style, validator, name);
|
|
|
|
}
|
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxBitmap& bitmap,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxBU_AUTODRAW,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxButtonNameStr);
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
#if WXWIN_COMPATIBILITY
|
2003-01-12 17:20:46 -05:00
|
|
|
wxBitmap *GetBitmap() const { return (wxBitmap *) &GetBitmapLabel(); }
|
1998-05-20 10:12:05 -04:00
|
|
|
#endif
|
|
|
|
|
1999-07-28 17:01:04 -04:00
|
|
|
// Implementation
|
|
|
|
virtual void SetDefault();
|
|
|
|
virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item);
|
|
|
|
virtual void DrawFace( WXHDC dc, int left, int top, int right, int bottom, bool sel );
|
|
|
|
virtual void DrawButtonFocus( WXHDC dc, int left, int top, int right, int bottom, bool sel );
|
|
|
|
virtual void DrawButtonDisable( WXHDC dc, int left, int top, int right, int bottom, bool with_marg );
|
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxBitmapButton)
|
1998-05-20 10:12:05 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
1998-08-07 19:52:45 -04:00
|
|
|
// _WX_BMPBUTTN_H_
|