KiCad PCB EDA Suite
sch_edit_frame.cpp File Reference
#include <fctsys.h>
#include <kiface_i.h>
#include <pgm_base.h>
#include <gr_basic.h>
#include <sch_draw_panel.h>
#include <gestfich.h>
#include <confirm.h>
#include <base_units.h>
#include <msgpanel.h>
#include <html_messagebox.h>
#include <executable_names.h>
#include <eda_dockart.h>
#include <general.h>
#include <eeschema_id.h>
#include <netlist.h>
#include <lib_pin.h>
#include <class_library.h>
#include <sch_edit_frame.h>
#include <sch_component.h>
#include <symbol_lib_table.h>
#include <dialog_helpers.h>
#include <reporter.h>
#include <lib_edit_frame.h>
#include <viewlib_frame.h>
#include <hotkeys.h>
#include <eeschema_config.h>
#include <sch_sheet.h>
#include <sch_sheet_path.h>
#include "sim/sim_plot_frame.h"
#include <invoke_sch_dialog.h>
#include <dialogs/dialog_schematic_find.h>
#include <dialog_symbol_remap.h>
#include <view/view.h>
#include <tool/tool_manager.h>
#include <wx/display.h>
#include <build_version.h>
#include <wildcards_and_files_ext.h>
#include <netlist_exporter_kicad.h>
#include <kiway.h>
#include <dialogs/dialog_fields_editor_global.h>
#include <sch_view.h>
#include <sch_painter.h>
#include <gal/graphics_abstraction_layer.h>

Go to the source code of this file.

Macros

#define FN_LEN_MAX   80
 

Functions

static void add_search_paths (SEARCH_STACK *aDst, const SEARCH_STACK &aSrc, int aIndex)
 
