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
7ade7db0
Commit
7ade7db0
authored
Jul 09, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SELECTION_TOOL got a new mode to edit MODULEs.
parent
d98a5c4e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
8 deletions
+29
-8
modedit.cpp
pcbnew/modedit.cpp
+1
-1
module_editor_frame.h
pcbnew/module_editor_frame.h
+1
-1
moduleframe.cpp
pcbnew/moduleframe.cpp
+1
-0
selection_tool.cpp
pcbnew/tools/selection_tool.cpp
+12
-6
selection_tool.h
pcbnew/tools/selection_tool.h
+14
-0
No files found.
pcbnew/modedit.cpp
View file @
7ade7db0
...
...
@@ -916,7 +916,7 @@ EDA_COLOR_T FOOTPRINT_EDIT_FRAME::GetGridColor() const
}
void
FOOTPRINT_EDIT_FRAME
::
SetActiveLayer
(
LAYER_
NUM
aLayer
)
void
FOOTPRINT_EDIT_FRAME
::
SetActiveLayer
(
LAYER_
ID
aLayer
)
{
PCB_BASE_FRAME
::
SetActiveLayer
(
aLayer
);
...
...
pcbnew/module_editor_frame.h
View file @
7ade7db0
...
...
@@ -399,7 +399,7 @@ public:
virtual
EDA_COLOR_T
GetGridColor
()
const
;
///> @copydoc PCB_BASE_FRAME::SetActiveLayer()
void
SetActiveLayer
(
LAYER_
NUM
aLayer
);
void
SetActiveLayer
(
LAYER_
ID
aLayer
);
///> @copydoc EDA_DRAW_FRAME::UseGalCanvas()
virtual
void
UseGalCanvas
(
bool
aEnable
);
...
...
pcbnew/moduleframe.cpp
View file @
7ade7db0
...
...
@@ -271,6 +271,7 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
drawPanel
->
SetEventDispatcher
(
m_toolDispatcher
);
m_toolManager
->
RegisterTool
(
new
SELECTION_TOOL
);
m_toolManager
->
GetTool
<
SELECTION_TOOL
>
()
->
EditModules
(
true
);
m_toolManager
->
RegisterTool
(
new
EDIT_TOOL
);
m_toolManager
->
RegisterTool
(
new
DRAWING_TOOL
);
m_toolManager
->
RegisterTool
(
new
POINT_EDITOR
);
...
...
pcbnew/tools/selection_tool.cpp
View file @
7ade7db0
...
...
@@ -54,7 +54,7 @@ SELECTION_TOOL::SELECTION_TOOL() :
SelectedEvent
(
TC_MESSAGE
,
TA_ACTION
,
"pcbnew.InteractiveSelection.selected"
),
DeselectedEvent
(
TC_MESSAGE
,
TA_ACTION
,
"pcbnew.InteractiveSelection.deselected"
),
ClearedEvent
(
TC_MESSAGE
,
TA_ACTION
,
"pcbnew.InteractiveSelection.cleared"
),
m_additive
(
false
),
m_multiple
(
false
)
m_additive
(
false
),
m_multiple
(
false
)
,
m_editModules
(
false
)
{
m_selArea
=
new
SELECTION_AREA
;
m_selection
.
group
=
new
KIGFX
::
VIEW_GROUP
;
...
...
@@ -189,8 +189,12 @@ bool SELECTION_TOOL::SelectSingle( const VECTOR2I& aWhere, bool aAllowDisambigua
GENERAL_COLLECTOR
collector
;
const
KICAD_T
types
[]
=
{
PCB_TRACE_T
,
PCB_VIA_T
,
PCB_LINE_T
,
EOT
};
// preferred types
collector
.
Collect
(
getModel
<
BOARD
>
(),
GENERAL_COLLECTOR
::
AllBoardItems
,
wxPoint
(
aWhere
.
x
,
aWhere
.
y
),
guide
);
if
(
m_editModules
)
collector
.
Collect
(
getModel
<
BOARD
>
(),
GENERAL_COLLECTOR
::
ModulesAndTheirItems
,
wxPoint
(
aWhere
.
x
,
aWhere
.
y
),
guide
);
else
collector
.
Collect
(
getModel
<
BOARD
>
(),
GENERAL_COLLECTOR
::
AllBoardItems
,
wxPoint
(
aWhere
.
x
,
aWhere
.
y
),
guide
);
switch
(
collector
.
GetCount
()
)
{
...
...
@@ -532,23 +536,25 @@ bool SELECTION_TOOL::selectable( const BOARD_ITEM* aItem ) const
case
PCB_MODULE_T
:
if
(
aItem
->
IsOnLayer
(
F_Cu
)
&&
board
->
IsElementVisible
(
MOD_FR_VISIBLE
)
)
return
true
;
return
!
m_editModules
;
if
(
aItem
->
IsOnLayer
(
B_Cu
)
&&
board
->
IsElementVisible
(
MOD_BK_VISIBLE
)
)
return
true
;
return
!
m_editModules
;
return
false
;
break
;
case
PCB_MODULE_TEXT_T
:
if
(
m_multiple
)
if
(
m_multiple
&&
!
m_editModules
)
return
false
;
break
;
// These are not selectable
case
PCB_MODULE_EDGE_T
:
case
PCB_PAD_T
:
return
m_editModules
;
case
NOT_USED
:
case
TYPE_NOT_INIT
:
return
false
;
...
...
pcbnew/tools/selection_tool.h
View file @
7ade7db0
...
...
@@ -139,6 +139,17 @@ public:
*/
void
AddMenuItem
(
const
TOOL_ACTION
&
aAction
);
/**
* Function EditModules()
* Toggles edit module mode. When enabled, one may select parts of modules individually
* (graphics, pads, etc.), so they can be modified.
* @param aEnabled decides if the mode should be enabled.
*/
void
EditModules
(
bool
aEnabled
)
{
m_editModules
=
aEnabled
;
}
///> Event sent after an item is selected.
const
TOOL_EVENT
SelectedEvent
;
...
...
@@ -260,6 +271,9 @@ private:
/// Right click popup menu
CONTEXT_MENU
m_menu
;
/// Edit module mode flag
bool
m_editModules
;
};
#endif
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