KiCad PCB EDA Suite
SIM_PLOT_FRAME_BASE Class Reference

Class SIM_PLOT_FRAME_BASE. More...

#include <sim_plot_frame_base.h>

Inheritance diagram for SIM_PLOT_FRAME_BASE:
KIWAY_PLAYER EDA_BASE_FRAME KIWAY_HOLDER SIM_PLOT_FRAME

Public Member Functions

 SIM_PLOT_FRAME_BASE (wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Spice Simulator"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(511, 468), long style=wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL, const wxString &name=wxT("SIM_PLOT_FRAME"))
 
 ~SIM_PLOT_FRAME_BASE ()
 
void m_splitterLeftRightOnIdle (wxIdleEvent &)
 
void m_splitterPlotAndConsoleOnIdle (wxIdleEvent &)
 
void m_splitterSignalsOnIdle (wxIdleEvent &)
 
void m_splitterTuneValuesOnIdle (wxIdleEvent &)
 
VTBL_ENTRY bool OpenProjectFiles (const std::vector< wxString > &aFileList, int aCtl=0)
 Function OpenProjectFiles is abstract, and opens a project or set of files given by aFileList. More...
 
VTBL_ENTRY bool ShowModal (wxString *aResult=NULL, wxWindow *aResultantFocusWindow=NULL)
 Function ShowModal puts up this wxFrame as if it were a modal dialog, with all other instantiated wxFrames disabled until this KIWAY_PLAYER derivative calls DismissModal(). More...
 
virtual void KiwayMailIn (KIWAY_EXPRESS &aEvent)
 Function KiwayMailIn receives KIWAY_EXPRESS messages from other players. More...
 
bool Destroy () override
 Our version of Destroy() which is virtual from wxWidgets. More...
 
bool ProcessEvent (wxEvent &aEvent) override
 Override 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)
 
bool ShowPreferences (EDA_HOTKEY_CONFIG *aHotkeys, EDA_HOTKEY_CONFIG *aShowHotkeys, const wxString &aHotkeysNickname)
 
void PrintMsg (const wxString &text)
 
virtual void InstallPreferences (PAGED_DIALOG *aParent)
 Allow a frame to load its preference panels (if any) into the preferences dialog. More...
 
virtual void LoadSettings (wxConfigBase *aCfg)
 Load common frame parameters from a configuration file. More...
 
virtual void SaveSettings (wxConfigBase *aCfg)
 Saves common frame parameters to a configuration data file. More...
 
wxString ConfigBaseName ()
 
virtual void SaveProjectSettings (bool aAskForSave)
 Save changes to the project settings to the project (.pro) file. More...
 
virtual int WriteHotkeyConfig (struct EDA_HOTKEY_CONFIG *aDescList, wxString *aFullFileName=NULL)
 Store the current hotkey list. More...
 
void ImportHotkeyConfigFromFile (EDA_HOTKEY_CONFIG *aDescList, const wxString &aDefaultShortname)
 Prompt the user for an old hotkey file to read, and read it. More...
 
void ExportHotkeyConfigToFile (EDA_HOTKEY_CONFIG *aDescList, const wxString &aDefaultShortname)
 Prompt the user for an old hotkey file to read, and read it. More...
 
wxString GetFileFromHistory (int cmdId, const wxString &type, wxFileHistory *aFileHistory=NULL)
 Fetches the file name from the file history list. More...
 
void UpdateFileHistory (const wxString &FullFileName, wxFileHistory *aFileHistory=NULL)
 Update the list of recently opened files. More...
 
void SetMruPath (const wxString &aPath)
 
wxString GetMruPath () const
 
virtual void ReCreateMenuBar ()
 Recreates the menu bar. More...
 
bool IsWritable (const wxFileName &aFileName)
 Checks if aFileName can be written. More...
 
void CheckForAutoSaveFile (const wxFileName &aFileName)
 Check if an auto save file exists for aFileName and takes the appropriate action depending on the user input. More...
 
virtual void ShowChangedLanguage ()
 Redraw the menus and what not in current language. More...
 
virtual void CommonSettingsChanged ()
 Notification event that some of the common (suite-wide) settings have changed. More...
 
bool PostCommandMenuEvent (int evt_type)
 Post a menu event to the frame, which can be used to trigger actions bound to menu items. More...
 
const wxString & GetAboutTitle () const
 
KIWAYKiway () const
 Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in. More...
 
PROJECTPrj () const
 Function Prj returns a reference to the PROJECT "associated with" this KIWAY. More...
 
VTBL_ENTRY EDA_UNITS_T GetUserUnits () const
 Function GetUserUnits Allows participation in KEYWAY_PLAYER/DIALOG_SHIM userUnits inheritance. More...
 
VTBL_ENTRY TOOL_MANAGERGetToolManager () const
 Function GetToolManager Return the tool manager instance, if any. More...
 
void SetKiway (wxWindow *aDest, KIWAY *aKiway)
 Function SetKiway. More...
 

Protected Member Functions

virtual void menuNewPlot (wxCommandEvent &event)
 
virtual void menuOpenWorkbook (wxCommandEvent &event)
 
virtual void menuSaveWorkbook (wxCommandEvent &event)
 
virtual void menuSaveImage (wxCommandEvent &event)
 
virtual void menuSaveCsv (wxCommandEvent &event)
 
virtual void menuExit (wxCommandEvent &event)
 
virtual void menuZoomIn (wxCommandEvent &event)
 
virtual void menuZoomOut (wxCommandEvent &event)
 
virtual void menuZoomFit (wxCommandEvent &event)
 
virtual void menuShowGrid (wxCommandEvent &event)
 
virtual void menuShowGridUpdate (wxUpdateUIEvent &event)
 
virtual void menuShowLegend (wxCommandEvent &event)
 
virtual void menuShowLegendUpdate (wxUpdateUIEvent &event)
 
virtual void onPlotChanged (wxAuiNotebookEvent &event)
 
virtual void onPlotClose (wxAuiNotebookEvent &event)
 
virtual void onSignalDblClick (wxMouseEvent &event)
 
virtual void onSignalRClick (wxListEvent &event)
 
bool IsModal ()
 
void SetModal (bool aIsModal)
 
bool IsDismissed ()
 Function IsDismissed returns false only if both the frame is acting in modal mode and it has not been dismissed yet with DismissModal(). More...
 
void DismissModal (bool aRetVal, const wxString &aResult=wxEmptyString)
 
void kiway_express (KIWAY_EXPRESS &aEvent)
 event handler, routes to derivative specific virtual KiwayMailIn() More...
 
void language_change (wxCommandEvent &event)
 Function language_change is an event handler called on a language menu selection. More...
 
void onAutoSaveTimer (wxTimerEvent &aEvent)
 Handle the auto save timer event. More...
 
virtual bool isAutoSaveRequired () const
 Return the auto save status of the application. More...
 
virtual bool doAutoSave ()
 This should be overridden by the derived class to handle the auto save feature. More...
 
virtual wxConfigBase * config ()
 Return the wxConfigBase used in SaveSettings(). More...
 
virtual const SEARCH_STACKsys_search ()
 Return a SEARCH_STACK pertaining to entire program. More...
 
virtual wxString help_name ()
 

Static Protected Member Functions

static wxString GetBackupSuffix ()
 
static wxString GetAutoSaveFilePrefix ()
 

Protected Attributes

wxMenuBar * m_mainMenu
 
wxMenu * m_fileMenu
 
wxMenu * m_simulationMenu
 
wxMenuItem * m_runSimulation
 
wxMenuItem * m_addSignals
 
wxMenuItem * m_probeSignals
 
wxMenuItem * m_tuneValue
 
wxMenuItem * m_showNetlist
 
wxMenuItem * m_settings
 
wxMenu * m_viewMenu
 
wxBoxSizer * m_sizerMain
 
wxToolBar * m_toolBar
 
wxSplitterWindow * m_splitterLeftRight
 
wxPanel * m_panelLeft
 
wxBoxSizer * m_sizer11
 
wxSplitterWindow * m_splitterPlotAndConsole
 
wxPanel * m_plotPanel
 
wxBoxSizer * m_sizerPlot
 
wxAuiNotebook * m_plotNotebook
 
wxPanel * m_welcomePanel
 
wxBoxSizer * m_sizer8
 
wxStaticText * m_staticTextInfo
 
wxPanel * m_panelConsole
 
wxBoxSizer * m_sizerConsole
 
wxTextCtrl * m_simConsole
 
wxPanel * m_sidePanel
 
wxBoxSizer * m_sideSizer
 
wxSplitterWindow * m_splitterSignals
 
wxPanel * m_panelSignals
 
wxListView * m_signals
 
wxPanel * m_panelCursorsAndTune
 
wxSplitterWindow * m_splitterTuneValues
 
wxPanel * m_panelCursors
 
wxListCtrl * m_cursors
 
wxPanel * m_tunePanel
 
wxStaticBoxSizer * m_tuneSizerStb
 
wxBoxSizer * m_tuneSizer
 
bool m_modal
 
WX_EVENT_LOOPm_modal_loop
 
wxWindow * m_modal_resultant_parent
 
wxString m_modal_string
 
bool m_modal_ret_val
 
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...) 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
 

Default style flags used for wxAUI toolbars

More...
 

Detailed Description

Class SIM_PLOT_FRAME_BASE.

Definition at line 50 of file sim_plot_frame_base.h.

Constructor & Destructor Documentation

◆ SIM_PLOT_FRAME_BASE()

SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE ( wxWindow *  parent,
wxWindowID  id = wxID_ANY,
const wxString &  title = _("Spice Simulator"),
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxSize( 511,468 ),
long  style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL,
const wxString &  name = wxT("SIM_PLOT_FRAME") 
)

Definition at line 12 of file sim_plot_frame_base.cpp.

