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(883, 594), 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 ImportFile (const wxString &aFileName, int aFileType)
 Function ImportFile load the given filename but sets the path to the current project path. More...
 
VTBL_ENTRY void ReadPcbNetlist (const wxString &aNetlistFileName, const wxString &aCmpFileName, REPORTER *aReporter, bool aChangeFootprint, bool aDeleteBadTracks, bool aDeleteExtraFootprints, bool aSelectByTimestamp, bool aDeleteSinglePadNets, bool aIsDryRun)
 Function ReadPcbNetlist provides access to PcbNew's function ReadPcbNetlist. More...
 
VTBL_ENTRY bool CreateNetlist (int aFormat, const wxString &aFullFileName, unsigned aNetlistOptions, REPORTER *aReporter=NULL, bool silent=false)
 Function ReadPcbNetlist provides access to Eeschema's function CreateNetlist. 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
 Function ProcessEvent overrides the default process event handler to implement the auto save feature. More...
 
bool Enable (bool enable) override
 
void SetAutoSaveInterval (int aInterval)
 
int GetAutoSaveInterval () const
 
bool IsType (FRAME_T aType) const
 
void GetKicadHelp (wxCommandEvent &event)
 
void GetKicadContribute (wxCommandEvent &event)
 
void GetKicadAbout (wxCommandEvent &event)
 
void PrintMsg (const wxString &text)
 
virtual void LoadSettings (wxConfigBase *aCfg)
 Function LoadSettings loads common frame parameters from a configuration file. More...
 
virtual void SaveSettings (wxConfigBase *aCfg)
 Function SaveSettings saves common frame parameters to a configuration data file. More...
 
wxString ConfigBaseName ()
 Function ConfigBaseName. More...
 
virtual void SaveProjectSettings (bool aAskForSave)
 Function SaveProjectSettings saves changes to the project settings to the project (.pro) file. More...
 
virtual void OnSelectPreferredEditor (wxCommandEvent &event)
 Function OnSelectPreferredEditor Open a dialog to select the editor that will used in KiCad to edit or display files (reports ... More...
 
int ReadHotkeyConfig (struct EDA_HOTKEY_CONFIG *aDescList)
 Function ReadHotkeyConfig Read configuration data and fill the current hotkey list with hotkeys. More...
 
virtual int WriteHotkeyConfig (struct EDA_HOTKEY_CONFIG *aDescList, wxString *aFullFileName=NULL)
 Function WriteHotkeyConfig Store the current hotkey list It is stored using the standard wxConfig mechanism or a file. More...
 
int ReadHotkeyConfigFile (const wxString &aFilename, struct EDA_HOTKEY_CONFIG *aDescList)
 Function ReadHotkeyConfigFile Read an old configuration file (&ltfile&gt.key) and fill the current hotkey list with hotkeys. More...
 
void ImportHotkeyConfigFromFile (EDA_HOTKEY_CONFIG *aDescList, const wxString &aDefaultShortname)
 Function ImportHotkeyConfigFromFile Prompt the user for an old hotkey file to read, and read it. More...
 
void ExportHotkeyConfigToFile (EDA_HOTKEY_CONFIG *aDescList, const wxString &aDefaultShortname)
 Function ExportHotkeyConfigToFile Prompt the user for an old hotkey file to read, and read it. More...
 
wxString GetFileFromHistory (int cmdId, const wxString &type, wxFileHistory *aFileHistory=NULL)
 Function GetFileFromHistory fetches the file name from the file history list. More...
 
void UpdateFileHistory (const wxString &FullFileName, wxFileHistory *aFileHistory=NULL)
 Function UpdateFileHistory Updates the list of recently opened files. More...
 
void SetMruPath (const wxString &aPath)
 
wxString GetMruPath () const
 
virtual void ReCreateMenuBar ()
 Function ReCreateMenuBar Creates recreates the menu bar. More...
 
bool IsWritable (const wxFileName &aFileName)
 Function IsWritable checks if aFileName can be written. More...
 
void CheckForAutoSaveFile (const wxFileName &aFileName, const wxString &aBackupFileExtension)
 Function CheckForAutoSaveFile checks if an auto save file exists for aFileName and takes the appropriate action depending on the user input. More...
 
virtual void ShowChangedLanguage ()
 Function ShowChangedLanguage redraws the menus and what not in current language. More...
 
virtual void ShowChangedIcons ()
 Function ShowChangedIcons redraws items menus after a icon was changed option. More...
 
void AddMenuIconsOptions (wxMenu *MasterMenu)
 Function AddMenuIconsOptions creates a menu list for icons in menu and icon sizes choice, and add it as submenu to MasterMenu. More...
 
bool PostCommandMenuEvent (int evt_type)
 Function PostCommandMenuEvent. More...
 
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...
 
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 OnChangeIconsOptions (wxCommandEvent &event) override
 Function OnChangeIconsOptions is an event handler called on a icons options in menus or toolbars menu selection. More...
 
void onAutoSaveTimer (wxTimerEvent &aEvent)
 Function onAutoSaveTimer handles the auto save timer event. More...
 
virtual bool isAutoSaveRequired () const
 Function autoSaveRequired returns the auto save status of the application. More...
 
virtual bool doAutoSave ()
 Function doAutoSave should be overridden by the derived class to handle the auto save feature. More...
 
virtual wxConfigBase * config ()
 Function config returns the wxConfigBase used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME. More...
 
virtual const SEARCH_STACKsys_search ()
 Function sys_search returns a SEARCH_STACK pertaining to entire program, and is overloaded in KICAD_MANAGER_FRAME. More...
 
virtual wxString help_name ()
 

Protected Attributes

wxMenuBar * m_mainMenu
 
wxMenu * m_fileMenu
 
wxMenu * m_simulationMenu
 
wxMenuItem * m_runSimulation
 
wxMenuItem * m_addSignals
 
wxMenuItem * m_probeSignals
 
wxMenuItem * m_tuneValue
 
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_staticText2
 
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...) if empty, the frame name defined in CTOR is used More...
 
wxAuiToolBar * m_mainToolBar
 Standard horizontal Toolbar. More...
 
wxString m_AboutTitle
 Name of program displayed in About. More...
 
wxAuiManager m_auimgr
 
bool m_hasAutoSave
 Flag to indicate if this frame supports auto save. More...
 
bool m_autoSaveState
 Flag to indicate the last auto save state. More...
 
int m_autoSaveInterval
 The auto save interval time in seconds. More...
 
wxTimer * m_autoSaveTimer
 The timer used to implement the auto save feature;. More...
 
wxString m_perspective
 wxAuiManager perspective. More...
 
wxString m_mruPath
 Most recently used path. More...
 

Static Protected Attributes

static constexpr int KICAD_AUI_TB_STYLE = wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_PLAIN_BACKGROUND
 

Default style flags used for wxAUI toolbars

More...
 

Detailed Description

Class SIM_PLOT_FRAME_BASE.

Definition at line 44 of file sim_plot_frame_base.h.

Constructor & Destructor Documentation

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( 883,594 ),
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.

References 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_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_staticText2, 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().

