]> git.saurik.com Git - wxWidgets.git/blame - include/wx/radiobox.h
Start/EndDrawingOnTop are still used under Motif, don't deprecate them
[wxWidgets.git] / include / wx / radiobox.h
CommitLineData
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
16cba29d 19extern 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 27class WXDLLEXPORT wxRadioBoxBase : public wxItemContainerImmutable
1e6feb95
VZ
28{
29public:
3bfa7be9 30 // change/query the individual radio button state
1a87edf2 31 virtual bool Enable(int n, bool enable = true) = 0;
789f6795 32 virtual bool Show(int n, bool show = true) = 0;
1e6feb95 33
3bfa7be9
VZ
34 // NB: these functions are stubbed here for now but should become pure
35 // virtual once all ports implement them
36 virtual bool IsItemEnabled(int WXUNUSED(n)) const { return true; }
37 virtual bool IsItemShown(int WXUNUSED(n)) const { return true; }
38
21e0a4d5
VZ
39 // return number of columns/rows in this radiobox
40 int GetColumnCount() const { return m_numCols; }
41 int GetRowCount() const { return m_numRows; }
1e6feb95
VZ
42
43 // return the item above/below/to the left/right of the given one
44 int GetNextItem(int item, wxDirection dir, long style) const;
45
3bfa7be9 46
bd0a76e2
VZ
47 // deprecated functions
48 // --------------------
49
50#if WXWIN_COMPATIBILITY_2_4
51 wxDEPRECATED( int GetNumberOfRowsOrCols() const );
52 wxDEPRECATED( void SetNumberOfRowsOrCols(int n) );
53#endif // WXWIN_COMPATIBILITY_2_4
21e0a4d5
VZ
54
55protected:
56 wxRadioBoxBase()
57 {
58 m_majorDim = 0;
59 }
60
61 // return the number of items in major direction (which depends on whether
62 // we have wxRA_SPECIFY_COLS or wxRA_SPECIFY_ROWS style)
63 int GetMajorDim() const { return m_majorDim; }
64
65 // sets m_majorDim and also updates m_numCols/Rows
66 //
67 // the style parameter should be the style of the radiobox itself
68 void SetMajorDim(int majorDim, long style);
69
70
71private:
72 // the number of elements in major dimension (i.e. number of columns if
73 // wxRA_SPECIFY_COLS or the number of rows if wxRA_SPECIFY_ROWS) and also
74 // the number of rows/columns calculated from it
75 int m_majorDim,
76 m_numCols,
77 m_numRows;
1e6feb95
VZ
78};
79
80#if defined(__WXUNIVERSAL__)
81 #include "wx/univ/radiobox.h"
82#elif defined(__WXMSW__)
83 #include "wx/msw/radiobox.h"
2049ba38 84#elif defined(__WXMOTIF__)
1e6feb95 85 #include "wx/motif/radiobox.h"
2049ba38 86#elif defined(__WXGTK__)
1e6feb95 87 #include "wx/gtk/radiobox.h"
34138703 88#elif defined(__WXMAC__)
1e6feb95 89 #include "wx/mac/radiobox.h"
e64df9bc
DE
90#elif defined(__WXCOCOA__)
91 #include "wx/cocoa/radiobox.h"
1777b9bb 92#elif defined(__WXPM__)
1e6feb95 93 #include "wx/os2/radiobox.h"
a152561c
WS
94#elif defined(__WXPALMOS__)
95 #include "wx/palmos/radiobox.h"
c801d85f
KB
96#endif
97
1e6feb95
VZ
98#endif // wxUSE_RADIOBOX
99
c801d85f 100#endif
34138703 101 // _WX_RADIOBOX_H_BASE_