KiCad PCB EDA Suite
KICAD_MANAGER_CONTROL Class Reference

KICAD_MANAGER_CONTROL. 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 }
 

Determines the reason of reset for a tool

More...
 

Public Member Functions

 KICAD_MANAGER_CONTROL ()
 
 ~KICAD_MANAGER_CONTROL () override
 
void Reset (RESET_REASON aReason) override
 Function Reset() Brings 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 SaveProjectAs (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)
 
void setTransitions () override
 

Sets up handlers for various events.

More...
 
void Activate ()
 Function Activate() Runs the tool. More...
 
TOOL_MENUGetToolMenu ()
 
void SetContextMenu (ACTION_MENU *aMenu, CONTEXT_MENU_TRIGGER aTrigger=CMENU_BUTTON)
 Function SetContextMenu() More...
 
void RunMainStack (std::function< void()> aFunc)
 Function RunMainStack() More...
 
template<class T >
void Go (int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
 Function Go() More...
 
TOOL_EVENTWait (const TOOL_EVENT_LIST &aEventList=TOOL_EVENT(TC_ANY, TA_ANY))
 Function Wait() More...
 
virtual bool Init ()
 Function Init() Init() is called once upon a registration of the tool. More...
 
TOOL_TYPE GetType () const
 Function GetType() Returns the type of the tool. More...
 
TOOL_ID GetId () const
 Function GetId() Returns the unique identifier of the tool. More...
 
const std::string & GetName () const
 Function GetName() Returns the name of the tool. More...
 
TOOL_MANAGERGetManager () const
 Function GetManager() Returns the instance of TOOL_MANAGER that takes care of the tool. More...
 
bool IsToolActive () const
 

Protected Member Functions

void attachManager (TOOL_MANAGER *aManager)
 Function attachManager() More...
 
KIGFX::VIEWgetView () const
 Function getView() More...
 
KIGFX::VIEW_CONTROLSgetViewControls () const
 Function getViewControls() More...
 
template<typename T >
T * getEditFrame () const
 Function getEditFrame() More...
 
template<typename T >
T * getModel () const
 Function getModel() More...
 

Protected Attributes

TOOL_MENU m_menu
 functions below are not yet implemented - their interface may change More...
 
TOOL_TYPE m_type
 

Stores the type of the tool.

More...
 
TOOL_ID m_toolId
 

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

More...
 
std::string m_toolName
 

Name of the tool.

More...
 
TOOL_MANAGERm_toolMgr
 

Private Attributes

KICAD_MANAGER_FRAMEm_frame
 

Pointer to the currently used edit/draw frame.

More...
 

Detailed Description

KICAD_MANAGER_CONTROL.

Handles actions in the kicad manager frame.

Definition at line 40 of file kicad_manager_control.h.

Member Enumeration Documentation

◆ RESET_REASON

enum TOOL_BASE::RESET_REASON
inherited

Determines 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.

Definition at line 78 of file tool_base.h.

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

Constructor & Destructor Documentation

◆ KICAD_MANAGER_CONTROL()

KICAD_MANAGER_CONTROL::KICAD_MANAGER_CONTROL ( )

Definition at line 68 of file kicad_manager_control.cpp.

68  :
69  TOOL_INTERACTIVE( "kicad.Control" ),
70  m_frame( nullptr )
71 {
72 }
TOOL_INTERACTIVE(TOOL_ID aId, const std::string &aName)
Constructor.
KICAD_MANAGER_FRAME * m_frame
Pointer to the currently used edit/draw frame.

◆ ~KICAD_MANAGER_CONTROL()

KICAD_MANAGER_CONTROL::~KICAD_MANAGER_CONTROL ( )
inlineoverride

Definition at line 44 of file kicad_manager_control.h.

44 { }

Member Function Documentation

◆ Activate()

void TOOL_INTERACTIVE::Activate ( )
inherited

Function Activate() Runs 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:218
TOOL_ID m_toolId
Unique identifier for the tool, assigned by a TOOL_MANAGER instance.
Definition: tool_base.h:213
bool InvokeTool(TOOL_ID aToolId)
Function InvokeTool() Calls 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(), LIB_EDIT_TOOL::DeleteItemCursor(), SCH_EDIT_TOOL::DeleteItemCursor(), PCBNEW_CONTROL::DeleteItemCursor(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::DrawLine(), MICROWAVE_TOOL::drawMicrowaveInductor(), LIB_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PCB_EDITOR_CONTROL::DrillOrigin(), PAD_TOOL::EnumeratePads(), PCBNEW_CONTROL::GridSetOrigin(), SCH_EDITOR_CONTROL::HighlightNetCursor(), PCB_INSPECTION_TOOL::HighlightNetTool(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), PCB_INSPECTION_TOOL::LocalRatsnestTool(), SCH_MOVE_TOOL::Main(), EE_POINT_EDITOR::Main(), LIB_MOVE_TOOL::Main(), PCBNEW_PICKER_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), EDIT_TOOL::MeasureTool(), EDIT_TOOL::Move(), LIB_TREE::onContextMenu(), POINT_EDITOR::OnSelectionChange(), LIB_DRAWING_TOOLS::PlaceAnchor(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), EDIT_TOOL::Remove(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), DRAWING_TOOL::SetAnchor(), DRC::ShowDRCDialog(), SCH_DRAWING_TOOLS::SingleClickPlace(), LIB_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

◆ attachManager()

void TOOL_BASE::attachManager ( TOOL_MANAGER aManager)
protectedinherited

Function attachManager()

Sets 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 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:218

References TOOL_BASE::m_toolMgr.

Referenced by TOOL_MANAGER::RegisterTool().

◆ Execute()

int KICAD_MANAGER_CONTROL::Execute ( const TOOL_EVENT aEvent)

Definition at line 685 of file kicad_manager_control.cpp.

686 {
687  wxString execFile;
688  wxString params;
689 
691  execFile = GERBVIEW_EXE;
692  else if( aEvent.IsAction( &KICAD_MANAGER_ACTIONS::convertImage ) )
693  execFile = BITMAPCONVERTER_EXE;
694  else if( aEvent.IsAction( &KICAD_MANAGER_ACTIONS::showCalculator ) )
695  execFile = PCB_CALCULATOR_EXE;
696  else if( aEvent.IsAction( &KICAD_MANAGER_ACTIONS::editWorksheet ) )
697  execFile = PL_EDITOR_EXE;
698  else if( aEvent.IsAction( &KICAD_MANAGER_ACTIONS::openTextEditor ) )
699  execFile = Pgm().GetEditorName();
700  else if( aEvent.IsAction( &KICAD_MANAGER_ACTIONS::editOtherSch ) )
701  execFile = EESCHEMA_EXE;
702  else if( aEvent.IsAction( &KICAD_MANAGER_ACTIONS::editOtherPCB ) )
703  execFile = PCBNEW_EXE;
704  else
705  wxFAIL_MSG( "Execute(): unexpected request" );
706 
707  if( execFile.IsEmpty() )
708  return 0;
709 
710  if( aEvent.Parameter<wxString*>() )
711  params = *aEvent.Parameter<wxString*>();
712  else if( aEvent.IsAction( &KICAD_MANAGER_ACTIONS::viewGerbers ) )
713  params = m_frame->Prj().GetProjectPath();
714 
715  if( !params.empty() )
716  AddDelimiterString( params );
717 
718  TERMINATE_HANDLER* callback = new TERMINATE_HANDLER( execFile );
719 
720  long pid = ExecuteFile( m_frame, execFile, params, callback );
721 
722  if( pid > 0 )
723  {
724  wxString msg = wxString::Format( _( "%s %s opened [pid=%ld]\n" ),
725  execFile,
726  params,
727  pid );
728  m_frame->PrintMsg( msg );
729 
730 #ifdef __WXMAC__
731  msg.Printf( "osascript -e 'activate application \"%s\"' ", execFile );
732  system( msg.c_str() );
733 #endif
734  }
735  else
736  {
737  delete callback;
738  }
739 
740  return 0;
741 }
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:103
const wxString PL_EDITOR_EXE
const wxString PCBNEW_EXE
static TOOL_ACTION showCalculator
static TOOL_ACTION viewGerbers
VTBL_ENTRY const wxString GetProjectPath() const
Function GetProjectPath returns the full path of the project.
Definition: project.cpp:102
const wxString GERBVIEW_EXE
static TOOL_ACTION convertImage
bool IsAction(const TOOL_ACTION *aAction) const
Function IsAction() Tests if the event contains an action issued upon activation of the given TOOL_AC...
Definition: tool_event.cpp:67
static TOOL_ACTION editOtherPCB
const wxString EESCHEMA_EXE
void PrintMsg(const wxString &aText)
Displays aText in the text panel.
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
KICAD_MANAGER_FRAME * m_frame
Pointer to the currently used edit/draw frame.
T Parameter() const
Function Parameter() Returns a non-standard parameter assigned to the event.
Definition: tool_event.h:435
const wxString PCB_CALCULATOR_EXE
void AddDelimiterString(wxString &string)
Function AddDelimiterString Add un " to the start and the end of string (if not already done).
Definition: gestfich.cpp:42
static TOOL_ACTION editWorksheet
static TOOL_ACTION editOtherSch
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
#define _(s)
Definition: 3d_actions.cpp:33
const wxString BITMAPCONVERTER_EXE
int ExecuteFile(wxWindow *frame, const wxString &ExecFile, const wxString &param, wxProcess *callback)
Function ExecuteFile calls the executable file ExecFile with the command line parameters param.
Definition: gestfich.cpp:174
static TOOL_ACTION openTextEditor

References _, AddDelimiterString(), BITMAPCONVERTER_EXE, KICAD_MANAGER_ACTIONS::convertImage, KICAD_MANAGER_ACTIONS::editOtherPCB, KICAD_MANAGER_ACTIONS::editOtherSch, KICAD_MANAGER_ACTIONS::editWorksheet, EESCHEMA_EXE, ExecuteFile(), Format(), GERBVIEW_EXE, PROJECT::GetProjectPath(), TOOL_EVENT::IsAction(), m_frame, KICAD_MANAGER_ACTIONS::openTextEditor, TOOL_EVENT::Parameter(), PCB_CALCULATOR_EXE, PCBNEW_EXE, Pgm(), PL_EDITOR_EXE, KICAD_MANAGER_FRAME::PrintMsg(), 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

Function getEditFrame()

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

Definition at line 186 of file tool_base.h.

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

References TOOL_BASE::getEditFrameInt().

Referenced by ZONE_CREATE_HELPER::createNewZone().

◆ GetId()

TOOL_ID TOOL_BASE::GetId ( ) const
inlineinherited

Function GetId() Returns the unique identifier of the tool.

The identifier is set by an instance of TOOL_MANAGER.

Returns
Identifier of the tool.

Definition at line 120 of file tool_base.h.

121  {
122  return m_toolId;
123  }
TOOL_ID m_toolId
Unique identifier for the tool, assigned by a TOOL_MANAGER instance.
Definition: tool_base.h:213

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

Function GetManager() Returns the instance of TOOL_MANAGER that takes care of the tool.

Returns
Instance of the TOOL_MANAGER. If there is no TOOL_MANAGER associated, it returns NULL.

Definition at line 142 of file tool_base.h.

143  {
144  return m_toolMgr;
145  }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:218

References TOOL_BASE::m_toolMgr.

Referenced by BOARD_COMMIT::BOARD_COMMIT(), ZONE_CREATE_HELPER::commitZone(), ZONE_CREATE_HELPER::createNewZone(), PCB_TOOL_BASE::doInteractiveItemPlacement(), ACTION_MENU::getToolManager(), LIB_TREE::onContextMenu(), ZONE_CREATE_HELPER::OnFirstPoint(), ACTION_MENU::OnMenuEvent(), and ZONE_CREATE_HELPER::performZoneCutout().

◆ getModel()

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

Function getModel()

Returns the model object if it matches the requested type.

Definition at line 200 of file tool_base.h.

201  {
202  EDA_ITEM* m = getModelInt();
203 #if !defined( QA_TEST ) // Dynamic casts give the linker a siezure in the test framework
204  wxASSERT( dynamic_cast<T*>( m ) );
205 #endif
206  return static_cast<T*>( m );
207  }
EDA_ITEM * getModelInt() const
Definition: tool_base.cpp:54
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: base_struct.h:166

References TOOL_BASE::getModelInt().

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

◆ GetName()

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

Function GetName() Returns 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 131 of file tool_base.h.

132  {
133  return m_toolName;
134  }
std::string m_toolName
Name of the tool.
Definition: tool_base.h:217

References TOOL_BASE::m_toolName.

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

◆ GetToolMenu()

◆ GetType()

TOOL_TYPE TOOL_BASE::GetType ( ) const
inlineinherited

Function GetType() Returns 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
Stores the type of the tool.
Definition: tool_base.h:210

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

Function getView()

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:280
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:218

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(), EE_SELECTION_TOOL::ClearSelection(), COMMON_TOOLS::CursorControl(), LIB_EDIT_TOOL::DeleteItemCursor(), SCH_EDIT_TOOL::DeleteItemCursor(), PCBNEW_CONTROL::DeleteItemCursor(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), EE_SELECTION_TOOL::doSelectionMenu(), SELECTION_TOOL::doSelectionMenu(), MICROWAVE_TOOL::drawMicrowaveInductor(), PCB_EDITOR_CONTROL::DrillOrigin(), LIB_EDIT_TOOL::Duplicate(), PAD_TOOL::EnumeratePads(), EE_SELECTION_TOOL::GetNode(), ROUTER_TOOL::getStartLayer(), COMMON_TOOLS::GridPreset(), PCBNEW_CONTROL::GridResetOrigin(), PCBNEW_CONTROL::GridSetOrigin(), SELECTION_TOOL::GuessSelectionCandidates(), EE_SELECTION_TOOL::highlight(), SELECTION_TOOL::highlight(), GERBVIEW_CONTROL::HighlightControl(), PNS::TOOL_BASE::highlightNet(), PCB_INSPECTION_TOOL::highlightNet(), EE_POINT_EDITOR::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), EDIT_TOOL::MeasureTool(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), SCH_MOVE_TOOL::moveItem(), POINT_EDITOR::OnSelectionChange(), COMMON_TOOLS::PanControl(), LIB_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), PNS::TOOL_BASE::pickSingleItem(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Remove(), PCB_EDITOR_CONTROL::Reset(), PNS::TOOL_BASE::Reset(), PCBNEW_CONTROL::Reset(), GERBVIEW_SELECTION_TOOL::Reset(), DRAWING_TOOL::Reset(), EE_SELECTION_TOOL::Reset(), SELECTION_TOOL::Reset(), EE_TOOL_BASE< SCH_BASE_FRAME >::Reset(), SCH_EDIT_TOOL::Rotate(), GERBVIEW_SELECTION_TOOL::select(), SELECTION_TOOL::Selectable(), GERBVIEW_SELECTION_TOOL::selectable(), EE_SELECTION_TOOL::selectionContains(), SELECTION_TOOL::selectionContains(), EE_SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::SelectPoint(), ZOOM_TOOL::selectRegion(), GERBVIEW_SELECTION_TOOL::selectVisually(), COMMON_TOOLS::ToggleGrid(), SCH_EDITOR_CONTROL::ToggleHiddenPins(), EE_SELECTION_TOOL::unhighlight(), SELECTION_TOOL::unhighlight(), GERBVIEW_SELECTION_TOOL::unselect(), GERBVIEW_SELECTION_TOOL::unselectVisually(), EE_POINT_EDITOR::updateEditedPoint(), POINT_EDITOR::updateEditedPoint(), SCH_EDITOR_CONTROL::UpdateFind(), PCBNEW_CONTROL::updateGrid(), EE_POINT_EDITOR::updateItem(), SCH_EDITOR_CONTROL::UpdateNetHighlighting(), EE_POINT_EDITOR::updatePoints(), POINT_EDITOR::updatePoints(), SELECTION_TOOL::updateSelection(), PNS::TOOL_BASE::updateStartItem(), EE_TOOL_BASE< SCH_BASE_FRAME >::updateView(), PCB_TOOL_BASE::view(), COMMON_TOOLS::ZoomFitScreen(), SELECTION_TOOL::zoomFitSelection(), EE_SELECTION_TOOL::~EE_SELECTION_TOOL(), GERBVIEW_SELECTION_TOOL::~GERBVIEW_SELECTION_TOOL(), and SELECTION_TOOL::~SELECTION_TOOL().

◆ getViewControls()

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

Function getViewControls()

Returns 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 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:218
KIGFX::VIEW_CONTROLS * GetViewControls() const
Definition: tool_manager.h:285

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

Referenced by EE_POINT_EDITOR::addCorner(), POINT_EDITOR::addCorner(), EE_POINT_EDITOR::addCornerCondition(), SCH_EDIT_TOOL::BreakWire(), PCB_TOOL_BASE::controls(), COMMON_TOOLS::CursorControl(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), COMMON_TOOLS::doZoomToPreset(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawLine(), MICROWAVE_TOOL::drawMicrowaveInductor(), SCH_LINE_WIRE_BUS_TOOL::DrawSegments(), LIB_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), LIB_EDIT_TOOL::Duplicate(), PAD_TOOL::EnumeratePads(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), COMMON_TOOLS::GridPreset(), PCB_INSPECTION_TOOL::HighlightNet(), SCH_EDITOR_CONTROL::HighlightNet(), PCB_INSPECTION_TOOL::HighlightNetTool(), MODULE_EDITOR_TOOLS::ImportFootprint(), SCH_MOVE_TOOL::Main(), EE_POINT_EDITOR::Main(), LIB_MOVE_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), PCBNEW_PICKER_TOOL::Main(), PICKER_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), ROUTER_TOOL::MainLoop(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), EDIT_TOOL::MeasureTool(), EDIT_TOOL::Move(), POINT_EDITOR::OnSelectionChange(), LIB_EDIT_TOOL::Paste(), ROUTER_TOOL::performDragging(), LIB_DRAWING_TOOLS::PlaceAnchor(), PCBNEW_CONTROL::placeBoardItems(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), SCH_EDIT_TOOL::RepeatDrawItem(), EE_SELECTION_TOOL::RequestSelection(), POINT_EDITOR::Reset(), DRAWING_TOOL::Reset(), COMMON_TOOLS::ResetLocalCoords(), GERBVIEW_SELECTION_TOOL::selectCursor(), SELECTION_TOOL::selectCursor(), EE_SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::SelectNode(), ZOOM_TOOL::selectRegion(), ALIGN_DISTRIBUTE_TOOL::selectTarget(), PICKER_TOOL::setControls(), PCBNEW_PICKER_TOOL::setControls(), EE_POINT_EDITOR::setEditedPoint(), POINT_EDITOR::setEditedPoint(), SCH_DRAWING_TOOLS::SingleClickPlace(), LIB_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), EE_POINT_EDITOR::updateEditedPoint(), POINT_EDITOR::updateEditedPoint(), LIB_MOVE_TOOL::updateModificationPoint(), 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

