]> git.saurik.com Git - wxWidgets.git/blame - include/wx/univ/bmpbuttn.h
make it non mach-o carbon savvy
[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
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_UNIV_BMPBUTTN_H_
13#define _WX_UNIV_BMPBUTTN_H_
14
12028905 15#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
a3870b2f 16 #pragma interface "univbmpbuttn.h"
1e6feb95
VZ
17#endif
18
19class WXDLLEXPORT wxBitmapButton : public wxBitmapButtonBase
20{
21public:
6463b9f5 22 wxBitmapButton() { }
1e6feb95
VZ
23
24 wxBitmapButton(wxWindow *parent,
25 wxWindowID id,
26 const wxBitmap& bitmap,
27 const wxPoint& pos = wxDefaultPosition,
28 const wxSize& size = wxDefaultSize,
29 long style = 0,
30 const wxValidator& validator = wxDefaultValidator,
6463b9f5
JS
31 const wxString& name = wxButtonNameStr)
32 {
33 Create(parent, id, bitmap, pos, size, style, validator, name);
34 }
1e6feb95
VZ
35
36 bool Create(wxWindow *parent,
37 wxWindowID id,
38 const wxBitmap& bitmap,
39 const wxPoint& pos = wxDefaultPosition,
40 const wxSize& size = wxDefaultSize,
41 long style = 0,
42 const wxValidator& validator = wxDefaultValidator,
43 const wxString& name = wxButtonNameStr);
44
45 virtual void SetMargins(int x, int y)
46 {
47 SetImageMargins(x, y);
48
49 wxBitmapButtonBase::SetMargins(x, y);
50 }
51
52 virtual bool Enable(bool enable = TRUE);
53
54 virtual bool SetCurrent(bool doit = TRUE);
55
56 virtual void Press();
57 virtual void Release();
58
59protected:
60 void OnSetFocus(wxFocusEvent& event);
61 void OnKillFocus(wxFocusEvent& event);
62
63 // called when one of the bitmap is changed by user
64 virtual void OnSetBitmap();
65
66 // set bitmap to the given one if it's ok or to m_bmpNormal and return
67 // TRUE if the bitmap really changed
68 bool ChangeBitmap(const wxBitmap& bmp);
69
70private:
71 DECLARE_EVENT_TABLE()
72 DECLARE_DYNAMIC_CLASS(wxBitmapButton)
73};
74
75#endif // _WX_UNIV_BMPBUTTN_H_
76