KiCad PCB EDA Suite
lib_edit_frame.cpp File Reference

LIB_EDIT_FRAME class is the symbol library editor frame. More...

#include <fctsys.h>
#include <pgm_base.h>
#include <kiface_i.h>
#include <kiway_express.h>
#include <sch_draw_panel.h>
#include <base_screen.h>
#include <confirm.h>
#include <eda_doc.h>
#include <gr_basic.h>
#include <sch_edit_frame.h>
#include <msgpanel.h>
#include <eda_dockart.h>
#include <general.h>
#include <eeschema_id.h>
#include <lib_edit_frame.h>
#include <class_library.h>
#include <lib_polyline.h>
#include <lib_pin.h>
#include <lib_manager.h>
#include <widgets/symbol_tree_pane.h>
#include <widgets/lib_tree.h>
#include <symbol_lib_table.h>
#include <list_operations.h>
#include <kicad_device_context.h>
#include <hotkeys.h>
#include <eeschema_config.h>
#include <dialogs/dialog_lib_edit_text.h>
#include <dialogs/dialog_edit_component_in_lib.h>
#include <dialogs/dialog_lib_edit_pin_table.h>
#include <wildcards_and_files_ext.h>
#include <menus_helpers.h>
#include <wx/progdlg.h>
#include <tool/context_menu.h>
#include <sch_view.h>
#include <sch_painter.h>

Go to the source code of this file.

