// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "statusbr.h"
#endif
return TRUE;
}
+
+wxSize wxStatusBarGeneric::DoGetBestSize() const
+{
+ int width, height;
+
+ // best width is the width of the parent
+ GetParent()->GetClientSize(&width, NULL);
+
+ // best height is as calculated above in Create
+ wxClientDC dc((wxWindow*)this);
+ dc.SetFont(GetFont());
+ wxCoord y;
+ dc.GetTextExtent(_T("X"), NULL, &y );
+ height = (int)( (11*y)/10 + 2*GetBorderY());
+
+ return wxSize(width, height);
+}
+
void wxStatusBarGeneric::SetFieldsCount(int number, const int *widths)
{
wxASSERT_MSG( number >= 0, _T("negative number of fields in wxStatusBar?") );
wxCHECK_RET( (number >= 0) && (number < m_nFields),
_T("invalid status bar field index") );
- m_statusStrings[number] = text;
+ wxString oldText = m_statusStrings[number];
+ if (oldText != text)
+ {
+ m_statusStrings[number] = text;
- wxRect rect;
- GetFieldRect(number, rect);
+ wxRect rect;
+ GetFieldRect(number, rect);
- Refresh( TRUE, &rect );
+ Refresh( TRUE, &rect );
+ }
}
wxString wxStatusBarGeneric::GetStatusText(int n) const