12  : KIWAY_PLAYER( parent, id, title, pos, size, style, name )
13 {
14  this->SetSizeHints( wxSize( 200,200 ), wxDefaultSize );
15 
16  m_mainMenu = new wxMenuBar( 0 );
17  m_fileMenu = new wxMenu();
18  wxMenuItem* m_newPlot;
19  m_newPlot = new wxMenuItem( m_fileMenu, wxID_NEW, wxString( _("New Plot") ) , wxEmptyString, wxITEM_NORMAL );
20  m_fileMenu->Append( m_newPlot );
21 
22  m_fileMenu->AppendSeparator();
23 
24  wxMenuItem* m_openWorkbook;
25  m_openWorkbook = new wxMenuItem( m_fileMenu, wxID_OPEN, wxString( _("Open Workbook") ) , wxEmptyString, wxITEM_NORMAL );
26  m_fileMenu->Append( m_openWorkbook );
27 
28  wxMenuItem* m_saveWorkbook;
29  m_saveWorkbook = new wxMenuItem( m_fileMenu, wxID_SAVE, wxString( _("Save Workbook") ) , wxEmptyString, wxITEM_NORMAL );
30  m_fileMenu->Append( m_saveWorkbook );
31 
32  m_fileMenu->AppendSeparator();
33 
34  wxMenuItem* m_saveImage;
35  m_saveImage = new wxMenuItem( m_fileMenu, ID_SAVE_AS_IMAGE, wxString( _("Save as Image") ) , wxEmptyString, wxITEM_NORMAL );
36  m_fileMenu->Append( m_saveImage );
37 
38  wxMenuItem* m_saveCsv;
39  m_saveCsv = new wxMenuItem( m_fileMenu, ID_SAVE_AS_CSV, wxString( _("Save as .csv File") ) , wxEmptyString, wxITEM_NORMAL );
40  m_fileMenu->Append( m_saveCsv );
41 
42  m_fileMenu->AppendSeparator();
43 
44  wxMenuItem* m_exitSim;
45  m_exitSim = new wxMenuItem( m_fileMenu, wxID_CLOSE, wxString( _("Exit Simulation") ) , wxEmptyString, wxITEM_NORMAL );
46  m_fileMenu->Append( m_exitSim );
47 
48  m_mainMenu->Append( m_fileMenu, _("File") );
49 
50  m_simulationMenu = new wxMenu();
51  m_runSimulation = new wxMenuItem( m_simulationMenu, ID_MENU_RUN_SIM, wxString( _("Run Simulation") ) , wxEmptyString, wxITEM_NORMAL );
53 
54  m_simulationMenu->AppendSeparator();
55 
56  m_addSignals = new wxMenuItem( m_simulationMenu, ID_MENU_ADD_SIGNAL, wxString( _("Add Signals...") ) , wxEmptyString, wxITEM_NORMAL );
57  m_simulationMenu->Append( m_addSignals );
58 
59  m_probeSignals = new wxMenuItem( m_simulationMenu, ID_MENU_PROBE_SIGNALS, wxString( _("Probe from schematics") ) , wxEmptyString, wxITEM_NORMAL );
61 
62  m_tuneValue = new wxMenuItem( m_simulationMenu, ID_MENU_TUNE_SIGNALS, wxString( _("Tune Component Value") ) , wxEmptyString, wxITEM_NORMAL );
63  m_simulationMenu->Append( m_tuneValue );
64 
65  m_simulationMenu->AppendSeparator();
66 
67  m_showNetlist = new wxMenuItem( m_simulationMenu, ID_MENU_SHOW_NETLIST, wxString( _("Show SPICE Netlist...") ) , _("Shows current simulation's netlist. Useful for debugging SPICE errors."), wxITEM_NORMAL );
69 
70  m_simulationMenu->AppendSeparator();
71 
72  m_settings = new wxMenuItem( m_simulationMenu, ID_MENU_SET_SIMUL, wxString( _("Settings...") ) , wxEmptyString, wxITEM_NORMAL );
73  m_simulationMenu->Append( m_settings );
74 
75  m_mainMenu->Append( m_simulationMenu, _("Simulation") );
76 
77  m_viewMenu = new wxMenu();
78  wxMenuItem* m_zoomIn;
79  m_zoomIn = new wxMenuItem( m_viewMenu, wxID_ZOOM_IN, wxString( _("Zoom In") ) , wxEmptyString, wxITEM_NORMAL );
80  m_viewMenu->Append( m_zoomIn );
81 
82  wxMenuItem* m_zoomOut;
83  m_zoomOut = new wxMenuItem( m_viewMenu, wxID_ZOOM_OUT, wxString( _("Zoom Out") ) , wxEmptyString, wxITEM_NORMAL );
84  m_viewMenu->Append( m_zoomOut );
85 
86  wxMenuItem* m_zoomFit;
87  m_zoomFit = new wxMenuItem( m_viewMenu, wxID_ZOOM_FIT, wxString( _("Fit on Screen") ) , wxEmptyString, wxITEM_NORMAL );
88  m_viewMenu->Append( m_zoomFit );
89 
90  m_viewMenu->AppendSeparator();
91 
92  wxMenuItem* m_showGrid;
93  m_showGrid = new wxMenuItem( m_viewMenu, ID_MENU_SHOW_GRID, wxString( _("Show &Grid") ) , wxEmptyString, wxITEM_CHECK );
94  m_viewMenu->Append( m_showGrid );
95 
96  wxMenuItem* m_showLegend;
97  m_showLegend = new wxMenuItem( m_viewMenu, ID_MENU_SHOW_LEGEND, wxString( _("Show &Legend") ) , wxEmptyString, wxITEM_CHECK );
98  m_viewMenu->Append( m_showLegend );
99 
100  m_mainMenu->Append( m_viewMenu, _("View") );
101 
102  this->SetMenuBar( m_mainMenu );
103 
104  m_sizerMain = new wxBoxSizer( wxVERTICAL );
105 
106  m_toolBar = new wxToolBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_FLAT|wxTB_HORIZONTAL|wxTB_TEXT );
107  m_toolBar->Realize();
108 
109  m_sizerMain->Add( m_toolBar, 0, wxEXPAND, 5 );
110 
111  m_splitterLeftRight = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D );
112  m_splitterLeftRight->SetSashGravity( 0.7 );
113  m_splitterLeftRight->Connect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterLeftRightOnIdle ), NULL, this );
114  m_splitterLeftRight->SetMinimumPaneSize( 50 );
115 
116  m_panelLeft = new wxPanel( m_splitterLeftRight, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
117  m_panelLeft->SetMinSize( wxSize( 300,-1 ) );
118 
119  m_sizer11 = new wxBoxSizer( wxVERTICAL );
120 
121  m_splitterPlotAndConsole = new wxSplitterWindow( m_panelLeft, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D );
122  m_splitterPlotAndConsole->SetSashGravity( 0.8 );
123  m_splitterPlotAndConsole->Connect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterPlotAndConsoleOnIdle ), NULL, this );
124  m_splitterPlotAndConsole->SetMinimumPaneSize( 50 );
125 
126  m_plotPanel = new wxPanel( m_splitterPlotAndConsole, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
127  m_plotPanel->SetMinSize( wxSize( -1,200 ) );
128 
129  m_sizerPlot = new wxBoxSizer( wxHORIZONTAL );
130 
131  m_plotNotebook = new wxAuiNotebook( m_plotPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_CLOSE_ON_ALL_TABS|wxAUI_NB_MIDDLE_CLICK_CLOSE|wxAUI_NB_TAB_MOVE|wxAUI_NB_TAB_SPLIT|wxAUI_NB_TOP );
132  m_welcomePanel = new wxPanel( m_plotNotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
133  m_sizer8 = new wxBoxSizer( wxVERTICAL );
134 
135 
136  m_sizer8->Add( 0, 0, 1, wxEXPAND, 5 );
137 
138  wxBoxSizer* bSizer81;
139  bSizer81 = new wxBoxSizer( wxHORIZONTAL );
140 
141 
142  bSizer81->Add( 0, 0, 1, wxEXPAND, 5 );
143 
144  m_staticTextInfo = new wxStaticText( m_welcomePanel, wxID_ANY, _("Start the simulation by clicking the Run Simulation button"), wxDefaultPosition, wxDefaultSize, 0 );
145  m_staticTextInfo->Wrap( -1 );
146  m_staticTextInfo->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
147  m_staticTextInfo->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) );
148 
149  bSizer81->Add( m_staticTextInfo, 0, wxALL|wxEXPAND, 5 );
150 
151 
152  bSizer81->Add( 0, 0, 1, wxEXPAND, 5 );
153 
154 
155  m_sizer8->Add( bSizer81, 0, wxEXPAND, 5 );
156 
157 
158  m_sizer8->Add( 0, 0, 1, wxEXPAND, 5 );
159 
160 
161  m_welcomePanel->SetSizer( m_sizer8 );
162  m_welcomePanel->Layout();
163  m_sizer8->Fit( m_welcomePanel );
164  m_plotNotebook->AddPage( m_welcomePanel, _("a page"), false, wxNullBitmap );
165 
166  m_sizerPlot->Add( m_plotNotebook, 1, wxEXPAND | wxALL, 5 );
167 
168 
169  m_plotPanel->SetSizer( m_sizerPlot );
170  m_plotPanel->Layout();
171  m_sizerPlot->Fit( m_plotPanel );
172  m_panelConsole = new wxPanel( m_splitterPlotAndConsole, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
173  m_panelConsole->SetMinSize( wxSize( -1,100 ) );
174 
175  m_sizerConsole = new wxBoxSizer( wxVERTICAL );
176 
177  m_simConsole = new wxTextCtrl( m_panelConsole, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_DONTWRAP|wxTE_MULTILINE|wxTE_READONLY );
178  m_simConsole->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
179 
180  m_sizerConsole->Add( m_simConsole, 1, wxALL|wxEXPAND, 5 );
181 
182 
183  m_panelConsole->SetSizer( m_sizerConsole );
184  m_panelConsole->Layout();
186  m_splitterPlotAndConsole->SplitHorizontally( m_plotPanel, m_panelConsole, 500 );
187  m_sizer11->Add( m_splitterPlotAndConsole, 1, wxEXPAND, 5 );
188 
189 
190  m_panelLeft->SetSizer( m_sizer11 );
191  m_panelLeft->Layout();
192  m_sizer11->Fit( m_panelLeft );
193  m_sidePanel = new wxPanel( m_splitterLeftRight, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
194  m_sidePanel->SetMinSize( wxSize( 200,-1 ) );
195 
196  m_sideSizer = new wxBoxSizer( wxVERTICAL );
197 
198  m_splitterSignals = new wxSplitterWindow( m_sidePanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D );
199  m_splitterSignals->SetSashGravity( 0.3 );
200  m_splitterSignals->Connect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterSignalsOnIdle ), NULL, this );
201  m_splitterSignals->SetMinimumPaneSize( 20 );
202 
203  m_panelSignals = new wxPanel( m_splitterSignals, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
204  m_panelSignals->SetMinSize( wxSize( -1,100 ) );
205 
206  wxStaticBoxSizer* sbSizer1;
207  sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( m_panelSignals, wxID_ANY, _("Signals") ), wxVERTICAL );
208 
209  m_signals = new wxListView( sbSizer1->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxLC_SINGLE_SEL );
210  sbSizer1->Add( m_signals, 1, wxALL|wxEXPAND, 5 );
211 
212 
213  m_panelSignals->SetSizer( sbSizer1 );
214  m_panelSignals->Layout();
215  sbSizer1->Fit( m_panelSignals );
216  m_panelCursorsAndTune = new wxPanel( m_splitterSignals, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
217  m_panelCursorsAndTune->SetMinSize( wxSize( -1,300 ) );
218 
219  wxBoxSizer* bSizer9;
220  bSizer9 = new wxBoxSizer( wxVERTICAL );
221 
222  m_splitterTuneValues = new wxSplitterWindow( m_panelCursorsAndTune, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D );
223  m_splitterTuneValues->SetSashGravity( 0.5 );
224  m_splitterTuneValues->Connect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterTuneValuesOnIdle ), NULL, this );
225  m_splitterTuneValues->SetMinimumPaneSize( 20 );
226 
227  m_panelCursors = new wxPanel( m_splitterTuneValues, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
228  m_panelCursors->SetMinSize( wxSize( -1,100 ) );
229 
230  wxStaticBoxSizer* sbSizer3;
231  sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( m_panelCursors, wxID_ANY, _("Cursors") ), wxVERTICAL );
232 
233  m_cursors = new wxListCtrl( sbSizer3->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL );
234  sbSizer3->Add( m_cursors, 1, wxALL|wxEXPAND, 5 );
235 
236 
237  m_panelCursors->SetSizer( sbSizer3 );
238  m_panelCursors->Layout();
239  sbSizer3->Fit( m_panelCursors );
240  m_tunePanel = new wxPanel( m_splitterTuneValues, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
241  m_tunePanel->SetMinSize( wxSize( -1,200 ) );
242 
243  m_tuneSizerStb = new wxStaticBoxSizer( new wxStaticBox( m_tunePanel, wxID_ANY, _("Tune") ), wxHORIZONTAL );
244 
245  m_tuneSizer = new wxBoxSizer( wxHORIZONTAL );
246 
247 
248  m_tuneSizerStb->Add( m_tuneSizer, 1, wxEXPAND, 5 );
249 
250 
251  m_tunePanel->SetSizer( m_tuneSizerStb );
252  m_tunePanel->Layout();
253  m_tuneSizerStb->Fit( m_tunePanel );
254  m_splitterTuneValues->SplitHorizontally( m_panelCursors, m_tunePanel, 0 );
255  bSizer9->Add( m_splitterTuneValues, 1, wxEXPAND, 5 );
256 
257 
258  m_panelCursorsAndTune->SetSizer( bSizer9 );
259  m_panelCursorsAndTune->Layout();
260  bSizer9->Fit( m_panelCursorsAndTune );
261  m_splitterSignals->SplitHorizontally( m_panelSignals, m_panelCursorsAndTune, 0 );
262  m_sideSizer->Add( m_splitterSignals, 1, wxEXPAND, 5 );
263 
264 
265  m_sidePanel->SetSizer( m_sideSizer );
266  m_sidePanel->Layout();
267  m_sideSizer->Fit( m_sidePanel );
268  m_splitterLeftRight->SplitVertically( m_panelLeft, m_sidePanel, 700 );
269  m_sizerMain->Add( m_splitterLeftRight, 1, wxEXPAND, 5 );
270 
271 
272  this->SetSizer( m_sizerMain );
273  this->Layout();
274 
275  this->Centre( wxBOTH );
276 
277  // Connect Events
278  m_fileMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuNewPlot ), this, m_newPlot->GetId());
279  m_fileMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuOpenWorkbook ), this, m_openWorkbook->GetId());
280  m_fileMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuSaveWorkbook ), this, m_saveWorkbook->GetId());
281  m_fileMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuSaveImage ), this, m_saveImage->GetId());
282  m_fileMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuSaveCsv ), this, m_saveCsv->GetId());
283  m_fileMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuExit ), this, m_exitSim->GetId());
284  m_viewMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuZoomIn ), this, m_zoomIn->GetId());
285  m_viewMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuZoomOut ), this, m_zoomOut->GetId());
286  m_viewMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuZoomFit ), this, m_zoomFit->GetId());
287  m_viewMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuShowGrid ), this, m_showGrid->GetId());
288  this->Connect( m_showGrid->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SIM_PLOT_FRAME_BASE::menuShowGridUpdate ) );
289  m_viewMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuShowLegend ), this, m_showLegend->GetId());
290  this->Connect( m_showLegend->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SIM_PLOT_FRAME_BASE::menuShowLegendUpdate ) );
291  m_plotNotebook->Connect( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED, wxAuiNotebookEventHandler( SIM_PLOT_FRAME_BASE::onPlotChanged ), NULL, this );
292  m_plotNotebook->Connect( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE, wxAuiNotebookEventHandler( SIM_PLOT_FRAME_BASE::onPlotClose ), NULL, this );
293  m_signals->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( SIM_PLOT_FRAME_BASE::onSignalDblClick ), NULL, this );
294  m_signals->Connect( wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, wxListEventHandler( SIM_PLOT_FRAME_BASE::onSignalRClick ), NULL, this );
295 }
#define ID_MENU_PROBE_SIGNALS
#define ID_SAVE_AS_IMAGE
wxSplitterWindow * m_splitterSignals
virtual void menuSaveWorkbook(wxCommandEvent &event)
KIWAY_PLAYER(KIWAY *aKiway, wxWindow *aParent, FRAME_T aFrameType, const wxString &aTitle, const wxPoint &aPos, const wxSize &aSize, long aStyle, const wxString &aWdoName=wxFrameNameStr)
virtual void menuShowLegendUpdate(wxUpdateUIEvent &event)
void m_splitterLeftRightOnIdle(wxIdleEvent &)
void m_splitterSignalsOnIdle(wxIdleEvent &)
virtual void onPlotChanged(wxAuiNotebookEvent &event)
virtual void menuShowGrid(wxCommandEvent &event)
virtual void menuZoomOut(wxCommandEvent &event)
#define ID_SAVE_AS_CSV
wxSplitterWindow * m_splitterTuneValues
wxStaticBoxSizer * m_tuneSizerStb
wxAuiNotebook * m_plotNotebook
virtual void menuSaveCsv(wxCommandEvent &event)
virtual void onSignalRClick(wxListEvent &event)
wxStaticText * m_staticTextInfo
virtual void menuShowLegend(wxCommandEvent &event)
#define ID_MENU_SHOW_NETLIST
virtual void onPlotClose(wxAuiNotebookEvent &event)
wxSplitterWindow * m_splitterLeftRight
wxMenuItem * m_runSimulation
#define ID_MENU_TUNE_SIGNALS
virtual void menuOpenWorkbook(wxCommandEvent &event)
virtual void menuZoomIn(wxCommandEvent &event)
void m_splitterPlotAndConsoleOnIdle(wxIdleEvent &)
#define ID_MENU_SHOW_LEGEND
virtual void onSignalDblClick(wxMouseEvent &event)
#define ID_MENU_SET_SIMUL
virtual void menuShowGridUpdate(wxUpdateUIEvent &event)
virtual void menuNewPlot(wxCommandEvent &event)
#define ID_MENU_ADD_SIGNAL
virtual void menuSaveImage(wxCommandEvent &event)
const char * name
Definition: DXF_plotter.cpp:61
#define ID_MENU_SHOW_GRID
void m_splitterTuneValuesOnIdle(wxIdleEvent &)
virtual void menuZoomFit(wxCommandEvent &event)
virtual void menuExit(wxCommandEvent &event)
wxSplitterWindow * m_splitterPlotAndConsole
#define ID_MENU_RUN_SIM

References ID_MENU_ADD_SIGNAL, ID_MENU_PROBE_SIGNALS, ID_MENU_RUN_SIM, ID_MENU_SET_SIMUL, ID_MENU_SHOW_GRID, ID_MENU_SHOW_LEGEND, ID_MENU_SHOW_NETLIST, ID_MENU_TUNE_SIGNALS, ID_SAVE_AS_CSV, ID_SAVE_AS_IMAGE, m_addSignals, m_cursors, m_fileMenu, m_mainMenu, m_panelConsole, m_panelCursors, m_panelCursorsAndTune, m_panelLeft, m_panelSignals, m_plotNotebook, m_plotPanel, m_probeSignals, m_runSimulation, m_settings, m_showNetlist, m_sidePanel, m_sideSizer, m_signals, m_simConsole, m_simulationMenu, m_sizer11, m_sizer8, m_sizerConsole, m_sizerMain, m_sizerPlot, m_splitterLeftRight, m_splitterLeftRightOnIdle(), m_splitterPlotAndConsole, m_splitterPlotAndConsoleOnIdle(), m_splitterSignals, m_splitterSignalsOnIdle(), m_splitterTuneValues, m_splitterTuneValuesOnIdle(), m_staticTextInfo, m_toolBar, m_tunePanel, m_tuneSizer, m_tuneSizerStb, m_tuneValue, m_viewMenu, m_welcomePanel, menuExit(), menuNewPlot(), menuOpenWorkbook(), menuSaveCsv(), menuSaveImage(), menuSaveWorkbook(), menuShowGrid(), menuShowGridUpdate(), menuShowLegend(), menuShowLegendUpdate(), menuZoomFit(), menuZoomIn(), menuZoomOut(), onPlotChanged(), onPlotClose(), onSignalDblClick(), and onSignalRClick().

◆ ~SIM_PLOT_FRAME_BASE()

SIM_PLOT_FRAME_BASE::~SIM_PLOT_FRAME_BASE ( )

Definition at line 297 of file sim_plot_frame_base.cpp.

298 {
299  // Disconnect Events
300  this->Disconnect( ID_MENU_SHOW_GRID, wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SIM_PLOT_FRAME_BASE::menuShowGridUpdate ) );
301  this->Disconnect( ID_MENU_SHOW_LEGEND, wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SIM_PLOT_FRAME_BASE::menuShowLegendUpdate ) );
302  m_plotNotebook->Disconnect( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED, wxAuiNotebookEventHandler( SIM_PLOT_FRAME_BASE::onPlotChanged ), NULL, this );
303  m_plotNotebook->Disconnect( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE, wxAuiNotebookEventHandler( SIM_PLOT_FRAME_BASE::onPlotClose ), NULL, this );
304  m_signals->Disconnect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( SIM_PLOT_FRAME_BASE::onSignalDblClick ), NULL, this );
305  m_signals->Disconnect( wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, wxListEventHandler( SIM_PLOT_FRAME_BASE::onSignalRClick ), NULL, this );
306 
307 }
virtual void menuShowLegendUpdate(wxUpdateUIEvent &event)
virtual void onPlotChanged(wxAuiNotebookEvent &event)
wxAuiNotebook * m_plotNotebook
virtual void onSignalRClick(wxListEvent &event)
virtual void onPlotClose(wxAuiNotebookEvent &event)
#define ID_MENU_SHOW_LEGEND
virtual void onSignalDblClick(wxMouseEvent &event)
virtual void menuShowGridUpdate(wxUpdateUIEvent &event)
#define ID_MENU_SHOW_GRID

