]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/radiobox.mm
Made all of the GNOME print support based
[wxWidgets.git] / src / cocoa / radiobox.mm
index 397829a6fd434f825f38b90834ca4e6eea67e909..63528324771a471f1af19034517be84781cd7559 100644 (file)
@@ -6,11 +6,15 @@
 // Created:     2003/02/15
 // RCS-ID:      $Id: 
 // Copyright:   (c) 2003 David Elliott
 // Created:     2003/02/15
 // RCS-ID:      $Id: 
 // Copyright:   (c) 2003 David Elliott
-// Licence:    wxWindows license
+// Licence:    wxWidgets licence
 /////////////////////////////////////////////////////////////////////////////
 
 /////////////////////////////////////////////////////////////////////////////
 
-#include "wx/app.h"
-#include "wx/radiobox.h"
+#include "wx/wxprec.h"
+#ifndef WX_PRECOMP
+    #include "wx/app.h"
+    #include "wx/radiobox.h"
+    #include "wx/arrstr.h"
+#endif //WX_PRECOMP
 
 #import <AppKit/NSView.h>
 
 
 #import <AppKit/NSView.h>
 
@@ -19,6 +23,21 @@ BEGIN_EVENT_TABLE(wxRadioBox, wxControl)
 END_EVENT_TABLE()
 // WX_IMPLEMENT_COCOA_OWNER(wxRadioBox,NSTextField,NSControl,NSView)
 
 END_EVENT_TABLE()
 // WX_IMPLEMENT_COCOA_OWNER(wxRadioBox,NSTextField,NSControl,NSView)
 
+bool wxRadioBox::Create(wxWindow *parent, wxWindowID winid,
+            const wxString& title,
+            const wxPoint& pos,
+            const wxSize& size,
+            const wxArrayString& choices,
+            int majorDim,
+            long style, const wxValidator& validator,
+            const wxString& name)
+{
+    wxCArrayString chs(choices);
+
+    return Create(parent, winid, title, pos, size, chs.GetCount(),
+                  chs.GetStrings(), majorDim, style, validator, name);
+}
+
 bool wxRadioBox::Create(wxWindow *parent, wxWindowID winid,
             const wxString& title,
             const wxPoint& pos,
 bool wxRadioBox::Create(wxWindow *parent, wxWindowID winid,
             const wxString& title,
             const wxPoint& pos,
@@ -30,17 +49,17 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID winid,
 {
     if(!CreateControl(parent,winid,pos,size,style,validator,name))
         return false;
 {
     if(!CreateControl(parent,winid,pos,size,style,validator,name))
         return false;
-    SetNSView([[NSView alloc] initWithFrame: NSMakeRect(10,10,20,20)]);
+    SetNSView([[NSView alloc] initWithFrame: MakeDefaultNSRect(size)]);
     [m_cocoaNSView release];
     if(m_parent)
         m_parent->CocoaAddChild(this);
     [m_cocoaNSView release];
     if(m_parent)
         m_parent->CocoaAddChild(this);
+    SetInitialFrameRect(pos,size);
+
     return true;
 }
 
 wxRadioBox::~wxRadioBox()
 {
     return true;
 }
 
 wxRadioBox::~wxRadioBox()
 {
-    CocoaRemoveFromParent();
-    SetNSView(NULL);
 }
 
     // selection
 }
 
     // selection
@@ -88,3 +107,8 @@ int wxRadioBox::GetRowCount() const
     return 0;
 }
 
     return 0;
 }
 
+wxSize wxRadioBox::DoGetBestSize() const
+{
+    return wxSize(50,50);
+}
+