KiCad PCB EDA Suite
CVPCB_MAINFRAME Class Reference

The CvPcb application main window. More...

#include <cvpcb_mainframe.h>

Inheritance diagram for CVPCB_MAINFRAME:
KIWAY_PLAYER EDA_BASE_FRAME KIWAY_HOLDER

Public Member Functions

 ~CVPCB_MAINFRAME ()
 
bool OpenProjectFiles (const std::vector< wxString > &aFileSet, int aCtl=0) override
 
void KiwayMailIn (KIWAY_EXPRESS &aEvent) override
 Function KiwayMailIn receives KIWAY_EXPRESS messages from other players. More...
 
DISPLAY_FOOTPRINTS_FRAMEGetFootprintViewerFrame ()
 
void OnSelectComponent (wxListEvent &event)
 Function OnSelectComponent Called when clicking on a component in component list window. More...
 
void OnEditFootprintLibraryTable (wxCommandEvent &event)
 Function OnEditFootprintLibraryTable displays the footprint library table editing dialog and updates the global and local footprint tables accordingly. More...
 
void OnCancel (wxCommandEvent &aEvent)
 
void OnOK (wxCommandEvent &aEvent)
 
void OnSaveAndContinue (wxCommandEvent &aEvent)
 
void OnQuit (wxCommandEvent &event)
 
void OnCloseWindow (wxCloseEvent &Event)
 
void OnSize (wxSizeEvent &SizeEvent)
 
void OnKeyDown (wxKeyEvent &aEvent)
 
void ReCreateHToolbar ()
 
virtual void ReCreateMenuBar () override
 (Re)Create the menubar for the CvPcb mainframe More...
 
void ShowChangedLanguage () override
 Redraw the menus and what not in current language. More...
 
void ChangeFocus (bool aMoveRight)
 
void ToFirstNA (wxCommandEvent &event)
 
void ToPreviousNA (wxCommandEvent &event)
 
void DelAssociations (wxCommandEvent &event)
 Function DelAssociations removes all component footprint associations already made. More...
 
void OnConfigurePaths (wxCommandEvent &aEvent)
 
void OnEditEquFilesList (wxCommandEvent &aEvent)
 Function OnEditEquFilesList envokes the equ files list edit dialog. More...
 
void DisplayModule (wxCommandEvent &event)
 
void OnComponentRightClick (wxMouseEvent &event)
 
void OnFootprintRightClick (wxMouseEvent &event)
 
void AutomaticFootprintMatching (wxCommandEvent &event)
 Called by the automatic association button Read *.equ files to try to find corresponding footprint for each component that is not already linked to a footprint ( a "free" component ) format of a line: 'cmp_ref' 'footprint_name'. More...
 
void OnSelectFilteringFootprint (wxCommandEvent &event)
 Function OnSelectFilteringFootprint is the command event handler for enabling and disabling footprint filtering. More...
 
void OnEnterFilteringText (wxCommandEvent &event)
 Function OnEnterFilteringText Is called each time the text of m_tcFilterString is changed. More...
 
void SetNewPkg (const wxString &aFootprintName)
 Function SetNewPkg set the footprint name for all selected components in component list and selects the next component. More...
 
void SetNewPkg (const wxString &aFootprintName, int aIndex)
 Function SetNewPkg Set the footprint name for the component of position aIndex in the component list. More...
 
void BuildCmpListBox ()
 
void BuildFOOTPRINTS_LISTBOX ()
 
void BuildLIBRARY_LISTBOX ()
 
void CreateScreenCmp ()
 Create or Update the frame showing the current highlighted footprint and (if showed) the 3D display frame. More...
 
bool SaveFootprintAssociation (bool doSaveSchematic)
 Function SaveFootprintAssociation saves the edits that the user has done by sending them back to eeschema via the kiway. More...
 
bool ReadNetListAndFpFiles (const std::string &aNetlist)
 Function ReadNetListAndFpFiles loads the netlist file built on the fly by Eeschema and loads footprint libraries from fp lib tables. More...
 
int ReadSchematicNetlist (const std::string &aNetlist)
 Function ReadSchematicNetlist read the netlist (.net) file built on the fly by Eeschema. More...
 
void LoadProjectFile ()
 Function LoadProjectFile reads the CvPcb configuration parameter from the project (.pro) file aFileName. More...
 
void SaveProjectFile ()
 Function SaveProjectFile Saves the CvPcb configuration parameter from the project (.pro) file aFileName. More...
 
void LoadSettings (wxConfigBase *aCfg) override
 Load common frame parameters from a configuration file. More...
 
void SaveSettings (wxConfigBase *aCfg) override
 Saves common frame parameters to a configuration data file. More...
 
void DisplayStatus ()
 Function DisplayStatus updates the information displayed on the status bar at bottom of the main frame. More...
 
bool LoadFootprintFiles ()
 Function LoadFootprintFiles reads the list of footprint (*.mod files) and generate the list of footprints. More...
 
PARAM_CFG_ARRAYGetProjectFileParameters (void)
 Function GetProjectFileParameters return project file parameter list for CvPcb. More...
 
void SendMessageToEESCHEMA (bool aClearHighligntOnly=false)
 Function SendMessageToEESCHEMA Send a remote command to Eeschema via a socket, Commands are $PART: "reference" put cursor on component anchor. More...
 
COMPONENTGetSelectedComponent ()
 
wxString GetSelectedFootprint ()
 
void SetStatusText (const wxString &aText, int aNumber=0) override
 
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...
 
bool Destroy () override
 Our version of Destroy() which is virtual from wxWidgets. More...
 
bool ProcessEvent (wxEvent &aEvent) override
 Override the default process event handler to implement the auto save feature. More...
 
void SetAutoSaveInterval (int aInterval)
 
int GetAutoSaveInterval () const
 
bool IsType (FRAME_T aType) const
 
void GetKicadHelp (wxCommandEvent &event)
 
void GetKicadContribute (wxCommandEvent &event)
 
void GetKicadAbout (wxCommandEvent &event)
 
bool ShowPreferences (EDA_HOTKEY_CONFIG *aHotkeys, EDA_HOTKEY_CONFIG *aShowHotkeys, const wxString &aHotkeysNickname)
 
void PrintMsg (const wxString &text)
 
virtual void InstallPreferences (PAGED_DIALOG *aParent)
 Allow a frame to load its preference panels (if any) into the preferences dialog. More...
 
wxString ConfigBaseName ()
 
virtual void SaveProjectSettings (bool aAskForSave)
 Save changes to the project settings to the project (.pro) file. More...
 
virtual int WriteHotkeyConfig (struct EDA_HOTKEY_CONFIG *aDescList, wxString *aFullFileName=NULL)
 Store the current hotkey list. More...
 
void ImportHotkeyConfigFromFile (EDA_HOTKEY_CONFIG *aDescList, const wxString &aDefaultShortname)
 Prompt the user for an old hotkey file to read, and read it. More...
 
void ExportHotkeyConfigToFile (EDA_HOTKEY_CONFIG *aDescList, const wxString &aDefaultShortname)
 Prompt the user for an old hotkey file to read, and read it. More...
 
wxString GetFileFromHistory (int cmdId, const wxString &type, wxFileHistory *aFileHistory=NULL)
 Fetches the file name from the file history list. More...
 
void UpdateFileHistory (const wxString &FullFileName, wxFileHistory *aFileHistory=NULL)
 Update the list of recently opened files. More...
 
void SetMruPath (const wxString &aPath)
 
wxString GetMruPath () const
 
bool IsWritable (const wxFileName &aFileName)
 Checks if aFileName can be written. More...
 
void CheckForAutoSaveFile (const wxFileName &aFileName)
 Check if an auto save file exists for aFileName and takes the appropriate action depending on the user input. More...
 
virtual void CommonSettingsChanged ()
 Notification event that some of the common (suite-wide) settings have changed. More...
 
bool PostCommandMenuEvent (int evt_type)
 Post a menu event to the frame, which can be used to trigger actions bound to menu items. More...
 
const wxString & GetAboutTitle () const
 
KIWAYKiway () const
 Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in. More...
 
PROJECTPrj () const
 Function Prj returns a reference to the PROJECT "associated with" this KIWAY. More...
 
VTBL_ENTRY EDA_UNITS_T GetUserUnits () const
 Function GetUserUnits Allows participation in KEYWAY_PLAYER/DIALOG_SHIM userUnits inheritance. More...
 
VTBL_ENTRY TOOL_MANAGERGetToolManager () const
 Function GetToolManager Return the tool manager instance, if any. More...
 
void SetKiway (wxWindow *aDest, KIWAY *aKiway)
 Function SetKiway. More...
 

Public Attributes

wxArrayString m_ModuleLibNames
 
wxArrayString m_EquFilesNames
 
FOOTPRINT_LISTm_FootprintsList
 

Protected Member Functions

 CVPCB_MAINFRAME (KIWAY *aKiway, wxWindow *aParent)
 
bool IsModal ()
 
void SetModal (bool aIsModal)
 
bool IsDismissed ()
 Function IsDismissed returns false only if both the frame is acting in modal mode and it has not been dismissed yet with DismissModal(). More...
 
void DismissModal (bool aRetVal, const wxString &aResult=wxEmptyString)
 
void kiway_express (KIWAY_EXPRESS &aEvent)
 event handler, routes to derivative specific virtual KiwayMailIn() More...
 
void language_change (wxCommandEvent &event)
 Function language_change is an event handler called on a language menu selection. More...
 
void onAutoSaveTimer (wxTimerEvent &aEvent)
 Handle the auto save timer event. More...
 
virtual bool isAutoSaveRequired () const
 Return the auto save status of the application. More...
 
virtual bool doAutoSave ()
 This should be overridden by the derived class to handle the auto save feature. More...
 
virtual wxConfigBase * config ()
 Return the wxConfigBase used in SaveSettings(). More...
 
virtual const SEARCH_STACKsys_search ()
 Return a SEARCH_STACK pertaining to entire program. More...
 
virtual wxString help_name ()
 

Static Protected Member Functions

static wxString GetBackupSuffix ()
 
static wxString GetAutoSaveFilePrefix ()
 

Protected Attributes

bool m_modified
 
bool m_skipComponentSelect
 
PARAM_CFG_ARRAY m_projectFileParams
 
bool m_initialized
 
bool m_modal
 
WX_EVENT_LOOPm_modal_loop
 
wxWindow * m_modal_resultant_parent
 
wxString m_modal_string
 
bool m_modal_ret_val
 
FRAME_T m_Ident
 Id Type (pcb, schematic, library..) More...
 
wxPoint m_FramePos
 
wxSize m_FrameSize
 
wxString m_configFrameName
 prefix used in config to identify some params (frame size...) More...
 
wxString m_AboutTitle
 Name of program displayed in About. More...
 
wxAuiManager m_auimgr
 
bool m_hasAutoSave
 Flag to indicate if this frame supports auto save. More...
 
bool m_autoSaveState
 Flag to indicate the last auto save state. More...
 
int m_autoSaveInterval
 The auto save interval time in seconds. More...
 
wxTimer * m_autoSaveTimer
 The timer used to implement the auto save feature;. More...
 
wxString m_perspective
 wxAuiManager perspective. More...
 
wxString m_mruPath
 Most recently used path. More...
 

Static Protected Attributes

static constexpr int KICAD_AUI_TB_STYLE = wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_PLAIN_BACKGROUND
 

Default style flags used for wxAUI toolbars

More...
 

Private Member Functions

void OnFilterFPbyKeywords (wxUpdateUIEvent &event)
 
void OnFilterFPbyPinCount (wxUpdateUIEvent &event)
 
void OnFilterFPbyLibrary (wxUpdateUIEvent &event)
 
void OnFilterFPbyKeyName (wxUpdateUIEvent &event)
 
int buildEquivalenceList (FOOTPRINT_EQUIVALENCE_LIST &aList, wxString *aErrorMessages=NULL)
 read the .equ files and populate the list of equvalents More...
 
void refreshAfterComponentSearch (COMPONENT *component)
 

Private Attributes

wxString m_currentSearchPattern
 
NETLIST m_netlist
 
int m_filteringOptions
 
wxAuiToolBar * m_mainToolBar
 
FOOTPRINTS_LISTBOXm_footprintListBox
 
LIBRARY_LISTBOXm_libListBox
 
COMPONENTS_LISTBOXm_compListBox
 
wxTextCtrl * m_tcFilterString
 
wxStaticText * m_statusLine1
 
wxStaticText * m_statusLine2
 
wxButton * m_saveAndContinue
 

Friends

struct CV::IFACE
 

Detailed Description

The CvPcb application main window.

Definition at line 57 of file cvpcb_mainframe.h.

Constructor & Destructor Documentation

◆ CVPCB_MAINFRAME()

CVPCB_MAINFRAME::CVPCB_MAINFRAME ( KIWAY aKiway,
wxWindow *  aParent 
)
protected

Definition at line 110 of file cvpcb_mainframe.cpp.

110  :
111  KIWAY_PLAYER( aKiway, aParent, FRAME_CVPCB, _( "Assign Footprints" ), wxDefaultPosition,
113 {
114  m_compListBox = NULL;
115  m_footprintListBox = NULL;
116  m_libListBox = NULL;
117  m_mainToolBar = NULL;
118  m_modified = false;
119  m_skipComponentSelect = false;
120  m_filteringOptions = 0;
121  m_tcFilterString = NULL;
123  m_initialized = false;
124 
125  // Give an icon
126  wxIcon icon;
127  icon.CopyFromBitmap( KiBitmap( icon_cvpcb_xpm ) );
128  SetIcon( icon );
129 
130  SetAutoLayout( true );
131 
132  LoadSettings( config() );
133 
134  wxSize const frame_min( ConvertDialogToPixels( FRAME_MIN_SIZE_DU ) );
135 
136  SetSizeHints( frame_min );
137 
138  // Frame size and position
139  SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
140 
141  ReCreateMenuBar();
143 
144  // Create list of available modules and components of the schematic
145  BuildCmpListBox();
148 
149  m_auimgr.SetManagedWindow( this );
150 
151  m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer(6) );
152 
153  m_auimgr.AddPane( m_libListBox, EDA_PANE().Palette().Name( "Libraries" ).Left().Layer(1)
154  .Caption( _( "Footprint Libraries" ) )
155  .BestSize( (int) ( m_FrameSize.x * 0.20 ), m_FrameSize.y ) );
156 
157  m_auimgr.AddPane( m_compListBox, EDA_PANE().Palette().Name( "Components" ).Center().Layer(0)
158  .Caption( _( "Symbol : Footprint Assignments" ) ) );
159 
160  m_auimgr.AddPane( m_footprintListBox, EDA_PANE().Palette().Name( "Footprints" ).Right().Layer(1)
161  .Caption( _( "Filtered Footprints" ) )
162  .BestSize( (int) ( m_FrameSize.x * 0.30 ), m_FrameSize.y ) );
163 
164  // Build the bottom panel, to display 2 status texts and the buttons:
165  auto bottomPanel = new wxPanel( this );
166  auto panelSizer = new wxBoxSizer( wxVERTICAL );
167 
168  wxFlexGridSizer* fgSizerStatus = new wxFlexGridSizer( 2, 1, 0, 0 );
169  fgSizerStatus->SetFlexibleDirection( wxBOTH );
170  fgSizerStatus->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
171 
172  m_statusLine1 = new wxStaticText( bottomPanel, wxID_ANY, wxEmptyString );
173  fgSizerStatus->Add( m_statusLine1, 0, 0, 5 );
174 
175  m_statusLine2 = new wxStaticText( bottomPanel, wxID_ANY, wxEmptyString );
176  fgSizerStatus->Add( m_statusLine2, 0, wxBOTTOM, 3 );
177 
178  panelSizer->Add( fgSizerStatus, 1, wxEXPAND|wxLEFT, 2 );
179 
180  wxStaticLine* staticline1 = new wxStaticLine( bottomPanel );
181  panelSizer->Add( staticline1, 0, wxEXPAND, 5 );
182 
183  wxFont statusFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
184  statusFont.SetSymbolicSize( wxFONTSIZE_SMALL );
185  m_statusLine1->SetFont( statusFont );
186  m_statusLine2->SetFont( statusFont );
187 
188  // Add buttons:
189  auto buttonsSizer = new wxBoxSizer( wxHORIZONTAL );
190  auto sdbSizer = new wxStdDialogButtonSizer();
191 
192  m_saveAndContinue = new wxButton( bottomPanel, ID_SAVE_PROJECT,
193  _( "Apply, Save Schematic && Continue" ) );
194  buttonsSizer->Add( m_saveAndContinue, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 20 );
195 
196  auto sdbSizerOK = new wxButton( bottomPanel, wxID_OK );
197  sdbSizer->AddButton( sdbSizerOK );
198  auto sdbSizerCancel = new wxButton( bottomPanel, wxID_CANCEL );
199  sdbSizer->AddButton( sdbSizerCancel );
200  sdbSizer->Realize();
201 
202  buttonsSizer->Add( sdbSizer, 0, 0, 5 );
203  panelSizer->Add( buttonsSizer, 0, wxALIGN_RIGHT|wxALL, 5 );
204 
205  bottomPanel->SetSizer( panelSizer );
206  bottomPanel->Fit();
207 
208  sdbSizerOK->SetDefault();
209 
210  m_auimgr.AddPane( bottomPanel, EDA_PANE().HToolbar().Name( "Buttons" ).Bottom().Layer(6) );
211 
212  m_auimgr.Update();
213  m_initialized = true;
214 
215  // Connect Events
216  m_saveAndContinue->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CVPCB_MAINFRAME::OnSaveAndContinue ), NULL, this );
217  m_footprintListBox->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( CVPCB_MAINFRAME::OnFootprintRightClick ), NULL, this );
218  m_compListBox->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( CVPCB_MAINFRAME::OnComponentRightClick ), NULL, this );
219 }
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_player.h:61
FOOTPRINT_LIST * m_FootprintsList
COMPONENTS_LISTBOX * m_compListBox
KIWAY_PLAYER(KIWAY *aKiway, wxWindow *aParent, FRAME_T aFrameType, const wxString &aTitle, const wxPoint &aPos, const wxSize &aSize, long aStyle, const wxString &aWdoName=wxFrameNameStr)
#define CVPCB_MAINFRAME_NAME
virtual wxConfigBase * config()
Return the wxConfigBase used in SaveSettings().
wxAuiManager m_auimgr
wxSize const FRAME_MIN_SIZE_DU(350, 250)
void LoadSettings(wxConfigBase *aCfg) override
Load common frame parameters from a configuration file.
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
wxTextCtrl * m_tcFilterString
static FOOTPRINT_LIST * GetInstance(KIWAY &aKiway)
Factory function to return a FOOTPRINT_LIST via Kiway.
void OnComponentRightClick(wxMouseEvent &event)
wxAuiToolBar * m_mainToolBar
#define KICAD_DEFAULT_DRAWFRAME_STYLE
virtual void ReCreateMenuBar() override
(Re)Create the menubar for the CvPcb mainframe
void BuildFOOTPRINTS_LISTBOX()
void OnFootprintRightClick(wxMouseEvent &event)
Specialization of the wxAuiPaneInfo class for KiCad panels.
LIBRARY_LISTBOX * m_libListBox
wxStaticText * m_statusLine2
FOOTPRINTS_LISTBOX * m_footprintListBox
void OnSaveAndContinue(wxCommandEvent &aEvent)
wxButton * m_saveAndContinue
wxStaticText * m_statusLine1

