1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2001-06-26 17:29:16 -04:00
|
|
|
// Name: wx/gtk/bmpbutton.h
|
1998-05-20 10:01:55 -04:00
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
1998-10-26 05:56:58 -05:00
|
|
|
// Id: $Id$
|
1998-10-24 13:12:05 -04:00
|
|
|
// Copyright: (c) 1998 Robert Roebling
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2008-02-22 14:59:36 -05:00
|
|
|
#ifndef _WX_GTK_BMPBUTTON_H_
|
|
|
|
#define _WX_GTK_BMPBUTTON_H_
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
1998-05-20 10:01:55 -04:00
|
|
|
// wxBitmapButton
|
2001-06-26 16:59:19 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2005-08-02 18:58:06 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxBitmapButton: public wxBitmapButtonBase
|
1998-05-28 13:44:04 -04:00
|
|
|
{
|
1998-11-15 12:57:55 -05:00
|
|
|
public:
|
2002-05-04 07:57:39 -04:00
|
|
|
wxBitmapButton() { Init(); }
|
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
wxBitmapButton(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxBitmap& bitmap,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
2008-03-18 12:25:48 -04:00
|
|
|
long style = wxBU_AUTODRAW,
|
2001-06-26 16:59:19 -04:00
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxButtonNameStr)
|
1999-10-11 06:05:36 -04:00
|
|
|
{
|
2002-05-04 07:57:39 -04:00
|
|
|
Init();
|
|
|
|
|
1999-10-11 06:05:36 -04:00
|
|
|
Create(parent, id, bitmap, pos, size, style, validator, name);
|
|
|
|
}
|
2002-05-04 07:57:39 -04:00
|
|
|
|
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,
|
2008-03-18 12:25:48 -04:00
|
|
|
long style = wxBU_AUTODRAW,
|
2001-06-26 16:59:19 -04:00
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxButtonNameStr);
|
|
|
|
|
1999-10-11 06:05:36 -04:00
|
|
|
void SetLabel( const wxString &label );
|
|
|
|
virtual void SetLabel( const wxBitmap& bitmap ) { SetBitmapLabel(bitmap); }
|
2001-06-26 17:29:16 -04:00
|
|
|
|
2008-03-18 12:25:48 -04:00
|
|
|
virtual bool Enable(bool enable = true);
|
2002-05-04 07:57:39 -04:00
|
|
|
|
1999-11-22 14:44:25 -05:00
|
|
|
// implementation
|
|
|
|
// --------------
|
2001-06-26 17:29:16 -04:00
|
|
|
|
2008-02-22 14:59:36 -05:00
|
|
|
void GTKMouseEnters();
|
|
|
|
void GTKMouseLeaves();
|
|
|
|
void GTKPressed();
|
|
|
|
void GTKReleased();
|
2001-06-26 17:29:16 -04:00
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
protected:
|
2001-06-26 16:59:19 -04:00
|
|
|
virtual void OnSetBitmap();
|
2004-10-18 09:13:39 -04:00
|
|
|
virtual wxSize DoGetBestSize() const;
|
2006-02-08 16:47:09 -05:00
|
|
|
void DoApplyWidgetStyle(GtkRcStyle *style);
|
2000-07-15 15:51:35 -04:00
|
|
|
|
2002-05-04 07:57:39 -04:00
|
|
|
void Init();
|
|
|
|
|
1999-10-11 06:05:36 -04:00
|
|
|
private:
|
2008-02-22 14:59:36 -05:00
|
|
|
void OnFocusChange(wxFocusEvent& event);
|
|
|
|
|
|
|
|
// true iff mouse hovers over the button
|
|
|
|
bool m_mouseHovers;
|
|
|
|
// true iff the button is in pressed state
|
|
|
|
bool m_isPressed;
|
|
|
|
|
1999-10-11 06:05:36 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxBitmapButton)
|
2008-02-22 14:59:36 -05:00
|
|
|
DECLARE_EVENT_TABLE()
|
1998-05-28 13:44:04 -04:00
|
|
|
};
|
1998-11-15 12:57:55 -05:00
|
|
|
|
2008-02-22 14:59:36 -05:00
|
|
|
#endif // _WX_GTK_BMPBUTTON_H_
|