X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fd3ece57847921264876c8daa1649b597e988d5b..f8d0234d39c66f3d1d7fc2346562cb96c8c7be20:/src/common/statbar.cpp diff --git a/src/common/statbar.cpp b/src/common/statbar.cpp index 9db337c9a5..323ce920e0 100644 --- a/src/common/statbar.cpp +++ b/src/common/statbar.cpp @@ -41,8 +41,8 @@ const char wxStatusBarNameStr[] = "statusBar"; IMPLEMENT_DYNAMIC_CLASS(wxStatusBar, wxWindow) -#include // This is a magic incantation which must be done! -WX_DEFINE_OBJARRAY(wxStatusBarPaneArray); +#include "wx/arrimpl.cpp" // This is a magic incantation which must be done! +WX_DEFINE_OBJARRAY(wxStatusBarPaneArray) // ---------------------------------------------------------------------------- @@ -58,7 +58,7 @@ wxStatusBarBase::~wxStatusBarBase() { // notify the frame that it doesn't have a status bar any longer to avoid // dangling pointers - wxFrame *frame = dynamic_cast(GetParent()); + wxFrame *frame = wxDynamicCast(GetParent(), wxFrame); if ( frame && frame->GetStatusBar() == this ) frame->SetStatusBar(NULL); } @@ -194,12 +194,15 @@ void wxStatusBarBase::PushStatusText(const wxString& text, int number) // save current status text in the stack m_panes[number].arrStack.push_back(GetStatusText(number)); - // update current status text SetStatusText(text, number); + // update current status text (eventually also in the native control) } void wxStatusBarBase::PopStatusText(int number) { + wxASSERT_MSG(m_panes[number].arrStack.GetCount() == 1, + "can't pop any further string"); + wxString text = m_panes[number].arrStack.back(); m_panes[number].arrStack.pop_back(); // also remove it from the stack