1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/osx/cocoa/combobox.mm
4 // Author: Stefan Csomor
7 // RCS-ID: $Id: combobox.mm 54129 2008-06-11 19:30:52Z SC $
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #include "wx/wxprec.h"
14 #if wxUSE_COMBOBOX && defined(wxOSX_USE_NATIVE_COMBOBOX)
16 #include "wx/combobox.h"
20 #include "wx/dcclient.h"
23 #include "wx/osx/private.h"
27 @interface wxNSComboBox : NSComboBox
33 @implementation wxNSComboBox
37 static BOOL initialized = NO;
41 wxOSXCocoaClassAddWXMethods( self );
47 return [self indexOfSelectedItem];
50 - (void) setIntValue: (int) v
52 [self selectItemAtIndex:v];
57 wxWidgetImplType* wxWidgetImpl::CreateComboBox( wxWindowMac* wxpeer,
58 wxWindowMac* WXUNUSED(parent),
59 wxWindowID WXUNUSED(id),
64 long WXUNUSED(extraStyle))
66 NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
67 wxNSComboBox* v = [[wxNSComboBox alloc] initWithFrame:r];
68 wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v );
72 #endif // wxUSE_COMBOBOX && defined(wxOSX_USE_NATIVE_COMBOBOX)