77 std::vector<EMBEDDED_FILES*> embeddedFilesStack;
79 embeddedFilesStack.push_back(
m_frame->GetBoard()->GetEmbeddedFiles() );
105 double rot_list[] = { 0.0, 90.0, -90.0, 180.0 };
135 "Enter an absolute value (e.g., -0.1mm), a percentage "
136 "(e.g., -5%), or both (e.g., -0.1mm - 5%).\n"
137 "If blank, the global value is used." ) );
238 if( !wxDialog::TransferDataToWindow() )
251 wxString variantName;
254 variantName =
m_footprint->GetBoard()->GetCurrentVariant();
259 wxCHECK2( srcField,
continue );
269 wxGridTableMessage tmsg(
m_fields, wxGRIDTABLE_NOTIFY_ROWS_APPENDED,
m_fields->GetNumberRows() );
283 m_cbLocked->SetToolTip(
_(
"Locked footprints cannot be freely moved or oriented on the canvas and can only be "
284 "selected when the 'Locked items' checkbox is checked in the selection filter." ) );
306 if(
m_footprint->GetLocalSolderMaskMargin().has_value() )
325 wxString jumperGroups;
327 if(
m_footprint->GetDuplicatePadNumbersAreJumpers() )
328 jumperGroups =
_(
"all pads with duplicate numbers" );
334 for(
const wxString& pinNumber :
group )
336 if( !groupTxt.IsEmpty() )
339 groupTxt << pinNumber;
342 if( !jumperGroups.IsEmpty() )
343 jumperGroups <<
"; ";
345 jumperGroups <<
"(" << groupTxt <<
")";
348 if( jumperGroups.IsEmpty() )
361 for(
int col = 0; col <
m_itemsGrid->GetNumberCols(); col++ )
366 int col_size =
m_itemsGrid->GetVisibleWidth( col );
373 col_size = std::max( col_size, GetTextExtent( board->
GetLayerName( layer ) ).x );
376 col_size +=
KiROUND( 14 * GetDPIScaleFactor() ) + 12;
397 if( !DIALOG_SHIM::Validate() )
401 for(
size_t i = 0; i <
m_fields->size(); ++i )
406 if( field.
GetName(
false ).IsEmpty() )
434 else if( width > maxSize )
436 wxString max =
m_frame->StringFromValue( maxSize,
true );
461 else if( height > maxSize )
463 wxString max =
m_frame->StringFromValue( maxSize,
true );
480 wxString clamped =
m_frame->StringFromValue( maxPenWidth,
true );
486 "It will be clamped at %s." ),
516 if( !
m_3dPanel->TransferDataFromWindow() )
523 std::set<wxString> files;
524 std::set<wxString> files_to_delete;
530 files.insert( field.GetText() );
536 wxCHECK2( field,
continue );
540 if( files.find( field->GetText() ) == files.end() )
541 files_to_delete.insert( field->GetText() );
545 for(
const wxString& file : files_to_delete )
554 wxString variantName;
560 std::map<wxString, wxString> baseFieldValues;
563 baseFieldValues[existing->GetName()] = existing->GetText();
582 if( !variantName.IsEmpty() )
584 auto it = baseFieldValues.find( field.GetName() );
585 wxString baseText = ( it != baseFieldValues.end() ) ? it->second : wxString();
602 if( !field.IsMandatory() )
606 view->
Add( newField );
650 case 1: attributes |=
FP_SMD;
break;
657 if( !variantName.IsEmpty() )
703 bool change_layer =
false;
719 std::vector<FP_3DMODEL>& panelList =
m_3dPanel->GetModelList();
720 std::vector<FP_3DMODEL>* fpList = &
m_footprint->Models();
722 fpList->insert( fpList->end(), panelList.begin(), panelList.end() );
726 commit.Push(
_(
"Edit Footprint Properties" ) );
736 [&]() -> std::pair<int, int>
748 wxGridTableMessage msg(
m_fields, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, 1 );
762 if( row < m_fields->GetMandatoryRowCount() )
764 DisplayError(
this, wxString::Format(
_(
"The first %d fields are mandatory." ),
765 m_fields->GetMandatoryRowCount() ) );
776 wxGridTableMessage msg(
m_fields, wxGRIDTABLE_NOTIFY_ROWS_DELETED, row, 1 );
814 grid->MakeCellVisible( row, col );
820 grid->SetGridCursor( row, col );
822 if( !( col == 0 && row < m_fields->GetMandatoryRowCount() ) )
823 grid->EnableCellEditControl(
true );
825 grid->ShowCellEditControl();
829 wxGridCellEditor* referenceEditor =
grid->GetCellEditor( 0, 0 );
831 if( wxTextEntry* textEntry =
dynamic_cast<wxTextEntry*
>( referenceEditor->GetControl() ) )
834 referenceEditor->DecRef();
constexpr EDA_IU_SCALE pcbIUScale
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
void SetFPRelativePosition(const VECTOR2I &aPos)
Information pertinent to a Pcbnew printed circuit board.
void UncacheItemById(const KIID &aId) const
Remove an item from the item-by-id cache.
wxString ConvertCrossReferencesToKIIDs(const wxString &aSource) const
Convert cross-references back and forth between ${refDes:field} and ${kiid:field}.
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
wxString GetCurrentVariant() const
const LSET & GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
std::vector< wxWindow * > m_tabOrder
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
void SetupStandardButtons(std::map< int, wxString > aLabels={})
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
virtual void SetVisible(bool aVisible)
virtual void SetText(const wxString &aText)
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1) override
Add a VIEW_ITEM to the view.
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
The main frame for Pcbnew.
void SetOrdinal(int aOrdinal)
wxString GetName(bool aUseDefaultName=true) const
Return the field name (not translated).
PCB_FIELD * CloneField() const
Same as Clone, but returns a PCB_FIELD item.
void StyleFromSettings(const BOARD_DESIGN_SETTINGS &settings, bool aCheckSide) override
int GetTextThickness() const override
VECTOR2I GetTextSize() const override
static S3D_CACHE * Get3DCacheManager(PROJECT *aProject, bool updateProjDir=false)
Return a pointer to an instance of the 3D cache manager.
void FlushCache(bool closePlugins=true)
Free all data in the cache and by default closes all plugins.
void DisplayError(wxWindow *aParent, const wxString &aText)
Display an error or warning message box with aMessage.
This file is part of the common library.
const int minSize
Push and Shove router track width and via size dialog.
Declaration of the eda_3d_viewer class.
#define TEXT_MIN_SIZE_MM
Minimum text size (1 micron).
#define TEXT_MAX_SIZE_MM
Maximum text size in mm (~10 inches)
int ClampTextPenSize(int aPenSize, int aSize, bool aStrict)
Pen width should not allow characters to become cluttered up in their own fatness.
static const std::string KiCadUriPrefix
PCB_LAYER_ID
A quick note on layer IDs:
KICOMMON_API wxFont GetInfoFont(wxWindow *aWindow)
KICOMMON_API wxFont GetSmallInfoFont(wxWindow *aWindow)
KICOMMON_API wxFont GetControlFont(wxWindow *aWindow)
KICOMMON_API void SelectReferenceNumber(wxTextEntry *aTextEntry)
Select the number (or "?") in a reference for ease of editing.
wxString GetUserFieldName(int aFieldNdx, bool aTranslateForHI)
@ USER
The field ID hasn't been set yet; field is invalid.
VECTOR2< int32_t > VECTOR2I
@ THERMAL
Use thermal relief for pads.
@ NONE
Pads are not covered.
@ FULL
pads are covered by copper