static void add_search_paths (SEARCH_STACK *aDst, wxConfigBase *aCfg, int aIndex)
 
 EVT_TOOL_RANGE (ID_SCHEMATIC_VERTICAL_TOOLBAR_START, ID_SCHEMATIC_VERTICAL_TOOLBAR_END, SCH_EDIT_FRAME::OnSelectTool) EVT_TOOL_RANGE(ID_SCHEMATIC_PLACE_MENU_START
 
SCH_EDIT_FRAME::OnSelectTool EVT_MENU_RANGE (ID_SCH_ROTATE_CLOCKWISE, ID_SCH_ROTATE_COUNTERCLOCKWISE, SCH_EDIT_FRAME::OnRotate) EVT_MENU_RANGE(ID_SCH_EDIT_ITEM
 
SCH_EDIT_FRAME::OnSelectTool SCH_EDIT_FRAME::OnEditItem EVT_MENU_RANGE (ID_POPUP_START_RANGE, ID_POPUP_END_RANGE, SCH_EDIT_FRAME::Process_Special_Functions) EVT_MENU_RANGE(ID_POPUP_GENERAL_START_RANGE
 
SCH_EDIT_FRAME::OnSelectTool SCH_EDIT_FRAME::OnEditItem SCH_EDIT_FRAME::Process_Special_Functions EVT_MENU_RANGE (ID_POPUP_SCH_SELECT_UNIT1, ID_POPUP_SCH_SELECT_UNIT_CMP_MAX, SCH_EDIT_FRAME::OnSelectUnit) EVT_MENU_RANGE(ID_POPUP_SCH_CHANGE_TYPE_TEXT
 
SCH_EDIT_FRAME::OnSelectTool SCH_EDIT_FRAME::OnEditItem SCH_EDIT_FRAME::Process_Special_Functions SCH_EDIT_FRAME::OnConvertTextType EVT_UPDATE_UI_RANGE (ID_SCHEMATIC_VERTICAL_TOOLBAR_START, ID_SCHEMATIC_VERTICAL_TOOLBAR_END, SCH_EDIT_FRAME::OnUpdateSelectTool) SCH_EDIT_FRAME
 

Variables

 ID_SCHEMATIC_PLACE_MENU_END
 
SCH_EDIT_FRAME::OnSelectTool ID_SCH_EDIT_COMPONENT_FOOTPRINT
 
SCH_EDIT_FRAME::OnSelectTool SCH_EDIT_FRAME::OnEditItem ID_POPUP_GENERAL_END_RANGE
 
SCH_EDIT_FRAME::OnSelectTool SCH_EDIT_FRAME::OnEditItem SCH_EDIT_FRAME::Process_Special_Functions ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_COMMENT
 

Macro Definition Documentation

#define FN_LEN_MAX   80

Function Documentation

static void add_search_paths ( SEARCH_STACK aDst,
const SEARCH_STACK aSrc,
int  aIndex 
)
static

Definition at line 82 of file sch_edit_frame.cpp.

References SEARCH_STACK::AddPaths(), and i.

Referenced by add_search_paths().

83 {
84  for( unsigned i=0; i<aSrc.GetCount(); ++i )
85  aDst->AddPaths( aSrc[i], aIndex );
86 }
size_t i
Definition: json11.cpp:597
void AddPaths(const wxString &aPaths, int aIndex=-1)
Function AddPaths insert or append path(s)
static void add_search_paths ( SEARCH_STACK aDst,
wxConfigBase *  aCfg,
int  aIndex 
)
static

Definition at line 91 of file sch_edit_frame.cpp.

References PROJECT::AbsolutePath(), add_search_paths(), SEARCH_STACK::AddPaths(), PGM_BASE::App(), EDA_DRAW_FRAME::CopyToClipboard(), DBG, DisplayError(), PROJECT::ELEM_SCH_PART_LIBS, PROJECT::ELEM_SCH_SEARCH_STACK, EVT_MENU(), EVT_MENU_RANGE(), EVT_TOOL(), EVT_TOOL_RANGE(), Format(), PROJECT::GetElem(), EDA_BASE_FRAME::GetKicadAbout(), EDA_BASE_FRAME::GetKicadContribute(), EDA_BASE_FRAME::GetKicadHelp(), SCH_EDIT_FRAME::GetSchematicFromRedoList(), SCH_EDIT_FRAME::GetSchematicFromUndoList(), i, ID_APPEND_PROJECT, ID_AUTOPLACE_FIELDS, ID_BACKANNO_ITEMS, ID_CONFIG_READ, ID_CONFIG_SAVE, ID_EDA_SOCKET_EVENT, ID_EDA_SOCKET_EVENT_SERV, ID_EDIT_COMPONENTS_TO_SYMBOLS_LIB_ID, ID_FILE1, ID_FILEMAX, ID_FIND_ITEMS, ID_GEN_COPY_SHEET_TO_CLIPBOARD, ID_GEN_PLOT_SCHEMATIC, ID_GET_ANNOTATE, ID_GET_ERC, ID_GET_NETLIST, ID_GET_TOOLS, ID_GRID_SETTINGS, ID_HELP_GET_INVOLVED, ID_HIERARCHY, ID_HIGHLIGHT, ID_IMPORT_NON_KICAD_SCH, ID_LOAD_PROJECT, ID_MENU_ZOOM_SELECTION, ID_NEW_PROJECT, ID_NO_TOOL_SELECTED, ID_OPEN_CMP_TABLE, ID_POPUP_SCH_CALL_LIBEDIT_AND_LOAD_CMP, ID_POPUP_SCH_DUPLICATE_ITEM, ID_POPUP_SCH_SELECT_ON_PCB, ID_PREFERENCES_CONFIGURE_PATHS, ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, ID_REMAP_SYMBOLS, ID_RESCUE_CACHED, ID_RUN_CVPCB, ID_RUN_LIBRARY, ID_RUN_PCB, ID_RUN_PCB_MODULE_EDITOR, ID_SAVE_ONE_SHEET_UNDER_NEW_NAME, ID_SAVE_PROJECT, ID_SCH_MOVE_ITEM, ID_SCHEMATIC_VERTICAL_TOOLBAR_END, ID_SCHEMATIC_VERTICAL_TOOLBAR_START, ID_SHEET_SET, ID_TO_LIBVIEW, ID_UPDATE_FIELDS, ID_UPDATE_ONE_SHEET, ID_UPDATE_PCB_FROM_SCH, ID_ZOOM_SELECTION, PARSE_ERROR::inputLine, Kiface(), PART_LIBS::LibNamesAndPaths(), HTML_MESSAGE_BOX::ListSet(), PART_LIBS::LoadAllLibraries(), PROJECT::m_project_name, HTML_MESSAGE_BOX::MessageSet(), SCH_EDIT_FRAME::OnAnnotate(), SCH_EDIT_FRAME::OnAppendProject(), SCH_EDIT_FRAME::OnAutoplaceFields(), SCH_EDIT_FRAME::OnCloseWindow(), SCH_BASE_FRAME::OnConfigurePaths(), SCH_EDIT_FRAME::OnCopySchematicItemRequest(), SCH_EDIT_FRAME::OnCreateBillOfMaterials(), SCH_EDIT_FRAME::OnCreateNetlist(), SCH_EDIT_FRAME::OnEditComponentSymbolsId(), SCH_EDIT_FRAME::OnErc(), SCH_EDIT_FRAME::OnExit(), SCH_EDIT_FRAME::OnFindItems(), SCH_BASE_FRAME::OnGridSettings(), SCH_EDIT_FRAME::OnImportProject(), SCH_EDIT_FRAME::OnLaunchBomManager(), SCH_EDIT_FRAME::OnLoadCmpToFootprintLinkFile(), SCH_EDIT_FRAME::OnLoadFile(), SCH_EDIT_FRAME::OnLoadProject(), SCH_EDIT_FRAME::OnMoveItem(), SCH_EDIT_FRAME::OnNewProject(), SCH_EDIT_FRAME::OnOpenCvpcb(), SCH_EDIT_FRAME::OnOpenLibraryEditor(), SCH_BASE_FRAME::OnOpenLibraryViewer(), SCH_EDIT_FRAME::OnOpenPcbModuleEditor(), SCH_EDIT_FRAME::OnOpenPcbnew(), SCH_EDIT_FRAME::OnPreferencesOptions(), SCH_EDIT_FRAME::OnPrint(), SCH_EDIT_FRAME::OnRemapSymbols(), SCH_EDIT_FRAME::OnRescueProject(), SCH_EDIT_FRAME::OnSaveProject(), SCH_EDIT_FRAME::OnSelectTool(), EDA_DRAW_FRAME::OnSize(), EDA_DRAW_FRAME::OnSockRequest(), EDA_DRAW_FRAME::OnSockRequestServer(), SCH_EDIT_FRAME::OnUpdateFields(), SCH_EDIT_FRAME::OnUpdatePCB(), PART_LIBS_T, Pgm(), SCH_EDIT_FRAME::PlotSchematic(), SCH_EDIT_FRAME::Process_Config(), EDA_DRAW_FRAME::Process_PageSettings(), SCH_EDIT_FRAME::Process_Special_Functions(), SCH_EDIT_FRAME::Save_File(), SCH_EDIT_FRAME::SelectAllFromSheet(), PROJECT::SetElem(), SEARCH_STACK::Split(), TO_UTF8, PART_LIBS::Type(), and IO_ERROR::What().

92 {
93  for( int i=1; true; ++i )
94  {
95  wxString key = wxString::Format( wxT( "LibraryPath%d" ), i );
96  wxString upath = aCfg->Read( key, wxEmptyString );
97 
98  if( !upath )
99  break;
100 
101  aDst->AddPaths( upath, aIndex );
102  }
103 }
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
void AddPaths(const wxString &aPaths, int aIndex=-1)
Function AddPaths insert or append path(s)

Definition at line 350 of file sch_edit_frame.cpp.

References EDA_PANE::Canvas(), g_Schematic_Hokeys_Descr, ID_EDIT_SYM_LIB_TABLE, ID_POPUP_GRID_LEVEL_1000, ID_POPUP_GRID_LEVEL_50, KiBitmap(), PCAD2KICAD::Left, NAMELESS_PROJECT, SCH_BASE_FRAME::OnEditSymbolLibTable(), and PCAD2KICAD::Right.

369  :
370  SCH_BASE_FRAME( aKiway, aParent, FRAME_SCH, wxT( "Eeschema" ),
371  wxDefaultPosition, wxDefaultSize, KICAD_DEFAULT_DRAWFRAME_STYLE, SCH_EDIT_FRAME_NAME ),
372  m_item_to_repeat( 0 )
373 {
374  m_showAxis = false; // true to show axis
375  m_showBorderAndTitleBlock = true; // true to show sheet references
376  m_CurrentSheet = new SCH_SHEET_PATH;
377  m_DefaultSchematicFileName = NAMELESS_PROJECT;
378  m_DefaultSchematicFileName += wxT( ".sch" );
379  m_showAllPins = false;
380  m_printMonochrome = true;
381  m_printSheetReference = true;
382  SetShowPageLimits( true );
383  m_hotkeysDescrList = g_Schematic_Hokeys_Descr;
384  m_dlgFindReplace = NULL;
385  m_findReplaceData = new wxFindReplaceData( wxFR_DOWN );
386  m_findReplaceStatus = new wxString( wxEmptyString );
387  m_undoItem = NULL;
388  m_hasAutoSave = true;
389 
390  m_toolManager = new TOOL_MANAGER;
391 
392  SetForceHVLines( true );
393  SetSpiceAjustPassiveValues( false );
394 
395  // Give an icon
396  wxIcon icon;
397  icon.CopyFromBitmap( KiBitmap( icon_eeschema_xpm ) );
398  SetIcon( icon );
399 
400  // Initialize grid id to the default value (50 mils):
402 
403  LoadSettings( config() );
404 
405  CreateScreens();
406 
407  SetPresetGrid( m_LastGridSizeId );
408 
409  SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
410 
411  if( m_canvas )
412  m_canvas->SetEnableBlockCommands( true );
413 
414  ReCreateMenuBar();
415  ReCreateHToolbar();
416  ReCreateVToolbar();
417  ReCreateOptToolbar();
418 
419  // Initialize common print setup dialog settings.
420  m_pageSetupData.GetPrintData().SetPrintMode( wxPRINT_MODE_PRINTER );
421  m_pageSetupData.GetPrintData().SetQuality( wxPRINT_QUALITY_MEDIUM );
422  m_pageSetupData.GetPrintData().SetBin( wxPRINTBIN_AUTO );
423  m_pageSetupData.GetPrintData().SetNoCopies( 1 );
424 
425  m_auimgr.SetManagedWindow( this );
426  m_auimgr.SetArtProvider( new EDA_DOCKART( this ) );
427 
428  m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer(6) );
429  m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" ).Left().Layer(3) );
430  m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( "ToolsToolbar" ).Right().Layer(1) );
431  m_auimgr.AddPane( m_canvas->GetWindow(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
432  m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ).Bottom().Layer(6) );
433 
434  m_auimgr.Update();
435 
436  Zoom_Automatique( false );
437 
438  if( GetGalCanvas() )
439  GetGalCanvas()->GetGAL()->SetGridVisibility( IsGridVisible() );
440 
441  // Net list generator
442  DefaultExecFlags();
443 
444  Bind( wxEVT_COMMAND_MENU_SELECTED, &SCH_EDIT_FRAME::OnEditSymbolLibTable, this,
446 }
virtual void OnEditSymbolLibTable(wxCommandEvent &aEvent)
#define SCH_EDIT_FRAME_NAME
Definition: draw_frame.h:50
Class TOOL_MANAGER.
Definition: tool_manager.h:49
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
#define NAMELESS_PROJECT
#define KICAD_DEFAULT_DRAWFRAME_STYLE
Class SCH_SHEET_PATH.
Specialization of the wxAuiPaneInfo class for KiCad panels.
EDA_PANE & Canvas()
Function Canvas Turn *this into an undecorated pane suitable for a drawing canvas.
A shim class between EDA_DRAW_FRAME and several derived classes: LIB_EDIT_FRAME, LIB_VIEW_FRAME, and SCH_EDIT_FRAME, and it brings in a common way of handling the provided virtual functions for the derived classes.
struct EDA_HOTKEY_CONFIG g_Schematic_Hokeys_Descr[]

Variable Documentation

Definition at line 333 of file sch_edit_frame.cpp.

SCH_EDIT_FRAME::OnSelectTool ID_SCH_EDIT_COMPONENT_FOOTPRINT

Definition at line 319 of file sch_edit_frame.cpp.

ID_SCHEMATIC_PLACE_MENU_END

Definition at line 306 of file sch_edit_frame.cpp.