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 <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 <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 71 of file schframe.cpp.

References SEARCH_STACK::AddPaths().

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

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

81 {
82  for( int i=1; true; ++i )
83  {
84  wxString key = wxString::Format( wxT( "LibraryPath%d" ), i );
85  wxString upath = aCfg->Read( key, wxEmptyString );
86 
87  if( !upath )
88  break;
89 
90  aDst->AddPaths( upath, aIndex );
91  }
92 }
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
void AddPaths(const wxString &aPaths, int aIndex=-1)
Function AddPaths insert or append path(s)

Definition at line 326 of file schframe.cpp.

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

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

Variable Documentation

Definition at line 307 of file schframe.cpp.

Definition at line 311 of file schframe.cpp.

SCH_EDIT_FRAME::OnSelectTool ID_SCH_EDIT_COMPONENT_FOOTPRINT

Definition at line 297 of file schframe.cpp.

ID_SCHEMATIC_VERTICAL_TOOLBAR_END

Definition at line 284 of file schframe.cpp.