1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxRadioBox declaration
4 // Author: Vadim Zeitlin
8 // Copyright: (c) wxWindows team
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_RADIOBOX_H_BASE_
13 #define _WX_RADIOBOX_H_BASE_
15 #if defined(__GNUG__) && !defined(__APPLE__)
16 #pragma interface "radioboxbase.h"
21 #include "wx/control.h"
23 WXDLLEXPORT_DATA(extern const wxChar
*) wxRadioBoxNameStr
;
25 // ----------------------------------------------------------------------------
26 // wxRadioBoxBase is not a normal base class, but rather a mix-in because the
27 // real wxRadioBox derives from different classes on different platforms: for
28 // example, it is a wxStaticBox in wxUniv but not in wxMSW
29 // ----------------------------------------------------------------------------
31 class WXDLLEXPORT wxRadioBoxBase
35 virtual void SetSelection(int n
) = 0;
36 virtual int GetSelection() const = 0;
38 virtual wxString
GetStringSelection() const
41 int sel
= GetSelection();
42 if ( sel
!= wxNOT_FOUND
)
48 virtual bool SetStringSelection(const wxString
& s
)
50 int sel
= FindString(s
);
51 if ( sel
!= wxNOT_FOUND
)
62 virtual int GetCount() const = 0;
63 virtual int FindString(const wxString
& s
) const
65 int count
= GetCount();
66 for ( int n
= 0; n
< count
; n
++ )
68 if ( GetString(n
) == s
)
75 virtual wxString
GetString(int n
) const = 0;
76 virtual void SetString(int n
, const wxString
& label
) = 0;
78 // change the individual radio button state
79 virtual void Enable(int n
, bool enable
= TRUE
) = 0;
80 virtual void Show(int n
, bool show
= TRUE
) = 0;
83 virtual int GetColumnCount() const = 0;
84 virtual int GetRowCount() const = 0;
86 // return the item above/below/to the left/right of the given one
87 int GetNextItem(int item
, wxDirection dir
, long style
) const;
89 // for compatibility only, don't use these methods in new code!
90 #if WXWIN_COMPATIBILITY_2_2
91 int Number() const { return GetCount(); }
92 wxString
GetLabel(int n
) const { return GetString(n
); }
93 void SetLabel(int n
, const wxString
& label
) { SetString(n
, label
); }
94 #endif // WXWIN_COMPATIBILITY_2_2
97 #if defined(__WXUNIVERSAL__)
98 #include "wx/univ/radiobox.h"
99 #elif defined(__WXMSW__)
100 #include "wx/msw/radiobox.h"
101 #elif defined(__WXMOTIF__)
102 #include "wx/motif/radiobox.h"
103 #elif defined(__WXGTK__)
104 #include "wx/gtk/radiobox.h"
105 #elif defined(__WXMAC__)
106 #include "wx/mac/radiobox.h"
107 #elif defined(__WXPM__)
108 #include "wx/os2/radiobox.h"
111 #endif // wxUSE_RADIOBOX
114 // _WX_RADIOBOX_H_BASE_