1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/osx/iphone/button.mm
4 // Author: Stefan Csomor
7 // Copyright: (c) Stefan Csomor
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #include "wx/wxprec.h"
13 #include "wx/button.h"
17 #include "wx/toplevel.h"
18 #include "wx/dcclient.h"
21 #include "wx/stockitem.h"
23 #include "wx/osx/private.h"
25 @implementation wxUIButton
29 static BOOL initialized = NO;
33 wxOSXIPhoneClassAddWXMethods( self );
42 - (void) setIntValue: (int) v
49 wxWidgetImplType* wxWidgetImpl::CreateButton( wxWindowMac* wxpeer,
50 wxWindowMac* WXUNUSED(parent),
52 const wxString& WXUNUSED(label),
56 long WXUNUSED(extraStyle))
58 CGRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
59 UIButtonType buttonType = UIButtonTypeRoundedRect;
61 if ( id == wxID_HELP )
63 buttonType = UIButtonTypeInfoDark;
66 UIButton* v = [[UIButton buttonWithType:buttonType] retain];
68 wxWidgetIPhoneImpl* c = new wxWidgetIPhoneImpl( wxpeer, v );
72 void wxWidgetIPhoneImpl::SetDefaultButton( bool isDefault )
76 void wxWidgetIPhoneImpl::PerformClick()
80 wxWidgetImplType* wxWidgetImpl::CreateDisclosureTriangle( wxWindowMac* wxpeer,
81 wxWindowMac* WXUNUSED(parent),
82 wxWindowID WXUNUSED(id),
83 const wxString& label,
87 long WXUNUSED(extraStyle))
89 CGRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
90 wxUIButton* v = [[wxUIButton alloc] initWithFrame:r];
91 [v setTitle:wxCFStringRef( label).AsNSString() forState:UIControlStateNormal];
92 wxWidgetIPhoneImpl* c = new wxWidgetIPhoneImpl( wxpeer, v );