59 m_footprint( aFootprint ),
60 m_posX( aParent, m_XPosLabel, m_ModPositionX, m_XPosUnit ),
61 m_posY( aParent, m_YPosLabel, m_ModPositionY, m_YPosUnit ),
62 m_orientValidator( 3, &m_orientValue ),
63 m_netClearance( aParent, m_NetClearanceLabel, m_NetClearanceCtrl, m_NetClearanceUnits ),
64 m_solderMask( aParent, m_SolderMaskMarginLabel, m_SolderMaskMarginCtrl,
65 m_SolderMaskMarginUnits ),
66 m_solderPaste( aParent, m_SolderPasteMarginLabel, m_SolderPasteMarginCtrl,
67 m_SolderPasteMarginUnits ),
68 m_solderPasteRatio( aParent, m_PasteMarginRatioLabel, m_PasteMarginRatioCtrl,
69 m_PasteMarginRatioUnits ),
70 m_returnValue( FP_PROPS_CANCEL ),
71 m_initialized( false )
81 for(
size_t i = 0; i <
m_NoteBook->GetPageCount(); ++i )
121 infoFont.SetStyle( wxFONTSTYLE_ITALIC );
190 Prj().Get3DCacheManager()->FlushCache(
false );
263 if( !wxDialog::TransferDataToWindow() )
279 FP_TEXT* textItem = dyn_cast<FP_TEXT*>( item );
282 m_texts->push_back( *textItem );
313 m_AutoPlaceCtrl->SetItemToolTip( 0,
_(
"Footprint can be freely moved and oriented on the " 315 m_AutoPlaceCtrl->SetItemToolTip( 1,
_(
"Footprint is locked: it cannot be freely moved and " 316 "oriented on the canvas and can only be selected when " 317 "the 'Locked items' checkbox is enabled in the " 318 "selection filter." ) );
353 for(
int col = 0; col <
m_itemsGrid->GetNumberCols(); col++ )
365 col_size = std::max( col_size, GetTextExtent( board->
GetLayerName( layer ) ).x );
389 if( !DIALOG_SHIM::Validate() )
393 for(
size_t i = 2; i <
m_texts->size(); ++i )
397 if(
text.GetText().IsEmpty() )
443 FP_TEXT* textItem = dyn_cast<FP_TEXT*>( item );
448 if( i < m_texts->size() )
449 *textItem =
m_texts->at( i++ );
456 while( i < m_texts->size() )
460 view->Add( newText );
488 case 1: attributes |=
FP_SMD;
break;
516 bool change_layer =
false;
532 fpList->insert( fpList->end(), panelList.begin(), panelList.end() );
536 commit.
Push(
_(
"Modify footprint properties" ) );
563 m_texts->push_back( textItem );
566 wxGridTableMessage msg(
m_texts, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, 1 );
583 wxArrayInt selectedRows =
m_itemsGrid->GetSelectedRows();
585 if( selectedRows.empty() &&
m_itemsGrid->GetGridCursorRow() >= 0 )
586 selectedRows.push_back(
m_itemsGrid->GetGridCursorRow() );
588 if( selectedRows.empty() )
591 for(
int row : selectedRows )
595 DisplayError(
nullptr,
_(
"Reference and value are mandatory." ) );
601 selectedRows.Sort( [](
int* first,
int* second ) {
return *second - *first; } );
603 for(
int row : selectedRows )
608 wxGridTableMessage msg(
m_texts, wxGRIDTABLE_NOTIFY_ROWS_DELETED, row, 1 );
627 for(
int i = 1; i <
m_itemsGrid->GetNumberCols(); i++ )
674 grid->MakeCellVisible( row, col );
680 grid->SetGridCursor( row, col );
681 grid->EnableCellEditControl(
true );
682 grid->ShowCellEditControl();
686 auto referenceEditor =
grid->GetCellEditor( 0, 0 );
688 if(
auto textEntry = dynamic_cast<wxTextEntry*>( referenceEditor->GetControl() ) )
691 referenceEditor->DecRef();
720 int page = aEvent.GetSelection();
724 m_NoteBook->ChangeSelection( (
unsigned) page );
731 wxSize pageSize =
m_NoteBook->GetPage( page )->GetSize();
734 m_NoteBook->GetPage( page )->SetSize( pageSize );
void SetMirrored(bool isMirrored)
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
void SelectReferenceNumber(wxTextEntry *aTextEntry)
Select the number (or "?") in a reference for ease of editing.
COMMIT & Modify(EDA_ITEM *aItem)
Create an undo entry for an item that has been already modified.
void AdjustGridColumnWidths(int aWidth)
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Returns the BOARD_DESIGN_SETTINGS for the open project.
virtual void SetNegativeZero()
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
This file is part of the common library.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
void ShowHideColumns(const wxString &shownColumns)
Show/hide the grid columns based on a tokenized string of shown column indexes.
void ValidatorTransferToWindowWithoutEvents(wxValidator &aValidator)
Call a text validator's TransferDataToWindow method without firing a text change event.
std::vector< wxWindow * > m_tabOrder
int GetNumberRows() override
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
void SetItalic(bool isItalic)
wxFont GetInfoFont(wxWindow *aWindow)
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
void DeleteStructure()
Delete this object after removing from its parent if it has one.
std::vector< FP_3DMODEL > & GetModelList()
LSET GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
void SetTextSize(const wxSize &aNewSize)
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...
wxString m_FootprintTextShownColumns
int GetTextThickness(PCB_LAYER_ID aLayer) const
Return the default text thickness from the layer class for the given layer.
static LSET AllTechMask()
Return a mask holding all technical layers (no CU layer) on both side.
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Return an LSEQ from the union of this LSET and a desired sequence.
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
int GetVisibleWidth(int aCol, bool aHeader=true, bool aContents=false, bool aKeep=true)
Calculates the specified column based on the actual size of the text on screen.
bool GetTextUpright(PCB_LAYER_ID aLayer) const
void DestroyTable(wxGridTableBase *aTable)
Work-around for a bug in wxGrid which crashes when deleting the table if the cell edit control was no...
bool GetTextItalic(PCB_LAYER_ID aLayer) const
virtual PCB_LAYER_ID GetActiveLayer() const
pads are covered by copper
bool IsBackLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a back layer.
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
EDA_ITEM_FLAGS GetEditFlags() const
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
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 KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
Use thermal relief for pads.
wxString GetShownColumns()
Get a tokenized string containing the shown column indexes.
void SetKeepUpright(bool aKeepUpright)
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 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.
Information pertinent to a Pcbnew printed circuit board.
PCB_LAYER_ID
A quick note on layer IDs:
The main frame for Pcbnew.
PCBNEW_SETTINGS & Settings()
PCBNEW_SETTINGS * GetPcbNewSettings() const
virtual void Push(const wxString &aMessage=wxT("A commit"), bool aCreateUndoEntry=true, bool aSetDirtyBit=true) override
Revert the commit by restoring the modified items state.
virtual void SetValue(long long int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
virtual long long int GetValue()
Return the current value in Internal Units.
bool TransferDataToWindow() override
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
void SetCoordType(ORIGIN_TRANSFORMS::COORD_TYPES_T aCoordType)
Set the current origin transform mode.
virtual void SetDoubleValue(double aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
virtual double GetDoubleValue()
Return the current value in Internal Units.
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Custom text control validator definitions.
bool TransferDataFromWindow() override
wxSize GetTextSize(PCB_LAYER_ID aLayer) const
Return the default text size from the layer class for the given layer.
Container for design settings for a BOARD object.