void LIB_EDIT_FRAME::OnUpdateDeMorganConvert( wxUpdateUIEvent& event ) { LIB_PART* part = GetCurPart(); event.Enable( GetShowDeMorgan() || ( part && part->HasConversion() ) ); event.Check( m_convert > 1 ); }
void LIB_EDIT_FRAME::OnUpdateDeMorganConvert( wxUpdateUIEvent& event ) { if( m_mainToolBar == NULL ) return; event.Enable( GetShowDeMorgan() || ( m_component && m_component->HasConversion() ) ); event.Check( m_convert > 1 ); }
void LIB_EDIT_FRAME::OnUpdateDeMorganNormal( wxUpdateUIEvent& event ) { if( m_mainToolBar == NULL ) return; LIB_PART* part = GetCurPart(); event.Enable( GetShowDeMorgan() || ( part && part->HasConversion() ) ); event.Check( m_convert <= 1 ); }
void LIB_EDIT_FRAME::EditGraphicSymbol( wxDC* DC, LIB_ITEM* DrawItem ) { if( DrawItem == NULL ) return; LIB_PART* symbol = DrawItem->GetParent(); DIALOG_LIB_EDIT_DRAW_ITEM dialog( this, DrawItem->GetTypeName() ); dialog.SetWidthUnits( ReturnUnitSymbol( g_UserUnit ) ); wxString val = StringFromValue( g_UserUnit, DrawItem->GetWidth() ); dialog.SetWidth( val ); dialog.SetApplyToAllUnits( DrawItem->GetUnit() == 0 ); dialog.EnableApplyToAllUnits( symbol && symbol->GetUnitCount() > 1 ); dialog.SetApplyToAllConversions( DrawItem->GetConvert() == 0 ); bool enblConvOptStyle = symbol && symbol->HasConversion(); // if a symbol contains no graphic items, symbol->HasConversion() returns false. // but when creating a new symbol, with DeMorgan option set, the ApplyToAllConversions // must be enabled even if symbol->HasConversion() returns false in order to be able // to create graphic items shared by all body styles if( GetShowDeMorgan() ) enblConvOptStyle = true; dialog.EnableApplyToAllConversions( enblConvOptStyle ); dialog.SetFillStyle( DrawItem->GetFillMode() ); dialog.EnableFillStyle( DrawItem->IsFillable() ); if( dialog.ShowModal() == wxID_CANCEL ) return; // Init default values (used to create a new draw item) val = dialog.GetWidth(); m_drawLineWidth = ValueFromString( g_UserUnit, val ); m_drawSpecificConvert = !dialog.GetApplyToAllConversions(); m_drawSpecificUnit = !dialog.GetApplyToAllUnits(); #if 0 /* TODO: see if m_drawFillStyle must retain the last fill option or not. * if the last is Filled, having next new graphic items created * with filled body is often bad. * currently m_drawFillStyle is left with the default value (not filled) */ if( DrawItem->IsFillable() ) m_drawFillStyle = (FILL_T) dialog.GetFillStyle(); #endif // Save copy for undo if not in edit (edit command already handle the save copy) if( !DrawItem->InEditMode() ) SaveCopyInUndoList( DrawItem->GetParent() ); if( m_drawSpecificUnit ) DrawItem->SetUnit( GetUnit() ); else DrawItem->SetUnit( 0 ); if( m_drawSpecificConvert ) DrawItem->SetConvert( GetConvert() ); else DrawItem->SetConvert( 0 ); if( DrawItem->IsFillable() ) DrawItem->SetFillMode( (FILL_T) dialog.GetFillStyle() ); DrawItem->SetWidth( m_drawLineWidth ); OnModify( ); MSG_PANEL_ITEMS items; DrawItem->GetMsgPanelInfo( items ); SetMsgPanel( items ); m_canvas->Refresh(); }