KiCad PCB EDA Suite
schframe.cpp File Reference
#include <fctsys.h>
#include <kiface_i.h>
#include <pgm_base.h>
#include <gr_basic.h>
#include <class_drawpanel.h>
#include <gestfich.h>
#include <confirm.h>
#include <base_units.h>
#include <msgpanel.h>
#include <html_messagebox.h>
#include <executable_names.h>
#include <general.h>
#include <eeschema_id.h>
#include <netlist.h>
#include <lib_pin.h>
#include <class_library.h>
#include <schframe.h>
#include <sch_component.h>
#include <symbol_lib_table.h>
#include <dialog_helpers.h>
#include <libeditframe.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 <wx/display.h>
#include <build_version.h>
#include <wildcards_and_files_ext.h>
#include <netlist_exporter_kicad.h>
#include <kiway.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_MENU_RANGE (ID_PREFERENCES_HOTKEY_START, ID_PREFERENCES_HOTKEY_END, SCH_EDIT_FRAME::Process_Config) EVT_TOOL_RANGE(ID_SCHEMATIC_VERTICAL_TOOLBAR_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_VERTICAL_TOOLBAR_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 73 of file schframe.cpp.

References SEARCH_STACK::AddPaths().

74 {
75  for( unsigned i=0; i<aSrc.GetCount(); ++i )
76  aDst->AddPaths( aSrc[i], aIndex );
77 }
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 82 of file schframe.cpp.

References SEARCH_STACK::AddPaths(), and Format().

83 {
84  for( int i=1; true; ++i )
85  {
86  wxString key = wxString::Format( wxT( "LibraryPath%d" ), i );
87  wxString upath = aCfg->Read( key, wxEmptyString );
88 
89  if( !upath )
90  break;
91 
92  aDst->AddPaths( upath, aIndex );
93  }
94 }
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 AddPaths(const wxString &aPaths, int aIndex=-1)
Function AddPaths insert or append path(s)

Definition at line 332 of file schframe.cpp.

References g_Schematic_Hokeys_Descr, EDA_PANEINFO::HorizontalToolbarPane(), ID_EDIT_SYM_LIB_TABLE, ID_POPUP_GRID_LEVEL_1000, ID_POPUP_GRID_LEVEL_50, KiBitmap(), PCAD2KICAD::Left, EDA_PANEINFO::MessageToolbarPane(), NAMELESS_PROJECT, SCH_BASE_FRAME::OnEditSymbolLibTable(), PCAD2KICAD::Right, and EDA_PANEINFO::VerticalToolbarPane().