12  : KIWAY_PLAYER( parent, id, title, pos, size, style, name )
13 {
14  this->SetSizeHints( wxSize( 600,500 ), 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, wxID_ANY, 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, wxID_ANY, 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, wxID_ANY, wxString( _("Run Simulation") ) , wxEmptyString, wxITEM_NORMAL );
53 
54  m_simulationMenu->AppendSeparator();
55 
56  m_addSignals = new wxMenuItem( m_simulationMenu, wxID_ANY, wxString( _("Add signals...") ) , wxEmptyString, wxITEM_NORMAL );
57  m_simulationMenu->Append( m_addSignals );
58 
59  m_probeSignals = new wxMenuItem( m_simulationMenu, wxID_ANY, wxString( _("Probe from schematics") ) , wxEmptyString, wxITEM_NORMAL );
61 
62  m_tuneValue = new wxMenuItem( m_simulationMenu, wxID_ANY, wxString( _("Tune component value") ) , wxEmptyString, wxITEM_NORMAL );
63  m_simulationMenu->Append( m_tuneValue );
64 
65  m_simulationMenu->AppendSeparator();
66 
67  m_settings = new wxMenuItem( m_simulationMenu, wxID_ANY, wxString( _("Settings...") ) , wxEmptyString, wxITEM_NORMAL );
68  m_simulationMenu->Append( m_settings );
69 
70  m_mainMenu->Append( m_simulationMenu, _("Simulation") );
71 
72  m_viewMenu = new wxMenu();
73  wxMenuItem* m_zoomIn;
74  m_zoomIn = new wxMenuItem( m_viewMenu, wxID_ZOOM_IN, wxString( _("Zoom In") ) , wxEmptyString, wxITEM_NORMAL );
75  m_viewMenu->Append( m_zoomIn );
76 
77  wxMenuItem* m_zoomOut;
78  m_zoomOut = new wxMenuItem( m_viewMenu, wxID_ZOOM_OUT, wxString( _("Zoom Out") ) , wxEmptyString, wxITEM_NORMAL );
79  m_viewMenu->Append( m_zoomOut );
80 
81  wxMenuItem* m_zoomFit;
82  m_zoomFit = new wxMenuItem( m_viewMenu, wxID_ZOOM_FIT, wxString( _("Fit on Screen") ) , wxEmptyString, wxITEM_NORMAL );
83  m_viewMenu->Append( m_zoomFit );
84 
85  m_viewMenu->AppendSeparator();
86 
87  wxMenuItem* m_showGrid;
88  m_showGrid = new wxMenuItem( m_viewMenu, wxID_ANY, wxString( _("Show &grid") ) , wxEmptyString, wxITEM_CHECK );
89  m_viewMenu->Append( m_showGrid );
90 
91  wxMenuItem* m_showLegend;
92  m_showLegend = new wxMenuItem( m_viewMenu, wxID_ANY, wxString( _("Show &legend") ) , wxEmptyString, wxITEM_CHECK );
93  m_viewMenu->Append( m_showLegend );
94 
95  m_mainMenu->Append( m_viewMenu, _("View") );
96 
97  this->SetMenuBar( m_mainMenu );
98 
99  m_sizerMain = new wxBoxSizer( wxVERTICAL );
100 
101  m_toolBar = new wxToolBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_FLAT|wxTB_HORIZONTAL|wxTB_TEXT );
102  m_toolBar->Realize();
103 
104  m_sizerMain->Add( m_toolBar, 0, wxEXPAND, 5 );
105 
106  m_splitterLeftRight = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D );
107  m_splitterLeftRight->SetSashGravity( 0.7 );
108  m_splitterLeftRight->Connect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterLeftRightOnIdle ), NULL, this );
109  m_splitterLeftRight->SetMinimumPaneSize( 50 );
110 
111  m_panelLeft = new wxPanel( m_splitterLeftRight, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
112  m_panelLeft->SetMinSize( wxSize( 300,-1 ) );
113 
114  m_sizer11 = new wxBoxSizer( wxVERTICAL );
115 
116  m_splitterPlotAndConsole = new wxSplitterWindow( m_panelLeft, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D );
117  m_splitterPlotAndConsole->SetSashGravity( 0.8 );
118  m_splitterPlotAndConsole->Connect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterPlotAndConsoleOnIdle ), NULL, this );
119  m_splitterPlotAndConsole->SetMinimumPaneSize( 50 );
120 
121  m_plotPanel = new wxPanel( m_splitterPlotAndConsole, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
122  m_plotPanel->SetMinSize( wxSize( -1,200 ) );
123 
124  m_sizerPlot = new wxBoxSizer( wxHORIZONTAL );
125 
126  m_plotNotebook = new wxAuiNotebook( m_plotPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_MIDDLE_CLICK_CLOSE|wxAUI_NB_TAB_MOVE|wxAUI_NB_TAB_SPLIT|wxAUI_NB_TOP );
127  m_welcomePanel = new wxPanel( m_plotNotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
128  m_sizer8 = new wxBoxSizer( wxVERTICAL );
129 
130 
131  m_sizer8->Add( 0, 0, 1, wxEXPAND, 5 );
132 
133  wxBoxSizer* bSizer81;
134  bSizer81 = new wxBoxSizer( wxHORIZONTAL );
135 
136 
137  bSizer81->Add( 0, 0, 1, wxEXPAND, 5 );
138 
139  m_staticText2 = new wxStaticText( m_welcomePanel, wxID_ANY, _("Start the simulation by clicking the Run Simulation button"), wxDefaultPosition, wxDefaultSize, 0 );
140  m_staticText2->Wrap( -1 );
141  m_staticText2->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
142  m_staticText2->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) );
143 
144  bSizer81->Add( m_staticText2, 0, wxALIGN_RIGHT|wxALL|wxEXPAND, 5 );
145 
146 
147  bSizer81->Add( 0, 0, 1, wxEXPAND, 5 );
148 
149 
150  m_sizer8->Add( bSizer81, 0, wxEXPAND, 5 );
151 
152 
153  m_sizer8->Add( 0, 0, 1, wxEXPAND, 5 );
154 
155 
156  m_welcomePanel->SetSizer( m_sizer8 );
157  m_welcomePanel->Layout();
158  m_sizer8->Fit( m_welcomePanel );
159  m_plotNotebook->AddPage( m_welcomePanel, _("a page"), false, wxNullBitmap );
160 
161  m_sizerPlot->Add( m_plotNotebook, 1, wxEXPAND | wxALL, 5 );
162 
163 
164  m_plotPanel->SetSizer( m_sizerPlot );
165  m_plotPanel->Layout();
166  m_sizerPlot->Fit( m_plotPanel );
167  m_panelConsole = new wxPanel( m_splitterPlotAndConsole, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
168  m_panelConsole->SetMinSize( wxSize( -1,100 ) );
169 
170  m_sizerConsole = new wxBoxSizer( wxVERTICAL );
171 
172  m_simConsole = new wxTextCtrl( m_panelConsole, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_DONTWRAP|wxTE_MULTILINE|wxTE_READONLY );
173  m_simConsole->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
174 
175  m_sizerConsole->Add( m_simConsole, 1, wxALL|wxEXPAND, 5 );
176 
177 
178  m_panelConsole->SetSizer( m_sizerConsole );
179  m_panelConsole->Layout();
181  m_splitterPlotAndConsole->SplitHorizontally( m_plotPanel, m_panelConsole, 500 );
182  m_sizer11->Add( m_splitterPlotAndConsole, 1, wxEXPAND, 5 );
183 
184 
185  m_panelLeft->SetSizer( m_sizer11 );
186  m_panelLeft->Layout();
187  m_sizer11->Fit( m_panelLeft );
188  m_sidePanel = new wxPanel( m_splitterLeftRight, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
189  m_sidePanel->SetMinSize( wxSize( 200,-1 ) );
190 
191  m_sideSizer = new wxBoxSizer( wxVERTICAL );
192 
193  m_splitterSignals = new wxSplitterWindow( m_sidePanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D );
194  m_splitterSignals->SetSashGravity( 0.3 );
195  m_splitterSignals->Connect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterSignalsOnIdle ), NULL, this );
196  m_splitterSignals->SetMinimumPaneSize( 20 );
197 
198  m_panelSignals = new wxPanel( m_splitterSignals, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
199  m_panelSignals->SetMinSize( wxSize( -1,100 ) );
200 
201  wxStaticBoxSizer* sbSizer1;
202  sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( m_panelSignals, wxID_ANY, _("Signals") ), wxVERTICAL );
203 
204  m_signals = new wxListView( sbSizer1->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxLC_SINGLE_SEL );
205  sbSizer1->Add( m_signals, 1, wxALL|wxEXPAND, 5 );
206 
207 
208  m_panelSignals->SetSizer( sbSizer1 );
209  m_panelSignals->Layout();
210  sbSizer1->Fit( m_panelSignals );
211  m_panelCursorsAndTune = new wxPanel( m_splitterSignals, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
212  m_panelCursorsAndTune->SetMinSize( wxSize( -1,300 ) );
213 
214  wxBoxSizer* bSizer9;
215  bSizer9 = new wxBoxSizer( wxVERTICAL );
216 
217  m_splitterTuneValues = new wxSplitterWindow( m_panelCursorsAndTune, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D );
218  m_splitterTuneValues->SetSashGravity( 0.5 );
219  m_splitterTuneValues->Connect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterTuneValuesOnIdle ), NULL, this );
220  m_splitterTuneValues->SetMinimumPaneSize( 20 );
221 
222  m_panelCursors = new wxPanel( m_splitterTuneValues, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
223  m_panelCursors->SetMinSize( wxSize( -1,100 ) );
224 
225  wxStaticBoxSizer* sbSizer3;
226  sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( m_panelCursors, wxID_ANY, _("Cursors") ), wxVERTICAL );
227 
228  m_cursors = new wxListCtrl( sbSizer3->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL );
229  sbSizer3->Add( m_cursors, 1, wxALL|wxEXPAND, 5 );
230 
231 
232  m_panelCursors->SetSizer( sbSizer3 );
233  m_panelCursors->Layout();
234  sbSizer3->Fit( m_panelCursors );
235  m_tunePanel = new wxPanel( m_splitterTuneValues, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
236  m_tunePanel->SetMinSize( wxSize( -1,200 ) );
237 
238  m_tuneSizerStb = new wxStaticBoxSizer( new wxStaticBox( m_tunePanel, wxID_ANY, _("Tune") ), wxHORIZONTAL );
239 
240  m_tuneSizer = new wxBoxSizer( wxHORIZONTAL );
241 
242 
243  m_tuneSizerStb->Add( m_tuneSizer, 1, wxEXPAND, 5 );
244 
245 
246  m_tunePanel->SetSizer( m_tuneSizerStb );
247  m_tunePanel->Layout();
248  m_tuneSizerStb->Fit( m_tunePanel );
249  m_splitterTuneValues->SplitHorizontally( m_panelCursors, m_tunePanel, 0 );
250  bSizer9->Add( m_splitterTuneValues, 1, wxEXPAND, 5 );
251 
252 
253  m_panelCursorsAndTune->SetSizer( bSizer9 );
254  m_panelCursorsAndTune->Layout();
255  bSizer9->Fit( m_panelCursorsAndTune );
256  m_splitterSignals->SplitHorizontally( m_panelSignals, m_panelCursorsAndTune, 0 );
257  m_sideSizer->Add( m_splitterSignals, 1, wxEXPAND, 5 );
258 
259 
260  m_sidePanel->SetSizer( m_sideSizer );
261  m_sidePanel->Layout();
262  m_sideSizer->Fit( m_sidePanel );
263  m_splitterLeftRight->SplitVertically( m_panelLeft, m_sidePanel, 700 );
264  m_sizerMain->Add( m_splitterLeftRight, 1, wxEXPAND, 5 );
265 
266 
267  this->SetSizer( m_sizerMain );
268  this->Layout();
269 
270  this->Centre( wxBOTH );
271 
272  // Connect Events
273  this->Connect( m_newPlot->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuNewPlot ) );
274  this->Connect( m_openWorkbook->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuOpenWorkbook ) );
275  this->Connect( m_saveWorkbook->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuSaveWorkbook ) );
276  this->Connect( m_saveImage->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuSaveImage ) );
277  this->Connect( m_saveCsv->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuSaveCsv ) );
278  this->Connect( m_exitSim->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuExit ) );
279  this->Connect( m_zoomIn->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuZoomIn ) );
280  this->Connect( m_zoomOut->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuZoomOut ) );
281  this->Connect( m_zoomFit->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuZoomFit ) );
282  this->Connect( m_showGrid->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuShowGrid ) );
283  this->Connect( m_showGrid->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SIM_PLOT_FRAME_BASE::menuShowGridUpdate ) );
284  this->Connect( m_showLegend->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuShowLegend ) );
285  this->Connect( m_showLegend->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SIM_PLOT_FRAME_BASE::menuShowLegendUpdate ) );
286  m_plotNotebook->Connect( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED, wxAuiNotebookEventHandler( SIM_PLOT_FRAME_BASE::onPlotChanged ), NULL, this );
287  m_plotNotebook->Connect( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE, wxAuiNotebookEventHandler( SIM_PLOT_FRAME_BASE::onPlotClose ), NULL, this );
288  m_signals->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( SIM_PLOT_FRAME_BASE::onSignalDblClick ), NULL, this );
289  m_signals->Connect( wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, wxListEventHandler( SIM_PLOT_FRAME_BASE::onSignalRClick ), NULL, this );
290 }
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)
wxStaticText * m_staticText2
virtual void menuShowGrid(wxCommandEvent &event)
virtual void menuZoomOut(wxCommandEvent &event)
wxSplitterWindow * m_splitterTuneValues
wxStaticBoxSizer * m_tuneSizerStb
wxAuiNotebook * m_plotNotebook
virtual void menuSaveCsv(wxCommandEvent &event)
virtual void onSignalRClick(wxListEvent &event)
virtual void menuShowLegend(wxCommandEvent &event)
virtual void onPlotClose(wxAuiNotebookEvent &event)
wxSplitterWindow * m_splitterLeftRight
wxMenuItem * m_runSimulation
virtual void menuOpenWorkbook(wxCommandEvent &event)
virtual void menuZoomIn(wxCommandEvent &event)
void m_splitterPlotAndConsoleOnIdle(wxIdleEvent &)
virtual void onSignalDblClick(wxMouseEvent &event)
virtual void menuShowGridUpdate(wxUpdateUIEvent &event)
virtual void menuNewPlot(wxCommandEvent &event)
virtual void menuSaveImage(wxCommandEvent &event)
const char * name
void m_splitterTuneValuesOnIdle(wxIdleEvent &)
virtual void menuZoomFit(wxCommandEvent &event)
virtual void menuExit(wxCommandEvent &event)
wxSplitterWindow * m_splitterPlotAndConsole
SIM_PLOT_FRAME_BASE::~SIM_PLOT_FRAME_BASE ( )

Definition at line 292 of file sim_plot_frame_base.cpp.

References m_plotNotebook, m_signals, menuExit(), menuNewPlot(), menuOpenWorkbook(), menuSaveCsv(), menuSaveImage(), menuSaveWorkbook(), menuShowGrid(), menuShowGridUpdate(), menuShowLegend(), menuShowLegendUpdate(), menuZoomFit(), menuZoomIn(), menuZoomOut(), onPlotChanged(), onPlotClose(), onSignalDblClick(), and onSignalRClick().

293 {
294  // Disconnect Events
295  this->Disconnect( wxID_NEW, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuNewPlot ) );
296  this->Disconnect( wxID_OPEN, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuOpenWorkbook ) );
297  this->Disconnect( wxID_SAVE, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuSaveWorkbook ) );
298  this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuSaveImage ) );
299  this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuSaveCsv ) );
300  this->Disconnect( wxID_CLOSE, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuExit ) );
301  this->Disconnect( wxID_ZOOM_IN, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuZoomIn ) );
302  this->Disconnect( wxID_ZOOM_OUT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuZoomOut ) );
303  this->Disconnect( wxID_ZOOM_FIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuZoomFit ) );
304  this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuShowGrid ) );
305  this->Disconnect( wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SIM_PLOT_FRAME_BASE::menuShowGridUpdate ) );
306  this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuShowLegend ) );
307  this->Disconnect( wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SIM_PLOT_FRAME_BASE::menuShowLegendUpdate ) );
308  m_plotNotebook->Disconnect( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED, wxAuiNotebookEventHandler( SIM_PLOT_FRAME_BASE::onPlotChanged ), NULL, this );
309  m_plotNotebook->Disconnect( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE, wxAuiNotebookEventHandler( SIM_PLOT_FRAME_BASE::onPlotClose ), NULL, this );
310  m_signals->Disconnect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( SIM_PLOT_FRAME_BASE::onSignalDblClick ), NULL, this );
311  m_signals->Disconnect( wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, wxListEventHandler( SIM_PLOT_FRAME_BASE::onSignalRClick ), NULL, this );
312 
313 }
virtual void menuSaveWorkbook(wxCommandEvent &event)
virtual void menuShowLegendUpdate(wxUpdateUIEvent &event)
virtual void onPlotChanged(wxAuiNotebookEvent &event)
virtual void menuShowGrid(wxCommandEvent &event)
virtual void menuZoomOut(wxCommandEvent &event)
wxAuiNotebook * m_plotNotebook
virtual void menuSaveCsv(wxCommandEvent &event)
virtual void onSignalRClick(wxListEvent &event)
virtual void menuShowLegend(wxCommandEvent &event)
virtual void onPlotClose(wxAuiNotebookEvent &event)
virtual void menuOpenWorkbook(wxCommandEvent &event)
virtual void menuZoomIn(wxCommandEvent &event)
virtual void onSignalDblClick(wxMouseEvent &event)
virtual void menuShowGridUpdate(wxUpdateUIEvent &event)
virtual void menuNewPlot(wxCommandEvent &event)
virtual void menuSaveImage(wxCommandEvent &event)
virtual void menuZoomFit(wxCommandEvent &event)
virtual void menuExit(wxCommandEvent &event)

