1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2005-10-29 13:43:11 -04:00
|
|
|
// Name: wx/msw/bmpbuttn.h
|
1998-05-20 10:12:05 -04:00
|
|
|
// 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
|
2004-05-23 16:53:33 -04: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
|
|
|
|
|
|
|
#include "wx/button.h"
|
1999-11-25 17:59:22 -05:00
|
|
|
#include "wx/bitmap.h"
|
2004-09-19 06:08:24 -04:00
|
|
|
#include "wx/brush.h"
|
1998-05-20 10:12:05 -04:00
|
|
|
|
2005-11-02 20:48:10 -05:00
|
|
|
class WXDLLEXPORT wxBitmapButton : public wxBitmapButtonBase
|
1998-05-20 10:12:05 -04:00
|
|
|
{
|
1999-07-28 17:01:04 -04:00
|
|
|
public:
|
2005-10-29 13:43:11 -04:00
|
|
|
wxBitmapButton() { }
|
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
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
|
|
|
|
1999-07-28 17:01:04 -04:00
|
|
|
// Implementation
|
2004-09-18 08:34:45 -04:00
|
|
|
virtual bool SetBackgroundColour(const wxColour& colour);
|
1999-07-28 17:01:04 -04:00
|
|
|
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 );
|
|
|
|
|
2004-03-16 16:58:53 -05:00
|
|
|
protected:
|
2005-11-03 14:38:20 -05:00
|
|
|
// reimplement some base class virtuals
|
2004-03-16 16:58:53 -05:00
|
|
|
virtual wxSize DoGetBestSize() const;
|
2005-11-03 14:38:20 -05:00
|
|
|
virtual void OnSetBitmap();
|
2004-08-19 13:39:28 -04:00
|
|
|
|
2004-10-03 09:46:11 -04:00
|
|
|
// invalidate m_brushDisabled when system colours change
|
|
|
|
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
|
|
|
|
2005-11-02 20:48:10 -05:00
|
|
|
// change the currently bitmap if we have a hover one
|
|
|
|
void OnMouseEnterOrLeave(wxMouseEvent& event);
|
|
|
|
|
2004-10-03 09:46:11 -04:00
|
|
|
|
|
|
|
// the brush we use to draw disabled buttons
|
2004-09-18 08:34:45 -04:00
|
|
|
wxBrush m_brushDisabled;
|
|
|
|
|
2004-10-03 09:46:11 -04:00
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
2003-07-21 20:24:07 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxBitmapButton)
|
1998-05-20 10:12:05 -04:00
|
|
|
};
|
|
|
|
|
2005-11-02 20:48:10 -05:00
|
|
|
#endif // _WX_BMPBUTTN_H_
|