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
d60caed4
Commit
d60caed4
authored
May 06, 2011
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pin edit: fix some minor issues.
parent
883929f9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
22 deletions
+30
-22
dialog_lib_edit_pin.cpp
eeschema/dialogs/dialog_lib_edit_pin.cpp
+7
-3
lib_pin.cpp
eeschema/lib_pin.cpp
+21
-17
lib_pin.h
eeschema/lib_pin.h
+2
-2
No files found.
eeschema/dialogs/dialog_lib_edit_pin.cpp
View file @
d60caed4
...
...
@@ -15,10 +15,13 @@ wxSize DIALOG_LIB_EDIT_PIN::s_LastSize;
DIALOG_LIB_EDIT_PIN
::
DIALOG_LIB_EDIT_PIN
(
wxWindow
*
parent
,
LIB_PIN
*
aPin
)
:
DIALOG_LIB_EDIT_PIN_BASE
(
parent
)
{
// Creates a dummy pin to show on a panel, insside this dialog:
m_dummyPin
=
new
LIB_PIN
(
*
aPin
);
// m_dummyPin changes do not proparagte to a parent, so set parent to null
// m_dummyPin changes do not proparagte to other pins of the current lib component,
// so set parent to null and clear flags
m_dummyPin
->
SetParent
(
NULL
);
m_dummyPin
->
ClearFlags
();
m_panelShowPin
->
SetBackgroundColour
(
MakeColour
(
g_DrawBgColor
)
);
...
...
@@ -60,7 +63,7 @@ void DIALOG_LIB_EDIT_PIN::OnPaintShowPanel( wxPaintEvent& event )
// Give a parent to m_dummyPin only from draw purpose.
// In fact m_dummyPin should not have a parent, but draw functions need a parent
// to know some options
// to know some options
, about pin texts
LIB_EDIT_FRAME
*
libframe
=
(
LIB_EDIT_FRAME
*
)
GetParent
();
m_dummyPin
->
SetParent
(
libframe
->
GetComponent
()
);
...
...
@@ -79,7 +82,6 @@ void DIALOG_LIB_EDIT_PIN::OnPaintShowPanel( wxPaintEvent& event )
NEGATE
(
offset
.
y
);
GRResetPenAndBrush
(
&
dc
);
m_dummyPin
->
SetVisible
(
true
);
// TODO find a better way to show invisible pin here
m_dummyPin
->
Draw
(
NULL
,
&
dc
,
offset
,
-
1
,
wxCOPY
,
NULL
,
DefaultTransform
);
...
...
@@ -115,6 +117,8 @@ void DIALOG_LIB_EDIT_PIN::OnOKButtonClick( wxCommandEvent& event )
// Called when a pin properties changes
void
DIALOG_LIB_EDIT_PIN
::
OnPropertiesChange
(
wxCommandEvent
&
event
)
{
if
(
!
IsShown
()
)
// do nothing at init time
return
;
int
units
=
((
LIB_EDIT_FRAME
*
)
GetParent
())
->
m_InternalUnits
;
int
pinNameSize
=
ReturnValueFromString
(
g_UserUnit
,
GetNameTextSize
(),
units
);
int
pinNumSize
=
ReturnValueFromString
(
g_UserUnit
,
GetPadNameTextSize
(),
units
);
...
...
eeschema/lib_pin.cpp
View file @
d60caed4
...
...
@@ -470,9 +470,9 @@ void LIB_PIN::SetVisible( bool visible )
return
;
if
(
visible
)
m_attributes
&=
~
PIN
NOTDRAW
;
m_attributes
&=
~
PIN
_INVISIBLE
;
else
m_attributes
|=
PIN
NOTDRAW
;
m_attributes
|=
PIN
_INVISIBLE
;
SetModified
();
...
...
@@ -488,9 +488,9 @@ void LIB_PIN::SetVisible( bool visible )
continue
;
if
(
visible
)
pinList
[
i
]
->
m_attributes
&=
~
PIN
NOTDRAW
;
pinList
[
i
]
->
m_attributes
&=
~
PIN
_INVISIBLE
;
else
pinList
[
i
]
->
m_attributes
|=
PIN
NOTDRAW
;
pinList
[
i
]
->
m_attributes
|=
PIN
_INVISIBLE
;
SetModified
();
}
...
...
@@ -619,13 +619,12 @@ bool LIB_PIN::Save( FILE* ExportFile )
m_Unit
,
m_Convert
,
Etype
)
<
0
)
return
false
;
if
(
(
m_shape
)
||
(
m_attributes
&
PINNOTDRAW
)
)
if
(
m_shape
||
!
IsVisible
(
)
)
{
if
(
fprintf
(
ExportFile
,
" "
)
<
0
)
return
false
;
}
if
(
m_attributes
&
PINNOTDRAW
&&
fprintf
(
ExportFile
,
"N"
)
<
0
)
if
(
!
IsVisible
()
&&
fprintf
(
ExportFile
,
"N"
)
<
0
)
return
false
;
if
(
m_shape
&
INVERT
&&
fprintf
(
ExportFile
,
"I"
)
<
0
)
...
...
@@ -741,7 +740,7 @@ bool LIB_PIN::Load( char* line, wxString& errorMsg )
break
;
case
'N'
:
m_attributes
|=
PIN
NOTDRAW
;
m_attributes
|=
PIN
_INVISIBLE
;
break
;
case
'I'
:
...
...
@@ -797,16 +796,21 @@ void LIB_PIN::drawGraphic( EDA_DRAW_PANEL* aPanel,
void
*
aData
,
const
TRANSFORM
&
aTransform
)
{
// Invisible pins are only drawn on request.
In libedit they are drawn
//
in g_InvisibleItemColor because we must see them
.
SCH_EDIT_FRAME
*
frame
=
(
SCH_EDIT_FRAME
*
)
wxGetApp
().
GetTopWindow
();
if
(
m_attributes
&
PINNOTDRAW
)
// Invisible pins are only drawn on request.
//
They are drawn in g_InvisibleItemColor
.
// in schematic, they are drawn only if m_ShowAllPins is true.
// In other windows, they are always drawn because we must see them.
if
(
!
IsVisible
()
)
{
if
(
frame
->
m_LibeditFrame
&&
frame
->
m_LibeditFrame
->
IsActive
()
)
aColor
=
g_InvisibleItemColor
;
else
if
(
!
frame
->
m_ShowAllPins
)
EDA_DRAW_FRAME
*
frame
=
NULL
;
if
(
aPanel
&&
aPanel
->
GetParent
()
)
frame
=
(
EDA_DRAW_FRAME
*
)
aPanel
->
GetParent
();
if
(
frame
&&
frame
->
m_Ident
==
SCHEMATIC_FRAME
&&
!
((
SCH_EDIT_FRAME
*
)
frame
)
->
m_ShowAllPins
)
return
;
aColor
=
g_InvisibleItemColor
;
}
LIB_COMPONENT
*
Entry
=
GetParent
();
...
...
@@ -1673,7 +1677,7 @@ void LIB_PIN::DoMirrorHorizontal( const wxPoint& center )
void
LIB_PIN
::
DoPlot
(
PLOTTER
*
plotter
,
const
wxPoint
&
offset
,
bool
fill
,
const
TRANSFORM
&
aTransform
)
{
if
(
m_attributes
&
PINNOTDRAW
)
if
(
!
IsVisible
()
)
return
;
int
orient
=
ReturnPinDrawOrient
(
aTransform
);
...
...
eeschema/lib_pin.h
View file @
d60caed4
...
...
@@ -52,7 +52,7 @@ enum ElectricPinType {
extern
const
wxChar
*
MsgPinElectricType
[];
/* Pin visibility flag bit. */
#define PIN
NOTDRAW
1
/* Set makes pin invisible */
#define PIN
_INVISIBLE
1
/* Set makes pin invisible */
/**
...
...
@@ -350,7 +350,7 @@ public:
*
* @return True if draw object is visible otherwise false.
*/
bool
IsVisible
()
{
return
(
m_attributes
&
PIN
NOTDRAW
)
==
0
;
}
bool
IsVisible
()
{
return
(
m_attributes
&
PIN
_INVISIBLE
)
==
0
;
}
/**
* @return the size of the "pen" that be used to draw or plot this item.
...
...
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