References ID_MENU_SHOW_GRID, ID_MENU_SHOW_LEGEND, m_plotNotebook, m_signals, menuShowGridUpdate(), menuShowLegendUpdate(), onPlotChanged(), onPlotClose(), onSignalDblClick(), and onSignalRClick().

Member Function Documentation

◆ CheckForAutoSaveFile()

void EDA_BASE_FRAME::CheckForAutoSaveFile ( const wxFileName &  aFileName)
inherited

Check 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.

Parameters
aFileNameA wxFileName object containing the file name to check.

Definition at line 584 of file eda_base_frame.cpp.

585 {
586  wxCHECK_RET( aFileName.IsOk(), wxT( "Invalid file name!" ) );
587 
588  wxFileName autoSaveFileName = aFileName;
589 
590  // Check for auto save file.
591  autoSaveFileName.SetName( GetAutoSaveFilePrefix() + aFileName.GetName() );
592 
593  wxLogTrace( traceAutoSave,
594  wxT( "Checking for auto save file " ) + autoSaveFileName.GetFullPath() );
595 
596  if( !autoSaveFileName.FileExists() )
597  return;
598 
599  wxString msg = wxString::Format( _(
600  "Well this is potentially embarrassing!\n"
601  "It appears that the last time you were editing the file\n"
602  "\"%s\"\n"
603  "it was not saved properly. Do you wish to restore the last saved edits you made?" ),
604  GetChars( aFileName.GetFullName() )
605  );
606 
607  int response = wxMessageBox( msg, Pgm().App().GetAppName(), wxYES_NO | wxICON_QUESTION, this );
608 
609  // Make a backup of the current file, delete the file, and rename the auto save file to
610  // the file name.
611  if( response == wxYES )
612  {
613  // Get the backup file name.
614  wxFileName backupFileName = aFileName;
615  backupFileName.SetExt( aFileName.GetExt() + GetBackupSuffix() );
616 
617  // If an old backup file exists, delete it. If an old copy of the file exists, rename
618  // it to the backup file name
619  if( aFileName.FileExists() )
620  {
621  // Rename the old file to the backup file name.
622  if( !wxRenameFile( aFileName.GetFullPath(), backupFileName.GetFullPath(), true ) )
623  {
624  msg.Printf( _( "Could not create backup file \"%s\"" ),
625  GetChars( backupFileName.GetFullPath() ) );
626  wxMessageBox( msg );
627  }
628  }
629 
630  if( !wxRenameFile( autoSaveFileName.GetFullPath(), aFileName.GetFullPath() ) )
631  {
632  wxMessageBox( _( "The auto save file could not be renamed to the board file name." ),
633  Pgm().App().GetAppName(), wxOK | wxICON_EXCLAMATION, this );
634  }
635  }
636  else
637  {
638  wxLogTrace( traceAutoSave,
639  wxT( "Removing auto save file " ) + autoSaveFileName.GetFullPath() );
640 
641  // Remove the auto save file when using the previous file as is.
642  wxRemoveFile( autoSaveFileName.GetFullPath() );
643  }
644 }
const wxChar *const traceAutoSave
Flag to enable auto save feature debug tracing.
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:66
static wxString GetBackupSuffix()
static wxString GetAutoSaveFilePrefix()
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:100
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205

References Format(), EDA_BASE_FRAME::GetAutoSaveFilePrefix(), EDA_BASE_FRAME::GetBackupSuffix(), GetChars(), Pgm(), and traceAutoSave.

Referenced by SCH_EDIT_FRAME::OpenProjectFiles(), and PCB_EDIT_FRAME::OpenProjectFiles().

◆ CommonSettingsChanged()

void EDA_BASE_FRAME::CommonSettingsChanged ( )
virtualinherited

Notification event that some of the common (suite-wide) settings have changed.

Update menus, toolbars, local variables, etc.

Reimplemented in PCB_EDIT_FRAME, SCH_EDIT_FRAME, GERBVIEW_FRAME, PCB_BASE_FRAME, LIB_EDIT_FRAME, FOOTPRINT_EDIT_FRAME, KICAD_MANAGER_FRAME, EDA_DRAW_FRAME, and EDA_3D_VIEWER.

Definition at line 243 of file eda_base_frame.cpp.

244 {
245  if( GetMenuBar() )
246  {
247  // For icons in menus, icon scaling & hotkeys
248  ReCreateMenuBar();
249  GetMenuBar()->Refresh();
250  }
251 }
virtual void ReCreateMenuBar()
Recreates the menu bar.

References EDA_BASE_FRAME::ReCreateMenuBar().

Referenced by EDA_3D_VIEWER::CommonSettingsChanged(), EDA_DRAW_FRAME::CommonSettingsChanged(), and KIWAY::CommonSettingsChanged().

◆ config()

wxConfigBase * EDA_BASE_FRAME::config ( )
protectedvirtualinherited

Return the wxConfigBase used in SaveSettings().

This is overloaded in KICAD_MANAGER_FRAME

Reimplemented in KICAD_MANAGER_FRAME.

Definition at line 359 of file eda_base_frame.cpp.

360 {
361  // KICAD_MANAGER_FRAME overrides this
362  wxConfigBase* ret = Kiface().KifaceSettings();
363  //wxASSERT( ret );
364  return ret;
365 }
wxConfigBase * KifaceSettings() const
Definition: kiface_i.h:103
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52

References Kiface(), and KIFACE_I::KifaceSettings().

Referenced by CVPCB_MAINFRAME::CVPCB_MAINFRAME(), FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME(), GERBVIEW_FRAME::GERBVIEW_FRAME(), PCB_EDIT_FRAME::GetSettings(), 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 EDA_BASE_FRAME::windowClosing().

◆ ConfigBaseName()

wxString EDA_BASE_FRAME::ConfigBaseName ( )
inlineinherited
Returns
a base name prefix used in Load/Save settings to build the full name of keys used in config. This is usually the name of the frame set by CTOR, unless m_configFrameName contains a base name. this is the case of frames which can be shown in normal or modal mode. This is needed because we want only one base name prefix, regardless the mode used.

Definition at line 266 of file eda_base_frame.h.

267  {
268  wxString baseCfgName = m_configFrameName.IsEmpty() ? GetName() : m_configFrameName;
269  return baseCfgName;
270  }
wxString m_configFrameName
prefix used in config to identify some params (frame size...)

References EDA_BASE_FRAME::m_configFrameName.

Referenced by DISPLAY_FOOTPRINTS_FRAME::LoadSettings(), FOOTPRINT_VIEWER_FRAME::LoadSettings(), EDA_BASE_FRAME::LoadSettings(), EDA_DRAW_FRAME::LoadSettings(), DISPLAY_FOOTPRINTS_FRAME::SaveSettings(), FOOTPRINT_VIEWER_FRAME::SaveSettings(), EDA_BASE_FRAME::SaveSettings(), EDA_DRAW_FRAME::SaveSettings(), and EDA_BASE_FRAME::WriteHotkeyConfig().

◆ Destroy()

◆ DismissModal()

void KIWAY_PLAYER::DismissModal ( bool  aRetVal,
const wxString &  aResult = wxEmptyString 
)
protectedinherited

Definition at line 162 of file kiway_player.cpp.

163 {
164  m_modal_ret_val = aRetVal;
165  m_modal_string = aResult;
166 
167  if( m_modal_loop )
168  {
169  m_modal_loop->Exit();
170  m_modal_loop = 0; // this marks it as dismissed.
171  }
172 
173  Show( false );
174 }
bool m_modal_ret_val
Definition: kiway_player.h:260
wxString m_modal_string
Definition: kiway_player.h:259
WX_EVENT_LOOP * m_modal_loop
Definition: kiway_player.h:257

References KIWAY_PLAYER::m_modal_loop, KIWAY_PLAYER::m_modal_ret_val, and KIWAY_PLAYER::m_modal_string.

Referenced by FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), FOOTPRINT_WIZARD_FRAME::ExportSelectedFootprint(), LIB_VIEW_FRAME::OnAddPartToSchematic(), LIB_VIEW_FRAME::OnCloseWindow(), FOOTPRINT_VIEWER_FRAME::OnCloseWindow(), and FOOTPRINT_WIZARD_FRAME::OnCloseWindow().

◆ doAutoSave()

bool EDA_BASE_FRAME::doAutoSave ( )
protectedvirtualinherited

This should be overridden by the derived class to handle the auto save feature.

Returns
true if the auto save was successful otherwise false.

Reimplemented in PCB_EDIT_FRAME, and SCH_EDIT_FRAME.

Definition at line 222 of file eda_base_frame.cpp.

223 {
224  wxCHECK_MSG( false, true, wxT( "Auto save timer function not overridden. Bad programmer!" ) );
225 }

Referenced by EDA_BASE_FRAME::onAutoSaveTimer().

◆ ExportHotkeyConfigToFile()

void EDA_BASE_FRAME::ExportHotkeyConfigToFile ( EDA_HOTKEY_CONFIG aDescList,
const wxString &  aDefaultShortname 
)
inherited

Prompt the user for an old hotkey file to read, and read it.

Parameters
aDescList= current hotkey list descr. to initialize.
aDefaultShortname= a default short name (extension not needed) like eechema, kicad...

Definition at line 738 of file hotkeys_basic.cpp.

740 {
741  wxString ext = DEFAULT_HOTKEY_FILENAME_EXT;
742  wxString mask = wxT( "*." ) + ext;
743 
744 #if 0
745  wxString path = wxPathOnly( Prj().GetProjectFullName() );
746 #else
747  wxString path = GetMruPath();
748 #endif
749  wxFileName fn( aDefaultShortname );
750  fn.SetExt( DEFAULT_HOTKEY_FILENAME_EXT );
751 
752  wxString filename = EDA_FILE_SELECTOR( _( "Write Hotkey Configuration File:" ),
753  path,
754  fn.GetFullPath(),
755  ext,
756  mask,
757  this,
758  wxFD_SAVE,
759  true );
760 
761  if( filename.IsEmpty() )
762  return;
763 
764  WriteHotkeyConfig( aDescList, &filename );
765  SetMruPath( wxFileName( filename ).GetPath() );
766 }
void SetMruPath(const wxString &aPath)
PROJECT & Prj()
Definition: kicad.cpp:303
wxString GetMruPath() const
wxString EDA_FILE_SELECTOR(const wxString &aTitle, const wxString &aPath, const wxString &aFileName, const wxString &aExtension, const wxString &aWildcard, wxWindow *aParent, int aStyle, const bool aKeepWorkingDirectory, const wxPoint &aPosition, wxString *aMruPath)
Function EDA_FILE_SELECTOR.
Definition: gestfich.cpp:82
virtual int WriteHotkeyConfig(struct EDA_HOTKEY_CONFIG *aDescList, wxString *aFullFileName=NULL)
Store the current hotkey list.
#define DEFAULT_HOTKEY_FILENAME_EXT
Definition: hotkeys_basic.h:34

References DEFAULT_HOTKEY_FILENAME_EXT, EDA_FILE_SELECTOR(), EDA_BASE_FRAME::GetMruPath(), Prj(), EDA_BASE_FRAME::SetMruPath(), and EDA_BASE_FRAME::WriteHotkeyConfig().

Referenced by PANEL_HOTKEYS_EDITOR::installButtons().

◆ GetAboutTitle()

const wxString& EDA_BASE_FRAME::GetAboutTitle ( ) const
inlineinherited

Definition at line 405 of file eda_base_frame.h.

405 { return m_AboutTitle; }
wxString m_AboutTitle
Name of program displayed in About.

References EDA_BASE_FRAME::m_AboutTitle.

Referenced by DIALOG_ABOUT::DIALOG_ABOUT().

◆ GetAutoSaveFilePrefix()

static wxString EDA_BASE_FRAME::GetAutoSaveFilePrefix ( )
inlinestaticprotectedinherited
Returns
the string to prepend to a file name for automatic save.

Definition at line 161 of file eda_base_frame.h.

162  {
163  return wxT( "_autosave-" );
164  }

Referenced by EDA_BASE_FRAME::CheckForAutoSaveFile(), SCH_EDIT_FRAME::doAutoSave(), PCB_EDIT_FRAME::doAutoSave(), PCB_EDIT_FRAME::Files_io_from_id(), SCH_EDIT_FRAME::OnCloseWindow(), PCB_EDIT_FRAME::OnExportSTEP(), SCH_EDIT_FRAME::SaveEEFile(), and PCB_EDIT_FRAME::SavePcbFile().

◆ GetAutoSaveInterval()

int EDA_BASE_FRAME::GetAutoSaveInterval ( ) const
inlineinherited

Definition at line 218 of file eda_base_frame.h.

218 { return m_autoSaveInterval; }
int m_autoSaveInterval
The auto save interval time in seconds.

References EDA_BASE_FRAME::m_autoSaveInterval.

◆ GetBackupSuffix()

static wxString EDA_BASE_FRAME::GetBackupSuffix ( )
inlinestaticprotectedinherited
Returns
the suffix to be appended to the file extension on backup

Definition at line 153 of file eda_base_frame.h.

154  {
155  return wxT( "-bak" );
156  }

Referenced by EDA_BASE_FRAME::CheckForAutoSaveFile(), PCB_EDIT_FRAME::createBackupFile(), and PCB_EDIT_FRAME::Files_io_from_id().

◆ GetFileFromHistory()

wxString EDA_BASE_FRAME::GetFileFromHistory ( int  cmdId,
const wxString &  type,
wxFileHistory *  aFileHistory = NULL 
)
inherited

Fetches the file name from the file history list.

This removes the selected file, if this file does not exist. The menu is also updated, if wxFileHistory::UseMenu was called at init time

Parameters
cmdIdThe command ID associated with the aFileHistory object.
typePlease document me!
aFileHistoryThe wxFileHistory in use. If null, the main application file history is used
Returns
a wxString containing the selected filename

Definition at line 398 of file eda_base_frame.cpp.

400 {
401  wxFileHistory* fileHistory = aFileHistory;
402 
403  if( !fileHistory )
404  fileHistory = &Kiface().GetFileHistory();
405 
406  int baseId = fileHistory->GetBaseId();
407 
408  wxASSERT( cmdId >= baseId && cmdId < baseId + (int) fileHistory->GetCount() );
409 
410  unsigned i = cmdId - baseId;
411 
412  if( i < fileHistory->GetCount() )
413  {
414  wxString fn = fileHistory->GetHistoryFile( i );
415 
416  if( wxFileName::FileExists( fn ) )
417  return fn;
418  else
419  {
420  wxString msg = wxString::Format( _( "File \"%s\" was not found." ), fn );
421  wxMessageBox( msg );
422 
423  fileHistory->RemoveFileFromHistory( i );
424  }
425  }
426 
427  return wxEmptyString;
428 }
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
FILE_HISTORY & GetFileHistory()
Definition: kiface_i.h:123
size_t i
Definition: json11.cpp:597

References Format(), 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(), SCH_EDIT_FRAME::OnLoadFile(), and GERBVIEW_FRAME::OnZipFileHistory().

◆ GetKicadAbout()

void EDA_BASE_FRAME::GetKicadAbout ( wxCommandEvent &  event)
inherited

Definition at line 505 of file eda_base_frame.cpp.

506 {
507  void ShowAboutDialog(EDA_BASE_FRAME * aParent); // See AboutDialog_main.cpp
508  ShowAboutDialog( this );
509 }
void ShowAboutDialog(EDA_BASE_FRAME *aParent)
The base frame for deriving all KiCad main window classes.

References ShowAboutDialog().

◆ GetKicadContribute()

void EDA_BASE_FRAME::GetKicadContribute ( wxCommandEvent &  event)
inherited

Definition at line 492 of file eda_base_frame.cpp.

