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

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

Definition at line 313 of file schframe.cpp.

SCH_EDIT_FRAME::OnSelectTool ID_SCH_EDIT_COMPONENT_FOOTPRINT

Definition at line 299 of file schframe.cpp.

ID_SCHEMATIC_VERTICAL_TOOLBAR_END

Definition at line 286 of file schframe.cpp.