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