diff --git a/eeschema/sch_symbol.cpp b/eeschema/sch_symbol.cpp index 27c1e86372..fa7478c953 100644 --- a/eeschema/sch_symbol.cpp +++ b/eeschema/sch_symbol.cpp @@ -95,21 +95,22 @@ static LIB_SYMBOL* dummy() } -SCH_SYMBOL::SCH_SYMBOL( const wxPoint& aPos, SCH_ITEM* aParent ) : +SCH_SYMBOL::SCH_SYMBOL( const wxPoint& aPosition, EDA_ITEM* aParent ) : SCH_ITEM( aParent, SCH_SYMBOL_T ) { - Init( aPos ); + Init( aPosition ); } SCH_SYMBOL::SCH_SYMBOL( const LIB_SYMBOL& aSymbol, const LIB_ID& aLibId, - const SCH_SHEET_PATH* aSheet, int unit, int convert, const wxPoint& pos ) : - SCH_ITEM( nullptr, SCH_SYMBOL_T ) + const SCH_SHEET_PATH* aSheet, int aUnit, int aConvert, + const wxPoint& aPosition, EDA_ITEM* aParent ) : + SCH_ITEM( aParent, SCH_SYMBOL_T ) { - Init( pos ); + Init( aPosition ); - m_unit = unit; - m_convert = convert; + m_unit = aUnit; + m_convert = aConvert; m_lib_id = aLibId; std::unique_ptr< LIB_SYMBOL > part; @@ -146,8 +147,8 @@ SCH_SYMBOL::SCH_SYMBOL( const LIB_SYMBOL& aSymbol, const LIB_ID& aLibId, SCH_SYMBOL::SCH_SYMBOL( const LIB_SYMBOL& aSymbol, const SCH_SHEET_PATH* aSheet, - const PICKED_SYMBOL& aSel, const wxPoint& pos ) : - SCH_SYMBOL( aSymbol, aSel.LibId, aSheet, aSel.Unit, aSel.Convert, pos ) + const PICKED_SYMBOL& aSel, const wxPoint& aPosition, EDA_ITEM* aParent ) : + SCH_SYMBOL( aSymbol, aSel.LibId, aSheet, aSel.Unit, aSel.Convert, aPosition, aParent ) { // Set any fields that were modified as part of the symbol selection for( const std::pair& i : aSel.Fields ) diff --git a/eeschema/sch_symbol.h b/eeschema/sch_symbol.h index 4304de5f6c..b8ad0a612c 100644 --- a/eeschema/sch_symbol.h +++ b/eeschema/sch_symbol.h @@ -78,7 +78,7 @@ extern std::string toUTFTildaText( const wxString& txt ); class SCH_SYMBOL : public SCH_ITEM { public: - SCH_SYMBOL( const wxPoint& pos = wxPoint( 0, 0 ), SCH_ITEM* aParent = nullptr ); + SCH_SYMBOL( const wxPoint& aPosition = wxPoint( 0, 0 ), EDA_ITEM* aParent = nullptr ); /** * Create schematic symbol from library symbol object. @@ -86,16 +86,16 @@ public: * @param aSymbol is the library symbol to create schematic symbol from. * @param aLibId is the #LIB_ID of alias to create. * @param aSheet is the schematic sheet the symbol is place into. - * @param unit is unit for symbols that have multiple parts per package. - * @param convert is the alternate body style for the schematic symbols. - * @param pos is the position of the symbol. - * @param setNewItemFlag is used to set the symbol #IS_NEW and #IS_MOVING flags. + * @param aUnit is unit for symbols that have multiple parts per package. + * @param aConvert is the alternate body style for the schematic symbols. + * @param aPositions is the position of the symbol. */ SCH_SYMBOL( const LIB_SYMBOL& aSymbol, const LIB_ID& aLibId, const SCH_SHEET_PATH* aSheet, - int unit, int convert = 0, const wxPoint& pos = wxPoint( 0, 0 ) ); + int aUnit, int aConvert = 0, const wxPoint& aPosition = wxPoint( 0, 0 ), + EDA_ITEM* aParent = nullptr ); SCH_SYMBOL( const LIB_SYMBOL& aSymbol, const SCH_SHEET_PATH* aSheet, const PICKED_SYMBOL& aSel, - const wxPoint& pos = wxPoint( 0, 0 ) ); + const wxPoint& aPosition = wxPoint( 0, 0 ), EDA_ITEM* aParent = nullptr ); /** * Clone \a aSymbol into a new schematic symbol object. diff --git a/eeschema/tools/sch_drawing_tools.cpp b/eeschema/tools/sch_drawing_tools.cpp index 5a219281d8..cc897e7f0a 100644 --- a/eeschema/tools/sch_drawing_tools.cpp +++ b/eeschema/tools/sch_drawing_tools.cpp @@ -269,7 +269,8 @@ int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent ) continue; wxPoint pos( cursorPos ); - symbol = new SCH_SYMBOL( *libSymbol, &m_frame->GetCurrentSheet(), sel, pos ); + symbol = new SCH_SYMBOL( *libSymbol, &m_frame->GetCurrentSheet(), sel, pos, + &m_frame->Schematic() ); addSymbol( symbol ); // Update cursor now that we have a symbol