]> git.saurik.com Git - wxWidgets.git/blob - include/wx/osx/radiobox.h
Remove RPM .spec files from the repository.
[wxWidgets.git] / include / wx / osx / radiobox.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/osx/radiobox.h
3 // Purpose: wxRadioBox class
4 // Author: Stefan Csomor
5 // Modified by:
6 // Created: 1998-01-01
7 // Copyright: (c) Stefan Csomor
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_RADIOBOX_H_
12 #define _WX_RADIOBOX_H_
13
14 // List box item
15 class WXDLLIMPEXP_FWD_CORE wxBitmap ;
16
17 class WXDLLIMPEXP_FWD_CORE wxRadioButton ;
18
19 class WXDLLIMPEXP_CORE wxRadioBox: public wxControl, public wxRadioBoxBase
20 {
21 DECLARE_DYNAMIC_CLASS(wxRadioBox)
22 public:
23 // Constructors & destructor
24 wxRadioBox();
25 inline wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title,
26 const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
27 int n = 0, const wxString choices[] = NULL,
28 int majorDim = 0, long style = wxRA_SPECIFY_COLS,
29 const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr)
30 {
31 Create(parent, id, title, pos, size, n, choices, majorDim, style, val, name);
32 }
33 inline wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title,
34 const wxPoint& pos, const wxSize& size,
35 const wxArrayString& choices,
36 int majorDim = 0, long style = wxRA_SPECIFY_COLS,
37 const wxValidator& val = wxDefaultValidator,
38 const wxString& name = wxRadioBoxNameStr)
39 {
40 Create(parent, id, title, pos, size, choices,
41 majorDim, style, val, name);
42 }
43 virtual ~wxRadioBox();
44 bool Create(wxWindow *parent, wxWindowID id, const wxString& title,
45 const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
46 int n = 0, const wxString choices[] = NULL,
47 int majorDim = 0, long style = wxRA_SPECIFY_COLS,
48 const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr);
49 bool Create(wxWindow *parent, wxWindowID id, const wxString& title,
50 const wxPoint& pos, const wxSize& size,
51 const wxArrayString& choices,
52 int majorDim = 0, long style = wxRA_SPECIFY_COLS,
53 const wxValidator& val = wxDefaultValidator,
54 const wxString& name = wxRadioBoxNameStr);
55
56 // Enabling
57 virtual bool Enable(bool enable = true);
58 virtual bool Enable(unsigned int item, bool enable = true);
59 virtual bool IsItemEnabled(unsigned int item) const;
60
61 // Showing
62 virtual bool Show(bool show = true);
63 virtual bool Show(unsigned int item, bool show = true);
64 virtual bool IsItemShown(unsigned int item) const;
65
66 // Specific functions (in wxWidgets2 reference)
67 virtual void SetSelection(int item);
68 virtual int GetSelection() const;
69
70 virtual unsigned int GetCount() const { return m_noItems; }
71
72 virtual wxString GetString(unsigned int item) const;
73 virtual void SetString(unsigned int item, const wxString& label);
74
75 virtual wxString GetLabel() const;
76 virtual void SetLabel(const wxString& label) ;
77
78 // protect native font of box
79 virtual bool SetFont( const wxFont &font );
80 // Other external functions
81 void Command(wxCommandEvent& event);
82 void SetFocus();
83
84 // Other variable access functions
85 inline int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; }
86 inline void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; }
87
88 void OnRadioButton( wxCommandEvent& event ) ;
89
90 protected:
91 // resolve ambiguity in base classes
92 virtual wxBorder GetDefaultBorder() const { return wxRadioBoxBase::GetDefaultBorder(); }
93
94 wxRadioButton *m_radioButtonCycle;
95
96 unsigned int m_noItems;
97 int m_noRowsOrCols;
98
99 // Internal functions
100 virtual wxSize DoGetBestSize() const ;
101 virtual void DoSetSize(int x, int y,
102 int width, int height,
103 int sizeFlags = wxSIZE_AUTO);
104
105 DECLARE_EVENT_TABLE()
106 };
107
108 #endif
109 // _WX_RADIOBOX_H_