80#include <wx/filedlg.h>
81#include <wx/hyperlink.h>
102 wxDefaultPosition, wxDefaultSize,
104 m_show_layer_manager_tools( true )
106 m_showBorderAndTitleBlock =
false;
107 m_aboutTitle =
_HKI(
"KiCad Footprint Editor" );
108 m_editorSettings =
nullptr;
112 wxIconBundle icon_bundle;
115 icon_bundle.AddIcon( icon );
117 icon_bundle.AddIcon( icon );
119 icon_bundle.AddIcon( icon );
121 icon_bundle.AddIcon( icon );
123 icon_bundle.AddIcon( icon );
125 SetIcons( icon_bundle );
128 m_canvasType = loadCanvasTypeSetting();
131 GetGalDisplayOptions(), m_canvasType );
132 SetCanvas( drawPanel );
136 SetBoard(
new BOARD() );
155 GetGalDisplayOptions().m_axesEnabled =
true;
168 m_toolbarSettings = GetToolbarSettings<FOOTPRINT_EDIT_TOOLBAR_SETTINGS>(
"fpedit-toolbars" );
171 ReCreateLayerBox(
false );
182 LoadSettings( GetSettings() );
184 updateEnabledLayers();
186 float proportion = GetFootprintEditorSettings()->m_AuiPanels.properties_splitter;
187 m_propertiesPanel->SetSplitterProportion( proportion );
198 libWidth = cfg->m_LibWidth;
199 aui_cfg = cfg->m_AuiPanels;
208 m_auimgr.SetManagedWindow(
this );
210 unsigned int auiFlags = wxAUI_MGR_DEFAULT;
211#if !defined( _WIN32 )
214 auiFlags |= wxAUI_MGR_LIVE_RESIZE;
216 m_auimgr.SetFlags( auiFlags );
219 m_auimgr.AddPane( m_tbTopMain,
EDA_PANE().HToolbar().Name(
"TopMainToolbar" )
222 m_auimgr.AddPane( m_messagePanel,
EDA_PANE().Messages().Name(
"MsgPanel" )
223 .Bottom().Layer( 6 ) );
226 m_auimgr.AddPane( m_treePane,
EDA_PANE().Palette().Name(
"Footprints" )
228 .Caption(
_(
"Libraries" ) )
229 .MinSize( FromDIP( 250 ), -1 ).BestSize( FromDIP( 250 ), -1 ) );
230 m_auimgr.AddPane( m_propertiesPanel,
EDA_PANE().Name( PropertiesPaneName() )
232 .Caption(
_(
"Properties" ) ).PaneBorder(
false )
233 .MinSize( FromDIP( wxSize( 240, 60 ) ) ).BestSize( FromDIP( wxSize( 300, 200 ) ) ) );
234 m_auimgr.AddPane( m_tbLeft,
EDA_PANE().VToolbar().Name(
"LeftToolbar" )
235 .Left().Layer( 2 ) );
237 m_auimgr.AddPane( m_tbRight,
EDA_PANE().VToolbar().Name(
"RightToolbar" )
239 m_auimgr.AddPane( m_appearancePanel,
EDA_PANE().Name(
"LayersManager" )
241 .Caption(
_(
"Appearance" ) ).PaneBorder(
false )
242 .MinSize( FromDIP( 180 ), -1 ).BestSize( FromDIP( 180 ), -1 ) );
243 m_auimgr.AddPane( m_selectionFilterPanel,
EDA_PANE().Palette().Name(
"SelectionFilter" )
244 .Right().Layer( 3 ).Position( 2 )
245 .Caption(
_(
"Selection Filter" ) ).PaneBorder(
false )
246 .MinSize( FromDIP( 180 ), -1 ).BestSize( FromDIP( 180 ), -1 ) );
249 m_auimgr.AddPane( GetCanvas(),
EDA_PANE().Canvas().Name(
"DrawFrame" )
252 m_auimgr.GetPane(
"LayersManager" ).Show( m_show_layer_manager_tools );
253 m_auimgr.GetPane(
"SelectionFilter" ).Show( m_show_layer_manager_tools );
254 m_auimgr.GetPane( PropertiesPaneName() ).Show( GetSettings()->m_AuiPanels.show_properties );
257 m_auimgr.GetPane(
"SelectionFilter" ).dock_proportion = 0;
261 DragAcceptFiles(
true );
263 FinishAUIInitialization();
266 wxAuiPaneInfo& treePane = m_auimgr.GetPane(
"Footprints" );
267 wxAuiPaneInfo& layersManager = m_auimgr.GetPane(
"LayersManager" );
279 m_appearancePanel->SetUserLayerPresets( cfg->m_LayerPresets );
280 m_appearancePanel->ApplyLayerPreset( cfg->m_ActiveLayerPreset );
286 restoreLastFootprint();
293 setupUnits( GetSettings() );
315 UpdateToolbarControlSizes();
316 m_treePane->FocusSearchFieldIfExists();
348 std::vector<MSG_PANEL_ITEM> msgItems;
416 wxAuiPaneInfo& layersManager =
m_auimgr.GetPane(
"LayersManager" );
417 wxAuiPaneInfo& selectionFilter =
m_auimgr.GetPane(
"SelectionFilter" );
455 if(
id.GetLibNickname().
empty() )
475 if(
GetBoard()->GetFirstFootprint() )
514 if( libNickname.Length() && footprintName.Length() )
518 id.SetLibItemName( footprintName );
547 enabledLayers.
set( layer );
549 RECURSE_MODE::RECURSE );
557 if( cfg->m_DesignSettings.m_UserLayerNames.contains(
LSET::Name( user ).ToStdString() ) )
558 enabledLayers.
set( user );
591 const wxString msg = wxString::Format(
_(
"Editing %s from board. Saving will update the board only." ),
593 const wxString openLibLink = wxString::Format(
_(
"Open in library %s" ),
596 const auto openLibraryCopy =
597 [
this]( wxHyperlinkEvent& aEvent )
604 wxHyperlinkCtrl* button =
new wxHyperlinkCtrl( infobar, wxID_ANY, openLibLink,
606 button->Bind( wxEVT_COMMAND_HYPERLINK, openLibraryCopy );
608 infobar->RemoveAllButtons();
609 infobar->AddButton( button );
610 infobar->AddCloseButton();
611 infobar->ShowMessage( msg, wxICON_INFORMATION );
616 else if( !libName.empty()
619 wxString msg = wxString::Format(
_(
"Editing footprint from read-only library %s." ),
624 wxString link =
_(
"Save as editable copy" );
626 const auto saveAsEditableCopy =
627 [
this, aFootprint]( wxHyperlinkEvent& aEvent )
632 wxHyperlinkCtrl* button =
new wxHyperlinkCtrl( infobar, wxID_ANY, link, wxEmptyString );
633 button->Bind( wxEVT_COMMAND_HYPERLINK, saveAsEditableCopy );
635 infobar->RemoveAllButtons();
636 infobar->AddButton( button );
637 infobar->AddCloseButton();
638 infobar->ShowMessage( msg, wxICON_INFORMATION );
677 wxFAIL_MSG( wxT(
"Plotting not supported in Footprint Editor" ) );
685 wxFAIL_MSG( wxT(
"Plotting not supported in Footprint Editor" ) );
729 wxString wx_source_name = source_name;
814 return &cfg->m_MagneticItems;
826 bool hasGraphicalItem = footprint->
Pads().size() || footprint->
Zones().size();
828 if( !hasGraphicalItem )
835 hasGraphicalItem =
true;
840 if( hasGraphicalItem )
846 BOX2I newFootprintBB( { 0, 0 }, { 0, 0 } );
848 return newFootprintBB;
861 wxString msg =
_(
"Save changes to '%s' before closing?" );
890 aEvent.GetId() == wxEVT_QUERY_END_SESSION )
901 wxString msg =
_(
"Save changes to '%s' before closing?" );
938 m_auimgr.GetPane( wxT(
"LayersManager" ) ).Show(
false );
939 m_auimgr.GetPane( wxT(
"SelectionFilter" ) ).Show(
false );
945 if( mgr->
IsProjectOpen() && wxFileName::IsDirWritable(
Prj().GetProjectPath() ) )
973 bool tree_shown = tree_pane_info.IsShown();
974 tree_pane_info.Caption(
_(
"Libraries" ) );
977 bool lm_shown = lm_pane_info.IsShown();
978 lm_pane_info.Caption(
_(
"Appearance" ) );
980 sf_pane_info.Caption(
_(
"Selection Filter" ) );
986 lm_pane_info.Show( lm_shown );
987 tree_pane_info.Show( tree_shown );
1006 if( !GetTitle().StartsWith( wxT(
"*" ) ) )
1016 bool writable =
true;
1024 title += wxS(
" " ) + wxString::Format(
_(
"[from %s]" ),
Prj().GetProjectName()
1026 + FILEEXT::PcbFileExtension );
1046 title += wxS(
" " ) +
_(
"[Read Only]" );
1055 title += wxS(
" " ) +
_(
"[Unsaved]" );
1059 title =
_(
"[no footprint loaded]" );
1062 title += wxT(
" \u2014 " ) +
_(
"Footprint Editor" );
1093 progressReporter.Show(
false );
1117 progressReporter.Show(
false );
1129 adapter->Sync( fpTable );
1135 if( adapter->FindItem( target ) )
1137 if( targetSelected )
1207 pcbTool->SetIsFootprintEditor(
true );
1237#define ENABLE( x ) ACTION_CONDITIONS().Enable( x )
1238#define CHECK( x ) ACTION_CONDITIONS().Check( x )
1240 auto haveFootprintCond =
1246 auto footprintTargettedCond =
1252 const auto footprintFromBoardCond =
1258 auto pcbFrameExistsCond =
1263 return ( frame !=
nullptr );
1266 auto boardFootprintExistsCond =
1272 bool canInsert = frame && editorFootprint && editorFootprint->
GetLink() ==
niluuid;
1275 if( frame && editorFootprint && editorFootprint->
GetLink() !=
niluuid )
1283 if( editorFootprint->
GetLink() == candidate->m_Uuid )
1337 auto constrainedDrawingModeCond =
1343 auto highContrastCond =
1349 auto boardFlippedCond =
1355 auto libraryTreeCond =
1361 auto layerManagerCond =
1364 return m_auimgr.GetPane(
"LayersManager" ).IsShown();
1367 auto propertiesCond =
1393 const auto isArcKeepCenterMode =
1399 const auto isArcKeepEndpointMode =
1405 const auto isArcKeepRadiusMode =
1418#define CURRENT_EDIT_TOOL( action ) \
1419 mgr->SetConditions( action, ACTION_CONDITIONS().Enable( haveFootprintCond ) \
1420 .Check( cond.CurrentTool( action ) ) )
1445#undef CURRENT_EDIT_TOOL
1507 wxFileName fn(
id.GetLibItemName() );
1508 fn.SetExt( wxT(
"png" ) );
1510 wxString projectPath = wxPathOnly(
Prj().GetProjectFullName() );
1512 wxFileDialog dlg(
this,
_(
"Export View as PNG" ), projectPath, fn.GetFullName(),
1515 if( dlg.ShowModal() == wxID_CANCEL || dlg.GetPath().IsEmpty() )
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...
static TOOL_ACTION toggleGrid
static TOOL_ACTION millimetersUnits
static TOOL_ACTION unselectAll
static TOOL_ACTION revert
static TOOL_ACTION showLibraryTree
static TOOL_ACTION saveAs
static TOOL_ACTION pluginsReload
static TOOL_ACTION pasteSpecial
static TOOL_ACTION showDatasheet
static TOOL_ACTION pointEditorArcKeepCenter
static TOOL_ACTION milsUnits
static TOOL_ACTION ungroup
static TOOL_ACTION toggleBoundingBoxes
static TOOL_ACTION pointEditorArcKeepRadius
static TOOL_ACTION duplicate
static TOOL_ACTION inchesUnits
static TOOL_ACTION highContrastMode
static TOOL_ACTION embeddedFiles
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 showProperties
static TOOL_ACTION gridSetOrigin
static TOOL_ACTION ddAddLibrary
static TOOL_ACTION toggleGridOverrides
static TOOL_ACTION selectAll
static TOOL_ACTION pointEditorArcKeepEndpoint
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...
std::vector< LAYER_PRESET > GetUserLayerPresets() const
Update the current layer presets from those saved in the project file.
int GetTabIndex() const
Set the current notebook tab.
void UpdateDisplayOptions()
Return a list of the layer presets created by the user.
wxString GetActiveLayerPreset() const
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
wxString m_ColorTheme
Active color theme name.
bool IsContentModified() const
void SetContentModified(bool aModified=true)
BASE_SET & set(size_t pos)
Container for design settings for a BOARD object.
std::shared_ptr< NET_SETTINGS > m_NetSettings
std::map< std::string, wxString > m_UserLayerNames
int m_SolderMaskExpansion
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 LSET GetLayerSet() const
Return a std::bitset of all layers on which the item physically resides.
Information pertinent to a Pcbnew printed circuit board.
void SetBoardUse(BOARD_USE aUse)
Set what the board is going to be used for.
bool SetLayerName(PCB_LAYER_ID aLayer, const wxString &aLayerName)
Changes the name of the layer given by aLayer.
FOOTPRINT * GetFirstFootprint() const
Get the first footprint on the board or nullptr.
void SetVisibleAlls()
Change the bit-mask of visible element categories and layers.
const FOOTPRINTS & Footprints() const
void SetCopperLayerCount(int aCount)
void DeleteAllFootprints()
Remove all footprints from the deque and free the memory associated with them.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
const LSET & GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
void SetEnabledLayers(const LSET &aLayerMask)
A proxy function that calls the correspondent function in m_BoardSettings.
constexpr BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
Color settings are a bit different than most of the settings objects in that there can be more than o...
Handle actions that are shared between different applications.
void CommonSettingsChanged(int aFlags) override
Notification event that some of the common (suite-wide) settings have changed.
void ShowChangedLanguage() override
Redraw the menus and what not in current language.
virtual void setupUIConditions()
Setup the UI conditions for the various actions and their controls in this frame.
virtual void OnSize(wxSizeEvent &aEvent)
virtual bool canCloseWindow(wxCloseEvent &aCloseEvent)
virtual void OnDropFiles(wxDropFilesEvent &aEvent)
Handle event fired when a file is dropped to the window.
bool m_isClosing
Set by the close window event handler after frames are asked if they can close.
WX_INFOBAR * GetInfoBar()
EDA_DRAW_PANEL_GAL::GAL_TYPE m_canvasType
The current canvas type.
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.
bool SaveCanvasImageToFile(const wxString &aFileName, BITMAP_TYPE aBitmapType)
Save the current view as an image file.
virtual void SwitchCanvas(EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType)
Change the current rendering backend.
virtual void OnSelectZoom(wxCommandEvent &event)
Set the zoom factor when selected by the zoom list box in the main tool bar.
GAL_DISPLAY_OPTIONS_IMPL & GetGalDisplayOptions()
Return a reference to the gal rendering options used by GAL for rendering.
static bool m_openGLFailureOccured
Has any failure occurred when switching to OpenGL in any EDA_DRAW_FRAME?
static const wxString PropertiesPaneName()
virtual void UpdateMsgPanel()
Redraw the message panel.
EDA_DRAW_PANEL_GAL::GAL_TYPE loadCanvasTypeSetting()
Return the canvas type stored in the application settings.
PROPERTIES_PANEL * m_propertiesPanel
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.
@ GAL_TYPE_OPENGL
OpenGL implementation.
KIGFX::GAL * GetGAL() const
Return a pointer to the GAL instance used in the panel.
void SetEventDispatcher(TOOL_DISPATCHER *aEventDispatcher)
Set a dispatcher that processes events and forwards them to tools.
Specialization of the wxAuiPaneInfo class for KiCad panels.
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 CurrentTool(const TOOL_ACTION &aTool)
Create a functor testing if the specified tool is the current active tool in the frame.
virtual SELECTION_CONDITION UndoAvailable()
Create a functor that tests if there are any items in the undo queue.
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 ContentModified()
Create a functor that tests if the content of the frame is modified.
SELECTION_CONDITION GridOverrides()
Create a functor testing if the grid overrides wires is enabled in a frame.
SELECTION_CONDITION FullscreenCursor()
Create a functor testing if the cursor is full screen in a frame.
bool IsFootprintLibWritable(const wxString &aNickname)
Return true if the library given by aNickname is writable.
void AddLibraries(EDA_BASE_FRAME *aParent)
static wxObjectDataPtr< LIB_TREE_MODEL_ADAPTER > Create(FOOTPRINT_EDIT_FRAME *aFrame, FP_LIB_TABLE *aLibs)
void ReadWindowSettings(WINDOW_SETTINGS &aCfg)
Read GAL config options from application-level config.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
bool m_axesEnabled
Fullscreen crosshair or small cross.
void SetAxesEnabled(bool aAxesEnabled)
Enable drawing the axes.
void UpdateAllLayersColor()
Apply the new coloring scheme to all layers.
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 MarkTargetDirty(int aTarget)
Set or clear target 'dirty' flag.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
Module editor specific tools.
A logical library item identifier and consists of various portions much like a URI.
int SetLibItemName(const UTF8 &aLibItemName)
Override the library item name portion of the LIB_ID to aLibItemName.
bool IsValid() const
Check if this LID_ID is valid.
int SetLibNickname(const UTF8 &aLibNickname)
Override the logical library name portion of the LIB_ID to aLibNickname.
const wxString GetUniStringLibItemName() const
Get strings for display messages in dialogs.
const UTF8 & GetLibItemName() const
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
void RefreshLibTree()
Refresh the tree (mainly to update highlighting and asterisking)
void CenterLibId(const LIB_ID &aLibId)
Ensure that an item is visible (preferably centered).
void ShowChangedLanguage()
void SelectLibId(const LIB_ID &aLibId)
Select an item in the tree widget.
LIB_TREE_MODEL_ADAPTER::SORT_MODE GetSortMode() const
void Unselect()
Unselect currently selected item in wxDataViewCtrl.
LIB_ID GetSelectedLibId(int *aUnit=nullptr) const
For multi-unit symbols, if the user selects the symbol itself rather than picking an individual unit,...
void Regenerate(bool aKeepState)
Regenerate the tree.
void SetSortMode(LIB_TREE_MODEL_ADAPTER::SORT_MODE aMode)
Save/restore the sorting mode.
LSET is a set of PCB_LAYER_IDs.
static int NameToLayer(wxString &aName)
Return the layer number from a layer name.
static LSET UserDefinedLayersMask(int aUserDefinedLayerCount=MAX_USER_DEFINED_LAYERS)
Return a mask with the requested number of user defined layers.
static wxString Name(PCB_LAYER_ID aLayerId)
Return the fixed name association with aLayerId.
Describe the page size and margins of a paper page on which to eventually print or plot.
void SetCheckboxesFromFilter(PCB_SELECTION_FILTER_OPTIONS &aOptions)
Gather all the actions that are shared by tools.
static TOOL_ACTION toggleHV45Mode
static TOOL_ACTION drawRuleArea
static TOOL_ACTION drawBezier
static TOOL_ACTION placeText
static TOOL_ACTION drawOrthogonalDimension
static TOOL_ACTION drawRectangle
static TOOL_ACTION setAnchor
static TOOL_ACTION padDisplayMode
static TOOL_ACTION placeReferenceImage
static TOOL_ACTION showLayersManager
static TOOL_ACTION drawCircle
static TOOL_ACTION mirrorH
Mirroring of selected items.
static TOOL_ACTION exportFootprint
static TOOL_ACTION drawTable
static TOOL_ACTION drawTextBox
static TOOL_ACTION drawPolygon
static TOOL_ACTION placePad
Activation of the drawing tool (placing a PAD)
static TOOL_ACTION drawRadialDimension
static TOOL_ACTION editTextAndGraphics
static TOOL_ACTION drawLeader
static TOOL_ACTION ddImportFootprint
static TOOL_ACTION placeImportedGraphics
static TOOL_ACTION drawArc
static TOOL_ACTION graphicsOutlines
Display footprint graphics as outlines.
static TOOL_ACTION loadFpFromBoard
static TOOL_ACTION drawCenterDimension
static TOOL_ACTION footprintProperties
static TOOL_ACTION flipBoard
static TOOL_ACTION textOutlines
Display texts as lines.
static TOOL_ACTION checkFootprint
static TOOL_ACTION editLibFpInFpEditor
static TOOL_ACTION mirrorV
static TOOL_ACTION repairFootprint
static TOOL_ACTION saveFpToBoard
static TOOL_ACTION drawLine
static TOOL_ACTION cleanupGraphics
static TOOL_ACTION rotateCw
Rotation of selected objects.
static TOOL_ACTION rotateCcw
static TOOL_ACTION drawAlignedDimension
Common, abstract interface for edit frames.
APPEARANCE_CONTROLS * m_appearancePanel
PANEL_SELECTION_FILTER * m_selectionFilterPanel
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.
void setFPWatcher(FOOTPRINT *aFootprint)
Create or removes a watcher on the specified footprint.
void OnModify() override
Must be called after a change in order to set the "modify" flag and update other data structures and ...
FOOTPRINT * loadFootprint(const LIB_ID &aFootprintId)
Attempt to load aFootprintId from the footprint library table.
BOX2I GetBoardBoundingBox(bool aBoardEdgesOnly=false) const
Calculate the bounding box containing all board items (or board edge segments).
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
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 void AddFootprintToBoard(FOOTPRINT *aFootprint)
Add the given footprint to the board.
PCB_DISPLAY_OPTIONS m_displayOptions
FOOTPRINT_EDITOR_SETTINGS * GetFootprintEditorSettings() const
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.
HIGH_CONTRAST_MODE m_ContrastModeDisplay
How inactive layers are displayed.
void UpdateColors()
Update the color settings in the painter and GAL.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void DisplayBoard(BOARD *aBoard, PROGRESS_REPORTER *aReporter=nullptr)
Add all items from the current board to the VIEW, so they can be displayed by GAL.
Group generic conditions for PCB editor states.
SELECTION_CONDITION PadFillDisplay()
Create a functor that tests if the frame fills the pads.
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 TextFillDisplay()
Create a functor that tests if the frame fills text items.
The main frame for Pcbnew.
Parameters and options when plotting/printing a board.
Tool that displays edit points allowing to modify items by dragging the points.
virtual SETTINGS_MANAGER & GetSettingsManager() const
static FP_LIB_TABLE * PcbFootprintLibs(PROJECT *aProject)
Return the table of footprint libraries without Kiway.
@ PCB_FOOTPRINT_EDITOR_FP_NAME
@ PCB_FOOTPRINT_EDITOR_LIB_NICKNAME
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...
virtual const wxString & GetRString(RSTRING_T aStringId)
Return a "retained string", which is any session and project specific string identified in enum RSTRI...
float SplitterProportion() const
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 bool NotEmpty(const SELECTION &aSelection)
Test if there are any items selected.
static bool Idle(const SELECTION &aSelection)
Test if there no items selected or being edited.
static bool ShowAlways(const SELECTION &aSelection)
The default condition function (always returns true).
T * GetAppSettings(const char *aFilename)
Return a handle to the a given settings by type.
bool IsProjectOpen() const
Helper for checking if we have a project open.
const char * c_str() const
A modified version of the wxInfoBar class that allows us to:
void ShowMessageFor(const wxString &aMessage, int aTime, int aFlags=wxICON_INFORMATION, MESSAGE_TYPE aType=WX_INFOBAR::MESSAGE_TYPE::GENERIC)
Show the infobar with the provided message and icon for a specific period of time.
Multi-thread safe progress reporter dialog, intended for use of tasks that parallel reporting back of...
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.
static bool empty(const wxTextEntryBase *aCtrl)
Declaration of the eda_3d_viewer class.
static constexpr EDA_ANGLE ANGLE_90
#define KICAD_DEFAULT_DRAWFRAME_STYLE
#define FOOTPRINT_EDIT_FRAME_NAME
static const std::string KiCadFootprintLibPathExtension
static const std::string KiCadFootprintFileExtension
static wxString PngFileWildcard()
bool IsUserLayer(PCB_LAYER_ID aLayerId)
Test whether a layer is a non copper and a non tech layer.
PCB_LAYER_ID
A quick note on layer IDs:
This file contains miscellaneous commonly used macros and functions.
@ TARGET_NONCACHED
Auxiliary rendering target (noncached)
SETTINGS_MANAGER * GetSettingsManager()
PGM_BASE & Pgm()
The global program "get" accessor.
KIWAY Kiway(KFCTL_STANDALONE)
wxString UnescapeString(const wxString &aSource)
wxString From_UTF8(const char *cstring)
constexpr int mmToIU(double mm) const
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
@ PCB_TEXT_T
class PCB_TEXT, text on a 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.