Function Go()

Defines which state (aStateFunc) to go when a certain event arrives (aConditions). No conditions means any event.

Definition at line 129 of file tool_interactive.h.

131 {
132  TOOL_STATE_FUNC sptr = std::bind( aStateFunc, static_cast<T*>( this ), std::placeholders::_1 );
133 
134  goInternal( sptr, aConditions );
135 }
std::function< int(const TOOL_EVENT &)> TOOL_STATE_FUNC
Definition: tool_base.h:57
void goInternal(TOOL_STATE_FUNC &aState, const TOOL_EVENT_LIST &aConditions)

References TOOL_INTERACTIVE::goInternal().

Referenced by LENGTH_TUNER_TOOL::setTransitions(), ZOOM_TOOL::setTransitions(), AUTOPLACE_TOOL::setTransitions(), MICROWAVE_TOOL::setTransitions(), ROUTER_TOOL::setTransitions(), CVPCB_FOOTPRINT_VIEWER_CONTROL::setTransitions(), LIB_PIN_TOOL::setTransitions(), PAD_TOOL::setTransitions(), EE_INSPECTION_TOOL::setTransitions(), ZONE_FILLER_TOOL::setTransitions(), LIB_DRAWING_TOOLS::setTransitions(), EE_POINT_EDITOR::setTransitions(), COMMON_CONTROL::setTransitions(), SCH_MOVE_TOOL::setTransitions(), setTransitions(), LIB_MOVE_TOOL::setTransitions(), GERBVIEW_CONTROL::setTransitions(), SCH_DRAWING_TOOLS::setTransitions(), POINT_EDITOR::setTransitions(), GLOBAL_EDIT_TOOL::setTransitions(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::setTransitions(), EDA_3D_VIEWER_CONTROL::setTransitions(), LIB_EDIT_TOOL::setTransitions(), LIB_CONTROL::setTransitions(), SCH_EDIT_TOOL::setTransitions(), POSITION_RELATIVE_TOOL::setTransitions(), GERBVIEW_SELECTION_TOOL::setTransitions(), COMMON_TOOLS::setTransitions(), PCB_INSPECTION_TOOL::setTransitions(), PCBNEW_CONTROL::setTransitions(), ALIGN_DISTRIBUTE_TOOL::setTransitions(), SCH_LINE_WIRE_BUS_TOOL::setTransitions(), MODULE_EDITOR_TOOLS::setTransitions(), CVPCB_CONTROL::setTransitions(), CVPCB_ASSOCIATION_TOOL::setTransitions(), PCBNEW_PICKER_TOOL::setTransitions(), PICKER_TOOL::setTransitions(), PCB_EDITOR_CONTROL::setTransitions(), DRAWING_TOOL::setTransitions(), EDIT_TOOL::setTransitions(), SELECTION_TOOL::setTransitions(), SCH_EDITOR_CONTROL::setTransitions(), DRC::setTransitions(), and EE_SELECTION_TOOL::setTransitions().

◆ Init()

◆ IsToolActive()

bool TOOL_BASE::IsToolActive ( ) const
inherited

Definition at line 31 of file tool_base.cpp.

32 {
33  return m_toolMgr->IsToolActive( m_toolId );
34 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:218
TOOL_ID m_toolId
Unique identifier for the tool, assigned by a TOOL_MANAGER instance.
Definition: tool_base.h:213
bool IsToolActive(TOOL_ID aId) const
Function IsToolActive() Returns true if a tool with given id is active (executing)

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

◆ 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  wxString envStr;
148 
149  // KiCad system template path.
150  ENV_VAR_MAP_CITER it = Pgm().GetLocalEnvVariables().find( "KICAD_TEMPLATE_DIR" );
151 
152  if( it != Pgm().GetLocalEnvVariables().end() && it->second.GetValue() != wxEmptyString )
153  {
154  templatePath.AssignDir( it->second.GetValue() );
155  ps->AddTemplatesPage( _( "System Templates" ), templatePath );
156  }
157 
158  // User template path.
159  it = Pgm().GetLocalEnvVariables().find( "KICAD_USER_TEMPLATE_DIR" );
160 
161  if( it != Pgm().GetLocalEnvVariables().end() && it->second.GetValue() != wxEmptyString )
162  {
163  templatePath.AssignDir( it->second.GetValue() );
164  ps->AddTemplatesPage( _( "User Templates" ), templatePath );
165  }
166 
167  // Show the project template selector dialog
168  if( ps->ShowModal() != wxID_OK )
169  return -1;
170 
171  if( !ps->GetSelectedTemplate() )
172  {
173  wxMessageBox( _( "No project template was selected. Cannot generate new project." ),
174  _( "Error" ), wxOK | wxICON_ERROR, m_frame );
175 
176  return -1;
177  }
178 
179  // Get project destination folder and project file name.
180  wxString default_dir = wxFileName( Prj().GetProjectFullName() ).GetPathWithSep();
181  wxString title = _( "New Project Folder" );
182  wxFileDialog dlg( m_frame, title, default_dir, wxEmptyString, ProjectFileWildcard(),
183  wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
184 
185  // Add a "Create a new directory" checkbox
186  dlg.SetExtraControlCreator( &DIR_CHECKBOX::Create );
187 
188  if( dlg.ShowModal() == wxID_CANCEL )
189  return -1;
190 
191  wxFileName fn( dlg.GetPath() );
192 
193  // wxFileName automatically extracts an extension. But if it isn't
194  // a .pro extension, we should keep it as part of the filename
195  if( !fn.GetExt().IsEmpty()
196  && fn.GetExt().ToStdString() != ProjectFileExtension )
197  fn.SetName( fn.GetName() + wxT( "." ) + fn.GetExt() );
198 
199  fn.SetExt( ProjectFileExtension ); // enforce extension
200 
201  if( !fn.IsAbsolute() )
202  fn.MakeAbsolute();
203 
204  // Append a new directory with the same name of the project file.
205  if( static_cast<DIR_CHECKBOX*>( dlg.GetExtraControl() )->CreateNewDir() )
206  fn.AppendDir( fn.GetName() );
207 
208  // Check if the project directory is empty if it already exists.
209  wxDir directory( fn.GetPath() );
210 
211  if( !fn.DirExists() )
212  {
213  if( !fn.Mkdir() )
214  {
215  wxString msg;
216  msg.Printf( _( "Directory \"%s\" could not be created.\n\n"
217  "Please make sure you have write permissions and try again." ),
218  fn.GetPath() );
220  return -1;
221  }
222  }
223 
224  if( !fn.IsDirWritable() )
225  {
226  wxString msg;
227 
228  msg.Printf( _( "Cannot write to folder \"%s\"." ), fn.GetPath() );
229  wxMessageDialog msgDlg( m_frame, msg, _( "Error!" ), wxICON_ERROR | wxOK | wxCENTER );
230  msgDlg.SetExtendedMessage( _( "Please check your access permissions to this folder "
231  "and try again." ) );
232  msgDlg.ShowModal();
233  return -1;
234  }
235 
236  m_frame->ClearMsg();
237 
238  // Make sure we are not overwriting anything in the destination folder.
239  std::vector< wxFileName > destFiles;
240 
241  if( ps->GetSelectedTemplate()->GetDestinationFiles( fn, destFiles ) )
242  {
243  std::vector< wxFileName > overwrittenFiles;
244 
245  for( const auto& file : destFiles )
246  {
247  if( file.FileExists() )
248  overwrittenFiles.push_back( file );
249  }
250 
251  if( !overwrittenFiles.empty() )
252  {
253  wxString extendedMsg = _( "Overwriting files:" ) + "\n";
254 
255  for( const auto& file : overwrittenFiles )
256  extendedMsg += "\n" + file.GetFullName();
257 
258  KIDIALOG msgDlg( m_frame, _( "Similar files already exist in the destination folder." ),
259  _( "Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
260  msgDlg.SetExtendedMessage( extendedMsg );
261  msgDlg.SetOKLabel( _( "Overwrite" ) );
262  msgDlg.DoNotShowCheckbox( __FILE__, __LINE__ );
263 
264  if( msgDlg.ShowModal() == wxID_CANCEL )
265  return -1;
266  }
267  }
268 
269  wxString errorMsg;
270 
271  // The selected template widget contains the template we're attempting to use to
272  // create a project
273  if( !ps->GetSelectedTemplate()->CreateProject( fn, &errorMsg ) )
274  {
275  wxMessageDialog createDlg( m_frame,
276  _( "A problem occurred creating new project from template!" ),
277  _( "Template Error" ),
278  wxOK | wxICON_ERROR );
279 
280  if( !errorMsg.empty() )
281  createDlg.SetExtendedMessage( errorMsg );
282 
283  createDlg.ShowModal();
284  return -1;
285  }
286 
287  m_frame->CreateNewProject( fn.GetFullPath() );
288  m_frame->LoadProject( fn );
289  return 0;
290 }
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:103
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition: confirm.cpp:252
Helper class to create more flexible dialogs, including 'do not show again' checkbox handling.
Definition: confirm.h:44
const std::string ProjectFileExtension
PROJECT_TEMPLATE * GetSelectedTemplate()
PROJECT & Prj()
Definition: kicad.cpp:317
KICAD_MANAGER_FRAME * m_frame
Pointer to the currently used edit/draw frame.
std::map< wxString, ENV_VAR_ITEM >::const_iterator ENV_VAR_MAP_CITER
Definition: pgm_base.h:119
wxString ProjectFileWildcard()
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.
#define _(s)
Definition: 3d_actions.cpp:33
static wxWindow * Create(wxWindow *aParent)
void AddTemplatesPage(const wxString &aTitle, wxFileName &aPath)
Add a new page with aTitle, populated with templates from aPath.
void LoadProject(const wxFileName &aProjectFileName)
void CreateNewProject(const wxFileName &aProjectFileName)
Creates a new project by setting up and initial project, schematic, and board files.
void ClearMsg()
Erase the text panel.

References _, DIALOG_TEMPLATE_SELECTOR::AddTemplatesPage(), KICAD_MANAGER_FRAME::ClearMsg(), DIR_CHECKBOX::Create(), KICAD_MANAGER_FRAME::CreateNewProject(), PROJECT_TEMPLATE::CreateProject(), DisplayErrorMessage(), KIDIALOG::DoNotShowCheckbox(), 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 81 of file kicad_manager_control.cpp.

82 {
83  wxString default_dir = m_frame->GetMruPath();
84  wxFileDialog dlg( m_frame, _( "Create New Project" ), default_dir, wxEmptyString,
85  ProjectFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
86 
87  // Add a "Create a new directory" checkbox
88  dlg.SetExtraControlCreator( &DIR_CHECKBOX::Create );
89 
90  if( dlg.ShowModal() == wxID_CANCEL )
91  return -1;
92 
93  wxFileName pro( dlg.GetPath() );
94 
95  // wxFileName automatically extracts an extension. But if it isn't
96  // a .pro extension, we should keep it as part of the filename
97  if( !pro.GetExt().IsEmpty()
98  && pro.GetExt().ToStdString() != ProjectFileExtension )
99  pro.SetName( pro.GetName() + wxT( "." ) + pro.GetExt() );
100 
101  pro.SetExt( ProjectFileExtension ); // enforce extension
102 
103  if( !pro.IsAbsolute() )
104  pro.MakeAbsolute();
105 
106  // Append a new directory with the same name of the project file.
107  if( static_cast<DIR_CHECKBOX*>( dlg.GetExtraControl() )->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( _( "Directory \"%s\" could not be created.\n\n"
119  "Please 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 directory is not empty. It is recommended that you "
128  "create projects in their own empty directory.\n\nDo you "
129  "want to continue?" );
130 
131  if( !IsOK( m_frame, msg ) )
132  return -1;
133  }
134 
135  m_frame->CreateNewProject( pro );
136  m_frame->LoadProject( pro );
137 
138  return 0;
139 }
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition: confirm.cpp:252
const std::string ProjectFileExtension
wxString GetMruPath() const
KICAD_MANAGER_FRAME * m_frame
Pointer to the currently used edit/draw frame.
wxString ProjectFileWildcard()
#define _(s)
Definition: 3d_actions.cpp:33
static wxWindow * Create(wxWindow *aParent)
void LoadProject(const wxFileName &aProjectFileName)
void CreateNewProject(const wxFileName &aProjectFileName)
Creates a new project by setting up and initial project, schematic, and board files.
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
Definition: confirm.cpp:283

References _, DIR_CHECKBOX::Create(), KICAD_MANAGER_FRAME::CreateNewProject(), DisplayErrorMessage(), EDA_BASE_FRAME::GetMruPath(), IsOK(), KICAD_MANAGER_FRAME::LoadProject(), m_frame, ProjectFileExtension, and ProjectFileWildcard().

Referenced by setTransitions().

◆ OpenProject()

int KICAD_MANAGER_CONTROL::OpenProject ( const TOOL_EVENT aEvent)

Definition at line 293 of file kicad_manager_control.cpp.

294 {
295  wxString default_dir = m_frame->GetMruPath();
296  wxFileDialog dlg( m_frame, _( "Open Existing Project" ), default_dir, wxEmptyString,
297  ProjectFileWildcard(), wxFD_OPEN | wxFD_FILE_MUST_EXIST );
298 
299  if( dlg.ShowModal() == wxID_CANCEL )
300  return -1;
301 
302  wxFileName pro( dlg.GetPath() );
303  pro.SetExt( ProjectFileExtension ); // enforce extension
304 
305  if( !pro.IsAbsolute() )
306  pro.MakeAbsolute();
307 
308  if( !pro.FileExists() )
309  return -1;
310 
311  m_frame->LoadProject( pro );
312  return 0;
313 }
const std::string ProjectFileExtension
wxString GetMruPath() const
KICAD_MANAGER_FRAME * m_frame
Pointer to the currently used edit/draw frame.
wxString ProjectFileWildcard()
#define _(s)
Definition: 3d_actions.cpp:33
void LoadProject(const wxFileName &aProjectFileName)

References _, EDA_BASE_FRAME::GetMruPath(), KICAD_MANAGER_FRAME::LoadProject(), m_frame, ProjectFileExtension, and ProjectFileWildcard().

Referenced by setTransitions().

◆ Refresh()

int KICAD_MANAGER_CONTROL::Refresh ( const TOOL_EVENT aEvent)

Definition at line 570 of file kicad_manager_control.cpp.

571 {
573  return 0;
574 }
KICAD_MANAGER_FRAME * m_frame
Pointer to the currently used edit/draw frame.

References m_frame, and KICAD_MANAGER_FRAME::RefreshProjectTree().

Referenced by setTransitions().

◆ Reset()

void KICAD_MANAGER_CONTROL::Reset ( RESET_REASON  aReason)
overridevirtual

Function Reset() Brings 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 75 of file kicad_manager_control.cpp.

76 {
77  m_frame = getEditFrame<KICAD_MANAGER_FRAME>();
78 }
KICAD_MANAGER_FRAME * m_frame
Pointer to the currently used edit/draw frame.

References m_frame.

◆ RunMainStack()

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

Function RunMainStack()

Calls 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 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:218
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 491 of file kicad_manager_control.cpp.

492 {
493  wxString msg;
494 
495  wxFileName currentProjectFile( Prj().GetProjectFullName() );
496  wxString currentProjectDirPath = currentProjectFile.GetPath();
497  wxString currentProjectName = Prj().GetProjectName();
498 
499  wxString default_dir = m_frame->GetMruPath();
500 
501  if( default_dir == currentProjectDirPath
502  || default_dir == currentProjectDirPath + wxFileName::GetPathSeparator() )
503  {
504  // Don't start within the current project
505  wxFileName default_dir_fn( default_dir );
506  default_dir_fn.RemoveLastDir();
507  default_dir = default_dir_fn.GetPath();
508  }
509 
510  wxFileDialog dlg( m_frame, _( "Save Project To" ), default_dir, wxEmptyString, wxEmptyString,
511  wxFD_SAVE );
512 
513  if( dlg.ShowModal() == wxID_CANCEL )
514  return -1;
515 
516  wxFileName newProjectDir( dlg.GetPath() );
517 
518  if( !newProjectDir.IsAbsolute() )
519  newProjectDir.MakeAbsolute();
520 
521  if( wxDirExists( newProjectDir.GetFullPath() ) )
522  {
523  msg.Printf( _( "\"%s\" already exists." ), newProjectDir.GetFullPath() );
525  return -1;
526  }
527 
528  if( !wxMkdir( newProjectDir.GetFullPath() ) )
529  {
530  msg.Printf( _( "Directory \"%s\" could not be created.\n\n"
531  "Please make sure you have write permissions and try again." ),
532  newProjectDir.GetPath() );
534  return -1;
535  }
536 
537  if( !newProjectDir.IsDirWritable() )
538  {
539  msg.Printf( _( "Cannot write to folder \"%s\"." ), newProjectDir.GetFullPath() );
540  wxMessageDialog msgDlg( m_frame, msg, _( "Error!" ), wxICON_ERROR | wxOK | wxCENTER );
541  msgDlg.SetExtendedMessage( _( "Please check your access permissions to this folder "
542  "and try again." ) );
543  msgDlg.ShowModal();
544  return -1;
545  }
546 
547  const wxString& newProjectDirPath = newProjectDir.GetFullPath();
548  const wxString& newProjectName = newProjectDir.GetName();
549  wxDir currentProjectDir( currentProjectDirPath );
550 
551  SAVE_AS_TRAVERSER traverser( m_frame,
552  currentProjectDirPath, currentProjectName,
553  newProjectDirPath, newProjectName );
554 
555  currentProjectDir.Traverse( traverser );
556 
557  if( !traverser.GetErrors().empty() )
558  DisplayErrorMessage( m_frame, traverser.GetErrors() );
559 
560  if( traverser.GetNewProjectFile().FileExists() )
561  {
562  m_frame->CreateNewProject( traverser.GetNewProjectFile() );
563  m_frame->LoadProject( traverser.GetNewProjectFile() );
564  }
565 
566  return 0;
567 }
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition: confirm.cpp:252
PROJECT & Prj()
Definition: kicad.cpp:317
wxString GetMruPath() const
KICAD_MANAGER_FRAME * m_frame
Pointer to the currently used edit/draw frame.
#define _(s)
Definition: 3d_actions.cpp:33
VTBL_ENTRY const wxString GetProjectName() const
Function GetProjectName returns the short name of the project.
Definition: project.cpp:108
void LoadProject(const wxFileName &aProjectFileName)
void CreateNewProject(const wxFileName &aProjectFileName)
Creates a new project by setting up and initial project, schematic, and board files.

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

Referenced by setTransitions().

◆ SetContextMenu()

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

Function SetContextMenu()

Assigns 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 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:218
void SetTool(TOOL_INTERACTIVE *aTool)
Function SetTool() Sets a tool that is the creator of the menu.
void ScheduleContextMenu(TOOL_BASE *aTool, ACTION_MENU *aMenu, CONTEXT_MENU_TRIGGER aTrigger)
Sets behaviour of the tool's context popup menu.

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

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), EE_SELECTION_TOOL::doSelectionMenu(), SELECTION_TOOL::doSelectionMenu(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), TOOL_MENU::ShowContextMenu(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

◆ setTransitions()

void KICAD_MANAGER_CONTROL::setTransitions ( )
overridevirtual

Sets up handlers for various events.

Implements TOOL_INTERACTIVE.

Definition at line 744 of file kicad_manager_control.cpp.

745 {
750 
753 
763 
766 }
static TOOL_ACTION newProject
int ShowPlayer(const TOOL_EVENT &aEvent)
static TOOL_ACTION showCalculator
static TOOL_ACTION viewGerbers
static TOOL_ACTION newFromTemplate
void Go(int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
Function Go()
static TOOL_ACTION convertImage
int Refresh(const TOOL_EVENT &aEvent)
static TOOL_ACTION editOtherPCB
static TOOL_ACTION editSchematic
int OpenProject(const TOOL_EVENT &aEvent)
static TOOL_ACTION editFootprints
static TOOL_ACTION updateMenu
Definition: actions.h:162
static TOOL_ACTION editWorksheet
int NewProject(const TOOL_EVENT &aEvent)
int SaveProjectAs(const TOOL_EVENT &aEvent)
static TOOL_ACTION editOtherSch
static TOOL_ACTION editPCB
int UpdateMenu(const TOOL_EVENT &aEvent)
static TOOL_ACTION openProject
static TOOL_ACTION saveAs
Definition: actions.h:55
static TOOL_ACTION zoomRedraw
Definition: actions.h:87
int NewFromTemplate(const TOOL_EVENT &aEvent)
static TOOL_ACTION editSymbols
int Execute(const TOOL_EVENT &aEvent)
static TOOL_ACTION openTextEditor

References KICAD_MANAGER_ACTIONS::convertImage, KICAD_MANAGER_ACTIONS::editFootprints, KICAD_MANAGER_ACTIONS::editOtherPCB, KICAD_MANAGER_ACTIONS::editOtherSch, KICAD_MANAGER_ACTIONS::editPCB, KICAD_MANAGER_ACTIONS::editSchematic, KICAD_MANAGER_ACTIONS::editSymbols, KICAD_MANAGER_ACTIONS::editWorksheet, Execute(), TOOL_INTERACTIVE::Go(), KICAD_MANAGER_ACTIONS::newFromTemplate, NewFromTemplate(), KICAD_MANAGER_ACTIONS::newProject, NewProject(), KICAD_MANAGER_ACTIONS::openProject, OpenProject(), KICAD_MANAGER_ACTIONS::openTextEditor, Refresh(), ACTIONS::saveAs, SaveProjectAs(), KICAD_MANAGER_ACTIONS::showCalculator, ShowPlayer(), UpdateMenu(), ACTIONS::updateMenu, KICAD_MANAGER_ACTIONS::viewGerbers, and ACTIONS::zoomRedraw.

◆ ShowPlayer()

int KICAD_MANAGER_CONTROL::ShowPlayer ( const TOOL_EVENT aEvent)

Definition at line 593 of file kicad_manager_control.cpp.

594 {
595  FRAME_T playerType = aEvent.Parameter<FRAME_T>();
596  KIWAY_PLAYER* player;
597 
598  try
599  {
600  player = m_frame->Kiway().Player( playerType, true );
601  }
602  catch( const IO_ERROR& err )
603  {
604  wxMessageBox( _( "Application failed to load:\n" ) + err.What(), _( "KiCad Error" ),
605  wxOK | wxICON_ERROR, m_frame );
606  return -1;
607  }
608 
609  if( !player->IsVisible() ) // A hidden frame might not have the document loaded.
610  {
611  wxString filepath;
612 
613  if( playerType == FRAME_SCH )
614  {
615  filepath = m_frame->SchFileName();
616  }
617  else if( playerType == FRAME_PCB_EDITOR )
618  {
619  wxFileName kicad_board( m_frame->PcbFileName() );
620  wxFileName legacy_board( m_frame->PcbLegacyFileName() );
621 
622  if( !legacy_board.FileExists() || kicad_board.FileExists() )
623  filepath = kicad_board.GetFullPath();
624  else
625  filepath = legacy_board.GetFullPath();
626  }
627 
628  if( !filepath.IsEmpty() )
629  {
630  if( !player->OpenProjectFiles( std::vector<wxString>( 1, filepath ) ) )
631  return -1;
632  }
633 
634  player->Show( true );
635  }
636 
637  // Needed on Windows, other platforms do not use it, but it creates no issue
638  if( player->IsIconized() )
639  player->Iconize( false );
640 
641  player->Raise();
642 
643  // Raising the window does not set the focus on Linux. This should work on
644  // any platform.
645  if( wxWindow::FindFocus() != player )
646  player->SetFocus();
647 
648  return 0;
649 }
KIWAY_PLAYER is a wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of ...
Definition: kiway_player.h:59
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_holder.h:56
FRAME_T
Enum FRAME_T is the set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
Definition: frame_type.h:34
const wxString SchFileName()
VTBL_ENTRY KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=NULL)
Function Player returns the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:341
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:33
KICAD_MANAGER_FRAME * m_frame
Pointer to the currently used edit/draw frame.
T Parameter() const
Function Parameter() Returns a non-standard parameter assigned to the event.
Definition: tool_event.h:435
const wxString PcbLegacyFileName()
#define _(s)
Definition: 3d_actions.cpp:33
const wxString PcbFileName()
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:76

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

Referenced by setTransitions().

◆ UpdateMenu()

int KICAD_MANAGER_CONTROL::UpdateMenu ( const TOOL_EVENT aEvent)

Definition at line 577 of file kicad_manager_control.cpp.

578 {
579  ACTION_MENU* actionMenu = aEvent.Parameter<ACTION_MENU*>();
580  CONDITIONAL_MENU* conditionalMenu = dynamic_cast<CONDITIONAL_MENU*>( actionMenu );
581  SELECTION dummySel;
582 
583  if( conditionalMenu )
584  conditionalMenu->Evaluate( dummySel );
585 
586  if( actionMenu )
587  actionMenu->UpdateAll();
588 
589  return 0;
590 }
ACTION_MENU.
Definition: action_menu.h:43
void UpdateAll()
Function UpdateAll() Runs update handlers for the menu and its submenus.
T Parameter() const
Function Parameter() Returns a non-standard parameter assigned to the event.
Definition: tool_event.h:435

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

Referenced by setTransitions().

◆ Wait()

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

Function Wait()

Suspends 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_MANAGER * m_toolMgr
Definition: tool_base.h:218
TOOL_EVENT * ScheduleWait(TOOL_BASE *aTool, const TOOL_EVENT_LIST &aConditions)
Pauses execution of a given tool until one or more events matching aConditions arrives.

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

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EE_SELECTION_TOOL::doSelectionMenu(), SELECTION_TOOL::doSelectionMenu(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), LIB_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EnumeratePads(), ROUTER_TOOL::InlineDrag(), ZOOM_TOOL::Main(), CVPCB_CONTROL::Main(), SCH_MOVE_TOOL::Main(), EE_POINT_EDITOR::Main(), LIB_MOVE_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), EDA_3D_VIEWER_CONTROL::Main(), PCBNEW_PICKER_TOOL::Main(), PICKER_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), SELECTION_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), EDIT_TOOL::MeasureTool(), EDIT_TOOL::Move(), POINT_EDITOR::OnSelectionChange(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), EDIT_TOOL::pickCopyReferencePoint(), LIB_DRAWING_TOOLS::PlaceAnchor(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), EDIT_TOOL::Remove(), EE_SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectMultiple(), GERBVIEW_SELECTION_TOOL::selectPoint(), SELECTION_TOOL::selectPoint(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), ZOOM_TOOL::selectRegion(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), LIB_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

Member Data Documentation

◆ m_frame

KICAD_MANAGER_FRAME* KICAD_MANAGER_CONTROL::m_frame
private

Pointer to the currently used edit/draw frame.

Definition at line 65 of file kicad_manager_control.h.

Referenced by Execute(), NewFromTemplate(), NewProject(), OpenProject(), Refresh(), Reset(), SaveProjectAs(), and ShowPlayer().

◆ m_menu

TOOL_MENU TOOL_INTERACTIVE::m_menu
protectedinherited

functions below are not yet implemented - their interface may change

Definition at line 108 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(), DRAWING_TOOL::drawSegment(), LIB_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EnumeratePads(), TOOL_INTERACTIVE::GetToolMenu(), PICKER_TOOL::Init(), SCH_EDIT_TOOL::Init(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Init(), LIB_DRAWING_TOOLS::Init(), EDA_3D_VIEWER_CONTROL::Init(), MODULE_EDITOR_TOOLS::Init(), LIB_CONTROL::Init(), PCB_EDITOR_CONTROL::Init(), SCH_DRAWING_TOOLS::Init(), GERBVIEW_SELECTION_TOOL::Init(), DRAWING_TOOL::Init(), EE_SELECTION_TOOL::Init(), EE_TOOL_BASE< SCH_BASE_FRAME >::Init(), SELECTION_TOOL::Init(), SCH_LINE_WIRE_BUS_TOOL::Init(), EDIT_TOOL::Init(), PCB_TOOL_BASE::Init(), SCH_MOVE_TOOL::Main(), LIB_MOVE_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), EDA_3D_VIEWER_CONTROL::Main(), PCBNEW_PICKER_TOOL::Main(), PICKER_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), SELECTION_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), EDIT_TOOL::MeasureTool(), LIB_DRAWING_TOOLS::PlaceAnchor(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), LIB_DRAWING_TOOLS::TwoClickPlace(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ m_toolId

TOOL_ID TOOL_BASE::m_toolId
protectedinherited

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

Definition at line 213 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 218 of file tool_base.h.

Referenced by TOOL_INTERACTIVE::Activate(), EE_SELECTION_TOOL::AddItemsToSel(), EE_SELECTION_TOOL::AddItemToSel(), SELECTION_TOOL::AddItemToSel(), CVPCB_ASSOCIATION_TOOL::Associate(), TOOL_BASE::attachManager(), PCB_INSPECTION_TOOL::calculateSelectionRatsnest(), ROUTER_TOOL::CanInlineDrag(), EDIT_TOOL::ChangeTrackWidth(), PCB_INSPECTION_TOOL::ClearHighlight(), SCH_EDITOR_CONTROL::ClearHighlight(), SELECTION_TOOL::ClearSelection(), GERBVIEW_SELECTION_TOOL::clearSelection(), EE_SELECTION_TOOL::ClearSelection(), SCH_EDIT_TOOL::ConvertDeMorgan(), LIB_EDIT_TOOL::Copy(), PAD_TOOL::copyPadSettings(), MICROWAVE_TOOL::createInductorBetween(), MODULE_EDITOR_TOOLS::CreatePadFromShapes(), PCB_INSPECTION_TOOL::CrossProbePcbToSch(), COMMON_TOOLS::CursorControl(), ROUTER_TOOL::CustomTrackWidthDialog(), SCH_EDITOR_CONTROL::Cut(), LIB_EDIT_TOOL::DeleteItemCursor(), SCH_EDIT_TOOL::DeleteItemCursor(), PCBNEW_CONTROL::DeleteItemCursor(), SCH_EDITOR_CONTROL::doCopy(), SCH_EDITOR_CONTROL::doCrossProbeSchToPcb(), LIB_EDIT_TOOL::DoDelete(), SCH_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::drawSegment(), LIB_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PCB_EDITOR_CONTROL::DrillOrigin(), LIB_EDIT_TOOL::Duplicate(), SCH_EDIT_TOOL::Duplicate(), EDIT_TOOL::Duplicate(), SCH_EDIT_TOOL::editFieldText(), EDIT_TOOL::EditFpInFpEditor(), LIB_EDIT_TOOL::editSymbolProperties(), SCH_EDITOR_CONTROL::EditWithLibEdit(), SCH_EDITOR_CONTROL::EnterSheet(), PAD_TOOL::EnumeratePads(), GLOBAL_EDIT_TOOL::ExchangeFootprints(), SELECTION_TOOL::expandConnection(), MODULE_EDITOR_TOOLS::ExplodePadToShapes(), SELECTION_TOOL::filterSelection(), SELECTION_TOOL::findCallback(), SCH_EDITOR_CONTROL::FindComponentAndItem(), POINT_EDITOR::finishItem(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), EDIT_TOOL::Flip(), EDIT_TOOL::GetAndPlace(), TOOL_BASE::getEditFrameInt(), TOOL_BASE::GetManager(), TOOL_BASE::getModelInt(), DRAWING_TOOL::getSourceZoneForAction(), TOOL_BASE::getView(), TOOL_BASE::getViewControls(), TOOL_INTERACTIVE::goInternal(), PCBNEW_CONTROL::GridSetOrigin(), GERBVIEW_CONTROL::HighlightControl(), PCB_INSPECTION_TOOL::HighlightItem(), PCB_INSPECTION_TOOL::HighlightNet(), SCH_EDITOR_CONTROL::HighlightNet(), PCB_INSPECTION_TOOL::highlightNet(), SCH_EDITOR_CONTROL::HighlightNetCursor(), PCB_INSPECTION_TOOL::HighlightNetTool(), MODULE_EDITOR_TOOLS::ImportFootprint(), LIB_EDIT_TOOL::Init(), SCH_EDIT_TOOL::Init(), PAD_TOOL::Init(), GLOBAL_EDIT_TOOL::Init(), ALIGN_DISTRIBUTE_TOOL::Init(), LIB_CONTROL::Init(), PCB_EDITOR_CONTROL::Init(), POINT_EDITOR::Init(), POSITION_RELATIVE_TOOL::Init(), EE_TOOL_BASE< SCH_BASE_FRAME >::Init(), EDIT_TOOL::Init(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), EDIT_TOOL::invokeInlineRouter(), EDIT_TOOL::isInteractiveDragEnabled(), TOOL_BASE::IsToolActive(), SCH_EDITOR_CONTROL::LeaveSheet(), COMMON_CONTROL::ListHotKeys(), PCB_INSPECTION_TOOL::LocalRatsnestTool(), SCH_MOVE_TOOL::Main(), CVPCB_CONTROL::Main(), LIB_MOVE_TOOL::Main(), EE_SELECTION_TOOL::Main(), SELECTION_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), LIB_EDIT_TOOL::Mirror(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::Mirror(), PCB_EDITOR_CONTROL::modifyLockSelected(), EDIT_TOOL::Move(), EDIT_TOOL::MoveExact(), LIB_CONTROL::OnDeMorgan(), LIB_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), PAD_TOOL::pastePadProperties(), EDIT_TOOL::pickCopyReferencePoint(), LIB_EDIT_TOOL::PinTable(), PCBNEW_CONTROL::placeBoardItems(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), PCBNEW_CONTROL::Print(), GERBVIEW_CONTROL::Print(), LIB_EDIT_TOOL::Properties(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), PAD_TOOL::pushPadSettings(), EE_SELECTION_TOOL::RebuildSelection(), LIB_EDIT_TOOL::Redo(), SCH_EDITOR_CONTROL::Redo(), POSITION_RELATIVE_TOOL::RelativeItemSelectionMove(), EDIT_TOOL::Remove(), POINT_EDITOR::removeCorner(), EE_SELECTION_TOOL::RemoveItemFromSel(), SELECTION_TOOL::RemoveItemFromSel(), EE_SELECTION_TOOL::RemoveItemsFromSel(), SCH_EDIT_TOOL::RepeatDrawItem(), LIB_DRAWING_TOOLS::RepeatDrawItem(), EE_SELECTION_TOOL::RequestSelection(), SELECTION_TOOL::RequestSelection(), COMMON_TOOLS::ResetLocalCoords(), TOOL_INTERACTIVE::resetTransitions(), LIB_EDIT_TOOL::Rotate(), SCH_EDIT_TOOL::Rotate(), EDIT_TOOL::Rotate(), TOOL_INTERACTIVE::RunMainStack(), DRC::RunTests(), EE_SELECTION_TOOL::SelectConnection(), PCB_TOOL_BASE::selection(), COMMON_TOOLS::SelectionTool(), GERBVIEW_SELECTION_TOOL::SelectItem(), GERBVIEW_SELECTION_TOOL::SelectItems(), SELECTION_TOOL::SelectItems(), EE_SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectNet(), GERBVIEW_SELECTION_TOOL::selectPoint(), EE_SELECTION_TOOL::SelectPoint(), SELECTION_TOOL::selectPoint(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), SELECTION_TOOL::selectSameSheet(), SELECTION_TOOL::selectSheetContents(), DRAWING_TOOL::SetAnchor(), TOOL_INTERACTIVE::SetContextMenu(), DRC::ShowDRCDialog(), SCH_DRAWING_TOOLS::SingleClickPlace(), PCB_EDITOR_CONTROL::TrackWidthDec(), PCB_EDITOR_CONTROL::TrackWidthInc(), LIB_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), LIB_EDIT_TOOL::Undo(), SCH_EDITOR_CONTROL::Undo(), GERBVIEW_SELECTION_TOOL::UnselectItem(), GERBVIEW_SELECTION_TOOL::UnselectItems(), SELECTION_TOOL::UnselectItems(), EE_INSPECTION_TOOL::UpdateMessagePanel(), GERBVIEW_CONTROL::UpdateMessagePanel(), PCBNEW_CONTROL::UpdateMessagePanel(), PCB_INSPECTION_TOOL::UpdateSelectionRatsnest(), PCB_EDITOR_CONTROL::ViaSizeDec(), PCB_EDITOR_CONTROL::ViaSizeInc(), TOOL_INTERACTIVE::Wait(), PCB_EDITOR_CONTROL::ZoneDuplicate(), and PCB_EDITOR_CONTROL::ZoneMerge().

◆ m_toolName

std::string TOOL_BASE::m_toolName
protectedinherited

Name of the tool.

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

Definition at line 217 of file tool_base.h.

Referenced by TOOL_BASE::GetName().

◆ m_type

TOOL_TYPE TOOL_BASE::m_type
protectedinherited

Stores the type of the tool.

Definition at line 210 of file tool_base.h.

Referenced by TOOL_BASE::GetType(), and BOARD_COMMIT::Push().


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