X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b0fb0f3c71c527b5c5cb839355c88766b6f8c888..4b1ae1539c549eb612e5d2b6876124138ce9cb4e:/src/xrc/xh_statbar.cpp diff --git a/src/xrc/xh_statbar.cpp b/src/xrc/xh_statbar.cpp index d69735c63b..a5e04452ef 100644 --- a/src/xrc/xh_statbar.cpp +++ b/src/xrc/xh_statbar.cpp @@ -3,7 +3,7 @@ // Purpose: XRC resource for wxStatusBar // Author: Brian Ravnsgaard Riis // Created: 2004/01/21 -// RCS-ID: +// RCS-ID: $Id$ // Copyright: (c) 2004 Brian Ravnsgaard Riis // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -27,7 +27,9 @@ #include "wx/xrc/xh_statbar.h" #include "wx/statusbr.h" -wxStatusBarXmlHandler::wxStatusBarXmlHandler() : +IMPLEMENT_DYNAMIC_CLASS(wxStatusBarXmlHandler, wxXmlResourceHandler) + +wxStatusBarXmlHandler::wxStatusBarXmlHandler() : wxXmlResourceHandler() { XRC_ADD_STYLE(wxST_SIZEGRIP); @@ -46,11 +48,11 @@ wxObject *wxStatusBarXmlHandler::DoCreateResource() int fields = GetLong(wxT("fields"), 1); wxString widths = GetParamValue(wxT("widths")); - if(fields > 1) + if (fields > 1 && !widths.IsEmpty()) { int *width = new int[fields]; - - for (unsigned int i = 0; i < fields; ++i) + + for (int i = 0; i < fields; ++i) { width[i] = wxAtoi(widths.BeforeFirst(wxT(','))); if(widths.Find(wxT(','))) @@ -59,6 +61,8 @@ wxObject *wxStatusBarXmlHandler::DoCreateResource() statbar->SetFieldsCount(fields, width); delete[] width; } + else + statbar->SetFieldsCount(fields); if (m_parentAsWindow) {