disable use of #pragma interface under Mac OS X
[wxWidgets.git] / include / wx / motif / bmpbuttn.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: bmpbuttn.h
3 // Purpose: wxBitmapButton class
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 17/09/98
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_BMPBUTTN_H_
13 #define _WX_BMPBUTTN_H_
14
15 #if defined(__GNUG__) && !defined(__APPLE__)
16 #pragma interface "bmpbuttn.h"
17 #endif
18
19 #include "wx/motif/bmpmotif.h"
20
21 WXDLLEXPORT_DATA(extern const char*) wxButtonNameStr;
22
23 #define wxDEFAULT_BUTTON_MARGIN 4
24
25 class WXDLLEXPORT wxBitmapButton: public wxBitmapButtonBase
26 {
27 DECLARE_DYNAMIC_CLASS(wxBitmapButton)
28 public:
29 wxBitmapButton();
30 ~wxBitmapButton();
31 wxBitmapButton(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap,
32 const wxPoint& pos = wxDefaultPosition,
33 const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
34 const wxValidator& validator = wxDefaultValidator,
35 const wxString& name = wxButtonNameStr)
36 {
37 Create(parent, id, bitmap, pos, size, style, validator, name);
38 }
39
40 bool Create(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap,
41 const wxPoint& pos = wxDefaultPosition,
42 const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
43 const wxValidator& validator = wxDefaultValidator,
44 const wxString& name = wxButtonNameStr);
45
46 virtual void SetLabel(const wxBitmap& bitmap)
47 {
48 SetBitmapLabel(bitmap);
49 }
50 virtual void SetLabel(const wxString& label)
51 {
52 wxControl::SetLabel(label);
53 }
54
55 virtual void SetBitmapLabel(const wxBitmap& bitmap);
56
57 void SetBitmapSelected(const wxBitmap& sel);
58 void SetBitmapFocus(const wxBitmap& focus);
59 void SetBitmapDisabled(const wxBitmap& disabled);
60
61 // Implementation
62 void DoSetBitmap();
63 virtual void ChangeBackgroundColour();
64 virtual wxSize DoGetBestSize() const;
65
66 protected:
67 wxBitmap m_bmpNormalOriginal; // May be different from m_buttonBitmap
68 // if m_buttonBitmap has been changed
69 // to reflect button background colour
70 wxBitmap m_bmpSelectedOriginal;
71 wxBitmap m_bmpDisabledOriginal;
72
73 wxBitmapCache m_bitmapCache;
74
75 WXPixmap m_insensPixmap;
76 };
77
78 #endif
79 // _WX_BMPBUTTN_H_