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
dd3b684c
Commit
dd3b684c
authored
Jan 01, 2013
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eeschema: fix Bug #1095005
parent
aaf6cce6
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
89 additions
and
52 deletions
+89
-52
lib_draw_item.h
eeschema/lib_draw_item.h
+1
-1
libedit.cpp
eeschema/libedit.cpp
+3
-3
libedit_onleftclick.cpp
eeschema/libedit_onleftclick.cpp
+9
-11
libedit_onrightclick.cpp
eeschema/libedit_onrightclick.cpp
+23
-2
libeditframe.cpp
eeschema/libeditframe.cpp
+5
-4
libeditframe.h
eeschema/libeditframe.h
+16
-1
onrightclick.cpp
eeschema/onrightclick.cpp
+3
-3
pinedit.cpp
eeschema/pinedit.cpp
+25
-24
base_struct.h
include/base_struct.h
+4
-3
No files found.
eeschema/lib_draw_item.h
View file @
dd3b684c
...
@@ -398,7 +398,7 @@ public:
...
@@ -398,7 +398,7 @@ public:
*
*
* @return True if the item is being edited.
* @return True if the item is being edited.
*/
*/
bool
InEditMode
()
const
{
return
(
m_Flags
&
(
IS_NEW
|
IS_MOVED
|
IS_RESIZED
)
)
!=
0
;
}
bool
InEditMode
()
const
{
return
(
m_Flags
&
(
IS_NEW
|
IS_
DRAGGED
|
IS_
MOVED
|
IS_RESIZED
)
)
!=
0
;
}
void
SetEraseLastDrawItem
(
bool
aErase
=
true
)
{
m_eraseLastDrawItem
=
aErase
;
}
void
SetEraseLastDrawItem
(
bool
aErase
=
true
)
{
m_eraseLastDrawItem
=
aErase
;
}
...
...
eeschema/libedit.cpp
View file @
dd3b684c
/*
/*
* This program source code file is part of KiCad, a free EDA CAD application.
* This program source code file is part of KiCad, a free EDA CAD application.
*
*
* Copyright (C) 20
04 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 20
13 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2008-201
1
Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2008-201
3
Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2004-201
1
KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2004-201
3
KiCad Developers, see change_log.txt for contributors.
*
*
* This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* modify it under the terms of the GNU General Public License
...
...
eeschema/libedit_onleftclick.cpp
View file @
dd3b684c
/*
/*
* This program source code file is part of KiCad, a free EDA CAD application.
* This program source code file is part of KiCad, a free EDA CAD application.
*
*
* Copyright (C) 20
06 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 20
13 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 201
0
Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 201
3
Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-201
1
KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-201
3
KiCad Developers, see AUTHORS.txt for contributors.
*
*
* This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* modify it under the terms of the GNU General Public License
...
@@ -40,7 +40,10 @@
...
@@ -40,7 +40,10 @@
void
LIB_EDIT_FRAME
::
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
aPosition
)
void
LIB_EDIT_FRAME
::
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
aPosition
)
{
{
LIB_ITEM
*
item
=
m_drawItem
;
LIB_ITEM
*
item
=
m_drawItem
;
bool
no_item_edited
=
item
==
NULL
||
item
->
GetFlags
()
==
0
;
bool
item_in_edit
=
false
;
if
(
item
)
item_in_edit
=
item
->
IsNew
()
||
item
->
IsMoving
()
||
item
->
IsDragging
();
bool
no_item_edited
=
!
item_in_edit
;
if
(
m_component
==
NULL
)
// No component loaded !
if
(
m_component
==
NULL
)
// No component loaded !
return
;
return
;
...
@@ -63,7 +66,8 @@ void LIB_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& aPosition )
...
@@ -63,7 +66,8 @@ void LIB_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& aPosition )
switch
(
GetToolId
()
)
switch
(
GetToolId
()
)
{
{
case
ID_NO_TOOL_SELECTED
:
case
ID_NO_TOOL_SELECTED
:
if
(
item
&&
item
->
GetFlags
()
)
// moved object
// If an item is currently in edit, finish edit
if
(
item_in_edit
)
{
{
switch
(
item
->
Type
()
)
switch
(
item
->
Type
()
)
{
{
...
@@ -80,13 +84,9 @@ void LIB_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& aPosition )
...
@@ -80,13 +84,9 @@ void LIB_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& aPosition )
case
ID_LIBEDIT_PIN_BUTT
:
case
ID_LIBEDIT_PIN_BUTT
:
if
(
no_item_edited
)
if
(
no_item_edited
)
{
CreatePin
(
DC
);
CreatePin
(
DC
);
}
else
else
{
PlacePin
(
DC
);
PlacePin
(
DC
);
}
break
;
break
;
case
ID_LIBEDIT_BODY_LINE_BUTT
:
case
ID_LIBEDIT_BODY_LINE_BUTT
:
...
@@ -95,9 +95,7 @@ void LIB_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& aPosition )
...
@@ -95,9 +95,7 @@ void LIB_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& aPosition )
case
ID_LIBEDIT_BODY_RECT_BUTT
:
case
ID_LIBEDIT_BODY_RECT_BUTT
:
case
ID_LIBEDIT_BODY_TEXT_BUTT
:
case
ID_LIBEDIT_BODY_TEXT_BUTT
:
if
(
no_item_edited
)
if
(
no_item_edited
)
{
m_drawItem
=
CreateGraphicItem
(
m_component
,
DC
);
m_drawItem
=
CreateGraphicItem
(
m_component
,
DC
);
}
else
if
(
m_drawItem
)
else
if
(
m_drawItem
)
{
{
if
(
m_drawItem
->
IsNew
()
)
if
(
m_drawItem
->
IsNew
()
)
...
...
eeschema/libedit_onrightclick.cpp
View file @
dd3b684c
/**
/**
* @file libedit_onrightclick.cpp
* @file libedit_onrightclick.cpp
* @brief Library editor: create the pop menus when clicking on mouse right button
*/
*/
/* , In library editor, create the pop menu when clicking on mouse right button
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004-2013 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
*/
#include <fctsys.h>
#include <fctsys.h>
...
@@ -247,7 +268,7 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
...
@@ -247,7 +268,7 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
return
true
;
return
true
;
}
}
// Add menu items for pin edition
void
AddMenusForPin
(
wxMenu
*
PopMenu
,
LIB_PIN
*
Pin
,
LIB_EDIT_FRAME
*
frame
)
void
AddMenusForPin
(
wxMenu
*
PopMenu
,
LIB_PIN
*
Pin
,
LIB_EDIT_FRAME
*
frame
)
{
{
bool
selected
=
Pin
->
IsSelected
();
bool
selected
=
Pin
->
IsSelected
();
...
...
eeschema/libeditframe.cpp
View file @
dd3b684c
/*
/*
* This program source code file is part of KiCad, a free EDA CAD application.
* This program source code file is part of KiCad, a free EDA CAD application.
*
*
* Copyright (C) 20
04 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 20
13 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2008-201
1
Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2008-201
3
Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2004-201
1
KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2004-201
3
KiCad Developers, see change_log.txt for contributors.
*
*
* This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* modify it under the terms of the GNU General Public License
...
@@ -804,8 +804,9 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
...
@@ -804,8 +804,9 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
break
;
break
;
SaveCopyInUndoList
(
m_component
);
SaveCopyInUndoList
(
m_component
);
GlobalSetPins
(
&
dc
,
(
LIB_PIN
*
)
m_drawItem
,
id
);
GlobalSetPins
(
(
LIB_PIN
*
)
m_drawItem
,
id
);
m_canvas
->
MoveCursorToCrossHair
();
m_canvas
->
MoveCursorToCrossHair
();
m_canvas
->
Refresh
();
break
;
break
;
case
ID_POPUP_ZOOM_BLOCK
:
case
ID_POPUP_ZOOM_BLOCK
:
...
...
eeschema/libeditframe.h
View file @
dd3b684c
...
@@ -585,7 +585,22 @@ public:
...
@@ -585,7 +585,22 @@ public:
virtual
bool
HandleBlockEnd
(
wxDC
*
DC
);
virtual
bool
HandleBlockEnd
(
wxDC
*
DC
);
void
PlacePin
(
wxDC
*
DC
);
void
PlacePin
(
wxDC
*
DC
);
void
GlobalSetPins
(
wxDC
*
DC
,
LIB_PIN
*
MasterPin
,
int
id
);
/**
* Function GlobalSetPins
* @param aMasterPin is the "template" pin
* @param aId is a param to select what should be mofified:
* - aId = ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNAMESIZE_ITEM:
* Change pins text name size
* - aId = ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNUMSIZE_ITEM:
* Change pins text num size
* - aId = ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINSIZE_ITEM:
* Change pins length.
*
* If aMasterPin is selected ( .m_flag == IS_SELECTED ),
* only the other selected pins are modified
*/
void
GlobalSetPins
(
LIB_PIN
*
aMasterPin
,
int
aId
);
// Automatic placement of pins
// Automatic placement of pins
void
RepeatPinItem
(
wxDC
*
DC
,
LIB_PIN
*
Pin
);
void
RepeatPinItem
(
wxDC
*
DC
,
LIB_PIN
*
Pin
);
...
...
eeschema/onrightclick.cpp
View file @
dd3b684c
/*
/*
* This program source code file is part of KiCad, a free EDA CAD application.
* This program source code file is part of KiCad, a free EDA CAD application.
*
*
* Copyright (C) 20
04 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 20
13 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2008-201
1
Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2008-201
3
Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2004-201
1
KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2004-201
3
KiCad Developers, see change_log.txt for contributors.
*
*
* This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* modify it under the terms of the GNU General Public License
...
...
eeschema/pinedit.cpp
View file @
dd3b684c
...
@@ -159,7 +159,6 @@ void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event )
...
@@ -159,7 +159,6 @@ void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event )
pin
->
SetFlags
(
item_flags
);
pin
->
SetFlags
(
item_flags
);
}
}
/**
/**
* Clean up after aborting a move pin command.
* Clean up after aborting a move pin command.
*/
*/
...
@@ -467,58 +466,60 @@ void LIB_EDIT_FRAME::CreateImagePins( LIB_PIN* aPin, int aUnit, int aConvert, bo
...
@@ -467,58 +466,60 @@ void LIB_EDIT_FRAME::CreateImagePins( LIB_PIN* aPin, int aUnit, int aConvert, bo
}
}
/* Depending on "id":
/* aMasterPin is the "template" pin
* - Change pin text size (name or num) (range 10 .. 1000 mil)
* aId is a param to select what should be mofified:
* - Change pin length.
* - aId = ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNAMESIZE_ITEM:
* Change pins text name size
* - aId = ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNUMSIZE_ITEM:
* Change pins text num size
* - aId = ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINSIZE_ITEM:
* Change pins length.
*
*
* If
Pin is selected ( .m_flag == IS_SELECTED ) only the other selected
* If
aMasterPin is selected ( .m_flag == IS_SELECTED ),
* pins are modified
*
only the other selected
pins are modified
*/
*/
void
LIB_EDIT_FRAME
::
GlobalSetPins
(
wxDC
*
DC
,
LIB_PIN
*
MasterPin
,
int
i
d
)
void
LIB_EDIT_FRAME
::
GlobalSetPins
(
LIB_PIN
*
aMasterPin
,
int
aI
d
)
{
{
LIB_PIN
*
Pin
;
bool
selected
=
aMasterPin
->
IsSelected
();
bool
selected
=
MasterPin
->
IsSelected
();
bool
showPinText
=
true
;
if
(
(
m_component
==
NULL
)
||
(
MasterPin
==
NULL
)
)
if
(
(
m_component
==
NULL
)
||
(
a
MasterPin
==
NULL
)
)
return
;
return
;
if
(
MasterPin
->
Type
()
!=
LIB_PIN_T
)
if
(
a
MasterPin
->
Type
()
!=
LIB_PIN_T
)
return
;
return
;
OnModify
(
);
OnModify
(
);
P
in
=
m_component
->
GetNextPin
();
LIB_PIN
*
p
in
=
m_component
->
GetNextPin
();
for
(
;
Pin
!=
NULL
;
Pin
=
m_component
->
GetNextPin
(
P
in
)
)
for
(
;
pin
!=
NULL
;
pin
=
m_component
->
GetNextPin
(
p
in
)
)
{
{
if
(
(
Pin
->
GetConvert
()
)
&&
(
P
in
->
GetConvert
()
!=
m_convert
)
)
if
(
(
pin
->
GetConvert
()
)
&&
(
p
in
->
GetConvert
()
!=
m_convert
)
)
continue
;
continue
;
// Is it the "selected mode" ?
// Is it the "selected mode" ?
if
(
selected
&&
!
P
in
->
IsSelected
()
)
if
(
selected
&&
!
p
in
->
IsSelected
()
)
continue
;
continue
;
Pin
->
Draw
(
m_canvas
,
DC
,
wxPoint
(
0
,
0
),
UNSPECIFIED_COLOR
,
g_XorMode
,
&
showPinText
,
DefaultTransform
);
switch
(
aId
)
switch
(
id
)
{
{
case
ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNUMSIZE_ITEM
:
case
ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNUMSIZE_ITEM
:
Pin
->
SetNumberTextSize
(
MasterPin
->
GetNumberTextSize
()
);
pin
->
SetNumberTextSize
(
a
MasterPin
->
GetNumberTextSize
()
);
break
;
break
;
case
ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNAMESIZE_ITEM
:
case
ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNAMESIZE_ITEM
:
Pin
->
SetNameTextSize
(
MasterPin
->
GetNameTextSize
()
);
pin
->
SetNameTextSize
(
a
MasterPin
->
GetNameTextSize
()
);
break
;
break
;
case
ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINSIZE_ITEM
:
case
ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINSIZE_ITEM
:
Pin
->
SetLength
(
MasterPin
->
GetLength
()
);
pin
->
SetLength
(
a
MasterPin
->
GetLength
()
);
break
;
break
;
}
}
Pin
->
Draw
(
m_canvas
,
DC
,
wxPoint
(
0
,
0
),
UNSPECIFIED_COLOR
,
GR_DEFAULT_DRAWMODE
,
&
showPinText
,
// Clear the flag IS_CHANGED, which was set by previous changes (if any)
DefaultTransform
);
// but not used here.
pin
->
ClearFlags
(
IS_CHANGED
);
}
}
}
}
...
...
include/base_struct.h
View file @
dd3b684c
/*
/*
* This program source code file is part of KiCad, a free EDA CAD application.
* This program source code file is part of KiCad, a free EDA CAD application.
*
*
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2008-2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2008-2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2008-2013 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2004-2013 KiCad Developers, see change_log.txt for contributors.
*
*
* This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* modify it under the terms of the GNU General Public License
...
...
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