]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/radiobox.mm
replace use of deprecated GtkPixmap, gtk_container_border_width
[wxWidgets.git] / src / cocoa / radiobox.mm
index 71b8994bad8f880546692d5e7db85a258442664d..a6e87e742f7dac6a851f09b467b418b0ff78cb1c 100644 (file)
@@ -1,22 +1,47 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        cocoa/radiobox.mm
+// Name:        src/cocoa/radiobox.mm
 // Purpose:     wxRadioBox
 // Author:      David Elliott
 // Modified by:
 // Created:     2003/02/15
-// RCS-ID:      $Id
+// RCS-ID:      $Id$
 // Copyright:   (c) 2003 David Elliott
-// Licence:    wxWindows license
+// Licence:     wxWidgets licence
 /////////////////////////////////////////////////////////////////////////////
 
-#include "wx/app.h"
+#include "wx/wxprec.h"
+
+#if wxUSE_RADIOBOX
+
 #include "wx/radiobox.h"
 
+#ifndef WX_PRECOMP
+    #include "wx/app.h"
+    #include "wx/arrstr.h"
+#endif //WX_PRECOMP
+
+#import <AppKit/NSView.h>
+
 IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl)
 BEGIN_EVENT_TABLE(wxRadioBox, wxControl)
 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,
@@ -28,15 +53,17 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID winid,
 {
     if(!CreateControl(parent,winid,pos,size,style,validator,name))
         return false;
-    m_cocoaNSView = NULL;
+    SetNSView([[NSView alloc] initWithFrame: MakeDefaultNSRect(size)]);
+    [m_cocoaNSView release];
     if(m_parent)
         m_parent->CocoaAddChild(this);
+    SetInitialFrameRect(pos,size);
+
     return true;
 }
 
 wxRadioBox::~wxRadioBox()
 {
-    CocoaRemoveFromParent();
 }
 
     // selection
@@ -50,37 +77,36 @@ int wxRadioBox::GetSelection() const
 }
 
     // string access
-int wxRadioBox::GetCount() const
+unsigned int wxRadioBox::GetCount() const
 {
     return 0;
 }
 
-wxString wxRadioBox::GetString(int n) const
+wxString wxRadioBox::GetString(unsigned int n) const
 {
     return wxEmptyString;
 }
 
-void wxRadioBox::SetString(int n, const wxString& label)
+void wxRadioBox::SetString(unsigned int n, const wxString& label)
 {
 }
 
     // change the individual radio button state
-void wxRadioBox::Enable(int n, bool enable)
+bool wxRadioBox::Enable(unsigned int n, bool enable)
 {
+    // TODO
+    return false;
 }
 
-void wxRadioBox::Show(int n, bool show)
+bool wxRadioBox::Show(unsigned int n, bool show)
 {
+    // TODO
+    return false;
 }
 
-    // layout parameters
-int wxRadioBox::GetColumnCount() const
+wxSize wxRadioBox::DoGetBestSize() const
 {
-    return 0;
-}
-
-int wxRadioBox::GetRowCount() const
-{
-    return 0;
+    return wxSize(50,50);
 }
 
+#endif