KiCad PCB EDA Suite
lib_control.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2019 KiCad Developers, see AUTHORS.txt for contributors.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, you may find one here:
18  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19  * or you may search the http://www.gnu.org website for the version 2 license,
20  * or you may write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22  */
23 
24 #include <fctsys.h>
25 #include <sch_painter.h>
26 #include <tool/tool_manager.h>
27 #include <tools/ee_actions.h>
28 #include <lib_edit_frame.h>
29 #include <tools/lib_control.h>
30 
31 
32 TOOL_ACTION EE_ACTIONS::showElectricalTypes( "eeschema.SymbolLibraryControl.showElectricalTypes",
33  AS_GLOBAL, 0,
34  _( "Show Pin Electrical Types" ), "",
35  pin_show_etype_xpm );
36 
37 
38 TOOL_ACTION EE_ACTIONS::showComponentTree( "eeschema.SymbolLibraryControl.showComponentTree",
39  AS_GLOBAL, 0,
40  _( "Show Symbol Tree" ), "",
41  search_tree_xpm );
42 
43 
45 {
46  wxCommandEvent dummy;
48 
49  return 0;
50 }
51 
52 
54 {
55  if( m_isLibEdit )
56  {
57  LIB_EDIT_FRAME* editFrame = static_cast<LIB_EDIT_FRAME*>( m_frame );
58 
59  wxCommandEvent dummy;
60  editFrame->OnToggleSearchTree( dummy );
61  }
62 
63  return 0;
64 }
65 
66 
68 {
70 
71  // Update canvas
75 
76  return 0;
77 }
78 
79 
81 {
85 }
void OnToggleSearchTree(wxCommandEvent &event)
void OnOpenLibraryViewer(wxCommandEvent &event)
Open the library viewer only to browse library contents.
int ShowElectricalTypes(const TOOL_EVENT &aEvent)
Definition: lib_control.cpp:67
void UpdateAllItems(int aUpdateFlags)
Updates all items in the view according to the given flags.
Definition: view.cpp:1443
KIGFX::SCH_RENDER_SETTINGS * GetRenderSettings()
void SetShowElectricalType(bool aShow)
static TOOL_ACTION showComponentTree
Definition: ee_actions.h:174
void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
void Go(int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
Function Go()
Item is being added to the view.
Definition: view_item.h:60
SCH_DRAW_PANEL * GetCanvas() const override
Class TOOL_EVENT.
Definition: tool_event.h:167
void setTransitions() override
Sets up handlers for various events.
Definition: lib_control.cpp:80
All active tools
Definition: tool_event.h:143
static TOOL_ACTION showElectricalTypes
Definition: ee_actions.h:173
KIGFX::SCH_VIEW * GetView() const
static TOOL_ACTION showLibraryBrowser
Definition: ee_actions.h:152
The symbol library editor main window.
int ShowLibraryBrowser(const TOOL_EVENT &aEvent)
Definition: lib_control.cpp:44
static LIB_PART * dummy()
Used when a LIB_PART is not found in library to draw a dummy shape This component is a 400 mils squar...
Class TOOL_ACTION.
Definition: tool_action.h:46
int ShowComponentTree(const TOOL_EVENT &aEvent)
Definition: lib_control.cpp:53
bool GetShowElectricalType()
Allow some frames to show/hide pin electrical type names.