KiCad PCB EDA Suite
KICAD_MANAGER_CONTROL Class Reference

Handle actions in the kicad manager frame. More...

#include <kicad_manager_control.h>

Inheritance diagram for KICAD_MANAGER_CONTROL:
TOOL_INTERACTIVE TOOL_BASE

Public Types

enum  RESET_REASON { RUN , MODEL_RELOAD , GAL_SWITCH , REDRAW }
 Determine the reason of reset for a tool. More...
 

Public Member Functions

 KICAD_MANAGER_CONTROL ()
 
 ~KICAD_MANAGER_CONTROL () override
 
void Reset (RESET_REASON aReason) override
 Bring the tool to a known, initial state. More...
 
int NewProject (const TOOL_EVENT &aEvent)
 
int NewFromTemplate (const TOOL_EVENT &aEvent)
 
int OpenProject (const TOOL_EVENT &aEvent)
 
int OpenDemoProject (const TOOL_EVENT &aEvent)
 
int CloseProject (const TOOL_EVENT &aEvent)
 
int SaveProjectAs (const TOOL_EVENT &aEvent)
 
int LoadProject (const TOOL_EVENT &aEvent)
 
int ImportNonKicadProj (const TOOL_EVENT &aEvent)
 Imports a non kicad project from a sch/pcb dropped file. More...
 
int ViewDroppedViewers (const TOOL_EVENT &aEvent)
 
int Refresh (const TOOL_EVENT &aEvent)
 
int UpdateMenu (const TOOL_EVENT &aEvent)
 
int ShowPlayer (const TOOL_EVENT &aEvent)
 
int Execute (const TOOL_EVENT &aEvent)
 
int ShowPluginManager (const TOOL_EVENT &aEvent)
 Set up handlers for various events. More...
 
void setTransitions () override
 This method is meant to be overridden in order to specify handlers for events. More...
 
void Activate ()
 Run the tool. More...
 
TOOL_MENUGetToolMenu ()
 
void SetContextMenu (ACTION_MENU *aMenu, CONTEXT_MENU_TRIGGER aTrigger=CMENU_BUTTON)
 Assign a context menu and tells when it should be activated. More...
 
void RunMainStack (std::function< void()> aFunc)
 Call a function using the main stack. More...
 
