Call wxTLW::SetDefaultItem() from wxButtonBase::SetDefault() instead of doing
[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 = wxEmptyString
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 bool Create( wxWindow* pParent
44 ,wxWindowID vId
45 ,const wxString& rsLabel = wxEmptyString
46 ,const wxPoint& rPos = wxDefaultPosition
47 ,const wxSize& rSize = wxDefaultSize
48 ,long lStyle = 0
49 ,const wxValidator& rValidator = wxDefaultValidator
50 ,const wxString& rsName = wxButtonNameStr
51 );
52
53 virtual ~wxButton();
54
55 static wxSize GetDefaultSize(void);
56 virtual void Command(wxCommandEvent& rEvent);
57 virtual bool OS2Command( WXUINT uParam
58 ,WXWORD vId
59 );
60 virtual WXHBRUSH OnCtlColor( WXHDC hDC
61 ,WXHWND hWnd
62 ,WXUINT uCtlColor
63 ,WXUINT uMessage
64 ,WXWPARAM wParam
65 ,WXLPARAM lParam
66 );
67 void MakeOwnerDrawn(void);
68
69 virtual MRESULT WindowProc( WXUINT uMsg
70 ,WXWPARAM wParam
71 ,WXLPARAM lParam
72 );
73
74 protected:
75
76 bool SendClickEvent(void);
77 void SetTmpDefault(void);
78 void UnsetTmpDefault(void);
79
80 static void SetDefaultStyle( wxButton* pButton
81 ,bool bOn
82 );
83
84 virtual wxSize DoGetBestSize(void) const;
85 virtual WXDWORD OS2GetStyle( long style
86 ,WXDWORD* exstyle
87 ) const;
88 private:
89 DECLARE_DYNAMIC_CLASS(wxButton)
90 }; // end of CLASS wxButton
91
92 #endif
93 // _WX_BUTTON_H_
94