23#include <wx/snglinst.h>
58 int aCtlBits = 0 )
override
91 std::vector<TOOL_ACTION*> actions;
92 std::vector<ACTION_TOOLBAR_CONTROL*> controls;
95 actions.push_back( action );
98 controls.push_back( control );
130 void SaveFileAs(
const wxString& aProjectBasePath,
const wxString& aSrcProjectName,
131 const wxString& aNewProjectBasePath,
const wxString& aNewProjectName,
132 const wxString& aSrcFilePath, wxString& aErrors )
override;
168 const wxString& aNewProjectBasePath,
const wxString& aNewProjectName,
169 const wxString& aSrcFilePath, wxString& aErrors )
171 wxFileName destFile( aSrcFilePath );
172 wxString destPath = destFile.GetPathWithSep();
173 wxUniChar pathSep = wxFileName::GetPathSeparator();
174 wxString ext = destFile.GetExt();
176 if( destPath.StartsWith( aProjectBasePath + pathSep ) )
178 destPath.Replace( aProjectBasePath, aNewProjectBasePath,
false );
179 destFile.SetPath( destPath );
182 if( ext ==
"kicad_wks" )
184 if( destFile.GetName() == aSrcProjectName )
185 destFile.SetName( aNewProjectName );
187 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
191 wxFAIL_MSG(
"Unexpected filetype for Pcbnew::SaveFileAs()" );
constexpr EDA_IU_SCALE drawSheetIUScale
static std::list< TOOL_ACTION * > & GetActionList()
Return list of TOOL_ACTIONs.
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
The base frame for deriving all KiCad main window classes.
KIFACE_BASE(const char *aKifaceName, KIWAY::FACE_T aId)
void InitSettings(APP_SETTINGS_BASE *aSettings)
void end_common()
Common things to do for a top program module, during OnKifaceEnd();.
APP_SETTINGS_BASE * KifaceSettings() const
bool start_common(int aCtlBits)
Common things to do for a top program module, during OnKifaceStart().
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
FACE_T
Known KIFACE implementations.
Container for data for KiCad programs.
virtual SETTINGS_MANAGER & GetSettingsManager() const
The main window used in the drawing sheet editor.
T * RegisterSettings(T *aSettings, bool aLoadNow=true)
Take ownership of the pointer passed in.
UNITS_PROVIDER(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits)
EDA_UNITS GetUserUnits() const
void SetUserUnits(EDA_UNITS aUnits)
This file is part of the common library.
@ PANEL_DS_DISPLAY_OPTIONS
void KiCopyFile(const wxString &aSrcPath, const wxString &aDestPath, wxString &aErrors)
PGE::IFACE KIFACE_BASE, UNITS_PROVIDER kiface("pl_editor", KIWAY::FACE_PL_EDITOR)
PANEL_SNAPPING * CreateSnappingPanel(wxWindow *aParent, SETTINGS_T *aCfg, FRAME_T aFrameType, SNAP_INFERENCE_SETTINGS SETTINGS_T::*aInference=nullptr, MAGNETIC_SETTINGS SETTINGS_T::*aMagnetics=nullptr)
Build the snapping page for an editor.
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
T * GetToolbarSettings(const wxString &aFilename)
T * GetAppSettings(const char *aFilename)
bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits, KIWAY *aKiway) override
Typically start_common() is called from here.
Implement a participant in the KIWAY alchemy.
bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits, KIWAY *aKiway) override
Typically start_common() is called from here.
IFACE(const char *aName, KIWAY::FACE_T aType)
void SaveFileAs(const wxString &aProjectBasePath, const wxString &aSrcProjectName, const wxString &aNewProjectBasePath, const wxString &aNewProjectName, const wxString &aSrcFilePath, wxString &aErrors) override
Saving a file under a different name is delegated to the various KIFACEs because the project doesn't ...
void * IfaceOrAddress(int aDataId) override
Return a pointer to the requested object.
wxWindow * CreateKiWindow(wxWindow *aParent, int aClassId, KIWAY *aKiway, int aCtlBits=0) override
Create a wxWindow for the current project.
void OnKifaceEnd() override
Called just once just before the DSO is to be unloaded.
static const long long MM