]> git.saurik.com Git - wxWidgets.git/blame_incremental - src/cocoa/radiobox.mm
[ 1509599 ] 'Split pickers page in widgets sample' with more icons and rebaking.
[wxWidgets.git] / src / cocoa / radiobox.mm
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: src/cocoa/radiobox.mm
3// Purpose: wxRadioBox
4// Author: David Elliott
5// Modified by:
6// Created: 2003/02/15
7// RCS-ID: $Id$
8// Copyright: (c) 2003 David Elliott
9// Licence: wxWidgets licence
10/////////////////////////////////////////////////////////////////////////////
11
12#include "wx/wxprec.h"
13
14#if wxUSE_RADIOBOX
15
16#include "wx/radiobox.h"
17
18#ifndef WX_PRECOMP
19 #include "wx/app.h"
20 #include "wx/arrstr.h"
21#endif //WX_PRECOMP
22
23#import <AppKit/NSView.h>
24
25IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl)
26BEGIN_EVENT_TABLE(wxRadioBox, wxControl)
27END_EVENT_TABLE()
28// WX_IMPLEMENT_COCOA_OWNER(wxRadioBox,NSTextField,NSControl,NSView)
29
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
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;
56 SetNSView([[NSView alloc] initWithFrame: MakeDefaultNSRect(size)]);
57 [m_cocoaNSView release];
58 if(m_parent)
59 m_parent->CocoaAddChild(this);
60 SetInitialFrameRect(pos,size);
61
62 return true;
63}
64
65wxRadioBox::~wxRadioBox()
66{
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
80unsigned int wxRadioBox::GetCount() const
81{
82 return 0;
83}
84
85wxString wxRadioBox::GetString(unsigned int n) const
86{
87 return wxEmptyString;
88}
89
90void wxRadioBox::SetString(unsigned int n, const wxString& label)
91{
92}
93
94 // change the individual radio button state
95bool wxRadioBox::Enable(unsigned int n, bool enable)
96{
97 // TODO
98 return false;
99}
100
101bool wxRadioBox::Show(unsigned int n, bool show)
102{
103 // TODO
104 return false;
105}
106
107wxSize wxRadioBox::DoGetBestSize() const
108{
109 return wxSize(50,50);
110}
111
112#endif