27#include <wx/snglinst.h>
58 int aCtlBits = 0 )
override
115 void SaveFileAs(
const wxString& aProjectBasePath,
const wxString& aSrcProjectName,
116 const wxString& aNewProjectBasePath,
const wxString& aNewProjectName,
117 const wxString& aSrcFilePath, wxString& aErrors )
override;
153 const wxString& aNewProjectBasePath,
const wxString& aNewProjectName,
154 const wxString& aSrcFilePath, wxString& aErrors )
156 wxFileName destFile( aSrcFilePath );
157 wxString destPath = destFile.GetPathWithSep();
158 wxUniChar pathSep = wxFileName::GetPathSeparator();
159 wxString ext = destFile.GetExt();
161 if( destPath.StartsWith( aProjectBasePath + pathSep ) )
163 destPath.Replace( aProjectBasePath, aNewProjectBasePath,
false );
164 destFile.SetPath( destPath );
167 if( ext ==
"kicad_wks" )
169 if( destFile.GetName() == aSrcProjectName )
170 destFile.SetName( aNewProjectName );
172 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
176 wxFAIL_MSG(
"Unexpected filetype for Pcbnew::SaveFileAs()" );
constexpr EDA_IU_SCALE drawSheetIUScale
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.
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 * GetAppSettings()
Returns a handle to the a given settings by type If the settings have already been loaded,...
T * RegisterSettings(T *aSettings, bool aLoadNow=true)
Takes ownership of the pointer passed in.
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)
PGM_BASE & Pgm()
The global Program "get" accessor.
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
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.