493 {
494  if( !wxLaunchDefaultBrowser( URL_GET_INVOLVED ) )
495  {
496  wxString msg;
497  msg.Printf( _( "Could not launch the default browser.\n"
498  "For information on how to help the KiCad project, visit %s" ),
500  wxMessageBox( msg, _( "Get involved with KiCad" ), wxOK, this );
501  }
502 }
#define URL_GET_INVOLVED

References URL_GET_INVOLVED.

◆ GetKicadHelp()

void EDA_BASE_FRAME::GetKicadHelp ( wxCommandEvent &  event)
inherited

Definition at line 431 of file eda_base_frame.cpp.

432 {
433  const SEARCH_STACK& search = sys_search();
434 
435  /* We have to get document for beginners,
436  * or the full specific doc
437  * if event id is wxID_INDEX, we want the document for beginners.
438  * else the specific doc file (its name is in Kiface().GetHelpFileName())
439  * The document for beginners is the same for all KiCad utilities
440  */
441  if( event.GetId() == wxID_INDEX )
442  {
443  // List of possible names for Getting Started in KiCad
444  const wxChar* names[2] = {
445  wxT( "getting_started_in_kicad" ),
446  wxT( "Getting_Started_in_KiCad" )
447  };
448 
449  wxString helpFile;
450  // Search for "getting_started_in_kicad.html" or "getting_started_in_kicad.pdf"
451  // or "Getting_Started_in_KiCad.html" or "Getting_Started_in_KiCad.pdf"
452  for( unsigned ii = 0; ii < arrayDim( names ); ii++ )
453  {
454  helpFile = SearchHelpFileFullPath( search, names[ii] );
455 
456  if( !helpFile.IsEmpty() )
457  break;
458  }
459 
460  if( !helpFile )
461  {
462  wxString msg = wxString::Format( _(
463  "Html or pdf help file \n\"%s\"\n or\n\"%s\" could not be found." ), names[0], names[1] );
464  wxMessageBox( msg );
465  }
466  else
467  {
468  GetAssociatedDocument( this, helpFile );
469  }
470 
471  return;
472  }
473 
474  wxString base_name = help_name();
475  wxString helpFile = SearchHelpFileFullPath( search, base_name );
476 
477  if( !helpFile )
478  {
479  wxString msg = wxString::Format( _(
480  "Help file \"%s\" could not be found." ),
481  GetChars( base_name )
482  );
483  wxMessageBox( msg );
484  }
485  else
486  {
487  GetAssociatedDocument( this, helpFile );
488  }
489 }
wxString SearchHelpFileFullPath(const SEARCH_STACK &aSearchStack, const wxString &aBaseName)
Return the help file's full path.
bool GetAssociatedDocument(wxWindow *aParent, const wxString &aDocName, const wxPathList *aPaths)
Function GetAssociatedDocument open a document (file) with the suitable browser.
Definition: eda_doc.cpp:87
Class SEARCH_STACK looks for files in a number of places.
Definition: search_stack.h:41
virtual const SEARCH_STACK & sys_search()
Return a SEARCH_STACK pertaining to entire program.
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Definition: macros.h:107
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:100
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
virtual wxString help_name()

References arrayDim(), Format(), GetAssociatedDocument(), GetChars(), EDA_BASE_FRAME::help_name(), numEval::SearchHelpFileFullPath(), and EDA_BASE_FRAME::sys_search().

◆ GetMruPath()

wxString EDA_BASE_FRAME::GetMruPath ( ) const
inlineinherited

◆ GetToolManager()

TOOL_MANAGER * KIWAY_HOLDER::GetToolManager ( ) const
inherited

Function GetToolManager Return the tool manager instance, if any.

Definition at line 46 of file kiway_holder.cpp.

47 {
48  return nullptr;
49 }

Referenced by DIALOG_SHIM::DIALOG_SHIM().

◆ GetUserUnits()

EDA_UNITS_T KIWAY_HOLDER::GetUserUnits ( ) const
inherited

Function GetUserUnits Allows participation in KEYWAY_PLAYER/DIALOG_SHIM userUnits inheritance.

This would fit better in KEYWAY_PLAYER, but DIALOG_SHIMs can only use mix-ins because their primary superclass must be wxDialog.

Definition at line 40 of file kiway_holder.cpp.

41 {
42  return MILLIMETRES;
43 }

References MILLIMETRES.

Referenced by DIALOG_SHIM::DIALOG_SHIM().

◆ help_name()

wxString EDA_BASE_FRAME::help_name ( )
protectedvirtualinherited

Reimplemented in KICAD_MANAGER_FRAME.

Definition at line 374 of file eda_base_frame.cpp.

375 {
376  return Kiface().GetHelpFileName();
377 }
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
const wxString & GetHelpFileName() const
Function GetHelpFileName returns just the basename portion of the current help file.
Definition: kiface_i.h:121

References KIFACE_I::GetHelpFileName(), and Kiface().

Referenced by EDA_BASE_FRAME::GetKicadHelp().

◆ ImportHotkeyConfigFromFile()

void EDA_BASE_FRAME::ImportHotkeyConfigFromFile ( EDA_HOTKEY_CONFIG aDescList,
const wxString &  aDefaultShortname 
)
inherited

Prompt the user for an old hotkey file to read, and read it.

Parameters
aDescList= current hotkey list descr. to initialize.
aDefaultShortname= a default short name (extension not needed) like eechema, kicad...

Definition at line 709 of file hotkeys_basic.cpp.

711 {
712  wxString ext = DEFAULT_HOTKEY_FILENAME_EXT;
713  wxString mask = wxT( "*." ) + ext;
714 
715 
716  wxString path = GetMruPath();
717  wxFileName fn( aDefaultShortname );
718  fn.SetExt( DEFAULT_HOTKEY_FILENAME_EXT );
719 
720  wxString filename = EDA_FILE_SELECTOR( _( "Read Hotkey Configuration File:" ),
721  path,
722  fn.GetFullPath(),
723  ext,
724  mask,
725  this,
726  wxFD_OPEN,
727  true );
728 
729  if( filename.IsEmpty() )
730  return;
731 
732  ::ReadHotkeyConfigFile( filename, aDescList, false );
733  WriteHotkeyConfig( aDescList );
734  SetMruPath( wxFileName( filename ).GetPath() );
735 }
void SetMruPath(const wxString &aPath)
int ReadHotkeyConfigFile(const wxString &aFilename, struct EDA_HOTKEY_CONFIG *aDescList, const bool aDefaultLocation)
Function ReadHotkeyConfig Read hotkey configuration for a given app, possibly before the frame for th...
wxString GetMruPath() const
wxString EDA_FILE_SELECTOR(const wxString &aTitle, const wxString &aPath, const wxString &aFileName, const wxString &aExtension, const wxString &aWildcard, wxWindow *aParent, int aStyle, const bool aKeepWorkingDirectory, const wxPoint &aPosition, wxString *aMruPath)
Function EDA_FILE_SELECTOR.
Definition: gestfich.cpp:82
virtual int WriteHotkeyConfig(struct EDA_HOTKEY_CONFIG *aDescList, wxString *aFullFileName=NULL)
Store the current hotkey list.
#define DEFAULT_HOTKEY_FILENAME_EXT
Definition: hotkeys_basic.h:34

References DEFAULT_HOTKEY_FILENAME_EXT, EDA_FILE_SELECTOR(), EDA_BASE_FRAME::GetMruPath(), ReadHotkeyConfigFile(), EDA_BASE_FRAME::SetMruPath(), and EDA_BASE_FRAME::WriteHotkeyConfig().

Referenced by PANEL_HOTKEYS_EDITOR::installButtons().

◆ InstallPreferences()

virtual void EDA_BASE_FRAME::InstallPreferences ( PAGED_DIALOG aParent)
inlinevirtualinherited

Allow a frame to load its preference panels (if any) into the preferences dialog.

Parameters
aParenta paged dialog into which the preference panels should be installed

Reimplemented in PCB_EDIT_FRAME, SCH_EDIT_FRAME, GERBVIEW_FRAME, LIB_EDIT_FRAME, and FOOTPRINT_EDIT_FRAME.

Definition at line 238 of file eda_base_frame.h.

238 { }

Referenced by EDA_BASE_FRAME::ShowPreferences().

◆ isAutoSaveRequired()

virtual bool EDA_BASE_FRAME::isAutoSaveRequired ( ) const
inlineprotectedvirtualinherited

Return 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 176 of file eda_base_frame.h.

176 { return false; }

Referenced by EDA_BASE_FRAME::ProcessEvent().

◆ IsDismissed()

bool KIWAY_PLAYER::IsDismissed ( )
protectedinherited

Function IsDismissed returns false only if both the frame is acting in modal mode and it has not been dismissed yet with DismissModal().

IOW, it will return true if the dialog is not modal or if it is modal and has been dismissed.

Definition at line 156 of file kiway_player.cpp.

157 {
158  return !m_modal_loop;
159 }
WX_EVENT_LOOP * m_modal_loop
Definition: kiway_player.h:257

References KIWAY_PLAYER::m_modal_loop.

Referenced by LIB_VIEW_FRAME::OnCloseWindow(), FOOTPRINT_VIEWER_FRAME::OnCloseWindow(), and FOOTPRINT_WIZARD_FRAME::OnCloseWindow().

◆ IsModal()

◆ IsType()

◆ IsWritable()

bool EDA_BASE_FRAME::IsWritable ( const wxFileName &  aFileName)
inherited

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.

Note
The file name path must be set or an assertion will be raised on debug builds and return false on release builds.
Parameters
aFileNameThe full path and/or file name of the file to test.
Returns
False if aFileName cannot be written.

Definition at line 540 of file eda_base_frame.cpp.

541 {
542  wxString msg;
543  wxFileName fn = aFileName;
544 
545  // Check for absence of a file path with a file name. Unfortunately KiCad
546  // uses paths relative to the current project path without the ./ part which
547  // confuses wxFileName. Making the file name path absolute may be less than
548  // elegant but it solves the problem.
549  if( fn.GetPath().IsEmpty() && fn.HasName() )
550  fn.MakeAbsolute();
551 
552  wxCHECK_MSG( fn.IsOk(), false,
553  wxT( "File name object is invalid. Bad programmer!" ) );
554  wxCHECK_MSG( !fn.GetPath().IsEmpty(), false,
555  wxT( "File name object path <" ) + fn.GetFullPath() +
556  wxT( "> is not set. Bad programmer!" ) );
557 
558  if( fn.IsDir() && !fn.IsDirWritable() )
559  {
560  msg.Printf( _( "You do not have write permissions to folder \"%s\"." ),
561  GetChars( fn.GetPath() ) );
562  }
563  else if( !fn.FileExists() && !fn.IsDirWritable() )
564  {
565  msg.Printf( _( "You do not have write permissions to save file \"%s\" to folder \"%s\"." ),
566  GetChars( fn.GetFullName() ), GetChars( fn.GetPath() ) );
567  }
568  else if( fn.FileExists() && !fn.IsFileWritable() )
569  {
570  msg.Printf( _( "You do not have write permissions to save file \"%s\"." ),
571  GetChars( fn.GetFullPath() ) );
572  }
573 
574  if( !msg.IsEmpty() )
575  {
576  wxMessageBox( msg );
577  return false;
578  }
579 
580  return true;
581 }
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:100

References GetChars().

Referenced by SCH_EDIT_FRAME::doAutoSave(), SCH_EDIT_FRAME::SaveEEFile(), LIB_EDIT_FRAME::saveLibrary(), PCB_EDIT_FRAME::SavePcbCopy(), PCB_EDIT_FRAME::SavePcbFile(), CVPCB_MAINFRAME::SaveProjectFile(), and SCH_EDIT_FRAME::SaveProjectSettings().

◆ Kiway()

KIWAY& KIWAY_HOLDER::Kiway ( ) const
inlineinherited

Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in.

A KIWAY_HOLDER is not necessarily a KIWAY_PLAYER.

Definition at line 61 of file kiway_player.h.

62  {
63  wxASSERT( m_kiway ); // smoke out bugs in Debug build, then Release runs fine.
64  return *m_kiway;
65  }
KIWAY * m_kiway
Definition: kiway_player.h:101

References KIWAY_HOLDER::m_kiway.

Referenced by TREEPROJECT_ITEM::Activate(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PCB_BASE_EDIT_FRAME::AddLibrary(), SCH_EDIT_FRAME::AppendSchematic(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), DIALOG_CHOOSE_FOOTPRINT::ConstructRightPanel(), DIALOG_CHOOSE_COMPONENT::ConstructRightPanel(), PCB_BASE_FRAME::CreateAndShow3D_Frame(), CVPCB_MAINFRAME::CreateScreenCmp(), SCH_EDIT_FRAME::CreateScreens(), CVPCB_MAINFRAME::CVPCB_MAINFRAME(), DIALOG_RESCUE_EACH::DIALOG_RESCUE_EACH(), DIALOG_SHIM::DIALOG_SHIM(), FIELDS_GRID_TRICKS::doPopupSelection(), FIELDS_EDITOR_GRID_TRICKS::doPopupSelection(), EDIT_TOOL::editFootprintInFpEditor(), SCH_EDIT_FRAME::EditSheet(), SCH_EDITOR_CONTROL::EditWithSymbolEditor(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), LIB_MANAGER::GetBufferedPart(), LIB_MANAGER::getLibraryBuffer(), FOOTPRINT_EDIT_FRAME::GetPlotSettings(), PCB_EDIT_FRAME::importFile(), SCH_EDIT_FRAME::importFile(), SCH_EDIT_FRAME::InitSheet(), KIWAY_PLAYER::language_change(), KICAD_MANAGER_FRAME::language_change(), CVPCB_MAINFRAME::LoadFootprintFiles(), KICAD_MANAGER_FRAME::LoadProject(), LIB_VIEW_FRAME::OnAddPartToSchematic(), LIB_EDIT_FRAME::OnAddPartToSchematic(), TEXT_BUTTON_SYMBOL_CHOOSER::OnButtonClick(), TEXT_BUTTON_FP_CHOOSER::OnButtonClick(), KICAD_MANAGER_FRAME::OnCloseWindow(), SCH_EDIT_FRAME::OnCloseWindow(), CVPCB_MAINFRAME::OnEditFootprintLibraryTable(), KICAD_MANAGER_FRAME::OnEditFpLibTable(), SCH_BASE_FRAME::OnEditSymbolLibTable(), KICAD_MANAGER_FRAME::OnEditSymLibTable(), KICAD_MANAGER_FRAME::OnImportEagleFiles(), DIALOG_CHOOSE_COMPONENT::OnInitDialog(), SCH_EDIT_FRAME::OnOpenCvpcb(), SCH_EDIT_FRAME::OnOpenLibraryEditor(), SCH_BASE_FRAME::OnOpenLibraryViewer(), SCH_EDIT_FRAME::OnOpenPcbModuleEditor(), SCH_EDIT_FRAME::OnOpenPcbnew(), DIALOG_SYMBOL_REMAP::OnRemapSymbols(), KICAD_MANAGER_FRAME::OnRunPcbFpEditor(), KICAD_MANAGER_FRAME::OnRunSchLibEditor(), SCH_EDIT_FRAME::OnSimulate(), DIALOG_EDIT_ONE_FIELD::OnTextValueSelectButtonClick(), FOOTPRINT_EDIT_FRAME::OnUpdateInsertModuleInBoard(), FOOTPRINT_EDIT_FRAME::OnUpdateLoadModuleFromBoard(), SCH_EDIT_FRAME::OnUpdatePCB(), SCH_EDIT_FRAME::OpenProjectFiles(), KIWAY_HOLDER::Prj(), PCB_EDIT_FRAME::Process_Config(), PCB_EDIT_FRAME::Process_Special_Functions(), FOOTPRINT_EDIT_FRAME::ProcessPreferences(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), LIB_EDIT_FRAME::refreshSchematic(), SCH_EDIT_FRAME::rescueProject(), KICAD_MANAGER_FRAME::RunEeschema(), KICAD_MANAGER_FRAME::RunPcbNew(), SCH_EDIT_FRAME::SaveEEFile(), CVPCB_MAINFRAME::SaveFootprintAssociation(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_BASE_FRAME::SelectComponentFromLibBrowser(), SCH_EDIT_FRAME::SendCrossProbeClearHighlight(), SCH_EDIT_FRAME::SendCrossProbeNetName(), PCB_EDIT_FRAME::SendCrossProbeNetName(), CVPCB_MAINFRAME::SendMessageToEESCHEMA(), PCB_EDIT_FRAME::SendMessageToEESCHEMA(), SCH_EDIT_FRAME::SendMessageToPCBNEW(), SCH_EDIT_FRAME::sendNetlistToCvpcb(), FOOTPRINT_EDIT_FRAME::SetPlotSettings(), FOOTPRINT_VIEWER_FRAME::Show3D_Frame(), FOOTPRINT_WIZARD_FRAME::Show3D_Frame(), EDA_BASE_FRAME::ShowPreferences(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), LIB_MANAGER::UpdatePart(), and DIALOG_EXCHANGE_FOOTPRINTS::ViewAndSelectFootprint().

◆ kiway_express()

void KIWAY_PLAYER::kiway_express ( KIWAY_EXPRESS aEvent)
protectedinherited

event handler, routes to derivative specific virtual KiwayMailIn()

Definition at line 177 of file kiway_player.cpp.

178 {
179  // logging support
180  KiwayMailIn( aEvent ); // call the virtual, override in derived.
181 }
virtual void KiwayMailIn(KIWAY_EXPRESS &aEvent)
Function KiwayMailIn receives KIWAY_EXPRESS messages from other players.

References KIWAY_PLAYER::KiwayMailIn().

◆ KiwayMailIn()

void KIWAY_PLAYER::KiwayMailIn ( KIWAY_EXPRESS aEvent)
virtualinherited

Function KiwayMailIn receives KIWAY_EXPRESS messages from other players.

Merely override it in derived classes.

Reimplemented in LIB_EDIT_FRAME, FOOTPRINT_EDIT_FRAME, SCH_EDIT_FRAME, PCB_EDIT_FRAME, and CVPCB_MAINFRAME.

Definition at line 71 of file kiway_player.cpp.

72 {
73  // override this in derived classes.
74 }

Referenced by KIWAY_PLAYER::kiway_express(), and KIWAY::ProcessEvent().

◆ language_change()

void KIWAY_PLAYER::language_change ( wxCommandEvent &  event)
protectedinherited

Function language_change is an event handler called on a language menu selection.

Definition at line 184 of file kiway_player.cpp.

185 {
186  int id = event.GetId();
187 
188  // tell all the KIWAY_PLAYERs about the language change.
189  Kiway().SetLanguage( id );
190 }
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_player.h:61
VTBL_ENTRY void SetLanguage(int aLanguage)
Function SetLanguage changes the language and then calls ShowChangedLanguage() on all KIWAY_PLAYERs.
Definition: kiway.cpp:415

References KIWAY_HOLDER::Kiway(), and KIWAY::SetLanguage().

◆ LoadSettings()

void EDA_BASE_FRAME::LoadSettings ( wxConfigBase *  aCfg)
virtualinherited

Load 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, PCB_EDIT_FRAME, GERBVIEW_FRAME, LIB_EDIT_FRAME, SCH_EDIT_FRAME, CVPCB_MAINFRAME, KICAD_MANAGER_FRAME, EDA_3D_VIEWER, PL_EDITOR_FRAME, FOOTPRINT_WIZARD_FRAME, SIM_PLOT_FRAME, FOOTPRINT_VIEWER_FRAME, LIB_VIEW_FRAME, DISPLAY_FOOTPRINTS_FRAME, and FOOTPRINT_EDIT_FRAME.

Definition at line 254 of file eda_base_frame.cpp.

255 {
256  int maximized = 0;
257 
258  wxString baseCfgName = ConfigBaseName();
259 
260  wxString text = baseCfgName + entryPosX;
261  aCfg->Read( text, &m_FramePos.x, m_FramePos.x );
262 
263  text = baseCfgName + entryPosY;
264  aCfg->Read( text, &m_FramePos.y, m_FramePos.y );
265 
266  text = baseCfgName + entrySizeX;
267  aCfg->Read( text, &m_FrameSize.x, m_FrameSize.x );
268 
269  text = baseCfgName + entrySizeY;
270  aCfg->Read( text, &m_FrameSize.y, m_FrameSize.y );
271 
272  text = baseCfgName + entryMaximized;
273  aCfg->Read( text, &maximized, 0 );
274 
275  if( m_hasAutoSave )
276  {
277  text = baseCfgName + entryAutoSaveInterval;
278  aCfg->Read( text, &m_autoSaveInterval, DEFAULT_AUTO_SAVE_INTERVAL );
279  }
280 
281  // Ensure the window is on a connected display, and is visible.
282  // (at least a corner of the frame must be visible on screen)
283  // Sometimes, if a window was moved on an auxiliary display, and when this
284  // display is no more available, it is not the case.
285  wxRect rect( m_FramePos, m_FrameSize );
286 
287  if( wxDisplay::GetFromPoint( rect.GetTopLeft() ) == wxNOT_FOUND &&
288  wxDisplay::GetFromPoint( rect.GetTopRight() ) == wxNOT_FOUND &&
289  wxDisplay::GetFromPoint( rect.GetBottomLeft() ) == wxNOT_FOUND &&
290  wxDisplay::GetFromPoint( rect.GetBottomRight() ) == wxNOT_FOUND )
291  {
292  m_FramePos = wxDefaultPosition;
293  }
294 
295  // Ensure Window title bar is visible
296 #if defined( __WXMAC__ )
297  // for macOSX, the window must be below system (macOSX) toolbar
298  // Ypos_min = GetMBarHeight(); seems no more exist in new API (subject to change)
299  int Ypos_min = 20;
300 #else
301  int Ypos_min = 0;
302 #endif
303  if( m_FramePos.y < Ypos_min )
304  m_FramePos.y = Ypos_min;
305 
306  if( maximized )
307  Maximize();
308 
309  aCfg->Read( baseCfgName + entryPerspective, &m_perspective );
310  aCfg->Read( baseCfgName + entryMruPath, &m_mruPath );
311 }
wxString m_mruPath
Most recently used path.
wxString ConfigBaseName()
static const wxString entryPosX
X position of frame, in pixels (suffix)
wxString m_perspective
wxAuiManager perspective.
static const wxString entryPerspective
Configuration file entry for wxAuiManger perspective.
#define DEFAULT_AUTO_SAVE_INTERVAL
The default auto save interval is 10 minutes.
static const wxString entrySizeX
Width of frame, in pixels (suffix)
static const wxString entrySizeY
Height of frame, in pixels (suffix)
static const wxString entryPosY
Y position of frame, in pixels (suffix)
static const wxString entryAutoSaveInterval
Configuration file entry name for auto save interval.
static const wxString entryMaximized
Nonzero iff frame is maximized (suffix)
bool m_hasAutoSave
Flag to indicate if this frame supports auto save.
static const wxString entryMruPath
Configuration file entry for most recently used path.
int m_autoSaveInterval
The auto save interval time in seconds.

References EDA_BASE_FRAME::ConfigBaseName(), DEFAULT_AUTO_SAVE_INTERVAL, entryAutoSaveInterval, entryMaximized, entryMruPath, entryPerspective, entryPosX, entryPosY, entrySizeX, entrySizeY, EDA_BASE_FRAME::m_autoSaveInterval, EDA_BASE_FRAME::m_FramePos, EDA_BASE_FRAME::m_FrameSize, EDA_BASE_FRAME::m_hasAutoSave, EDA_BASE_FRAME::m_mruPath, and EDA_BASE_FRAME::m_perspective.

Referenced by SIM_PLOT_FRAME::LoadSettings(), EDA_3D_VIEWER::LoadSettings(), KICAD_MANAGER_FRAME::LoadSettings(), CVPCB_MAINFRAME::LoadSettings(), and EDA_DRAW_FRAME::LoadSettings().

◆ m_splitterLeftRightOnIdle()

void SIM_PLOT_FRAME_BASE::m_splitterLeftRightOnIdle ( wxIdleEvent &  )
inline

Definition at line 119 of file sim_plot_frame_base.h.

120  {
121  m_splitterLeftRight->SetSashPosition( 700 );
122  m_splitterLeftRight->Disconnect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterLeftRightOnIdle ), NULL, this );
123  }
void m_splitterLeftRightOnIdle(wxIdleEvent &)
wxSplitterWindow * m_splitterLeftRight

References m_splitterLeftRight.

Referenced by SIM_PLOT_FRAME_BASE().

◆ m_splitterPlotAndConsoleOnIdle()

void SIM_PLOT_FRAME_BASE::m_splitterPlotAndConsoleOnIdle ( wxIdleEvent &  )
inline

Definition at line 125 of file sim_plot_frame_base.h.

126  {
127  m_splitterPlotAndConsole->SetSashPosition( 500 );
128  m_splitterPlotAndConsole->Disconnect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterPlotAndConsoleOnIdle ), NULL, this );
129  }
void m_splitterPlotAndConsoleOnIdle(wxIdleEvent &)
wxSplitterWindow * m_splitterPlotAndConsole

