#include "wx/dcclient.h"
#include "wx/intl.h"
#include "wx/log.h"
+ #include "wx/control.h"
#endif
#include "wx/msw/private.h"
SetFieldsCount(1);
SubclassWin(m_hWnd);
+
+ // cache the DC instance used by UpdateFieldText:
+ // NOTE: create the DC before calling InheritAttributes() since
+ // it may result in a call to our SetFont()
+ m_pDC = new wxClientDC(this);
+
InheritAttributes();
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_MENUBAR));
// work correctly, we need to wait until we return to the main loop
PostSizeEventToParent();
- // cache the DC instance used by UpdateFieldText
- m_pDC = new wxClientDC(this);
-
return true;
}
// frame is not - otherwise statusbar leaves a hole in the place it used to
// occupy
PostSizeEventToParent();
+
+ wxDELETE(m_pDC);
}
bool wxStatusBar::SetFont(const wxFont& font)
if (!wxWindow::SetFont(font))
return false;
- m_pDC->SetFont(font);
+ if (m_pDC) m_pDC->SetFont(font);
return true;
}
// Get field style, if any
int style;
- switch(m_panes[nField].nStyle)
+ switch(m_panes[nField].GetStyle())
{
case wxSB_RAISED:
style = SBT_POPOUT;
for ( size_t i = 0; i < m_panes.GetCount(); ++i )
{
int widthField =
- m_bSameWidthForAllPanes ? DEFAULT_FIELD_WIDTH : m_panes[i].nWidth;
+ m_bSameWidthForAllPanes ? DEFAULT_FIELD_WIDTH : m_panes[i].GetWidth();
if ( widthField >= 0 )
{
width += widthField;