Member Function Documentation

void EDA_BASE_FRAME::AddMenuIconsOptions ( wxMenu *  MasterMenu)
inherited

Function AddMenuIconsOptions creates a menu list for icons in menu and icon sizes choice, and add it as submenu to MasterMenu.

Parameters
MasterMenuThe main menu. The sub menu list will be accessible from the menu item with id ID_KICAD_SELECT_ICONS_OPTIONS

Definition at line 692 of file basicframe.cpp.

References AddMenuItem(), ID_KICAD_SELECT_ICONS_IN_MENUS, ID_KICAD_SELECT_ICONS_OPTIONS, KiBitmap(), and Pgm().

Referenced by preparePreferencesMenu(), PL_EDITOR_FRAME::ReCreateMenuBar(), KICAD_MANAGER_FRAME::ReCreateMenuBar(), and GERBVIEW_FRAME::ReCreateMenuBar().

693 {
694  wxMenu* menu = NULL;
695  wxMenuItem* item = MasterMenu->FindItem( ID_KICAD_SELECT_ICONS_OPTIONS );
696 
697  if( item ) // This menu exists, do nothing
698  return;
699 
700  menu = new wxMenu;
701 
702  menu->Append( new wxMenuItem( menu, ID_KICAD_SELECT_ICONS_IN_MENUS,
703  _( "Icons in Menus" ), wxEmptyString,
704  wxITEM_CHECK ) );
705  menu->Check( ID_KICAD_SELECT_ICONS_IN_MENUS, Pgm().GetUseIconsInMenus() );
706 
707  AddMenuItem( MasterMenu, menu,
709  _( "Icons Options" ),
710  _( "Select show icons in menus and icons sizes" ),
711  KiBitmap( icon_xpm ) );
712 }
wxMenuItem * AddMenuItem(wxMenu *aMenu, int aId, const wxString &aText, const wxBitmap &aImage, wxItemKind aType=wxITEM_NORMAL)
Function AddMenuItem is an inline helper function to create and insert a menu item with an icon into ...
Definition: bitmap.cpp:55
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:36
void EDA_BASE_FRAME::CheckForAutoSaveFile ( const wxFileName &  aFileName,
const wxString &  aBackupFileExtension 
)
inherited

Function CheckForAutoSaveFile checks if an auto save file exists for aFileName and takes the appropriate action depending on the user input.

If an auto save file exists for aFileName, the user is prompted if they wish to replace file aFileName with the auto saved file. If the user chooses to replace the file, the backup file of aFileName is removed, aFileName is renamed to the backup file name, and the auto save file is renamed to aFileName. If user chooses to keep the existing version of aFileName, the auto save file is removed.

Parameters
aFileNameA wxFileName object containing the file name to check.
aBackupFileExtensionA wxString object containing the backup file extension used to create the backup file name.

Definition at line 597 of file basicframe.cpp.

References AUTOSAVE_PREFIX_FILENAME, Format(), GetChars(), Pgm(), and traceAutoSave.

Referenced by PCB_EDIT_FRAME::OpenProjectFiles().

599 {
600  wxCHECK_RET( aFileName.IsOk(), wxT( "Invalid file name!" ) );
601  wxCHECK_RET( !aBackupFileExtension.IsEmpty(), wxT( "Invalid backup file extension!" ) );
602 
603  wxFileName autoSaveFileName = aFileName;
604 
605  // Check for auto save file.
606  autoSaveFileName.SetName( AUTOSAVE_PREFIX_FILENAME + aFileName.GetName() );
607 
608  wxLogTrace( traceAutoSave,
609  wxT( "Checking for auto save file " ) + autoSaveFileName.GetFullPath() );
610 
611  if( !autoSaveFileName.FileExists() )
612  return;
613 
614  wxString msg = wxString::Format( _(
615  "Well this is potentially embarrassing!\n"
616  "It appears that the last time you were editing the file\n"
617  "'%s'\n"
618  "it was not saved properly. Do you wish to restore the last saved edits you made?" ),
619  GetChars( aFileName.GetFullName() )
620  );
621 
622  int response = wxMessageBox( msg, Pgm().App().GetAppName(), wxYES_NO | wxICON_QUESTION, this );
623 
624  // Make a backup of the current file, delete the file, and rename the auto save file to
625  // the file name.
626  if( response == wxYES )
627  {
628  // Get the backup file name.
629  wxFileName backupFileName = aFileName;
630  backupFileName.SetExt( aBackupFileExtension );
631 
632  // If an old backup file exists, delete it. If an old copy of the file exists, rename
633  // it to the backup file name
634  if( aFileName.FileExists() )
635  {
636  // Remove the old file backup file.
637  if( backupFileName.FileExists() )
638  wxRemoveFile( backupFileName.GetFullPath() );
639 
640  // Rename the old file to the backup file name.
641  if( !wxRenameFile( aFileName.GetFullPath(), backupFileName.GetFullPath() ) )
642  {
643  msg.Printf( _( "Could not create backup file <%s>" ),
644  GetChars( backupFileName.GetFullPath() ) );
645  wxMessageBox( msg );
646  }
647  }
648 
649  if( !wxRenameFile( autoSaveFileName.GetFullPath(), aFileName.GetFullPath() ) )
650  {
651  wxMessageBox( _( "The auto save file could not be renamed to the board file name." ),
652  Pgm().App().GetAppName(), wxOK | wxICON_EXCLAMATION, this );
653  }
654  }
655  else
656  {
657  wxLogTrace( traceAutoSave,
658  wxT( "Removing auto save file " ) + autoSaveFileName.GetFullPath() );
659 
660  // Remove the auto save file when using the previous file as is.
661  wxRemoveFile( autoSaveFileName.GetFullPath() );
662  }
663 }
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
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:92
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
#define AUTOSAVE_PREFIX_FILENAME
Prefix to create filenames for schematic files or other difile when auto-saved to retrieve a crash...
Definition: wxstruct.h:71
const wxChar traceAutoSave[]
Flag to enable auto save feature debug tracing.
Definition: basicframe.cpp:53
wxConfigBase * EDA_BASE_FRAME::config ( )
protectedvirtualinherited
wxString EDA_BASE_FRAME::ConfigBaseName ( )
inlineinherited

Function ConfigBaseName.

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 268 of file wxstruct.h.

References EDA_BASE_FRAME::m_configFrameName.

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

269  {
270  wxString baseCfgName = m_configFrameName.IsEmpty() ? GetName() : m_configFrameName;
271  return baseCfgName;
272  }
wxString m_configFrameName
prefix used in config to identify some params (frame size...) if empty, the frame name defined in CTO...
Definition: wxstruct.h:142
VTBL_ENTRY bool KIWAY_PLAYER::CreateNetlist ( int  aFormat,
const wxString &  aFullFileName,
unsigned  aNetlistOptions,
REPORTER aReporter = NULL,
bool  silent = false 
)
inlineinherited

Function ReadPcbNetlist provides access to Eeschema's function CreateNetlist.

Definition at line 215 of file kiway_player.h.

220  {
221  return false;
222  };
void KIWAY_PLAYER::DismissModal ( bool  aRetVal,
const wxString &  aResult = wxEmptyString 
)
protectedinherited
bool EDA_BASE_FRAME::doAutoSave ( )
protectedvirtualinherited

Function doAutoSave 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 250 of file basicframe.cpp.

Referenced by EDA_BASE_FRAME::onAutoSaveTimer().

251 {
252  wxCHECK_MSG( false, true, wxT( "Auto save timer function not overridden. Bad programmer!" ) );
253 }
bool EDA_BASE_FRAME::Enable ( bool  enable)
overrideinherited

Definition at line 211 of file basicframe.cpp.

Referenced by FOOTPRINT_EDIT_FRAME::OnUpdateLoadModuleFromBoard(), and KIWAY_PLAYER::ShowModal().

212 {
213  // so we can do logging of this state change:
214 
215 #if defined(DEBUG)
216  const char* type_id = typeid( *this ).name();
217  printf( "wxFrame %-28s: %s\n", type_id, enable ? "enabled" : "disabled" );
218 #endif
219 
220  return wxFrame::Enable( enable );
221 }
void EDA_BASE_FRAME::ExportHotkeyConfigToFile ( EDA_HOTKEY_CONFIG aDescList,
const wxString &  aDefaultShortname 
)
inherited

Function ExportHotkeyConfigToFile 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 (extention not needed) like eechema, kicad...

Definition at line 768 of file hotkeys_basic.cpp.

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

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

770 {
771  wxString ext = DEFAULT_HOTKEY_FILENAME_EXT;
772  wxString mask = wxT( "*." ) + ext;
773 
774 #if 0
775  wxString path = wxPathOnly( Prj().GetProjectFullName() );
776 #else
777  wxString path = GetMruPath();
778 #endif
779  wxFileName fn( aDefaultShortname );
780  fn.SetExt( DEFAULT_HOTKEY_FILENAME_EXT );
781 
782  wxString filename = EDA_FILE_SELECTOR( _( "Write Hotkey Configuration File:" ),
783  path,
784  fn.GetFullPath(),
785  ext,
786  mask,
787  this,
788  wxFD_SAVE,
789  true );
790 
791  if( filename.IsEmpty() )
792  return;
793 
794  WriteHotkeyConfig( aDescList, &filename );
795  SetMruPath( wxFileName( filename ).GetPath() );
796 }
void SetMruPath(const wxString &aPath)
Definition: wxstruct.h:369
PROJECT & Prj()
Definition: kicad.cpp:270
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)
Function WriteHotkeyConfig Store the current hotkey list It is stored using the standard wxConfig mec...
#define DEFAULT_HOTKEY_FILENAME_EXT
Definition: hotkeys_basic.h:34
wxString GetMruPath() const
Definition: wxstruct.h:371
int EDA_BASE_FRAME::GetAutoSaveInterval ( ) const
inlineinherited

Definition at line 227 of file wxstruct.h.

References EDA_BASE_FRAME::m_autoSaveInterval.

Referenced by DIALOG_GENERALOPTIONS::init(), and SCH_EDIT_FRAME::OnPreferencesOptions().

227 { return m_autoSaveInterval; }
int m_autoSaveInterval
The auto save interval time in seconds.
Definition: wxstruct.h:158
wxString EDA_BASE_FRAME::GetFileFromHistory ( int  cmdId,
const wxString &  type,
wxFileHistory *  aFileHistory = NULL 
)
inherited

Function GetFileFromHistory fetches the file name from the file history list.

and removes the selected file, if this file does not exists Note also the menu is updated, if wxFileHistory::UseMenu was called at init time

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 419 of file basicframe.cpp.

References Format(), GetChars(), KIFACE_I::GetFileHistory(), 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(), and GERBVIEW_FRAME::OnZipFileHistory().

421 {
422  wxFileHistory* fileHistory = aFileHistory;
423 
424  if( !fileHistory )
425  fileHistory = &Kiface().GetFileHistory();
426 
427  int baseId = fileHistory->GetBaseId();
428 
429  wxASSERT( cmdId >= baseId && cmdId < baseId + (int) fileHistory->GetCount() );
430 
431  unsigned i = cmdId - baseId;
432 
433  if( i < fileHistory->GetCount() )
434  {
435  wxString fn = fileHistory->GetHistoryFile( i );
436 
437  if( wxFileName::FileExists( fn ) )
438  return fn;
439  else
440  {
441  wxString msg = wxString::Format(
442  wxT( "file '%s' was not found." ),
443  GetChars( fn ) );
444 
445  wxMessageBox( msg );
446 
447  fileHistory->RemoveFileFromHistory( i );
448  }
449  }
450 
451  return wxEmptyString;
452 }
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
wxFileHistory & GetFileHistory()
Definition: kiface_i.h:123
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:92
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
void EDA_BASE_FRAME::GetKicadAbout ( wxCommandEvent &  event)
inherited

