- wxASSERT_MSG( number >= 0, _T("negative number of fields in wxStatusBar?") );
-
- // enlarge the m_statusStrings array if needed:
- for (size_t i = m_panes.GetCount(); i < (size_t)number; ++i)
- m_statusStrings.Add( wxEmptyString );
-
- // shrink the m_statusStrings array if needed:
- for (int j = (int)m_panes.GetCount() - 1; j >= number; --j)
- m_statusStrings.RemoveAt(j);
-
- // forget the old cached pixel widths
- m_widthsAbs.Empty();
-
- wxStatusBarBase::SetFieldsCount(number, widths);
-
- wxASSERT_MSG( m_panes.GetCount() == m_statusStrings.GetCount(),
- _T("This really should never happen, can we do away with m_panes.GetCount() here?") );
-}
-
-void wxStatusBarGeneric::SetStatusText(const wxString& text, int number)
-{
- wxCHECK_RET( (number >= 0) && ((size_t)number < m_panes.GetCount()),
- _T("invalid status bar field index") );
-
- wxString oldText = m_statusStrings[number];
- if (oldText != text)
- {
- m_statusStrings[number] = text;
-
- wxRect rect;
- GetFieldRect(number, rect);
-
- Refresh(true, &rect);