58 m_netClearance( aParent, m_NetClearanceLabel, m_NetClearanceCtrl, m_NetClearanceUnits, true ),
59 m_solderMask( aParent, m_SolderMaskMarginLabel, m_SolderMaskMarginCtrl, m_SolderMaskMarginUnits ),
60 m_solderPaste( aParent, m_SolderPasteMarginLabel, m_SolderPasteMarginCtrl, m_SolderPasteMarginUnits ),
97 wxGridCellAttr* attr =
new wxGridCellAttr;
99 "*.*",
true,
Prj().GetProjectPath() ) );
103 attr =
new wxGridCellAttr;
104 attr->SetRenderer(
new wxGridCellBoolRenderer() );
106 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
110 aParent->
Prj().Get3DCacheManager()->GetResolver()->SetProgramBase( &
Pgm() );
119 wxFont infoFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
120 infoFont.SetSymbolicSize( wxFONTSIZE_SMALL );
128 infoFont.SetStyle( wxFONTSTYLE_ITALIC );
184 Prj().Get3DCacheManager()->FlushCache(
false );
204 if( !wxDialog::TransferDataToWindow() )
220 auto textItem = dyn_cast<FP_TEXT*>( item );
223 m_texts->push_back( *textItem );
233 m_AutoPlaceCtrl->SetItemToolTip( 0,
_(
"Enable hotkey move commands and Auto Placement" ) );
234 m_AutoPlaceCtrl->SetItemToolTip( 1,
_(
"Disable hotkey move commands and Auto Placement" ) );
290 wxString default_path;
293 default_path.Replace( wxT(
"/" ), wxT(
"\\" ) );
299 wxString origPath, alias, shortPath;
305 origPath = model.m_Filename;
307 if( res && res->
SplitAlias( origPath, alias, shortPath ) )
308 origPath = alias + wxT(
":" ) + shortPath;
313 m_modelsGrid->SetCellValue( row, 1, model.m_Show ? wxT(
"1" ) : wxT(
"0" ) );
319 for(
int col = 0; col <
m_itemsGrid->GetNumberCols(); col++ )
332 col_size = std::max( col_size, GetTextExtent( board->
GetLayerName( layer ) ).x );
356 aModelIdx = std::max( 0, aModelIdx );
357 aModelIdx = std::min( aModelIdx,
m_modelsGrid->GetNumberRows() - 1 );
380 if( aEvent.GetCol() == 0 )
382 bool hasAlias =
false;
384 wxString filename =
m_modelsGrid->GetCellValue( aEvent.GetRow(), 0 );
386 filename.Replace(
"\n",
"" );
387 filename.Replace(
"\r",
"" );
388 filename.Replace(
"\t",
"" );
402 filename.insert( 0, wxT(
":" ) );
406 filename.Replace( wxT(
"\\" ), wxT(
"/" ) );
410 m_modelsGrid->SetCellValue( aEvent.GetRow(), 0, filename );
412 else if( aEvent.GetCol() == 1 )
414 wxString showValue =
m_modelsGrid->GetCellValue( aEvent.GetRow(), 1 );
416 m_shapes3D_list[ aEvent.GetRow() ].m_Show = ( showValue == wxT(
"1" ) );
457 if( initialpath.IsEmpty() )
459 if( !wxGetEnv(
"KICAD6_3DMODEL_DIR", &initialpath ) || initialpath.IsEmpty() )
468 if( tmp > 0 && tmp <= INT_MAX )
487 if( res && res->
SplitAlias( filename, alias, shortPath ) )
488 filename = alias + wxT(
":" ) + shortPath;
535 if( aFootprintName.IsEmpty() )
556 if( !DIALOG_SHIM::Validate() )
574 for(
size_t i = 2; i <
m_texts->size(); ++i )
604 if( !DIALOG_SHIM::TransferDataFromWindow() )
610 if( !
m_Panel3D->TransferDataFromWindow() )
629 std::vector<FP_TEXT*> items_to_remove;
633 FP_TEXT* textItem = dynamic_cast<FP_TEXT*>( item );
638 if( i < m_texts->size() )
639 *textItem =
m_texts->at( i++ );
642 items_to_remove.push_back( textItem );
649 for(
FP_TEXT* item: items_to_remove )
652 view->Remove( item );
653 item->DeleteStructure();
657 while( i < m_texts->size() )
661 view->Add( newText );
671 case 1: attributes |=
FP_SMD;
break;
696 msg.ToDouble( &dtmp );
721 commit.
Push(
_(
"Modify footprint properties" ) );
766 m_texts->push_back( textItem );
769 wxGridTableMessage msg(
m_texts, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, 1 );
790 else if( curRow < 2 )
792 DisplayError(
nullptr,
_(
"Reference and value are mandatory." ) );
799 wxGridTableMessage msg(
m_texts, wxGRIDTABLE_NOTIFY_ROWS_DELETED, curRow, 1 );
825 for(
int i = 1; i <
m_itemsGrid->GetNumberCols(); i++ )
875 textEntry->SelectAll();
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
COMMIT & Modify(EDA_ITEM *aItem)
Create an undo entry for an item that has been already modified.
const UTF8 & GetLibItemName() const
Container for project specific data.
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
#define KICAD6_3DMODEL_DIR
A variable name whose value holds the path of 3D shape files.
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...
const BITMAP_OPAQUE small_folder_xpm[1]
void ShowHideColumns(const wxString &shownColumns)
Show/hide the grid columns based on a tokenized string of shown column indexes.
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)
bool Select3DModel(wxWindow *aParent, S3D_CACHE *aCache, wxString &prevModelSelectDir, int &prevModelWildcard, FP_3DMODEL *aModel)
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
LSET GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings Returns a bit-mask of all t...
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...
A logical library item identifier and consists of various portions much like a URI.
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.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
virtual const wxString GetProjectPath() const
Return the full path of the project.
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
void SetValue(const wxString &aValue) override
Set a new value in evaluator buffer, and display it in the wxTextCtrl.
void UpdateDummyFootprint(bool aRelaodRequired=true)
Copy shapes from the current shape list which are flagged for preview to the copy of footprint that i...
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.
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
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
wxString m_lastFootprint3dDir
bool SplitAlias(const wxString &aFileName, wxString &anAlias, wxString &aRelPath)
Return true if the given name contains an alias and populates the string anAlias with the alias and a...
bool m_Show
Include model in rendering.
PCB_LAYER_ID
A quick note on layer IDs:
pads are covered by copper
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
virtual BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Editor for wxGrid cells that adds a file/folder browser to the grid input field.
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
void SetSelectedModel(int idx)
Set the currently selected index in the model list so that the scale/rotation/offset controls can be ...
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
const BITMAP_OPAQUE small_trash_xpm[1]
int SetLibItemName(const UTF8 &aLibItemName, bool aTestForRev=true)
Override the library item name portion of the LIB_ID to aLibItemName.
const BITMAP_OPAQUE icon_modedit_xpm[1]
virtual void SetRString(RSTRING_T aStringId, const wxString &aString)
Store a "retained string", which is any session and project specific string identified in enum RSTRIN...
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
wxString m_Filename
The 3D shape filename in 3D library.
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.
virtual const wxString & GetRString(RSTRING_T aStringId)
Return a "retained string", which is any session and project specific string identified in enum RSTRI...
bool Configure3DPaths(wxWindow *aParent, FILENAME_RESOLVER *aResolver)
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.
Provide an extensible class to resolve 3D model paths.
Declaration of the eda_3d_viewer class.
Information pertinent to a Pcbnew printed circuit board.
virtual void SetValue(int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
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 long long int GetValue()
Return the current value in Internal Units.
static bool GetLayer(MODEL_VRML &aModel, LAYER_NUM layer, VRML_LAYER **vlayer)
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
bool ValidateFileName(const wxString &aFileName, bool &hasAlias)
Returns true if the given path is a valid aliased relative path.
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
virtual const wxString & GetText() const
Return the string associated with the text object.
const BITMAP_OPAQUE small_plus_xpm[1]
Custom text control validator definitions.
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.