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
300c066b
Commit
300c066b
authored
Sep 17, 2013
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The last fix to selection rules.
parent
867067aa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
15 deletions
+7
-15
selection_tool.cpp
pcbnew/tools/selection_tool.cpp
+7
-15
No files found.
pcbnew/tools/selection_tool.cpp
View file @
300c066b
...
...
@@ -210,11 +210,11 @@ void SELECTION_TOOL::selectSingle( const VECTOR2I& aWhere )
default
:
// Remove modules, they have to be selected by clicking on area that does not
// contain anything but module footprint
for
(
int
i
=
0
;
i
<
collector
.
GetCount
();
++
i
)
// contain anything but module footprint
and not selectable items
for
(
int
i
=
collector
.
GetCount
()
-
1
;
i
>=
0
;
--
i
)
{
BOARD_ITEM
*
boardItem
=
(
collector
)[
i
];
if
(
boardItem
->
Type
()
==
PCB_MODULE_T
)
if
(
boardItem
->
Type
()
==
PCB_MODULE_T
||
!
selectable
(
boardItem
)
)
collector
.
Remove
(
i
);
}
...
...
@@ -223,7 +223,7 @@ void SELECTION_TOOL::selectSingle( const VECTOR2I& aWhere )
{
toggleSelection
(
collector
[
0
]
);
}
else
else
if
(
collector
.
GetCount
()
>
1
)
{
item
=
disambiguationMenu
(
&
collector
);
if
(
item
)
...
...
@@ -345,22 +345,14 @@ BOARD_ITEM* SELECTION_TOOL::disambiguationMenu( GENERAL_COLLECTOR* aCollector )
int
limit
=
std
::
min
(
10
,
aCollector
->
GetCount
()
);
int
addedItems
=
0
;
for
(
int
i
=
0
;
i
<
limit
;
++
i
)
{
wxString
text
;
BOARD_ITEM
*
item
=
(
*
aCollector
)[
i
];
if
(
selectable
(
item
)
)
{
text
=
item
->
GetSelectMenuText
();
m_menu
->
Add
(
text
,
i
);
addedItems
++
;
}
}
if
(
addedItems
==
0
)
// none of items was selectable
return
NULL
;
SetContextMenu
(
m_menu
.
get
(),
CMENU_NOW
);
while
(
OPT_TOOL_EVENT
evt
=
Wait
()
)
...
...
@@ -411,7 +403,6 @@ BOARD_ITEM* SELECTION_TOOL::disambiguationMenu( GENERAL_COLLECTOR* aCollector )
bool
SELECTION_TOOL
::
selectable
(
const
BOARD_ITEM
*
aItem
)
{
BOARD
*
board
=
getModel
<
BOARD
>
(
PCB_T
);
bool
highContrast
=
getView
()
->
GetPainter
()
->
GetSettings
()
->
GetHighContrast
();
if
(
highContrast
)
...
...
@@ -437,6 +428,7 @@ bool SELECTION_TOOL::selectable( const BOARD_ITEM* aItem )
return
false
;
}
BOARD
*
board
=
getModel
<
BOARD
>
(
PCB_T
);
switch
(
aItem
->
Type
()
)
{
case
PCB_VIA_T
:
...
...
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