mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-21 10:31:40 +00:00
Implement simple inheritance for library symbols.
This change completely removes the LIB_ALIAS design pattern an replaces it by allowing LIB_PART objects to inherit from other LIB_PART objects. The initial implementation only allows for single inheritance and only supports the mandatory fields in the derived part because that is all that the current symbol library file format will support. Once the new file format is implemented and saving to the old file format is deprecated, more complex inheritance will be added. The LIB_ALIAS information saved in the document files was move into the LIB_PART object. This change impacts virtually every part of the schematic and symbol library editor code so this commit message is woefully incomplete. REMOVE: Removed the symbol aliases concept from the schematic and symbol editors and the symbol viewer. NEW: Replace the symbol alias concept with simple inheritance that allows a library symbol to be derived from another library symbol.
This commit is contained in:
parent
9f896312ee
commit
54f066fed7
common
eeschema
class_libentry.cppclass_libentry.hclass_library.cppclass_library.h
dialogs
dialog_choose_component.cppdialog_edit_component_in_lib.cppdialog_edit_component_in_lib.hdialog_edit_component_in_lib_base.cppdialog_edit_component_in_lib_base.fbpdialog_edit_component_in_lib_base.hdialog_edit_component_in_schematic.cppdialog_edit_component_in_schematic_base.cppdialog_edit_component_in_schematic_base.fbpdialog_edit_component_in_schematic_base.hdialog_lib_edit_pin_table.hdialog_lib_new_component.cppdialog_lib_new_component.hdialog_lib_new_component_base.cppdialog_lib_new_component_base.fbpdialog_lib_new_component_base.hdialog_symbol_remap.cppdialog_update_fields.cpp
fields_grid_table.cppgenerate_alias_info.cppgetpart.cpplibarch.cpplibedit
lib_edit_frame.cpplib_edit_frame.hlib_export.cpplib_manager.cpplib_manager.hlibedit.cpplibedit_plot_component.cpplibedit_undo_redo.cppmenubar_libedit.cppsymbedit.cpptoolbars_libedit.cpp
netlist_exporters
netlist_exporter.cppnetlist_exporter_generic.cppnetlist_exporter_orcadpcb2.cppnetlist_exporter_pspice.cpp
project_rescue.cppsch_base_frame.cppsch_base_frame.hsch_component.cppsch_component.hsch_eagle_plugin.cppsch_eagle_plugin.hsch_field.cppsch_io_mgr.hsch_legacy_plugin.cppsch_legacy_plugin.hsch_painter.cppsch_painter.hsch_plugin.cppsch_screen.cppsch_sheet_path.cppsch_view.cppsch_view.hsymbol_lib_table.cppsymbol_lib_table.hsymbol_tree_model_adapter.cppsymbol_tree_synchronizing_adapter.cpptoolbars_viewlib.cpptools
viewlib_frame.cppviewlib_frame.hviewlibs.cppwidgets
include
qa/eeschema
@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
* Copyright (C) 2012-2018 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2012-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@ -113,7 +113,7 @@ DIALOG_SHIM::DIALOG_SHIM( wxWindow* aParent, wxWindowID id, const wxString& titl
|
||||
Bind( wxEVT_BUTTON, &DIALOG_SHIM::OnButton, this );
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
// On Windows, the app top windows can be brought to the foreground (at least temporarily)
|
||||
// On Windows, the app top windows can be brought to the foreground (at least temporarily)
|
||||
// in certain circumstances such as when calling an external tool in Eeschema BOM generation.
|
||||
// So set the parent frame (if exists) to top window to avoid this annoying behavior.
|
||||
if( kiwayHolder && kiwayHolder->GetType() == KIWAY_HOLDER::FRAME )
|
||||
@ -235,6 +235,31 @@ bool DIALOG_SHIM::Show( bool show )
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_SHIM::ResetSize()
|
||||
{
|
||||
const char* hash_key;
|
||||
|
||||
if( m_hash_key.size() )
|
||||
{
|
||||
// a special case like EDA_LIST_DIALOG, which has multiple uses.
|
||||
hash_key = m_hash_key.c_str();
|
||||
}
|
||||
else
|
||||
{
|
||||
hash_key = typeid(*this).name();
|
||||
}
|
||||
|
||||
RECT_MAP::iterator it = class_map.find( hash_key );
|
||||
|
||||
if( it == class_map.end() )
|
||||
return;
|
||||
|
||||
EDA_RECT rect = it->second;
|
||||
rect.SetSize( 0, 0 );
|
||||
class_map[ hash_key ] = rect;
|
||||
}
|
||||
|
||||
|
||||
bool DIALOG_SHIM::Enable( bool enable )
|
||||
{
|
||||
// so we can do logging of this state change:
|
||||
@ -406,7 +431,8 @@ void DIALOG_SHIM::EndQuasiModal( int retCode )
|
||||
|
||||
if( !IsQuasiModal() )
|
||||
{
|
||||
wxFAIL_MSG( wxT( "either DIALOG_SHIM::EndQuasiModal called twice or ShowQuasiModal wasn't called" ) );
|
||||
wxFAIL_MSG( "either DIALOG_SHIM::EndQuasiModal called twice or ShowQuasiModal"
|
||||
"wasn't called" );
|
||||
return;
|
||||
}
|
||||
|
||||
@ -535,7 +561,6 @@ void DIALOG_SHIM::OnCharHook( wxKeyEvent& aEvt )
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DIALOG_SHIM::OnGridEditorShown( wxGridEvent& event )
|
||||
{
|
||||
SetEscapeId( wxID_NONE );
|
||||
|
@ -51,155 +51,30 @@ int LIB_PART::m_subpartIdSeparator = 0;
|
||||
int LIB_PART::m_subpartFirstId = 'A';
|
||||
|
||||
|
||||
LIB_ALIAS::LIB_ALIAS( const wxString& aName, LIB_PART* aRootPart ) :
|
||||
EDA_ITEM( LIB_ALIAS_T ),
|
||||
shared( aRootPart )
|
||||
{
|
||||
SetName( aName );
|
||||
}
|
||||
|
||||
|
||||
LIB_ALIAS::LIB_ALIAS( const LIB_ALIAS& aAlias, LIB_PART* aRootPart ) :
|
||||
EDA_ITEM( aAlias ),
|
||||
shared( aRootPart )
|
||||
{
|
||||
name = aAlias.name;
|
||||
|
||||
description = aAlias.description;
|
||||
keyWords = aAlias.keyWords;
|
||||
docFileName = aAlias.docFileName;
|
||||
}
|
||||
|
||||
|
||||
LIB_ALIAS::~LIB_ALIAS()
|
||||
{
|
||||
wxLogTrace( traceSchLibMem, wxT( "%s: destroying alias:'%s'" ),
|
||||
GetChars( wxString::FromAscii( __WXFUNCTION__ ) ), GetChars( GetName() ) );
|
||||
|
||||
wxCHECK_RET( shared, wxT( "~LIB_ALIAS() without a LIB_PART" ) );
|
||||
|
||||
if( shared )
|
||||
shared->RemoveAlias( this );
|
||||
}
|
||||
|
||||
|
||||
wxString LIB_ALIAS::GetLibNickname() const
|
||||
{
|
||||
wxASSERT_MSG( shared, wxT( "LIB_ALIAS without a LIB_PART" ) );
|
||||
|
||||
if( shared )
|
||||
return shared->GetLibraryName();
|
||||
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
|
||||
bool LIB_ALIAS::IsRoot() const
|
||||
{
|
||||
return name == shared->GetName();
|
||||
}
|
||||
|
||||
|
||||
LIB_ID LIB_ALIAS::GetLibId() const
|
||||
{
|
||||
LIB_ID id = shared->GetLibId();
|
||||
id.SetLibItemName( name );
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
PART_LIB* LIB_ALIAS::GetLib()
|
||||
{
|
||||
return shared->GetLib();
|
||||
}
|
||||
|
||||
|
||||
void LIB_ALIAS::SetName( const wxString& aName )
|
||||
{
|
||||
name = LIB_ID::FixIllegalChars( aName, LIB_ID::ID_SCH );
|
||||
}
|
||||
|
||||
|
||||
int LIB_ALIAS::GetUnitCount()
|
||||
{
|
||||
return shared->GetUnitCount();
|
||||
}
|
||||
|
||||
|
||||
wxString LIB_ALIAS::GetUnitReference( int aUnit )
|
||||
{
|
||||
return LIB_PART::SubReference( aUnit, false );
|
||||
}
|
||||
|
||||
|
||||
const EDA_RECT LIB_ALIAS::GetBoundingBox() const
|
||||
{
|
||||
// a LIB_ALIAS does not really have a bounding box.
|
||||
// return a 0 size rect.
|
||||
EDA_RECT dummy;
|
||||
|
||||
return dummy;
|
||||
};
|
||||
|
||||
|
||||
const BOX2I LIB_ALIAS::ViewBBox() const
|
||||
{
|
||||
// LIB_ALIAS may be displayed in preview windows, so ensure that it is always
|
||||
// selected for drawing.
|
||||
BOX2I bbox;
|
||||
bbox.SetMaximum();
|
||||
return bbox;
|
||||
}
|
||||
|
||||
|
||||
wxString LIB_ALIAS::GetSearchText()
|
||||
wxString LIB_PART::GetSearchText()
|
||||
{
|
||||
// Matches are scored by offset from front of string, so inclusion of this spacer
|
||||
// discounts matches found after it.
|
||||
static const wxString discount( wxT( " " ) );
|
||||
|
||||
wxString text = GetKeyWords() + discount + GetDescription();
|
||||
wxString text = GetKeyWords() + discount + GetDescription();
|
||||
wxString footprint = GetFootprintField().GetText();
|
||||
|
||||
// If a footprint is defined for the part, add it to the serach string
|
||||
if( shared )
|
||||
if( !footprint.IsEmpty() )
|
||||
{
|
||||
wxString footprint = shared->GetFootprintField().GetText();
|
||||
|
||||
if( !footprint.IsEmpty() )
|
||||
text += discount + footprint;
|
||||
text += discount + footprint;
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
|
||||
bool LIB_ALIAS::operator==( const wxChar* aName ) const
|
||||
{
|
||||
return name == aName;
|
||||
}
|
||||
|
||||
|
||||
bool operator<( const LIB_ALIAS& aItem1, const LIB_ALIAS& aItem2 )
|
||||
bool operator<( const LIB_PART& aItem1, const LIB_PART& aItem2 )
|
||||
{
|
||||
return aItem1.GetName() < aItem2.GetName();
|
||||
}
|
||||
|
||||
|
||||
void LIB_ALIAS::ViewGetLayers( int aLayers[], int& aCount ) const
|
||||
{
|
||||
// An alias's fields don't know how to fetch their parent's values so we don't let
|
||||
// them draw themselves. This means the alias always has to draw them, which means
|
||||
// it has to "own" their layers as well.
|
||||
aCount = 6;
|
||||
aLayers[0] = LAYER_DEVICE;
|
||||
aLayers[1] = LAYER_DEVICE_BACKGROUND;
|
||||
aLayers[2] = LAYER_REFERENCEPART;
|
||||
aLayers[3] = LAYER_VALUEPART;
|
||||
aLayers[4] = LAYER_FIELDS;
|
||||
aLayers[5] = LAYER_SELECTION_SHADOWS;
|
||||
}
|
||||
|
||||
|
||||
/// http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared
|
||||
struct null_deleter
|
||||
{
|
||||
@ -209,7 +84,7 @@ struct null_deleter
|
||||
};
|
||||
|
||||
|
||||
LIB_PART::LIB_PART( const wxString& aName, PART_LIB* aLibrary ) :
|
||||
LIB_PART::LIB_PART( const wxString& aName, LIB_PART* aParent, PART_LIB* aLibrary ) :
|
||||
EDA_ITEM( LIB_PART_T ),
|
||||
m_me( this, null_deleter() )
|
||||
{
|
||||
@ -221,6 +96,9 @@ LIB_PART::LIB_PART( const wxString& aName, PART_LIB* aLibrary ) :
|
||||
m_showPinNumbers = true;
|
||||
m_showPinNames = true;
|
||||
|
||||
if( aParent )
|
||||
m_parent = aParent->SharedPtr();
|
||||
|
||||
// Add the MANDATORY_FIELDS in RAM only. These are assumed to be present
|
||||
// when the field editors are invoked.
|
||||
m_drawings[LIB_FIELD_T].reserve( 4 );
|
||||
@ -241,7 +119,9 @@ LIB_PART::LIB_PART( LIB_PART& aPart, PART_LIB* aLibrary ) :
|
||||
LIB_ITEM* newItem;
|
||||
|
||||
m_library = aLibrary;
|
||||
m_FootprintList = aPart.m_FootprintList;
|
||||
m_name = aPart.m_name;
|
||||
m_parent = aPart.m_parent;
|
||||
m_FootprintList = wxArrayString( aPart.m_FootprintList );
|
||||
m_unitCount = aPart.m_unitCount;
|
||||
m_unitsLocked = aPart.m_unitsLocked;
|
||||
m_pinNameOffset = aPart.m_pinNameOffset;
|
||||
@ -250,41 +130,197 @@ LIB_PART::LIB_PART( LIB_PART& aPart, PART_LIB* aLibrary ) :
|
||||
m_dateLastEdition = aPart.m_dateLastEdition;
|
||||
m_options = aPart.m_options;
|
||||
m_libId = aPart.m_libId;
|
||||
m_description = aPart.m_description;
|
||||
m_keyWords = aPart.m_keyWords;
|
||||
m_docFileName = aPart.m_docFileName;
|
||||
|
||||
for( LIB_ITEM& oldItem : aPart.m_drawings )
|
||||
{
|
||||
if( oldItem.HasFlag( IS_NEW ) || oldItem.HasFlag( STRUCT_DELETED ) )
|
||||
if( ( oldItem.GetFlags() & ( IS_NEW | STRUCT_DELETED ) ) != 0 )
|
||||
continue;
|
||||
|
||||
newItem = (LIB_ITEM*) oldItem.Clone();
|
||||
newItem->SetParent( this );
|
||||
m_drawings.push_back( newItem );
|
||||
}
|
||||
|
||||
for( LIB_ALIAS* alias : aPart.m_aliases )
|
||||
m_aliases.emplace_back( new LIB_ALIAS( *alias, this ) );
|
||||
}
|
||||
|
||||
|
||||
LIB_PART::~LIB_PART()
|
||||
{
|
||||
wxLogTrace( traceSchLibMem,
|
||||
wxT( "%s: destroying symbol with alias list count of %llu" ),
|
||||
GetChars( wxString::FromAscii( __WXFUNCTION__ ) ),
|
||||
(long long unsigned) m_aliases.size() );
|
||||
|
||||
// If the part is being deleted directly rather than through the library,
|
||||
// delete all of the aliases.
|
||||
while( m_aliases.size() )
|
||||
{
|
||||
LIB_ALIAS* alias = m_aliases.back();
|
||||
m_aliases.pop_back();
|
||||
delete alias;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const wxString LIB_PART::GetLibraryName()
|
||||
int LIB_PART::Compare( const LIB_PART& aRhs ) const
|
||||
{
|
||||
if( m_me == aRhs.m_me )
|
||||
return 0;
|
||||
|
||||
int retv = m_name.Cmp( aRhs.m_name );
|
||||
|
||||
if( retv )
|
||||
return retv;
|
||||
|
||||
retv = m_libId.compare( aRhs.m_libId );
|
||||
|
||||
if( retv )
|
||||
return retv;
|
||||
|
||||
if( m_parent.lock() < aRhs.m_parent.lock() )
|
||||
return -1;
|
||||
|
||||
if( m_parent.lock() > aRhs.m_parent.lock() )
|
||||
return 1;
|
||||
|
||||
if( m_options != aRhs.m_options )
|
||||
return ( m_options == ENTRY_NORMAL ) ? -1 : 1;
|
||||
|
||||
if( m_unitCount != aRhs.m_unitCount )
|
||||
return m_unitCount - aRhs.m_unitCount;
|
||||
|
||||
if( m_drawings.size() != aRhs.m_drawings.size() )
|
||||
return m_drawings.size() - aRhs.m_drawings.size();
|
||||
|
||||
LIB_ITEMS_CONTAINER::CONST_ITERATOR lhsItem = m_drawings.begin();
|
||||
LIB_ITEMS_CONTAINER::CONST_ITERATOR rhsItem = aRhs.m_drawings.begin();
|
||||
|
||||
while( lhsItem != m_drawings.end() )
|
||||
{
|
||||
if( lhsItem->Type() != rhsItem->Type() )
|
||||
return lhsItem->Type() - rhsItem->Type();
|
||||
|
||||
retv = lhsItem->compare( *rhsItem );
|
||||
|
||||
if( retv )
|
||||
return retv;
|
||||
|
||||
++lhsItem;
|
||||
++rhsItem;
|
||||
}
|
||||
|
||||
if( m_FootprintList.GetCount() != aRhs.m_FootprintList.GetCount() )
|
||||
return m_FootprintList.GetCount() - aRhs.m_FootprintList.GetCount();
|
||||
|
||||
for( size_t i = 0; i < m_FootprintList.GetCount(); i++ )
|
||||
{
|
||||
retv = m_FootprintList[i].Cmp( aRhs.m_FootprintList[i] );
|
||||
|
||||
if( retv )
|
||||
return retv;
|
||||
}
|
||||
|
||||
retv = m_description.Cmp( aRhs.m_description );
|
||||
|
||||
if( retv )
|
||||
return retv;
|
||||
|
||||
retv = m_keyWords.Cmp( aRhs.m_keyWords );
|
||||
|
||||
if( retv )
|
||||
return retv;
|
||||
|
||||
retv = m_docFileName.Cmp( aRhs.m_docFileName );
|
||||
|
||||
if( retv )
|
||||
return retv;
|
||||
|
||||
if( m_pinNameOffset != aRhs.m_pinNameOffset )
|
||||
return m_pinNameOffset - aRhs.m_pinNameOffset;
|
||||
|
||||
if( m_unitsLocked != aRhs.m_unitsLocked )
|
||||
return ( m_unitsLocked ) ? 1 : -1;
|
||||
|
||||
if( m_showPinNames != aRhs.m_showPinNames )
|
||||
return ( m_showPinNames ) ? 1 : -1;
|
||||
|
||||
if( m_showPinNumbers != aRhs.m_showPinNumbers )
|
||||
return ( m_showPinNumbers ) ? 1 : -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
wxString LIB_PART::GetUnitReference( int aUnit )
|
||||
{
|
||||
return LIB_PART::SubReference( aUnit, false );
|
||||
}
|
||||
|
||||
|
||||
void LIB_PART::SetName( const wxString& aName )
|
||||
{
|
||||
wxString validatedName = LIB_ID::FixIllegalChars( aName, LIB_ID::ID_SCH );
|
||||
|
||||
m_name = validatedName;
|
||||
m_libId.SetLibItemName( validatedName, false );
|
||||
|
||||
GetValueField().SetText( validatedName );
|
||||
}
|
||||
|
||||
|
||||
void LIB_PART::SetParent( LIB_PART* aParent )
|
||||
{
|
||||
if( aParent )
|
||||
m_parent = aParent->SharedPtr();
|
||||
else
|
||||
m_parent.reset();
|
||||
}
|
||||
|
||||
|
||||
std::unique_ptr< LIB_PART > LIB_PART::Flatten() const
|
||||
{
|
||||
std::unique_ptr< LIB_PART > retv;
|
||||
|
||||
if( IsAlias() )
|
||||
{
|
||||
PART_SPTR parent = m_parent.lock();
|
||||
|
||||
wxCHECK_MSG( parent, retv,
|
||||
wxString::Format( "Parent of derived symbol '%s' undefined", m_name ) );
|
||||
|
||||
retv.reset( new LIB_PART( *const_cast< LIB_PART* >( this ) ) );
|
||||
|
||||
// Flattened symbols have no inheritance.
|
||||
retv->SetParent( nullptr );
|
||||
|
||||
// Flatten parent information into the derived symbol.
|
||||
retv->SetUnitCount( parent->GetUnitCount() );
|
||||
|
||||
LIB_ITEM* newItem;
|
||||
|
||||
for( LIB_ITEM& item : parent->GetDrawItems() )
|
||||
{
|
||||
// Only add fields from the parent that are not present in the child. The child
|
||||
// symbol fields are already set.
|
||||
if( item.Type() == LIB_FIELD_T )
|
||||
{
|
||||
LIB_FIELD* field = (LIB_FIELD*) &item;
|
||||
|
||||
if( retv->GetField( field->GetId() ) )
|
||||
continue;
|
||||
}
|
||||
|
||||
newItem = (LIB_ITEM*) item.Clone();
|
||||
newItem->SetParent( retv.get() );
|
||||
retv->GetDrawItems().push_back( newItem );
|
||||
}
|
||||
|
||||
if( parent->IsPower() )
|
||||
retv->SetPower();
|
||||
else
|
||||
retv->SetNormal();
|
||||
|
||||
retv->LockUnits( parent->UnitsLocked() );
|
||||
}
|
||||
else
|
||||
{
|
||||
retv.reset( new LIB_PART( *const_cast< LIB_PART* >( this ) ) );
|
||||
}
|
||||
|
||||
return retv;
|
||||
}
|
||||
|
||||
|
||||
const wxString LIB_PART::GetLibraryName() const
|
||||
{
|
||||
if( m_library )
|
||||
return m_library->GetName();
|
||||
@ -325,31 +361,6 @@ wxString LIB_PART::SubReference( int aUnit, bool aAddSeparator )
|
||||
}
|
||||
|
||||
|
||||
const wxString& LIB_PART::GetName() const
|
||||
{
|
||||
static wxString dummy;
|
||||
|
||||
wxCHECK_MSG( m_aliases.size(), dummy, "no aliases defined for symbol" );
|
||||
|
||||
return m_aliases[0]->GetName();
|
||||
}
|
||||
|
||||
|
||||
void LIB_PART::SetName( const wxString& aName )
|
||||
{
|
||||
// The LIB_ALIAS that is the LIB_PART name has to be created so create it.
|
||||
if( m_aliases.empty() )
|
||||
m_aliases.push_back( new LIB_ALIAS( aName, this ) );
|
||||
else
|
||||
m_aliases[0]->SetName( aName );
|
||||
|
||||
wxString validatedName = LIB_ID::FixIllegalChars( aName, LIB_ID::ID_SCH );
|
||||
m_libId.SetLibItemName( validatedName, false );
|
||||
|
||||
GetValueField().SetText( validatedName );
|
||||
}
|
||||
|
||||
|
||||
void LIB_PART::Print( wxDC* aDc, const wxPoint& aOffset, int aMulti, int aConvert,
|
||||
const PART_DRAW_OPTIONS& aOpts )
|
||||
{
|
||||
@ -457,7 +468,8 @@ void LIB_PART::Plot( PLOTTER* aPlotter, int aUnit, int aConvert,
|
||||
if( aConvert && item.m_Convert && ( item.m_Convert != aConvert ) )
|
||||
continue;
|
||||
|
||||
item.Plot( aPlotter, aOffset, fill && ( item.m_Fill != FILLED_WITH_BG_BODYCOLOR ), aTransform );
|
||||
item.Plot( aPlotter, aOffset, fill && ( item.m_Fill != FILLED_WITH_BG_BODYCOLOR ),
|
||||
aTransform );
|
||||
}
|
||||
}
|
||||
|
||||
@ -481,15 +493,18 @@ void LIB_PART::PlotLibFields( PLOTTER* aPlotter, int aUnit, int aConvert,
|
||||
if( aConvert && item.m_Convert && ( item.m_Convert != aConvert ) )
|
||||
continue;
|
||||
|
||||
LIB_FIELD& field = (LIB_FIELD&) item;
|
||||
|
||||
// The reference is a special case: we should change the basic text
|
||||
// to add '?' and the part id
|
||||
LIB_FIELD& field = (LIB_FIELD&) item;
|
||||
wxString tmp = field.GetShownText();
|
||||
|
||||
if( field.GetId() == REFERENCE )
|
||||
{
|
||||
wxString text = field.GetFullText( aUnit );
|
||||
field.SetText( text );
|
||||
}
|
||||
|
||||
item.Plot( aPlotter, aOffset, fill, aTransform );
|
||||
field.SetText( tmp );
|
||||
}
|
||||
@ -541,11 +556,12 @@ void LIB_PART::AddDrawItem( LIB_ITEM* aItem )
|
||||
|
||||
LIB_ITEM* LIB_PART::GetNextDrawItem( LIB_ITEM* aItem, KICAD_T aType )
|
||||
{
|
||||
if( m_drawings.empty( aType ) )
|
||||
return NULL;
|
||||
|
||||
if( aItem == NULL )
|
||||
return &( *( m_drawings.begin( aType ) ) );
|
||||
{
|
||||
LIB_ITEMS_CONTAINER::ITERATOR it1 = m_drawings.begin( aType );
|
||||
|
||||
return (it1 != m_drawings.end( aType ) ) ? &( *( m_drawings.begin( aType ) ) ) : nullptr;
|
||||
}
|
||||
|
||||
// Search for the last item, assume aItem is of type aType
|
||||
wxASSERT( ( aType == TYPE_NOT_INIT ) || ( aType == aItem->Type() ) );
|
||||
@ -569,9 +585,6 @@ LIB_ITEM* LIB_PART::GetNextDrawItem( LIB_ITEM* aItem, KICAD_T aType )
|
||||
|
||||
void LIB_PART::GetPins( LIB_PINS& aList, int aUnit, int aConvert )
|
||||
{
|
||||
if( m_drawings.empty( LIB_PIN_T ) )
|
||||
return;
|
||||
|
||||
/* Notes:
|
||||
* when aUnit == 0: no unit filtering
|
||||
* when aConvert == 0: no convert (shape selection) filtering
|
||||
@ -632,23 +645,24 @@ bool LIB_PART::PinsConflictWith( LIB_PART& aOtherPart, bool aTestNums, bool aTes
|
||||
continue;
|
||||
|
||||
// Same number?
|
||||
if( aTestNums && ( eachThisPin->GetNumber() != eachOtherPin->GetNumber() ))
|
||||
if( aTestNums && ( eachThisPin->GetNumber() != eachOtherPin->GetNumber() ) )
|
||||
continue;
|
||||
|
||||
// Same name?
|
||||
if( aTestNames && ( eachThisPin->GetName() != eachOtherPin->GetName() ))
|
||||
if( aTestNames && ( eachThisPin->GetName() != eachOtherPin->GetName() ) )
|
||||
continue;
|
||||
|
||||
// Same electrical type?
|
||||
if( aTestType && ( eachThisPin->GetType() != eachOtherPin->GetType() ))
|
||||
if( aTestType && ( eachThisPin->GetType() != eachOtherPin->GetType() ) )
|
||||
continue;
|
||||
|
||||
// Same orientation?
|
||||
if( aTestOrientation && ( eachThisPin->GetOrientation() != eachOtherPin->GetOrientation() ))
|
||||
if( aTestOrientation
|
||||
&& ( eachThisPin->GetOrientation() != eachOtherPin->GetOrientation() ) )
|
||||
continue;
|
||||
|
||||
// Same length?
|
||||
if( aTestLength && ( eachThisPin->GetLength() != eachOtherPin->GetLength() ))
|
||||
if( aTestLength && ( eachThisPin->GetLength() != eachOtherPin->GetLength() ) )
|
||||
continue;
|
||||
|
||||
foundMatch = true;
|
||||
@ -699,10 +713,13 @@ const EDA_RECT LIB_PART::GetUnitBoundingBox( int aUnit, int aConvert ) const
|
||||
|
||||
void LIB_PART::ViewGetLayers( int aLayers[], int& aCount ) const
|
||||
{
|
||||
aCount = 3;
|
||||
aCount = 6;
|
||||
aLayers[0] = LAYER_DEVICE;
|
||||
aLayers[1] = LAYER_DEVICE_BACKGROUND;
|
||||
aLayers[2] = LAYER_SELECTION_SHADOWS;
|
||||
aLayers[2] = LAYER_REFERENCEPART;
|
||||
aLayers[3] = LAYER_VALUEPART;
|
||||
aLayers[4] = LAYER_FIELDS;
|
||||
aLayers[5] = LAYER_SELECTION_SHADOWS;
|
||||
}
|
||||
|
||||
|
||||
@ -862,18 +879,21 @@ bool LIB_PART::HasConversion() const
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void LIB_PART::ClearTempFlags()
|
||||
{
|
||||
for( LIB_ITEM& item : m_drawings )
|
||||
item.ClearTempFlags();
|
||||
}
|
||||
|
||||
|
||||
void LIB_PART::ClearEditFlags()
|
||||
{
|
||||
for( LIB_ITEM& item : m_drawings )
|
||||
item.ClearEditFlags();
|
||||
}
|
||||
|
||||
|
||||
LIB_ITEM* LIB_PART::LocateDrawItem( int aUnit, int aConvert,
|
||||
KICAD_T aType, const wxPoint& aPoint )
|
||||
{
|
||||
@ -976,6 +996,15 @@ void LIB_PART::SetUnitCount( int aCount )
|
||||
}
|
||||
|
||||
|
||||
int LIB_PART::GetUnitCount() const
|
||||
{
|
||||
if( PART_SPTR parent = m_parent.lock() )
|
||||
return parent->GetUnitCount();
|
||||
|
||||
return m_unitCount;
|
||||
}
|
||||
|
||||
|
||||
void LIB_PART::SetConversion( bool aSetConvert )
|
||||
{
|
||||
if( aSetConvert == HasConversion() )
|
||||
@ -1021,142 +1050,6 @@ void LIB_PART::SetConversion( bool aSetConvert )
|
||||
}
|
||||
|
||||
|
||||
wxArrayString LIB_PART::GetAliasNames( bool aIncludeRoot ) const
|
||||
{
|
||||
wxArrayString names;
|
||||
|
||||
LIB_ALIASES::const_iterator it;
|
||||
|
||||
for( it=m_aliases.begin(); it != m_aliases.end(); ++it )
|
||||
{
|
||||
if( !aIncludeRoot && (*it)->IsRoot() )
|
||||
continue;
|
||||
|
||||
names.Add( (*it)->GetName() );
|
||||
}
|
||||
|
||||
return names;
|
||||
}
|
||||
|
||||
|
||||
bool LIB_PART::HasAlias( const wxString& aName ) const
|
||||
{
|
||||
wxCHECK2_MSG( !aName.IsEmpty(), return false,
|
||||
wxT( "Cannot get alias with an empty name, bad programmer." ) );
|
||||
|
||||
for( size_t i = 0; i < m_aliases.size(); i++ )
|
||||
{
|
||||
if( aName == m_aliases[i]->GetName() )
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void LIB_PART::RemoveAlias( const wxString& aName )
|
||||
{
|
||||
LIB_ALIAS* a = GetAlias( aName );
|
||||
|
||||
if( a )
|
||||
RemoveAlias( a );
|
||||
}
|
||||
|
||||
|
||||
LIB_ALIAS* LIB_PART::RemoveAlias( LIB_ALIAS* aAlias )
|
||||
{
|
||||
wxCHECK_MSG( aAlias, NULL, wxT( "Cannot remove alias by NULL pointer." ) );
|
||||
|
||||
LIB_ALIAS* nextAlias = NULL;
|
||||
|
||||
LIB_ALIASES::iterator it = find( m_aliases.begin(), m_aliases.end(), aAlias );
|
||||
|
||||
if( it != m_aliases.end() )
|
||||
{
|
||||
bool rename = aAlias->IsRoot();
|
||||
|
||||
wxLogTrace( traceSchLibMem,
|
||||
wxT( "%s: symbol:'%s', alias:'%s', alias count %llu, reference count %ld." ),
|
||||
GetChars( wxString::FromAscii( __WXFUNCTION__ ) ),
|
||||
GetChars( GetName() ),
|
||||
GetChars( aAlias->GetName() ),
|
||||
(long long unsigned) m_aliases.size(),
|
||||
m_me.use_count() );
|
||||
|
||||
it = m_aliases.erase( it );
|
||||
|
||||
if( !m_aliases.empty() )
|
||||
{
|
||||
if( it == m_aliases.end() )
|
||||
it = m_aliases.begin();
|
||||
|
||||
nextAlias = *it;
|
||||
|
||||
if( rename )
|
||||
SetName( nextAlias->GetName() );
|
||||
}
|
||||
}
|
||||
|
||||
return nextAlias;
|
||||
}
|
||||
|
||||
|
||||
void LIB_PART::RemoveAllAliases()
|
||||
{
|
||||
// Remove all of the aliases except the root alias.
|
||||
while( m_aliases.size() > 1 )
|
||||
m_aliases.pop_back();
|
||||
}
|
||||
|
||||
|
||||
LIB_ALIAS* LIB_PART::GetAlias( const wxString& aName ) const
|
||||
{
|
||||
wxCHECK2_MSG( !aName.IsEmpty(), return NULL,
|
||||
wxT( "Cannot get alias with an empty name. Bad programmer!" ) );
|
||||
|
||||
for( LIB_ALIAS* alias : m_aliases)
|
||||
{
|
||||
if( alias->GetName() == aName )
|
||||
return alias;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
LIB_ALIAS* LIB_PART::GetRootAlias() const
|
||||
{
|
||||
for( LIB_ALIAS* alias : m_aliases )
|
||||
{
|
||||
if( alias->IsRoot() )
|
||||
return alias;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
LIB_ALIAS* LIB_PART::GetAlias( size_t aIndex ) const
|
||||
{
|
||||
wxCHECK2_MSG( aIndex < m_aliases.size(), return NULL,
|
||||
wxT( "Illegal alias list index, bad programmer." ) );
|
||||
|
||||
return m_aliases[aIndex];
|
||||
}
|
||||
|
||||
|
||||
void LIB_PART::AddAlias( const wxString& aName )
|
||||
{
|
||||
m_aliases.push_back( new LIB_ALIAS( aName, this ) );
|
||||
}
|
||||
|
||||
|
||||
void LIB_PART::AddAlias( LIB_ALIAS* aAlias )
|
||||
{
|
||||
m_aliases.push_back( aAlias );
|
||||
}
|
||||
|
||||
|
||||
void LIB_PART::SetSubpartIdNotation( int aSep, int aFirstId )
|
||||
{
|
||||
m_subpartFirstId = 'A';
|
||||
|
@ -41,12 +41,11 @@ class EDA_RECT;
|
||||
class LINE_READER;
|
||||
class OUTPUTFORMATTER;
|
||||
class PART_LIB;
|
||||
class LIB_ALIAS;
|
||||
class LIB_PART;
|
||||
class LIB_FIELD;
|
||||
class TEST_LIB_PART_FIXTURE;
|
||||
|
||||
|
||||
typedef std::vector<LIB_ALIAS*> LIB_ALIASES;
|
||||
typedef std::shared_ptr<LIB_PART> PART_SPTR; ///< shared pointer to LIB_PART
|
||||
typedef std::weak_ptr<LIB_PART> PART_REF; ///< weak pointer to LIB_PART
|
||||
typedef MULTIVECTOR<LIB_ITEM, LIB_ARC_T, LIB_FIELD_T> LIB_ITEMS_CONTAINER;
|
||||
@ -61,135 +60,7 @@ enum LIBRENTRYOPTIONS
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Part library alias object definition.
|
||||
*
|
||||
* Part aliases are not really parts. An alias uses the part definition
|
||||
* (graphic, pins...) but has its own name, keywords and documentation. Therefore, when
|
||||
* the part is modified, alias of this part are modified. This is a simple
|
||||
* method to create parts that have the same physical layout with different names
|
||||
* such as 74LS00, 74HC00 ... and many op amps.
|
||||
*/
|
||||
class LIB_ALIAS : public EDA_ITEM, public LIB_TREE_ITEM
|
||||
{
|
||||
/**
|
||||
* Actual LIB_PART referenced by [multiple] aliases.
|
||||
*
|
||||
* @note - Do not delete the shared part. The shared part is shared by
|
||||
* all of the aliases associated with it. A shared LIB_PART will
|
||||
* be deleted when all LIB_ALIASes pointing to it are deleted.
|
||||
*/
|
||||
LIB_PART* shared;
|
||||
|
||||
protected:
|
||||
wxString name;
|
||||
wxString description; ///< documentation for info
|
||||
wxString keyWords; ///< keyword list (used for search for parts by keyword)
|
||||
wxString docFileName; ///< Associate doc file name
|
||||
|
||||
public:
|
||||
LIB_ALIAS( const wxString& aName, LIB_PART* aRootComponent );
|
||||
LIB_ALIAS( const LIB_ALIAS& aAlias, LIB_PART* aRootComponent = NULL );
|
||||
|
||||
virtual ~LIB_ALIAS();
|
||||
|
||||
virtual wxString GetClass() const override
|
||||
{
|
||||
return wxT( "LIB_ALIAS" );
|
||||
}
|
||||
|
||||
// a LIB_ALIAS does not really have a bounding box.
|
||||
// But because it is derived from EDA_ITEM, returns a dummy bounding box
|
||||
// to avoid useless messages in debug mode
|
||||
const EDA_RECT GetBoundingBox() const override;
|
||||
|
||||
/**
|
||||
* Returns a default bounding box for the alias. This will be set to the full
|
||||
* bounding size, ensuring that the alias is always drawn when it is used on screen.
|
||||
*
|
||||
* N.B. This is acceptable only because there is typically only a single LIB_ALIAS
|
||||
* element being drawn (e.g. in the symbol browser)
|
||||
* @return a maximum size view bounding box
|
||||
*/
|
||||
virtual const BOX2I ViewBBox() const override;
|
||||
|
||||
/**
|
||||
* Get the shared LIB_PART.
|
||||
*
|
||||
* @return LIB_PART* - the LIB_PART shared by
|
||||
* this LIB_ALIAS with possibly other LIB_ALIASes.
|
||||
*/
|
||||
LIB_PART* GetPart() const
|
||||
{
|
||||
return shared;
|
||||
}
|
||||
|
||||
PART_LIB* GetLib();
|
||||
|
||||
LIB_ID GetLibId() const override;
|
||||
|
||||
wxString GetLibNickname() const override;
|
||||
const wxString& GetName() const override { return name; }
|
||||
|
||||
void SetName( const wxString& aName );
|
||||
|
||||
void SetDescription( const wxString& aDescription )
|
||||
{
|
||||
description = aDescription;
|
||||
}
|
||||
|
||||
const wxString& GetDescription() override { return description; }
|
||||
|
||||
void SetKeyWords( const wxString& aKeyWords )
|
||||
{
|
||||
keyWords = aKeyWords;
|
||||
}
|
||||
|
||||
const wxString& GetKeyWords() const { return keyWords; }
|
||||
|
||||
void SetDocFileName( const wxString& aDocFileName )
|
||||
{
|
||||
docFileName = aDocFileName;
|
||||
}
|
||||
|
||||
const wxString& GetDocFileName() const { return docFileName; }
|
||||
|
||||
wxString GetSearchText() override;
|
||||
|
||||
/**
|
||||
* For symbols having aliases, IsRoot() indicates the principal item.
|
||||
*/
|
||||
bool IsRoot() const override;
|
||||
|
||||
/**
|
||||
* For symbols with units, return the number of units.
|
||||
*/
|
||||
int GetUnitCount() override;
|
||||
|
||||
/**
|
||||
* For symbols with units, return an identifier for unit x.
|
||||
*/
|
||||
wxString GetUnitReference( int aUnit ) override;
|
||||
|
||||
/**
|
||||
* KEEPCASE sensitive comparison of the part entry name.
|
||||
*/
|
||||
bool operator==( const wxChar* aName ) const;
|
||||
bool operator!=( const wxChar* aName ) const
|
||||
{
|
||||
return !( *this == aName );
|
||||
}
|
||||
|
||||
bool operator==( const LIB_ALIAS* aAlias ) const { return this == aAlias; }
|
||||
|
||||
void ViewGetLayers( int aLayers[], int& aCount ) const override;
|
||||
|
||||
#if defined(DEBUG)
|
||||
void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
|
||||
#endif
|
||||
};
|
||||
|
||||
extern bool operator<( const LIB_ALIAS& aItem1, const LIB_ALIAS& aItem2 );
|
||||
extern bool operator<( const LIB_PART& aItem1, const LIB_PART& aItem2 );
|
||||
|
||||
|
||||
struct PART_DRAW_OPTIONS
|
||||
@ -217,10 +88,14 @@ struct PART_DRAW_OPTIONS
|
||||
* A library symbol object is typically saved and loaded in a part library file (.lib).
|
||||
* Library symbols are different from schematic symbols.
|
||||
*/
|
||||
class LIB_PART : public EDA_ITEM
|
||||
class LIB_PART : public EDA_ITEM, public LIB_TREE_ITEM
|
||||
{
|
||||
PART_SPTR m_me; ///< http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared
|
||||
///< http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared
|
||||
PART_SPTR m_me;
|
||||
PART_REF m_parent; ///< Use for inherited symbols.
|
||||
|
||||
LIB_ID m_libId;
|
||||
|
||||
int m_pinNameOffset; ///< The offset in mils to draw the pin name. Set to 0
|
||||
///< to draw the pin name above the pin.
|
||||
bool m_unitsLocked; ///< True if part has multiple units and changing
|
||||
@ -233,31 +108,35 @@ class LIB_PART : public EDA_ITEM
|
||||
LIB_ITEMS_CONTAINER m_drawings; ///< Drawing items of this part.
|
||||
wxArrayString m_FootprintList; /**< List of suitable footprint names for the
|
||||
part (wild card names accepted). */
|
||||
LIB_ALIASES m_aliases; ///< List of alias object pointers associated with the
|
||||
///< part.
|
||||
PART_LIB* m_library; ///< Library the part belongs to if any.
|
||||
wxString m_name; ///< Symbol name.
|
||||
wxString m_description; ///< documentation for info
|
||||
wxString m_keyWords; ///< keyword list (used for search for parts by keyword)
|
||||
wxString m_docFileName; ///< Associate doc file name
|
||||
|
||||
static int m_subpartIdSeparator; ///< the separator char between
|
||||
///< the subpart id and the reference
|
||||
///< like U1A ( m_subpartIdSeparator = 0 ) or U1.A or U1-A
|
||||
static int m_subpartFirstId; ///< the ascii char value to calculate the subpart symbol id
|
||||
///< from the part number: only 'A', 'a' or '1' can be used,
|
||||
///< other values have no sense.
|
||||
private:
|
||||
///< the subpart id and the reference like U1A
|
||||
///< ( m_subpartIdSeparator = 0 ) or U1.A or U1-A
|
||||
static int m_subpartFirstId; ///< the ASCII char value to calculate the subpart
|
||||
///< symbol id from the part number: only 'A', 'a'
|
||||
///< or '1' can be used, other values have no sense.
|
||||
void deleteAllFields();
|
||||
|
||||
public:
|
||||
|
||||
LIB_PART( const wxString& aName, PART_LIB* aLibrary = NULL );
|
||||
LIB_PART( const wxString& aName, LIB_PART* aParent = nullptr, PART_LIB* aLibrary = nullptr );
|
||||
|
||||
/**
|
||||
* Copy constructor.
|
||||
*/
|
||||
LIB_PART( LIB_PART& aPart, PART_LIB* aLibrary = NULL );
|
||||
|
||||
virtual ~LIB_PART();
|
||||
|
||||
PART_SPTR SharedPtr()
|
||||
{
|
||||
// clone a shared pointer
|
||||
return m_me;
|
||||
}
|
||||
PART_SPTR SharedPtr() { return m_me; }
|
||||
|
||||
void SetParent( LIB_PART* aParent = nullptr );
|
||||
PART_REF& GetParent() { return m_parent; }
|
||||
|
||||
virtual wxString GetClass() const override
|
||||
{
|
||||
@ -265,56 +144,54 @@ public:
|
||||
}
|
||||
|
||||
virtual void SetName( const wxString& aName );
|
||||
const wxString& GetName() const;
|
||||
const wxString GetName() const override { return m_name; }
|
||||
|
||||
const LIB_ID& GetLibId() const { return m_libId; }
|
||||
LIB_ID GetLibId() const override { return m_libId; }
|
||||
void SetLibId( const LIB_ID& aLibId ) { m_libId = aLibId; }
|
||||
|
||||
const wxString GetLibraryName();
|
||||
wxString GetLibNickname() const override { return GetLibraryName(); }
|
||||
|
||||
void SetDescription( const wxString& aDescription )
|
||||
{
|
||||
m_description = aDescription;
|
||||
}
|
||||
|
||||
const wxString GetDescription() override { return m_description; }
|
||||
|
||||
void SetKeyWords( const wxString& aKeyWords )
|
||||
{
|
||||
m_keyWords = aKeyWords;
|
||||
}
|
||||
|
||||
const wxString GetKeyWords() const { return m_keyWords; }
|
||||
|
||||
void SetDocFileName( const wxString& aDocFileName )
|
||||
{
|
||||
m_docFileName = aDocFileName;
|
||||
}
|
||||
|
||||
const wxString GetDocFileName() const { return m_docFileName; }
|
||||
|
||||
wxString GetSearchText() override;
|
||||
|
||||
/**
|
||||
* For symbols derived from other symbols, IsRoot() indicates no derivation.
|
||||
*/
|
||||
bool IsRoot() const override { return m_parent.use_count() == 0; }
|
||||
bool IsAlias() const { return !IsRoot(); }
|
||||
|
||||
const wxString GetLibraryName() const;
|
||||
|
||||
PART_LIB* GetLib() { return m_library; }
|
||||
void SetLib( PART_LIB* aLibrary ) { m_library = aLibrary; }
|
||||
|
||||
wxArrayString GetAliasNames( bool aIncludeRoot = true ) const;
|
||||
|
||||
LIB_ALIASES GetAliases() const { return m_aliases; }
|
||||
|
||||
size_t GetAliasCount() const { return m_aliases.size(); }
|
||||
|
||||
LIB_ALIAS* GetAlias( size_t aIndex ) const;
|
||||
LIB_ALIAS* GetAlias( const wxString& aName ) const;
|
||||
LIB_ALIAS* GetRootAlias() const;
|
||||
|
||||
timestamp_t GetDateLastEdition() const { return m_dateLastEdition; }
|
||||
|
||||
/**
|
||||
* Add an alias \a aName to the part.
|
||||
*
|
||||
* Duplicate alias names are not added to the alias list. Debug builds will raise an
|
||||
* assertion. Release builds will fail silently.
|
||||
*
|
||||
* @param aName - Name of alias to add.
|
||||
*/
|
||||
void AddAlias( const wxString& aName );
|
||||
|
||||
void AddAlias( LIB_ALIAS* aAlias );
|
||||
|
||||
/**
|
||||
* Test if alias \a aName is in part alias list.
|
||||
*
|
||||
* Alias name comparisons are case insensitive.
|
||||
*
|
||||
* @param aName - Name of alias.
|
||||
* @return True if alias name in alias list.
|
||||
*/
|
||||
bool HasAlias( const wxString& aName ) const;
|
||||
|
||||
void RemoveAlias( const wxString& aName );
|
||||
LIB_ALIAS* RemoveAlias( LIB_ALIAS* aAlias );
|
||||
|
||||
void RemoveAllAliases();
|
||||
|
||||
wxArrayString& GetFootprints() { return m_FootprintList; }
|
||||
wxArrayString GetFootprints() const { return m_FootprintList; }
|
||||
void SetFootprintFilters( const wxArrayString& aFootprintFilters )
|
||||
{
|
||||
m_FootprintList = aFootprintFilters;
|
||||
}
|
||||
|
||||
void ViewGetLayers( int aLayers[], int& aCount ) const override;
|
||||
|
||||
@ -384,7 +261,7 @@ public:
|
||||
void GetFields( LIB_FIELDS& aList );
|
||||
|
||||
/**
|
||||
* Findd a field within this part matching \a aFieldName and returns it or NULL if not found.
|
||||
* Find a field within this part matching \a aFieldName and returns it or NULL if not found.
|
||||
*/
|
||||
LIB_FIELD* FindField( const wxString& aFieldName );
|
||||
|
||||
@ -579,10 +456,7 @@ public:
|
||||
*
|
||||
* @return LIB_ITEMS_CONTAINER& - Reference to the draw item object container.
|
||||
*/
|
||||
LIB_ITEMS_CONTAINER& GetDrawItems()
|
||||
{
|
||||
return m_drawings;
|
||||
}
|
||||
LIB_ITEMS_CONTAINER& GetDrawItems() { return m_drawings; }
|
||||
|
||||
SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
|
||||
|
||||
@ -597,7 +471,12 @@ public:
|
||||
* @param count - Number of units per package.
|
||||
*/
|
||||
void SetUnitCount( int count );
|
||||
int GetUnitCount() const { return m_unitCount; }
|
||||
int GetUnitCount() const override;
|
||||
|
||||
/**
|
||||
* Return an identifier for \a aUnit for symbols with units.
|
||||
*/
|
||||
wxString GetUnitReference( int aUnit ) override;
|
||||
|
||||
/**
|
||||
* @return true if the part has multiple units per part.
|
||||
@ -609,7 +488,7 @@ public:
|
||||
* @return the sub reference for part having multiple units per part.
|
||||
* The sub reference identify the part (or unit)
|
||||
* @param aUnit = the part identifier ( 1 to max count)
|
||||
* @param aAddSeparator = true (default) to prpebd the sub ref
|
||||
* @param aAddSeparator = true (default) to prepend the sub ref
|
||||
* by the separator symbol (if any)
|
||||
* Note: this is a static function.
|
||||
*/
|
||||
@ -679,7 +558,28 @@ public:
|
||||
void SetShowPinNumbers( bool aShow ) { m_showPinNumbers = aShow; }
|
||||
bool ShowPinNumbers() { return m_showPinNumbers; }
|
||||
|
||||
bool operator==( const LIB_PART* aPart ) const { return this == aPart; }
|
||||
/**
|
||||
* Comparison test that can be used for operators.
|
||||
*
|
||||
* @param aRhs is the right hand side symbol used for comparison.
|
||||
*
|
||||
* @return -1 if this symbol is less than \a aRhs
|
||||
* 1 if this symbol is greater than \a aRhs
|
||||
* 0 if this symbol is the same as \a aRhs
|
||||
*/
|
||||
int Compare( const LIB_PART& aRhs ) const;
|
||||
|
||||
bool operator==( const LIB_PART* aPart ) const { return this == aPart; }
|
||||
bool operator==( const LIB_PART& aPart ) const { return Compare( aPart ) == 0; }
|
||||
|
||||
/**
|
||||
* Return a flattened symbol inheritance to the caller.
|
||||
*
|
||||
* If the symbol does not inherit from another symbol, a copy of the symbol is returned.
|
||||
*
|
||||
* @return a flattened symbol on the heap
|
||||
*/
|
||||
std::unique_ptr< LIB_PART > Flatten() const;
|
||||
|
||||
#if defined(DEBUG)
|
||||
void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright (C) 2004-2016 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 2004-2017 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2004-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@ -146,7 +146,7 @@ void PART_LIB::EnableBuffering( bool aEnable )
|
||||
}
|
||||
|
||||
|
||||
void PART_LIB::GetAliasNames( wxArrayString& aNames ) const
|
||||
void PART_LIB::GetPartNames( wxArrayString& aNames ) const
|
||||
{
|
||||
m_plugin->EnumerateSymbolLib( aNames, fileName.GetFullPath(), m_properties.get() );
|
||||
|
||||
@ -154,44 +154,27 @@ void PART_LIB::GetAliasNames( wxArrayString& aNames ) const
|
||||
}
|
||||
|
||||
|
||||
void PART_LIB::GetAliases( std::vector<LIB_ALIAS*>& aAliases ) const
|
||||
void PART_LIB::GetParts( std::vector<LIB_PART*>& aSymbols ) const
|
||||
{
|
||||
m_plugin->EnumerateSymbolLib( aAliases, fileName.GetFullPath(), m_properties.get() );
|
||||
m_plugin->EnumerateSymbolLib( aSymbols, fileName.GetFullPath(), m_properties.get() );
|
||||
|
||||
std::sort( aAliases.begin(), aAliases.end(),
|
||||
[](LIB_ALIAS *lhs, LIB_ALIAS *rhs) -> bool
|
||||
std::sort( aSymbols.begin(), aSymbols.end(),
|
||||
[](LIB_PART *lhs, LIB_PART *rhs) -> bool
|
||||
{ return lhs->GetName() < rhs->GetName(); });
|
||||
}
|
||||
|
||||
|
||||
LIB_ALIAS* PART_LIB::FindAlias( const wxString& aName ) const
|
||||
{
|
||||
LIB_ALIAS* alias = m_plugin->LoadSymbol( fileName.GetFullPath(), aName, m_properties.get() );
|
||||
|
||||
// Set the library to this even though technically the legacy cache plugin owns the
|
||||
// symbols. This allows the symbol library table conversion tool to determine the
|
||||
// correct library where the symbol was found.
|
||||
if( alias && alias->GetPart() && !alias->GetPart()->GetLib() )
|
||||
alias->GetPart()->SetLib( const_cast<PART_LIB*>( this ) );
|
||||
|
||||
return alias;
|
||||
}
|
||||
|
||||
|
||||
LIB_ALIAS* PART_LIB::FindAlias( const LIB_ID& aLibId ) const
|
||||
{
|
||||
return FindAlias( aLibId.Format().wx_str() );
|
||||
}
|
||||
|
||||
|
||||
LIB_PART* PART_LIB::FindPart( const wxString& aName ) const
|
||||
{
|
||||
LIB_ALIAS* alias = FindAlias( aName );
|
||||
LIB_PART* symbol = m_plugin->LoadSymbol( fileName.GetFullPath(), aName, m_properties.get() );
|
||||
|
||||
if( alias != NULL )
|
||||
return alias->GetPart();
|
||||
// Set the library to this even though technically the legacy cache plugin owns the
|
||||
// symbols. This allows the symbol library table conversion tool to determine the
|
||||
// correct library where the symbol was found.
|
||||
if( symbol && !symbol->GetLib() )
|
||||
symbol->SetLib( const_cast<PART_LIB*>( this ) );
|
||||
|
||||
return NULL;
|
||||
return symbol;
|
||||
}
|
||||
|
||||
|
||||
@ -204,7 +187,8 @@ LIB_PART* PART_LIB::FindPart( const LIB_ID& aLibId ) const
|
||||
void PART_LIB::AddPart( LIB_PART* aPart )
|
||||
{
|
||||
// add a clone, not the caller's copy, the plugin take ownership of the new symbol.
|
||||
m_plugin->SaveSymbol( fileName.GetFullPath(), new LIB_PART( *aPart, this ), m_properties.get() );
|
||||
m_plugin->SaveSymbol( fileName.GetFullPath(), new LIB_PART( *aPart->SharedPtr().get(), this ),
|
||||
m_properties.get() );
|
||||
|
||||
// If we are not buffering, the library file is updated immediately when the plugin
|
||||
// SaveSymbol() function is called.
|
||||
@ -215,11 +199,11 @@ void PART_LIB::AddPart( LIB_PART* aPart )
|
||||
}
|
||||
|
||||
|
||||
LIB_ALIAS* PART_LIB::RemoveAlias( LIB_ALIAS* aEntry )
|
||||
LIB_PART* PART_LIB::RemovePart( LIB_PART* aEntry )
|
||||
{
|
||||
wxCHECK_MSG( aEntry != NULL, NULL, "NULL pointer cannot be removed from library." );
|
||||
|
||||
m_plugin->DeleteAlias( fileName.GetFullPath(), aEntry->GetName(), m_properties.get() );
|
||||
m_plugin->DeleteSymbol( fileName.GetFullPath(), aEntry->GetName(), m_properties.get() );
|
||||
|
||||
// If we are not buffering, the library file is updated immediately when the plugin
|
||||
// SaveSymbol() function is called.
|
||||
@ -256,19 +240,18 @@ PART_LIB* PART_LIB::LoadLibrary( const wxString& aFileName )
|
||||
{
|
||||
std::unique_ptr<PART_LIB> lib( new PART_LIB( LIBRARY_TYPE_EESCHEMA, aFileName ) );
|
||||
|
||||
std::vector<LIB_ALIAS*> aliases;
|
||||
std::vector<LIB_PART*> parts;
|
||||
// This loads the library.
|
||||
lib->GetAliases( aliases );
|
||||
lib->GetParts( parts );
|
||||
|
||||
// Now, set the LIB_PART m_library member but it will only be used
|
||||
// when loading legacy libraries in the future. Once the symbols in the
|
||||
// schematic have a full #LIB_ID, this will not get called.
|
||||
for( size_t ii = 0; ii < aliases.size(); ii++ )
|
||||
for( size_t ii = 0; ii < parts.size(); ii++ )
|
||||
{
|
||||
LIB_ALIAS* alias = aliases[ii];
|
||||
LIB_PART* part = parts[ii];
|
||||
|
||||
if( alias->GetPart() )
|
||||
alias->GetPart()->SetLib( lib.get() );
|
||||
part->SetLib( lib.get() );
|
||||
}
|
||||
|
||||
PART_LIB* ret = lib.release();
|
||||
@ -394,26 +377,7 @@ LIB_PART* PART_LIBS::FindLibPart( const LIB_ID& aLibId, const wxString& aLibrary
|
||||
}
|
||||
|
||||
|
||||
LIB_ALIAS* PART_LIBS::FindLibraryAlias( const LIB_ID& aLibId, const wxString& aLibraryName )
|
||||
{
|
||||
LIB_ALIAS* entry = NULL;
|
||||
|
||||
for( PART_LIB& lib : *this )
|
||||
{
|
||||
if( !aLibraryName.IsEmpty() && lib.GetName() != aLibraryName )
|
||||
continue;
|
||||
|
||||
entry = lib.FindAlias( aLibId.GetLibItemName().wx_str() );
|
||||
|
||||
if( entry )
|
||||
break;
|
||||
}
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
|
||||
void PART_LIBS::FindLibraryNearEntries( std::vector<LIB_ALIAS*>& aCandidates,
|
||||
void PART_LIBS::FindLibraryNearEntries( std::vector<LIB_PART*>& aCandidates,
|
||||
const wxString& aEntryName,
|
||||
const wxString& aLibraryName )
|
||||
{
|
||||
@ -422,17 +386,17 @@ void PART_LIBS::FindLibraryNearEntries( std::vector<LIB_ALIAS*>& aCandidates,
|
||||
if( !aLibraryName.IsEmpty() && lib.GetName() != aLibraryName )
|
||||
continue;
|
||||
|
||||
wxArrayString aliasNames;
|
||||
wxArrayString partNames;
|
||||
|
||||
lib.GetAliasNames( aliasNames );
|
||||
lib.GetPartNames( partNames );
|
||||
|
||||
if( aliasNames.IsEmpty() )
|
||||
if( partNames.IsEmpty() )
|
||||
continue;
|
||||
|
||||
for( size_t i = 0; i < aliasNames.size(); i++ )
|
||||
for( size_t i = 0; i < partNames.size(); i++ )
|
||||
{
|
||||
if( aliasNames[i].CmpNoCase( aEntryName ) == 0 )
|
||||
aCandidates.push_back( lib.FindAlias( aliasNames[i] ) );
|
||||
if( partNames[i].CmpNoCase( aEntryName ) == 0 )
|
||||
aCandidates.push_back( lib.FindPart( partNames[i] ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 2004-2017 KiCad Developers, see change_log.txt for contributors.
|
||||
* Copyright (C) 2004-2019 KiCad Developers, see change_log.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@ -31,15 +31,16 @@
|
||||
#ifndef CLASS_LIBRARY_H
|
||||
#define CLASS_LIBRARY_H
|
||||
|
||||
#include <boost/ptr_container/ptr_vector.hpp>
|
||||
#include <wx/filename.h>
|
||||
|
||||
#include <class_libentry.h>
|
||||
#include <sch_io_mgr.h>
|
||||
|
||||
#include <project.h>
|
||||
|
||||
#include <map>
|
||||
|
||||
class LIB_PART;
|
||||
class LIB_ID;
|
||||
class LINE_READER;
|
||||
class OUTPUTFORMATTER;
|
||||
@ -163,9 +164,9 @@ class PART_LIB;
|
||||
class wxRegEx;
|
||||
|
||||
/**
|
||||
* LIB_ALIAS map sorting.
|
||||
* LIB_PART map sorting.
|
||||
*/
|
||||
struct AliasMapSort
|
||||
struct LibPartMapSort
|
||||
{
|
||||
bool operator() ( const wxString& aItem1, const wxString& aItem2 ) const
|
||||
{
|
||||
@ -173,11 +174,11 @@ struct AliasMapSort
|
||||
}
|
||||
};
|
||||
|
||||
/// Alias map used by part library object.
|
||||
/// Part map used by part library object.
|
||||
|
||||
typedef std::map< wxString, LIB_ALIAS*, AliasMapSort > LIB_ALIAS_MAP;
|
||||
typedef std::vector< LIB_ALIAS* > LIB_ALIASES;
|
||||
typedef boost::ptr_vector< PART_LIB > PART_LIBS_BASE;
|
||||
typedef std::map< wxString, LIB_PART*, LibPartMapSort > LIB_PART_MAP;
|
||||
typedef std::vector< LIB_PART* > LIB_PARTS;
|
||||
typedef boost::ptr_vector< PART_LIB > PART_LIBS_BASE;
|
||||
|
||||
|
||||
/**
|
||||
@ -276,21 +277,8 @@ public:
|
||||
LIB_PART* FindLibPart( const LIB_ID& aLibId, const wxString& aLibraryName = wxEmptyString );
|
||||
|
||||
/**
|
||||
* Function FindLibraryEntry
|
||||
* searches all libraries in the list for an entry.
|
||||
* Search all libraries in the list for a #LIB_PART using a case insensitive comparison.
|
||||
*
|
||||
* The object can be either a part or an alias.
|
||||
*
|
||||
* @param aLibId - The library indentifaction of entry to search for (case sensitive).
|
||||
* @param aLibraryName - Name of the library to search.
|
||||
* @return The entry object if found, otherwise NULL.
|
||||
*/
|
||||
LIB_ALIAS* FindLibraryAlias( const LIB_ID& aLibId,
|
||||
const wxString& aLibraryName = wxEmptyString );
|
||||
|
||||
/**
|
||||
* Function FindLibraryNearEntries
|
||||
* Searches all libraries in the list for an entry, using a case insensitive comparison.
|
||||
* Helper function used in dialog to find all candidates.
|
||||
* During a long time, eeschema was using a case insensitive search.
|
||||
* Therefore, for old schematics (<= 2013), or libs, for some components,
|
||||
@ -301,7 +289,7 @@ public:
|
||||
* @param aLibraryName - Name of the library to search.
|
||||
* @param aCandidates - a std::vector to store candidates
|
||||
*/
|
||||
void FindLibraryNearEntries( std::vector<LIB_ALIAS*>& aCandidates, const wxString& aEntryName,
|
||||
void FindLibraryNearEntries( std::vector<LIB_PART*>& aCandidates, const wxString& aEntryName,
|
||||
const wxString& aLibraryName = wxEmptyString );
|
||||
|
||||
int GetLibraryCount() { return size(); }
|
||||
@ -310,6 +298,9 @@ public:
|
||||
|
||||
/**
|
||||
* Object used to load, save, search, and otherwise manipulate symbol library files.
|
||||
*
|
||||
* @warning This code is obsolete with the exception of the cache library. All other
|
||||
* symbol library I/O is managed by the #SCH_IO_MGR object.
|
||||
*/
|
||||
class PART_LIB
|
||||
{
|
||||
@ -369,33 +360,20 @@ public:
|
||||
*
|
||||
* @param aNames - String array to place entry names into.
|
||||
*/
|
||||
void GetAliasNames( wxArrayString& aNames ) const;
|
||||
void GetPartNames( wxArrayString& aNames ) const;
|
||||
|
||||
/**
|
||||
* Load a vector with all the entries in this library.
|
||||
*
|
||||
* @param aAliases - vector to receive the aliases.
|
||||
* @param aParts - vector to receive the aliases.
|
||||
*/
|
||||
void GetAliases( std::vector<LIB_ALIAS*>& aAliases ) const;
|
||||
void GetParts( std::vector<LIB_PART*>& aPart) const;
|
||||
|
||||
/**
|
||||
* Find #LIB_ALIAS by \a aName.
|
||||
*
|
||||
* @param aName - Name of entry, case sensitive.
|
||||
* @return #LIB_ALIAS* if found. NULL if not found.
|
||||
*/
|
||||
LIB_ALIAS* FindAlias( const wxString& aName ) const;
|
||||
|
||||
LIB_ALIAS* FindAlias( const LIB_ID& aLibId ) const;
|
||||
|
||||
/**
|
||||
* Find part by \a aName.
|
||||
*
|
||||
* This is a helper for FindEntry so casting a LIB_ALIAS pointer to
|
||||
* a LIB_PART pointer is not required.
|
||||
* Find #LIB_PART by \a aName.
|
||||
*
|
||||
* @param aName - Name of part, case sensitive.
|
||||
* @return LIB_PART* - part if found, else NULL.
|
||||
* @return LIB_PART pointer part if found, else NULL.
|
||||
*/
|
||||
LIB_PART* FindPart( const wxString& aName ) const;
|
||||
|
||||
@ -422,10 +400,11 @@ public:
|
||||
* @param aEntry - Entry to remove from library.
|
||||
* @return The next entry in the library or NULL if the library is empty.
|
||||
*/
|
||||
LIB_ALIAS* RemoveAlias( LIB_ALIAS* aEntry );
|
||||
LIB_PART* RemovePart( LIB_PART* aEntry );
|
||||
|
||||
/**
|
||||
* Replace an existing part entry in the library.
|
||||
*
|
||||
* Note a part can have an alias list,
|
||||
* so these alias will be added in library (and previously existing alias removed)
|
||||
* @param aOldPart - The part to replace.
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include <widgets/symbol_preview_widget.h>
|
||||
#include <wx/clipbrd.h>
|
||||
#include <kiface_i.h>
|
||||
#include <class_libentry.h>
|
||||
|
||||
#define SYM_CHOOSER_HSASH wxT( "SymbolChooserHSashPosition" )
|
||||
#define SYM_CHOOSER_VSASH wxT( "SymbolChooserVSashPosition" )
|
||||
@ -152,7 +153,8 @@ DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT( SCH_BASE_FRAME* aParent, const
|
||||
m_hsplitter->SetSashPosition( m_config->Read( SYM_CHOOSER_HSASH, HorizPixelsFromDU( 220 ) ) );
|
||||
|
||||
if( m_vsplitter )
|
||||
m_vsplitter->SetSashPosition( m_config->Read( SYM_CHOOSER_VSASH, VertPixelsFromDU( 230 ) ) );
|
||||
m_vsplitter->SetSashPosition( m_config->Read( SYM_CHOOSER_VSASH,
|
||||
VertPixelsFromDU( 230 ) ) );
|
||||
|
||||
wxSize dlgSize( m_config->Read( SYM_CHOOSER_WIDTH_KEY, HorizPixelsFromDU( 390 ) ),
|
||||
m_config->Read( SYM_CHOOSER_HEIGHT_KEY, VertPixelsFromDU( 300 ) ) );
|
||||
@ -353,11 +355,11 @@ void DIALOG_CHOOSE_COMPONENT::ShowFootprintFor( LIB_ID const& aLibId )
|
||||
if( !m_fp_preview || !m_fp_preview->IsInitialized() )
|
||||
return;
|
||||
|
||||
LIB_ALIAS* alias = nullptr;
|
||||
LIB_PART* symbol = nullptr;
|
||||
|
||||
try
|
||||
{
|
||||
alias = Prj().SchSymbolLibTable()->LoadSymbol( aLibId );
|
||||
symbol = Prj().SchSymbolLibTable()->LoadSymbol( aLibId );
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
{
|
||||
@ -367,10 +369,10 @@ void DIALOG_CHOOSE_COMPONENT::ShowFootprintFor( LIB_ID const& aLibId )
|
||||
ioe.What() ) );
|
||||
}
|
||||
|
||||
if( !alias )
|
||||
if( !symbol )
|
||||
return;
|
||||
|
||||
LIB_FIELD* fp_field = alias->GetPart()->GetField( FOOTPRINT );
|
||||
LIB_FIELD* fp_field = symbol->GetField( FOOTPRINT );
|
||||
wxString fp_name = fp_field ? fp_field->GetFullText() : wxString( "" );
|
||||
|
||||
ShowFootprint( fp_name );
|
||||
@ -411,13 +413,13 @@ void DIALOG_CHOOSE_COMPONENT::PopulateFootprintSelector( LIB_ID const& aLibId )
|
||||
|
||||
m_fp_sel_ctrl->ClearFilters();
|
||||
|
||||
LIB_ALIAS* alias = nullptr;
|
||||
LIB_PART* symbol = nullptr;
|
||||
|
||||
if( aLibId.IsValid() )
|
||||
{
|
||||
try
|
||||
{
|
||||
alias = Prj().SchSymbolLibTable()->LoadSymbol( aLibId );
|
||||
symbol = Prj().SchSymbolLibTable()->LoadSymbol( aLibId );
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
{
|
||||
@ -429,16 +431,16 @@ void DIALOG_CHOOSE_COMPONENT::PopulateFootprintSelector( LIB_ID const& aLibId )
|
||||
}
|
||||
}
|
||||
|
||||
if( alias != nullptr )
|
||||
if( symbol != nullptr )
|
||||
{
|
||||
LIB_PINS temp_pins;
|
||||
LIB_FIELD* fp_field = alias->GetPart()->GetField( FOOTPRINT );
|
||||
LIB_FIELD* fp_field = symbol->GetField( FOOTPRINT );
|
||||
wxString fp_name = fp_field ? fp_field->GetFullText() : wxString( "" );
|
||||
|
||||
alias->GetPart()->GetPins( temp_pins );
|
||||
symbol->GetPins( temp_pins );
|
||||
|
||||
m_fp_sel_ctrl->FilterByPinCount( temp_pins.size() );
|
||||
m_fp_sel_ctrl->FilterByFootprintFilters( alias->GetPart()->GetFootprints(), true );
|
||||
m_fp_sel_ctrl->FilterByFootprintFilters( symbol->GetFootprints(), true );
|
||||
m_fp_sel_ctrl->SetDefaultFootprint( fp_name );
|
||||
m_fp_sel_ctrl->UpdateList();
|
||||
m_fp_sel_ctrl->Enable();
|
||||
|
@ -33,7 +33,8 @@
|
||||
#include <widgets/wx_grid.h>
|
||||
#include <widgets/grid_text_button_helpers.h>
|
||||
#include <lib_edit_frame.h>
|
||||
#include <class_library.h>
|
||||
#include <lib_manager.h>
|
||||
#include <class_libentry.h>
|
||||
#include <symbol_lib_table.h>
|
||||
#include <sch_item.h>
|
||||
#include <sch_component.h>
|
||||
@ -51,6 +52,8 @@
|
||||
#define LibEditFieldsShownColumnsKey wxT( "LibEditFieldsShownColumns" )
|
||||
|
||||
int DIALOG_EDIT_COMPONENT_IN_LIBRARY::m_lastOpenedPage = 0;
|
||||
DIALOG_EDIT_COMPONENT_IN_LIBRARY::LAST_LAYOUT
|
||||
DIALOG_EDIT_COMPONENT_IN_LIBRARY::m_lastLayout = DIALOG_EDIT_COMPONENT_IN_LIBRARY::NONE;
|
||||
|
||||
|
||||
DIALOG_EDIT_COMPONENT_IN_LIBRARY::DIALOG_EDIT_COMPONENT_IN_LIBRARY( LIB_EDIT_FRAME* aParent,
|
||||
@ -58,7 +61,6 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY::DIALOG_EDIT_COMPONENT_IN_LIBRARY( LIB_EDIT_FRA
|
||||
DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( aParent ),
|
||||
m_Parent( aParent ),
|
||||
m_libEntry( aLibEntry ),
|
||||
m_currentAlias( wxNOT_FOUND ),
|
||||
m_pinNameOffset( aParent, m_nameOffsetLabel, m_nameOffsetCtrl, m_nameOffsetUnits, true ),
|
||||
m_delayedFocusCtrl( nullptr ),
|
||||
m_delayedFocusGrid( nullptr ),
|
||||
@ -71,37 +73,17 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY::DIALOG_EDIT_COMPONENT_IN_LIBRARY( LIB_EDIT_FRA
|
||||
|
||||
// Give a bit more room for combobox editors
|
||||
m_grid->SetDefaultRowSize( m_grid->GetDefaultRowSize() + 4 );
|
||||
m_aliasGrid->SetDefaultRowSize( m_aliasGrid->GetDefaultRowSize() + 4 );
|
||||
|
||||
// Work around a bug in wxWidgets where it fails to recalculate the grid height
|
||||
// after changing the default row size
|
||||
m_aliasGrid->AppendRows( 1 );
|
||||
m_aliasGrid->DeleteRows( m_grid->GetNumberRows() - 1, 1 );
|
||||
|
||||
m_fields = new FIELDS_GRID_TABLE<LIB_FIELD>( this, aParent, m_libEntry );
|
||||
m_grid->SetTable( m_fields );
|
||||
|
||||
m_grid->PushEventHandler( new FIELDS_GRID_TRICKS( m_grid, this ) );
|
||||
m_aliasGrid->PushEventHandler( new FIELDS_GRID_TRICKS( m_grid, this ) );
|
||||
|
||||
// Show/hide columns according to the user's preference
|
||||
m_config->Read( LibEditFieldsShownColumnsKey, &m_shownColumns, wxT( "0 1 2 3 4 5 6 7" ) );
|
||||
m_grid->ShowHideColumns( m_shownColumns );
|
||||
|
||||
// Hide non-overridden rows in aliases grid
|
||||
m_aliasGrid->HideRow( REFERENCE );
|
||||
m_aliasGrid->HideRow( FOOTPRINT );
|
||||
|
||||
wxGridCellAttr* attr = new wxGridCellAttr;
|
||||
attr->SetReadOnly();
|
||||
m_aliasGrid->SetColAttr( FDC_NAME, attr );
|
||||
m_aliasGrid->SetCellValue( VALUE, FDC_NAME, TEMPLATE_FIELDNAME::GetDefaultFieldName( VALUE ) );
|
||||
m_aliasGrid->SetCellValue( DATASHEET, FDC_NAME,
|
||||
TEMPLATE_FIELDNAME::GetDefaultFieldName( DATASHEET ) );
|
||||
|
||||
attr = new wxGridCellAttr;
|
||||
attr->SetEditor( new GRID_CELL_URL_EDITOR( this ) );
|
||||
m_aliasGrid->SetAttr( DATASHEET, FDC_VALUE, attr );
|
||||
m_grid->SetAttr( DATASHEET, FDC_VALUE, attr );
|
||||
|
||||
m_SymbolNameCtrl->SetValidator( SCH_FIELD_VALIDATOR( true, VALUE ) );
|
||||
|
||||
@ -110,8 +92,6 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY::DIALOG_EDIT_COMPONENT_IN_LIBRARY( LIB_EDIT_FRA
|
||||
m_bpDelete->SetBitmap( KiBitmap( trash_xpm ) );
|
||||
m_bpMoveUp->SetBitmap( KiBitmap( small_up_xpm ) );
|
||||
m_bpMoveDown->SetBitmap( KiBitmap( small_down_xpm ) );
|
||||
m_addAliasButton->SetBitmap( KiBitmap( small_plus_xpm ) );
|
||||
m_deleteAliasButton->SetBitmap( KiBitmap( trash_xpm ) );
|
||||
m_addFilterButton->SetBitmap( KiBitmap( small_plus_xpm ) );
|
||||
m_deleteFilterButton->SetBitmap( KiBitmap( trash_xpm ) );
|
||||
m_editFilterButton->SetBitmap( KiBitmap( small_edit_xpm ) );
|
||||
@ -126,12 +106,21 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY::DIALOG_EDIT_COMPONENT_IN_LIBRARY( LIB_EDIT_FRA
|
||||
m_grid->Connect( wxEVT_GRID_CELL_CHANGING,
|
||||
wxGridEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnGridCellChanging ),
|
||||
NULL, this );
|
||||
m_aliasGrid->Connect( wxEVT_GRID_CELL_CHANGING,
|
||||
wxGridEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnAliasGridCellChanging ),
|
||||
NULL, this );
|
||||
|
||||
if( m_lastLayout != DIALOG_EDIT_COMPONENT_IN_LIBRARY::NONE )
|
||||
{
|
||||
if( ( m_lastLayout == DIALOG_EDIT_COMPONENT_IN_LIBRARY::ALIAS && aLibEntry->IsRoot() )
|
||||
|| ( m_lastLayout == DIALOG_EDIT_COMPONENT_IN_LIBRARY::PARENT && aLibEntry->IsAlias() ) )
|
||||
{
|
||||
ResetSize();
|
||||
}
|
||||
}
|
||||
|
||||
m_lastLayout = ( aLibEntry->IsAlias() ) ? DIALOG_EDIT_COMPONENT_IN_LIBRARY::ALIAS :
|
||||
DIALOG_EDIT_COMPONENT_IN_LIBRARY::PARENT;
|
||||
|
||||
m_grid->GetParent()->Layout();
|
||||
m_aliasGrid->GetParent()->Layout();
|
||||
syncControlStates( m_libEntry->IsAlias() );
|
||||
Layout();
|
||||
|
||||
FinishDialogSettings();
|
||||
@ -150,18 +139,9 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY::~DIALOG_EDIT_COMPONENT_IN_LIBRARY()
|
||||
m_grid->Disconnect( wxEVT_GRID_CELL_CHANGING,
|
||||
wxGridEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnGridCellChanging ),
|
||||
NULL, this );
|
||||
m_aliasGrid->Disconnect( wxEVT_GRID_CELL_CHANGING,
|
||||
wxGridEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnAliasGridCellChanging ),
|
||||
NULL, this );
|
||||
|
||||
// Delete the GRID_TRICKS.
|
||||
m_grid->PopEventHandler( true );
|
||||
m_aliasGrid->PopEventHandler( true );
|
||||
|
||||
// An OK will have transferred these and cleared the buffer, but we have to delete them
|
||||
// on a Cancel.
|
||||
for( LIB_ALIAS* alias : m_aliasesBuffer )
|
||||
delete alias;
|
||||
}
|
||||
|
||||
|
||||
@ -170,23 +150,11 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataToWindow()
|
||||
if( !wxDialog::TransferDataToWindow() )
|
||||
return false;
|
||||
|
||||
LIB_ALIAS* rootAlias = m_libEntry->GetAlias( m_libEntry->GetName() );
|
||||
|
||||
// Push a copy of each field into m_fields
|
||||
m_libEntry->GetFields( *m_fields );
|
||||
|
||||
// The datasheet field is special. Grab its value from the LIB_ALIAS document file
|
||||
// member except for old libraries that saved the root alias document file in the
|
||||
// datasheet field in the LIB_PART object.
|
||||
if( rootAlias->GetDocFileName().IsEmpty() )
|
||||
{
|
||||
m_fields->at( DATASHEET ).SetText( m_libEntry->GetField( DATASHEET )->GetText() );
|
||||
rootAlias->SetDocFileName( m_libEntry->GetField( DATASHEET )->GetText() );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_fields->at( DATASHEET ).SetText( rootAlias->GetDocFileName() );
|
||||
}
|
||||
// Copy the data sheet field from the old alias document file name.
|
||||
m_fields->at( DATASHEET ).SetText( m_libEntry->GetDocFileName() );
|
||||
|
||||
// The Y axis for components in lib is from bottom to top while the screen axis is top
|
||||
// to bottom: we must change the y coord sign for editing
|
||||
@ -200,13 +168,12 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataToWindow()
|
||||
// notify the grid
|
||||
wxGridTableMessage msg( m_fields, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, m_fields->GetNumberRows() );
|
||||
m_grid->ProcessTableMessage( msg );
|
||||
adjustGridColumns( m_grid->GetRect().GetWidth());
|
||||
adjustGridColumns( m_grid->GetRect().GetWidth() );
|
||||
|
||||
m_SymbolNameCtrl->SetValue( m_libEntry->GetName() );
|
||||
|
||||
m_DescCtrl->SetValue( rootAlias->GetDescription() );
|
||||
m_KeywordCtrl->SetValue( rootAlias->GetKeyWords() );
|
||||
|
||||
m_DescCtrl->SetValue( m_libEntry->GetDescription() );
|
||||
m_KeywordCtrl->SetValue( m_libEntry->GetKeyWords() );
|
||||
m_SelNumberOfUnits->SetValue( m_libEntry->GetUnitCount() );
|
||||
m_OptionPartsLocked->SetValue( m_libEntry->UnitsLocked() && m_libEntry->GetUnitCount() > 1 );
|
||||
m_AsConvertButt->SetValue( m_libEntry->HasConversion() );
|
||||
@ -217,27 +184,36 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataToWindow()
|
||||
m_PinsNameInsideButt->SetValue( m_libEntry->GetPinNameOffset() != 0 );
|
||||
m_pinNameOffset.SetValue( Mils2iu( m_libEntry->GetPinNameOffset() ) );
|
||||
|
||||
const LIB_ALIASES aliases = m_libEntry->GetAliases();
|
||||
wxArrayString tmp = m_libEntry->GetFootprints();
|
||||
m_FootprintFilterListBox->Append( tmp );
|
||||
|
||||
for( LIB_ALIAS* alias : aliases )
|
||||
// Populate the list of root parts for inherited objects.
|
||||
if( m_libEntry->IsAlias() )
|
||||
{
|
||||
if( alias->IsRoot() )
|
||||
continue;
|
||||
wxArrayString rootSymbolNames;
|
||||
wxString libName = m_Parent->GetCurLib();
|
||||
|
||||
m_aliasesBuffer.push_back( new LIB_ALIAS( *alias, m_libEntry ) );
|
||||
m_aliasListBox->Append( alias->GetName() );
|
||||
// Someone forgot to set the current library in the editor frame window.
|
||||
wxCHECK( !libName.empty(), false );
|
||||
|
||||
m_Parent->GetLibManager().GetRootSymbolNames( libName, rootSymbolNames );
|
||||
m_inheritanceSelectCombo->Append( rootSymbolNames );
|
||||
|
||||
PART_SPTR rootPart = m_libEntry->GetParent().lock();
|
||||
|
||||
wxCHECK( rootPart, false );
|
||||
|
||||
wxString parentName = rootPart->GetName();
|
||||
int selection = m_inheritanceSelectCombo->FindString( parentName );
|
||||
|
||||
wxCHECK( selection != wxNOT_FOUND, false );
|
||||
m_inheritanceSelectCombo->SetSelection( selection );
|
||||
|
||||
// Copy the reference field from the root symbol to prevent validation errors.
|
||||
m_fields->at( REFERENCE ).SetText( rootPart->GetReferenceField().GetText() );
|
||||
m_lastOpenedPage = 0;
|
||||
}
|
||||
|
||||
if( m_aliasListBox->GetCount() )
|
||||
m_aliasListBox->SetSelection( 0 );
|
||||
|
||||
wxCommandEvent dummy;
|
||||
OnSelectAlias( dummy );
|
||||
|
||||
adjustAliasGridColumns( m_aliasGrid->GetClientRect().GetWidth() - 4 );
|
||||
|
||||
m_FootprintFilterListBox->Append( m_libEntry->GetFootprints() );
|
||||
|
||||
m_NoteBook->SetSelection( (unsigned) m_lastOpenedPage );
|
||||
|
||||
return true;
|
||||
@ -246,7 +222,7 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataToWindow()
|
||||
|
||||
bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::Validate()
|
||||
{
|
||||
if( !m_grid->CommitPendingChanges() || !m_aliasGrid->CommitPendingChanges() )
|
||||
if( !m_grid->CommitPendingChanges() )
|
||||
return false;
|
||||
|
||||
if( !SCH_COMPONENT::IsReferenceStringValid( m_fields->at( REFERENCE ).GetText() ) )
|
||||
@ -310,7 +286,6 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow()
|
||||
if( !wxDialog::TransferDataFromWindow() )
|
||||
return false;
|
||||
|
||||
LIB_ALIAS* rootAlias = m_libEntry->GetAlias( m_libEntry->GetName() );
|
||||
// We need to keep the name and the value the same at the moment!
|
||||
wxString newName = m_fields->at( VALUE ).GetText();
|
||||
|
||||
@ -329,19 +304,15 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow()
|
||||
}
|
||||
|
||||
// Datasheet field is special; copy it to the root alias docfilename
|
||||
rootAlias->SetDocFileName( m_fields->at( DATASHEET ).GetText() );
|
||||
|
||||
m_libEntry->SetDocFileName( m_fields->at( DATASHEET ).GetText() );
|
||||
m_libEntry->SetFields( *m_fields );
|
||||
|
||||
// We need to keep the name and the value the same at the moment!
|
||||
m_libEntry->SetName( newName );
|
||||
|
||||
rootAlias->SetDescription( m_DescCtrl->GetValue() );
|
||||
rootAlias->SetKeyWords( m_KeywordCtrl->GetValue() );
|
||||
|
||||
m_libEntry->SetDescription( m_DescCtrl->GetValue() );
|
||||
m_libEntry->SetKeyWords( m_KeywordCtrl->GetValue() );
|
||||
m_libEntry->SetUnitCount( m_SelNumberOfUnits->GetValue() );
|
||||
m_libEntry->LockUnits( m_libEntry->GetUnitCount() > 1 && m_OptionPartsLocked->GetValue() );
|
||||
|
||||
m_libEntry->SetConversion( m_AsConvertButt->GetValue() );
|
||||
|
||||
if( m_OptionPower->GetValue() )
|
||||
@ -364,16 +335,7 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow()
|
||||
m_libEntry->SetPinNameOffset( 0 ); // pin text outside the body (name is on the pin)
|
||||
}
|
||||
|
||||
transferAliasDataToBuffer();
|
||||
m_libEntry->RemoveAllAliases();
|
||||
|
||||
for( LIB_ALIAS* alias : m_aliasesBuffer )
|
||||
m_libEntry->AddAlias( alias ); // Transfers ownership; no need to delete
|
||||
|
||||
m_aliasesBuffer.clear();
|
||||
|
||||
m_libEntry->GetFootprints().Clear();
|
||||
m_libEntry->GetFootprints() = m_FootprintFilterListBox->GetStrings();
|
||||
m_libEntry->SetFootprintFilters( m_FootprintFilterListBox->GetStrings() );
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -513,77 +475,6 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnMoveDown( wxCommandEvent& event )
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EDIT_COMPONENT_IN_LIBRARY::updateAliasName( bool aFromGrid, const wxString& aName )
|
||||
{
|
||||
int idx = m_aliasListBox->GetSelection();
|
||||
|
||||
if( idx >= 0 )
|
||||
{
|
||||
m_aliasListBox->SetString( (unsigned) idx, aName );
|
||||
m_aliasesBuffer[ idx ]->SetName( aName );
|
||||
|
||||
if( aFromGrid )
|
||||
m_AliasNameCtrl->ChangeValue( aName );
|
||||
else
|
||||
m_aliasGrid->SetCellValue( VALUE, FDC_VALUE, aName );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnAliasGridCellChanging( wxGridEvent& event )
|
||||
{
|
||||
if( event.GetRow() == VALUE )
|
||||
{
|
||||
int idx = m_aliasListBox->GetSelection();
|
||||
wxString newName = event.GetString();
|
||||
|
||||
if( idx < 0 || !checkAliasName( newName ) )
|
||||
{
|
||||
event.Veto();
|
||||
|
||||
m_delayedFocusGrid = m_aliasGrid;
|
||||
m_delayedFocusRow = event.GetRow();
|
||||
m_delayedFocusColumn = event.GetCol();
|
||||
m_delayedFocusPage = 1;
|
||||
}
|
||||
else
|
||||
updateAliasName( true, newName );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnAliasNameText( wxCommandEvent& event )
|
||||
{
|
||||
updateAliasName( false, m_AliasNameCtrl->GetValue() );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnAliasNameKillFocus( wxFocusEvent& event )
|
||||
{
|
||||
if( !m_delayedFocusCtrl && !checkAliasName( m_AliasNameCtrl->GetValue() ) )
|
||||
{
|
||||
m_delayedFocusCtrl = m_AliasNameCtrl;
|
||||
m_delayedFocusPage = 1;
|
||||
}
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EDIT_COMPONENT_IN_LIBRARY::transferAliasDataToBuffer()
|
||||
{
|
||||
if( m_currentAlias >= 0 )
|
||||
{
|
||||
LIB_ALIAS* alias = m_aliasesBuffer[ m_currentAlias ];
|
||||
|
||||
alias->SetName( m_aliasGrid->GetCellValue( VALUE, FDC_VALUE ) );
|
||||
alias->SetDocFileName( m_aliasGrid->GetCellValue( DATASHEET, FDC_VALUE ) );
|
||||
alias->SetDescription( m_AliasDescCtrl->GetValue() );
|
||||
alias->SetKeyWords( m_AliasKeywordsCtrl->GetValue() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnEditSpiceModel( wxCommandEvent& event )
|
||||
{
|
||||
#ifdef KICAD_SPICE
|
||||
@ -613,153 +504,6 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnEditSpiceModel( wxCommandEvent& event )
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnSelectAlias( wxCommandEvent& event )
|
||||
{
|
||||
if( m_delayedFocusCtrl || !m_aliasGrid->CommitPendingChanges() )
|
||||
{
|
||||
m_aliasListBox->SetSelection( m_currentAlias ); // veto selection change
|
||||
return;
|
||||
}
|
||||
|
||||
// Copy any pending changes back into the buffer
|
||||
transferAliasDataToBuffer();
|
||||
|
||||
LIB_ALIAS* alias = nullptr;
|
||||
int newIdx = m_aliasListBox->GetSelection();
|
||||
|
||||
if( newIdx >= 0 )
|
||||
{
|
||||
alias = m_aliasesBuffer[ newIdx ];
|
||||
|
||||
m_aliasGrid->SetCellValue( VALUE, FDC_VALUE, alias->GetName() );
|
||||
m_aliasGrid->SetCellValue( DATASHEET, FDC_VALUE, alias->GetDocFileName() );
|
||||
m_aliasGrid->Enable( true );
|
||||
|
||||
// Use ChangeValue() so we don't generate events
|
||||
m_AliasNameCtrl->ChangeValue( alias->GetName() );
|
||||
m_AliasNameCtrl->Enable( true );
|
||||
m_AliasDescCtrl->ChangeValue( alias->GetDescription() );
|
||||
m_AliasDescCtrl->Enable( true );
|
||||
m_AliasKeywordsCtrl->ChangeValue( alias->GetKeyWords() );
|
||||
m_AliasKeywordsCtrl->Enable( true );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_aliasGrid->SetCellValue( VALUE, FDC_VALUE, wxEmptyString );
|
||||
m_aliasGrid->SetCellValue( DATASHEET, FDC_VALUE, wxEmptyString );
|
||||
m_aliasGrid->Enable( false );
|
||||
|
||||
// Use ChangeValue() so we don't generate events
|
||||
m_AliasNameCtrl->ChangeValue( wxEmptyString );
|
||||
m_AliasNameCtrl->Enable( false );
|
||||
m_AliasDescCtrl->ChangeValue( wxEmptyString );
|
||||
m_AliasDescCtrl->Enable( false );
|
||||
m_AliasKeywordsCtrl->ChangeValue( wxEmptyString );
|
||||
m_AliasKeywordsCtrl->Enable( false );
|
||||
}
|
||||
|
||||
m_currentAlias = newIdx;
|
||||
}
|
||||
|
||||
|
||||
bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::checkAliasName( const wxString& aName )
|
||||
{
|
||||
if( aName.IsEmpty() )
|
||||
return false;
|
||||
|
||||
if( m_SymbolNameCtrl->GetValue().CmpNoCase( aName ) == 0 )
|
||||
{
|
||||
wxString msg;
|
||||
msg.Printf( _( "Alias can not have same name as symbol." ) );
|
||||
DisplayInfoMessage( this, msg );
|
||||
return false;
|
||||
}
|
||||
|
||||
for( int i = 0; i < (int)m_aliasListBox->GetCount(); ++i )
|
||||
{
|
||||
if( i == m_aliasListBox->GetSelection() )
|
||||
continue;
|
||||
|
||||
if( m_aliasListBox->GetString( i ).CmpNoCase( aName ) == 0 )
|
||||
{
|
||||
wxString msg;
|
||||
msg.Printf( _( "Alias \"%s\" already exists." ), aName );
|
||||
DisplayInfoMessage( this, msg );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
wxString library = m_Parent->GetCurLib();
|
||||
|
||||
if( !library.empty() )
|
||||
{
|
||||
LIB_ALIAS* existing = Prj().SchSymbolLibTable()->LoadSymbol( library, aName );
|
||||
|
||||
if( existing && existing->GetPart()->GetName() != m_libEntry->GetName() )
|
||||
{
|
||||
wxString msg;
|
||||
msg.Printf( _( "Symbol name \"%s\" already exists in library \"%s\"." ),
|
||||
aName, library );
|
||||
DisplayErrorMessage( this, msg );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnAddAlias( wxCommandEvent& event )
|
||||
{
|
||||
if( m_delayedFocusCtrl || !m_aliasGrid->CommitPendingChanges() )
|
||||
return;
|
||||
|
||||
wxCommandEvent dummy;
|
||||
wxString aliasname = _( "untitled" );
|
||||
int suffix = 1;
|
||||
|
||||
while( m_aliasListBox->FindString( aliasname ) != wxNOT_FOUND )
|
||||
aliasname = wxString::Format( _( "untitled%i" ), suffix++ );
|
||||
|
||||
LIB_ALIAS* alias = new LIB_ALIAS( aliasname, m_libEntry );
|
||||
|
||||
// Initialize with parent's data
|
||||
alias->SetDescription( m_DescCtrl->GetValue() );
|
||||
alias->SetKeyWords( m_KeywordCtrl->GetValue() );
|
||||
alias->SetDocFileName( m_grid->GetCellValue( DATASHEET, FDC_VALUE ) );
|
||||
|
||||
m_aliasesBuffer.push_back( alias ); // transfers ownership of alias to aliasesBuffer
|
||||
|
||||
m_aliasListBox->Append( aliasname );
|
||||
m_aliasListBox->SetSelection( m_aliasListBox->GetCount() - 1 );
|
||||
OnSelectAlias( dummy );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnDeleteAlias( wxCommandEvent& event )
|
||||
{
|
||||
if( m_delayedFocusCtrl || !m_aliasGrid->CommitPendingChanges() )
|
||||
return;
|
||||
|
||||
int sel = m_aliasListBox->GetSelection();
|
||||
|
||||
if( sel == wxNOT_FOUND )
|
||||
return;
|
||||
|
||||
m_aliasListBox->Delete( (unsigned) sel );
|
||||
m_aliasesBuffer.erase( m_aliasesBuffer.begin() + sel );
|
||||
m_currentAlias = wxNOT_FOUND;
|
||||
|
||||
if( m_aliasListBox->GetCount() == 0 )
|
||||
m_aliasListBox->SetSelection( wxNOT_FOUND );
|
||||
else
|
||||
m_aliasListBox->SetSelection( std::max( 0, sel - 1 ) );
|
||||
|
||||
wxCommandEvent dummy;
|
||||
OnSelectAlias( dummy );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnFilterDClick( wxMouseEvent& event)
|
||||
{
|
||||
int idx = m_FootprintFilterListBox->HitTest( event.GetPosition() );
|
||||
@ -783,11 +527,6 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnCancelButtonClick( wxCommandEvent& even
|
||||
void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnAddFootprintFilter( wxCommandEvent& event )
|
||||
{
|
||||
wxString filterLine;
|
||||
LIB_PART* component = m_Parent->GetCurPart();
|
||||
|
||||
if( component == NULL )
|
||||
return;
|
||||
|
||||
WX_TEXT_ENTRY_DIALOG dlg( this, _( "Filter:" ), _( "Add Footprint Filter" ), filterLine );
|
||||
|
||||
if( dlg.ShowModal() == wxID_CANCEL || dlg.GetValue().IsEmpty() )
|
||||
@ -853,13 +592,6 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::adjustGridColumns( int aWidth )
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EDIT_COMPONENT_IN_LIBRARY::adjustAliasGridColumns( int aWidth )
|
||||
{
|
||||
m_aliasGrid->AutoSizeColumn( FDC_NAME );
|
||||
m_aliasGrid->SetColSize( FDC_VALUE, aWidth - m_aliasGrid->GetColSize( FDC_NAME ) - 2 );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnUpdateUI( wxUpdateUIEvent& event )
|
||||
{
|
||||
m_OptionPartsLocked->Enable( m_SelNumberOfUnits->GetValue() > 1 );
|
||||
@ -878,13 +610,6 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnUpdateUI( wxUpdateUIEvent& event )
|
||||
}
|
||||
}
|
||||
|
||||
// Synthesize a Select event when the selection is cleared
|
||||
if( m_aliasListBox->GetSelection() == wxNOT_FOUND && m_currentAlias != wxNOT_FOUND )
|
||||
{
|
||||
wxCommandEvent dummy;
|
||||
OnSelectAlias( dummy );
|
||||
}
|
||||
|
||||
// Handle shown columns changes
|
||||
wxString shownColumns = m_grid->GetShownColumns();
|
||||
|
||||
@ -957,9 +682,21 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnSizeGrid( wxSizeEvent& event )
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnSizeAliasGrid( wxSizeEvent& event )
|
||||
void DIALOG_EDIT_COMPONENT_IN_LIBRARY::syncControlStates( bool aIsAlias )
|
||||
{
|
||||
adjustAliasGridColumns( event.GetSize().GetX() );
|
||||
if( aIsAlias )
|
||||
m_PanelFootprintFilter->Hide();
|
||||
else
|
||||
m_PanelFootprintFilter->Show();
|
||||
|
||||
event.Skip();
|
||||
bSizerLowerBasicPanel->Show( !aIsAlias );
|
||||
bButtonSize->Show( !aIsAlias );
|
||||
|
||||
#ifdef KICAD_SPICE
|
||||
m_spiceFieldsButton->Show( !aIsAlias );
|
||||
#endif
|
||||
|
||||
m_inheritanceSelectCombo->Enable( aIsAlias );
|
||||
m_inheritsStaticText->Enable( aIsAlias );
|
||||
m_grid->ForceRefresh();
|
||||
}
|
||||
|
@ -26,7 +26,6 @@
|
||||
#define _DIALOG_EDIT_COMPONENT_IN_LIB_H_
|
||||
|
||||
#include <fields_grid_table.h>
|
||||
#include <class_library.h>
|
||||
#include <widgets/unit_binder.h>
|
||||
#include <dialog_edit_component_in_lib_base.h>
|
||||
|
||||
@ -40,6 +39,14 @@ class DIALOG_EDIT_COMPONENT_IN_LIBRARY: public DIALOG_EDIT_COMPONENT_IN_LIBRARY_
|
||||
{
|
||||
static int m_lastOpenedPage; // To remember the last notebook selection
|
||||
|
||||
enum LAST_LAYOUT {
|
||||
NONE,
|
||||
ALIAS,
|
||||
PARENT
|
||||
};
|
||||
|
||||
static LAST_LAYOUT m_lastLayout;
|
||||
|
||||
public:
|
||||
wxConfigBase* m_config;
|
||||
|
||||
@ -48,8 +55,6 @@ public:
|
||||
|
||||
FIELDS_GRID_TABLE<LIB_FIELD>* m_fields;
|
||||
|
||||
int m_currentAlias;
|
||||
LIB_ALIASES m_aliasesBuffer;
|
||||
UNIT_BINDER m_pinNameOffset;
|
||||
|
||||
wxControl* m_delayedFocusCtrl;
|
||||
@ -81,27 +86,18 @@ private:
|
||||
void OnMoveDown( wxCommandEvent& event ) override;
|
||||
void OnSymbolNameKillFocus( wxFocusEvent& event ) override;
|
||||
void OnSymbolNameText( wxCommandEvent& event ) override;
|
||||
void OnSelectAlias( wxCommandEvent& event ) override;
|
||||
void OnAddAlias( wxCommandEvent& event ) override;
|
||||
void OnDeleteAlias( wxCommandEvent& event ) override;
|
||||
void OnAddFootprintFilter( wxCommandEvent& event ) override;
|
||||
void OnDeleteFootprintFilter( wxCommandEvent& event ) override;
|
||||
void OnEditFootprintFilter( wxCommandEvent& event ) override;
|
||||
void OnSizeGrid( wxSizeEvent& event ) override;
|
||||
void OnSizeAliasGrid( wxSizeEvent& event ) override;
|
||||
void OnGridCellChanging( wxGridEvent& event );
|
||||
void OnAliasGridCellChanging( wxGridEvent& event );
|
||||
void OnAliasNameKillFocus( wxFocusEvent& event ) override;
|
||||
void OnAliasNameText( wxCommandEvent& event ) override;
|
||||
void OnEditSpiceModel( wxCommandEvent& event ) override;
|
||||
void OnUpdateUI( wxUpdateUIEvent& event ) override;
|
||||
void OnFilterDClick( wxMouseEvent& event ) override;
|
||||
void OnCancelButtonClick( wxCommandEvent& event ) override;
|
||||
|
||||
void updateAliasName( bool aFromGrid, const wxString& aName );
|
||||
bool checkAliasName( const wxString& aName );
|
||||
void adjustGridColumns( int aWidth );
|
||||
void adjustAliasGridColumns( int aWidth );
|
||||
void syncControlStates( bool aIsAlias );
|
||||
};
|
||||
|
||||
#endif // _DIALOG_EDIT_COMPONENT_IN_LIB_H_
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Dec 1 2018)
|
||||
// C++ code generated with wxFormBuilder (version Aug 15 2019)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@ -9,7 +9,7 @@
|
||||
|
||||
#include "dialog_edit_component_in_lib_base.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
|
||||
{
|
||||
@ -75,11 +75,10 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wx
|
||||
|
||||
// Cell Defaults
|
||||
m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
|
||||
m_grid->SetMinSize( wxSize( -1,180 ) );
|
||||
m_grid->SetMinSize( wxSize( -1,160 ) );
|
||||
|
||||
sbSizer4->Add( m_grid, 1, wxTOP|wxBOTTOM|wxEXPAND, 5 );
|
||||
sbSizer4->Add( m_grid, 1, wxALL|wxEXPAND, 5 );
|
||||
|
||||
wxBoxSizer* bButtonSize;
|
||||
bButtonSize = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_bpAdd = new wxBitmapButton( sbSizer4->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
|
||||
@ -113,7 +112,7 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wx
|
||||
sbSizer4->Add( bButtonSize, 0, wxEXPAND|wxBOTTOM, 5 );
|
||||
|
||||
|
||||
bSizerBasicPanel->Add( sbSizer4, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
bSizerBasicPanel->Add( sbSizer4, 1, wxALL|wxEXPAND, 5 );
|
||||
|
||||
wxBoxSizer* bSizerMidBasicPanel;
|
||||
bSizerMidBasicPanel = new wxBoxSizer( wxVERTICAL );
|
||||
@ -127,10 +126,10 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wx
|
||||
wxStaticText* staticNameLabel;
|
||||
staticNameLabel = new wxStaticText( m_PanelBasic, wxID_ANY, _("Symbol name:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
staticNameLabel->Wrap( -1 );
|
||||
fgSizerFPID->Add( staticNameLabel, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
|
||||
fgSizerFPID->Add( staticNameLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
m_SymbolNameCtrl = new wxTextCtrl( m_PanelBasic, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizerFPID->Add( m_SymbolNameCtrl, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
|
||||
fgSizerFPID->Add( m_SymbolNameCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
wxStaticText* staticDescriptionLabel;
|
||||
staticDescriptionLabel = new wxStaticText( m_PanelBasic, wxID_ANY, _("Description:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
@ -138,22 +137,30 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wx
|
||||
fgSizerFPID->Add( staticDescriptionLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_DescCtrl = new wxTextCtrl( m_PanelBasic, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizerFPID->Add( m_DescCtrl, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
|
||||
fgSizerFPID->Add( m_DescCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
staticKeywordsLabel = new wxStaticText( m_PanelBasic, wxID_ANY, _("Keywords:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
staticKeywordsLabel->Wrap( -1 );
|
||||
fgSizerFPID->Add( staticKeywordsLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_KeywordCtrl = new wxTextCtrl( m_PanelBasic, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizerFPID->Add( m_KeywordCtrl, 0, wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
||||
fgSizerFPID->Add( m_KeywordCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
m_inheritsStaticText = new wxStaticText( m_PanelBasic, wxID_ANY, _("Derive from symbol:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_inheritsStaticText->Wrap( -1 );
|
||||
fgSizerFPID->Add( m_inheritsStaticText, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
m_inheritanceSelectCombo = new wxComboBox( m_PanelBasic, wxID_ANY, _("<None>"), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_DROPDOWN|wxCB_READONLY );
|
||||
m_inheritanceSelectCombo->SetToolTip( _("Select symbol to derive this symbol from or select\n<None> for root symbol.\n\nDerived symbols were formerly referred to as aliases.\nThis is no longer the case and all symbols are either\nderived from another symbols or they stand alone as\nroot symbols.") );
|
||||
|
||||
fgSizerFPID->Add( m_inheritanceSelectCombo, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
|
||||
bSizerMidBasicPanel->Add( fgSizerFPID, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 );
|
||||
|
||||
|
||||
bSizerBasicPanel->Add( bSizerMidBasicPanel, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
|
||||
bSizerBasicPanel->Add( bSizerMidBasicPanel, 0, wxEXPAND, 5 );
|
||||
|
||||
wxBoxSizer* bSizerLowerBasicPanel;
|
||||
bSizerLowerBasicPanel = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
wxBoxSizer* bSizerLeftCol;
|
||||
@ -261,134 +268,6 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wx
|
||||
m_PanelBasic->Layout();
|
||||
bSizerBasicPanel->Fit( m_PanelBasic );
|
||||
m_NoteBook->AddPage( m_PanelBasic, _("General"), true );
|
||||
m_PanelAlias = new wxPanel( m_NoteBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
wxBoxSizer* bSizerMainPanelAlias;
|
||||
bSizerMainPanelAlias = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
wxBoxSizer* bLeftBoxSizerPanelAlias;
|
||||
bLeftBoxSizerPanelAlias = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
wxStaticText* staticAliasesLabel;
|
||||
staticAliasesLabel = new wxStaticText( m_PanelAlias, wxID_ANY, _("Aliases:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
staticAliasesLabel->Wrap( -1 );
|
||||
bLeftBoxSizerPanelAlias->Add( staticAliasesLabel, 0, wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_aliasListBox = new wxListBox( m_PanelAlias, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
|
||||
bLeftBoxSizerPanelAlias->Add( m_aliasListBox, 1, wxEXPAND|wxLEFT, 5 );
|
||||
|
||||
wxBoxSizer* bSizerButtons;
|
||||
bSizerButtons = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_addAliasButton = new wxBitmapButton( m_PanelAlias, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
|
||||
m_addAliasButton->SetToolTip( _("Add alias") );
|
||||
m_addAliasButton->SetMinSize( wxSize( 30,29 ) );
|
||||
|
||||
bSizerButtons->Add( m_addAliasButton, 0, wxALL, 5 );
|
||||
|
||||
|
||||
bSizerButtons->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_deleteAliasButton = new wxBitmapButton( m_PanelAlias, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
|
||||
m_deleteAliasButton->SetToolTip( _("Delete alias") );
|
||||
m_deleteAliasButton->SetMinSize( wxSize( 30,29 ) );
|
||||
|
||||
bSizerButtons->Add( m_deleteAliasButton, 0, wxALL, 5 );
|
||||
|
||||
|
||||
bLeftBoxSizerPanelAlias->Add( bSizerButtons, 0, wxEXPAND, 5 );
|
||||
|
||||
|
||||
bSizerMainPanelAlias->Add( bLeftBoxSizerPanelAlias, 2, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
wxBoxSizer* bRightBoxSizerPanelAlias;
|
||||
bRightBoxSizerPanelAlias = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_staticText12 = new wxStaticText( m_PanelAlias, wxID_ANY, _("Alias field substitutions:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText12->Wrap( -1 );
|
||||
bRightBoxSizerPanelAlias->Add( m_staticText12, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_aliasGrid = new WX_GRID( m_PanelAlias, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
// Grid
|
||||
m_aliasGrid->CreateGrid( 4, 2 );
|
||||
m_aliasGrid->EnableEditing( true );
|
||||
m_aliasGrid->EnableGridLines( true );
|
||||
m_aliasGrid->EnableDragGridSize( false );
|
||||
m_aliasGrid->SetMargins( 0, 0 );
|
||||
|
||||
// Columns
|
||||
m_aliasGrid->SetColSize( 0, 72 );
|
||||
m_aliasGrid->SetColSize( 1, 420 );
|
||||
m_aliasGrid->EnableDragColMove( false );
|
||||
m_aliasGrid->EnableDragColSize( true );
|
||||
m_aliasGrid->SetColLabelSize( 22 );
|
||||
m_aliasGrid->SetColLabelValue( 0, _("Name") );
|
||||
m_aliasGrid->SetColLabelValue( 1, _("Value") );
|
||||
m_aliasGrid->SetColLabelValue( 2, _("Show") );
|
||||
m_aliasGrid->SetColLabelValue( 3, _("H Align") );
|
||||
m_aliasGrid->SetColLabelValue( 4, _("V Align") );
|
||||
m_aliasGrid->SetColLabelValue( 5, _("Italic") );
|
||||
m_aliasGrid->SetColLabelValue( 6, _("Bold") );
|
||||
m_aliasGrid->SetColLabelValue( 7, _("Text Size") );
|
||||
m_aliasGrid->SetColLabelValue( 8, _("Orientation") );
|
||||
m_aliasGrid->SetColLabelValue( 9, _("X Position") );
|
||||
m_aliasGrid->SetColLabelValue( 10, _("Y Position") );
|
||||
m_aliasGrid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
|
||||
|
||||
// Rows
|
||||
m_aliasGrid->EnableDragRowSize( true );
|
||||
m_aliasGrid->SetRowLabelSize( 0 );
|
||||
m_aliasGrid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
|
||||
|
||||
// Label Appearance
|
||||
|
||||
// Cell Defaults
|
||||
m_aliasGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
|
||||
bRightBoxSizerPanelAlias->Add( m_aliasGrid, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
bRightBoxSizerPanelAlias->Add( 0, 0, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
|
||||
|
||||
wxFlexGridSizer* fgSizerFPID1;
|
||||
fgSizerFPID1 = new wxFlexGridSizer( 6, 1, 0, 0 );
|
||||
fgSizerFPID1->AddGrowableCol( 0 );
|
||||
fgSizerFPID1->SetFlexibleDirection( wxBOTH );
|
||||
fgSizerFPID1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
wxStaticText* staticAliasNameLabel;
|
||||
staticAliasNameLabel = new wxStaticText( m_PanelAlias, wxID_ANY, _("Alias name:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
staticAliasNameLabel->Wrap( -1 );
|
||||
fgSizerFPID1->Add( staticAliasNameLabel, 0, wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
m_AliasNameCtrl = new wxTextCtrl( m_PanelAlias, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizerFPID1->Add( m_AliasNameCtrl, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 );
|
||||
|
||||
wxStaticText* staticAliasDescLabel;
|
||||
staticAliasDescLabel = new wxStaticText( m_PanelAlias, wxID_ANY, _("Alias description:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
staticAliasDescLabel->Wrap( -1 );
|
||||
fgSizerFPID1->Add( staticAliasDescLabel, 0, wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
m_AliasDescCtrl = new wxTextCtrl( m_PanelAlias, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizerFPID1->Add( m_AliasDescCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
staticAliasKeywordsLabel = new wxStaticText( m_PanelAlias, wxID_ANY, _("Alias keywords:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
staticAliasKeywordsLabel->Wrap( -1 );
|
||||
fgSizerFPID1->Add( staticAliasKeywordsLabel, 0, wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
m_AliasKeywordsCtrl = new wxTextCtrl( m_PanelAlias, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizerFPID1->Add( m_AliasKeywordsCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
bRightBoxSizerPanelAlias->Add( fgSizerFPID1, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
bSizerMainPanelAlias->Add( bRightBoxSizerPanelAlias, 7, wxEXPAND|wxRIGHT|wxTOP, 20 );
|
||||
|
||||
|
||||
m_PanelAlias->SetSizer( bSizerMainPanelAlias );
|
||||
m_PanelAlias->Layout();
|
||||
bSizerMainPanelAlias->Fit( m_PanelAlias );
|
||||
m_NoteBook->AddPage( m_PanelAlias, _("Aliases"), false );
|
||||
m_PanelFootprintFilter = new wxPanel( m_NoteBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
wxBoxSizer* bPanelFpFilterBoxSizer;
|
||||
bPanelFpFilterBoxSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
@ -470,6 +349,7 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wx
|
||||
|
||||
this->SetSizer( bMainSizer );
|
||||
this->Layout();
|
||||
bMainSizer->Fit( this );
|
||||
|
||||
// Connect Events
|
||||
this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnUpdateUI ) );
|
||||
@ -480,12 +360,6 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wx
|
||||
m_bpDelete->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnDeleteField ), NULL, this );
|
||||
m_SymbolNameCtrl->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnSymbolNameKillFocus ), NULL, this );
|
||||
m_SymbolNameCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnSymbolNameText ), NULL, this );
|
||||
m_aliasListBox->Connect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnSelectAlias ), NULL, this );
|
||||
m_addAliasButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnAddAlias ), NULL, this );
|
||||
m_deleteAliasButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnDeleteAlias ), NULL, this );
|
||||
m_aliasGrid->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnSizeAliasGrid ), NULL, this );
|
||||
m_AliasNameCtrl->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnAliasNameKillFocus ), NULL, this );
|
||||
m_AliasNameCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnAliasNameText ), NULL, this );
|
||||
m_FootprintFilterListBox->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnFilterDClick ), NULL, this );
|
||||
m_FootprintFilterListBox->Connect( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnEditFootprintFilter ), NULL, this );
|
||||
m_addFilterButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnAddFootprintFilter ), NULL, this );
|
||||
@ -506,12 +380,6 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::~DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE()
|
||||
m_bpDelete->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnDeleteField ), NULL, this );
|
||||
m_SymbolNameCtrl->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnSymbolNameKillFocus ), NULL, this );
|
||||
m_SymbolNameCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnSymbolNameText ), NULL, this );
|
||||
m_aliasListBox->Disconnect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnSelectAlias ), NULL, this );
|
||||
m_addAliasButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnAddAlias ), NULL, this );
|
||||
m_deleteAliasButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnDeleteAlias ), NULL, this );
|
||||
m_aliasGrid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnSizeAliasGrid ), NULL, this );
|
||||
m_AliasNameCtrl->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnAliasNameKillFocus ), NULL, this );
|
||||
m_AliasNameCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnAliasNameText ), NULL, this );
|
||||
m_FootprintFilterListBox->Disconnect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnFilterDClick ), NULL, this );
|
||||
m_FootprintFilterListBox->Disconnect( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnEditFootprintFilter ), NULL, this );
|
||||
m_addFilterButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnAddFootprintFilter ), NULL, this );
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Dec 1 2018)
|
||||
// C++ code generated with wxFormBuilder (version Aug 15 2019)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@ -28,6 +28,7 @@ class WX_GRID;
|
||||
#include <wx/statbox.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/combobox.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/spinctrl.h>
|
||||
#include <wx/panel.h>
|
||||
@ -50,6 +51,7 @@ class DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE : public DIALOG_SHIM
|
||||
wxNotebook* m_NoteBook;
|
||||
wxPanel* m_PanelBasic;
|
||||
WX_GRID* m_grid;
|
||||
wxBoxSizer* bButtonSize;
|
||||
wxBitmapButton* m_bpAdd;
|
||||
wxBitmapButton* m_bpMoveUp;
|
||||
wxBitmapButton* m_bpMoveDown;
|
||||
@ -58,6 +60,9 @@ class DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE : public DIALOG_SHIM
|
||||
wxTextCtrl* m_DescCtrl;
|
||||
wxStaticText* staticKeywordsLabel;
|
||||
wxTextCtrl* m_KeywordCtrl;
|
||||
wxStaticText* m_inheritsStaticText;
|
||||
wxComboBox* m_inheritanceSelectCombo;
|
||||
wxBoxSizer* bSizerLowerBasicPanel;
|
||||
wxCheckBox* m_AsConvertButt;
|
||||
wxCheckBox* m_OptionPower;
|
||||
wxStaticText* m_staticTextNbUnits;
|
||||
@ -69,16 +74,6 @@ class DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE : public DIALOG_SHIM
|
||||
wxStaticText* m_nameOffsetLabel;
|
||||
wxTextCtrl* m_nameOffsetCtrl;
|
||||
wxStaticText* m_nameOffsetUnits;
|
||||
wxPanel* m_PanelAlias;
|
||||
wxListBox* m_aliasListBox;
|
||||
wxBitmapButton* m_addAliasButton;
|
||||
wxBitmapButton* m_deleteAliasButton;
|
||||
wxStaticText* m_staticText12;
|
||||
WX_GRID* m_aliasGrid;
|
||||
wxTextCtrl* m_AliasNameCtrl;
|
||||
wxTextCtrl* m_AliasDescCtrl;
|
||||
wxStaticText* staticAliasKeywordsLabel;
|
||||
wxTextCtrl* m_AliasKeywordsCtrl;
|
||||
wxPanel* m_PanelFootprintFilter;
|
||||
wxStaticText* m_staticTextFootprints;
|
||||
wxListBox* m_FootprintFilterListBox;
|
||||
@ -99,12 +94,6 @@ class DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE : public DIALOG_SHIM
|
||||
virtual void OnDeleteField( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnSymbolNameKillFocus( wxFocusEvent& event ) { event.Skip(); }
|
||||
virtual void OnSymbolNameText( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnSelectAlias( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnAddAlias( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnDeleteAlias( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnSizeAliasGrid( wxSizeEvent& event ) { event.Skip(); }
|
||||
virtual void OnAliasNameKillFocus( wxFocusEvent& event ) { event.Skip(); }
|
||||
virtual void OnAliasNameText( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnFilterDClick( wxMouseEvent& event ) { event.Skip(); }
|
||||
virtual void OnEditFootprintFilter( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnAddFootprintFilter( wxCommandEvent& event ) { event.Skip(); }
|
||||
@ -115,7 +104,7 @@ class DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE : public DIALOG_SHIM
|
||||
|
||||
public:
|
||||
|
||||
DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wxWindow* parent, wxWindowID id = ID_LIBEDIT_NOTEBOOK, const wxString& title = _("Library Symbol Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 855,579 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wxWindow* parent, wxWindowID id = ID_LIBEDIT_NOTEBOOK, const wxString& title = _("Library Symbol Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
~DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE();
|
||||
|
||||
};
|
||||
|
@ -201,15 +201,9 @@ bool DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataToWindow()
|
||||
int mirror = m_cmp->GetOrientation() & ( CMP_MIRROR_X | CMP_MIRROR_Y );
|
||||
|
||||
if( mirror == CMP_MIRROR_X )
|
||||
{
|
||||
m_rbMirror->SetSelection( 1 );
|
||||
DBG( printf( "mirror=X,1\n" ); )
|
||||
}
|
||||
else if( mirror == CMP_MIRROR_Y )
|
||||
{
|
||||
m_rbMirror->SetSelection( 2 );
|
||||
DBG( printf( "mirror=Y,2\n" ); )
|
||||
}
|
||||
else
|
||||
m_rbMirror->SetSelection( 0 );
|
||||
|
||||
@ -346,7 +340,7 @@ bool DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::Validate()
|
||||
}
|
||||
else if( id != m_cmp->GetLibId() )
|
||||
{
|
||||
LIB_ALIAS* alias = nullptr;
|
||||
LIB_PART* alias = nullptr;
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Dec 30 2017)
|
||||
// C++ code generated with wxFormBuilder (version Nov 6 2019)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@ -14,22 +14,22 @@
|
||||
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
|
||||
{
|
||||
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
|
||||
|
||||
|
||||
wxBoxSizer* mainSizer;
|
||||
mainSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
wxStaticBoxSizer* sbFields;
|
||||
sbFields = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Fields") ), wxVERTICAL );
|
||||
|
||||
|
||||
m_grid = new WX_GRID( sbFields->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
|
||||
// Grid
|
||||
m_grid->CreateGrid( 4, 11 );
|
||||
m_grid->EnableEditing( true );
|
||||
m_grid->EnableGridLines( true );
|
||||
m_grid->EnableDragGridSize( false );
|
||||
m_grid->SetMargins( 0, 0 );
|
||||
|
||||
|
||||
// Columns
|
||||
m_grid->SetColSize( 0, 72 );
|
||||
m_grid->SetColSize( 1, 120 );
|
||||
@ -57,189 +57,189 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE
|
||||
m_grid->SetColLabelValue( 9, _("X Position") );
|
||||
m_grid->SetColLabelValue( 10, _("Y Position") );
|
||||
m_grid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
|
||||
|
||||
|
||||
// Rows
|
||||
m_grid->EnableDragRowSize( true );
|
||||
m_grid->SetRowLabelSize( 0 );
|
||||
m_grid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
|
||||
|
||||
|
||||
// Label Appearance
|
||||
|
||||
|
||||
// Cell Defaults
|
||||
m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
|
||||
m_grid->SetMinSize( wxSize( -1,180 ) );
|
||||
|
||||
sbFields->Add( m_grid, 1, wxEXPAND|wxBOTTOM, 5 );
|
||||
|
||||
|
||||
sbFields->Add( m_grid, 1, wxALL|wxEXPAND, 5 );
|
||||
|
||||
wxBoxSizer* bButtonSize;
|
||||
bButtonSize = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_bpAdd = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
m_bpAdd = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
|
||||
m_bpAdd->SetToolTip( _("Add field") );
|
||||
m_bpAdd->SetMinSize( wxSize( 30,30 ) );
|
||||
|
||||
bButtonSize->Add( m_bpAdd, 0, wxRIGHT, 5 );
|
||||
|
||||
m_bpMoveUp = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
bButtonSize->Add( m_bpAdd, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
|
||||
|
||||
m_bpMoveUp = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
|
||||
m_bpMoveUp->SetToolTip( _("Move up") );
|
||||
m_bpMoveUp->SetMinSize( wxSize( 30,30 ) );
|
||||
|
||||
bButtonSize->Add( m_bpMoveUp, 0, wxRIGHT, 5 );
|
||||
|
||||
m_bpMoveDown = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
bButtonSize->Add( m_bpMoveUp, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
|
||||
|
||||
m_bpMoveDown = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
|
||||
m_bpMoveDown->SetToolTip( _("Move down") );
|
||||
m_bpMoveDown->SetMinSize( wxSize( 30,30 ) );
|
||||
|
||||
bButtonSize->Add( m_bpMoveDown, 0, wxRIGHT, 5 );
|
||||
|
||||
|
||||
bButtonSize->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 10 );
|
||||
|
||||
m_bpDelete = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
bButtonSize->Add( m_bpMoveDown, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
|
||||
|
||||
|
||||
bButtonSize->Add( 0, 0, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT, 10 );
|
||||
|
||||
m_bpDelete = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
|
||||
m_bpDelete->SetToolTip( _("Delete field") );
|
||||
m_bpDelete->SetMinSize( wxSize( 30,30 ) );
|
||||
|
||||
bButtonSize->Add( m_bpDelete, 0, wxRIGHT, 5 );
|
||||
|
||||
|
||||
bButtonSize->Add( 0, 0, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
bButtonSize->Add( m_bpDelete, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
|
||||
|
||||
|
||||
bButtonSize->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
|
||||
m_updateFieldValues = new wxButton( sbFields->GetStaticBox(), wxID_ANY, _("Update Fields from Library..."), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_updateFieldValues->SetToolTip( _("Sets fields to the original library values") );
|
||||
|
||||
bButtonSize->Add( m_updateFieldValues, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
sbFields->Add( bButtonSize, 0, wxEXPAND, 10 );
|
||||
|
||||
|
||||
mainSizer->Add( sbFields, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 10 );
|
||||
|
||||
|
||||
bButtonSize->Add( m_updateFieldValues, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
sbFields->Add( bButtonSize, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
mainSizer->Add( sbFields, 1, wxALL|wxEXPAND, 5 );
|
||||
|
||||
wxBoxSizer* lowerSizer;
|
||||
lowerSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
|
||||
wxStaticBoxSizer* sbSizerLibraryReference;
|
||||
sbSizerLibraryReference = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Symbol") ), wxVERTICAL );
|
||||
|
||||
|
||||
wxFlexGridSizer* fgSizer1;
|
||||
fgSizer1 = new wxFlexGridSizer( 3, 2, 0, 0 );
|
||||
fgSizer1->AddGrowableCol( 1 );
|
||||
fgSizer1->SetFlexibleDirection( wxBOTH );
|
||||
fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
|
||||
m_staticText3 = new wxStaticText( sbSizerLibraryReference->GetStaticBox(), wxID_ANY, _("Library Reference:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText3->Wrap( -1 );
|
||||
fgSizer1->Add( m_staticText3, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
|
||||
|
||||
fgSizer1->Add( m_staticText3, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
wxBoxSizer* bLibraryReferenceSizer;
|
||||
bLibraryReferenceSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
|
||||
m_libraryNameTextCtrl = new wxTextCtrl( sbSizerLibraryReference->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_libraryNameTextCtrl->SetToolTip( _("Name of the symbol in the library to which this symbol is linked") );
|
||||
|
||||
|
||||
bLibraryReferenceSizer->Add( m_libraryNameTextCtrl, 1, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
|
||||
|
||||
m_buttonBrowseLibrary = new wxBitmapButton( sbSizerLibraryReference->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
m_buttonBrowseLibrary = new wxBitmapButton( sbSizerLibraryReference->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
|
||||
m_buttonBrowseLibrary->SetToolTip( _("Browse library") );
|
||||
m_buttonBrowseLibrary->SetMinSize( wxSize( 30,29 ) );
|
||||
|
||||
bLibraryReferenceSizer->Add( m_buttonBrowseLibrary, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
|
||||
fgSizer1->Add( bLibraryReferenceSizer, 1, wxEXPAND|wxRIGHT, 5 );
|
||||
|
||||
|
||||
bLibraryReferenceSizer->Add( m_buttonBrowseLibrary, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
|
||||
|
||||
|
||||
fgSizer1->Add( bLibraryReferenceSizer, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT, 5 );
|
||||
|
||||
m_unitLabel = new wxStaticText( sbSizerLibraryReference->GetStaticBox(), wxID_ANY, _("Unit:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_unitLabel->Wrap( -1 );
|
||||
fgSizer1->Add( m_unitLabel, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
fgSizer1->Add( m_unitLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
wxArrayString m_unitChoiceChoices;
|
||||
m_unitChoice = new wxChoice( sbSizerLibraryReference->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_unitChoiceChoices, 0 );
|
||||
m_unitChoice->SetSelection( 0 );
|
||||
m_unitChoice->SetMinSize( wxSize( 100,-1 ) );
|
||||
|
||||
fgSizer1->Add( m_unitChoice, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
|
||||
fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
fgSizer1->Add( m_unitChoice, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 );
|
||||
|
||||
|
||||
fgSizer1->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
|
||||
m_cbAlternateSymbol = new wxCheckBox( sbSizerLibraryReference->GetStaticBox(), wxID_ANY, _("Alternate symbol (DeMorgan)"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_cbAlternateSymbol->SetToolTip( _("Use the alternate shape of this symbol.\nFor gates, this is the \"De Morgan\" conversion") );
|
||||
|
||||
fgSizer1->Add( m_cbAlternateSymbol, 0, wxALL, 5 );
|
||||
|
||||
|
||||
|
||||
fgSizer1->Add( m_cbAlternateSymbol, 0, wxRIGHT|wxTOP, 5 );
|
||||
|
||||
|
||||
sbSizerLibraryReference->Add( fgSizer1, 0, wxEXPAND, 5 );
|
||||
|
||||
|
||||
lowerSizer->Add( sbSizerLibraryReference, 5, wxEXPAND|wxRIGHT|wxLEFT, 10 );
|
||||
|
||||
|
||||
|
||||
lowerSizer->Add( sbSizerLibraryReference, 5, wxEXPAND|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
wxString m_rbOrientationChoices[] = { _("0"), _("+90"), _("+180"), _("-90") };
|
||||
int m_rbOrientationNChoices = sizeof( m_rbOrientationChoices ) / sizeof( wxString );
|
||||
m_rbOrientation = new wxRadioBox( this, wxID_ANY, _("Orientation"), wxDefaultPosition, wxDefaultSize, m_rbOrientationNChoices, m_rbOrientationChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_rbOrientation->SetSelection( 0 );
|
||||
m_rbOrientation->SetToolTip( _("Select if the symbol is to be rotated when drawn") );
|
||||
|
||||
lowerSizer->Add( m_rbOrientation, 2, wxEXPAND|wxRIGHT|wxLEFT, 8 );
|
||||
|
||||
|
||||
lowerSizer->Add( m_rbOrientation, 2, wxEXPAND|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
wxString m_rbMirrorChoices[] = { _("Default"), _("Mirror around X axis"), _("Mirror around Y axis") };
|
||||
int m_rbMirrorNChoices = sizeof( m_rbMirrorChoices ) / sizeof( wxString );
|
||||
m_rbMirror = new wxRadioBox( this, wxID_ANY, _("Aspect"), wxDefaultPosition, wxDefaultSize, m_rbMirrorNChoices, m_rbMirrorChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_rbMirror->SetSelection( 1 );
|
||||
m_rbMirror->SetToolTip( _("Pick the graphical transformation to be used when displaying the symbol") );
|
||||
|
||||
lowerSizer->Add( m_rbMirror, 2, wxEXPAND|wxRIGHT|wxLEFT, 8 );
|
||||
|
||||
|
||||
mainSizer->Add( lowerSizer, 0, wxEXPAND|wxTOP|wxRIGHT, 5 );
|
||||
|
||||
|
||||
lowerSizer->Add( m_rbMirror, 2, wxEXPAND|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
|
||||
mainSizer->Add( lowerSizer, 0, wxEXPAND, 5 );
|
||||
|
||||
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
mainSizer->Add( m_staticline1, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 10 );
|
||||
|
||||
|
||||
wxBoxSizer* bSizer101;
|
||||
bSizer101 = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
|
||||
wxBoxSizer* bSizer11;
|
||||
bSizer11 = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
|
||||
wxStaticText* timeStampLabel;
|
||||
timeStampLabel = new wxStaticText( this, wxID_ANY, _("Unique ID:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
timeStampLabel->Wrap( -1 );
|
||||
bSizer11->Add( timeStampLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
|
||||
m_textCtrlTimeStamp = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
|
||||
m_textCtrlTimeStamp->SetToolTip( _("Unique ID that identifies the symbol") );
|
||||
|
||||
|
||||
bSizer11->Add( m_textCtrlTimeStamp, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
bSizer101->Add( bSizer11, 0, wxEXPAND|wxRIGHT|wxLEFT, 10 );
|
||||
|
||||
|
||||
|
||||
|
||||
bSizer101->Add( 0, 0, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
m_spiceFieldsButton = new wxButton( this, wxID_ANY, _("Edit Spice Model..."), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer101->Add( m_spiceFieldsButton, 0, wxEXPAND|wxALL, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
bSizer101->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 15 );
|
||||
|
||||
|
||||
m_stdDialogButtonSizer = new wxStdDialogButtonSizer();
|
||||
m_stdDialogButtonSizerOK = new wxButton( this, wxID_OK );
|
||||
m_stdDialogButtonSizer->AddButton( m_stdDialogButtonSizerOK );
|
||||
m_stdDialogButtonSizerCancel = new wxButton( this, wxID_CANCEL );
|
||||
m_stdDialogButtonSizer->AddButton( m_stdDialogButtonSizerCancel );
|
||||
m_stdDialogButtonSizer->Realize();
|
||||
|
||||
bSizer101->Add( m_stdDialogButtonSizer, 0, wxEXPAND|wxALL, 5 );
|
||||
|
||||
|
||||
|
||||
bSizer101->Add( m_stdDialogButtonSizer, 0, wxEXPAND, 5 );
|
||||
|
||||
|
||||
mainSizer->Add( bSizer101, 0, wxEXPAND, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
this->SetSizer( mainSizer );
|
||||
this->Layout();
|
||||
mainSizer->Fit( this );
|
||||
|
||||
|
||||
// Connect Events
|
||||
this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnInitDlg ) );
|
||||
this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnUpdateUI ) );
|
||||
@ -268,5 +268,5 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::~DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BAS
|
||||
m_buttonBrowseLibrary->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnBrowseLibrary ), NULL, this );
|
||||
m_spiceFieldsButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnEditSpiceModel ), NULL, this );
|
||||
m_stdDialogButtonSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnCancelButtonClick ), NULL, this );
|
||||
|
||||
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,12 +1,11 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Dec 30 2017)
|
||||
// C++ code generated with wxFormBuilder (version Nov 6 2019)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE_H__
|
||||
#define __DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE_H__
|
||||
#pragma once
|
||||
|
||||
#include <wx/artprov.h>
|
||||
#include <wx/xrc/xmlres.h>
|
||||
@ -20,10 +19,10 @@ class WX_GRID;
|
||||
#include <wx/font.h>
|
||||
#include <wx/grid.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/bmpbuttn.h>
|
||||
#include <wx/bitmap.h>
|
||||
#include <wx/image.h>
|
||||
#include <wx/icon.h>
|
||||
#include <wx/bmpbuttn.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/statbox.h>
|
||||
@ -44,7 +43,7 @@ class WX_GRID;
|
||||
class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE : public DIALOG_SHIM
|
||||
{
|
||||
private:
|
||||
|
||||
|
||||
protected:
|
||||
WX_GRID* m_grid;
|
||||
wxBitmapButton* m_bpAdd;
|
||||
@ -66,7 +65,7 @@ class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE : public DIALOG_SHIM
|
||||
wxStdDialogButtonSizer* m_stdDialogButtonSizer;
|
||||
wxButton* m_stdDialogButtonSizerOK;
|
||||
wxButton* m_stdDialogButtonSizerCancel;
|
||||
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void OnInitDlg( wxInitDialogEvent& event ) { event.Skip(); }
|
||||
virtual void OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); }
|
||||
@ -79,13 +78,12 @@ class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE : public DIALOG_SHIM
|
||||
virtual void OnBrowseLibrary( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnEditSpiceModel( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnCancelButtonClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Symbol Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU );
|
||||
|
||||
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Symbol Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU );
|
||||
~DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE();
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif //__DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE_H__
|
||||
|
@ -23,7 +23,8 @@
|
||||
|
||||
#include "dialog_lib_edit_pin_table_base.h"
|
||||
|
||||
#include "class_library.h"
|
||||
#include <lib_item.h>
|
||||
#include <class_library.h>
|
||||
|
||||
enum COL_ORDER
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2009 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 2016 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2016-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@ -26,9 +26,13 @@
|
||||
#include <sch_validators.h>
|
||||
#include <template_fieldnames.h>
|
||||
|
||||
DIALOG_LIB_NEW_COMPONENT::DIALOG_LIB_NEW_COMPONENT( wxWindow* parent ) :
|
||||
DIALOG_LIB_NEW_COMPONENT::DIALOG_LIB_NEW_COMPONENT( wxWindow* parent,
|
||||
const wxArrayString* aRootSymbolNames ) :
|
||||
DIALOG_LIB_NEW_COMPONENT_BASE( parent )
|
||||
{
|
||||
if( aRootSymbolNames && aRootSymbolNames->GetCount() )
|
||||
m_comboInheritanceSelect->Append( *aRootSymbolNames );
|
||||
|
||||
m_textName->SetValidator( SCH_FIELD_VALIDATOR( true, VALUE ) );
|
||||
m_textReference->SetValidator( SCH_FIELD_VALIDATOR( true, REFERENCE ) );
|
||||
|
||||
@ -41,3 +45,26 @@ DIALOG_LIB_NEW_COMPONENT::DIALOG_LIB_NEW_COMPONENT( wxWindow* parent ) :
|
||||
// Now all widgets have the size fixed, call FinishDialogSettings
|
||||
FinishDialogSettings();
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_LIB_NEW_COMPONENT::OnParentSymbolSelect( wxCommandEvent& event )
|
||||
{
|
||||
syncControls( !m_comboInheritanceSelect->GetValue().IsEmpty() );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_LIB_NEW_COMPONENT::syncControls( bool aIsDerivedPart )
|
||||
{
|
||||
m_staticTextDes->Enable( !aIsDerivedPart );
|
||||
m_textReference->Enable( !aIsDerivedPart );
|
||||
m_staticTextUnits->Enable( !aIsDerivedPart );
|
||||
m_spinPartCount->Enable( !aIsDerivedPart );
|
||||
m_checkLockItems->Enable( !aIsDerivedPart );
|
||||
m_checkHasConversion->Enable( !aIsDerivedPart );
|
||||
m_checkIsPowerSymbol->Enable( !aIsDerivedPart );
|
||||
m_staticText12->Enable( !aIsDerivedPart );
|
||||
m_spinPinTextPosition->Enable( !aIsDerivedPart );
|
||||
m_checkShowPinNumber->Enable( !aIsDerivedPart );
|
||||
m_checkShowPinName->Enable( !aIsDerivedPart );
|
||||
m_checkShowPinNameInside->Enable( !aIsDerivedPart );
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2009-2105 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 2015 KiCad Developers, see CHANGELOG.TXT for contributors.
|
||||
* Copyright (C) 2015-2019 KiCad Developers, see CHANGELOG.TXT for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@ -37,11 +37,13 @@ class DIALOG_LIB_NEW_COMPONENT : public DIALOG_LIB_NEW_COMPONENT_BASE
|
||||
{
|
||||
public:
|
||||
/** Constructor */
|
||||
DIALOG_LIB_NEW_COMPONENT( wxWindow* parent );
|
||||
DIALOG_LIB_NEW_COMPONENT( wxWindow* parent, const wxArrayString* aRootSymbolNames = nullptr );
|
||||
|
||||
void SetName( const wxString& name ) override { m_textName->SetValue( name ); }
|
||||
wxString GetName( void ) const override { return m_textName->GetValue(); }
|
||||
|
||||
wxString GetParentSymbolName() const { return m_comboInheritanceSelect->GetValue(); }
|
||||
|
||||
void SetReference( const wxString& reference )
|
||||
{
|
||||
m_textReference->SetValue( reference );
|
||||
@ -92,6 +94,12 @@ public:
|
||||
m_checkShowPinNameInside->SetValue( show );
|
||||
}
|
||||
bool GetPinNameInside( void ) { return m_checkShowPinNameInside->GetValue(); }
|
||||
|
||||
protected:
|
||||
virtual void OnParentSymbolSelect( wxCommandEvent& event ) override;
|
||||
|
||||
private:
|
||||
void syncControls( bool aIsDerivedPart );
|
||||
};
|
||||
|
||||
#endif // __dialog_lib_new_component__
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Dec 30 2017)
|
||||
// C++ code generated with wxFormBuilder (version Aug 15 2019)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@ -7,133 +7,135 @@
|
||||
|
||||
#include "dialog_lib_new_component_base.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
BEGIN_EVENT_TABLE( DIALOG_LIB_NEW_COMPONENT_BASE, DIALOG_SHIM )
|
||||
EVT_COMBOBOX( wxID_ANY, DIALOG_LIB_NEW_COMPONENT_BASE::_wxFB_OnParentSymbolSelect )
|
||||
END_EVENT_TABLE()
|
||||
|
||||
DIALOG_LIB_NEW_COMPONENT_BASE::DIALOG_LIB_NEW_COMPONENT_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
|
||||
{
|
||||
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
|
||||
|
||||
|
||||
wxBoxSizer* bSizerMain;
|
||||
bSizerMain = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
wxBoxSizer* bSizerTop;
|
||||
bSizerTop = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
wxFlexGridSizer* fgSizer31;
|
||||
fgSizer31 = new wxFlexGridSizer( 0, 2, 0, 0 );
|
||||
fgSizer31 = new wxFlexGridSizer( 0, 2, 6, 6 );
|
||||
fgSizer31->AddGrowableCol( 1 );
|
||||
fgSizer31->SetFlexibleDirection( wxBOTH );
|
||||
fgSizer31->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
|
||||
m_staticTextName = new wxStaticText( this, wxID_ANY, _("Symbol name:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextName->Wrap( -1 );
|
||||
m_staticTextName->SetToolTip( _("This is the symbol name in library,\nand also the default component value when loaded in the schematic.") );
|
||||
|
||||
fgSizer31->Add( m_staticTextName, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_textName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 100,-1 ), 0 );
|
||||
fgSizer31->Add( m_textName, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
fgSizer31->Add( m_staticTextName, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_textName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), 0 );
|
||||
fgSizer31->Add( m_textName, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
|
||||
m_staticText5 = new wxStaticText( this, wxID_ANY, _("Derive from existing symbol:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText5->Wrap( -1 );
|
||||
fgSizer31->Add( m_staticText5, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_comboInheritanceSelect = new wxComboBox( this, wxID_ANY, _("Combo!"), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_DROPDOWN|wxCB_READONLY );
|
||||
m_comboInheritanceSelect->SetToolTip( _("Select symbol in the current library as parent symbol.\n\nThis was previously known as an alias. Do not select\nan existing symbol to create a new root symbol.") );
|
||||
|
||||
fgSizer31->Add( m_comboInheritanceSelect, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
|
||||
m_staticTextDes = new wxStaticText( this, wxID_ANY, _("Default reference designator:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextDes->Wrap( -1 );
|
||||
fgSizer31->Add( m_staticTextDes, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||
|
||||
fgSizer31->Add( m_staticTextDes, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_textReference = new wxTextCtrl( this, wxID_ANY, _("U"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizer31->Add( m_textReference, 0, wxEXPAND|wxALL, 5 );
|
||||
|
||||
|
||||
fgSizer31->Add( 0, 0, 1, wxEXPAND|wxTOP, 10 );
|
||||
|
||||
|
||||
fgSizer31->Add( 0, 0, 1, wxEXPAND, 10 );
|
||||
|
||||
fgSizer31->Add( m_textReference, 0, wxEXPAND, 5 );
|
||||
|
||||
m_staticTextUnits = new wxStaticText( this, wxID_ANY, _("Number of units per package:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextUnits->Wrap( -1 );
|
||||
fgSizer31->Add( m_staticTextUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||
|
||||
fgSizer31->Add( m_staticTextUnits, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_spinPartCount = new wxSpinCtrl( this, wxID_ANY, wxT("1"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 1, 64, 0 );
|
||||
fgSizer31->Add( m_spinPartCount, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||
|
||||
|
||||
bSizerTop->Add( fgSizer31, 1, wxEXPAND|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
fgSizer31->Add( m_spinPartCount, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
bSizerTop->Add( fgSizer31, 1, wxALL|wxEXPAND, 5 );
|
||||
|
||||
wxBoxSizer* bSizer17;
|
||||
bSizer17 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
m_checkLockItems = new wxCheckBox( this, wxID_ANY, _("Units are not interchangeable"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer17->Add( m_checkLockItems, 0, wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
bSizer17->Add( 0, 0, 0, wxEXPAND|wxTOP|wxBOTTOM, 10 );
|
||||
|
||||
|
||||
m_checkHasConversion = new wxCheckBox( this, wxID_ANY, _("Create symbol with alternate body style (DeMorgan)"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer17->Add( m_checkHasConversion, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
m_checkIsPowerSymbol = new wxCheckBox( this, wxID_ANY, _("Create symbol as power symbol"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer17->Add( m_checkIsPowerSymbol, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
bSizerTop->Add( bSizer17, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
bSizerTop->Add( bSizer17, 0, wxBOTTOM|wxEXPAND, 5 );
|
||||
|
||||
|
||||
bSizerMain->Add( bSizerTop, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
wxBoxSizer* bSizerBottom;
|
||||
bSizerBottom = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
bSizerBottom->Add( 0, 0, 1, wxEXPAND|wxTOP, 5 );
|
||||
|
||||
|
||||
wxFlexGridSizer* fgSizer4;
|
||||
fgSizer4 = new wxFlexGridSizer( 0, 2, 0, 55 );
|
||||
fgSizer4 = new wxFlexGridSizer( 0, 2, 6, 6 );
|
||||
fgSizer4->AddGrowableCol( 1 );
|
||||
fgSizer4->SetFlexibleDirection( wxBOTH );
|
||||
fgSizer4->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
|
||||
m_staticText12 = new wxStaticText( this, wxID_ANY, _("Pin text position offset:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText12->Wrap( -1 );
|
||||
fgSizer4->Add( m_staticText12, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||
|
||||
fgSizer4->Add( m_staticText12, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_spinPinTextPosition = new wxSpinCtrl( this, wxID_ANY, wxT("40"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 1, 100, 40 );
|
||||
fgSizer4->Add( m_spinPinTextPosition, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
bSizerBottom->Add( fgSizer4, 0, wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
fgSizer4->Add( m_spinPinTextPosition, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
bSizerBottom->Add( fgSizer4, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
wxBoxSizer* bSizer19;
|
||||
bSizer19 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
m_checkShowPinNumber = new wxCheckBox( this, wxID_ANY, _("Show pin number text"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_checkShowPinNumber->SetValue(true);
|
||||
m_checkShowPinNumber->SetValue(true);
|
||||
bSizer19->Add( m_checkShowPinNumber, 0, wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
m_checkShowPinName = new wxCheckBox( this, wxID_ANY, _("Show pin name text"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_checkShowPinName->SetValue(true);
|
||||
m_checkShowPinName->SetValue(true);
|
||||
bSizer19->Add( m_checkShowPinName, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
m_checkShowPinNameInside = new wxCheckBox( this, wxID_ANY, _("Pin name inside"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_checkShowPinNameInside->SetValue(true);
|
||||
m_checkShowPinNameInside->SetValue(true);
|
||||
bSizer19->Add( m_checkShowPinNameInside, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
bSizerBottom->Add( bSizer19, 0, wxEXPAND|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
bSizerBottom->Add( bSizer19, 0, wxEXPAND, 5 );
|
||||
|
||||
|
||||
bSizerMain->Add( bSizerBottom, 1, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
m_sdbSizer = new wxStdDialogButtonSizer();
|
||||
m_sdbSizerOK = new wxButton( this, wxID_OK );
|
||||
m_sdbSizer->AddButton( m_sdbSizerOK );
|
||||
m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
|
||||
m_sdbSizer->AddButton( m_sdbSizerCancel );
|
||||
m_sdbSizer->Realize();
|
||||
|
||||
|
||||
bSizerMain->Add( m_sdbSizer, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
this->SetSizer( bSizerMain );
|
||||
this->Layout();
|
||||
bSizerMain->Fit( this );
|
||||
|
||||
|
||||
this->Centre( wxBOTH );
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<wxFormBuilder_Project>
|
||||
<FileVersion major="1" minor="13" />
|
||||
<FileVersion major="1" minor="15" />
|
||||
<object class="Project" expanded="1">
|
||||
<property name="class_decoration"></property>
|
||||
<property name="code_generation">C++</property>
|
||||
@ -14,6 +14,8 @@
|
||||
<property name="file">dialog_lib_new_component_base</property>
|
||||
<property name="first_id">1000</property>
|
||||
<property name="help_provider">none</property>
|
||||
<property name="image_path_wrapper_function_name"></property>
|
||||
<property name="indent_with_spaces"></property>
|
||||
<property name="internationalize">1</property>
|
||||
<property name="name">dialog_lib_new_component</property>
|
||||
<property name="namespace"></property>
|
||||
@ -24,6 +26,7 @@
|
||||
<property name="skip_php_events">1</property>
|
||||
<property name="skip_python_events">1</property>
|
||||
<property name="ui_table">UI</property>
|
||||
<property name="use_array_enum">0</property>
|
||||
<property name="use_enum">1</property>
|
||||
<property name="use_microsoft_bom">0</property>
|
||||
<object class="Dialog" expanded="1">
|
||||
@ -52,42 +55,6 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnActivate"></event>
|
||||
<event name="OnActivateApp"></event>
|
||||
<event name="OnAuiFindManager"></event>
|
||||
<event name="OnAuiPaneButton"></event>
|
||||
<event name="OnAuiPaneClose"></event>
|
||||
<event name="OnAuiPaneMaximize"></event>
|
||||
<event name="OnAuiPaneRestore"></event>
|
||||
<event name="OnAuiRender"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnClose"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnHibernate"></event>
|
||||
<event name="OnIconize"></event>
|
||||
<event name="OnIdle"></event>
|
||||
<event name="OnInitDialog"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizerMain</property>
|
||||
@ -104,23 +71,23 @@
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxLEFT|wxRIGHT</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxFlexGridSizer" expanded="1">
|
||||
<property name="cols">2</property>
|
||||
<property name="flexible_direction">wxBOTH</property>
|
||||
<property name="growablecols">1</property>
|
||||
<property name="growablerows"></property>
|
||||
<property name="hgap">0</property>
|
||||
<property name="hgap">6</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">fgSizer31</property>
|
||||
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
|
||||
<property name="permission">none</property>
|
||||
<property name="rows">0</property>
|
||||
<property name="vgap">0</property>
|
||||
<property name="vgap">6</property>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
@ -151,6 +118,7 @@
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Symbol name:</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
@ -176,34 +144,11 @@
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxTextCtrl" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
@ -250,7 +195,7 @@
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size">100,-1</property>
|
||||
<property name="size">-1,-1</property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
@ -263,38 +208,138 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnText"></event>
|
||||
<event name="OnTextEnter"></event>
|
||||
<event name="OnTextMaxLen"></event>
|
||||
<event name="OnTextURL"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Derive from existing symbol:</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_staticText5</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxComboBox" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="choices"></property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_comboInheritanceSelect</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="selection">-1</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxCB_DROPDOWN|wxCB_READONLY</property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip">Select symbol in the current library as parent symbol.

This was previously known as an alias. Do not select
an existing symbol to create a new root symbol.</property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="value">Combo!</property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnCombobox">OnParentSymbolSelect</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
@ -325,6 +370,7 @@
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Default reference designator:</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
@ -350,34 +396,11 @@
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxALL</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxTextCtrl" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
@ -437,58 +460,11 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnText"></event>
|
||||
<event name="OnTextEnter"></event>
|
||||
<event name="OnTextMaxLen"></event>
|
||||
<event name="OnTextURL"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">10</property>
|
||||
<property name="flag">wxEXPAND|wxTOP</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="spacer" expanded="1">
|
||||
<property name="height">0</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="width">0</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">10</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="spacer" expanded="1">
|
||||
<property name="height">0</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="width">0</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
@ -519,6 +495,7 @@
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Number of units per package:</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
@ -544,34 +521,11 @@
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxSpinCtrl" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
@ -629,39 +583,13 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnSpinCtrl"></event>
|
||||
<event name="OnSpinCtrlText"></event>
|
||||
<event name="OnTextEnter"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
|
||||
<property name="flag">wxBOTTOM|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
@ -730,40 +658,6 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCheckBox"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">10</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="spacer" expanded="1">
|
||||
<property name="height">0</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="width">0</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
@ -828,30 +722,6 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCheckBox"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
@ -916,30 +786,6 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCheckBox"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
@ -957,33 +803,23 @@
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxTOP</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="spacer" expanded="1">
|
||||
<property name="height">0</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="width">0</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxLEFT|wxRIGHT</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxFlexGridSizer" expanded="1">
|
||||
<property name="cols">2</property>
|
||||
<property name="flexible_direction">wxBOTH</property>
|
||||
<property name="growablecols"></property>
|
||||
<property name="growablecols">1</property>
|
||||
<property name="growablerows"></property>
|
||||
<property name="hgap">55</property>
|
||||
<property name="hgap">6</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">fgSizer4</property>
|
||||
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
|
||||
<property name="permission">none</property>
|
||||
<property name="rows">0</property>
|
||||
<property name="vgap">0</property>
|
||||
<property name="vgap">6</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
@ -1014,6 +850,7 @@
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Pin text position offset:</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
@ -1039,34 +876,11 @@
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxSpinCtrl" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
@ -1124,39 +938,13 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnSpinCtrl"></event>
|
||||
<event name="OnSpinCtrlText"></event>
|
||||
<event name="OnTextEnter"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxLEFT|wxRIGHT</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
@ -1225,30 +1013,6 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCheckBox"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
@ -1313,30 +1077,6 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCheckBox"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
@ -1401,30 +1141,6 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCheckBox"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
@ -1447,14 +1163,6 @@
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_sdbSizer</property>
|
||||
<property name="permission">protected</property>
|
||||
<event name="OnApplyButtonClick"></event>
|
||||
<event name="OnCancelButtonClick"></event>
|
||||
<event name="OnContextHelpButtonClick"></event>
|
||||
<event name="OnHelpButtonClick"></event>
|
||||
<event name="OnNoButtonClick"></event>
|
||||
<event name="OnOKButtonClick"></event>
|
||||
<event name="OnSaveButtonClick"></event>
|
||||
<event name="OnYesButtonClick"></event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
|
@ -1,12 +1,11 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Dec 30 2017)
|
||||
// C++ code generated with wxFormBuilder (version Aug 15 2019)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __DIALOG_LIB_NEW_COMPONENT_BASE_H__
|
||||
#define __DIALOG_LIB_NEW_COMPONENT_BASE_H__
|
||||
#pragma once
|
||||
|
||||
#include <wx/artprov.h>
|
||||
#include <wx/xrc/xmlres.h>
|
||||
@ -19,6 +18,7 @@
|
||||
#include <wx/colour.h>
|
||||
#include <wx/settings.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/combobox.h>
|
||||
#include <wx/spinctrl.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/checkbox.h>
|
||||
@ -32,11 +32,18 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class DIALOG_LIB_NEW_COMPONENT_BASE : public DIALOG_SHIM
|
||||
{
|
||||
DECLARE_EVENT_TABLE()
|
||||
private:
|
||||
|
||||
|
||||
// Private event handlers
|
||||
void _wxFB_OnParentSymbolSelect( wxCommandEvent& event ){ OnParentSymbolSelect( event ); }
|
||||
|
||||
|
||||
protected:
|
||||
wxStaticText* m_staticTextName;
|
||||
wxTextCtrl* m_textName;
|
||||
wxStaticText* m_staticText5;
|
||||
wxComboBox* m_comboInheritanceSelect;
|
||||
wxStaticText* m_staticTextDes;
|
||||
wxTextCtrl* m_textReference;
|
||||
wxStaticText* m_staticTextUnits;
|
||||
@ -52,12 +59,15 @@ class DIALOG_LIB_NEW_COMPONENT_BASE : public DIALOG_SHIM
|
||||
wxStdDialogButtonSizer* m_sdbSizer;
|
||||
wxButton* m_sdbSizerOK;
|
||||
wxButton* m_sdbSizerCancel;
|
||||
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void OnParentSymbolSelect( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
public:
|
||||
|
||||
DIALOG_LIB_NEW_COMPONENT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("New Symbol"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
|
||||
DIALOG_LIB_NEW_COMPONENT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("New Symbol"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
~DIALOG_LIB_NEW_COMPONENT_BASE();
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif //__DIALOG_LIB_NEW_COMPONENT_BASE_H__
|
||||
|
@ -296,7 +296,7 @@ bool DIALOG_SYMBOL_REMAP::remapSymbolToLibTable( SCH_COMPONENT* aSymbol )
|
||||
if( it->IsCache() )
|
||||
continue;
|
||||
|
||||
LIB_ALIAS* alias = it->FindAlias( aSymbol->GetLibId().GetLibItemName().wx_str() );
|
||||
LIB_PART* alias = it->FindPart( aSymbol->GetLibId().GetLibItemName().wx_str() );
|
||||
|
||||
// Found in the same library as the old look up method assuming the user didn't
|
||||
// change the libraries or library ordering since the last time the schematic was
|
||||
|
@ -99,7 +99,7 @@ bool DIALOG_UPDATE_FIELDS::TransferDataToWindow()
|
||||
{
|
||||
for( auto component : m_components )
|
||||
{
|
||||
const auto part = component->GetPartRef().lock();
|
||||
const std::unique_ptr< LIB_PART >& part = component->GetPartRef();
|
||||
|
||||
if( !part )
|
||||
continue;
|
||||
@ -145,12 +145,12 @@ void DIALOG_UPDATE_FIELDS::updateFields( SCH_COMPONENT* aComponent )
|
||||
std::vector<SCH_FIELD*> oldFields;
|
||||
SCH_FIELDS newFields;
|
||||
|
||||
PART_SPTR libPart = aComponent->GetPartRef().lock();
|
||||
std::unique_ptr< LIB_PART >& libPart = aComponent->GetPartRef();
|
||||
|
||||
if( libPart == nullptr ) // the symbol is not found in lib: cannot update fields
|
||||
if( !libPart ) // the symbol is not found in lib: cannot update fields
|
||||
return;
|
||||
|
||||
LIB_ALIAS* alias = m_frame->GetLibAlias( aComponent->GetLibId() );
|
||||
LIB_PART* alias = m_frame->GetLibPart( aComponent->GetLibId() );
|
||||
|
||||
aComponent->GetFields( oldFields, false );
|
||||
|
||||
|
@ -199,13 +199,20 @@ bool FIELDS_GRID_TABLE<T>::CanSetValueAs( int aRow, int aCol, const wxString& aT
|
||||
template <class T>
|
||||
wxGridCellAttr* FIELDS_GRID_TABLE<T>::GetAttr( int aRow, int aCol, wxGridCellAttr::wxAttrKind )
|
||||
{
|
||||
wxGridCellAttr* tmp;
|
||||
|
||||
// Only the VALUE and DATASHEET fields can be edited for inherited symbols.
|
||||
bool rowIsReadOnly = m_part && m_part->IsAlias() && ( aRow == REFERENCE || aRow == FOOTPRINT );
|
||||
|
||||
switch( aCol )
|
||||
{
|
||||
case FDC_NAME:
|
||||
if( aRow < MANDATORY_FIELDS )
|
||||
if( aRow < MANDATORY_FIELDS || rowIsReadOnly )
|
||||
{
|
||||
m_readOnlyAttr->IncRef();
|
||||
return m_readOnlyAttr;
|
||||
tmp = m_fieldNameAttr->Clone();
|
||||
tmp->SetReadOnly( true );
|
||||
tmp->SetTextColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) );
|
||||
return tmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -216,17 +223,30 @@ wxGridCellAttr* FIELDS_GRID_TABLE<T>::GetAttr( int aRow, int aCol, wxGridCellAtt
|
||||
case FDC_VALUE:
|
||||
if( aRow == REFERENCE )
|
||||
{
|
||||
m_referenceAttr->IncRef();
|
||||
return m_referenceAttr;
|
||||
if( rowIsReadOnly )
|
||||
{
|
||||
tmp = m_referenceAttr->Clone();
|
||||
tmp->SetReadOnly( true );
|
||||
tmp->SetTextColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) );
|
||||
return tmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_referenceAttr->IncRef();
|
||||
return m_referenceAttr;
|
||||
}
|
||||
}
|
||||
else if( aRow == VALUE )
|
||||
{
|
||||
// For power symbols, the value is not editable, because value and pin name must
|
||||
// be the same and can be edited only in library editor.
|
||||
if( m_part && m_part->IsPower() && ! m_frame->IsType( FRAME_SCH_LIB_EDITOR ) )
|
||||
if( ( m_part && m_part->IsPower() && !m_frame->IsType( FRAME_SCH_LIB_EDITOR ) )
|
||||
|| rowIsReadOnly )
|
||||
{
|
||||
m_readOnlyAttr->IncRef();
|
||||
return m_readOnlyAttr;
|
||||
tmp = m_readOnlyAttr->Clone();
|
||||
tmp->SetReadOnly( true );
|
||||
tmp->SetTextColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) );
|
||||
return tmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -236,8 +256,18 @@ wxGridCellAttr* FIELDS_GRID_TABLE<T>::GetAttr( int aRow, int aCol, wxGridCellAtt
|
||||
}
|
||||
else if( aRow == FOOTPRINT )
|
||||
{
|
||||
m_footprintAttr->IncRef();
|
||||
return m_footprintAttr;
|
||||
if( rowIsReadOnly )
|
||||
{
|
||||
tmp = m_footprintAttr->Clone();
|
||||
tmp->SetReadOnly( true );
|
||||
tmp->SetTextColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) );
|
||||
return tmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_footprintAttr->IncRef();
|
||||
return m_footprintAttr;
|
||||
}
|
||||
}
|
||||
else if( aRow == DATASHEET )
|
||||
{
|
||||
@ -251,39 +281,109 @@ wxGridCellAttr* FIELDS_GRID_TABLE<T>::GetAttr( int aRow, int aCol, wxGridCellAtt
|
||||
|
||||
if( templateFn && templateFn->m_URL )
|
||||
{
|
||||
m_urlAttr->IncRef();
|
||||
return m_urlAttr;
|
||||
if( rowIsReadOnly )
|
||||
{
|
||||
tmp = m_urlAttr->Clone();
|
||||
tmp->SetReadOnly( true );
|
||||
tmp->SetTextColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) );
|
||||
return tmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_urlAttr->IncRef();
|
||||
return m_urlAttr;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_nonUrlAttr->IncRef();
|
||||
return m_nonUrlAttr;
|
||||
if( rowIsReadOnly )
|
||||
{
|
||||
tmp = m_nonUrlAttr->Clone();
|
||||
tmp->SetReadOnly( true );
|
||||
tmp->SetTextColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) );
|
||||
return tmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_nonUrlAttr->IncRef();
|
||||
return m_nonUrlAttr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
|
||||
case FDC_TEXT_SIZE:
|
||||
case FDC_POSX:
|
||||
case FDC_POSY:
|
||||
return nullptr;
|
||||
if( rowIsReadOnly )
|
||||
{
|
||||
tmp = m_readOnlyAttr->Clone();
|
||||
tmp->SetTextColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) );
|
||||
return tmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
case FDC_H_ALIGN:
|
||||
m_hAlignAttr->IncRef();
|
||||
return m_hAlignAttr;
|
||||
if( rowIsReadOnly )
|
||||
{
|
||||
tmp = m_hAlignAttr->Clone();
|
||||
tmp->SetReadOnly( true );
|
||||
tmp->SetTextColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) );
|
||||
return tmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_hAlignAttr->IncRef();
|
||||
return m_hAlignAttr;
|
||||
}
|
||||
|
||||
case FDC_V_ALIGN:
|
||||
m_vAlignAttr->IncRef();
|
||||
return m_vAlignAttr;
|
||||
if( rowIsReadOnly )
|
||||
{
|
||||
tmp = m_vAlignAttr->Clone();
|
||||
tmp->SetReadOnly( true );
|
||||
tmp->SetTextColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) );
|
||||
return tmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_vAlignAttr->IncRef();
|
||||
return m_vAlignAttr;
|
||||
}
|
||||
|
||||
case FDC_ORIENTATION:
|
||||
m_orientationAttr->IncRef();
|
||||
return m_orientationAttr;
|
||||
if( rowIsReadOnly )
|
||||
{
|
||||
tmp = m_orientationAttr->Clone();
|
||||
tmp->SetReadOnly( true );
|
||||
tmp->SetTextColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) );
|
||||
return tmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_orientationAttr->IncRef();
|
||||
return m_orientationAttr;
|
||||
}
|
||||
|
||||
case FDC_SHOWN:
|
||||
case FDC_ITALIC:
|
||||
case FDC_BOLD:
|
||||
m_boolAttr->IncRef();
|
||||
return m_boolAttr;
|
||||
if( rowIsReadOnly )
|
||||
{
|
||||
tmp = m_boolAttr->Clone();
|
||||
tmp->SetReadOnly( true );
|
||||
tmp->SetTextColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) );
|
||||
return tmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_boolAttr->IncRef();
|
||||
return m_boolAttr;
|
||||
}
|
||||
|
||||
default:
|
||||
wxFAIL;
|
||||
|
@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2017 Chris Pavlina <pavlina.chris@gmail.com>
|
||||
* Copyright (C) 2017 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2017-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
@ -50,7 +50,7 @@ class FOOTPRINT_INFO_GENERATOR
|
||||
wxString m_html;
|
||||
SYMBOL_LIB_TABLE* m_sym_lib_table;
|
||||
LIB_ID const m_lib_id;
|
||||
LIB_ALIAS* m_module;
|
||||
LIB_PART* m_symbol;
|
||||
int m_unit;
|
||||
|
||||
public:
|
||||
@ -58,7 +58,7 @@ public:
|
||||
: m_html( DescriptionFormat ),
|
||||
m_sym_lib_table( aSymbolLibTable ),
|
||||
m_lib_id( aLibId ),
|
||||
m_module( nullptr ),
|
||||
m_symbol( nullptr ),
|
||||
m_unit( aUnit )
|
||||
{ }
|
||||
|
||||
@ -74,7 +74,7 @@ public:
|
||||
|
||||
try
|
||||
{
|
||||
m_module = const_cast< LIB_ALIAS* >( m_sym_lib_table->LoadSymbol( m_lib_id ) );
|
||||
m_symbol = const_cast< LIB_PART* >( m_sym_lib_table->LoadSymbol( m_lib_id ) );
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
{
|
||||
@ -86,7 +86,7 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
if( m_module )
|
||||
if( m_symbol )
|
||||
{
|
||||
SetHtmlName();
|
||||
SetHtmlAliasOf();
|
||||
@ -107,13 +107,13 @@ public:
|
||||
protected:
|
||||
void SetHtmlName()
|
||||
{
|
||||
m_html.Replace( "__NAME__", EscapedHTML( m_module->GetName() ) );
|
||||
m_html.Replace( "__NAME__", EscapedHTML( m_symbol->GetName() ) );
|
||||
}
|
||||
|
||||
|
||||
void SetHtmlAliasOf()
|
||||
{
|
||||
if( m_module->IsRoot() )
|
||||
if( m_symbol->IsRoot() )
|
||||
{
|
||||
m_html.Replace( "__ALIASOF__", wxEmptyString );
|
||||
}
|
||||
@ -122,14 +122,8 @@ protected:
|
||||
wxString root_name = _( "Unknown" );
|
||||
wxString root_desc = "";
|
||||
|
||||
LIB_PART* root = m_module->GetPart();
|
||||
LIB_ALIAS* root_alias = root ? root->GetAlias( 0 ) : nullptr;
|
||||
|
||||
if( root )
|
||||
root_name = root->GetName();
|
||||
|
||||
if( root_alias )
|
||||
root_desc = root_alias->GetDescription();
|
||||
root_name = m_symbol->SharedPtr()->GetName();
|
||||
root_desc = m_symbol->SharedPtr()->GetDescription();
|
||||
|
||||
m_html.Replace(
|
||||
"__ALIASOF__", wxString::Format(
|
||||
@ -140,7 +134,7 @@ protected:
|
||||
|
||||
void SetHtmlDesc()
|
||||
{
|
||||
wxString raw_desc = m_module->GetDescription();
|
||||
wxString raw_desc = m_symbol->GetDescription();
|
||||
|
||||
m_html.Replace( "__DESC__", wxString::Format( DescFormat, EscapedHTML( raw_desc ) ) );
|
||||
}
|
||||
@ -148,7 +142,7 @@ protected:
|
||||
|
||||
void SetHtmlKeywords()
|
||||
{
|
||||
wxString keywords = m_module->GetKeyWords();
|
||||
wxString keywords = m_symbol->GetKeyWords();
|
||||
|
||||
if( keywords.empty() )
|
||||
m_html.Replace( "__KEY__", wxEmptyString );
|
||||
@ -169,26 +163,25 @@ protected:
|
||||
switch( aField.GetId() )
|
||||
{
|
||||
case DATASHEET:
|
||||
text = m_symbol->GetDocFileName();
|
||||
|
||||
if( text.IsEmpty() || text == wxT( "~" ) )
|
||||
{
|
||||
text = m_module->GetDocFileName();
|
||||
|
||||
if( text.IsEmpty() || text == wxT( "~" ) )
|
||||
{
|
||||
fieldhtml.Replace( "__VALUE__", text );
|
||||
}
|
||||
else
|
||||
{
|
||||
wxString datasheetlink = DatasheetLinkFormat;
|
||||
datasheetlink.Replace( "__HREF__", EscapedHTML( text ) );
|
||||
|
||||
if( text.Length() > 75 )
|
||||
text = text.Left( 72 ) + wxT( "..." );
|
||||
|
||||
datasheetlink.Replace( "__TEXT__", EscapedHTML( text ) );
|
||||
|
||||
fieldhtml.Replace( "__VALUE__", datasheetlink );
|
||||
}
|
||||
fieldhtml.Replace( "__VALUE__", text );
|
||||
}
|
||||
else
|
||||
{
|
||||
wxString datasheetlink = DatasheetLinkFormat;
|
||||
datasheetlink.Replace( "__HREF__", EscapedHTML( text ) );
|
||||
|
||||
if( text.Length() > 75 )
|
||||
text = text.Left( 72 ) + wxT( "..." );
|
||||
|
||||
datasheetlink.Replace( "__TEXT__", EscapedHTML( text ) );
|
||||
|
||||
fieldhtml.Replace( "__VALUE__", datasheetlink );
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case VALUE:
|
||||
@ -207,13 +200,34 @@ protected:
|
||||
{
|
||||
wxString fieldtable;
|
||||
LIB_FIELDS fields;
|
||||
m_module->GetPart()->GetFields( fields );
|
||||
m_symbol->GetFields( fields );
|
||||
|
||||
for( auto const & field: fields )
|
||||
{
|
||||
fieldtable += GetHtmlFieldRow( field );
|
||||
}
|
||||
|
||||
if( m_symbol->IsAlias() )
|
||||
{
|
||||
std::shared_ptr< LIB_PART > parent = m_symbol->GetParent().lock();
|
||||
|
||||
// Append all of the unique parent fields if this is an alias.
|
||||
if( parent )
|
||||
{
|
||||
LIB_FIELDS parentFields;
|
||||
|
||||
parent->GetFields( parentFields );
|
||||
|
||||
for( auto const& parentField : parentFields )
|
||||
{
|
||||
if( m_symbol->FindField( parentField.GetName() ) )
|
||||
continue;
|
||||
|
||||
fieldtable += GetHtmlFieldRow( parentField );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_html.Replace( "__FIELDS__", fieldtable );
|
||||
}
|
||||
};
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user