added stock buttons support
[wxWidgets.git] / include / wx / os2 / button.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: button.h
3 // Purpose: wxButton 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_BUTTON_H_
13 #define _WX_BUTTON_H_
14
15 #include "wx/control.h"
16
17 // Pushbutton
18 class WXDLLEXPORT wxButton: public wxButtonBase
19 {
20 public:
21 inline wxButton() {}
22 inline wxButton( wxWindow* pParent
23 ,wxWindowID vId
24 ,const wxString& rsLabel
25 ,const wxPoint& rPos = wxDefaultPosition
26 ,const wxSize& rSize = wxDefaultSize
27 ,long lStyle = 0
28 ,const wxValidator& rValidator = wxDefaultValidator
29 ,const wxString& rsName = wxButtonNameStr
30 )
31 {
32 Create( pParent
33 ,vId
34 ,rsLabel
35 ,rPos
36 ,rSize
37 ,lStyle
38 ,rValidator
39 ,rsName
40 );
41 }
42
43 wxButton(wxWindow *parent, wxWindowID id, wxStockItemID stock,
44 const wxString& descriptiveLabel = wxEmptyString,
45 const wxPoint& pos = wxDefaultPosition,
46 long style = 0,
47 const wxValidator& validator = wxDefaultValidator,
48 const wxString& name = wxButtonNameStr)
49 {
50 Create(parent, id, stock, descriptiveLabel, pos, style, validator, name);
51 }
52
53 bool Create( wxWindow* pParent
54 ,wxWindowID vId
55 ,const wxString& rsLabel
56 ,const wxPoint& rPos = wxDefaultPosition
57 ,const wxSize& rSize = wxDefaultSize
58 ,long lStyle = 0
59 ,const wxValidator& rValidator = wxDefaultValidator
60 ,const wxString& rsName = wxButtonNameStr
61 );
62
63 bool Create(wxWindow *parent, wxWindowID id, wxStockItemID stock,
64 const wxString& descriptiveLabel = wxEmptyString,
65 const wxPoint& pos = wxDefaultPosition,
66 long style = 0,
67 const wxValidator& validator = wxDefaultValidator,
68 const wxString& name = wxButtonNameStr)
69 {
70 return CreateStock(parent, id, stock, descriptiveLabel,
71 pos, style, validator, name);
72 }
73
74 virtual ~wxButton();
75
76 virtual void SetDefault(void);
77 static wxSize GetDefaultSize(void);
78 virtual void Command(wxCommandEvent& rEvent);
79 virtual bool OS2Command( WXUINT uParam
80 ,WXWORD vId
81 );
82 virtual WXHBRUSH OnCtlColor( WXHDC hDC
83 ,WXHWND hWnd
84 ,WXUINT uCtlColor
85 ,WXUINT uMessage
86 ,WXWPARAM wParam
87 ,WXLPARAM lParam
88 );
89 void MakeOwnerDrawn(void);
90
91 virtual MRESULT WindowProc( WXUINT uMsg
92 ,WXWPARAM wParam
93 ,WXLPARAM lParam
94 );
95
96 protected:
97
98 bool SendClickEvent(void);
99 void SetTmpDefault(void);
100 void UnsetTmpDefault(void);
101
102 static void SetDefaultStyle( wxButton* pButton
103 ,bool bOn
104 );
105
106 virtual wxSize DoGetBestSize(void) const;
107 virtual WXDWORD OS2GetStyle( long style
108 ,WXDWORD* exstyle
109 ) const;
110 private:
111 DECLARE_DYNAMIC_CLASS(wxButton)
112 }; // end of CLASS wxButton
113
114 #endif
115 // _WX_BUTTON_H_
116