]>
Commit | Line | Data |
---|---|---|
f033830e SC |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: src/osx/cocoa/tglbtn.mm | |
3 | // Purpose: Definition of the wxToggleButton class, which implements a | |
4 | // toggle button under wxMac. | |
5 | // Author: Stefan Csomor | |
6 | // Modified by: | |
7 | // Created: 08.02.01 | |
8 | // RCS-ID: $Id: tglbtn.cpp 54129 2008-06-11 19:30:52Z SC $ | |
9 | // Copyright: (c) Stefan Csomor | |
10 | // License: wxWindows license | |
11 | ///////////////////////////////////////////////////////////////////////////// | |
12 | ||
13 | // ============================================================================ | |
14 | // declatations | |
15 | // ============================================================================ | |
16 | ||
17 | // ---------------------------------------------------------------------------- | |
18 | // headers | |
19 | // ---------------------------------------------------------------------------- | |
20 | ||
21 | #include "wx/wxprec.h" | |
22 | ||
23 | #if wxUSE_TOGGLEBTN | |
24 | ||
25 | #include "wx/tglbtn.h" | |
26 | #include "wx/osx/private.h" | |
27 | ||
03647350 VZ |
28 | wxWidgetImplType* wxWidgetImpl::CreateToggleButton( wxWindowMac* wxpeer, |
29 | wxWindowMac* WXUNUSED(parent), | |
30 | wxWindowID WXUNUSED(id), | |
d8207702 | 31 | const wxString& WXUNUSED(label), |
03647350 | 32 | const wxPoint& pos, |
f033830e | 33 | const wxSize& size, |
03647350 | 34 | long WXUNUSED(style), |
d8207702 | 35 | long WXUNUSED(extraStyle)) |
f033830e | 36 | { |
dbeddfb9 | 37 | NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ; |
f033830e | 38 | wxNSButton* v = [[wxNSButton alloc] initWithFrame:r]; |
03647350 VZ |
39 | |
40 | [v setBezelStyle:NSSmallSquareBezelStyle]; | |
f033830e | 41 | [v setButtonType:NSOnOffButton]; |
f033830e | 42 | wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v ); |
f033830e SC |
43 | return c; |
44 | } | |
45 | ||
03647350 VZ |
46 | wxWidgetImplType* wxWidgetImpl::CreateBitmapToggleButton( wxWindowMac* wxpeer, |
47 | wxWindowMac* WXUNUSED(parent), | |
48 | wxWindowID WXUNUSED(id), | |
d8207702 | 49 | const wxBitmap& WXUNUSED(label), |
03647350 | 50 | const wxPoint& pos, |
f033830e | 51 | const wxSize& size, |
03647350 | 52 | long WXUNUSED(style), |
d8207702 | 53 | long WXUNUSED(extraStyle)) |
03647350 | 54 | { |
dbeddfb9 | 55 | NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ; |
f033830e | 56 | wxNSButton* v = [[wxNSButton alloc] initWithFrame:r]; |
03647350 | 57 | |
f033830e SC |
58 | [v setBezelStyle:NSRegularSquareBezelStyle]; |
59 | [v setButtonType:NSOnOffButton]; | |
f033830e | 60 | wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v ); |
f033830e SC |
61 | return c; |
62 | } | |
63 | ||
64 | #endif // wxUSE_TOGGLEBTN | |
65 |