]>
Commit | Line | Data |
---|---|---|
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 | #define wxDEFAULT_BUTTON_MARGIN 4 | |
22 | ||
23 | class WXDLLEXPORT wxBitmapButton: public wxBitmapButtonBase | |
24 | { | |
25 | DECLARE_DYNAMIC_CLASS(wxBitmapButton) | |
26 | public: | |
27 | wxBitmapButton(); | |
28 | ~wxBitmapButton(); | |
29 | wxBitmapButton(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap, | |
30 | const wxPoint& pos = wxDefaultPosition, | |
31 | const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW, | |
32 | const wxValidator& validator = wxDefaultValidator, | |
33 | const wxString& name = wxButtonNameStr) | |
34 | { | |
35 | Create(parent, id, bitmap, pos, size, style, validator, name); | |
36 | } | |
37 | ||
38 | bool Create(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap, | |
39 | const wxPoint& pos = wxDefaultPosition, | |
40 | const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW, | |
41 | const wxValidator& validator = wxDefaultValidator, | |
42 | const wxString& name = wxButtonNameStr); | |
43 | ||
44 | virtual void SetLabel(const wxBitmap& bitmap) | |
45 | { | |
46 | SetBitmapLabel(bitmap); | |
47 | } | |
48 | virtual void SetLabel(const wxString& label) | |
49 | { | |
50 | wxControl::SetLabel(label); | |
51 | } | |
52 | ||
53 | virtual void SetBitmapLabel(const wxBitmap& bitmap); | |
54 | ||
55 | void SetBitmapSelected(const wxBitmap& sel); | |
56 | void SetBitmapFocus(const wxBitmap& focus); | |
57 | void SetBitmapDisabled(const wxBitmap& disabled); | |
58 | ||
59 | // Implementation | |
60 | void DoSetBitmap(); | |
61 | virtual void ChangeBackgroundColour(); | |
62 | virtual wxSize DoGetBestSize() const; | |
63 | ||
64 | protected: | |
65 | wxBitmap m_bmpNormalOriginal; // May be different from m_buttonBitmap | |
66 | // if m_buttonBitmap has been changed | |
67 | // to reflect button background colour | |
68 | wxBitmap m_bmpSelectedOriginal; | |
69 | wxBitmap m_bmpDisabledOriginal; | |
70 | ||
71 | wxBitmapCache m_bitmapCache; | |
72 | ||
73 | WXPixmap m_insensPixmap; | |
74 | }; | |
75 | ||
76 | #endif | |
77 | // _WX_BMPBUTTN_H_ |