1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/osx/radiobox.h
3 // Purpose: wxRadioBox class
4 // Author: Stefan Csomor
7 // Copyright: (c) Stefan Csomor
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_RADIOBOX_H_
12 #define _WX_RADIOBOX_H_
15 class WXDLLIMPEXP_FWD_CORE wxBitmap
;
17 class WXDLLIMPEXP_FWD_CORE wxRadioButton
;
19 class WXDLLIMPEXP_CORE wxRadioBox
: public wxControl
, public wxRadioBoxBase
21 DECLARE_DYNAMIC_CLASS(wxRadioBox
)
23 // Constructors & destructor
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
)
31 Create(parent
, id
, title
, pos
, size
, n
, choices
, majorDim
, style
, val
, name
);
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
)
40 Create(parent
, id
, title
, pos
, size
, choices
,
41 majorDim
, style
, val
, name
);
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
);
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;
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;
66 // Specific functions (in wxWidgets2 reference)
67 virtual void SetSelection(int item
);
68 virtual int GetSelection() const;
70 virtual unsigned int GetCount() const { return m_noItems
; }
72 virtual wxString
GetString(unsigned int item
) const;
73 virtual void SetString(unsigned int item
, const wxString
& label
);
75 virtual wxString
GetLabel() const;
76 virtual void SetLabel(const wxString
& label
) ;
78 // protect native font of box
79 virtual bool SetFont( const wxFont
&font
);
80 // Other external functions
81 void Command(wxCommandEvent
& event
);
84 // Other variable access functions
85 inline int GetNumberOfRowsOrCols() const { return m_noRowsOrCols
; }
86 inline void SetNumberOfRowsOrCols(int n
) { m_noRowsOrCols
= n
; }
88 void OnRadioButton( wxCommandEvent
& event
) ;
91 // resolve ambiguity in base classes
92 virtual wxBorder
GetDefaultBorder() const { return wxRadioBoxBase::GetDefaultBorder(); }
94 wxRadioButton
*m_radioButtonCycle
;
96 unsigned int m_noItems
;
100 virtual wxSize
DoGetBestSize() const ;
101 virtual void DoSetSize(int x
, int y
,
102 int width
, int height
,
103 int sizeFlags
= wxSIZE_AUTO
);
105 DECLARE_EVENT_TABLE()