X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a83f860948059b0273b5cc6d9e43fadad3ebfca..f050bdbd5b69ed1a6752102f0c4c13bc7cb4ed3c:/src/common/framecmn.cpp diff --git a/src/common/framecmn.cpp b/src/common/framecmn.cpp index 9e9de0ac28..7cbe913304 100644 --- a/src/common/framecmn.cpp +++ b/src/common/framecmn.cpp @@ -419,12 +419,27 @@ void wxFrameBase::DoGiveHelp(const wxString& help, bool show) } } + m_lastHelpShown = text = help; } else // hide help, restore the original text { - text = m_oldStatusText; - m_oldStatusText.clear(); + // clear the last shown help string but remember its value + wxString lastHelpShown; + lastHelpShown.swap(m_lastHelpShown); + + // also clear the old status text but remember it too to restore it + // below + text.swap(m_oldStatusText); + + if ( statbar->GetStatusText(m_statusBarPane) != lastHelpShown ) + { + // if the text was changed with an explicit SetStatusText() call + // from the user code in the meanwhile, do not overwrite it with + // the old status bar contents -- this is almost certainly not what + // the user expects and would be very hard to avoid from user code + return; + } } statbar->SetStatusText(text, m_statusBarPane);