]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/cocoa/button.h | |
3 | // Purpose: wxButton class | |
4 | // Author: David Elliott | |
5 | // Modified by: | |
6 | // Created: 2002/12/29 | |
7 | // Copyright: (c) 2002 David Elliott | |
8 | // Licence: wxWindows licence | |
9 | ///////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | #ifndef __WX_COCOA_BUTTON_H__ | |
12 | #define __WX_COCOA_BUTTON_H__ | |
13 | ||
14 | #include "wx/cocoa/NSButton.h" | |
15 | ||
16 | // ======================================================================== | |
17 | // wxButton | |
18 | // ======================================================================== | |
19 | class WXDLLIMPEXP_CORE wxButton : public wxButtonBase, protected wxCocoaNSButton | |
20 | { | |
21 | DECLARE_DYNAMIC_CLASS(wxButton) | |
22 | DECLARE_EVENT_TABLE() | |
23 | WX_DECLARE_COCOA_OWNER(NSButton,NSControl,NSView) | |
24 | // ------------------------------------------------------------------------ | |
25 | // initialization | |
26 | // ------------------------------------------------------------------------ | |
27 | public: | |
28 | wxButton() { } | |
29 | wxButton(wxWindow *parent, wxWindowID winid, | |
30 | const wxString& label = wxEmptyString, | |
31 | const wxPoint& pos = wxDefaultPosition, | |
32 | const wxSize& size = wxDefaultSize, long style = 0, | |
33 | const wxValidator& validator = wxDefaultValidator, | |
34 | const wxString& name = wxButtonNameStr) | |
35 | { | |
36 | Create(parent, winid, label, pos, size, style, validator, name); | |
37 | } | |
38 | ||
39 | ||
40 | bool Create(wxWindow *parent, wxWindowID winid, | |
41 | const wxString& label = wxEmptyString, | |
42 | const wxPoint& pos = wxDefaultPosition, | |
43 | const wxSize& size = wxDefaultSize, long style = 0, | |
44 | const wxValidator& validator = wxDefaultValidator, | |
45 | const wxString& name = wxButtonNameStr); | |
46 | ||
47 | virtual ~wxButton(); | |
48 | ||
49 | // ------------------------------------------------------------------------ | |
50 | // Cocoa callbacks | |
51 | // ------------------------------------------------------------------------ | |
52 | protected: | |
53 | virtual void Cocoa_wxNSButtonAction(void); | |
54 | // ------------------------------------------------------------------------ | |
55 | // Implementation | |
56 | // ------------------------------------------------------------------------ | |
57 | public: | |
58 | wxString GetLabel() const; | |
59 | void SetLabel(const wxString& label); | |
60 | wxSize DoGetBestSize() const; | |
61 | }; | |
62 | ||
63 | #endif | |
64 | // __WX_COCOA_BUTTON_H__ |