Definition at line 546 of file basicframe.cpp.

References ShowAboutDialog().

547 {
548  void ShowAboutDialog(EDA_BASE_FRAME * aParent); // See AboutDialog_main.cpp
549  ShowAboutDialog( this );
550 }
void ShowAboutDialog(EDA_BASE_FRAME *aParent)
Class EDA_BASE_FRAME is the base frame for deriving all KiCad main window classes.
Definition: wxstruct.h:117
void EDA_BASE_FRAME::GetKicadContribute ( wxCommandEvent &  event)
inherited

Definition at line 533 of file basicframe.cpp.

References URL_GET_INVOLVED.

534 {
535  if( !wxLaunchDefaultBrowser( URL_GET_INVOLVED ) )
536  {
537  wxString msg;
538  msg.Printf( _( "Could not launch the default browser.\n"
539  "For information on how to help the KiCad project, visit %s" ),
541  wxMessageBox( msg, _( "Get involved with KiCad" ), wxOK, this );
542  }
543 }
#define URL_GET_INVOLVED
Definition: basicframe.cpp:51
void EDA_BASE_FRAME::GetKicadHelp ( wxCommandEvent &  event)
inherited

Definition at line 455 of file basicframe.cpp.

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

456 {
457  const SEARCH_STACK& search = sys_search();
458 
459  /* We have to get document for beginners,
460  * or the full specific doc
461  * if event id is wxID_INDEX, we want the document for beginners.
462  * else the specific doc file (its name is in Kiface().GetHelpFileName())
463  * The document for beginners is the same for all KiCad utilities
464  */
465  if( event.GetId() == wxID_INDEX )
466  {
467  // List of possible names for Getting Started in KiCad
468  const wxChar* names[2] = {
469  wxT( "getting_started_in_kicad" ),
470  wxT( "Getting_Started_in_KiCad" )
471  };
472 
473  wxString helpFile;
474  // Search for "getting_started_in_kicad.html" or "getting_started_in_kicad.pdf"
475  // or "Getting_Started_in_KiCad.html" or "Getting_Started_in_KiCad.pdf"
476  for( unsigned ii = 0; ii < DIM( names ); ii++ )
477  {
478  helpFile = SearchHelpFileFullPath( search, names[ii] );
479 
480  if( !helpFile.IsEmpty() )
481  break;
482  }
483 
484  if( !helpFile )
485  {
486  wxString msg = wxString::Format( _(
487  "Html or pdf help file \n'%s'\n or\n'%s' could not be found." ), names[0], names[1] );
488  wxMessageBox( msg );
489  }
490  else
491  {
492  GetAssociatedDocument( this, helpFile );
493  }
494 
495  return;
496  }
497 
498  wxString base_name = help_name();
499  wxString helpFile = SearchHelpFileFullPath( search, base_name );
500 
501  if( !helpFile )
502  {
503  wxString msg = wxString::Format( _(
504  "Help file '%s' could not be found." ),
505  GetChars( base_name )
506  );
507  wxMessageBox( msg );
508  }
509  else
510  {
511  GetAssociatedDocument( this, helpFile );
512  }
513 }
#define DIM(x)
of elements in an array
Definition: macros.h:98
bool GetAssociatedDocument(wxWindow *aParent, const wxString &aDocName, const wxPathList *aPaths)
Function GetAssociatedDocument open a document (file) with the suitable browser.
Definition: eda_doc.cpp:86
Class SEARCH_STACK looks for files in a number of places.
Definition: search_stack.h:41
virtual const SEARCH_STACK & sys_search()
Function sys_search returns a SEARCH_STACK pertaining to entire program, and is overloaded in KICAD_M...
Definition: basicframe.cpp:389
wxString SearchHelpFileFullPath(const SEARCH_STACK &aSStack, const wxString &aBaseName)
Function SearchHelpFileFullPath returns the help file's full path.
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:92
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()
Definition: basicframe.cpp:395
wxString EDA_BASE_FRAME::GetMruPath ( ) const
inlineinherited
wxString EDA_BASE_FRAME::help_name ( )
protectedvirtualinherited

Reimplemented in KICAD_MANAGER_FRAME.

Definition at line 395 of file basicframe.cpp.

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

Referenced by EDA_BASE_FRAME::GetKicadHelp().

396 {
397  return Kiface().GetHelpFileName();
398 }
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
VTBL_ENTRY bool KIWAY_PLAYER::ImportFile ( const wxString &  aFileName,
int  aFileType 
)
inlineinherited

Function ImportFile load the given filename but sets the path to the current project path.

Parameters
fullfilepath of file to be imported.
aFileTypeenum value for filetype

Definition at line 188 of file kiway_player.h.

189  {
190  // overload me for your wxFrame type.
191 
192  return false;
193  }
void EDA_BASE_FRAME::ImportHotkeyConfigFromFile ( EDA_HOTKEY_CONFIG aDescList,
const wxString &  aDefaultShortname 
)
inherited

Function ImportHotkeyConfigFromFile 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 (extention not needed) like eechema, kicad...

Definition at line 737 of file hotkeys_basic.cpp.

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

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

739 {
740  wxString ext = DEFAULT_HOTKEY_FILENAME_EXT;
741  wxString mask = wxT( "*." ) + ext;
742 
743 #if 0 // pass in the project dir as an argument
744  wxString path = wxPathOnly( Prj().GetProjectFullName() );
745 #else
746  wxString path = GetMruPath();
747 #endif
748  wxFileName fn( aDefaultShortname );
749  fn.SetExt( DEFAULT_HOTKEY_FILENAME_EXT );
750 
751  wxString filename = EDA_FILE_SELECTOR( _( "Read Hotkey Configuration File:" ),
752  path,
753  fn.GetFullPath(),
754  ext,
755  mask,
756  this,
757  wxFD_OPEN,
758  true );
759 
760  if( filename.IsEmpty() )
761  return;
762 
763  ReadHotkeyConfigFile( filename, aDescList );
764  SetMruPath( wxFileName( filename ).GetPath() );
765 }
void SetMruPath(const wxString &aPath)
Definition: wxstruct.h:369
int ReadHotkeyConfigFile(const wxString &aFilename, struct EDA_HOTKEY_CONFIG *aDescList)
Function ReadHotkeyConfigFile Read an old configuration file (<file>.key) and fill the current ho...
PROJECT & Prj()
Definition: kicad.cpp:270
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
#define DEFAULT_HOTKEY_FILENAME_EXT
Definition: hotkeys_basic.h:34
wxString GetMruPath() const
Definition: wxstruct.h:371
virtual bool EDA_BASE_FRAME::isAutoSaveRequired ( ) const
inlineprotectedvirtualinherited

Function autoSaveRequired returns the auto save status of the application.

Override this function if your derived frame supports automatic file saving.

Reimplemented in PCB_EDIT_FRAME, and SCH_EDIT_FRAME.

Definition at line 181 of file wxstruct.h.

Referenced by EDA_BASE_FRAME::ProcessEvent().

181 { return false; }
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 163 of file kiway_player.cpp.

References DBG, and KIWAY_PLAYER::m_modal_loop.

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

164 {
165  bool ret = !m_modal_loop;
166 
167  DBG(printf( "%s: ret:%d\n", __func__, ret );)
168 
169  return ret;
170 }
WX_EVENT_LOOP * m_modal_loop
Definition: kiway_player.h:290
#define DBG(x)
Definition: fctsys.h:33
bool EDA_BASE_FRAME::IsType ( FRAME_T  aType) const
inlineinherited
bool EDA_BASE_FRAME::IsWritable ( const wxFileName &  aFileName)
inherited

Function IsWritable checks if aFileName can be written.

The function performs a number of tests on aFileName to verify that it can be saved. If aFileName defines a path with no file name, them the path is tested for user write permission. If aFileName defines a file name that does not exist in the path, the path is tested for user write permission. If aFileName defines a file that already exits, the file name is tested for user write permissions.

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 553 of file basicframe.cpp.

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

554 {
555  wxString msg;
556  wxFileName fn = aFileName;
557 
558  // Check for absence of a file path with a file name. Unfortunately KiCad
559  // uses paths relative to the current project path without the ./ part which
560  // confuses wxFileName. Making the file name path absolute may be less than
561  // elegant but it solves the problem.
562  if( fn.GetPath().IsEmpty() && fn.HasName() )
563  fn.MakeAbsolute();
564 
565  wxCHECK_MSG( fn.IsOk(), false,
566  wxT( "File name object is invalid. Bad programmer!" ) );
567  wxCHECK_MSG( !fn.GetPath().IsEmpty(), false,
568  wxT( "File name object path <" ) + fn.GetFullPath() +
569  wxT( "> is not set. Bad programmer!" ) );
570 
571  if( fn.IsDir() && !fn.IsDirWritable() )
572  {
573  msg.Printf( _( "You do not have write permissions to folder <%s>." ),
574  GetChars( fn.GetPath() ) );
575  }
576  else if( !fn.FileExists() && !fn.IsDirWritable() )
577  {
578  msg.Printf( _( "You do not have write permissions to save file <%s> to folder <%s>." ),
579  GetChars( fn.GetFullName() ), GetChars( fn.GetPath() ) );
580  }
581  else if( fn.FileExists() && !fn.IsFileWritable() )
582  {
583  msg.Printf( _( "You do not have write permissions to save file <%s>." ),
584  GetChars( fn.GetFullPath() ) );
585  }
586 
587  if( !msg.IsEmpty() )
588  {
589  wxMessageBox( msg );
590  return false;
591  }
592 
593  return true;
594 }
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:92
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 60 of file kiway_player.h.

References KIWAY_HOLDER::m_kiway.

Referenced by SCH_EDIT_FRAME::AppendSchematic(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), DIALOG_CHOOSE_COMPONENT::ConstructRightPanel(), CVPCB_MAINFRAME::CreateScreenCmp(), CVPCB_MAINFRAME::CVPCB_MAINFRAME(), DIALOG_SHIM::DIALOG_SHIM(), EDIT_TOOL::editFootprintInFpEditor(), SCH_EDIT_FRAME::EditSheet(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), LIB_MANAGER::GetBufferedPart(), LIB_MANAGER::getLibraryBuffer(), FOOTPRINT_EDIT_FRAME::GetPlotSettings(), SCH_EDIT_FRAME::ImportFile(), PCB_EDIT_FRAME::ImportFile(), DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::initBuffers(), PCB_EDIT_FRAME::InstallModuleOptionsFrame(), KIWAY_PLAYER::language_change(), CVPCB_MAINFRAME::LoadFootprintFiles(), KIWAY_PLAYER::OnChangeIconsOptions(), CVPCB_MAINFRAME::OnEditFootprintLibraryTable(), SCH_BASE_FRAME::OnEditSymbolLibTable(), DIALOG_CHOOSE_COMPONENT::OnInitDialog(), SCH_EDIT_FRAME::OnLeftClick(), SCH_BASE_FRAME::OnOpenLibraryViewer(), SCH_EDIT_FRAME::OnSimulate(), DIALOG_EDIT_ONE_FIELD::OnTextValueSelectButtonClick(), FOOTPRINT_EDIT_FRAME::OnUpdateInsertModuleInBoard(), FOOTPRINT_EDIT_FRAME::OnUpdateLoadModuleFromBoard(), FOOTPRINT_EDIT_FRAME::OnUpdateReplaceModuleInBoard(), 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(), SCH_EDIT_FRAME::SaveEEFile(), CVPCB_MAINFRAME::SaveFootprintAssociation(), SCH_BASE_FRAME::SelectComponentFromLibBrowser(), CVPCB_MAINFRAME::SendMessageToEESCHEMA(), PCB_EDIT_FRAME::SendMessageToEESCHEMA(), SCH_EDIT_FRAME::SendMessageToPCBNEW(), SCH_EDIT_FRAME::sendNetlist(), FOOTPRINT_EDIT_FRAME::SetPlotSettings(), DISPLAY_FOOTPRINTS_FRAME::Show3D_Frame(), FOOTPRINT_VIEWER_FRAME::Show3D_Frame(), FOOTPRINT_EDIT_FRAME::Show3D_Frame(), FOOTPRINT_WIZARD_FRAME::Show3D_Frame(), DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::showButtonHandler(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::showButtonHandler(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), LIB_MANAGER::UpdatePart(), and DIALOG_EXCHANGE_MODULE::ViewAndSelectFootprint().

61  {
62  wxASSERT( m_kiway ); // smoke out bugs in Debug build, then Release runs fine.
63  return *m_kiway;
64  }
KIWAY * m_kiway
Definition: kiway_player.h:85
void KIWAY_PLAYER::kiway_express ( KIWAY_EXPRESS aEvent)
protectedinherited

event handler, routes to derivative specific virtual KiwayMailIn()

Definition at line 188 of file kiway_player.cpp.

References KIWAY_EXPRESS::Command(), KIWAY_EXPRESS::GetPayload(), KIWAY_PLAYER::KiwayMailIn(), and name.

189 {
190  // logging support
191 #if defined(DEBUG)
192  const char* class_name = typeid( this ).name();
193 
194  printf( "%s: received cmd:%d pay:'%s'\n", class_name,
195  aEvent.Command(), aEvent.GetPayload().c_str() );
196 #endif
197 
198  KiwayMailIn( aEvent ); // call the virtual, override in derived.
199 }
virtual void KiwayMailIn(KIWAY_EXPRESS &aEvent)
Function KiwayMailIn receives KIWAY_EXPRESS messages from other players.
const std::string & GetPayload()
Function Payload returns the payload, which can be any text but it typicall self identifying s-expres...
Definition: kiway_express.h:62
const char * name
MAIL_T Command()
Function Command returns the MAIL_T associated with this mail.
Definition: kiway_express.h:52
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 SCH_EDIT_FRAME, PCB_EDIT_FRAME, and CVPCB_MAINFRAME.

Definition at line 75 of file kiway_player.cpp.

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

76 {
77  // override this in derived classes.
78 }
void KIWAY_PLAYER::language_change ( wxCommandEvent &  event)
protectedinherited

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

Definition at line 202 of file kiway_player.cpp.

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

203 {
204  int id = event.GetId();
205 
206  // tell all the KIWAY_PLAYERs about the language change.
207  Kiway().SetLanguage( id );
208 }
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_player.h:60
VTBL_ENTRY void SetLanguage(int aLanguage)
Function SetLanguage changes the language and then calls ShowChangedLanguage() on all KIWAY_PLAYERs...
Definition: kiway.cpp:396
void EDA_BASE_FRAME::LoadSettings ( wxConfigBase *  aCfg)
virtualinherited

Function LoadSettings loads common frame parameters from a configuration file.

Don't forget to call the base method or your frames won't remember their positions and sizes.

Reimplemented in EDA_DRAW_FRAME, PCB_BASE_FRAME, GERBVIEW_FRAME, PCB_EDIT_FRAME, LIB_EDIT_FRAME, SCH_EDIT_FRAME, KICAD_MANAGER_FRAME, CVPCB_MAINFRAME, PL_EDITOR_FRAME, EDA_3D_VIEWER, FOOTPRINT_WIZARD_FRAME, SIM_PLOT_FRAME, FOOTPRINT_VIEWER_FRAME, LIB_VIEW_FRAME, and FOOTPRINT_EDIT_FRAME.

Definition at line 275 of file basicframe.cpp.

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, EDA_BASE_FRAME::m_perspective, wxPoint::x, and wxPoint::y.

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

276 {
277  int maximized = 0;
278 
279  wxString baseCfgName = ConfigBaseName();
280 
281  wxString text = baseCfgName + entryPosX;
282  aCfg->Read( text, &m_FramePos.x );
283 
284  text = baseCfgName + entryPosY;
285  aCfg->Read( text, &m_FramePos.y );
286 
287  text = baseCfgName + entrySizeX;
288  aCfg->Read( text, &m_FrameSize.x, 600 );
289 
290  text = baseCfgName + entrySizeY;
291  aCfg->Read( text, &m_FrameSize.y, 400 );
292 
293  text = baseCfgName + entryMaximized;
294  aCfg->Read( text, &maximized, 0 );
295 
296  if( m_hasAutoSave )
297  {
298  text = baseCfgName + entryAutoSaveInterval;
299  aCfg->Read( text, &m_autoSaveInterval, DEFAULT_AUTO_SAVE_INTERVAL );
300  }
301 
302  // Ensure the window is on a connected display, and is visible.
303  // (at least a corner of the frame must be visible on screen)
304  // Sometimes, if a window was moved on an auxiliary display, and when this
305  // display is no more available, it is not the case.
306  wxRect rect( m_FramePos, m_FrameSize );
307 
308  if( wxDisplay::GetFromPoint( rect.GetTopLeft() ) == wxNOT_FOUND &&
309  wxDisplay::GetFromPoint( rect.GetTopRight() ) == wxNOT_FOUND &&
310  wxDisplay::GetFromPoint( rect.GetBottomLeft() ) == wxNOT_FOUND &&
311  wxDisplay::GetFromPoint( rect.GetBottomRight() ) == wxNOT_FOUND )
312  {
313  m_FramePos = wxDefaultPosition;
314  }
315 
316  // Ensure Window title bar is visible
317 #if defined( __WXMAC__ )
318  // for macOSX, the window must be below system (macOSX) toolbar
319  // Ypos_min = GetMBarHeight(); seems no more exist in new API (subject to change)
320  int Ypos_min = 20;
321 #else
322  int Ypos_min = 0;
323 #endif
324  if( m_FramePos.y < Ypos_min )
325  m_FramePos.y = Ypos_min;
326 
327  if( maximized )
328  Maximize();
329 
330  aCfg->Read( baseCfgName + entryPerspective, &m_perspective );
331  aCfg->Read( baseCfgName + entryMruPath, &m_mruPath );
332 }
wxString m_mruPath
Most recently used path.
Definition: wxstruct.h:165
wxString ConfigBaseName()
Function ConfigBaseName.
Definition: wxstruct.h:268
static const wxString entryPosX
X position of frame, in pixels (suffix)
Definition: basicframe.cpp:68
wxString m_perspective
wxAuiManager perspective.
Definition: wxstruct.h:163
static const wxString entryPerspective
Configuration file entry for wxAuiManger perspective.
Definition: basicframe.cpp:62
wxPoint m_FramePos
Definition: wxstruct.h:139
static const wxString entrySizeX
Width of frame, in pixels (suffix)
Definition: basicframe.cpp:70
static const wxString entrySizeY
Height of frame, in pixels (suffix)
Definition: basicframe.cpp:69
static const wxString entryPosY
Y position of frame, in pixels (suffix)
Definition: basicframe.cpp:67
static const wxString entryAutoSaveInterval
Configuration file entry name for auto save interval.
Definition: basicframe.cpp:59
static const wxString entryMaximized
Nonzero iff frame is maximized (suffix)
Definition: basicframe.cpp:71
bool m_hasAutoSave
Flag to indicate if this frame supports auto save.
Definition: wxstruct.h:152
wxSize m_FrameSize
Definition: wxstruct.h:140
static const wxString entryMruPath
Configuration file entry for most recently used path.
Definition: basicframe.cpp:65
int m_autoSaveInterval
The auto save interval time in seconds.
Definition: wxstruct.h:158
#define DEFAULT_AUTO_SAVE_INTERVAL
The default auto save interval is 10 minutes.
Definition: basicframe.cpp:49
void SIM_PLOT_FRAME_BASE::m_splitterLeftRightOnIdle ( wxIdleEvent &  )
inline

Definition at line 112 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

113  {
114  m_splitterLeftRight->SetSashPosition( 700 );
115  m_splitterLeftRight->Disconnect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterLeftRightOnIdle ), NULL, this );
116  }
void m_splitterLeftRightOnIdle(wxIdleEvent &)
wxSplitterWindow * m_splitterLeftRight
void SIM_PLOT_FRAME_BASE::m_splitterPlotAndConsoleOnIdle ( wxIdleEvent &  )
inline

