X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8907154c1a8a6882c6797d1f16393ddfb23e7f3a..d23ec02c6ab52f60349601be999bab4cf6acbdc4:/src/common/radiocmn.cpp diff --git a/src/common/radiocmn.cpp b/src/common/radiocmn.cpp index 9f4572fa6e..32adee107a 100644 --- a/src/common/radiocmn.cpp +++ b/src/common/radiocmn.cpp @@ -34,16 +34,24 @@ // implementation // ============================================================================ -int wxRadioBoxBase::FindString(const wxString& s) const +void wxRadioBoxBase::SetMajorDim(unsigned int majorDim, long style) { - int count = GetCount(); - for ( int n = 0; n < count; n++ ) + 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 ) { - if ( GetString(n) == s ) - return n; + m_numCols = majorDim; + m_numRows = minorDim; + } + else // wxRA_SPECIFY_ROWS + { + m_numCols = minorDim; + m_numRows = majorDim; } - - return wxNOT_FOUND; } int wxRadioBoxBase::GetNextItem(int item, wxDirection dir, long style) const @@ -156,24 +164,4 @@ void wxRadioBoxBase::SetNumberOfRowsOrCols(int WXUNUSED(n)) #endif // WXWIN_COMPATIBILITY_2_4 -#if WXWIN_COMPATIBILITY_2_2 - -int wxRadioBoxBase::Number() const -{ - return GetCount(); -} - -wxString wxRadioBoxBase::GetLabel(int n) const -{ - return GetString(n); -} - -void wxRadioBoxBase::SetLabel(int n, const wxString& label) -{ - SetString(n, label); -} - -#endif // WXWIN_COMPATIBILITY_2_2 - #endif // wxUSE_RADIOBOX -