Commit a6dac245 authored by Maciej Suminski's avatar Maciej Suminski
Browse files

Removed TOOL_ACTIONs: selectionSingle, selectionClear. SELECTION_TOOL methods...

Removed TOOL_ACTIONs: selectionSingle, selectionClear. SELECTION_TOOL methods are called directly instead.
parent dfc052d5
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@

#include <tool/context_menu.h>
#include <tools/common_actions.h>
#include <tools/selection_tool.h>

#include <ratsnest_data.h>

@@ -636,7 +637,7 @@ int ROUTER_TOOL::Main( TOOL_EVENT& aEvent )
    BOARD_DESIGN_SETTINGS& bds = board->GetDesignSettings();

    // Deselect all items
    m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear );
    m_toolMgr->GetTool<SELECTION_TOOL>()->ClearSelection();

    getEditFrame<PCB_EDIT_FRAME>()->SetToolID( ID_TRACK_BUTT, wxCURSOR_PENCIL,
                                               _( "Interactive Router" ) );
+0 −5
Original line number Diff line number Diff line
@@ -31,11 +31,6 @@
TOOL_ACTION COMMON_ACTIONS::selectionActivate( "pcbnew.InteractiveSelection",
        AS_GLOBAL, 0, "", "" );    // No description, it is not supposed to be shown anywhere

TOOL_ACTION COMMON_ACTIONS::selectionSingle( "pcbnew.InteractiveSelection.Single",
        AS_GLOBAL, 0, "", "" );    // No description, it is not supposed to be shown anywhere

TOOL_ACTION COMMON_ACTIONS::selectionClear( "pcbnew.InteractiveSelection.Clear",
        AS_GLOBAL, 0, "", "" );    // No description, it is not supposed to be shown anywhere

// Edit tool actions
TOOL_ACTION COMMON_ACTIONS::editActivate( "pcbnew.InteractiveEdit",
+0 −6
Original line number Diff line number Diff line
@@ -37,12 +37,6 @@ public:
    /// Activation of the selection tool
    static TOOL_ACTION selectionActivate;

    /// Select a single item under the cursor position
    static TOOL_ACTION selectionSingle;

    /// Clears the current selection
    static TOOL_ACTION selectionClear;

    // Edit Tool
    /// Activation of the edit tool
    static TOOL_ACTION editActivate;
+8 −7
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@
#include <gal/graphics_abstraction_layer.h>
#include <tool/tool_manager.h>
#include <router/direction.h>
#include "selection_tool.h"

#include <class_board.h>
#include <class_drawsegment.h>
@@ -102,7 +103,7 @@ int DRAWING_TOOL::DrawArc( TOOL_EVENT& aEvent )
    KIGFX::VIEW_GROUP preview( m_view );
    m_view->Add( &preview );

    m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear );
    m_toolMgr->GetTool<SELECTION_TOOL>()->ClearSelection();
    m_controls->ShowCursor( true );
    m_controls->SetSnapping( true );

@@ -288,7 +289,7 @@ int DRAWING_TOOL::PlaceText( TOOL_EVENT& aEvent )
    KIGFX::VIEW_GROUP preview( m_view );
    m_view->Add( &preview );

    m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear );
    m_toolMgr->GetTool<SELECTION_TOOL>()->ClearSelection();
    m_controls->ShowCursor( true );
    m_controls->SetSnapping( true );
    m_controls->SetAutoPan( true );
@@ -394,7 +395,7 @@ int DRAWING_TOOL::DrawDimension( TOOL_EVENT& aEvent )
    KIGFX::VIEW_GROUP preview( m_view );
    m_view->Add( &preview );

    m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear );
    m_toolMgr->GetTool<SELECTION_TOOL>()->ClearSelection();
    m_controls->ShowCursor( true );
    m_controls->SetSnapping( true );

@@ -590,7 +591,7 @@ int DRAWING_TOOL::PlaceTarget( TOOL_EVENT& aEvent )
    m_view->Add( &preview );
    preview.ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY );

    m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear );
    m_toolMgr->GetTool<SELECTION_TOOL>()->ClearSelection();
    m_controls->SetSnapping( true );
    m_controls->SetAutoPan( true );