Definition at line 118 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

119  {
120  m_splitterPlotAndConsole->SetSashPosition( 500 );
121  m_splitterPlotAndConsole->Disconnect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterPlotAndConsoleOnIdle ), NULL, this );
122  }
void m_splitterPlotAndConsoleOnIdle(wxIdleEvent &)
wxSplitterWindow * m_splitterPlotAndConsole
void SIM_PLOT_FRAME_BASE::m_splitterSignalsOnIdle ( wxIdleEvent &  )
inline

Definition at line 124 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

125  {
126  m_splitterSignals->SetSashPosition( 0 );
127  m_splitterSignals->Disconnect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterSignalsOnIdle ), NULL, this );
128  }
wxSplitterWindow * m_splitterSignals
void m_splitterSignalsOnIdle(wxIdleEvent &)
void SIM_PLOT_FRAME_BASE::m_splitterTuneValuesOnIdle ( wxIdleEvent &  )
inline

Definition at line 130 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

131  {
132  m_splitterTuneValues->SetSashPosition( 0 );
133  m_splitterTuneValues->Disconnect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterTuneValuesOnIdle ), NULL, this );
134  }
wxSplitterWindow * m_splitterTuneValues
void m_splitterTuneValuesOnIdle(wxIdleEvent &)
virtual void SIM_PLOT_FRAME_BASE::menuExit ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 92 of file sim_plot_frame_base.h.

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

92 { event.Skip(); }
virtual void SIM_PLOT_FRAME_BASE::menuNewPlot ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 87 of file sim_plot_frame_base.h.

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

87 { event.Skip(); }
virtual void SIM_PLOT_FRAME_BASE::menuOpenWorkbook ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 88 of file sim_plot_frame_base.h.

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

88 { event.Skip(); }
virtual void SIM_PLOT_FRAME_BASE::menuSaveCsv ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 91 of file sim_plot_frame_base.h.

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

91 { event.Skip(); }
virtual void SIM_PLOT_FRAME_BASE::menuSaveImage ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 90 of file sim_plot_frame_base.h.

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

90 { event.Skip(); }
virtual void SIM_PLOT_FRAME_BASE::menuSaveWorkbook ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 89 of file sim_plot_frame_base.h.

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

89 { event.Skip(); }
virtual void SIM_PLOT_FRAME_BASE::menuShowGrid ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 96 of file sim_plot_frame_base.h.

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

