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
f81c237d
Commit
f81c237d
authored
May 20, 2011
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Libedit: add block rotate and block mirror horizontally
parent
9214f584
Changes
23
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
294 additions
and
12 deletions
+294
-12
block_libedit.cpp
eeschema/block_libedit.cpp
+21
-6
class_libentry.cpp
eeschema/class_libentry.cpp
+32
-0
class_libentry.h
eeschema/class_libentry.h
+14
-0
lib_arc.cpp
eeschema/lib_arc.cpp
+22
-0
lib_arc.h
eeschema/lib_arc.h
+2
-0
lib_bezier.cpp
eeschema/lib_bezier.cpp
+36
-0
lib_bezier.h
eeschema/lib_bezier.h
+2
-0
lib_circle.cpp
eeschema/lib_circle.cpp
+12
-0
lib_circle.h
eeschema/lib_circle.h
+2
-0
lib_draw_item.h
eeschema/lib_draw_item.h
+22
-0
lib_field.cpp
eeschema/lib_field.cpp
+12
-0
lib_field.h
eeschema/lib_field.h
+2
-0
lib_pin.cpp
eeschema/lib_pin.cpp
+35
-0
lib_pin.h
eeschema/lib_pin.h
+2
-0
lib_polyline.cpp
eeschema/lib_polyline.cpp
+22
-0
lib_polyline.h
eeschema/lib_polyline.h
+2
-0
lib_rectangle.cpp
eeschema/lib_rectangle.cpp
+16
-0
lib_rectangle.h
eeschema/lib_rectangle.h
+2
-0
lib_text.cpp
eeschema/lib_text.cpp
+14
-1
lib_text.h
eeschema/lib_text.h
+2
-0
libedit_onrightclick.cpp
eeschema/libedit_onrightclick.cpp
+2
-0
libedit_undo_redo.cpp
eeschema/libedit_undo_redo.cpp
+2
-5
libeditframe.cpp
eeschema/libeditframe.cpp
+16
-0
No files found.
eeschema/block_libedit.cpp
View file @
f81c237d
...
...
@@ -140,12 +140,12 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
case
BLOCK_SAVE
:
/* Save */
case
BLOCK_PASTE
:
case
BLOCK_ROTATE
:
case
BLOCK_MIRROR_X
:
case
BLOCK_FLIP
:
break
;
case
BLOCK_ROTATE
:
case
BLOCK_MIRROR_X
:
case
BLOCK_MIRROR_Y
:
if
(
m_component
)
ItemCount
=
m_component
->
SelectItems
(
GetScreen
()
->
m_BlockLocate
,
...
...
@@ -158,7 +158,13 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
if
(
m_component
)
{
OnModify
();
int
block_cmd
=
GetScreen
()
->
m_BlockLocate
.
m_Command
;
if
(
block_cmd
==
BLOCK_MIRROR_Y
)
m_component
->
MirrorSelectedItemsH
(
pt
);
else
if
(
block_cmd
==
BLOCK_MIRROR_X
)
m_component
->
MirrorSelectedItemsV
(
pt
);
else
if
(
block_cmd
==
BLOCK_ROTATE
)
m_component
->
RotateSelectedItems
(
pt
);
}
break
;
...
...
@@ -240,19 +246,28 @@ void LIB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
GetScreen
()
->
m_BlockLocate
.
ClearItemsList
();
break
;
case
BLOCK_MIRROR_Y
:
/* Invert by popup menu, from block move */
case
BLOCK_ROTATE
:
// Invert by popup menu, from block move
case
BLOCK_MIRROR_X
:
// Invert by popup menu, from block move
case
BLOCK_MIRROR_Y
:
// Invert by popup menu, from block move
if
(
m_component
)
SaveCopyInUndoList
(
m_component
);
pt
=
GetScreen
()
->
m_BlockLocate
.
Centre
();
pt
.
y
*=
-
1
;
if
(
m_component
)
{
int
block_cmd
=
GetScreen
()
->
m_BlockLocate
.
m_Command
;
if
(
block_cmd
==
BLOCK_MIRROR_Y
)
m_component
->
MirrorSelectedItemsH
(
pt
);
else
if
(
block_cmd
==
BLOCK_MIRROR_X
)
m_component
->
MirrorSelectedItemsV
(
pt
);
else
if
(
block_cmd
==
BLOCK_ROTATE
)
m_component
->
RotateSelectedItems
(
pt
);
}
break
;
case
BLOCK_ZOOM
:
// Handled by HandleBlockEnd
case
BLOCK_DELETE
:
case
BLOCK_SAVE
:
case
BLOCK_ROTATE
:
case
BLOCK_ABORT
:
default
:
break
;
...
...
eeschema/class_libentry.cpp
View file @
f81c237d
...
...
@@ -1215,7 +1215,10 @@ bool LIB_COMPONENT::HasConversion() const
void
LIB_COMPONENT
::
ClearStatus
()
{
BOOST_FOREACH
(
LIB_ITEM
&
item
,
drawings
)
{
item
.
m_Flags
=
0
;
item
.
m_Selected
=
0
;
}
}
...
...
@@ -1346,6 +1349,35 @@ void LIB_COMPONENT::MirrorSelectedItemsH( const wxPoint& aCenter )
drawings
.
sort
();
}
void
LIB_COMPONENT
::
MirrorSelectedItemsV
(
const
wxPoint
&
aCenter
)
{
BOOST_FOREACH
(
LIB_ITEM
&
item
,
drawings
)
{
if
(
item
.
m_Selected
==
0
)
continue
;
item
.
MirrorVertical
(
aCenter
);
item
.
m_Flags
=
item
.
m_Selected
=
0
;
}
drawings
.
sort
();
}
void
LIB_COMPONENT
::
RotateSelectedItems
(
const
wxPoint
&
aCenter
)
{
BOOST_FOREACH
(
LIB_ITEM
&
item
,
drawings
)
{
if
(
item
.
m_Selected
==
0
)
continue
;
item
.
Rotate
(
aCenter
);
item
.
m_Flags
=
item
.
m_Selected
=
0
;
}
drawings
.
sort
();
}
LIB_ITEM
*
LIB_COMPONENT
::
LocateDrawItem
(
int
aUnit
,
int
aConvert
,
KICAD_T
aType
,
const
wxPoint
&
aPoint
)
...
...
eeschema/class_libentry.h
View file @
f81c237d
...
...
@@ -512,6 +512,20 @@ public:
*/
void
MirrorSelectedItemsH
(
const
wxPoint
&
aCenter
);
/**
* Vertically (Y axis) mirror selected draw items about a point.
*
* @param aCenter - Center point to mirror around.
*/
void
MirrorSelectedItemsV
(
const
wxPoint
&
aCenter
);
/**
* Rotate CCW selected draw items about a point.
*
* @param aCenter - Center point to mirror around.
*/
void
RotateSelectedItems
(
const
wxPoint
&
aCenter
);
/**
* Locate a draw object.
*
...
...
eeschema/lib_arc.cpp
View file @
f81c237d
...
...
@@ -277,6 +277,28 @@ void LIB_ARC::DoMirrorHorizontal( const wxPoint& aCenter )
EXCHG
(
m_ArcStart
,
m_ArcEnd
);
}
void
LIB_ARC
::
DoMirrorVertical
(
const
wxPoint
&
aCenter
)
{
m_Pos
.
y
-=
aCenter
.
y
;
m_Pos
.
y
*=
-
1
;
m_Pos
.
y
+=
aCenter
.
y
;
m_ArcStart
.
y
-=
aCenter
.
y
;
m_ArcStart
.
y
*=
-
1
;
m_ArcStart
.
y
+=
aCenter
.
y
;
m_ArcEnd
.
y
-=
aCenter
.
y
;
m_ArcEnd
.
y
*=
-
1
;
m_ArcEnd
.
y
+=
aCenter
.
y
;
EXCHG
(
m_ArcStart
,
m_ArcEnd
);
}
void
LIB_ARC
::
DoRotate
(
const
wxPoint
&
aCenter
)
{
RotatePoint
(
&
m_Pos
,
aCenter
,
-
900
);
RotatePoint
(
&
m_ArcStart
,
aCenter
,
-
900
);
RotatePoint
(
&
m_ArcEnd
,
aCenter
,
-
900
);
}
void
LIB_ARC
::
DoPlot
(
PLOTTER
*
aPlotter
,
const
wxPoint
&
aOffset
,
bool
aFill
,
const
TRANSFORM
&
aTransform
)
...
...
eeschema/lib_arc.h
View file @
f81c237d
...
...
@@ -141,6 +141,8 @@ protected:
virtual
void
DoMove
(
const
wxPoint
&
aPosition
);
virtual
wxPoint
DoGetPosition
()
const
{
return
m_Pos
;
}
virtual
void
DoMirrorHorizontal
(
const
wxPoint
&
aCenter
);
virtual
void
DoMirrorVertical
(
const
wxPoint
&
aCenter
);
virtual
void
DoRotate
(
const
wxPoint
&
aCenter
);
virtual
void
DoPlot
(
PLOTTER
*
aPlotter
,
const
wxPoint
&
aOffset
,
bool
aFill
,
const
TRANSFORM
&
aTransform
);
virtual
int
DoGetWidth
()
const
{
return
m_Width
;
}
...
...
eeschema/lib_bezier.cpp
View file @
f81c237d
...
...
@@ -190,6 +190,42 @@ void LIB_BEZIER::DoMirrorHorizontal( const wxPoint& aCenter )
}
}
void
LIB_BEZIER
::
DoMirrorVertical
(
const
wxPoint
&
aCenter
)
{
size_t
i
,
imax
=
m_PolyPoints
.
size
();
for
(
i
=
0
;
i
<
imax
;
i
++
)
{
m_PolyPoints
[
i
].
y
-=
aCenter
.
y
;
m_PolyPoints
[
i
].
y
*=
-
1
;
m_PolyPoints
[
i
].
y
+=
aCenter
.
y
;
}
imax
=
m_BezierPoints
.
size
();
for
(
i
=
0
;
i
<
imax
;
i
++
)
{
m_BezierPoints
[
i
].
y
-=
aCenter
.
y
;
m_BezierPoints
[
i
].
y
*=
-
1
;
m_BezierPoints
[
i
].
y
+=
aCenter
.
y
;
}
}
void
LIB_BEZIER
::
DoRotate
(
const
wxPoint
&
aCenter
)
{
size_t
i
,
imax
=
m_PolyPoints
.
size
();
for
(
i
=
0
;
i
<
imax
;
i
++
)
{
RotatePoint
(
&
m_PolyPoints
[
i
],
aCenter
,
-
900
);
}
imax
=
m_BezierPoints
.
size
();
for
(
i
=
0
;
i
<
imax
;
i
++
)
{
RotatePoint
(
&
m_BezierPoints
[
i
],
aCenter
,
-
900
);
}
}
void
LIB_BEZIER
::
DoPlot
(
PLOTTER
*
aPlotter
,
const
wxPoint
&
aOffset
,
bool
aFill
,
const
TRANSFORM
&
aTransform
)
...
...
eeschema/lib_bezier.h
View file @
f81c237d
...
...
@@ -93,6 +93,8 @@ protected:
virtual
void
DoMove
(
const
wxPoint
&
aPosition
);
virtual
wxPoint
DoGetPosition
()
const
{
return
m_PolyPoints
[
0
];
}
virtual
void
DoMirrorHorizontal
(
const
wxPoint
&
aCenter
);
virtual
void
DoMirrorVertical
(
const
wxPoint
&
aCenter
);
virtual
void
DoRotate
(
const
wxPoint
&
aCenter
);
virtual
void
DoPlot
(
PLOTTER
*
aPlotter
,
const
wxPoint
&
aOffset
,
bool
aFill
,
const
TRANSFORM
&
aTransform
);
virtual
int
DoGetWidth
()
const
{
return
m_Width
;
}
...
...
eeschema/lib_circle.cpp
View file @
f81c237d
...
...
@@ -162,6 +162,18 @@ void LIB_CIRCLE::DoMirrorHorizontal( const wxPoint& aCenter )
m_Pos
.
x
+=
aCenter
.
x
;
}
void
LIB_CIRCLE
::
DoMirrorVertical
(
const
wxPoint
&
aCenter
)
{
m_Pos
.
y
-=
aCenter
.
y
;
m_Pos
.
y
*=
-
1
;
m_Pos
.
y
+=
aCenter
.
y
;
}
void
LIB_CIRCLE
::
DoRotate
(
const
wxPoint
&
aCenter
)
{
RotatePoint
(
&
m_Pos
,
aCenter
,
-
900
);
}
void
LIB_CIRCLE
::
DoPlot
(
PLOTTER
*
aPlotter
,
const
wxPoint
&
aOffset
,
bool
aFill
,
const
TRANSFORM
&
aTransform
)
...
...
eeschema/lib_circle.h
View file @
f81c237d
...
...
@@ -109,6 +109,8 @@ protected:
virtual
void
DoMove
(
const
wxPoint
&
aPosition
);
virtual
wxPoint
DoGetPosition
()
const
{
return
m_Pos
;
}
virtual
void
DoMirrorHorizontal
(
const
wxPoint
&
aCenter
);
virtual
void
DoMirrorVertical
(
const
wxPoint
&
aCenter
);
virtual
void
DoRotate
(
const
wxPoint
&
aCenter
);
virtual
void
DoPlot
(
PLOTTER
*
aPlotter
,
const
wxPoint
&
aOffset
,
bool
aFill
,
const
TRANSFORM
&
aTransform
);
virtual
int
DoGetWidth
()
const
{
return
m_Width
;
}
...
...
eeschema/lib_draw_item.h
View file @
f81c237d
...
...
@@ -299,6 +299,26 @@ public:
DoMirrorHorizontal
(
aCenter
);
}
/**
* Mirror the draw object along the MirrorVertical (Y) axis about a point.
*
* @param aCenter - Point to mirror around.
*/
void
MirrorVertical
(
const
wxPoint
&
aCenter
)
{
DoMirrorVertical
(
aCenter
);
}
/**
* Rotate about a point.
*
* @param aCenter - Point to mirror around.
*/
void
Rotate
(
const
wxPoint
&
aCenter
)
{
DoRotate
(
aCenter
);
}
/**
* Rotate the draw item.
*/
...
...
@@ -377,6 +397,8 @@ protected:
virtual
void
DoMove
(
const
wxPoint
&
aPosition
)
=
0
;
virtual
wxPoint
DoGetPosition
()
const
=
0
;
virtual
void
DoMirrorHorizontal
(
const
wxPoint
&
aCenter
)
=
0
;
virtual
void
DoMirrorVertical
(
const
wxPoint
&
aCenter
)
=
0
;
virtual
void
DoRotate
(
const
wxPoint
&
aCenter
)
=
0
;
virtual
void
DoPlot
(
PLOTTER
*
aPlotter
,
const
wxPoint
&
aOffset
,
bool
aFill
,
const
TRANSFORM
&
aTransform
)
=
0
;
virtual
int
DoGetWidth
()
const
=
0
;
...
...
eeschema/lib_field.cpp
View file @
f81c237d
...
...
@@ -476,6 +476,18 @@ void LIB_FIELD::DoMirrorHorizontal( const wxPoint& center )
m_Pos
.
x
+=
center
.
x
;
}
void
LIB_FIELD
::
DoMirrorVertical
(
const
wxPoint
&
center
)
{
m_Pos
.
y
-=
center
.
y
;
m_Pos
.
y
*=
-
1
;
m_Pos
.
y
+=
center
.
y
;
}
void
LIB_FIELD
::
DoRotate
(
const
wxPoint
&
center
)
{
RotatePoint
(
&
m_Pos
,
center
,
-
900
);
}
void
LIB_FIELD
::
DoPlot
(
PLOTTER
*
plotter
,
const
wxPoint
&
offset
,
bool
fill
,
const
TRANSFORM
&
aTransform
)
...
...
eeschema/lib_field.h
View file @
f81c237d
...
...
@@ -245,6 +245,8 @@ protected:
virtual
void
DoMove
(
const
wxPoint
&
newPosition
);
virtual
wxPoint
DoGetPosition
(
void
)
const
{
return
m_Pos
;
}
virtual
void
DoMirrorHorizontal
(
const
wxPoint
&
center
);
virtual
void
DoMirrorVertical
(
const
wxPoint
&
aCenter
);
virtual
void
DoRotate
(
const
wxPoint
&
aCenter
);
virtual
void
DoPlot
(
PLOTTER
*
plotter
,
const
wxPoint
&
offset
,
bool
fill
,
const
TRANSFORM
&
aTransform
);
virtual
int
DoGetWidth
(
void
)
const
{
return
m_Thickness
;
}
...
...
eeschema/lib_pin.cpp
View file @
f81c237d
...
...
@@ -1673,6 +1673,41 @@ void LIB_PIN::DoMirrorHorizontal( const wxPoint& center )
m_orientation
=
PIN_RIGHT
;
}
void
LIB_PIN
::
DoMirrorVertical
(
const
wxPoint
&
center
)
{
m_position
.
y
-=
center
.
y
;
m_position
.
y
*=
-
1
;
m_position
.
y
+=
center
.
y
;
if
(
m_orientation
==
PIN_UP
)
m_orientation
=
PIN_DOWN
;
else
if
(
m_orientation
==
PIN_DOWN
)
m_orientation
=
PIN_UP
;
}
void
LIB_PIN
::
DoRotate
(
const
wxPoint
&
center
)
{
RotatePoint
(
&
m_position
,
center
,
-
900
);
switch
(
m_orientation
)
{
case
PIN_RIGHT
:
m_orientation
=
PIN_UP
;
break
;
case
PIN_UP
:
m_orientation
=
PIN_LEFT
;
break
;
case
PIN_LEFT
:
m_orientation
=
PIN_DOWN
;
break
;
case
PIN_DOWN
:
m_orientation
=
PIN_RIGHT
;
break
;
}
}
void
LIB_PIN
::
DoPlot
(
PLOTTER
*
plotter
,
const
wxPoint
&
offset
,
bool
fill
,
const
TRANSFORM
&
aTransform
)
...
...
eeschema/lib_pin.h
View file @
f81c237d
...
...
@@ -472,6 +472,8 @@ protected:
virtual
void
DoMove
(
const
wxPoint
&
aPosition
);
virtual
wxPoint
DoGetPosition
()
const
{
return
m_position
;
}
virtual
void
DoMirrorHorizontal
(
const
wxPoint
&
aCenter
);
virtual
void
DoMirrorVertical
(
const
wxPoint
&
aCenter
);
virtual
void
DoRotate
(
const
wxPoint
&
aCenter
);
virtual
void
DoPlot
(
PLOTTER
*
aPlotter
,
const
wxPoint
&
aOffset
,
bool
aFill
,
const
TRANSFORM
&
aTransform
);
virtual
int
DoGetWidth
()
const
{
return
m_width
;
}
...
...
eeschema/lib_polyline.cpp
View file @
f81c237d
...
...
@@ -177,6 +177,28 @@ void LIB_POLYLINE::DoMirrorHorizontal( const wxPoint& aCenter )
}
}
void
LIB_POLYLINE
::
DoMirrorVertical
(
const
wxPoint
&
aCenter
)
{
size_t
i
,
imax
=
m_PolyPoints
.
size
();
for
(
i
=
0
;
i
<
imax
;
i
++
)
{
m_PolyPoints
[
i
].
y
-=
aCenter
.
y
;
m_PolyPoints
[
i
].
y
*=
-
1
;
m_PolyPoints
[
i
].
y
+=
aCenter
.
y
;
}
}
void
LIB_POLYLINE
::
DoRotate
(
const
wxPoint
&
aCenter
)
{
size_t
i
,
imax
=
m_PolyPoints
.
size
();
for
(
i
=
0
;
i
<
imax
;
i
++
)
{
RotatePoint
(
&
m_PolyPoints
[
i
],
aCenter
,
-
900
);
}
}
void
LIB_POLYLINE
::
DoPlot
(
PLOTTER
*
aPlotter
,
const
wxPoint
&
aOffset
,
bool
aFill
,
const
TRANSFORM
&
aTransform
)
...
...
eeschema/lib_polyline.h
View file @
f81c237d
...
...
@@ -126,6 +126,8 @@ protected:
virtual
void
DoMove
(
const
wxPoint
&
aPosition
);
virtual
wxPoint
DoGetPosition
()
const
{
return
m_PolyPoints
[
0
];
}
virtual
void
DoMirrorHorizontal
(
const
wxPoint
&
aCenter
);
virtual
void
DoMirrorVertical
(
const
wxPoint
&
aCenter
);
virtual
void
DoRotate
(
const
wxPoint
&
aCenter
);
virtual
void
DoPlot
(
PLOTTER
*
aPlotter
,
const
wxPoint
&
aOffset
,
bool
aFill
,
const
TRANSFORM
&
aTransform
);
virtual
int
DoGetWidth
()
const
{
return
m_Width
;
}
...
...
eeschema/lib_rectangle.cpp
View file @
f81c237d
...
...
@@ -132,6 +132,22 @@ void LIB_RECTANGLE::DoMirrorHorizontal( const wxPoint& aCenter )
m_End
.
x
+=
aCenter
.
x
;
}
void
LIB_RECTANGLE
::
DoMirrorVertical
(
const
wxPoint
&
aCenter
)
{
m_Pos
.
y
-=
aCenter
.
y
;
m_Pos
.
y
*=
-
1
;
m_Pos
.
y
+=
aCenter
.
y
;
m_End
.
y
-=
aCenter
.
y
;
m_End
.
y
*=
-
1
;
m_End
.
y
+=
aCenter
.
y
;
}
void
LIB_RECTANGLE
::
DoRotate
(
const
wxPoint
&
aCenter
)
{
RotatePoint
(
&
m_Pos
,
aCenter
,
-
900
);
RotatePoint
(
&
m_End
,
aCenter
,
-
900
);
}
void
LIB_RECTANGLE
::
DoPlot
(
PLOTTER
*
aPlotter
,
const
wxPoint
&
aOffset
,
bool
aFill
,
const
TRANSFORM
&
aTransform
)
...
...
eeschema/lib_rectangle.h
View file @
f81c237d
...
...
@@ -116,6 +116,8 @@ protected:
virtual
void
DoMove
(
const
wxPoint
&
aPosition
);
virtual
wxPoint
DoGetPosition
()
const
{
return
m_Pos
;
}
virtual
void
DoMirrorHorizontal
(
const
wxPoint
&
aCenter
);
virtual
void
DoMirrorVertical
(
const
wxPoint
&
aCenter
);
virtual
void
DoRotate
(
const
wxPoint
&
aCenter
);
virtual
void
DoPlot
(
PLOTTER
*
aPlotter
,
const
wxPoint
&
aOffset
,
bool
aFill
,
const
TRANSFORM
&
aTransform
);
virtual
int
DoGetWidth
()
const
{
return
m_Width
;
}
...
...
eeschema/lib_text.cpp
View file @
f81c237d
/***************************/
/*
class_BodyItem_T
ext.cpp */
/*
lib_t
ext.cpp */
/***************************/
/**
...
...
@@ -264,6 +264,19 @@ void LIB_TEXT::DoMirrorHorizontal( const wxPoint& center )
m_Pos
.
x
+=
center
.
x
;
}
void
LIB_TEXT
::
DoMirrorVertical
(
const
wxPoint
&
center
)
{
m_Pos
.
y
-=
center
.
y
;
m_Pos
.
y
*=
-
1
;
m_Pos
.
y
+=
center
.
y
;
}
void
LIB_TEXT
::
DoRotate
(
const
wxPoint
&
center
)
{
RotatePoint
(
&
m_Pos
,
center
,
-
900
);
m_Orient
=
m_Orient
?
0
:
900
;
}
void
LIB_TEXT
::
DoPlot
(
PLOTTER
*
plotter
,
const
wxPoint
&
offset
,
bool
fill
,
const
TRANSFORM
&
aTransform
)
...
...
eeschema/lib_text.h
View file @
f81c237d
...
...
@@ -141,6 +141,8 @@ protected:
virtual
void
DoMove
(
const
wxPoint
&
aPosition
);
virtual
wxPoint
DoGetPosition
()
const
{
return
m_Pos
;
}
virtual
void
DoMirrorHorizontal
(
const
wxPoint
&
aCenter
);
virtual
void
DoMirrorVertical
(
const
wxPoint
&
aCenter
);
virtual
void
DoRotate
(
const
wxPoint
&
aCenter
);
virtual
void
DoPlot
(
PLOTTER
*
aPlotter
,
const
wxPoint
&
aOffset
,
bool
aFill
,
const
TRANSFORM
&
aTransform
);
virtual
int
DoGetWidth
()
const
{
return
m_Thickness
;
}
...
...
eeschema/libedit_onrightclick.cpp
View file @
f81c237d
...
...
@@ -299,6 +299,8 @@ void AddMenusForBlock( wxMenu* PopMenu, LIB_EDIT_FRAME* frame )
ADD_MENUITEM
(
PopMenu
,
ID_POPUP_SELECT_ITEMS_BLOCK
,
_
(
"Select Items"
),
green_xpm
);
ADD_MENUITEM
(
PopMenu
,
ID_POPUP_COPY_BLOCK
,
_
(
"Copy Block"
),
copyblock_xpm
);
ADD_MENUITEM
(
PopMenu
,
ID_POPUP_MIRROR_Y_BLOCK
,
_
(
"Mirror Block ||"
),
mirror_H_xpm
);
ADD_MENUITEM
(
PopMenu
,
ID_POPUP_MIRROR_X_BLOCK
,
_
(
"Mirror Block --"
),
mirror_V_xpm
);
ADD_MENUITEM
(
PopMenu
,
ID_POPUP_ROTATE_BLOCK
,
_
(
"Rotate Block ccw"
),
rotate_pos_xpm
);
ADD_MENUITEM
(
PopMenu
,
ID_POPUP_DELETE_BLOCK
,
_
(
"Delete Block"
),
delete_xpm
);
}
}
eeschema/libedit_undo_redo.cpp
View file @
f81c237d
...
...
@@ -19,17 +19,14 @@ void LIB_EDIT_FRAME::SaveCopyInUndoList( EDA_ITEM* ItemToCopy, int unused_flag )
CopyItem
=
new
LIB_COMPONENT
(
*
(
(
LIB_COMPONENT
*
)
ItemToCopy
)
);
if
(
CopyItem
==
NULL
)
return
;
// Clear current flags (which can be temporary set by a current edit command).
CopyItem
->
ClearStatus
()
;
lastcmd
=
new
PICKED_ITEMS_LIST
();
ITEM_PICKER
wrapper
(
CopyItem
,
UR_LIBEDIT
);
lastcmd
->
PushItem
(
wrapper
);
GetScreen
()
->
PushCommandToUndoList
(
lastcmd
);
// Clear current flags (which can be temporary set by a current edit command).
CopyItem
->
ClearStatus
();
// Clear redo list, because after new save there is no redo to do.
GetScreen
()
->
ClearUndoORRedoList
(
GetScreen
()
->
m_RedoList
);
}
...
...
eeschema/libeditframe.cpp
View file @
f81c237d
...
...
@@ -626,7 +626,9 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case
ID_POPUP_DELETE_BLOCK
:
case
ID_POPUP_COPY_BLOCK
:
case
ID_POPUP_SELECT_ITEMS_BLOCK
:
case
ID_POPUP_MIRROR_X_BLOCK
:
case
ID_POPUP_MIRROR_Y_BLOCK
:
case
ID_POPUP_ROTATE_BLOCK
:
case
ID_POPUP_PLACE_BLOCK
:
case
ID_POPUP_LIBEDIT_DELETE_CURRENT_POLY_SEGMENT
:
break
;
...
...
@@ -806,6 +808,20 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
HandleBlockPlace
(
&
dc
);
break
;
case
ID_POPUP_MIRROR_X_BLOCK
:
DrawPanel
->
m_AutoPAN_Request
=
false
;
GetScreen
()
->
m_BlockLocate
.
m_Command
=
BLOCK_MIRROR_X
;
DrawPanel
->
MoveCursorToCrossHair
();
HandleBlockPlace
(
&
dc
);
break
;
case
ID_POPUP_ROTATE_BLOCK
:
DrawPanel
->
m_AutoPAN_Request
=
false
;
GetScreen
()
->
m_BlockLocate
.
m_Command
=
BLOCK_ROTATE
;
DrawPanel
->
MoveCursorToCrossHair
();
HandleBlockPlace
(
&
dc
);
break
;
case
ID_POPUP_PLACE_BLOCK
:
DrawPanel
->
m_AutoPAN_Request
=
false
;
DrawPanel
->
MoveCursorToCrossHair
();
...
...
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