]> git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/bmpbuttn.h
added wxQueueEvent() avoiding the bug of wxPostEvent() with the events having wxStrin...
[wxWidgets.git] / include / wx / os2 / bmpbuttn.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: bmpbuttn.h
3 // Purpose: wxBitmapButton class
4 // Author: David Webster
5 // Modified by:
6 // Created: 10/13/99
7 // RCS-ID: $Id$
8 // Copyright: (c) David Webster
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/dcclient.h"
17
18 WXDLLIMPEXP_DATA_CORE(extern const char) wxButtonNameStr[];
19
20 #define wxDEFAULT_BUTTON_MARGIN 4
21
22 class WXDLLIMPEXP_CORE wxBitmapButton: public wxBitmapButtonBase
23 {
24 public:
25 inline wxBitmapButton()
26 {
27 m_marginX = wxDEFAULT_BUTTON_MARGIN;
28 m_marginY = wxDEFAULT_BUTTON_MARGIN;
29 }
30 inline wxBitmapButton( wxWindow* pParent
31 ,wxWindowID vId
32 ,const wxBitmap& rBitmap
33 ,const wxPoint& rPos = wxDefaultPosition
34 ,const wxSize& rSize = wxDefaultSize
35 ,long lStyle = wxBU_AUTODRAW
36 ,const wxValidator& rValidator = wxDefaultValidator
37 ,const wxString& rsName = wxButtonNameStr
38 )
39 {
40 Create( pParent
41 ,vId
42 ,rBitmap
43 ,rPos
44 ,rSize
45 ,lStyle
46 ,rValidator
47 ,rsName
48 );
49 }
50
51 bool Create( wxWindow* pParent
52 ,wxWindowID vId
53 ,const wxBitmap& rBitmap
54 ,const wxPoint& rPos = wxDefaultPosition
55 ,const wxSize& rSize = wxDefaultSize
56 ,long lStyle = wxBU_AUTODRAW
57 ,const wxValidator& rValidator = wxDefaultValidator
58 ,const wxString& rsName = wxButtonNameStr
59 );
60
61 virtual void SetLabel(const wxBitmap& rBitmap)
62 {
63 SetBitmapLabel(rBitmap);
64 }
65
66 //
67 // Implementation
68 //
69 virtual bool OS2OnDraw(WXDRAWITEMSTRUCT* pItem);
70
71 private:
72
73 virtual void DrawFace( wxClientDC& rDC
74 ,bool bSel
75 );
76 virtual void DrawButtonFocus(wxClientDC& rDC);
77 virtual void DrawButtonDisable( wxClientDC& rDC
78 ,wxBitmap& rBmp
79 );
80 DECLARE_DYNAMIC_CLASS(wxBitmapButton)
81
82 virtual void SetLabel(const wxString& rsString)
83 {
84 wxButton::SetLabel(rsString);
85 }
86 }; // end of CLASS wxBitmapButton
87
88 #endif // _WX_BMPBUTTN_H_
89