27#include <wx/snglinst.h>
61 int aCtlBits = 0 )
override
97 std::vector<TOOL_ACTION*> actions;
98 std::vector<ACTION_TOOLBAR_CONTROL*> controls;
101 actions.push_back( action );
104 controls.push_back( control );
136 void SaveFileAs(
const wxString& aProjectBasePath,
const wxString& aSrcProjectName,
137 const wxString& aNewProjectBasePath,
const wxString& aNewProjectName,
138 const wxString& aSrcFilePath, wxString& aErrors )
override;
174 const wxString& aNewProjectBasePath,
const wxString& aNewProjectName,
175 const wxString& aSrcFilePath, wxString& aErrors )
177 wxFileName destFile( aSrcFilePath );
178 wxString destPath = destFile.GetPathWithSep();
179 wxUniChar pathSep = wxFileName::GetPathSeparator();
180 wxString ext = destFile.GetExt();
182 if( destPath.StartsWith( aProjectBasePath + pathSep ) )
184 destPath.Replace( aProjectBasePath, aNewProjectBasePath,
false );
185 destFile.SetPath( destPath );
188 if( ext ==
"kicad_wks" )
190 if( destFile.GetName() == aSrcProjectName )
191 destFile.SetName( aNewProjectName );
193 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
197 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.
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.
T * GetToolbarSettings(const wxString &aFilename)
Return a handle to the given toolbar settings.
T * GetAppSettings(const wxString &aFilename)
Return a handle to the a given settings by type.
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.