]> git.saurik.com Git - wxWidgets.git/blame - src/osx/iphone/button.mm
avoid setting initial position if it was not specified, broken in r70734
[wxWidgets.git] / src / osx / iphone / button.mm
CommitLineData
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
0c2dc57d
SC
7// Copyright: (c) Stefan Csomor
8// Licence: wxWindows licence
9/////////////////////////////////////////////////////////////////////////////
10
11#include "wx/wxprec.h"
12
13#include "wx/button.h"
14
15#ifndef WX_PRECOMP
16 #include "wx/panel.h"
17 #include "wx/toplevel.h"
18 #include "wx/dcclient.h"
19#endif
20
21#include "wx/stockitem.h"
22
23#include "wx/osx/private.h"
24
0c2dc57d
SC
25@implementation wxUIButton
26
27+ (void)initialize
28{
29 static BOOL initialized = NO;
03647350 30 if (!initialized)
0c2dc57d
SC
31 {
32 initialized = YES;
33 wxOSXIPhoneClassAddWXMethods( self );
34 }
35}
36
37- (int) intValue
38{
39 return 0;
40}
41
42- (void) setIntValue: (int) v
43{
44}
45
46@end
47
48
03647350
VZ
49wxWidgetImplType* wxWidgetImpl::CreateButton( wxWindowMac* wxpeer,
50 wxWindowMac* WXUNUSED(parent),
51 wxWindowID id,
0c2dc57d 52 const wxString& WXUNUSED(label),
03647350 53 const wxPoint& pos,
0c2dc57d 54 const wxSize& size,
03647350
VZ
55 long WXUNUSED(style),
56 long WXUNUSED(extraStyle))
0c2dc57d
SC
57{
58 CGRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
59 UIButtonType buttonType = UIButtonTypeRoundedRect;
60
61 if ( id == wxID_HELP )
62 {
63 buttonType = UIButtonTypeInfoDark;
64 }
65
66 UIButton* v = [[UIButton buttonWithType:buttonType] retain];
67 v.frame = r;
68 wxWidgetIPhoneImpl* c = new wxWidgetIPhoneImpl( wxpeer, v );
69 return c;
0c2dc57d
SC
70}
71
72void wxWidgetIPhoneImpl::SetDefaultButton( bool isDefault )
03647350 73{
0c2dc57d
SC
74}
75
03647350 76void wxWidgetIPhoneImpl::PerformClick()
0c2dc57d
SC
77{
78}
79
03647350
VZ
80wxWidgetImplType* wxWidgetImpl::CreateDisclosureTriangle( wxWindowMac* wxpeer,
81 wxWindowMac* WXUNUSED(parent),
82 wxWindowID WXUNUSED(id),
0c2dc57d 83 const wxString& label,
03647350 84 const wxPoint& pos,
0c2dc57d 85 const wxSize& size,
03647350
VZ
86 long WXUNUSED(style),
87 long WXUNUSED(extraStyle))
0c2dc57d
SC
88{
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 );
93 return c;
94}