]>
Commit | Line | Data |
---|---|---|
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 WXDLLIMPEXP_CORE 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 | virtual wxWindow *SetDefault(); | |
56 | ||
57 | static wxSize GetDefaultSize(void); | |
58 | virtual void Command(wxCommandEvent& rEvent); | |
59 | virtual bool OS2Command( WXUINT uParam | |
60 | ,WXWORD vId | |
61 | ); | |
62 | virtual WXHBRUSH OnCtlColor( WXHDC hDC | |
63 | ,WXHWND hWnd | |
64 | ,WXUINT uCtlColor | |
65 | ,WXUINT uMessage | |
66 | ,WXWPARAM wParam | |
67 | ,WXLPARAM lParam | |
68 | ); | |
69 | void MakeOwnerDrawn(void); | |
70 | ||
71 | virtual MRESULT WindowProc( WXUINT uMsg | |
72 | ,WXWPARAM wParam | |
73 | ,WXLPARAM lParam | |
74 | ); | |
75 | ||
76 | protected: | |
77 | ||
78 | bool SendClickEvent(void); | |
79 | void SetTmpDefault(void); | |
80 | void UnsetTmpDefault(void); | |
81 | ||
82 | static void SetDefaultStyle( wxButton* pButton | |
83 | ,bool bOn | |
84 | ); | |
85 | ||
86 | virtual wxSize DoGetBestSize(void) const; | |
87 | virtual WXDWORD OS2GetStyle( long style | |
88 | ,WXDWORD* exstyle | |
89 | ) const; | |
90 | private: | |
91 | DECLARE_DYNAMIC_CLASS(wxButton) | |
92 | }; // end of CLASS wxButton | |
93 | ||
94 | #endif | |
95 | // _WX_BUTTON_H_ | |
96 |