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