]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/bmpbuttn.h
Removed WXWIN_COMPATIBILITY_2_2 together with code guarded by it.
[wxWidgets.git] / include / wx / msw / bmpbuttn.h
CommitLineData
2bda0e17
KB
1/////////////////////////////////////////////////////////////////////////////
2// Name: bmpbuttn.h
3// Purpose: wxBitmapButton class
4// Author: Julian Smart
5// Modified by:
6// Created: 01/02/97
7// RCS-ID: $Id$
bbcdf8bc 8// Copyright: (c) Julian Smart
65571936 9// Licence: wxWindows licence
2bda0e17
KB
10/////////////////////////////////////////////////////////////////////////////
11
bbcdf8bc
JS
12#ifndef _WX_BMPBUTTN_H_
13#define _WX_BMPBUTTN_H_
2bda0e17 14
2bda0e17 15#include "wx/button.h"
1e7215e6 16#include "wx/bitmap.h"
a6c255cb 17#include "wx/brush.h"
2bda0e17 18
2bda0e17
KB
19#define wxDEFAULT_BUTTON_MARGIN 4
20
1e6feb95 21class WXDLLEXPORT wxBitmapButton: public wxBitmapButtonBase
2bda0e17 22{
0655ad29 23public:
1e6feb95
VZ
24 wxBitmapButton()
25 { m_marginX = m_marginY = wxDEFAULT_BUTTON_MARGIN; }
26 wxBitmapButton(wxWindow *parent,
27 wxWindowID id,
28 const wxBitmap& bitmap,
29 const wxPoint& pos = wxDefaultPosition,
30 const wxSize& size = wxDefaultSize,
31 long style = wxBU_AUTODRAW,
32 const wxValidator& validator = wxDefaultValidator,
33 const wxString& name = wxButtonNameStr)
0655ad29
VZ
34 {
35 Create(parent, id, bitmap, pos, size, style, validator, name);
36 }
37
1e6feb95
VZ
38 bool Create(wxWindow *parent,
39 wxWindowID id,
40 const wxBitmap& bitmap,
41 const wxPoint& pos = wxDefaultPosition,
42 const wxSize& size = wxDefaultSize,
43 long style = wxBU_AUTODRAW,
44 const wxValidator& validator = wxDefaultValidator,
45 const wxString& name = wxButtonNameStr);
2bda0e17 46
0655ad29 47 // Implementation
d50dbf7c 48 virtual bool SetBackgroundColour(const wxColour& colour);
0655ad29
VZ
49 virtual void SetDefault();
50 virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item);
51 virtual void DrawFace( WXHDC dc, int left, int top, int right, int bottom, bool sel );
52 virtual void DrawButtonFocus( WXHDC dc, int left, int top, int right, int bottom, bool sel );
53 virtual void DrawButtonDisable( WXHDC dc, int left, int top, int right, int bottom, bool with_marg );
54
c046274e
RD
55protected:
56 virtual wxSize DoGetBestSize() const;
fcf90ee1 57
a6fd0fde
VZ
58 // invalidate m_brushDisabled when system colours change
59 void OnSysColourChanged(wxSysColourChangedEvent& event);
60
61
62 // the brush we use to draw disabled buttons
d50dbf7c
VZ
63 wxBrush m_brushDisabled;
64
a6fd0fde
VZ
65
66 DECLARE_EVENT_TABLE()
fc7a2a60 67 DECLARE_DYNAMIC_CLASS_NO_COPY(wxBitmapButton)
2bda0e17
KB
68};
69
70#endif
bbcdf8bc 71 // _WX_BMPBUTTN_H_