template<class T >
void Go (int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
 Define which state (aStateFunc) to go when a certain event arrives (aConditions). More...
 
TOOL_EVENTWait (const TOOL_EVENT_LIST &aEventList=TOOL_EVENT(TC_ANY, TA_ANY))
 Suspend execution of the tool until an event specified in aEventList arrives. More...
 
virtual bool Init ()
 Init() is called once upon a registration of the tool. More...
 
TOOL_TYPE GetType () const
 Return the type of the tool. More...
 
TOOL_ID GetId () const
 Return the unique identifier of the tool. More...
 
const std::string & GetName () const
 Return the name of the tool. More...
 
TOOL_MANAGERGetManager () const
 Return the instance of TOOL_MANAGER that takes care of the tool. More...
 
bool IsToolActive () const
 

Protected Member Functions

void attachManager (TOOL_MANAGER *aManager)
 Set the TOOL_MANAGER the tool will belong to. More...
 
KIGFX::VIEWgetView () const
 Returns the instance of #VIEW object used in the application. More...
 
KIGFX::VIEW_CONTROLSgetViewControls () const
 Return the instance of VIEW_CONTROLS object used in the application. More...
 
template<typename T >
T * getEditFrame () const
 Return the application window object, casted to requested user type. More...
 
template<typename T >
T * getModel () const
 Return the model object if it matches the requested type. More...
 

Protected Attributes

TOOL_MENU m_menu
 The functions below are not yet implemented - their interface may change. More...
 
TOOL_TYPE m_type
 Unique identifier for the tool, assigned by a TOOL_MANAGER instance. More...
 
TOOL_ID m_toolId
 Name of the tool. More...
 
std::string m_toolName
 
TOOL_MANAGERm_toolMgr
 

Private Member Functions

int openProject (const wxString &aDefaultDir)
 
void resetTransitions ()
 Clear the current transition map and restores the default one created by setTransitions(). More...
 
void goInternal (TOOL_STATE_FUNC &aState, const TOOL_EVENT_LIST &aConditions)
 
EDA_ITEMgetModelInt () const
 
TOOLS_HOLDERgetToolHolderInt () const
 

Private Attributes

KICAD_MANAGER_FRAMEm_frame
 < Pointer to the currently used edit/draw frame. More...
 
std::mutex m_loading
 

Detailed Description

Handle actions in the kicad manager frame.

Definition at line 38 of file kicad_manager_control.h.

Member Enumeration Documentation

◆ RESET_REASON

enum TOOL_BASE::RESET_REASON
inherited

Determine the reason of reset for a tool.

Enumerator
RUN 

Tool is invoked after being inactive.

MODEL_RELOAD 

Model changes (required full reload)

GAL_SWITCH 

Rendering engine changes.

REDRAW 

Full drawing refresh.

Definition at line 77 of file tool_base.h.

78 {
79 RUN,
82 REDRAW
83 };
@ REDRAW
Full drawing refresh.
Definition: tool_base.h:82
@ MODEL_RELOAD
Model changes (required full reload)
Definition: tool_base.h:80
@ GAL_SWITCH
Rendering engine changes.
Definition: tool_base.h:81
@ RUN
Tool is invoked after being inactive.
Definition: tool_base.h:79

Constructor & Destructor Documentation

◆ KICAD_MANAGER_CONTROL()

KICAD_MANAGER_CONTROL::KICAD_MANAGER_CONTROL ( )

Definition at line 56 of file kicad_manager_control.cpp.

56 :
57 TOOL_INTERACTIVE( "kicad.Control" ),
58 m_frame( nullptr )
59{
60}
KICAD_MANAGER_FRAME * m_frame
< Pointer to the currently used edit/draw frame.
TOOL_INTERACTIVE(TOOL_ID aId, const std::string &aName)
Create a tool with given id & name.

◆ ~KICAD_MANAGER_CONTROL()

KICAD_MANAGER_CONTROL::~KICAD_MANAGER_CONTROL ( )
inlineoverride

Definition at line 42 of file kicad_manager_control.h.

42{ }

Member Function Documentation

◆ Activate()

void TOOL_INTERACTIVE::Activate ( )
inherited

Run the tool.

After activation, the tool starts receiving events until it is finished.

Definition at line 51 of file tool_interactive.cpp.

52{
54}
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:215
TOOL_ID m_toolId
Name of the tool.
Definition: tool_base.h:210
bool InvokeTool(TOOL_ID aToolId)
Call a tool by sending a tool activation event to tool of given ID.

References TOOL_MANAGER::InvokeTool(), TOOL_BASE::m_toolId, and TOOL_BASE::m_toolMgr.

Referenced by AUTOPLACE_TOOL::autoplace(), EDIT_TOOL::copyToClipboard(), SCH_EDIT_TOOL::DeleteItemCursor(), SYMBOL_EDITOR_EDIT_TOOL::DeleteItemCursor(), PL_EDIT_TOOL::DeleteItemCursor(), PCB_CONTROL::DeleteItemCursor(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::DrawLine(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::DrawRectangle(), SCH_DRAWING_TOOLS::DrawShape(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), BOARD_EDITOR_CONTROL::DrillOrigin(), PAD_TOOL::EnumeratePads(), PCB_CONTROL::GridSetOrigin(), SCH_EDITOR_CONTROL::HighlightNetCursor(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), DRAWING_TOOL::InteractivePlaceWithPreview(), BOARD_INSPECTION_TOOL::LocalRatsnestTool(), EE_POINT_EDITOR::Main(), SCH_MOVE_TOOL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), PICKER_TOOL::Main(), PL_EDIT_TOOL::Main(), PL_POINT_EDITOR::Main(), PCB_PICKER_TOOL::Main(), LENGTH_TUNER_TOOL::MainLoop(), ROUTER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), PCB_POINT_EDITOR::OnSelectionChange(), GROUP_TOOL::PickNewMember(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), DRAWING_TOOL::PlaceText(), EDIT_TOOL::Remove(), ROUTER_TOOL::RouteSelected(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), DRAWING_TOOL::SetAnchor(), DRC_TOOL::ShowDRCDialog(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

◆ attachManager()

void TOOL_BASE::attachManager ( TOOL_MANAGER aManager)
protectedinherited

Set the TOOL_MANAGER the tool will belong to.

Called by TOOL_MANAGER::RegisterTool()

Definition at line 60 of file tool_base.cpp.

61{
62 m_toolMgr = aManager;
63}

References TOOL_BASE::m_toolMgr.

Referenced by TOOL_MANAGER::RegisterTool().

◆ CloseProject()

int KICAD_MANAGER_CONTROL::CloseProject ( const TOOL_EVENT aEvent)

Definition at line 339 of file kicad_manager_control.cpp.

340{
341 m_frame->CloseProject( true );
342 return 0;
343}
bool CloseProject(bool aSave)
Closes the project, and saves it if aSave is true;.

References KICAD_MANAGER_FRAME::CloseProject(), and m_frame.

Referenced by setTransitions().

◆ Execute()

int KICAD_MANAGER_CONTROL::Execute ( const TOOL_EVENT aEvent)

Definition at line 835 of file kicad_manager_control.cpp.

836{
837 wxString execFile;
838 wxString param;
839
841 execFile = GERBVIEW_EXE;
843 execFile = BITMAPCONVERTER_EXE;
845 execFile = PCB_CALCULATOR_EXE;
847 execFile = PL_EDITOR_EXE;
849 execFile = Pgm().GetTextEditor();
851 execFile = EESCHEMA_EXE;
853 execFile = PCBNEW_EXE;
854 else
855 wxFAIL_MSG( "Execute(): unexpected request" );
856
857 if( execFile.IsEmpty() )
858 return 0;
859
860 if( aEvent.Parameter<wxString*>() )
861 param = *aEvent.Parameter<wxString*>();
863 param = m_frame->Prj().GetProjectPath();
864
865 TERMINATE_HANDLER* callback = new TERMINATE_HANDLER( execFile );
866
867 long pid = ExecuteFile( execFile, param, callback );
868
869 if( pid > 0 )
870 {
871#ifdef __WXMAC__
872 // This non-parameterized use of wxExecute is fine because execFile is not derived
873 // from user input.
874 wxExecute( "osascript -e 'activate application \"" + execFile + "\"'" );
875#endif
876 }
877 else
878 {
879 delete callback;
880 }
881
882 return 0;
883}
static TOOL_ACTION editOtherPCB
static TOOL_ACTION editOtherSch
static TOOL_ACTION openTextEditor
static TOOL_ACTION convertImage
static TOOL_ACTION editDrawingSheet
static TOOL_ACTION showCalculator
static TOOL_ACTION viewGerbers
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
virtual const wxString GetProjectPath() const
Return the full path of the project.
Definition: project.cpp:126
T Parameter() const
Return a non-standard parameter assigned to the event.
Definition: tool_event.h:442
bool IsAction(const TOOL_ACTION *aAction) const
Test if the event contains an action issued upon activation of the given TOOL_ACTION.
Definition: tool_event.cpp:81
const wxString EESCHEMA_EXE
const wxString GERBVIEW_EXE
const wxString PL_EDITOR_EXE
const wxString BITMAPCONVERTER_EXE
const wxString PCBNEW_EXE
const wxString PCB_CALCULATOR_EXE
int ExecuteFile(const wxString &aEditorName, const wxString &aFileName, wxProcess *aCallback)
Call the executable file aEditorName with the parameter aFileName.
Definition: gestfich.cpp:115
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:111

References BITMAPCONVERTER_EXE, KICAD_MANAGER_ACTIONS::convertImage, KICAD_MANAGER_ACTIONS::editDrawingSheet, KICAD_MANAGER_ACTIONS::editOtherPCB, KICAD_MANAGER_ACTIONS::editOtherSch, EESCHEMA_EXE, ExecuteFile(), GERBVIEW_EXE, PROJECT::GetProjectPath(), TOOL_EVENT::IsAction(), KICAD_MANAGER_FRAME::IsProjectActive(), m_frame, KICAD_MANAGER_ACTIONS::openTextEditor, TOOL_EVENT::Parameter(), PCB_CALCULATOR_EXE, PCBNEW_EXE, Pgm(), PL_EDITOR_EXE, KIWAY_HOLDER::Prj(), KICAD_MANAGER_ACTIONS::showCalculator, and KICAD_MANAGER_ACTIONS::viewGerbers.

Referenced by setTransitions().

◆ getEditFrame()

template<typename T >
T * TOOL_BASE::getEditFrame ( ) const
inlineprotectedinherited

Return the application window object, casted to requested user type.

Definition at line 185 of file tool_base.h.

186 {
187#if !defined( QA_TEST ) // Dynamic casts give the linker a seizure in the test framework
188 wxASSERT( dynamic_cast<T*>( getToolHolderInt() ) );
189#endif
190 return static_cast<T*>( getToolHolderInt() );
191 }
TOOLS_HOLDER * getToolHolderInt() const
Definition: tool_base.cpp:48

References TOOL_BASE::getToolHolderInt().

Referenced by ZONE_CREATE_HELPER::createNewZone(), and ZONE_CREATE_HELPER::setUniquePriority().

◆ GetId()

TOOL_ID TOOL_BASE::GetId ( ) const
inlineinherited

Return the unique identifier of the tool.

The identifier is set by an instance of TOOL_MANAGER.

Returns
Identifier of the tool.

Definition at line 121 of file tool_base.h.

122 {
123 return m_toolId;
124 }

References TOOL_BASE::m_toolId.

Referenced by TOOL_MANAGER::finishTool(), TOOL_MANAGER::InitTools(), TOOL_MANAGER::isActive(), TOOL_MANAGER::RegisterTool(), ACTION_MANAGER::RunHotKey(), TOOL_MANAGER::runTool(), TOOL_MANAGER::saveViewControls(), and TOOL_MANAGER::ShutdownTool().

◆ GetManager()

TOOL_MANAGER * TOOL_BASE::GetManager ( ) const
inlineinherited

◆ getModel()

template<typename T >
T * TOOL_BASE::getModel ( ) const
inlineprotectedinherited

Return the model object if it matches the requested type.

Store the type of the tool.

Definition at line 197 of file tool_base.h.

References TOOL_BASE::getModelInt().

Referenced by ZONE_CREATE_HELPER::commitZone(), and ZONE_CREATE_HELPER::createZoneFromExisting().

◆ getModelInt()

EDA_ITEM * TOOL_BASE::getModelInt ( ) const
privateinherited

Definition at line 54 of file tool_base.cpp.

55{
56 return m_toolMgr->GetModel();
57}
EDA_ITEM * GetModel() const
Definition: tool_manager.h:292

References TOOL_MANAGER::GetModel(), and TOOL_BASE::m_toolMgr.

Referenced by TOOL_BASE::getModel().

◆ GetName()

const std::string & TOOL_BASE::GetName ( void  ) const
inlineinherited

Return the name of the tool.

Tool names are expected to obey the format: application.ToolName (eg. pcbnew.InteractiveSelection).

Returns
The name of the tool.

Definition at line 134 of file tool_base.h.

135 {
136 return m_toolName;
137 }
std::string m_toolName
Definition: tool_base.h:214

References TOOL_BASE::m_toolName.

Referenced by TOOL_MANAGER::dispatchInternal(), TOOL_MANAGER::InitTools(), TOOL_MANAGER::invokeTool(), TOOL_MANAGER::RegisterTool(), TOOL_MANAGER::runTool(), and TOOL_MANAGER::ShutdownTool().

◆ getToolHolderInt()

TOOLS_HOLDER * TOOL_BASE::getToolHolderInt ( ) const
privateinherited

Definition at line 48 of file tool_base.cpp.

49{
50 return m_toolMgr->GetToolHolder();
51}
TOOLS_HOLDER * GetToolHolder() const
Definition: tool_manager.h:296

References TOOL_MANAGER::GetToolHolder(), and TOOL_BASE::m_toolMgr.

Referenced by TOOL_BASE::getEditFrame().

◆ GetToolMenu()

◆ GetType()

TOOL_TYPE TOOL_BASE::GetType ( ) const
inlineinherited

Return the type of the tool.

Returns
The type of the tool.

Definition at line 109 of file tool_base.h.

110 {
111 return m_type;
112 }
TOOL_TYPE m_type
Unique identifier for the tool, assigned by a TOOL_MANAGER instance.
Definition: tool_base.h:207

References TOOL_BASE::m_type.

Referenced by TOOL_MANAGER::finishTool(), TOOL_MANAGER::InvokeTool(), TOOL_MANAGER::ResetTools(), TOOL_MANAGER::runTool(), and TOOL_MANAGER::ShutdownTool().

◆ getView()

KIGFX::VIEW * TOOL_BASE::getView ( ) const
protectedinherited

Returns the instance of #VIEW object used in the application.

It allows tools to draw.

Returns
The instance of VIEW.

Definition at line 36 of file tool_base.cpp.

37{
38 return m_toolMgr->GetView();
39}
KIGFX::VIEW * GetView() const
Definition: tool_manager.h:285

References TOOL_MANAGER::GetView(), and TOOL_BASE::m_toolMgr.

Referenced by EE_POINT_EDITOR::addCornerCondition(), ALIGN_DISTRIBUTE_TOOL::AlignLeft(), ALIGN_DISTRIBUTE_TOOL::AlignRight(), COMMON_TOOLS::CenterContents(), SCH_EDIT_TOOL::ChangeTextType(), EE_INSPECTION_TOOL::CheckSymbol(), GERBVIEW_CONTROL::ClearAllLayers(), PL_SELECTION_TOOL::ClearSelection(), EE_SELECTION_TOOL::ClearSelection(), EE_SELECTION_TOOL::CollectHits(), SCH_LINE_WIRE_BUS_TOOL::computeBreakPoint(), COMMON_TOOLS::CursorControl(), SCH_EDIT_TOOL::DeleteItemCursor(), PL_EDIT_TOOL::DeleteItemCursor(), PCB_CONTROL::DeleteItemCursor(), EDIT_TOOL::DeleteItems(), PL_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), SELECTION_TOOL::doSelectionMenu(), COMMON_TOOLS::doZoomFit(), COMMON_TOOLS::doZoomInOut(), COMMON_TOOLS::doZoomToPreset(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), SCH_LINE_WIRE_BUS_TOOL::DrawSegments(), PL_DRAWING_TOOLS::DrawShape(), DRAWING_TOOL::drawShape(), DRAWING_TOOL::DrawZone(), BOARD_EDITOR_CONTROL::DrillOrigin(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), PAD_TOOL::EnumeratePads(), EE_SELECTION_TOOL::GetNode(), ROUTER_TOOL::getStartLayer(), PCB_CONTROL::GridResetOrigin(), PCB_CONTROL::GridSetOrigin(), EE_SELECTION_TOOL::GuessSelectionCandidates(), PCB_SELECTION_TOOL::GuessSelectionCandidates(), ROUTER_TOOL::handleCommonEvents(), EE_SELECTION_TOOL::highlight(), PL_SELECTION_TOOL::highlight(), PCB_SELECTION_TOOL::highlight(), GERBVIEW_CONTROL::HighlightControl(), BOARD_INSPECTION_TOOL::highlightNet(), PNS::TOOL_BASE::highlightNets(), PCB_SELECTION_TOOL::hitTestDistance(), SCH_EDIT_TOOL::Init(), EDIT_TOOL::Init(), ROUTER_TOOL::InlineDrag(), EE_POINT_EDITOR::Main(), SCH_MOVE_TOOL::Main(), PL_POINT_EDITOR::Main(), PCB_PICKER_TOOL::Main(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), PL_EDIT_TOOL::moveItem(), COMMON_TOOLS::OnGridChanged(), PCB_POINT_EDITOR::OnSelectionChange(), COMMON_TOOLS::PanControl(), SCH_EDITOR_CONTROL::Paste(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), PL_EDIT_TOOL::Paste(), ROUTER_TOOL::performRouting(), PNS::TOOL_BASE::pickSingleItem(), BOARD_EDITOR_CONTROL::PlaceFootprint(), DRAWING_TOOL::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), DRAWING_TOOL::PlaceText(), ROUTER_TOOL::prepareInteractive(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), EE_SELECTION_TOOL::Reset(), EE_TOOL_BASE< T >::Reset(), GERBVIEW_SELECTION_TOOL::Reset(), PNS::TOOL_BASE::Reset(), BOARD_EDITOR_CONTROL::Reset(), DRAWING_TOOL::Reset(), PCB_CONTROL::Reset(), PCB_SELECTION_TOOL::Reset(), SCH_EDIT_TOOL::Rotate(), GERBVIEW_SELECTION_TOOL::select(), PCB_SELECTION_TOOL::Selectable(), EE_SELECTION_TOOL::SelectAll(), PCB_SELECTION_TOOL::SelectAll(), EE_SELECTION_TOOL::selectionContains(), PL_SELECTION_TOOL::selectionContains(), PCB_SELECTION_TOOL::selectionContains(), EE_SELECTION_TOOL::selectMultiple(), PL_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectMultiple(), PL_SELECTION_TOOL::SelectPoint(), EE_SELECTION_TOOL::selectPoint(), ZOOM_TOOL::selectRegion(), GERBVIEW_SELECTION_TOOL::selectVisually(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_EDITOR_CONTROL::ToggleERCErrors(), SCH_EDITOR_CONTROL::ToggleERCExclusions(), SCH_EDITOR_CONTROL::ToggleERCWarnings(), SCH_EDITOR_CONTROL::ToggleHiddenFields(), SCH_EDITOR_CONTROL::ToggleHiddenPins(), SCH_EDITOR_CONTROL::ToggleOPCurrents(), SCH_EDITOR_CONTROL::ToggleOPVoltages(), SCH_DRAWING_TOOLS::TwoClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), EE_SELECTION_TOOL::unhighlight(), PL_SELECTION_TOOL::unhighlight(), PCB_SELECTION_TOOL::unhighlight(), GERBVIEW_SELECTION_TOOL::unselect(), GERBVIEW_SELECTION_TOOL::unselectVisually(), EE_POINT_EDITOR::updateEditedPoint(), PL_POINT_EDITOR::updateEditedPoint(), PCB_POINT_EDITOR::updateEditedPoint(), SCH_FIND_REPLACE_TOOL::UpdateFind(), PL_POINT_EDITOR::updateItem(), PCB_POINT_EDITOR::updateItem(), EE_TOOL_BASE< T >::updateItem(), SCH_EDITOR_CONTROL::UpdateNetHighlighting(), EE_POINT_EDITOR::updatePoints(), PL_POINT_EDITOR::updatePoints(), PCB_POINT_EDITOR::updatePoints(), PCB_SELECTION_TOOL::updateSelection(), PNS::TOOL_BASE::updateStartItem(), PCB_SELECTION_TOOL::view(), PCB_TOOL_BASE::view(), PCB_VIEWER_TOOLS::view(), EE_SELECTION_TOOL::ZoomFitCrossProbeBBox(), PCB_SELECTION_TOOL::ZoomFitCrossProbeBBox(), PCB_SELECTION_TOOL::zoomFitSelection(), EE_SELECTION_TOOL::~EE_SELECTION_TOOL(), GERBVIEW_SELECTION_TOOL::~GERBVIEW_SELECTION_TOOL(), and PCB_SELECTION_TOOL::~PCB_SELECTION_TOOL().