References BuildCmpListBox(), BuildFOOTPRINTS_LISTBOX(), BuildLIBRARY_LISTBOX(), PCAD2KICAD::Center, EDA_BASE_FRAME::config(), FRAME_MIN_SIZE_DU(), FOOTPRINT_LIST::GetInstance(), ID_SAVE_PROJECT, KiBitmap(), KIWAY_HOLDER::Kiway(), PCAD2KICAD::Left, LoadSettings(), EDA_BASE_FRAME::m_auimgr, m_compListBox, m_filteringOptions, m_footprintListBox, m_FootprintsList, EDA_BASE_FRAME::m_FramePos, EDA_BASE_FRAME::m_FrameSize, m_initialized, m_libListBox, m_mainToolBar, m_modified, m_saveAndContinue, m_skipComponentSelect, m_statusLine1, m_statusLine2, m_tcFilterString, OnComponentRightClick(), OnFootprintRightClick(), OnSaveAndContinue(), ReCreateHToolbar(), ReCreateMenuBar(), and PCAD2KICAD::Right.

◆ ~CVPCB_MAINFRAME()

CVPCB_MAINFRAME::~CVPCB_MAINFRAME ( )

Definition at line 222 of file cvpcb_mainframe.cpp.

223 {
224  // Disconnect Events
225  m_saveAndContinue->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CVPCB_MAINFRAME::OnSaveAndContinue ), NULL, this );
226  m_footprintListBox->Disconnect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( CVPCB_MAINFRAME::OnFootprintRightClick ), NULL, this );
227 
228  m_auimgr.UnInit();
229 }
wxAuiManager m_auimgr
void OnFootprintRightClick(wxMouseEvent &event)
FOOTPRINTS_LISTBOX * m_footprintListBox
void OnSaveAndContinue(wxCommandEvent &aEvent)
wxButton * m_saveAndContinue

References EDA_BASE_FRAME::m_auimgr, m_footprintListBox, m_saveAndContinue, OnFootprintRightClick(), and OnSaveAndContinue().

Member Function Documentation

◆ AutomaticFootprintMatching()

void CVPCB_MAINFRAME::AutomaticFootprintMatching ( wxCommandEvent &  event)

Called by the automatic association button Read *.equ files to try to find corresponding footprint for each component that is not already linked to a footprint ( a "free" component ) format of a line: 'cmp_ref' 'footprint_name'.

Definition at line 170 of file auto_associate.cpp.

171 {
172  FOOTPRINT_EQUIVALENCE_LIST equiv_List;
173  wxString msg, error_msg;
174 
175  if( m_netlist.IsEmpty() )
176  return;
177 
178  if( buildEquivalenceList( equiv_List, &error_msg ) )
179  wxMessageBox( error_msg, _( "Equivalence File Load Error" ), wxOK | wxICON_WARNING, this );
180 
181  // Sort the association list by component value.
182  // When sorted, find duplicate definitions (i.e. 2 or more items
183  // having the same component value) is more easy.
184  std::sort( equiv_List.begin(), equiv_List.end(), sortListbyCmpValue );
185 
186  // Display the number of footprint/component equivalences.
187  msg.Printf( _( "%lu footprint/cmp equivalences found." ), (unsigned long)equiv_List.size() );
188  SetStatusText( msg, 0 );
189 
190  // Now, associate each free component with a footprint, when the association
191  // is found in list
192  m_skipComponentSelect = true;
193  error_msg.Empty();
194 
195  for( unsigned kk = 0; kk < m_netlist.GetCount(); kk++ )
196  {
197  COMPONENT* component = m_netlist.GetComponent( kk );
198 
199  bool found = false;
200 
201  if( !component->GetFPID().empty() ) // the component has already a footprint
202  continue;
203 
204  // Here a first attempt is made. We can have multiple equivItem of the same value.
205  // When happens, using the footprint filter of components can remove the ambiguity by
206  // filtering equivItem so one can use multiple equiv_List (for polar and
207  // non-polar caps for example)
208  wxString fpid_candidate;
209 
210  for( unsigned idx = 0; idx < equiv_List.size(); idx++ )
211  {
212  FOOTPRINT_EQUIVALENCE& equivItem = equiv_List[idx];
213 
214  if( equivItem.m_ComponentValue.CmpNoCase( component->GetValue() ) != 0 )
215  continue;
216 
217  const FOOTPRINT_INFO *module = m_FootprintsList->GetModuleInfo( equivItem.m_FootprintFPID );
218 
219  bool equ_is_unique = true;
220  unsigned next = idx+1;
221  int previous = idx-1;
222 
223  if( next < equiv_List.size() &&
224  equivItem.m_ComponentValue == equiv_List[next].m_ComponentValue )
225  equ_is_unique = false;
226 
227  if( previous >= 0 &&
228  equivItem.m_ComponentValue == equiv_List[previous].m_ComponentValue )
229  equ_is_unique = false;
230 
231  // If the equivalence is unique, no ambiguity: use the association
232  if( module && equ_is_unique )
233  {
234  SetNewPkg( equivItem.m_FootprintFPID, kk );
235  found = true;
236  break;
237  }
238 
239  // Store the first candidate found in list, when equivalence is not unique
240  // We use it later.
241  if( module && fpid_candidate.IsEmpty() )
242  fpid_candidate = equivItem.m_FootprintFPID;
243 
244  // The equivalence is not unique: use the footprint filter to try to remove
245  // ambiguity
246  // if the footprint filter does not remove ambiguity, we will use fpid_candidate
247  if( module )
248  {
249  size_t filtercount = component->GetFootprintFilters().GetCount();
250  found = ( 0 == filtercount ); // if no entries, do not filter
251 
252  for( size_t jj = 0; jj < filtercount && !found; jj++ )
253  {
254  found = module->GetFootprintName().Matches( component->GetFootprintFilters()[jj] );
255  }
256  }
257  else
258  {
259  msg.Printf( _( "Component %s: footprint %s not found in any of the project "
260  "footprint libraries." ),
261  GetChars( component->GetReference() ),
262  GetChars( equivItem.m_FootprintFPID ) );
263 
264  if( ! error_msg.IsEmpty() )
265  error_msg << wxT("\n\n");
266 
267  error_msg += msg;
268  }
269 
270  if( found )
271  {
272  SetNewPkg( equivItem.m_FootprintFPID, kk );
273  break;
274  }
275  }
276 
277  if( found )
278  continue;
279  else if( !fpid_candidate.IsEmpty() )
280  {
281  SetNewPkg( fpid_candidate, kk );
282  continue;
283  }
284 
285  // obviously the last chance: there's only one filter matching one footprint
286  if( 1 == component->GetFootprintFilters().GetCount() )
287  {
288  // we do not need to analyze wildcards: single footprint do not
289  // contain them and if there are wildcards it just will not match any
290  const FOOTPRINT_INFO* module = m_FootprintsList->GetModuleInfo( component->GetFootprintFilters()[0] );
291 
292  if( module )
293  {
294  SetNewPkg( component->GetFootprintFilters()[0], kk );
295  }
296  }
297  }
298 
299  if( !error_msg.IsEmpty() )
300  wxMessageBox( error_msg, _( "CvPcb Warning" ), wxOK | wxICON_WARNING, this );
301 
302  m_skipComponentSelect = false;
303  m_compListBox->Refresh();
304 }
CITER next(CITER it)
Definition: ptree.cpp:130
FOOTPRINT_LIST * m_FootprintsList
FOOTPRINT_INFO * GetModuleInfo(const wxString &aFootprintId)
Get info for a module by id.
COMPONENTS_LISTBOX * m_compListBox
bool sortListbyCmpValue(const FOOTPRINT_EQUIVALENCE &ref, const FOOTPRINT_EQUIVALENCE &test)
void SetNewPkg(const wxString &aFootprintName)
Function SetNewPkg set the footprint name for all selected components in component list and selects t...
unsigned GetCount() const
Function GetCount.
Definition: pcb_netlist.h:256
bool empty() const
Definition: lib_id.h:186
const LIB_ID & GetFPID() const
Definition: pcb_netlist.h:166
boost::ptr_vector< FOOTPRINT_EQUIVALENCE > FOOTPRINT_EQUIVALENCE_LIST
const wxString & GetReference() const
Definition: pcb_netlist.h:151
void SetStatusText(const wxString &aText, int aNumber=0) override
Class COMPONENT is used to store components and all of their related information found in a netlist.
Definition: pcb_netlist.h:83
int buildEquivalenceList(FOOTPRINT_EQUIVALENCE_LIST &aList, wxString *aErrorMessages=NULL)
read the .equ files and populate the list of equvalents
COMPONENT * GetComponent(unsigned aIndex)
Function GetComponent returns the COMPONENT at aIndex.
Definition: pcb_netlist.h:265
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:100
bool IsEmpty() const
Function IsEmpty()
Definition: pcb_netlist.h:244
const wxString & GetValue() const
Definition: pcb_netlist.h:153
const wxArrayString & GetFootprintFilters() const
Definition: pcb_netlist.h:177
const wxString & GetFootprintName() const

References buildEquivalenceList(), LIB_ID::empty(), GetChars(), NETLIST::GetComponent(), NETLIST::GetCount(), COMPONENT::GetFootprintFilters(), FOOTPRINT_INFO::GetFootprintName(), COMPONENT::GetFPID(), FOOTPRINT_LIST::GetModuleInfo(), COMPONENT::GetReference(), COMPONENT::GetValue(), NETLIST::IsEmpty(), m_compListBox, FOOTPRINT_EQUIVALENCE::m_ComponentValue, FOOTPRINT_EQUIVALENCE::m_FootprintFPID, m_FootprintsList, m_netlist, m_skipComponentSelect, next(), SetNewPkg(), SetStatusText(), and sortListbyCmpValue().

◆ BuildCmpListBox()

void CVPCB_MAINFRAME::BuildCmpListBox ( )

Definition at line 847 of file cvpcb_mainframe.cpp.

848 {
849  wxString msg;
850  COMPONENT* component;
851  wxFont guiFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
852 
853  if( m_compListBox == NULL )
854  {
856  wxDefaultPosition, wxDefaultSize );
857  m_compListBox->SetFont( wxFont( guiFont.GetPointSize(),
858  wxFONTFAMILY_MODERN,
859  wxFONTSTYLE_NORMAL,
860  wxFONTWEIGHT_NORMAL ) );
861  }
862 
864 
865  for( unsigned i = 0; i < m_netlist.GetCount(); i++ )
866  {
867  component = m_netlist.GetComponent( i );
868 
869  msg.Printf( CMP_FORMAT, m_compListBox->GetCount() + 1,
870  GetChars( component->GetReference() ),
871  GetChars( component->GetValue() ),
872  GetChars( FROM_UTF8( component->GetFPID().Format().c_str() ) ) );
873  m_compListBox->m_ComponentList.Add( msg );
874  }
875 
876  if( m_compListBox->m_ComponentList.Count() )
877  {
878  m_compListBox->SetItemCount( m_compListBox->m_ComponentList.Count() );
879  m_compListBox->SetSelection( 0, true );
880  m_compListBox->RefreshItems( 0L, m_compListBox->m_ComponentList.Count()-1 );
882  }
883 }
static wxString FROM_UTF8(const char *cstring)
function FROM_UTF8 converts a UTF8 encoded C string to a wxString for all wxWidgets build modes.
Definition: macros.h:61
COMPONENTS_LISTBOX * m_compListBox
void SetSelection(int index, bool State=true)
unsigned GetCount() const
Function GetCount.
Definition: pcb_netlist.h:256
const char * c_str() const
Definition: utf8.h:107
const LIB_ID & GetFPID() const
Definition: pcb_netlist.h:166
void UpdateWidth(int aLine=-1)
const wxString & GetReference() const
Definition: pcb_netlist.h:151
UTF8 Format() const
Definition: lib_id.cpp:237
Class COMPONENT is used to store components and all of their related information found in a netlist.
Definition: pcb_netlist.h:83
COMPONENT * GetComponent(unsigned aIndex)
Function GetComponent returns the COMPONENT at aIndex.
Definition: pcb_netlist.h:265
#define CMP_FORMAT
Definition: cvpcb.h:30
wxArrayString m_ComponentList
Definition: listboxes.h:200
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:100
size_t i
Definition: json11.cpp:597
const wxString & GetValue() const
Definition: pcb_netlist.h:153

References UTF8::c_str(), CMP_FORMAT, LIB_ID::Format(), FROM_UTF8(), GetChars(), NETLIST::GetComponent(), COMPONENTS_LISTBOX::GetCount(), NETLIST::GetCount(), COMPONENT::GetFPID(), COMPONENT::GetReference(), COMPONENT::GetValue(), i, ID_CVPCB_COMPONENT_LIST, m_compListBox, COMPONENTS_LISTBOX::m_ComponentList, m_netlist, COMPONENTS_LISTBOX::SetSelection(), and ITEMS_LISTBOX_BASE::UpdateWidth().

Referenced by CVPCB_MAINFRAME().

◆ buildEquivalenceList()

int CVPCB_MAINFRAME::buildEquivalenceList ( FOOTPRINT_EQUIVALENCE_LIST aList,
wxString *  aErrorMessages = NULL 
)
private

read the .equ files and populate the list of equvalents

Parameters
aListthe list to populate
aErrorMessagesis a pointer to a wxString to store error messages (can be NULL)
Returns
the error count ( 0 = no error)

Definition at line 83 of file auto_associate.cpp.

