]>
Commit | Line | Data |
---|---|---|
f033830e | 1 | ///////////////////////////////////////////////////////////////////////////// |
0f9b48d1 | 2 | // Name: src/osx/carbon/bmpbuttn.cpp |
f033830e SC |
3 | // Purpose: wxBitmapButton |
4 | // Author: Stefan Csomor | |
5 | // Modified by: | |
6 | // Created: 1998-01-01 | |
7 | // RCS-ID: $Id: bmpbuttn.cpp 54820 2008-07-29 20:04:11Z SC $ | |
8 | // Copyright: (c) Stefan Csomor | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #include "wx/wxprec.h" | |
13 | ||
14 | #if wxUSE_BMPBUTTON | |
15 | ||
16 | #include "wx/bmpbuttn.h" | |
17 | #include "wx/image.h" | |
18 | ||
19 | #ifndef WX_PRECOMP | |
20 | #include "wx/dcmemory.h" | |
21 | #endif | |
22 | ||
23 | #include "wx/osx/private.h" | |
24 | ||
25 | wxWidgetImplType* wxWidgetImpl::CreateBitmapButton( wxWindowMac* wxpeer, | |
26 | wxWindowMac* parent, | |
27 | wxWindowID id, | |
28 | const wxBitmap& bitmap, | |
29 | const wxPoint& pos, | |
30 | const wxSize& size, | |
31 | long style, | |
32 | long extraStyle) | |
33 | { | |
36eca861 | 34 | NSView* sv = static_cast<NSView*>(wxpeer->GetParent()->GetHandle() ); |
f033830e | 35 | |
dbeddfb9 | 36 | NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ; |
f033830e SC |
37 | wxNSButton* v = [[wxNSButton alloc] initWithFrame:r]; |
38 | ||
39 | [v setBezelStyle:NSRegularSquareBezelStyle]; | |
0f9b48d1 | 40 | [v setImage:bitmap.GetNSImage() ]; |
f033830e SC |
41 | [v setButtonType:NSMomentaryPushInButton]; |
42 | [sv addSubview:v]; | |
43 | wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v ); | |
44 | [v setImplementation:c]; | |
45 | return c; | |
46 | } | |
47 | ||
48 | #endif |