Add an infobar warning when trying to fill a zone which is not connected.

This commit is contained in:
Jeff Young 2022-02-24 20:29:23 +00:00
parent c924b0155e
commit b7be42375d
1 changed files with 15 additions and 2 deletions

View File

@ -268,8 +268,21 @@ int ZONE_FILLER_TOOL::ZoneFillDirty( const TOOL_EVENT& aEvent )
if( outlines == 0 ) if( outlines == 0 )
{ {
// TODO: why does this trash memory? WX_INFOBAR* infobar = frame->GetInfoBar();
// frame->ShowInfoBarWarning( _( "Zone has no connections." ) );
#ifdef __WXMAC__
// I haven't a clue why this is needed, but if you start another operation before the
// animation is over then you end up accessing deleted view items.
infobar->SetShowHideEffects( wxSHOW_EFFECT_NONE, wxSHOW_EFFECT_NONE );
#endif
infobar->RemoveAllButtons();
infobar->ShowMessageFor( _( "Zone has no connections." ), 4000, wxICON_WARNING );
#ifdef __WXMAC__
infobar->SetShowHideEffects( wxSHOW_EFFECT_ROLL_TO_BOTTOM, wxSHOW_EFFECT_ROLL_TO_TOP );
infobar->SetEffectDuration( 300 );
#endif
break; break;
} }
} }