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
2cb6e59d
Commit
2cb6e59d
authored
Aug 08, 2013
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Multiple items selection tool.
parent
80901c69
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
selection_tool.cpp
pcbnew/tools/selection_tool.cpp
+21
-0
No files found.
pcbnew/tools/selection_tool.cpp
View file @
2cb6e59d
...
...
@@ -197,6 +197,7 @@ void SELECTION_TOOL::selectMultiple()
if
(
evt
->
IsDrag
(
MB_Left
)
)
{
// Start drawing a selection box
m_selArea
->
SetOrigin
(
evt
->
DragOrigin
()
);
m_selArea
->
SetEnd
(
evt
->
Position
()
);
m_selArea
->
ViewSetVisible
(
true
);
...
...
@@ -205,7 +206,27 @@ void SELECTION_TOOL::selectMultiple()
if
(
evt
->
IsMouseUp
(
MB_Left
)
)
{
// End drawing a selection box
m_selArea
->
ViewSetVisible
(
false
);
// Mark items within a box as selected
std
::
vector
<
VIEW
::
LayerItemPair
>
selectedItems
;
BOX2I
selectionBox
=
m_selArea
->
ViewBBox
();
v
->
Query
(
selectionBox
,
selectedItems
);
std
::
vector
<
VIEW
::
LayerItemPair
>::
iterator
it
,
it_end
;
for
(
it
=
selectedItems
.
begin
(),
it_end
=
selectedItems
.
end
();
it
!=
it_end
;
++
it
)
{
BOARD_ITEM
*
item
=
static_cast
<
BOARD_ITEM
*>
(
it
->
first
);
// Add only those items which are fully within a selection box
if
(
selectionBox
.
Contains
(
item
->
ViewBBox
()
)
)
{
item
->
SetSelected
();
m_selectedItems
.
insert
(
item
);
}
}
break
;
}
}
...
...
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