55#include <python_scripting.h>
95#include <wx/wupdlock.h>
110#include "../scripting/python_scripting.h"
112#include <wx/filedlg.h>
114using namespace std::placeholders;
186 m_exportNetlistAction(
nullptr ), m_findDialog(
nullptr )
188 m_maximizeByDefault =
true;
189 m_showBorderAndTitleBlock =
true;
190 m_SelTrackWidthBox =
nullptr;
191 m_SelViaSizeBox =
nullptr;
192 m_SelLayerBox =
nullptr;
193 m_show_layer_manager_tools =
true;
194 m_supportsAutoSave =
true;
195 m_probingSchToPcb =
false;
196 m_show_properties =
true;
197 m_show_search =
false;
201 m_ZoneFillsDirty =
true;
203 m_aboutTitle =
_HKI(
"KiCad PCB Editor" );
207 m_exportNetlistAction =
new TOOL_ACTION(
"pcbnew.EditorControl.exportNetlist",
209 _(
"Export netlist used to update schematics" ) );
213 GetGalDisplayOptions(),
217 SetBoard(
new BOARD() );
220 wxIconBundle icon_bundle;
223 icon_bundle.AddIcon( icon );
225 icon_bundle.AddIcon( icon );
227 icon_bundle.AddIcon( icon );
229 SetIcons( icon_bundle );
238 GetScreen()->m_Center =
false;
245 ReCreateAuxiliaryToolbar();
247 ReCreateOptToolbar();
252 float proportion = GetPcbNewSettings()->m_AuiPanels.properties_splitter_proportion;
253 m_propertiesPanel->SetSplitterProportion( proportion );
260 m_auimgr.SetManagedWindow(
this );
264 unsigned int auiFlags = wxAUI_MGR_DEFAULT;
265#if !defined( _WIN32 )
268 auiFlags |= wxAUI_MGR_LIVE_RESIZE;
270 m_auimgr.SetFlags( auiFlags );
273 m_auimgr.AddPane( m_mainToolBar,
EDA_PANE().HToolbar().Name( wxS(
"MainToolbar" ) )
275 m_auimgr.AddPane( m_auxiliaryToolBar,
EDA_PANE().HToolbar().Name( wxS(
"AuxToolbar" ) )
277 m_auimgr.AddPane( m_messagePanel,
EDA_PANE().Messages().Name( wxS(
"MsgPanel" ) )
278 .Bottom().Layer( 6 ) );
281 m_auimgr.AddPane( m_optionsToolBar,
EDA_PANE().VToolbar().Name( wxS(
"OptToolbar" ) )
282 .
Left().Layer( 3 ) );
284 m_auimgr.AddPane( m_drawToolBar,
EDA_PANE().VToolbar().Name( wxS(
"ToolsToolbar" ) )
285 .
Right().Layer( 3 ) );
287 m_auimgr.AddPane( m_appearancePanel,
EDA_PANE().Name( wxS(
"LayersManager" ) )
289 .Caption(
_(
"Appearance" ) ).PaneBorder(
false )
290 .MinSize( 180, -1 ).BestSize( 180, -1 ) );
292 m_auimgr.AddPane( m_selectionFilterPanel,
EDA_PANE().Name( wxS(
"SelectionFilter" ) )
293 .
Right().Layer( 4 ).Position( 2 )
294 .Caption(
_(
"Selection Filter" ) ).PaneBorder(
false )
295 .MinSize( 180, -1 ).BestSize( 180, -1 ) );
297 m_auimgr.AddPane( m_propertiesPanel,
EDA_PANE().Name( wxS(
"PropertiesManager" ) )
298 .
Left().Layer( 5 ).Caption(
_(
"Properties" ) )
299 .PaneBorder(
false ).MinSize( 240, -1 ).BestSize( 300, -1 ) );
302 m_auimgr.AddPane( GetCanvas(),
EDA_PANE().Canvas().Name( wxS(
"DrawFrame" ) )
306 m_auimgr.AddPane( m_searchPane,
EDA_PANE()
307 .Name( SearchPaneName() )
309 .Caption(
_(
"Search" ) )
313 .FloatingSize( 480, 200 )
315 .DestroyOnClose(
false ) );
318 m_auimgr.GetPane(
"LayersManager" ).Show( m_show_layer_manager_tools );
319 m_auimgr.GetPane(
"SelectionFilter" ).Show( m_show_layer_manager_tools );
320 m_auimgr.GetPane(
"PropertiesManager" ).Show( m_show_properties );
322 m_auimgr.GetPane( SearchPaneName() ).Show( m_show_search );
325 m_auimgr.GetPane(
"SelectionFilter" ).dock_proportion = 0;
327 FinishAUIInitialization();
331 if( settings->m_AuiPanels.right_panel_width > 0 )
333 wxAuiPaneInfo& layersManager = m_auimgr.GetPane( wxS(
"LayersManager" ) );
334 SetAuiPaneSize( m_auimgr, layersManager, settings->m_AuiPanels.right_panel_width, -1 );
337 if( settings->m_AuiPanels.properties_panel_width > 0 && m_propertiesPanel )
339 wxAuiPaneInfo& propertiesPanel = m_auimgr.GetPane( wxS(
"PropertiesManager" ) );
341 settings->m_AuiPanels.properties_panel_width, -1 );
344 if( settings->m_AuiPanels.search_panel_height > 0 )
346 wxAuiPaneInfo& searchPane = m_auimgr.GetPane( SearchPaneName() );
347 SetAuiPaneSize( m_auimgr, searchPane, -1, settings->m_AuiPanels.search_panel_height );
350 m_appearancePanel->SetTabIndex( settings->m_AuiPanels.appearance_panel_tab );
362 m_redrawNetnamesTimer.SetOwner(
this );
366 [
this]( wxIdleEvent& aEvent )
368 if( GetCanvas()->GetView()->GetViewport() != m_lastViewport )
370 m_lastViewport = GetCanvas()->GetView()->GetViewport();
371 m_redrawNetnamesTimer.StartOnce( 500 );
383 PythonSyncEnvironmentVariables();
384 PythonSyncProjectName();
389 GetCanvas()->SwitchBackend( m_canvasType );
396 wxString strK2S =
Pgm().GetExecutablePath();
399 if( strK2S.Find( wxT(
"pcbnew.app" ) ) != wxNOT_FOUND )
402 strK2S += wxT(
"../../" );
405 strK2S += wxT(
"Contents/MacOS/" );
408 wxFileName appK2S( strK2S, wxT(
"kicad2step" ) );
411 appK2S.SetExt( wxT(
"exe" ) );
426 m_appearancePanel->OnBoardChanged();
436 UpdateToolbarControlSizes();
441 m_eventCounterTimer =
new wxTimer(
this );
444 [&]( wxTimerEvent& aEvent )
446 GetCanvas()->m_PaintEventCounter->Show();
447 GetCanvas()->m_PaintEventCounter->Reset();
455 m_eventCounterTimer->GetId() );
457 m_eventCounterTimer->Start( 1000 );
462 DragAcceptFiles(
true );
479 open_dlg->Close(
true );
505 if( aBuildConnectivity )
521 bool needs_refresh =
false;
540 double lod = track->ViewGetLOD(
GetNetnameLayer( track->GetLayer() ), view );
545 if( lod != track->GetCachedLOD() ||
scale != track->GetCachedScale() )
548 needs_refresh =
true;
549 track->SetCachedLOD( lod );
550 track->SetCachedScale(
scale );
578 if( screen !=
nullptr )
646 pcbTool->SetIsBoardEditor(
true );
663#define ENABLE( x ) ACTION_CONDITIONS().Enable( x )
664#define CHECK( x ) ACTION_CONDITIONS().Check( x )
698 if( SCRIPTING::IsWxAvailable() )
701 auto enableZoneControlConition =
709 ENABLE( enableZoneControlConition )
712 ENABLE( enableZoneControlConition )
715 ENABLE( enableZoneControlConition )
718 ENABLE( enableZoneControlConition )
723 auto constrainedDrawingModeCond =
729 auto enableBoardSetupCondition =
733 return !tool->IsDRCDialogShown();
738 auto boardFlippedCond =
744 auto layerManagerCond =
750 auto propertiesCond =
756 auto searchPaneCond =
762 auto highContrastCond =
768 auto globalRatsnestCond =
774 auto curvedRatsnestCond =
780 auto netHighlightCond =
787 auto enableNetHighlightCond =
801 .Enable( enableNetHighlightCond ) );
806 auto isArcKeepCenterMode = [
this](
const SELECTION& )
811 auto isArcKeepEndpointMode = [
this](
const SELECTION& )
820 auto isHighlightMode =
834 auto isWalkaroundMode =
852 if( bci->GetNetCode() > 0 )
892#define CURRENT_TOOL( action ) mgr->SetConditions( action, CHECK( cond.CurrentTool( action ) ) )
908#define CURRENT_EDIT_TOOL( action ) mgr->SetConditions( action, ACTION_CONDITIONS().Check( cond.CurrentTool( action ) ).Enable( isDrcRunning ) )
944#undef CURRENT_EDIT_TOOL
952 if( event.GetId() == wxID_EXIT )
955 if( event.GetId() == wxID_CLOSE ||
Kiface().IsSingle() )
967 if( marker->IsExcluded() )
980 marker->GetRCItem()->SetItems(
GetCanvas()->GetDrawingSheet() );
982 commit.
Add( marker );
1011 if( zoneFillerTool->
IsBusy() )
1015 if( wxWindow* reporter =
dynamic_cast<wxWindow*
>( zoneFillerTool->
GetProgressReporter() ) )
1016 reporter->ShowWithEffect( wxSHOW_EFFECT_EXPAND );
1021 if(
Kiface().IsSingle() )
1025 if( fpEditor && !fpEditor->Close() )
1030 if( fpViewer && !fpViewer->Close() )
1035 if( fpViewer && !fpViewer->Close() )
1042 if( fpEditor && fpEditor->IsCurrentFPFromBoard() )
1044 if( !fpEditor->CanCloseFPFromBoard(
true ) )
1052 wxString msg =
_(
"Save changes to '%s' before closing?" );
1057 return Files_io_from_id( ID_SAVE_BOARD );
1069 open_dlg->Close(
true );
1083 GetCanvas()->SetEvtHandlerEnabled(
false );
1095 if( !fn.IsOk() || !fn.IsDirWritable() )
1096 fn.SetPath( wxFileName::GetTempDir() );
1098 wxLogTrace(
traceAutoSave, wxT(
"Deleting auto save file <" ) + fn.GetFullPath() + wxT(
">" ) );
1101 if( fn.FileExists() && !wxRemoveFile( fn.GetFullPath() ) )
1102 wxLogTrace(
traceAutoSave, wxT(
"The auto save file could not be removed!" ) );
1112 m_auimgr.GetPane( wxS(
"LayersManager" ) ).Show(
false );
1113 m_auimgr.GetPane( wxS(
"TabbedPanel" ) ).Show(
false );
1146 if( !aInitialPage.IsEmpty() )
1167 else if(
dynamic_cast<PAD*
>( aItem ) )
1175 if( (
GetBoard()->GetVisibleLayers() & maskAndPasteLayers ).any() )
1183 text->ClearRenderCache();
1184 text->ClearBoundingBoxCache();
1279 if( oldLayer == aLayer )
1331 if( ( oldLayer ==
F_Cu || aLayer ==
F_Cu ) &&
pad->IsOnLayer(
F_Cu ) )
1334 if( ( oldLayer ==
B_Cu || aLayer ==
B_Cu ) &&
pad->IsOnLayer(
B_Cu ) )
1337 else if(
pad->IsOnLayer( oldLayer ) ||
pad->IsOnLayer( aLayer ) )
1378 layerEnum.
Map( *seq,
GetBoard()->GetLayerName( *seq ) );
1398 if( fn.FileExists() && !fn.IsFileWritable() )
1435 SetStatusText( wxEmptyString );
1487 if(
project.m_PcbLastPath[ aType ].IsEmpty() )
1488 return wxEmptyString;
1490 wxFileName absoluteFileName =
project.m_PcbLastPath[ aType ];
1493 absoluteFileName.MakeAbsolute( pcbFileName.GetPath() );
1494 return absoluteFileName.GetFullPath();
1502 wxFileName relativeFileName = aLastPath;
1505 relativeFileName.MakeRelativeTo( pcbFileName.GetPath() );
1507 if( relativeFileName.GetFullPath() !=
project.m_PcbLastPath[ aType ] )
1509 project.m_PcbLastPath[ aType ] = relativeFileName.GetFullPath();
1521 if( !GetTitle().StartsWith( wxT(
"*" ) ) )
1543 bool readOnly =
false;
1544 bool unsaved =
false;
1546 if( fn.IsOk() && fn.FileExists() )
1547 readOnly = !fn.IsFileWritable();
1556 title += fn.GetName();
1559 title += wxS(
" " ) +
_(
"[Read Only]" );
1562 title += wxS(
" " ) +
_(
"[Unsaved]" );
1564 title += wxT(
" \u2014 " ) +
_(
"PCB Editor" );
1599 layerEnum.
Map( *seq,
GetBoard()->GetLayerName( *seq ) );
1627 wxString findString;
1631 if( selection.
Size() == 1 )
1635 switch( front->
Type() )
1638 findString =
static_cast<FOOTPRINT*
>( front )->GetValue();
1642 findString =
static_cast<FP_TEXT*
>( front )->GetShownText();
1646 findString =
static_cast<PCB_TEXT*
>( front )->GetShownText();
1648 if( findString.Contains( wxT(
"\n" ) ) )
1649 findString = findString.Before(
'\n' );
1698 wxFAIL_MSG( wxT(
"ToPlotter(): unexpected plot type" ) );
break;
1711 if(
Kiface().IsSingle() )
1723 if( !frame->IsShown() )
1725 wxFileName fn(
Prj().GetProjectPath(),
Prj().GetProjectName(),
1730 if( !fn.FileExists() )
1734 if( !fn.FileExists() )
1736 DisplayError(
this,
_(
"The schematic for this board cannot be found." ) );
1745 frame->Show(
true );
1756 const wxString& aAnnotateMessage )
1761 "stand-alone mode. In order to create or update PCBs from "
1762 "schematics, you must launch the KiCad project manager and "
1763 "create a project." ) );
1772 std::string payload( aAnnotateMessage );
1776 if( payload == aAnnotateMessage )
1794 wxString extra_info = e.
Problem() + wxT(
" : " ) + e.
What() + wxT(
" at " ) + e.
Where();
1797 "report this issue to the KiCad team using the menu "
1798 "Help->Report Bug."), extra_info );
1809 wxFileName schematic(
Prj().GetProjectPath(),
Prj().GetProjectName(),
1812 if( !schematic.FileExists() )
1814 wxFileName legacySchematic(
Prj().GetProjectPath(),
Prj().GetProjectName(),
1817 if( legacySchematic.FileExists() )
1819 schematic = legacySchematic;
1823 msg.Printf(
_(
"Schematic file '%s' not found." ), schematic.GetFullPath() );
1829 if(
Kiface().IsSingle() )
1863 if( !frame->IsShown() )
1866 frame->
OpenProjectFiles( std::vector<wxString>( 1, schematic.GetFullPath() ) );
1867 frame->Show(
true );
1872 if( frame->IsIconized() )
1874 frame->Iconize(
false );
1878 frame->Maximize(
false );
1892 for(
const std::pair<const wxString, ENV_VAR_ITEM>& var : vars )
1893 UpdatePythonEnvVar( var.first, var.second.GetValue() );
1897 for(
const std::pair<const wxString, ENV_VAR_ITEM>& var : vars )
1898 wxSetEnv( var.first, var.second.GetValue() );
1916 if( aFootprint ==
nullptr )
1952 editor->LoadFootprintFromBoard( aFootprint );
1978 bool aSelectedMode )
1990 bool resetText,
bool resetTextLayers,
bool resetTextEffects,
1998 if( resetTextLayers )
2009 if( resetTextEffects )
2033 std::vector<FP_TEXT*> candidates;
2037 FP_TEXT* candidate = dyn_cast<FP_TEXT*>( item );
2040 candidates.push_back( candidate );
2043 if( candidates.size() == 0 )
2046 if( candidates.size() == 1 )
2047 return candidates[0];
2050 std::vector<FP_TEXT*> candidatesOnSameLayer;
2052 for(
FP_TEXT* candidate : candidates )
2055 candidatesOnSameLayer.push_back( candidate );
2058 if( candidatesOnSameLayer.size() == 1 )
2059 return candidatesOnSameLayer[0];
2062 std::vector<FP_TEXT*> candidatesAtSamePos;
2064 for(
FP_TEXT* candidate : candidatesOnSameLayer.size() ? candidatesOnSameLayer : candidates )
2067 candidatesAtSamePos.push_back( candidate );
2070 if( candidatesAtSamePos.size() > 0 )
2071 return candidatesAtSamePos[0];
2072 else if( candidatesOnSameLayer.size() > 0 )
2073 return candidatesOnSameLayer[0];
2075 return candidates[0];
2084 bool resetTextLayers,
bool resetTextEffects,
2085 bool resetFabricationAttrs,
bool reset3DModels,
2089 bool dummyBool =
false;
2092 aUpdated = &dummyBool;
2119 PAD* pad_model =
nullptr;
2122 if( !
pad->IsOnCopperLayer() )
2129 if(
pad->GetNumber().IsEmpty() )
2136 PAD* last_pad =
nullptr;
2148 last_pad = pad_model;
2165 resetTextLayers, resetTextEffects, aUpdated );
2168 processTextItem( aExisting->
Value(), aNew->
Value(),
2172 resetTextLayers, resetTextEffects, aUpdated );
2177 FP_TEXT* srcItem = dyn_cast<FP_TEXT*>( item );
2181 FP_TEXT* destItem = getMatchingTextItem( srcItem, aNew );
2185 processTextItem( *srcItem, *destItem,
false, resetTextLayers, resetTextEffects,
2188 else if( !deleteExtraTexts )
2195 if( !resetFabricationAttrs )
2199 if( !reset3DModels )
2207 aCommit.
Remove( aExisting );
2208 aCommit.
Add( aNew );
2244 wxHyperlinkCtrl* button =
new wxHyperlinkCtrl( infobar, wxID_ANY,
_(
"Edit design rules" ),
2247 button->Bind( wxEVT_COMMAND_HYPERLINK, std::function<
void( wxHyperlinkEvent& aEvent )>(
2248 [&]( wxHyperlinkEvent& aEvent )
2253 infobar->RemoveAllButtons();
2254 infobar->AddButton( button );
2255 infobar->AddCloseButton();
2256 infobar->ShowMessage(
_(
"Could not compile custom design rules." ), wxICON_ERROR,
2264 if( aEnvVarsChanged )
2289 wxString wildcard = wxT(
"*.hyp" );
2292 fn.SetExt( wxT(
"hyp") );
2294 wxFileDialog dlg(
this,
_(
"Export Hyperlynx Layout" ), fn.GetPath(), fn.GetFullName(),
2295 wildcard, wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
2297 if( dlg.ShowModal() != wxID_OK )
2303 fn.SetExt( wxT(
"hyp" ) );
2317 return m_auimgr.GetPane( wxS(
"LayersManager" ) ).IsShown();
2323 return m_auimgr.GetPane( wxS(
"PropertiesManager" ) ).IsShown();
Class PCBNEW_ACTION_PLUGINS.
@ KEEP_ENDPOINTS_OR_START_DIRECTION
@ KEEP_CENTER_ADJUST_ANGLE_RADIUS
constexpr EDA_IU_SCALE pcbIUScale
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
@ NORMAL
Inactive layers are shown normally (no high-contrast mode)
@ HIDDEN
Inactive layers are hidden.
static TOOL_ACTION toggleGrid
static TOOL_ACTION millimetersUnits
static TOOL_ACTION togglePolarCoords
static TOOL_ACTION pasteSpecial
static TOOL_ACTION milsUnits
static TOOL_ACTION toggleBoundingBoxes
static TOOL_ACTION showSearch
static TOOL_ACTION duplicate
static TOOL_ACTION inchesUnits
static TOOL_ACTION highContrastMode
static TOOL_ACTION toggleCursorStyle
static TOOL_ACTION measureTool
static TOOL_ACTION doDelete
static TOOL_ACTION selectionTool
static TOOL_ACTION zoomFitScreen
static TOOL_ACTION deleteTool
static TOOL_ACTION zoomTool
static TOOL_ACTION gridSetOrigin
static TOOL_ACTION selectAll
Manage TOOL_ACTION objects.
void SetConditions(const TOOL_ACTION &aAction, const ACTION_CONDITIONS &aConditions)
Set the conditions the UI elements for activating a specific tool action should use for determining t...
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
bool m_ShowEventCounters
Shows debugging event counters in various places.
void ApplyLayerPreset(const wxString &aPresetName)
int GetTabIndex() const
Set the current notebook tab.
void UpdateDisplayOptions()
Return a list of the layer presets created by the user.
void OnColorThemeChanged()
Respond to change in OS's DarkMode.
void OnLanguageChanged()
Update the panel contents from the application and board models.
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Handles how to draw a screen (a board, a schematic ...)
bool IsContentModified() const
const wxString & GetPageNumber() const
virtual void Push(const wxString &aMessage=wxT("A commit"), int aCommitFlags=0) override
Revert the commit by restoring the modified items state.
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
bool GetLocalRatsnestVisible() const
Container for design settings for a BOARD object.
std::set< wxString > m_DrcExclusions
Handle actions specific to the board editor in PcbNew.
Abstract interface for BOARD_ITEMs capable of storing other items inside.
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.
virtual void SetLocked(bool aLocked)
PCB_GROUP * GetParentGroup() const
virtual bool IsOnLayer(PCB_LAYER_ID aLayer) const
Test to see if this object is on the given layer.
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
virtual bool IsLocked() const
Information pertinent to a Pcbnew printed circuit board.
LSET GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
bool IsElementVisible(GAL_LAYER_ID aLayer) const
Test whether a given element category is visible.
void RemoveAllListeners()
Remove all listeners.
const PAGE_INFO & GetPageSettings() const
GAL_SET GetVisibleElements() const
Return a set of all the element categories that are visible.
bool BuildConnectivity(PROGRESS_REPORTER *aReporter=nullptr)
Build or rebuild the board connectivity database for the board, especially the list of connected item...
void SynchronizeNetsAndNetClasses(bool aResetTrackAndViaSizes)
Copy NETCLASS info to each NET, based on NET membership in a NETCLASS.
TITLE_BLOCK & GetTitleBlock()
const std::map< wxString, wxString > & GetProperties() const
void SetProject(PROJECT *aProject, bool aReferenceOnly=false)
Link a board to a given project.
const wxString & GetFileName() const
void SetElementVisibility(GAL_LAYER_ID aLayer, bool aNewState)
Change the visibility of an element category.
PROJECT * GetProject() const
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
void UpdateRatsnestExclusions()
Update the visibility flags on the current unconnected ratsnest lines.
void SetColor(int aLayer, const COLOR4D &aColor)
COLOR4D GetColor(int aLayer) const
COMMIT & Remove(EDA_ITEM *aItem)
Notify observers that aItem has been removed.
COMMIT & Add(EDA_ITEM *aItem)
Notify observers that aItem has been added.
Handle actions that are shared between different applications.
void SetCallback(std::function< void(BOARD_ITEM *)> aCallback)
Function to be called on each found event.
bool Show(bool show=true) override
The Show method is overridden to make the search combobox focused by default.
void Preload(const wxString &aFindString)
void FindNext()
Finds the next item.
A dialog to set the plot options and create plot files in various formats.
void SetSheetCount(int aSheetCount)
Changes the sheet-count number displayed in the title block.
void SetPageNumber(const std::string &aPageNumber)
Changes the page number displayed in the title block.
void SetSheetName(const std::string &aSheetName)
Set the sheet name displayed in the title block.
void SetIsFirstPage(bool aIsFirstPage)
Change if this is first page.
void SetFileName(const std::string &aFileName)
Set the file name displayed in the title block.
virtual APP_SETTINGS_BASE * config() const
Returns the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
virtual void setupUIConditions()
Setup the UI conditions for the various actions and their controls in this frame.
virtual void ThemeChanged()
Process light/dark theme change.
static wxString GetAutoSaveFilePrefix()
WX_INFOBAR * GetInfoBar()
void OnSelectGrid(wxCommandEvent &event)
Command event handler for selecting grid sizes.
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
KIGFX::GAL_DISPLAY_OPTIONS & GetGalDisplayOptions()
Return a reference to the gal rendering options used by GAL for rendering.
virtual void SwitchCanvas(EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType)
Changes the current rendering backend.
virtual void OnSize(wxSizeEvent &event) override
Recalculate the size of toolbars and display panel when the frame size changes.
virtual void OnSelectZoom(wxCommandEvent &event)
Set the zoom factor when selected by the zoom list box in the main tool bar.
virtual wxString GetScreenDesc() const
virtual void Zoom_Automatique(bool aWarpPointer)
Redraw the screen with best zoom level and the best centering that shows all the page or the board.
void OnGridSettings(wxCommandEvent &event)
SEARCH_PANE * m_searchPane
The current canvas type.
static constexpr GAL_TYPE GAL_FALLBACK
void StopDrawing()
Prevent the GAL canvas from further drawing until it is recreated or StartDrawing() is called.
void ForceRefresh()
Force a redraw.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
KIGFX::GAL * GetGAL() const
Return a pointer to the GAL instance used in the panel.
A base class for most all the KiCad significant classes used in schematics and boards.
KICAD_T Type() const
Returns the type of object.
void ClearFlags(EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
virtual void SetParent(EDA_ITEM *aParent)
Specialization of the wxAuiPaneInfo class for KiCad panels.
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
const EDA_ANGLE & GetTextAngle() const
virtual const wxString & GetText() const
Return the string associated with the text object.
void SetAttributes(const EDA_TEXT &aSrc)
Set the text attributes from another instance.
virtual bool IsVisible() const
GR_TEXT_H_ALIGN_T GetHorizJustify() const
virtual void SetVisible(bool aVisible)
GR_TEXT_V_ALIGN_T GetVertJustify() const
virtual void SetText(const wxString &aText)
int GetTextThickness() const
VECTOR2I GetTextSize() const
SELECTION_CONDITION NoActiveTool()
Create a functor testing if there are no tools active in the frame.
SELECTION_CONDITION BoundingBoxes()
SELECTION_CONDITION RedoAvailable()
Create a functor that tests if there are any items in the redo queue.
SELECTION_CONDITION UndoAvailable()
Create a functor that tests if there are any items in the undo queue.
SELECTION_CONDITION ScriptingConsoleVisible()
Create a functor testing if the python scripting console window is visible.
SELECTION_CONDITION Units(EDA_UNITS aUnit)
Create a functor that tests if the frame has the specified units.
SELECTION_CONDITION GridVisible()
Create a functor testing if the grid is visible in a frame.
SELECTION_CONDITION PolarCoordinates()
Create a functor testing if polar coordinates are current being used.
SELECTION_CONDITION FullscreenCursor()
Create a functor testing if the cursor is full screen in a frame.
ENUM_MAP & Map(T aValue, const wxString &aName)
static ENUM_MAP< T > & Instance()
ENUM_MAP & Undefined(T aValue)
const VECTOR2I & GetPos0() const
void SetPos0(const VECTOR2I &aPos)
bool Contains(GAL_LAYER_ID aPos)
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
virtual const wxString What() const
A composite of Problem() and Where()
virtual const wxString Problem() const
what was the problem?
virtual const wxString Where() const
where did the Problem() occur?
Read the new s-expression based KiCad netlist format.
virtual void LoadNetlist() override
Load the contents of the netlist file into aNetlist.
APP_SETTINGS_BASE * KifaceSettings() const
A color representation with 4 components: red, green, blue, alpha.
void ReadWindowSettings(WINDOW_SETTINGS &aCfg)
Read GAL config options from application-level config.
void SetGridColor(const COLOR4D &aGridColor)
Set the grid color.
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
Contains methods for drawing PCB-specific items.
virtual PCB_RENDER_SETTINGS * GetSettings() override
Return a pointer to current settings that are going to be used when drawing items.
PCB specific render settings.
void LoadDisplayOptions(const PCB_DISPLAY_OPTIONS &aOptions)
Load settings related to display options (high-contrast mode, full or outline modes for vias/pads/tra...
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1) override
Add a VIEW_ITEM to the view.
virtual void Remove(VIEW_ITEM *aItem) override
Remove a VIEW_ITEM from the view.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
const std::set< int > & GetHighlightNetCodes() const
Return the netcode of currently highlighted net.
An abstract base class for deriving all objects that can be added to a VIEW.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
void SetLayerVisible(int aLayer, bool aVisible=true)
Control the visibility of a particular layer.
bool IsMirroredX() const
Return true if view is flipped across the X axis.
void UpdateAllItems(int aUpdateFlags)
Update all items in the view according to the given flags.
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
void MarkTargetDirty(int aTarget)
Set or clear target 'dirty' flag.
void UpdateAllItemsConditionally(int aUpdateFlags, std::function< bool(VIEW_ITEM *)> aCondition)
Update items in the view according to the given flags and condition.
An implementation of class VIEW_CONTROLS for wxWidgets library.
std::unique_ptr< PROF_COUNTER > m_MotionEventCounter
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
virtual bool OpenProjectFiles(const std::vector< wxString > &aFileList, int aCtl=0)
Open a project or set of files given by aFileList.
void OnSockRequestServer(wxSocketEvent &evt)
void OnSockRequest(wxSocketEvent &evt)
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
virtual void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged)
Call CommonSettingsChanged() on all KIWAY_PLAYERs.
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
virtual void ExpressMail(FRAME_T aDestination, MAIL_T aCommand, std::string &aPayload, wxWindow *aSource=nullptr)
Send aPayload to aDestination from aSource.
int SetLayerSelection(int layer)
const UTF8 & GetLibItemName() const
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
LSET is a set of PCB_LAYER_IDs.
static LSET AllLayersMask()
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Return an LSEQ from the union of this LSET and a desired sequence.
static const wxChar * Name(PCB_LAYER_ID aLayerId)
Return the fixed name association with aLayerId.
static const int UNCONNECTED
Constant that forces initialization of a netinfo item to the NETINFO_ITEM ORPHANED (typically -1) whe...
Store information read from a netlist along with the flags used to update the NETLIST in the BOARD.
const wxString & GetPinType() const
const wxString & GetPinFunction() const
bool IsOnCopperLayer() const override
void SetInitialPage(const wxString &aPage, const wxString &aParentPage=wxEmptyString)
Describe the page size and margins of a paper page on which to eventually print or plot.
DISPLAY_OPTIONS m_Display
EDA_ANGLE m_RotationAngle
ARC_EDIT_MODE m_ArcEditMode
Gather all the actions that are shared by tools.
static TOOL_ACTION toggleHV45Mode
static TOOL_ACTION drawRuleArea
static TOOL_ACTION microwaveCreateGap
static TOOL_ACTION placeText
static TOOL_ACTION pointEditorArcKeepCenter
static TOOL_ACTION drawOrthogonalDimension
static TOOL_ACTION drawRectangle
static TOOL_ACTION padDisplayMode
static TOOL_ACTION showRatsnest
static TOOL_ACTION showLayersManager
static TOOL_ACTION toggleNetHighlight
static TOOL_ACTION drawCircle
static TOOL_ACTION routeDiffPair
Activation of the Push and Shove router (differential pair mode)
static TOOL_ACTION placeImage
static TOOL_ACTION layerChanged
static TOOL_ACTION ddAppendBoard
Drag and drop.
static TOOL_ACTION highlightNet
static TOOL_ACTION routerTuneDiffPair
Activation of the Push and Shove router (diff pair tuning mode)
static TOOL_ACTION drawTextBox
static TOOL_ACTION routerHighlightMode
Actions to enable switching modes via hotkey assignments.
static TOOL_ACTION routerWalkaroundMode
static TOOL_ACTION routerShoveMode
static TOOL_ACTION drawZoneCutout
static TOOL_ACTION drawPolygon
static TOOL_ACTION hideNetInRatsnest
static TOOL_ACTION zoneDisplayFilled
static TOOL_ACTION showNetInRatsnest
static TOOL_ACTION drawRadialDimension
static TOOL_ACTION showProperties
static TOOL_ACTION routerTuneDiffPairSkew
Activation of the Push and Shove router (skew tuning mode)
static TOOL_ACTION zoneFill
static TOOL_ACTION viaDisplayMode
static TOOL_ACTION drawLeader
static TOOL_ACTION zoneUnfill
static TOOL_ACTION drillOrigin
static TOOL_ACTION routerTuneSingleTrace
Activation of the Push and Shove router (tune single line mode)
static TOOL_ACTION trackDisplayMode
static TOOL_ACTION microwaveCreateStubArc
static TOOL_ACTION zoneDisplayTriangulated
static TOOL_ACTION ungroup
static TOOL_ACTION selectUnconnected
Select unconnected footprints from ratsnest of selection.
static TOOL_ACTION zoneDisplayFractured
static TOOL_ACTION drawVia
static TOOL_ACTION drawArc
static TOOL_ACTION zoneDuplicate
Duplicate zone onto another layer.
static TOOL_ACTION graphicsOutlines
Display footprint graphics as outlines.
static TOOL_ACTION pluginsReload
Scripting Actions.
static TOOL_ACTION drawSimilarZone
static TOOL_ACTION pointEditorArcKeepEndpoint
static TOOL_ACTION boardSetup
static TOOL_ACTION drawCenterDimension
static TOOL_ACTION selectSameSheet
Select all components on the same sheet as the selected footprint.
static TOOL_ACTION microwaveCreateStub
static TOOL_ACTION selectNet
Select all connections belonging to a single net.
static TOOL_ACTION microwaveCreateLine
static TOOL_ACTION flipBoard
static TOOL_ACTION zoneDisplayOutline
static TOOL_ACTION ratsnestLineMode
static TOOL_ACTION textOutlines
Display texts as lines.
static TOOL_ACTION highlightNetSelection
static TOOL_ACTION microwaveCreateFunctionShape
static TOOL_ACTION zoneMerge
static TOOL_ACTION unlock
static TOOL_ACTION placeFootprint
static TOOL_ACTION routeSingleTrack
Activation of the Push and Shove router.
static TOOL_ACTION deselectNet
Remove all connections belonging to a single net from the active selection.
static TOOL_ACTION showPythonConsole
static TOOL_ACTION drawLine
static TOOL_ACTION localRatsnestTool
static TOOL_ACTION drawAlignedDimension
static TOOL_ACTION drawZone
static TOOL_ACTION selectOnSchematic
Select symbols/pins on schematic corresponding to selected footprints/pads.
Common, abstract interface for edit frames.
COLOR_SETTINGS * GetColorSettings(bool aForceRefresh=false) const override
Helper to retrieve the current color settings.
wxString GetDesignRulesPath()
Return the absolute path to the design rules file for the currently-loaded board.
void doCloseWindow() override
void unitsChangeRefresh() override
Called when when the units setting has changed to allow for any derived classes to handle refreshing ...
virtual void SetBoard(BOARD *aBoard, PROGRESS_REPORTER *aReporter=nullptr) override
Set the #m_Pcb member in such as way as to ensure deleting any previous BOARD.
APPEARANCE_CONTROLS * GetAppearancePanel()
APPEARANCE_CONTROLS * m_appearancePanel
PANEL_SELECTION_FILTER * m_selectionFilterPanel
PROPERTIES_PANEL * m_propertiesPanel
void ActivateGalCanvas() override
Set the #m_Pcb member in such as way as to ensure deleting any previous BOARD.
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
virtual const PCB_PLOT_PARAMS & GetPlotSettings() const
Return the PCB_PLOT_PARAMS for the BOARD owned by this frame.
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Display options control the way tracks, vias, outlines and other things are shown (for instance solid...
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
PCBNEW_SETTINGS * GetPcbNewSettings() const
virtual PCB_LAYER_ID GetActiveLayer() const
void OnModify() override
Must be called after a change in order to set the "modify" flag and update other data structures and ...
bool canCloseWindow(wxCloseEvent &aCloseEvent) override
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
virtual void SetPageSettings(const PAGE_INFO &aPageSettings) override
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
PCB_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Returns the BOARD_DESIGN_SETTINGS for the open project.
virtual void ShowChangedLanguage() override
Redraw the menus and what not in current language.
virtual void SetPlotSettings(const PCB_PLOT_PARAMS &aSettings)
void PlaceFootprint(FOOTPRINT *aFootprint, bool aRecreateRatsnest=true)
Places aFootprint at the current cursor position and updates footprint coordinates with the new posit...
virtual void SetActiveLayer(PCB_LAYER_ID aLayer)
void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged) override
Notification event that some of the common (suite-wide) settings have changed.
virtual void Update3DView(bool aMarkDirty, bool aRefresh, const wxString *aTitle=nullptr)
Update the 3D view, if the viewer is opened by this frame.
Handle actions that are shared between different frames in PcbNew.
double m_ZoneOpacity
Opacity override for filled zone areas.
HIGH_CONTRAST_MODE m_ContrastModeDisplay
How inactive layers are displayed.
void UpdateColors()
Update the color settings in the painter and GAL.
void SetDrawingSheet(DS_PROXY_VIEW_ITEM *aDrawingSheet)
Sets (or updates) drawing-sheet used by the draw panel.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void SyncLayersVisibility(const BOARD *aBoard)
Update "visibility" property of each layer of a given BOARD.
virtual void SetHighContrastLayer(int aLayer) override
SetHighContrastLayer(), with some extra smarts for PCB.
Group generic conditions for PCB editor states.
SELECTION_CONDITION PadFillDisplay()
Create a functor that tests if the frame fills the pads.
SELECTION_CONDITION TrackFillDisplay()
Create a functor that tests if the frame fills tracks.
SELECTION_CONDITION HasItems()
Create a functor that tests if there are items in the board.
SELECTION_CONDITION GraphicsFillDisplay()
Create a functor that tests if the frame fills graphics items.
SELECTION_CONDITION ZoneDisplayMode(ZONE_DISPLAY_MODE aMode)
Create a functor that tests the current zone display mode in the frame.
SELECTION_CONDITION ViaFillDisplay()
Create a functor that tests if the frame fills vias.
SELECTION_CONDITION Get45degMode()
Create a functor that tests whether only 45 degree lines should be allowed.
SELECTION_CONDITION TextFillDisplay()
Create a functor that tests if the frame fills text items.
The main frame for Pcbnew.
void HardRedraw() override
Rebuild the GAL and redraws the screen.
void OnDisplayOptionsChanged() override
int TestStandalone(void)
Test if standalone mode.
void ShowBoardSetupDialog(const wxString &aInitialPage=wxEmptyString)
void SetLastPath(LAST_PATH_TYPE aType, const wxString &aLastPath)
Set the path of the last file successfully read.
void SetBoard(BOARD *aBoard, PROGRESS_REPORTER *aReporter=nullptr) override
Set the #m_Pcb member in such as way as to ensure deleting any previous BOARD.
void SetActiveLayer(PCB_LAYER_ID aLayer) override
Change the currently active layer to aLayer and also update the APPEARANCE_CONTROLS.
void OnModify() override
Must be called after a board change to set the modified flag.
void ThemeChanged() override
Called when light/dark theme is changed.
void setupUIConditions() override
Setup the UI conditions for the various actions and their controls in this frame.
void SaveProjectSettings() override
Save changes to the project settings to the project (.pro) file.
void RecordDRCExclusions()
Scan existing markers and record data from any that are Excluded.
void SetElementVisibility(GAL_LAYER_ID aElement, bool aNewState)
Change the visibility of an element category.
void OnClearFileHistory(wxCommandEvent &aEvent)
virtual ~PCB_EDIT_FRAME()
void SwitchCanvas(EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType) override
Switch currently used canvas (Cairo / OpenGL).
void FindNext()
Find the next item using our existing search parameters.
BOARD_ITEM_CONTAINER * GetModel() const override
void OnExportSTEP(wxCommandEvent &event)
Export the current BOARD to a STEP assembly.
DIALOG_FIND * m_findDialog
void SetPageSettings(const PAGE_INFO &aPageSettings) override
bool IsElementVisible(GAL_LAYER_ID aElement) const
Test whether a given element category is visible.
void UpdateUserInterface()
Update the layer manager and other widgets from the board setup (layer and items visibility,...
void onBoardLoaded()
Update the state of the GUI after a new board is loaded or created.
void SetGridColor(const COLOR4D &aColor) override
void ProjectChanged() override
Notification event that the project has changed.
bool Clear_Pcb(bool aQuery, bool aFinal=false)
Delete all and reinitialize the current board.
wxString GetLastPath(LAST_PATH_TYPE aType)
Get the last path for a particular type.
void OnExportIDF3(wxCommandEvent &event)
Export the current BOARD to a IDFv3 board and lib files.
void ShowChangedLanguage() override
Redraw the menus and what not in current language.
void doCloseWindow() override
void ReCreateLayerBox(bool aForceResizeToolbar=true)
Recreate the layer box by clearing the old list and building a new one from the new layer names and c...
void PythonSyncProjectName()
Synchronize the project name from KiCad's environment into the Python interpreter.
bool m_show_layer_manager_tools
void OnExportVRML(wxCommandEvent &event)
Export the current BOARD to a VRML file.
void ShowFindDialog()
Show the Find dialog.
void onSize(wxSizeEvent &aEvent)
int ShowExchangeFootprintsDialog(FOOTPRINT *aFootprint, bool aUpdateMode, bool aSelectedMode)
void ShowFootprintPropertiesDialog(FOOTPRINT *aFootprint)
void OnExportHyperlynx(wxCommandEvent &event)
Export the current BOARD to a Hyperlynx HYP file.
bool IsContentModified() const override
Get if the current board has been modified but not saved.
void PythonSyncEnvironmentVariables()
Synchronize the environment variables from KiCad's environment into the Python interpreter.
void OnRunTeardropTool(wxCommandEvent &event)
run teardrop tool
TOOL_ACTION * m_exportNetlistAction
The export board netlist tool action object.
void ReCreateAuxiliaryToolbar() override
bool FetchNetlistFromSchematic(NETLIST &aNetlist, const wxString &aAnnotateMessage)
wxString GetCurrentFileName() const override
Get the full filename + path of the currently opened file in the frame.
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
void ExportSVG(wxCommandEvent &event)
Show the Export to SVG file dialog.
void RecreateCmpFileFromBoard(wxCommandEvent &aEvent)
Recreates a .cmp file from the current loaded board.
void OnRemoveTeardropTool(wxCommandEvent &event)
Remove all teardrops.
EDA_ANGLE GetRotationAngle() const override
Return the angle used for rotate operations.
COLOR4D GetGridColor() override
void Files_io(wxCommandEvent &event)
Call Files_io_from_id with the wxCommandEvent id.
void UpdateTitle()
Set the main window title bar text.
void ExchangeFootprint(FOOTPRINT *aExisting, FOOTPRINT *aNew, BOARD_COMMIT &aCommit, bool deleteExtraTexts=true, bool resetTextLayers=true, bool resetTextEffects=true, bool resetFabricationAttrs=true, bool reset3DModels=true, bool *aUpdated=nullptr)
Replace aExisting footprint by aNew footprint using the Existing footprint settings (position,...
PCB_LAYER_BOX_SELECTOR * m_SelLayerBox
void ExportToGenCAD(wxCommandEvent &event)
Create a file in GenCAD 1.4 format from the current board.
void ActivateGalCanvas() override
Set the #m_Pcb member in such as way as to ensure deleting any previous BOARD.
void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged) override
Called after the preferences dialog is run.
void Process_Special_Functions(wxCommandEvent &event)
SELECTION & GetCurrentSelection() override
Get the current selection from the canvas area.
void OnQuit(wxCommandEvent &event)
bool canCloseWindow(wxCloseEvent &aCloseEvent) override
void ResolveDRCExclusions()
Update markers to match recorded exclusions.
wxTimer * m_eventCounterTimer
void Tracks_and_Vias_Size_Event(wxCommandEvent &event)
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
void redrawNetnames(wxTimerEvent &aEvent)
static const wxString SearchPaneName()
void OnFileHistory(wxCommandEvent &event)
void ToPlotter(int aID)
Open a dialog frame to create plot and drill files relative to the current board.
A set of BOARD_ITEMs (i.e., without duplicates).
bool RemoveItem(BOARD_ITEM *aItem)
Remove item from group.
bool AddItem(BOARD_ITEM *aItem)
Add item to group.
Parameters and options when plotting/printing a board.
void SetFormat(PLOT_FORMAT aFormat)
Tool that displays edit points allowing to modify items by dragging the points.
static bool HasUnlockedItems(const SELECTION &aSelection)
Test if any selected items are unlocked.
static bool HasLockedItems(const SELECTION &aSelection)
Test if any selected items are locked.
A progress reporter interface for use in multi-threaded environments.
The backing store for a PROJECT, in JSON format.
The project local settings are things that are attached to a particular project, but also might be pa...
wxString m_ActiveLayerPreset
The name of a LAYER_PRESET that is currently activated (or blank if none)
PCB_LAYER_ID m_ActiveLayer
The current (active) board layer for editing.
virtual PROJECT_LOCAL_SETTINGS & GetLocalSettings() const
virtual PROJECT_FILE & GetProjectFile() const
float SplitterProportion() const
static SELECTION_CONDITION HasTypes(std::vector< KICAD_T > aTypes)
Create a functor that tests if among the selected items there is at least one of a given types.
static SELECTION_CONDITION HasType(KICAD_T aType)
Create a functor that tests if among the selected items there is at least one of a given type.
static SELECTION_CONDITION MoreThan(int aNumber)
Create a functor that tests if the number of selected items is greater than the value given as parame...
static bool Idle(const SELECTION &aSelection)
Test if there no items selected or being edited.
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 bool ShowAlways(const SELECTION &aSelection)
The default condition function (always returns true).
static SELECTION_CONDITION OnlyTypes(std::vector< KICAD_T > aTypes)
Create a functor that tests if the selected items are only of given types.
int Size() const
Returns the number of selected parts.
Is a LINE_READER that reads from a multiline 8 bit wide std::string.
A modified version of the wxInfoBar class that allows us to:
void RemoveAllButtons()
Remove all the buttons that have been added by the user.
@ OUTDATED_SAVE
OUTDATED_SAVE Messages that should be cleared on save.
void AddCloseButton(const wxString &aTooltip=_("Hide this message."))
Add the default close button to the infobar on the right side.
void ShowMessage(const wxString &aMessage, int aFlags=wxICON_INFORMATION) override
Show the info bar with the provided message and icon.
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
bool HandleUnsavedChanges(wxWindow *aParent, const wxString &aMessage, const std::function< bool()> &aSaveFunction)
Display a dialog with Save, Cancel and Discard Changes buttons.
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
This file is part of the common library.
#define DIALOG_DRC_WINDOW_NAME
bool InvokeExportSVG(PCB_EDIT_FRAME *aCaller, BOARD *aBoard)
Function InvokeExportSVG shows the Export SVG dialog.
static constexpr EDA_ANGLE & ANGLE_90
#define KICAD_DEFAULT_DRAWFRAME_STYLE
#define PCB_EDIT_FRAME_NAME
GERBVIEW_FRAME::OnZipFileHistory GERBVIEW_FRAME::OnSelectDisplayMode EVT_CHOICE(ID_GBR_AUX_TOOLBAR_PCB_APERATTRIBUTES_CHOICE, GERBVIEW_FRAME::OnSelectHighlightChoice) EVT_UPDATE_UI(ID_TOOLBARH_GERBVIEW_SELECT_ACTIVE_LAYER
const wxString EESCHEMA_EXE
@ FRAME_FOOTPRINT_VIEWER_MODAL
int ExecuteFile(const wxString &aEditorName, const wxString &aFileName, wxProcess *aCallback)
Call the executable file aEditorName with the parameter aFileName.
const std::string LegacyPcbFileExtension
const std::string LegacySchematicFileExtension
const std::string KiCadPcbFileExtension
const std::string KiCadSchematicFileExtension
const wxChar *const traceAutoSave
Flag to enable auto save feature debug tracing.
@ ID_EDA_SOCKET_EVENT_SERV
std::map< wxString, ENV_VAR_ITEM > ENV_VAR_MAP
int GetNetnameLayer(int aLayer)
Returns a netname layer corresponding to the given layer.
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
@ LAYER_ZONES
Control for copper zone opacity/visibility (color ignored)
PCB_LAYER_ID
A quick note on layer IDs:
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
@ REPAINT
Item needs to be redrawn.
@ GEOMETRY
Position or shape has changed.
@ ALL
All except INITIAL_ADD.
@ TARGET_NONCACHED
Auxiliary rendering target (noncached)
@ RM_MarkObstacles
Ignore collisions, mark obstacles.
@ RM_Walkaround
Only walk around.
@ SMD
Smd pad, appears on the solder paste layer (default)
#define CURRENT_TOOL(action)
EVT_MENU_RANGE(ID_POPUP_PCB_SELECT_WIDTH_START_RANGE, ID_POPUP_PCB_SELECT_WIDTH_END_RANGE, PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event) EVT_UPDATE_UI_RANGE(ID_POPUP_PCB_SELECT_WIDTH1
ID_POPUP_PCB_SELECT_WIDTH8
bool ExportBoardToHyperlynx(BOARD *aBoard, const wxFileName &aPath)
#define CURRENT_EDIT_TOOL(action)
PCB_EDIT_FRAME::OnUpdateSelectTrackWidth EVT_UPDATE_UI_RANGE(ID_POPUP_PCB_SELECT_VIASIZE1, ID_POPUP_PCB_SELECT_VIASIZE8, PCB_EDIT_FRAME::OnUpdateSelectViaSize) PCB_EDIT_FRAME
@ ID_POPUP_PCB_SELECT_WIDTH_START_RANGE
@ ID_POPUP_PCB_SELECT_WIDTH1
@ ID_POPUP_PCB_SELECT_VIASIZE8
@ ID_GEN_EXPORT_FILE_HYPERLYNX
@ ID_IMPORT_NON_KICAD_BOARD
@ ID_MENU_RECOVER_BOARD_AUTOSAVE
@ ID_AUX_TOOLBAR_PCB_VIA_SIZE
@ ID_AUX_TOOLBAR_PCB_SELECT_AUTO_WIDTH
@ ID_MENU_EXPORT_FOOTPRINTS_TO_NEW_LIBRARY
@ ID_POPUP_PCB_SELECT_WIDTH_END_RANGE
@ ID_MENU_EXPORT_FOOTPRINTS_TO_LIBRARY
@ ID_GEN_EXPORT_FILE_VRML
@ ID_POPUP_PCB_SELECT_VIASIZE1
@ ID_REMOVE_TEARDROP_TOOL
@ ID_GEN_EXPORT_FILE_STEP
@ ID_TOOLBARH_PCB_SELECT_LAYER
@ ID_GEN_EXPORT_FILE_IDF3
@ ID_AUX_TOOLBAR_PCB_TRACK_WIDTH
@ ID_GEN_EXPORT_FILE_GENCADFORMAT
void Refresh()
Update the board display after modifying it by a python script (note: it is automatically called by a...
#define PROJECT_VAR_NAME
A variable name whose value holds the current project directory.
LAST_PATH_TYPE
For storing PcbNew MRU paths of various types.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
std::function< bool(const SELECTION &)> SELECTION_CONDITION
< Functor type that checks a specific condition for selected items.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
A filename or source description, a problem input line, a line number, a byte offset,...
int properties_panel_width
float properties_splitter_proportion
TRACK_CLEARANCE_MODE m_TrackClearance
bool m_DisplayRatsnestLinesCurved
bool m_ShowGlobalRatsnest
wxLogTrace helper definitions.
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
@ PCB_ZONE_T
class ZONE, a copper pour area
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
@ PCB_FP_ZONE_T
class ZONE, managed by a footprint
@ PCB_PAD_T
class PAD, a pad in a footprint
@ PCB_FP_TEXT_T
class FP_TEXT, text in a footprint
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
Definition of file extensions used in Kicad.
void SetAuiPaneSize(wxAuiManager &aManager, wxAuiPaneInfo &aPane, int aWidth, int aHeight)
Sets the size of an AUI pane, working around http://trac.wxwidgets.org/ticket/13180.
WX_VIEW_CONTROLS class definition.