84 {
85  char line[1024];
86  int error_count = 0;
87  FILE* file;
88  wxFileName fn;
89  wxString tmp, error_msg;
90 
91  SEARCH_STACK& search = Kiface().KifaceSearch();
92 
93  // Find equivalences in all available files, and populates the
94  // equiv_List with all equivalences found in .equ files
95  for( unsigned ii = 0; ii < m_EquFilesNames.GetCount(); ii++ )
96  {
97  fn = wxExpandEnvVars( m_EquFilesNames[ii] );
98 
99  tmp = search.FindValidPath( fn.GetFullPath() );
100 
101  if( !tmp )
102  {
103  error_count++;
104 
105  if( aErrorMessages )
106  {
107  error_msg.Printf( _( "Equivalence file \"%s\" could not be found in the "
108  "default search paths." ),
109  GetChars( fn.GetFullName() ) );
110 
111  if( ! aErrorMessages->IsEmpty() )
112  *aErrorMessages << wxT("\n\n");
113 
114  *aErrorMessages += error_msg;
115  }
116 
117  continue;
118  }
119 
120  file = wxFopen( tmp, wxT( "rt" ) );
121 
122  if( file == NULL )
123  {
124  error_count++;
125 
126  if( aErrorMessages )
127  {
128  error_msg.Printf( _( "Error opening equivalence file \"%s\"." ), GetChars( tmp ) );
129 
130  if( ! aErrorMessages->IsEmpty() )
131  *aErrorMessages << wxT("\n\n");
132 
133  *aErrorMessages += error_msg;
134  }
135 
136  continue;
137  }
138 
139  while( GetLine( file, line, NULL, sizeof( line ) ) != NULL )
140  {
141  if( *line == 0 )
142  continue;
143 
144  wxString wtext = FROM_UTF8( line );
145  wxString value = GetQuotedText( wtext );
146 
147  if( value.IsEmpty() )
148  continue;
149 
150  wxString footprint = GetQuotedText( wtext );
151 
152  if( footprint.IsEmpty() )
153  continue;
154 
155  value.Replace( wxT( " " ), wxT( "_" ) );
156 
157  FOOTPRINT_EQUIVALENCE* equivItem = new FOOTPRINT_EQUIVALENCE();
158  equivItem->m_ComponentValue = value;
159  equivItem->m_FootprintFPID = footprint;
160  aList.push_back( equivItem );
161  }
162 
163  fclose( file );
164  }
165 
166  return error_count;
167 }
wxString FindValidPath(const wxString &aFileName) const
Definition: search_stack.h:73
static wxString FROM_UTF8(const char *cstring)
function FROM_UTF8 converts a UTF8 encoded C string to a wxString for all wxWidgets build modes.
Definition: macros.h:61
wxString GetQuotedText(wxString &text)
wxArrayString m_EquFilesNames
Class SEARCH_STACK looks for files in a number of places.
Definition: search_stack.h:41
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
char * GetLine(FILE *File, char *Line, int *LineNum, int SizeLine)
Read one line line from aFile.
Definition: string.cpp:317
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:100

References SEARCH_STACK::FindValidPath(), FROM_UTF8(), GetChars(), GetLine(), GetQuotedText(), Kiface(), KIFACE_I::KifaceSearch(), FOOTPRINT_EQUIVALENCE::m_ComponentValue, m_EquFilesNames, and FOOTPRINT_EQUIVALENCE::m_FootprintFPID.

Referenced by AutomaticFootprintMatching().

◆ BuildFOOTPRINTS_LISTBOX()

void CVPCB_MAINFRAME::BuildFOOTPRINTS_LISTBOX ( )

Definition at line 827 of file cvpcb_mainframe.cpp.

828 {
829  wxFont guiFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
830 
831  if( m_footprintListBox == NULL )
832  {
834  wxDefaultPosition, wxDefaultSize );
835  m_footprintListBox->SetFont( wxFont( guiFont.GetPointSize(),
836  wxFONTFAMILY_MODERN,
837  wxFONTSTYLE_NORMAL,
838  wxFONTWEIGHT_NORMAL ) );
839  }
840 
841  m_footprintListBox->SetFootprints( *m_FootprintsList, wxEmptyString, NULL,
843  DisplayStatus();
844 }
FOOTPRINT_LIST * m_FootprintsList
FOOTPRINTS_LISTBOX * m_footprintListBox
void SetFootprints(FOOTPRINT_LIST &aList, const wxString &aLibName, COMPONENT *aComponent, const wxString &aFootPrintFilterPattern, int aFilterType)
Function SetFootprints populates the wxListCtrl with the footprints from aList that meet the filter c...
void DisplayStatus()
Function DisplayStatus updates the information displayed on the status bar at bottom of the main fram...

References DisplayStatus(), ID_CVPCB_FOOTPRINT_LIST, m_footprintListBox, m_FootprintsList, FOOTPRINTS_LISTBOX::SetFootprints(), and FOOTPRINTS_LISTBOX::UNFILTERED_FP_LIST.

Referenced by CVPCB_MAINFRAME(), and ReadNetListAndFpFiles().

◆ BuildLIBRARY_LISTBOX()

void CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX ( )

Definition at line 886 of file cvpcb_mainframe.cpp.

887 {
888  wxFont guiFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
889 
890  if( m_libListBox == NULL )
891  {
893  wxDefaultPosition, wxDefaultSize );
894  m_libListBox->SetFont( wxFont( guiFont.GetPointSize(),
895  wxFONTFAMILY_MODERN,
896  wxFONTSTYLE_NORMAL,
897  wxFONTWEIGHT_NORMAL ) );
898  }
899 
900  FP_LIB_TABLE* tbl = Prj().PcbFootprintLibs( Kiway() );
901 
902  if( tbl )
903  {
904  wxArrayString libNames;
905 
906  std::vector< wxString > libNickNames = tbl->GetLogicalLibs();
907 
908  for( unsigned ii = 0; ii < libNickNames.size(); ii++ )
909  libNames.Add( libNickNames[ii] );
910 
911  m_libListBox->SetLibraryList( libNames );
912  }
913 }
void SetLibraryList(const wxArrayString &aList)
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_player.h:61
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
LIBRARY_LISTBOX * m_libListBox
VTBL_ENTRY FP_LIB_TABLE * PcbFootprintLibs(KIWAY &aKiway)
Return the table of footprint libraries.
std::vector< wxString > GetLogicalLibs()
Return the logical library names, all of them that are pertinent to a look up done on this LIB_TABLE.

References LIB_TABLE::GetLogicalLibs(), ID_CVPCB_LIBRARY_LIST, KIWAY_HOLDER::Kiway(), m_libListBox, PROJECT::PcbFootprintLibs(), KIWAY_HOLDER::Prj(), and LIBRARY_LISTBOX::SetLibraryList().

Referenced by CVPCB_MAINFRAME(), OnEditFootprintLibraryTable(), and ReadNetListAndFpFiles().

◆ ChangeFocus()

void CVPCB_MAINFRAME::ChangeFocus ( bool  aMoveRight)

Definition at line 285 of file cvpcb_mainframe.cpp.

286 {
287  wxWindow* hasFocus = wxWindow::FindFocus();
288 
289  if( aMoveRight )
290  {
291  if( hasFocus == m_libListBox )
292  m_compListBox->SetFocus();
293  else if( hasFocus == m_compListBox )
294  m_footprintListBox->SetFocus();
295  else if( hasFocus == m_footprintListBox )
296  m_libListBox->SetFocus();
297  }
298  else
299  {
300  if( hasFocus == m_libListBox )
301  m_footprintListBox->SetFocus();
302  else if( hasFocus == m_compListBox )
303  m_libListBox->SetFocus();
304  else if( hasFocus == m_footprintListBox )
305  m_compListBox->SetFocus();
306  }
307 }
COMPONENTS_LISTBOX * m_compListBox
LIBRARY_LISTBOX * m_libListBox
FOOTPRINTS_LISTBOX * m_footprintListBox

References m_compListBox, m_footprintListBox, and m_libListBox.

Referenced by FOOTPRINTS_LISTBOX::OnChar(), and COMPONENTS_LISTBOX::OnChar().

◆ CheckForAutoSaveFile()

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

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

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

Parameters
aFileNameA wxFileName object containing the file name to check.

Definition at line 584 of file eda_base_frame.cpp.

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

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

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

◆ CommonSettingsChanged()

void EDA_BASE_FRAME::CommonSettingsChanged ( )
virtualinherited

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

Update menus, toolbars, local variables, etc.

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

Definition at line 243 of file eda_base_frame.cpp.

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

References EDA_BASE_FRAME::ReCreateMenuBar().

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

◆ config()

wxConfigBase * EDA_BASE_FRAME::config ( )
protectedvirtualinherited

Return the wxConfigBase used in SaveSettings().

This is overloaded in KICAD_MANAGER_FRAME

Reimplemented in KICAD_MANAGER_FRAME.

Definition at line 359 of file eda_base_frame.cpp.

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

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

Referenced by CVPCB_MAINFRAME(), FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME(), GERBVIEW_FRAME::GERBVIEW_FRAME(), PCB_EDIT_FRAME::GetSettings(), SIM_PLOT_FRAME::onClose(), FOOTPRINT_WIZARD_FRAME::OnCloseWindow(), LIB_EDIT_FRAME::OnPreferencesOptions(), SCH_EDIT_FRAME::OnPreferencesOptions(), SCH_EDIT_FRAME::OpenProjectFiles(), PL_EDITOR_FRAME::PL_EDITOR_FRAME(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), and EDA_BASE_FRAME::windowClosing().

◆ ConfigBaseName()

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

Definition at line 266 of file eda_base_frame.h.

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

References EDA_BASE_FRAME::m_configFrameName.

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

◆ CreateScreenCmp()

void CVPCB_MAINFRAME::CreateScreenCmp ( )

Create or Update the frame showing the current highlighted footprint and (if showed) the 3D display frame.

Definition at line 794 of file cvpcb_mainframe.cpp.

795 {
797 
798  if( !fpframe )
799  {
800  fpframe = (DISPLAY_FOOTPRINTS_FRAME*) Kiway().Player( FRAME_CVPCB_DISPLAY, true, this );
801  fpframe->Show( true );
802  }
803  else
804  {
805  if( fpframe->IsIconized() )
806  fpframe->Iconize( false );
807 
808  // The display footprint window might be buried under some other
809  // windows, so CreateScreenCmp() on an existing window would not
810  // show any difference, leaving the user confused.
811  // So we want to put it to front, second after our CVPCB_MAINFRAME.
812  // We do this by a little dance of bringing it to front then the main
813  // frame back.
814  wxWindow* focus = FindFocus();
815 
816  fpframe->Raise(); // Make sure that is visible.
817  Raise(); // .. but still we want the focus.
818 
819  if( focus )
820  focus->SetFocus();
821  }
822 
823  fpframe->InitDisplay();
824 }
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_player.h:61
Class DISPLAY_FOOTPRINTS_FRAME is used to display footprints.
VTBL_ENTRY KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=NULL)
Function Player returns the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:321
void InitDisplay()
Function InitDisplay Refresh the full display for this frame: Set the title, the status line and redr...
DISPLAY_FOOTPRINTS_FRAME * GetFootprintViewerFrame()

References FRAME_CVPCB_DISPLAY, GetFootprintViewerFrame(), DISPLAY_FOOTPRINTS_FRAME::InitDisplay(), KIWAY_HOLDER::Kiway(), and KIWAY::Player().

Referenced by DisplayModule(), and refreshAfterComponentSearch().

◆ DelAssociations()

void CVPCB_MAINFRAME::DelAssociations ( wxCommandEvent &  event)

Function DelAssociations removes all component footprint associations already made.

Definition at line 403 of file cvpcb_mainframe.cpp.

404 {
405  if( IsOK( this, _( "Delete selections" ) ) )
406  {
407  m_skipComponentSelect = true;
408 
409  // Remove all selections to avoid issues when setting the fpids
411 
412  for( unsigned i = 0; i < m_netlist.GetCount(); i++ )
413  {
414  LIB_ID fpid;
415 
416  m_netlist.GetComponent( i )->SetFPID( fpid );
417  SetNewPkg( wxEmptyString );
418  }
419 
420  // Remove all selections after setting the fpids
422 
423  m_skipComponentSelect = false;
425  }
426 
427  DisplayStatus();
428 }
void SetFPID(const LIB_ID &aFPID)
Definition: pcb_netlist.h:155
COMPONENTS_LISTBOX * m_compListBox
void DeselectAll()
Removes all selection in lists which can have more than one item selected.
void SetSelection(int index, bool State=true)
void SetNewPkg(const wxString &aFootprintName)
Function SetNewPkg set the footprint name for all selected components in component list and selects t...
unsigned GetCount() const
Function GetCount.
Definition: pcb_netlist.h:256
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
COMPONENT * GetComponent(unsigned aIndex)
Function GetComponent returns the COMPONENT at aIndex.
Definition: pcb_netlist.h:265
size_t i
Definition: json11.cpp:597
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Function IsOK displays a yes/no dialog with aMessage and returns the user response.
Definition: confirm.cpp:294
void DisplayStatus()
Function DisplayStatus updates the information displayed on the status bar at bottom of the main fram...

References ITEMS_LISTBOX_BASE::DeselectAll(), DisplayStatus(), NETLIST::GetComponent(), NETLIST::GetCount(), i, IsOK(), m_compListBox, m_netlist, m_skipComponentSelect, COMPONENT::SetFPID(), SetNewPkg(), and COMPONENTS_LISTBOX::SetSelection().

◆ Destroy()

◆ DismissModal()

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

Definition at line 162 of file kiway_player.cpp.

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

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

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

◆ DisplayModule()

void CVPCB_MAINFRAME::DisplayModule ( wxCommandEvent &  event)

Definition at line 448 of file cvpcb_mainframe.cpp.

449 {
450  CreateScreenCmp();
451  GetFootprintViewerFrame()->RedrawScreen( wxPoint( 0, 0 ), false );
452 }
void CreateScreenCmp()
Create or Update the frame showing the current highlighted footprint and (if showed) the 3D display f...
virtual void RedrawScreen(const wxPoint &aCenterPoint, bool aWarpPointer)
Redraw the entire screen area by updating the scroll bars and mouse pointer in order to have aCenterP...
DISPLAY_FOOTPRINTS_FRAME * GetFootprintViewerFrame()

References CreateScreenCmp(), GetFootprintViewerFrame(), and EDA_DRAW_FRAME::RedrawScreen().

◆ DisplayStatus()

void CVPCB_MAINFRAME::DisplayStatus ( )

Function DisplayStatus updates the information displayed on the status bar at bottom of the main frame.

When the library or component list controls have the focus, the footprint assignment status of the components is displayed in the first status bar pane and the list of filters for the selected component is displayed in the second status bar pane. When the footprint list control has the focus, the description of the selected footprint is displayed in the first status bar pane and the key words for the selected footprint are displayed in the second status bar pane. The third status bar pane always displays the current footprint list filtering.

Definition at line 616 of file cvpcb_mainframe.cpp.

617 {
618  if( !m_initialized )
619  return;
620 
621  wxString filters, msg;
622  COMPONENT* component = GetSelectedComponent();
623 
625  {
626  msg.Empty();
627 
628  if( component )
629  {
630  for( unsigned ii = 0; ii < component->GetFootprintFilters().GetCount(); ii++ )
631  {
632  if( msg.IsEmpty() )
633  msg += component->GetFootprintFilters()[ii];
634  else
635  msg += wxT( ", " ) + component->GetFootprintFilters()[ii];
636  }
637  }
638 
639  filters += _( "key words" ) + wxString::Format( wxT( " (%s)" ), msg );
640  }
641 
643  {
644  msg.Empty();
645 
646  if( component )
647  msg = wxString::Format( wxT( "%i" ), component->GetPinCount() );
648 
649  if( !filters.IsEmpty() )
650  filters += wxT( ", " );
651 
652  filters += _( "pin count" ) + wxString::Format( wxT( " (%s)" ), msg );
653  }
654 
656  {
658 
659  if( !filters.IsEmpty() )
660  filters += wxT( ", " );
661 
662  filters += _( "library" ) + wxString::Format( wxT( " (%s)" ), msg );
663  }
664 
666  {
667  if( !filters.IsEmpty() )
668  filters += wxT( ", " );
669 
670  filters += _( "search text" );
671  }
672 
673  if( filters.IsEmpty() )
674  msg = _( "No filtering" );
675  else
676  msg.Printf( _( "Filtered by %s" ), GetChars( filters ) );
677 
678  msg << wxT( ": " ) << m_footprintListBox->GetCount();
679 
680  SetStatusText( msg );
681 
682 
683  msg.Empty();
684  wxString footprintName = GetSelectedFootprint();
685 
686  FOOTPRINT_INFO* module = m_FootprintsList->GetModuleInfo( footprintName );
687 
688  if( module ) // can be NULL if no netlist loaded
689  {
690  msg = wxString::Format( _( "Description: %s; Key words: %s" ),
691  module->GetDescription(),
692  module->GetKeywords() );
693  }
694 
695  SetStatusText( msg, 1 );
696 }
FOOTPRINT_LIST * m_FootprintsList
FOOTPRINT_INFO * GetModuleInfo(const wxString &aFootprintId)
Get info for a module by id.
const wxString & GetDescription() override
wxString GetSelectedLibrary()
void SetStatusText(const wxString &aText, int aNumber=0) override
const wxString & GetKeywords()
LIBRARY_LISTBOX * m_libListBox
Class COMPONENT is used to store components and all of their related information found in a netlist.
Definition: pcb_netlist.h:83
wxString GetSelectedFootprint()
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:100
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
COMPONENT * GetSelectedComponent()
FOOTPRINTS_LISTBOX * m_footprintListBox
int GetPinCount() const
Definition: pcb_netlist.h:184
const wxArrayString & GetFootprintFilters() const
Definition: pcb_netlist.h:177

