45 FRAME_T aFrameType,
const wxString& aTitle,
46 const wxPoint& aPos,
const wxSize& aSize,
long aStyle,
47 const wxString& aFrameName ) :
48 PCB_BASE_FRAME( aKiway, aParent, aFrameType, aTitle, aPos, aSize, aStyle, aFrameName ),
49 m_rotationAngle( 900 ), m_undoRedoBlocked( false ),
50 m_selectionFilterPanel( nullptr ),
51 m_appearancePanel( nullptr )
65 wxFileName projectName(
Prj().GetProjectFullName() );
67 if( mgr->
IsProjectOpen() && wxFileName::IsDirWritable( projectName.GetPath() )
68 && projectName.Exists() )
81 static bool s_switcherShown =
false;
83 if( !s_switcherShown && wxGetKeyState( WXK_RAW_CONTROL ) && wxGetKeyState( WXK_TAB ) )
90 s_switcherShown =
true;
92 s_switcherShown =
false;
96 if( idx >= 0 && idx < (
int) mru.size() )
103 return PCB_BASE_FRAME::TryBefore( aEvent );
109 wxCHECK2_MSG( aRotationAngle > 0 && aRotationAngle <= 900, aRotationAngle = 900,
110 wxT(
"Invalid rotation angle, defaulting to 90." ) );
126 bool new_board = ( aBoard !=
m_pcb );
144 bds.
m_DRCEngine = std::make_shared<DRC_ENGINE>( aBoard, &bds );
172 [units, view](
EDA_ITEM* aItem,
void* aTestData )
174 DIMENSION_BASE* dimension = static_cast<DIMENSION_BASE*>( aItem );
180 view->
Update( dimension );
219 return wxEmptyString;
virtual void SetBoard(BOARD *aBoard)
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)
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 ...
wxPoint m_GridOrigin
origin for grid offsets
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.
wxString GetDesignRulesPath()
Return the absolute path to the design rules file for the currently-loaded board.
APPEARANCE_CONTROLS * m_appearancePanel
AUI panel for controlling layer and object visibility and appearance.
DIM_UNITS_MODE GetUnitsMode() const
FRAME_T
The set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
const std::string DesignRulesFileExtension
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
void SetUnits(EDA_UNITS aUnits)
const wxArrayString & GetLayerPresetsMRU()
void Update()
Updates the dimension's cached text and geometry.
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
void unitsChangeRefresh() override
Called when when the units setting has changed to allow for any derived classes to handle refreshing ...
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
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.
bool IsSingle() const
Is this KIFACE_I running under single_top?
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 DisplayBoard(BOARD *aBoard)
Add all items from the current board to the VIEW, so they can be displayed by GAL.
void Clear()
Remove all items from the view.
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
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.
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.
int m_rotationAngle
User defined rotation angle (in tenths of a degree).
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.
virtual void SetBoard(BOARD *aBoard) override
Set the #m_Pcb member in such as way as to ensure deleting any previous 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()
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.
virtual void SetGridVisibility(bool aVisible)
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.