48 FRAME_T aFrameType,
const wxString& aTitle,
49 const wxPoint& aPos,
const wxSize& aSize,
long aStyle,
50 const wxString& aFrameName ) :
51 PCB_BASE_FRAME( aKiway, aParent, aFrameType, aTitle, aPos, aSize, aStyle, aFrameName ),
52 m_undoRedoBlocked( false ),
53 m_selectionFilterPanel( nullptr ),
54 m_appearancePanel( nullptr ),
55 m_propertiesPanel( nullptr ),
56 m_tabbedPanel( nullptr )
61 [
this]( wxIdleEvent& aEvent )
91 wxFileName projectName(
Prj().GetProjectFullName() );
93 if( mgr->
IsProjectOpen() && wxFileName::IsDirWritable( projectName.GetPath() )
94 && projectName.Exists() )
107 static bool s_presetSwitcherShown =
false;
108 static bool s_viewportSwitcherShown =
false;
115 if( wxGetKeyState( WXK_TAB ) )
117 if( ( aEvent.GetEventType() == wxEVT_CHAR || aEvent.GetEventType() == wxEVT_CHAR_HOOK )
118 &&
static_cast<wxKeyEvent&
>( aEvent ).GetKeyCode() == WXK_TAB )
131 s_presetSwitcherShown =
true;
132 switcher.ShowModal();
133 s_presetSwitcherShown =
false;
137 if( idx >= 0 && idx < (
int) mru.size() )
154 s_viewportSwitcherShown =
true;
155 switcher.ShowModal();
156 s_viewportSwitcherShown =
false;
160 if( idx >= 0 && idx < (
int) mru.size() )
169 return PCB_BASE_FRAME::TryBefore( aEvent );
208 bds.
m_DRCEngine = std::make_shared<DRC_ENGINE>( aBoard, &bds );
232 bool selectedItemsModified =
false;
236 if( selectedItemsModified )
271 return wxEmptyString;
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)
Container for design settings for a BOARD object.
std::shared_ptr< DRC_ENGINE > m_DRCEngine
const VECTOR2I & GetGridOrigin()
Information pertinent to a Pcbnew printed circuit board.
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...
virtual APP_SETTINGS_BASE * config() const
Returns the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
SETTINGS_MANAGER * GetSettingsManager() const
virtual void ReCreateAuxiliaryToolbar()
virtual void SetGridVisibility(bool aVisible)
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.
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
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
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.
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 handleActivateEvent(wxActivateEvent &aEvent) override
Handle a window activation event.
PROPERTIES_PANEL * m_propertiesPanel
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.
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
void UpdateUserUnits(BOARD_ITEM *aItem, bool *aSelectedItemsModified=nullptr)
Update any references within aItem (or its descendants) to the user units.
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.
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.
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.
virtual void UpdateData()=0
bool IsProjectOpen() const
Helper for checking if we have a project open TODO: This should be deprecated along with Prj() once w...
bool UnloadProject(PROJECT *aProject, bool aSave=true)
Saves, unloads and unregisters the given PROJECT.
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.
const std::string DesignRulesFileExtension
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
VECTOR2< double > VECTOR2D
Definition of file extensions used in Kicad.