103 return editor->IsSymbolEditable() && !
editor->IsSymbolAlias();
127 if( dlg.ShowModal() == wxID_CANCEL )
147 got_unit[
static_cast<size_t>(aPin->
GetUnit())] =
true;
149 for(
LIB_PIN* other : pinList )
157 if( got_unit[
static_cast<size_t>( other->GetUnit() )] )
160 if( other->GetPosition() == original_pin.
GetPosition()
162 && other->GetType() == original_pin.
GetType()
163 && other->IsVisible() == original_pin.
IsVisible()
164 && other->GetName() == original_pin.
GetName() )
171 else if( other->GetConvert() == aPin->
GetConvert() )
174 other->ChangeLength( aPin->
GetLength() );
175 other->SetShape( aPin->
GetShape() );
185 other->SetType( aPin->
GetType() );
187 other->SetName( aPin->
GetName() );
191 other->SetModified();
192 got_unit[
static_cast<size_t>( other->GetUnit() )] =
true;
200 std::vector<MSG_PANEL_ITEM> items;
222 bool ask_for_pin =
true;
238 msg.Printf(
_(
"This position is already occupied by another pin, in unit %d." ),
241 KIDIALOG dlg(
m_frame, msg,
_(
"Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
242 dlg.SetOKLabel(
_(
"Place Pin Anyway" ) );
245 bool status = dlg.
ShowModal() == wxID_OK;
306 pin->MoveTo( aPosition );
345 for( ii = 1; ii <= aPin->
GetParent()->GetUnitCount(); ii++ )
356 unknownNum.Printf(
"%s-U%c", aPin->
GetNumber(), wxChar(
'A' + ii - 1 ) );
365 catch(
const boost::bad_pointer& e )
367 wxLogError(
"Cannot add new pin to symbol. Boost pointer error %s occurred.",
392 if(
pin == sourcePin )
428 switch(
pin->GetOrientation() )
438 wxString nextName =
pin->GetName();
440 pin->SetName( nextName );
442 wxString nextNumber =
pin->GetNumber();
444 pin->SetNumber( nextNumber );
constexpr EDA_IU_SCALE schIUScale
virtual PICKED_ITEMS_LIST * PopCommandFromUndoList()
Return the last command to undo and remove it from list, nothing is deleted.
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
EDA_ITEM_FLAGS GetEditFlags() const
void ClearFlags(EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
bool HasFlag(EDA_ITEM_FLAGS aFlag) const
static TOOL_ACTION pushPinNameSize
static TOOL_ACTION pushPinNumSize
static TOOL_ACTION pushPinLength
Helper class to create more flexible dialogs, including 'do not show again' checkbox handling.
void DoNotShowCheckbox(wxString file, int line)
Checks the 'do not show again' setting for the dialog.
LIB_SYMBOL * GetParent() const
ELECTRICAL_PINTYPE GetType() const
int GetOrientation() const
int GetNumberTextSize() const
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Display basic info (type, part and convert) about the current item in message panel.
VECTOR2I GetPosition() const override
const wxString & GetNumber() const
GRAPHIC_PINSHAPE GetShape() const
void SetNumber(const wxString &aNumber)
const wxString & GetName() const
int GetNameTextSize() const
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Define a library symbol object.
void ClearTempFlags()
Clears the status flag all draw objects in this symbol.
void RemoveDrawItem(LIB_ITEM *aItem)
Remove draw aItem from list.
void AddDrawItem(LIB_ITEM *aItem, bool aSort=true)
Add a new draw aItem to the draw object list and sort according to aSort.
std::vector< LIB_PIN * > GetAllLibPins() const
Return a list of pin pointers for all units / converts.
int GetUnitCount() const override
For items with units, return the number of units.
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0) const
Return a list of pin object pointers from the draw item list.
static SELECTION_CONDITION Count(int aNumber)
Create a functor that tests if the number of selected items is equal to the value given as parameter.
static SELECTION_CONDITION OnlyTypes(std::vector< KICAD_T > aTypes)
Create a functor that tests if the selected items are only of given types.
The symbol library editor main window.
void UpdateItem(EDA_ITEM *aItem, bool isAddOrDelete=false, bool aUpdateRtree=false) override
Mark an item for refresh.
LIB_SYMBOL * GetCurSymbol() const
Return the current symbol being edited or NULL if none selected.
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current symbol.
void SaveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO aUndoType=UNDO_REDO::LIBEDIT, bool aAppend=false)
Create a copy of the current symbol, and save it in the undo list.
This file is part of the common library.
#define IS_PASTED
Modifier on IS_NEW which indicates it came from clipboard.
#define IS_NEW
New item, just created.
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
ELECTRICAL_PINTYPE
The symbol library pin object electrical types used in ERC tests.
@ PT_INPUT
usual pin input: must be connected
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
constexpr int MilsToIU(int mils) const