1998-09-18 06:19:10 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2006-07-25 10:31:55 -04:00
|
|
|
// Name: wx/motif/bmpbuttn.h
|
1998-09-18 06:19:10 -04:00
|
|
|
// Purpose: wxBitmapButton class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 17/09/98
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Julian Smart
|
2006-07-25 10:31:55 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-09-18 06:19:10 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_BMPBUTTN_H_
|
|
|
|
#define _WX_BMPBUTTN_H_
|
|
|
|
|
2003-03-27 14:40:32 -05:00
|
|
|
#include "wx/motif/bmpmotif.h"
|
|
|
|
|
1998-09-18 06:19:10 -04:00
|
|
|
#define wxDEFAULT_BUTTON_MARGIN 4
|
|
|
|
|
2003-03-16 03:50:21 -05:00
|
|
|
class WXDLLEXPORT wxBitmapButton: public wxBitmapButtonBase
|
1998-09-18 06:19:10 -04:00
|
|
|
{
|
2002-02-05 11:34:33 -05:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxBitmapButton)
|
|
|
|
public:
|
|
|
|
wxBitmapButton();
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxBitmapButton();
|
2003-03-16 03:50:21 -05:00
|
|
|
wxBitmapButton(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap,
|
2002-02-05 11:34:33 -05:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxButtonNameStr)
|
|
|
|
{
|
|
|
|
Create(parent, id, bitmap, pos, size, style, validator, name);
|
|
|
|
}
|
2006-07-25 10:31:55 -04:00
|
|
|
|
2002-02-05 11:34:33 -05: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);
|
2006-07-25 10:31:55 -04:00
|
|
|
|
2002-02-05 11:34:33 -05:00
|
|
|
virtual void SetLabel(const wxBitmap& bitmap)
|
|
|
|
{
|
|
|
|
SetBitmapLabel(bitmap);
|
|
|
|
}
|
|
|
|
virtual void SetLabel(const wxString& label)
|
|
|
|
{
|
|
|
|
wxControl::SetLabel(label);
|
|
|
|
}
|
2006-07-25 10:31:55 -04:00
|
|
|
|
2002-02-05 11:34:33 -05:00
|
|
|
virtual void SetBitmapLabel(const wxBitmap& bitmap);
|
2006-07-25 10:31:55 -04:00
|
|
|
|
2002-02-05 11:34:33 -05:00
|
|
|
void SetBitmapSelected(const wxBitmap& sel);
|
|
|
|
void SetBitmapFocus(const wxBitmap& focus);
|
|
|
|
void SetBitmapDisabled(const wxBitmap& disabled);
|
2006-07-25 10:31:55 -04:00
|
|
|
|
2002-02-05 11:34:33 -05:00
|
|
|
// Implementation
|
|
|
|
void DoSetBitmap();
|
|
|
|
virtual void ChangeBackgroundColour();
|
2002-08-05 14:04:08 -04:00
|
|
|
virtual wxSize DoGetBestSize() const;
|
2006-07-25 10:31:55 -04:00
|
|
|
|
2002-02-05 11:34:33 -05:00
|
|
|
protected:
|
2003-03-16 03:50:21 -05:00
|
|
|
wxBitmap m_bmpNormalOriginal; // May be different from m_buttonBitmap
|
2002-02-05 11:34:33 -05:00
|
|
|
// if m_buttonBitmap has been changed
|
|
|
|
// to reflect button background colour
|
2006-07-25 10:31:55 -04:00
|
|
|
wxBitmap m_bmpSelectedOriginal;
|
2003-03-16 03:50:21 -05:00
|
|
|
wxBitmap m_bmpDisabledOriginal;
|
2003-03-27 14:40:32 -05:00
|
|
|
|
|
|
|
wxBitmapCache m_bitmapCache;
|
|
|
|
|
2002-02-05 11:34:33 -05:00
|
|
|
WXPixmap m_insensPixmap;
|
1998-09-18 06:19:10 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
2002-02-05 11:34:33 -05:00
|
|
|
// _WX_BMPBUTTN_H_
|