57 m_footprint( aFootprint ),
58 m_posX( aParent, m_XPosLabel, m_ModPositionX, m_XPosUnit ),
59 m_posY( aParent, m_YPosLabel, m_ModPositionY, m_YPosUnit ),
60 m_orientation( aParent, m_orientationLabel, m_orientationCtrl, nullptr ),
61 m_netClearance( aParent, m_NetClearanceLabel, m_NetClearanceCtrl, m_NetClearanceUnits ),
62 m_solderMask( aParent, m_SolderMaskMarginLabel, m_SolderMaskMarginCtrl,
63 m_SolderMaskMarginUnits ),
64 m_solderPaste( aParent, m_SolderPasteMarginLabel, m_SolderPasteMarginCtrl,
65 m_SolderPasteMarginUnits ),
66 m_solderPasteRatio( aParent, m_PasteMarginRatioLabel, m_PasteMarginRatioCtrl,
67 m_PasteMarginRatioUnits ),
68 m_returnValue( FP_PROPS_CANCEL ),
69 m_initialized( false ),
71 m_lastRequestedSize( 0, 0 )
110 double rot_list[] = { 0.0, 90.0, -90.0, 180.0 };
120 infoFont.SetStyle( wxFONTSTYLE_ITALIC );
187 Prj().Get3DCacheManager()->FlushCache(
false );
237 if( !wxDialog::TransferDataToWindow() )
253 FP_TEXT* textItem = dyn_cast<FP_TEXT*>( item );
256 m_texts->push_back( *textItem );
274 m_cbLocked->SetToolTip(
_(
"Locked footprints cannot be freely moved and oriented on the "
275 "canvas and can only be selected when the 'Locked items' checkbox "
276 "is enabled in the selection filter." ) );
310 for(
int col = 0; col <
m_itemsGrid->GetNumberCols(); col++ )
322 col_size = std::max( col_size, GetTextExtent( board->
GetLayerName( layer ) ).x );
346 if( !DIALOG_SHIM::Validate() )
350 for(
size_t i = 0; i <
m_texts->size(); ++i )
356 if(
text.GetText().IsEmpty() )
431 if(
text.GetTextThickness() > maxPenWidth )
440 "It will be clamped at %s." ),
481 FP_TEXT* textItem = dyn_cast<FP_TEXT*>( item );
486 if( i < m_texts->size() )
487 *textItem =
m_texts->at( i++ );
494 while( i < m_texts->size() )
498 view->Add( newText );
526 case 1: attributes |=
FP_SMD;
break;
553 bool change_layer =
false;
569 fpList->insert( fpList->end(), panelList.begin(), panelList.end() );
573 commit.
Push(
_(
"Modify footprint properties" ) );
600 m_texts->push_back( textItem );
603 wxGridTableMessage msg(
m_texts, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, 1 );
620 wxArrayInt selectedRows =
m_itemsGrid->GetSelectedRows();
622 if( selectedRows.empty() &&
m_itemsGrid->GetGridCursorRow() >= 0 )
623 selectedRows.push_back(
m_itemsGrid->GetGridCursorRow() );
625 if( selectedRows.empty() )
628 for(
int row : selectedRows )
632 DisplayError(
nullptr,
_(
"Reference and value are mandatory." ) );
638 selectedRows.Sort( [](
int* first,
int* second ) {
return *second - *first; } );
640 for(
int row : selectedRows )
645 wxGridTableMessage msg(
m_texts, wxGRIDTABLE_NOTIFY_ROWS_DELETED, row, 1 );
664 for(
int i = 1; i <
m_itemsGrid->GetNumberCols(); i++ )
705 grid->MakeCellVisible( row, col );
711 grid->SetGridCursor( row, col );
712 grid->EnableCellEditControl(
true );
713 grid->ShowCellEditControl();
717 auto referenceEditor =
grid->GetCellEditor( 0, 0 );
719 if(
auto textEntry =
dynamic_cast<wxTextEntry*
>( referenceEditor->GetControl() ) )
722 referenceEditor->DecRef();
732 wxSize new_size = aEvent.GetSize();
766 int page = aEvent.GetSelection();
770 m_NoteBook->ChangeSelection( (
unsigned) page );
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
virtual void Push(const wxString &aMessage=wxT("A commit"), int aCommitFlags=0) override
Revert the commit by restoring the modified items state.
Container for design settings for a BOARD object.
bool GetTextUpright(PCB_LAYER_ID aLayer) const
int GetTextThickness(PCB_LAYER_ID aLayer) const
Return the default text thickness from the layer class for the given layer.
bool GetTextItalic(PCB_LAYER_ID aLayer) const
VECTOR2I GetTextSize(PCB_LAYER_ID aLayer) const
Return the default text size from the layer class for the given layer.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
void DeleteStructure()
Delete this object after removing from its parent if it has one.
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.
Information pertinent to a Pcbnew printed circuit board.
LSET GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
COMMIT & Modify(EDA_ITEM *aItem)
Create an undo entry for an item that has been already modified.
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...
EDA_ITEM_FLAGS GetEditFlags() const
void SetMirrored(bool isMirrored)
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
void SetKeepUpright(bool aKeepUpright)
void SetTextSize(const VECTOR2I &aNewSize)
void SetItalic(bool aItalic)
int GetNumberRows() override
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Return an LSEQ from the union of this LSET and a desired sequence.
static LSET AllTechMask()
Return a mask holding all technical layers (no CU layer) on both side.
std::vector< FP_3DMODEL > & GetModelList()
bool TransferDataToWindow() override
void AdjustGridColumnWidths()
bool TransferDataFromWindow() override
wxString m_FootprintTextShownColumns
PCBNEW_SETTINGS * GetPcbNewSettings() const
virtual PCB_LAYER_ID GetActiveLayer() const
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Returns the BOARD_DESIGN_SETTINGS for the open project.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
The main frame for Pcbnew.
wxString StringFromValue(double aValue, bool aAddUnitLabel=false, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
Converts aValue in internal units into a united string.
int ValueFromString(const wxString &aTextValue, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
Converts aTextValue in aUnits to internal units used by the frame.
virtual long long int GetValue()
Return the current value in Internal Units.
virtual void SetPrecision(int aLength)
Normally not needed, but can be used to set the precision when using internal units that are floats (...
virtual void SetUnits(EDA_UNITS aUnits)
Normally not needed (as the UNIT_BINDER inherits from the parent frame), but can be used to set to DE...
virtual EDA_ANGLE GetAngleValue()
virtual void SetNegativeZero()
virtual double GetDoubleValue()
Return the current value in Internal Units.
virtual void SetAngleValue(const EDA_ANGLE &aValue)
virtual void SetDoubleValue(double aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
virtual bool Validate(double aMin, double aMax, EDA_UNITS aUnits=EDA_UNITS::UNSCALED)
Validate the control against the given range, informing the user of any errors found.
virtual void SetValue(long long int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
void SetCoordType(ORIGIN_TRANSFORMS::COORD_TYPES_T aCoordType)
Set the current origin transform mode.
int GetVisibleWidth(int aCol, bool aHeader=true, bool aContents=true, bool aKeep=false)
Calculates the specified column based on the actual size of the text on screen.
void ShowHideColumns(const wxString &shownColumns)
Show/hide the grid columns based on a tokenized string of shown column indexes.
void SetTable(wxGridTableBase *table, bool aTakeOwnership=false)
Hide wxGrid's SetTable() method with one which doesn't mess up the grid column widths when setting th...
void DestroyTable(wxGridTableBase *aTable)
Work-around for a bug in wxGrid which crashes when deleting the table if the cell edit control was no...
wxString GetShownColumns()
Get a tokenized string containing the shown column indexes.
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
This file is part of the common library.
int Clamp_Text_PenSize(int aPenSize, int aSize, bool aStrict)
Pen width should not allow characters to become cluttered up in their own fatness.
bool IsBackLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a back layer.
PCB_LAYER_ID
A quick note on layer IDs:
wxFont GetInfoFont(wxWindow *aWindow)
void SelectReferenceNumber(wxTextEntry *aTextEntry)
Select the number (or "?") in a reference for ease of editing.
#define TEXTS_MAX_SIZE
Maximum text size in internal units (10 inches)
#define TEXTS_MIN_SIZE
Minimum text size in internal units (1 mil)
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
@ THERMAL
Use thermal relief for pads.
@ NONE
Pads are not covered.
@ FULL
pads are covered by copper