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
55f65292
Commit
55f65292
authored
Jul 08, 2011
by
Marco Mattila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix sheet resizing in eeschema.
parent
84572d37
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
15 deletions
+11
-15
sch_screen.cpp
eeschema/sch_screen.cpp
+1
-1
schedit.cpp
eeschema/schedit.cpp
+0
-1
sheet.cpp
eeschema/sheet.cpp
+9
-13
base_struct.h
include/base_struct.h
+1
-0
No files found.
eeschema/sch_screen.cpp
View file @
55f65292
...
@@ -572,7 +572,7 @@ void SCH_SCREEN::Draw( EDA_DRAW_PANEL* aCanvas, wxDC* aDC, int aDrawMode, int aC
...
@@ -572,7 +572,7 @@ void SCH_SCREEN::Draw( EDA_DRAW_PANEL* aCanvas, wxDC* aDC, int aDrawMode, int aC
{
{
for
(
SCH_ITEM
*
item
=
GetDrawItems
();
item
!=
NULL
;
item
=
item
->
Next
()
)
for
(
SCH_ITEM
*
item
=
GetDrawItems
();
item
!=
NULL
;
item
=
item
->
Next
()
)
{
{
if
(
item
->
IsMoving
()
)
if
(
item
->
IsMoving
()
||
item
->
IsResized
()
)
continue
;
continue
;
// uncomment line below when there is a virtual
// uncomment line below when there is a virtual
...
...
eeschema/schedit.cpp
View file @
55f65292
...
@@ -214,7 +214,6 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
...
@@ -214,7 +214,6 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
break
;
break
;
case
ID_POPUP_SCH_RESIZE_SHEET
:
case
ID_POPUP_SCH_RESIZE_SHEET
:
DrawPanel
->
MoveCursorToCrossHair
();
ReSizeSheet
(
(
SCH_SHEET
*
)
item
,
&
dc
);
ReSizeSheet
(
(
SCH_SHEET
*
)
item
,
&
dc
);
screen
->
TestDanglingEnds
(
DrawPanel
,
&
dc
);
screen
->
TestDanglingEnds
(
DrawPanel
,
&
dc
);
break
;
break
;
...
...
eeschema/sheet.cpp
View file @
55f65292
...
@@ -198,7 +198,7 @@ static void MoveOrResizeSheet( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint&
...
@@ -198,7 +198,7 @@ static void MoveOrResizeSheet( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint&
if
(
aErase
)
if
(
aErase
)
sheet
->
Draw
(
aPanel
,
aDC
,
wxPoint
(
0
,
0
),
g_XorMode
);
sheet
->
Draw
(
aPanel
,
aDC
,
wxPoint
(
0
,
0
),
g_XorMode
);
if
(
sheet
->
GetFlags
()
&
IS_RESIZED
)
if
(
sheet
->
IsResized
()
)
{
{
int
width
=
screen
->
GetCrossHairPosition
().
x
-
sheet
->
m_Pos
.
x
;
int
width
=
screen
->
GetCrossHairPosition
().
x
-
sheet
->
m_Pos
.
x
;
int
height
=
screen
->
GetCrossHairPosition
().
y
-
sheet
->
m_Pos
.
y
;
int
height
=
screen
->
GetCrossHairPosition
().
y
-
sheet
->
m_Pos
.
y
;
...
@@ -223,7 +223,7 @@ static void MoveOrResizeSheet( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint&
...
@@ -223,7 +223,7 @@ static void MoveOrResizeSheet( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint&
sheet
->
m_Pos
.
y
+
height
)
);
sheet
->
m_Pos
.
y
+
height
)
);
sheet
->
Resize
(
wxSize
(
grid
.
x
-
sheet
->
m_Pos
.
x
,
grid
.
y
-
sheet
->
m_Pos
.
y
)
);
sheet
->
Resize
(
wxSize
(
grid
.
x
-
sheet
->
m_Pos
.
x
,
grid
.
y
-
sheet
->
m_Pos
.
y
)
);
}
}
else
/* Move Sheet */
else
if
(
sheet
->
IsMoving
()
)
{
{
moveVector
=
screen
->
GetCrossHairPosition
()
-
sheet
->
m_Pos
;
moveVector
=
screen
->
GetCrossHairPosition
()
-
sheet
->
m_Pos
;
sheet
->
Move
(
moveVector
);
sheet
->
Move
(
moveVector
);
...
@@ -251,7 +251,7 @@ static void ExitSheet( EDA_DRAW_PANEL* aPanel, wxDC* aDC )
...
@@ -251,7 +251,7 @@ static void ExitSheet( EDA_DRAW_PANEL* aPanel, wxDC* aDC )
{
{
SAFE_DELETE
(
item
);
SAFE_DELETE
(
item
);
}
}
else
if
(
item
->
m_Flags
&
(
IS_RESIZED
|
IS_MOVED
)
)
else
if
(
item
->
IsMoving
()
||
item
->
IsResized
(
)
)
{
{
screen
->
RemoveFromDrawList
(
item
);
screen
->
RemoveFromDrawList
(
item
);
delete
item
;
delete
item
;
...
@@ -266,10 +266,6 @@ static void ExitSheet( EDA_DRAW_PANEL* aPanel, wxDC* aDC )
...
@@ -266,10 +266,6 @@ static void ExitSheet( EDA_DRAW_PANEL* aPanel, wxDC* aDC )
item
->
Draw
(
aPanel
,
aDC
,
wxPoint
(
0
,
0
),
GR_DEFAULT_DRAWMODE
);
item
->
Draw
(
aPanel
,
aDC
,
wxPoint
(
0
,
0
),
GR_DEFAULT_DRAWMODE
);
item
->
ClearFlags
();
item
->
ClearFlags
();
SCH_SHEET
*
sheet
=
(
SCH_SHEET
*
)
item
;
aPanel
->
CrossHairOff
(
aDC
);
screen
->
SetCrossHairPosition
(
sheet
->
GetResizePosition
()
);
aPanel
->
CrossHairOn
(
aDC
);
}
}
else
else
{
{
...
@@ -300,6 +296,7 @@ SCH_SHEET* SCH_EDIT_FRAME::CreateSheet( wxDC* aDC )
...
@@ -300,6 +296,7 @@ SCH_SHEET* SCH_EDIT_FRAME::CreateSheet( wxDC* aDC )
DrawPanel
->
m_mouseCaptureCallback
(
DrawPanel
,
aDC
,
wxDefaultPosition
,
false
);
DrawPanel
->
m_mouseCaptureCallback
(
DrawPanel
,
aDC
,
wxDefaultPosition
,
false
);
DrawPanel
->
CrossHairOff
(
aDC
);
DrawPanel
->
CrossHairOff
(
aDC
);
GetScreen
()
->
SetCrossHairPosition
(
sheet
->
GetResizePosition
()
);
GetScreen
()
->
SetCrossHairPosition
(
sheet
->
GetResizePosition
()
);
DrawPanel
->
MoveCursorToCrossHair
();
DrawPanel
->
CrossHairOn
(
aDC
);
DrawPanel
->
CrossHairOn
(
aDC
);
return
sheet
;
return
sheet
;
...
@@ -315,20 +312,19 @@ void SCH_EDIT_FRAME::ReSizeSheet( SCH_SHEET* aSheet, wxDC* aDC )
...
@@ -315,20 +312,19 @@ void SCH_EDIT_FRAME::ReSizeSheet( SCH_SHEET* aSheet, wxDC* aDC )
wxString
::
Format
(
wxT
(
"Cannot perform sheet resize on %s object."
),
wxString
::
Format
(
wxT
(
"Cannot perform sheet resize on %s object."
),
GetChars
(
aSheet
->
GetClass
()
)
)
);
GetChars
(
aSheet
->
GetClass
()
)
)
);
DrawPanel
->
CrossHairOff
(
aDC
);
GetScreen
()
->
SetCrossHairPosition
(
aSheet
->
GetResizePosition
()
);
DrawPanel
->
MoveCursorToCrossHair
();
DrawPanel
->
CrossHairOn
(
aDC
);
SetUndoItem
(
aSheet
);
SetUndoItem
(
aSheet
);
OnModify
();
aSheet
->
SetFlags
(
IS_RESIZED
);
aSheet
->
SetFlags
(
IS_RESIZED
);
DrawPanel
->
SetMouseCapture
(
MoveOrResizeSheet
,
ExitSheet
);
DrawPanel
->
SetMouseCapture
(
MoveOrResizeSheet
,
ExitSheet
);
DrawPanel
->
m_mouseCaptureCallback
(
DrawPanel
,
aDC
,
wxDefaultPosition
,
true
);
DrawPanel
->
m_mouseCaptureCallback
(
DrawPanel
,
aDC
,
wxDefaultPosition
,
true
);
if
(
aSheet
->
IsNew
()
)
// not already in edit, save a copy for undo/redo
if
(
aSheet
->
IsNew
()
)
// not already in edit, save a copy for undo/redo
SetUndoItem
(
aSheet
);
SetUndoItem
(
aSheet
);
DrawPanel
->
CrossHairOff
(
aDC
);
GetScreen
()
->
SetCrossHairPosition
(
aSheet
->
GetResizePosition
()
);
DrawPanel
->
CrossHairOn
(
aDC
);
}
}
...
...
include/base_struct.h
View file @
55f65292
...
@@ -412,6 +412,7 @@ public:
...
@@ -412,6 +412,7 @@ public:
inline
bool
IsMoving
()
const
{
return
m_Flags
&
IS_MOVED
;
}
inline
bool
IsMoving
()
const
{
return
m_Flags
&
IS_MOVED
;
}
inline
bool
IsDragging
()
const
{
return
m_Flags
&
IS_DRAGGED
;
}
inline
bool
IsDragging
()
const
{
return
m_Flags
&
IS_DRAGGED
;
}
inline
bool
IsSelected
()
const
{
return
m_Flags
&
SELECTED
;
}
inline
bool
IsSelected
()
const
{
return
m_Flags
&
SELECTED
;
}
inline
bool
IsResized
()
const
{
return
m_Flags
&
IS_RESIZED
;
}
void
SetModified
();
void
SetModified
();
...
...
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