References FOOTPRINTS_LISTBOX::FILTERING_BY_COMPONENT_KEYWORD, FOOTPRINTS_LISTBOX::FILTERING_BY_LIBRARY, FOOTPRINTS_LISTBOX::FILTERING_BY_NAME, FOOTPRINTS_LISTBOX::FILTERING_BY_PIN_COUNT, Format(), GetChars(), FOOTPRINTS_LISTBOX::GetCount(), FOOTPRINT_INFO::GetDescription(), COMPONENT::GetFootprintFilters(), FOOTPRINT_INFO::GetKeywords(), FOOTPRINT_LIST::GetModuleInfo(), COMPONENT::GetPinCount(), GetSelectedComponent(), GetSelectedFootprint(), LIBRARY_LISTBOX::GetSelectedLibrary(), m_filteringOptions, m_footprintListBox, m_FootprintsList, m_initialized, m_libListBox, and SetStatusText().

Referenced by BuildFOOTPRINTS_LISTBOX(), DelAssociations(), ReadNetListAndFpFiles(), refreshAfterComponentSearch(), SetNewPkg(), and ShowChangedLanguage().

◆ doAutoSave()

bool EDA_BASE_FRAME::doAutoSave ( )
protectedvirtualinherited

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

Returns
true if the auto save was successful otherwise false.

Reimplemented in PCB_EDIT_FRAME, and SCH_EDIT_FRAME.

Definition at line 222 of file eda_base_frame.cpp.

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

Referenced by EDA_BASE_FRAME::onAutoSaveTimer().

◆ ExportHotkeyConfigToFile()

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

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

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

Definition at line 738 of file hotkeys_basic.cpp.

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

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

Referenced by PANEL_HOTKEYS_EDITOR::installButtons().

◆ GetAboutTitle()

const wxString& EDA_BASE_FRAME::GetAboutTitle ( ) const
inlineinherited

Definition at line 405 of file eda_base_frame.h.

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

References EDA_BASE_FRAME::m_AboutTitle.

Referenced by DIALOG_ABOUT::DIALOG_ABOUT().

◆ GetAutoSaveFilePrefix()

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

Definition at line 161 of file eda_base_frame.h.

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

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

◆ GetAutoSaveInterval()

int EDA_BASE_FRAME::GetAutoSaveInterval ( ) const
inlineinherited

Definition at line 218 of file eda_base_frame.h.

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

References EDA_BASE_FRAME::m_autoSaveInterval.

◆ GetBackupSuffix()

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

Definition at line 153 of file eda_base_frame.h.

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

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

◆ GetFileFromHistory()

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

Fetches the file name from the file history list.

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

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

Definition at line 398 of file eda_base_frame.cpp.

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

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

Referenced by GERBVIEW_FRAME::OnDrlFileHistory(), KICAD_MANAGER_FRAME::OnFileHistory(), PL_EDITOR_FRAME::OnFileHistory(), PCB_EDIT_FRAME::OnFileHistory(), GERBVIEW_FRAME::OnGbrFileHistory(), GERBVIEW_FRAME::OnJobFileHistory(), SCH_EDIT_FRAME::OnLoadFile(), and GERBVIEW_FRAME::OnZipFileHistory().

◆ GetFootprintViewerFrame()

DISPLAY_FOOTPRINTS_FRAME * CVPCB_MAINFRAME::GetFootprintViewerFrame ( )
Returns
a pointer on the Footprint Viewer frame, if exists, or NULL

Definition at line 927 of file cvpcb_mainframe.cpp.

928 {
929  // returns the Footprint Viewer frame, if exists, or NULL
930  return dynamic_cast<DISPLAY_FOOTPRINTS_FRAME*>
931  ( wxWindow::FindWindowByName( FOOTPRINTVIEWER_FRAME_NAME ) );
932 }
#define FOOTPRINTVIEWER_FRAME_NAME

References FOOTPRINTVIEWER_FRAME_NAME.

Referenced by CreateScreenCmp(), DisplayModule(), OnCloseWindow(), and refreshAfterComponentSearch().

◆ GetKicadAbout()

void EDA_BASE_FRAME::GetKicadAbout ( wxCommandEvent &  event)
inherited

Definition at line 505 of file eda_base_frame.cpp.

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

References ShowAboutDialog().

◆ GetKicadContribute()

void EDA_BASE_FRAME::GetKicadContribute ( wxCommandEvent &  event)
inherited

Definition at line 492 of file eda_base_frame.cpp.

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

References URL_GET_INVOLVED.

◆ GetKicadHelp()

void EDA_BASE_FRAME::GetKicadHelp ( wxCommandEvent &  event)
inherited

Definition at line 431 of file eda_base_frame.cpp.

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

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

◆ GetMruPath()

wxString EDA_BASE_FRAME::GetMruPath ( ) const
inlineinherited

◆ GetProjectFileParameters()

PARAM_CFG_ARRAY & CVPCB_MAINFRAME::GetProjectFileParameters ( void  )

Function GetProjectFileParameters return project file parameter list for CvPcb.

Populate the project file parameter array specific to CvPcb if it hasn't already been populated and return a reference to the array to the caller. Creating the parameter list at run time has the advantage of being able to define local variables. The old method of statically building the array at compile time requiring global variable definitions.

Returns
A reference to a PARAM_CFG_ARRAY contain the project settings for CvPcb.

Definition at line 45 of file cfg.cpp.

46 {
47  if( !m_projectFileParams.empty() )
48  return m_projectFileParams;
49 
51 
53  wxT( "EquName" ), &m_EquFilesNames, GROUP_CVP_EQU ) );
54 
55  return m_projectFileParams;
56 }
wxArrayString m_EquFilesNames
Class PARAM_CFG_BASE is a base class which establishes the interface functions ReadParam and SavePara...
Definition: config_params.h:99
PARAM_CFG_ARRAY m_projectFileParams
#define GROUP_CVP_EQU
Definition: config_params.h:53
#define GROUP_PCB_LIBS
(and few for component editor).
Definition: config_params.h:48

References GROUP_CVP_EQU, GROUP_PCB_LIBS, m_EquFilesNames, m_projectFileParams, and PARAM_COMMAND_ERASE.

Referenced by LoadProjectFile(), and SaveProjectFile().

◆ GetSelectedComponent()

COMPONENT * CVPCB_MAINFRAME::GetSelectedComponent ( )

Definition at line 916 of file cvpcb_mainframe.cpp.

917 {
918  int selection = m_compListBox->GetSelection();
919 
920  if( selection >= 0 && selection < (int) m_netlist.GetCount() )
921  return m_netlist.GetComponent( selection );
922 
923  return NULL;
924 }
COMPONENTS_LISTBOX * m_compListBox
unsigned GetCount() const
Function GetCount.
Definition: pcb_netlist.h:256
COMPONENT * GetComponent(unsigned aIndex)
Function GetComponent returns the COMPONENT at aIndex.
Definition: pcb_netlist.h:265

References NETLIST::GetComponent(), NETLIST::GetCount(), ITEMS_LISTBOX_BASE::GetSelection(), m_compListBox, and m_netlist.

Referenced by DisplayStatus(), DISPLAY_FOOTPRINTS_FRAME::InitDisplay(), and OnSelectComponent().

◆ GetSelectedFootprint()

wxString CVPCB_MAINFRAME::GetSelectedFootprint ( )
Returns
the LIB_ID of the selected footprint in footprint listview or a empty string if no selection

Definition at line 935 of file cvpcb_mainframe.cpp.

936 {
937  // returns the LIB_ID of the selected footprint in footprint listview
938  // or a empty string
940 }
FOOTPRINTS_LISTBOX * m_footprintListBox

References FOOTPRINTS_LISTBOX::GetSelectedFootprint(), and m_footprintListBox.

Referenced by DisplayStatus(), and DISPLAY_FOOTPRINTS_FRAME::InitDisplay().

◆ GetToolManager()

TOOL_MANAGER * KIWAY_HOLDER::GetToolManager ( ) const
inherited

Function GetToolManager Return the tool manager instance, if any.

Definition at line 46 of file kiway_holder.cpp.

47 {
48  return nullptr;
49 }

Referenced by DIALOG_SHIM::DIALOG_SHIM().

◆ GetUserUnits()

EDA_UNITS_T KIWAY_HOLDER::GetUserUnits ( ) const
inherited

Function GetUserUnits Allows participation in KEYWAY_PLAYER/DIALOG_SHIM userUnits inheritance.

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

Definition at line 40 of file kiway_holder.cpp.

41 {
42  return MILLIMETRES;
43 }

References MILLIMETRES.

Referenced by DIALOG_SHIM::DIALOG_SHIM().

◆ help_name()

wxString EDA_BASE_FRAME::help_name ( )
protectedvirtualinherited

Reimplemented in KICAD_MANAGER_FRAME.

Definition at line 374 of file eda_base_frame.cpp.

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

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

Referenced by EDA_BASE_FRAME::GetKicadHelp().

◆ ImportHotkeyConfigFromFile()

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

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

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

Definition at line 709 of file hotkeys_basic.cpp.

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

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

Referenced by PANEL_HOTKEYS_EDITOR::installButtons().

◆ InstallPreferences()

virtual void EDA_BASE_FRAME::InstallPreferences ( PAGED_DIALOG aParent)
inlinevirtualinherited

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

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

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

Definition at line 238 of file eda_base_frame.h.

238 { }

Referenced by EDA_BASE_FRAME::ShowPreferences().

◆ isAutoSaveRequired()

virtual bool EDA_BASE_FRAME::isAutoSaveRequired ( ) const
inlineprotectedvirtualinherited

Return the auto save status of the application.

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

Reimplemented in PCB_EDIT_FRAME, and SCH_EDIT_FRAME.

Definition at line 176 of file eda_base_frame.h.

176 { return false; }

Referenced by EDA_BASE_FRAME::ProcessEvent().

◆ IsDismissed()

bool KIWAY_PLAYER::IsDismissed ( )
protectedinherited

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

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

Definition at line 156 of file kiway_player.cpp.

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

References KIWAY_PLAYER::m_modal_loop.

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

◆ IsModal()

◆ IsType()

◆ IsWritable()

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

Checks if aFileName can be written.

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

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

Definition at line 540 of file eda_base_frame.cpp.

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

References GetChars().

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

◆ Kiway()

KIWAY& KIWAY_HOLDER::Kiway ( ) const
inlineinherited

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

A KIWAY_HOLDER is not necessarily a KIWAY_PLAYER.

Definition at line 61 of file kiway_player.h.

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

References KIWAY_HOLDER::m_kiway.

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

◆ kiway_express()

void KIWAY_PLAYER::kiway_express ( KIWAY_EXPRESS aEvent)
protectedinherited

event handler, routes to derivative specific virtual KiwayMailIn()

Definition at line 177 of file kiway_player.cpp.

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

References KIWAY_PLAYER::KiwayMailIn().

◆ KiwayMailIn()

void CVPCB_MAINFRAME::KiwayMailIn ( KIWAY_EXPRESS aEvent)
overridevirtual

Function KiwayMailIn receives KIWAY_EXPRESS messages from other players.

Merely override it in derived classes.

Reimplemented from KIWAY_PLAYER.

Definition at line 969 of file cvpcb_mainframe.cpp.

970 {
971  const std::string& payload = mail.GetPayload();
972 
973  //DBG(printf( "%s: %s\n", __func__, payload.c_str() );)
974 
975  switch( mail.Command() )
976  {
978  ReadNetListAndFpFiles( payload );
979  /* @todo
980  Go into SCH_EDIT_FRAME::OnOpenCvpcb( wxCommandEvent& event ) and trim GNL_ALL down.
981  */
982  break;
983 
984  default:
985  ; // ignore most
986  }
987 }
bool ReadNetListAndFpFiles(const std::string &aNetlist)
Function ReadNetListAndFpFiles loads the netlist file built on the fly by Eeschema and loads footprin...
SCH->CVPCB netlist immediately after launching CVPCB.
Definition: mail_type.h:42

References KIWAY_EXPRESS::Command(), KIWAY_EXPRESS::GetPayload(), MAIL_EESCHEMA_NETLIST, and ReadNetListAndFpFiles().

◆ language_change()

void KIWAY_PLAYER::language_change ( wxCommandEvent &  event)
protectedinherited

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

Definition at line 184 of file kiway_player.cpp.

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

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

◆ LoadFootprintFiles()

bool CVPCB_MAINFRAME::LoadFootprintFiles ( )

Function LoadFootprintFiles reads the list of footprint (*.mod files) and generate the list of footprints.

for each module are stored the module name documentation string associated keywords m_ModuleLibNames is the list of library that must be read (loaded) fills m_footprints

Returns
true if libraries are found, false otherwise.

Definition at line 699 of file cvpcb_mainframe.cpp.

700 {
701  FP_LIB_TABLE* fptbl = Prj().PcbFootprintLibs( Kiway() );
702 
703  // Check if there are footprint libraries in the footprint library table.
704  if( !fptbl || !fptbl->GetLogicalLibs().size() )
705  {
706  wxMessageBox( _( "No PCB footprint libraries are listed in the current footprint "
707  "library table." ), _( "Configuration Error" ), wxOK | wxICON_ERROR );
708  return false;
709  }
710 
711  WX_PROGRESS_REPORTER progressReporter( this, _( "Loading Footprint Libraries" ), 2 );
712 
713  m_FootprintsList->ReadFootprintFiles( fptbl, nullptr, &progressReporter );
714 
716  {
718  }
719 
720  return true;
721 }
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_player.h:61
FOOTPRINT_LIST * m_FootprintsList
void DisplayErrors(wxTopLevelWindow *aCaller=NULL)
virtual bool ReadFootprintFiles(FP_LIB_TABLE *aTable, const wxString *aNickname=nullptr, PROGRESS_REPORTER *aProgressReporter=nullptr)=0
Read all the footprints provided by the combination of aTable and aNickname.
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
VTBL_ENTRY FP_LIB_TABLE * PcbFootprintLibs(KIWAY &aKiway)
Return the table of footprint libraries.
unsigned GetErrorCount() const
std::vector< wxString > GetLogicalLibs()
Return the logical library names, all of them that are pertinent to a look up done on this LIB_TABLE.

References FOOTPRINT_LIST::DisplayErrors(), FOOTPRINT_LIST::GetErrorCount(), LIB_TABLE::GetLogicalLibs(), KIWAY_HOLDER::Kiway(), m_FootprintsList, PROJECT::PcbFootprintLibs(), KIWAY_HOLDER::Prj(), and FOOTPRINT_LIST::ReadFootprintFiles().

Referenced by ReadNetListAndFpFiles().

◆ LoadProjectFile()

void CVPCB_MAINFRAME::LoadProjectFile ( )

Function LoadProjectFile reads the CvPcb configuration parameter from the project (.pro) file aFileName.

Definition at line 59 of file cfg.cpp.

60 {
61  PROJECT& prj = Prj();
62 
63  m_ModuleLibNames.Clear();
64  m_EquFilesNames.Clear();
65 
66  prj.ConfigLoad( Kiface().KifaceSearch(), GROUP_CVP, GetProjectFileParameters() );
67 }
Class PROJECT holds project specific data.
Definition: project.h:57
wxArrayString m_EquFilesNames
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
wxArrayString m_ModuleLibNames
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
#define GROUP_CVP
Definition: config_params.h:52
VTBL_ENTRY bool ConfigLoad(const SEARCH_STACK &aSearchS, const wxString &aGroupName, const PARAM_CFG_ARRAY &aParams, const wxString &aForeignConfigFileName=wxEmptyString)
Function ConfigLoad reads a subset of parameters from the "project" file.
Definition: project.cpp:358
PARAM_CFG_ARRAY & GetProjectFileParameters(void)
Function GetProjectFileParameters return project file parameter list for CvPcb.
Definition: cfg.cpp:45

References PROJECT::ConfigLoad(), GetProjectFileParameters(), GROUP_CVP, Kiface(), m_EquFilesNames, m_ModuleLibNames, and KIWAY_HOLDER::Prj().

Referenced by ReadNetListAndFpFiles().

◆ LoadSettings()

void CVPCB_MAINFRAME::LoadSettings ( wxConfigBase *  aCfg)
overridevirtual

