54 FRAME_T aFrameType,
const wxString& aTitle,
55 const wxPoint& aPos,
const wxSize& aSize,
long aStyle,
56 const wxString& aFrameName ) :
57 PCB_BASE_FRAME( aKiway, aParent, aFrameType, aTitle, aPos, aSize, aStyle, aFrameName ),
67 if( !wxApp::GetGUIInstance() )
71 [
this]( wxIdleEvent& aEvent )
101 wxFileName projectName(
Prj().GetProjectFullName() );
103 if( mgr->
IsProjectOpen() && wxFileName::IsDirWritable( projectName.GetPath() )
104 && projectName.Exists() )
106 GFootprintList.WriteCacheToFile(
Prj().GetProjectPath() + wxT(
"fp-info-cache" ) );
117 static bool s_presetSwitcherShown =
false;
118 static bool s_viewportSwitcherShown =
false;
125 if( wxGetKeyState( WXK_TAB ) )
127 if( ( aEvent.GetEventType() == wxEVT_CHAR || aEvent.GetEventType() == wxEVT_CHAR_HOOK )
128 &&
static_cast<wxKeyEvent&
>( aEvent ).GetKeyCode() == WXK_TAB )
141 s_presetSwitcherShown =
true;
142 const int switcherDialogRet = switcher.
ShowModal();
143 s_presetSwitcherShown =
false;
145 if( switcherDialogRet == wxID_OK )
149 if( idx >= 0 && idx < (
int) mru.size() )
167 s_viewportSwitcherShown =
true;
168 const int switcherDialogRet = switcher.
ShowModal();
169 s_viewportSwitcherShown =
false;
171 if( switcherDialogRet == wxID_OK )
175 if( idx >= 0 && idx < (
int) mru.size() )
185 return PCB_BASE_FRAME::TryBefore( aEvent );
206 bool is_new_board = ( aBoard !=
m_pcb );
224 bds.
m_DRCEngine = std::make_shared<DRC_ENGINE>( aBoard, &bds );
248 board->UpdateUserUnits( board,
GetCanvas()->GetView() );
284 return wxEmptyString;
321 propertiesPaneInfo.Show( show );
339 wxArrayString* aTokens )
343 if( !aCrossRef.IsEmpty() )
347 if( candidate->GetReference() == aCrossRef )
349 candidate->GetContextualTextVars( aTokens );
359 footprint->GetContextualTextVars( aTokens );
370 auto layerSelectorFactory =
385 aToolbar->Bind( wxEVT_UPDATE_UI,
386 [
this]( wxUpdateUIEvent& aEvent )
397 aToolbar->Bind( wxEVT_COMBOBOX,
398 [
this]( wxCommandEvent& aEvent )
415 wxPostEvent(
this, evt );
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
@ NORMAL
Inactive layers are shown normally (no high-contrast mode)
wxString m_ColorTheme
Active color theme name.
Container for design settings for a BOARD object.
std::shared_ptr< DRC_ENGINE > m_DRCEngine
const VECTOR2I & GetGridOrigin() const
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
FOOTPRINT * GetParentFootprint() const
Information pertinent to a Pcbnew printed circuit board.
void GetContextualTextVars(wxArrayString *aVars) const
const FOOTPRINTS & Footprints() const
const wxString & GetFileName() const
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Color settings are a bit different than most of the settings objects in that there can be more than o...
Create and handle a window for the 3d viewer connected to a Kiway and a pcbboard.
virtual APP_SETTINGS_BASE * config() const
Return the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
SETTINGS_MANAGER * GetSettingsManager() const
void RegisterCustomToolbarControlFactory(const ACTION_TOOLBAR_CONTROL &aControlDesc, const ACTION_TOOLBAR_CONTROL_FACTORY &aControlFactory)
Register a creation factory for toolbar controls that are present in this frame.
virtual void configureToolbars()
static const wxString PropertiesPaneName()
virtual void ReCreateAuxiliaryToolbar()
virtual void SetGridVisibility(bool aVisible)
PROPERTIES_PANEL * m_propertiesPanel
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
KIGFX::GAL * GetGAL() const
Return a pointer to the GAL instance used in the panel.
static const TOOL_EVENT SelectedItemsModified
Selected items were moved, this can be very high frequency on the canvas, use with care.
void SetGridOrigin(const VECTOR2D &aGridOrigin)
Set the origin point for the grid.
void Clear()
Remove all items from the view.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
virtual ~PCB_BASE_EDIT_FRAME()
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.
bool m_darkMode
Panel with Layers and Object Inspector tabs.
void doCloseWindow() override
void SetGridVisibility(bool aVisible) override
Override this function in the PCB_BASE_EDIT_FRAME to refill the layer widget.
virtual EDA_ANGLE GetRotationAngle() const
Return the angle used for rotate operations.
void unitsChangeRefresh() override
Called when when the units setting has changed to allow for any derived classes to handle refreshing ...
bool TryBefore(wxEvent &aEvent) override
PCB_LAYER_BOX_SELECTOR * m_SelLayerBox
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.
void ToggleProperties() override
void configureToolbars() override
PCB_BASE_EDIT_FRAME(KIWAY *aKiway, wxWindow *aParent, FRAME_T aFrameType, const wxString &aTitle, const wxPoint &aPos, const wxSize &aSize, long aStyle, const wxString &aFrameName)
void HighlightSelectionFilter(const PCB_SELECTION_FILTER_OPTIONS &aOptions)
APPEARANCE_CONTROLS * m_appearancePanel
wxAuiNotebook * m_tabbedPanel
void SetObjectVisible(GAL_LAYER_ID aLayer, bool aVisible=true)
PANEL_SELECTION_FILTER * m_selectionFilterPanel
void GetContextualTextVars(BOARD_ITEM *aSourceItem, const wxString &aCrossRef, wxArrayString *aTokens)
void handleActivateEvent(wxActivateEvent &aEvent) override
Handle a window activation event.
virtual void onDarkModeToggle()
void ActivateGalCanvas() override
Set the #m_Pcb member in such as way as to ensure deleting any previous BOARD.
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Display options control the way tracks, vias, outlines and other things are shown (for instance solid...
void handleActivateEvent(wxActivateEvent &aEvent) override
Handle a window activation event.
virtual void unitsChangeRefresh() override
Called when when the units setting has changed to allow for any derived classes to handle refreshing ...
PCBNEW_SETTINGS * GetPcbNewSettings() const
virtual PCB_LAYER_ID GetActiveLayer() const
PCB_BASE_FRAME(KIWAY *aKiway, wxWindow *aParent, FRAME_T aFrameType, const wxString &aTitle, const wxPoint &aPos, const wxSize &aSize, long aStyle, const wxString &aFrameName)
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
virtual void ActivateGalCanvas() override
Use to start up the GAL drawing canvas.
virtual void SetBoard(BOARD *aBoard, PROGRESS_REPORTER *aReporter=nullptr)
Set the #m_Pcb member in such as way as to ensure deleting any previous BOARD.
EDA_3D_VIEWER_FRAME * Get3DViewerFrame()
virtual void SetActiveLayer(PCB_LAYER_ID aLayer)
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.
void SyncLayersVisibility(const BOARD *aBoard)
Update "visibility" property of each layer of a given BOARD.
Class to display a pcb layer list in a wxBitmapComboBox.
A progress reporter interface for use in multi-threaded environments.
virtual const wxString AbsolutePath(const wxString &aFileName) const
Fix up aFileName if it is relative to the project's directory to be an absolute path and filename.
bool IsProjectOpen() const
Helper for checking if we have a project open.
bool UnloadProject(PROJECT *aProject, bool aSave=true)
Save, unload and unregister the given PROJECT.
Declaration of the eda_3d_viewer class.
static constexpr EDA_ANGLE ANGLE_90
#define VIEWPORT_SWITCH_KEY
#define PRESET_SWITCH_KEY
FRAME_T
The set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
static const std::string DesignRulesFileExtension
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
PCB_LAYER_ID ToLAYER_ID(int aLayer)
int properties_panel_width
This file contains data structures that are saved in the project file or project local settings file ...
VECTOR2< double > VECTOR2D
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.