◆ getViewControls()

KIGFX::VIEW_CONTROLS * TOOL_BASE::getViewControls ( ) const
protectedinherited

Return the instance of VIEW_CONTROLS object used in the application.

It allows tools to read & modify user input and its settings (eg. show cursor, enable snapping to grid, etc.).

Returns
The instance of VIEW_CONTROLS.

Definition at line 42 of file tool_base.cpp.

43{
44 return m_toolMgr->GetViewControls();
45}
KIGFX::VIEW_CONTROLS * GetViewControls() const
Definition: tool_manager.h:287

References TOOL_MANAGER::GetViewControls(), and TOOL_BASE::m_toolMgr.

Referenced by EE_POINT_EDITOR::addCorner(), PCB_POINT_EDITOR::addCorner(), EE_POINT_EDITOR::addCornerCondition(), EE_SELECTION_TOOL::autostartEvent(), SCH_EDIT_TOOL::BreakWire(), PCB_SELECTION_TOOL::controls(), PCB_TOOL_BASE::controls(), EDIT_TOOL::copyToClipboard(), COMMON_TOOLS::CursorControl(), EDIT_TOOL::DeleteItems(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), EDIT_TOOL::doMoveSelection(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), COMMON_TOOLS::doZoomToPreset(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawLine(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::DrawRectangle(), SCH_DRAWING_TOOLS::DrawShape(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), PAD_TOOL::EnumeratePads(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), SCH_EDITOR_CONTROL::HighlightNet(), BOARD_INSPECTION_TOOL::HighlightNet(), FOOTPRINT_EDITOR_CONTROL::ImportFootprint(), SCH_EDIT_TOOL::Init(), EDIT_TOOL::Init(), EE_POINT_EDITOR::Main(), EE_SELECTION_TOOL::Main(), SCH_MOVE_TOOL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), PICKER_TOOL::Main(), PL_EDIT_TOOL::Main(), PL_POINT_EDITOR::Main(), PCB_PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), COMMON_TOOLS::OnGridChanged(), PCB_POINT_EDITOR::OnSelectionChange(), SCH_EDITOR_CONTROL::Paste(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), ROUTER_TOOL::performDragging(), LENGTH_TUNER_TOOL::performTuning(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), PCB_CONTROL::placeBoardItems(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImage(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), SCH_EDIT_TOOL::RepeatDrawItem(), PL_SELECTION_TOOL::RequestSelection(), EE_SELECTION_TOOL::RequestSelection(), DRAWING_TOOL::Reset(), PCB_POINT_EDITOR::Reset(), COMMON_TOOLS::ResetLocalCoords(), ROUTER_TOOL::RouteSelected(), PCB_SELECTION_TOOL::selectCursor(), EE_SELECTION_TOOL::selectMultiple(), PL_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::SelectNode(), ZOOM_TOOL::selectRegion(), ALIGN_DISTRIBUTE_TOOL::selectTarget(), PICKER_TOOL::setControls(), PCB_PICKER_TOOL::setControls(), EE_POINT_EDITOR::setEditedPoint(), PL_POINT_EDITOR::setEditedPoint(), PCB_POINT_EDITOR::setEditedPoint(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), EE_POINT_EDITOR::updateEditedPoint(), PL_POINT_EDITOR::updateEditedPoint(), PCB_POINT_EDITOR::updateEditedPoint(), PCB_POINT_EDITOR::updateItem(), PL_EDIT_TOOL::updateModificationPoint(), and COMMON_TOOLS::ZoomCenter().

◆ Go()

template<class T >
void TOOL_INTERACTIVE::Go ( int(T::*)(const TOOL_EVENT &)  aStateFunc,
const TOOL_EVENT_LIST aConditions = TOOL_EVENTTC_ANYTA_ANY ) 
)
inherited

Define which state (aStateFunc) to go when a certain event arrives (aConditions).

No conditions means any event.

Definition at line 147 of file tool_interactive.h.

149{
150 TOOL_STATE_FUNC sptr = std::bind( aStateFunc, static_cast<T*>( this ), std::placeholders::_1 );
151
152 goInternal( sptr, aConditions );
153}
void goInternal(TOOL_STATE_FUNC &aState, const TOOL_EVENT_LIST &aConditions)
std::function< int(const TOOL_EVENT &)> TOOL_STATE_FUNC
Definition: tool_base.h:58

References TOOL_INTERACTIVE::goInternal().

