]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/osx/button.h | |
3 | // Purpose: wxButton class | |
4 | // Author: Stefan Csomor | |
5 | // Modified by: | |
6 | // Created: 1998-01-01 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Stefan Csomor | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_OSX_BUTTON_H_ | |
13 | #define _WX_OSX_BUTTON_H_ | |
14 | ||
15 | #include "wx/control.h" | |
16 | #include "wx/gdicmn.h" | |
17 | ||
18 | // Pushbutton | |
19 | class WXDLLIMPEXP_CORE wxButton : public wxButtonBase | |
20 | { | |
21 | public: | |
22 | wxButton() {} | |
23 | wxButton(wxWindow *parent, | |
24 | wxWindowID id, | |
25 | const wxString& label = wxEmptyString, | |
26 | const wxPoint& pos = wxDefaultPosition, | |
27 | const wxSize& size = wxDefaultSize, | |
28 | long style = 0, | |
29 | const wxValidator& validator = wxDefaultValidator, | |
30 | const wxString& name = wxButtonNameStr) | |
31 | { | |
32 | Create(parent, id, label, pos, size, style, validator, name); | |
33 | } | |
34 | ||
35 | bool Create(wxWindow *parent, | |
36 | wxWindowID id, | |
37 | const wxString& label = wxEmptyString, | |
38 | const wxPoint& pos = wxDefaultPosition, | |
39 | const wxSize& size = wxDefaultSize, | |
40 | long style = 0, | |
41 | const wxValidator& validator = wxDefaultValidator, | |
42 | const wxString& name = wxButtonNameStr); | |
43 | ||
44 | virtual void SetLabel(const wxString& label); | |
45 | virtual wxWindow *SetDefault(); | |
46 | virtual void Command(wxCommandEvent& event); | |
47 | ||
48 | // osx specific event handling common for all osx-ports | |
49 | ||
50 | virtual bool OSXHandleClicked( double timestampsec ); | |
51 | ||
52 | #if wxOSX_USE_COCOA | |
53 | void OSXUpdateAfterLabelChange(const wxString& label); | |
54 | #endif | |
55 | ||
56 | protected: | |
57 | DECLARE_DYNAMIC_CLASS(wxButton) | |
58 | }; | |
59 | ||
60 | // OS X specific class, not part of public wx API | |
61 | class WXDLLIMPEXP_CORE wxDisclosureTriangle : public wxControl | |
62 | { | |
63 | public: | |
64 | wxDisclosureTriangle(wxWindow *parent, | |
65 | wxWindowID id, | |
66 | const wxString& label = wxEmptyString, | |
67 | const wxPoint& pos = wxDefaultPosition, | |
68 | const wxSize& size = wxDefaultSize, | |
69 | long style = wxBORDER_NONE, | |
70 | const wxValidator& validator = wxDefaultValidator, | |
71 | const wxString& name = wxButtonNameStr) | |
72 | { | |
73 | Create(parent, id, label, pos, size, style, validator, name); | |
74 | } | |
75 | ||
76 | bool Create(wxWindow *parent, | |
77 | wxWindowID id, | |
78 | const wxString& label = wxEmptyString, | |
79 | const wxPoint& pos = wxDefaultPosition, | |
80 | const wxSize& size = wxDefaultSize, | |
81 | long style = wxBORDER_NONE, | |
82 | const wxValidator& validator = wxDefaultValidator, | |
83 | const wxString& name = wxButtonNameStr); | |
84 | ||
85 | void SetOpen( bool open ); | |
86 | bool IsOpen() const; | |
87 | ||
88 | // osx specific event handling common for all osx-ports | |
89 | ||
90 | virtual bool OSXHandleClicked( double timestampsec ); | |
91 | ||
92 | protected: | |
93 | virtual wxSize DoGetBestSize() const ; | |
94 | }; | |
95 | ||
96 | #endif // _WX_OSX_BUTTON_H_ |