diff --git a/common/base_struct.cpp b/common/base_struct.cpp
index 7c5badd98e..c91c874565 100644
--- a/common/base_struct.cpp
+++ b/common/base_struct.cpp
@@ -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 );
+}
+
diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt
index 79025de9f2..c6f364a25a 100644
--- a/eeschema/CMakeLists.txt
+++ b/eeschema/CMakeLists.txt
@@ -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
+ dialogs/dialog_lib_edit_pin.cpp
+ dialogs/dialog_lib_edit_pin_base.cpp
dialog_lib_new_component.cpp
dialog_lib_new_component_base.cpp
dialogs/dialog_print_using_printer_base.cpp
diff --git a/eeschema/dialog_lib_edit_pin.fbp b/eeschema/dialog_lib_edit_pin.fbp
deleted file mode 100644
index 348d80075c..0000000000
--- a/eeschema/dialog_lib_edit_pin.fbp
+++ /dev/null
@@ -1,1400 +0,0 @@
-
-
-
-
-
diff --git a/eeschema/dialog_lib_edit_pin.cpp b/eeschema/dialogs/dialog_lib_edit_pin.cpp
similarity index 100%
rename from eeschema/dialog_lib_edit_pin.cpp
rename to eeschema/dialogs/dialog_lib_edit_pin.cpp
diff --git a/eeschema/dialog_lib_edit_pin.h b/eeschema/dialogs/dialog_lib_edit_pin.h
similarity index 100%
rename from eeschema/dialog_lib_edit_pin.h
rename to eeschema/dialogs/dialog_lib_edit_pin.h
diff --git a/eeschema/dialog_lib_edit_pin_base.cpp b/eeschema/dialogs/dialog_lib_edit_pin_base.cpp
similarity index 91%
rename from eeschema/dialog_lib_edit_pin_base.cpp
rename to eeschema/dialogs/dialog_lib_edit_pin_base.cpp
index 7f793d7389..b2b5543d6f 100644
--- a/eeschema/dialog_lib_edit_pin_base.cpp
+++ b/eeschema/dialogs/dialog_lib_edit_pin_base.cpp
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// 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);
-
+ m_checkShow->SetValue(true);
boarderSizer->Add( m_checkShow, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
diff --git a/eeschema/dialogs/dialog_lib_edit_pin_base.fbp b/eeschema/dialogs/dialog_lib_edit_pin_base.fbp
new file mode 100644
index 0000000000..3fb3c0b86b
--- /dev/null
+++ b/eeschema/dialogs/dialog_lib_edit_pin_base.fbp
@@ -0,0 +1,1519 @@
+
+
+
+
+
+ C++
+ 1
+ source_name
+ 0
+ UTF-8
+ table
+ dialog_lib_edit_pin_base
+ 1000
+ none
+ 1
+ dialog_lib_edit_pin
+
+ .
+
+ 1
+ 1
+ 1
+ 0
+
+
+ wxBOTH
+
+ 1
+ 1
+ impl_virtual
+
+
+
+ 0
+ wxID_ANY
+
+
+ DIALOG_LIB_EDIT_PIN_BASE
+
+
+ wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER
+
+ Pin Properties
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ mainSizer
+ wxVERTICAL
+ none
+
+ 12
+ wxALL|wxEXPAND
+ 0
+
+ 6
+ wxBOTH
+
+
+ 0
+
+ fgSizer1
+ wxFLEX_GROWMODE_ALL
+ none
+ 5
+ 0
+
+ 3
+ wxALIGN_CENTER_VERTICAL|wxALL
+ 0
+
+
+
+ 1
+ 1
+
+
+ 0
+ wxID_ANY
+ Pin &name:
+
+
+ m_staticText1
+ protected
+
+
+
+
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+ -1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 3
+ wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND
+ 0
+
+
+
+ 1
+ 1
+
+
+ 0
+ wxID_ANY
+
+ 0
+
+ m_textName
+ protected
+
+
+
+
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 3
+ wxEXPAND
+ 1
+
+ 0
+ protected
+ 0
+
+
+
+ 3
+ wxALIGN_CENTER_VERTICAL|wxALL
+ 0
+
+
+
+ 1
+ 1
+
+
+ 0
+ wxID_ANY
+ N&ame text size:
+
+
+ m_staticText2
+ protected
+
+
+
+
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+ -1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 3
+ wxALIGN_CENTER_VERTICAL|wxALL
+ 0
+
+
+
+ 1
+ 1
+
+
+ 0
+ wxID_ANY
+
+ 0
+
+ m_textNameTextSize
+ protected
+
+
+
+
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 3
+ wxALIGN_CENTER_VERTICAL|wxALL
+ 0
+
+
+
+ 1
+ 1
+
+
+ 0
+ wxID_ANY
+ units
+
+ -1,-1
+ m_staticNameTextSizeUnits
+ protected
+
+
+
+
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+ -1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 3
+ wxALIGN_CENTER_VERTICAL|wxALL
+ 0
+
+
+
+ 1
+ 1
+
+
+ 0
+ wxID_ANY
+ Pin n&umber:
+
+
+ m_staticText4
+ protected
+
+
+
+
+ Pin number: 1 to 4 ASCII letters and/or digits
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+ -1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 3
+ wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND
+ 0
+
+
+
+ 1
+ 1
+
+
+ 0
+ wxID_ANY
+
+ 0
+
+ m_textNumber
+ protected
+
+
+
+
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 3
+ wxEXPAND
+ 1
+
+ 0
+ protected
+ 0
+
+
+
+ 3
+ wxALIGN_CENTER_VERTICAL|wxALL
+ 0
+
+
+
+ 1
+ 1
+
+
+ 0
+ wxID_ANY
+ Number te&xt size:
+
+
+ m_staticText9
+ protected
+
+
+
+
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+ -1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 3
+ wxALIGN_CENTER_VERTICAL|wxALL
+ 0
+
+
+
+ 1
+ 1
+
+
+ 0
+ wxID_ANY
+
+ 0
+
+ m_textNumberTextSize
+ protected
+
+
+
+
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 3
+ wxALIGN_CENTER_VERTICAL|wxALL
+ 0
+
+
+
+ 1
+ 1
+
+
+ 0
+ wxID_ANY
+ units
+
+
+ m_staticNumberTextSizeUnits
+ protected
+
+
+
+
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+ -1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 3
+ wxALIGN_CENTER_VERTICAL|wxALL
+ 0
+
+
+
+ 1
+ 1
+
+
+ 0
+ wxID_ANY
+ &Orientation:
+
+
+ m_staticText5
+ protected
+
+
+
+
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+ -1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 5
+ wxALL
+ 0
+
+
+
+
+ 1
+ 1
+
+
+ 0
+ wxID_ANY
+
+
+ m_choiceOrientation
+ protected
+
+
+
+ wxBitmapComboBox; wx/bmpcbox.h
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 3
+ wxEXPAND
+ 1
+
+ 0
+ protected
+ 15
+
+
+
+ 3
+ wxALIGN_CENTER_VERTICAL|wxALL
+ 0
+
+
+
+ 1
+ 1
+
+
+ 0
+ wxID_ANY
+ &Length:
+
+
+ m_staticText11
+ protected
+
+
+
+
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+ -1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 3
+ wxALIGN_CENTER_VERTICAL|wxALL
+ 0
+
+
+
+ 1
+ 1
+
+
+ 0
+ wxID_ANY
+
+ 0
+
+ m_textLength
+ protected
+
+
+
+
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 3
+ wxALIGN_CENTER_VERTICAL|wxALL
+ 0
+
+
+
+ 1
+ 1
+
+
+ 0
+ wxID_ANY
+ units
+
+
+ m_staticLengthUnits
+ protected
+
+
+
+
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+ -1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 3
+ wxALIGN_CENTER_VERTICAL|wxALL
+ 0
+
+
+
+ 1
+ 1
+
+
+ 0
+ wxID_ANY
+ &Electrical type:
+
+
+ m_staticText6
+ protected
+
+
+
+
+ Used by the ERC.
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+ -1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 5
+ wxALL
+ 0
+
+
+
+
+ 1
+ 1
+
+
+ 0
+ wxID_ANY
+
+
+ m_choiceElectricalType
+ protected
+
+
+
+ wxBitmapComboBox; wx/bmpcbox.h
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 3
+ wxEXPAND
+ 1
+
+ 0
+ protected
+ 0
+
+
+
+ 5
+ wxEXPAND
+ 1
+
+ 0
+ protected
+ 0
+
+
+
+ 5
+ wxEXPAND
+ 1
+
+ 0
+ protected
+ 0
+
+
+
+ 3
+ wxEXPAND
+ 0
+
+ 0
+ protected
+ 0
+
+
+
+ 3
+ wxALIGN_CENTER_VERTICAL|wxALL
+ 0
+
+
+
+ 1
+ 1
+
+
+ 0
+ wxID_ANY
+ Graphic &Style:
+
+
+ m_staticText7
+ protected
+
+
+
+
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+ -1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 5
+ wxALL
+ 0
+
+
+
+
+ 1
+ 1
+
+
+ 0
+ wxID_ANY
+
+
+ m_choiceStyle
+ protected
+
+
+
+ wxBitmapComboBox; wx/bmpcbox.h
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 3
+ wxEXPAND
+ 1
+
+ 0
+ protected
+ 0
+
+
+
+ 5
+ wxEXPAND
+ 1
+
+ 0
+ protected
+ 0
+
+
+
+ 5
+ wxEXPAND
+ 1
+
+ 0
+ protected
+ 0
+
+
+
+
+
+ 12
+ wxALL|wxEXPAND
+ 0
+
+
+ boarderSizer
+ wxVERTICAL
+ none
+
+ 3
+ wxALIGN_CENTER_VERTICAL|wxALL
+ 0
+
+
+ 0
+
+ 1
+ 1
+
+
+ 0
+ wxID_ANY
+ Add to all &parts in package
+
+
+ m_checkApplyToAllParts
+ protected
+
+
+
+
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 3
+ wxALIGN_CENTER_VERTICAL|wxALL
+ 0
+
+
+ 0
+
+ 1
+ 1
+
+
+ 0
+ wxID_ANY
+ Add to all alternate &body styles (DeMorgan)
+
+
+ m_checkApplyToAllConversions
+ protected
+
+
+
+
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+ OnCBpartSelection
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 3
+ wxALIGN_CENTER_VERTICAL|wxALL
+ 0
+
+
+ 1
+
+ 1
+ 1
+
+
+ 0
+ wxID_ANY
+ &Visible
+
+
+ m_checkShow
+ protected
+
+
+
+
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 10
+ wxALL|wxEXPAND
+ 0
+
+ 5
+ protected
+ 0
+
+
+
+ 0
+ wxALL|wxEXPAND
+ 0
+
+ 0
+ 1
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0
+
+ m_sdbSizer1
+ protected
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/eeschema/dialog_lib_edit_pin_base.h b/eeschema/dialogs/dialog_lib_edit_pin_base.h
similarity index 83%
rename from eeschema/dialog_lib_edit_pin_base.h
rename to eeschema/dialogs/dialog_lib_edit_pin_base.h
index 7f055f5521..6e138a7092 100644
--- a/eeschema/dialog_lib_edit_pin_base.h
+++ b/eeschema/dialogs/dialog_lib_edit_pin_base.h
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// 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,7 +32,12 @@ 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;
@@ -71,8 +76,13 @@ class DIALOG_LIB_EDIT_PIN_BASE : public wxDialog
wxStdDialogButtonSizer* m_sdbSizer1;
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();
diff --git a/eeschema/lib_draw_item.h b/eeschema/lib_draw_item.h
index 2a11ccb28d..23d4441a23 100644
--- a/eeschema/lib_draw_item.h
+++ b/eeschema/lib_draw_item.h
@@ -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 );
/**
diff --git a/eeschema/lib_field.cpp b/eeschema/lib_field.cpp
index 113f5370ab..88f81586d3 100644
--- a/eeschema/lib_field.cpp
+++ b/eeschema/lib_field.cpp
@@ -298,7 +298,10 @@ void LIB_FIELD::drawGraphic( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint&
int color;
int linewidth = GetPenSize();
- linewidth = Clamp_Text_PenSize( linewidth, m_Size, m_Bold );
+ 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 );
+}
+
diff --git a/eeschema/lib_field.h b/eeschema/lib_field.h
index c824d6e7a3..f7bd08be50 100644
--- a/eeschema/lib_field.h
+++ b/eeschema/lib_field.h
@@ -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.
*
diff --git a/eeschema/sch_sheet_pin.cpp b/eeschema/sch_sheet_pin.cpp
index 529e06462c..302279adee 100644
--- a/eeschema/sch_sheet_pin.cpp
+++ b/eeschema/sch_sheet_pin.cpp
@@ -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;
}
diff --git a/include/base_struct.h b/include/base_struct.h
index 5767f005d4..c7f6b0deb0 100644
--- a/include/base_struct.h
+++ b/include/base_struct.h
@@ -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 */
diff --git a/polygon/PolyLine.cpp b/polygon/PolyLine.cpp
index a6d49f1b4b..8dbde4023b 100644
--- a/polygon/PolyLine.cpp
+++ b/polygon/PolyLine.cpp
@@ -155,7 +155,7 @@ int CPolyLine::NormalizeWithKbool( std::vector * 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,169 +1196,167 @@ 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
+ };
+ int xx[MAXPTS], yy[MAXPTS];
+
+ // define range for hatch lines
+ int min_x = corner[0].x;
+ int max_x = corner[0].x;
+ int min_y = corner[0].y;
+ int max_y = corner[0].y;
+ for( unsigned ic = 1; ic < corner.size(); ic++ )
{
- enum {
- MAXPTS = 100
- };
- int xx[MAXPTS], yy[MAXPTS];
+ if( corner[ic].x < min_x )
+ min_x = corner[ic].x;
+ if( corner[ic].x > max_x )
+ max_x = corner[ic].x;
+ if( corner[ic].y < min_y )
+ min_y = corner[ic].y;
+ if( corner[ic].y > max_y )
+ max_y = corner[ic].y;
+ }
- // define range for hatch lines
- int min_x = corner[0].x;
- int max_x = corner[0].x;
- int min_y = corner[0].y;
- int max_y = corner[0].y;
- for( unsigned ic = 1; ic < corner.size(); ic++ )
+ int slope_flag = (layer & 1) ? 1 : -1; // 1 or -1
+ double slope = 0.707106 * slope_flag;
+ int spacing;
+ if( m_HatchStyle == DIAGONAL_EDGE )
+ spacing = 10 * PCBU_PER_MIL;
+ else
+ spacing = 50 * PCBU_PER_MIL;
+ int max_a, min_a;
+ if( slope_flag == 1 )
+ {
+ max_a = (int) (max_y - slope * min_x);
+ min_a = (int) (min_y - slope * max_x);
+ }
+ else
+ {
+ max_a = (int) (max_y - slope * max_x);
+ min_a = (int) (min_y - slope * min_x);
+ }
+ min_a = (min_a / spacing) * spacing;
+
+ // calculate an offset depending on layer number, for a better display of hatches on a multilayer board
+ int offset = (layer * 7) / 8;
+ min_a += offset;
+
+ // now calculate and draw hatch lines
+ int nc = corner.size();
+
+ // loop through hatch lines
+ for( int a = min_a; a max_x )
- max_x = corner[ic].x;
- if( corner[ic].y < min_y )
- min_y = corner[ic].y;
- if( corner[ic].y > max_y )
- max_y = corner[ic].y;
- }
-
- int slope_flag = (layer & 1) ? 1 : -1; // 1 or -1
- double slope = 0.707106 * slope_flag;
- int spacing;
- if( m_HatchStyle == DIAGONAL_EDGE )
- spacing = 10 * PCBU_PER_MIL;
- else
- spacing = 50 * PCBU_PER_MIL;
- int max_a, min_a;
- if( slope_flag == 1 )
- {
- max_a = (int) (max_y - slope * min_x);
- min_a = (int) (min_y - slope * max_x);
- }
- else
- {
- max_a = (int) (max_y - slope * max_x);
- min_a = (int) (min_y - slope * min_x);
- }
- min_a = (min_a / spacing) * spacing;
-
- // calculate an offset depending on layer number, for a better display of hatches on a multilayer board
- int offset = (layer * 7) / 8;
- min_a += offset;
-
- // now calculate and draw hatch lines
- int nc = corner.size();
-
- // loop through hatch lines
- for( int a = min_a; a2 )
- {
- for( int istart = 0; istart<(npts - 1); istart++ )
- {
- int max_x = INT_MIN;
- int imax = INT_MIN;
- for( int i = istart; i max_x )
- {
- max_x = xx[i];
- imax = i;
- }
- }
-
- int temp = xx[istart];
- xx[istart] = xx[imax];
- xx[imax] = temp;
- temp = yy[istart];
- yy[istart] = yy[imax];
- yy[imax] = temp;
- }
- }
-
- // draw lines
- for( int ip = 0; ip 0 )
- dx = 20 * NM_PER_MIL;
- else
- dx = -20 * NM_PER_MIL;
- double x1 = xx[ip] + dx;
- double x2 = xx[ip + 1] - dx;
- double y1 = yy[ip] + dx * slope;
- double y2 = yy[ip + 1] - dx * slope;
- m_HatchLines.push_back( CSegment( xx[ip], yy[ip], to_int( x1 ), to_int( y1 ) ) );
- m_HatchLines.push_back( CSegment( xx[ip + 1], yy[ip + 1], to_int( x2 ),
- to_int( y2 ) ) );
+ ok = FindLineSegmentIntersection( a, slope,
+ corner[ic].x, corner[ic].y,
+ corner[ic + 1].x, corner[ic + 1].y,
+ side_style[ic],
+ &x, &y, &x2, &y2 );
}
+ if( ok )
+ {
+ xx[npts] = (int) x;
+ yy[npts] = (int) y;
+ npts++;
+ wxASSERT( npts2 )
+ {
+ for( int istart = 0; istart<(npts - 1); istart++ )
+ {
+ int max_x = INT_MIN;
+ int imax = INT_MIN;
+ for( int i = istart; i max_x )
+ {
+ max_x = xx[i];
+ imax = i;
+ }
+ }
+
+ int temp = xx[istart];
+ xx[istart] = xx[imax];
+ xx[imax] = temp;
+ temp = yy[istart];
+ yy[istart] = yy[imax];
+ yy[imax] = temp;
}
}
- // end for
+ // draw lines
+ for( int ip = 0; ip 0 )
+ dx = 20 * NM_PER_MIL;
+ else
+ dx = -20 * NM_PER_MIL;
+ double x1 = xx[ip] + dx;
+ double x2 = xx[ip + 1] - dx;
+ double y1 = yy[ip] + dx * slope;
+ double y2 = yy[ip + 1] - dx * slope;
+ m_HatchLines.push_back( CSegment( xx[ip], yy[ip], to_int( x1 ), to_int( y1 ) ) );
+ m_HatchLines.push_back( CSegment( xx[ip + 1], yy[ip + 1], to_int( x2 ),
+ to_int( y2 ) ) );
+ }
+ }
}
}