X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e92ea6291662dd0044f4469bcea03e3040a48f7d..31ad423e4fb556ec225a63b161154d3bf3445c1b:/src/cocoa/combobox.mm diff --git a/src/cocoa/combobox.mm b/src/cocoa/combobox.mm index eb3f4b104f..e016e89205 100644 --- a/src/cocoa/combobox.mm +++ b/src/cocoa/combobox.mm @@ -6,7 +6,7 @@ // Created: 2003/07/14 // RCS-ID: $Id$ // Copyright: (c) 2003 David Elliott -// Licence: wxWindows licence +// Licence: wxWidgets licence ///////////////////////////////////////////////////////////////////////////// #include "wx/wxprec.h" @@ -27,6 +27,21 @@ BEGIN_EVENT_TABLE(wxComboBox, wxTextCtrl) END_EVENT_TABLE() // WX_IMPLEMENT_COCOA_OWNER(wxComboBox,NSComboBox,NSTextField,NSView) +bool wxComboBox::Create(wxWindow *parent, wxWindowID winid, + const wxString& value, + const wxPoint& pos, + const wxSize& size, + const wxArrayString& choices, + long style, + const wxValidator& validator, + const wxString& name) +{ + wxCArrayString chs(choices); + + return Create(parent, winid, value, pos, size, chs.GetCount(), + chs.GetStrings(), style, validator, name); +} + bool wxComboBox::Create(wxWindow *parent, wxWindowID winid, const wxString& value, const wxPoint& pos, @@ -41,12 +56,14 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID winid, return false; m_cocoaNSView = NULL; - SetNSTextField([[NSComboBox alloc] initWithFrame:NSMakeRect(0,0,30,30)]); + SetNSTextField([[NSComboBox alloc] initWithFrame:MakeDefaultNSRect(size)]); [m_cocoaNSView release]; [GetNSTextField() setStringValue:wxNSStringWithWxString(value.c_str())]; [GetNSControl() sizeToFit]; if(m_parent) m_parent->CocoaAddChild(this); + SetInitialFrameRect(pos,size); + return true; }