1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/osx/iphone/button.mm
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #include "wx/wxprec.h"
14 #include "wx/button.h"
18 #include "wx/toplevel.h"
19 #include "wx/dcclient.h"
22 #include "wx/stockitem.h"
24 #include "wx/osx/private.h"
26 @implementation wxUIButton
30 static BOOL initialized = NO;
34 wxOSXIPhoneClassAddWXMethods( self );
43 - (void) setIntValue: (int) v
50 wxWidgetImplType* wxWidgetImpl::CreateButton( wxWindowMac* wxpeer,
51 wxWindowMac* WXUNUSED(parent),
53 const wxString& WXUNUSED(label),
57 long WXUNUSED(extraStyle))
59 CGRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
60 UIButtonType buttonType = UIButtonTypeRoundedRect;
62 if ( id == wxID_HELP )
64 buttonType = UIButtonTypeInfoDark;
67 UIButton* v = [[UIButton buttonWithType:buttonType] retain];
69 wxWidgetIPhoneImpl* c = new wxWidgetIPhoneImpl( wxpeer, v );
73 void wxWidgetIPhoneImpl::SetDefaultButton( bool isDefault )
77 void wxWidgetIPhoneImpl::PerformClick()
81 wxWidgetImplType* wxWidgetImpl::CreateDisclosureTriangle( wxWindowMac* wxpeer,
82 wxWindowMac* WXUNUSED(parent),
83 wxWindowID WXUNUSED(id),
84 const wxString& label,
88 long WXUNUSED(extraStyle))
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 );