]>
Commit | Line | Data |
---|---|---|
1e6feb95 VZ |
1 | /////////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/radiobox.h | |
3 | // Purpose: wxRadioBox declaration | |
4 | // Author: Vadim Zeitlin | |
5 | // Modified by: | |
6 | // Created: 10.09.00 | |
7 | // RCS-ID: $Id$ | |
99d80019 | 8 | // Copyright: (c) Vadim Zeitlin |
65571936 | 9 | // Licence: wxWindows licence |
1e6feb95 VZ |
10 | /////////////////////////////////////////////////////////////////////////////// |
11 | ||
34138703 JS |
12 | #ifndef _WX_RADIOBOX_H_BASE_ |
13 | #define _WX_RADIOBOX_H_BASE_ | |
c801d85f | 14 | |
1e6feb95 VZ |
15 | #if wxUSE_RADIOBOX |
16 | ||
8ba7c771 | 17 | #include "wx/ctrlsub.h" |
1e6feb95 | 18 | |
63ec432b | 19 | extern WXDLLEXPORT_DATA(const wxChar) wxRadioBoxNameStr[]; |
1e6feb95 VZ |
20 | |
21 | // ---------------------------------------------------------------------------- | |
22 | // wxRadioBoxBase is not a normal base class, but rather a mix-in because the | |
23 | // real wxRadioBox derives from different classes on different platforms: for | |
aca49b79 | 24 | // example, it is a wxStaticBox in wxUniv and wxMSW but not in other ports |
1e6feb95 VZ |
25 | // ---------------------------------------------------------------------------- |
26 | ||
8ba7c771 | 27 | class WXDLLEXPORT wxRadioBoxBase : public wxItemContainerImmutable |
1e6feb95 VZ |
28 | { |
29 | public: | |
3bfa7be9 | 30 | // change/query the individual radio button state |
aa61d352 VZ |
31 | virtual bool Enable(unsigned int n, bool enable = true) = 0; |
32 | virtual bool Show(unsigned int n, bool show = true) = 0; | |
7a952d4c WS |
33 | virtual bool IsItemEnabled(unsigned int n) const = 0; |
34 | virtual bool IsItemShown(unsigned int n) const = 0; | |
3bfa7be9 | 35 | |
21e0a4d5 | 36 | // return number of columns/rows in this radiobox |
aa61d352 VZ |
37 | unsigned int GetColumnCount() const { return m_numCols; } |
38 | unsigned int GetRowCount() const { return m_numRows; } | |
1e6feb95 VZ |
39 | |
40 | // return the item above/below/to the left/right of the given one | |
41 | int GetNextItem(int item, wxDirection dir, long style) const; | |
42 | ||
3bfa7be9 | 43 | |
bd0a76e2 VZ |
44 | // deprecated functions |
45 | // -------------------- | |
46 | ||
47 | #if WXWIN_COMPATIBILITY_2_4 | |
48 | wxDEPRECATED( int GetNumberOfRowsOrCols() const ); | |
49 | wxDEPRECATED( void SetNumberOfRowsOrCols(int n) ); | |
50 | #endif // WXWIN_COMPATIBILITY_2_4 | |
21e0a4d5 VZ |
51 | |
52 | protected: | |
53 | wxRadioBoxBase() | |
54 | { | |
55 | m_majorDim = 0; | |
56 | } | |
57 | ||
58 | // return the number of items in major direction (which depends on whether | |
59 | // we have wxRA_SPECIFY_COLS or wxRA_SPECIFY_ROWS style) | |
aa61d352 | 60 | unsigned int GetMajorDim() const { return m_majorDim; } |
21e0a4d5 VZ |
61 | |
62 | // sets m_majorDim and also updates m_numCols/Rows | |
63 | // | |
64 | // the style parameter should be the style of the radiobox itself | |
aa61d352 | 65 | void SetMajorDim(unsigned int majorDim, long style); |
21e0a4d5 VZ |
66 | |
67 | ||
68 | private: | |
69 | // the number of elements in major dimension (i.e. number of columns if | |
70 | // wxRA_SPECIFY_COLS or the number of rows if wxRA_SPECIFY_ROWS) and also | |
71 | // the number of rows/columns calculated from it | |
aa61d352 VZ |
72 | unsigned int m_majorDim, |
73 | m_numCols, | |
74 | m_numRows; | |
1e6feb95 VZ |
75 | }; |
76 | ||
77 | #if defined(__WXUNIVERSAL__) | |
78 | #include "wx/univ/radiobox.h" | |
79 | #elif defined(__WXMSW__) | |
80 | #include "wx/msw/radiobox.h" | |
2049ba38 | 81 | #elif defined(__WXMOTIF__) |
1e6feb95 | 82 | #include "wx/motif/radiobox.h" |
1be7a35c | 83 | #elif defined(__WXGTK20__) |
1e6feb95 | 84 | #include "wx/gtk/radiobox.h" |
1be7a35c MR |
85 | #elif defined(__WXGTK__) |
86 | #include "wx/gtk1/radiobox.h" | |
34138703 | 87 | #elif defined(__WXMAC__) |
1e6feb95 | 88 | #include "wx/mac/radiobox.h" |
e64df9bc DE |
89 | #elif defined(__WXCOCOA__) |
90 | #include "wx/cocoa/radiobox.h" | |
1777b9bb | 91 | #elif defined(__WXPM__) |
1e6feb95 | 92 | #include "wx/os2/radiobox.h" |
a152561c WS |
93 | #elif defined(__WXPALMOS__) |
94 | #include "wx/palmos/radiobox.h" | |
c801d85f KB |
95 | #endif |
96 | ||
1e6feb95 VZ |
97 | #endif // wxUSE_RADIOBOX |
98 | ||
c801d85f | 99 | #endif |
34138703 | 100 | // _WX_RADIOBOX_H_BASE_ |