]> git.saurik.com Git - wxWidgets.git/blame - src/cocoa/radiobox.mm
more woodoo in DoGetBestSize() to get rid of tree borders for default-sizes controls
[wxWidgets.git] / src / cocoa / radiobox.mm
CommitLineData
da0634c1 1/////////////////////////////////////////////////////////////////////////////
8228b893 2// Name: src/cocoa/radiobox.mm
da0634c1
DE
3// Purpose: wxRadioBox
4// Author: David Elliott
5// Modified by:
6// Created: 2003/02/15
8228b893 7// RCS-ID: $Id$
da0634c1 8// Copyright: (c) 2003 David Elliott
1a87edf2 9// Licence: wxWidgets licence
da0634c1
DE
10/////////////////////////////////////////////////////////////////////////////
11
449c5673 12#include "wx/wxprec.h"
16c81607
RN
13
14#if wxUSE_RADIOBOX
15
cc11cc69
WS
16#include "wx/radiobox.h"
17
449c5673
DE
18#ifndef WX_PRECOMP
19 #include "wx/app.h"
584ad2a3 20 #include "wx/arrstr.h"
449c5673 21#endif //WX_PRECOMP
da0634c1 22
548dd93d
DE
23#import <AppKit/NSView.h>
24
da0634c1
DE
25IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl)
26BEGIN_EVENT_TABLE(wxRadioBox, wxControl)
27END_EVENT_TABLE()
28// WX_IMPLEMENT_COCOA_OWNER(wxRadioBox,NSTextField,NSControl,NSView)
29
584ad2a3
MB
30bool wxRadioBox::Create(wxWindow *parent, wxWindowID winid,
31 const wxString& title,
32 const wxPoint& pos,
33 const wxSize& size,
34 const wxArrayString& choices,
35 int majorDim,
36 long style, const wxValidator& validator,
37 const wxString& name)
38{
39 wxCArrayString chs(choices);
40
41 return Create(parent, winid, title, pos, size, chs.GetCount(),
42 chs.GetStrings(), majorDim, style, validator, name);
43}
44
da0634c1
DE
45bool wxRadioBox::Create(wxWindow *parent, wxWindowID winid,
46 const wxString& title,
47 const wxPoint& pos,
48 const wxSize& size,
49 int n, const wxString choices[],
50 int majorDim,
51 long style, const wxValidator& validator,
52 const wxString& name)
53{
54 if(!CreateControl(parent,winid,pos,size,style,validator,name))
55 return false;
8d656ea9 56 SetNSView([[NSView alloc] initWithFrame: MakeDefaultNSRect(size)]);
548dd93d 57 [m_cocoaNSView release];
da0634c1
DE
58 if(m_parent)
59 m_parent->CocoaAddChild(this);
8d656ea9
DE
60 SetInitialFrameRect(pos,size);
61
da0634c1
DE
62 return true;
63}
64
65wxRadioBox::~wxRadioBox()
66{
da0634c1
DE
67}
68
69 // selection
70void wxRadioBox::SetSelection(int n)
71{
72}
73
74int wxRadioBox::GetSelection() const
75{
76 return 0;
77}
78
79 // string access
aa61d352 80unsigned int wxRadioBox::GetCount() const
da0634c1
DE
81{
82 return 0;
83}
84
aa61d352 85wxString wxRadioBox::GetString(unsigned int n) const
da0634c1
DE
86{
87 return wxEmptyString;
88}
89
aa61d352 90void wxRadioBox::SetString(unsigned int n, const wxString& label)
da0634c1
DE
91{
92}
93
94 // change the individual radio button state
aa61d352 95bool wxRadioBox::Enable(unsigned int n, bool enable)
da0634c1 96{
1a87edf2
WS
97 // TODO
98 return false;
da0634c1
DE
99}
100
aa61d352 101bool wxRadioBox::Show(unsigned int n, bool show)
da0634c1 102{
789f6795
WS
103 // TODO
104 return false;
da0634c1
DE
105}
106
9a165f54
DE
107wxSize wxRadioBox::DoGetBestSize() const
108{
109 return wxSize(50,50);
110}
111
16c81607 112#endif