References m_splitterPlotAndConsole.

Referenced by SIM_PLOT_FRAME_BASE().

◆ m_splitterSignalsOnIdle()

void SIM_PLOT_FRAME_BASE::m_splitterSignalsOnIdle ( wxIdleEvent &  )
inline

Definition at line 131 of file sim_plot_frame_base.h.

132  {
133  m_splitterSignals->SetSashPosition( 0 );
134  m_splitterSignals->Disconnect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterSignalsOnIdle ), NULL, this );
135  }
wxSplitterWindow * m_splitterSignals
void m_splitterSignalsOnIdle(wxIdleEvent &)

References m_splitterSignals.

Referenced by SIM_PLOT_FRAME_BASE().

◆ m_splitterTuneValuesOnIdle()

void SIM_PLOT_FRAME_BASE::m_splitterTuneValuesOnIdle ( wxIdleEvent &  )
inline

Definition at line 137 of file sim_plot_frame_base.h.

138  {
139  m_splitterTuneValues->SetSashPosition( 0 );
140  m_splitterTuneValues->Disconnect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterTuneValuesOnIdle ), NULL, this );
141  }
wxSplitterWindow * m_splitterTuneValues
void m_splitterTuneValuesOnIdle(wxIdleEvent &)

References m_splitterTuneValues.

Referenced by SIM_PLOT_FRAME_BASE().

◆ menuExit()

virtual void SIM_PLOT_FRAME_BASE::menuExit ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 99 of file sim_plot_frame_base.h.

99 { event.Skip(); }

Referenced by SIM_PLOT_FRAME_BASE().

◆ menuNewPlot()

virtual void SIM_PLOT_FRAME_BASE::menuNewPlot ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 94 of file sim_plot_frame_base.h.

94 { event.Skip(); }

Referenced by SIM_PLOT_FRAME_BASE().

◆ menuOpenWorkbook()

virtual void SIM_PLOT_FRAME_BASE::menuOpenWorkbook ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 95 of file sim_plot_frame_base.h.

95 { event.Skip(); }

Referenced by SIM_PLOT_FRAME_BASE().

◆ menuSaveCsv()

virtual void SIM_PLOT_FRAME_BASE::menuSaveCsv ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 98 of file sim_plot_frame_base.h.

98 { event.Skip(); }

Referenced by SIM_PLOT_FRAME_BASE().

◆ menuSaveImage()

virtual void SIM_PLOT_FRAME_BASE::menuSaveImage ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 97 of file sim_plot_frame_base.h.

97 { event.Skip(); }

Referenced by SIM_PLOT_FRAME_BASE().

◆ menuSaveWorkbook()

virtual void SIM_PLOT_FRAME_BASE::menuSaveWorkbook ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 96 of file sim_plot_frame_base.h.

96 { event.Skip(); }

Referenced by SIM_PLOT_FRAME_BASE().

◆ menuShowGrid()

virtual void SIM_PLOT_FRAME_BASE::menuShowGrid ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 103 of file sim_plot_frame_base.h.

103 { event.Skip(); }

Referenced by SIM_PLOT_FRAME_BASE().

◆ menuShowGridUpdate()

