53 FRAME_T aFrameType,
const wxString& aTitle,
54 const wxPoint& aPos,
const wxSize& aSize,
long aStyle,
55 const wxString& aFrameName ) :
56 PCB_BASE_FRAME( aKiway, aParent, aFrameType, aTitle, aPos, aSize, aStyle, aFrameName ),
57 m_undoRedoBlocked( false ),
58 m_selectionFilterPanel( nullptr ),
59 m_appearancePanel( nullptr ),
60 m_tabbedPanel( nullptr )
66 if( !wxApp::GetGUIInstance() )
70 [
this]( wxIdleEvent& aEvent )
100 wxFileName projectName(
Prj().GetProjectFullName() );
102 if( mgr->
IsProjectOpen() && wxFileName::IsDirWritable( projectName.GetPath() )
103 && projectName.Exists() )
116 static bool s_presetSwitcherShown =
false;
117 static bool s_viewportSwitcherShown =
false;
124 if( wxGetKeyState( WXK_TAB ) )
126 if( ( aEvent.GetEventType() == wxEVT_CHAR || aEvent.GetEventType() == wxEVT_CHAR_HOOK )
127 &&
static_cast<wxKeyEvent&
>( aEvent ).GetKeyCode() == WXK_TAB )
140 s_presetSwitcherShown =
true;
141 const int switcherDialogRet = switcher.
ShowModal();
142 s_presetSwitcherShown =
false;
144 if( switcherDialogRet == wxID_OK )
148 if( idx >= 0 && idx < (
int) mru.size() )
166 s_viewportSwitcherShown =
true;
167 const int switcherDialogRet = switcher.
ShowModal();
168 s_viewportSwitcherShown =
false;
170 if( switcherDialogRet == wxID_OK )
174 if( idx >= 0 && idx < (
int) mru.size() )
184 return PCB_BASE_FRAME::TryBefore( aEvent );
205 bool is_new_board = ( aBoard !=
m_pcb );
223 bds.
m_DRCEngine = std::make_shared<DRC_ENGINE>( aBoard, &bds );
247 board->UpdateUserUnits( board,
GetCanvas()->GetView() );
283 return wxEmptyString;
320 propertiesPaneInfo.Show( show );
338 wxArrayString* aTokens )
342 if( !aCrossRef.IsEmpty() )
346 if( candidate->GetReference() == aCrossRef )
358 footprint->GetContextualTextVars( aTokens );
369 auto layerSelectorFactory =
390 aToolbar->Bind( wxEVT_UPDATE_UI,
391 [
this]( wxUpdateUIEvent& aEvent )
402 aToolbar->Bind( wxEVT_COMBOBOX,
403 [
this]( wxCommandEvent& aEvent )
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
void ApplyLayerPreset(const wxString &aPresetName)
const wxArrayString & GetViewportsMRU()
void RefreshCollapsiblePanes()
Function to force a redraw of the collapsible panes in this control.
const wxArrayString & GetLayerPresetsMRU()
Return a list of viewports created by the user.
void OnDarkModeToggle()
Update the widget when the active board layer is changed.
void SetObjectVisible(GAL_LAYER_ID aLayer, bool isVisible=true)
void ApplyViewport(const wxString &aPresetName)
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()
bool IsType(FRAME_T aType) const
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...
int GetLayerSelection() const
int SetLayerSelection(int layer)
static const LSET & ForbiddenFootprintLayers()
Layers which are not allowed within footprint definitions.
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)
APPEARANCE_CONTROLS * m_appearancePanel
void SetObjectVisible(GAL_LAYER_ID aLayer, bool aVisible=true)
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.
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
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_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.
void SetBoardFrame(PCB_BASE_FRAME *aFrame)
void SetNotAllowedLayerSet(const LSET &aMask)
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
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.