- wxASSERT_MSG( number >= 0, _T("negative number of fields in wxStatusBar?") );
-
- int i;
- for(i = m_nFields; i < number; ++i)
- m_statusStrings.Add( wxEmptyString );
-
- for (i = m_nFields - 1; i >= number; --i)
- m_statusStrings.RemoveAt(i);
-
- // forget the old cached pixel widths
- m_widthsAbs.Empty();
-
- wxStatusBarBase::SetFieldsCount(number, widths);
-
- wxASSERT_MSG( m_nFields == (int)m_statusStrings.GetCount(),
- _T("This really should never happen, can we do away with m_nFields here?") );
-}
-
-void wxStatusBarGeneric::SetStatusText(const wxString& text, int number)
-{
- wxCHECK_RET( (number >= 0) && (number < m_nFields),
- _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);
-
- // it's common to show some text in the status bar before starting a
- // relatively lengthy operation, ensure that the text is shown to the
- // user immediately and not after the lengthy operation end
- Update();
- }
-}