]>
Commit | Line | Data |
---|---|---|
0e320a79 DW |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: bmpbuttn.h | |
3 | // Purpose: wxBitmapButton class | |
37f214d5 | 4 | // Author: David Webster |
0e320a79 | 5 | // Modified by: |
37f214d5 | 6 | // Created: 10/13/99 |
0e320a79 | 7 | // RCS-ID: $Id$ |
37f214d5 DW |
8 | // Copyright: (c) David Webster |
9 | // Licence: wxWindows licence | |
0e320a79 DW |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_BMPBUTTN_H_ | |
13 | #define _WX_BMPBUTTN_H_ | |
14 | ||
0e320a79 DW |
15 | #include "wx/button.h" |
16 | ||
17 | WXDLLEXPORT_DATA(extern const char*) wxButtonNameStr; | |
18 | ||
19 | #define wxDEFAULT_BUTTON_MARGIN 4 | |
20 | ||
210a651b | 21 | class WXDLLEXPORT wxBitmapButton: public wxBitmapButtonBase |
0e320a79 | 22 | { |
db16e5c3 DW |
23 | public: |
24 | inline wxBitmapButton() | |
25 | { | |
26 | m_marginX = wxDEFAULT_BUTTON_MARGIN; | |
27 | m_marginY = wxDEFAULT_BUTTON_MARGIN; | |
28 | } | |
29 | inline wxBitmapButton( wxWindow* pParent | |
30 | ,wxWindowID vId | |
31 | ,const wxBitmap& rBitmap | |
32 | ,const wxPoint& rPos = wxDefaultPosition | |
33 | ,const wxSize& rSize = wxDefaultSize | |
34 | ,long lStyle = wxBU_AUTODRAW | |
db16e5c3 | 35 | ,const wxValidator& rValidator = wxDefaultValidator |
db16e5c3 DW |
36 | ,const wxString& rsName = wxButtonNameStr |
37 | ) | |
38 | { | |
39 | Create( pParent | |
40 | ,vId | |
41 | ,rBitmap | |
42 | ,rPos | |
43 | ,rSize | |
44 | ,lStyle | |
db16e5c3 | 45 | ,rValidator |
db16e5c3 DW |
46 | ,rsName |
47 | ); | |
48 | } | |
0e320a79 | 49 | |
db16e5c3 DW |
50 | bool Create( wxWindow* pParent |
51 | ,wxWindowID vId | |
52 | ,const wxBitmap& rBitmap | |
53 | ,const wxPoint& rPos = wxDefaultPosition | |
54 | ,const wxSize& rSize = wxDefaultSize | |
55 | ,long lStyle = wxBU_AUTODRAW | |
db16e5c3 | 56 | ,const wxValidator& rValidator = wxDefaultValidator |
db16e5c3 DW |
57 | ,const wxString& rsName = wxButtonNameStr |
58 | ); | |
0e320a79 | 59 | |
db16e5c3 DW |
60 | virtual void SetLabel(const wxBitmap& rBitmap) |
61 | { | |
62 | SetBitmapLabel(rBitmap); | |
63 | } | |
0e320a79 | 64 | |
37f214d5 | 65 | #if WXWIN_COMPATIBILITY |
db16e5c3 DW |
66 | wxBitmap* GetBitmap(void) const |
67 | { | |
68 | return (wxBitmap *)&m_buttonBitmap; | |
69 | } | |
37f214d5 DW |
70 | #endif |
71 | ||
db16e5c3 DW |
72 | // |
73 | // Implementation | |
74 | // | |
75 | virtual void SetDefault(); | |
76 | virtual bool OS2OnDraw(WXDRAWITEMSTRUCT* pItem); | |
0e320a79 | 77 | |
db16e5c3 | 78 | private: |
0e320a79 | 79 | |
db16e5c3 DW |
80 | virtual void DrawFace( wxClientDC& rDC |
81 | ,bool bSel | |
82 | ); | |
83 | virtual void DrawButtonFocus(wxClientDC& rDC); | |
84 | virtual void DrawButtonDisable( wxClientDC& rDC | |
85 | ,wxBitmap& rBmp | |
86 | ); | |
87 | DECLARE_DYNAMIC_CLASS(wxBitmapButton) | |
0e320a79 | 88 | |
db16e5c3 DW |
89 | virtual void SetLabel(const wxString& rsString) |
90 | { | |
91 | wxButton::SetLabel(rsString); | |
92 | } | |
93 | }; // end of CLASS wxBitmapButton | |
0e320a79 | 94 | |
db16e5c3 | 95 | #endif // _WX_BMPBUTTN_H_ |
0e320a79 | 96 |