KiCad PCB EDA Suite
|
Class EDA_BASE_FRAME is the base frame for deriving all KiCad main window classes. More...
#include <eda_base_frame.h>
Public Member Functions | |
EDA_BASE_FRAME (wxWindow *aParent, FRAME_T aFrameType, const wxString &aTitle, const wxPoint &aPos, const wxSize &aSize, long aStyle, const wxString &aFrameName) | |
~EDA_BASE_FRAME () | |
bool | ProcessEvent (wxEvent &aEvent) override |
Function ProcessEvent overrides the default process event handler to implement the auto save feature. More... | |
void | SetAutoSaveInterval (int aInterval) |
int | GetAutoSaveInterval () const |
bool | IsType (FRAME_T aType) const |
void | GetKicadHelp (wxCommandEvent &event) |
void | GetKicadContribute (wxCommandEvent &event) |
void | GetKicadAbout (wxCommandEvent &event) |
void | PrintMsg (const wxString &text) |
virtual void | LoadSettings (wxConfigBase *aCfg) |
Function LoadSettings loads common frame parameters from a configuration file. More... | |
virtual void | SaveSettings (wxConfigBase *aCfg) |
Function SaveSettings saves common frame parameters to a configuration data file. More... | |
wxString | ConfigBaseName () |
Function ConfigBaseName. More... | |
virtual void | SaveProjectSettings (bool aAskForSave) |
Function SaveProjectSettings saves changes to the project settings to the project (.pro) file. More... | |
virtual void | OnSelectPreferredEditor (wxCommandEvent &event) |
Function OnSelectPreferredEditor Open a dialog to select the editor that will used in KiCad to edit or display files (reports ... More... | |
int | ReadHotkeyConfig (struct EDA_HOTKEY_CONFIG *aDescList) |
Function ReadHotkeyConfig Read configuration data and fill the current hotkey list with hotkeys. More... | |
virtual int | WriteHotkeyConfig (struct EDA_HOTKEY_CONFIG *aDescList, wxString *aFullFileName=NULL) |
Function WriteHotkeyConfig Store the current hotkey list It is stored using the standard wxConfig mechanism or a file. More... | |
int | ReadHotkeyConfigFile (const wxString &aFilename, struct EDA_HOTKEY_CONFIG *aDescList) |
Function ReadHotkeyConfigFile Read an old configuration file (<file>.key) and fill the current hotkey list with hotkeys. More... | |
void | ImportHotkeyConfigFromFile (EDA_HOTKEY_CONFIG *aDescList, const wxString &aDefaultShortname) |
Function ImportHotkeyConfigFromFile Prompt the user for an old hotkey file to read, and read it. More... | |
void | ExportHotkeyConfigToFile (EDA_HOTKEY_CONFIG *aDescList, const wxString &aDefaultShortname) |
Function ExportHotkeyConfigToFile Prompt the user for an old hotkey file to read, and read it. More... | |
wxString | GetFileFromHistory (int cmdId, const wxString &type, wxFileHistory *aFileHistory=NULL) |
Function GetFileFromHistory fetches the file name from the file history list. More... | |
void | UpdateFileHistory (const wxString &FullFileName, wxFileHistory *aFileHistory=NULL) |
Function UpdateFileHistory Updates the list of recently opened files. More... | |
void | SetMruPath (const wxString &aPath) |
wxString | GetMruPath () const |
virtual void | ReCreateMenuBar () |
Function ReCreateMenuBar Creates recreates the menu bar. More... | |
bool | IsWritable (const wxFileName &aFileName) |
Function IsWritable checks if aFileName can be written. More... | |
void | CheckForAutoSaveFile (const wxFileName &aFileName, const wxString &aBackupFileExtension) |
Function CheckForAutoSaveFile checks if an auto save file exists for aFileName and takes the appropriate action depending on the user input. More... | |
virtual void | ShowChangedLanguage () |
Function ShowChangedLanguage redraws the menus and what not in current language. More... | |
virtual void | OnChangeIconsOptions (wxCommandEvent &event) |
Function OnChangeIconsOptions Selects the current icons options in menus (or toolbars) in Kicad (the default for toolbars/menus is 26x26 pixels, and shows icons in menus). More... | |
virtual void | ShowChangedIcons () |
Function ShowChangedIcons redraws items menus after a icon was changed option. More... | |
void | AddMenuIconsOptions (wxMenu *MasterMenu) |
Function AddMenuIconsOptions creates a menu list for icons in menu and icon sizes choice, and add it as submenu to MasterMenu. More... | |
bool | PostCommandMenuEvent (int evt_type) |
Function PostCommandMenuEvent. More... | |
virtual int | GetIconScale () |
Function GetIconScale. More... | |
virtual void | SetIconScale (int aScale) |
Function SetIconScale. More... | |
Protected Member Functions | |
void | onAutoSaveTimer (wxTimerEvent &aEvent) |
Function onAutoSaveTimer handles the auto save timer event. More... | |
virtual bool | isAutoSaveRequired () const |
Function autoSaveRequired returns the auto save status of the application. More... | |
virtual bool | doAutoSave () |
Function doAutoSave should be overridden by the derived class to handle the auto save feature. More... | |
virtual wxConfigBase * | config () |
Function config returns the wxConfigBase used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME. More... | |
virtual const SEARCH_STACK & | sys_search () |
Function sys_search returns a SEARCH_STACK pertaining to entire program, and is overloaded in KICAD_MANAGER_FRAME. More... | |
virtual wxString | help_name () |
Protected Attributes | |
FRAME_T | m_Ident |
Id Type (pcb, schematic, library..) More... | |
wxPoint | m_FramePos |
wxSize | m_FrameSize |
wxString | m_configFrameName |
prefix used in config to identify some params (frame size...) if empty, the frame name defined in CTOR is used More... | |
wxAuiToolBar * | m_mainToolBar |
Standard horizontal Toolbar. More... | |
wxString | m_AboutTitle |
Name of program displayed in About. More... | |
wxAuiManager | m_auimgr |
bool | m_hasAutoSave |
Flag to indicate if this frame supports auto save. More... | |
bool | m_autoSaveState |
Flag to indicate the last auto save state. More... | |
int | m_autoSaveInterval |
The auto save interval time in seconds. More... | |
wxTimer * | m_autoSaveTimer |
The timer used to implement the auto save feature;. More... | |
wxString | m_perspective |
wxAuiManager perspective. More... | |
wxString | m_mruPath |
Most recently used path. More... | |
Static Protected Attributes | |
static constexpr int | KICAD_AUI_TB_STYLE = wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_PLAIN_BACKGROUND |
More... | |
Private Member Functions | |
void | windowClosing (wxCloseEvent &event) |
Function windowClosing (with its unexpected name so it does not collide with the real OnWindowClose() function provided in derived classes) is called just before a window closing, and is used to call a derivation specific SaveSettings(). More... | |
wxWindow * | findQuasiModalDialog () |
void | removePaneBorder (wxShowEvent &event) |
Removes border from wxAui panes. More... | |
Class EDA_BASE_FRAME is the base frame for deriving all KiCad main window classes.
This class is not intended to be used directly. It provides support for automatic calls to a SaveSettings() function. SaveSettings() for a derived class can choose to do nothing, or rely on basic SaveSettings() support in this base class to do most of the work by calling it from the derived class's SaveSettings().
This class is not a KIWAY_PLAYER because KICAD_MANAGER_FRAME is derived from it and that class is not a player.
Definition at line 109 of file eda_base_frame.h.
EDA_BASE_FRAME::EDA_BASE_FRAME | ( | wxWindow * | aParent, |
FRAME_T | aFrameType, | ||
const wxString & | aTitle, | ||
const wxPoint & | aPos, | ||
const wxSize & | aSize, | ||
long | aStyle, | ||
const wxString & | aFrameName | ||
) |
Definition at line 73 of file eda_base_frame.cpp.
References ID_AUTO_SAVE_TIMER, m_autoSaveInterval, m_autoSaveState, m_autoSaveTimer, m_FramePos, m_FrameSize, m_hasAutoSave, m_Ident, m_mainToolBar, m_mruPath, onAutoSaveTimer(), removePaneBorder(), windowClosing(), wxPoint::x, and wxPoint::y.
Referenced by isAutoSaveRequired().
EDA_BASE_FRAME::~EDA_BASE_FRAME | ( | ) |
Definition at line 176 of file eda_base_frame.cpp.
References m_autoSaveTimer.
Referenced by isAutoSaveRequired().
void EDA_BASE_FRAME::AddMenuIconsOptions | ( | wxMenu * | MasterMenu | ) |
Function AddMenuIconsOptions creates a menu list for icons in menu and icon sizes choice, and add it as submenu to MasterMenu.
MasterMenu | The main menu. The sub menu list will be accessible from the menu item with id ID_KICAD_SELECT_ICONS_OPTIONS |
Definition at line 693 of file eda_base_frame.cpp.
References AddMenuItem(), ID_KICAD_SELECT_ICONS_IN_MENUS, ID_KICAD_SELECT_ICONS_OPTIONS, KiBitmap(), and Pgm().
Referenced by GetMruPath(), preparePreferencesMenu(), PL_EDITOR_FRAME::ReCreateMenuBar(), KICAD_MANAGER_FRAME::ReCreateMenuBar(), and GERBVIEW_FRAME::ReCreateMenuBar().
void EDA_BASE_FRAME::CheckForAutoSaveFile | ( | const wxFileName & | aFileName, |
const wxString & | aBackupFileExtension | ||
) |
Function CheckForAutoSaveFile checks if an auto save file exists for aFileName and takes the appropriate action depending on the user input.
If an auto save file exists for aFileName, the user is prompted if they wish to replace file aFileName with the auto saved file. If the user chooses to replace the file, the backup file of aFileName is removed, aFileName is renamed to the backup file name, and the auto save file is renamed to aFileName. If user chooses to keep the existing version of aFileName, the auto save file is removed.
aFileName | A wxFileName object containing the file name to check. |
aBackupFileExtension | A wxString object containing the backup file extension used to create the backup file name. |
Definition at line 598 of file eda_base_frame.cpp.
References AUTOSAVE_PREFIX_FILENAME, Format(), GetChars(), Pgm(), and traceAutoSave.
Referenced by GetMruPath(), and PCB_EDIT_FRAME::OpenProjectFiles().
|
protectedvirtual |
Function config returns the wxConfigBase used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
Reimplemented in KICAD_MANAGER_FRAME.
Definition at line 381 of file eda_base_frame.cpp.
References Kiface(), and KIFACE_I::KifaceSettings().
Referenced by CVPCB_MAINFRAME::CVPCB_MAINFRAME(), FOOTPRINT_WIZARD_FRAME::DisplayBuildMessage(), FOOTPRINT_EDIT_FRAME::Export_Module(), GERBVIEW_FRAME::GERBVIEW_FRAME(), FOOTPRINT_EDIT_FRAME::Import_Module(), isAutoSaveRequired(), LIB_EDIT_FRAME::LIB_EDIT_FRAME(), LIB_VIEW_FRAME::LIB_VIEW_FRAME(), SIM_PLOT_FRAME::onClose(), FOOTPRINT_WIZARD_FRAME::OnCloseWindow(), LIB_EDIT_FRAME::OnPreferencesOptions(), SCH_EDIT_FRAME::OnPreferencesOptions(), SCH_EDIT_FRAME::OpenProjectFiles(), PL_EDITOR_FRAME::PL_EDITOR_FRAME(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), and windowClosing().
|
inline |
Function ConfigBaseName.
Definition at line 260 of file eda_base_frame.h.
References m_configFrameName.
Referenced by LoadSettings(), EDA_DRAW_FRAME::LoadSettings(), SaveSettings(), and EDA_DRAW_FRAME::SaveSettings().
|
protectedvirtual |
Function doAutoSave should be overridden by the derived class to handle the auto save feature.
Reimplemented in PCB_EDIT_FRAME, and SCH_EDIT_FRAME.
Definition at line 251 of file eda_base_frame.cpp.
Referenced by isAutoSaveRequired(), and onAutoSaveTimer().
void EDA_BASE_FRAME::ExportHotkeyConfigToFile | ( | EDA_HOTKEY_CONFIG * | aDescList, |
const wxString & | aDefaultShortname | ||
) |
Function ExportHotkeyConfigToFile Prompt the user for an old hotkey file to read, and read it.
aDescList | = current hotkey list descr. to initialize. |
aDefaultShortname | = a default short name (extention not needed) like eechema, kicad... |
Definition at line 757 of file hotkeys_basic.cpp.
References DEFAULT_HOTKEY_FILENAME_EXT, EDA_FILE_SELECTOR(), and Prj().
Referenced by KICAD_MANAGER_FRAME::Process_Config(), LIB_EDIT_FRAME::Process_Config(), SCH_EDIT_FRAME::Process_Config(), PL_EDITOR_FRAME::Process_Config(), PCB_EDIT_FRAME::Process_Config(), GERBVIEW_FRAME::Process_Config(), FOOTPRINT_EDIT_FRAME::ProcessPreferences(), and SaveProjectSettings().
|
private |
Definition at line 114 of file eda_base_frame.cpp.
References FRAME_SCH, DIALOG_SHIM::IsQuasiModal(), and m_Ident.
Referenced by ProcessEvent(), and windowClosing().
|
inline |
Definition at line 219 of file eda_base_frame.h.
References m_autoSaveInterval.
Referenced by DIALOG_GENERALOPTIONS::init(), and SCH_EDIT_FRAME::OnPreferencesOptions().
wxString EDA_BASE_FRAME::GetFileFromHistory | ( | int | cmdId, |
const wxString & | type, | ||
wxFileHistory * | aFileHistory = NULL |
||
) |
Function GetFileFromHistory fetches the file name from the file history list.
and removes the selected file, if this file does not exists Note also the menu is updated, if wxFileHistory::UseMenu was called at init time
cmdId | The command ID associated with the aFileHistory object. |
type | Please document me! |
aFileHistory | The wxFileHistory in use. If null, the main application file history is used |
Definition at line 420 of file eda_base_frame.cpp.
References Format(), GetChars(), KIFACE_I::GetFileHistory(), i, and Kiface().
Referenced by GERBVIEW_FRAME::OnDrlFileHistory(), KICAD_MANAGER_FRAME::OnFileHistory(), PL_EDITOR_FRAME::OnFileHistory(), PCB_EDIT_FRAME::OnFileHistory(), GERBVIEW_FRAME::OnGbrFileHistory(), GERBVIEW_FRAME::OnJobFileHistory(), GERBVIEW_FRAME::OnZipFileHistory(), and SaveProjectSettings().
|
inlinevirtual |
Function GetIconScale.
Return the desired scaling for toolbar/menubar icons in fourths (e.g. 4 is unity). A negative number indicates autoscale based on font size.
Reimplemented in PCB_EDIT_FRAME, SCH_EDIT_FRAME, GERBVIEW_FRAME, LIB_EDIT_FRAME, and FOOTPRINT_EDIT_FRAME.
Definition at line 453 of file eda_base_frame.h.
Referenced by get_scale_factor(), and FOOTPRINT_EDIT_FRAME::GetIconScale().
void EDA_BASE_FRAME::GetKicadAbout | ( | wxCommandEvent & | event | ) |
Definition at line 547 of file eda_base_frame.cpp.
References ShowAboutDialog().
Referenced by add_search_paths(), and IsType().
void EDA_BASE_FRAME::GetKicadContribute | ( | wxCommandEvent & | event | ) |
Definition at line 534 of file eda_base_frame.cpp.
References URL_GET_INVOLVED.
Referenced by add_search_paths(), and IsType().
void EDA_BASE_FRAME::GetKicadHelp | ( | wxCommandEvent & | event | ) |
Definition at line 456 of file eda_base_frame.cpp.
References DIM, Format(), GetAssociatedDocument(), GetChars(), help_name(), SearchHelpFileFullPath(), and sys_search().
Referenced by add_search_paths(), and IsType().
|
inline |
Definition at line 363 of file eda_base_frame.h.
References AddMenuIconsOptions(), CheckForAutoSaveFile(), IsWritable(), m_mruPath, OnChangeIconsOptions(), PostCommandMenuEvent(), ReCreateMenuBar(), ShowChangedIcons(), and ShowChangedLanguage().
Referenced by KICAD_MANAGER_FRAME::OnImportEagleFiles(), KICAD_MANAGER_FRAME::OnLoadProject(), and KICAD_MANAGER_FRAME::OnNewProject().
|
protectedvirtual |
Reimplemented in KICAD_MANAGER_FRAME.
Definition at line 396 of file eda_base_frame.cpp.
References KIFACE_I::GetHelpFileName(), and Kiface().
Referenced by GetKicadHelp(), and isAutoSaveRequired().
void EDA_BASE_FRAME::ImportHotkeyConfigFromFile | ( | EDA_HOTKEY_CONFIG * | aDescList, |
const wxString & | aDefaultShortname | ||
) |
Function ImportHotkeyConfigFromFile Prompt the user for an old hotkey file to read, and read it.
aDescList | = current hotkey list descr. to initialize. |
aDefaultShortname | = a default short name (extention not needed) like eechema, kicad... |
Definition at line 728 of file hotkeys_basic.cpp.
References DEFAULT_HOTKEY_FILENAME_EXT, and EDA_FILE_SELECTOR().
Referenced by KICAD_MANAGER_FRAME::Process_Config(), LIB_EDIT_FRAME::Process_Config(), SCH_EDIT_FRAME::Process_Config(), PL_EDITOR_FRAME::Process_Config(), PCB_EDIT_FRAME::Process_Config(), GERBVIEW_FRAME::Process_Config(), FOOTPRINT_EDIT_FRAME::ProcessPreferences(), and SaveProjectSettings().
|
inlineprotectedvirtual |
Function autoSaveRequired returns the auto save status of the application.
Override this function if your derived frame supports automatic file saving.
Reimplemented in PCB_EDIT_FRAME, and SCH_EDIT_FRAME.
Definition at line 175 of file eda_base_frame.h.
References config(), doAutoSave(), EDA_BASE_FRAME(), help_name(), ProcessEvent(), SetAutoSaveInterval(), sys_search(), and ~EDA_BASE_FRAME().
Referenced by ProcessEvent().
|
inline |
Definition at line 221 of file eda_base_frame.h.
References GetKicadAbout(), GetKicadContribute(), GetKicadHelp(), LoadSettings(), PrintMsg(), and SaveSettings().
Referenced by BOARD_COMMIT::BOARD_COMMIT(), LIB_PIN::drawGraphic(), BOARD_PRINTOUT_CONTROLLER::DrawPage(), DIALOG_EDIT_ONE_FIELD::init(), DIALOG_PAD_PROPERTIES::initValues(), PCB_LAYER_WIDGET::OnRenderEnable(), PCBNEW_CONTROL::PasteItemsFromClipboard(), PCB_BASE_FRAME::PlaceTexteModule(), and PCB_BASE_FRAME::RotateTextModule().
bool EDA_BASE_FRAME::IsWritable | ( | const wxFileName & | aFileName | ) |
Function IsWritable checks if aFileName can be written.
The function performs a number of tests on aFileName to verify that it can be saved. If aFileName defines a path with no file name, them the path is tested for user write permission. If aFileName defines a file name that does not exist in the path, the path is tested for user write permission. If aFileName defines a file that already exits, the file name is tested for user write permissions.
aFileName | The full path and/or file name of the file to test. |
Definition at line 554 of file eda_base_frame.cpp.
References GetChars().
Referenced by SCH_EDIT_FRAME::doAutoSave(), GetMruPath(), SCH_EDIT_FRAME::SaveEEFile(), LIB_EDIT_FRAME::saveLibrary(), PCB_EDIT_FRAME::SavePcbCopy(), PCB_EDIT_FRAME::SavePcbFile(), CVPCB_MAINFRAME::SaveProjectFile(), and SCH_EDIT_FRAME::SaveProjectSettings().
|
virtual |
Function LoadSettings loads common frame parameters from a configuration file.
Don't forget to call the base method or your frames won't remember their positions and sizes.
Reimplemented in EDA_DRAW_FRAME, PCB_BASE_FRAME, GERBVIEW_FRAME, PCB_EDIT_FRAME, LIB_EDIT_FRAME, SCH_EDIT_FRAME, KICAD_MANAGER_FRAME, CVPCB_MAINFRAME, PL_EDITOR_FRAME, EDA_3D_VIEWER, FOOTPRINT_WIZARD_FRAME, SIM_PLOT_FRAME, FOOTPRINT_VIEWER_FRAME, LIB_VIEW_FRAME, and FOOTPRINT_EDIT_FRAME.
Definition at line 276 of file eda_base_frame.cpp.
References ConfigBaseName(), DEFAULT_AUTO_SAVE_INTERVAL, entryAutoSaveInterval, entryMaximized, entryMruPath, entryPerspective, entryPosX, entryPosY, entrySizeX, entrySizeY, m_autoSaveInterval, m_FramePos, m_FrameSize, m_hasAutoSave, m_mruPath, m_perspective, wxPoint::x, and wxPoint::y.
Referenced by IsType(), SIM_PLOT_FRAME::LoadSettings(), EDA_3D_VIEWER::LoadSettings(), CVPCB_MAINFRAME::LoadSettings(), KICAD_MANAGER_FRAME::LoadSettings(), and EDA_DRAW_FRAME::LoadSettings().
|
protected |
Function onAutoSaveTimer handles the auto save timer event.
Definition at line 244 of file eda_base_frame.cpp.
References doAutoSave(), m_autoSaveInterval, and m_autoSaveTimer.
Referenced by EDA_BASE_FRAME().
|
virtual |
Function OnChangeIconsOptions Selects the current icons options in menus (or toolbars) in Kicad (the default for toolbars/menus is 26x26 pixels, and shows icons in menus).
Reimplemented in KIWAY_PLAYER, and KICAD_MANAGER_FRAME.
Definition at line 682 of file eda_base_frame.cpp.
References ID_KICAD_SELECT_ICONS_IN_MENUS, Pgm(), ReCreateMenuBar(), and PGM_BASE::SetUseIconsInMenus().
Referenced by GetMruPath(), KICAD_MANAGER_FRAME::OnChangeIconsOptions(), and KIWAY_PLAYER::OnChangeIconsOptions().
|
virtual |
Function OnSelectPreferredEditor Open a dialog to select the editor that will used in KiCad to edit or display files (reports ...
) The full filename editor is saved in configuration (global params)
Definition at line 517 of file eda_base_frame.cpp.
References PGM_BASE::AskUserForPreferredEditor(), PGM_BASE::GetEditorName(), Pgm(), and PGM_BASE::SetEditorName().
Referenced by SaveProjectSettings().
bool EDA_BASE_FRAME::PostCommandMenuEvent | ( | int | evt_type | ) |
Function PostCommandMenuEvent.
Post a menu event to the frame, which can be used to trigger actions bound to menu items.
Definition at line 667 of file eda_base_frame.cpp.
Referenced by GetMruPath(), FOOTPRINT_EDIT_FRAME::OnHotKey(), FOOTPRINT_EDIT_FRAME::OnHotkeyDeleteItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyDuplicateItem(), PCB_EDIT_FRAME::OnHotkeyDuplicateOrArrayItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyEditItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyMoveItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyMoveItemExact(), and FOOTPRINT_EDIT_FRAME::OnHotkeyRotateItem().
void EDA_BASE_FRAME::PrintMsg | ( | const wxString & | text | ) |
Definition at line 402 of file eda_base_frame.cpp.
Referenced by IsType().
|
override |
Function ProcessEvent overrides the default process event handler to implement the auto save feature.
Definition at line 186 of file eda_base_frame.cpp.
References findQuasiModalDialog(), isAutoSaveRequired(), m_autoSaveInterval, m_autoSaveState, m_autoSaveTimer, m_hasAutoSave, and traceAutoSave.
Referenced by isAutoSaveRequired(), LIB_VIEW_FRAME::onSelectNextSymbol(), LIB_VIEW_FRAME::onSelectPreviousSymbol(), KIWAY::ProcessEvent(), LIB_VIEW_FRAME::ReCreateListCmp(), GERBVIEW_CONTROL::SwitchUnits(), and PCBNEW_CONTROL::SwitchUnits().
int EDA_BASE_FRAME::ReadHotkeyConfig | ( | struct EDA_HOTKEY_CONFIG * | aDescList | ) |
Function ReadHotkeyConfig Read configuration data and fill the current hotkey list with hotkeys.
aDescList | = current hotkey list descr. to initialize. |
Definition at line 649 of file hotkeys_basic.cpp.
References ReadHotkeyConfig().
Referenced by SaveProjectSettings().
int EDA_BASE_FRAME::ReadHotkeyConfigFile | ( | const wxString & | aFilename, |
struct EDA_HOTKEY_CONFIG * | aDescList | ||
) |
Function ReadHotkeyConfigFile Read an old configuration file (<file>.key) and fill the current hotkey list with hotkeys.
aFilename | = file name to read. |
aDescList | = current hotkey list descr. to initialize. |
Definition at line 594 of file hotkeys_basic.cpp.
References DEFAULT_HOTKEY_FILENAME_EXT, and ParseHotkeyConfig().
Referenced by SaveProjectSettings().
|
virtual |
Function ReCreateMenuBar Creates recreates the menu bar.
Needed when the language is changed
Reimplemented in PCB_EDIT_FRAME, EDA_DRAW_FRAME, SCH_EDIT_FRAME, GERBVIEW_FRAME, LIB_EDIT_FRAME, KICAD_MANAGER_FRAME, PCB_BASE_FRAME, PL_EDITOR_FRAME, FOOTPRINT_EDIT_FRAME, CVPCB_MAINFRAME, FOOTPRINT_VIEWER_FRAME, and LIB_VIEW_FRAME.
Definition at line 257 of file eda_base_frame.cpp.
Referenced by GetMruPath(), InstallHotkeyFrame(), OnChangeIconsOptions(), ShowChangedIcons(), and ShowChangedLanguage().
|
private |
Removes border from wxAui panes.
Definition at line 160 of file eda_base_frame.cpp.
Referenced by EDA_BASE_FRAME().
|
inlinevirtual |
Function SaveProjectSettings saves changes to the project settings to the project (.pro) file.
The method is virtual so you can override it to call the suitable save method. The base method do nothing
aAskForSave | = true to open a dialog before saving the settings |
Reimplemented in PCB_EDIT_FRAME, and SCH_EDIT_FRAME.
Definition at line 274 of file eda_base_frame.h.
References ExportHotkeyConfigToFile(), GetFileFromHistory(), ImportHotkeyConfigFromFile(), OnSelectPreferredEditor(), ReadHotkeyConfig(), ReadHotkeyConfigFile(), UpdateFileHistory(), and WriteHotkeyConfig().
Referenced by DIALOG_PAGES_SETTINGS::OnOkClick(), SCH_EDIT_FRAME::OnPreferencesOptions(), and SCH_EDIT_FRAME::Process_Config().
|
virtual |
Function SaveSettings saves common frame parameters to a configuration data file.
Don't forget to call the base class's SaveSettings() from your derived SaveSettings() otherwise the frames won't remember their positions and sizes.
Reimplemented in EDA_DRAW_FRAME, PCB_BASE_FRAME, GERBVIEW_FRAME, PCB_EDIT_FRAME, LIB_EDIT_FRAME, SCH_EDIT_FRAME, KICAD_MANAGER_FRAME, CVPCB_MAINFRAME, PL_EDITOR_FRAME, EDA_3D_VIEWER, FOOTPRINT_WIZARD_FRAME, SIM_PLOT_FRAME, FOOTPRINT_VIEWER_FRAME, LIB_VIEW_FRAME, and FOOTPRINT_EDIT_FRAME.
Definition at line 336 of file eda_base_frame.cpp.
References ConfigBaseName(), entryAutoSaveInterval, entryMruPath, entryPerspective, m_auimgr, m_autoSaveInterval, m_FramePos, m_FrameSize, m_hasAutoSave, m_mruPath, wxPoint::x, and wxPoint::y.
Referenced by IsType(), SIM_PLOT_FRAME::SaveSettings(), EDA_3D_VIEWER::SaveSettings(), CVPCB_MAINFRAME::SaveSettings(), KICAD_MANAGER_FRAME::SaveSettings(), EDA_DRAW_FRAME::SaveSettings(), and windowClosing().
void EDA_BASE_FRAME::SetAutoSaveInterval | ( | int | aInterval | ) |
Definition at line 225 of file eda_base_frame.cpp.
References m_autoSaveInterval, m_autoSaveState, and m_autoSaveTimer.
Referenced by isAutoSaveRequired(), DIALOG_GENERALOPTIONS::OnOkClick(), and SCH_EDIT_FRAME::OnPreferencesOptions().
|
inlinevirtual |
Function SetIconScale.
Modify the scale of icons in the window; should refresh them and save the setting.
Reimplemented in PCB_EDIT_FRAME, SCH_EDIT_FRAME, GERBVIEW_FRAME, and LIB_EDIT_FRAME.
Definition at line 460 of file eda_base_frame.h.
|
inline |
Definition at line 361 of file eda_base_frame.h.
Referenced by KICAD_MANAGER_FRAME::LoadProject().
|
virtual |
Function ShowChangedIcons redraws items menus after a icon was changed option.
Definition at line 269 of file eda_base_frame.cpp.
References ReCreateMenuBar().
Referenced by GetMruPath(), and KIWAY::ShowChangedIcons().
|
virtual |
Function ShowChangedLanguage redraws the menus and what not in current language.
Reimplemented in PCB_EDIT_FRAME, GERBVIEW_FRAME, PCB_BASE_FRAME, and CVPCB_MAINFRAME.
Definition at line 262 of file eda_base_frame.cpp.
References ReCreateMenuBar().
Referenced by GetMruPath(), KIWAY::SetLanguage(), CVPCB_MAINFRAME::ShowChangedLanguage(), PCB_BASE_FRAME::ShowChangedLanguage(), and GERBVIEW_FRAME::ShowChangedLanguage().
|
protectedvirtual |
Function sys_search returns a SEARCH_STACK pertaining to entire program, and is overloaded in KICAD_MANAGER_FRAME.
Reimplemented in KICAD_MANAGER_FRAME.
Definition at line 390 of file eda_base_frame.cpp.
References Kiface(), and KIFACE_I::KifaceSearch().
Referenced by GetKicadHelp(), and isAutoSaveRequired().
void EDA_BASE_FRAME::UpdateFileHistory | ( | const wxString & | FullFileName, |
wxFileHistory * | aFileHistory = NULL |
||
) |
Function UpdateFileHistory Updates the list of recently opened files.
Note also the menu is updated, if wxFileHistory::UseMenu was called at init time
FullFileName | The full file name including the path. |
aFileHistory | The wxFileHistory in use. If NULL, the main application file history is used. |
Definition at line 408 of file eda_base_frame.cpp.
References KIFACE_I::GetFileHistory(), and Kiface().
Referenced by SCH_EDIT_FRAME::importFile(), GERBVIEW_FRAME::LoadExcellonFiles(), GERBVIEW_FRAME::loadListOfGerberFiles(), PL_EDITOR_FRAME::LoadPageLayoutDescrFile(), KICAD_MANAGER_FRAME::LoadProject(), KICAD_MANAGER_FRAME::OnCloseWindow(), SCH_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::SavePcbFile(), SaveProjectSettings(), and GERBVIEW_FRAME::unarchiveFiles().
|
private |
Function windowClosing (with its unexpected name so it does not collide with the real OnWindowClose() function provided in derived classes) is called just before a window closing, and is used to call a derivation specific SaveSettings().
SaveSettings() is called for all derived wxFrames in this base class overload. (Calling it from a destructor is deprecated since the wxFrame's position is not available in the destructor on linux.) In other words, you should not need to call SaveSettings() anywhere, except in this one function found only in this class.
Definition at line 136 of file eda_base_frame.cpp.
References config(), findQuasiModalDialog(), and SaveSettings().
Referenced by EDA_BASE_FRAME().
|
virtual |
Function WriteHotkeyConfig Store the current hotkey list It is stored using the standard wxConfig mechanism or a file.
aDescList | = pointer to the current hotkey list. |
aFullFileName | = a wxString pointer to a full file name. if NULL, use the standard wxConfig mechanism (default) the output format is: shortcut "key" "function" lines starting with # are comments |
Reimplemented in EDA_DRAW_FRAME.
Definition at line 528 of file hotkeys_basic.cpp.
References AddDelimiterString(), DEFAULT_HOTKEY_FILENAME_EXT, GetChars(), GetNewConfig(), HOTKEYS_CONFIG_KEY, KeyNameFromKeyCode(), EDA_HOTKEY_CONFIG::m_HK_InfoList, EDA_HOTKEY::m_InfoMsg, EDA_HOTKEY::m_KeyCode, EDA_HOTKEY_CONFIG::m_SectionTag, EDA_HOTKEY_CONFIG::m_Title, and TO_UTF8.
Referenced by SaveProjectSettings(), HOTKEYS_EDITOR_DIALOG::TransferDataFromWindow(), and EDA_DRAW_FRAME::WriteHotkeyConfig().
|
staticprotected |
Default style flags used for wxAUI toolbars
Definition at line 162 of file eda_base_frame.h.
Referenced by FOOTPRINT_EDIT_FRAME::ReCreateAuxiliaryToolbar(), GERBVIEW_FRAME::ReCreateAuxiliaryToolbar(), PCB_EDIT_FRAME::ReCreateAuxiliaryToolbar(), KICAD_MANAGER_FRAME::RecreateBaseHToolbar(), DISPLAY_FOOTPRINTS_FRAME::ReCreateHToolbar(), LIB_VIEW_FRAME::ReCreateHToolbar(), FOOTPRINT_EDIT_FRAME::ReCreateHToolbar(), FOOTPRINT_VIEWER_FRAME::ReCreateHToolbar(), PL_EDITOR_FRAME::ReCreateHToolbar(), CVPCB_MAINFRAME::ReCreateHToolbar(), FOOTPRINT_WIZARD_FRAME::ReCreateHToolbar(), GERBVIEW_FRAME::ReCreateHToolbar(), SCH_EDIT_FRAME::ReCreateHToolbar(), LIB_EDIT_FRAME::ReCreateHToolbar(), PCB_EDIT_FRAME::ReCreateHToolbar(), EDA_3D_VIEWER::ReCreateMainToolbar(), PCB_EDIT_FRAME::ReCreateMicrowaveVToolbar(), DISPLAY_FOOTPRINTS_FRAME::ReCreateOptToolbar(), FOOTPRINT_EDIT_FRAME::ReCreateOptToolbar(), GERBVIEW_FRAME::ReCreateOptToolbar(), SCH_EDIT_FRAME::ReCreateOptToolbar(), LIB_EDIT_FRAME::ReCreateOptToolbar(), PCB_EDIT_FRAME::ReCreateOptToolbar(), FOOTPRINT_EDIT_FRAME::ReCreateVToolbar(), PL_EDITOR_FRAME::ReCreateVToolbar(), GERBVIEW_FRAME::ReCreateVToolbar(), SCH_EDIT_FRAME::ReCreateVToolbar(), LIB_EDIT_FRAME::ReCreateVToolbar(), and PCB_EDIT_FRAME::ReCreateVToolbar().
|
protected |
Name of program displayed in About.
Definition at line 141 of file eda_base_frame.h.
|
protected |
Definition at line 143 of file eda_base_frame.h.
Referenced by CVPCB_MAINFRAME::CVPCB_MAINFRAME(), GERBVIEW_FRAME::GERBVIEW_FRAME(), LIB_EDIT_FRAME::IsSearchTreeShown(), KICAD_MANAGER_FRAME::KICAD_MANAGER_FRAME(), LIB_EDIT_FRAME::LIB_EDIT_FRAME(), LIB_VIEW_FRAME::LIB_VIEW_FRAME(), PCB_EDIT_FRAME::OnSelectOptionToolbar(), LIB_VIEW_FRAME::OnSize(), FOOTPRINT_VIEWER_FRAME::OnSize(), FOOTPRINT_WIZARD_FRAME::OnSize(), KICAD_MANAGER_FRAME::OnSize(), LIB_EDIT_FRAME::OnToggleSearchTree(), GERBVIEW_FRAME::OnToggleShowLayerManager(), PCB_EDIT_FRAME::OnUpdateShowLayerManager(), PCB_EDIT_FRAME::OnUpdateShowMicrowaveToolbar(), PL_EDITOR_FRAME::PL_EDITOR_FRAME(), PCB_EDIT_FRAME::ReCreateAuxiliaryToolbar(), PCB_EDIT_FRAME::ReCreateLayerBox(), GERBVIEW_FRAME::ReFillLayerWidget(), CVPCB_MAINFRAME::refreshAfterComponentSearch(), removePaneBorder(), SaveSettings(), GERBVIEW_FRAME::ShowChangedLanguage(), GERBVIEW_FRAME::updateDCodeSelectBox(), GERBVIEW_FRAME::UpdateTitleAndInfo(), EDA_DRAW_FRAME::UseGalCanvas(), CVPCB_MAINFRAME::~CVPCB_MAINFRAME(), EDA_3D_VIEWER::~EDA_3D_VIEWER(), EDA_DRAW_FRAME::~EDA_DRAW_FRAME(), and KICAD_MANAGER_FRAME::~KICAD_MANAGER_FRAME().
|
protected |
The auto save interval time in seconds.
Definition at line 152 of file eda_base_frame.h.
Referenced by EDA_BASE_FRAME(), GetAutoSaveInterval(), LoadSettings(), onAutoSaveTimer(), ProcessEvent(), SaveSettings(), and SetAutoSaveInterval().
|
protected |
Flag to indicate the last auto save state.
Definition at line 149 of file eda_base_frame.h.
Referenced by SCH_EDIT_FRAME::doAutoSave(), PCB_EDIT_FRAME::doAutoSave(), EDA_BASE_FRAME(), ProcessEvent(), and SetAutoSaveInterval().
|
protected |
The timer used to implement the auto save feature;.
Definition at line 155 of file eda_base_frame.h.
Referenced by EDA_BASE_FRAME(), onAutoSaveTimer(), ProcessEvent(), SetAutoSaveInterval(), and ~EDA_BASE_FRAME().
|
protected |
prefix used in config to identify some params (frame size...) if empty, the frame name defined in CTOR is used
Definition at line 136 of file eda_base_frame.h.
Referenced by ConfigBaseName(), and LIB_VIEW_FRAME::LIB_VIEW_FRAME().
|
protected |
Definition at line 133 of file eda_base_frame.h.
Referenced by CVPCB_MAINFRAME::CVPCB_MAINFRAME(), EDA_BASE_FRAME(), GERBVIEW_FRAME::GERBVIEW_FRAME(), KICAD_MANAGER_FRAME::KICAD_MANAGER_FRAME(), LIB_EDIT_FRAME::LIB_EDIT_FRAME(), LIB_VIEW_FRAME::LIB_VIEW_FRAME(), SIM_PLOT_FRAME::LoadSettings(), LoadSettings(), KICAD_MANAGER_FRAME::OnCloseWindow(), PL_EDITOR_FRAME::PL_EDITOR_FRAME(), and SaveSettings().
|
protected |
Definition at line 134 of file eda_base_frame.h.
Referenced by CVPCB_MAINFRAME::CVPCB_MAINFRAME(), EDA_BASE_FRAME(), GERBVIEW_FRAME::GERBVIEW_FRAME(), KICAD_MANAGER_FRAME::KICAD_MANAGER_FRAME(), LIB_EDIT_FRAME::LIB_EDIT_FRAME(), LIB_VIEW_FRAME::LIB_VIEW_FRAME(), LIB_VIEW_FRAME::LoadSettings(), SIM_PLOT_FRAME::LoadSettings(), FOOTPRINT_WIZARD_FRAME::LoadSettings(), CVPCB_MAINFRAME::LoadSettings(), LoadSettings(), KICAD_MANAGER_FRAME::OnCloseWindow(), EDA_DRAW_FRAME::OnSize(), PL_EDITOR_FRAME::PL_EDITOR_FRAME(), and SaveSettings().
|
protected |
Flag to indicate if this frame supports auto save.
Definition at line 146 of file eda_base_frame.h.
Referenced by EDA_BASE_FRAME(), LoadSettings(), ProcessEvent(), and SaveSettings().
|
protected |
Id Type (pcb, schematic, library..)
Definition at line 132 of file eda_base_frame.h.
Referenced by EDA_BASE_FRAME(), and findQuasiModalDialog().
|
protected |
Standard horizontal Toolbar.
Definition at line 139 of file eda_base_frame.h.
Referenced by PCB_EDIT_FRAME::createPopUpMenuForFpPads(), EDA_BASE_FRAME(), GERBVIEW_FRAME::GERBVIEW_FRAME(), EDA_DRAW_FRAME::GetToolbarTool(), EDA_DRAW_FRAME::GetToolToggled(), KICAD_MANAGER_FRAME::KICAD_MANAGER_FRAME(), LIB_EDIT_FRAME::LIB_EDIT_FRAME(), LIB_VIEW_FRAME::LIB_VIEW_FRAME(), FOOTPRINT_VIEWER_FRAME::OnCloseWindow(), PCB_EDIT_FRAME::OnPlaceOrRouteFootprints(), PCB_EDIT_FRAME::OnRightClick(), LIB_EDIT_FRAME::OnUpdateDeMorganConvert(), LIB_EDIT_FRAME::OnUpdateDeMorganNormal(), FOOTPRINT_EDIT_FRAME::OnUpdateSelectTool(), LIB_EDIT_FRAME::OnUpdateSelectTool(), SCH_EDIT_FRAME::OnUpdateSelectTool(), PCB_EDIT_FRAME::OnUpdateVerticalToolbar(), PCB_BASE_FRAME::PcbGeneralLocateAndDisplay(), PL_EDITOR_FRAME::PL_EDITOR_FRAME(), PCB_EDIT_FRAME::PrepareLayerIndicator(), LIB_EDIT_FRAME::Process_Special_Functions(), KICAD_MANAGER_FRAME::RecreateBaseHToolbar(), DISPLAY_FOOTPRINTS_FRAME::ReCreateHToolbar(), LIB_VIEW_FRAME::ReCreateHToolbar(), FOOTPRINT_EDIT_FRAME::ReCreateHToolbar(), FOOTPRINT_VIEWER_FRAME::ReCreateHToolbar(), PL_EDITOR_FRAME::ReCreateHToolbar(), FOOTPRINT_WIZARD_FRAME::ReCreateHToolbar(), GERBVIEW_FRAME::ReCreateHToolbar(), SCH_EDIT_FRAME::ReCreateHToolbar(), LIB_EDIT_FRAME::ReCreateHToolbar(), PCB_EDIT_FRAME::ReCreateHToolbar(), PCB_EDIT_FRAME::ReCreateLayerBox(), EDA_3D_VIEWER::ReCreateMainToolbar(), GERBVIEW_FRAME::ReCreateOptToolbar(), GERBVIEW_FRAME::ReCreateVToolbar(), SCH_EDIT_FRAME::RedrawActiveWindow(), and EDA_3D_VIEWER::RenderEngineChanged().
|
protected |
Most recently used path.
Definition at line 159 of file eda_base_frame.h.
Referenced by EDA_BASE_FRAME(), FOOTPRINT_EDIT_FRAME::Export_Module(), GetMruPath(), FOOTPRINT_EDIT_FRAME::Import_Module(), GERBVIEW_FRAME::LoadExcellonFiles(), GERBVIEW_FRAME::LoadGerberFiles(), LoadSettings(), GERBVIEW_FRAME::LoadZipArchiveFile(), LIB_EDIT_FRAME::OnExportPart(), LIB_EDIT_FRAME::OnImportPart(), GERBVIEW_FRAME::OpenProjectFiles(), and SaveSettings().
|
protected |
wxAuiManager perspective.
Definition at line 157 of file eda_base_frame.h.
Referenced by LoadSettings().