]>
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 DW |
8 | // Copyright: (c) David Webster |
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 DW |
16 | |
17 | WXDLLEXPORT_DATA(extern const char*) wxButtonNameStr; | |
18 | ||
19 | // Pushbutton | |
20 | class WXDLLEXPORT wxButton: public wxControl | |
21 | { | |
22 | DECLARE_DYNAMIC_CLASS(wxButton) | |
23 | public: | |
24 | inline wxButton() {} | |
25 | inline wxButton(wxWindow *parent, wxWindowID id, const wxString& label, | |
26 | const wxPoint& pos = wxDefaultPosition, | |
27 | const wxSize& size = wxDefaultSize, long style = 0, | |
57c4d796 DW |
28 | #if wxUSE_VALIDATORS |
29 | # if defined(__VISAGECPP__) | |
30 | const wxValidator* validator = wxDefaultValidator, | |
31 | # else | |
0e320a79 | 32 | const wxValidator& validator = wxDefaultValidator, |
57c4d796 DW |
33 | # endif |
34 | #endif | |
0e320a79 DW |
35 | const wxString& name = wxButtonNameStr) |
36 | { | |
37 | Create(parent, id, label, pos, size, style, validator, name); | |
38 | } | |
39 | ||
40 | bool Create(wxWindow *parent, wxWindowID id, const wxString& label, | |
41 | const wxPoint& pos = wxDefaultPosition, | |
42 | const wxSize& size = wxDefaultSize, long style = 0, | |
57c4d796 DW |
43 | #if wxUSE_VALIDATORS |
44 | # if defined(__VISAGECPP__) | |
45 | const wxValidator* validator = wxDefaultValidator, | |
46 | # else | |
0e320a79 | 47 | const wxValidator& validator = wxDefaultValidator, |
57c4d796 DW |
48 | # endif |
49 | #endif | |
0e320a79 DW |
50 | const wxString& name = wxButtonNameStr); |
51 | ||
1408104d DW |
52 | virtual ~wxButton(); |
53 | ||
0e320a79 | 54 | virtual void SetDefault(); |
1408104d DW |
55 | |
56 | static wxSize GetDefaultSize(); | |
57 | ||
0e320a79 | 58 | virtual void Command(wxCommandEvent& event); |
d88de032 DW |
59 | virtual bool OS2Command(WXUINT param, WXWORD id); |
60 | virtual WXHBRUSH OnCtlColor(WXHDC pDC, | |
61 | WXHWND pWnd, | |
62 | WXUINT nCtlColor, | |
63 | WXUINT message, | |
64 | WXWPARAM wParam, | |
65 | WXLPARAM lParam); | |
66 | protected: | |
67 | // send a notification event, return TRUE if processed | |
68 | bool SendClickEvent(); | |
69 | ||
70 | virtual wxSize DoGetBestSize(); | |
0e320a79 DW |
71 | }; |
72 | ||
73 | #endif | |
74 | // _WX_BUTTON_H_ |