Commit | Line | Data |
---|---|---|
0c2dc57d SC |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: src/osx/iphone/button.mm | |
3 | // Purpose: wxButton | |
4 | // Author: Stefan Csomor | |
5 | // Modified by: | |
6 | // Created: 1998-01-01 | |
a9a4f229 | 7 | // RCS-ID: $Id$ |
0c2dc57d SC |
8 | // Copyright: (c) Stefan Csomor |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #include "wx/wxprec.h" | |
13 | ||
14 | #include "wx/button.h" | |
15 | ||
16 | #ifndef WX_PRECOMP | |
17 | #include "wx/panel.h" | |
18 | #include "wx/toplevel.h" | |
19 | #include "wx/dcclient.h" | |
20 | #endif | |
21 | ||
22 | #include "wx/stockitem.h" | |
23 | ||
24 | #include "wx/osx/private.h" | |
25 | ||
0c2dc57d SC |
26 | @implementation wxUIButton |
27 | ||
28 | + (void)initialize | |
29 | { | |
30 | static BOOL initialized = NO; | |
03647350 | 31 | if (!initialized) |
0c2dc57d SC |
32 | { |
33 | initialized = YES; | |
34 | wxOSXIPhoneClassAddWXMethods( self ); | |
35 | } | |
36 | } | |
37 | ||
38 | - (int) intValue | |
39 | { | |
40 | return 0; | |
41 | } | |
42 | ||
43 | - (void) setIntValue: (int) v | |
44 | { | |
45 | } | |
46 | ||
47 | @end | |
48 | ||
49 | ||
03647350 VZ |
50 | wxWidgetImplType* wxWidgetImpl::CreateButton( wxWindowMac* wxpeer, |
51 | wxWindowMac* WXUNUSED(parent), | |
52 | wxWindowID id, | |
0c2dc57d | 53 | const wxString& WXUNUSED(label), |
03647350 | 54 | const wxPoint& pos, |
0c2dc57d | 55 | const wxSize& size, |
03647350 VZ |
56 | long WXUNUSED(style), |
57 | long WXUNUSED(extraStyle)) | |
0c2dc57d SC |
58 | { |
59 | CGRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ; | |
60 | UIButtonType buttonType = UIButtonTypeRoundedRect; | |
61 | ||
62 | if ( id == wxID_HELP ) | |
63 | { | |
64 | buttonType = UIButtonTypeInfoDark; | |
65 | } | |
66 | ||
67 | UIButton* v = [[UIButton buttonWithType:buttonType] retain]; | |
68 | v.frame = r; | |
69 | wxWidgetIPhoneImpl* c = new wxWidgetIPhoneImpl( wxpeer, v ); | |
70 | return c; | |
0c2dc57d SC |
71 | } |
72 | ||
73 | void wxWidgetIPhoneImpl::SetDefaultButton( bool isDefault ) | |
03647350 | 74 | { |
0c2dc57d SC |
75 | } |
76 | ||
03647350 | 77 | void wxWidgetIPhoneImpl::PerformClick() |
0c2dc57d SC |
78 | { |
79 | } | |
80 | ||
03647350 VZ |
81 | wxWidgetImplType* wxWidgetImpl::CreateDisclosureTriangle( wxWindowMac* wxpeer, |
82 | wxWindowMac* WXUNUSED(parent), | |
83 | wxWindowID WXUNUSED(id), | |
0c2dc57d | 84 | const wxString& label, |
03647350 | 85 | const wxPoint& pos, |
0c2dc57d | 86 | const wxSize& size, |
03647350 VZ |
87 | long WXUNUSED(style), |
88 | long WXUNUSED(extraStyle)) | |
0c2dc57d SC |
89 | { |
90 | CGRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ; | |
91 | wxUIButton* v = [[wxUIButton alloc] initWithFrame:r]; | |
92 | [v setTitle:wxCFStringRef( label).AsNSString() forState:UIControlStateNormal]; | |
93 | wxWidgetIPhoneImpl* c = new wxWidgetIPhoneImpl( wxpeer, v ); | |
94 | return c; | |
95 | } |