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
4b85c011
Commit
4b85c011
authored
Mar 25, 2010
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Libedit: fixed incorrect undo/redo after moving a field
parent
aa35b980
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
22 deletions
+30
-22
CMakeLists.txt
common/CMakeLists.txt
+0
-1
libfield.cpp
eeschema/libfield.cpp
+30
-21
No files found.
common/CMakeLists.txt
View file @
4b85c011
...
@@ -45,7 +45,6 @@ set(COMMON_SRCS
...
@@ -45,7 +45,6 @@ set(COMMON_SRCS
msgpanel.cpp
msgpanel.cpp
newstroke_font.cpp
newstroke_font.cpp
projet_config.cpp
projet_config.cpp
# pyhandler.cpp
richio.cpp
richio.cpp
selcolor.cpp
selcolor.cpp
string.cpp
string.cpp
...
...
eeschema/libfield.cpp
View file @
4b85c011
...
@@ -19,10 +19,10 @@ static void ShowMoveField( WinEDA_DrawPanel* panel, wxDC* DC, bool erase );
...
@@ -19,10 +19,10 @@ static void ShowMoveField( WinEDA_DrawPanel* panel, wxDC* DC, bool erase );
extern
int
m_unit
;
extern
int
m_unit
;
static
wxPoint
StartCursor
,
LastTex
tPosition
;
static
wxPoint
s_InitialPosition
,
s_Las
tPosition
;
static
void
Exi
tMoveField
(
WinEDA_DrawPanel
*
Panel
,
wxDC
*
DC
)
static
void
Abor
tMoveField
(
WinEDA_DrawPanel
*
Panel
,
wxDC
*
DC
)
{
{
Panel
->
ManageCurseur
=
NULL
;
Panel
->
ManageCurseur
=
NULL
;
Panel
->
ForceCloseManageCurseur
=
NULL
;
Panel
->
ForceCloseManageCurseur
=
NULL
;
...
@@ -39,8 +39,8 @@ static void ExitMoveField( WinEDA_DrawPanel* Panel, wxDC* DC )
...
@@ -39,8 +39,8 @@ static void ExitMoveField( WinEDA_DrawPanel* Panel, wxDC* DC )
wxPoint
curpos
=
Panel
->
GetScreen
()
->
m_Curseur
;
wxPoint
curpos
=
Panel
->
GetScreen
()
->
m_Curseur
;
Panel
->
GetScreen
()
->
m_Curseur
=
StartCursor
;
Panel
->
GetScreen
()
->
m_Curseur
=
s_InitialPosition
;
ShowMoveField
(
Panel
,
DC
,
TRUE
);
ShowMoveField
(
Panel
,
DC
,
true
);
Panel
->
GetScreen
()
->
m_Curseur
=
curpos
;
Panel
->
GetScreen
()
->
m_Curseur
=
curpos
;
item
->
m_Flags
=
0
;
item
->
m_Flags
=
0
;
parent
->
SetDrawItem
(
NULL
);
parent
->
SetDrawItem
(
NULL
);
...
@@ -55,19 +55,19 @@ void WinEDA_LibeditFrame::StartMoveField( wxDC* DC, LIB_FIELD* field )
...
@@ -55,19 +55,19 @@ void WinEDA_LibeditFrame::StartMoveField( wxDC* DC, LIB_FIELD* field )
return
;
return
;
m_drawItem
=
field
;
m_drawItem
=
field
;
LastTextPosition
=
field
->
m_Pos
;
s_InitialPosition
=
field
->
m_Pos
;
NEGATE
(
s_InitialPosition
.
y
);
m_drawItem
->
m_Flags
|=
IS_MOVED
;
m_drawItem
->
m_Flags
|=
IS_MOVED
;
startPos
.
x
=
LastTextPosition
.
x
;
startPos
.
y
=
-
LastTextPosition
.
y
;
DrawPanel
->
CursorOff
(
DC
);
DrawPanel
->
CursorOff
(
DC
);
GetScreen
()
->
m_Curseur
=
startPos
;
s_LastPosition
=
s_InitialPosition
;
GetScreen
()
->
m_Curseur
=
s_InitialPosition
;
DrawPanel
->
MouseToCursorSchema
();
DrawPanel
->
MouseToCursorSchema
();
DrawPanel
->
ManageCurseur
=
ShowMoveField
;
DrawPanel
->
ManageCurseur
=
ShowMoveField
;
DrawPanel
->
ForceCloseManageCurseur
=
Exi
tMoveField
;
DrawPanel
->
ForceCloseManageCurseur
=
Abor
tMoveField
;
DrawPanel
->
ManageCurseur
(
DrawPanel
,
DC
,
TRUE
);
DrawPanel
->
ManageCurseur
(
DrawPanel
,
DC
,
true
);
StartCursor
=
GetScreen
()
->
m_Curseur
;
s_InitialPosition
=
GetScreen
()
->
m_Curseur
;
DrawPanel
->
CursorOn
(
DC
);
DrawPanel
->
CursorOn
(
DC
);
}
}
...
@@ -90,16 +90,19 @@ static void ShowMoveField( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
...
@@ -90,16 +90,19 @@ static void ShowMoveField( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
return
;
return
;
wxString
text
=
Field
->
GetFullText
(
parent
->
GetUnit
()
);
wxString
text
=
Field
->
GetFullText
(
parent
->
GetUnit
()
);
wxPoint
offset
;
offset
.
x
=
s_LastPosition
.
x
-
Field
->
m_Pos
.
x
;
offset
.
y
=
s_LastPosition
.
y
+
Field
->
m_Pos
.
y
;
if
(
erase
)
if
(
erase
)
Field
->
Draw
(
panel
,
DC
,
wxPoint
(
0
,
0
)
,
-
1
,
g_XorMode
,
&
text
,
Field
->
Draw
(
panel
,
DC
,
offset
,
-
1
,
g_XorMode
,
&
text
,
DefaultTransformMatrix
);
DefaultTransformMatrix
);
LastTextPosition
.
x
=
panel
->
GetScreen
()
->
m_Curseur
.
x
;
s_LastPosition
=
panel
->
GetScreen
()
->
m_Curseur
;
LastTextPosition
.
y
=
-
panel
->
GetScreen
()
->
m_Curseur
.
y
;
offset
.
x
=
s_LastPosition
.
x
-
Field
->
m_Pos
.
x
;
offset
.
y
=
s_LastPosition
.
y
+
Field
->
m_Pos
.
y
;
Field
->
m_Pos
=
LastTextPosition
;
Field
->
Draw
(
panel
,
DC
,
offset
,
-
1
,
g_XorMode
,
&
text
,
Field
->
Draw
(
panel
,
DC
,
wxPoint
(
0
,
0
),
-
1
,
g_XorMode
,
&
text
,
DefaultTransformMatrix
);
DefaultTransformMatrix
);
}
}
...
@@ -240,19 +243,25 @@ void WinEDA_LibeditFrame::RotateField( wxDC* DC, LIB_FIELD* Field )
...
@@ -240,19 +243,25 @@ void WinEDA_LibeditFrame::RotateField( wxDC* DC, LIB_FIELD* Field )
wxString
fieldText
=
Field
->
GetFullText
(
m_unit
);
wxString
fieldText
=
Field
->
GetFullText
(
m_unit
);
if
(
(
Field
->
m_Flags
&
IS_MOVED
)
)
ShowMoveField
(
DrawPanel
,
DC
,
false
);
else
Field
->
Draw
(
DrawPanel
,
DC
,
wxPoint
(
0
,
0
),
-
1
,
g_XorMode
,
&
fieldText
,
Field
->
Draw
(
DrawPanel
,
DC
,
wxPoint
(
0
,
0
),
-
1
,
g_XorMode
,
&
fieldText
,
DefaultTransformMatrix
);
DefaultTransformMatrix
);
if
(
Field
->
m_Orient
)
if
(
Field
->
m_Orient
==
TEXT_ORIENT_VERT
)
Field
->
m_Orient
=
0
;
Field
->
m_Orient
=
TEXT_ORIENT_HORIZ
;
else
else
Field
->
m_Orient
=
900
;
Field
->
m_Orient
=
TEXT_ORIENT_VERT
;
int
drawMode
=
g_XorMode
;
int
drawMode
=
g_XorMode
;
if
(
Field
->
m_Flags
==
0
)
if
(
Field
->
m_Flags
==
0
)
drawMode
=
GR_DEFAULT_DRAWMODE
;
drawMode
=
GR_DEFAULT_DRAWMODE
;
if
(
(
Field
->
m_Flags
&
IS_MOVED
)
)
ShowMoveField
(
DrawPanel
,
DC
,
false
);
else
Field
->
Draw
(
DrawPanel
,
DC
,
wxPoint
(
0
,
0
),
-
1
,
drawMode
,
&
fieldText
,
Field
->
Draw
(
DrawPanel
,
DC
,
wxPoint
(
0
,
0
),
-
1
,
drawMode
,
&
fieldText
,
DefaultTransformMatrix
);
DefaultTransformMatrix
);
...
...
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