Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
62e2537e
Commit
62e2537e
authored
Nov 21, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
selection_tool: Renamed selectSingle to selectCursor.
parent
18898fe8
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
18 deletions
+18
-18
common_actions.cpp
pcbnew/tools/common_actions.cpp
+1
-1
common_actions.h
pcbnew/tools/common_actions.h
+1
-1
edit_tool.cpp
pcbnew/tools/edit_tool.cpp
+1
-1
selection_tool.cpp
pcbnew/tools/selection_tool.cpp
+10
-10
selection_tool.h
pcbnew/tools/selection_tool.h
+5
-5
No files found.
pcbnew/tools/common_actions.cpp
View file @
62e2537e
...
@@ -32,7 +32,7 @@ TOOL_ACTION COMMON_ACTIONS::selectionActivate( "pcbnew.InteractiveSelection",
...
@@ -32,7 +32,7 @@ TOOL_ACTION COMMON_ACTIONS::selectionActivate( "pcbnew.InteractiveSelection",
AS_GLOBAL
,
0
,
AS_GLOBAL
,
0
,
""
,
""
,
AF_ACTIVATE
);
// No description, it is not supposed to be shown anywhere
""
,
""
,
AF_ACTIVATE
);
// No description, it is not supposed to be shown anywhere
TOOL_ACTION
COMMON_ACTIONS
::
selection
Single
(
"pcbnew.InteractiveSelection.Single
"
,
TOOL_ACTION
COMMON_ACTIONS
::
selection
Cursor
(
"pcbnew.InteractiveSelection.Cursor
"
,
AS_GLOBAL
,
0
,
AS_GLOBAL
,
0
,
""
,
""
);
// No description, it is not supposed to be shown anywhere
""
,
""
);
// No description, it is not supposed to be shown anywhere
...
...
pcbnew/tools/common_actions.h
View file @
62e2537e
...
@@ -41,7 +41,7 @@ public:
...
@@ -41,7 +41,7 @@ public:
static
TOOL_ACTION
selectionActivate
;
static
TOOL_ACTION
selectionActivate
;
/// Select a single item under the cursor position
/// Select a single item under the cursor position
static
TOOL_ACTION
selection
Single
;
static
TOOL_ACTION
selection
Cursor
;
/// Clears the current selection
/// Clears the current selection
static
TOOL_ACTION
selectionClear
;
static
TOOL_ACTION
selectionClear
;
...
...
pcbnew/tools/edit_tool.cpp
View file @
62e2537e
...
@@ -581,7 +581,7 @@ wxPoint EDIT_TOOL::getModificationPoint( const SELECTION& aSelection )
...
@@ -581,7 +581,7 @@ wxPoint EDIT_TOOL::getModificationPoint( const SELECTION& aSelection )
bool
EDIT_TOOL
::
makeSelection
(
const
SELECTION
&
aSelection
)
bool
EDIT_TOOL
::
makeSelection
(
const
SELECTION
&
aSelection
)
{
{
if
(
aSelection
.
Empty
()
)
// Try to find an item that could be modified
if
(
aSelection
.
Empty
()
)
// Try to find an item that could be modified
m_toolMgr
->
RunAction
(
COMMON_ACTIONS
::
selection
Single
,
true
);
m_toolMgr
->
RunAction
(
COMMON_ACTIONS
::
selection
Cursor
,
true
);
return
!
aSelection
.
Empty
();
return
!
aSelection
.
Empty
();
}
}
...
...
pcbnew/tools/selection_tool.cpp
View file @
62e2537e
...
@@ -111,7 +111,7 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent )
...
@@ -111,7 +111,7 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent )
if
(
!
m_additive
)
if
(
!
m_additive
)
clearSelection
();
clearSelection
();
select
Single
(
evt
->
Position
()
);
select
Cursor
(
evt
->
Position
()
);
}
}
}
}
...
@@ -119,7 +119,7 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent )
...
@@ -119,7 +119,7 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent )
else
if
(
evt
->
IsClick
(
BUT_RIGHT
)
)
else
if
(
evt
->
IsClick
(
BUT_RIGHT
)
)
{
{
if
(
m_selection
.
Empty
()
)
if
(
m_selection
.
Empty
()
)
select
Single
(
evt
->
Position
()
);
select
Cursor
(
evt
->
Position
()
);
generateMenu
();
generateMenu
();
}
}
...
@@ -128,7 +128,7 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent )
...
@@ -128,7 +128,7 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent )
else
if
(
evt
->
IsDblClick
(
BUT_LEFT
)
)
else
if
(
evt
->
IsDblClick
(
BUT_LEFT
)
)
{
{
if
(
m_selection
.
Empty
()
)
if
(
m_selection
.
Empty
()
)
select
Single
(
evt
->
Position
()
);
select
Cursor
(
evt
->
Position
()
);
m_toolMgr
->
RunAction
(
COMMON_ACTIONS
::
properties
);
m_toolMgr
->
RunAction
(
COMMON_ACTIONS
::
properties
);
}
}
...
@@ -143,7 +143,7 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent )
...
@@ -143,7 +143,7 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent )
else
if
(
m_selection
.
Empty
()
)
else
if
(
m_selection
.
Empty
()
)
{
{
// There is nothing selected, so try to select something
// There is nothing selected, so try to select something
if
(
!
select
Single
(
getView
()
->
ToWorld
(
getViewControls
()
->
GetMousePosition
()
),
false
)
)
if
(
!
select
Cursor
(
getView
()
->
ToWorld
(
getViewControls
()
->
GetMousePosition
()
),
false
)
)
{
{
// If nothings has been selected or user wants to select more
// If nothings has been selected or user wants to select more
// draw the selection box
// draw the selection box
...
@@ -171,10 +171,10 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent )
...
@@ -171,10 +171,10 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent )
}
}
}
}
else
if
(
evt
->
IsAction
(
&
COMMON_ACTIONS
::
selection
Single
)
)
else
if
(
evt
->
IsAction
(
&
COMMON_ACTIONS
::
selection
Cursor
)
)
{
{
// GetMousePosition() is used, as it is independent of snapping settings
// GetMousePosition() is used, as it is independent of snapping settings
select
Single
(
getView
()
->
ToWorld
(
getViewControls
()
->
GetMousePosition
()
)
);
select
Cursor
(
getView
()
->
ToWorld
(
getViewControls
()
->
GetMousePosition
()
)
);
}
}
else
if
(
evt
->
IsAction
(
&
COMMON_ACTIONS
::
find
)
)
else
if
(
evt
->
IsAction
(
&
COMMON_ACTIONS
::
find
)
)
...
@@ -245,7 +245,7 @@ void SELECTION_TOOL::toggleSelection( BOARD_ITEM* aItem )
...
@@ -245,7 +245,7 @@ void SELECTION_TOOL::toggleSelection( BOARD_ITEM* aItem )
}
}
bool
SELECTION_TOOL
::
select
Single
(
const
VECTOR2I
&
aWhere
,
bool
aAllowDisambiguation
)
bool
SELECTION_TOOL
::
select
Cursor
(
const
VECTOR2I
&
aWhere
,
bool
aAllowDisambiguation
)
{
{
BOARD_ITEM
*
item
;
BOARD_ITEM
*
item
;
GENERAL_COLLECTORS_GUIDE
guide
=
m_frame
->
GetCollectorsGuide
();
GENERAL_COLLECTORS_GUIDE
guide
=
m_frame
->
GetCollectorsGuide
();
...
@@ -395,7 +395,7 @@ bool SELECTION_TOOL::selectMultiple()
...
@@ -395,7 +395,7 @@ bool SELECTION_TOOL::selectMultiple()
void
SELECTION_TOOL
::
setTransitions
()
void
SELECTION_TOOL
::
setTransitions
()
{
{
Go
(
&
SELECTION_TOOL
::
Main
,
COMMON_ACTIONS
::
selectionActivate
.
MakeEvent
()
);
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
::
ClearSelection
,
COMMON_ACTIONS
::
selectionClear
.
MakeEvent
()
);
Go
(
&
SELECTION_TOOL
::
find
,
COMMON_ACTIONS
::
find
.
MakeEvent
()
);
Go
(
&
SELECTION_TOOL
::
find
,
COMMON_ACTIONS
::
find
.
MakeEvent
()
);
Go
(
&
SELECTION_TOOL
::
findMove
,
COMMON_ACTIONS
::
findMove
.
MakeEvent
()
);
Go
(
&
SELECTION_TOOL
::
findMove
,
COMMON_ACTIONS
::
findMove
.
MakeEvent
()
);
...
@@ -444,9 +444,9 @@ bool SELECTION_TOOL::CheckLock()
...
@@ -444,9 +444,9 @@ bool SELECTION_TOOL::CheckLock()
}
}
int
SELECTION_TOOL
::
Single
Selection
(
TOOL_EVENT
&
aEvent
)
int
SELECTION_TOOL
::
Cursor
Selection
(
TOOL_EVENT
&
aEvent
)
{
{
select
Single
(
getView
()
->
ToWorld
(
getViewControls
()
->
GetMousePosition
()
)
);
select
Cursor
(
getView
()
->
ToWorld
(
getViewControls
()
->
GetMousePosition
()
)
);
setTransitions
();
setTransitions
();
return
0
;
return
0
;
...
...
pcbnew/tools/selection_tool.h
View file @
62e2537e
...
@@ -151,8 +151,8 @@ public:
...
@@ -151,8 +151,8 @@ public:
///> Checks if the user has agreed to modify locked items for the given selection.
///> Checks if the user has agreed to modify locked items for the given selection.
bool
CheckLock
();
bool
CheckLock
();
///> Select
single item
event handler.
///> Select
a single item under cursor
event handler.
int
Single
Selection
(
TOOL_EVENT
&
aEvent
);
int
Cursor
Selection
(
TOOL_EVENT
&
aEvent
);
///> Clear current selection event handler.
///> Clear current selection event handler.
int
ClearSelection
(
TOOL_EVENT
&
aEvent
);
int
ClearSelection
(
TOOL_EVENT
&
aEvent
);
...
@@ -168,7 +168,7 @@ public:
...
@@ -168,7 +168,7 @@ public:
private
:
private
:
/**
/**
* Function select
Single
()
* Function select
Cursor
()
* Selects an item pointed by the parameter aWhere. If there is more than one item at that
* 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.
* place, there is a menu displayed that allows to choose the item.
*
*
...
@@ -177,7 +177,7 @@ private:
...
@@ -177,7 +177,7 @@ private:
* a menu is shown, otherise function finishes without selecting anything.
* a menu is shown, otherise function finishes without selecting anything.
* @return True if an item was selected, false otherwise.
* @return True if an item was selected, false otherwise.
*/
*/
bool
select
Single
(
const
VECTOR2I
&
aWhere
,
bool
aAllowDisambiguation
=
true
);
bool
select
Cursor
(
const
VECTOR2I
&
aWhere
,
bool
aAllowDisambiguation
=
true
);
/**
/**
* Function selectMultiple()
* Function selectMultiple()
...
@@ -208,7 +208,7 @@ private:
...
@@ -208,7 +208,7 @@ private:
/**
/**
* Function disambiguationMenu()
* Function disambiguationMenu()
* Handles the menu that allows to select one of many items in case there is more than one
* Handles the menu that allows to select one of many items in case there is more than one
* item at the selected point (@see select
Single
()).
* item at the selected point (@see select
Cursor
()).
*
*
* @param aItems contains list of items that are displayed to the user.
* @param aItems contains list of items that are displayed to the user.
*/
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment