X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dee1a63ff52bfe4da396187f8438aa1a29796737..d23ec02c6ab52f60349601be999bab4cf6acbdc4:/src/common/radiocmn.cpp diff --git a/src/common/radiocmn.cpp b/src/common/radiocmn.cpp index 9c759147e8..32adee107a 100644 --- a/src/common/radiocmn.cpp +++ b/src/common/radiocmn.cpp @@ -34,6 +34,26 @@ // implementation // ============================================================================ +void wxRadioBoxBase::SetMajorDim(unsigned 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(),