349  :
350  SCH_BASE_FRAME( aKiway, aParent, FRAME_SCH, wxT( "Eeschema" ),
351  wxDefaultPosition, wxDefaultSize, KICAD_DEFAULT_DRAWFRAME_STYLE, SCH_EDIT_FRAME_NAME ),
352  m_item_to_repeat( 0 )
353 {
354  m_showAxis = false; // true to show axis
355  m_showBorderAndTitleBlock = true; // true to show sheet references
356  m_CurrentSheet = new SCH_SHEET_PATH;
357  m_DefaultSchematicFileName = NAMELESS_PROJECT;
358  m_DefaultSchematicFileName += wxT( ".sch" );
359  m_showAllPins = false;
360  m_previewPosition = wxDefaultPosition;
361  m_previewSize = wxDefaultSize;
362  m_printMonochrome = true;
363  m_printSheetReference = true;
364  SetShowPageLimits( true );
365  m_hotkeysDescrList = g_Schematic_Hokeys_Descr;
366  m_dlgFindReplace = NULL;
367  m_findReplaceData = new wxFindReplaceData( wxFR_DOWN );
368  m_undoItem = NULL;
369  m_hasAutoSave = true;
370 
371  SetForceHVLines( true );
372  SetSpiceAjustPassiveValues( false );
373 
374  // Give an icon
375  wxIcon icon;
376  icon.CopyFromBitmap( KiBitmap( icon_eeschema_xpm ) );
377  SetIcon( icon );
378 
379  // Initialize grid id to the default value (50 mils):
380  const int default_grid = ID_POPUP_GRID_LEVEL_50 - ID_POPUP_GRID_LEVEL_1000;
381  m_LastGridSizeId = default_grid;
382 
383  LoadSettings( config() );
384 
385  CreateScreens();
386 
387  // Ensure m_LastGridSizeId is an offset inside the allowed schematic grid range
388  if( !GetScreen()->GridExists( m_LastGridSizeId + ID_POPUP_GRID_LEVEL_1000 ) )
389  m_LastGridSizeId = default_grid;
390 
391  SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
392 
393  if( m_canvas )
394  m_canvas->SetEnableBlockCommands( true );
395 
396  ReCreateMenuBar();
397  ReCreateHToolbar();
398  ReCreateVToolbar();
399  ReCreateOptToolbar();
400 
401  // Initialize common print setup dialog settings.
402  m_pageSetupData.GetPrintData().SetPrintMode( wxPRINT_MODE_PRINTER );
403  m_pageSetupData.GetPrintData().SetQuality( wxPRINT_QUALITY_MEDIUM );
404  m_pageSetupData.GetPrintData().SetBin( wxPRINTBIN_AUTO );
405  m_pageSetupData.GetPrintData().SetNoCopies( 1 );
406 
407  m_auimgr.SetManagedWindow( this );
408 
409  EDA_PANEINFO horiz;
410  horiz.HorizontalToolbarPane();
411 
412  EDA_PANEINFO vert;
413  vert.VerticalToolbarPane();
414 
415  EDA_PANEINFO mesg;
416  mesg.MessageToolbarPane();
417 
418  if( m_mainToolBar )
419  m_auimgr.AddPane( m_mainToolBar,
420  wxAuiPaneInfo( horiz ).Name( wxT( "m_mainToolBar" ) ).Top().Row( 0 ) );
421 
422  if( m_drawToolBar )
423  m_auimgr.AddPane( m_drawToolBar, wxAuiPaneInfo( vert ).Name( wxT( "m_drawToolBar" ) ).Right() );
424 
425  if( m_optionsToolBar )
426  m_auimgr.AddPane( m_optionsToolBar,
427  wxAuiPaneInfo( vert ).Name( wxT( "m_optionsToolBar" ) ).Left() );
428 
429  if( m_canvas )
430  m_auimgr.AddPane( m_canvas, wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() );
431 
432  if( m_messagePanel )
433  m_auimgr.AddPane( m_messagePanel, wxAuiPaneInfo( mesg ).Name( wxT( "MsgPanel" ) ).Bottom().
434  Layer(10) );
435 
436  m_auimgr.Update();
437 
438  // Now Drawpanel is sized, we can use BestZoom to show the component (if any)
439  GetScreen()->SetZoom( BestZoom() );
440 
441  Zoom_Automatique( false );
442 
443  // Net list generator
444  DefaultExecFlags();
445 
446  Bind( wxEVT_COMMAND_MENU_SELECTED, &SCH_EDIT_FRAME::OnEditSymbolLibTable, this,
448 }
EDA_PANEINFO & HorizontalToolbarPane()
Function HorizontalToolbarPane Change *this to a horizontal toolbar for KiCad.
Definition: wxstruct.h:487
#define KICAD_DEFAULT_DRAWFRAME_STYLE
Definition: wxstruct.h:55
void OnEditSymbolLibTable(wxCommandEvent &aEvent)
Specialization of the wxAuiPaneInfo class for KiCad panels.
Definition: wxstruct.h:478
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:36
EDA_PANEINFO & VerticalToolbarPane()
Function VerticalToolbarPane Change *this to a vertical toolbar for KiCad.
Definition: wxstruct.h:505
int Row
Definition: queue.cpp:46
Class SCH_SHEET_PATH.
EDA_PANEINFO & MessageToolbarPane()
Function MessageToolbarPane Change *this to a message pane for KiCad.
Definition: wxstruct.h:524
#define NAMELESS_PROJECT
default name for nameless projects
Definition: common.h:72
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.
#define SCH_EDIT_FRAME_NAME
Definition: schframe.h:113
struct EDA_HOTKEY_CONFIG g_Schematic_Hokeys_Descr[]

Variable Documentation

Definition at line 313 of file schframe.cpp.

Definition at line 317 of file schframe.cpp.

SCH_EDIT_FRAME::OnSelectTool ID_SCH_EDIT_COMPONENT_FOOTPRINT

Definition at line 303 of file schframe.cpp.

ID_SCHEMATIC_VERTICAL_TOOLBAR_END

Definition at line 290 of file schframe.cpp.