96 { event.Skip(); }
virtual void SIM_PLOT_FRAME_BASE::menuShowGridUpdate ( wxUpdateUIEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 97 of file sim_plot_frame_base.h.

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

97 { event.Skip(); }
virtual void SIM_PLOT_FRAME_BASE::menuShowLegend ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 98 of file sim_plot_frame_base.h.

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

98 { event.Skip(); }
virtual void SIM_PLOT_FRAME_BASE::menuShowLegendUpdate ( wxUpdateUIEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 99 of file sim_plot_frame_base.h.

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

99 { event.Skip(); }
virtual void SIM_PLOT_FRAME_BASE::menuZoomFit ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 95 of file sim_plot_frame_base.h.

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

95 { event.Skip(); }
virtual void SIM_PLOT_FRAME_BASE::menuZoomIn ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 93 of file sim_plot_frame_base.h.

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

93 { event.Skip(); }
virtual void SIM_PLOT_FRAME_BASE::menuZoomOut ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 94 of file sim_plot_frame_base.h.

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

94 { event.Skip(); }
void EDA_BASE_FRAME::onAutoSaveTimer ( wxTimerEvent &  aEvent)
protectedinherited

Function onAutoSaveTimer handles the auto save timer event.

Definition at line 243 of file basicframe.cpp.

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

Referenced by EDA_BASE_FRAME::EDA_BASE_FRAME().

244 {
245  if( !doAutoSave() )
246  m_autoSaveTimer->Start( m_autoSaveInterval * 1000, wxTIMER_ONE_SHOT );
247 }
virtual bool doAutoSave()
Function doAutoSave should be overridden by the derived class to handle the auto save feature...
Definition: basicframe.cpp:250
wxTimer * m_autoSaveTimer
The timer used to implement the auto save feature;.
Definition: wxstruct.h:161
int m_autoSaveInterval
The auto save interval time in seconds.
Definition: wxstruct.h:158
void KIWAY_PLAYER::OnChangeIconsOptions ( wxCommandEvent &  event)
overrideprotectedvirtualinherited

Function OnChangeIconsOptions is an event handler called on a icons options in menus or toolbars menu selection.

Reimplemented from EDA_BASE_FRAME.

Definition at line 211 of file kiway_player.cpp.

References KIWAY_HOLDER::Kiway(), EDA_BASE_FRAME::OnChangeIconsOptions(), and KIWAY::ShowChangedIcons().

212 {
215 }
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_player.h:60
virtual void OnChangeIconsOptions(wxCommandEvent &event)
Function OnChangeIconsOptions Selects the current icons options in menus (or toolbars) in Kicad (the ...
Definition: basicframe.cpp:681
VTBL_ENTRY void ShowChangedIcons()
Function ShowChangedIcons Calls ShowChangedIcons() on all KIWAY_PLAYERs.
Definition: kiway.cpp:432
virtual void SIM_PLOT_FRAME_BASE::onPlotChanged ( wxAuiNotebookEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 100 of file sim_plot_frame_base.h.

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

100 { event.Skip(); }
virtual void SIM_PLOT_FRAME_BASE::onPlotClose ( wxAuiNotebookEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 101 of file sim_plot_frame_base.h.

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

101 { event.Skip(); }
void EDA_BASE_FRAME::OnSelectPreferredEditor ( wxCommandEvent &  event)
virtualinherited

Function OnSelectPreferredEditor Open a dialog to select the editor that will used in KiCad to edit or display files (reports ...

) The full filename editor is saved in configuration (global params)

Definition at line 516 of file basicframe.cpp.

References PGM_BASE::AskUserForPreferredEditor(), PGM_BASE::GetEditorName(), Pgm(), and PGM_BASE::SetEditorName().

517 {
518  // Ask for the current editor and instruct GetEditorName() to not show
519  // unless we pass false as argument.
520  wxString editorname = Pgm().GetEditorName( false );
521 
522  // Ask the user to select a new editor, but suggest the current one as the default.
523  editorname = Pgm().AskUserForPreferredEditor( editorname );
524 
525  // If we have a new editor name request it to be copied to m_editor_name and saved
526  // to the preferences file. If the user cancelled the dialog then the previous
527  // value will be retained.
528  if( !editorname.IsEmpty() )
529  Pgm().SetEditorName( editorname );
530 }
VTBL_ENTRY void SetEditorName(const wxString &aFileName)
Definition: pgm_base.cpp:330
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
VTBL_ENTRY const wxString AskUserForPreferredEditor(const wxString &aDefaultEditor=wxEmptyString)
Shows a dialog that instructs the user to select a new preferred editor.
Definition: pgm_base.cpp:375
VTBL_ENTRY const wxString & GetEditorName(bool aCanShowFileChooser=true)
Return the preferred editor name.
Definition: pgm_base.cpp:338
virtual void SIM_PLOT_FRAME_BASE::onSignalDblClick ( wxMouseEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 102 of file sim_plot_frame_base.h.

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

102 { event.Skip(); }
virtual void SIM_PLOT_FRAME_BASE::onSignalRClick ( wxListEvent &  event)
inlineprotectedvirtual

Reimplemented in SIM_PLOT_FRAME.

Definition at line 103 of file sim_plot_frame_base.h.

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

103 { event.Skip(); }
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 170 of file kiway_player.h.

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

171  {
172  // overload me for your wxFrame type.
173 
174  // Any overload should probably do this also:
175  // Prj().MaybeLoadProjectSettings();
176 
177  // Then update the window title.
178 
179  return false;
180  }
bool EDA_BASE_FRAME::PostCommandMenuEvent ( int  evt_type)
inherited

Function PostCommandMenuEvent.

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

Definition at line 666 of file basicframe.cpp.

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

667 {
668  if( evt_type != 0 )
669  {
670  wxCommandEvent evt( wxEVT_COMMAND_MENU_SELECTED );
671  evt.SetEventObject( this );
672  evt.SetId( evt_type );
673  wxPostEvent( this, evt );
674  return true;
675  }
676 
677  return false;
678 }
void EDA_BASE_FRAME::PrintMsg ( const wxString &  text)
inherited

Definition at line 401 of file basicframe.cpp.

Referenced by EDA_DRAW_PANEL::OnMouseEvent().

402 {
403  SetStatusText( text );
404 }
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.

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

Referenced by DIALOG_EDIT_COMPONENT_IN_LIBRARY::AddAliasOfPart(), LIB_EDIT_FRAME::addLibraryFile(), SCH_EDIT_FRAME::AppendSchematic(), PCB_EDIT_FRAME::ArchiveModulesOnBoard(), LIB_VIEW_FRAME::BestZoom(), DIALOG_MODULE_MODULE_EDITOR::BrowseAndAdd3DShapeFile(), DIALOG_MODULE_BOARD_EDITOR::BrowseAndAdd3DShapeFile(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::BrowseAndSelectDocFile(), DIALOG_EXCHANGE_MODULE::BrowseAndSelectFootprint(), DIALOG_SYMBOL_LIB_TABLE::browseLibrariesHandler(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), DIALOG_MODULE_MODULE_EDITOR::Cfg3DPath(), DIALOG_MODULE_BOARD_EDITOR::Cfg3DPath(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions(), PCB_BASE_EDIT_FRAME::CreateNewLibrary(), DIALOG_PLOT_SCHEMATIC::createPlotFileName(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), FOOTPRINT_EDIT_FRAME::DeleteModuleFromCurrentLibrary(), DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT(), DIALOG_CONFIG_EQUFILES::DIALOG_CONFIG_EQUFILES(), DIALOG_FP_LIB_TABLE::DIALOG_FP_LIB_TABLE(), DIALOG_MODULE_BOARD_EDITOR::DIALOG_MODULE_BOARD_EDITOR(), DIALOG_MODULE_MODULE_EDITOR::DIALOG_MODULE_MODULE_EDITOR(), DIALOG_PAGES_SETTINGS::DIALOG_PAGES_SETTINGS(), DIALOG_SYMBOL_LIB_TABLE::DIALOG_SYMBOL_LIB_TABLE(), LIB_VIEW_FRAME::DisplayLibInfos(), LIB_EDIT_FRAME::DisplayLibInfos(), SCH_BASE_FRAME::DisplayListComponentsInLib(), PCB_EDIT_FRAME::doAutoSave(), DIALOG_MODULE_MODULE_EDITOR::Edit3DShapeFileName(), DIALOG_MODULE_BOARD_EDITOR::Edit3DShapeFileName(), SCH_EDIT_FRAME::EditComponentFieldText(), 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(), FOOTPRINT_EDIT_FRAME::GetCurrentLib(), SCH_BASE_FRAME::GetLibAlias(), SCH_BASE_FRAME::GetLibPart(), FOOTPRINT_EDIT_FRAME::getLibPath(), LIB_EDIT_FRAME::getLibraryFileName(), DIALOG_SYMBOL_REMAP::getLibsNotInGlobalSymbolLibTable(), DIALOG_BOM::getPluginFileName(), LIB_VIEW_FRAME::getSelectedAlias(), FP_THREAD_IFACE::GetTable(), SCH_EDIT_FRAME::ImportFile(), PCB_EDIT_FRAME::ImportFile(), DIALOG_MODULE_MODULE_EDITOR::initModeditProperties(), DIALOG_MODULE_BOARD_EDITOR::InitModeditProperties(), PCB_EDIT_FRAME::InstallNetlistFrame(), SCH_EDIT_FRAME::IsSearchCacheObsolete(), SCH_EDIT_FRAME::Load_Component(), SCH_EDIT_FRAME::LoadCmpToFootprintLinkFile(), LIB_EDIT_FRAME::LoadComponentFromCurrentLib(), CVPCB_MAINFRAME::LoadFootprintFiles(), DIALOG_SPICE_MODEL::loadLibrary(), LIB_EDIT_FRAME::LoadOneSymbol(), CVPCB_MAINFRAME::LoadProjectFile(), SCH_EDIT_FRAME::LoadProjectFile(), PCB_EDIT_FRAME::LoadProjectSettings(), DIALOG_DRC_CONTROL::makeValidFileNameReport(), FOOTPRINT_VIEWER_FRAME::OnActivate(), DIALOG_GENCAD_EXPORT_OPTIONS::onBrowse(), DIALOG_DRC_CONTROL::OnButtonBrowseRptFileClick(), CVPCB_MAINFRAME::OnEditFootprintLibraryTable(), SCH_BASE_FRAME::OnEditSymbolLibTable(), DIALOG_GENDRILL::OnGenReportFile(), SCH_EDIT_FRAME::OnImportProject(), DIALOG_CHOOSE_COMPONENT::OnInitDialog(), PCB_EDIT_FRAME::OnLeftClick(), DIALOG_NETLIST::OnOpenNetlistClick(), DIALOG_PLOT::OnOutputDirectoryBrowseClicked(), DIALOG_SVG_PRINT::OnOutputDirectoryBrowseClicked(), DIALOG_GENDRILL::OnOutputDirectoryBrowseClicked(), DIALOG_PLOT_SCHEMATIC::OnOutputDirectoryBrowseClicked(), DIALOG_GEN_MODULE_POSITION::OnOutputDirectoryBrowseClicked(), LIB_EDIT_FRAME::OnPlotCurrentComponent(), DIALOG_SYMBOL_REMAP::OnRemapSymbols(), SCH_EDIT_FRAME::OnRightClick(), DIALOG_BOM::OnRunPlugin(), DIALOG_NETLIST::OnSaveMessagesToFile(), SCH_EDIT_FRAME::OnSaveProject(), DIALOG_CHOOSE_COMPONENT::OnSchViewPaint(), DIALOG_SPICE_MODEL::onSelectLibrary(), LIB_VIEW_FRAME::OnSelectSymbol(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnTestChipName(), FOOTPRINT_EDIT_FRAME::OnUpdateSelectCurrentLib(), LIB_EDIT_FRAME::OnViewEntryDoc(), LIB_VIEW_FRAME::onViewSymbolDocument(), SCH_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::OpenProjectFiles(), SCH_EDIT_FRAME::PasteListOfItems(), PCB_EDITOR_CONTROL::PlaceModule(), DIALOG_CHOOSE_COMPONENT::PopulateFootprintSelector(), SCH_EDIT_FRAME::Process_Config(), PCB_EDIT_FRAME::Process_Config(), FOOTPRINT_EDIT_FRAME::ProcessPreferences(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), PCB_EDIT_FRAME::RecreateCmpFileFromBoard(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), LIB_VIEW_FRAME::ReCreateHToolbar(), FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList(), LIB_VIEW_FRAME::ReCreateListCmp(), LIB_VIEW_FRAME::ReCreateListLib(), LIB_VIEW_FRAME::RedrawActiveWindow(), 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::SaveFootprintInLibrary(), LIB_EDIT_FRAME::saveLibrary(), LIB_EDIT_FRAME::SaveOneSymbol(), CVPCB_MAINFRAME::SaveProjectFile(), SCH_EDIT_FRAME::SaveProjectSettings(), PCB_EDIT_FRAME::SaveProjectSettings(), SCH_BASE_FRAME::saveSymbolLibTables(), FOOTPRINT_VIEWER_FRAME::SelectAndViewFootprint(), SCH_BASE_FRAME::SelectComponentFromLibrary(), FOOTPRINT_VIEWER_FRAME::SelectCurrentFootprint(), PCB_BASE_FRAME::SelectLibrary(), SCH_BASE_FRAME::SelectLibraryFromList(), LIB_EDIT_FRAME::SelectSymLibTable(), SCH_EDIT_FRAME::sendNetlist(), FOOTPRINT_VIEWER_FRAME::setCurFootprintName(), LIB_EDIT_FRAME::SetCurLib(), FOOTPRINT_VIEWER_FRAME::setCurNickname(), LIB_EDIT_FRAME::SetCurPart(), DIALOG_CHOOSE_COMPONENT::ShowFootprintFor(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), EDA_3D_VIEWER::takeScreenshot(), SIM_PLOT_FRAME::updateNetlistExporter(), SCH_SCREEN::UpdateSymbolLinks(), FOOTPRINT_VIEWER_FRAME::UpdateTitle(), CVPCB_MAINFRAME::UpdateTitle(), FOOTPRINT_EDIT_FRAME::updateTitle(), SCH_EDIT_FRAME::WriteNetListFile(), DIALOG_MODULE_BOARD_EDITOR::~DIALOG_MODULE_BOARD_EDITOR(), and DIALOG_MODULE_MODULE_EDITOR::~DIALOG_MODULE_MODULE_EDITOR().

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:60
VTBL_ENTRY PROJECT & Prj() const
Function Prj returns the PROJECT associated with this KIWAY.
Definition: kiway.cpp:144
bool EDA_BASE_FRAME::ProcessEvent ( wxEvent &  aEvent)
overrideinherited

Function ProcessEvent overrides 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 185 of file basicframe.cpp.

References 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 LIB_VIEW_FRAME::onSelectNextSymbol(), LIB_VIEW_FRAME::onSelectPreviousSymbol(), KIWAY::ProcessEvent(), LIB_VIEW_FRAME::ReCreateListCmp(), and PCBNEW_CONTROL::SwitchUnits().

186 {
187  if( !wxFrame::ProcessEvent( aEvent ) )
188  return false;
189 
190  if( IsShown() && m_hasAutoSave && IsActive() &&
192  {
193  if( !m_autoSaveState )
194  {
195  wxLogTrace( traceAutoSave, wxT( "Starting auto save timer." ) );
196  m_autoSaveTimer->Start( m_autoSaveInterval * 1000, wxTIMER_ONE_SHOT );
197  m_autoSaveState = true;
198  }
199  else if( m_autoSaveTimer->IsRunning() )
200  {
201  wxLogTrace( traceAutoSave, wxT( "Stopping auto save timer." ) );
202  m_autoSaveTimer->Stop();
203  m_autoSaveState = false;
204  }
205  }
206 
207  return true;
208 }
bool m_autoSaveState
Flag to indicate the last auto save state.
Definition: wxstruct.h:155
wxTimer * m_autoSaveTimer
The timer used to implement the auto save feature;.
Definition: wxstruct.h:161
virtual bool isAutoSaveRequired() const
Function autoSaveRequired returns the auto save status of the application.
Definition: wxstruct.h:181
bool m_hasAutoSave
Flag to indicate if this frame supports auto save.
Definition: wxstruct.h:152
int m_autoSaveInterval
The auto save interval time in seconds.
Definition: wxstruct.h:158
const wxChar traceAutoSave[]
Flag to enable auto save feature debug tracing.
Definition: basicframe.cpp:53
int EDA_BASE_FRAME::ReadHotkeyConfig ( struct EDA_HOTKEY_CONFIG aDescList)
inherited

Function ReadHotkeyConfig Read configuration data and fill the current hotkey list with hotkeys.

Parameters
aDescList= current hotkey list descr. to initialize.

Definition at line 658 of file hotkeys_basic.cpp.

659 {
660  ::ReadHotkeyConfig( GetName(), aDescList );
661  return 1;
662 }
int ReadHotkeyConfig(struct EDA_HOTKEY_CONFIG *aDescList)
Function ReadHotkeyConfig Read configuration data and fill the current hotkey list with hotkeys...
int EDA_BASE_FRAME::ReadHotkeyConfigFile ( const wxString &  aFilename,
struct EDA_HOTKEY_CONFIG aDescList 
)
inherited

Function ReadHotkeyConfigFile Read an old configuration file (&ltfile&gt.key) and fill the current hotkey list with hotkeys.

Parameters
aFilename= file name to read.
aDescList= current hotkey list descr. to initialize.

Definition at line 601 of file hotkeys_basic.cpp.

References DEFAULT_HOTKEY_FILENAME_EXT, and ParseHotkeyConfig().

Referenced by EDA_BASE_FRAME::ImportHotkeyConfigFromFile().

603 {
604  wxFileName fn( aFilename );
605  fn.SetExt( DEFAULT_HOTKEY_FILENAME_EXT );
606 
607  wxFile cfgfile( fn.GetFullPath() );
608 
609  if( !cfgfile.IsOpened() ) // There is a problem to open file
610  return 0;
611 
612  // get length
613  cfgfile.SeekEnd();
614  wxFileOffset size = cfgfile.Tell();
615  cfgfile.Seek( 0 );
616 
617  // read data
618  char* buffer = new char[size];
619  cfgfile.Read( buffer, size );
620 
621  wxString data( buffer, wxConvUTF8 );
622 
623  // parse
624  ParseHotkeyConfig( data, aDescList );
625 
626  // cleanup
627  delete[] buffer;
628  cfgfile.Close();
629  return 1;
630 }
void ParseHotkeyConfig(const wxString &data, struct EDA_HOTKEY_CONFIG *aDescList)
#define DEFAULT_HOTKEY_FILENAME_EXT
Definition: hotkeys_basic.h:34
VTBL_ENTRY void KIWAY_PLAYER::ReadPcbNetlist ( const wxString &  aNetlistFileName,
const wxString &  aCmpFileName,
REPORTER aReporter,
bool  aChangeFootprint,
bool  aDeleteBadTracks,
bool  aDeleteExtraFootprints,
bool  aSelectByTimestamp,
bool  aDeleteSinglePadNets,
bool  aIsDryRun 
)
inlineinherited

Function ReadPcbNetlist provides access to PcbNew's function ReadPcbNetlist.

Definition at line 199 of file kiway_player.h.

208  {
209  };
void EDA_BASE_FRAME::ReCreateMenuBar ( void  )
virtualinherited
virtual void EDA_BASE_FRAME::SaveProjectSettings ( bool  aAskForSave)
inlinevirtualinherited

Function SaveProjectSettings saves changes to the project settings to the project (.pro) file.

The method is virtual so you can override it to call the suitable save method. The base method do nothing

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

Reimplemented in PCB_EDIT_FRAME, and SCH_EDIT_FRAME.

Definition at line 282 of file wxstruct.h.

Referenced by DIALOG_PAGES_SETTINGS::OnOkClick().

282 {};
void EDA_BASE_FRAME::SaveSettings ( wxConfigBase *  aCfg)
virtualinherited

Function SaveSettings saves common frame parameters to a configuration data file.

Don't forget to call the base class's SaveSettings() from your derived SaveSettings() otherwise the frames won't remember their positions and sizes.

Reimplemented in EDA_DRAW_FRAME, PCB_BASE_FRAME, GERBVIEW_FRAME, PCB_EDIT_FRAME, LIB_EDIT_FRAME, SCH_EDIT_FRAME, KICAD_MANAGER_FRAME, CVPCB_MAINFRAME, PL_EDITOR_FRAME, EDA_3D_VIEWER, FOOTPRINT_WIZARD_FRAME, SIM_PLOT_FRAME, FOOTPRINT_VIEWER_FRAME, LIB_VIEW_FRAME, and FOOTPRINT_EDIT_FRAME.

Definition at line 335 of file basicframe.cpp.

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, EDA_BASE_FRAME::m_mruPath, wxPoint::x, and wxPoint::y.

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

336 {
337  wxString text;
338 
339  if( IsIconized() )
340  return;
341 
342  wxString baseCfgName = ConfigBaseName();
343 
344  m_FrameSize = GetSize();
345  m_FramePos = GetPosition();
346 
347  text = baseCfgName + wxT( "Pos_x" );
348  aCfg->Write( text, (long) m_FramePos.x );
349 
350  text = baseCfgName + wxT( "Pos_y" );
351  aCfg->Write( text, (long) m_FramePos.y );
352 
353  text = baseCfgName + wxT( "Size_x" );
354  aCfg->Write( text, (long) m_FrameSize.x );
355 
356  text = baseCfgName + wxT( "Size_y" );
357  aCfg->Write( text, (long) m_FrameSize.y );
358 
359  text = baseCfgName + wxT( "Maximized" );
360  aCfg->Write( text, IsMaximized() );
361 
362  if( m_hasAutoSave )
363  {
364  text = baseCfgName + entryAutoSaveInterval;
365  aCfg->Write( text, m_autoSaveInterval );
366  }
367 
368  // Once this is fully implemented, wxAuiManager will be used to maintain
369  // the persistance of the main frame and all it's managed windows and
370  // all of the legacy frame persistence position code can be removed.
371  wxString perspective = m_auimgr.SavePerspective();
372 
373  // printf( "perspective(%s): %s\n",
374  // TO_UTF8( m_FrameName + entryPerspective ), TO_UTF8( perspective ) );
375  aCfg->Write( baseCfgName + entryPerspective, perspective );
376  aCfg->Write( baseCfgName + entryMruPath, m_mruPath );
377 }
wxString m_mruPath
Most recently used path.
Definition: wxstruct.h:165
wxString ConfigBaseName()
Function ConfigBaseName.
Definition: wxstruct.h:268
wxAuiManager m_auimgr
Definition: wxstruct.h:149
static const wxString entryPerspective
Configuration file entry for wxAuiManger perspective.
Definition: basicframe.cpp:62
wxPoint m_FramePos
Definition: wxstruct.h:139
static const wxString entryAutoSaveInterval
Configuration file entry name for auto save interval.
Definition: basicframe.cpp:59
bool m_hasAutoSave
Flag to indicate if this frame supports auto save.
Definition: wxstruct.h:152
wxSize m_FrameSize
Definition: wxstruct.h:140
static const wxString entryMruPath
Configuration file entry for most recently used path.
Definition: basicframe.cpp:65
int m_autoSaveInterval
The auto save interval time in seconds.
Definition: wxstruct.h:158
void EDA_BASE_FRAME::SetAutoSaveInterval ( int  aInterval)
inherited

Definition at line 224 of file basicframe.cpp.

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

Referenced by DIALOG_GENERALOPTIONS::OnOkClick(), and SCH_EDIT_FRAME::OnPreferencesOptions().

225 {
226  m_autoSaveInterval = aInterval;
227 
228  if( m_autoSaveTimer->IsRunning() )
229  {
230  if( m_autoSaveInterval > 0 )
231  {
232  m_autoSaveTimer->Start( m_autoSaveInterval * 1000, wxTIMER_ONE_SHOT );
233  }
234  else
235  {
236  m_autoSaveTimer->Stop();
237  m_autoSaveState = false;
238  }
239  }
240 }
bool m_autoSaveState
Flag to indicate the last auto save state.
Definition: wxstruct.h:155
wxTimer * m_autoSaveTimer
The timer used to implement the auto save feature;.
Definition: wxstruct.h:161
int m_autoSaveInterval
The auto save interval time in seconds.
Definition: wxstruct.h:158
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 41 of file kiway_holder.cpp.

References KIWAY_HOLDER::m_kiway, and name.

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

42 {
43 #if defined(DEBUG)
44  // offer a trap point for debugging most any window
45  wxASSERT( aDest );
46  if( !strcmp( typeid(aDest).name(), "DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB" ) )
47  {
48  int breakhere=1;
49  (void) breakhere;
50  }
51 #endif
52 
53  (void) aDest;
54 
55  m_kiway = aKiway;
56 }
KIWAY * m_kiway
Definition: kiway_player.h:85
const char * name
void KIWAY_PLAYER::SetModal ( bool  aIsModal)
inlineprotectedinherited

Definition at line 260 of file kiway_player.h.

References KIWAY_PLAYER::m_modal.

Referenced by LIB_VIEW_FRAME::LIB_VIEW_FRAME().

260 { m_modal = aIsModal; }
void EDA_BASE_FRAME::SetMruPath ( const wxString &  aPath)
inlineinherited

Definition at line 369 of file wxstruct.h.

Referenced by EDA_BASE_FRAME::ExportHotkeyConfigToFile(), EDA_BASE_FRAME::ImportHotkeyConfigFromFile(), and KICAD_MANAGER_FRAME::LoadProject().

369 { m_mruPath = aPath; }
wxString m_mruPath
Most recently used path.
Definition: wxstruct.h:165
void EDA_BASE_FRAME::ShowChangedIcons ( )
virtualinherited

Function ShowChangedIcons redraws items menus after a icon was changed option.

Definition at line 268 of file basicframe.cpp.

References EDA_BASE_FRAME::ReCreateMenuBar().

Referenced by KIWAY::ShowChangedIcons().

269 {
270  ReCreateMenuBar();
271  GetMenuBar()->Refresh();
272 }
virtual void ReCreateMenuBar()
Function ReCreateMenuBar Creates recreates the menu bar.
Definition: basicframe.cpp:256
void EDA_BASE_FRAME::ShowChangedLanguage ( )
virtualinherited

Function ShowChangedLanguage redraws the menus and what not in current language.

Reimplemented in PCB_EDIT_FRAME, and GERBVIEW_FRAME.

Definition at line 261 of file basicframe.cpp.

References EDA_BASE_FRAME::ReCreateMenuBar().

Referenced by KIWAY::SetLanguage(), GERBVIEW_FRAME::ShowChangedLanguage(), and PCB_EDIT_FRAME::ShowChangedLanguage().

262 {
263  ReCreateMenuBar();
264  GetMenuBar()->Refresh();
265 }
virtual void ReCreateMenuBar()
Function ReCreateMenuBar Creates recreates the menu bar.
Definition: basicframe.cpp:256
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 81 of file kiway_player.cpp.

References DBG, EDA_BASE_FRAME::Enable(), 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, TO_UTF8, and WX_EVENT_LOOP.

Referenced by DIALOG_EDIT_ONE_FIELD::OnTextValueSelectButtonClick(), FOOTPRINT_EDIT_FRAME::Process_Special_Functions(), SCH_BASE_FRAME::SelectComponentFromLibBrowser(), PCB_BASE_FRAME::SelectFootprintFromLibBrowser(), DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::showButtonHandler(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::showButtonHandler(), and DIALOG_EXCHANGE_MODULE::ViewAndSelectFootprint().

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

Function sys_search returns a SEARCH_STACK pertaining to entire program, and is overloaded in KICAD_MANAGER_FRAME.

Reimplemented in KICAD_MANAGER_FRAME.

Definition at line 389 of file basicframe.cpp.

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

Referenced by EDA_BASE_FRAME::GetKicadHelp().

390 {
391  return Kiface().KifaceSearch();
392 }
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
void EDA_BASE_FRAME::UpdateFileHistory ( const wxString &  FullFileName,
wxFileHistory *  aFileHistory = NULL 
)
inherited

Function UpdateFileHistory Updates the list of recently opened files.

Note also the menu is 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 407 of file basicframe.cpp.

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

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

409 {
410  wxFileHistory* fileHistory = aFileHistory;
411 
412  if( !fileHistory )
413  fileHistory = &Kiface().GetFileHistory();
414 
415  fileHistory->AddFileToHistory( FullFileName );
416 }
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
wxFileHistory & GetFileHistory()
Definition: kiface_i.h:123
int EDA_BASE_FRAME::WriteHotkeyConfig ( struct EDA_HOTKEY_CONFIG aDescList,
wxString *  aFullFileName = NULL 
)
virtualinherited

Function WriteHotkeyConfig Store the current hotkey list It 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 534 of file hotkeys_basic.cpp.

References AddDelimiterString(), EDA_BASE_FRAME::config(), DEFAULT_HOTKEY_FILENAME_EXT, GetChars(), GetNewConfig(), HOTKEYS_CONFIG_KEY, KeyNameFromKeyCode(), EDA_HOTKEY_CONFIG::m_HK_InfoList, EDA_HOTKEY::m_InfoMsg, EDA_HOTKEY::m_KeyCode, EDA_HOTKEY_CONFIG::m_SectionTag, EDA_HOTKEY_CONFIG::m_Title, and TO_UTF8.

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

536 {
537  wxString msg;
538  wxString keyname, infokey;
539 
540  msg = wxT( "$hotkey list\n" );
541 
542  // Print the current hotkey list
543  EDA_HOTKEY** list;
544 
545  for( ; aDescList->m_HK_InfoList != NULL; aDescList++ )
546  {
547  if( aDescList->m_Title )
548  {
549  msg += wxT( "# " );
550  msg += *aDescList->m_Title;
551  msg += wxT( "\n" );
552  }
553 
554  msg += *aDescList->m_SectionTag;
555  msg += wxT( "\n" );
556 
557  list = aDescList->m_HK_InfoList;
558 
559  for( ; *list != NULL; list++ )
560  {
561  EDA_HOTKEY* hk_decr = *list;
562  msg += wxT( "shortcut " );
563  keyname = KeyNameFromKeyCode( hk_decr->m_KeyCode );
564  AddDelimiterString( keyname );
565  infokey = hk_decr->m_InfoMsg;
566  AddDelimiterString( infokey );
567  msg += keyname + wxT( ": " ) + infokey + wxT( "\n" );
568  }
569  }
570 
571  msg += wxT( "$Endlist\n" );
572 
573  if( aFullFileName )
574  {
575  FILE* file = wxFopen( *aFullFileName, wxT( "wt" ) );
576 
577  if( file )
578  {
579  fputs( TO_UTF8( msg ), file );
580  fclose( file );
581  }
582  else
583  {
584  msg.Printf( wxT( "Unable to write file %s" ), GetChars( *aFullFileName ) );
585  return 0;
586  }
587  }
588  else
589  {
590  wxFileName fn( GetName() );
591  fn.SetExt( DEFAULT_HOTKEY_FILENAME_EXT );
592  wxConfigBase* config = GetNewConfig( fn.GetFullPath() );
593  config->Write( HOTKEYS_CONFIG_KEY, msg );
594  delete config;
595  }
596 
597  return 1;
598 }
EDA_HOTKEY ** m_HK_InfoList
Definition: hotkeys_basic.h:91
wxConfigBase * GetNewConfig(const wxString &aProgName)
Function GetNewConfig.
Definition: common.cpp:205
virtual wxConfigBase * config()
Function config returns the wxConfigBase used in SaveSettings(), and is overloaded in KICAD_MANAGER_F...
Definition: basicframe.cpp:380
#define TO_UTF8(wxstring)
Macro TO_UTF8 converts a wxString to a UTF8 encoded C string for all wxWidgets build modes...
Definition: macros.h:47
#define HOTKEYS_CONFIG_KEY
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 * m_SectionTag
Definition: hotkeys_basic.h:90
wxString m_InfoMsg
Definition: hotkeys_basic.h:64
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:92
class EDA_HOTKEY is a class to handle hot key commands.
Definition: hotkeys_basic.h:57
wxString * m_Title
Definition: hotkeys_basic.h:92
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

Member Data Documentation

wxString EDA_BASE_FRAME::m_AboutTitle
protectedinherited

Name of program displayed in About.

Definition at line 147 of file wxstruct.h.

wxMenuItem* SIM_PLOT_FRAME_BASE::m_addSignals
protected

Definition at line 53 of file sim_plot_frame_base.h.

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

bool EDA_BASE_FRAME::m_autoSaveState
protectedinherited
wxTimer* EDA_BASE_FRAME::m_autoSaveTimer
protectedinherited
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 142 of file wxstruct.h.

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

wxListCtrl* SIM_PLOT_FRAME_BASE::m_cursors
protected

Definition at line 81 of file sim_plot_frame_base.h.

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

wxMenu* SIM_PLOT_FRAME_BASE::m_fileMenu
protected

Definition at line 50 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

bool EDA_BASE_FRAME::m_hasAutoSave
protectedinherited

Flag to indicate if this frame supports auto save.

Definition at line 152 of file wxstruct.h.

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

FRAME_T EDA_BASE_FRAME::m_Ident
protectedinherited

Id Type (pcb, schematic, library..)

Definition at line 138 of file wxstruct.h.

Referenced by EDA_BASE_FRAME::EDA_BASE_FRAME().

wxMenuBar* SIM_PLOT_FRAME_BASE::m_mainMenu
protected

Definition at line 49 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

bool KIWAY_PLAYER::m_modal
protectedinherited

Definition at line 289 of file kiway_player.h.

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

WX_EVENT_LOOP* KIWAY_PLAYER::m_modal_loop
protectedinherited
wxWindow* KIWAY_PLAYER::m_modal_resultant_parent
protectedinherited

Definition at line 291 of file kiway_player.h.

Referenced by KIWAY_PLAYER::ShowModal().

bool KIWAY_PLAYER::m_modal_ret_val
protectedinherited
wxString KIWAY_PLAYER::m_modal_string
protectedinherited

Definition at line 292 of file kiway_player.h.

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

wxPanel* SIM_PLOT_FRAME_BASE::m_panelConsole
protected

Definition at line 70 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

wxPanel* SIM_PLOT_FRAME_BASE::m_panelCursors
protected

Definition at line 80 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

wxPanel* SIM_PLOT_FRAME_BASE::m_panelCursorsAndTune
protected

Definition at line 78 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

wxPanel* SIM_PLOT_FRAME_BASE::m_panelLeft
protected

Definition at line 61 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

wxPanel* SIM_PLOT_FRAME_BASE::m_panelSignals
protected

Definition at line 76 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

wxString EDA_BASE_FRAME::m_perspective
protectedinherited

wxAuiManager perspective.

Definition at line 163 of file wxstruct.h.

Referenced by EDA_BASE_FRAME::LoadSettings().

wxPanel* SIM_PLOT_FRAME_BASE::m_plotPanel
protected

Definition at line 64 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

wxMenuItem* SIM_PLOT_FRAME_BASE::m_probeSignals
protected

Definition at line 54 of file sim_plot_frame_base.h.

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

wxMenuItem* SIM_PLOT_FRAME_BASE::m_runSimulation
protected

Definition at line 52 of file sim_plot_frame_base.h.

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

wxMenuItem* SIM_PLOT_FRAME_BASE::m_settings
protected

Definition at line 56 of file sim_plot_frame_base.h.

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

wxPanel* SIM_PLOT_FRAME_BASE::m_sidePanel
protected

Definition at line 73 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

wxBoxSizer* SIM_PLOT_FRAME_BASE::m_sideSizer
protected

Definition at line 74 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

wxTextCtrl* SIM_PLOT_FRAME_BASE::m_simConsole
protected
wxMenu* SIM_PLOT_FRAME_BASE::m_simulationMenu
protected

Definition at line 51 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

wxBoxSizer* SIM_PLOT_FRAME_BASE::m_sizer11
protected

Definition at line 62 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

wxBoxSizer* SIM_PLOT_FRAME_BASE::m_sizer8
protected

Definition at line 68 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

wxBoxSizer* SIM_PLOT_FRAME_BASE::m_sizerConsole
protected

Definition at line 71 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

wxBoxSizer* SIM_PLOT_FRAME_BASE::m_sizerMain
protected

Definition at line 58 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

wxBoxSizer* SIM_PLOT_FRAME_BASE::m_sizerPlot
protected

Definition at line 65 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

wxSplitterWindow* SIM_PLOT_FRAME_BASE::m_splitterLeftRight
protected
wxSplitterWindow* SIM_PLOT_FRAME_BASE::m_splitterPlotAndConsole
protected
wxSplitterWindow* SIM_PLOT_FRAME_BASE::m_splitterSignals
protected
wxSplitterWindow* SIM_PLOT_FRAME_BASE::m_splitterTuneValues
protected
wxStaticText* SIM_PLOT_FRAME_BASE::m_staticText2
protected

Definition at line 69 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

wxToolBar* SIM_PLOT_FRAME_BASE::m_toolBar
protected
wxPanel* SIM_PLOT_FRAME_BASE::m_tunePanel
protected
wxBoxSizer* SIM_PLOT_FRAME_BASE::m_tuneSizer
protected

Definition at line 84 of file sim_plot_frame_base.h.

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

wxStaticBoxSizer* SIM_PLOT_FRAME_BASE::m_tuneSizerStb
protected

Definition at line 83 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

wxMenuItem* SIM_PLOT_FRAME_BASE::m_tuneValue
protected

Definition at line 55 of file sim_plot_frame_base.h.

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

wxMenu* SIM_PLOT_FRAME_BASE::m_viewMenu
protected

Definition at line 57 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE().

wxPanel* SIM_PLOT_FRAME_BASE::m_welcomePanel
protected

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