Loading change_log.txt +6 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,12 @@ Started 2007-June-11 Please add newer entries at the top, list the date and your name with email address. 2008-Nov-25 UPDATE Dick Hollenbeck <dick@softplc.com> ================================================================================ +eeschema edit component in schematic editor. works except for field add, remove, move up. 2008-Nov-24 UPDATE Dick Hollenbeck <dick@softplc.com> ================================================================================ +eeschema Loading common/wxwineda.cpp +288 −208 Original line number Diff line number Diff line Loading @@ -10,23 +10,31 @@ #include "common.h" /**********************************************************************************/ /* Classe WinEDA_EnterText pour entrer une ligne texte au clavier dans les frames */ /**********************************************************************************/ WinEDA_EnterText::WinEDA_EnterText(wxWindow *parent, const wxString &Title, const wxString & TextToEdit, wxBoxSizer * BoxSizer, const wxSize & Size ) WinEDA_EnterText::WinEDA_EnterText( wxWindow* parent, const wxString& Title, const wxString& TextToEdit, wxBoxSizer* BoxSizer, const wxSize& Size ) { m_Modify = FALSE; if ( TextToEdit ) m_NewText = TextToEdit; if( TextToEdit ) m_NewText = TextToEdit; m_Title = new wxStaticText( parent, -1, Title ); m_Title->SetForegroundColour( wxColour( 200, 0, 0 ) ); BoxSizer->Add( m_Title, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE, 5 ); m_FrameText = new wxTextCtrl( parent, -1, TextToEdit, wxDefaultPosition, Size ); m_FrameText->SetInsertionPoint( 1 ); BoxSizer->Add(m_FrameText, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5); BoxSizer->Add( m_FrameText, 0, wxGROW | wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); } Loading @@ -39,6 +47,7 @@ wxString WinEDA_EnterText::GetValue() return m_NewText; } void WinEDA_EnterText::GetValue( char* buffer, int lenmax ) { m_Modify = m_FrameText->IsModified(); Loading @@ -46,17 +55,21 @@ void WinEDA_EnterText::GetValue(char * buffer, int lenmax) { m_NewText = m_FrameText->GetValue(); int ii, ll = m_NewText.Len(); for ( ii = 0; ii < ll && ii < (lenmax-1); ii++ ); for( ii = 0; ii < ll && ii < (lenmax - 1); ii++ ) ; buffer[ii] = m_NewText.GetChar( ii ); buffer[lenmax - 1] = 0; } } void WinEDA_EnterText::SetValue( const wxString& new_text ) { m_FrameText->SetValue( new_text ); } void WinEDA_EnterText::Enable( bool enbl ) { m_Title->Enable( enbl ); Loading @@ -76,53 +89,74 @@ WinEDA_GraphicTextCtrl::WinEDA_GraphicTextCtrl(wxWindow *parent, m_Units = units; m_Internal_Unit = internal_unit; m_Title = NULL; // Limitation de la taille du texte a de valeurs raisonnables if ( textsize < 10 ) textsize = 10; if ( textsize > 3000 ) textsize = 3000; m_Title = new wxStaticText( parent, -1, Title ); BoxSizer->Add( m_Title, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE, 5 ); m_FrameText = new wxTextCtrl( parent, -1, TextToEdit ); BoxSizer->Add( m_FrameText, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); if( !Title.IsEmpty() ) { wxString msg; msg = _("Size") + ReturnUnitSymbol(m_Units); wxString msg = _( "Size" ) + ReturnUnitSymbol( m_Units ); wxStaticText* text = new wxStaticText( parent, -1, msg ); BoxSizer->Add( text, 0, wxGROW | wxLEFT | wxRIGHT | wxADJUST_MINSIZE, 5 ); } wxString value; value.Printf(( m_Internal_Unit > 1000 ) ? wxT("%.4f") : wxT("%.3f"), To_User_Unit(m_Units, textsize, m_Internal_Unit) ); wxString value = FormatSize( m_Internal_Unit, m_Units, textsize ); m_FrameSize = new wxTextCtrl( parent, -1, value, wxDefaultPosition, wxSize( 70, -1 ) ); BoxSizer->Add( m_FrameSize, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); } WinEDA_GraphicTextCtrl::~WinEDA_GraphicTextCtrl() { /* no, these are deleted by the BoxSizer delete m_FrameText; delete m_Title; */ } wxString WinEDA_GraphicTextCtrl::FormatSize( int internalUnit, int units, int textSize ) { wxString value; // Limitation de la taille du texte a de valeurs raisonnables if( textSize < 10 ) textSize = 10; if( textSize > 3000 ) textSize = 3000; value.Printf( ( internalUnit > 1000 ) ? wxT( "%.4f" ) : wxT( "%.3f" ), To_User_Unit( units, textSize, internalUnit ) ); return value; } void WinEDA_GraphicTextCtrl::SetTitle( const wxString& title ) { m_Title->SetLabel( title ); } void WinEDA_GraphicTextCtrl::SetValue( const wxString& value ) { m_FrameText->SetValue( value ); } void WinEDA_GraphicTextCtrl::SetValue(int value) void WinEDA_GraphicTextCtrl::SetValue( int textSize ) { wxString msg; msg.Printf(( m_Internal_Unit > 1000 ) ? wxT("%.4f") : wxT("%.3f"), To_User_Unit(m_Units, value, m_Internal_Unit) ); m_FrameSize->SetValue(msg); wxString value = FormatSize( m_Internal_Unit, m_Units, textSize ); m_FrameSize->SetValue( value ); } Loading @@ -132,56 +166,79 @@ wxString text = m_FrameText->GetValue(); return text; } int WinEDA_GraphicTextCtrl::GetTextSize() int WinEDA_GraphicTextCtrl::ParseSize( const wxString& sizeText, int internalUnit, int units ) { int textsize; double dtmp; m_FrameSize->GetValue().ToDouble(&dtmp); textsize = (int)From_User_Unit( m_Units, dtmp, m_Internal_Unit); // Limitation de la taille du texte a de valeurs raisonnables if ( textsize < 10 ) textsize = 10; if ( textsize > 3000 ) textsize = 3000; sizeText.ToDouble( &dtmp ); textsize = (int) From_User_Unit( units, dtmp, internalUnit ); // Limit to reasonable size if( textsize < 10 ) textsize = 10; if( textsize > 3000 ) textsize = 3000; return textsize; } int WinEDA_GraphicTextCtrl::GetTextSize() { return ParseSize( m_FrameSize->GetValue(), m_Internal_Unit, m_Units ); } void WinEDA_GraphicTextCtrl::Enable( bool state ) { m_FrameText->Enable( state ); } /*****************************************************************/ /* Classe pour afficher et editer une coordonne en INCHES ou MM */ /*****************************************************************/ WinEDA_PositionCtrl::WinEDA_PositionCtrl(wxWindow *parent, const wxString & title, const wxPoint & pos_to_edit, int units, wxBoxSizer * BoxSizer, WinEDA_PositionCtrl::WinEDA_PositionCtrl( wxWindow* parent, const wxString& title, const wxPoint& pos_to_edit, int units, wxBoxSizer* BoxSizer, int internal_unit ) { wxString text; m_Units = units; m_Internal_Unit = internal_unit; if ( title.IsEmpty() ) text = _("Pos "); else text = title; if( title.IsEmpty() ) text = _( "Pos " ); else text = title; text += _( "X" ) + ReturnUnitSymbol( m_Units ); m_TextX = new wxStaticText( parent, -1, text ); BoxSizer->Add( m_TextX, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE, 5 ); m_FramePosX = new wxTextCtrl( parent, -1, wxEmptyString, wxDefaultPosition ); BoxSizer->Add( m_FramePosX, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); if ( title.IsEmpty() ) text = _("Pos "); else text = title; if( title.IsEmpty() ) text = _( "Pos " ); else text = title; text += _( "Y" ) + ReturnUnitSymbol( m_Units ); m_TextY = new wxStaticText( parent, -1, text ); BoxSizer->Add( m_TextY, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE, 5 ); m_FramePosY = new wxTextCtrl( parent, -1, wxEmptyString ); BoxSizer->Add( m_FramePosY, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); SetValue( pos_to_edit.x, pos_to_edit.y ); Loading @@ -196,9 +253,11 @@ WinEDA_PositionCtrl::~WinEDA_PositionCtrl() delete m_FramePosY; } /******************************************/ wxPoint WinEDA_PositionCtrl::GetValue() /******************************************/ /* Retourne (en unites internes) les coordonnes entrees (en unites utilisateur) */ { Loading @@ -222,6 +281,7 @@ void WinEDA_PositionCtrl::Enable(bool x_win_on, bool y_win_on) m_FramePosY->Enable( y_win_on ); } /***********************************************************/ void WinEDA_PositionCtrl::SetValue( int x_value, int y_value ) /***********************************************************/ Loading @@ -240,6 +300,7 @@ wxString msg; m_FramePosY->SetValue( msg ); } /*******************/ /* WinEDA_SizeCtrl */ /*******************/ Loading @@ -253,12 +314,14 @@ WinEDA_SizeCtrl::WinEDA_SizeCtrl(wxWindow *parent, const wxString & title, { } /*************************************/ wxSize WinEDA_SizeCtrl::GetValue() /*************************************/ { wxPoint pos = WinEDA_PositionCtrl::GetValue(); wxSize size; size.x = pos.x; size.y = pos.y; return size; Loading @@ -270,9 +333,9 @@ wxSize size; /***********************************************************************/ /* Unites: si units = 0 : unite = inch si units = 1 : unite = mm si units >1 : affichage direct * si units = 0 : unite = inch * si units = 1 : unite = mm * si units >1 : affichage direct */ WinEDA_ValueCtrl::WinEDA_ValueCtrl( wxWindow* parent, const wxString& title, int value, int units, wxBoxSizer* BoxSizer, Loading @@ -286,19 +349,26 @@ wxString label = title; label += ReturnUnitSymbol( m_Units ); m_Text = new wxStaticText( parent, -1, label ); BoxSizer->Add( m_Text, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE, 5 ); wxString stringvalue = ReturnStringFromValue( m_Units, m_Value, m_Internal_Unit ); m_ValueCtrl = new wxTextCtrl( parent, -1, stringvalue ); BoxSizer->Add(m_ValueCtrl, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5); BoxSizer->Add( m_ValueCtrl, 0, wxGROW | wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); } WinEDA_ValueCtrl::~WinEDA_ValueCtrl() { delete m_ValueCtrl; delete m_Text; } /***********************************/ int WinEDA_ValueCtrl::GetValue() /***********************************/ Loading @@ -310,17 +380,20 @@ wxString txtvalue = m_ValueCtrl->GetValue(); return coord; } /********************************************/ void WinEDA_ValueCtrl::SetValue( int new_value ) /********************************************/ { wxString buffer; m_Value = new_value; buffer = ReturnStringFromValue( m_Units, m_Value, m_Internal_Unit ); m_ValueCtrl->SetValue( buffer ); } /* Active ou desactive la frame: */ void WinEDA_ValueCtrl::Enable( bool enbl ) { Loading @@ -328,6 +401,7 @@ void WinEDA_ValueCtrl::Enable(bool enbl) m_Text->Enable( enbl ); } /***************************************************************/ /* Classe pour afficher et editer une valeur en double flottant*/ /***************************************************************/ Loading @@ -340,19 +414,23 @@ wxString label = title; m_Value = value; m_Text = new wxStaticText( parent, -1, label ); BoxSizer->Add( m_Text, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 ); buffer.Printf( wxT( "%lf" ), m_Value ); m_ValueCtrl = new wxTextCtrl( parent, -1, buffer ); BoxSizer->Add( m_ValueCtrl, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); } WinEDA_DFloatValueCtrl::~WinEDA_DFloatValueCtrl() { delete m_ValueCtrl; delete m_Text; } double WinEDA_DFloatValueCtrl::GetValue() { double coord = 0; Loading @@ -361,19 +439,21 @@ double coord = 0; return coord; } void WinEDA_DFloatValueCtrl::SetValue( double new_value ) { wxString buffer; m_Value = new_value; buffer.Printf( wxT( "%lf" ), m_Value ); m_ValueCtrl->SetValue( buffer ); } /* Active ou desactive la frame: */ void WinEDA_DFloatValueCtrl::Enable( bool enbl ) { m_ValueCtrl->Enable( enbl ); m_Text->Enable( enbl ); } eeschema/component_class.cpp +8 −4 Original line number Diff line number Diff line Loading @@ -683,7 +683,8 @@ int SCH_COMPONENT::GetRotationMiroir() { if( memcmp( TempMat, m_Transform, sizeof(MatNormal) ) == 0 ) { found = TRUE; break; found = TRUE; break; } SetRotationMiroir( CMP_ROTATE_COUNTERCLOCKWISE ); } Loading @@ -697,7 +698,8 @@ int SCH_COMPONENT::GetRotationMiroir() { if( memcmp( TempMat, m_Transform, sizeof(MatNormal) ) == 0 ) { found = TRUE; break; found = TRUE; break; } SetRotationMiroir( CMP_ROTATE_COUNTERCLOCKWISE ); } Loading @@ -712,7 +714,8 @@ int SCH_COMPONENT::GetRotationMiroir() { if( memcmp( TempMat, m_Transform, sizeof(MatNormal) ) == 0 ) { found = TRUE; break; found = TRUE; break; } SetRotationMiroir( CMP_ROTATE_COUNTERCLOCKWISE ); } Loading @@ -726,7 +729,8 @@ int SCH_COMPONENT::GetRotationMiroir() } else { wxBell(); return CMP_NORMAL; wxBell(); return CMP_NORMAL; } } Loading eeschema/component_class.h +6 −0 Original line number Diff line number Diff line Loading @@ -193,6 +193,12 @@ public: */ void AddField( const SCH_CMP_FIELD& aField ); void SetFields( const SCH_CMP_FIELDS& aFields ) { m_Fields = aFields; // vector copying, length is changed possibly } /** * Function GetFieldCount * returns the number of fields in this component. Loading Loading
change_log.txt +6 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,12 @@ Started 2007-June-11 Please add newer entries at the top, list the date and your name with email address. 2008-Nov-25 UPDATE Dick Hollenbeck <dick@softplc.com> ================================================================================ +eeschema edit component in schematic editor. works except for field add, remove, move up. 2008-Nov-24 UPDATE Dick Hollenbeck <dick@softplc.com> ================================================================================ +eeschema Loading
common/wxwineda.cpp +288 −208 Original line number Diff line number Diff line Loading @@ -10,23 +10,31 @@ #include "common.h" /**********************************************************************************/ /* Classe WinEDA_EnterText pour entrer une ligne texte au clavier dans les frames */ /**********************************************************************************/ WinEDA_EnterText::WinEDA_EnterText(wxWindow *parent, const wxString &Title, const wxString & TextToEdit, wxBoxSizer * BoxSizer, const wxSize & Size ) WinEDA_EnterText::WinEDA_EnterText( wxWindow* parent, const wxString& Title, const wxString& TextToEdit, wxBoxSizer* BoxSizer, const wxSize& Size ) { m_Modify = FALSE; if ( TextToEdit ) m_NewText = TextToEdit; if( TextToEdit ) m_NewText = TextToEdit; m_Title = new wxStaticText( parent, -1, Title ); m_Title->SetForegroundColour( wxColour( 200, 0, 0 ) ); BoxSizer->Add( m_Title, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE, 5 ); m_FrameText = new wxTextCtrl( parent, -1, TextToEdit, wxDefaultPosition, Size ); m_FrameText->SetInsertionPoint( 1 ); BoxSizer->Add(m_FrameText, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5); BoxSizer->Add( m_FrameText, 0, wxGROW | wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); } Loading @@ -39,6 +47,7 @@ wxString WinEDA_EnterText::GetValue() return m_NewText; } void WinEDA_EnterText::GetValue( char* buffer, int lenmax ) { m_Modify = m_FrameText->IsModified(); Loading @@ -46,17 +55,21 @@ void WinEDA_EnterText::GetValue(char * buffer, int lenmax) { m_NewText = m_FrameText->GetValue(); int ii, ll = m_NewText.Len(); for ( ii = 0; ii < ll && ii < (lenmax-1); ii++ ); for( ii = 0; ii < ll && ii < (lenmax - 1); ii++ ) ; buffer[ii] = m_NewText.GetChar( ii ); buffer[lenmax - 1] = 0; } } void WinEDA_EnterText::SetValue( const wxString& new_text ) { m_FrameText->SetValue( new_text ); } void WinEDA_EnterText::Enable( bool enbl ) { m_Title->Enable( enbl ); Loading @@ -76,53 +89,74 @@ WinEDA_GraphicTextCtrl::WinEDA_GraphicTextCtrl(wxWindow *parent, m_Units = units; m_Internal_Unit = internal_unit; m_Title = NULL; // Limitation de la taille du texte a de valeurs raisonnables if ( textsize < 10 ) textsize = 10; if ( textsize > 3000 ) textsize = 3000; m_Title = new wxStaticText( parent, -1, Title ); BoxSizer->Add( m_Title, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE, 5 ); m_FrameText = new wxTextCtrl( parent, -1, TextToEdit ); BoxSizer->Add( m_FrameText, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); if( !Title.IsEmpty() ) { wxString msg; msg = _("Size") + ReturnUnitSymbol(m_Units); wxString msg = _( "Size" ) + ReturnUnitSymbol( m_Units ); wxStaticText* text = new wxStaticText( parent, -1, msg ); BoxSizer->Add( text, 0, wxGROW | wxLEFT | wxRIGHT | wxADJUST_MINSIZE, 5 ); } wxString value; value.Printf(( m_Internal_Unit > 1000 ) ? wxT("%.4f") : wxT("%.3f"), To_User_Unit(m_Units, textsize, m_Internal_Unit) ); wxString value = FormatSize( m_Internal_Unit, m_Units, textsize ); m_FrameSize = new wxTextCtrl( parent, -1, value, wxDefaultPosition, wxSize( 70, -1 ) ); BoxSizer->Add( m_FrameSize, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); } WinEDA_GraphicTextCtrl::~WinEDA_GraphicTextCtrl() { /* no, these are deleted by the BoxSizer delete m_FrameText; delete m_Title; */ } wxString WinEDA_GraphicTextCtrl::FormatSize( int internalUnit, int units, int textSize ) { wxString value; // Limitation de la taille du texte a de valeurs raisonnables if( textSize < 10 ) textSize = 10; if( textSize > 3000 ) textSize = 3000; value.Printf( ( internalUnit > 1000 ) ? wxT( "%.4f" ) : wxT( "%.3f" ), To_User_Unit( units, textSize, internalUnit ) ); return value; } void WinEDA_GraphicTextCtrl::SetTitle( const wxString& title ) { m_Title->SetLabel( title ); } void WinEDA_GraphicTextCtrl::SetValue( const wxString& value ) { m_FrameText->SetValue( value ); } void WinEDA_GraphicTextCtrl::SetValue(int value) void WinEDA_GraphicTextCtrl::SetValue( int textSize ) { wxString msg; msg.Printf(( m_Internal_Unit > 1000 ) ? wxT("%.4f") : wxT("%.3f"), To_User_Unit(m_Units, value, m_Internal_Unit) ); m_FrameSize->SetValue(msg); wxString value = FormatSize( m_Internal_Unit, m_Units, textSize ); m_FrameSize->SetValue( value ); } Loading @@ -132,56 +166,79 @@ wxString text = m_FrameText->GetValue(); return text; } int WinEDA_GraphicTextCtrl::GetTextSize() int WinEDA_GraphicTextCtrl::ParseSize( const wxString& sizeText, int internalUnit, int units ) { int textsize; double dtmp; m_FrameSize->GetValue().ToDouble(&dtmp); textsize = (int)From_User_Unit( m_Units, dtmp, m_Internal_Unit); // Limitation de la taille du texte a de valeurs raisonnables if ( textsize < 10 ) textsize = 10; if ( textsize > 3000 ) textsize = 3000; sizeText.ToDouble( &dtmp ); textsize = (int) From_User_Unit( units, dtmp, internalUnit ); // Limit to reasonable size if( textsize < 10 ) textsize = 10; if( textsize > 3000 ) textsize = 3000; return textsize; } int WinEDA_GraphicTextCtrl::GetTextSize() { return ParseSize( m_FrameSize->GetValue(), m_Internal_Unit, m_Units ); } void WinEDA_GraphicTextCtrl::Enable( bool state ) { m_FrameText->Enable( state ); } /*****************************************************************/ /* Classe pour afficher et editer une coordonne en INCHES ou MM */ /*****************************************************************/ WinEDA_PositionCtrl::WinEDA_PositionCtrl(wxWindow *parent, const wxString & title, const wxPoint & pos_to_edit, int units, wxBoxSizer * BoxSizer, WinEDA_PositionCtrl::WinEDA_PositionCtrl( wxWindow* parent, const wxString& title, const wxPoint& pos_to_edit, int units, wxBoxSizer* BoxSizer, int internal_unit ) { wxString text; m_Units = units; m_Internal_Unit = internal_unit; if ( title.IsEmpty() ) text = _("Pos "); else text = title; if( title.IsEmpty() ) text = _( "Pos " ); else text = title; text += _( "X" ) + ReturnUnitSymbol( m_Units ); m_TextX = new wxStaticText( parent, -1, text ); BoxSizer->Add( m_TextX, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE, 5 ); m_FramePosX = new wxTextCtrl( parent, -1, wxEmptyString, wxDefaultPosition ); BoxSizer->Add( m_FramePosX, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); if ( title.IsEmpty() ) text = _("Pos "); else text = title; if( title.IsEmpty() ) text = _( "Pos " ); else text = title; text += _( "Y" ) + ReturnUnitSymbol( m_Units ); m_TextY = new wxStaticText( parent, -1, text ); BoxSizer->Add( m_TextY, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE, 5 ); m_FramePosY = new wxTextCtrl( parent, -1, wxEmptyString ); BoxSizer->Add( m_FramePosY, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); SetValue( pos_to_edit.x, pos_to_edit.y ); Loading @@ -196,9 +253,11 @@ WinEDA_PositionCtrl::~WinEDA_PositionCtrl() delete m_FramePosY; } /******************************************/ wxPoint WinEDA_PositionCtrl::GetValue() /******************************************/ /* Retourne (en unites internes) les coordonnes entrees (en unites utilisateur) */ { Loading @@ -222,6 +281,7 @@ void WinEDA_PositionCtrl::Enable(bool x_win_on, bool y_win_on) m_FramePosY->Enable( y_win_on ); } /***********************************************************/ void WinEDA_PositionCtrl::SetValue( int x_value, int y_value ) /***********************************************************/ Loading @@ -240,6 +300,7 @@ wxString msg; m_FramePosY->SetValue( msg ); } /*******************/ /* WinEDA_SizeCtrl */ /*******************/ Loading @@ -253,12 +314,14 @@ WinEDA_SizeCtrl::WinEDA_SizeCtrl(wxWindow *parent, const wxString & title, { } /*************************************/ wxSize WinEDA_SizeCtrl::GetValue() /*************************************/ { wxPoint pos = WinEDA_PositionCtrl::GetValue(); wxSize size; size.x = pos.x; size.y = pos.y; return size; Loading @@ -270,9 +333,9 @@ wxSize size; /***********************************************************************/ /* Unites: si units = 0 : unite = inch si units = 1 : unite = mm si units >1 : affichage direct * si units = 0 : unite = inch * si units = 1 : unite = mm * si units >1 : affichage direct */ WinEDA_ValueCtrl::WinEDA_ValueCtrl( wxWindow* parent, const wxString& title, int value, int units, wxBoxSizer* BoxSizer, Loading @@ -286,19 +349,26 @@ wxString label = title; label += ReturnUnitSymbol( m_Units ); m_Text = new wxStaticText( parent, -1, label ); BoxSizer->Add( m_Text, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE, 5 ); wxString stringvalue = ReturnStringFromValue( m_Units, m_Value, m_Internal_Unit ); m_ValueCtrl = new wxTextCtrl( parent, -1, stringvalue ); BoxSizer->Add(m_ValueCtrl, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5); BoxSizer->Add( m_ValueCtrl, 0, wxGROW | wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); } WinEDA_ValueCtrl::~WinEDA_ValueCtrl() { delete m_ValueCtrl; delete m_Text; } /***********************************/ int WinEDA_ValueCtrl::GetValue() /***********************************/ Loading @@ -310,17 +380,20 @@ wxString txtvalue = m_ValueCtrl->GetValue(); return coord; } /********************************************/ void WinEDA_ValueCtrl::SetValue( int new_value ) /********************************************/ { wxString buffer; m_Value = new_value; buffer = ReturnStringFromValue( m_Units, m_Value, m_Internal_Unit ); m_ValueCtrl->SetValue( buffer ); } /* Active ou desactive la frame: */ void WinEDA_ValueCtrl::Enable( bool enbl ) { Loading @@ -328,6 +401,7 @@ void WinEDA_ValueCtrl::Enable(bool enbl) m_Text->Enable( enbl ); } /***************************************************************/ /* Classe pour afficher et editer une valeur en double flottant*/ /***************************************************************/ Loading @@ -340,19 +414,23 @@ wxString label = title; m_Value = value; m_Text = new wxStaticText( parent, -1, label ); BoxSizer->Add( m_Text, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 ); buffer.Printf( wxT( "%lf" ), m_Value ); m_ValueCtrl = new wxTextCtrl( parent, -1, buffer ); BoxSizer->Add( m_ValueCtrl, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); } WinEDA_DFloatValueCtrl::~WinEDA_DFloatValueCtrl() { delete m_ValueCtrl; delete m_Text; } double WinEDA_DFloatValueCtrl::GetValue() { double coord = 0; Loading @@ -361,19 +439,21 @@ double coord = 0; return coord; } void WinEDA_DFloatValueCtrl::SetValue( double new_value ) { wxString buffer; m_Value = new_value; buffer.Printf( wxT( "%lf" ), m_Value ); m_ValueCtrl->SetValue( buffer ); } /* Active ou desactive la frame: */ void WinEDA_DFloatValueCtrl::Enable( bool enbl ) { m_ValueCtrl->Enable( enbl ); m_Text->Enable( enbl ); }
eeschema/component_class.cpp +8 −4 Original line number Diff line number Diff line Loading @@ -683,7 +683,8 @@ int SCH_COMPONENT::GetRotationMiroir() { if( memcmp( TempMat, m_Transform, sizeof(MatNormal) ) == 0 ) { found = TRUE; break; found = TRUE; break; } SetRotationMiroir( CMP_ROTATE_COUNTERCLOCKWISE ); } Loading @@ -697,7 +698,8 @@ int SCH_COMPONENT::GetRotationMiroir() { if( memcmp( TempMat, m_Transform, sizeof(MatNormal) ) == 0 ) { found = TRUE; break; found = TRUE; break; } SetRotationMiroir( CMP_ROTATE_COUNTERCLOCKWISE ); } Loading @@ -712,7 +714,8 @@ int SCH_COMPONENT::GetRotationMiroir() { if( memcmp( TempMat, m_Transform, sizeof(MatNormal) ) == 0 ) { found = TRUE; break; found = TRUE; break; } SetRotationMiroir( CMP_ROTATE_COUNTERCLOCKWISE ); } Loading @@ -726,7 +729,8 @@ int SCH_COMPONENT::GetRotationMiroir() } else { wxBell(); return CMP_NORMAL; wxBell(); return CMP_NORMAL; } } Loading
eeschema/component_class.h +6 −0 Original line number Diff line number Diff line Loading @@ -193,6 +193,12 @@ public: */ void AddField( const SCH_CMP_FIELD& aField ); void SetFields( const SCH_CMP_FIELDS& aFields ) { m_Fields = aFields; // vector copying, length is changed possibly } /** * Function GetFieldCount * returns the number of fields in this component. Loading