Loading pcbnew/tools/common_actions.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ TOOL_ACTION COMMON_ACTIONS::selectionActivate( "pcbnew.InteractiveSelection", AS_GLOBAL, 0, "", "", AF_ACTIVATE ); // No description, it is not supposed to be shown anywhere TOOL_ACTION COMMON_ACTIONS::selectionSingle( "pcbnew.InteractiveSelection.Single", TOOL_ACTION COMMON_ACTIONS::selectionCursor( "pcbnew.InteractiveSelection.Cursor", AS_GLOBAL, 0, "", "" ); // No description, it is not supposed to be shown anywhere Loading pcbnew/tools/common_actions.h +1 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ public: static TOOL_ACTION selectionActivate; /// Select a single item under the cursor position static TOOL_ACTION selectionSingle; static TOOL_ACTION selectionCursor; /// Clears the current selection static TOOL_ACTION selectionClear; Loading pcbnew/tools/edit_tool.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -581,7 +581,7 @@ wxPoint EDIT_TOOL::getModificationPoint( const SELECTION& aSelection ) bool EDIT_TOOL::makeSelection( const SELECTION& aSelection ) { if( aSelection.Empty() ) // Try to find an item that could be modified m_toolMgr->RunAction( COMMON_ACTIONS::selectionSingle, true ); m_toolMgr->RunAction( COMMON_ACTIONS::selectionCursor, true ); return !aSelection.Empty(); } Loading pcbnew/tools/selection_tool.cpp +10 −10 Original line number Diff line number Diff line Loading @@ -111,7 +111,7 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent ) if( !m_additive ) clearSelection(); selectSingle( evt->Position() ); selectCursor( evt->Position() ); } } Loading @@ -119,7 +119,7 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent ) else if( evt->IsClick( BUT_RIGHT ) ) { if( m_selection.Empty() ) selectSingle( evt->Position() ); selectCursor( evt->Position() ); generateMenu(); } Loading @@ -128,7 +128,7 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent ) else if( evt->IsDblClick( BUT_LEFT ) ) { if( m_selection.Empty() ) selectSingle( evt->Position() ); selectCursor( evt->Position() ); m_toolMgr->RunAction( COMMON_ACTIONS::properties ); } Loading @@ -143,7 +143,7 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent ) else if( m_selection.Empty() ) { // There is nothing selected, so try to select something if( !selectSingle( getView()->ToWorld( getViewControls()->GetMousePosition() ), false ) ) if( !selectCursor( getView()->ToWorld( getViewControls()->GetMousePosition() ), false ) ) { // If nothings has been selected or user wants to select more // draw the selection box Loading Loading @@ -171,10 +171,10 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent ) } } else if( evt->IsAction( &COMMON_ACTIONS::selectionSingle ) ) else if( evt->IsAction( &COMMON_ACTIONS::selectionCursor ) ) { // GetMousePosition() is used, as it is independent of snapping settings selectSingle( getView()->ToWorld( getViewControls()->GetMousePosition() ) ); selectCursor( getView()->ToWorld( getViewControls()->GetMousePosition() ) ); } else if( evt->IsAction( &COMMON_ACTIONS::find ) ) Loading Loading @@ -245,7 +245,7 @@ void SELECTION_TOOL::toggleSelection( BOARD_ITEM* aItem ) } bool SELECTION_TOOL::selectSingle( const VECTOR2I& aWhere, bool aAllowDisambiguation ) bool SELECTION_TOOL::selectCursor( const VECTOR2I& aWhere, bool aAllowDisambiguation ) { BOARD_ITEM* item; GENERAL_COLLECTORS_GUIDE guide = m_frame->GetCollectorsGuide(); Loading Loading @@ -395,7 +395,7 @@ bool SELECTION_TOOL::selectMultiple() void SELECTION_TOOL::setTransitions() { Go( &SELECTION_TOOL::Main, COMMON_ACTIONS::selectionActivate.MakeEvent() ); Go( &SELECTION_TOOL::SingleSelection, COMMON_ACTIONS::selectionSingle.MakeEvent() ); Go( &SELECTION_TOOL::CursorSelection, COMMON_ACTIONS::selectionCursor.MakeEvent() ); Go( &SELECTION_TOOL::ClearSelection, COMMON_ACTIONS::selectionClear.MakeEvent() ); Go( &SELECTION_TOOL::find, COMMON_ACTIONS::find.MakeEvent() ); Go( &SELECTION_TOOL::findMove, COMMON_ACTIONS::findMove.MakeEvent() ); Loading Loading @@ -444,9 +444,9 @@ bool SELECTION_TOOL::CheckLock() } int SELECTION_TOOL::SingleSelection( TOOL_EVENT& aEvent ) int SELECTION_TOOL::CursorSelection( TOOL_EVENT& aEvent ) { selectSingle( getView()->ToWorld( getViewControls()->GetMousePosition() ) ); selectCursor( getView()->ToWorld( getViewControls()->GetMousePosition() ) ); setTransitions(); return 0; Loading pcbnew/tools/selection_tool.h +5 −5 Original line number Diff line number Diff line Loading @@ -151,8 +151,8 @@ public: ///> Checks if the user has agreed to modify locked items for the given selection. bool CheckLock(); ///> Select single item event handler. int SingleSelection( TOOL_EVENT& aEvent ); ///> Select a single item under cursor event handler. int CursorSelection( TOOL_EVENT& aEvent ); ///> Clear current selection event handler. int ClearSelection( TOOL_EVENT& aEvent ); Loading @@ -168,7 +168,7 @@ public: private: /** * Function selectSingle() * Function selectCursor() * Selects an item pointed by the parameter aWhere. If there is more than one item at that * place, there is a menu displayed that allows to choose the item. * Loading @@ -177,7 +177,7 @@ private: * a menu is shown, otherise function finishes without selecting anything. * @return True if an item was selected, false otherwise. */ bool selectSingle( const VECTOR2I& aWhere, bool aAllowDisambiguation = true ); bool selectCursor( const VECTOR2I& aWhere, bool aAllowDisambiguation = true ); /** * Function selectMultiple() Loading Loading @@ -208,7 +208,7 @@ private: /** * Function disambiguationMenu() * Handles the menu that allows to select one of many items in case there is more than one * item at the selected point (@see selectSingle()). * item at the selected point (@see selectCursor()). * * @param aItems contains list of items that are displayed to the user. */ Loading Loading
pcbnew/tools/common_actions.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ TOOL_ACTION COMMON_ACTIONS::selectionActivate( "pcbnew.InteractiveSelection", AS_GLOBAL, 0, "", "", AF_ACTIVATE ); // No description, it is not supposed to be shown anywhere TOOL_ACTION COMMON_ACTIONS::selectionSingle( "pcbnew.InteractiveSelection.Single", TOOL_ACTION COMMON_ACTIONS::selectionCursor( "pcbnew.InteractiveSelection.Cursor", AS_GLOBAL, 0, "", "" ); // No description, it is not supposed to be shown anywhere Loading
pcbnew/tools/common_actions.h +1 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ public: static TOOL_ACTION selectionActivate; /// Select a single item under the cursor position static TOOL_ACTION selectionSingle; static TOOL_ACTION selectionCursor; /// Clears the current selection static TOOL_ACTION selectionClear; Loading
pcbnew/tools/edit_tool.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -581,7 +581,7 @@ wxPoint EDIT_TOOL::getModificationPoint( const SELECTION& aSelection ) bool EDIT_TOOL::makeSelection( const SELECTION& aSelection ) { if( aSelection.Empty() ) // Try to find an item that could be modified m_toolMgr->RunAction( COMMON_ACTIONS::selectionSingle, true ); m_toolMgr->RunAction( COMMON_ACTIONS::selectionCursor, true ); return !aSelection.Empty(); } Loading
pcbnew/tools/selection_tool.cpp +10 −10 Original line number Diff line number Diff line Loading @@ -111,7 +111,7 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent ) if( !m_additive ) clearSelection(); selectSingle( evt->Position() ); selectCursor( evt->Position() ); } } Loading @@ -119,7 +119,7 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent ) else if( evt->IsClick( BUT_RIGHT ) ) { if( m_selection.Empty() ) selectSingle( evt->Position() ); selectCursor( evt->Position() ); generateMenu(); } Loading @@ -128,7 +128,7 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent ) else if( evt->IsDblClick( BUT_LEFT ) ) { if( m_selection.Empty() ) selectSingle( evt->Position() ); selectCursor( evt->Position() ); m_toolMgr->RunAction( COMMON_ACTIONS::properties ); } Loading @@ -143,7 +143,7 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent ) else if( m_selection.Empty() ) { // There is nothing selected, so try to select something if( !selectSingle( getView()->ToWorld( getViewControls()->GetMousePosition() ), false ) ) if( !selectCursor( getView()->ToWorld( getViewControls()->GetMousePosition() ), false ) ) { // If nothings has been selected or user wants to select more // draw the selection box Loading Loading @@ -171,10 +171,10 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent ) } } else if( evt->IsAction( &COMMON_ACTIONS::selectionSingle ) ) else if( evt->IsAction( &COMMON_ACTIONS::selectionCursor ) ) { // GetMousePosition() is used, as it is independent of snapping settings selectSingle( getView()->ToWorld( getViewControls()->GetMousePosition() ) ); selectCursor( getView()->ToWorld( getViewControls()->GetMousePosition() ) ); } else if( evt->IsAction( &COMMON_ACTIONS::find ) ) Loading Loading @@ -245,7 +245,7 @@ void SELECTION_TOOL::toggleSelection( BOARD_ITEM* aItem ) } bool SELECTION_TOOL::selectSingle( const VECTOR2I& aWhere, bool aAllowDisambiguation ) bool SELECTION_TOOL::selectCursor( const VECTOR2I& aWhere, bool aAllowDisambiguation ) { BOARD_ITEM* item; GENERAL_COLLECTORS_GUIDE guide = m_frame->GetCollectorsGuide(); Loading Loading @@ -395,7 +395,7 @@ bool SELECTION_TOOL::selectMultiple() void SELECTION_TOOL::setTransitions() { Go( &SELECTION_TOOL::Main, COMMON_ACTIONS::selectionActivate.MakeEvent() ); Go( &SELECTION_TOOL::SingleSelection, COMMON_ACTIONS::selectionSingle.MakeEvent() ); Go( &SELECTION_TOOL::CursorSelection, COMMON_ACTIONS::selectionCursor.MakeEvent() ); Go( &SELECTION_TOOL::ClearSelection, COMMON_ACTIONS::selectionClear.MakeEvent() ); Go( &SELECTION_TOOL::find, COMMON_ACTIONS::find.MakeEvent() ); Go( &SELECTION_TOOL::findMove, COMMON_ACTIONS::findMove.MakeEvent() ); Loading Loading @@ -444,9 +444,9 @@ bool SELECTION_TOOL::CheckLock() } int SELECTION_TOOL::SingleSelection( TOOL_EVENT& aEvent ) int SELECTION_TOOL::CursorSelection( TOOL_EVENT& aEvent ) { selectSingle( getView()->ToWorld( getViewControls()->GetMousePosition() ) ); selectCursor( getView()->ToWorld( getViewControls()->GetMousePosition() ) ); setTransitions(); return 0; Loading
pcbnew/tools/selection_tool.h +5 −5 Original line number Diff line number Diff line Loading @@ -151,8 +151,8 @@ public: ///> Checks if the user has agreed to modify locked items for the given selection. bool CheckLock(); ///> Select single item event handler. int SingleSelection( TOOL_EVENT& aEvent ); ///> Select a single item under cursor event handler. int CursorSelection( TOOL_EVENT& aEvent ); ///> Clear current selection event handler. int ClearSelection( TOOL_EVENT& aEvent ); Loading @@ -168,7 +168,7 @@ public: private: /** * Function selectSingle() * Function selectCursor() * Selects an item pointed by the parameter aWhere. If there is more than one item at that * place, there is a menu displayed that allows to choose the item. * Loading @@ -177,7 +177,7 @@ private: * a menu is shown, otherise function finishes without selecting anything. * @return True if an item was selected, false otherwise. */ bool selectSingle( const VECTOR2I& aWhere, bool aAllowDisambiguation = true ); bool selectCursor( const VECTOR2I& aWhere, bool aAllowDisambiguation = true ); /** * Function selectMultiple() Loading Loading @@ -208,7 +208,7 @@ private: /** * Function disambiguationMenu() * Handles the menu that allows to select one of many items in case there is more than one * item at the selected point (@see selectSingle()). * item at the selected point (@see selectCursor()). * * @param aItems contains list of items that are displayed to the user. */ Loading