Referenced by EDA_3D_CONTROLLER::setTransitions(), CVPCB_ASSOCIATION_TOOL::setTransitions(), CVPCB_CONTROL::setTransitions(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::setTransitions(), EE_INSPECTION_TOOL::setTransitions(), EE_POINT_EDITOR::setTransitions(), EE_SELECTION_TOOL::setTransitions(), SCH_DRAWING_TOOLS::setTransitions(), SCH_EDIT_TOOL::setTransitions(), SCH_EDITOR_CONTROL::setTransitions(), SCH_FIND_REPLACE_TOOL::setTransitions(), SCH_LINE_WIRE_BUS_TOOL::setTransitions(), SCH_MOVE_TOOL::setTransitions(), SCH_NAVIGATE_TOOL::setTransitions(), SIMULATOR_CONTROL::setTransitions(), SYMBOL_EDITOR_CONTROL::setTransitions(), SYMBOL_EDITOR_DRAWING_TOOLS::setTransitions(), SYMBOL_EDITOR_EDIT_TOOL::setTransitions(), SYMBOL_EDITOR_MOVE_TOOL::setTransitions(), SYMBOL_EDITOR_PIN_TOOL::setTransitions(), GERBVIEW_CONTROL::setTransitions(), GERBVIEW_INSPECTION_TOOL::setTransitions(), GERBVIEW_SELECTION_TOOL::setTransitions(), COMMON_CONTROL::setTransitions(), COMMON_TOOLS::setTransitions(), PICKER_TOOL::setTransitions(), ZOOM_TOOL::setTransitions(), setTransitions(), PL_DRAWING_TOOLS::setTransitions(), PL_EDIT_TOOL::setTransitions(), PL_EDITOR_CONTROL::setTransitions(), PL_POINT_EDITOR::setTransitions(), PL_SELECTION_TOOL::setTransitions(), AUTOPLACE_TOOL::setTransitions(), MICROWAVE_TOOL::setTransitions(), SCRIPTING_TOOL::setTransitions(), LENGTH_TUNER_TOOL::setTransitions(), ROUTER_TOOL::setTransitions(), BOARD_EDITOR_CONTROL::setTransitions(), BOARD_INSPECTION_TOOL::setTransitions(), BOARD_REANNOTATE_TOOL::setTransitions(), CONVERT_TOOL::setTransitions(), DRAWING_TOOL::setTransitions(), DRC_TOOL::setTransitions(), EDIT_TOOL::setTransitions(), FOOTPRINT_EDITOR_CONTROL::setTransitions(), GLOBAL_EDIT_TOOL::setTransitions(), GROUP_TOOL::setTransitions(), PAD_TOOL::setTransitions(), PCB_CONTROL::setTransitions(), PCB_PICKER_TOOL::setTransitions(), PCB_POINT_EDITOR::setTransitions(), PCB_SELECTION_TOOL::setTransitions(), PCB_VIEWER_TOOLS::setTransitions(), ALIGN_DISTRIBUTE_TOOL::setTransitions(), POSITION_RELATIVE_TOOL::setTransitions(), PROPERTIES_TOOL::setTransitions(), and ZONE_FILLER_TOOL::setTransitions().

◆ goInternal()

void TOOL_INTERACTIVE::goInternal ( TOOL_STATE_FUNC aState,
const TOOL_EVENT_LIST aConditions 
)
privateinherited

Definition at line 70 of file tool_interactive.cpp.

71{
72 m_toolMgr->ScheduleNextState( this, aState, aConditions );
73}
void ScheduleNextState(TOOL_BASE *aTool, TOOL_STATE_FUNC &aHandler, const TOOL_EVENT_LIST &aConditions)
Define a state transition.

References TOOL_BASE::m_toolMgr, and TOOL_MANAGER::ScheduleNextState().

Referenced by TOOL_INTERACTIVE::Go().

◆ ImportNonKicadProj()

int KICAD_MANAGER_CONTROL::ImportNonKicadProj ( const TOOL_EVENT aEvent)

Imports a non kicad project from a sch/pcb dropped file.

No error is displayed if the project can not be imported.

Definition at line 346 of file kicad_manager_control.cpp.

347{
348 if( !aEvent.Parameter<wxString*>() )
349 return -1;
350
351 wxFileName droppedFileName( *aEvent.Parameter<wxString*>() );
352
353 wxString schFileExtension, pcbFileExtension;
354 int schFileType, pcbFileType;
355
356 // Define extensions to use according to dropped file.
357 // Eagle project.
358 if( droppedFileName.GetExt() == EagleSchematicFileExtension
359 || droppedFileName.GetExt() == EaglePcbFileExtension )
360 {
361 // Check if droppedFile is an eagle file.
362 // If not, return and do not import files.
363 if( !IsFileFromEDATool( droppedFileName, EDA_TOOLS::EAGLE ) )
364 return -1;
365
366 schFileExtension = EagleSchematicFileExtension;
367 pcbFileExtension = EaglePcbFileExtension;
368 schFileType = SCH_IO_MGR::SCH_EAGLE;
369 pcbFileType = IO_MGR::EAGLE;
370 }
371 // Cadstar project.
372 else if( droppedFileName.GetExt() == CadstarSchematicFileExtension
373 || droppedFileName.GetExt() == CadstarPcbFileExtension )
374 {
375 schFileExtension = CadstarSchematicFileExtension;
376 pcbFileExtension = CadstarPcbFileExtension;
377 schFileType = SCH_IO_MGR::SCH_CADSTAR_ARCHIVE;
378 pcbFileType = IO_MGR::CADSTAR_PCB_ARCHIVE;
379 }
380 else
381 {
382 return -1;
383 }
384
385 IMPORT_PROJ_HELPER importProj( m_frame, droppedFileName.GetFullPath(), schFileExtension,
386 pcbFileExtension );
387
388 // Check if the project directory is empty
389 wxDir directory( importProj.GetProjPath() );
390
391 if( directory.HasFiles() )
392 {
393 // Append a new directory with the same name of the project file
394 // Keep iterating until we find an empty directory
395 importProj.CreateEmptyDirForProject();
396
397 if( !wxMkdir( importProj.GetProjPath() ) )
398 return -1;
399 }
400
401 importProj.SetProjAbsolutePath();
402
403 if( !importProj.CopyImportedFiles( false ) )
404 {
405 wxRmdir( importProj.GetProjPath() ); // Remove the previous created directory, before leaving.
406 return -1;
407 }
408
409 m_frame->CloseProject( true );
410
411 m_frame->CreateNewProject( importProj.GetProjFullPath(), false /* Don't create stub files */ );
412 m_frame->LoadProject( importProj.GetProj() );
413
414 importProj.AssociateFilesWithProj( schFileType, pcbFileType );
416 m_frame->LoadProject( importProj.GetProj() );
417 return 0;
418}
A helper class to import non Kicad project.
Definition: import_proj.h:12
@ EAGLE
Definition: io_mgr.h:57
@ CADSTAR_PCB_ARCHIVE
Definition: io_mgr.h:63
void CreateNewProject(const wxFileName &aProjectFileName, bool aCreateStubFiles=true)
Creates a new project by setting up and initial project, schematic, and board files.
void LoadProject(const wxFileName &aProjectFileName)
bool IsFileFromEDATool(const wxFileName &aFileName, const EDA_TOOLS aTool)
Check if aFileName is a aTool file As an example, can be used to check if a .sch file is an EAGLE fil...
Definition: eda_tools.cpp:29
const std::string CadstarPcbFileExtension
const std::string EagleSchematicFileExtension
const std::string EaglePcbFileExtension
const std::string CadstarSchematicFileExtension

References IMPORT_PROJ_HELPER::AssociateFilesWithProj(), IO_MGR::CADSTAR_PCB_ARCHIVE, CadstarPcbFileExtension, CadstarSchematicFileExtension, KICAD_MANAGER_FRAME::CloseProject(), IMPORT_PROJ_HELPER::CopyImportedFiles(), IMPORT_PROJ_HELPER::CreateEmptyDirForProject(), KICAD_MANAGER_FRAME::CreateNewProject(), directory, EAGLE, IO_MGR::EAGLE, EaglePcbFileExtension, EagleSchematicFileExtension, IMPORT_PROJ_HELPER::GetProj(), IMPORT_PROJ_HELPER::GetProjFullPath(), IMPORT_PROJ_HELPER::GetProjPath(), IsFileFromEDATool(), KICAD_MANAGER_FRAME::LoadProject(), m_frame, TOOL_EVENT::Parameter(), KICAD_MANAGER_FRAME::ReCreateTreePrj(), and IMPORT_PROJ_HELPER::SetProjAbsolutePath().

Referenced by setTransitions().

◆ Init()

◆ IsToolActive()

bool TOOL_BASE::IsToolActive ( ) const
inherited

Definition at line 31 of file tool_base.cpp.

32{
34}
bool IsToolActive(TOOL_ID aId) const
Return true if a tool with given id is active (executing)

References TOOL_MANAGER::IsToolActive(), TOOL_BASE::m_toolId, and TOOL_BASE::m_toolMgr.

Referenced by EDIT_TOOL::Drag(), ROUTER_TOOL::handleLayerSwitch(), PCB_SELECTION_TOOL::Main(), BOARD_EDITOR_CONTROL::TrackWidthDec(), and BOARD_EDITOR_CONTROL::TrackWidthInc().

◆ LoadProject()

int KICAD_MANAGER_CONTROL::LoadProject ( const TOOL_EVENT aEvent)

Definition at line 420 of file kicad_manager_control.cpp.

421{
422 if( aEvent.Parameter<wxString*>() )
423 m_frame->LoadProject( wxFileName( *aEvent.Parameter<wxString*>() ) );
424 return 0;
425}

References KICAD_MANAGER_FRAME::LoadProject(), m_frame, and TOOL_EVENT::Parameter().

Referenced by setTransitions().

◆ NewFromTemplate()

int KICAD_MANAGER_CONTROL::NewFromTemplate ( const TOOL_EVENT aEvent)

Definition at line 142 of file kicad_manager_control.cpp.

143{
145
146 wxFileName templatePath;
147
148 // KiCad system template path.
149 ENV_VAR_MAP_CITER it = Pgm().GetLocalEnvVariables().find( "KICAD7_TEMPLATE_DIR" );
150
151 if( it != Pgm().GetLocalEnvVariables().end() && it->second.GetValue() != wxEmptyString )
152 {
153 templatePath.AssignDir( it->second.GetValue() );
154 ps->AddTemplatesPage( _( "System Templates" ), templatePath );
155 }
156
157 // User template path.
158 it = Pgm().GetLocalEnvVariables().find( "KICAD_USER_TEMPLATE_DIR" );
159
160 if( it != Pgm().GetLocalEnvVariables().end() && it->second.GetValue() != wxEmptyString )
161 {
162 templatePath.AssignDir( it->second.GetValue() );
163 ps->AddTemplatesPage( _( "User Templates" ), templatePath );
164 }
165
166 // Show the project template selector dialog
167 if( ps->ShowModal() != wxID_OK )
168 return -1;
169
170 if( !ps->GetSelectedTemplate() )
171 {
172 wxMessageBox( _( "No project template was selected. Cannot generate new project." ),
173 _( "Error" ), wxOK | wxICON_ERROR, m_frame );
174
175 return -1;
176 }
177
178 // Get project destination folder and project file name.
179 wxString default_dir = wxFileName( Prj().GetProjectFullName() ).GetPathWithSep();
180 wxString title = _( "New Project Folder" );
181 wxFileDialog dlg( m_frame, title, default_dir, wxEmptyString, ProjectFileWildcard(),
182 wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
183
184 // Add a "Create a new directory" checkbox
185#if wxCHECK_VERSION( 3, 1, 7 )
186 FILEDLG_NEW_PROJECT newProjectHook;
187 dlg.SetCustomizeHook( newProjectHook );
188#else
189 dlg.SetExtraControlCreator( &LEGACYFILEDLG_NEW_PROJECT::Create );
190#endif
191
192
193 if( dlg.ShowModal() == wxID_CANCEL )
194 return -1;
195
196 wxFileName fn( dlg.GetPath() );
197
198 // wxFileName automatically extracts an extension. But if it isn't a .kicad_pro extension,
199 // we should keep it as part of the filename
200 if( !fn.GetExt().IsEmpty() && fn.GetExt().ToStdString() != ProjectFileExtension )
201 fn.SetName( fn.GetName() + wxT( "." ) + fn.GetExt() );
202
203 fn.SetExt( ProjectFileExtension );
204
205 if( !fn.IsAbsolute() )
206 fn.MakeAbsolute();
207
208 bool createNewDir = false;
209#if wxCHECK_VERSION( 3, 1, 7 )
210 createNewDir = newProjectHook.GetCreateNewDir();
211#else
212 createNewDir = static_cast<LEGACYFILEDLG_NEW_PROJECT*>( dlg.GetExtraControl() )->CreateNewDir();
213#endif
214
215 // Append a new directory with the same name of the project file.
216 if( createNewDir )
217 fn.AppendDir( fn.GetName() );
218
219 // Check if the project directory is empty if it already exists.
220
221 if( !fn.DirExists() )
222 {
223 if( !fn.Mkdir() )
224 {
225 wxString msg;
226 msg.Printf( _( "Folder '%s' could not be created.\n\n"
227 "Make sure you have write permissions and try again." ),
228 fn.GetPath() );
230 return -1;
231 }
232 }
233
234 if( !fn.IsDirWritable() )
235 {
236 wxString msg;
237
238 msg.Printf( _( "Insufficient permissions to write to folder '%s'." ), fn.GetPath() );
239 wxMessageDialog msgDlg( m_frame, msg, _( "Error" ), wxICON_ERROR | wxOK | wxCENTER );
240 msgDlg.ShowModal();
241 return -1;
242 }
243
244 // Make sure we are not overwriting anything in the destination folder.
245 std::vector< wxFileName > destFiles;
246
247 if( ps->GetSelectedTemplate()->GetDestinationFiles( fn, destFiles ) )
248 {
249 std::vector<wxFileName> overwrittenFiles;
250
251 for( const wxFileName& file : destFiles )
252 {
253 if( file.FileExists() )
254 overwrittenFiles.push_back( file );
255 }
256
257 if( !overwrittenFiles.empty() )
258 {
259 wxString extendedMsg = _( "Overwriting files:" ) + "\n";
260
261 for( const wxFileName& file : overwrittenFiles )
262 extendedMsg += "\n" + file.GetFullName();
263
264 KIDIALOG msgDlg( m_frame,
265 _( "Similar files already exist in the destination folder." ),
266 _( "Confirmation" ),
267 wxOK | wxCANCEL | wxICON_WARNING );
268 msgDlg.SetExtendedMessage( extendedMsg );
269 msgDlg.SetOKLabel( _( "Overwrite" ) );
270 msgDlg.DoNotShowCheckbox( __FILE__, __LINE__ );
271
272 if( msgDlg.ShowModal() == wxID_CANCEL )
273 return -1;
274 }
275 }
276
277 wxString errorMsg;
278
279 // The selected template widget contains the template we're attempting to use to
280 // create a project
281 if( !ps->GetSelectedTemplate()->CreateProject( fn, &errorMsg ) )
282 {
283 wxMessageDialog createDlg( m_frame,
284 _( "A problem occurred creating new project from template." ),
285 _( "Error" ),
286 wxOK | wxICON_ERROR );
287
288 if( !errorMsg.empty() )
289 createDlg.SetExtendedMessage( errorMsg );
290
291 createDlg.ShowModal();
292 return -1;
293 }
294
295 m_frame->CreateNewProject( fn.GetFullPath() );
296 m_frame->LoadProject( fn );
297 return 0;
298}
void AddTemplatesPage(const wxString &aTitle, wxFileName &aPath)
Add a new page with aTitle, populated with templates from aPath.
PROJECT_TEMPLATE * GetSelectedTemplate()
bool GetCreateNewDir() const
Helper class to create more flexible dialogs, including 'do not show again' checkbox handling.
Definition: confirm.h:46
ā€¨Helper widget to select whether a new directory should be created for a project.
static wxWindow * Create(wxWindow *aParent)
size_t GetDestinationFiles(const wxFileName &aNewProjectPath, std::vector< wxFileName > &aDestFiles)
Fetch the list of destination files to be copied when the new project is created.
bool CreateProject(wxFileName &aNewProjectPath, wxString *aErrorMsg=nullptr)
Copies and renames all template files to create a new project.
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition: confirm.cpp:325
#define _(s)
const std::string ProjectFileExtension
wxString ProjectFileWildcard()
std::map< wxString, ENV_VAR_ITEM >::const_iterator ENV_VAR_MAP_CITER
PROJECT & Prj()
Definition: kicad.cpp:573

References _, DIALOG_TEMPLATE_SELECTOR::AddTemplatesPage(), LEGACYFILEDLG_NEW_PROJECT::Create(), KICAD_MANAGER_FRAME::CreateNewProject(), PROJECT_TEMPLATE::CreateProject(), DisplayErrorMessage(), KIDIALOG::DoNotShowCheckbox(), FILEDLG_NEW_PROJECT::GetCreateNewDir(), PROJECT_TEMPLATE::GetDestinationFiles(), DIALOG_TEMPLATE_SELECTOR::GetSelectedTemplate(), KICAD_MANAGER_FRAME::LoadProject(), m_frame, Pgm(), Prj(), ProjectFileExtension, ProjectFileWildcard(), and KIDIALOG::ShowModal().

Referenced by setTransitions().

◆ NewProject()

int KICAD_MANAGER_CONTROL::NewProject ( const TOOL_EVENT aEvent)

Definition at line 69 of file kicad_manager_control.cpp.

70{
71 wxString default_dir = m_frame->GetMruPath();
72 wxFileDialog dlg( m_frame, _( "Create New Project" ), default_dir, wxEmptyString,
73 ProjectFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
74
75 // Add a "Create a new directory" checkbox
76#if wxCHECK_VERSION( 3, 1, 7 )
77 FILEDLG_NEW_PROJECT newProjectHook;
78 dlg.SetCustomizeHook( newProjectHook );
79#else
80 dlg.SetExtraControlCreator( &LEGACYFILEDLG_NEW_PROJECT::Create );
81#endif
82
83 if( dlg.ShowModal() == wxID_CANCEL )
84 return -1;
85
86 wxFileName pro( dlg.GetPath() );
87
88 // wxFileName automatically extracts an extension. But if it isn't
89 // a .pro extension, we should keep it as part of the filename
90 if( !pro.GetExt().IsEmpty() && pro.GetExt().ToStdString() != ProjectFileExtension )
91 pro.SetName( pro.GetName() + wxT( "." ) + pro.GetExt() );
92
93 pro.SetExt( ProjectFileExtension ); // enforce extension
94
95 if( !pro.IsAbsolute() )
96 pro.MakeAbsolute();
97
98 // Append a new directory with the same name of the project file.
99 bool createNewDir = false;
100
101#if wxCHECK_VERSION( 3, 1, 7 )
102 createNewDir = newProjectHook.GetCreateNewDir();
103#else
104 createNewDir = static_cast<LEGACYFILEDLG_NEW_PROJECT*>( dlg.GetExtraControl() )->CreateNewDir();
105#endif
106
107 if( createNewDir )
108 pro.AppendDir( pro.GetName() );
109
110 // Check if the project directory is empty if it already exists.
111 wxDir directory( pro.GetPath() );
112
113 if( !pro.DirExists() )
114 {
115 if( !pro.Mkdir() )
116 {
117 wxString msg;
118 msg.Printf( _( "Folder '%s' could not be created.\n\n"
119 "Make sure you have write permissions and try again." ),
120 pro.GetPath() );
122 return -1;
123 }
124 }
125 else if( directory.HasFiles() )
126 {
127 wxString msg = _( "The selected folder is not empty. It is recommended that you "
128 "create projects in their own empty folder.\n\n"
129 "Do you want to continue?" );
130
131 if( !IsOK( m_frame, msg ) )
132 return -1;
133 }
134
136 m_frame->LoadProject( pro );
137
138 return 0;
139}
wxString GetMruPath() const
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
Definition: confirm.cpp:380

References _, LEGACYFILEDLG_NEW_PROJECT::Create(), KICAD_MANAGER_FRAME::CreateNewProject(), directory, DisplayErrorMessage(), FILEDLG_NEW_PROJECT::GetCreateNewDir(), EDA_BASE_FRAME::GetMruPath(), IsOK(), KICAD_MANAGER_FRAME::LoadProject(), m_frame, ProjectFileExtension, and ProjectFileWildcard().

Referenced by setTransitions().

◆ OpenDemoProject()

int KICAD_MANAGER_CONTROL::OpenDemoProject ( const TOOL_EVENT aEvent)

Definition at line 327 of file kicad_manager_control.cpp.

328{
330}
int openProject(const wxString &aDefaultDir)
static wxString GetStockDemosPath()
Gets the stock (install) demos path.
Definition: paths.cpp:310

References PATHS::GetStockDemosPath(), and openProject().

Referenced by setTransitions().

◆ OpenProject()

int KICAD_MANAGER_CONTROL::OpenProject ( const TOOL_EVENT aEvent)

Definition at line 333 of file kicad_manager_control.cpp.

334{
335 return openProject( m_frame->GetMruPath() );
336}

References EDA_BASE_FRAME::GetMruPath(), m_frame, and openProject().

Referenced by setTransitions().

◆ openProject()

int KICAD_MANAGER_CONTROL::openProject ( const wxString &  aDefaultDir)
private

Definition at line 301 of file kicad_manager_control.cpp.

302{
303 wxString wildcard = AllProjectFilesWildcard()
304 + "|" + ProjectFileWildcard()
306
307 wxFileDialog dlg( m_frame, _( "Open Existing Project" ), aDefaultDir, wxEmptyString, wildcard,
308 wxFD_OPEN | wxFD_FILE_MUST_EXIST );
309
310 if( dlg.ShowModal() == wxID_CANCEL )
311 return -1;
312
313 wxFileName pro( dlg.GetPath() );
314
315 if( !pro.IsAbsolute() )
316 pro.MakeAbsolute();
317
318 if( !pro.FileExists() )
319 return -1;
320
321 m_frame->LoadProject( pro );
322
323 return 0;
324}
wxString AllProjectFilesWildcard()
wxString LegacyProjectFileWildcard()

References _, AllProjectFilesWildcard(), LegacyProjectFileWildcard(), KICAD_MANAGER_FRAME::LoadProject(), m_frame, and ProjectFileWildcard().

Referenced by OpenDemoProject(), and OpenProject().

◆ Refresh()

int KICAD_MANAGER_CONTROL::Refresh ( const TOOL_EVENT aEvent)

Definition at line 704 of file kicad_manager_control.cpp.

705{
707 return 0;
708}

References m_frame, and KICAD_MANAGER_FRAME::RefreshProjectTree().

Referenced by setTransitions().

◆ Reset()

void KICAD_MANAGER_CONTROL::Reset ( RESET_REASON  aReason)
overridevirtual

Bring the tool to a known, initial state.

If the tool claimed anything from the model or the view, it must release it when its reset.

Parameters
aReasoncontains information about the reason of tool reset.

Implements TOOL_BASE.

Definition at line 63 of file kicad_manager_control.cpp.

64{
65 m_frame = getEditFrame<KICAD_MANAGER_FRAME>();
66}

References m_frame.

◆ resetTransitions()

void TOOL_INTERACTIVE::resetTransitions ( )
privateinherited

Clear the current transition map and restores the default one created by setTransitions().

Definition at line 63 of file tool_interactive.cpp.

64{
67}
virtual void setTransitions()=0
This method is meant to be overridden in order to specify handlers for events.
void ClearTransitions(TOOL_BASE *aTool)
Clear the state transition map for a tool.

References TOOL_MANAGER::ClearTransitions(), TOOL_BASE::m_toolMgr, and TOOL_INTERACTIVE::setTransitions().

◆ RunMainStack()

void TOOL_INTERACTIVE::RunMainStack ( std::function< void()>  aFunc)
inherited

Call a function using the main stack.

Parameters
aFuncis the function to be calls.

Definition at line 87 of file tool_interactive.cpp.

88{
89 m_toolMgr->RunMainStack( this, std::move( aFunc ) );
90}
void RunMainStack(TOOL_BASE *aTool, std::function< void()> aFunc)

References TOOL_BASE::m_toolMgr, and TOOL_MANAGER::RunMainStack().

Referenced by DRAWING_TOOL::PlaceText().

◆ SaveProjectAs()

int KICAD_MANAGER_CONTROL::SaveProjectAs ( const TOOL_EVENT aEvent)

Definition at line 625 of file kicad_manager_control.cpp.

626{
627 wxString msg;
628
629 wxFileName currentProjectFile( Prj().GetProjectFullName() );
630 wxString currentProjectDirPath = currentProjectFile.GetPath();
631 wxString currentProjectName = Prj().GetProjectName();
632
633 wxString default_dir = m_frame->GetMruPath();
634
635 Prj().GetProjectFile().SaveToFile( currentProjectDirPath );
636 Prj().GetLocalSettings().SaveToFile( currentProjectDirPath );
637
638 if( default_dir == currentProjectDirPath
639 || default_dir == currentProjectDirPath + wxFileName::GetPathSeparator() )
640 {
641 // Don't start within the current project
642 wxFileName default_dir_fn( default_dir );
643 default_dir_fn.RemoveLastDir();
644 default_dir = default_dir_fn.GetPath();
645 }
646
647 wxFileDialog dlg( m_frame, _( "Save Project To" ), default_dir, wxEmptyString, wxEmptyString,
648 wxFD_SAVE );
649
650 if( dlg.ShowModal() == wxID_CANCEL )
651 return -1;
652
653 wxFileName newProjectDir( dlg.GetPath(), wxEmptyString );
654
655 if( !newProjectDir.IsAbsolute() )
656 newProjectDir.MakeAbsolute();
657
658 if( wxDirExists( newProjectDir.GetFullPath() ) )
659 {
660 msg.Printf( _( "'%s' already exists." ), newProjectDir.GetFullPath() );
662 return -1;
663 }
664
665 if( !wxMkdir( newProjectDir.GetFullPath() ) )
666 {
667 msg.Printf( _( "Folder '%s' could not be created.\n\n"
668 "Please make sure you have write permissions and try again." ),
669 newProjectDir.GetPath() );
671 return -1;
672 }
673
674 if( !newProjectDir.IsDirWritable() )
675 {
676 msg.Printf( _( "Insufficient permissions to write to folder '%s'." ),
677 newProjectDir.GetFullPath() );
678 wxMessageDialog msgDlg( m_frame, msg, _( "Error!" ), wxICON_ERROR | wxOK | wxCENTER );
679 msgDlg.ShowModal();
680 return -1;
681 }
682
683 const wxString& newProjectDirPath = newProjectDir.GetFullPath();
684 const wxString& newProjectName = newProjectDir.GetDirs().Last();
685 wxDir currentProjectDir( currentProjectDirPath );
686
687 SAVE_AS_TRAVERSER traverser( m_frame, currentProjectDirPath, currentProjectName,
688 newProjectDirPath, newProjectName );
689
690 currentProjectDir.Traverse( traverser );
691
692 if( !traverser.GetErrors().empty() )
693 DisplayErrorMessage( m_frame, traverser.GetErrors() );
694
695 if( !traverser.GetNewProjectFile().FileExists() )
696 m_frame->CreateNewProject( traverser.GetNewProjectFile() );
697
698 m_frame->LoadProject( traverser.GetNewProjectFile() );
699
700 return 0;
701}
bool SaveToFile(const wxString &aDirectory="", bool aForce=false) override
bool SaveToFile(const wxString &aDirectory="", bool aForce=false) override
virtual const wxString GetProjectName() const
Return the short name of the project.
Definition: project.cpp:132
virtual PROJECT_LOCAL_SETTINGS & GetLocalSettings() const
Definition: project.h:155
virtual PROJECT_FILE & GetProjectFile() const
Definition: project.h:149

References _, KICAD_MANAGER_FRAME::CreateNewProject(), DisplayErrorMessage(), SAVE_AS_TRAVERSER::GetErrors(), PROJECT::GetLocalSettings(), EDA_BASE_FRAME::GetMruPath(), SAVE_AS_TRAVERSER::GetNewProjectFile(), PROJECT::GetProjectFile(), PROJECT::GetProjectName(), KICAD_MANAGER_FRAME::LoadProject(), m_frame, Prj(), PROJECT_FILE::SaveToFile(), and PROJECT_LOCAL_SETTINGS::SaveToFile().

Referenced by setTransitions().

◆ SetContextMenu()

void TOOL_INTERACTIVE::SetContextMenu ( ACTION_MENU aMenu,
CONTEXT_MENU_TRIGGER  aTrigger = CMENU_BUTTON 
)
inherited

Assign a context menu and tells when it should be activated.

Parameters
aMenuis the menu to be assigned.
aTriggerdetermines conditions upon which the context menu is activated.

Definition at line 76 of file tool_interactive.cpp.

77{
78 if( aMenu )
79 aMenu->SetTool( this );
80 else
81 aTrigger = CMENU_OFF;
82
83 m_toolMgr->ScheduleContextMenu( this, aMenu, aTrigger );
84}
void SetTool(TOOL_INTERACTIVE *aTool)
Set a tool that is the creator of the menu.
void ScheduleContextMenu(TOOL_BASE *aTool, ACTION_MENU *aMenu, CONTEXT_MENU_TRIGGER aTrigger)
Set behavior of the tool's context popup menu.
@ CMENU_OFF
Definition: tool_event.h:149

References CMENU_OFF, TOOL_BASE::m_toolMgr, TOOL_MANAGER::ScheduleContextMenu(), and ACTION_MENU::SetTool().

Referenced by SELECTION_TOOL::doSelectionMenu(), TOOL_MENU::ShowContextMenu(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

◆ setTransitions()

void KICAD_MANAGER_CONTROL::setTransitions ( )
overridevirtual

This method is meant to be overridden in order to specify handlers for events.

It is called every time tool is reset or finished.

Implements TOOL_INTERACTIVE.

Definition at line 949 of file kicad_manager_control.cpp.

950{
960
963
973
976
978}
static TOOL_ACTION zoomRedraw
Definition: actions.h:93
static TOOL_ACTION saveAs
Definition: actions.h:52
static TOOL_ACTION updateMenu
Definition: actions.h:172
static TOOL_ACTION viewDroppedGerbers
static TOOL_ACTION openDemoProject
static TOOL_ACTION editPCB
static TOOL_ACTION loadProject
static TOOL_ACTION newProject
static TOOL_ACTION editSchematic
static TOOL_ACTION openProject
static TOOL_ACTION closeProject
static TOOL_ACTION editFootprints
static TOOL_ACTION showPluginManager
static TOOL_ACTION importNonKicadProj
static TOOL_ACTION newFromTemplate
static TOOL_ACTION editSymbols
int OpenProject(const TOOL_EVENT &aEvent)
int OpenDemoProject(const TOOL_EVENT &aEvent)
int CloseProject(const TOOL_EVENT &aEvent)
int SaveProjectAs(const TOOL_EVENT &aEvent)
int NewProject(const TOOL_EVENT &aEvent)
int ViewDroppedViewers(const TOOL_EVENT &aEvent)
int NewFromTemplate(const TOOL_EVENT &aEvent)
int ShowPluginManager(const TOOL_EVENT &aEvent)
Set up handlers for various events.
int UpdateMenu(const TOOL_EVENT &aEvent)
int ImportNonKicadProj(const TOOL_EVENT &aEvent)
Imports a non kicad project from a sch/pcb dropped file.
int LoadProject(const TOOL_EVENT &aEvent)
int ShowPlayer(const TOOL_EVENT &aEvent)
int Refresh(const TOOL_EVENT &aEvent)
int Execute(const TOOL_EVENT &aEvent)
void Go(int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
Define which state (aStateFunc) to go when a certain event arrives (aConditions).

References KICAD_MANAGER_ACTIONS::closeProject, CloseProject(), KICAD_MANAGER_ACTIONS::convertImage, KICAD_MANAGER_ACTIONS::editDrawingSheet, KICAD_MANAGER_ACTIONS::editFootprints, KICAD_MANAGER_ACTIONS::editOtherPCB, KICAD_MANAGER_ACTIONS::editOtherSch, KICAD_MANAGER_ACTIONS::editPCB, KICAD_MANAGER_ACTIONS::editSchematic, KICAD_MANAGER_ACTIONS::editSymbols, Execute(), TOOL_INTERACTIVE::Go(), KICAD_MANAGER_ACTIONS::importNonKicadProj, ImportNonKicadProj(), KICAD_MANAGER_ACTIONS::loadProject, LoadProject(), KICAD_MANAGER_ACTIONS::newFromTemplate, NewFromTemplate(), KICAD_MANAGER_ACTIONS::newProject, NewProject(), KICAD_MANAGER_ACTIONS::openDemoProject, OpenDemoProject(), KICAD_MANAGER_ACTIONS::openProject, OpenProject(), KICAD_MANAGER_ACTIONS::openTextEditor, Refresh(), ACTIONS::saveAs, SaveProjectAs(), KICAD_MANAGER_ACTIONS::showCalculator, ShowPlayer(), KICAD_MANAGER_ACTIONS::showPluginManager, ShowPluginManager(), ACTIONS::updateMenu, UpdateMenu(), KICAD_MANAGER_ACTIONS::viewDroppedGerbers, ViewDroppedViewers(), KICAD_MANAGER_ACTIONS::viewGerbers, and ACTIONS::zoomRedraw.

◆ ShowPlayer()

int KICAD_MANAGER_CONTROL::ShowPlayer ( const TOOL_EVENT aEvent)

Definition at line 727 of file kicad_manager_control.cpp.

728{
729 FRAME_T playerType = aEvent.Parameter<FRAME_T>();
730 KIWAY_PLAYER* player;
731
732 if( playerType == FRAME_SCH && !m_frame->IsProjectActive() )
733 {
734 DisplayInfoMessage( m_frame, _( "Create (or open) a project to edit a schematic." ),
735 wxEmptyString );
736 return -1;
737 }
738 else if( playerType == FRAME_PCB_EDITOR && !m_frame->IsProjectActive() )
739 {
740 DisplayInfoMessage( m_frame, _( "Create (or open) a project to edit a pcb." ),
741 wxEmptyString );
742 return -1;
743 }
744
745 // Prevent multiple KIWAY_PLAYER loading at one time
746 if( !m_loading.try_lock() )
747 return -1;
748
749 const std::lock_guard<std::mutex> lock( m_loading, std::adopt_lock );
750
751 try
752 {
753 player = m_frame->Kiway().Player( playerType, true );
754 }
755 catch( const IO_ERROR& err )
756 {
757 wxMessageBox( _( "Application failed to load:\n" ) + err.What(), _( "KiCad Error" ),
758 wxOK | wxICON_ERROR, m_frame );
759 return -1;
760 }
761
762 if ( !player )
763 {
764 wxMessageBox( _( "Application failed to load." ), _( "KiCad Error" ),
765 wxOK | wxICON_ERROR, m_frame );
766 return -1;
767 }
768
769 if( !player->IsVisible() ) // A hidden frame might not have the document loaded.
770 {
771 wxString filepath;
772
773 if( playerType == FRAME_SCH )
774 {
775 wxFileName kicad_schematic( m_frame->SchFileName() );
776 wxFileName legacy_schematic( m_frame->SchLegacyFileName() );
777
778 if( !legacy_schematic.FileExists() || kicad_schematic.FileExists() )
779 filepath = kicad_schematic.GetFullPath();
780 else
781 filepath = legacy_schematic.GetFullPath();
782 }
783 else if( playerType == FRAME_PCB_EDITOR )
784 {
785 wxFileName kicad_board( m_frame->PcbFileName() );
786 wxFileName legacy_board( m_frame->PcbLegacyFileName() );
787
788 if( !legacy_board.FileExists() || kicad_board.FileExists() )
789 filepath = kicad_board.GetFullPath();
790 else
791 filepath = legacy_board.GetFullPath();
792 }
793
794 if( !filepath.IsEmpty() )
795 {
796 if( !player->OpenProjectFiles( std::vector<wxString>( 1, filepath ) ) )
797 {
798 player->Destroy();
799 return -1;
800 }
801 }
802
803 wxBusyCursor busy;
804 player->Show( true );
805 }
806
807 // Needed on Windows, other platforms do not use it, but it creates no issue
808 if( player->IsIconized() )
809 player->Iconize( false );
810
811 player->Raise();
812
813 // Raising the window does not set the focus on Linux. This should work on
814 // any platform.
815 if( wxWindow::FindFocus() != player )
816 player->SetFocus();
817
818 return 0;
819}
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
Definition: ki_exception.h:76
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:30
const wxString SchLegacyFileName()
const wxString SchFileName()
const wxString PcbLegacyFileName()
const wxString PcbFileName()
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
Definition: kiway_holder.h:53
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
Definition: kiway_player.h:66
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:394
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo)
Display an informational message box with aMessage.
Definition: confirm.cpp:352
FRAME_T
The set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
Definition: frame_type.h:33
@ FRAME_PCB_EDITOR
Definition: frame_type.h:40
@ FRAME_SCH
Definition: frame_type.h:34

References _, DisplayInfoMessage(), FRAME_PCB_EDITOR, FRAME_SCH, KICAD_MANAGER_FRAME::IsProjectActive(), KIWAY_HOLDER::Kiway(), m_frame, m_loading, TOOL_EVENT::Parameter(), KICAD_MANAGER_FRAME::PcbFileName(), KICAD_MANAGER_FRAME::PcbLegacyFileName(), KIWAY::Player(), KICAD_MANAGER_FRAME::SchFileName(), KICAD_MANAGER_FRAME::SchLegacyFileName(), and IO_ERROR::What().

Referenced by setTransitions().

◆ ShowPluginManager()

int KICAD_MANAGER_CONTROL::ShowPluginManager ( const TOOL_EVENT aEvent)

Set up handlers for various events.

Definition at line 886 of file kicad_manager_control.cpp.

887{
890 {
891 // policy disables the plugin manager
892 return 0;
893 }
894
895 // For some reason, after a click or a double click the bitmap button calling
896 // PCM keeps the focus althougt the focus was not set to this button.
897 // This hack force removing the focus from this button
898 m_frame->SetFocus();
899 wxSafeYield();
900
901 DIALOG_PCM pcm( m_frame, m_frame->GetPcm() );
902 pcm.ShowModal();
903
904 const std::unordered_set<PCM_PACKAGE_TYPE>& changed = pcm.GetChangedPackageTypes();
905
906 if( changed.count( PCM_PACKAGE_TYPE::PT_PLUGIN ) )
907 {
908 std::string payload = "";
910 }
911
912 KICAD_SETTINGS* settings = Pgm().GetSettingsManager().GetAppSettings<KICAD_SETTINGS>();
913
914 if( changed.count( PCM_PACKAGE_TYPE::PT_LIBRARY )
915 && ( settings->m_PcmLibAutoAdd || settings->m_PcmLibAutoRemove ) )
916 {
917 // Reset project tables
919 Prj().SetElem( PROJECT::ELEM_FPTBL, nullptr );
920
921 KIWAY& kiway = m_frame->Kiway();
922
923 // Reset state containing global lib tables
924 KIFACE* kiface;
925
926 if( ( kiface = kiway.KiFACE( KIWAY::FACE_SCH, false ) ) )
927 kiface->Reset();
928
929 if( ( kiface = kiway.KiFACE( KIWAY::FACE_PCB, false ) ) )
930 kiface->Reset();
931
932 // Reload lib tables
933 std::string payload = "";
934
937 kiway.ExpressMail( FRAME_CVPCB, MAIL_RELOAD_LIB, payload );
940 }
941
942 if( changed.count( PCM_PACKAGE_TYPE::PT_COLORTHEME ) )
943 Pgm().GetSettingsManager().ReloadColorSettings();
944
945 return 0;
946}
Implementing pcm main dialog.
Definition: dialog_pcm.h:36
std::shared_ptr< PLUGIN_CONTENT_MANAGER > GetPcm()
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition: kiway.h:279
virtual KIFACE * KiFACE(FACE_T aFaceId, bool doLoad=true)
Return the KIFACE* given a FACE_T.
Definition: kiway.cpp:198
@ FACE_SCH
eeschema DSO
Definition: kiway.h:286
@ FACE_PCB
pcbnew DSO
Definition: kiway.h:287
virtual void ExpressMail(FRAME_T aDestination, MAIL_T aCommand, std::string &aPayload, wxWindow *aSource=nullptr)
Send aPayload to aDestination from aSource.
Definition: kiway.cpp:491
virtual void SetElem(ELEM_T aIndex, _ELEM *aElem)
Definition: project.cpp:294
@ ELEM_SYMBOL_LIB_TABLE
Definition: project.h:211
@ ELEM_FPTBL
Definition: project.h:206
return & kiface
Definition: cvpcb.cpp:112
@ FRAME_SCH_SYMBOL_EDITOR
Definition: frame_type.h:35
@ FRAME_FOOTPRINT_VIEWER
Definition: frame_type.h:42
@ FRAME_SCH_VIEWER
Definition: frame_type.h:36
@ FRAME_FOOTPRINT_EDITOR
Definition: frame_type.h:41
@ FRAME_CVPCB
Definition: frame_type.h:48
@ MAIL_RELOAD_PLUGINS
Definition: mail_type.h:56
@ MAIL_RELOAD_LIB
Definition: mail_type.h:55
STATE GetPolicyState(const wxString &aKey)
Definition: gtk/policy.cpp:25
@ PT_COLORTHEME
Definition: pcm_data.h:45
@ PT_PLUGIN
Definition: pcm_data.h:43
@ PT_LIBRARY
Definition: pcm_data.h:44
#define POLICY_KEY_PCM
Definition: policy_keys.h:29
Implement a participant in the KIWAY alchemy.
Definition: kiway.h:151

References KIPLATFORM::POLICY::DISABLED, PROJECT::ELEM_FPTBL, PROJECT::ELEM_SYMBOL_LIB_TABLE, KIWAY::ExpressMail(), KIWAY::FACE_PCB, KIWAY::FACE_SCH, FRAME_CVPCB, FRAME_FOOTPRINT_EDITOR, FRAME_FOOTPRINT_VIEWER, FRAME_PCB_EDITOR, FRAME_SCH_SYMBOL_EDITOR, FRAME_SCH_VIEWER, DIALOG_PCM::GetChangedPackageTypes(), KICAD_MANAGER_FRAME::GetPcm(), KIPLATFORM::POLICY::GetPolicyState(), kiface, KIWAY::KiFACE(), KIWAY_HOLDER::Kiway(), m_frame, KICAD_SETTINGS::m_PcmLibAutoAdd, KICAD_SETTINGS::m_PcmLibAutoRemove, MAIL_RELOAD_LIB, MAIL_RELOAD_PLUGINS, Pgm(), POLICY_KEY_PCM, Prj(), PT_COLORTHEME, PT_LIBRARY, PT_PLUGIN, and PROJECT::SetElem().

Referenced by setTransitions().

◆ UpdateMenu()

int KICAD_MANAGER_CONTROL::UpdateMenu ( const TOOL_EVENT aEvent)

Definition at line 711 of file kicad_manager_control.cpp.

712{
713 ACTION_MENU* actionMenu = aEvent.Parameter<ACTION_MENU*>();
714 CONDITIONAL_MENU* conditionalMenu = dynamic_cast<CONDITIONAL_MENU*>( actionMenu );
715 SELECTION dummySel;
716
717 if( conditionalMenu )
718 conditionalMenu->Evaluate( dummySel );
719
720 if( actionMenu )
721 actionMenu->UpdateAll();
722
723 return 0;
724}
Defines the structure of a menu based on ACTIONs.
Definition: action_menu.h:49
void UpdateAll()
Run update handlers for the menu and its submenus.

References TOOL_EVENT::Parameter(), and ACTION_MENU::UpdateAll().

Referenced by setTransitions().

◆ ViewDroppedViewers()

int KICAD_MANAGER_CONTROL::ViewDroppedViewers ( const TOOL_EVENT aEvent)

Definition at line 427 of file kicad_manager_control.cpp.

428{
429 if( aEvent.Parameter<wxString*>() )
430 wxExecute( *aEvent.Parameter<wxString*>(), wxEXEC_ASYNC );
431 return 0;
432}

References TOOL_EVENT::Parameter().

Referenced by setTransitions().

◆ Wait()

TOOL_EVENT * TOOL_INTERACTIVE::Wait ( const TOOL_EVENT_LIST aEventList = TOOL_EVENTTC_ANYTA_ANY ))
inherited

Suspend execution of the tool until an event specified in aEventList arrives.

No parameters means waiting for any event.

Definition at line 57 of file tool_interactive.cpp.

58{
59 return m_toolMgr->ScheduleWait( this, aEventList );
60}
TOOL_EVENT * ScheduleWait(TOOL_BASE *aTool, const TOOL_EVENT_LIST &aConditions)
Pause execution of a given tool until one or more events matching aConditions arrives.

References TOOL_BASE::m_toolMgr, and TOOL_MANAGER::ScheduleWait().

Referenced by SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), SELECTION_TOOL::doSelectionMenu(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), SCH_DRAWING_TOOLS::DrawShape(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), DRAWING_TOOL::drawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EnumeratePads(), ROUTER_TOOL::InlineDrag(), DRAWING_TOOL::InteractivePlaceWithPreview(), EDA_3D_CONTROLLER::Main(), CVPCB_CONTROL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), EE_POINT_EDITOR::Main(), EE_SELECTION_TOOL::Main(), SCH_MOVE_TOOL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), PICKER_TOOL::Main(), ZOOM_TOOL::Main(), PL_EDIT_TOOL::Main(), PL_POINT_EDITOR::Main(), PL_SELECTION_TOOL::Main(), PCB_PICKER_TOOL::Main(), PCB_SELECTION_TOOL::Main(), LENGTH_TUNER_TOOL::MainLoop(), ROUTER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), PCB_POINT_EDITOR::OnSelectionChange(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), EDIT_TOOL::pickReferencePoint(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), DRAWING_TOOL::PlaceText(), EE_SELECTION_TOOL::selectMultiple(), PL_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectPoint(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), ZOOM_TOOL::selectRegion(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

Member Data Documentation

◆ m_frame

KICAD_MANAGER_FRAME* KICAD_MANAGER_CONTROL::m_frame
private

◆ m_loading

std::mutex KICAD_MANAGER_CONTROL::m_loading
private

Definition at line 79 of file kicad_manager_control.h.

Referenced by ShowPlayer().

◆ m_menu

TOOL_MENU TOOL_INTERACTIVE::m_menu
protectedinherited

The functions below are not yet implemented - their interface may change.

Definition at line 125 of file tool_interactive.h.

Referenced by SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), SCH_DRAWING_TOOLS::DrawShape(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), DRAWING_TOOL::drawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EnumeratePads(), TOOL_INTERACTIVE::GetToolMenu(), EDA_3D_CONTROLLER::Init(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Init(), EE_SELECTION_TOOL::Init(), EE_TOOL_BASE< T >::Init(), SCH_DRAWING_TOOLS::Init(), SCH_EDIT_TOOL::Init(), SCH_LINE_WIRE_BUS_TOOL::Init(), SYMBOL_EDITOR_CONTROL::Init(), SYMBOL_EDITOR_DRAWING_TOOLS::Init(), GERBVIEW_SELECTION_TOOL::Init(), PICKER_TOOL::Init(), ZOOM_TOOL::Init(), PL_DRAWING_TOOLS::Init(), PL_EDIT_TOOL::Init(), PL_SELECTION_TOOL::Init(), LENGTH_TUNER_TOOL::Init(), ROUTER_TOOL::Init(), BOARD_EDITOR_CONTROL::Init(), DRAWING_TOOL::Init(), FOOTPRINT_EDITOR_CONTROL::Init(), PAD_TOOL::Init(), PCB_SELECTION_TOOL::Init(), PCB_TOOL_BASE::Init(), PCB_VIEWER_TOOLS::Init(), DRAWING_TOOL::InteractivePlaceWithPreview(), EDA_3D_CONTROLLER::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), SCH_MOVE_TOOL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), PICKER_TOOL::Main(), ZOOM_TOOL::Main(), PL_EDIT_TOOL::Main(), PL_SELECTION_TOOL::Main(), PCB_PICKER_TOOL::Main(), PCB_SELECTION_TOOL::Main(), LENGTH_TUNER_TOOL::MainLoop(), ROUTER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), DRAWING_TOOL::PlaceText(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace().

◆ m_toolId

TOOL_ID TOOL_BASE::m_toolId
protectedinherited

Name of the tool.

Names are expected to obey the format application.ToolName (eg. pcbnew.InteractiveSelection).

Definition at line 210 of file tool_base.h.

Referenced by TOOL_INTERACTIVE::Activate(), TOOL_BASE::GetId(), and TOOL_BASE::IsToolActive().

◆ m_toolMgr

TOOL_MANAGER* TOOL_BASE::m_toolMgr
protectedinherited

Definition at line 215 of file tool_base.h.

Referenced by TOOL_INTERACTIVE::Activate(), SELECTION_TOOL::AddItemsToSel(), SELECTION_TOOL::AddItemToSel(), SCH_MOVE_TOOL::AlignElements(), SCH_EDITOR_CONTROL::AssignNetclass(), BOARD_EDITOR_CONTROL::AssignNetclass(), CVPCB_ASSOCIATION_TOOL::Associate(), TOOL_BASE::attachManager(), SCH_EDIT_TOOL::AutoplaceFields(), EE_SELECTION_TOOL::autostartEvent(), SCH_EDIT_TOOL::BreakWire(), BOARD_INSPECTION_TOOL::calculateSelectionRatsnest(), ROUTER_TOOL::CanInlineDrag(), SCH_EDITOR_CONTROL::ChangeLineMode(), SCH_EDIT_TOOL::ChangeTextType(), EDIT_TOOL::ChangeTrackWidth(), SCH_EDIT_TOOL::CleanupSheetPins(), GERBVIEW_CONTROL::ClearAllLayers(), SCH_EDITOR_CONTROL::ClearHighlight(), BOARD_INSPECTION_TOOL::ClearHighlight(), GERBVIEW_SELECTION_TOOL::clearSelection(), PL_SELECTION_TOOL::ClearSelection(), EE_SELECTION_TOOL::ClearSelection(), PCB_SELECTION_TOOL::ClearSelection(), SCH_EDIT_TOOL::ConvertDeMorgan(), SYMBOL_EDITOR_EDIT_TOOL::Copy(), PL_EDIT_TOOL::Copy(), PAD_TOOL::copyPadSettings(), EDIT_TOOL::copyToClipboard(), EDIT_TOOL::CreateArray(), MICROWAVE_TOOL::createInductorBetween(), EE_INSPECTION_TOOL::CrossProbe(), DRC_TOOL::CrossProbe(), COMMON_TOOLS::CursorControl(), SCH_EDITOR_CONTROL::Cut(), SCH_EDIT_TOOL::DeleteItemCursor(), SYMBOL_EDITOR_EDIT_TOOL::DeleteItemCursor(), PL_EDIT_TOOL::DeleteItemCursor(), PCB_CONTROL::DeleteItemCursor(), EDIT_TOOL::DeleteItems(), SCH_EDITOR_CONTROL::doCopy(), BOARD_EDITOR_CONTROL::doCrossProbePcbToSch(), SCH_EDITOR_CONTROL::doCrossProbeSchToPcb(), SCH_EDIT_TOOL::DoDelete(), SYMBOL_EDITOR_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), BOARD_INSPECTION_TOOL::doHideRatsnestNet(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), PCB_SELECTION_TOOL::doSyncSelection(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), COMMON_TOOLS::doZoomInOut(), COMMON_TOOLS::doZoomToPreset(), EDIT_TOOL::Drag(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::DrawRectangle(), SCH_LINE_WIRE_BUS_TOOL::DrawSegments(), SCH_DRAWING_TOOLS::DrawShape(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), DRAWING_TOOL::drawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), BOARD_EDITOR_CONTROL::DrillOrigin(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), EDIT_TOOL::Duplicate(), SCH_EDIT_TOOL::EditField(), SCH_EDIT_TOOL::editFieldText(), BOARD_EDITOR_CONTROL::EditFpInFpEditor(), PAD_TOOL::EditPad(), SYMBOL_EDITOR_EDIT_TOOL::editShapeProperties(), SYMBOL_EDITOR_EDIT_TOOL::editSymbolProperties(), SCH_EDITOR_CONTROL::EditWithSymbolEditor(), PCB_SELECTION_TOOL::EnterGroup(), GROUP_TOOL::EnterGroup(), SCH_NAVIGATE_TOOL::EnterSheet(), PAD_TOOL::EnumeratePads(), EE_INSPECTION_TOOL::ExcludeMarker(), PCB_SELECTION_TOOL::ExitGroup(), PCB_SELECTION_TOOL::expandConnection(), PAD_TOOL::explodePad(), PCB_SELECTION_TOOL::filterSelection(), PCB_SELECTION_TOOL::FindItem(), SCH_EDITOR_CONTROL::FindSymbolAndItem(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), EDIT_TOOL::Flip(), EDIT_TOOL::GetAndPlace(), TOOL_BASE::GetManager(), TOOL_BASE::getModelInt(), DRAWING_TOOL::getSourceZoneForAction(), TOOL_BASE::getToolHolderInt(), TOOL_BASE::getView(), TOOL_BASE::getViewControls(), TOOL_INTERACTIVE::goInternal(), PCB_SELECTION_TOOL::grabUnconnected(), COMMON_TOOLS::GridNext(), COMMON_TOOLS::GridPreset(), COMMON_TOOLS::GridPrev(), PCB_CONTROL::GridSetOrigin(), GROUP_TOOL::Group(), GERBVIEW_CONTROL::HighlightControl(), BOARD_INSPECTION_TOOL::HighlightItem(), SCH_EDITOR_CONTROL::HighlightNet(), BOARD_INSPECTION_TOOL::HighlightNet(), BOARD_INSPECTION_TOOL::highlightNet(), SCH_EDITOR_CONTROL::HighlightNetCursor(), PL_EDIT_TOOL::ImportDrawingSheetContent(), FOOTPRINT_EDITOR_CONTROL::ImportFootprint(), EE_TOOL_BASE< T >::Init(), SCH_EDIT_TOOL::Init(), SYMBOL_EDITOR_CONTROL::Init(), SYMBOL_EDITOR_EDIT_TOOL::Init(), PL_DRAWING_TOOLS::Init(), PL_EDIT_TOOL::Init(), PL_POINT_EDITOR::Init(), ROUTER_TOOL::Init(), BOARD_EDITOR_CONTROL::Init(), BOARD_INSPECTION_TOOL::Init(), BOARD_REANNOTATE_TOOL::Init(), CONVERT_TOOL::Init(), DRAWING_TOOL::Init(), EDIT_TOOL::Init(), GLOBAL_EDIT_TOOL::Init(), GROUP_TOOL::Init(), PAD_TOOL::Init(), PCB_POINT_EDITOR::Init(), PCB_SELECTION_TOOL::Init(), ALIGN_DISTRIBUTE_TOOL::Init(), POSITION_RELATIVE_TOOL::Init(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), BOARD_INSPECTION_TOOL::InspectClearance(), BOARD_INSPECTION_TOOL::InspectConstraints(), DRAWING_TOOL::InteractivePlaceWithPreview(), EDIT_TOOL::invokeInlineRouter(), EDIT_TOOL::isRouterActive(), TOOL_BASE::IsToolActive(), GROUP_TOOL::LeaveGroup(), BOARD_INSPECTION_TOOL::LocalRatsnestTool(), EDA_3D_CONTROLLER::Main(), CVPCB_CONTROL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), SCH_MOVE_TOOL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), PL_EDIT_TOOL::Main(), PL_SELECTION_TOOL::Main(), PCB_PICKER_TOOL::Main(), PCB_SELECTION_TOOL::Main(), LENGTH_TUNER_TOOL::MainLoop(), ROUTER_TOOL::MainLoop(), PCB_VIEWER_TOOLS::MeasureTool(), SCH_EDIT_TOOL::Mirror(), SYMBOL_EDITOR_EDIT_TOOL::Mirror(), EDIT_TOOL::Mirror(), BOARD_EDITOR_CONTROL::modifyLockSelected(), EDIT_TOOL::MoveExact(), SCH_EDITOR_CONTROL::NextLineMode(), SYMBOL_EDITOR_CONTROL::OnDeMorgan(), SELECTION_TOOL::onDisambiguationExpire(), COMMON_TOOLS::OnGridChanged(), PCB_POINT_EDITOR::OnSelectionChange(), SCH_EDITOR_CONTROL::Paste(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), PL_EDIT_TOOL::Paste(), PAD_TOOL::pastePadProperties(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), GROUP_TOOL::PickNewMember(), EDIT_TOOL::pickReferencePoint(), SYMBOL_EDITOR_EDIT_TOOL::PinTable(), PCB_CONTROL::placeBoardItems(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), DRAWING_TOOL::PlaceText(), GERBVIEW_CONTROL::Print(), PCB_CONTROL::Print(), SCH_EDIT_TOOL::Properties(), SYMBOL_EDITOR_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), PAD_TOOL::pushPadSettings(), EDIT_TOOL::rebuildConnectivity(), ZONE_FILLER_TOOL::rebuildConnectivity(), EE_SELECTION_TOOL::RebuildSelection(), PAD_TOOL::RecombinePad(), SCH_EDITOR_CONTROL::Redo(), SYMBOL_EDITOR_EDIT_TOOL::Redo(), POSITION_RELATIVE_TOOL::RelativeItemSelectionMove(), EDIT_TOOL::Remove(), PCB_POINT_EDITOR::removeCorner(), GROUP_TOOL::RemoveFromGroup(), SELECTION_TOOL::RemoveItemFromSel(), SELECTION_TOOL::RemoveItemsFromSel(), SCH_EDIT_TOOL::RepeatDrawItem(), SYMBOL_EDITOR_DRAWING_TOOLS::RepeatDrawItem(), PCB_SELECTION_TOOL::RequestSelection(), EE_SELECTION_TOOL::RequestSelection(), EDA_3D_CONTROLLER::Reset(), COMMON_TOOLS::Reset(), PNS::TOOL_BASE::Reset(), PAD_TOOL::Reset(), COMMON_TOOLS::ResetLocalCoords(), TOOL_INTERACTIVE::resetTransitions(), SCH_EDITOR_CONTROL::Revert(), SCH_EDIT_TOOL::Rotate(), SYMBOL_EDITOR_EDIT_TOOL::Rotate(), EDIT_TOOL::Rotate(), ROUTER_TOOL::RouteSelected(), TOOL_INTERACTIVE::RunMainStack(), DRC_TOOL::RunTests(), EE_SELECTION_TOOL::Selectable(), EE_SELECTION_TOOL::SelectAll(), PCB_SELECTION_TOOL::SelectAll(), EE_SELECTION_TOOL::SelectConnection(), PCB_TOOL_BASE::selection(), COMMON_TOOLS::SelectionTool(), GERBVIEW_SELECTION_TOOL::SelectItem(), GERBVIEW_SELECTION_TOOL::SelectItems(), EE_SELECTION_TOOL::selectMultiple(), PL_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectNet(), GERBVIEW_SELECTION_TOOL::selectPoint(), PL_SELECTION_TOOL::SelectPoint(), PCB_SELECTION_TOOL::selectPoint(), EE_SELECTION_TOOL::selectPoint(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), PCB_SELECTION_TOOL::selectSameSheet(), PCB_SELECTION_TOOL::selectSheetContents(), DRAWING_TOOL::SetAnchor(), TOOL_INTERACTIVE::SetContextMenu(), EDA_3D_CONTROLLER::SetMaterial(), DRC_TOOL::ShowDRCDialog(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_EDIT_TOOL::Swap(), EE_SELECTION_TOOL::SyncSelection(), COMMON_TOOLS::ToggleCursor(), COMMON_TOOLS::ToggleCursorStyle(), EDA_3D_CONTROLLER::ToggleVisibility(), BOARD_EDITOR_CONTROL::TrackWidthDec(), BOARD_EDITOR_CONTROL::TrackWidthInc(), SCH_MOVE_TOOL::trimDanglingLines(), SCH_DRAWING_TOOLS::TwoClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), SCH_EDITOR_CONTROL::Undo(), SYMBOL_EDITOR_EDIT_TOOL::Undo(), GROUP_TOOL::Ungroup(), PCB_SELECTION_TOOL::unrouteSelected(), GERBVIEW_SELECTION_TOOL::UnselectItem(), GERBVIEW_SELECTION_TOOL::UnselectItems(), PNS::TOOL_BASE::updateEndItem(), BOARD_INSPECTION_TOOL::UpdateLocalRatsnest(), EE_INSPECTION_TOOL::UpdateMessagePanel(), GERBVIEW_CONTROL::UpdateMessagePanel(), PL_EDITOR_CONTROL::UpdateMessagePanel(), PCB_CONTROL::UpdateMessagePanel(), EDIT_TOOL::updateModificationPoint(), EE_POINT_EDITOR::updateParentItem(), PNS::TOOL_BASE::updateStartItem(), BOARD_EDITOR_CONTROL::ViaSizeDec(), BOARD_EDITOR_CONTROL::ViaSizeInc(), TOOL_INTERACTIVE::Wait(), BOARD_EDITOR_CONTROL::ZoneDuplicate(), and BOARD_EDITOR_CONTROL::ZoneMerge().

◆ m_toolName

std::string TOOL_BASE::m_toolName
protectedinherited

Definition at line 214 of file tool_base.h.

Referenced by TOOL_BASE::GetName().

◆ m_type

TOOL_TYPE TOOL_BASE::m_type
protectedinherited

Unique identifier for the tool, assigned by a TOOL_MANAGER instance.

Definition at line 207 of file tool_base.h.

Referenced by TOOL_BASE::GetType().


The documentation for this class was generated from the following files: