Unit binder: fix hang and DIALOG_WIRE_BUS_PROPERTIES: fix uninitialized variable.

The hang can be Windows specific.
This commit is contained in:
jean-pierre charras 2022-03-19 10:22:41 +01:00
parent 6bf47e44e4
commit 2bba277c5e
2 changed files with 12 additions and 6 deletions

View File

@ -142,10 +142,9 @@ void UNIT_BINDER::onClick( wxMouseEvent& aEvent )
// These are tokens, not strings, so do a select all // These are tokens, not strings, so do a select all
textEntry->SelectAll(); textEntry->SelectAll();
} }
else
{ // Needed at least on Windows to avoid hanging
aEvent.Skip(); aEvent.Skip();
}
} }

View File

@ -64,7 +64,7 @@ bool DIALOG_WIRE_BUS_PROPERTIES::TransferDataToWindow()
{ {
STROKE_PARAMS stroke; STROKE_PARAMS stroke;
COLOR4D color; COLOR4D color;
int dotSize; int dotSize = -1; // set value to "not found"
for( SCH_ITEM* item : m_items ) for( SCH_ITEM* item : m_items )
{ {
@ -140,7 +140,14 @@ bool DIALOG_WIRE_BUS_PROPERTIES::TransferDataToWindow()
|| static_cast<const SCH_JUNCTION*>( item )->GetDiameter() == dotSize; || static_cast<const SCH_JUNCTION*>( item )->GetDiameter() == dotSize;
} ) ) } ) )
{ {
m_junctionSize.SetValue( dotSize ); if( dotSize >=0 )
m_junctionSize.SetValue( dotSize );
else
{
// No junction found in selected items: disable m_junctionSize
m_junctionSize.Enable( false );
m_junctionSize.SetValue( INDETERMINATE_ACTION );
}
} }
else else
{ {