diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt index e63e95238e..005e9b200d 100644 --- a/eeschema/CMakeLists.txt +++ b/eeschema/CMakeLists.txt @@ -124,7 +124,7 @@ set ( EESCHEMA_LIBEDIT_SRCS libedit/pinedit.cpp libedit/symbdraw.cpp libedit/symbedit.cpp - libedit/tool_lib.cpp + libedit/toolbars_libedit.cpp libedit/lib_export.cpp libedit/lib_manager.cpp @@ -221,8 +221,8 @@ set( EESCHEMA_SRCS symbol_tree_synchronizing_adapter.cpp template_fieldnames.cpp template_fieldnames_keywords.cpp - tool_sch.cpp - tool_viewlib.cpp + toolbars_sch_editor.cpp + toolbars_viewlib.cpp transform.cpp viewlib_frame.cpp viewlibs.cpp diff --git a/eeschema/libedit/tool_lib.cpp b/eeschema/libedit/toolbars_libedit.cpp similarity index 100% rename from eeschema/libedit/tool_lib.cpp rename to eeschema/libedit/toolbars_libedit.cpp diff --git a/eeschema/tool_sch.cpp b/eeschema/toolbars_sch_editor.cpp similarity index 100% rename from eeschema/tool_sch.cpp rename to eeschema/toolbars_sch_editor.cpp diff --git a/eeschema/tool_viewlib.cpp b/eeschema/toolbars_viewlib.cpp similarity index 100% rename from eeschema/tool_viewlib.cpp rename to eeschema/toolbars_viewlib.cpp diff --git a/eeschema/tools/sch_wire_bus_tool.cpp b/eeschema/tools/sch_wire_bus_tool.cpp index 75e1df877e..9ae3e1fbb5 100644 --- a/eeschema/tools/sch_wire_bus_tool.cpp +++ b/eeschema/tools/sch_wire_bus_tool.cpp @@ -48,7 +48,7 @@ TOOL_ACTION SCH_ACTIONS::startWire( "eeschema.WireBusDrawing.startWire", _( "Start Wire" ), _( "Start drawing a wire" ), add_line_xpm, AF_ACTIVATE ); -TOOL_ACTION SCH_ACTIONS::drawWire( "eeschema.WireBusDrawing.drawWire", +TOOL_ACTION SCH_ACTIONS::drawWire( "eeschema.WireBusDrawing.drawWires", AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_BEGIN_WIRE ), _( "Add Wire" ), _( "Add a wire" ), add_line_xpm, AF_ACTIVATE ); @@ -58,7 +58,7 @@ TOOL_ACTION SCH_ACTIONS::startBus( "eeschema.WireBusDrawing.startBus", _( "Start Bus" ), _( "Start drawing a bus" ), add_bus_xpm, AF_ACTIVATE ); -TOOL_ACTION SCH_ACTIONS::drawBus( "eeschema.WireBusDrawing.drawBus", +TOOL_ACTION SCH_ACTIONS::drawBus( "eeschema.WireBusDrawing.drawBusses", AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_BEGIN_BUS ), _( "Add Bus" ), _( "Add a bus" ), add_bus_xpm, AF_ACTIVATE ); @@ -322,6 +322,9 @@ bool SCH_WIRE_BUS_TOOL::IsDrawingLineWireOrBus( const SELECTION& aSelection ) } +/* + * Immediate action: start drawing a wire. Does not select the wire tool. + */ int SCH_WIRE_BUS_TOOL::StartWire( const TOOL_EVENT& aEvent ) { m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true ); @@ -334,7 +337,10 @@ int SCH_WIRE_BUS_TOOL::StartWire( const TOOL_EVENT& aEvent ) } -int SCH_WIRE_BUS_TOOL::DrawWire( const TOOL_EVENT& aEvent ) +/* + * Tool action: first call selects the tool; subsequent calls start wires. + */ +int SCH_WIRE_BUS_TOOL::DrawWires( const TOOL_EVENT& aEvent ) { if( m_frame->GetToolId() == ID_WIRE_BUTT ) return StartWire( aEvent ); @@ -348,6 +354,9 @@ int SCH_WIRE_BUS_TOOL::DrawWire( const TOOL_EVENT& aEvent ) } +/* + * Immediate action: start drawing a bus. Does not select the bus tool. + */ int SCH_WIRE_BUS_TOOL::StartBus( const TOOL_EVENT& aEvent ) { m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true ); @@ -360,7 +369,10 @@ int SCH_WIRE_BUS_TOOL::StartBus( const TOOL_EVENT& aEvent ) } -int SCH_WIRE_BUS_TOOL::DrawBus( const TOOL_EVENT& aEvent ) +/* + * Tool action: first call selects the tool; subsequent calls start busses. + */ +int SCH_WIRE_BUS_TOOL::DrawBusses( const TOOL_EVENT& aEvent ) { if( m_frame->GetToolId() == ID_BUS_BUTT ) return StartBus( aEvent ); @@ -455,7 +467,10 @@ SCH_LINE* SCH_WIRE_BUS_TOOL::doUnfoldBus( const wxString& aNet ) } -int SCH_WIRE_BUS_TOOL::StartLines( const TOOL_EVENT& aEvent) +/* + * Immediate action: start drawing a line. Does not select the line tool. + */ +int SCH_WIRE_BUS_TOOL::StartLine( const TOOL_EVENT& aEvent) { m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true ); @@ -465,10 +480,13 @@ int SCH_WIRE_BUS_TOOL::StartLines( const TOOL_EVENT& aEvent) } +/* + * Tool action: first call selects the tool; subsequent calls start lines. + */ int SCH_WIRE_BUS_TOOL::DrawLines( const TOOL_EVENT& aEvent) { if( m_frame->GetToolId() == ID_LINE_COMMENT_BUTT ) - return StartLines( aEvent ); + return StartLine( aEvent ); else { m_frame->SetToolID( ID_LINE_COMMENT_BUTT, wxCURSOR_PENCIL, _( "Add lines" ) ); @@ -984,13 +1002,13 @@ void SCH_WIRE_BUS_TOOL::finishSegments() void SCH_WIRE_BUS_TOOL::setTransitions() { - Go( &SCH_WIRE_BUS_TOOL::DrawWire, SCH_ACTIONS::drawWire.MakeEvent() ); - Go( &SCH_WIRE_BUS_TOOL::DrawBus, SCH_ACTIONS::drawBus.MakeEvent() ); - Go( &SCH_WIRE_BUS_TOOL::DrawLines, SCH_ACTIONS::drawLines.MakeEvent() ); + Go( &SCH_WIRE_BUS_TOOL::DrawWires, SCH_ACTIONS::drawWire.MakeEvent() ); + Go( &SCH_WIRE_BUS_TOOL::DrawBusses, SCH_ACTIONS::drawBus.MakeEvent() ); + Go( &SCH_WIRE_BUS_TOOL::DrawLines, SCH_ACTIONS::drawLines.MakeEvent() ); - Go( &SCH_WIRE_BUS_TOOL::StartWire, SCH_ACTIONS::startWire.MakeEvent() ); - Go( &SCH_WIRE_BUS_TOOL::StartBus, SCH_ACTIONS::startBus.MakeEvent() ); - Go( &SCH_WIRE_BUS_TOOL::StartLines, SCH_ACTIONS::startLines.MakeEvent() ); + Go( &SCH_WIRE_BUS_TOOL::StartWire, SCH_ACTIONS::startWire.MakeEvent() ); + Go( &SCH_WIRE_BUS_TOOL::StartBus, SCH_ACTIONS::startBus.MakeEvent() ); + Go( &SCH_WIRE_BUS_TOOL::StartLine, SCH_ACTIONS::startLines.MakeEvent() ); - Go( &SCH_WIRE_BUS_TOOL::UnfoldBus, SCH_ACTIONS::unfoldBus.MakeEvent() ); + Go( &SCH_WIRE_BUS_TOOL::UnfoldBus, SCH_ACTIONS::unfoldBus.MakeEvent() ); } diff --git a/eeschema/tools/sch_wire_bus_tool.h b/eeschema/tools/sch_wire_bus_tool.h index ecc4617d2d..7c47ccc5d0 100644 --- a/eeschema/tools/sch_wire_bus_tool.h +++ b/eeschema/tools/sch_wire_bus_tool.h @@ -72,12 +72,20 @@ public: ///> Get the SCH_LINE_DRAWING_TOOL top-level context menu inline TOOL_MENU& GetToolMenu() { return m_menu; } + /* + * These are the immediate actions. They start drawing at the mouse location. They + * do not select the tool. + */ int StartWire( const TOOL_EVENT& aEvent ); int StartBus( const TOOL_EVENT& aEvent ); - int StartLines( const TOOL_EVENT& aEvent ); + int StartLine( const TOOL_EVENT& aEvent ); - int DrawWire( const TOOL_EVENT& aEvent ); - int DrawBus( const TOOL_EVENT& aEvent ); + /* + * These are the two-step actions. They select the tool on the first call, and start + * drawing on subsequent calls. + */ + int DrawWires( const TOOL_EVENT& aEvent ); + int DrawBusses( const TOOL_EVENT& aEvent ); int DrawLines( const TOOL_EVENT& aEvent ); int UnfoldBus( const TOOL_EVENT& aEvent ); diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 262e6dcce8..24aca52cd7 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -309,10 +309,10 @@ set( PCBNEW_CLASS_SRCS specctra_import_export/specctra_keywords.cpp target_edit.cpp text_mod_grid_table.cpp - tool_footprint_editor.cpp - tool_footprint_viewer.cpp - tool_onrightclick.cpp - tool_pcb_editor.cpp + toolbars_footprint_editor.cpp + toolbars_footprint_viewer.cpp + toolbar_onrightclick.cpp + toolbars_pcb_editor.cpp toolbars_update_user_interface.cpp tracks_cleaner.cpp undo_redo.cpp diff --git a/pcbnew/tool_onrightclick.cpp b/pcbnew/toolbar_onrightclick.cpp similarity index 100% rename from pcbnew/tool_onrightclick.cpp rename to pcbnew/toolbar_onrightclick.cpp diff --git a/pcbnew/tool_footprint_editor.cpp b/pcbnew/toolbars_footprint_editor.cpp similarity index 100% rename from pcbnew/tool_footprint_editor.cpp rename to pcbnew/toolbars_footprint_editor.cpp diff --git a/pcbnew/tool_footprint_viewer.cpp b/pcbnew/toolbars_footprint_viewer.cpp similarity index 100% rename from pcbnew/tool_footprint_viewer.cpp rename to pcbnew/toolbars_footprint_viewer.cpp diff --git a/pcbnew/tool_pcb_editor.cpp b/pcbnew/toolbars_pcb_editor.cpp similarity index 100% rename from pcbnew/tool_pcb_editor.cpp rename to pcbnew/toolbars_pcb_editor.cpp