]> git.saurik.com Git - wxWidgets.git/blame - include/wx/cocoa/radiobox.h
Added include wx/timer.h to non WX_PRECOMP case.
[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"
9ed97552 16DECLARE_WXCOCOA_OBJC_CLASS(NSMatrix);
da0634c1
DE
17
18// ========================================================================
19// wxRadioBox
20// ========================================================================
21class WXDLLEXPORT wxRadioBox: public wxControl, public wxRadioBoxBase// , protected wxCocoaNSButton
22{
23 DECLARE_DYNAMIC_CLASS(wxRadioBox)
24 DECLARE_EVENT_TABLE()
9ed97552 25 WX_DECLARE_COCOA_OWNER(NSBox,NSView,NSView)
da0634c1
DE
26// ------------------------------------------------------------------------
27// initialization
28// ------------------------------------------------------------------------
29public:
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 }
584ad2a3
MB
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 }
da0634c1
DE
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);
584ad2a3
MB
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);
da0634c1
DE
72 virtual ~wxRadioBox();
73
7a952d4c
WS
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
da0634c1
DE
90// ------------------------------------------------------------------------
91// Cocoa callbacks
92// ------------------------------------------------------------------------
93protected:
1f4e6866
DE
94 // Static boxes cannot be enabled/disabled
95 virtual void CocoaSetEnabled(bool enable) { }
da0634c1
DE
96// ------------------------------------------------------------------------
97// Implementation
98// ------------------------------------------------------------------------
99public:
100// Pure virtuals
101 // selection
102 virtual void SetSelection(int n);
103 virtual int GetSelection() const;
104 // string access
aa61d352
VZ
105 virtual unsigned int GetCount() const;
106 virtual wxString GetString(unsigned int n) const;
107 virtual void SetString(unsigned int n, const wxString& label);
da0634c1 108 // change the individual radio button state
9a165f54 109protected:
9ed97552 110 WX_NSMatrix GetNSMatrix() const;
9a165f54 111 virtual wxSize DoGetBestSize() const;
da0634c1
DE
112};
113
114#endif // __WX_COCOA_RADIOBOX_H__