Load common frame parameters from a configuration file.

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

Reimplemented from EDA_BASE_FRAME.

Definition at line 232 of file cvpcb_mainframe.cpp.

233 {
235 
236  wxSize const frame_default( ConvertDialogToPixels( FRAME_DEFAULT_SIZE_DU ) );
237 
238  if( m_FrameSize == wxDefaultSize )
239  m_FrameSize = frame_default;
240 
242 }
static const wxString FilterFootprintEntry
wxSize const FRAME_DEFAULT_SIZE_DU(450, 300)
virtual void LoadSettings(wxConfigBase *aCfg)
Load common frame parameters from a configuration file.

References FilterFootprintEntry, FRAME_DEFAULT_SIZE_DU(), EDA_BASE_FRAME::LoadSettings(), m_filteringOptions, EDA_BASE_FRAME::m_FrameSize, and FOOTPRINTS_LISTBOX::UNFILTERED_FP_LIST.

Referenced by CVPCB_MAINFRAME().

◆ onAutoSaveTimer()

void EDA_BASE_FRAME::onAutoSaveTimer ( wxTimerEvent &  aEvent)
protectedinherited

Handle the auto save timer event.

Definition at line 215 of file eda_base_frame.cpp.

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

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

Referenced by EDA_BASE_FRAME::EDA_BASE_FRAME().

◆ OnCancel()

void CVPCB_MAINFRAME::OnCancel ( wxCommandEvent &  aEvent)

Definition at line 388 of file cvpcb_mainframe.cpp.

389 {
390  // Throw away modifications on a Cancel
391  m_modified = false;
392 
393  Close( false );
394 }

References m_modified.

◆ OnCloseWindow()

void CVPCB_MAINFRAME::OnCloseWindow ( wxCloseEvent &  Event)

Definition at line 259 of file cvpcb_mainframe.cpp.

260 {
261  if( m_modified )
262  {
263  if( !HandleUnsavedChanges( this, _( "Symbol to Footprint links have been modified.\nSave before exit?" ),
264  [&]()->bool { return SaveFootprintAssociation( false ); } ) )
265  {
266  Event.Veto();
267  return;
268  }
269  }
270 
271  // Close module display frame
273  GetFootprintViewerFrame()->Close( true );
274 
275  m_modified = false;
276 
277  // clear highlight symbol in schematic:
278  SendMessageToEESCHEMA( true );
279 
280  // Delete window
281  Destroy();
282 }
bool HandleUnsavedChanges(wxWindow *aParent, const wxString &aMessage, const std::function< bool()> &aSaveFunction)
Function HandleUnsavedChanges displays a dialog with Save, Cancel and Discard Changes buttons.
Definition: confirm.cpp:212
void SendMessageToEESCHEMA(bool aClearHighligntOnly=false)
Function SendMessageToEESCHEMA Send a remote command to Eeschema via a socket, Commands are $PART: "r...
DISPLAY_FOOTPRINTS_FRAME * GetFootprintViewerFrame()
bool Destroy() override
Our version of Destroy() which is virtual from wxWidgets.
bool SaveFootprintAssociation(bool doSaveSchematic)
Function SaveFootprintAssociation saves the edits that the user has done by sending them back to eesc...

References KIWAY_PLAYER::Destroy(), GetFootprintViewerFrame(), HandleUnsavedChanges(), m_modified, SaveFootprintAssociation(), and SendMessageToEESCHEMA().

◆ OnComponentRightClick()

void CVPCB_MAINFRAME::OnComponentRightClick ( wxMouseEvent &  event)

Definition at line 455 of file cvpcb_mainframe.cpp.

456 {
457  wxMenu menu;
458 
459  menu.Append( ID_CVPCB_CREATE_SCREENCMP, _( "View Footprint" ), _( "Show the assigned footprint in the footprint viewer" ) );
460 
461  PopupMenu( &menu );
462 }

References ID_CVPCB_CREATE_SCREENCMP.

Referenced by CVPCB_MAINFRAME().

◆ OnConfigurePaths()

void CVPCB_MAINFRAME::OnConfigurePaths ( wxCommandEvent &  aEvent)

Definition at line 954 of file cvpcb_mainframe.cpp.

955 {
956  DIALOG_CONFIGURE_PATHS dlg( this, Prj().Get3DCacheManager()->GetResolver() );
957  dlg.ShowModal();
958 }
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.

References KIWAY_HOLDER::Prj().

◆ OnEditEquFilesList()

void CVPCB_MAINFRAME::OnEditEquFilesList ( wxCommandEvent &  aEvent)

Function OnEditEquFilesList envokes the equ files list edit dialog.

Definition at line 62 of file dialog_config_equfiles.cpp.

63 {
64  DIALOG_CONFIG_EQUFILES dlg( this );
65 
66  dlg.ShowModal();
67 }

◆ OnEditFootprintLibraryTable()

void CVPCB_MAINFRAME::OnEditFootprintLibraryTable ( wxCommandEvent &  event)

Function OnEditFootprintLibraryTable displays the footprint library table editing dialog and updates the global and local footprint tables accordingly.

Definition at line 437 of file cvpcb_mainframe.cpp.

438 {
440  kiface->CreateWindow( this, DIALOG_PCB_LIBRARY_TABLE, &Kiway() );
441 
442  wxBusyCursor dummy;
444  m_FootprintsList->ReadFootprintFiles( Prj().PcbFootprintLibs( Kiway() ) );
445 }
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_player.h:61
FOOTPRINT_LIST * m_FootprintsList
virtual bool ReadFootprintFiles(FP_LIB_TABLE *aTable, const wxString *aNickname=nullptr, PROGRESS_REPORTER *aProgressReporter=nullptr)=0
Read all the footprints provided by the combination of aTable and aNickname.
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
pcbnew DSO
Definition: kiway.h:267
VTBL_ENTRY KIFACE * KiFACE(FACE_T aFaceId, bool doLoad=true)
Function KiFACE returns the KIFACE* given a FACE_T.
Definition: kiway.cpp:169
static LIB_PART * dummy()
Used when a LIB_PART is not found in library to draw a dummy shape This component is a 400 mils squar...
Class KIFACE is used by a participant in the KIWAY alchemy.
Definition: kiway.h:151
return & kiface
Definition: pcbnew.cpp:212

References BuildLIBRARY_LISTBOX(), DIALOG_PCB_LIBRARY_TABLE, dummy(), KIWAY::FACE_PCB, kiface, KIWAY::KiFACE(), KIWAY_HOLDER::Kiway(), m_FootprintsList, KIWAY_HOLDER::Prj(), and FOOTPRINT_LIST::ReadFootprintFiles().

◆ OnEnterFilteringText()

void CVPCB_MAINFRAME::OnEnterFilteringText ( wxCommandEvent &  event)

Function OnEnterFilteringText Is called each time the text of m_tcFilterString is changed.

Definition at line 601 of file cvpcb_mainframe.cpp.

602 {
603  // Called when changing the filter string in main toolbar.
604  // If the option FOOTPRINTS_LISTBOX::FILTERING_BY_NAME is set, update the list of
605  // available footprints which match the filter
606 
608 
610  return;
611 
612  OnSelectFilteringFootprint( aEvent );
613 }
void OnSelectFilteringFootprint(wxCommandEvent &event)
Function OnSelectFilteringFootprint is the command event handler for enabling and disabling footprint...
wxString m_currentSearchPattern
wxTextCtrl * m_tcFilterString

References FOOTPRINTS_LISTBOX::FILTERING_BY_NAME, m_currentSearchPattern, m_filteringOptions, m_tcFilterString, and OnSelectFilteringFootprint().

◆ OnFilterFPbyKeyName()

void CVPCB_MAINFRAME::OnFilterFPbyKeyName ( wxUpdateUIEvent &  event)
private

◆ OnFilterFPbyKeywords()

void CVPCB_MAINFRAME::OnFilterFPbyKeywords ( wxUpdateUIEvent &  event)
private

◆ OnFilterFPbyLibrary()

void CVPCB_MAINFRAME::OnFilterFPbyLibrary ( wxUpdateUIEvent &  event)
private

◆ OnFilterFPbyPinCount()

void CVPCB_MAINFRAME::OnFilterFPbyPinCount ( wxUpdateUIEvent &  event)
private

◆ OnFootprintRightClick()

void CVPCB_MAINFRAME::OnFootprintRightClick ( wxMouseEvent &  event)

Definition at line 465 of file cvpcb_mainframe.cpp.

466 {
467  wxMenu menu;
468 
469  menu.Append( ID_CVPCB_CREATE_SCREENCMP, _( "View Footprint" ), _( "Show the current footprint in the footprint viewer" ) );
470 
471  PopupMenu( &menu );
472 }

References ID_CVPCB_CREATE_SCREENCMP.

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

◆ OnKeyDown()

void CVPCB_MAINFRAME::OnKeyDown ( wxKeyEvent &  aEvent)

◆ OnOK()

void CVPCB_MAINFRAME::OnOK ( wxCommandEvent &  aEvent)

Definition at line 370 of file cvpcb_mainframe.cpp.

371 {
372  SaveFootprintAssociation( false );
373 
374  m_modified = false;
375 
376  Close( true );
377 }
bool SaveFootprintAssociation(bool doSaveSchematic)
Function SaveFootprintAssociation saves the edits that the user has done by sending them back to eesc...

References m_modified, and SaveFootprintAssociation().

◆ OnQuit()

void CVPCB_MAINFRAME::OnQuit ( wxCommandEvent &  event)

Definition at line 397 of file cvpcb_mainframe.cpp.

398 {
399  Close( false );
400 }

◆ OnSaveAndContinue()

void CVPCB_MAINFRAME::OnSaveAndContinue ( wxCommandEvent &  aEvent)

Definition at line 380 of file cvpcb_mainframe.cpp.

381 {
382  SaveFootprintAssociation( true );
383 
384  m_modified = false;
385 }
bool SaveFootprintAssociation(bool doSaveSchematic)
Function SaveFootprintAssociation saves the edits that the user has done by sending them back to eesc...

References m_modified, and SaveFootprintAssociation().

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

◆ OnSelectComponent()

void CVPCB_MAINFRAME::OnSelectComponent ( wxListEvent &  event)

Function OnSelectComponent Called when clicking on a component in component list window.

  • Updates the filtered footprint list, if the filtered list option is selected
  • Updates the current selected footprint in footprint list
  • Updates the footprint shown in footprint display window (if opened)

Definition at line 475 of file cvpcb_mainframe.cpp.

