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
fdb18547
Commit
fdb18547
authored
Nov 17, 2010
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eeschema: fix bug 676532. Minor enhancements.
parent
67b14484
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
1778 additions
and
155 deletions
+1778
-155
base_struct.cpp
common/base_struct.cpp
+41
-0
CMakeLists.txt
eeschema/CMakeLists.txt
+2
-2
dialog_lib_edit_pin.cpp
eeschema/dialogs/dialog_lib_edit_pin.cpp
+0
-0
dialog_lib_edit_pin.h
eeschema/dialogs/dialog_lib_edit_pin.h
+0
-0
dialog_lib_edit_pin_base.cpp
eeschema/dialogs/dialog_lib_edit_pin_base.cpp
+10
-9
dialog_lib_edit_pin_base.fbp
eeschema/dialogs/dialog_lib_edit_pin_base.fbp
+1519
-0
dialog_lib_edit_pin_base.h
eeschema/dialogs/dialog_lib_edit_pin_base.h
+11
-1
lib_draw_item.h
eeschema/lib_draw_item.h
+5
-0
lib_field.cpp
eeschema/lib_field.cpp
+30
-3
lib_field.h
eeschema/lib_field.h
+7
-0
sch_sheet_pin.cpp
eeschema/sch_sheet_pin.cpp
+1
-0
base_struct.h
include/base_struct.h
+14
-0
PolyLine.cpp
polygon/PolyLine.cpp
+138
-140
No files found.
common/base_struct.cpp
View file @
fdb18547
...
...
@@ -463,6 +463,27 @@ void EDA_TextStruct::DrawOneLineOfText( WinEDA_DrawPanel* aPanel, wxDC* aDC,
m_HJustify
,
m_VJustify
,
width
,
m_Italic
,
m_Bold
);
}
/**
* Function GetStyleName
* @return a wwString withe the style name( Normal, Italic, Bold, Bold+Italic)
*/
wxString
EDA_TextStruct
::
GetTextStyleName
()
{
int
style
=
0
;
if
(
m_Italic
)
style
=
1
;
if
(
m_Bold
)
style
+=
2
;
wxString
stylemsg
[
4
]
=
{
_
(
"Normal"
),
_
(
"Italic"
),
_
(
"Bold"
),
_
(
"Bold+Italic"
)
};
return
stylemsg
[
style
];
}
/******************/
/* Class EDA_Rect */
...
...
@@ -666,3 +687,23 @@ void EDA_Rect::Merge( const EDA_Rect& aRect )
end
.
y
=
MAX
(
end
.
y
,
rect_end
.
y
);
SetEnd
(
end
);
}
/**
* Function Merge
* modifies Position and Size of this in order to contain the given point
* mainly used to calculate bounding boxes
* @param aPoint = given point to merge with this
*/
void
EDA_Rect
::
Merge
(
const
wxPoint
&
aPoint
)
{
Normalize
();
// ensure width and height >= 0
wxPoint
end
=
GetEnd
();
// Change origin and size in order to contain the given rect
m_Pos
.
x
=
MIN
(
m_Pos
.
x
,
aPoint
.
x
);
m_Pos
.
y
=
MIN
(
m_Pos
.
y
,
aPoint
.
y
);
end
.
x
=
MAX
(
end
.
x
,
aPoint
.
x
);
end
.
y
=
MAX
(
end
.
y
,
aPoint
.
y
);
SetEnd
(
end
);
}
eeschema/CMakeLists.txt
View file @
fdb18547
...
...
@@ -56,8 +56,8 @@ set(EESCHEMA_SRCS
dialog_libedit_dimensions_base.cpp
dialog_lib_edit_draw_item.cpp
dialog_lib_edit_draw_item_base.cpp
dialog_lib_edit_pin.cpp
dialog_lib_edit_pin_base.cpp
dialog
s/dialog
_lib_edit_pin.cpp
dialog
s/dialog
_lib_edit_pin_base.cpp
dialog_lib_new_component.cpp
dialog_lib_new_component_base.cpp
dialogs/dialog_print_using_printer_base.cpp
...
...
eeschema/dialog_lib_edit_pin.cpp
→
eeschema/dialog
s/dialog
_lib_edit_pin.cpp
View file @
fdb18547
File moved
eeschema/dialog_lib_edit_pin.h
→
eeschema/dialog
s/dialog
_lib_edit_pin.h
View file @
fdb18547
File moved
eeschema/dialog_lib_edit_pin_base.cpp
→
eeschema/dialog
s/dialog
_lib_edit_pin_base.cpp
View file @
fdb18547
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version
Apr 16 2008
)
// C++ code generated with wxFormBuilder (version
Sep 8 2010
)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
...
...
@@ -11,6 +11,10 @@
///////////////////////////////////////////////////////////////////////////
BEGIN_EVENT_TABLE
(
DIALOG_LIB_EDIT_PIN_BASE
,
wxDialog
)
EVT_CHECKBOX
(
wxID_ANY
,
DIALOG_LIB_EDIT_PIN_BASE
::
_wxFB_OnCBpartSelection
)
END_EVENT_TABLE
()
DIALOG_LIB_EDIT_PIN_BASE
::
DIALOG_LIB_EDIT_PIN_BASE
(
wxWindow
*
parent
,
wxWindowID
id
,
const
wxString
&
title
,
const
wxPoint
&
pos
,
const
wxSize
&
size
,
long
style
)
:
wxDialog
(
parent
,
id
,
title
,
pos
,
size
,
style
)
{
this
->
SetSizeHints
(
wxDefaultSize
,
wxDefaultSize
);
...
...
@@ -101,10 +105,10 @@ DIALOG_LIB_EDIT_PIN_BASE::DIALOG_LIB_EDIT_PIN_BASE( wxWindow* parent, wxWindowID
fgSizer1
->
Add
(
0
,
0
,
1
,
wxEXPAND
,
3
);
fgSizer1
->
Add
(
0
,
0
,
1
,
wxEXPAND
,
3
);
fgSizer1
->
Add
(
0
,
0
,
1
,
wxEXPAND
,
5
);
fgSizer1
->
Add
(
0
,
0
,
1
,
wxEXPAND
,
3
);
fgSizer1
->
Add
(
0
,
0
,
1
,
wxEXPAND
,
5
);
fgSizer1
->
Add
(
0
,
0
,
0
,
wxEXPAND
,
3
);
...
...
@@ -120,10 +124,10 @@ DIALOG_LIB_EDIT_PIN_BASE::DIALOG_LIB_EDIT_PIN_BASE( wxWindow* parent, wxWindowID
fgSizer1
->
Add
(
0
,
0
,
1
,
wxEXPAND
,
3
);
fgSizer1
->
Add
(
0
,
0
,
1
,
wxEXPAND
,
3
);
fgSizer1
->
Add
(
0
,
0
,
1
,
wxEXPAND
,
5
);
fgSizer1
->
Add
(
0
,
0
,
1
,
wxEXPAND
,
3
);
fgSizer1
->
Add
(
0
,
0
,
1
,
wxEXPAND
,
5
);
mainSizer
->
Add
(
fgSizer1
,
0
,
wxALL
|
wxEXPAND
,
12
);
...
...
@@ -131,16 +135,13 @@ DIALOG_LIB_EDIT_PIN_BASE::DIALOG_LIB_EDIT_PIN_BASE( wxWindow* parent, wxWindowID
boarderSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
m_checkApplyToAllParts
=
new
wxCheckBox
(
this
,
wxID_ANY
,
_
(
"Add to all &parts in package"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
boarderSizer
->
Add
(
m_checkApplyToAllParts
,
0
,
wxALIGN_CENTER_VERTICAL
|
wxALL
,
3
);
m_checkApplyToAllConversions
=
new
wxCheckBox
(
this
,
wxID_ANY
,
_
(
"Add to all alternate &body styles (DeMorgan)"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
boarderSizer
->
Add
(
m_checkApplyToAllConversions
,
0
,
wxALIGN_CENTER_VERTICAL
|
wxALL
,
3
);
m_checkShow
=
new
wxCheckBox
(
this
,
wxID_ANY
,
_
(
"&Visible"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_checkShow
->
SetValue
(
true
);
boarderSizer
->
Add
(
m_checkShow
,
0
,
wxALIGN_CENTER_VERTICAL
|
wxALL
,
3
);
...
...
eeschema/dialog
_lib_edit_pin
.fbp
→
eeschema/dialog
s/dialog_lib_edit_pin_base
.fbp
View file @
fdb18547
This source diff could not be displayed because it is too large. You can
view the blob
instead.
eeschema/dialog_lib_edit_pin_base.h
→
eeschema/dialog
s/dialog
_lib_edit_pin_base.h
View file @
fdb18547
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version
Apr 16 2008
)
// C++ code generated with wxFormBuilder (version
Sep 8 2010
)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
...
...
@@ -32,8 +32,13 @@ class wxBitmapComboBox;
///////////////////////////////////////////////////////////////////////////////
class
DIALOG_LIB_EDIT_PIN_BASE
:
public
wxDialog
{
DECLARE_EVENT_TABLE
()
private
:
// Private event handlers
void
_wxFB_OnCBpartSelection
(
wxCommandEvent
&
event
){
OnCBpartSelection
(
event
);
}
protected
:
wxStaticText
*
m_staticText1
;
wxTextCtrl
*
m_textName
;
...
...
@@ -72,7 +77,12 @@ class DIALOG_LIB_EDIT_PIN_BASE : public wxDialog
wxButton
*
m_sdbSizer1OK
;
wxButton
*
m_sdbSizer1Cancel
;
// Virtual event handlers, overide them in your derived class
virtual
void
OnCBpartSelection
(
wxCommandEvent
&
event
)
{
event
.
Skip
();
}
public
:
DIALOG_LIB_EDIT_PIN_BASE
(
wxWindow
*
parent
,
wxWindowID
id
=
wxID_ANY
,
const
wxString
&
title
=
_
(
"Pin Properties"
),
const
wxPoint
&
pos
=
wxDefaultPosition
,
const
wxSize
&
size
=
wxDefaultSize
,
long
style
=
wxDEFAULT_DIALOG_STYLE
|
wxRESIZE_BORDER
);
~
DIALOG_LIB_EDIT_PIN_BASE
();
...
...
eeschema/lib_draw_item.h
View file @
fdb18547
...
...
@@ -232,6 +232,11 @@ public:
return
EDA_BaseStruct
::
GetBoundingBox
();
}
/**
* Displays basic info (type, part and convert) about item
* in msg panel
* @param aFrame = main frame where the message manel info is.
*/
virtual
void
DisplayInfo
(
WinEDA_DrawFrame
*
aFrame
);
/**
...
...
eeschema/lib_field.cpp
View file @
fdb18547
...
...
@@ -298,6 +298,9 @@ void LIB_FIELD::drawGraphic( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint&
int
color
;
int
linewidth
=
GetPenSize
();
if
(
m_Bold
)
linewidth
=
GetPenSizeForBold
(
m_Size
.
x
);
else
linewidth
=
Clamp_Text_PenSize
(
linewidth
,
m_Size
,
m_Bold
);
if
(
(
m_Attributs
&
TEXT_NO_VISIBLE
)
&&
(
aColor
<
0
)
)
...
...
@@ -339,8 +342,7 @@ void LIB_FIELD::drawGraphic( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint&
EDA_Rect bBox = GetBoundingBox();
m_Text = tmp;
bBox.Inflate( 1, 1 );
GRRect( &aPanel->m_ClipBox, aDC, bBox.GetOrigin().x, bBox.GetOrigin().y,
bBox.GetEnd().x, bBox.GetEnd().y, 0, LIGHTMAGENTA );
GRRect( &aPanel->m_ClipBox, aDC, bBox, 0, LIGHTMAGENTA );
#endif
}
...
...
@@ -703,3 +705,28 @@ void LIB_FIELD::calcEdit( const wxPoint& aPosition )
Move
(
m_initialPos
+
aPosition
-
m_initialCursorPos
);
}
}
void
LIB_FIELD
::
DisplayInfo
(
WinEDA_DrawFrame
*
aFrame
)
{
wxString
msg
;
LIB_DRAW_ITEM
::
DisplayInfo
(
aFrame
);
// Display style:
msg
=
GetTextStyleName
();
aFrame
->
AppendMsgPanel
(
_
(
"Style"
),
msg
,
MAGENTA
);
msg
=
ReturnStringFromValue
(
g_UserUnit
,
m_Size
.
x
,
EESCHEMA_INTERNAL_UNIT
,
true
);
aFrame
->
AppendMsgPanel
(
_
(
"Size X"
),
msg
,
BLUE
);
msg
=
ReturnStringFromValue
(
g_UserUnit
,
m_Size
.
y
,
EESCHEMA_INTERNAL_UNIT
,
true
);
aFrame
->
AppendMsgPanel
(
_
(
"Size Y"
),
msg
,
BLUE
);
// Display field name (ref, value ...)
msg
=
GetName
();
aFrame
->
AppendMsgPanel
(
_
(
"Field"
),
msg
,
BROWN
);
// Display field text:
aFrame
->
AppendMsgPanel
(
_
(
"Value"
),
m_Text
,
BROWN
);
}
eeschema/lib_field.h
View file @
fdb18547
...
...
@@ -107,6 +107,13 @@ public:
*/
virtual
EDA_Rect
GetBoundingBox
();
/**
* Displays info (type, part convert filed name and value)
* in msg panel
* @param aFrame = main frame where the message manel info is.
*/
virtual
void
DisplayInfo
(
WinEDA_DrawFrame
*
aFrame
);
/**
* Test if the given point is within the bounds of this object.
*
...
...
eeschema/sch_sheet_pin.cpp
View file @
fdb18547
...
...
@@ -58,6 +58,7 @@ SCH_SHEET_PIN* SCH_SHEET_PIN::GenCopy()
newitem
->
SetEdge
(
GetEdge
()
);
newitem
->
m_Shape
=
m_Shape
;
newitem
->
m_Size
=
m_Size
;
newitem
->
SetNumber
(
GetNumber
()
);
return
newitem
;
}
...
...
include/base_struct.h
View file @
fdb18547
...
...
@@ -243,6 +243,14 @@ public:
* @param aRect = given rect to merge with this
*/
void
Merge
(
const
EDA_Rect
&
aRect
);
/**
* Function Merge
* Modify Position and Size of this in order to contain the given point
* mainly used to calculate bounding boxes
* @param aPoint = given point to merge with this
*/
void
Merge
(
const
wxPoint
&
aPoint
);
};
...
...
@@ -676,6 +684,12 @@ public:
{
return
((
m_Size
.
y
*
14
)
/
10
)
+
m_Width
;
}
/**
* Function GetTextStyleName
* @return a wwString withe the style name( Normal, Italic, Bold, Bold+Italic)
*/
wxString
GetTextStyleName
();
};
#endif
/* BASE_STRUCT_H */
polygon/PolyLine.cpp
View file @
fdb18547
...
...
@@ -155,7 +155,7 @@ int CPolyLine::NormalizeWithKbool( std::vector<CPolyLine*> * aExtraPolyList, boo
{
// find the polygon that contains this hole
// testing one corner inside is enought because a hole is entirely inside the polygon
// sowe test only the first corner
// so
we test only the first corner
int
x
=
(
*
hole
)[
0
];
int
y
=
(
*
hole
)[
1
];
if
(
TestPointInside
(
x
,
y
)
)
...
...
@@ -1196,8 +1196,9 @@ void CPolyLine::Hatch()
int
layer
=
GetLayer
();
if
(
GetClosed
()
)
// If not closed, the poly is beeing created and not finalised. Not not hatch
{
if
(
!
GetClosed
()
)
// If not closed, the poly is beeing created and not finalised. Not not hatch
return
;
enum
{
MAXPTS
=
100
};
...
...
@@ -1302,9 +1303,9 @@ void CPolyLine::Hatch()
}
while
(
npts
%
2
!=
0
&&
nloops
<
3
);
/* DICK 1/22/08: this was firing repeatedly on me, needed to comment out to get
* my work done:
* wxASSERT( npts%2==0 ); // odd number of intersection points, error
*/
* my work done:
* wxASSERT( npts%2==0 ); // odd number of intersection points, error
*/
// sort points in order of descending x (if more than 2)
if
(
npts
>
2
)
...
...
@@ -1357,9 +1358,6 @@ void CPolyLine::Hatch()
}
}
}
// end for
}
}
...
...
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