X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e421922f90186d0619a806d277a0a2182e61b5fb..bd1a4a99fc1bec4ac5d0b14379dc5345d6ce3253:/src/common/radiocmn.cpp diff --git a/src/common/radiocmn.cpp b/src/common/radiocmn.cpp index 2c91443928..0d2851632f 100644 --- a/src/common/radiocmn.cpp +++ b/src/common/radiocmn.cpp @@ -6,7 +6,7 @@ // Created: 03.06.01 // RCS-ID: $Id$ // Copyright: (c) 2001 Vadim Zeitlin -// License: wxWindows license +// License: wxWindows licence /////////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -17,10 +17,6 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ - #pragma implementation "radioboxbase.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -38,6 +34,26 @@ // implementation // ============================================================================ +void wxRadioBoxBase::SetMajorDim(int majorDim, long style) +{ + wxCHECK_RET( majorDim != 0, _T("major radiobox dimension can't be 0") ); + + m_majorDim = majorDim; + + int minorDim = (GetCount() + m_majorDim - 1) / m_majorDim; + + if ( style & wxRA_SPECIFY_COLS ) + { + m_numCols = majorDim; + m_numRows = minorDim; + } + else // wxRA_SPECIFY_ROWS + { + m_numCols = minorDim; + m_numRows = majorDim; + } +} + int wxRadioBoxBase::GetNextItem(int item, wxDirection dir, long style) const { int count = GetCount(), @@ -98,7 +114,7 @@ int wxRadioBoxBase::GetNextItem(int item, wxDirection dir, long style) const default: wxFAIL_MSG( _T("unexpected wxDirection value") ); - return -1; + return wxNOT_FOUND; } // ensure that the item is in range [0..count) @@ -134,5 +150,18 @@ int wxRadioBoxBase::GetNextItem(int item, wxDirection dir, long style) const return item; } -#endif // wxUSE_RADIOBOX +#if WXWIN_COMPATIBILITY_2_4 + +// these functions are deprecated and don't do anything +int wxRadioBoxBase::GetNumberOfRowsOrCols() const +{ + return 1; +} +void wxRadioBoxBase::SetNumberOfRowsOrCols(int WXUNUSED(n)) +{ +} + +#endif // WXWIN_COMPATIBILITY_2_4 + +#endif // wxUSE_RADIOBOX