]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/msw/bmpbuttn.h | |
3 | // Purpose: wxBitmapButton class | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 01/02/97 | |
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 | #include "wx/button.h" | |
16 | #include "wx/bitmap.h" | |
17 | #include "wx/brush.h" | |
18 | ||
19 | class WXDLLEXPORT wxBitmapButton : public wxBitmapButtonBase | |
20 | { | |
21 | public: | |
22 | wxBitmapButton() { } | |
23 | ||
24 | wxBitmapButton(wxWindow *parent, | |
25 | wxWindowID id, | |
26 | const wxBitmap& bitmap, | |
27 | const wxPoint& pos = wxDefaultPosition, | |
28 | const wxSize& size = wxDefaultSize, | |
29 | long style = wxBU_AUTODRAW, | |
30 | const wxValidator& validator = wxDefaultValidator, | |
31 | const wxString& name = wxButtonNameStr) | |
32 | { | |
33 | Create(parent, id, bitmap, pos, size, style, validator, name); | |
34 | } | |
35 | ||
36 | bool Create(wxWindow *parent, | |
37 | wxWindowID id, | |
38 | const wxBitmap& bitmap, | |
39 | const wxPoint& pos = wxDefaultPosition, | |
40 | const wxSize& size = wxDefaultSize, | |
41 | long style = wxBU_AUTODRAW, | |
42 | const wxValidator& validator = wxDefaultValidator, | |
43 | const wxString& name = wxButtonNameStr); | |
44 | ||
45 | // Implementation | |
46 | virtual bool SetBackgroundColour(const wxColour& colour); | |
47 | virtual void SetDefault(); | |
48 | virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item); | |
49 | virtual void DrawFace( WXHDC dc, int left, int top, int right, int bottom, bool sel ); | |
50 | virtual void DrawButtonFocus( WXHDC dc, int left, int top, int right, int bottom, bool sel ); | |
51 | virtual void DrawButtonDisable( WXHDC dc, int left, int top, int right, int bottom, bool with_marg ); | |
52 | ||
53 | protected: | |
54 | // reimplement some base class virtuals | |
55 | virtual wxSize DoGetBestSize() const; | |
56 | virtual void OnSetBitmap(); | |
57 | ||
58 | // invalidate m_brushDisabled when system colours change | |
59 | void OnSysColourChanged(wxSysColourChangedEvent& event); | |
60 | ||
61 | // change the currently bitmap if we have a hover one | |
62 | void OnMouseEnterOrLeave(wxMouseEvent& event); | |
63 | ||
64 | ||
65 | // the brush we use to draw disabled buttons | |
66 | wxBrush m_brushDisabled; | |
67 | ||
68 | ||
69 | DECLARE_EVENT_TABLE() | |
70 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxBitmapButton) | |
71 | }; | |
72 | ||
73 | #endif // _WX_BMPBUTTN_H_ |