]>
Commit | Line | Data |
---|---|---|
9b6dbb09 JS |
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 | |
65571936 | 9 | // Licence: wxWindows licence |
9b6dbb09 JS |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_BMPBUTTN_H_ | |
13 | #define _WX_BMPBUTTN_H_ | |
14 | ||
aae91497 MB |
15 | #include "wx/motif/bmpmotif.h" |
16 | ||
9b6dbb09 JS |
17 | #define wxDEFAULT_BUTTON_MARGIN 4 |
18 | ||
ea9868e8 | 19 | class WXDLLEXPORT wxBitmapButton: public wxBitmapButtonBase |
9b6dbb09 | 20 | { |
83df96d6 JS |
21 | DECLARE_DYNAMIC_CLASS(wxBitmapButton) |
22 | public: | |
23 | wxBitmapButton(); | |
24 | ~wxBitmapButton(); | |
ea9868e8 | 25 | wxBitmapButton(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap, |
83df96d6 JS |
26 | const wxPoint& pos = wxDefaultPosition, |
27 | const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW, | |
28 | const wxValidator& validator = wxDefaultValidator, | |
29 | const wxString& name = wxButtonNameStr) | |
30 | { | |
31 | Create(parent, id, bitmap, pos, size, style, validator, name); | |
32 | } | |
33 | ||
34 | bool Create(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap, | |
35 | const wxPoint& pos = wxDefaultPosition, | |
36 | const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW, | |
37 | const wxValidator& validator = wxDefaultValidator, | |
38 | const wxString& name = wxButtonNameStr); | |
39 | ||
40 | virtual void SetLabel(const wxBitmap& bitmap) | |
41 | { | |
42 | SetBitmapLabel(bitmap); | |
43 | } | |
44 | virtual void SetLabel(const wxString& label) | |
45 | { | |
46 | wxControl::SetLabel(label); | |
47 | } | |
48 | ||
49 | virtual void SetBitmapLabel(const wxBitmap& bitmap); | |
50 | ||
83df96d6 JS |
51 | void SetBitmapSelected(const wxBitmap& sel); |
52 | void SetBitmapFocus(const wxBitmap& focus); | |
53 | void SetBitmapDisabled(const wxBitmap& disabled); | |
54 | ||
83df96d6 JS |
55 | // Implementation |
56 | void DoSetBitmap(); | |
57 | virtual void ChangeBackgroundColour(); | |
401eb3de | 58 | virtual wxSize DoGetBestSize() const; |
83df96d6 JS |
59 | |
60 | protected: | |
ea9868e8 | 61 | wxBitmap m_bmpNormalOriginal; // May be different from m_buttonBitmap |
83df96d6 JS |
62 | // if m_buttonBitmap has been changed |
63 | // to reflect button background colour | |
ea9868e8 MB |
64 | wxBitmap m_bmpSelectedOriginal; |
65 | wxBitmap m_bmpDisabledOriginal; | |
aae91497 MB |
66 | |
67 | wxBitmapCache m_bitmapCache; | |
68 | ||
83df96d6 | 69 | WXPixmap m_insensPixmap; |
9b6dbb09 JS |
70 | }; |
71 | ||
72 | #endif | |
83df96d6 | 73 | // _WX_BMPBUTTN_H_ |