]>
Commit | Line | Data |
---|---|---|
0e320a79 DW |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: button.h | |
3 | // Purpose: wxButton class | |
d88de032 | 4 | // Author: David Webster |
0e320a79 | 5 | // Modified by: |
d88de032 | 6 | // Created: 10/13/99 |
0e320a79 | 7 | // RCS-ID: $Id$ |
d88de032 | 8 | // Copyright: (c) David Webster |
65571936 | 9 | // Licence: wxWindows licence |
0e320a79 DW |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_BUTTON_H_ | |
13 | #define _WX_BUTTON_H_ | |
14 | ||
0e320a79 | 15 | #include "wx/control.h" |
0e320a79 | 16 | |
0e320a79 | 17 | // Pushbutton |
210a651b | 18 | class WXDLLEXPORT wxButton: public wxButtonBase |
0e320a79 | 19 | { |
0e320a79 | 20 | public: |
afa59b4e DW |
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 | |
afa59b4e | 28 | ,const wxValidator& rValidator = wxDefaultValidator |
afa59b4e DW |
29 | ,const wxString& rsName = wxButtonNameStr |
30 | ) | |
31 | { | |
32 | Create( pParent | |
33 | ,vId | |
34 | ,rsLabel | |
35 | ,rPos | |
36 | ,rSize | |
37 | ,lStyle | |
afa59b4e | 38 | ,rValidator |
afa59b4e DW |
39 | ,rsName |
40 | ); | |
41 | } | |
401e3b6e VS |
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 | } | |
0e320a79 | 52 | |
afa59b4e DW |
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 | |
afa59b4e | 59 | ,const wxValidator& rValidator = wxDefaultValidator |
afa59b4e DW |
60 | ,const wxString& rsName = wxButtonNameStr |
61 | ); | |
401e3b6e VS |
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 | } | |
0e320a79 | 73 | |
afa59b4e | 74 | virtual ~wxButton(); |
1408104d | 75 | |
afa59b4e DW |
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); | |
1408104d | 90 | |
afa59b4e DW |
91 | virtual MRESULT WindowProc( WXUINT uMsg |
92 | ,WXWPARAM wParam | |
93 | ,WXLPARAM lParam | |
94 | ); | |
1408104d | 95 | |
d88de032 | 96 | protected: |
d88de032 | 97 | |
b9b1d6c8 | 98 | bool SendClickEvent(void); |
430974f8 DW |
99 | void SetTmpDefault(void); |
100 | void UnsetTmpDefault(void); | |
101 | ||
018d3030 DW |
102 | static void SetDefaultStyle( wxButton* pButton |
103 | ,bool bOn | |
104 | ); | |
430974f8 | 105 | |
b9b1d6c8 DW |
106 | virtual wxSize DoGetBestSize(void) const; |
107 | virtual WXDWORD OS2GetStyle( long style | |
108 | ,WXDWORD* exstyle | |
109 | ) const; | |
210a651b DW |
110 | private: |
111 | DECLARE_DYNAMIC_CLASS(wxButton) | |
afa59b4e | 112 | }; // end of CLASS wxButton |
0e320a79 DW |
113 | |
114 | #endif | |
115 | // _WX_BUTTON_H_ | |
afa59b4e | 116 |