476 {
478  return;
479 
480  wxString libraryName;
481  COMPONENT* component = GetSelectedComponent();
482  libraryName = m_libListBox->GetSelectedLibrary();
483 
484  m_footprintListBox->SetFootprints( *m_FootprintsList, libraryName, component,
486 
487  if( component && component->GetFPID().IsValid() )
489  else
491 
492  refreshAfterComponentSearch (component);
493 }
FOOTPRINT_LIST * m_FootprintsList
void SetSelectedFootprint(const LIB_ID &aFPID)
wxString m_currentSearchPattern
bool IsValid() const
Definition: lib_id.h:171
const LIB_ID & GetFPID() const
Definition: pcb_netlist.h:166
void refreshAfterComponentSearch(COMPONENT *component)
wxString GetSelectedLibrary()
LIBRARY_LISTBOX * m_libListBox
Class COMPONENT is used to store components and all of their related information found in a netlist.
Definition: pcb_netlist.h:83
void SetSelection(int index, bool State=true)
COMPONENT * GetSelectedComponent()
FOOTPRINTS_LISTBOX * m_footprintListBox
void SetFootprints(FOOTPRINT_LIST &aList, const wxString &aLibName, COMPONENT *aComponent, const wxString &aFootPrintFilterPattern, int aFilterType)
Function SetFootprints populates the wxListCtrl with the footprints from aList that meet the filter c...

References COMPONENT::GetFPID(), GetSelectedComponent(), LIBRARY_LISTBOX::GetSelectedLibrary(), ITEMS_LISTBOX_BASE::GetSelection(), LIB_ID::IsValid(), m_currentSearchPattern, m_filteringOptions, m_footprintListBox, m_FootprintsList, m_libListBox, m_skipComponentSelect, refreshAfterComponentSearch(), FOOTPRINTS_LISTBOX::SetFootprints(), FOOTPRINTS_LISTBOX::SetSelectedFootprint(), and FOOTPRINTS_LISTBOX::SetSelection().

Referenced by COMPONENTS_LISTBOX::OnSelectComponent(), OnSelectFilteringFootprint(), and LIBRARY_LISTBOX::OnSelectLibrary().

◆ OnSelectFilteringFootprint()

void CVPCB_MAINFRAME::OnSelectFilteringFootprint ( wxCommandEvent &  event)

Function OnSelectFilteringFootprint is the command event handler for enabling and disabling footprint filtering.

Definition at line 543 of file cvpcb_mainframe.cpp.

544 {
545  int option = 0;
546 
547  switch( event.GetId() )
548  {
551  break;
552 
555  break;
556 
559  break;
560 
564  break;
565  }
566 
567  if( event.IsChecked() )
568  m_filteringOptions |= option;
569  else
570  m_filteringOptions &= ~option;
571 
572  wxListEvent l_event;
573  OnSelectComponent( l_event );
574 }
wxString m_currentSearchPattern
wxTextCtrl * m_tcFilterString
void OnSelectComponent(wxListEvent &event)
Function OnSelectComponent Called when clicking on a component in component list window.

References FOOTPRINTS_LISTBOX::FILTERING_BY_COMPONENT_KEYWORD, FOOTPRINTS_LISTBOX::FILTERING_BY_LIBRARY, FOOTPRINTS_LISTBOX::FILTERING_BY_NAME, FOOTPRINTS_LISTBOX::FILTERING_BY_PIN_COUNT, ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST, ID_CVPCB_FOOTPRINT_DISPLAY_BY_NAME, ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST, m_currentSearchPattern, m_filteringOptions, m_tcFilterString, and OnSelectComponent().

Referenced by OnEnterFilteringText(), and LIBRARY_LISTBOX::OnSelectLibrary().

◆ OnSize()

void CVPCB_MAINFRAME::OnSize ( wxSizeEvent &  SizeEvent)

Definition at line 253 of file cvpcb_mainframe.cpp.

254 {
255  event.Skip();
256 }

◆ OpenProjectFiles()

bool CVPCB_MAINFRAME::OpenProjectFiles ( const std::vector< wxString > &  aFileSet,
int  aCtl = 0 
)
override

Definition at line 431 of file cvpcb_mainframe.cpp.

432 {
433  return true;
434 }

◆ PostCommandMenuEvent()

bool EDA_BASE_FRAME::PostCommandMenuEvent ( int  evt_type)
inherited

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

Definition at line 647 of file eda_base_frame.cpp.

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

Referenced by FOOTPRINT_EDIT_FRAME::OnHotKey(), FOOTPRINT_EDIT_FRAME::OnHotkeyDeleteItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyDuplicateItem(), PCB_EDIT_FRAME::OnHotkeyDuplicateOrArrayItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyEditItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyMoveItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyMoveItemExact(), and FOOTPRINT_EDIT_FRAME::OnHotkeyRotateItem().

◆ PrintMsg()

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

Definition at line 380 of file eda_base_frame.cpp.

381 {
382  SetStatusText( text );
383 }

◆ Prj()

PROJECT & KIWAY_HOLDER::Prj ( ) const
inherited

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

Definition at line 34 of file kiway_holder.cpp.

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

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

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

◆ ProcessEvent()

bool EDA_BASE_FRAME::ProcessEvent ( wxEvent &  aEvent)
overrideinherited

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

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

Definition at line 157 of file eda_base_frame.cpp.

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

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

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

◆ ReadNetListAndFpFiles()

bool CVPCB_MAINFRAME::ReadNetListAndFpFiles ( const std::string &  aNetlist)

Function ReadNetListAndFpFiles loads the netlist file built on the fly by Eeschema and loads footprint libraries from fp lib tables.

Parameters
aNetlistis the netlist from eeschema in kicad s-expr format. (see CVPCB_MAINFRAME::KiwayMailIn() to know how to get this netlist)

Definition at line 167 of file readwrite_dlgs.cpp.

168 {
169  wxString msg;
170  bool hasMissingNicks = false;
171 
172  ReadSchematicNetlist( aNetlist );
173 
174  if( m_compListBox == NULL )
175  return false;
176 
177  LoadProjectFile();
178 
179  wxSafeYield();
180 
182 
185 
186  m_compListBox->Clear();
187 
189  {
190  for( unsigned i = 0; i < m_netlist.GetCount(); i++ )
191  {
192  COMPONENT* component = m_netlist.GetComponent( i );
193 
194  if( component->GetFPID().empty() )
195  continue;
196 
197  if( component->GetFPID().IsLegacy() )
198  hasMissingNicks = true;
199  }
200  }
201 
202  // Check if footprint links were generated before the footprint library table was implemented.
203  if( hasMissingNicks )
204  {
205  msg = _(
206  "Some of the assigned footprints are legacy entries (are missing lib nicknames). "
207  "Would you like CvPcb to attempt to convert them to the new required LIB_ID format? "
208  "(If you answer no, then these assignments will be cleared out and you will "
209  "have to re-assign these footprints yourself.)"
210  );
211 
212  if( IsOK( this, msg ) )
213  {
214  msg.Clear();
215 
216  try
217  {
218  for( unsigned i = 0; i < m_netlist.GetCount(); i++ )
219  {
220  COMPONENT* component = m_netlist.GetComponent( i );
221 
222  if( component->GetFPID().IsLegacy() )
223  {
224  // get this first here, it's possibly obsoleted if we get it too soon.
225  FP_LIB_TABLE* tbl = Prj().PcbFootprintLibs( Kiway() );
226 
227  int guess = guessNickname( tbl, (LIB_ID*) &component->GetFPID() );
228 
229  switch( guess )
230  {
231  case 0:
232  DBG(printf("%s: guessed OK ref:%s fpid:%s\n", __func__,
233  TO_UTF8( component->GetReference() ), component->GetFPID().Format().c_str() );)
234  m_modified = true;
235  break;
236 
237  case 1:
238  msg += wxString::Format( _(
239  "Component \"%s\" footprint \"%s\" was <b>not found</b> in any library.\n" ),
240  GetChars( component->GetReference() ),
241  GetChars( component->GetFPID().GetLibItemName() )
242  );
243  break;
244 
245  case 2:
246  msg += wxString::Format( _(
247  "Component \"%s\" footprint \"%s\" was found in <b>multiple</b> libraries.\n" ),
248  GetChars( component->GetReference() ),
249  GetChars( component->GetFPID().GetLibItemName() )
250  );
251  break;
252  }
253  }
254  }
255  }
256  catch( const IO_ERROR& ioe )
257  {
258  msg = ioe.What();
259  msg += wxT( "\n\n" );
260  msg += _( "First check your footprint library table entries." );
261 
262  wxMessageBox( msg, _( "Problematic Footprint Library Tables" ) );
263  return false;
264  }
265 
266  if( msg.size() )
267  {
268  HTML_MESSAGE_BOX dlg( this, wxEmptyString );
269 
270  dlg.MessageSet( _( "The following errors occurred attempting to convert the "
271  "footprint assignments:\n\n" ) );
272  dlg.ListSet( msg );
273  dlg.MessageSet( _( "\nYou will need to reassign them manually if you want them "
274  "to be updated correctly the next time you import the "
275  "netlist in Pcbnew." ) );
276 
277 #if 1
278  dlg.ShowModal();
279 #else
280  dlg.Fit();
281  dlg.Show( true ); // modeless lets user watch while fixing the problems, but its not working.
282 #endif
283  }
284  }
285  else
286  {
287  // Clear the legacy footprint assignments.
288  for( unsigned i = 0; i < m_netlist.GetCount(); i++ )
289  {
290  COMPONENT* component = m_netlist.GetComponent( i );
291 
292  if( component->GetFPID().IsLegacy() )
293  {
294  component->SetFPID( LIB_ID() /* empty */ );
295  m_modified = true;
296  }
297  }
298  }
299  }
300 
301 
302  // Display a dialog to select footprint selection, if the netlist
303  // and the .cmp file give 2 different valid footprints
304  std::vector <int > m_indexes; // indexes of footprints in netlist
305 
306  for( unsigned ii = 0; ii < m_netlist.GetCount(); ii++ )
307  {
308  COMPONENT* component = m_netlist.GetComponent( ii );
309 
310  if( component->GetAltFPID().empty() )
311  continue;
312 
313  if( component->GetFPID().IsLegacy() || component->GetAltFPID().IsLegacy())
314  continue;
315 
316  m_indexes.push_back( ii );
317  }
318 
319  // If a n assignment conflict is found,
320  // open a dialog to chose between schematic assignment
321  // and .cmp file assignment:
322  if( m_indexes.size() > 0 )
323  {
325 
326  for( unsigned ii = 0; ii < m_indexes.size(); ii++ )
327  {
328  COMPONENT* component = m_netlist.GetComponent( m_indexes[ii] );
329 
330  wxString cmpfpid = component->GetFPID().Format();
331  wxString schfpid = component->GetAltFPID().Format();
332 
333  dlg.Add( component->GetReference(), schfpid, cmpfpid );
334  }
335 
336  if( dlg.ShowModal() == wxID_OK )
337  {
338 
339  // Update the fp selection:
340  for( unsigned ii = 0; ii < m_indexes.size(); ii++ )
341  {
342  COMPONENT* component = m_netlist.GetComponent( m_indexes[ii] );
343 
344  int choice = dlg.GetSelection( component->GetReference() );
345 
346  if( choice == 0 ) // the schematic (alt fpid) is chosen:
347  component->SetFPID( component->GetAltFPID() );
348  }
349  }
350  }
351 
352  // Populates the component list box:
353  for( unsigned i = 0; i < m_netlist.GetCount(); i++ )
354  {
355  COMPONENT* component = m_netlist.GetComponent( i );
356 
357  msg.Printf( CMP_FORMAT, m_compListBox->GetCount() + 1,
358  GetChars( component->GetReference() ),
359  GetChars( component->GetValue() ),
360  GetChars( FROM_UTF8( component->GetFPID().Format().c_str() ) ) );
361 
362  m_compListBox->AppendLine( msg );
363  }
364 
365  if( !m_netlist.IsEmpty() )
366  m_compListBox->SetSelection( 0, true );
367 
368  DisplayStatus();
369 
370  return true;
371 }
const UTF8 & GetLibItemName() const
Definition: lib_id.h:114
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_player.h:61
static wxString FROM_UTF8(const char *cstring)
function FROM_UTF8 converts a UTF8 encoded C string to a wxString for all wxWidgets build modes.
Definition: macros.h:61
void SetFPID(const LIB_ID &aFPID)
Definition: pcb_netlist.h:155
bool AnyFootprintsLinked() const
Function AnyFootprintsLinked.
COMPONENTS_LISTBOX * m_compListBox
void SetSelection(int index, bool State=true)
int ReadSchematicNetlist(const std::string &aNetlist)
Function ReadSchematicNetlist read the netlist (.net) file built on the fly by Eeschema.
unsigned GetCount() const
Function GetCount.
Definition: pcb_netlist.h:256
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
bool LoadFootprintFiles()
Function LoadFootprintFiles reads the list of footprint (*.mod files) and generate the list of footpr...
static int guessNickname(FP_LIB_TABLE *aTbl, LIB_ID *aFootprintId)
Return true if the resultant LIB_ID has a certain nickname.
bool empty() const
Definition: lib_id.h:186
void AppendLine(const wxString &text)
const char * c_str() const
Definition: utf8.h:107
const LIB_ID & GetFPID() const
Definition: pcb_netlist.h:166
#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
const LIB_ID & GetAltFPID() const
Definition: pcb_netlist.h:168
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:33
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
const wxString & GetReference() const
Definition: pcb_netlist.h:151
void BuildFOOTPRINTS_LISTBOX()
Class HTML_MESSAGE_BOX.
UTF8 Format() const
Definition: lib_id.cpp:237
Class COMPONENT is used to store components and all of their related information found in a netlist.
Definition: pcb_netlist.h:83
VTBL_ENTRY FP_LIB_TABLE * PcbFootprintLibs(KIWAY &aKiway)
Return the table of footprint libraries.
COMPONENT * GetComponent(unsigned aIndex)
Function GetComponent returns the COMPONENT at aIndex.
Definition: pcb_netlist.h:265
#define CMP_FORMAT
Definition: cvpcb.h:30
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:100
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
size_t i
Definition: json11.cpp:597
bool IsEmpty() const
Function IsEmpty()
Definition: pcb_netlist.h:244
const wxString & GetValue() const
Definition: pcb_netlist.h:153
#define DBG(x)
Definition: fctsys.h:33
bool IsLegacy() const
Definition: lib_id.h:176
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:76
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Function IsOK displays a yes/no dialog with aMessage and returns the user response.
Definition: confirm.cpp:294
void DisplayStatus()
Function DisplayStatus updates the information displayed on the status bar at bottom of the main fram...
void LoadProjectFile()
Function LoadProjectFile reads the CvPcb configuration parameter from the project (....
Definition: cfg.cpp:59

References DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR::Add(), NETLIST::AnyFootprintsLinked(), COMPONENTS_LISTBOX::AppendLine(), BuildFOOTPRINTS_LISTBOX(), BuildLIBRARY_LISTBOX(), UTF8::c_str(), COMPONENTS_LISTBOX::Clear(), CMP_FORMAT, DBG, DisplayStatus(), LIB_ID::empty(), LIB_ID::Format(), Format(), FROM_UTF8(), COMPONENT::GetAltFPID(), GetChars(), NETLIST::GetComponent(), COMPONENTS_LISTBOX::GetCount(), NETLIST::GetCount(), COMPONENT::GetFPID(), LIB_ID::GetLibItemName(), COMPONENT::GetReference(), DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR::GetSelection(), COMPONENT::GetValue(), guessNickname(), i, NETLIST::IsEmpty(), LIB_ID::IsLegacy(), IsOK(), KIWAY_HOLDER::Kiway(), HTML_MESSAGE_BOX::ListSet(), LoadFootprintFiles(), LoadProjectFile(), m_compListBox, m_modified, m_netlist, HTML_MESSAGE_BOX::MessageSet(), PROJECT::PcbFootprintLibs(), KIWAY_HOLDER::Prj(), ReadSchematicNetlist(), COMPONENT::SetFPID(), COMPONENTS_LISTBOX::SetSelection(), DIALOG_SHIM::Show(), TO_UTF8, and IO_ERROR::What().

Referenced by KiwayMailIn().

◆ ReadSchematicNetlist()

int CVPCB_MAINFRAME::ReadSchematicNetlist ( const std::string &  aNetlist)

Function ReadSchematicNetlist read the netlist (.net) file built on the fly by Eeschema.

Parameters
aNetlistis the netlist buffer filled by eeschema, in kicad s-expr format. It is the same netlist as the .net file created by Eeschema. (This method is called by ReadNetListAndFpFiles)

Definition at line 761 of file cvpcb_mainframe.cpp.

762 {
763  STRING_LINE_READER* strrdr = new STRING_LINE_READER( aNetlist, "Eeschema via Kiway" );
764  KICAD_NETLIST_READER netrdr( strrdr, &m_netlist );
765 
766  m_netlist.Clear();
767 
768  try
769  {
770  netrdr.LoadNetlist();
771  }
772  catch( const IO_ERROR& ioe )
773  {
774  wxString msg = wxString::Format( _( "Error loading schematic.\n%s" ), ioe.What().GetData() );
775  wxMessageBox( msg, _( "Load Error" ), wxOK | wxICON_ERROR );
776  return 1;
777  }
778 
779  // We also remove footprint name if it is "$noname" because this is a dummy name,
780  // not the actual name of the footprint.
781  for( unsigned ii = 0; ii < m_netlist.GetCount(); ii++ )
782  {
783  if( m_netlist.GetComponent( ii )->GetFPID().GetLibItemName() == std::string( "$noname" ) )
784  m_netlist.GetComponent( ii )->SetFPID( LIB_ID() );
785  }
786 
787  // Sort components by reference:
789 
790  return 0;
791 }
const UTF8 & GetLibItemName() const
Definition: lib_id.h:114
Class KICAD_NETLIST_READER read the new s-expression based KiCad netlist format.
void SetFPID(const LIB_ID &aFPID)
Definition: pcb_netlist.h:155
unsigned GetCount() const
Function GetCount.
Definition: pcb_netlist.h:256
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
void SortByReference()
const LIB_ID & GetFPID() const
Definition: pcb_netlist.h:166
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:33
COMPONENT * GetComponent(unsigned aIndex)
Function GetComponent returns the COMPONENT at aIndex.
Definition: pcb_netlist.h:265
void Clear()
Function Clear removes all components from the netlist.
Definition: pcb_netlist.h:250
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
Class STRING_LINE_READER is a LINE_READER that reads from a multiline 8 bit wide std::string.
Definition: richio.h:254
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:76

References NETLIST::Clear(), Format(), NETLIST::GetComponent(), NETLIST::GetCount(), COMPONENT::GetFPID(), LIB_ID::GetLibItemName(), KICAD_NETLIST_READER::LoadNetlist(), m_netlist, COMPONENT::SetFPID(), NETLIST::SortByReference(), and IO_ERROR::What().

Referenced by ReadNetListAndFpFiles().

◆ ReCreateHToolbar()

void CVPCB_MAINFRAME::ReCreateHToolbar ( void  )

Definition at line 35 of file toolbars_cvpcb.cpp.

36 {
37  if( m_mainToolBar )
38  m_mainToolBar->Clear();
39  else
40  m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
41  KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
42 
43  m_mainToolBar->AddTool( ID_CVPCB_LIB_TABLE_EDIT, wxEmptyString,
44  KiScaledBitmap( config_xpm, this ),
45  _( "Edit footprint library table" ) );
46 
48  m_mainToolBar->AddTool( ID_CVPCB_CREATE_SCREENCMP, wxEmptyString,
49  KiScaledBitmap( show_footprint_xpm, this ),
50  _( "View selected footprint" ) );
51 
53  m_mainToolBar->AddTool( ID_CVPCB_GOTO_PREVIOUSNA, wxEmptyString,
54  KiScaledBitmap( left_xpm, this ),
55  _( "Select previous unlinked symbol" ) );
56 
57  m_mainToolBar->AddTool( ID_CVPCB_GOTO_FIRSTNA, wxEmptyString,
58  KiScaledBitmap( right_xpm, this ),
59  _( "Select next unlinked symbol" ) );
60 
62  m_mainToolBar->AddTool( ID_CVPCB_AUTO_ASSOCIE, wxEmptyString,
63  KiScaledBitmap( auto_associe_xpm, this ),
64  _( "Perform automatic footprint association" ) );
65 
66  m_mainToolBar->AddTool( ID_CVPCB_DEL_ASSOCIATIONS, wxEmptyString,
67  KiScaledBitmap( delete_association_xpm, this ),
68  _( "Delete all footprint associations" ) );
69 
70  // Add tools for footprint names filtering:
72  m_mainToolBar->AddSpacer( 15 );
73  wxStaticText* text = new wxStaticText( m_mainToolBar, wxID_ANY,
74  _( "Footprint Filters:" ) );
75  text->SetFont( m_mainToolBar->GetFont().Bold() );
76  m_mainToolBar->AddControl( text );
77 
79  KiScaledBitmap( module_filtered_list_xpm, this ),
80  wxNullBitmap,
81  true, NULL,
82  _( "Filter footprint list by schematic symbol keywords" ),
83  wxEmptyString );
84 
86  KiScaledBitmap( module_pin_filtered_list_xpm, this ),
87  wxNullBitmap,
88  true, NULL,
89  _( "Filter footprint list by pin count" ),
90  wxEmptyString );
91 
93  KiScaledBitmap( module_library_list_xpm, this ),
94  wxNullBitmap, true, NULL,
95  _( "Filter footprint list by library" ),
96  wxEmptyString );
97 
100  KiScaledBitmap( module_name_filtered_list_xpm, this ),
101  wxNullBitmap, true, NULL,
102  _( "Filter footprint list using a partial name or a pattern" ),
103  wxEmptyString );
104 
106 
107  m_mainToolBar->AddControl( m_tcFilterString );
108 
109 
110  // after adding the buttons to the toolbar, must call Realize() to reflect the changes
111  m_mainToolBar->Realize();
112 }
wxBitmap KiScaledBitmap(BITMAP_DEF aBitmap, EDA_BASE_FRAME *aWindow)
Construct a wxBitmap from a memory record, scaling it if device DPI demands it.
Definition: bitmap.cpp:116
wxTextCtrl * m_tcFilterString
wxAuiToolBar * m_mainToolBar
void KiScaledSeparator(wxAuiToolBar *aToolbar, EDA_BASE_FRAME *aWindow)
Add a separator to the given toolbar scaled the same way as KiScaledBitmap.
Definition: bitmap.cpp:167
static constexpr int KICAD_AUI_TB_STYLE
Default style flags used for wxAUI toolbars

