]>
Commit | Line | Data |
---|---|---|
2bda0e17 KB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: bmpbuttn.h | |
3 | // Purpose: wxBitmapButton class | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 01/02/97 | |
7 | // RCS-ID: $Id$ | |
bbcdf8bc | 8 | // Copyright: (c) Julian Smart |
1e7215e6 | 9 | // Licence: wxWindows licence |
2bda0e17 KB |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
bbcdf8bc JS |
12 | #ifndef _WX_BMPBUTTN_H_ |
13 | #define _WX_BMPBUTTN_H_ | |
2bda0e17 KB |
14 | |
15 | #ifdef __GNUG__ | |
16 | #pragma interface "bmpbuttn.h" | |
17 | #endif | |
18 | ||
19 | #include "wx/button.h" | |
1e7215e6 | 20 | #include "wx/bitmap.h" |
2bda0e17 | 21 | |
2bda0e17 KB |
22 | #define wxDEFAULT_BUTTON_MARGIN 4 |
23 | ||
1e6feb95 | 24 | class WXDLLEXPORT wxBitmapButton: public wxBitmapButtonBase |
2bda0e17 | 25 | { |
0655ad29 | 26 | public: |
1e6feb95 VZ |
27 | wxBitmapButton() |
28 | { m_marginX = m_marginY = wxDEFAULT_BUTTON_MARGIN; } | |
29 | wxBitmapButton(wxWindow *parent, | |
30 | wxWindowID id, | |
31 | const wxBitmap& bitmap, | |
32 | const wxPoint& pos = wxDefaultPosition, | |
33 | const wxSize& size = wxDefaultSize, | |
34 | long style = wxBU_AUTODRAW, | |
35 | const wxValidator& validator = wxDefaultValidator, | |
36 | const wxString& name = wxButtonNameStr) | |
0655ad29 VZ |
37 | { |
38 | Create(parent, id, bitmap, pos, size, style, validator, name); | |
39 | } | |
40 | ||
1e6feb95 VZ |
41 | bool Create(wxWindow *parent, |
42 | wxWindowID id, | |
43 | const wxBitmap& bitmap, | |
44 | const wxPoint& pos = wxDefaultPosition, | |
45 | const wxSize& size = wxDefaultSize, | |
46 | long style = wxBU_AUTODRAW, | |
47 | const wxValidator& validator = wxDefaultValidator, | |
48 | const wxString& name = wxButtonNameStr); | |
2bda0e17 KB |
49 | |
50 | #if WXWIN_COMPATIBILITY | |
1e6feb95 | 51 | wxBitmap *GetBitmap() const { return (wxBitmap *) & m_bmp; } |
2bda0e17 KB |
52 | #endif |
53 | ||
0655ad29 VZ |
54 | // Implementation |
55 | virtual void SetDefault(); | |
56 | virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item); | |
57 | virtual void DrawFace( WXHDC dc, int left, int top, int right, int bottom, bool sel ); | |
58 | virtual void DrawButtonFocus( WXHDC dc, int left, int top, int right, int bottom, bool sel ); | |
59 | virtual void DrawButtonDisable( WXHDC dc, int left, int top, int right, int bottom, bool with_marg ); | |
60 | ||
1e6feb95 VZ |
61 | private: |
62 | DECLARE_DYNAMIC_CLASS(wxBitmapButton) | |
2bda0e17 KB |
63 | }; |
64 | ||
65 | #endif | |
bbcdf8bc | 66 | // _WX_BMPBUTTN_H_ |