adding bitmap button implementation to ios

This commit is contained in:
Stefan Csomor
2020-04-26 11:54:04 +02:00
parent 9f3ad89ba9
commit 68b22e65b8

View File

@@ -92,3 +92,30 @@ wxWidgetImplType* wxWidgetImpl::CreateDisclosureTriangle( wxWindowMac* wxpeer,
wxWidgetIPhoneImpl* c = new wxWidgetIPhoneImpl( wxpeer, v );
return c;
}
#if wxUSE_BMPBUTTON
wxWidgetImplType* wxWidgetImpl::CreateBitmapButton( wxWindowMac* wxpeer,
wxWindowMac* WXUNUSED(parent),
wxWindowID winid,
const wxBitmap& bitmap,
const wxPoint& pos,
const wxSize& size,
long style,
long WXUNUSED(extraStyle))
{
CGRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
UIButtonType buttonType = UIButtonTypeRoundedRect;
UIButton* v = [[UIButton buttonWithType:buttonType] retain];
v.frame = r;
if (bitmap.IsOk())
[v setImage:bitmap.GetImage() forState:UIControlStateNormal];
wxWidgetIPhoneImpl* c = new wxWidgetIPhoneImpl( wxpeer, v );
return c;
}
#endif // wxUSE_BMPBUTTON