]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/combobox.mm
Use "&Help" so wxMac doesn't make an extra help menu
[wxWidgets.git] / src / cocoa / combobox.mm
index 19575440febbe3e45d7e2e7654ec85d96d29ad6b..8500a22382b4afebf4d5e2863c2fcf3b4f5106ed 100644 (file)
@@ -9,6 +9,10 @@
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
+#include "wx/wxprec.h"
+
+#if wxUSE_COMBOBOX
+
 #include "wx/app.h"
 #include "wx/combobox.h"
 #include "wx/log.h"
 #include "wx/app.h"
 #include "wx/combobox.h"
 #include "wx/log.h"
@@ -23,6 +27,21 @@ BEGIN_EVENT_TABLE(wxComboBox, wxTextCtrl)
 END_EVENT_TABLE()
 // WX_IMPLEMENT_COCOA_OWNER(wxComboBox,NSComboBox,NSTextField,NSView)
 
 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,
 bool wxComboBox::Create(wxWindow *parent, wxWindowID winid,
             const wxString& value,
             const wxPoint& pos,
@@ -37,12 +56,14 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID winid,
         return false;
 
     m_cocoaNSView = NULL;
         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);
     [m_cocoaNSView release];
     [GetNSTextField() setStringValue:wxNSStringWithWxString(value.c_str())];
     [GetNSControl() sizeToFit];
     if(m_parent)
         m_parent->CocoaAddChild(this);
+    SetInitialFrameRect(pos,size);
+
     return true;
 }
 
     return true;
 }
 
@@ -59,7 +80,7 @@ wxString wxComboBox::GetStringSelection()
     return wxEmptyString;
 }
 
     return wxEmptyString;
 }
 
-void wxComboBox::SetStringSelection(wxString& selection)
+void wxComboBox::SetStringSelection(const wxString& selection)
 {
 }
 
 {
 }
 
@@ -123,3 +144,4 @@ wxClientData* wxComboBox::DoGetItemClientObject(int) const
     return NULL;
 }
 
     return NULL;
 }
 
+#endif //wxUSE_COMBOBOX