49 FRAME_T aFrameType,
const wxString& aTitle,
50 const wxPoint& aPos,
const wxSize& aSize,
long aStyle,
51 const wxString& aFrameName ) :
52 PCB_BASE_FRAME( aKiway, aParent, aFrameType, aTitle, aPos, aSize, aStyle, aFrameName ),
53 m_undoRedoBlocked( false ),
54 m_selectionFilterPanel( nullptr ),
55 m_appearancePanel( nullptr ),
56 m_propertiesPanel( nullptr ),
57 m_tabbedPanel( nullptr ),
58 m_show_properties( false )
63 [
this]( wxIdleEvent& aEvent )
93 wxFileName projectName(
Prj().GetProjectFullName() );
95 if( mgr->
IsProjectOpen() && wxFileName::IsDirWritable( projectName.GetPath() )
96 && projectName.Exists() )
109 static bool s_presetSwitcherShown =
false;
110 static bool s_viewportSwitcherShown =
false;
117 if( wxGetKeyState( WXK_TAB ) )
119 if( ( aEvent.GetEventType() == wxEVT_CHAR || aEvent.GetEventType() == wxEVT_CHAR_HOOK )
120 &&
static_cast<wxKeyEvent&
>( aEvent ).GetKeyCode() == WXK_TAB )
133 s_presetSwitcherShown =
true;
134 switcher.ShowModal();
135 s_presetSwitcherShown =
false;
139 if( idx >= 0 && idx < (
int) mru.size() )
156 s_viewportSwitcherShown =
true;
157 switcher.ShowModal();
158 s_viewportSwitcherShown =
false;
162 if( idx >= 0 && idx < (
int) mru.size() )
171 return PCB_BASE_FRAME::TryBefore( aEvent );
192 bool is_new_board = ( aBoard !=
m_pcb );
210 bds.
m_DRCEngine = std::make_shared<DRC_ENGINE>( aBoard, &bds );
234 board->UpdateUserUnits( board,
GetCanvas()->GetView() );
269 return wxEmptyString;
311 wxAuiPaneInfo& propertiesPaneInfo =
m_auimgr.GetPane(
"PropertiesManager" );
328 wxArrayString* aTokens )
332 if( !aCrossRef.IsEmpty() )
336 if( candidate->GetReference() == aCrossRef )
348 footprint->GetContextualTextVars( aTokens );
351 aTokens->push_back( entry.first );
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()
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
FOOTPRINTS & Footprints()
const wxString & GetFileName() const
PROJECT * GetProject() 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.
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 GetContextualTextVars(BOARD_ITEM *aSourceItem, const wxString &aCrossRef, wxArrayString *aTokens)
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
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 std::map< wxString, wxString > & GetTextVars() const
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.
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.