Eliminated lingering validation failure message on the status bar. Added wxPropertyGrid virtual member functions DoHidePropertyError() and GetStatusBar().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64796 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Jaakko Salli
2010-07-03 12:22:58 +00:00
parent 8915141c1e
commit 2d8d109b6c
3 changed files with 109 additions and 21 deletions

View File

@@ -3127,6 +3127,22 @@ bool wxPropertyGrid::PerformValidation( wxPGProperty* p, wxVariant& pendingValue
// -----------------------------------------------------------------------
#if wxUSE_STATUSBAR
wxStatusBar* wxPropertyGrid::GetStatusBar()
{
wxWindow* topWnd = ::wxGetTopLevelParent(this);
if ( topWnd && topWnd->IsKindOf(CLASSINFO(wxFrame)) )
{
wxFrame* pFrame = wxStaticCast(topWnd, wxFrame);
if ( pFrame )
return pFrame->GetStatusBar();
}
return NULL;
}
#endif
// -----------------------------------------------------------------------
void wxPropertyGrid::DoShowPropertyError( wxPGProperty* WXUNUSED(property), const wxString& msg )
{
if ( !msg.length() )
@@ -3135,19 +3151,11 @@ void wxPropertyGrid::DoShowPropertyError( wxPGProperty* WXUNUSED(property), cons
#if wxUSE_STATUSBAR
if ( !wxPGGlobalVars->m_offline )
{
wxWindow* topWnd = ::wxGetTopLevelParent(this);
if ( topWnd )
wxStatusBar* pStatusBar = GetStatusBar();
if ( pStatusBar )
{
wxFrame* pFrame = wxDynamicCast(topWnd, wxFrame);
if ( pFrame )
{
wxStatusBar* pStatusBar = pFrame->GetStatusBar();
if ( pStatusBar )
{
pStatusBar->SetStatusText(msg);
return;
}
}
pStatusBar->SetStatusText(msg);
return;
}
}
#endif
@@ -3157,6 +3165,23 @@ void wxPropertyGrid::DoShowPropertyError( wxPGProperty* WXUNUSED(property), cons
// -----------------------------------------------------------------------
void wxPropertyGrid::DoHidePropertyError( wxPGProperty* WXUNUSED(property) )
{
#if wxUSE_STATUSBAR
if ( !wxPGGlobalVars->m_offline )
{
wxStatusBar* pStatusBar = GetStatusBar();
if ( pStatusBar )
{
pStatusBar->SetStatusText(wxEmptyString);
return;
}
}
#endif
}
// -----------------------------------------------------------------------
bool wxPropertyGrid::OnValidationFailure( wxPGProperty* property,
wxVariant& invalidValue )
{
@@ -3259,6 +3284,11 @@ void wxPropertyGrid::DoOnValidationFailureReset( wxPGProperty* property )
}
}
if ( vfb & wxPG_VFB_SHOW_MESSAGE )
{
DoHidePropertyError(property);
}
m_validationInfo.m_isFailing = false;
}
@@ -4214,14 +4244,7 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags )
if ( !(GetExtraStyle() & wxPG_EX_HELP_AS_TOOLTIPS) )
{
wxStatusBar* statusbar = NULL;
if ( !(m_iFlags & wxPG_FL_NOSTATUSBARHELP) )
{
wxFrame* frame = wxDynamicCast(::wxGetTopLevelParent(this),wxFrame);
if ( frame )
statusbar = frame->GetStatusBar();
}
wxStatusBar* statusbar = GetStatusBar();
if ( statusbar )
{
const wxString* pHelpString = (const wxString*) NULL;