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_rotationAngle( 900 ), m_undoRedoBlocked( false ),
53 m_selectionFilterPanel( nullptr ),
54 m_appearancePanel( nullptr )
57 [
this]( wxIdleEvent& aEvent )
81 wxFileName projectName(
Prj().GetProjectFullName() );
83 if( mgr->
IsProjectOpen() && wxFileName::IsDirWritable( projectName.GetPath() )
84 && projectName.Exists() )
97 static bool s_switcherShown =
false;
99 if( aEvent.GetEventType() == wxEVT_CHAR || aEvent.GetEventType() == wxEVT_CHAR_HOOK )
101 if( !s_switcherShown && wxGetKeyState( WXK_RAW_CONTROL ) && wxGetKeyState( WXK_TAB ) )
108 s_switcherShown =
true;
109 switcher.ShowModal();
110 s_switcherShown =
false;
114 if( idx >= 0 && idx < (
int) mru.size() )
122 return PCB_BASE_FRAME::TryBefore( aEvent );
128 wxCHECK2_MSG( aRotationAngle > 0 && aRotationAngle <= 900, aRotationAngle = 900,
129 wxT(
"Invalid rotation angle, defaulting to 90." ) );
163 bds.
m_DRCEngine = std::make_shared<DRC_ENGINE>( aBoard, &bds );
191 [units, view](
EDA_ITEM* aItem,
void* aTestData )
199 view->
Update( dimension );
238 return wxEmptyString;
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 SetUnits(EDA_UNITS aUnits)
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 SetObjectVisible(GAL_LAYER_ID aLayer, bool aVisible=true)
virtual void unitsChangeRefresh() override
Called when when the units setting has changed to allow for any derived classes to handle refreshing ...
void ActivateGalCanvas() override
Set the #m_Pcb member in such as way as to ensure deleting any previous BOARD.
void ApplyLayerPreset(const wxString &aPresetName)
SETTINGS_MANAGER * GetSettingsManager() const
virtual APP_SETTINGS_BASE * config() const
Returns the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
virtual void handleActivateEvent(wxActivateEvent &aEvent)
Handle a window activation event.
wxString GetDesignRulesPath()
Return the absolute path to the design rules file for the currently-loaded board.
APPEARANCE_CONTROLS * m_appearancePanel
void handleActivateEvent(wxActivateEvent &aEvent) override
Handle a window activation event.
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
A progress reporter interface for use in multi-threaded environments.
FRAME_T
The set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
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_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
const std::string DesignRulesFileExtension
const wxArrayString & GetLayerPresetsMRU()
const wxPoint & GetGridOrigin()
void SetGridOrigin(const VECTOR2D &aGridOrigin)
Set the origin point for the grid.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
const wxString & GetFileName() const
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
void unitsChangeRefresh() override
Called when when the units setting has changed to allow for any derived classes to handle refreshing ...
virtual void OnLayerAlphaChanged()
Notify the frame that the layer Alpha is being changed.
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.
void doCloseWindow() override
DIM_UNITS_MODE GetUnitsMode() const
bool TryBefore(wxEvent &aEvent) override
bool IsProjectOpen() const
Helper for checking if we have a project open TODO: This should be deprecated along with Prj() once w...
virtual void ActivateGalCanvas() override
Use to start up the GAL drawing canvas.
VECTOR2< double > VECTOR2D
std::function< SEARCH_RESULT(EDA_ITEM *aItem, void *aTestData) > INSPECTOR_FUNC
Used to inspect and possibly collect the (search) results of iterating over a list or tree of KICAD_T...
void Clear()
Remove all items from the view.
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
Definition of file extensions used in Kicad.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
KIGFX::GAL * GetGAL() const
Return a pointer to the GAL instance used in the panel.
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 SyncLayersVisibility(const BOARD *aBoard)
Update "visibility" property of each layer of a given BOARD.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void UpdateColors()
Update the color settings in the painter and GAL.
void SetGridVisibility(bool aVisible) override
Override this function in the PCB_BASE_EDIT_FRAME to refill the layer widget.
static const KICAD_T Dimensions[]
A scan list for dimensions.
Information pertinent to a Pcbnew printed circuit board.
bool UnloadProject(PROJECT *aProject, bool aSave=true)
Saves, unloads and unregisters the given PROJECT.
PCBNEW_SETTINGS * GetPcbNewSettings() const
A base class for most all the KiCad significant classes used in schematics and boards.
virtual void ReCreateAuxiliaryToolbar()
void RefreshCollapsiblePanes()
Function to force a redraw of the collapsible panes in this control.
Color settings are a bit different than most of the settings objects in that there can be more than o...
virtual ~PCB_BASE_EDIT_FRAME()
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
void SetRotationAngle(int aRotationAngle)
Set the angle used for rotate operations.
void OnLayerAlphaChanged()
virtual void SetGridVisibility(bool aVisible)
bool IsSingle() const
Is this KIFACE running under single_top?
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
std::shared_ptr< DRC_ENGINE > m_DRCEngine
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
void SetObjectVisible(GAL_LAYER_ID aLayer, bool isVisible=true)
Update the manual layer alpha overrides.
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
COLOR_SETTINGS * GetColorSettings() const override
Helper to retrieve the current color settings.
Container for design settings for a BOARD object.
void Update()
Update the dimension's cached text and geometry.