]> git.saurik.com Git - wxWidgets.git/blame - include/wx/cocoa/radiobox.h
Change GetC to return an int so that it can return wxEOF on error.
[wxWidgets.git] / include / wx / cocoa / radiobox.h
CommitLineData
da0634c1
DE
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/cocoa/radiobox.h
3// Purpose: wxRadioBox class
4// Author: David Elliott
5// Modified by:
6// Created: 2003/03/18
8228b893 7// RCS-ID: $Id$
da0634c1 8// Copyright: (c) 2003 David Elliott
1a87edf2 9// Licence: wxWindows licence
da0634c1
DE
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef __WX_COCOA_RADIOBOX_H__
13#define __WX_COCOA_RADIOBOX_H__
14
15// #include "wx/cocoa/NSButton.h"
16
17// ========================================================================
18// wxRadioBox
19// ========================================================================
20class WXDLLEXPORT wxRadioBox: public wxControl, public wxRadioBoxBase// , protected wxCocoaNSButton
21{
22 DECLARE_DYNAMIC_CLASS(wxRadioBox)
23 DECLARE_EVENT_TABLE()
24// WX_DECLARE_COCOA_OWNER(NSButton,NSControl,NSView)
25// ------------------------------------------------------------------------
26// initialization
27// ------------------------------------------------------------------------
28public:
29 wxRadioBox() { }
30 wxRadioBox(wxWindow *parent, wxWindowID winid,
31 const wxString& title,
32 const wxPoint& pos = wxDefaultPosition,
33 const wxSize& size = wxDefaultSize,
34 int n = 0, const wxString choices[] = NULL,
35 int majorDim = 0,
36 long style = 0, const wxValidator& validator = wxDefaultValidator,
37 const wxString& name = wxRadioBoxNameStr)
38 {
39 Create(parent, winid, title, pos, size, n, choices, majorDim, style, validator, name);
40 }
584ad2a3
MB
41 wxRadioBox(wxWindow *parent, wxWindowID winid,
42 const wxString& title,
43 const wxPoint& pos,
44 const wxSize& size,
45 const wxArrayString& choices,
46 int majorDim = 0,
47 long style = 0, const wxValidator& validator = wxDefaultValidator,
48 const wxString& name = wxRadioBoxNameStr)
49 {
50 Create(parent, winid, title, pos, size, choices, majorDim, style, validator, name);
51 }
da0634c1
DE
52
53 bool Create(wxWindow *parent, wxWindowID winid,
54 const wxString& title,
55 const wxPoint& pos = wxDefaultPosition,
56 const wxSize& size = wxDefaultSize,
57 int n = 0, const wxString choices[] = NULL,
58 int majorDim = 0,
59 long style = 0,
60 const wxValidator& validator = wxDefaultValidator,
61 const wxString& name = wxRadioBoxNameStr);
584ad2a3
MB
62 bool Create(wxWindow *parent, wxWindowID winid,
63 const wxString& title,
64 const wxPoint& pos,
65 const wxSize& size,
66 const wxArrayString& choices,
67 int majorDim = 0,
68 long style = 0,
69 const wxValidator& validator = wxDefaultValidator,
70 const wxString& name = wxRadioBoxNameStr);
da0634c1
DE
71 virtual ~wxRadioBox();
72
7a952d4c
WS
73 // Enabling
74 virtual bool Enable(unsigned int n, bool enable = true);
75 virtual bool IsItemEnabled(unsigned int WXUNUSED(n)) const
76 {
77 /* TODO */
78 return true;
79 }
80
81 // Showing
82 virtual bool Show(unsigned int n, bool show = true);
83 virtual bool IsItemShown(unsigned int WXUNUSED(n)) const
84 {
85 /* TODO */
86 return true;
87 }
88
da0634c1
DE
89// ------------------------------------------------------------------------
90// Cocoa callbacks
91// ------------------------------------------------------------------------
92protected:
1f4e6866
DE
93 // Static boxes cannot be enabled/disabled
94 virtual void CocoaSetEnabled(bool enable) { }
da0634c1
DE
95// ------------------------------------------------------------------------
96// Implementation
97// ------------------------------------------------------------------------
98public:
99// Pure virtuals
100 // selection
101 virtual void SetSelection(int n);
102 virtual int GetSelection() const;
103 // string access
aa61d352
VZ
104 virtual unsigned int GetCount() const;
105 virtual wxString GetString(unsigned int n) const;
106 virtual void SetString(unsigned int n, const wxString& label);
da0634c1 107 // change the individual radio button state
9a165f54
DE
108protected:
109 virtual wxSize DoGetBestSize() const;
da0634c1
DE
110};
111
112#endif // __WX_COCOA_RADIOBOX_H__