Functions

 EVT_TOOL_RANGE (ID_LIBEDIT_PIN_BUTT, ID_LIBEDIT_DELETE_ITEM_BUTT, LIB_EDIT_FRAME::OnSelectTool) EVT_MENU_RANGE(ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_ITEM
 
LIB_EDIT_FRAME::Process_Special_Functions EVT_MENU_RANGE (ID_POPUP_GENERAL_START_RANGE, ID_POPUP_GENERAL_END_RANGE, LIB_EDIT_FRAME::Process_Special_Functions) EVT_MENU_RANGE(ID_LIBEDIT_MIRROR_X
 
LIB_EDIT_FRAME::Process_Special_Functions LIB_EDIT_FRAME::OnOrient EVT_UPDATE_UI_RANGE (ID_LIBEDIT_PIN_BUTT, ID_LIBEDIT_DELETE_ITEM_BUTT, LIB_EDIT_FRAME::OnUpdateEditingPart) LIB_EDIT_FRAME
 

Variables

 ID_POPUP_LIBEDIT_DELETE_CURRENT_POLY_SEGMENT
 
LIB_EDIT_FRAME::Process_Special_Functions ID_LIBEDIT_ORIENT_NORMAL
 

Detailed Description

LIB_EDIT_FRAME class is the symbol library editor frame.

Definition in file lib_edit_frame.cpp.

Function Documentation

Definition at line 189 of file lib_edit_frame.cpp.

References DEFAULT_REPEAT_OFFSET_PIN, g_Libedit_Hokeys_Descr, GetDefaultTextSize(), ID_EDIT_SYM_LIB_TABLE, ID_POPUP_GRID_LEVEL_1000, ID_POPUP_GRID_LEVEL_50, ID_PREFERENCES_CONFIGURE_PATHS, ID_ZOOM_PAGE, KiBitmap(), PCAD2KICAD::Left, SCH_BASE_FRAME::OnConfigurePaths(), LIB_EDIT_FRAME::OnEditSymbolLibTable(), and PCAD2KICAD::Right.

196  :
197  SCH_BASE_FRAME( aKiway, aParent, FRAME_SCH_LIB_EDITOR, _( "Library Editor" ),
198  wxDefaultPosition, wxDefaultSize, KICAD_DEFAULT_DRAWFRAME_STYLE, LIB_EDIT_FRAME_NAME )
199 {
200  m_showAxis = true; // true to draw axis
201  SetShowDeMorgan( false );
202  m_drawSpecificConvert = true;
203  m_drawSpecificUnit = false;
204  m_hotkeysDescrList = g_Libedit_Hokeys_Descr;
205  m_syncPinEdit = false;
206  m_repeatPinStep = DEFAULT_REPEAT_OFFSET_PIN;
207  SetShowElectricalType( true );
208 
209  m_my_part = NULL;
210  m_tempCopyComponent = NULL;
211  m_treePane = nullptr;
212  m_libMgr = nullptr;
213 
214  // Delayed initialization
215  if( m_textSize == -1 )
216  m_textSize = GetDefaultTextSize();
217 
218  // Initialize grid id to the default value 50 mils:
220 
221  wxIcon icon;
222  icon.CopyFromBitmap( KiBitmap( icon_libedit_xpm ) );
223  SetIcon( icon );
224 
225  LoadSettings( config() );
226 
227  m_dummyScreen = new SCH_SCREEN( aKiway );
228  SetScreen( m_dummyScreen );
229  GetScreen()->m_Center = true;
230  GetScreen()->SetMaxUndoItems( m_UndoRedoCountMax );
231 
232  SetCrossHairPosition( wxPoint( 0, 0 ) );
233 
234  SetPresetGrid( m_LastGridSizeId );
235 
236  SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
237 
238  if( m_canvas )
239  m_canvas->SetEnableBlockCommands( true );
240 
241  m_libMgr = new LIB_MANAGER( *this );
242  SyncLibraries( true );
243  m_treePane = new SYMBOL_TREE_PANE( this, m_libMgr );
244 
245  ReCreateMenuBar();
246  ReCreateHToolbar();
247  ReCreateVToolbar();
248  ReCreateOptToolbar();
249 
250  updateTitle();
251  DisplayCmpDoc();
252  UpdatePartSelectList();
253 
254  m_auimgr.SetManagedWindow( this );
255  m_auimgr.SetArtProvider( new EDA_DOCKART( this ) );
256 
257 
258  m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer(6) );
259  m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ).Bottom().Layer(6) );
260 
261  m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" ).Left().Layer(3) );
262  m_auimgr.AddPane( m_treePane, EDA_PANE().Palette().Name( "ComponentTree" ).Left().Layer(1)
263  .Caption( _( "Libraries" ) ).MinSize( 250, -1 ).Resizable() );
264  m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( "ToolsToolbar" ).Right().Layer(1) );
265 
266  m_auimgr.AddPane( m_canvas->GetWindow(), wxAuiPaneInfo().Name( "DrawFrame" ).CentrePane() );
267 
268  m_auimgr.Update();
269 
270  Raise();
271  Show( true );
272 
273  Bind( wxEVT_COMMAND_MENU_SELECTED, &LIB_EDIT_FRAME::OnConfigurePaths, this,
275 
276  Bind( wxEVT_COMMAND_MENU_SELECTED, &LIB_EDIT_FRAME::OnEditSymbolLibTable, this,
278 
279  wxCommandEvent evt( wxEVT_COMMAND_MENU_SELECTED, ID_ZOOM_PAGE );
280  wxPostEvent( this, evt );
281 
282  SyncView();
283  GetGalCanvas()->GetViewControls()->SetSnapping( true );
284  GetGalCanvas()->GetView()->UseDrawPriority( true );
285  GetGalCanvas()->GetGAL()->SetGridVisibility( IsGridVisible() );
286  GetGalCanvas()->GetGAL()->SetAxesEnabled( true );
287 }
#define LIB_EDIT_FRAME_NAME
Definition: draw_frame.h:49
void OnEditSymbolLibTable(wxCommandEvent &aEvent) override
void OnConfigurePaths(wxCommandEvent &aEvent)
struct EDA_HOTKEY_CONFIG g_Libedit_Hokeys_Descr[]
#define DEFAULT_REPEAT_OFFSET_PIN
the default value (overwritten by the eeschema config)
Definition: general.h:50
Library Editor pane with component tree and symbol library table selector.
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
#define KICAD_DEFAULT_DRAWFRAME_STYLE
Specialization of the wxAuiPaneInfo class for KiCad panels.
Class to handle modifications to the symbol libraries.
Definition: lib_manager.h:49
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.
int GetDefaultTextSize()
Default size for text in general.

Variable Documentation

Definition at line 169 of file lib_edit_frame.cpp.

ID_POPUP_LIBEDIT_DELETE_CURRENT_POLY_SEGMENT

Definition at line 163 of file lib_edit_frame.cpp.

Referenced by LIB_EDIT_FRAME::Process_Special_Functions().