virtual void SIM_PLOT_FRAME_BASE::menuShowGridUpdate ( wxUpdateUIEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 104 of file sim_plot_frame_base.h.

104 { event.Skip(); }

Referenced by SIM_PLOT_FRAME_BASE(), and ~SIM_PLOT_FRAME_BASE().

◆ menuShowLegend()

virtual void SIM_PLOT_FRAME_BASE::menuShowLegend ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 105 of file sim_plot_frame_base.h.

105 { event.Skip(); }

Referenced by SIM_PLOT_FRAME_BASE().

◆ menuShowLegendUpdate()

virtual void SIM_PLOT_FRAME_BASE::menuShowLegendUpdate ( wxUpdateUIEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 106 of file sim_plot_frame_base.h.

106 { event.Skip(); }

Referenced by SIM_PLOT_FRAME_BASE(), and ~SIM_PLOT_FRAME_BASE().

◆ menuZoomFit()

virtual void SIM_PLOT_FRAME_BASE::menuZoomFit ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 102 of file sim_plot_frame_base.h.

102 { event.Skip(); }

Referenced by SIM_PLOT_FRAME_BASE().

◆ menuZoomIn()

virtual void SIM_PLOT_FRAME_BASE::menuZoomIn ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 100 of file sim_plot_frame_base.h.

100 { event.Skip(); }

Referenced by SIM_PLOT_FRAME_BASE().

◆ menuZoomOut()

virtual void SIM_PLOT_FRAME_BASE::menuZoomOut ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 101 of file sim_plot_frame_base.h.

101 { event.Skip(); }

Referenced by SIM_PLOT_FRAME_BASE().

◆ onAutoSaveTimer()

void EDA_BASE_FRAME::onAutoSaveTimer ( wxTimerEvent &  aEvent)
protectedinherited

Handle the auto save timer event.

Definition at line 215 of file eda_base_frame.cpp.

216 {
217  if( !doAutoSave() )
218  m_autoSaveTimer->Start( m_autoSaveInterval * 1000, wxTIMER_ONE_SHOT );
219 }
virtual bool doAutoSave()
This should be overridden by the derived class to handle the auto save feature.
wxTimer * m_autoSaveTimer
The timer used to implement the auto save feature;.
int m_autoSaveInterval
The auto save interval time in seconds.

References EDA_BASE_FRAME::doAutoSave(), EDA_BASE_FRAME::m_autoSaveInterval, and EDA_BASE_FRAME::m_autoSaveTimer.

Referenced by EDA_BASE_FRAME::EDA_BASE_FRAME().

◆ onPlotChanged()

virtual void SIM_PLOT_FRAME_BASE::onPlotChanged ( wxAuiNotebookEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 107 of file sim_plot_frame_base.h.

107 { event.Skip(); }

Referenced by SIM_PLOT_FRAME_BASE(), and ~SIM_PLOT_FRAME_BASE().

◆ onPlotClose()

virtual void SIM_PLOT_FRAME_BASE::onPlotClose ( wxAuiNotebookEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 108 of file sim_plot_frame_base.h.

108 { event.Skip(); }

Referenced by SIM_PLOT_FRAME_BASE(), and ~SIM_PLOT_FRAME_BASE().

◆ onSignalDblClick()

virtual void SIM_PLOT_FRAME_BASE::onSignalDblClick ( wxMouseEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 109 of file sim_plot_frame_base.h.

109 { event.Skip(); }

Referenced by SIM_PLOT_FRAME_BASE(), and ~SIM_PLOT_FRAME_BASE().

◆ onSignalRClick()

virtual void SIM_PLOT_FRAME_BASE::onSignalRClick ( wxListEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 110 of file sim_plot_frame_base.h.

110 { event.Skip(); }

Referenced by SIM_PLOT_FRAME_BASE(), and ~SIM_PLOT_FRAME_BASE().

◆ OpenProjectFiles()

VTBL_ENTRY bool KIWAY_PLAYER::OpenProjectFiles ( const std::vector< wxString > &  aFileList,
int  aCtl = 0 
)
inlineinherited

Function OpenProjectFiles is abstract, and opens a project or set of files given by aFileList.

This is generalized in the direction of worst case. In a typical case aFileList will only hold a single file, like "myboard.kicad_pcb", because any KIWAY_PLAYER is only in one KIWAY and the KIWAY owns the PROJECT. Therefore opening files from multiple projects into the same KIWAY_PLAYER is precluded.

Each derived class should handle this in a way specific to its needs. No filename prompting is done inside here for any file or project. There should be no need to call this with aFileList which is empty. However, calling it with a single filename which does not exist should indicate to the implementor that a new session is being started and that the given name is the desired name for the data file at time of save.

This function does not support "appending". Use a different function for that. Any prior project data tree should be cleared before loading the new stuff.

Therefore, one of the first things an implementation should do is test for existence of the first file in the list, and if it does not exist, treat it as a new session, possibly with a UI notification to that effect.

After loading the window should update its Title as part of this operation. If the KIWAY_PLAYER needs to, it can load the *.pro file as part of this operation.

If the KIWAY_PLAYER cannot load any of the file(s) in the list, then it should say why through some GUI interface, and return false.

Parameters
aFileListincludes files that this frame should open according to the knowledge in the derived wxFrame. In almost every case, the list will have only a single file in it.
aCtlis a set of bit flags ORed together from the set of KICTL_* #defined above.
Returns
bool - true if all requested files were opened OK, else false.

Definition at line 186 of file kiway_player.h.

187  {
188  // overload me for your wxFrame type.
189 
190  // Any overload should probably do this also:
191  // Prj().MaybeLoadProjectSettings();
192 
193  // Then update the window title.
194 
195  return false;
196  }

Referenced by PCB_EDIT_FRAME::FetchNetlistFromSchematic(), PGM_SINGLE_TOP::MacOpenFile(), SCH_EDIT_FRAME::OnOpenPcbnew(), PGM_SINGLE_TOP::OnPgmInit(), PCB_EDIT_FRAME::OnRunEeschema(), KICAD_MANAGER_FRAME::RunEeschema(), and KICAD_MANAGER_FRAME::RunPcbNew().

◆ PostCommandMenuEvent()

bool EDA_BASE_FRAME::PostCommandMenuEvent ( int  evt_type)
inherited

Post a menu event to the frame, which can be used to trigger actions bound to menu items.

Definition at line 647 of file eda_base_frame.cpp.

648 {
649  if( evt_type != 0 )
650  {
651  wxCommandEvent evt( wxEVT_COMMAND_MENU_SELECTED );
652  evt.SetEventObject( this );
653  evt.SetId( evt_type );
654  wxPostEvent( this, evt );
655  return true;
656  }
657 
658  return false;
659 }

Referenced by 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().

◆ PrintMsg()

void EDA_BASE_FRAME::PrintMsg ( const wxString &  text)
inherited

Definition at line 380 of file eda_base_frame.cpp.

381 {
382  SetStatusText( text );
383 }

◆ Prj()

PROJECT & KIWAY_HOLDER::Prj ( ) const
inherited

Function Prj returns a reference to the PROJECT "associated with" this KIWAY.

Definition at line 34 of file kiway_holder.cpp.

35 {
36  return Kiway().Prj();
37 }
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_player.h:61
VTBL_ENTRY PROJECT & Prj() const
Function Prj returns the PROJECT associated with this KIWAY.
Definition: kiway.cpp:163

References KIWAY_HOLDER::Kiway(), and KIWAY::Prj().

Referenced by PCB_BASE_EDIT_FRAME::AddLibrary(), LIB_MANAGER::addLibrary(), SCH_EDIT_FRAME::AppendSchematic(), PCB_EDIT_FRAME::ArchiveModulesOnBoard(), DIALOG_SYMBOL_REMAP::backupProject(), LIB_VIEW_FRAME::BestZoom(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), DIALOG_FOOTPRINT_FP_EDITOR::Cfg3DPath(), DIALOG_FOOTPRINT_BOARD_EDITOR::Cfg3DPath(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::checkAliasName(), PCB_BASE_EDIT_FRAME::CreateNewLibrary(), KICAD_MANAGER_FRAME::CreateNewProject(), DIALOG_PLOT_SCHEMATIC::createPlotFileName(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), FOOTPRINT_EDIT_FRAME::DeleteModuleFromLibrary(), DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT(), DIALOG_CHOOSE_FOOTPRINT::DIALOG_CHOOSE_FOOTPRINT(), DIALOG_CONFIG_EQUFILES::DIALOG_CONFIG_EQUFILES(), DIALOG_FOOTPRINT_BOARD_EDITOR::DIALOG_FOOTPRINT_BOARD_EDITOR(), DIALOG_FOOTPRINT_FP_EDITOR::DIALOG_FOOTPRINT_FP_EDITOR(), DIALOG_PAGES_SETTINGS::DIALOG_PAGES_SETTINGS(), DIALOG_SYMBOL_REMAP::DIALOG_SYMBOL_REMAP(), LIB_VIEW_FRAME::DisplayLibInfos(), PCB_EDIT_FRAME::doAutoSave(), SCH_DRAWING_TOOLS::doPlaceComponent(), SCH_EDIT_FRAME::EditSheet(), PCB_EDIT_FRAME::Export_IDF3(), PCB_EDIT_FRAME::ExportVRML_File(), PCB_EDIT_FRAME::Files_io_from_id(), PCB_EDIT_FRAME::GenD356File(), NETLIST_DIALOG::GenNetlist(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), FOOTPRINT_VIEWER_FRAME::getCurFootprintName(), LIB_EDIT_FRAME::GetCurLib(), FOOTPRINT_VIEWER_FRAME::getCurNickname(), SCH_BASE_FRAME::GetLibAlias(), SCH_BASE_FRAME::GetLibPart(), DIALOG_SYMBOL_REMAP::getLibsNotInGlobalSymbolLibTable(), KICAD_MANAGER_FRAME::GetProjectFileName(), LIB_VIEW_FRAME::getSelectedAlias(), FP_THREAD_IFACE::GetTable(), PCB_EDIT_FRAME::importFile(), SCH_EDIT_FRAME::importFile(), FOOTPRINT_EDIT_FRAME::initLibraryTree(), PCB_EDIT_FRAME::InstallNetlistFrame(), SCH_EDIT_FRAME::IsSearchCacheObsolete(), LIB_EDIT_FRAME::KiwayMailIn(), EDA_DRAW_FRAME::LibraryFileBrowser(), SCH_EDIT_FRAME::LoadCmpToFootprintLinkFile(), LIB_EDIT_FRAME::LoadComponentFromCurrentLib(), CVPCB_MAINFRAME::LoadFootprintFiles(), DIALOG_SPICE_MODEL::loadLibrary(), LIB_EDIT_FRAME::LoadOneSymbol(), KICAD_MANAGER_FRAME::LoadProject(), CVPCB_MAINFRAME::LoadProjectFile(), SCH_EDIT_FRAME::LoadProjectFile(), PCB_EDIT_FRAME::LoadProjectSettings(), DIALOG_DRC_CONTROL::makeValidFileNameReport(), DIALOG_FOOTPRINT_FP_EDITOR::On3DModelCellChanged(), DIALOG_FOOTPRINT_BOARD_EDITOR::On3DModelCellChanged(), FOOTPRINT_VIEWER_FRAME::OnActivate(), DIALOG_FOOTPRINT_FP_EDITOR::OnAdd3DModel(), DIALOG_FOOTPRINT_BOARD_EDITOR::OnAdd3DModel(), LIB_VIEW_FRAME::OnAddPartToSchematic(), LIB_EDIT_FRAME::OnAddPartToSchematic(), DIALOG_GENCAD_EXPORT_OPTIONS::onBrowse(), KICAD_MANAGER_FRAME::OnBrowseInFileExplorer(), DIALOG_DRC_CONTROL::OnButtonBrowseRptFileClick(), DIALOG_EDIT_COMPONENTS_LIBID::onClickOrphansButton(), SCH_EDIT_FRAME::OnCloseWindow(), CVPCB_MAINFRAME::OnConfigurePaths(), FOOTPRINT_EDIT_FRAME::OnConfigurePaths(), KICAD_MANAGER_FRAME::OnCreateProjectFromTemplate(), CVPCB_MAINFRAME::OnEditFootprintLibraryTable(), DIALOG_GENDRILL::OnGenReportFile(), SCH_EDIT_FRAME::OnImportProject(), DIALOG_CHOOSE_COMPONENT::OnInitDialog(), SCH_EDIT_FRAME::OnLoadProject(), SCH_EDIT_FRAME::OnOpenCvpcb(), KICAD_MANAGER_FRAME::OnOpenFileInTextEditor(), DIALOG_NETLIST::OnOpenNetlistClick(), SCH_EDIT_FRAME::OnOpenPcbModuleEditor(), SCH_EDIT_FRAME::OnOpenPcbnew(), DIALOG_EXPORT_SVG::OnOutputDirectoryBrowseClicked(), DIALOG_PLOT::OnOutputDirectoryBrowseClicked(), DIALOG_PLOT_SCHEMATIC::OnOutputDirectoryBrowseClicked(), DIALOG_GENDRILL::OnOutputDirectoryBrowseClicked(), DIALOG_GEN_FOOTPRINT_POSITION::OnOutputDirectoryBrowseClicked(), LIB_EDIT_FRAME::OnPlotCurrentComponent(), SCH_EDIT_FRAME::OnPrint(), DIALOG_SYMBOL_REMAP::OnRemapSymbols(), KICAD_MANAGER_FRAME::OnRunGerbview(), DIALOG_BOM::OnRunPlugin(), FOOTPRINT_EDIT_FRAME::OnSaveFootprintAsPng(), KICAD_MANAGER_FRAME::OnSaveProject(), DIALOG_SPICE_MODEL::onSelectLibrary(), LIB_VIEW_FRAME::OnSelectSymbol(), KICAD_MANAGER_FRAME::OnUnarchiveFiles(), LIB_EDIT_FRAME::OnViewEntryDoc(), LIB_VIEW_FRAME::onViewSymbolDocument(), SCH_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::OpenProjectFiles(), PANEL_PREV_3D::PANEL_PREV_3D(), SCH_EDITOR_CONTROL::Paste(), PCB_BASE_EDIT_FRAME::PCB_BASE_EDIT_FRAME(), DIALOG_CHOOSE_COMPONENT::PopulateFootprintSelector(), SCH_EDIT_FRAME::PrintPage(), SCH_EDIT_FRAME::Process_Config(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), PCB_EDIT_FRAME::RecreateCmpFileFromBoard(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList(), LIB_VIEW_FRAME::ReCreateListCmp(), LIB_VIEW_FRAME::ReCreateListLib(), EDA_3D_VIEWER::ReloadRequest(), DIALOG_SYMBOL_REMAP::remapSymbolToLibTable(), SCH_EDIT_FRAME::RescueLegacyProject(), SCH_EDIT_FRAME::RescueSymbolLibTableProject(), FOOTPRINT_EDIT_FRAME::restoreLastFootprint(), FOOTPRINT_EDIT_FRAME::retainLastFootprint(), SCH_EDIT_FRAME::SaveEEFile(), FOOTPRINT_EDIT_FRAME::SaveFootprint(), FOOTPRINT_EDIT_FRAME::SaveFootprintAs(), FOOTPRINT_EDIT_FRAME::saveFootprintInLibrary(), LIB_EDIT_FRAME::saveLibrary(), LIB_EDIT_FRAME::SaveOneSymbol(), LIB_EDIT_FRAME::savePartAs(), SCH_EDIT_FRAME::SaveProject(), CVPCB_MAINFRAME::SaveProjectFile(), SCH_EDIT_FRAME::SaveProjectSettings(), PCB_EDIT_FRAME::SaveProjectSettings(), SCH_BASE_FRAME::saveSymbolLibTables(), FOOTPRINT_VIEWER_FRAME::SelectAndViewFootprint(), SCH_BASE_FRAME::SelectCompFromLibTree(), PCB_BASE_FRAME::SelectLibrary(), LIB_EDIT_FRAME::SelectLibraryFromList(), LIB_EDIT_FRAME::selectSymLibTable(), FOOTPRINT_VIEWER_FRAME::setCurFootprintName(), LIB_EDIT_FRAME::SetCurLib(), FOOTPRINT_VIEWER_FRAME::setCurNickname(), LIB_EDIT_FRAME::SetCurPart(), KICAD_MANAGER_FRAME::SetProjectFileName(), DIALOG_CHOOSE_COMPONENT::ShowFootprintFor(), LIB_VIEW_FRAME::ShowModal(), FOOTPRINT_VIEWER_FRAME::ShowModal(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), LIB_MANAGER::symTable(), FOOTPRINT_EDIT_FRAME::SyncLibraryTree(), EDA_3D_VIEWER::takeScreenshot(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_FOOTPRINT_FP_EDITOR::TransferDataToWindow(), DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataToWindow(), SIM_PLOT_FRAME::updateNetlistExporter(), SCH_SCREEN::UpdateSymbolLinks(), FOOTPRINT_VIEWER_FRAME::UpdateTitle(), FOOTPRINT_EDIT_FRAME::updateTitle(), SCH_EDIT_FRAME::UpdateTitle(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::Validate(), SCH_EDIT_FRAME::WriteNetListFile(), DIALOG_FOOTPRINT_BOARD_EDITOR::~DIALOG_FOOTPRINT_BOARD_EDITOR(), DIALOG_FOOTPRINT_FP_EDITOR::~DIALOG_FOOTPRINT_FP_EDITOR(), and PCB_BASE_EDIT_FRAME::~PCB_BASE_EDIT_FRAME().

◆ ProcessEvent()

bool EDA_BASE_FRAME::ProcessEvent ( wxEvent &  aEvent)
overrideinherited

Override the default process event handler to implement the auto save feature.

Warning
If you override this function in a derived class, make sure you call down to this or the auto save feature will be disabled.

Definition at line 157 of file eda_base_frame.cpp.

158 {
159 #ifdef __WXMAC__
160  // Apple in its infinite wisdom will raise a disabled window before even passing
161  // us the event, so we have no way to stop it. Instead, we have to catch an
162  // improperly ordered disabled window and quasi-modal dialog here and reorder
163  // them.
164  if( !IsEnabled() && IsActive() )
165  {
166  wxWindow* dlg = findQuasiModalDialog();
167  if( dlg )
168  dlg->Raise();
169  }
170 #endif
171 
172  if( !wxFrame::ProcessEvent( aEvent ) )
173  return false;
174 
175  if( IsShown() && m_hasAutoSave && IsActive() &&
177  {
178  if( !m_autoSaveState )
179  {
180  wxLogTrace( traceAutoSave, wxT( "Starting auto save timer." ) );
181  m_autoSaveTimer->Start( m_autoSaveInterval * 1000, wxTIMER_ONE_SHOT );
182  m_autoSaveState = true;
183  }
184  else if( m_autoSaveTimer->IsRunning() )
185  {
186  wxLogTrace( traceAutoSave, wxT( "Stopping auto save timer." ) );
187  m_autoSaveTimer->Stop();
188  m_autoSaveState = false;
189  }
190  }
191 
192  return true;
193 }
bool m_autoSaveState
Flag to indicate the last auto save state.
const wxChar *const traceAutoSave
Flag to enable auto save feature debug tracing.
virtual bool isAutoSaveRequired() const
Return the auto save status of the application.
wxTimer * m_autoSaveTimer
The timer used to implement the auto save feature;.
wxWindow * findQuasiModalDialog()
bool m_hasAutoSave
Flag to indicate if this frame supports auto save.
int m_autoSaveInterval
The auto save interval time in seconds.

References EDA_BASE_FRAME::findQuasiModalDialog(), EDA_BASE_FRAME::isAutoSaveRequired(), EDA_BASE_FRAME::m_autoSaveInterval, EDA_BASE_FRAME::m_autoSaveState, EDA_BASE_FRAME::m_autoSaveTimer, EDA_BASE_FRAME::m_hasAutoSave, and traceAutoSave.

Referenced by COMMON_TOOLS::GridProperties(), STATUS_POPUP::onCharHook(), LIB_VIEW_FRAME::onSelectNextSymbol(), LIB_VIEW_FRAME::onSelectPreviousSymbol(), KIWAY::ProcessEvent(), and LIB_VIEW_FRAME::ReCreateListCmp().

◆ ReCreateMenuBar()

void EDA_BASE_FRAME::ReCreateMenuBar ( )
virtualinherited

◆ SaveProjectSettings()

virtual void EDA_BASE_FRAME::SaveProjectSettings ( bool  aAskForSave)
inlinevirtualinherited

Save 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

Parameters
aAskForSave= true to open a dialog before saving the settings

Reimplemented in PCB_EDIT_FRAME, and SCH_EDIT_FRAME.

Definition at line 280 of file eda_base_frame.h.

280 {};

Referenced by DIALOG_PAGES_SETTINGS::OnOkClick().

◆ SaveSettings()

void EDA_BASE_FRAME::SaveSettings ( wxConfigBase *  aCfg)
virtualinherited

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, PCB_EDIT_FRAME, GERBVIEW_FRAME, LIB_EDIT_FRAME, SCH_EDIT_FRAME, CVPCB_MAINFRAME, KICAD_MANAGER_FRAME, PL_EDITOR_FRAME, EDA_3D_VIEWER, FOOTPRINT_WIZARD_FRAME, SIM_PLOT_FRAME, FOOTPRINT_VIEWER_FRAME, LIB_VIEW_FRAME, DISPLAY_FOOTPRINTS_FRAME, and FOOTPRINT_EDIT_FRAME.

Definition at line 314 of file eda_base_frame.cpp.

315 {
316  wxString text;
317 
318  if( IsIconized() )
319  return;
320 
321  wxString baseCfgName = ConfigBaseName();
322 
323  m_FrameSize = GetSize();
324  m_FramePos = GetPosition();
325 
326  text = baseCfgName + wxT( "Pos_x" );
327  aCfg->Write( text, (long) m_FramePos.x );
328 
329  text = baseCfgName + wxT( "Pos_y" );
330  aCfg->Write( text, (long) m_FramePos.y );
331 
332  text = baseCfgName + wxT( "Size_x" );
333  aCfg->Write( text, (long) m_FrameSize.x );
334 
335  text = baseCfgName + wxT( "Size_y" );
336  aCfg->Write( text, (long) m_FrameSize.y );
337 
338  text = baseCfgName + wxT( "Maximized" );
339  aCfg->Write( text, IsMaximized() );
340 
341  if( m_hasAutoSave )
342  {
343  text = baseCfgName + entryAutoSaveInterval;
344  aCfg->Write( text, m_autoSaveInterval );
345  }
346 
347  // Once this is fully implemented, wxAuiManager will be used to maintain
348  // the persistance of the main frame and all it's managed windows and
349  // all of the legacy frame persistence position code can be removed.
350  wxString perspective = m_auimgr.SavePerspective();
351 
352  // printf( "perspective(%s): %s\n",
353  // TO_UTF8( m_FrameName + entryPerspective ), TO_UTF8( perspective ) );
354  aCfg->Write( baseCfgName + entryPerspective, perspective );
355  aCfg->Write( baseCfgName + entryMruPath, m_mruPath );
356 }
wxString m_mruPath
Most recently used path.
wxString ConfigBaseName()
wxAuiManager m_auimgr
static const wxString entryPerspective
Configuration file entry for wxAuiManger perspective.
static const wxString entryAutoSaveInterval
Configuration file entry name for auto save interval.
bool m_hasAutoSave
Flag to indicate if this frame supports auto save.
static const wxString entryMruPath
Configuration file entry for most recently used path.
int m_autoSaveInterval
The auto save interval time in seconds.

References EDA_BASE_FRAME::ConfigBaseName(), entryAutoSaveInterval, entryMruPath, entryPerspective, EDA_BASE_FRAME::m_auimgr, EDA_BASE_FRAME::m_autoSaveInterval, EDA_BASE_FRAME::m_FramePos, EDA_BASE_FRAME::m_FrameSize, EDA_BASE_FRAME::m_hasAutoSave, and EDA_BASE_FRAME::m_mruPath.

Referenced by SIM_PLOT_FRAME::SaveSettings(), EDA_3D_VIEWER::SaveSettings(), KICAD_MANAGER_FRAME::SaveSettings(), CVPCB_MAINFRAME::SaveSettings(), EDA_DRAW_FRAME::SaveSettings(), and EDA_BASE_FRAME::windowClosing().

◆ SetAutoSaveInterval()

void EDA_BASE_FRAME::SetAutoSaveInterval ( int  aInterval)
inherited

Definition at line 196 of file eda_base_frame.cpp.

197 {
198  m_autoSaveInterval = aInterval;
199 
200  if( m_autoSaveTimer->IsRunning() )
201  {
202  if( m_autoSaveInterval > 0 )
203  {
204  m_autoSaveTimer->Start( m_autoSaveInterval * 1000, wxTIMER_ONE_SHOT );
205  }
206  else
207  {
208  m_autoSaveTimer->Stop();
209  m_autoSaveState = false;
210  }
211  }
212 }
bool m_autoSaveState
Flag to indicate the last auto save state.
wxTimer * m_autoSaveTimer
The timer used to implement the auto save feature;.
int m_autoSaveInterval
The auto save interval time in seconds.

References EDA_BASE_FRAME::m_autoSaveInterval, EDA_BASE_FRAME::m_autoSaveState, and EDA_BASE_FRAME::m_autoSaveTimer.

Referenced by EDA_DRAW_FRAME::CommonSettingsChanged().

◆ SetKiway()

void KIWAY_HOLDER::SetKiway ( wxWindow *  aDest,
KIWAY aKiway 
)
inherited

Function SetKiway.

Parameters
aDestis the recipient of aKiway pointer. It is only used for debugging, since "this" is not a wxWindow*. "this" is a KIWAY_HOLDER mix-in.
aKiwayis often from a parent window, or from KIFACE::CreateWindow().

Definition at line 53 of file kiway_holder.cpp.

54 {
55 #if defined(DEBUG)
56  // offer a trap point for debugging most any window
57  wxASSERT( aDest );
58  if( !strcmp( typeid(aDest).name(), "DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB" ) )
59  {
60  int breakhere=1;
61  (void) breakhere;
62  }
63 #endif
64 
65  (void) aDest;
66 
67  m_kiway = aKiway;
68 }
KIWAY * m_kiway
Definition: kiway_player.h:101
const char * name
Definition: DXF_plotter.cpp:61

References KIWAY_HOLDER::m_kiway, and name.

Referenced by InvokePcbLibTableEditor(), and SIM_PLOT_FRAME::SIM_PLOT_FRAME().

◆ SetModal()

void KIWAY_PLAYER::SetModal ( bool  aIsModal)
inlineprotectedinherited

Definition at line 234 of file kiway_player.h.

234 { m_modal = aIsModal; }

References KIWAY_PLAYER::m_modal.

Referenced by FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME().

◆ SetMruPath()

void EDA_BASE_FRAME::SetMruPath ( const wxString &  aPath)
inlineinherited

◆ ShowChangedLanguage()

void EDA_BASE_FRAME::ShowChangedLanguage ( )
virtualinherited

Redraw the menus and what not in current language.

Reimplemented in PCB_EDIT_FRAME, SCH_EDIT_FRAME, LIB_EDIT_FRAME, FOOTPRINT_EDIT_FRAME, GERBVIEW_FRAME, PCB_BASE_FRAME, and CVPCB_MAINFRAME.

Definition at line 233 of file eda_base_frame.cpp.

234 {
235  if( GetMenuBar() )
236  {
237  ReCreateMenuBar();
238  GetMenuBar()->Refresh();
239  }
240 }
virtual void ReCreateMenuBar()
Recreates the menu bar.

References EDA_BASE_FRAME::ReCreateMenuBar().

Referenced by KIWAY::SetLanguage(), CVPCB_MAINFRAME::ShowChangedLanguage(), PCB_BASE_FRAME::ShowChangedLanguage(), GERBVIEW_FRAME::ShowChangedLanguage(), LIB_EDIT_FRAME::ShowChangedLanguage(), and SCH_EDIT_FRAME::ShowChangedLanguage().

◆ ShowModal()

bool KIWAY_PLAYER::ShowModal ( wxString *  aResult = NULL,
wxWindow *  aResultantFocusWindow = NULL 
)
inherited

Function ShowModal puts up this wxFrame as if it were a modal dialog, with all other instantiated wxFrames disabled until this KIWAY_PLAYER derivative calls DismissModal().

That is, behavior is similar to a modal dialog window. Not all KIWAY_PLAYERs use this interface, so don't call this unless the implementation knows how to call DismissModal() on a button click or double click or some special event which ends the modal behavior.

Parameters
aResultif not NULL, indicates a place to put a resultant string.
aResultantFocusWindowif not NULL, indicates what window to pass focus to on return.
Returns
bool - true if frame implementation called KIWAY_PLAYER::DismissModal() with aRetVal of true.

Definition at line 77 of file kiway_player.cpp.

78 {
79  wxASSERT_MSG( IsModal(), wxT( "ShowModal() shouldn't be called on non-modal frame" ) );
80 
81  /*
82  This function has a nice interface but a necessarily unsightly implementation.
83  Now the implementation is encapsulated, localizing future changes.
84 
85  It works in tandem with DismissModal(). But only ShowModal() is in the
86  vtable and therefore cross-module capable.
87  */
88 
89  // This is an exception safe way to zero a pointer before returning.
90  // Yes, even though DismissModal() clears this first normally, this is
91  // here in case there's an exception before the dialog is dismissed.
92  struct NULLER
93  {
94  void*& m_what;
95  NULLER( void*& aPtr ) : m_what( aPtr ) {}
96  ~NULLER() { m_what = 0; } // indeed, set it to NULL on destruction
97  } clear_this( (void*&) m_modal_loop );
98 
99 
100  m_modal_resultant_parent = aResultantFocusWindow;
101 
102  Show( true );
103  Raise(); // Needed on some Window managers to always display the frame
104 
105  SetFocus();
106 
107  {
108  // We have to disable all frames but the the modal one.
109  // wxWindowDisabler does that, but it also disables all top level windows
110  // We do not want to disable top level windows which are child of the modal one,
111  // if they are enabled.
112  // An example is an aui toolbar which was moved
113  // or a dialog or another frame or miniframe opened by the modal one.
114  wxWindowList wlist = GetChildren();
115  std::vector<wxWindow*> enabledTopLevelWindows;
116 
117  for( unsigned ii = 0; ii < wlist.size(); ii++ )
118  if( wlist[ii]->IsTopLevel() && wlist[ii]->IsEnabled() )
119  enabledTopLevelWindows.push_back( wlist[ii] );
120 
121  // exception safe way to disable all top level windows except the modal one,
122  // re-enables only those that were disabled on exit
123  wxWindowDisabler toggle( this );
124 
125  for( unsigned ii = 0; ii < enabledTopLevelWindows.size(); ii++ )
126  enabledTopLevelWindows[ii]->Enable( true );
127 
128  WX_EVENT_LOOP event_loop;
129  m_modal_loop = &event_loop;
130  event_loop.Run();
131 
132  } // End of scope for some variables.
133  // End nesting before setting focus below.
134 
135  if( aResult )
136  *aResult = m_modal_string;
137 
138  if( aResultantFocusWindow )
139  {
140  aResultantFocusWindow->Raise();
141 
142  // have the final say, after wxWindowDisabler reenables my parent and
143  // the events settle down, set the focus
144  wxSafeYield();
145  aResultantFocusWindow->SetFocus();
146  }
147 
148  return m_modal_ret_val;
149 }
bool m_modal_ret_val
Definition: kiway_player.h:260
#define WX_EVENT_LOOP
Definition: kiway_player.h:107
wxWindow * m_modal_resultant_parent
Definition: kiway_player.h:258
wxString m_modal_string
Definition: kiway_player.h:259
bool IsModal()
Definition: kiway_player.h:233
WX_EVENT_LOOP * m_modal_loop
Definition: kiway_player.h:257

References KIWAY_PLAYER::IsModal(), KIWAY_PLAYER::m_modal_loop, KIWAY_PLAYER::m_modal_resultant_parent, KIWAY_PLAYER::m_modal_ret_val, KIWAY_PLAYER::m_modal_string, and WX_EVENT_LOOP.

Referenced by FIELDS_GRID_TRICKS::doPopupSelection(), FIELDS_EDITOR_GRID_TRICKS::doPopupSelection(), TEXT_BUTTON_SYMBOL_CHOOSER::OnButtonClick(), TEXT_BUTTON_FP_CHOOSER::OnButtonClick(), DIALOG_EDIT_ONE_FIELD::OnTextValueSelectButtonClick(), FOOTPRINT_EDIT_FRAME::Process_Special_Functions(), LIB_VIEW_FRAME::ShowModal(), FOOTPRINT_VIEWER_FRAME::ShowModal(), and DIALOG_EXCHANGE_FOOTPRINTS::ViewAndSelectFootprint().

◆ ShowPreferences()

bool EDA_BASE_FRAME::ShowPreferences ( EDA_HOTKEY_CONFIG aHotkeys,
EDA_HOTKEY_CONFIG aShowHotkeys,
const wxString &  aHotkeysNickname 
)
inherited

Definition at line 512 of file eda_base_frame.cpp.

514 {
515  PAGED_DIALOG dlg( this, _( "Preferences" ) );
516  wxTreebook* book = dlg.GetTreebook();
517 
518  book->AddPage( new PANEL_COMMON_SETTINGS( &dlg, book ), _( "Common" ) );
519  book->AddPage( new PANEL_HOTKEYS_EDITOR( this, book, false,
520  aHotkeys, aShowHotkeys, aHotkeysNickname ), _( "Hotkeys" ) );
521 
522  for( unsigned i = 0; i < KIWAY_PLAYER_COUNT; ++i )
523  {
524  KIWAY_PLAYER* frame = dlg.Kiway().Player( (FRAME_T) i, false );
525 
526  if( frame )
527  frame->InstallPreferences( &dlg );
528  }
529 
530  if( dlg.ShowModal() == wxID_OK )
531  {
532  dlg.Kiway().CommonSettingsChanged();
533  return true;
534  }
535 
536  return false;
537 }
Class KIWAY_PLAYER is a wxFrame capable of the OpenProjectFiles function, meaning it can load a porti...
Definition: kiway_player.h:127
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_player.h:61
FRAME_T
Enum FRAME_T is the set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
Definition: frame_type.h:34
VTBL_ENTRY KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=NULL)
Function Player returns the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:321
size_t i
Definition: json11.cpp:597
virtual void InstallPreferences(PAGED_DIALOG *aParent)
Allow a frame to load its preference panels (if any) into the preferences dialog.

References KIWAY::CommonSettingsChanged(), PAGED_DIALOG::GetTreebook(), i, EDA_BASE_FRAME::InstallPreferences(), KIWAY_HOLDER::Kiway(), KIWAY_PLAYER_COUNT, and KIWAY::Player().

Referenced by KICAD_MANAGER_FRAME::OnPreferences(), LIB_EDIT_FRAME::OnPreferencesOptions(), SCH_EDIT_FRAME::OnPreferencesOptions(), PL_EDITOR_FRAME::Process_Config(), PCB_EDIT_FRAME::Process_Config(), GERBVIEW_FRAME::Process_Config(), and FOOTPRINT_EDIT_FRAME::ProcessPreferences().

◆ sys_search()

const SEARCH_STACK & EDA_BASE_FRAME::sys_search ( )
protectedvirtualinherited

Return a SEARCH_STACK pertaining to entire program.

This is overloaded in KICAD_MANAGER_FRAME

Reimplemented in KICAD_MANAGER_FRAME.

Definition at line 368 of file eda_base_frame.cpp.

369 {
370  return Kiface().KifaceSearch();
371 }
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
SEARCH_STACK & KifaceSearch()
Only for DSO specific 'non-library' files.
Definition: kiface_i.h:127

References Kiface(), and KIFACE_I::KifaceSearch().

Referenced by EDA_BASE_FRAME::GetKicadHelp().

◆ UpdateFileHistory()

void EDA_BASE_FRAME::UpdateFileHistory ( const wxString &  FullFileName,
wxFileHistory *  aFileHistory = NULL 
)
inherited

Update the list of recently opened files.

The menu is also updated, if wxFileHistory::UseMenu was called at init time.

Parameters
FullFileNameThe full file name including the path.
aFileHistoryThe wxFileHistory in use. If NULL, the main application file history is used.

Definition at line 386 of file eda_base_frame.cpp.

388 {
389  wxFileHistory* fileHistory = aFileHistory;
390 
391  if( !fileHistory )
392  fileHistory = &Kiface().GetFileHistory();
393 
394  fileHistory->AddFileToHistory( FullFileName );
395 }
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
FILE_HISTORY & GetFileHistory()
Definition: kiface_i.h:123

References KIFACE_I::GetFileHistory(), and Kiface().

Referenced by SCH_EDIT_FRAME::importFile(), GERBVIEW_FRAME::LoadExcellonFiles(), GERBVIEW_FRAME::LoadGerberJobFile(), GERBVIEW_FRAME::loadListOfGerberAndDrillFiles(), PL_EDITOR_FRAME::LoadPageLayoutDescrFile(), KICAD_MANAGER_FRAME::LoadProject(), KICAD_MANAGER_FRAME::OnCloseWindow(), SCH_EDIT_FRAME::OnCloseWindow(), SCH_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::SavePcbFile(), and GERBVIEW_FRAME::unarchiveFiles().

◆ WriteHotkeyConfig()

int EDA_BASE_FRAME::WriteHotkeyConfig ( struct EDA_HOTKEY_CONFIG aDescList,
wxString *  aFullFileName = NULL 
)
virtualinherited

Store the current hotkey list.

The hotkey list is stored using the standard wxConfig mechanism or a file.

Parameters
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 489 of file hotkeys_basic.cpp.

491 {
492  wxString msg;
493  wxString keyname, infokey;
494  FILE* file;
495 
496  msg = wxT( "$hotkey list\n" );
497 
498  // Print the current hotkey list
499  EDA_HOTKEY** list;
500 
501  for( ; aDescList->m_HK_InfoList != nullptr; aDescList++ )
502  {
503  if( aDescList->m_Title )
504  {
505  msg += wxT( "# " );
506  msg += *aDescList->m_Title;
507  msg += wxT( "\n" );
508  }
509 
510  msg += *aDescList->m_SectionTag;
511  msg += wxT( "\n" );
512 
513  list = aDescList->m_HK_InfoList;
514 
515  for( ; *list != nullptr; list++ )
516  {
517  EDA_HOTKEY* hk_decr = *list;
518  msg += wxT( "shortcut " );
519  keyname = KeyNameFromKeyCode( hk_decr->m_KeyCode );
520  AddDelimiterString( keyname );
521  infokey = hk_decr->m_InfoMsg;
522  AddDelimiterString( infokey );
523  msg += keyname + wxT( ": " ) + infokey + wxT( "\n" );
524  }
525  }
526 
527  msg += wxT( "$Endlist\n" );
528 
529  if( aFullFileName )
530  file = wxFopen( *aFullFileName, wxT( "wt" ) );
531  else
532  {
533  wxString configName( ConfigBaseName() );
534  if( configName == SCH_EDIT_FRAME_NAME || configName == LIB_EDIT_FRAME_NAME )
535  configName = EESCHEMA_HOTKEY_NAME;
536  else if( configName == PCB_EDIT_FRAME_NAME ||
537  configName == FOOTPRINT_EDIT_FRAME_NAME )
538  configName = PCBNEW_HOTKEY_NAME;
539 
540  wxFileName fn( configName );
541  fn.SetExt( DEFAULT_HOTKEY_FILENAME_EXT );
542  fn.SetPath( GetKicadConfigPath() );
543  file = wxFopen( fn.GetFullPath(), wxT( "wt" ) );
544  }
545 
546  if( file )
547  {
548  wxFputs( msg, file );
549  fclose( file );
550  }
551  else
552  {
553  msg.Printf( wxT( "Unable to write file %s" ), GetChars( *aFullFileName ) );
554  return 0;
555  }
556 
557  return 1;
558 }
#define LIB_EDIT_FRAME_NAME
Definition: draw_frame.h:50
EDA_HOTKEY ** m_HK_InfoList
Definition: hotkeys_basic.h:98
wxString ConfigBaseName()
#define PCB_EDIT_FRAME_NAME
Definition: draw_frame.h:57
#define SCH_EDIT_FRAME_NAME
Definition: draw_frame.h:51
#define FOOTPRINT_EDIT_FRAME_NAME
Definition: draw_frame.h:54
void AddDelimiterString(wxString &string)
Function AddDelimiterString Add un " to the start and the end of string (if not already done).
Definition: gestfich.cpp:44
wxString GetKicadConfigPath()
Return the user configuration path used to store KiCad's configuration files.
Definition: common.cpp:267
wxString * m_SectionTag
Definition: hotkeys_basic.h:97
wxString m_InfoMsg
Definition: hotkeys_basic.h:66
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:100
class EDA_HOTKEY is a class to handle hot key commands.
Definition: hotkeys_basic.h:59
wxString * m_Title
Definition: hotkeys_basic.h:99
#define EESCHEMA_HOTKEY_NAME
Definition: hotkeys_basic.h:35
wxString KeyNameFromKeyCode(int aKeycode, bool *aIsFound)
Function KeyNameFromKeyCode return the key name from the key code Only some wxWidgets key values are ...
#define DEFAULT_HOTKEY_FILENAME_EXT
Definition: hotkeys_basic.h:34
#define PCBNEW_HOTKEY_NAME
Definition: hotkeys_basic.h:36

References AddDelimiterString(), EDA_BASE_FRAME::ConfigBaseName(), DEFAULT_HOTKEY_FILENAME_EXT, EESCHEMA_HOTKEY_NAME, FOOTPRINT_EDIT_FRAME_NAME, GetChars(), GetKicadConfigPath(), KeyNameFromKeyCode(), LIB_EDIT_FRAME_NAME, EDA_HOTKEY_CONFIG::m_HK_InfoList, EDA_HOTKEY::m_InfoMsg, EDA_HOTKEY::m_KeyCode, EDA_HOTKEY_CONFIG::m_SectionTag, EDA_HOTKEY_CONFIG::m_Title, PCB_EDIT_FRAME_NAME, PCBNEW_HOTKEY_NAME, and SCH_EDIT_FRAME_NAME.

Referenced by EDA_BASE_FRAME::ExportHotkeyConfigToFile(), EDA_BASE_FRAME::ImportHotkeyConfigFromFile(), PANEL_HOTKEYS_EDITOR::TransferDataFromWindow(), and EDA_DRAW_FRAME::WriteHotkeyConfig().

Member Data Documentation

◆ KICAD_AUI_TB_STYLE

◆ m_AboutTitle

wxString EDA_BASE_FRAME::m_AboutTitle
protectedinherited

◆ m_addSignals

wxMenuItem* SIM_PLOT_FRAME_BASE::m_addSignals
protected

Definition at line 59 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME::SIM_PLOT_FRAME(), and SIM_PLOT_FRAME_BASE().

◆ m_auimgr

◆ m_autoSaveInterval

◆ m_autoSaveState

bool EDA_BASE_FRAME::m_autoSaveState
protectedinherited

◆ m_autoSaveTimer

wxTimer* EDA_BASE_FRAME::m_autoSaveTimer
protectedinherited

◆ m_configFrameName

wxString EDA_BASE_FRAME::m_configFrameName
protectedinherited

prefix used in config to identify some params (frame size...)

if empty, the frame name defined in CTOR is used

Definition at line 124 of file eda_base_frame.h.

Referenced by EDA_BASE_FRAME::ConfigBaseName(), and FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME().

◆ m_cursors

wxListCtrl* SIM_PLOT_FRAME_BASE::m_cursors
protected

Definition at line 88 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME::onCursorUpdate(), and SIM_PLOT_FRAME_BASE().

◆ m_fileMenu

wxMenu* SIM_PLOT_FRAME_BASE::m_fileMenu
protected

Definition at line 56 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

◆ m_FramePos

◆ m_FrameSize

◆ m_hasAutoSave

bool EDA_BASE_FRAME::m_hasAutoSave
protectedinherited

Flag to indicate if this frame supports auto save.

Definition at line 132 of file eda_base_frame.h.

Referenced by EDA_BASE_FRAME::EDA_BASE_FRAME(), EDA_BASE_FRAME::LoadSettings(), EDA_BASE_FRAME::ProcessEvent(), and EDA_BASE_FRAME::SaveSettings().

◆ m_Ident

FRAME_T EDA_BASE_FRAME::m_Ident
protectedinherited

◆ m_mainMenu

wxMenuBar* SIM_PLOT_FRAME_BASE::m_mainMenu
protected

◆ m_modal

bool KIWAY_PLAYER::m_modal
protectedinherited

Definition at line 256 of file kiway_player.h.

Referenced by KIWAY_PLAYER::IsModal(), and KIWAY_PLAYER::SetModal().

◆ m_modal_loop

WX_EVENT_LOOP* KIWAY_PLAYER::m_modal_loop
protectedinherited

◆ m_modal_resultant_parent

wxWindow* KIWAY_PLAYER::m_modal_resultant_parent
protectedinherited

Definition at line 258 of file kiway_player.h.

Referenced by KIWAY_PLAYER::ShowModal().

◆ m_modal_ret_val

bool KIWAY_PLAYER::m_modal_ret_val
protectedinherited

◆ m_modal_string

wxString KIWAY_PLAYER::m_modal_string
protectedinherited

Definition at line 259 of file kiway_player.h.

Referenced by KIWAY_PLAYER::DismissModal(), and KIWAY_PLAYER::ShowModal().

◆ m_mruPath

◆ m_panelConsole

wxPanel* SIM_PLOT_FRAME_BASE::m_panelConsole
protected

Definition at line 77 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

◆ m_panelCursors

wxPanel* SIM_PLOT_FRAME_BASE::m_panelCursors
protected

Definition at line 87 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

◆ m_panelCursorsAndTune

wxPanel* SIM_PLOT_FRAME_BASE::m_panelCursorsAndTune
protected

Definition at line 85 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

◆ m_panelLeft

wxPanel* SIM_PLOT_FRAME_BASE::m_panelLeft
protected

Definition at line 68 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

◆ m_panelSignals

wxPanel* SIM_PLOT_FRAME_BASE::m_panelSignals
protected

Definition at line 83 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

◆ m_perspective

wxString EDA_BASE_FRAME::m_perspective
protectedinherited

wxAuiManager perspective.

Definition at line 143 of file eda_base_frame.h.

Referenced by EDA_BASE_FRAME::LoadSettings().

◆ m_plotNotebook

◆ m_plotPanel

wxPanel* SIM_PLOT_FRAME_BASE::m_plotPanel
protected

Definition at line 71 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

◆ m_probeSignals

wxMenuItem* SIM_PLOT_FRAME_BASE::m_probeSignals
protected

Definition at line 60 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME::SIM_PLOT_FRAME(), and SIM_PLOT_FRAME_BASE().

◆ m_runSimulation

wxMenuItem* SIM_PLOT_FRAME_BASE::m_runSimulation
protected

Definition at line 58 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME::SIM_PLOT_FRAME(), and SIM_PLOT_FRAME_BASE().

◆ m_settings

wxMenuItem* SIM_PLOT_FRAME_BASE::m_settings
protected

Definition at line 63 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME::SIM_PLOT_FRAME(), and SIM_PLOT_FRAME_BASE().

◆ m_showNetlist

wxMenuItem* SIM_PLOT_FRAME_BASE::m_showNetlist
protected

Definition at line 62 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME::SIM_PLOT_FRAME(), and SIM_PLOT_FRAME_BASE().

◆ m_sidePanel

wxPanel* SIM_PLOT_FRAME_BASE::m_sidePanel
protected

Definition at line 80 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

◆ m_sideSizer

wxBoxSizer* SIM_PLOT_FRAME_BASE::m_sideSizer
protected

Definition at line 81 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

◆ m_signals

◆ m_simConsole

wxTextCtrl* SIM_PLOT_FRAME_BASE::m_simConsole
protected

◆ m_simulationMenu

wxMenu* SIM_PLOT_FRAME_BASE::m_simulationMenu
protected

Definition at line 57 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

◆ m_sizer11

wxBoxSizer* SIM_PLOT_FRAME_BASE::m_sizer11
protected

Definition at line 69 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

◆ m_sizer8

wxBoxSizer* SIM_PLOT_FRAME_BASE::m_sizer8
protected

Definition at line 75 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

◆ m_sizerConsole

wxBoxSizer* SIM_PLOT_FRAME_BASE::m_sizerConsole
protected

Definition at line 78 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

◆ m_sizerMain

wxBoxSizer* SIM_PLOT_FRAME_BASE::m_sizerMain
protected

Definition at line 65 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

◆ m_sizerPlot

wxBoxSizer* SIM_PLOT_FRAME_BASE::m_sizerPlot
protected

Definition at line 72 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

◆ m_splitterLeftRight

wxSplitterWindow* SIM_PLOT_FRAME_BASE::m_splitterLeftRight
protected

◆ m_splitterPlotAndConsole

wxSplitterWindow* SIM_PLOT_FRAME_BASE::m_splitterPlotAndConsole
protected

◆ m_splitterSignals

wxSplitterWindow* SIM_PLOT_FRAME_BASE::m_splitterSignals
protected

◆ m_splitterTuneValues

wxSplitterWindow* SIM_PLOT_FRAME_BASE::m_splitterTuneValues
protected

◆ m_staticTextInfo

wxStaticText* SIM_PLOT_FRAME_BASE::m_staticTextInfo
protected

Definition at line 76 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

◆ m_toolBar

wxToolBar* SIM_PLOT_FRAME_BASE::m_toolBar
protected

◆ m_tunePanel

wxPanel* SIM_PLOT_FRAME_BASE::m_tunePanel
protected

◆ m_tuneSizer

wxBoxSizer* SIM_PLOT_FRAME_BASE::m_tuneSizer
protected

Definition at line 91 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME::AddTuner(), and SIM_PLOT_FRAME_BASE().

◆ m_tuneSizerStb

wxStaticBoxSizer* SIM_PLOT_FRAME_BASE::m_tuneSizerStb
protected

Definition at line 90 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

◆ m_tuneValue

wxMenuItem* SIM_PLOT_FRAME_BASE::m_tuneValue
protected

Definition at line 61 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME::SIM_PLOT_FRAME(), and SIM_PLOT_FRAME_BASE().

◆ m_viewMenu

wxMenu* SIM_PLOT_FRAME_BASE::m_viewMenu
protected

Definition at line 64 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

◆ m_welcomePanel

wxPanel* SIM_PLOT_FRAME_BASE::m_welcomePanel
protected

The documentation for this class was generated from the following files: