]> git.saurik.com Git - wxWidgets.git/blame - include/wx/univ/bmpbuttn.h
don't define WINVER as 0x0400 in configure, it's defined in the headers as 0x0600...
[wxWidgets.git] / include / wx / univ / bmpbuttn.h
CommitLineData
1e6feb95
VZ
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/univ/bmpbuttn.h
3// Purpose: wxBitmapButton class for wxUniversal
4// Author: Vadim Zeitlin
5// Modified by:
6// Created: 25.08.00
7// RCS-ID: $Id$
8// Copyright: (c) Vadim Zeitlin
65571936 9// Licence: wxWindows licence
1e6feb95
VZ
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_UNIV_BMPBUTTN_H_
13#define _WX_UNIV_BMPBUTTN_H_
14
1e6feb95
VZ
15class WXDLLEXPORT wxBitmapButton : public wxBitmapButtonBase
16{
17public:
6463b9f5 18 wxBitmapButton() { }
1e6feb95
VZ
19
20 wxBitmapButton(wxWindow *parent,
21 wxWindowID id,
22 const wxBitmap& bitmap,
23 const wxPoint& pos = wxDefaultPosition,
24 const wxSize& size = wxDefaultSize,
25 long style = 0,
26 const wxValidator& validator = wxDefaultValidator,
6463b9f5
JS
27 const wxString& name = wxButtonNameStr)
28 {
29 Create(parent, id, bitmap, pos, size, style, validator, name);
30 }
1e6feb95
VZ
31
32 bool Create(wxWindow *parent,
33 wxWindowID id,
34 const wxBitmap& bitmap,
35 const wxPoint& pos = wxDefaultPosition,
36 const wxSize& size = wxDefaultSize,
37 long style = 0,
38 const wxValidator& validator = wxDefaultValidator,
39 const wxString& name = wxButtonNameStr);
40
41 virtual void SetMargins(int x, int y)
42 {
43 SetImageMargins(x, y);
44
45 wxBitmapButtonBase::SetMargins(x, y);
46 }
47
a290fa5a 48 virtual bool Enable(bool enable = true);
1e6feb95 49
a290fa5a 50 virtual bool SetCurrent(bool doit = true);
1e6feb95
VZ
51
52 virtual void Press();
53 virtual void Release();
54
55protected:
56 void OnSetFocus(wxFocusEvent& event);
57 void OnKillFocus(wxFocusEvent& event);
58
59 // called when one of the bitmap is changed by user
60 virtual void OnSetBitmap();
61
62 // set bitmap to the given one if it's ok or to m_bmpNormal and return
a290fa5a 63 // true if the bitmap really changed
1e6feb95
VZ
64 bool ChangeBitmap(const wxBitmap& bmp);
65
66private:
67 DECLARE_EVENT_TABLE()
68 DECLARE_DYNAMIC_CLASS(wxBitmapButton)
69};
70
71#endif // _WX_UNIV_BMPBUTTN_H_
72