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
d613da8b
Commit
d613da8b
authored
Dec 19, 2013
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Module texts are undo/redoable.
parent
7ce91d4e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
1 deletion
+30
-1
board_undo_redo.cpp
pcbnew/board_undo_redo.cpp
+25
-0
selection_tool.cpp
pcbnew/tools/selection_tool.cpp
+5
-1
No files found.
pcbnew/board_undo_redo.cpp
View file @
d613da8b
...
@@ -295,6 +295,17 @@ void PCB_EDIT_FRAME::SaveCopyInUndoList( BOARD_ITEM* aItem,
...
@@ -295,6 +295,17 @@ void PCB_EDIT_FRAME::SaveCopyInUndoList( BOARD_ITEM* aItem,
if
(
aItem
==
NULL
)
// Nothing to save
if
(
aItem
==
NULL
)
// Nothing to save
return
;
return
;
// For texts belonging to modules, we need to save state of the parent module
if
(
aItem
->
Type
()
==
PCB_MODULE_TEXT_T
)
{
aItem
=
aItem
->
GetParent
();
wxASSERT
(
aItem
->
Type
()
==
PCB_MODULE_T
);
aCommandType
=
UR_CHANGED
;
if
(
aItem
==
NULL
)
return
;
}
PICKED_ITEMS_LIST
*
commandToUndo
=
new
PICKED_ITEMS_LIST
();
PICKED_ITEMS_LIST
*
commandToUndo
=
new
PICKED_ITEMS_LIST
();
commandToUndo
->
m_TransformPoint
=
aTransformPoint
;
commandToUndo
->
m_TransformPoint
=
aTransformPoint
;
...
@@ -364,6 +375,20 @@ void PCB_EDIT_FRAME::SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsList,
...
@@ -364,6 +375,20 @@ void PCB_EDIT_FRAME::SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsList,
for
(
unsigned
ii
=
0
;
ii
<
commandToUndo
->
GetCount
();
ii
++
)
for
(
unsigned
ii
=
0
;
ii
<
commandToUndo
->
GetCount
();
ii
++
)
{
{
BOARD_ITEM
*
item
=
(
BOARD_ITEM
*
)
commandToUndo
->
GetPickedItem
(
ii
);
BOARD_ITEM
*
item
=
(
BOARD_ITEM
*
)
commandToUndo
->
GetPickedItem
(
ii
);
// For texts belonging to modules, we need to save state of the parent module
if
(
item
->
Type
()
==
PCB_MODULE_TEXT_T
)
{
item
=
item
->
GetParent
();
wxASSERT
(
item
->
Type
()
==
PCB_MODULE_T
);
if
(
item
==
NULL
)
continue
;
commandToUndo
->
SetPickedItem
(
item
,
ii
);
commandToUndo
->
SetPickedItemStatus
(
UR_CHANGED
,
ii
);
}
UNDO_REDO_T
command
=
commandToUndo
->
GetPickedItemStatus
(
ii
);
UNDO_REDO_T
command
=
commandToUndo
->
GetPickedItemStatus
(
ii
);
if
(
command
==
UR_UNSPECIFIED
)
if
(
command
==
UR_UNSPECIFIED
)
...
...
pcbnew/tools/selection_tool.cpp
View file @
d613da8b
...
@@ -463,9 +463,13 @@ bool SELECTION_TOOL::selectable( const BOARD_ITEM* aItem ) const
...
@@ -463,9 +463,13 @@ bool SELECTION_TOOL::selectable( const BOARD_ITEM* aItem ) const
break
;
break
;
case
PCB_MODULE_TEXT_T
:
if
(
m_multiple
)
return
false
;
break
;
// These are not selectable
// These are not selectable
case
PCB_MODULE_EDGE_T
:
case
PCB_MODULE_EDGE_T
:
case
PCB_MODULE_TEXT_T
:
case
PCB_PAD_T
:
case
PCB_PAD_T
:
case
NOT_USED
:
case
NOT_USED
:
case
TYPE_NOT_INIT
:
case
TYPE_NOT_INIT
:
...
...
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