]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: button.h | |
3 | // Purpose: wxButton class | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 01/02/97 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Julian Smart | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_BUTTON_H_ | |
13 | #define _WX_BUTTON_H_ | |
14 | ||
15 | #ifdef __GNUG__ | |
16 | #pragma interface "button.h" | |
17 | #endif | |
18 | ||
19 | #include "wx/control.h" | |
20 | ||
21 | WXDLLEXPORT_DATA(extern const wxChar*) wxButtonNameStr; | |
22 | ||
23 | // ---------------------------------------------------------------------------- | |
24 | // Pushbutton | |
25 | // ---------------------------------------------------------------------------- | |
26 | ||
27 | class WXDLLEXPORT wxButton : public wxControl | |
28 | { | |
29 | DECLARE_DYNAMIC_CLASS(wxButton) | |
30 | ||
31 | public: | |
32 | wxButton() { } | |
33 | wxButton(wxWindow *parent, wxWindowID id, const wxString& label, | |
34 | const wxPoint& pos = wxDefaultPosition, | |
35 | const wxSize& size = wxDefaultSize, long style = 0, | |
36 | const wxValidator& validator = wxDefaultValidator, | |
37 | const wxString& name = wxButtonNameStr) | |
38 | { | |
39 | Create(parent, id, label, pos, size, style, validator, name); | |
40 | } | |
41 | ||
42 | bool Create(wxWindow *parent, wxWindowID id, const wxString& label, | |
43 | const wxPoint& pos = wxDefaultPosition, | |
44 | const wxSize& size = wxDefaultSize, long style = 0, | |
45 | const wxValidator& validator = wxDefaultValidator, | |
46 | const wxString& name = wxButtonNameStr); | |
47 | ||
48 | virtual ~wxButton(); | |
49 | ||
50 | virtual void SetDefault(); | |
51 | ||
52 | static wxSize GetDefaultSize(); | |
53 | ||
54 | // implementation from now on | |
55 | virtual void Command(wxCommandEvent& event); | |
56 | virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); | |
57 | virtual bool MSWCommand(WXUINT param, WXWORD id); | |
58 | virtual WXHBRUSH OnCtlColor(WXHDC pDC, | |
59 | WXHWND pWnd, | |
60 | WXUINT nCtlColor, | |
61 | WXUINT message, | |
62 | WXWPARAM wParam, | |
63 | WXLPARAM lParam); | |
64 | ||
65 | protected: | |
66 | // send a notification event, return TRUE if processed | |
67 | bool SendClickEvent(); | |
68 | ||
69 | virtual wxSize DoGetBestSize() const; | |
70 | }; | |
71 | ||
72 | #endif | |
73 | // _WX_BUTTON_H_ |