References ID_CVPCB_AUTO_ASSOCIE, ID_CVPCB_CREATE_SCREENCMP, ID_CVPCB_DEL_ASSOCIATIONS, ID_CVPCB_FILTER_TEXT_EDIT, ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST, ID_CVPCB_FOOTPRINT_DISPLAY_BY_NAME, ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST, ID_CVPCB_GOTO_FIRSTNA, ID_CVPCB_GOTO_PREVIOUSNA, ID_CVPCB_LIB_TABLE_EDIT, ID_H_TOOLBAR, EDA_BASE_FRAME::KICAD_AUI_TB_STYLE, KiScaledBitmap(), KiScaledSeparator(), m_mainToolBar, and m_tcFilterString.

Referenced by CVPCB_MAINFRAME(), and ShowChangedLanguage().

◆ ReCreateMenuBar()

void CVPCB_MAINFRAME::ReCreateMenuBar ( )
overridevirtual

(Re)Create the menubar for the CvPcb mainframe

Reimplemented from EDA_BASE_FRAME.

Definition at line 43 of file cvpcb/menubar.cpp.

44 {
45  // wxWidgets handles the Mac Application menu behind the scenes, but that means
46  // we always have to start from scratch with a new wxMenuBar.
47  wxMenuBar* oldMenuBar = GetMenuBar();
48  wxMenuBar* menuBar = new wxMenuBar();
49 
50  // Recreate all menus:
51 
52  // Menu File:
53  wxMenu* filesMenu = new wxMenu;
54 
55  // Save the footprints back into eeschema
56  AddMenuItem( filesMenu, ID_SAVE_PROJECT,
57  _( "&Save Schematic\tCtrl+S" ),
59  KiBitmap( save_xpm ) );
60 
61  // Preferences Menu :
62  wxMenu* preferencesMenu = new wxMenu;
63 
64  // Path configuration edit dialog.
65  AddMenuItem( preferencesMenu,
67  _( "&Configure Paths..." ),
68  _( "Edit path configuration environment variables" ),
69  KiBitmap( editor_xpm ) );
70 
71  AddMenuItem( preferencesMenu, ID_CVPCB_LIB_TABLE_EDIT,
72  _( "Manage &Footprint Libraries..." ), _( "Manage footprint libraries" ),
73  KiBitmap( library_table_xpm ) );
74 
75  preferencesMenu->AppendSeparator();
76  AddMenuItem( preferencesMenu, ID_CVPCB_EQUFILES_LIST_EDIT,
77  _( "Footprint &Association Files..." ),
78  _( "Configure footprint association file (.equ) list."
79  "These files are used to automatically assign "
80  "the footprint name from the symbol value" ),
81  KiBitmap( library_table_xpm ) );
82  preferencesMenu->AppendSeparator();
83 
84  // Language submenu
85  Pgm().AddMenuLanguageList( preferencesMenu );
86 
87  // Menu Help:
88  wxMenu* helpMenu = new wxMenu;
89 
90  // Manual Contents
91  AddMenuItem( helpMenu, wxID_HELP, _( "CvPcb &Manual" ),
92  _( "Open CvPcb Manual" ),
93  KiBitmap( online_help_xpm ) );
94 
95  AddMenuItem( helpMenu,
96  wxID_INDEX,
97  _( "&Getting Started in KiCad" ),
98  _( "Open \"Getting Started in KiCad\" guide for beginners" ),
99  KiBitmap( help_xpm ) );
100 
101  // About CvPcb
102  AddMenuItem( helpMenu, wxID_ABOUT, _( "&About KiCad" ), KiBitmap( about_xpm ) );
103 
104  // Create the menubar and append all submenus
105  menuBar->Append( filesMenu, _( "&File" ) );
106  menuBar->Append( preferencesMenu, _( "&Preferences" ) );
107  menuBar->Append( helpMenu, _( "&Help" ) );
108 
109  SetMenuBar( menuBar );
110  delete oldMenuBar;
111 }
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:251
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:66
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
#define SAVE_HLP_MSG
VTBL_ENTRY void AddMenuLanguageList(wxMenu *MasterMenu)
Function AddMenuLanguageList creates a menu list for language choice, and add it as submenu to Master...
Definition: pgm_base.cpp:815

References AddMenuItem(), PGM_BASE::AddMenuLanguageList(), ID_CVPCB_EQUFILES_LIST_EDIT, ID_CVPCB_LIB_TABLE_EDIT, ID_PREFERENCES_CONFIGURE_PATHS, ID_SAVE_PROJECT, KiBitmap(), Pgm(), and SAVE_HLP_MSG.

Referenced by CVPCB_MAINFRAME().

◆ refreshAfterComponentSearch()

void CVPCB_MAINFRAME::refreshAfterComponentSearch ( COMPONENT component)
private

Definition at line 496 of file cvpcb_mainframe.cpp.

497 {
498  // Tell AuiMgr that objects are changed !
499  if( m_auimgr.GetManagedWindow() ) // Be sure Aui Manager is initialized
500  // (could be not the case when starting CvPcb
501  m_auimgr.Update();
502 
503  if( component == NULL )
504  {
505  DisplayStatus();
506  return;
507  }
508 
509  // Preview of the already assigned footprint.
510  // Find the footprint that was already chosen for this component and select it,
511  // but only if the selection is made from the component list or the library list.
512  // If the selection is made from the footprint list, do not change the current
513  // selected footprint.
514  if( FindFocus() == m_compListBox || FindFocus() == m_libListBox )
515  {
516  wxString module = FROM_UTF8( component->GetFPID().Format().c_str() );
517 
519 
520  for( int ii = 0; ii < m_footprintListBox->GetCount(); ii++ )
521  {
522  wxString footprintName;
523  wxString msg = m_footprintListBox->OnGetItemText( ii, 0 );
524  msg.Trim( true );
525  msg.Trim( false );
526  footprintName = msg.AfterFirst( wxChar( ' ' ) );
527 
528  if( module.Cmp( footprintName ) == 0 )
529  {
530  m_footprintListBox->SetSelection( ii, true );
531  break;
532  }
533  }
534 
536  CreateScreenCmp();
537  }
538 
540  DisplayStatus();
541 }
static wxString FROM_UTF8(const char *cstring)
function FROM_UTF8 converts a UTF8 encoded C string to a wxString for all wxWidgets build modes.
Definition: macros.h:61
COMPONENTS_LISTBOX * m_compListBox
void SendMessageToEESCHEMA(bool aClearHighligntOnly=false)
Function SendMessageToEESCHEMA Send a remote command to Eeschema via a socket, Commands are $PART: "r...
wxAuiManager m_auimgr
void CreateScreenCmp()
Create or Update the frame showing the current highlighted footprint and (if showed) the 3D display f...
const char * c_str() const
Definition: utf8.h:107
const LIB_ID & GetFPID() const
Definition: pcb_netlist.h:166
wxString OnGetItemText(long item, long column) const override
Function OnGetItemText this overloaded function MUST be provided for the wxLC_VIRTUAL mode because re...
LIBRARY_LISTBOX * m_libListBox
UTF8 Format() const
Definition: lib_id.cpp:237
void SetSelection(int index, bool State=true)
DISPLAY_FOOTPRINTS_FRAME * GetFootprintViewerFrame()
FOOTPRINTS_LISTBOX * m_footprintListBox
void DisplayStatus()
Function DisplayStatus updates the information displayed on the status bar at bottom of the main fram...

References UTF8::c_str(), CreateScreenCmp(), DisplayStatus(), LIB_ID::Format(), FROM_UTF8(), FOOTPRINTS_LISTBOX::GetCount(), GetFootprintViewerFrame(), COMPONENT::GetFPID(), ITEMS_LISTBOX_BASE::GetSelection(), EDA_BASE_FRAME::m_auimgr, m_compListBox, m_footprintListBox, m_libListBox, FOOTPRINTS_LISTBOX::OnGetItemText(), SendMessageToEESCHEMA(), and FOOTPRINTS_LISTBOX::SetSelection().

Referenced by OnSelectComponent().

◆ SaveFootprintAssociation()

bool CVPCB_MAINFRAME::SaveFootprintAssociation ( bool  doSaveSchematic)

Function SaveFootprintAssociation saves the edits that the user has done by sending them back to eeschema via the kiway.

Optionally saves the schematic to disk as well.

Definition at line 374 of file readwrite_dlgs.cpp.

375 {
376  std::string payload;
377  STRING_FORMATTER sf;
378 
380 
381  payload = sf.GetString();
383 
384  if( doSaveSchematic )
385  {
386  payload = "";
387  Kiway().ExpressMail( FRAME_SCH, MAIL_SCH_SAVE, payload );
388 
389  if( payload == "success" )
390  SetStatusText( _( "Schematic saved" ), 1 );
391  }
392 
393  return true;
394 }
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_player.h:61
CVPCB->SCH footprint stuffing.
Definition: mail_type.h:40
CVPCB->SCH save the schematic.
Definition: mail_type.h:41
void SetStatusText(const wxString &aText, int aNumber=0) override
const std::string & GetString()
Definition: richio.h:475
void FormatBackAnnotation(OUTPUTFORMATTER *aOut)
Definition: pcb_netlist.h:355
VTBL_ENTRY void ExpressMail(FRAME_T aDestination, MAIL_T aCommand, std::string &aPayload, wxWindow *aSource=NULL)
Function ExpressMail send aPayload to aDestination from aSource.
Definition: kiway.cpp:407
Class STRING_FORMATTER implements OUTPUTFORMATTER to a memory buffer.
Definition: richio.h:445

References KIWAY::ExpressMail(), NETLIST::FormatBackAnnotation(), FRAME_SCH, STRING_FORMATTER::GetString(), KIWAY_HOLDER::Kiway(), m_netlist, MAIL_BACKANNOTATE_FOOTPRINTS, MAIL_SCH_SAVE, and SetStatusText().

Referenced by OnCloseWindow(), OnOK(), and OnSaveAndContinue().

◆ SaveProjectFile()

void CVPCB_MAINFRAME::SaveProjectFile ( )

Function SaveProjectFile Saves the CvPcb configuration parameter from the project (.pro) file aFileName.

Definition at line 70 of file cfg.cpp.

71 {
72  PROJECT& prj = Prj();
73  wxFileName fn = prj.GetProjectFullName();
74 
75  if( !IsWritable( fn ) )
76  {
77  wxMessageBox( _( "Project file \"%s\" is not writable" ), fn.GetFullPath() );
78  return;
79  }
80 
81  wxString pro_name = fn.GetFullPath();
82 
83  prj.ConfigSave( Kiface().KifaceSearch(), GROUP_CVP, GetProjectFileParameters(), pro_name );
84 }
VTBL_ENTRY void ConfigSave(const SEARCH_STACK &aSList, const wxString &aGroupName, const PARAM_CFG_ARRAY &aParams, const wxString &aFileName=wxEmptyString)
Function ConfigSave saves the current "project" parameters into the wxConfigBase* derivative.
Definition: project.cpp:323
Class PROJECT holds project specific data.
Definition: project.h:57
bool IsWritable(const wxFileName &aFileName)
Checks if aFileName can be written.
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
#define GROUP_CVP
Definition: config_params.h:52
VTBL_ENTRY const wxString GetProjectFullName() const
Function GetProjectFullName returns the full path and name of the project.
Definition: project.cpp:96
PARAM_CFG_ARRAY & GetProjectFileParameters(void)
Function GetProjectFileParameters return project file parameter list for CvPcb.
Definition: cfg.cpp:45

References PROJECT::ConfigSave(), GetProjectFileParameters(), PROJECT::GetProjectFullName(), GROUP_CVP, EDA_BASE_FRAME::IsWritable(), Kiface(), and KIWAY_HOLDER::Prj().

Referenced by DIALOG_CONFIG_EQUFILES::OnOkClick().

◆ SaveProjectSettings()

virtual void EDA_BASE_FRAME::SaveProjectSettings ( bool  aAskForSave)
inlinevirtualinherited

Save changes to the project settings to the project (.pro) file.

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

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

Reimplemented in PCB_EDIT_FRAME, and SCH_EDIT_FRAME.

Definition at line 280 of file eda_base_frame.h.

280 {};

Referenced by DIALOG_PAGES_SETTINGS::OnOkClick().

◆ SaveSettings()

void CVPCB_MAINFRAME::SaveSettings ( wxConfigBase *  aCfg)
overridevirtual

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 from EDA_BASE_FRAME.

Definition at line 245 of file cvpcb_mainframe.cpp.

246 {
248 
250 }
virtual void SaveSettings(wxConfigBase *aCfg)
Saves common frame parameters to a configuration data file.
static const wxString FilterFootprintEntry

References FilterFootprintEntry, m_filteringOptions, and EDA_BASE_FRAME::SaveSettings().

◆ SendMessageToEESCHEMA()

void CVPCB_MAINFRAME::SendMessageToEESCHEMA ( bool  aClearHighligntOnly = false)

Function SendMessageToEESCHEMA Send a remote command to Eeschema via a socket, Commands are $PART: "reference" put cursor on component anchor.

Parameters
aClearHighligntOnly= true if the message to send is only "clear highlight" (used when exiting Cvpcb)

Definition at line 724 of file cvpcb_mainframe.cpp.

725 {
726  if( m_netlist.IsEmpty() )
727  return;
728 
729  // clear highlight of previously selected components (if any):
730  // Selecting a non existing symbol clears any previously highlighted symbols
731  std::string packet = "$CLEAR: \"HIGHLIGHTED\"";
732 
733  if( Kiface().IsSingle() )
734  SendCommand( MSG_TO_SCH, packet.c_str() );
735  else
736  Kiway().ExpressMail( FRAME_SCH, MAIL_CROSS_PROBE, packet, this );
737 
738  if( aClearHighligntOnly )
739  return;
740 
741  int selection = m_compListBox->GetSelection();
742 
743  if ( selection < 0 ) // Nothing selected
744  return;
745 
746  if( m_netlist.GetComponent( selection ) == NULL )
747  return;
748 
749  // Now highlight the selected component:
750  COMPONENT* component = m_netlist.GetComponent( selection );
751 
752  packet = StrPrintf( "$PART: \"%s\"", TO_UTF8( component->GetReference() ) );
753 
754  if( Kiface().IsSingle() )
755  SendCommand( MSG_TO_SCH, packet.c_str() );
756  else
757  Kiway().ExpressMail( FRAME_SCH, MAIL_CROSS_PROBE, packet, this );
758 }
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_player.h:61
int StrPrintf(std::string *aResult, const char *aFormat,...)
Function StrPrintf is like sprintf() but the output is appended to a std::string instead of to a char...
Definition: richio.cpp:74
COMPONENTS_LISTBOX * m_compListBox
#define MSG_TO_SCH
Definition: eda_dde.h:46
bool SendCommand(int service, const char *cmdline)
Definition: eda_dde.cpp:132
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
#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 IsSingle() const
Function IsSingle is this KIFACE_I running under single_top?
Definition: kiface_i.h:115
const wxString & GetReference() const
Definition: pcb_netlist.h:151
Class COMPONENT is used to store components and all of their related information found in a netlist.
Definition: pcb_netlist.h:83
COMPONENT * GetComponent(unsigned aIndex)
Function GetComponent returns the COMPONENT at aIndex.
Definition: pcb_netlist.h:265
VTBL_ENTRY void ExpressMail(FRAME_T aDestination, MAIL_T aCommand, std::string &aPayload, wxWindow *aSource=NULL)
Function ExpressMail send aPayload to aDestination from aSource.
Definition: kiway.cpp:407
bool IsEmpty() const
Function IsEmpty()
Definition: pcb_netlist.h:244
PCB<->SCH, CVPCB->SCH cross-probing.
Definition: mail_type.h:39

References KIWAY::ExpressMail(), FRAME_SCH, NETLIST::GetComponent(), COMPONENT::GetReference(), ITEMS_LISTBOX_BASE::GetSelection(), NETLIST::IsEmpty(), KIFACE_I::IsSingle(), Kiface(), KIWAY_HOLDER::Kiway(), m_compListBox, m_netlist, MAIL_CROSS_PROBE, MSG_TO_SCH, SendCommand(), numEval::StrPrintf(), and TO_UTF8.

Referenced by OnCloseWindow(), refreshAfterComponentSearch(), ToFirstNA(), and ToPreviousNA().

◆ SetAutoSaveInterval()

void EDA_BASE_FRAME::SetAutoSaveInterval ( int  aInterval)
inherited

Definition at line 196 of file eda_base_frame.cpp.

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

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

Referenced by EDA_DRAW_FRAME::CommonSettingsChanged().

◆ SetKiway()

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

Function SetKiway.

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

Definition at line 53 of file kiway_holder.cpp.

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

References KIWAY_HOLDER::m_kiway, and name.

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

◆ SetModal()

void KIWAY_PLAYER::SetModal ( bool  aIsModal)
inlineprotectedinherited

Definition at line 234 of file kiway_player.h.

234 { m_modal = aIsModal; }

References KIWAY_PLAYER::m_modal.