@@ -665,7 +666,7 @@ int DRAWING_TOOL::PlaceModule( TOOL_EVENT& aEvent )
    KIGFX::VIEW_GROUP preview( m_view );
    m_view->Add( &preview );

    m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear );
    m_toolMgr->GetTool<SELECTION_TOOL>()->ClearSelection();
    m_controls->ShowCursor( true );
    m_controls->SetSnapping( true );
    m_controls->SetAutoPan( true );
@@ -776,7 +777,7 @@ int DRAWING_TOOL::drawSegment( int aShape, bool aContinous )
    KIGFX::VIEW_GROUP preview( m_view );
    m_view->Add( &preview );

    m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear );
    m_toolMgr->GetTool<SELECTION_TOOL>()->ClearSelection();
    m_controls->ShowCursor( true );
    m_controls->SetSnapping( true );

@@ -952,7 +953,7 @@ int DRAWING_TOOL::drawZone( bool aKeepout )
    KIGFX::VIEW_GROUP preview( m_view );
    m_view->Add( &preview );

    m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear );
    m_toolMgr->GetTool<SELECTION_TOOL>()->ClearSelection();
    m_controls->ShowCursor( true );
    m_controls->SetSnapping( true );

+8 −8
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ EDIT_TOOL::EDIT_TOOL() :
bool EDIT_TOOL::Init()
{
    // Find the selection tool, so they can cooperate
    m_selectionTool = static_cast<SELECTION_TOOL*>( m_toolMgr->FindTool( "pcbnew.InteractiveSelection" ) );
    m_selectionTool = m_toolMgr->GetTool<SELECTION_TOOL>();

    if( !m_selectionTool )
    {
@@ -198,7 +198,7 @@ int EDIT_TOOL::Main( TOOL_EVENT& aEvent )
    }

    if( unselect )
        m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear );
        m_selectionTool->ClearSelection();

    RN_DATA* ratsnest = getModel<BOARD>()->GetRatsnest();
    ratsnest->ClearSimple();
@@ -252,7 +252,7 @@ int EDIT_TOOL::Properties( TOOL_EVENT& aEvent )
        std::vector<PICKED_ITEMS_LIST*>& undoList = editFrame->GetScreen()->m_UndoList.m_CommandsList;

        // Some of properties dialogs alter pointers, so we should deselect them
        m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear );
        m_selectionTool->ClearSelection();
        STATUS_FLAGS flags = item->GetFlags();
        item->ClearFlags();

@@ -279,7 +279,7 @@ int EDIT_TOOL::Properties( TOOL_EVENT& aEvent )
    }

    if( unselect )
        m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear );
        m_selectionTool->ClearSelection();

    setTransitions();

@@ -332,7 +332,7 @@ int EDIT_TOOL::Rotate( TOOL_EVENT& aEvent )
        getModel<BOARD>()->GetRatsnest()->Recalculate();

    if( unselect )
        m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear );
        m_selectionTool->ClearSelection();

    m_toolMgr->RunAction( COMMON_ACTIONS::pointEditorUpdate );
    setTransitions();
@@ -386,7 +386,7 @@ int EDIT_TOOL::Flip( TOOL_EVENT& aEvent )
        getModel<BOARD>()->GetRatsnest()->Recalculate();

    if( unselect )
        m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear );
        m_selectionTool->ClearSelection();

    m_toolMgr->RunAction( COMMON_ACTIONS::pointEditorUpdate );
    setTransitions();
@@ -411,7 +411,7 @@ int EDIT_TOOL::Remove( TOOL_EVENT& aEvent )
    PCB_EDIT_FRAME* editFrame = getEditFrame<PCB_EDIT_FRAME>();

    // As we are about to remove items, they have to be removed from the selection first
    m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear );
    m_selectionTool->ClearSelection();

    // Save them
    for( unsigned int i = 0; i < selectedItems.GetCount(); ++i )
@@ -529,7 +529,7 @@ wxPoint EDIT_TOOL::getModificationPoint( const SELECTION_TOOL::SELECTION& aSelec
bool EDIT_TOOL::makeSelection( const SELECTION_TOOL::SELECTION& aSelection )
{
    if( aSelection.Empty() )                        // Try to find an item that could be modified
        m_toolMgr->RunAction( COMMON_ACTIONS::selectionSingle );
        m_selectionTool->SelectSingle( getView()->ToWorld( getViewControls()->GetMousePosition() ) );

    return !aSelection.Empty();
}
Loading