Referenced by FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME().

◆ SetMruPath()

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

◆ SetNewPkg() [1/2]

void CVPCB_MAINFRAME::SetNewPkg ( const wxString &  aFootprintName)

Function SetNewPkg set the footprint name for all selected components in component list and selects the next component.

Parameters
aFootprintName= the new footprint name

Definition at line 45 of file readwrite_dlgs.cpp.

46 {
47  COMPONENT* component;
48  int componentIndex;
49 
50  if( m_netlist.IsEmpty() )
51  return;
52 
53  // If no component is selected, select the first one
54  if( m_compListBox->GetFirstSelected() < 0 )
55  {
56  componentIndex = 0;
57  m_compListBox->SetSelection( componentIndex, true );
58  }
59 
60  // iterate over the selection
61  while( m_compListBox->GetFirstSelected() != -1 )
62  {
63  // Get the component for the current iteration
64  componentIndex = m_compListBox->GetFirstSelected();
65  component = m_netlist.GetComponent( componentIndex );
66 
67  if( component == NULL )
68  return;
69 
70  SetNewPkg( aFootprintName, componentIndex );
71 
72  m_compListBox->SetSelection( componentIndex, false );
73  }
74 
75  // select the next component, if there is one
76  if( componentIndex < (m_compListBox->GetCount() - 1) )
77  componentIndex++;
78 
79  m_compListBox->SetSelection( componentIndex, true );
80 
81  // update the statusbar
82  DisplayStatus();
83 }
COMPONENTS_LISTBOX * m_compListBox
void SetSelection(int index, bool State=true)
void SetNewPkg(const wxString &aFootprintName)
Function SetNewPkg set the footprint name for all selected components in component list and selects t...
Class COMPONENT is used to store components and all of their related information found in a netlist.
Definition: pcb_netlist.h:83
COMPONENT * GetComponent(unsigned aIndex)
Function GetComponent returns the COMPONENT at aIndex.
Definition: pcb_netlist.h:265
bool IsEmpty() const
Function IsEmpty()
Definition: pcb_netlist.h:244
void DisplayStatus()
Function DisplayStatus updates the information displayed on the status bar at bottom of the main fram...

References DisplayStatus(), NETLIST::GetComponent(), COMPONENTS_LISTBOX::GetCount(), NETLIST::IsEmpty(), m_compListBox, m_netlist, and COMPONENTS_LISTBOX::SetSelection().

Referenced by AutomaticFootprintMatching(), DelAssociations(), and FOOTPRINTS_LISTBOX::OnLeftDClick().

◆ SetNewPkg() [2/2]

void CVPCB_MAINFRAME::SetNewPkg ( const wxString &  aFootprintName,
int  aIndex 
)

Function SetNewPkg Set the footprint name for the component of position aIndex in the component list.

Parameters
aFootprintName= the new footprint name
aIndex= the index of the component to modify in the component list

Definition at line 86 of file readwrite_dlgs.cpp.

87 {
88  COMPONENT* component;
89 
90  if( m_netlist.IsEmpty() )
91  return;
92 
93  component = m_netlist.GetComponent( aIndex );
94 
95  if( component == NULL )
96  return;
97 
98  LIB_ID fpid;
99 
100  if( !aFootprintName.IsEmpty() )
101  {
102  wxCHECK_RET( fpid.Parse( aFootprintName, LIB_ID::ID_PCB ) < 0,
103  wxString::Format( _( "\"%s\" is not a valid LIB_ID." ), aFootprintName ) );
104  }
105 
106  component->SetFPID( fpid );
107 
108  // create the new component description
109  wxString description = wxString::Format( CMP_FORMAT, aIndex + 1,
110  GetChars( component->GetReference() ),
111  GetChars( component->GetValue() ),
112  GetChars( FROM_UTF8( component->GetFPID().Format().c_str() ) ) );
113 
114  // Set the new description and deselect the processed component
115  m_compListBox->SetString( aIndex, description );
116 
117  // Mark this "session" as modified
118  m_modified = true;
119 
120  // update the statusbar
121  DisplayStatus();
122 }
static wxString FROM_UTF8(const char *cstring)
function FROM_UTF8 converts a UTF8 encoded C string to a wxString for all wxWidgets build modes.
Definition: macros.h:61
void SetFPID(const LIB_ID &aFPID)
Definition: pcb_netlist.h:155
COMPONENTS_LISTBOX * m_compListBox
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
const char * c_str() const
Definition: utf8.h:107
const LIB_ID & GetFPID() const
Definition: pcb_netlist.h:166
const wxString & GetReference() const
Definition: pcb_netlist.h:151
UTF8 Format() const
Definition: lib_id.cpp:237
Class COMPONENT is used to store components and all of their related information found in a netlist.
Definition: pcb_netlist.h:83
COMPONENT * GetComponent(unsigned aIndex)
Function GetComponent returns the COMPONENT at aIndex.
Definition: pcb_netlist.h:265
#define CMP_FORMAT
Definition: cvpcb.h:30
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:100
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
void SetString(unsigned linecount, const wxString &text)
bool IsEmpty() const
Function IsEmpty()
Definition: pcb_netlist.h:244
const wxString & GetValue() const
Definition: pcb_netlist.h:153
int Parse(const UTF8 &aId, LIB_ID_TYPE aType, bool aFix=false)
Parse LIB_ID with the information from aId.
Definition: lib_id.cpp:122
void DisplayStatus()
Function DisplayStatus updates the information displayed on the status bar at bottom of the main fram...

References UTF8::c_str(), CMP_FORMAT, DisplayStatus(), LIB_ID::Format(), Format(), FROM_UTF8(), GetChars(), NETLIST::GetComponent(), COMPONENT::GetFPID(), COMPONENT::GetReference(), COMPONENT::GetValue(), LIB_ID::ID_PCB, NETLIST::IsEmpty(), m_compListBox, m_modified, m_netlist, LIB_ID::Parse(), COMPONENT::SetFPID(), and COMPONENTS_LISTBOX::SetString().

◆ SetStatusText()

void CVPCB_MAINFRAME::SetStatusText ( const wxString &  aText,
int  aNumber = 0 
)
override

Definition at line 943 of file cvpcb_mainframe.cpp.

944 {
945  wxASSERT( aNumber < 2 );
946 
947  if( aNumber == 1 )
948  m_statusLine2->SetLabel( aText );
949  else
950  m_statusLine1->SetLabel( aText );
951 }
wxStaticText * m_statusLine2
wxStaticText * m_statusLine1

References m_statusLine1, and m_statusLine2.

Referenced by AutomaticFootprintMatching(), DisplayStatus(), and SaveFootprintAssociation().

◆ ShowChangedLanguage()

void CVPCB_MAINFRAME::ShowChangedLanguage ( )
overridevirtual

Redraw the menus and what not in current language.

Reimplemented from EDA_BASE_FRAME.

Definition at line 961 of file cvpcb_mainframe.cpp.

962 {
965  DisplayStatus();
966 }
virtual void ShowChangedLanguage()
Redraw the menus and what not in current language.
void DisplayStatus()
Function DisplayStatus updates the information displayed on the status bar at bottom of the main fram...

References DisplayStatus(), ReCreateHToolbar(), and EDA_BASE_FRAME::ShowChangedLanguage().

◆ ShowModal()

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

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

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

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

Definition at line 77 of file kiway_player.cpp.

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

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

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

◆ ShowPreferences()

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

Definition at line 512 of file eda_base_frame.cpp.

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

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

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

◆ sys_search()

const SEARCH_STACK & EDA_BASE_FRAME::sys_search ( )
protectedvirtualinherited

Return a SEARCH_STACK pertaining to entire program.

This is overloaded in KICAD_MANAGER_FRAME

Reimplemented in KICAD_MANAGER_FRAME.

Definition at line 368 of file eda_base_frame.cpp.

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

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

Referenced by EDA_BASE_FRAME::GetKicadHelp().

◆ ToFirstNA()

void CVPCB_MAINFRAME::ToFirstNA ( wxCommandEvent &  event)

Definition at line 310 of file cvpcb_mainframe.cpp.

311 {
312  if( m_netlist.IsEmpty() )
313  return;
314 
315  int first_selected = m_compListBox->GetFirstSelected();
316 
317  if( first_selected < 0 )
318  first_selected = -1; // We will start to 0 for the first search , if no item selected
319 
320  int candidate = -1;
321 
322  for( int jj = first_selected+1; jj < (int)m_netlist.GetCount(); jj++ )
323  {
324  if( m_netlist.GetComponent( jj )->GetFPID().empty() )
325  {
326  candidate = jj;
327  break;
328  }
329  }
330 
331  if( candidate >= 0 )
332  {
334  m_compListBox->SetSelection( candidate );
336  }
337 }
COMPONENTS_LISTBOX * m_compListBox
void SendMessageToEESCHEMA(bool aClearHighligntOnly=false)
Function SendMessageToEESCHEMA Send a remote command to Eeschema via a socket, Commands are $PART: "r...
void DeselectAll()
Removes all selection in lists which can have more than one item selected.
void SetSelection(int index, bool State=true)
unsigned GetCount() const
Function GetCount.
Definition: pcb_netlist.h:256
bool empty() const
Definition: lib_id.h:186
const LIB_ID & GetFPID() const
Definition: pcb_netlist.h:166
COMPONENT * GetComponent(unsigned aIndex)
Function GetComponent returns the COMPONENT at aIndex.
Definition: pcb_netlist.h:265
bool IsEmpty() const
Function IsEmpty()
Definition: pcb_netlist.h:244

References ITEMS_LISTBOX_BASE::DeselectAll(), LIB_ID::empty(), NETLIST::GetComponent(), NETLIST::GetCount(), COMPONENT::GetFPID(), NETLIST::IsEmpty(), m_compListBox, m_netlist, SendMessageToEESCHEMA(), and COMPONENTS_LISTBOX::SetSelection().

◆ ToPreviousNA()

void CVPCB_MAINFRAME::ToPreviousNA ( wxCommandEvent &  event)

Definition at line 340 of file cvpcb_mainframe.cpp.

341 {
342  if( m_netlist.IsEmpty() )
343  return;
344 
345  int first_selected = m_compListBox->GetFirstSelected();
346 
347  if( first_selected < 0 )
348  first_selected = m_compListBox->GetCount();
349 
350  int candidate = -1;
351 
352  for( int jj = first_selected-1; jj >= 0; jj-- )
353  {
354  if( m_netlist.GetComponent( jj )->GetFPID().empty() )
355  {
356  candidate = jj;
357  break;
358  }
359  }
360 
361  if( candidate >= 0 )
362  {
364  m_compListBox->SetSelection( candidate );
366  }
367 }
COMPONENTS_LISTBOX * m_compListBox
void SendMessageToEESCHEMA(bool aClearHighligntOnly=false)
Function SendMessageToEESCHEMA Send a remote command to Eeschema via a socket, Commands are $PART: "r...
void DeselectAll()
Removes all selection in lists which can have more than one item selected.
void SetSelection(int index, bool State=true)
bool empty() const
Definition: lib_id.h:186
const LIB_ID & GetFPID() const
Definition: pcb_netlist.h:166
COMPONENT * GetComponent(unsigned aIndex)
Function GetComponent returns the COMPONENT at aIndex.
Definition: pcb_netlist.h:265
bool IsEmpty() const
Function IsEmpty()
Definition: pcb_netlist.h:244

References ITEMS_LISTBOX_BASE::DeselectAll(), LIB_ID::empty(), NETLIST::GetComponent(), COMPONENTS_LISTBOX::GetCount(), COMPONENT::GetFPID(), NETLIST::IsEmpty(), m_compListBox, m_netlist, SendMessageToEESCHEMA(), and COMPONENTS_LISTBOX::SetSelection().

◆ UpdateFileHistory()

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

Update the list of recently opened files.

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

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

Definition at line 386 of file eda_base_frame.cpp.

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

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

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

◆ WriteHotkeyConfig()

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

Store the current hotkey list.

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

Parameters
aDescList= pointer to the current hotkey list.
aFullFileName= a wxString pointer to a full file name. if NULL, use the standard wxConfig mechanism (default) the output format is: shortcut "key" "function" lines starting with # are comments

Reimplemented in EDA_DRAW_FRAME.

Definition at line 489 of file hotkeys_basic.cpp.

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

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

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

Friends And Related Function Documentation

◆ CV::IFACE

friend struct CV::IFACE
friend

Definition at line 59 of file cvpcb_mainframe.h.

Member Data Documentation

◆ KICAD_AUI_TB_STYLE

◆ m_AboutTitle

wxString EDA_BASE_FRAME::m_AboutTitle
protectedinherited

◆ m_auimgr

◆ m_autoSaveInterval

◆ m_autoSaveState

bool EDA_BASE_FRAME::m_autoSaveState
protectedinherited

◆ m_autoSaveTimer

wxTimer* EDA_BASE_FRAME::m_autoSaveTimer
protectedinherited

◆ m_compListBox

◆ m_configFrameName

wxString EDA_BASE_FRAME::m_configFrameName
protectedinherited

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

if empty, the frame name defined in CTOR is used

Definition at line 124 of file eda_base_frame.h.

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

◆ m_currentSearchPattern

wxString CVPCB_MAINFRAME::m_currentSearchPattern
private

◆ m_EquFilesNames

wxArrayString CVPCB_MAINFRAME::m_EquFilesNames

◆ m_filteringOptions

◆ m_footprintListBox

◆ m_FootprintsList

◆ m_FramePos

◆ m_FrameSize

◆ m_hasAutoSave

bool EDA_BASE_FRAME::m_hasAutoSave
protectedinherited

Flag to indicate if this frame supports auto save.

Definition at line 132 of file eda_base_frame.h.

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

◆ m_Ident

FRAME_T EDA_BASE_FRAME::m_Ident
protectedinherited

◆ m_initialized

bool CVPCB_MAINFRAME::m_initialized
protected

Definition at line 85 of file cvpcb_mainframe.h.

Referenced by CVPCB_MAINFRAME(), and DisplayStatus().

◆ m_libListBox

LIBRARY_LISTBOX* CVPCB_MAINFRAME::m_libListBox
private

◆ m_mainToolBar

wxAuiToolBar* CVPCB_MAINFRAME::m_mainToolBar
private

Definition at line 64 of file cvpcb_mainframe.h.

Referenced by CVPCB_MAINFRAME(), and ReCreateHToolbar().

◆ m_modal

bool KIWAY_PLAYER::m_modal
protectedinherited

Definition at line 256 of file kiway_player.h.

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

◆ m_modal_loop

WX_EVENT_LOOP* KIWAY_PLAYER::m_modal_loop
protectedinherited

◆ m_modal_resultant_parent

wxWindow* KIWAY_PLAYER::m_modal_resultant_parent
protectedinherited

Definition at line 258 of file kiway_player.h.

Referenced by KIWAY_PLAYER::ShowModal().

◆ m_modal_ret_val

bool KIWAY_PLAYER::m_modal_ret_val
protectedinherited

◆ m_modal_string

wxString KIWAY_PLAYER::m_modal_string
protectedinherited

Definition at line 259 of file kiway_player.h.

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

◆ m_modified

bool CVPCB_MAINFRAME::m_modified
protected

◆ m_ModuleLibNames

wxArrayString CVPCB_MAINFRAME::m_ModuleLibNames

Definition at line 74 of file cvpcb_mainframe.h.

Referenced by LoadProjectFile().

◆ m_mruPath

◆ m_netlist

◆ m_perspective

wxString EDA_BASE_FRAME::m_perspective
protectedinherited

wxAuiManager perspective.

Definition at line 143 of file eda_base_frame.h.

Referenced by EDA_BASE_FRAME::LoadSettings().

◆ m_projectFileParams

PARAM_CFG_ARRAY CVPCB_MAINFRAME::m_projectFileParams
protected

Definition at line 83 of file cvpcb_mainframe.h.

Referenced by GetProjectFileParameters().

◆ m_saveAndContinue

wxButton* CVPCB_MAINFRAME::m_saveAndContinue
private

Definition at line 71 of file cvpcb_mainframe.h.

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

◆ m_skipComponentSelect

bool CVPCB_MAINFRAME::m_skipComponentSelect
protected

◆ m_statusLine1

wxStaticText* CVPCB_MAINFRAME::m_statusLine1
private

Definition at line 69 of file cvpcb_mainframe.h.

Referenced by CVPCB_MAINFRAME(), and SetStatusText().

◆ m_statusLine2

wxStaticText* CVPCB_MAINFRAME::m_statusLine2
private

Definition at line 70 of file cvpcb_mainframe.h.

Referenced by CVPCB_MAINFRAME(), and SetStatusText().

◆ m_tcFilterString

wxTextCtrl* CVPCB_MAINFRAME::m_tcFilterString
private

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