From ee918d7d29dc43f43f44f056a6999b9959793b76 Mon Sep 17 00:00:00 2001 From: stambaughw Date: Thu, 8 Oct 2009 13:19:28 +0000 Subject: [PATCH] Replace library editor new component dialog and minor updates. * Replace component library editor new component dialog using wxFormBuilder. * Rename component library draw items to conform to current coding standards. * Add GetWidth() method to component library draw objects. * Add regular expression key word search capability to component library object. --- eeschema/CMakeLists.txt | 3 +- eeschema/block.cpp | 4 +- eeschema/bus-wire-junction.cpp | 6 +- eeschema/class_BodyItem_Text.cpp | 46 +- eeschema/class_libentry.cpp | 72 +- eeschema/class_libentry.h | 18 +- eeschema/class_libentry_fields.cpp | 55 +- eeschema/class_libentry_fields.h | 26 +- eeschema/class_library.cpp | 18 + eeschema/class_library.h | 15 +- eeschema/class_pin.cpp | 140 +- eeschema/class_sch_cmp_field.cpp | 23 +- eeschema/class_sch_cmp_field.h | 7 +- eeschema/class_sch_component.cpp | 4 +- eeschema/classes_body_items.cpp | 308 ++-- eeschema/classes_body_items.h | 101 +- eeschema/controle.cpp | 6 +- eeschema/cross-probing.cpp | 6 +- eeschema/dangling_ends.cpp | 26 +- eeschema/dialog_cmp_graphic_properties.cpp | 67 +- eeschema/dialog_create_component.h | 136 -- eeschema/dialog_create_component.pjd | 1639 ----------------- eeschema/dialog_create_component.rc | 3 - .../dialog_edit_libentry_fields_in_lib.cpp | 22 +- eeschema/dialog_lib_new_component.cpp | 7 + eeschema/dialog_lib_new_component.fbp | 1234 +++++++++++++ eeschema/dialog_lib_new_component.h | 67 + eeschema/dialog_lib_new_component_base.cpp | 206 +++ eeschema/dialog_lib_new_component_base.h | 80 + eeschema/edit_graphic_bodyitem_text.cpp | 14 +- eeschema/find.cpp | 2 +- eeschema/getpart.cpp | 2 +- eeschema/hotkeys.cpp | 2 +- eeschema/libedit.cpp | 59 +- eeschema/libedit_onleftclick.cpp | 6 +- eeschema/libedit_onrightclick.cpp | 8 +- eeschema/libeditfrm.h | 14 +- eeschema/libfield.cpp | 10 +- eeschema/libframe.cpp | 10 +- eeschema/locate.cpp | 25 +- eeschema/netform.cpp | 8 +- eeschema/netlist.cpp | 2 +- eeschema/pinedit-dialog.cpp | 6 +- eeschema/pinedit.cpp | 134 +- eeschema/protos.h | 14 +- eeschema/symbdraw.cpp | 84 +- include/wxEeschemaStruct.h | 5 +- 47 files changed, 2297 insertions(+), 2453 deletions(-) delete mode 100644 eeschema/dialog_create_component.h delete mode 100644 eeschema/dialog_create_component.pjd delete mode 100644 eeschema/dialog_create_component.rc create mode 100644 eeschema/dialog_lib_new_component.cpp create mode 100644 eeschema/dialog_lib_new_component.fbp create mode 100644 eeschema/dialog_lib_new_component.h create mode 100644 eeschema/dialog_lib_new_component_base.cpp create mode 100644 eeschema/dialog_lib_new_component_base.h diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt index 3f17856000..2167473aad 100644 --- a/eeschema/CMakeLists.txt +++ b/eeschema/CMakeLists.txt @@ -43,7 +43,6 @@ set(EESCHEMA_SRCS dialog_build_BOM.cpp dialog_build_BOM_base.cpp # dialog_cmp_graphic_properties.cpp - dialog_create_component.cpp dialog_edit_component_in_lib.cpp dialog_edit_component_in_lib_base.cpp dialog_edit_component_in_schematic_fbp.cpp @@ -57,6 +56,8 @@ set(EESCHEMA_SRCS dialog_erc.cpp dialog_erc_base.cpp # dialog_find.cpp + dialog_lib_new_component.cpp + dialog_lib_new_component_base.cpp dialog_options.cpp dialog_print_using_printer_base.cpp dialog_print_using_printer.cpp diff --git a/eeschema/block.cpp b/eeschema/block.cpp index 349e4354ee..573edeaa41 100644 --- a/eeschema/block.cpp +++ b/eeschema/block.cpp @@ -861,10 +861,10 @@ static LIB_DRAW_ITEM* GetNextPinPosition( SCH_COMPONENT* aDrawLibItem, */ { static LIB_COMPONENT* Entry; - static LibDrawPin* NextPin; + static LIB_PIN* NextPin; static int Multi, convert, TransMat[2][2]; int orient; - LibDrawPin* Pin; + LIB_PIN* Pin; static wxPoint CmpPosition; if( aDrawLibItem ) diff --git a/eeschema/bus-wire-junction.cpp b/eeschema/bus-wire-junction.cpp index 7a570a020b..302f660928 100644 --- a/eeschema/bus-wire-junction.cpp +++ b/eeschema/bus-wire-junction.cpp @@ -794,9 +794,9 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer ) * - a BUS */ { - EDA_BaseStruct* item; - LibDrawPin* pin; - SCH_COMPONENT* LibItem = NULL; + EDA_BaseStruct* item; + LIB_PIN* pin; + SCH_COMPONENT* LibItem = NULL; Hierarchical_PIN_Sheet_Struct* pinsheet; wxPoint itempos; diff --git a/eeschema/class_BodyItem_Text.cpp b/eeschema/class_BodyItem_Text.cpp index 771dd1c5ea..17895bfef0 100644 --- a/eeschema/class_BodyItem_Text.cpp +++ b/eeschema/class_BodyItem_Text.cpp @@ -3,7 +3,7 @@ /***************************/ /** -* class LibDrawText : describes a graphic text used to draw component shapes +* class LIB_TEXT : describes a graphic text used to draw component shapes * This is only a graphic item */ @@ -21,7 +21,7 @@ #include "protos.h" -LibDrawText::LibDrawText(LIB_COMPONENT * aParent) : +LIB_TEXT::LIB_TEXT(LIB_COMPONENT * aParent) : LIB_DRAW_ITEM( COMPONENT_GRAPHIC_TEXT_DRAW_TYPE, aParent ), EDA_TextStruct() { @@ -30,7 +30,7 @@ LibDrawText::LibDrawText(LIB_COMPONENT * aParent) : } -bool LibDrawText::Save( FILE* ExportFile ) const +bool LIB_TEXT::Save( FILE* ExportFile ) const { wxString text = m_Text; @@ -65,7 +65,7 @@ bool LibDrawText::Save( FILE* ExportFile ) const } -bool LibDrawText::Load( char* line, wxString& errorMsg ) +bool LIB_TEXT::Load( char* line, wxString& errorMsg ) { int cnt, thickness; char hjustify = 'C', vjustify = 'C'; @@ -139,7 +139,7 @@ bool LibDrawText::Load( char* line, wxString& errorMsg ) * @param refPos A wxPoint to test * @return bool - true if a hit, else false */ -bool LibDrawText::HitTest( const wxPoint& refPos ) +bool LIB_TEXT::HitTest( const wxPoint& refPos ) { return HitTest( refPos, 0, DefaultTransformMatrix ); } @@ -151,8 +151,8 @@ bool LibDrawText::HitTest( const wxPoint& refPos ) * @param aThreshold = unused here (TextHitTest calculates its threshold ) * @param aTransMat = the transform matrix */ -bool LibDrawText::HitTest( wxPoint aPosRef, int aThreshold, - const int aTransMat[2][2] ) +bool LIB_TEXT::HitTest( wxPoint aPosRef, int aThreshold, + const int aTransMat[2][2] ) { wxPoint physicalpos = TransformCoordinate( aTransMat, m_Pos ); wxPoint tmp = m_Pos; @@ -171,9 +171,9 @@ bool LibDrawText::HitTest( wxPoint aPosRef, int aThreshold, } -LIB_DRAW_ITEM* LibDrawText::DoGenCopy() +LIB_DRAW_ITEM* LIB_TEXT::DoGenCopy() { - LibDrawText* newitem = new LibDrawText(NULL); + LIB_TEXT* newitem = new LIB_TEXT(NULL); newitem->m_Pos = m_Pos; newitem->m_Orient = m_Orient; @@ -192,11 +192,11 @@ LIB_DRAW_ITEM* LibDrawText::DoGenCopy() } -int LibDrawText::DoCompare( const LIB_DRAW_ITEM& other ) const +int LIB_TEXT::DoCompare( const LIB_DRAW_ITEM& other ) const { wxASSERT( other.Type() == COMPONENT_GRAPHIC_TEXT_DRAW_TYPE ); - const LibDrawText* tmp = ( LibDrawText* ) &other; + const LIB_TEXT* tmp = ( LIB_TEXT* ) &other; int result = m_Text.CmpNoCase( tmp->m_Text ); @@ -219,13 +219,13 @@ int LibDrawText::DoCompare( const LIB_DRAW_ITEM& other ) const } -void LibDrawText::DoOffset( const wxPoint& offset ) +void LIB_TEXT::DoOffset( const wxPoint& offset ) { m_Pos += offset; } -bool LibDrawText::DoTestInside( EDA_Rect& rect ) +bool LIB_TEXT::DoTestInside( EDA_Rect& rect ) { /* * FIXME: This should calculate the text size and justification and @@ -235,13 +235,13 @@ bool LibDrawText::DoTestInside( EDA_Rect& rect ) } -void LibDrawText::DoMove( const wxPoint& newPosition ) +void LIB_TEXT::DoMove( const wxPoint& newPosition ) { m_Pos = newPosition; } -void LibDrawText::DoMirrorHorizontal( const wxPoint& center ) +void LIB_TEXT::DoMirrorHorizontal( const wxPoint& center ) { m_Pos.x -= center.x; m_Pos.x *= -1; @@ -249,8 +249,8 @@ void LibDrawText::DoMirrorHorizontal( const wxPoint& center ) } -void LibDrawText::DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, - const int transform[2][2] ) +void LIB_TEXT::DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, + const int transform[2][2] ) { wxASSERT( plotter != NULL ); @@ -269,7 +269,7 @@ void LibDrawText::DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, /** Function GetPenSize * @return the size of the "pen" that be used to draw or plot this item */ -int LibDrawText::GetPenSize( ) +int LIB_TEXT::GetPenSize( ) { int pensize = m_Width; @@ -285,9 +285,9 @@ int LibDrawText::GetPenSize( ) return pensize; } -void LibDrawText::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, - const wxPoint& aOffset, int aColor, int aDrawMode, - void* aData, const int aTransformMatrix[2][2] ) +void LIB_TEXT::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, + const wxPoint& aOffset, int aColor, int aDrawMode, + void* aData, const int aTransformMatrix[2][2] ) { wxPoint pos1, pos2; @@ -318,7 +318,7 @@ void LibDrawText::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, } -void LibDrawText::DisplayInfo( WinEDA_DrawFrame* frame ) +void LIB_TEXT::DisplayInfo( WinEDA_DrawFrame* frame ) { wxString msg; @@ -331,7 +331,7 @@ void LibDrawText::DisplayInfo( WinEDA_DrawFrame* frame ) } -EDA_Rect LibDrawText::GetBoundingBox() +EDA_Rect LIB_TEXT::GetBoundingBox() { EDA_Rect rect = GetTextBox(); rect.m_Pos.y *= -1; diff --git a/eeschema/class_libentry.cpp b/eeschema/class_libentry.cpp index 8f39a00e7a..c5417d5a8d 100644 --- a/eeschema/class_libentry.cpp +++ b/eeschema/class_libentry.cpp @@ -193,8 +193,8 @@ LIB_COMPONENT::LIB_COMPONENT( LIB_COMPONENT& component, CMP_LIBRARY* lib ) : CMP_LIB_ENTRY( component, lib ) { LIB_DRAW_ITEM* newItem; - LibDrawField* oldField; - LibDrawField* newField; + LIB_FIELD* oldField; + LIB_FIELD* newField; m_Prefix = component.m_Prefix; m_AliasList = component.m_AliasList; @@ -221,7 +221,7 @@ LIB_COMPONENT::LIB_COMPONENT( LIB_COMPONENT& component, CMP_LIBRARY* lib ) : for( oldField = component.m_Fields; oldField != NULL; oldField = oldField->Next() ) { - newField = (LibDrawField*) oldField->GenCopy(); + newField = (LIB_FIELD*) oldField->GenCopy(); newField->SetParent( this ); m_Fields.PushBack( newField ); } @@ -240,8 +240,6 @@ void LIB_COMPONENT::Draw( WinEDA_DrawPanel* panel, wxDC* dc, bool showPinText, bool drawFields, bool onlySelected ) { - wxString fieldText; - LibDrawField* Field; BASE_SCREEN* screen = panel->GetScreen(); GRSetDrawMode( dc, drawMode ); @@ -282,25 +280,13 @@ void LIB_COMPONENT::Draw( WinEDA_DrawPanel* panel, wxDC* dc, if( drawFields ) { - /* The reference designator field is a special case for naming + LIB_FIELD* Field; + + /* + * The reference designator field is a special case for naming * convention. - * - * FIXME: This should be handled by the LibDrawField class. */ - if( m_UnitCount > 1 ) - { -#if defined(KICAD_GOST) - fieldText.Printf( wxT( "%s?.%c" ), (const wxChar*) m_Prefix.m_Text, - multi + '1' - 1 ); -#else - fieldText.Printf( wxT( "%s?%c" ), (const wxChar*) m_Prefix.m_Text, - multi + 'A' - 1 ); -#endif - } - else - { - fieldText = m_Prefix.m_Text + wxT( "?" ); - } + wxString fieldText = m_Prefix.GetFullText( multi ); if( !( onlySelected && m_Prefix.m_Selected == 0 ) ) m_Prefix.Draw( panel, dc, offset, color, drawMode, &fieldText, @@ -384,7 +370,7 @@ void LIB_COMPONENT::RemoveDrawItem( LIB_DRAW_ITEM* item, } else { - LibDrawField* field; + LIB_FIELD* field; for( field = m_Fields; field != NULL; field = field->Next() ) { @@ -438,7 +424,7 @@ LIB_DRAW_ITEM* LIB_COMPONENT::GetNextDrawItem( LIB_DRAW_ITEM* item, */ bool LIB_COMPONENT::Save( FILE* aFile ) { - LibDrawField* Field; + LIB_FIELD* Field; /* First line: it s a comment (component name for readers) */ if( fprintf( aFile, "#\n# %s\n#\n", CONV_TO_UTF8( m_Name.m_Text ) ) < 0 ) @@ -689,31 +675,31 @@ bool LIB_COMPONENT::LoadDrawEntries( FILE* f, char* line, switch( line[0] ) { case 'A': /* Arc */ - newEntry = ( LIB_DRAW_ITEM* ) new LibDrawArc(this); + newEntry = ( LIB_DRAW_ITEM* ) new LIB_ARC(this); break; case 'C': /* Circle */ - newEntry = ( LIB_DRAW_ITEM* ) new LibDrawCircle(this); + newEntry = ( LIB_DRAW_ITEM* ) new LIB_CIRCLE(this); break; case 'T': /* Text */ - newEntry = ( LIB_DRAW_ITEM* ) new LibDrawText(this); + newEntry = ( LIB_DRAW_ITEM* ) new LIB_TEXT(this); break; case 'S': /* Square */ - newEntry = ( LIB_DRAW_ITEM* ) new LibDrawSquare(this); + newEntry = ( LIB_DRAW_ITEM* ) new LIB_RECTANGLE(this); break; case 'X': /* Pin Description */ - newEntry = ( LIB_DRAW_ITEM* ) new LibDrawPin(this); + newEntry = ( LIB_DRAW_ITEM* ) new LIB_PIN(this); break; case 'P': /* Polyline */ - newEntry = ( LIB_DRAW_ITEM* ) new LibDrawPolyline(this); + newEntry = ( LIB_DRAW_ITEM* ) new LIB_POLYLINE(this); break; case 'B': /* Bezier Curves */ - newEntry = ( LIB_DRAW_ITEM* ) new LibDrawBezier(this); + newEntry = ( LIB_DRAW_ITEM* ) new LIB_BEZIER(this); break; default: @@ -766,7 +752,7 @@ bool LIB_COMPONENT::LoadAliases( char* line, wxString& errorMsg ) bool LIB_COMPONENT::LoadField( char* line, wxString& errorMsg ) { - LibDrawField* field = new LibDrawField( this ); + LIB_FIELD* field = new LIB_FIELD( this ); if ( !field->Load( line, errorMsg ) ) { @@ -846,9 +832,9 @@ EDA_Rect LIB_COMPONENT::GetBoundaryBox( int Unit, int Convert ) /** Function SetFields * initialize fields from a vector of fields - * @param aFields a std::vector to import. + * @param aFields a std::vector to import. */ -void LIB_COMPONENT::SetFields( const std::vector aFields ) +void LIB_COMPONENT::SetFields( const std::vector aFields ) { // Init basic fields (Value = name in lib, and reference): aFields[VALUE].Copy( &m_Name ); @@ -867,7 +853,7 @@ void LIB_COMPONENT::SetFields( const std::vector aFields ) create = TRUE; if( create ) { - LibDrawField*Field = new LibDrawField( this, ii ); + LIB_FIELD*Field = new LIB_FIELD( this, ii ); aFields[ii].Copy( Field ); m_Fields.PushBack( Field ); } @@ -879,7 +865,7 @@ void LIB_COMPONENT::SetFields( const std::vector aFields ) * text is like a void text and for non editable names, remove the name * (set to the default name) */ - for( LibDrawField* Field = m_Fields; Field; Field = Field->Next() ) + for( LIB_FIELD* Field = m_Fields; Field; Field = Field->Next() ) { Field->SetParent( this ); if( Field->m_FieldId >= FIELD1 ) @@ -947,7 +933,7 @@ void LIB_COMPONENT::SetOffset( const wxPoint& offset ) m_Name.SetOffset( offset ); m_Prefix.SetOffset( offset ); - for( LibDrawField* field = m_Fields; field != NULL; field = field->Next() ) + for( LIB_FIELD* field = m_Fields; field != NULL; field = field->Next() ) { field->SetOffset( offset ); } @@ -979,7 +965,7 @@ bool LIB_COMPONENT::HasConversion() const void LIB_COMPONENT::ClearStatus( void ) { - LibDrawField* field; + LIB_FIELD* field; BOOST_FOREACH( LIB_DRAW_ITEM& item, m_Drawings ) item.m_Flags = 0; @@ -1032,7 +1018,7 @@ int LIB_COMPONENT::SelectItems( EDA_Rect& rect, int unit, int convert, ItemsCount++; } - for( LibDrawField* field = m_Fields.GetFirst(); field != NULL; + for( LIB_FIELD* field = m_Fields.GetFirst(); field != NULL; field = field->Next() ) { if( field->Inside( rect ) ) @@ -1048,7 +1034,7 @@ int LIB_COMPONENT::SelectItems( EDA_Rect& rect, int unit, int convert, void LIB_COMPONENT::MoveSelectedItems( const wxPoint& offset ) { - LibDrawField* field; + LIB_FIELD* field; BOOST_FOREACH( LIB_DRAW_ITEM& item, m_Drawings ) { @@ -1086,7 +1072,7 @@ void LIB_COMPONENT::MoveSelectedItems( const wxPoint& offset ) void LIB_COMPONENT::ClearSelectedItems( void ) { - LibDrawField* field; + LIB_FIELD* field; BOOST_FOREACH( LIB_DRAW_ITEM& item, m_Drawings ) item.m_Flags = item.m_Selected = 0; @@ -1132,7 +1118,7 @@ void LIB_COMPONENT::CopySelectedItems( const wxPoint& offset ) void LIB_COMPONENT::MirrorSelectedItemsH( const wxPoint& center ) { - LibDrawField* field; + LIB_FIELD* field; BOOST_FOREACH( LIB_DRAW_ITEM& item, m_Drawings ) { @@ -1183,7 +1169,7 @@ void LIB_COMPONENT::MirrorSelectedItemsH( const wxPoint& center ) LIB_DRAW_ITEM* LIB_COMPONENT::LocateDrawItem( int unit, int convert, KICAD_T type, const wxPoint& pt ) { - LibDrawField* field; + LIB_FIELD* field; BOOST_FOREACH( LIB_DRAW_ITEM& item, m_Drawings ) { diff --git a/eeschema/class_libentry.h b/eeschema/class_libentry.h index 5e0ee90ae8..46cb53e17b 100644 --- a/eeschema/class_libentry.h +++ b/eeschema/class_libentry.h @@ -43,7 +43,7 @@ class CMP_LIB_ENTRY : public EDA_BaseStruct public: LibrEntryType Type; /* Type = ROOT; * = ALIAS pour struct LibraryAliasType */ - LibDrawField m_Name; // name (74LS00 ..) in lib ( = VALUE ) + LIB_FIELD m_Name; // name (74LS00 ..) in lib ( = VALUE ) wxString m_Doc; /* documentation for info */ wxString m_KeyWord; /* keyword list (used to select a group of * components by keyword) */ @@ -107,7 +107,7 @@ extern int LibraryEntryCompare( const CMP_LIB_ENTRY* LE1, class LIB_COMPONENT : public CMP_LIB_ENTRY { public: - LibDrawField m_Prefix; /* Prefix ( U, IC ... ) = REFERENCE */ + LIB_FIELD m_Prefix; /* Prefix ( U, IC ... ) = REFERENCE */ wxArrayString m_AliasList; /* ALIAS list for the component */ wxArrayString m_FootprintList; /* list of suitable footprint names * for the component (wildcard names @@ -123,8 +123,8 @@ public: * m_TextInside in mils */ bool m_DrawPinNum; bool m_DrawPinName; - DLIST m_Fields; /* Auxiliary Field list (id >= 2 ) */ - long m_LastDate; // Last change Date + DLIST m_Fields; /* Auxiliary Field list (id >= 2 ) */ + long m_LastDate; // Last change Date protected: int m_UnitCount; /* Units (or sections) per package */ @@ -177,9 +177,9 @@ public: /** * Initialize fields from a vector of fields. * - * @param aFields - a std::vector to import. + * @param aFields - a std::vector to import. */ - void SetFields( const std::vector aFields ); + void SetFields( const std::vector aFields ); /** * Draw component. @@ -244,10 +244,10 @@ public: LIB_DRAW_ITEM* GetNextDrawItem( LIB_DRAW_ITEM* item = NULL, KICAD_T type = TYPE_NOT_INIT ); - LibDrawPin* GetNextPin( LibDrawPin* item = NULL ) + LIB_PIN* GetNextPin( LIB_PIN* item = NULL ) { - return (LibDrawPin*) GetNextDrawItem( (LIB_DRAW_ITEM*) item, - COMPONENT_PIN_DRAW_TYPE ); + return (LIB_PIN*) GetNextDrawItem( (LIB_DRAW_ITEM*) item, + COMPONENT_PIN_DRAW_TYPE ); } /** diff --git a/eeschema/class_libentry_fields.cpp b/eeschema/class_libentry_fields.cpp index dd322b7017..07afa5e8eb 100644 --- a/eeschema/class_libentry_fields.cpp +++ b/eeschema/class_libentry_fields.cpp @@ -40,22 +40,21 @@ * * others = free fields */ -LibDrawField::LibDrawField(LIB_COMPONENT * aParent, int idfield ) : +LIB_FIELD::LIB_FIELD(LIB_COMPONENT * aParent, int idfield ) : LIB_DRAW_ITEM( COMPONENT_FIELD_DRAW_TYPE, aParent ) { m_FieldId = idfield; m_Size.x = m_Size.y = DEFAULT_SIZE_TEXT; } -LibDrawField::LibDrawField( int idfield ) : +LIB_FIELD::LIB_FIELD( int idfield ) : LIB_DRAW_ITEM( COMPONENT_FIELD_DRAW_TYPE, NULL ) { m_FieldId = idfield; m_Size.x = m_Size.y = DEFAULT_SIZE_TEXT; } -LibDrawField::LibDrawField( const LibDrawField& field ) : - LIB_DRAW_ITEM( field ) +LIB_FIELD::LIB_FIELD( const LIB_FIELD& field ) : LIB_DRAW_ITEM( field ) { m_Pos = field.m_Pos; m_Size = field.m_Size; @@ -71,12 +70,12 @@ LibDrawField::LibDrawField( const LibDrawField& field ) : } -LibDrawField::~LibDrawField() +LIB_FIELD::~LIB_FIELD() { } -bool LibDrawField::Save( FILE* ExportFile ) const +bool LIB_FIELD::Save( FILE* ExportFile ) const { int hjustify, vjustify; wxString text = m_Text; @@ -119,7 +118,7 @@ bool LibDrawField::Save( FILE* ExportFile ) const } -bool LibDrawField::Load( char* line, wxString& errorMsg ) +bool LIB_FIELD::Load( char* line, wxString& errorMsg ) { int cnt; char textOrient; @@ -257,7 +256,7 @@ parameter <%c> is not valid" ), /** Function GetPenSize * @return the size of the "pen" that be used to draw or plot this item */ -int LibDrawField::GetPenSize() +int LIB_FIELD::GetPenSize() { return ( m_Width == 0 ) ? g_DrawDefaultLineThickness : m_Width; } @@ -267,9 +266,9 @@ int LibDrawField::GetPenSize() * if aData not NULL, aData must point a wxString which is used instead of * the m_Text */ -void LibDrawField::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, - const wxPoint& aOffset, int aColor, int aDrawMode, - void* aData, const int aTransformMatrix[2][2] ) +void LIB_FIELD::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, + const wxPoint& aOffset, int aColor, int aDrawMode, + void* aData, const int aTransformMatrix[2][2] ) { wxPoint text_pos; int color; @@ -335,7 +334,7 @@ void LibDrawField::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, * @param refPos A wxPoint to test, in Field coordinate system * @return bool - true if a hit, else false */ -bool LibDrawField::HitTest( const wxPoint& refPos ) +bool LIB_FIELD::HitTest( const wxPoint& refPos ) { return HitTest( refPos, 0, DefaultTransformMatrix ); } @@ -346,8 +345,8 @@ bool LibDrawField::HitTest( const wxPoint& refPos ) * @param aThreshold = unused here (TextHitTest calculates its threshold ) * @param aTransMat = the transform matrix */ -bool LibDrawField::HitTest( wxPoint aPosRef, int aThreshold, - const int aTransMat[2][2] ) +bool LIB_FIELD::HitTest( wxPoint aPosRef, int aThreshold, + const int aTransMat[2][2] ) { int extraCharCount = 0; // Reference designator text has one or 2 additional character (displays @@ -387,9 +386,9 @@ bool LibDrawField::HitTest( wxPoint aPosRef, int aThreshold, } // Creation et Duplication d'un field -LIB_DRAW_ITEM* LibDrawField::DoGenCopy() +LIB_DRAW_ITEM* LIB_FIELD::DoGenCopy() { - LibDrawField* newfield = new LibDrawField( m_FieldId ); + LIB_FIELD* newfield = new LIB_FIELD( m_FieldId ); Copy( newfield ); @@ -399,9 +398,9 @@ LIB_DRAW_ITEM* LibDrawField::DoGenCopy() /** Function Copy * copy parameters of this to Target. Pointers are not copied - * @param Target = the LibDrawField to set with "this" values + * @param Target = the LIB_FIELD to set with "this" values */ -void LibDrawField::Copy( LibDrawField* Target ) const +void LIB_FIELD::Copy( LIB_FIELD* Target ) const { Target->SetParent( m_Parent ); Target->m_Pos = m_Pos; @@ -418,11 +417,11 @@ void LibDrawField::Copy( LibDrawField* Target ) const } -int LibDrawField::DoCompare( const LIB_DRAW_ITEM& other ) const +int LIB_FIELD::DoCompare( const LIB_DRAW_ITEM& other ) const { wxASSERT( other.Type() == COMPONENT_FIELD_DRAW_TYPE ); - const LibDrawField* tmp = ( LibDrawField* ) &other; + const LIB_FIELD* tmp = ( LIB_FIELD* ) &other; if( m_FieldId == tmp->m_FieldId ) return m_FieldId - tmp->m_FieldId; @@ -448,13 +447,13 @@ int LibDrawField::DoCompare( const LIB_DRAW_ITEM& other ) const } -void LibDrawField::DoOffset( const wxPoint& offset ) +void LIB_FIELD::DoOffset( const wxPoint& offset ) { m_Pos += offset; } -bool LibDrawField::DoTestInside( EDA_Rect& rect ) +bool LIB_FIELD::DoTestInside( EDA_Rect& rect ) { /* * FIXME: This fails to take into acount the size and/or orientation of @@ -464,13 +463,13 @@ bool LibDrawField::DoTestInside( EDA_Rect& rect ) } -void LibDrawField::DoMove( const wxPoint& newPosition ) +void LIB_FIELD::DoMove( const wxPoint& newPosition ) { m_Pos = newPosition; } -void LibDrawField::DoMirrorHorizontal( const wxPoint& center ) +void LIB_FIELD::DoMirrorHorizontal( const wxPoint& center ) { m_Pos.x -= center.x; m_Pos.x *= -1; @@ -478,8 +477,8 @@ void LibDrawField::DoMirrorHorizontal( const wxPoint& center ) } -void LibDrawField::DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, - const int transform[2][2] ) +void LIB_FIELD::DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, + const int transform[2][2] ) { } @@ -490,7 +489,7 @@ void LibDrawField::DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, * * @fixme This should be handled by the field object. */ -wxString LibDrawField::GetFullText( int unit ) +wxString LIB_FIELD::GetFullText( int unit ) { if( m_FieldId != REFERENCE ) return m_Text; @@ -515,7 +514,7 @@ wxString LibDrawField::GetFullText( int unit ) } -EDA_Rect LibDrawField::GetBoundingBox() +EDA_Rect LIB_FIELD::GetBoundingBox() { EDA_Rect rect = GetTextBox(); rect.m_Pos.y *= -1; diff --git a/eeschema/class_libentry_fields.h b/eeschema/class_libentry_fields.h index a1697baecb..29be4e27ec 100644 --- a/eeschema/class_libentry_fields.h +++ b/eeschema/class_libentry_fields.h @@ -18,8 +18,7 @@ * default value in schematic */ -class LibDrawField : public LIB_DRAW_ITEM, - public EDA_TextStruct +class LIB_FIELD : public LIB_DRAW_ITEM, public EDA_TextStruct { public: int m_FieldId; /* 0 = REFERENCE @@ -33,17 +32,17 @@ public: public: - LibDrawField* Next() const { return (LibDrawField*) Pnext; } - LibDrawField* Back() const { return (LibDrawField*) Pback; } + LIB_FIELD* Next() const { return (LIB_FIELD*) Pnext; } + LIB_FIELD* Back() const { return (LIB_FIELD*) Pback; } - LibDrawField( int idfield = 2 ); - LibDrawField( LIB_COMPONENT * aParent, int idfield = 2 ); - LibDrawField( const LibDrawField& field ); - ~LibDrawField(); + LIB_FIELD( int idfield = 2 ); + LIB_FIELD( LIB_COMPONENT * aParent, int idfield = 2 ); + LIB_FIELD( const LIB_FIELD& field ); + ~LIB_FIELD(); virtual wxString GetClass() const { - return wxT( "LibDrawField" ); + return wxT( "LIB_FIELD" ); } @@ -64,11 +63,11 @@ public: /** Function Copy * copy parameters of this to Target. Pointers are not copied - * @param aTarget = the LibDrawField to set with "this" values + * @param aTarget = the LIB_FIELD to set with "this" values */ - void Copy( LibDrawField* aTarget ) const; + void Copy( LIB_FIELD* aTarget ) const; - void SetFields( const std::vector aFields ); + void SetFields( const std::vector aFields ); void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC, const wxPoint &aOffset, int aColor, int aDrawMode, void* aData, @@ -100,7 +99,7 @@ public: virtual bool HitTest( wxPoint aPosRef, int aThreshold, const int aTransMat[2][2] ); - void operator=( const LibDrawField& field ) + void operator=( const LIB_FIELD& field ) { m_FieldId = field.m_FieldId; m_Text = field.m_Text; @@ -154,6 +153,7 @@ protected: virtual void DoMirrorHorizontal( const wxPoint& center ); virtual void DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, const int transform[2][2] ); + virtual int DoGetWidth( void ) { return m_Width; } }; #endif // CLASS_LIBENTRY_FIELDS_H diff --git a/eeschema/class_library.cpp b/eeschema/class_library.cpp index 1245033e09..1adfa5d442 100644 --- a/eeschema/class_library.cpp +++ b/eeschema/class_library.cpp @@ -18,6 +18,7 @@ #include #include +#include static const wxChar* duplicate_name_msg = _( "Component library <%s> has \ @@ -129,6 +130,23 @@ void CMP_LIBRARY::SearchEntryNames( wxArrayString& names, } +void CMP_LIBRARY::SearchEntryNames( wxArrayString& names, const wxRegEx& re, + bool sort ) +{ + if( !re.IsValid() ) + return; + + BOOST_FOREACH( CMP_LIB_ENTRY& entry, m_Entries ) + { + if( re.Matches( entry.m_KeyWord ) ) + names.Add( entry.GetName() ); + } + + if( sort ) + names.Sort(); +} + + CMP_LIB_ENTRY* CMP_LIBRARY::FindEntry( const wxChar* name ) { BOOST_FOREACH( CMP_LIB_ENTRY& entry, m_Entries ) diff --git a/eeschema/class_library.h b/eeschema/class_library.h index 1e830fe905..99f83ab274 100644 --- a/eeschema/class_library.h +++ b/eeschema/class_library.h @@ -42,6 +42,8 @@ /* Helpers for creating a list of component libraries. */ class CMP_LIBRARY; +class wxRegEx; + typedef boost::ptr_vector< CMP_LIBRARY > CMP_LIBRARY_LIST; @@ -176,9 +178,6 @@ public: * WildCompareString(). The names array will be populated with the * library entry names that meat the search criteria on exit. * - * @todo Convert the search functions to use regular expressions which - * should give better search capability. - * * @param names - String array to place entry names into. * @param nameSearch - Name wild card search criteria. * @param keySearch - Key word search criteria. @@ -189,6 +188,16 @@ public: const wxString& keySearch = wxEmptyString, bool sort = true ); + /** + * Find components in library by key word regular expression search. + * + * @param names - String array to place found component names into. + * @param re - Regular expression used to seach component key words. + * @param sort - Sort component name list. + */ + void SearchEntryNames( wxArrayString& names, const wxRegEx& re, + bool sort = true ); + /** * Find entry by name. * diff --git a/eeschema/class_pin.cpp b/eeschema/class_pin.cpp index 513baf7ba9..96f9c25df0 100644 --- a/eeschema/class_pin.cpp +++ b/eeschema/class_pin.cpp @@ -37,7 +37,7 @@ const wxChar* MsgPinElectricType[] = wxT( "?????" ) }; -LibDrawPin::LibDrawPin(LIB_COMPONENT * aParent) : +LIB_PIN::LIB_PIN(LIB_COMPONENT * aParent) : LIB_DRAW_ITEM( COMPONENT_PIN_DRAW_TYPE, aParent ) { m_PinLen = 300; /* default Pin len */ @@ -57,7 +57,7 @@ LibDrawPin::LibDrawPin(LIB_COMPONENT * aParent) : } -LibDrawPin::LibDrawPin( const LibDrawPin& pin ) : LIB_DRAW_ITEM( pin ) +LIB_PIN::LIB_PIN( const LIB_PIN& pin ) : LIB_DRAW_ITEM( pin ) { m_Pos = pin.m_Pos; m_PinLen = pin.m_PinLen; @@ -83,7 +83,7 @@ LibDrawPin::LibDrawPin( const LibDrawPin& pin ) : LIB_DRAW_ITEM( pin ) * @param aRefPos A wxPoint to test * @return bool - true if a hit, else false */ -bool LibDrawPin::HitTest( const wxPoint& aRefPos ) +bool LIB_PIN::HitTest( const wxPoint& aRefPos ) { int mindist = m_Width ? m_Width / 2 : g_DrawDefaultLineThickness / 2; @@ -100,8 +100,8 @@ bool LibDrawPin::HitTest( const wxPoint& aRefPos ) * @param aThreshold = max distance to a segment * @param aTransMat = the transform matrix */ -bool LibDrawPin::HitTest( wxPoint aRefPos, int aThreshold, - const int aTransMat[2][2] ) +bool LIB_PIN::HitTest( wxPoint aRefPos, int aThreshold, + const int aTransMat[2][2] ) { wxPoint pinPos = TransformCoordinate( aTransMat, m_Pos ); wxPoint pinEnd = TransformCoordinate( aTransMat, ReturnPinEndPoint() ); @@ -110,7 +110,7 @@ bool LibDrawPin::HitTest( wxPoint aRefPos, int aThreshold, } -bool LibDrawPin::Save( FILE* ExportFile ) const +bool LIB_PIN::Save( FILE* ExportFile ) const { wxString StringPinNum; int Etype; @@ -208,7 +208,7 @@ bool LibDrawPin::Save( FILE* ExportFile ) const } -bool LibDrawPin::Load( char* line, wxString& errorMsg ) +bool LIB_PIN::Load( char* line, wxString& errorMsg ) { int i, j; char pinAttrs[64]; @@ -324,19 +324,19 @@ bool LibDrawPin::Load( char* line, wxString& errorMsg ) /** Function GetPenSize * @return the size of the "pen" that be used to draw or plot this item */ -int LibDrawPin::GetPenSize() +int LIB_PIN::GetPenSize() { return ( m_Width == 0 ) ? g_DrawDefaultLineThickness : m_Width; } -void LibDrawPin::Draw( WinEDA_DrawPanel* aPanel, - wxDC* aDC, - const wxPoint& aOffset, - int aColor, - int aDrawMode, - void* aData, - const int aTransformMatrix[2][2] ) +void LIB_PIN::Draw( WinEDA_DrawPanel* aPanel, + wxDC* aDC, + const wxPoint& aOffset, + int aColor, + int aDrawMode, + void* aData, + const int aTransformMatrix[2][2] ) { // Invisible pins are only drawn on request. In libedit they are drawn // in g_InvisibleItemColor because we must see them. @@ -388,12 +388,12 @@ void LibDrawPin::Draw( WinEDA_DrawPanel* aPanel, * Draw the pin symbol (without texts) * if Color != 0 draw with Color, else with the normal pin color */ -void LibDrawPin::DrawPinSymbol( WinEDA_DrawPanel* aPanel, - wxDC* aDC, - const wxPoint& aPinPos, - int aOrient, - int aDrawMode, - int aColor ) +void LIB_PIN::DrawPinSymbol( WinEDA_DrawPanel* aPanel, + wxDC* aDC, + const wxPoint& aPinPos, + int aOrient, + int aDrawMode, + int aColor ) { int MapX1, MapY1, x1, y1; int color; @@ -555,15 +555,15 @@ void LibDrawPin::DrawPinSymbol( WinEDA_DrawPanel* aPanel, * If TextInside then the text is been put inside,otherwise all is drawn outside. * Pin Name: substring beteween '~' is negated *****************************************************************************/ -void LibDrawPin::DrawPinTexts( WinEDA_DrawPanel* panel, - wxDC* DC, - wxPoint& pin_pos, - int orient, - int TextInside, - bool DrawPinNum, - bool DrawPinName, - int Color, - int DrawMode ) +void LIB_PIN::DrawPinTexts( WinEDA_DrawPanel* panel, + wxDC* DC, + wxPoint& pin_pos, + int orient, + int TextInside, + bool DrawPinNum, + bool DrawPinName, + int Color, + int DrawMode ) /* DrawMode = GR_OR, XOR ... */ { int x, y, x1, y1; @@ -763,13 +763,13 @@ void LibDrawPin::DrawPinTexts( WinEDA_DrawPanel* panel, * If TextInside then the text is been put inside (moving from x1, y1 in * * the opposite direction to x2,y2), otherwise all is drawn outside. * *****************************************************************************/ -void LibDrawPin::PlotPinTexts( PLOTTER *plotter, - wxPoint& pin_pos, - int orient, - int TextInside, - bool DrawPinNum, - bool DrawPinName, - int aWidth ) +void LIB_PIN::PlotPinTexts( PLOTTER *plotter, + wxPoint& pin_pos, + int orient, + int TextInside, + bool DrawPinNum, + bool DrawPinName, + int aWidth ) { int x, y, x1, y1; wxString StringPinNum; @@ -945,7 +945,7 @@ void LibDrawPin::PlotPinTexts( PLOTTER *plotter, /******************************************/ -wxPoint LibDrawPin::ReturnPinEndPoint() +wxPoint LIB_PIN::ReturnPinEndPoint() /******************************************/ /* return the pin end position, for a component in normal orient @@ -977,7 +977,7 @@ wxPoint LibDrawPin::ReturnPinEndPoint() * according to its orientation and the matrix transform (rot, mirror) TransMat * @param TransMat = transform matrix */ -int LibDrawPin::ReturnPinDrawOrient( const int TransMat[2][2] ) +int LIB_PIN::ReturnPinDrawOrient( const int TransMat[2][2] ) { int orient; wxPoint end; // position of a end pin starting at 0,0 according to its orientation, lenght = 1 @@ -1021,7 +1021,7 @@ int LibDrawPin::ReturnPinDrawOrient( const int TransMat[2][2] ) * Used to print/draw the pin num * @param aStringBuffer = the wxString to store the pin num as an unicode string */ -void LibDrawPin::ReturnPinStringNum( wxString& aStringBuffer ) const +void LIB_PIN::ReturnPinStringNum( wxString& aStringBuffer ) const { aStringBuffer = ReturnPinStringNum( m_PinNum ); } @@ -1031,7 +1031,7 @@ void LibDrawPin::ReturnPinStringNum( wxString& aStringBuffer ) const * @param aPinNum = a long containing a pin num * @return aStringBuffer = the wxString to store the pin num as an unicode string */ -wxString LibDrawPin::ReturnPinStringNum( long aPinNum ) +wxString LIB_PIN::ReturnPinStringNum( long aPinNum ) { char ascii_buf[5]; @@ -1044,12 +1044,12 @@ wxString LibDrawPin::ReturnPinStringNum( long aPinNum ) } -/** Function LibDrawPin::SetPinNumFromString() +/** Function LIB_PIN::SetPinNumFromString() * fill the buffer with pin num as a wxString * Pin num is coded as a long * Used to print/draw the pin num */ -void LibDrawPin::SetPinNumFromString( wxString& buffer ) +void LIB_PIN::SetPinNumFromString( wxString& buffer ) { char ascii_buf[4]; unsigned ii, len = buffer.Len(); @@ -1068,10 +1068,10 @@ void LibDrawPin::SetPinNumFromString( wxString& buffer ) /*************************************/ -LIB_DRAW_ITEM* LibDrawPin::DoGenCopy() +LIB_DRAW_ITEM* LIB_PIN::DoGenCopy() /*************************************/ { - LibDrawPin* newpin = new LibDrawPin( GetParent() ); + LIB_PIN* newpin = new LIB_PIN( GetParent() ); newpin->m_Pos = m_Pos; newpin->m_PinLen = m_PinLen; @@ -1096,11 +1096,11 @@ LIB_DRAW_ITEM* LibDrawPin::DoGenCopy() } -int LibDrawPin::DoCompare( const LIB_DRAW_ITEM& other ) const +int LIB_PIN::DoCompare( const LIB_DRAW_ITEM& other ) const { wxASSERT( other.Type() == COMPONENT_PIN_DRAW_TYPE ); - const LibDrawPin* tmp = ( LibDrawPin* ) &other; + const LIB_PIN* tmp = ( LIB_PIN* ) &other; if( m_PinNum != tmp->m_PinNum ) return m_PinNum - tmp->m_PinNum; @@ -1120,13 +1120,13 @@ int LibDrawPin::DoCompare( const LIB_DRAW_ITEM& other ) const } -void LibDrawPin::DoOffset( const wxPoint& offset ) +void LIB_PIN::DoOffset( const wxPoint& offset ) { m_Pos += offset; } -bool LibDrawPin::DoTestInside( EDA_Rect& rect ) +bool LIB_PIN::DoTestInside( EDA_Rect& rect ) { wxPoint end = ReturnPinEndPoint(); @@ -1134,13 +1134,13 @@ bool LibDrawPin::DoTestInside( EDA_Rect& rect ) } -void LibDrawPin::DoMove( const wxPoint& newPosition ) +void LIB_PIN::DoMove( const wxPoint& newPosition ) { m_Pos = newPosition; } -void LibDrawPin::DoMirrorHorizontal( const wxPoint& center ) +void LIB_PIN::DoMirrorHorizontal( const wxPoint& center ) { m_Pos.x -= center.x; m_Pos.x *= -1; @@ -1153,8 +1153,8 @@ void LibDrawPin::DoMirrorHorizontal( const wxPoint& center ) } -void LibDrawPin::DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, - const int transform[2][2] ) +void LIB_PIN::DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, + const int transform[2][2] ) { if( m_Attributs & PINNOTDRAW ) return; @@ -1171,48 +1171,42 @@ void LibDrawPin::DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, } -/** Function LibDrawPin::DisplayInfo +/** Function LIB_PIN::DisplayInfo * Displays info (pin num and name, orientation ... * on the Info window */ -void LibDrawPin::DisplayInfo( WinEDA_DrawFrame* frame ) +void LIB_PIN::DisplayInfo( WinEDA_DrawFrame* frame ) { wxString Text; int ii; LIB_DRAW_ITEM::DisplayInfo( frame ); - /* Affichage du nom */ - frame->MsgPanel->Affiche_1_Parametre( 30, _( "PinName" ), m_PinName, - DARKCYAN ); + frame->MsgPanel->AppendMessage( _( "Pin name" ), m_PinName, DARKCYAN ); - /* Affichage du numero */ if( m_PinNum == 0 ) Text = wxT( "?" ); else ReturnPinStringNum( Text ); - frame->MsgPanel->Affiche_1_Parametre( 38, _( "PinNum" ), Text, DARKCYAN ); + frame->MsgPanel->AppendMessage( _( "Pin number" ), Text, DARKCYAN ); - /* Affichage du type */ ii = m_PinType; - frame->MsgPanel->Affiche_1_Parametre( 44, _( "PinType" ), - MsgPinElectricType[ii], RED ); + frame->MsgPanel->AppendMessage( _( "Pin type" ), MsgPinElectricType[ii], + RED ); - /* Affichage de la visiblite */ ii = m_Attributs; if( ii & 1 ) - Text = _( "no" ); + Text = _( "Not visible" ); else - Text = _( "yes" ); - frame->MsgPanel->Affiche_1_Parametre( 50, _( "Display" ), Text, DARKGREEN ); + Text = _( "Visible" ); + frame->MsgPanel->AppendMessage( _( "Display" ), Text, DARKGREEN ); /* Display pin length */ Text = ReturnStringFromValue( g_UnitMetric, m_PinLen, EESCHEMA_INTERNAL_UNIT, true ); - frame->MsgPanel->Affiche_1_Parametre( 56, _( "Length" ), Text, MAGENTA ); + frame->MsgPanel->AppendMessage( _( "Length" ), Text, MAGENTA ); - /* Affichage de l'orientation */ switch( m_Orient ) { case PIN_UP: @@ -1232,18 +1226,18 @@ void LibDrawPin::DisplayInfo( WinEDA_DrawFrame* frame ) break; default: - Text = wxT( "??" ); + Text = _( "Unknown" ); break; } - frame->MsgPanel->Affiche_1_Parametre( 62, _( "Orient" ), Text, MAGENTA ); + frame->MsgPanel->AppendMessage( _( "Oriention" ), Text, MAGENTA ); } -/** Function LibDrawPin::GetBoundingBox +/** Function LIB_PIN::GetBoundingBox * @return the boundary box for this, in schematic coordinates */ -EDA_Rect LibDrawPin::GetBoundingBox() +EDA_Rect LIB_PIN::GetBoundingBox() { wxPoint pt = m_Pos; diff --git a/eeschema/class_sch_cmp_field.cpp b/eeschema/class_sch_cmp_field.cpp index 1c643c46ac..e4910e9740 100644 --- a/eeschema/class_sch_cmp_field.cpp +++ b/eeschema/class_sch_cmp_field.cpp @@ -198,7 +198,8 @@ void SCH_CMP_FIELD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, DrawGraphicText( panel, DC, pos, color, fulltext, orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ, - m_Size, hjustify, vjustify, LineWidth, m_Italic, m_Bold, false ); + m_Size, hjustify, vjustify, LineWidth, m_Italic, + m_Bold, false ); } } @@ -208,19 +209,19 @@ void SCH_CMP_FIELD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, * copy parameters from a source. * Pointers and specific values (position, texts) are not copied * used to init a field from the model read from a lib entry - * @param aSource = the LibDrawField to read + * @param aSource = the LIB_FIELD to read */ -void SCH_CMP_FIELD::ImportValues( const LibDrawField& aSource ) +void SCH_CMP_FIELD::ImportValues( const LIB_FIELD& aSource ) { - m_Orient = aSource.m_Orient; - m_Size = aSource.m_Size; - m_HJustify = aSource.m_HJustify; - m_VJustify = aSource.m_VJustify; - m_Italic = aSource.m_Italic; - m_Bold = aSource.m_Bold; - m_Width = aSource.m_Width; + m_Orient = aSource.m_Orient; + m_Size = aSource.m_Size; + m_HJustify = aSource.m_HJustify; + m_VJustify = aSource.m_VJustify; + m_Italic = aSource.m_Italic; + m_Bold = aSource.m_Bold; + m_Width = aSource.m_Width; m_Attributs = aSource.m_Attributs; - m_Mirror = aSource.m_Mirror; + m_Mirror = aSource.m_Mirror; } /** diff --git a/eeschema/class_sch_cmp_field.h b/eeschema/class_sch_cmp_field.h index f19f243ba1..062f92a421 100644 --- a/eeschema/class_sch_cmp_field.h +++ b/eeschema/class_sch_cmp_field.h @@ -15,6 +15,7 @@ class SCH_COMPONENT; +class LIB_FIELD; /** @@ -23,7 +24,7 @@ class SCH_COMPONENT; * reference designator, footprint, and user definable name-value pairs of * arbitrary purpose. */ -class SCH_CMP_FIELD : public SCH_ITEM, public EDA_TextStruct +class SCH_CMP_FIELD : public SCH_ITEM, public EDA_TextStruct { public: int m_FieldId; // Field indicator type (REFERENCE, VALUE or other id) @@ -53,9 +54,9 @@ public: /** Function ImportValues * copy parameters from a source. * Pointers and specific values (position) are not copied - * @param aSource = the LibDrawField to read + * @param aSource = the LIB_FIELD to read */ - void ImportValues( const LibDrawField& aSource ); + void ImportValues( const LIB_FIELD& aSource ); /** Function GetPenSize * @return the size of the "pen" that be used to draw or plot this item diff --git a/eeschema/class_sch_component.cpp b/eeschema/class_sch_component.cpp index cc10191c9f..ab366173b5 100644 --- a/eeschema/class_sch_component.cpp +++ b/eeschema/class_sch_component.cpp @@ -35,12 +35,12 @@ void CreateDummyCmp() { DummyCmp = new LIB_COMPONENT( wxEmptyString ); - LibDrawSquare* Square = new LibDrawSquare(DummyCmp); + LIB_RECTANGLE* Square = new LIB_RECTANGLE(DummyCmp); Square->m_Pos = wxPoint( -200, 200 ); Square->m_End = wxPoint( 200, -200 ); - LibDrawText* Text = new LibDrawText(DummyCmp); + LIB_TEXT* Text = new LIB_TEXT(DummyCmp); Text->m_Size.x = Text->m_Size.y = 150; Text->m_Text = wxT( "??" ); diff --git a/eeschema/classes_body_items.cpp b/eeschema/classes_body_items.cpp index 520112dd36..0ff501c6be 100644 --- a/eeschema/classes_body_items.cpp +++ b/eeschema/classes_body_items.cpp @@ -60,14 +60,14 @@ void LIB_DRAW_ITEM::DisplayInfo( WinEDA_DrawFrame* frame ) frame->MsgPanel->EraseMsgBox(); - frame->MsgPanel->Affiche_1_Parametre( 1, _( "Type" ), m_typeName, CYAN ); + frame->MsgPanel->AppendMessage( _( "Type" ), m_typeName, CYAN ); /* Affichage de l'appartenance */ if( m_Unit == 0 ) msg = _( "All" ); else msg.Printf( wxT( "%d" ), m_Unit ); - Affiche_1_Parametre( frame, 8, _( "Unit" ), msg, BROWN ); + frame->MsgPanel->AppendMessage( _( "Unit" ), msg, BROWN ); if( m_Convert == 0 ) msg = _( "All" ); @@ -77,7 +77,7 @@ void LIB_DRAW_ITEM::DisplayInfo( WinEDA_DrawFrame* frame ) msg = _( "yes" ); else msg = wxT( "?" ); - Affiche_1_Parametre( frame, 14, _( "Convert" ), msg, BROWN ); + frame->MsgPanel->AppendMessage( _( "Convert" ), msg, BROWN ); } @@ -112,10 +112,10 @@ bool LIB_DRAW_ITEM::operator<( const LIB_DRAW_ITEM& other ) const /**********************/ -/** class LibDrawArc **/ +/** class LIB_ARC **/ /**********************/ -LibDrawArc::LibDrawArc( LIB_COMPONENT* aParent ) : +LIB_ARC::LIB_ARC( LIB_COMPONENT* aParent ) : LIB_DRAW_ITEM( COMPONENT_ARC_DRAW_TYPE, aParent ) { m_Radius = 0; @@ -127,7 +127,7 @@ LibDrawArc::LibDrawArc( LIB_COMPONENT* aParent ) : } -LibDrawArc::LibDrawArc( const LibDrawArc& arc ) : LIB_DRAW_ITEM( arc ) +LIB_ARC::LIB_ARC( const LIB_ARC& arc ) : LIB_DRAW_ITEM( arc ) { m_Radius = arc.m_Radius; m_t1 = arc.m_t1; @@ -145,7 +145,7 @@ LibDrawArc::LibDrawArc( const LibDrawArc& arc ) : LIB_DRAW_ITEM( arc ) * A centre_posx centre_posy rayon start_angle end_angle unit convert * fill('N', 'F' ou 'f') startx starty endx endy */ -bool LibDrawArc::Save( FILE* ExportFile ) const +bool LIB_ARC::Save( FILE* ExportFile ) const { int x1 = m_t1; @@ -167,7 +167,7 @@ bool LibDrawArc::Save( FILE* ExportFile ) const } -bool LibDrawArc::Load( char* line, wxString& errorMsg ) +bool LIB_ARC::Load( char* line, wxString& errorMsg ) { int startx, starty, endx, endy, cnt; char tmp[256]; @@ -224,7 +224,7 @@ bool LibDrawArc::Load( char* line, wxString& errorMsg ) * @param aRefPoint A wxPoint to test in eeschema space * @return bool - true if a hit, else false */ -bool LibDrawArc::HitTest( const wxPoint& aRefPoint ) +bool LIB_ARC::HitTest( const wxPoint& aRefPoint ) { int mindist = m_Width ? m_Width / 2 : g_DrawDefaultLineThickness / 2; @@ -243,8 +243,8 @@ bool LibDrawArc::HitTest( const wxPoint& aRefPoint ) * of a line) * @param aTransMat = the transform matrix */ -bool LibDrawArc::HitTest( wxPoint aRefPoint, int aThreshold, - const int aTransMat[2][2] ) +bool LIB_ARC::HitTest( wxPoint aRefPoint, int aThreshold, + const int aTransMat[2][2] ) { // TODO: use aTransMat to calculmates parameters wxPoint relpos = aRefPoint; @@ -278,9 +278,9 @@ bool LibDrawArc::HitTest( wxPoint aRefPoint, int aThreshold, } -LIB_DRAW_ITEM* LibDrawArc::DoGenCopy() +LIB_DRAW_ITEM* LIB_ARC::DoGenCopy() { - LibDrawArc* newitem = new LibDrawArc( GetParent() ); + LIB_ARC* newitem = new LIB_ARC( GetParent() ); newitem->m_Pos = m_Pos; newitem->m_ArcStart = m_ArcStart; @@ -298,11 +298,11 @@ LIB_DRAW_ITEM* LibDrawArc::DoGenCopy() } -int LibDrawArc::DoCompare( const LIB_DRAW_ITEM& other ) const +int LIB_ARC::DoCompare( const LIB_DRAW_ITEM& other ) const { wxASSERT( other.Type() == COMPONENT_ARC_DRAW_TYPE ); - const LibDrawArc* tmp = ( LibDrawArc* ) &other; + const LIB_ARC* tmp = ( LIB_ARC* ) &other; if( m_Pos.x != tmp->m_Pos.x ) return m_Pos.x - tmp->m_Pos.x; @@ -320,7 +320,7 @@ int LibDrawArc::DoCompare( const LIB_DRAW_ITEM& other ) const } -void LibDrawArc::DoOffset( const wxPoint& offset ) +void LIB_ARC::DoOffset( const wxPoint& offset ) { m_Pos += offset; m_ArcStart += offset; @@ -328,14 +328,14 @@ void LibDrawArc::DoOffset( const wxPoint& offset ) } -bool LibDrawArc::DoTestInside( EDA_Rect& rect ) +bool LIB_ARC::DoTestInside( EDA_Rect& rect ) { return rect.Inside( m_ArcStart.x, -m_ArcStart.y ) || rect.Inside( m_ArcEnd.x, -m_ArcEnd.y ); } -void LibDrawArc::DoMove( const wxPoint& newPosition ) +void LIB_ARC::DoMove( const wxPoint& newPosition ) { wxPoint offset = newPosition - m_Pos; m_Pos = newPosition; @@ -344,7 +344,7 @@ void LibDrawArc::DoMove( const wxPoint& newPosition ) } -void LibDrawArc::DoMirrorHorizontal( const wxPoint& center ) +void LIB_ARC::DoMirrorHorizontal( const wxPoint& center ) { m_Pos.x -= center.x; m_Pos.x *= -1; @@ -359,8 +359,8 @@ void LibDrawArc::DoMirrorHorizontal( const wxPoint& center ) } -void LibDrawArc::DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, - const int transform[2][2] ) +void LIB_ARC::DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, + const int transform[2][2] ) { wxASSERT( plotter != NULL ); @@ -384,16 +384,15 @@ void LibDrawArc::DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, /** Function GetPenSize * @return the size of the "pen" that be used to draw or plot this item */ -int LibDrawArc::GetPenSize() +int LIB_ARC::GetPenSize() { return ( m_Width == 0 ) ? g_DrawDefaultLineThickness : m_Width; } -void LibDrawArc::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, - const wxPoint& aOffset, int aColor, - int aDrawMode, void* aData, - const int aTransformMatrix[2][2] ) +void LIB_ARC::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, + const wxPoint& aOffset, int aColor, int aDrawMode, + void* aData, const int aTransformMatrix[2][2] ) { wxPoint pos1, pos2, posc; @@ -455,7 +454,7 @@ void LibDrawArc::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, } -EDA_Rect LibDrawArc::GetBoundingBox() +EDA_Rect LIB_ARC::GetBoundingBox() { int minX, minY, maxX, maxY, angleStart, angleEnd; EDA_Rect rect; @@ -516,7 +515,7 @@ start(%d, %d), end(%d, %d), radius %d" ), } -void LibDrawArc::DisplayInfo( WinEDA_DrawFrame* frame ) +void LIB_ARC::DisplayInfo( WinEDA_DrawFrame* frame ) { wxString msg; EDA_Rect bBox = GetBoundingBox(); @@ -526,20 +525,20 @@ void LibDrawArc::DisplayInfo( WinEDA_DrawFrame* frame ) msg = ReturnStringFromValue( g_UnitMetric, m_Width, EESCHEMA_INTERNAL_UNIT, true ); - frame->MsgPanel->Affiche_1_Parametre( 20, _( "Line width" ), msg, BLUE ); + frame->MsgPanel->AppendMessage( _( "Line width" ), msg, BLUE ); msg.Printf( wxT( "(%d, %d, %d, %d)" ), bBox.GetOrigin().x, bBox.GetOrigin().y, bBox.GetEnd().x, bBox.GetEnd().y ); - frame->MsgPanel->Affiche_1_Parametre( 40, _( "Bounding box" ), msg, BROWN ); + frame->MsgPanel->AppendMessage( _( "Bounding box" ), msg, BROWN ); } /*************************/ -/** class LibDrawCircle **/ +/** class LIB_CIRCLE **/ /*************************/ -LibDrawCircle::LibDrawCircle( LIB_COMPONENT* aParent ) : +LIB_CIRCLE::LIB_CIRCLE( LIB_COMPONENT* aParent ) : LIB_DRAW_ITEM( COMPONENT_CIRCLE_DRAW_TYPE, aParent ) { m_Radius = 0; @@ -548,7 +547,7 @@ LibDrawCircle::LibDrawCircle( LIB_COMPONENT* aParent ) : } -LibDrawCircle::LibDrawCircle( const LibDrawCircle& circle ) : +LIB_CIRCLE::LIB_CIRCLE( const LIB_CIRCLE& circle ) : LIB_DRAW_ITEM( circle ) { m_Pos = circle.m_Pos; @@ -557,7 +556,7 @@ LibDrawCircle::LibDrawCircle( const LibDrawCircle& circle ) : } -bool LibDrawCircle::Save( FILE* ExportFile ) const +bool LIB_CIRCLE::Save( FILE* ExportFile ) const { if( fprintf( ExportFile, "C %d %d %d %d %d %d %c\n", m_Pos.x, m_Pos.y, m_Radius, m_Unit, m_Convert, m_Width, fill_tab[m_Fill] ) < 0 ) @@ -567,7 +566,7 @@ bool LibDrawCircle::Save( FILE* ExportFile ) const } -bool LibDrawCircle::Load( char* line, wxString& errorMsg ) +bool LIB_CIRCLE::Load( char* line, wxString& errorMsg ) { char tmp[256]; @@ -596,7 +595,7 @@ bool LibDrawCircle::Load( char* line, wxString& errorMsg ) * @param aRefPos A wxPoint to test in eeschema space * @return bool - true if a hit, else false */ -bool LibDrawCircle::HitTest( const wxPoint& aPosRef ) +bool LIB_CIRCLE::HitTest( const wxPoint& aPosRef ) { int mindist = m_Width ? m_Width / 2 : g_DrawDefaultLineThickness / 2; @@ -615,7 +614,7 @@ bool LibDrawCircle::HitTest( const wxPoint& aPosRef ) * thickness of a line) * @param aTransMat = the transform matrix */ -bool LibDrawCircle::HitTest( wxPoint aPosRef, int aThreshold, +bool LIB_CIRCLE::HitTest( wxPoint aPosRef, int aThreshold, const int aTransMat[2][2] ) { wxPoint relpos = aPosRef - TransformCoordinate( aTransMat, m_Pos ); @@ -630,9 +629,9 @@ bool LibDrawCircle::HitTest( wxPoint aPosRef, int aThreshold, } -LIB_DRAW_ITEM* LibDrawCircle::DoGenCopy() +LIB_DRAW_ITEM* LIB_CIRCLE::DoGenCopy() { - LibDrawCircle* newitem = new LibDrawCircle( GetParent() ); + LIB_CIRCLE* newitem = new LIB_CIRCLE( GetParent() ); newitem->m_Pos = m_Pos; newitem->m_Radius = m_Radius; @@ -646,11 +645,11 @@ LIB_DRAW_ITEM* LibDrawCircle::DoGenCopy() } -int LibDrawCircle::DoCompare( const LIB_DRAW_ITEM& other ) const +int LIB_CIRCLE::DoCompare( const LIB_DRAW_ITEM& other ) const { wxASSERT( other.Type() == COMPONENT_CIRCLE_DRAW_TYPE ); - const LibDrawCircle* tmp = ( LibDrawCircle* ) &other; + const LIB_CIRCLE* tmp = ( LIB_CIRCLE* ) &other; if( m_Pos.x != tmp->m_Pos.x ) return m_Pos.x - tmp->m_Pos.x; @@ -665,13 +664,13 @@ int LibDrawCircle::DoCompare( const LIB_DRAW_ITEM& other ) const } -void LibDrawCircle::DoOffset( const wxPoint& offset ) +void LIB_CIRCLE::DoOffset( const wxPoint& offset ) { m_Pos += offset; } -bool LibDrawCircle::DoTestInside( EDA_Rect& rect ) +bool LIB_CIRCLE::DoTestInside( EDA_Rect& rect ) { /* * FIXME: This fails to take into acount the radius around the center @@ -681,13 +680,13 @@ bool LibDrawCircle::DoTestInside( EDA_Rect& rect ) } -void LibDrawCircle::DoMove( const wxPoint& newPosition ) +void LIB_CIRCLE::DoMove( const wxPoint& newPosition ) { m_Pos = newPosition; } -void LibDrawCircle::DoMirrorHorizontal( const wxPoint& center ) +void LIB_CIRCLE::DoMirrorHorizontal( const wxPoint& center ) { m_Pos.x -= center.x; m_Pos.x *= -1; @@ -695,8 +694,8 @@ void LibDrawCircle::DoMirrorHorizontal( const wxPoint& center ) } -void LibDrawCircle::DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, - const int transform[2][2] ) +void LIB_CIRCLE::DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, + const int transform[2][2] ) { wxPoint pos = TransformCoordinate( transform, m_Pos ) + offset; @@ -714,15 +713,15 @@ void LibDrawCircle::DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, /** Function GetPenSize * @return the size of the "pen" that be used to draw or plot this item */ -int LibDrawCircle::GetPenSize() +int LIB_CIRCLE::GetPenSize() { return ( m_Width == 0 ) ? g_DrawDefaultLineThickness : m_Width; } -void LibDrawCircle::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, - const wxPoint& aOffset, int aColor, int aDrawMode, - void* aData, const int aTransformMatrix[2][2] ) +void LIB_CIRCLE::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, + const wxPoint& aOffset, int aColor, int aDrawMode, + void* aData, const int aTransformMatrix[2][2] ) { wxPoint pos1; @@ -764,7 +763,7 @@ void LibDrawCircle::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, } -EDA_Rect LibDrawCircle::GetBoundingBox() +EDA_Rect LIB_CIRCLE::GetBoundingBox() { EDA_Rect rect; @@ -776,7 +775,7 @@ EDA_Rect LibDrawCircle::GetBoundingBox() } -void LibDrawCircle::DisplayInfo( WinEDA_DrawFrame* frame ) +void LIB_CIRCLE::DisplayInfo( WinEDA_DrawFrame* frame ) { wxString msg; EDA_Rect bBox = GetBoundingBox(); @@ -786,24 +785,24 @@ void LibDrawCircle::DisplayInfo( WinEDA_DrawFrame* frame ) msg = ReturnStringFromValue( g_UnitMetric, m_Width, EESCHEMA_INTERNAL_UNIT, true ); - frame->MsgPanel->Affiche_1_Parametre( 20, _( "Line width" ), msg, BLUE ); + frame->MsgPanel->AppendMessage( _( "Line width" ), msg, BLUE ); msg = ReturnStringFromValue( g_UnitMetric, m_Radius, EESCHEMA_INTERNAL_UNIT, true ); - frame->MsgPanel->Affiche_1_Parametre( 40, _( "Radius" ), msg, RED ); + frame->MsgPanel->AppendMessage( _( "Radius" ), msg, RED ); msg.Printf( wxT( "(%d, %d, %d, %d)" ), bBox.GetOrigin().x, bBox.GetOrigin().y, bBox.GetEnd().x, bBox.GetEnd().y ); - frame->MsgPanel->Affiche_1_Parametre( 60, _( "Bounding box" ), msg, BROWN ); + frame->MsgPanel->AppendMessage( _( "Bounding box" ), msg, BROWN ); } /*************************/ -/** class LibDrawSquare **/ +/** class LIB_RECTANGLE **/ /*************************/ -LibDrawSquare::LibDrawSquare( LIB_COMPONENT* aParent ) : +LIB_RECTANGLE::LIB_RECTANGLE( LIB_COMPONENT* aParent ) : LIB_DRAW_ITEM( COMPONENT_RECT_DRAW_TYPE, aParent ) { m_Width = 0; @@ -812,7 +811,7 @@ LibDrawSquare::LibDrawSquare( LIB_COMPONENT* aParent ) : } -LibDrawSquare::LibDrawSquare( const LibDrawSquare& rect ) : +LIB_RECTANGLE::LIB_RECTANGLE( const LIB_RECTANGLE& rect ) : LIB_DRAW_ITEM( rect ) { m_Pos = rect.m_Pos; @@ -822,7 +821,7 @@ LibDrawSquare::LibDrawSquare( const LibDrawSquare& rect ) : } -bool LibDrawSquare::Save( FILE* ExportFile ) const +bool LIB_RECTANGLE::Save( FILE* ExportFile ) const { if( fprintf( ExportFile, "S %d %d %d %d %d %d %d %c\n", m_Pos.x, m_Pos.y, m_End.x, m_End.y, m_Unit, m_Convert, m_Width, @@ -833,7 +832,7 @@ bool LibDrawSquare::Save( FILE* ExportFile ) const } -bool LibDrawSquare::Load( char* line, wxString& errorMsg ) +bool LIB_RECTANGLE::Load( char* line, wxString& errorMsg ) { int cnt; char tmp[256]; @@ -857,9 +856,9 @@ bool LibDrawSquare::Load( char* line, wxString& errorMsg ) } -LIB_DRAW_ITEM* LibDrawSquare::DoGenCopy() +LIB_DRAW_ITEM* LIB_RECTANGLE::DoGenCopy() { - LibDrawSquare* newitem = new LibDrawSquare( GetParent() ); + LIB_RECTANGLE* newitem = new LIB_RECTANGLE( GetParent() ); newitem->m_Pos = m_Pos; newitem->m_End = m_End; @@ -873,11 +872,11 @@ LIB_DRAW_ITEM* LibDrawSquare::DoGenCopy() } -int LibDrawSquare::DoCompare( const LIB_DRAW_ITEM& other ) const +int LIB_RECTANGLE::DoCompare( const LIB_DRAW_ITEM& other ) const { wxASSERT( other.Type() == COMPONENT_RECT_DRAW_TYPE ); - const LibDrawSquare* tmp = ( LibDrawSquare* ) &other; + const LIB_RECTANGLE* tmp = ( LIB_RECTANGLE* ) &other; if( m_Pos.x != tmp->m_Pos.x ) return m_Pos.x - tmp->m_Pos.x; @@ -895,20 +894,20 @@ int LibDrawSquare::DoCompare( const LIB_DRAW_ITEM& other ) const } -void LibDrawSquare::DoOffset( const wxPoint& offset ) +void LIB_RECTANGLE::DoOffset( const wxPoint& offset ) { m_Pos += offset; m_End += offset; } -bool LibDrawSquare::DoTestInside( EDA_Rect& rect ) +bool LIB_RECTANGLE::DoTestInside( EDA_Rect& rect ) { return rect.Inside( m_Pos.x, -m_Pos.y ) || rect.Inside( m_End.x, -m_End.y ); } -void LibDrawSquare::DoMove( const wxPoint& newPosition ) +void LIB_RECTANGLE::DoMove( const wxPoint& newPosition ) { wxPoint size = m_End - m_Pos; m_Pos = newPosition; @@ -916,7 +915,7 @@ void LibDrawSquare::DoMove( const wxPoint& newPosition ) } -void LibDrawSquare::DoMirrorHorizontal( const wxPoint& center ) +void LIB_RECTANGLE::DoMirrorHorizontal( const wxPoint& center ) { m_Pos.x -= center.x; m_Pos.x *= -1; @@ -927,7 +926,7 @@ void LibDrawSquare::DoMirrorHorizontal( const wxPoint& center ) } -void LibDrawSquare::DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, +void LIB_RECTANGLE::DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, const int transform[2][2] ) { wxASSERT( plotter != NULL ); @@ -949,12 +948,12 @@ void LibDrawSquare::DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, /** Function GetPenSize * @return the size of the "pen" that be used to draw or plot this item */ -int LibDrawSquare::GetPenSize() +int LIB_RECTANGLE::GetPenSize() { return ( m_Width == 0 ) ? g_DrawDefaultLineThickness : m_Width; } -void LibDrawSquare::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, +void LIB_RECTANGLE::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOffset, int aColor, int aDrawMode, void* aData, const int aTransformMatrix[2][2] ) { @@ -1001,7 +1000,7 @@ void LibDrawSquare::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, } -void LibDrawSquare::DisplayInfo( WinEDA_DrawFrame* frame ) +void LIB_RECTANGLE::DisplayInfo( WinEDA_DrawFrame* frame ) { wxString msg; @@ -1010,11 +1009,11 @@ void LibDrawSquare::DisplayInfo( WinEDA_DrawFrame* frame ) msg = ReturnStringFromValue( g_UnitMetric, m_Width, EESCHEMA_INTERNAL_UNIT, true ); - frame->MsgPanel->Affiche_1_Parametre( 20, _( "Line width" ), msg, BLUE ); + frame->MsgPanel->AppendMessage( _( "Line width" ), msg, BLUE ); } -EDA_Rect LibDrawSquare::GetBoundingBox() +EDA_Rect LIB_RECTANGLE::GetBoundingBox() { EDA_Rect rect; @@ -1031,7 +1030,7 @@ EDA_Rect LibDrawSquare::GetBoundingBox() * @param aRefPoint A wxPoint to test in eeschema space * @return bool - true if a hit, else false */ -bool LibDrawSquare::HitTest( const wxPoint& aRefPoint ) +bool LIB_RECTANGLE::HitTest( const wxPoint& aRefPoint ) { int mindist = (m_Width ? m_Width / 2 : g_DrawDefaultLineThickness / 2) + 1; @@ -1050,7 +1049,7 @@ bool LibDrawSquare::HitTest( const wxPoint& aRefPoint ) * of a line) * @param aTransMat = the transform matrix */ -bool LibDrawSquare::HitTest( wxPoint aRefPoint, int aThreshold, +bool LIB_RECTANGLE::HitTest( wxPoint aRefPoint, int aThreshold, const int aTransMat[2][2] ) { wxPoint actualStart = TransformCoordinate( aTransMat, m_Pos ); @@ -1088,9 +1087,9 @@ bool LibDrawSquare::HitTest( wxPoint aRefPoint, int aThreshold, /**************************/ -/** class LibDrawSegment **/ +/** class LIB_SEGMENT **/ /**************************/ -LibDrawSegment::LibDrawSegment( LIB_COMPONENT* aParent ) : +LIB_SEGMENT::LIB_SEGMENT( LIB_COMPONENT* aParent ) : LIB_DRAW_ITEM( COMPONENT_LINE_DRAW_TYPE, aParent ) { m_Width = 0; @@ -1098,7 +1097,7 @@ LibDrawSegment::LibDrawSegment( LIB_COMPONENT* aParent ) : } -LibDrawSegment::LibDrawSegment( const LibDrawSegment& segment ) : +LIB_SEGMENT::LIB_SEGMENT( const LIB_SEGMENT& segment ) : LIB_DRAW_ITEM( segment ) { m_Pos = segment.m_Pos; @@ -1107,7 +1106,7 @@ LibDrawSegment::LibDrawSegment( const LibDrawSegment& segment ) : } -bool LibDrawSegment::Save( FILE* ExportFile ) const +bool LIB_SEGMENT::Save( FILE* ExportFile ) const { if( fprintf( ExportFile, "L %d %d %d", m_Unit, m_Convert, m_Width ) ) return false; @@ -1116,15 +1115,15 @@ bool LibDrawSegment::Save( FILE* ExportFile ) const } -bool LibDrawSegment::Load( char* line, wxString& errorMsg ) +bool LIB_SEGMENT::Load( char* line, wxString& errorMsg ) { return true; } -LIB_DRAW_ITEM* LibDrawSegment::DoGenCopy() +LIB_DRAW_ITEM* LIB_SEGMENT::DoGenCopy() { - LibDrawSegment* newitem = new LibDrawSegment( GetParent() ); + LIB_SEGMENT* newitem = new LIB_SEGMENT( GetParent() ); newitem->m_Pos = m_Pos; newitem->m_End = m_End; @@ -1137,11 +1136,11 @@ LIB_DRAW_ITEM* LibDrawSegment::DoGenCopy() } -int LibDrawSegment::DoCompare( const LIB_DRAW_ITEM& other ) const +int LIB_SEGMENT::DoCompare( const LIB_DRAW_ITEM& other ) const { wxASSERT( other.Type() == COMPONENT_LINE_DRAW_TYPE ); - const LibDrawSegment* tmp = ( LibDrawSegment* ) &other; + const LIB_SEGMENT* tmp = ( LIB_SEGMENT* ) &other; if( m_Pos.x != tmp->m_Pos.x ) return m_Pos.x - tmp->m_Pos.x; @@ -1159,20 +1158,20 @@ int LibDrawSegment::DoCompare( const LIB_DRAW_ITEM& other ) const } -void LibDrawSegment::DoOffset( const wxPoint& offset ) +void LIB_SEGMENT::DoOffset( const wxPoint& offset ) { m_Pos += offset; m_End += offset; } -bool LibDrawSegment::DoTestInside( EDA_Rect& rect ) +bool LIB_SEGMENT::DoTestInside( EDA_Rect& rect ) { return rect.Inside( m_Pos.x, -m_Pos.y ) || rect.Inside( m_End.x, -m_End.y ); } -void LibDrawSegment::DoMove( const wxPoint& newPosition ) +void LIB_SEGMENT::DoMove( const wxPoint& newPosition ) { wxPoint offset = newPosition - m_Pos; m_Pos += offset; @@ -1180,7 +1179,7 @@ void LibDrawSegment::DoMove( const wxPoint& newPosition ) } -void LibDrawSegment::DoMirrorHorizontal( const wxPoint& center ) +void LIB_SEGMENT::DoMirrorHorizontal( const wxPoint& center ) { m_Pos.x -= center.x; m_Pos.x *= -1; @@ -1191,8 +1190,8 @@ void LibDrawSegment::DoMirrorHorizontal( const wxPoint& center ) } -void LibDrawSegment::DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, - const int transform[2][2] ) +void LIB_SEGMENT::DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, + const int transform[2][2] ) { wxASSERT( plotter != NULL ); @@ -1211,14 +1210,14 @@ void LibDrawSegment::DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, /** Function GetPenSize * @return the size of the "pen" that be used to draw or plot this item */ -int LibDrawSegment::GetPenSize() +int LIB_SEGMENT::GetPenSize() { return ( m_Width == 0 ) ? g_DrawDefaultLineThickness : m_Width; } -void LibDrawSegment::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, - const wxPoint& aOffset, int aColor, int aDrawMode, - void* aData, const int aTransformMatrix[2][2] ) +void LIB_SEGMENT::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, + const wxPoint& aOffset, int aColor, int aDrawMode, + void* aData, const int aTransformMatrix[2][2] ) { wxPoint pos1, pos2; @@ -1251,7 +1250,7 @@ void LibDrawSegment::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, } -void LibDrawSegment::DisplayInfo( WinEDA_DrawFrame* frame ) +void LIB_SEGMENT::DisplayInfo( WinEDA_DrawFrame* frame ) { wxString msg; EDA_Rect bBox = GetBoundingBox(); @@ -1261,12 +1260,12 @@ void LibDrawSegment::DisplayInfo( WinEDA_DrawFrame* frame ) msg = ReturnStringFromValue( g_UnitMetric, m_Width, EESCHEMA_INTERNAL_UNIT, true ); - frame->MsgPanel->Affiche_1_Parametre( 20, _( "Line width" ), msg, BLUE ); + frame->MsgPanel->AppendMessage( _( "Line width" ), msg, BLUE ); msg.Printf( wxT( "(%d, %d, %d, %d)" ), bBox.GetOrigin().x, bBox.GetOrigin().y, bBox.GetEnd().x, bBox.GetEnd().y ); - frame->MsgPanel->Affiche_1_Parametre( 60, _( "Bounding box" ), msg, BROWN ); + frame->MsgPanel->AppendMessage( _( "Bounding box" ), msg, BROWN ); } @@ -1276,7 +1275,7 @@ void LibDrawSegment::DisplayInfo( WinEDA_DrawFrame* frame ) * @param aRefPos A wxPoint to test * @return bool - true if a hit, else false */ -bool LibDrawSegment::HitTest( const wxPoint& aPosRef ) +bool LIB_SEGMENT::HitTest( const wxPoint& aPosRef ) { int mindist = m_Width ? m_Width / 2 : g_DrawDefaultLineThickness / 2; @@ -1295,8 +1294,8 @@ bool LibDrawSegment::HitTest( const wxPoint& aPosRef ) * thickness of a line) * @param aTransMat = the transform matrix */ -bool LibDrawSegment::HitTest( wxPoint aPosRef, int aThreshold, - const int aTransMat[2][2] ) +bool LIB_SEGMENT::HitTest( wxPoint aPosRef, int aThreshold, + const int aTransMat[2][2] ) { wxPoint start = TransformCoordinate( aTransMat, m_Pos ); wxPoint end = TransformCoordinate( aTransMat, m_End ); @@ -1306,9 +1305,9 @@ bool LibDrawSegment::HitTest( wxPoint aPosRef, int aThreshold, /***************************/ -/** class LibDrawPolyline **/ +/** class LIB_POLYLINE **/ /***************************/ -LibDrawPolyline::LibDrawPolyline( LIB_COMPONENT* aParent ) : +LIB_POLYLINE::LIB_POLYLINE( LIB_COMPONENT* aParent ) : LIB_DRAW_ITEM( COMPONENT_POLYLINE_DRAW_TYPE, aParent ) { m_Fill = NO_FILL; @@ -1317,7 +1316,7 @@ LibDrawPolyline::LibDrawPolyline( LIB_COMPONENT* aParent ) : } -LibDrawPolyline::LibDrawPolyline( const LibDrawPolyline& polyline ) : +LIB_POLYLINE::LIB_POLYLINE( const LIB_POLYLINE& polyline ) : LIB_DRAW_ITEM( polyline ) { m_PolyPoints = polyline.m_PolyPoints; // Vector copy @@ -1326,7 +1325,7 @@ LibDrawPolyline::LibDrawPolyline( const LibDrawPolyline& polyline ) : } -bool LibDrawPolyline::Save( FILE* ExportFile ) const +bool LIB_POLYLINE::Save( FILE* ExportFile ) const { int ccount = GetCornerCount(); @@ -1348,7 +1347,7 @@ bool LibDrawPolyline::Save( FILE* ExportFile ) const } -bool LibDrawPolyline::Load( char* line, wxString& errorMsg ) +bool LIB_POLYLINE::Load( char* line, wxString& errorMsg ) { char* p; int i, ccount = 0; @@ -1408,9 +1407,9 @@ bool LibDrawPolyline::Load( char* line, wxString& errorMsg ) } -LIB_DRAW_ITEM* LibDrawPolyline::DoGenCopy() +LIB_DRAW_ITEM* LIB_POLYLINE::DoGenCopy() { - LibDrawPolyline* newitem = new LibDrawPolyline( GetParent() ); + LIB_POLYLINE* newitem = new LIB_POLYLINE( GetParent() ); newitem->m_PolyPoints = m_PolyPoints; // Vector copy newitem->m_Width = m_Width; @@ -1423,11 +1422,11 @@ LIB_DRAW_ITEM* LibDrawPolyline::DoGenCopy() } -int LibDrawPolyline::DoCompare( const LIB_DRAW_ITEM& other ) const +int LIB_POLYLINE::DoCompare( const LIB_DRAW_ITEM& other ) const { wxASSERT( other.Type() == COMPONENT_POLYLINE_DRAW_TYPE ); - const LibDrawPolyline* tmp = ( LibDrawPolyline* ) &other; + const LIB_POLYLINE* tmp = ( LIB_POLYLINE* ) &other; if( m_PolyPoints.size() != tmp->m_PolyPoints.size() ) return m_PolyPoints.size() - tmp->m_PolyPoints.size(); @@ -1444,14 +1443,14 @@ int LibDrawPolyline::DoCompare( const LIB_DRAW_ITEM& other ) const } -void LibDrawPolyline::DoOffset( const wxPoint& offset ) +void LIB_POLYLINE::DoOffset( const wxPoint& offset ) { for( size_t i = 0; i < m_PolyPoints.size(); i++ ) m_PolyPoints[i] += offset; } -bool LibDrawPolyline::DoTestInside( EDA_Rect& rect ) +bool LIB_POLYLINE::DoTestInside( EDA_Rect& rect ) { for( size_t i = 0; i < m_PolyPoints.size(); i++ ) { @@ -1463,13 +1462,13 @@ bool LibDrawPolyline::DoTestInside( EDA_Rect& rect ) } -void LibDrawPolyline::DoMove( const wxPoint& newPosition ) +void LIB_POLYLINE::DoMove( const wxPoint& newPosition ) { DoOffset( newPosition - m_PolyPoints[0] ); } -void LibDrawPolyline::DoMirrorHorizontal( const wxPoint& center ) +void LIB_POLYLINE::DoMirrorHorizontal( const wxPoint& center ) { size_t i, imax = m_PolyPoints.size(); @@ -1482,8 +1481,8 @@ void LibDrawPolyline::DoMirrorHorizontal( const wxPoint& center ) } -void LibDrawPolyline::DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, - const int transform[2][2] ) +void LIB_POLYLINE::DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, + const int transform[2][2] ) { wxASSERT( plotter != NULL ); @@ -1511,7 +1510,7 @@ void LibDrawPolyline::DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill } -void LibDrawPolyline::AddPoint( const wxPoint& point ) +void LIB_POLYLINE::AddPoint( const wxPoint& point ) { m_PolyPoints.push_back( point ); } @@ -1520,14 +1519,14 @@ void LibDrawPolyline::AddPoint( const wxPoint& point ) /** Function GetPenSize * @return the size of the "pen" that be used to draw or plot this item */ -int LibDrawPolyline::GetPenSize() +int LIB_POLYLINE::GetPenSize() { return ( m_Width == 0 ) ? g_DrawDefaultLineThickness : m_Width; } -void LibDrawPolyline::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, - const wxPoint& aOffset, int aColor, int aDrawMode, - void* aData, const int aTransformMatrix[2][2] ) +void LIB_POLYLINE::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, + const wxPoint& aOffset, int aColor, int aDrawMode, + void* aData, const int aTransformMatrix[2][2] ) { wxPoint pos1; int color = ReturnLayerColor( LAYER_DEVICE ); @@ -1599,7 +1598,7 @@ void LibDrawPolyline::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, * @param aRefPos A wxPoint to test * @return bool - true if a hit, else false */ -bool LibDrawPolyline::HitTest( const wxPoint& aRefPos ) +bool LIB_POLYLINE::HitTest( const wxPoint& aRefPos ) { int mindist = m_Width ? m_Width / 2 : g_DrawDefaultLineThickness / 2; @@ -1616,7 +1615,7 @@ bool LibDrawPolyline::HitTest( const wxPoint& aRefPos ) * @param aThreshold = max distance to a segment * @param aTransMat = the transform matrix */ -bool LibDrawPolyline::HitTest( wxPoint aPosRef, int aThreshold, +bool LIB_POLYLINE::HitTest( wxPoint aPosRef, int aThreshold, const int aTransMat[2][2] ) { wxPoint ref, start, end; @@ -1637,7 +1636,7 @@ bool LibDrawPolyline::HitTest( wxPoint aPosRef, int aThreshold, /** Function GetBoundingBox * @return the boundary box for this, in library coordinates */ -EDA_Rect LibDrawPolyline::GetBoundingBox() +EDA_Rect LIB_POLYLINE::GetBoundingBox() { EDA_Rect rect; int xmin, xmax, ymin, ymax; @@ -1661,7 +1660,7 @@ EDA_Rect LibDrawPolyline::GetBoundingBox() } -void LibDrawPolyline::DisplayInfo( WinEDA_DrawFrame* frame ) +void LIB_POLYLINE::DisplayInfo( WinEDA_DrawFrame* frame ) { wxString msg; EDA_Rect bBox = GetBoundingBox(); @@ -1671,18 +1670,18 @@ void LibDrawPolyline::DisplayInfo( WinEDA_DrawFrame* frame ) msg = ReturnStringFromValue( g_UnitMetric, m_Width, EESCHEMA_INTERNAL_UNIT, true ); - frame->MsgPanel->Affiche_1_Parametre( 20, _( "Line width" ), msg, BLUE ); + frame->MsgPanel->AppendMessage( _( "Line width" ), msg, BLUE ); msg.Printf( wxT( "(%d, %d, %d, %d)" ), bBox.GetOrigin().x, bBox.GetOrigin().y, bBox.GetEnd().x, bBox.GetEnd().y ); - frame->MsgPanel->Affiche_1_Parametre( 40, _( "Bounding box" ), msg, BROWN ); + frame->MsgPanel->AppendMessage( _( "Bounding box" ), msg, BROWN ); } /***************************/ -/** class LibDrawBezier **/ +/** class LIB_BEZIER **/ /***************************/ -LibDrawBezier::LibDrawBezier( LIB_COMPONENT* aParent ) : +LIB_BEZIER::LIB_BEZIER( LIB_COMPONENT* aParent ) : LIB_DRAW_ITEM( COMPONENT_BEZIER_DRAW_TYPE, aParent ) { m_Fill = NO_FILL; @@ -1691,8 +1690,7 @@ LibDrawBezier::LibDrawBezier( LIB_COMPONENT* aParent ) : } -LibDrawBezier::LibDrawBezier( const LibDrawBezier& bezier ) : - LIB_DRAW_ITEM( bezier ) +LIB_BEZIER::LIB_BEZIER( const LIB_BEZIER& bezier ) : LIB_DRAW_ITEM( bezier ) { m_PolyPoints = bezier.m_PolyPoints; m_BezierPoints = bezier.m_BezierPoints; // Vector copy @@ -1701,7 +1699,7 @@ LibDrawBezier::LibDrawBezier( const LibDrawBezier& bezier ) : } -bool LibDrawBezier::Save( FILE* ExportFile ) const +bool LIB_BEZIER::Save( FILE* ExportFile ) const { int ccount = GetCornerCount(); @@ -1723,7 +1721,7 @@ bool LibDrawBezier::Save( FILE* ExportFile ) const } -bool LibDrawBezier::Load( char* line, wxString& errorMsg ) +bool LIB_BEZIER::Load( char* line, wxString& errorMsg ) { char* p; int i, ccount = 0; @@ -1782,9 +1780,9 @@ bool LibDrawBezier::Load( char* line, wxString& errorMsg ) } -LIB_DRAW_ITEM* LibDrawBezier::DoGenCopy() +LIB_DRAW_ITEM* LIB_BEZIER::DoGenCopy() { - LibDrawBezier* newitem = new LibDrawBezier(GetParent()); + LIB_BEZIER* newitem = new LIB_BEZIER(GetParent()); newitem->m_BezierPoints = m_BezierPoints; // Vector copy newitem->m_Width = m_Width; @@ -1796,11 +1794,11 @@ LIB_DRAW_ITEM* LibDrawBezier::DoGenCopy() } -int LibDrawBezier::DoCompare( const LIB_DRAW_ITEM& other ) const +int LIB_BEZIER::DoCompare( const LIB_DRAW_ITEM& other ) const { wxASSERT( other.Type() == COMPONENT_BEZIER_DRAW_TYPE ); - const LibDrawBezier* tmp = ( LibDrawBezier* ) &other; + const LIB_BEZIER* tmp = ( LIB_BEZIER* ) &other; if( m_BezierPoints.size() != tmp->m_BezierPoints.size() ) return m_BezierPoints.size() - tmp->m_BezierPoints.size(); @@ -1817,7 +1815,7 @@ int LibDrawBezier::DoCompare( const LIB_DRAW_ITEM& other ) const } -void LibDrawBezier::DoOffset( const wxPoint& offset ) +void LIB_BEZIER::DoOffset( const wxPoint& offset ) { size_t i; @@ -1829,7 +1827,7 @@ void LibDrawBezier::DoOffset( const wxPoint& offset ) } -bool LibDrawBezier::DoTestInside( EDA_Rect& rect ) +bool LIB_BEZIER::DoTestInside( EDA_Rect& rect ) { for( size_t i = 0; i < m_PolyPoints.size(); i++ ) { @@ -1841,13 +1839,13 @@ bool LibDrawBezier::DoTestInside( EDA_Rect& rect ) } -void LibDrawBezier::DoMove( const wxPoint& newPosition ) +void LIB_BEZIER::DoMove( const wxPoint& newPosition ) { DoOffset( newPosition - m_PolyPoints[0] ); } -void LibDrawBezier::DoMirrorHorizontal( const wxPoint& center ) +void LIB_BEZIER::DoMirrorHorizontal( const wxPoint& center ) { size_t i, imax = m_PolyPoints.size(); @@ -1868,8 +1866,8 @@ void LibDrawBezier::DoMirrorHorizontal( const wxPoint& center ) } -void LibDrawBezier::DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, - const int transform[2][2] ) +void LIB_BEZIER::DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, + const int transform[2][2] ) { wxASSERT( plotter != NULL ); @@ -1900,14 +1898,14 @@ void LibDrawBezier::DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, /** Function GetPenSize * @return the size of the "pen" that be used to draw or plot this item */ -int LibDrawBezier::GetPenSize() +int LIB_BEZIER::GetPenSize() { return ( m_Width == 0 ) ? g_DrawDefaultLineThickness : m_Width; } -void LibDrawBezier::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, - const wxPoint& aOffset, int aColor, int aDrawMode, - void* aData, const int aTransformMatrix[2][2] ) +void LIB_BEZIER::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, + const wxPoint& aOffset, int aColor, int aDrawMode, + void* aData, const int aTransformMatrix[2][2] ) { wxPoint pos1; std::vector PolyPointsTraslated; @@ -1967,7 +1965,7 @@ void LibDrawBezier::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, * @param aRefPos A wxPoint to test * @return bool - true if a hit, else false */ -bool LibDrawBezier::HitTest( const wxPoint& aRefPos ) +bool LIB_BEZIER::HitTest( const wxPoint& aRefPos ) { int mindist = m_Width ? m_Width /2 : g_DrawDefaultLineThickness / 2; // Have a minimal tolerance for hit test @@ -1982,8 +1980,8 @@ bool LibDrawBezier::HitTest( const wxPoint& aRefPos ) * @param aThreshold = max distance to a segment * @param aTransMat = the transform matrix */ -bool LibDrawBezier::HitTest( wxPoint aPosRef, int aThreshold, - const int aTransMat[2][2] ) +bool LIB_BEZIER::HitTest( wxPoint aPosRef, int aThreshold, + const int aTransMat[2][2] ) { wxPoint ref, start, end; @@ -2003,7 +2001,7 @@ bool LibDrawBezier::HitTest( wxPoint aPosRef, int aThreshold, /** Function GetBoundingBox * @return the boundary box for this, in library coordinates */ -EDA_Rect LibDrawBezier::GetBoundingBox() +EDA_Rect LIB_BEZIER::GetBoundingBox() { EDA_Rect rect; int xmin, xmax, ymin, ymax; @@ -2030,7 +2028,7 @@ EDA_Rect LibDrawBezier::GetBoundingBox() } -void LibDrawBezier::DisplayInfo( WinEDA_DrawFrame* frame ) +void LIB_BEZIER::DisplayInfo( WinEDA_DrawFrame* frame ) { wxString msg; EDA_Rect bBox = GetBoundingBox(); @@ -2040,10 +2038,10 @@ void LibDrawBezier::DisplayInfo( WinEDA_DrawFrame* frame ) msg = ReturnStringFromValue( g_UnitMetric, m_Width, EESCHEMA_INTERNAL_UNIT, true ); - frame->MsgPanel->Affiche_1_Parametre( 20, _( "Line width" ), msg, BLUE ); + frame->MsgPanel->AppendMessage( _( "Line width" ), msg, BLUE ); msg.Printf( wxT( "(%d, %d, %d, %d)" ), bBox.GetOrigin().x, bBox.GetOrigin().y, bBox.GetEnd().x, bBox.GetEnd().y ); - frame->MsgPanel->Affiche_1_Parametre( 40, _( "Bounding box" ), msg, BROWN ); + frame->MsgPanel->AppendMessage( _( "Bounding box" ), msg, BROWN ); } diff --git a/eeschema/classes_body_items.h b/eeschema/classes_body_items.h index c16eb1f25c..92a4e61468 100644 --- a/eeschema/classes_body_items.h +++ b/eeschema/classes_body_items.h @@ -277,6 +277,14 @@ public: DoPlot( plotter, offset, fill, transform ); } + /** + * Return the width of the draw item. + * + * @return int - Width of draw object. + */ + int GetWidth( void ) { return DoGetWidth(); } + + protected: virtual LIB_DRAW_ITEM* DoGenCopy() = 0; @@ -299,6 +307,7 @@ protected: virtual void DoMirrorHorizontal( const wxPoint& center ) = 0; virtual void DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, const int transform[2][2] ) = 0; + virtual int DoGetWidth( void ) = 0; }; @@ -311,7 +320,7 @@ typedef boost::ptr_vector< LIB_DRAW_ITEM > LIB_DRAW_ITEM_LIST; /********/ /* Pins */ /********/ -class LibDrawPin : public LIB_DRAW_ITEM +class LIB_PIN : public LIB_DRAW_ITEM { public: int m_PinLen; /* Pin length */ @@ -339,16 +348,16 @@ public: int m_Width; /* Line width */ public: - LibDrawPin(LIB_COMPONENT * aParent); - LibDrawPin( const LibDrawPin& pin ); - ~LibDrawPin() { } + LIB_PIN(LIB_COMPONENT * aParent); + LIB_PIN( const LIB_PIN& pin ); + ~LIB_PIN() { } - LibDrawPin* Next() const { return (LibDrawPin*) Pnext; } - LibDrawPin* Back() const { return (LibDrawPin*) Pback; } + LIB_PIN* Next() const { return (LIB_PIN*) Pnext; } + LIB_PIN* Back() const { return (LIB_PIN*) Pback; } virtual wxString GetClass() const { - return wxT( "LibDrawPin" ); + return wxT( "LIB_PIN" ); } @@ -452,6 +461,7 @@ protected: virtual void DoMirrorHorizontal( const wxPoint& center ); virtual void DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, const int transform[2][2] ); + virtual int DoGetWidth( void ) { return m_Width; } }; @@ -459,7 +469,7 @@ protected: /* Graphic Body Item: Arc */ /**************************/ -class LibDrawArc : public LIB_DRAW_ITEM +class LIB_ARC : public LIB_DRAW_ITEM { public: int m_Radius; @@ -472,12 +482,12 @@ public: int m_Width; /* Line width */ public: - LibDrawArc(LIB_COMPONENT * aParent); - LibDrawArc( const LibDrawArc& arc ); - ~LibDrawArc() { } + LIB_ARC(LIB_COMPONENT * aParent); + LIB_ARC( const LIB_ARC& arc ); + ~LIB_ARC() { } virtual wxString GetClass() const { - return wxT( "LibDrawArc" ); + return wxT( "LIB_ARC" ); } @@ -540,13 +550,14 @@ protected: virtual void DoMirrorHorizontal( const wxPoint& center ); virtual void DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, const int transform[2][2] ); + virtual int DoGetWidth( void ) { return m_Width; } }; /*****************************/ /* Graphic Body Item: Circle */ /*****************************/ -class LibDrawCircle : public LIB_DRAW_ITEM +class LIB_CIRCLE : public LIB_DRAW_ITEM { public: int m_Radius; @@ -555,12 +566,12 @@ public: int m_Width; /* Line width */ public: - LibDrawCircle(LIB_COMPONENT * aParent); - LibDrawCircle( const LibDrawCircle& circle ); - ~LibDrawCircle() { } + LIB_CIRCLE(LIB_COMPONENT * aParent); + LIB_CIRCLE( const LIB_CIRCLE& circle ); + ~LIB_CIRCLE() { } virtual wxString GetClass() const { - return wxT( "LibDrawCircle" ); + return wxT( "LIB_CIRCLE" ); } @@ -624,6 +635,7 @@ protected: virtual void DoMirrorHorizontal( const wxPoint& center ); virtual void DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, const int transform[2][2] ); + virtual int DoGetWidth( void ) { return m_Width; } }; @@ -633,15 +645,15 @@ protected: /* Fields like Ref , value... are not Text, */ /* they are a separate class */ /*********************************************/ -class LibDrawText : public LIB_DRAW_ITEM, public EDA_TextStruct +class LIB_TEXT : public LIB_DRAW_ITEM, public EDA_TextStruct { public: - LibDrawText(LIB_COMPONENT * aParent); - LibDrawText( const LibDrawText& text ); - ~LibDrawText() { } + LIB_TEXT(LIB_COMPONENT * aParent); + LIB_TEXT( const LIB_TEXT& text ); + ~LIB_TEXT() { } virtual wxString GetClass() const { - return wxT( "LibDrawText" ); + return wxT( "LIB_TEXT" ); } @@ -719,13 +731,14 @@ protected: virtual void DoMirrorHorizontal( const wxPoint& center ); virtual void DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, const int transform[2][2] ); + virtual int DoGetWidth( void ) { return m_Width; } }; /********************************/ /* Graphic Body Item: Rectangle */ /********************************/ -class LibDrawSquare : public LIB_DRAW_ITEM +class LIB_RECTANGLE : public LIB_DRAW_ITEM { public: wxPoint m_End; /* Rectangle end point. */ @@ -733,12 +746,12 @@ public: int m_Width; /* Line width */ public: - LibDrawSquare(LIB_COMPONENT * aParent); - LibDrawSquare( const LibDrawSquare& rect ); - ~LibDrawSquare() { } + LIB_RECTANGLE(LIB_COMPONENT * aParent); + LIB_RECTANGLE( const LIB_RECTANGLE& rect ); + ~LIB_RECTANGLE() { } virtual wxString GetClass() const { - return wxT( "LibDrawSquare" ); + return wxT( "LIB_RECTANGLE" ); } @@ -803,12 +816,13 @@ protected: virtual void DoMirrorHorizontal( const wxPoint& center ); virtual void DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, const int transform[2][2] ); + virtual int DoGetWidth( void ) { return m_Width; } }; /**********************************/ /* Graphic Body Item: single line */ /**********************************/ -class LibDrawSegment : public LIB_DRAW_ITEM +class LIB_SEGMENT : public LIB_DRAW_ITEM { public: wxPoint m_End; @@ -817,12 +831,12 @@ public: int m_Width; /* Line width */ public: - LibDrawSegment(LIB_COMPONENT * aParent); - LibDrawSegment( const LibDrawSegment& segment ); - ~LibDrawSegment() { } + LIB_SEGMENT(LIB_COMPONENT * aParent); + LIB_SEGMENT( const LIB_SEGMENT& segment ); + ~LIB_SEGMENT() { } virtual wxString GetClass() const { - return wxT( "LibDrawSegment" ); + return wxT( "LIB_SEGMENT" ); } @@ -886,26 +900,27 @@ protected: virtual void DoMirrorHorizontal( const wxPoint& center ); virtual void DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, const int transform[2][2] ); + virtual int DoGetWidth( void ) { return m_Width; } }; /**********************************************************/ /* Graphic Body Item: Polygon and polyline (set of lines) */ /**********************************************************/ -class LibDrawPolyline : public LIB_DRAW_ITEM +class LIB_POLYLINE : public LIB_DRAW_ITEM { public: int m_Width; /* Line width */ std::vector m_PolyPoints; // list of points (>= 2) public: - LibDrawPolyline(LIB_COMPONENT * aParent); - LibDrawPolyline( const LibDrawPolyline& polyline ); - ~LibDrawPolyline() { } + LIB_POLYLINE(LIB_COMPONENT * aParent); + LIB_POLYLINE( const LIB_POLYLINE& polyline ); + ~LIB_POLYLINE() { } virtual wxString GetClass() const { - return wxT( "LibDrawPolyline" ); + return wxT( "LIB_POLYLINE" ); } @@ -978,12 +993,13 @@ protected: virtual void DoMirrorHorizontal( const wxPoint& center ); virtual void DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, const int transform[2][2] ); + virtual int DoGetWidth( void ) { return m_Width; } }; /**********************************************************/ /* Graphic Body Item: Bezier Curve (set of lines) */ /**********************************************************/ -class LibDrawBezier : public LIB_DRAW_ITEM +class LIB_BEZIER : public LIB_DRAW_ITEM { public: int m_Width; /* Line width */ @@ -991,13 +1007,13 @@ public: std::vector m_PolyPoints; // list of points (>= 2) public: - LibDrawBezier( LIB_COMPONENT * aParent ); - LibDrawBezier( const LibDrawBezier& bezier ); - ~LibDrawBezier() { } + LIB_BEZIER( LIB_COMPONENT * aParent ); + LIB_BEZIER( const LIB_BEZIER& bezier ); + ~LIB_BEZIER() { } virtual wxString GetClass() const { - return wxT( "LibDrawBezier" ); + return wxT( "LIB_BEZIER" ); } @@ -1070,6 +1086,7 @@ protected: virtual void DoMirrorHorizontal( const wxPoint& center ); virtual void DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, const int transform[2][2] ); + virtual int DoGetWidth( void ) { return m_Width; } }; #endif // CLASSES_BODY_ITEMS_H diff --git a/eeschema/controle.cpp b/eeschema/controle.cpp index 79c127a7cd..f385edc548 100644 --- a/eeschema/controle.cpp +++ b/eeschema/controle.cpp @@ -42,7 +42,7 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( bool Include SCH_ITEM* DrawStruct; wxString msg; wxPoint mouse_position = GetScreen()->m_MousePosition; - LibDrawPin* Pin = NULL; + LIB_PIN* Pin = NULL; SCH_COMPONENT* LibItem = NULL; DrawStruct = SchematicGeneralLocateAndDisplay( mouse_position, IncludePin ); @@ -75,7 +75,7 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( bool Include break; case COMPONENT_PIN_DRAW_TYPE: - Pin = (LibDrawPin*) DrawStruct; + Pin = (LIB_PIN*) DrawStruct; break; } @@ -120,7 +120,7 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin */ { SCH_ITEM* DrawStruct; - LibDrawPin* Pin; + LIB_PIN* Pin; SCH_COMPONENT* LibItem; wxString Text; wxString msg; diff --git a/eeschema/cross-probing.cpp b/eeschema/cross-probing.cpp index d54b701d9a..21acd05334 100644 --- a/eeschema/cross-probing.cpp +++ b/eeschema/cross-probing.cpp @@ -98,8 +98,8 @@ void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectToSync, if( objectToSync == NULL ) return; - LibDrawPin* Pin = NULL; - char Line[1024]; + LIB_PIN* Pin = NULL; + char Line[1024]; /* Cross probing to pcbnew if a pin or a component is found */ switch( objectToSync->Type() ) @@ -126,7 +126,7 @@ void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectToSync, if( LibItem == NULL ) break; - Pin = (LibDrawPin*) objectToSync; + Pin = (LIB_PIN*) objectToSync; if( Pin->m_PinNum ) { wxString pinnum; diff --git a/eeschema/dangling_ends.cpp b/eeschema/dangling_ends.cpp index 785a894c3c..4ec96fb669 100644 --- a/eeschema/dangling_ends.cpp +++ b/eeschema/dangling_ends.cpp @@ -148,17 +148,19 @@ void WinEDA_SchematicFrame::TestDanglingEnds( SCH_ITEM* DrawList, wxDC* DC ) } -/************************************************************************************************/ -LibDrawPin* WinEDA_SchematicFrame::LocatePinEnd( SCH_ITEM* DrawList, const wxPoint& pos ) -/************************************************************************************************/ -/** Teste if point pos is on a pin end - * @return un pointer on the pin or NULL - * @param DrawList = list of SCH_ITEMs +/** + * Test if point pos is on a pin end. + * + * @param DrawList = List of SCH_ITEMs to check. + * + * @return LIB_PIN - Pointer to the located pin or NULL if no pin was found. */ +LIB_PIN* WinEDA_SchematicFrame::LocatePinEnd( SCH_ITEM* DrawList, + const wxPoint& pos ) { SCH_COMPONENT* DrawLibItem; - LibDrawPin* Pin; + LIB_PIN* Pin; wxPoint pinpos; Pin = LocateAnyPin( DrawList, pos, &DrawLibItem ); @@ -275,13 +277,10 @@ void TestLabelForDangling( SCH_TEXT* label, } -/****************************************************/ -wxPoint ReturnPinPhysicalPosition( LibDrawPin* Pin, - SCH_COMPONENT* DrawLibItem ) -/****************************************************/ /* Retourne la position physique de la pin, qui d�pend de l'orientation * du composant */ +wxPoint ReturnPinPhysicalPosition( LIB_PIN* Pin, SCH_COMPONENT* DrawLibItem ) { wxPoint PinPos = Pin->m_Pos; @@ -289,7 +288,8 @@ wxPoint ReturnPinPhysicalPosition( LibDrawPin* Pin, NEGATE( PinPos.y ); else - PinPos = TransformCoordinate( DrawLibItem->m_Transform, Pin->m_Pos) + DrawLibItem->m_Pos; + PinPos = TransformCoordinate( DrawLibItem->m_Transform, + Pin->m_Pos ) + DrawLibItem->m_Pos; return PinPos; } @@ -392,7 +392,7 @@ DanglingEndHandle* RebuildEndList( EDA_BaseStruct* DrawList ) if( Entry == NULL ) break; - for( LibDrawPin* Pin = Entry->GetNextPin(); Pin != NULL; + for( LIB_PIN* Pin = Entry->GetNextPin(); Pin != NULL; Pin = Entry->GetNextPin( Pin ) ) { wxASSERT( Pin->Type() == COMPONENT_PIN_DRAW_TYPE ); diff --git a/eeschema/dialog_cmp_graphic_properties.cpp b/eeschema/dialog_cmp_graphic_properties.cpp index 9434849b87..d4dc643acd 100644 --- a/eeschema/dialog_cmp_graphic_properties.cpp +++ b/eeschema/dialog_cmp_graphic_properties.cpp @@ -59,57 +59,62 @@ WinEDA_bodygraphics_PropertiesFrame::WinEDA_bodygraphics_PropertiesFrame( WinEDA /* Set the dialog items: */ if ( CurrentItem ) { - if ( CurrentItem->m_Unit == 0 ) m_CommonUnit->SetValue(TRUE); + if ( CurrentItem->m_Unit == 0 ) + m_CommonUnit->SetValue( TRUE ); } - else if ( ! g_FlDrawSpecificUnit ) m_CommonUnit->SetValue(TRUE); + else if ( ! g_FlDrawSpecificUnit ) + { + m_CommonUnit->SetValue( TRUE ); + } + if ( CurrentItem ) { - if ( CurrentItem->m_Convert == 0 ) m_CommonConvert->SetValue(TRUE); + if ( CurrentItem->m_Convert == 0 ) + m_CommonConvert->SetValue( TRUE ); } - else if ( !g_FlDrawSpecificConvert ) m_CommonConvert->SetValue(TRUE); + else if ( !g_FlDrawSpecificConvert ) + { + m_CommonConvert->SetValue( TRUE ); + } + + bool show_fill_option = false; + int fill_option = 0; -bool show_fill_option = FALSE; -int fill_option = 0; if( CurrentItem ) - switch(CurrentItem->Type()) + { + fill_option = CurrentItem->m_Fill; + + switch( CurrentItem->Type() ) { case COMPONENT_ARC_DRAW_TYPE: - show_fill_option = TRUE; - fill_option = ((LibDrawArc*)CurrentItem)->m_Fill; - m_GraphicShapeWidthCtrl->SetValue(((LibDrawArc*)CurrentItem)->m_Width); - - break; - case COMPONENT_CIRCLE_DRAW_TYPE: - show_fill_option = TRUE; - fill_option = ((LibDrawCircle*)CurrentItem)->m_Fill; - m_GraphicShapeWidthCtrl->SetValue(((LibDrawCircle*)CurrentItem)->m_Width); - break; - case COMPONENT_RECT_DRAW_TYPE: - show_fill_option = TRUE; - fill_option = ((LibDrawSquare *)CurrentItem)->m_Fill; - m_GraphicShapeWidthCtrl->SetValue(((LibDrawSquare*)CurrentItem)->m_Width); - break; + case COMPONENT_POLYLINE_DRAW_TYPE: + show_fill_option = true; - case COMPONENT_POLYLINE_DRAW_TYPE: - show_fill_option = TRUE; - fill_option = ((LibDrawPolyline*)CurrentItem)->m_Fill; - m_GraphicShapeWidthCtrl->SetValue(((LibDrawPolyline*)CurrentItem)->m_Width); + default: break; - - default: break; } - if ( show_fill_option ) m_Filled->SetSelection(fill_option); - else m_Filled->Enable(false); + m_GraphicShapeWidthCtrl->SetValue( CurrentItem->GetWidth() ); + } + + if ( show_fill_option ) + m_Filled->SetSelection( fill_option ); + else + m_Filled->Enable( false ); } /*! * WinEDA_bodygraphics_PropertiesFrame creator */ -bool WinEDA_bodygraphics_PropertiesFrame::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) +bool WinEDA_bodygraphics_PropertiesFrame::Create( wxWindow* parent, + wxWindowID id, + const wxString& caption, + const wxPoint& pos, + const wxSize& size, + long style ) { ////@begin WinEDA_bodygraphics_PropertiesFrame member initialisation m_CommonUnit = NULL; diff --git a/eeschema/dialog_create_component.h b/eeschema/dialog_create_component.h deleted file mode 100644 index 72f6bc7182..0000000000 --- a/eeschema/dialog_create_component.h +++ /dev/null @@ -1,136 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dialog_create_component.h -// Purpose: -// Author: -// Modified by: -// Created: 01/14/06 10:14:28 -// RCS-ID: -// Copyright: -// Licence: -///////////////////////////////////////////////////////////////////////////// - -// Generated by DialogBlocks (unregistered), 01/14/06 10:14:28 - -#ifndef _DIALOG_CREATE_COMPONENT_H_ -#define _DIALOG_CREATE_COMPONENT_H_ - -#if defined(__GNUG__) && !defined(__APPLE__) -#pragma interface "dialog_create_component.cpp" -#endif - -/*! - * Includes - */ - -////@begin includes -#include "wx/statline.h" -#include "wx/spinctrl.h" -////@end includes - -/*! - * Forward declarations - */ - -////@begin forward declarations -class wxSpinCtrl; -////@end forward declarations - -/*! - * Control identifiers - */ - -////@begin control identifiers -#define ID_DIALOG 10000 -#define ID_TEXTCTRL1 10009 -#define ID_TEXTCTRL 10008 -#define ID_CHECKBOX3 10005 -#define ID_CHECKBOX4 10006 -#define ID_CHECKBOX2 10004 -#define ID_RADIOBOX 10003 -#define ID_CHECKBOX1 10002 -#define ID_CHECKBOX5 10007 -#define ID_CHECKBOX 10001 -#define ID_SPINCTRL 10010 -#define SYMBOL_WINEDA_CREATECMPDIALOG_STYLE wxCAPTION|wxSYSTEM_MENU|wxCLOSE_BOX|MAYBE_RESIZE_BORDER -#define SYMBOL_WINEDA_CREATECMPDIALOG_TITLE _("Component Creation") -#define SYMBOL_WINEDA_CREATECMPDIALOG_IDNAME ID_DIALOG -#define SYMBOL_WINEDA_CREATECMPDIALOG_SIZE wxSize(400, 300) -#define SYMBOL_WINEDA_CREATECMPDIALOG_POSITION wxDefaultPosition -////@end control identifiers - -/*! - * Compatibility - */ - -#ifndef wxCLOSE_BOX -#define wxCLOSE_BOX 0x1000 -#endif -#ifndef wxFIXED_MINSIZE -#define wxFIXED_MINSIZE 0 -#endif - -/*! - * WinEDA_CreateCmpDialog class declaration - */ - -class WinEDA_CreateCmpDialog: public wxDialog -{ - DECLARE_DYNAMIC_CLASS( WinEDA_CreateCmpDialog ) - DECLARE_EVENT_TABLE() - -public: - /// Constructors - WinEDA_CreateCmpDialog( ); - WinEDA_CreateCmpDialog( WinEDA_DrawFrame* parent, wxWindowID id = SYMBOL_WINEDA_CREATECMPDIALOG_IDNAME, const wxString& caption = SYMBOL_WINEDA_CREATECMPDIALOG_TITLE, const wxPoint& pos = SYMBOL_WINEDA_CREATECMPDIALOG_POSITION, const wxSize& size = SYMBOL_WINEDA_CREATECMPDIALOG_SIZE, long style = SYMBOL_WINEDA_CREATECMPDIALOG_STYLE ); - - /// Creation - bool Create( WinEDA_DrawFrame* parent, wxWindowID id = SYMBOL_WINEDA_CREATECMPDIALOG_IDNAME, const wxString& caption = SYMBOL_WINEDA_CREATECMPDIALOG_TITLE, const wxPoint& pos = SYMBOL_WINEDA_CREATECMPDIALOG_POSITION, const wxSize& size = SYMBOL_WINEDA_CREATECMPDIALOG_SIZE, long style = SYMBOL_WINEDA_CREATECMPDIALOG_STYLE ); - - /// Creates the controls and sizers - void CreateControls(); - - // others functions: - wxString ReturnCmpName() - { - return m_CmpName->GetValue(); - } - void SetComponentData( LIB_COMPONENT & component ); -////@begin WinEDA_CreateCmpDialog event handler declarations - - /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK - void OnOkClick( wxCommandEvent& event ); - - /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL - void OnCancelClick( wxCommandEvent& event ); - -////@end WinEDA_CreateCmpDialog event handler declarations - -////@begin WinEDA_CreateCmpDialog member function declarations - - /// Retrieves bitmap resources - wxBitmap GetBitmapResource( const wxString& name ); - - /// Retrieves icon resources - wxIcon GetIconResource( const wxString& name ); -////@end WinEDA_CreateCmpDialog member function declarations - - /// Should we show tooltips? - static bool ShowToolTips(); - -////@begin WinEDA_CreateCmpDialog member variables - wxTextCtrl* m_CmpName; - wxTextCtrl* m_Reference; - wxCheckBox* m_AsConvert; - wxCheckBox* m_IsPowerSymbol; - wxCheckBox* m_PartsAreLocked; - wxButton* m_btClose; - wxRadioBox* m_PartsCount; - wxCheckBox* m_ShowPinNum; - wxCheckBox* m_ShowPinname; - wxCheckBox* m_PinNameInside; - wxSpinCtrl* m_SetSkew; -////@end WinEDA_CreateCmpDialog member variables -}; - -#endif - // _DIALOG_CREATE_COMPONENT_H_ diff --git a/eeschema/dialog_create_component.pjd b/eeschema/dialog_create_component.pjd deleted file mode 100644 index 25d28a7050..0000000000 --- a/eeschema/dialog_create_component.pjd +++ /dev/null @@ -1,1639 +0,0 @@ - - -
- 0 - "" - "" - "" - "" - "" - 0 - 0 - 0 - 1 - 1 - 1 - 1 - 0 - "jean-pierre Charras" - "GNU license" - "" - 0 - 0 - 0 - "<All platforms>" - "<Any>" - "///////////////////////////////////////////////////////////////////////////// -// Name: %HEADER-FILENAME% -// Purpose: -// Author: %AUTHOR% -// Modified by: -// Created: %DATE% -// RCS-ID: -// Copyright: %COPYRIGHT% -// Licence: GNU -///////////////////////////////////////////////////////////////////////////// - -" - "///////////////////////////////////////////////////////////////////////////// -// Name: %SOURCE-FILENAME% -// Purpose: -// Author: %AUTHOR% -// Modified by: -// Created: %DATE% -// RCS-ID: -// Copyright: %COPYRIGHT% -// Licence: -///////////////////////////////////////////////////////////////////////////// - -" - "///////////////////////////////////////////////////////////////////////////// -// Name: %SYMBOLS-FILENAME% -// Purpose: Symbols file -// Author: %AUTHOR% -// Modified by: -// Created: %DATE% -// RCS-ID: -// Copyright: %COPYRIGHT% -// Licence: -///////////////////////////////////////////////////////////////////////////// - -" - "#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "%HEADER-FILENAME%" -#endif - -" - "#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "%HEADER-FILENAME%" -#endif - -// For compilers that support precompilation, includes "wx/wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#ifndef WX_PRECOMP -#include "wx/wx.h" -#endif - -" - " /// %BODY% -" - " -/*! - * %BODY% - */ - -" - "app_resources.h" - "app_resources.cpp" - "AppResources" - "app.h" - "app.cpp" - "Application" - 0 - "" - "<None>" - "<System>" - "utf-8" - "<System>" - "" - 0 - 0 - 4 - " " - "" - 0 - 0 - 1 - 0 - 1 - 1 - 0 - 1 - 0 - 0 -
- - - "" - "data-document" - "" - "" - 0 - 1 - 0 - 0 - - "Configurations" - "config-data-document" - "" - "" - 0 - 1 - 0 - 0 - "" - 1 - -8519680 - "" - "Debug" - "ANSI" - "Static" - "Modular" - "GUI" - "wxMSW" - "Dynamic" - "Yes" - "No" - "No" - "%WXVERSION%" - "%EXECUTABLE%" - "" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - 0 - 1 - "" - - "GCC Release" - "gcc-config-data-document" - "" - "" - 0 - 1 - 0 - 0 - "GCC" - 1 - -8519680 - "GCC" - "Release" - "ANSI" - "Static" - "Modular" - "GUI" - "wxMSW" - "Dynamic" - "Yes" - "No" - "No" - "Yes" - "No" - "No" - "%WXVERSION%" - "%EXECUTABLE%" - "" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - 0 - 1 - "" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - - - - - - - - "Projects" - "root-document" - "" - "project" - 1 - 1 - 0 - 1 - - "Windows" - "html-document" - "" - "dialogsfolder" - 1 - 1 - 0 - 1 - - "Component Creation" - "dialog-document" - "" - "dialog" - 0 - 1 - 0 - 0 - "14/3/2006" - "wbDialogProxy" - 10000 - 0 - "" - 0 - "" - 0 - 0 - "ID_DIALOG" - 10000 - "WinEDA_CreateCmpDialog" - "wxDialog" - "wxDialog" - "dialog_create_component.cpp" - "dialog_create_component.h" - "" - "Component Creation" - 1 - "" - 0 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "Tiled" - 0 - 1 - 0 - 1 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - "MAYBE_RESIZE_BORDER" - 0 - 1 - -1 - -1 - 400 - 300 - 0 - "ID_BUTTON,ID_BUTTON1" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "wbBoxSizerProxy" - "Vertical" - "" - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "14/3/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "14/3/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "14/3/2006" - "wbStaticBoxSizerProxy" - "wxID_ANY" - -1 - "Name" - "" - "" - "" - "" - 0 - 1 - "wxStaticBox" - "Vertical" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxTextCtrl: ID_TEXTCTRL1" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "14/3/2006" - "wbTextCtrlProxy" - "ID_TEXTCTRL1" - 10009 - "" - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_CmpName" - "" - 0 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - 0 - - - - "wxStaticBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "14/3/2006" - "wbStaticBoxSizerProxy" - "wxID_ANY" - -1 - "Reference" - "" - "" - "" - "" - 0 - 1 - "wxStaticBox" - "Vertical" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxTextCtrl: ID_TEXTCTRL" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "14/3/2006" - "wbTextCtrlProxy" - "ID_TEXTCTRL" - 10008 - "" - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_Reference" - "U" - 0 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - 0 - - - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "14/3/2006" - "wbSpacerProxy" - 5 - 5 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "14/3/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "14/3/2006" - "wbStaticBoxSizerProxy" - "wxID_ANY" - -1 - "Options" - "" - "" - "" - "" - 0 - 1 - "wxStaticBox" - "Vertical" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxCheckBox: ID_CHECKBOX3" - "dialog-control-document" - "" - "checkbox" - 0 - 1 - 0 - 0 - "14/3/2006" - "wbCheckBoxProxy" - "ID_CHECKBOX3" - 10005 - "" - "wxCheckBox" - "wxCheckBox" - 1 - 0 - "" - "" - "m_AsConvert" - "As Convert" - 0 - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 1 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxCheckBox: ID_CHECKBOX4" - "dialog-control-document" - "" - "checkbox" - 0 - 1 - 0 - 0 - "14/3/2006" - "wbCheckBoxProxy" - "ID_CHECKBOX4" - 10006 - "" - "wxCheckBox" - "wxCheckBox" - 1 - 0 - "" - "" - "m_IsPowerSymbol" - "Power Symbol" - 0 - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 1 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxCheckBox: ID_CHECKBOX2" - "dialog-control-document" - "" - "checkbox" - 0 - 1 - 0 - 0 - "14/3/2006" - "wbCheckBoxProxy" - "ID_CHECKBOX2" - 10004 - "" - "wxCheckBox" - "wxCheckBox" - 1 - 0 - "" - "" - "m_PartsAreLocked" - "Parts are locked" - 0 - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 1 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "14/3/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxButton: wxID_OK" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "14/3/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnOkClick" - "wxID_OK" - 5100 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "&OK" - 1 - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxButton: wxID_CANCEL" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "14/3/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnCancelClick|||WinEDA_CreateCmpDialog" - "wxID_CANCEL" - 5101 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "m_btClose" - "&Cancel" - 0 - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - - "wxStaticLine: wxID_STATIC" - "dialog-control-document" - "" - "staticline" - 0 - 1 - 0 - 0 - "14/3/2006" - "wbStaticLineProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticLine" - "wxStaticLine" - 1 - 0 - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 1 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Expand" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "14/3/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxRadioBox: ID_RADIOBOX" - "dialog-control-document" - "" - "radiobox" - 0 - 1 - 0 - 0 - "14/3/2006" - "wbRadioBoxProxy" - "ID_RADIOBOX" - 10003 - "" - "wxRadioBox" - "wxRadioBox" - 1 - 0 - "" - "" - "m_PartsCount" - "Parts per component" - 9 - "&1|&2|&3|&4|&5|&6|&7|&8|&9|&10|&11|&12|&13|&14|&15|&16|&17|&18|&19|&20|&21|&22|&23|&24|&25|&26" - 0 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 1 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "14/3/2006" - "wbSpacerProxy" - 5 - 5 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - - "wxStaticBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "14/3/2006" - "wbStaticBoxSizerProxy" - "wxID_ANY" - -1 - "Draw options" - "" - "" - "" - "" - 0 - 1 - "wxStaticBox" - "Vertical" - "Centre" - "Expand" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxCheckBox: ID_CHECKBOX1" - "dialog-control-document" - "" - "checkbox" - 0 - 1 - 0 - 0 - "14/3/2006" - "wbCheckBoxProxy" - "ID_CHECKBOX1" - 10002 - "" - "wxCheckBox" - "wxCheckBox" - 1 - 0 - "" - "" - "m_ShowPinNum" - "Show Pin Number" - 1 - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 1 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxCheckBox: ID_CHECKBOX5" - "dialog-control-document" - "" - "checkbox" - 0 - 1 - 0 - 0 - "14/3/2006" - "wbCheckBoxProxy" - "ID_CHECKBOX5" - 10007 - "" - "wxCheckBox" - "wxCheckBox" - 1 - 0 - "" - "" - "m_ShowPinname" - "Show Pin Name" - 1 - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 1 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxCheckBox: ID_CHECKBOX" - "dialog-control-document" - "" - "checkbox" - 0 - 1 - 0 - 0 - "14/3/2006" - "wbCheckBoxProxy" - "ID_CHECKBOX" - 10001 - "" - "wxCheckBox" - "wxCheckBox" - 1 - 0 - "" - "" - "m_PinNameInside" - "Pin Name Inside" - 1 - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 1 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxStaticBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "14/3/2006" - "wbStaticBoxSizerProxy" - "wxID_ANY" - -1 - "Skew:" - "" - "" - "" - "" - 0 - 1 - "wxStaticBox" - "Vertical" - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxSpinCtrl: ID_SPINCTRL" - "dialog-control-document" - "" - "spinctrl" - 0 - 1 - 0 - 0 - "14/3/2006" - "wbSpinCtrlProxy" - "ID_SPINCTRL" - 10010 - "" - "wxSpinCtrl" - "wxSpinCtrl" - 1 - 0 - "" - "" - "m_SetSkew" - 0 - 100 - 40 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - - - - - - "Sources" - "html-document" - "" - "sourcesfolder" - 1 - 1 - 0 - 1 - - "dialog_create_component.rc" - "source-editor-document" - "dialog_create_component.rc" - "source-editor" - 0 - 0 - 1 - 0 - "14/3/2006" - "" - - - - "Images" - "html-document" - "" - "bitmapsfolder" - 1 - 1 - 0 - 1 - - - - -
diff --git a/eeschema/dialog_create_component.rc b/eeschema/dialog_create_component.rc deleted file mode 100644 index bcac0b5c6c..0000000000 --- a/eeschema/dialog_create_component.rc +++ /dev/null @@ -1,3 +0,0 @@ -#ifndef APSTUDIO_INVOKED -#include "wx/msw/wx.rc" -#endif diff --git a/eeschema/dialog_edit_libentry_fields_in_lib.cpp b/eeschema/dialog_edit_libentry_fields_in_lib.cpp index 23b6180adb..11127f4b11 100644 --- a/eeschema/dialog_edit_libentry_fields_in_lib.cpp +++ b/eeschema/dialog_edit_libentry_fields_in_lib.cpp @@ -32,8 +32,8 @@ private: LIB_COMPONENT* m_LibEntry; bool m_skipCopyFromPanel; - /// a copy of the edited component's LibDrawFields - std::vector m_FieldsBuf; + /// a copy of the edited component's LIB_FIELDs + std::vector m_FieldsBuf; public: DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB( WinEDA_LibeditFrame* aParent, @@ -79,7 +79,7 @@ private: * bad data into a field, and this value can be used to deny a row change. */ bool copyPanelToSelectedField(); - void setRowItem( int aFieldNdx, const LibDrawField& aField ); + void setRowItem( int aFieldNdx, const LIB_FIELD& aField ); /** Function updateDisplay * update the listbox showing fields, according to the fields texts @@ -283,7 +283,7 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::addFieldButtonHandler( wxCommandEvent& unsigned fieldNdx = m_FieldsBuf.size(); - LibDrawField blank( fieldNdx ); + LIB_FIELD blank( fieldNdx ); m_FieldsBuf.push_back( blank ); m_FieldsBuf[fieldNdx].m_Name = ReturnDefaultFieldName(fieldNdx); @@ -362,7 +362,7 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB:: moveUpButtonHandler( wxCommandEvent& e // swap the fieldNdx field with the one before it, in both the vector // and in the fieldListCtrl - LibDrawField tmp = m_FieldsBuf[fieldNdx - 1]; + LIB_FIELD tmp = m_FieldsBuf[fieldNdx - 1]; m_FieldsBuf[fieldNdx - 1] = m_FieldsBuf[fieldNdx]; setRowItem( fieldNdx - 1, m_FieldsBuf[fieldNdx] ); @@ -407,7 +407,7 @@ int DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::getSelectedFieldNdx() } -static bool SortFieldsById(const LibDrawField& item1, const LibDrawField& item2) +static bool SortFieldsById(const LIB_FIELD& item1, const LIB_FIELD& item2) { return item1.m_FieldId < item2.m_FieldId; } @@ -423,11 +423,11 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::InitBuffers( void ) m_FieldsBuf.push_back( m_LibEntry->m_Name ); // Creates a working copy of fields - for( LibDrawField* field = m_LibEntry->m_Fields; field != NULL; field = field->Next() ) + for( LIB_FIELD* field = m_LibEntry->m_Fields; field != NULL; field = field->Next() ) m_FieldsBuf.push_back( *field ); // Display 12 fields (or more), and add missing fields - LibDrawField blank( 2 ); + LIB_FIELD blank( 2 ); unsigned fcount = m_FieldsBuf.size(); for( unsigned ii = 2; ii < NUMBER_OF_FIELDS; ii++ ) { @@ -470,7 +470,7 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::InitBuffers( void ) /***********************************************************************************************/ -void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::setRowItem( int aFieldNdx, const LibDrawField& aField ) +void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::setRowItem( int aFieldNdx, const LIB_FIELD& aField ) /***********************************************************************************************/ { wxASSERT( aFieldNdx >= 0 ); @@ -503,7 +503,7 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::copySelectedFieldToPanel() if( fieldNdx >= m_FieldsBuf.size() ) // traps the -1 case too return; - LibDrawField& field = m_FieldsBuf[fieldNdx]; + LIB_FIELD& field = m_FieldsBuf[fieldNdx]; showCheckBox->SetValue( !(field.m_Attributs & TEXT_NO_VISIBLE) ); @@ -584,7 +584,7 @@ bool DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::copyPanelToSelectedField() if( fieldNdx >= m_FieldsBuf.size() ) // traps the -1 case too return true; - LibDrawField& field = m_FieldsBuf[fieldNdx]; + LIB_FIELD& field = m_FieldsBuf[fieldNdx]; if( showCheckBox->GetValue() ) field.m_Attributs &= ~TEXT_NO_VISIBLE; diff --git a/eeschema/dialog_lib_new_component.cpp b/eeschema/dialog_lib_new_component.cpp new file mode 100644 index 0000000000..e6c48d3695 --- /dev/null +++ b/eeschema/dialog_lib_new_component.cpp @@ -0,0 +1,7 @@ +#include "dialog_lib_new_component.h" + +DIALOG_LIB_NEW_COMPONENT::DIALOG_LIB_NEW_COMPONENT( wxWindow* parent ) : + DIALOG_LIB_NEW_COMPONENT_BASE( parent ) +{ + SetDefaultItem( m_sdbSizerOK ); +} diff --git a/eeschema/dialog_lib_new_component.fbp b/eeschema/dialog_lib_new_component.fbp new file mode 100644 index 0000000000..c511114b3b --- /dev/null +++ b/eeschema/dialog_lib_new_component.fbp @@ -0,0 +1,1234 @@ + + + + + + C++ + 1 + UTF-8 + table + dialog_lib_new_component_base + 1000 + none + 1 + dialog_lib_new_component + + . + + 1 + 1 + 0 + + + wxBOTH + + 1 + + + + 0 + wxID_ANY + + + DIALOG_LIB_NEW_COMPONENT_BASE + + + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + + Component Properties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + mainSizer + wxHORIZONTAL + none + + 12 + wxALL|wxEXPAND + 1 + + + bSizer5 + wxVERTICAL + none + + 3 + wxALIGN_LEFT + 0 + + + + 1 + + ,90,92,-1,70,0 + 0 + wxID_ANY + General Settings + + + m_staticText6 + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + wxALL|wxEXPAND + 0 + + + bSizer2 + wxHORIZONTAL + none + + 3 + wxEXPAND + 0 + + 0 + protected + 12 + + + + 3 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + Component &name: + + + m_staticText2 + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 3 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + + 0 + + m_textName + protected + + 100,-1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + wxEXPAND + 0 + + 0 + protected + 30 + + + + + + 0 + wxALL|wxEXPAND + 0 + + + bSizer3 + wxHORIZONTAL + none + + 3 + wxEXPAND + 0 + + 0 + protected + 12 + + + + 3 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + Default &reference designator: + + + m_staticText3 + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 3 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + + 0 + + m_textReference + protected + + 100,-1 + + + + U + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 0 + + 0 + protected + 30 + + + + + + 0 + wxALL|wxEXPAND + 0 + + + bSizer4 + wxHORIZONTAL + none + + 3 + wxEXPAND + 0 + + 0 + protected + 12 + + + + 3 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + Number of &parts per package: + + + m_staticText4 + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 3 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + 0 + 40 + + 1 + + m_spinPartCount + protected + + 100,-1 + wxSP_ARROW_KEYS + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + wxEXPAND + 0 + + 0 + protected + 30 + + + + + + 0 + wxALL|wxEXPAND + 0 + + + bSizer7 + wxHORIZONTAL + none + + 3 + wxEXPAND + 0 + + 0 + protected + 12 + + + + 3 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + + 0 + + 1 + + + 0 + wxID_ANY + Create component with &alternate body style (DeMorgan) + + + m_checkHasConversion + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + wxALL|wxEXPAND + 0 + + + bSizer8 + wxHORIZONTAL + none + + 3 + wxEXPAND + 0 + + 0 + protected + 12 + + + + 3 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + + 0 + + 1 + + + 0 + wxID_ANY + Create component as power &symbol + + + m_checkIsPowerSymbol + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + wxALL|wxEXPAND + 0 + + + bSizer9 + wxHORIZONTAL + none + + 3 + wxEXPAND + 0 + + 0 + protected + 12 + + + + 3 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + + 0 + + 1 + + + 0 + wxID_ANY + Prevent drawing items from being &moved + + + m_checkLockItems + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 10 + wxALL|wxEXPAND + 0 + + 0 + protected + 0 + + + + 3 + wxALIGN_LEFT|wxBOTTOM + 0 + + + + 1 + + ,90,92,-1,70,0 + 0 + wxID_ANY + Global Pin Settings + + + m_staticText7 + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + wxALL|wxEXPAND + 1 + + + bSizer6 + wxHORIZONTAL + none + + 3 + wxEXPAND + 0 + + 0 + protected + 12 + + + + 3 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + Pin text position &offset: + + + m_staticText41 + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 3 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + 40 + 10000 + + 0 + + m_spinPinTextPosition + protected + + 100,-1 + wxSP_ARROW_KEYS + + + 40 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + wxALIGN_CENTER_VERTICAL + 0 + + + + 1 + + + 0 + wxID_ANY + mils + + + m_staticText5 + protected + + 30,-1 + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + wxALL|wxEXPAND + 0 + + + bSizer10 + wxHORIZONTAL + none + + 3 + wxEXPAND + 0 + + 0 + protected + 12 + + + + 3 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + + 1 + + 1 + + + 0 + wxID_ANY + Show pin n&umber text + + + m_checkShowPinNumber + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + wxALL|wxEXPAND + 0 + + + bSizer12 + wxHORIZONTAL + none + + 3 + wxEXPAND + 0 + + 0 + protected + 12 + + + + 3 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + + 1 + + 1 + + + 0 + wxID_ANY + Show pin name te&xt + + + m_checkShowPinName + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 10 + wxALL|wxEXPAND + 0 + + 5 + protected + 0 + + + + 0 + wxALL|wxEXPAND + 0 + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_sdbSizer + protected + + + + + + + + + + + + + + + + diff --git a/eeschema/dialog_lib_new_component.h b/eeschema/dialog_lib_new_component.h new file mode 100644 index 0000000000..87188feac4 --- /dev/null +++ b/eeschema/dialog_lib_new_component.h @@ -0,0 +1,67 @@ +#ifndef __dialog_lib_new_component__ +#define __dialog_lib_new_component__ + +/** +@file +Subclass of DIALOG_LIB_NEW_COMPONENT, which is generated by wxFormBuilder. +*/ + +#include "dialog_lib_new_component_base.h" + +/** Implementing DIALOG_LIB_NEW_COMPONENT */ +class DIALOG_LIB_NEW_COMPONENT : public DIALOG_LIB_NEW_COMPONENT_BASE +{ +public: + /** Constructor */ + DIALOG_LIB_NEW_COMPONENT( wxWindow* parent ); + + void SetName( const wxString& name ) { m_textName->SetValue( name ); } + wxString GetName( void ) { return m_textName->GetValue(); } + + void SetReference( const wxString& reference ) + { + m_textReference->SetValue( reference ); + } + wxString GetReference( void ) { return m_textReference->GetValue(); } + + void SetPartCount( int count ) { m_spinPartCount->SetValue( count ); } + int GetPartCount( void ) { return m_spinPartCount->GetValue(); } + + void SetAlternateBodyStyle( bool enable ) + { + m_checkHasConversion->SetValue( enable ); + } + bool GetAlternateBodyStyle( void ) + { + return m_checkHasConversion->GetValue(); + } + + void SetPowerSymbol( bool enable ) + { + m_checkIsPowerSymbol->SetValue( enable ); + } + bool GetPowerSymbol( void ) { return m_checkIsPowerSymbol->GetValue(); } + + void SetLockItems( bool enable ) { m_checkLockItems->SetValue( enable ); } + bool GetLockItems( void ) { return m_checkLockItems->GetValue(); } + + void SetPinTextPosition( int position ) + { + m_spinPinTextPosition->SetValue( position ); + } + int GetPinTextPosition( void ) { return m_spinPinTextPosition->GetValue(); } + + void SetShowPinNumber( bool show ) + { + m_checkShowPinNumber->SetValue( show ); + } + bool GetShowPinNumber( void ) { return m_checkShowPinNumber->GetValue(); } + + void SetShowPinName( bool show ) + { + m_checkShowPinName->SetValue( show ); + } + bool GetShowPinName( void ) { return m_checkShowPinName->GetValue(); } +}; + +#endif // __dialog_lib_new_component__ diff --git a/eeschema/dialog_lib_new_component_base.cpp b/eeschema/dialog_lib_new_component_base.cpp new file mode 100644 index 0000000000..fac5110437 --- /dev/null +++ b/eeschema/dialog_lib_new_component_base.cpp @@ -0,0 +1,206 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Apr 16 2008) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "dialog_lib_new_component_base.h" + +/////////////////////////////////////////////////////////////////////////// + +DIALOG_LIB_NEW_COMPONENT_BASE::DIALOG_LIB_NEW_COMPONENT_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 ); + + wxBoxSizer* mainSizer; + mainSizer = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizer5; + bSizer5 = new wxBoxSizer( wxVERTICAL ); + + m_staticText6 = new wxStaticText( this, wxID_ANY, _("General Settings"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText6->Wrap( -1 ); + m_staticText6->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + + bSizer5->Add( m_staticText6, 0, wxALIGN_LEFT, 3 ); + + wxBoxSizer* bSizer2; + bSizer2 = new wxBoxSizer( wxHORIZONTAL ); + + + bSizer2->Add( 12, 0, 0, wxEXPAND, 3 ); + + m_staticText2 = new wxStaticText( this, wxID_ANY, _("Component &name:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText2->Wrap( -1 ); + bSizer2->Add( m_staticText2, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + + + bSizer2->Add( 0, 0, 1, wxEXPAND, 3 ); + + m_textName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 100,-1 ), 0 ); + bSizer2->Add( m_textName, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + + + bSizer2->Add( 30, 0, 0, wxEXPAND, 3 ); + + bSizer5->Add( bSizer2, 0, wxALL|wxEXPAND, 0 ); + + wxBoxSizer* bSizer3; + bSizer3 = new wxBoxSizer( wxHORIZONTAL ); + + + bSizer3->Add( 12, 0, 0, wxEXPAND, 3 ); + + m_staticText3 = new wxStaticText( this, wxID_ANY, _("Default &reference designator:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText3->Wrap( -1 ); + bSizer3->Add( m_staticText3, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + + + bSizer3->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_textReference = new wxTextCtrl( this, wxID_ANY, _("U"), wxDefaultPosition, wxSize( 100,-1 ), 0 ); + bSizer3->Add( m_textReference, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + + + bSizer3->Add( 30, 0, 0, wxEXPAND, 5 ); + + bSizer5->Add( bSizer3, 0, wxALL|wxEXPAND, 0 ); + + wxBoxSizer* bSizer4; + bSizer4 = new wxBoxSizer( wxHORIZONTAL ); + + + bSizer4->Add( 12, 0, 0, wxEXPAND, 3 ); + + m_staticText4 = new wxStaticText( this, wxID_ANY, _("Number of &parts per package:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText4->Wrap( -1 ); + bSizer4->Add( m_staticText4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + + + bSizer4->Add( 0, 0, 1, wxEXPAND, 3 ); + + m_spinPartCount = new wxSpinCtrl( this, wxID_ANY, wxT("1"), wxDefaultPosition, wxSize( 100,-1 ), wxSP_ARROW_KEYS, 1, 40, 0 ); + bSizer4->Add( m_spinPartCount, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + + + bSizer4->Add( 30, 0, 0, wxEXPAND, 3 ); + + bSizer5->Add( bSizer4, 0, wxALL|wxEXPAND, 0 ); + + wxBoxSizer* bSizer7; + bSizer7 = new wxBoxSizer( wxHORIZONTAL ); + + + bSizer7->Add( 12, 0, 0, wxEXPAND, 3 ); + + m_checkHasConversion = new wxCheckBox( this, wxID_ANY, _("Create component with &alternate body style (DeMorgan)"), wxDefaultPosition, wxDefaultSize, 0 ); + + bSizer7->Add( m_checkHasConversion, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + + bSizer5->Add( bSizer7, 0, wxALL|wxEXPAND, 0 ); + + wxBoxSizer* bSizer8; + bSizer8 = new wxBoxSizer( wxHORIZONTAL ); + + + bSizer8->Add( 12, 0, 0, wxEXPAND, 3 ); + + m_checkIsPowerSymbol = new wxCheckBox( this, wxID_ANY, _("Create component as power &symbol"), wxDefaultPosition, wxDefaultSize, 0 ); + + bSizer8->Add( m_checkIsPowerSymbol, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + + bSizer5->Add( bSizer8, 0, wxALL|wxEXPAND, 0 ); + + wxBoxSizer* bSizer9; + bSizer9 = new wxBoxSizer( wxHORIZONTAL ); + + + bSizer9->Add( 12, 0, 0, wxEXPAND, 3 ); + + m_checkLockItems = new wxCheckBox( this, wxID_ANY, _("Prevent drawing items from being &moved"), wxDefaultPosition, wxDefaultSize, 0 ); + + bSizer9->Add( m_checkLockItems, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + + bSizer5->Add( bSizer9, 0, wxALL|wxEXPAND, 0 ); + + + bSizer5->Add( 0, 0, 0, wxALL|wxEXPAND, 10 ); + + m_staticText7 = new wxStaticText( this, wxID_ANY, _("Global Pin Settings"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText7->Wrap( -1 ); + m_staticText7->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + + bSizer5->Add( m_staticText7, 0, wxALIGN_LEFT|wxBOTTOM, 3 ); + + wxBoxSizer* bSizer6; + bSizer6 = new wxBoxSizer( wxHORIZONTAL ); + + + bSizer6->Add( 12, 0, 0, wxEXPAND, 3 ); + + m_staticText41 = new wxStaticText( this, wxID_ANY, _("Pin text position &offset:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText41->Wrap( -1 ); + bSizer6->Add( m_staticText41, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + + + bSizer6->Add( 0, 0, 1, wxEXPAND, 3 ); + + m_spinPinTextPosition = new wxSpinCtrl( this, wxID_ANY, wxT("40"), wxDefaultPosition, wxSize( 100,-1 ), wxSP_ARROW_KEYS, 0, 10000, 40 ); + bSizer6->Add( m_spinPinTextPosition, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + + m_staticText5 = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxSize( 30,-1 ), 0 ); + m_staticText5->Wrap( -1 ); + bSizer6->Add( m_staticText5, 0, wxALIGN_CENTER_VERTICAL, 3 ); + + bSizer5->Add( bSizer6, 1, wxALL|wxEXPAND, 0 ); + + wxBoxSizer* bSizer10; + bSizer10 = new wxBoxSizer( wxHORIZONTAL ); + + + bSizer10->Add( 12, 0, 0, wxEXPAND, 3 ); + + m_checkShowPinNumber = new wxCheckBox( this, wxID_ANY, _("Show pin n&umber text"), wxDefaultPosition, wxDefaultSize, 0 ); + m_checkShowPinNumber->SetValue(true); + + bSizer10->Add( m_checkShowPinNumber, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + + bSizer5->Add( bSizer10, 0, wxALL|wxEXPAND, 0 ); + + wxBoxSizer* bSizer12; + bSizer12 = new wxBoxSizer( wxHORIZONTAL ); + + + bSizer12->Add( 12, 0, 0, wxEXPAND, 3 ); + + m_checkShowPinName = new wxCheckBox( this, wxID_ANY, _("Show pin name te&xt"), wxDefaultPosition, wxDefaultSize, 0 ); + m_checkShowPinName->SetValue(true); + + bSizer12->Add( m_checkShowPinName, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + + bSizer5->Add( bSizer12, 0, wxALL|wxEXPAND, 0 ); + + + bSizer5->Add( 0, 5, 0, wxALL|wxEXPAND, 10 ); + + m_sdbSizer = new wxStdDialogButtonSizer(); + m_sdbSizerOK = new wxButton( this, wxID_OK ); + m_sdbSizer->AddButton( m_sdbSizerOK ); + m_sdbSizerCancel = new wxButton( this, wxID_CANCEL ); + m_sdbSizer->AddButton( m_sdbSizerCancel ); + m_sdbSizer->Realize(); + bSizer5->Add( m_sdbSizer, 0, wxALL|wxEXPAND, 0 ); + + mainSizer->Add( bSizer5, 1, wxALL|wxEXPAND, 12 ); + + this->SetSizer( mainSizer ); + this->Layout(); + mainSizer->Fit( this ); + + this->Centre( wxBOTH ); +} + +DIALOG_LIB_NEW_COMPONENT_BASE::~DIALOG_LIB_NEW_COMPONENT_BASE() +{ +} diff --git a/eeschema/dialog_lib_new_component_base.h b/eeschema/dialog_lib_new_component_base.h new file mode 100644 index 0000000000..bc8c541f30 --- /dev/null +++ b/eeschema/dialog_lib_new_component_base.h @@ -0,0 +1,80 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Apr 16 2008) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __dialog_lib_new_component_base__ +#define __dialog_lib_new_component_base__ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +/// Class DIALOG_LIB_NEW_COMPONENT_BASE +/////////////////////////////////////////////////////////////////////////////// +class DIALOG_LIB_NEW_COMPONENT_BASE : public wxDialog +{ + private: + + protected: + wxStaticText* m_staticText6; + + wxStaticText* m_staticText2; + + wxTextCtrl* m_textName; + + + wxStaticText* m_staticText3; + + wxTextCtrl* m_textReference; + + + wxStaticText* m_staticText4; + + wxSpinCtrl* m_spinPartCount; + + + wxCheckBox* m_checkHasConversion; + + wxCheckBox* m_checkIsPowerSymbol; + + wxCheckBox* m_checkLockItems; + + wxStaticText* m_staticText7; + + wxStaticText* m_staticText41; + + wxSpinCtrl* m_spinPinTextPosition; + wxStaticText* m_staticText5; + + wxCheckBox* m_checkShowPinNumber; + + wxCheckBox* m_checkShowPinName; + + wxStdDialogButtonSizer* m_sdbSizer; + wxButton* m_sdbSizerOK; + wxButton* m_sdbSizerCancel; + + public: + DIALOG_LIB_NEW_COMPONENT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Component Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~DIALOG_LIB_NEW_COMPONENT_BASE(); + +}; + +#endif //__dialog_lib_new_component_base__ diff --git a/eeschema/edit_graphic_bodyitem_text.cpp b/eeschema/edit_graphic_bodyitem_text.cpp index da04116563..2bb075b924 100644 --- a/eeschema/edit_graphic_bodyitem_text.cpp +++ b/eeschema/edit_graphic_bodyitem_text.cpp @@ -25,10 +25,11 @@ class Dialog_BodyGraphicText_Properties : public Dialog_BodyGraphicText_Properti { private: WinEDA_LibeditFrame * m_Parent; - LibDrawText * m_GraphicText; + LIB_TEXT* m_GraphicText; public: - Dialog_BodyGraphicText_Properties( WinEDA_LibeditFrame* aParent, LibDrawText * aGraphicText); + Dialog_BodyGraphicText_Properties( WinEDA_LibeditFrame* aParent, + LIB_TEXT* aGraphicText ); ~Dialog_BodyGraphicText_Properties() {}; private: @@ -38,8 +39,9 @@ private: }; -Dialog_BodyGraphicText_Properties::Dialog_BodyGraphicText_Properties( WinEDA_LibeditFrame* aParent, LibDrawText * aGraphicText) : - Dialog_BodyGraphicText_Properties_base(aParent) +Dialog_BodyGraphicText_Properties::Dialog_BodyGraphicText_Properties( WinEDA_LibeditFrame* aParent, + LIB_TEXT* aGraphicText ) : + Dialog_BodyGraphicText_Properties_base( aParent ) { m_Parent = aParent; m_GraphicText = aGraphicText; @@ -239,7 +241,7 @@ void WinEDA_LibeditFrame::EditSymbolText(wxDC* DC, LIB_DRAW_ITEM* DrawItem) Dialog_BodyGraphicText_Properties * frame = new Dialog_BodyGraphicText_Properties( this, - (LibDrawText *) DrawItem ); + (LIB_TEXT*) DrawItem ); frame->ShowModal(); frame->Destroy(); GetScreen()->SetModify(); @@ -263,7 +265,7 @@ void WinEDA_LibeditFrame::RotateSymbolText(wxDC * DC) 90 deg Graphic text Rotation . */ { - LibDrawText * DrawItem = (LibDrawText *) m_drawItem; + LIB_TEXT* DrawItem = (LIB_TEXT *) m_drawItem; if( DrawItem == NULL ) return; diff --git a/eeschema/find.cpp b/eeschema/find.cpp index 69ab24e72c..9f4411b584 100644 --- a/eeschema/find.cpp +++ b/eeschema/find.cpp @@ -82,7 +82,7 @@ SCH_ITEM* WinEDA_SchematicFrame::FindComponentAndItem( bool DoCenterAndRedraw = FALSE; bool NotFound = true; wxString msg; - LibDrawPin* pin; + LIB_PIN* pin; EDA_SheetList SheetList; diff --git a/eeschema/getpart.cpp b/eeschema/getpart.cpp index 57c89e6b4e..ef73fcf77e 100644 --- a/eeschema/getpart.cpp +++ b/eeschema/getpart.cpp @@ -203,7 +203,7 @@ SCH_COMPONENT* WinEDA_SchematicFrame::Load_Component( wxDC* DC, Component->m_PrefixString = Entry->m_Prefix.m_Text; /* Init des autres champs si predefinis dans la librairie */ - LibDrawField* EntryField; + LIB_FIELD* EntryField; for( EntryField = Entry->m_Fields; EntryField != NULL; EntryField = EntryField->Next() ) { diff --git a/eeschema/hotkeys.cpp b/eeschema/hotkeys.cpp index 61aede0b5f..db4739825f 100644 --- a/eeschema/hotkeys.cpp +++ b/eeschema/hotkeys.cpp @@ -554,7 +554,7 @@ void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey, if( m_lastDrawItem && (m_lastDrawItem->m_Flags == 0) && (m_lastDrawItem->Type() == COMPONENT_PIN_DRAW_TYPE) ) { - RepeatPinItem( DC, (LibDrawPin*) m_lastDrawItem ); + RepeatPinItem( DC, (LIB_PIN*) m_lastDrawItem ); } else wxBell(); diff --git a/eeschema/libedit.cpp b/eeschema/libedit.cpp index 2ea2c59a69..e78ebcedfa 100644 --- a/eeschema/libedit.cpp +++ b/eeschema/libedit.cpp @@ -21,10 +21,10 @@ #include "libeditfrm.h" #include "class_library.h" -#include "dialog_create_component.h" +#include "dialog_lib_new_component.h" -/* Affiche dans la zone messages la librairie , et le composant edite */ +/* Update the main window title bar with the current library name. */ void WinEDA_LibeditFrame::DisplayLibInfos() { wxString msg = _( "Component Library Editor: " ); @@ -490,9 +490,7 @@ All changes will be lost. Discard changes?" ) ) ) */ void WinEDA_LibeditFrame::CreateNewLibraryPart( wxCommandEvent& event ) { - int diag; - wxString msg; - LIB_COMPONENT* NewStruct; + wxString name; if( m_component && GetScreen()->IsModify() && !IsOK( this, _( "All changes to the current component will be \ @@ -503,43 +501,43 @@ lost!\n\nClear the current component from the screen?" ) ) ) m_drawItem = NULL; - WinEDA_CreateCmpDialog Dialogbox( this ); - diag = Dialogbox.ShowModal(); - if( diag != wxID_OK ) + DIALOG_LIB_NEW_COMPONENT dlg( this ); + if( dlg.ShowModal() == wxID_CANCEL ) return; - msg = Dialogbox.ReturnCmpName(); - if( msg.IsEmpty() ) + + if( dlg.GetName().IsEmpty() ) return; - msg.MakeUpper(); - msg.Replace( wxT( " " ), wxT( "_" ) ); + + name = dlg.GetName().MakeUpper(); + name.Replace( wxT( " " ), wxT( "_" ) ); /* Test: y a t-il un composant deja de ce nom */ - if( m_library ) + if( m_library && m_library->FindEntry( name ) ) { - if( m_library->FindEntry( msg ) ) - { - wxString msg; - msg.Printf( _( "Component \"%s\" already exists in \ -library \"%s\"." ), - (const wxChar*) Dialogbox.ReturnCmpName(), - (const wxChar*) m_library->GetName() ); - DisplayError( this, msg ); - return; - } + wxString msg; + msg.Printf( _( "Component \"%s\" already exists in library \"%s\"." ), + (const wxChar*) name, + (const wxChar*) m_library->GetName() ); + DisplayError( this, msg ); + return; } - NewStruct = new LIB_COMPONENT( msg ); - Dialogbox.SetComponentData( *NewStruct ); - if( NewStruct->m_Prefix.m_Text.IsEmpty() ) - NewStruct->m_Prefix.m_Text = wxT( "U" ); - NewStruct->m_Prefix.m_Text.MakeUpper(); + LIB_COMPONENT* component = new LIB_COMPONENT( name ); + component->m_Prefix.m_Text = dlg.GetReference(); + component->SetPartCount( dlg.GetPartCount() ); + component->SetConversion( dlg.GetAlternateBodyStyle() ); + component->m_TextInside = dlg.GetPinTextPosition(); + component->m_Options = ( dlg.GetPowerSymbol() ) ? ENTRY_POWER : + ENTRY_NORMAL; + component->m_DrawPinNum = dlg.GetShowPinNumber(); + component->m_DrawPinName = dlg.GetShowPinName(); - // Effacement ancien composant affich� if( m_component ) { SAFE_DELETE( m_component ); } - m_component = NewStruct; + + m_component = component; m_unit = 1; m_convert = 1; DisplayLibInfos(); @@ -549,6 +547,7 @@ library \"%s\"." ), g_EditPinByPinIsOn = false; m_lastDrawItem = NULL; GetScreen()->ClearUndoRedoList(); + GetScreen()->SetModify(); DrawPanel->Refresh(); } diff --git a/eeschema/libedit_onleftclick.cpp b/eeschema/libedit_onleftclick.cpp index 11efc90e05..dd90fe70f1 100644 --- a/eeschema/libedit_onleftclick.cpp +++ b/eeschema/libedit_onleftclick.cpp @@ -39,7 +39,7 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) break; case COMPONENT_FIELD_DRAW_TYPE: - PlaceField( DC, (LibDrawField*) DrawEntry ); + PlaceField( DC, (LIB_FIELD*) DrawEntry ); DrawEntry = NULL; break; @@ -126,7 +126,7 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) DisplayCmpDoc(); SaveCopyInUndoList( m_component ); if( DrawEntry->Type() == COMPONENT_PIN_DRAW_TYPE ) - DeletePin( DC, m_component, (LibDrawPin*) DrawEntry ); + DeletePin( DC, m_component, (LIB_PIN*) DrawEntry ); else m_component->RemoveDrawItem( DrawEntry, DrawPanel, DC ); DrawEntry = NULL; @@ -229,7 +229,7 @@ void WinEDA_LibeditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) case COMPONENT_FIELD_DRAW_TYPE: if( DrawEntry->m_Flags == 0 ) { - EditField( DC, (LibDrawField*) DrawEntry ); + EditField( DC, (LIB_FIELD*) DrawEntry ); } break; diff --git a/eeschema/libedit_onrightclick.cpp b/eeschema/libedit_onrightclick.cpp index 52117eed3f..0869233c2d 100644 --- a/eeschema/libedit_onrightclick.cpp +++ b/eeschema/libedit_onrightclick.cpp @@ -22,7 +22,7 @@ /* functions to add commands and submenus depending on the item */ static void AddMenusForBlock( wxMenu* PopMenu, WinEDA_LibeditFrame* frame ); -static void AddMenusForPin( wxMenu* PopMenu, LibDrawPin* Pin, +static void AddMenusForPin( wxMenu* PopMenu, LIB_PIN* Pin, WinEDA_LibeditFrame* frame ); @@ -74,7 +74,7 @@ bool WinEDA_LibeditFrame::OnRightClick( const wxPoint& MousePos, switch( DrawEntry->Type() ) { case COMPONENT_PIN_DRAW_TYPE: - AddMenusForPin( PopMenu, (LibDrawPin*) DrawEntry, this ); + AddMenusForPin( PopMenu, (LIB_PIN*) DrawEntry, this ); break; case COMPONENT_ARC_DRAW_TYPE: @@ -179,7 +179,7 @@ bool WinEDA_LibeditFrame::OnRightClick( const wxPoint& MousePos, } else if( (DrawEntry->m_Flags & IS_NEW) ) { - if( ( (LibDrawPolyline*) DrawEntry )->GetCornerCount() > 2 ) + if( ( (LIB_POLYLINE*) DrawEntry )->GetCornerCount() > 2 ) { msg = AddHotkeyName( _( "Delete Segment " ), s_Libedit_Hokeys_Descr, HK_DELETE_PIN ); @@ -221,7 +221,7 @@ StructType %d" ), void AddMenusForPin( wxMenu* PopMenu, - LibDrawPin* Pin, + LIB_PIN* Pin, WinEDA_LibeditFrame* frame ) { bool selected = (Pin->m_Selected & IS_SELECTED) != 0; diff --git a/eeschema/libeditfrm.h b/eeschema/libeditfrm.h index 7602285c5c..a7bf3e94a3 100644 --- a/eeschema/libeditfrm.h +++ b/eeschema/libeditfrm.h @@ -142,7 +142,7 @@ private: void CreatePin( wxDC* DC ); void DeletePin( wxDC* DC, LIB_COMPONENT* LibEntry, - LibDrawPin* Pin ); + LIB_PIN* Pin ); void StartMovePin( wxDC* DC ); // Edition de l'ancre @@ -161,10 +161,10 @@ private: void RotateSymbolText( wxDC* DC ); void DeleteDrawPoly( wxDC* DC ); LIB_DRAW_ITEM* LocateItemUsingCursor(); - void RotateField( wxDC* DC, LibDrawField* Field ); - void PlaceField( wxDC* DC, LibDrawField* Field ); - void EditField( wxDC* DC, LibDrawField* Field ); - void StartMoveField( wxDC* DC, LibDrawField* field ); + void RotateField( wxDC* DC, LIB_FIELD* Field ); + void PlaceField( wxDC* DC, LIB_FIELD* Field ); + void EditField( wxDC* DC, LIB_FIELD* Field ); + void StartMoveField( wxDC* DC, LIB_FIELD* field ); public: /* Block commands: */ @@ -174,10 +174,10 @@ public: void PlacePin( wxDC* DC ); void InitEditOnePin(); - void GlobalSetPins( wxDC* DC, LibDrawPin* MasterPin, int id ); + void GlobalSetPins( wxDC* DC, LIB_PIN* MasterPin, int id ); // Repetition automatique de placement de pins - void RepeatPinItem( wxDC* DC, LibDrawPin* Pin ); + void RepeatPinItem( wxDC* DC, LIB_PIN* Pin ); protected: wxString m_ConfigPath; diff --git a/eeschema/libfield.cpp b/eeschema/libfield.cpp index 6308975a0b..b86f4c9f8b 100644 --- a/eeschema/libfield.cpp +++ b/eeschema/libfield.cpp @@ -52,7 +52,7 @@ static void ExitMoveField( WinEDA_DrawPanel* Panel, wxDC* DC ) /* * Initialise le deplacement d'un champ ( ref ou Name ) */ -void WinEDA_LibeditFrame::StartMoveField( wxDC* DC, LibDrawField* field ) +void WinEDA_LibeditFrame::StartMoveField( wxDC* DC, LIB_FIELD* field ) { wxPoint startPos; @@ -89,7 +89,7 @@ static void ShowMoveField( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) if( parent == NULL ) return; - LibDrawField* Field = (LibDrawField*) parent->GetDrawItem(); + LIB_FIELD* Field = (LIB_FIELD*) parent->GetDrawItem(); if( Field == NULL ) return; @@ -109,7 +109,7 @@ static void ShowMoveField( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) } -void WinEDA_LibeditFrame::PlaceField( wxDC* DC, LibDrawField* Field ) +void WinEDA_LibeditFrame::PlaceField( wxDC* DC, LIB_FIELD* Field ) { if( Field == NULL ) return; @@ -132,7 +132,7 @@ void WinEDA_LibeditFrame::PlaceField( wxDC* DC, LibDrawField* Field ) } -void WinEDA_LibeditFrame::EditField( wxDC* DC, LibDrawField* Field ) +void WinEDA_LibeditFrame::EditField( wxDC* DC, LIB_FIELD* Field ) { wxString Text; wxString title; @@ -230,7 +230,7 @@ not conflict with any library entries." ), * si un champ est en cours d'edition, modif de celui ci. * sinon Modif du champ pointe par la souris */ -void WinEDA_LibeditFrame::RotateField( wxDC* DC, LibDrawField* Field ) +void WinEDA_LibeditFrame::RotateField( wxDC* DC, LIB_FIELD* Field ) { if( Field == NULL ) diff --git a/eeschema/libframe.cpp b/eeschema/libframe.cpp index 2959bd6fa3..4ca9c97e5c 100644 --- a/eeschema/libframe.cpp +++ b/eeschema/libframe.cpp @@ -739,7 +739,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event ) SaveCopyInUndoList( m_component ); if( m_drawItem->Type() == COMPONENT_PIN_DRAW_TYPE ) { - DeletePin( &dc, m_component, (LibDrawPin*) m_drawItem ); + DeletePin( &dc, m_component, (LIB_PIN*) m_drawItem ); } else { @@ -761,7 +761,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event ) if( m_drawItem->Type() == COMPONENT_PIN_DRAW_TYPE ) StartMovePin( &dc ); else if( m_drawItem->Type() == COMPONENT_FIELD_DRAW_TYPE ) - StartMoveField( &dc, (LibDrawField*) m_drawItem ); + StartMoveField( &dc, (LIB_FIELD*) m_drawItem ); else StartMoveDrawSymbol( &dc ); break; @@ -785,7 +785,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event ) if( m_drawItem->Type() == COMPONENT_FIELD_DRAW_TYPE ) { SaveCopyInUndoList( m_component ); - RotateField( &dc, (LibDrawField*) m_drawItem ); + RotateField( &dc, (LIB_FIELD*) m_drawItem ); } DrawPanel->CursorOn( &dc ); break; @@ -796,7 +796,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event ) DrawPanel->CursorOff( &dc ); if( m_drawItem->Type() == COMPONENT_FIELD_DRAW_TYPE ) { - EditField( &dc, (LibDrawField*) m_drawItem ); + EditField( &dc, (LIB_FIELD*) m_drawItem ); } DrawPanel->MouseToCursorSchema(); DrawPanel->CursorOn( &dc ); @@ -809,7 +809,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event ) || (m_drawItem->Type() != COMPONENT_PIN_DRAW_TYPE) ) break; SaveCopyInUndoList( m_component ); - GlobalSetPins( &dc, (LibDrawPin*) m_drawItem, id ); + GlobalSetPins( &dc, (LIB_PIN*) m_drawItem, id ); DrawPanel->MouseToCursorSchema(); break; diff --git a/eeschema/locate.cpp b/eeschema/locate.cpp index a50ccaf2ad..06a71272c6 100644 --- a/eeschema/locate.cpp +++ b/eeschema/locate.cpp @@ -620,11 +620,11 @@ static bool IsBox1InBox2( int StartX1, int StartY1, int EndX1, int EndY1, * @param pin_number = pin number (string) * @return a pointer on the pin, or NULL if not found */ -LibDrawPin* LocatePinByNumber( const wxString& ePin_Number, - SCH_COMPONENT* eComponent ) +LIB_PIN* LocatePinByNumber( const wxString& ePin_Number, + SCH_COMPONENT* eComponent ) { LIB_COMPONENT* Entry; - LibDrawPin* Pin; + LIB_PIN* Pin; int Unit, Convert; Entry = CMP_LIBRARY::FindLibraryComponent( eComponent->m_ChipName ); @@ -687,13 +687,13 @@ Hierarchical_PIN_Sheet_Struct* LocateSheetLabel( DrawSheetStruct* Sheet, } -LibDrawPin* LocateAnyPin( SCH_ITEM* DrawList, const wxPoint& RefPos, - SCH_COMPONENT** libpart ) +LIB_PIN* LocateAnyPin( SCH_ITEM* DrawList, const wxPoint& RefPos, + SCH_COMPONENT** libpart ) { SCH_ITEM* DrawStruct; LIB_COMPONENT* Entry; SCH_COMPONENT* schItem = NULL; - LibDrawPin* Pin = NULL; + LIB_PIN* Pin = NULL; for( DrawStruct = DrawList; DrawStruct != NULL; DrawStruct = DrawStruct->Next() ) @@ -705,15 +705,16 @@ LibDrawPin* LocateAnyPin( SCH_ITEM* DrawList, const wxPoint& RefPos, if( Entry == NULL ) continue; - /* we use LocateDrawItem to locate pîns. but this function suppose a component + /* we use LocateDrawItem to locate pîns. but this function suppose a + * component. * at 0,0 location * So we must calculate the ref position relative to the component - */ + */ wxPoint libPos = RefPos - schItem->m_Pos; - Pin = (LibDrawPin*) Entry->LocateDrawItem( schItem->m_Multi, - schItem->m_Convert, - COMPONENT_PIN_DRAW_TYPE, - libPos, schItem->m_Transform ); + Pin = (LIB_PIN*) Entry->LocateDrawItem( schItem->m_Multi, + schItem->m_Convert, + COMPONENT_PIN_DRAW_TYPE, + libPos, schItem->m_Transform ); if( Pin ) break; } diff --git a/eeschema/netform.cpp b/eeschema/netform.cpp index 7018a8ec1e..78637c774a 100644 --- a/eeschema/netform.cpp +++ b/eeschema/netform.cpp @@ -30,7 +30,7 @@ static void WriteNetListPspice( WinEDA_SchematicFrame* frame, FILE* f, static void WriteGENERICListOfNets( FILE* f, NETLIST_OBJECT_LIST& aObjectsList ); static void AddPinToComponentPinList( SCH_COMPONENT* Component, DrawSheetPath* sheet, - LibDrawPin* PinEntry ); + LIB_PIN* PinEntry ); static void FindAllsInstancesOfComponent( SCH_COMPONENT* Component, LIB_COMPONENT* Entry, DrawSheetPath* Sheet_in ); @@ -111,7 +111,7 @@ static SCH_COMPONENT* FindNextComponentAndCreatPinList( EDA_BaseStruct* DrawList { SCH_COMPONENT* Component = NULL; LIB_COMPONENT* Entry; - LibDrawPin* Pin; + LIB_PIN* Pin; s_SortedComponentPinList.clear(); for( ; DrawList != NULL; DrawList = DrawList->Next() ) @@ -672,7 +672,7 @@ static void WriteNetListPCBNEW( WinEDA_SchematicFrame* frame, FILE* f, bool with /*************************************************************************************/ static void AddPinToComponentPinList( SCH_COMPONENT* Component, - DrawSheetPath* sheetlist, LibDrawPin* Pin ) + DrawSheetPath* sheetlist, LIB_PIN* Pin ) /*************************************************************************************/ /* Add a new pin description in the pin list s_SortedComponentPinList @@ -769,7 +769,7 @@ static void FindAllsInstancesOfComponent( SCH_COMPONENT* Component_in, { EDA_BaseStruct* SchItem; SCH_COMPONENT* Component2; - LibDrawPin* pin; + LIB_PIN* pin; DrawSheetPath* sheet; wxString str, Reference = Component_in->GetRef( Sheet_in ); diff --git a/eeschema/netlist.cpp b/eeschema/netlist.cpp index 592202e2f3..5a75ee9a8a 100644 --- a/eeschema/netlist.cpp +++ b/eeschema/netlist.cpp @@ -355,7 +355,7 @@ static void ListeObjetConnection( DrawSheetPath* sheetlist, NETLIST_OBJECT* new_item; SCH_COMPONENT* DrawLibItem; LIB_COMPONENT* Entry; - LibDrawPin* pin; + LIB_PIN* pin; Hierarchical_PIN_Sheet_Struct* SheetLabel; DrawSheetPath list; diff --git a/eeschema/pinedit-dialog.cpp b/eeschema/pinedit-dialog.cpp index fb2766d9b9..8ee5354da3 100644 --- a/eeschema/pinedit-dialog.cpp +++ b/eeschema/pinedit-dialog.cpp @@ -29,7 +29,7 @@ void InstallPineditFrame( WinEDA_LibeditFrame* parent, wxDC* DC, if ( ( parent->GetDrawItem() == NULL ) || ( parent->GetDrawItem()->Type() == COMPONENT_PIN_DRAW_TYPE ) ) { - LibDrawPin * Pin = (LibDrawPin *) parent->GetDrawItem(); + LIB_PIN* Pin = (LIB_PIN*) parent->GetDrawItem(); WinEDA_PinPropertiesFrame dlg( parent ); accept = dlg.ShowModal(); @@ -81,7 +81,7 @@ WinEDA_PinPropertiesFrame::WinEDA_PinPropertiesFrame( ) WinEDA_PinPropertiesFrame::WinEDA_PinPropertiesFrame( WinEDA_LibeditFrame* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) { - LibDrawPin * CurrentPin = (LibDrawPin *) parent->GetDrawItem(); + LIB_PIN* CurrentPin = (LIB_PIN*) parent->GetDrawItem(); m_Parent = parent; if ( CurrentPin ) @@ -326,7 +326,7 @@ void WinEDA_PinPropertiesFrame::SetValuesInDialog(void) /*******************************************************/ { wxString number; - LibDrawPin * CurrentPin = (LibDrawPin *) m_Parent->GetDrawItem(); + LIB_PIN* CurrentPin = (LIB_PIN*) m_Parent->GetDrawItem(); wxString msg; int tmp, ii; diff --git a/eeschema/pinedit.cpp b/eeschema/pinedit.cpp index 13d2d61e6b..a0438ce38d 100644 --- a/eeschema/pinedit.cpp +++ b/eeschema/pinedit.cpp @@ -34,7 +34,7 @@ int CodeShape[NBSHAPES] = /* Routines locales */ -static void CreateImagePins( LibDrawPin* Pin, int unit, int convert, +static void CreateImagePins( LIB_PIN* Pin, int unit, int convert, bool asDeMorgan ); static void AbortPinMove( WinEDA_DrawPanel* Panel, wxDC* DC ); static void DrawMovePin( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ); @@ -125,8 +125,8 @@ void WinEDA_PinPropertiesFrame::PinPropertiesAccept( wxCommandEvent& event ) */ void WinEDA_LibeditFrame::InitEditOnePin() { - LibDrawPin* Pin; - LibDrawPin* CurrentPin = (LibDrawPin*) m_drawItem; + LIB_PIN* Pin; + LIB_PIN* CurrentPin = (LIB_PIN*) m_drawItem; if( m_component == NULL || CurrentPin == NULL || m_drawItem->Type() != COMPONENT_PIN_DRAW_TYPE ) @@ -160,7 +160,7 @@ static void AbortPinMove( WinEDA_DrawPanel* Panel, wxDC* DC ) if( parent == NULL ) return; - LibDrawPin* CurrentPin = (LibDrawPin*) parent->GetDrawItem(); + LIB_PIN* CurrentPin = (LIB_PIN*) parent->GetDrawItem(); if( CurrentPin == NULL || CurrentPin->Type() != COMPONENT_PIN_DRAW_TYPE ) return; @@ -184,11 +184,11 @@ static void AbortPinMove( WinEDA_DrawPanel* Panel, wxDC* DC ) */ void WinEDA_LibeditFrame::PlacePin( wxDC* DC ) { - LibDrawPin* Pin; - LibDrawPin* CurrentPin = (LibDrawPin*) m_drawItem; - bool ask_for_pin = true; - wxPoint newpos; - bool status; + LIB_PIN* Pin; + LIB_PIN* CurrentPin = (LIB_PIN*) m_drawItem; + bool ask_for_pin = true; + wxPoint newpos; + bool status; if( CurrentPin == NULL ) return; @@ -254,8 +254,8 @@ another pin. Continue?" ) ); void WinEDA_PinPropertiesFrame::SetPinOrientation( int neworient ) { - LibDrawPin* CurrentPin = (LibDrawPin*) m_Parent->GetDrawItem(); - LibDrawPin* Pin, * RefPin = CurrentPin; + LIB_PIN* CurrentPin = (LIB_PIN*) m_Parent->GetDrawItem(); + LIB_PIN* Pin, * RefPin = CurrentPin; if( CurrentPin == NULL || CurrentPin->GetParent() == NULL || RefPin == NULL ) return; @@ -285,9 +285,9 @@ void WinEDA_PinPropertiesFrame::SetPinOrientation( int neworient ) */ void WinEDA_LibeditFrame::StartMovePin( wxDC* DC ) { - LibDrawPin* Pin; - LibDrawPin* CurrentPin = (LibDrawPin*) m_drawItem; - wxPoint startPos; + LIB_PIN* Pin; + LIB_PIN* CurrentPin = (LIB_PIN*) m_drawItem; + wxPoint startPos; /* Marquage des pins a traiter */ Pin = m_component->GetNextPin(); @@ -330,7 +330,7 @@ static void DrawMovePin( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) if( parent == NULL ) return; - LibDrawPin* CurrentPin = (LibDrawPin*) parent->GetDrawItem(); + LIB_PIN* CurrentPin = (LIB_PIN*) parent->GetDrawItem(); if( CurrentPin == NULL || CurrentPin->Type() != COMPONENT_PIN_DRAW_TYPE ) return; @@ -372,8 +372,8 @@ void WinEDA_PinPropertiesFrame::SetPinShape( int newshape ) * des autres unites de la seule forme convert courante */ { - LibDrawPin* Pin; - LibDrawPin* CurrentPin = (LibDrawPin*) m_Parent->GetDrawItem(); + LIB_PIN* Pin; + LIB_PIN* CurrentPin = (LIB_PIN*) m_Parent->GetDrawItem(); if( CurrentPin ) { @@ -401,8 +401,8 @@ void WinEDA_PinPropertiesFrame::SetPinType( int newtype ) * des autres unites du boitier */ { - LibDrawPin* Pin; - LibDrawPin* CurrentPin = (LibDrawPin*) m_Parent->GetDrawItem(); + LIB_PIN* Pin; + LIB_PIN* CurrentPin = (LIB_PIN*) m_Parent->GetDrawItem(); if( CurrentPin == NULL || CurrentPin->GetParent() == NULL ) return; @@ -429,9 +429,9 @@ void WinEDA_PinPropertiesFrame::SetPinName( const wxString& newname, int newsize * si newsize < 0 : pas de changement de taille */ { - LibDrawPin* Pin; - LibDrawPin* CurrentPin = (LibDrawPin*) m_Parent->GetDrawItem(); - wxString buf; + LIB_PIN* Pin; + LIB_PIN* CurrentPin = (LIB_PIN*) m_Parent->GetDrawItem(); + wxString buf; if( CurrentPin == NULL || CurrentPin->GetParent() == NULL ) return; @@ -470,9 +470,9 @@ void WinEDA_PinPropertiesFrame::SetPinNum( const wxString& newnum, int newsize ) * Si newsize < 0 ) pase de changement de taille */ { - LibDrawPin* Pin; - LibDrawPin* CurrentPin = (LibDrawPin*) m_Parent->GetDrawItem(); - wxString buf; + LIB_PIN* Pin; + LIB_PIN* CurrentPin = (LIB_PIN*) m_Parent->GetDrawItem(); + wxString buf; buf = newnum; buf.Replace( wxT( " " ), wxT( "_" ) ); @@ -503,7 +503,7 @@ void WinEDA_PinPropertiesFrame::SetPinNum( const wxString& newnum, int newsize ) /*************************************************/ void WinEDA_LibeditFrame::DeletePin( wxDC* DC, LIB_COMPONENT* LibEntry, - LibDrawPin* Pin ) + LIB_PIN* Pin ) /*************************************************/ /* Routine d'effacement de la pin pointee par la souris @@ -512,8 +512,8 @@ void WinEDA_LibeditFrame::DeletePin( wxDC* DC, * Sinon seule la pin de l'unite en convert courante sera effacee */ { - LibDrawPin* tmp; - wxPoint PinPos; + LIB_PIN* tmp; + wxPoint PinPos; if( LibEntry == NULL || Pin == NULL ) return; @@ -547,8 +547,8 @@ void WinEDA_LibeditFrame::DeletePin( wxDC* DC, */ void WinEDA_LibeditFrame::CreatePin( wxDC* DC ) { - LibDrawPin* CurrentPin; - bool showPinText = true; + LIB_PIN* CurrentPin; + bool showPinText = true; if( m_component == NULL ) return; @@ -556,7 +556,7 @@ void WinEDA_LibeditFrame::CreatePin( wxDC* DC ) /* Effacement des flags */ m_component->ClearStatus(); - CurrentPin = new LibDrawPin( m_component ); + CurrentPin = new LIB_PIN( m_component ); m_drawItem = CurrentPin; @@ -626,9 +626,9 @@ void WinEDA_LibeditFrame::CreatePin( wxDC* DC ) void WinEDA_PinPropertiesFrame::SetPinAttributes( bool draw, bool unit, bool convert ) { - LibDrawPin* tmp; - LibDrawPin* Pin; - LibDrawPin* CurrentPin = (LibDrawPin*) m_Parent->GetDrawItem(); + LIB_PIN* tmp; + LIB_PIN* Pin; + LIB_PIN* CurrentPin = (LIB_PIN*) m_Parent->GetDrawItem(); if( CurrentPin == NULL ) return; @@ -729,7 +729,7 @@ void WinEDA_PinPropertiesFrame::NewSizePin( int newsize ) * */ { - LibDrawPin* RefPin, * Pin = (LibDrawPin*) m_Parent->GetDrawItem(); + LIB_PIN* RefPin, * Pin = (LIB_PIN*) m_Parent->GetDrawItem(); if( Pin == NULL || Pin->GetParent() == NULL ) return; @@ -758,12 +758,12 @@ void WinEDA_PinPropertiesFrame::NewSizePin( int newsize ) } -static void CreateImagePins( LibDrawPin* Pin, int unit, int convert, +static void CreateImagePins( LIB_PIN* Pin, int unit, int convert, bool asDeMorgan ) { - int ii; - LibDrawPin* NewPin; - bool CreateConv = false; + int ii; + LIB_PIN* NewPin; + bool CreateConv = false; if( g_EditPinByPinIsOn ) @@ -775,7 +775,7 @@ static void CreateImagePins( LibDrawPin* Pin, int unit, int convert, /* Creation de la pin " convert " pour la part courante */ if( CreateConv == true ) { - NewPin = (LibDrawPin*) Pin->GenCopy(); + NewPin = (LIB_PIN*) Pin->GenCopy(); if( Pin->m_Convert > 1 ) NewPin->m_Convert = 1; else @@ -789,7 +789,7 @@ static void CreateImagePins( LibDrawPin* Pin, int unit, int convert, continue; /* Pin commune a toutes les unites */ /* Creation pour la representation "normale" */ - NewPin = (LibDrawPin*) Pin->GenCopy(); + NewPin = (LIB_PIN*) Pin->GenCopy(); if( convert != 0 ) NewPin->m_Convert = 1; NewPin->m_Unit = ii; @@ -799,7 +799,7 @@ static void CreateImagePins( LibDrawPin* Pin, int unit, int convert, if( CreateConv == false ) continue; - NewPin = (LibDrawPin*)Pin->GenCopy(); + NewPin = (LIB_PIN*)Pin->GenCopy(); NewPin->m_Convert = 2; if( Pin->m_Unit != 0 ) NewPin->m_Unit = ii; @@ -808,21 +808,19 @@ static void CreateImagePins( LibDrawPin* Pin, int unit, int convert, } -/*************************************************/ -void WinEDA_LibeditFrame::GlobalSetPins( wxDC* DC, - LibDrawPin* MasterPin, int id ) -/*************************************************/ - /* Depending on "id": - * - Change pin text size (name or num) (range 10 .. 1000 mil) - * - Change pin lenght. + * - Change pin text size (name or num) (range 10 .. 1000 mil) + * - Change pin lenght. * - * If Pin is selected ( .m_flag == IS_SELECTED ) only the other selected pis are modified + * If Pin is selected ( .m_flag == IS_SELECTED ) only the other selected + * pins are modified */ +void WinEDA_LibeditFrame::GlobalSetPins( wxDC* DC, LIB_PIN* MasterPin, int id ) + { - LibDrawPin* Pin; - bool selected = ( MasterPin->m_Selected & IS_SELECTED ) != 0; - bool showPinText = true; + LIB_PIN* Pin; + bool selected = ( MasterPin->m_Selected & IS_SELECTED ) != 0; + bool showPinText = true; if( ( m_component == NULL ) || ( MasterPin == NULL ) ) return; @@ -866,19 +864,19 @@ void WinEDA_LibeditFrame::GlobalSetPins( wxDC* DC, /************************************************************************/ -void WinEDA_LibeditFrame::RepeatPinItem( wxDC* DC, LibDrawPin* SourcePin ) +void WinEDA_LibeditFrame::RepeatPinItem( wxDC* DC, LIB_PIN* SourcePin ) /************************************************************************/ /* Creation d'une nouvelle pin par copie de la pr�c�dente ( fct REPEAT) */ { - LibDrawPin* Pin; - wxString msg; - int ox = 0, oy = 0; + LIB_PIN* Pin; + wxString msg; + int ox = 0, oy = 0; if( m_component == NULL || SourcePin == NULL || SourcePin->Type() != COMPONENT_PIN_DRAW_TYPE ) return; - Pin = (LibDrawPin*)SourcePin->GenCopy(); + Pin = (LIB_PIN*)SourcePin->GenCopy(); m_component->AddDrawItem( Pin ); Pin->m_Flags = IS_NEW; @@ -916,8 +914,8 @@ void WinEDA_LibeditFrame::RepeatPinItem( wxDC* DC, LibDrawPin* SourcePin ) int sort_by_pin_number( const void* ref, const void* tst ) { - const LibDrawPin* Ref = *(LibDrawPin**) ref; - const LibDrawPin* Tst = *(LibDrawPin**) tst; + const LIB_PIN* Ref = *(LIB_PIN**) ref; + const LIB_PIN* Tst = *(LIB_PIN**) tst; return Ref->m_PinNum - Tst->m_PinNum; } @@ -925,10 +923,10 @@ int sort_by_pin_number( const void* ref, const void* tst ) void WinEDA_LibeditFrame::OnCheckComponent( wxCommandEvent& event ) { - int nb_pins, ii, error; - LibDrawPin* Pin; - LibDrawPin** PinList; - wxString msg; + int nb_pins, ii, error; + LIB_PIN* Pin; + LIB_PIN** PinList; + wxString msg; if( m_component == NULL ) return; @@ -940,7 +938,7 @@ void WinEDA_LibeditFrame::OnCheckComponent( wxCommandEvent& event ) nb_pins++; } - PinList = (LibDrawPin**) MyZMalloc( (nb_pins + 1) * sizeof(LibDrawPin*) ); + PinList = (LIB_PIN**) MyZMalloc( (nb_pins + 1) * sizeof(LIB_PIN*) ); Pin = m_component->GetNextPin(); for( ii = 0; Pin != NULL; Pin = m_component->GetNextPin( Pin ) ) { @@ -949,14 +947,14 @@ void WinEDA_LibeditFrame::OnCheckComponent( wxCommandEvent& event ) } // Classement des pins par numero de pin - qsort( PinList, nb_pins, sizeof(LibDrawPin*), sort_by_pin_number ); + qsort( PinList, nb_pins, sizeof(LIB_PIN*), sort_by_pin_number ); // Controle des duplicates: error = 0; for( ii = 1; ii < nb_pins; ii++ ) { - wxString aux_msg, StringPinNum; - LibDrawPin* curr_pin = PinList[ii]; + wxString aux_msg, StringPinNum; + LIB_PIN* curr_pin = PinList[ii]; Pin = PinList[ii - 1]; if( Pin->m_PinNum != curr_pin->m_PinNum diff --git a/eeschema/protos.h b/eeschema/protos.h index 777e127f47..1420d98fdd 100644 --- a/eeschema/protos.h +++ b/eeschema/protos.h @@ -18,7 +18,7 @@ class SCH_ITEM; class Hierarchical_PIN_Sheet_Struct; class PLOTTER; class DrawSheetStruct; -class LibDrawPin; +class LIB_PIN; wxString ReturnDefaultFieldName( int aFieldNdx ); @@ -101,15 +101,15 @@ void DeleteStruct( WinEDA_DrawPanel* panel, /*************/ /* LOCATE.CPP */ /*************/ -LibDrawPin* LocatePinByNumber( const wxString& ePin_Number, - SCH_COMPONENT* eComponent ); +LIB_PIN* LocatePinByNumber( const wxString& ePin_Number, + SCH_COMPONENT* eComponent ); -SCH_COMPONENT* LocateSmallestComponent( SCH_SCREEN* Screen ); +SCH_COMPONENT* LocateSmallestComponent( SCH_SCREEN* Screen ); /* Recherche du plus petit (en surface) composant pointe par la souris */ -int PickItemsInBlock( BLOCK_SELECTOR& aBlock, - BASE_SCREEN* screen ); +int PickItemsInBlock( BLOCK_SELECTOR& aBlock, + BASE_SCREEN* screen ); /* function PickStruct: * Search at location pos @@ -152,7 +152,7 @@ SCH_ITEM* PickStruct( const wxPoint& refpos, Hierarchical_PIN_Sheet_Struct* LocateSheetLabel( DrawSheetStruct* Sheet, const wxPoint& pos ); -LibDrawPin* LocateAnyPin( SCH_ITEM* DrawList, +LIB_PIN* LocateAnyPin( SCH_ITEM* DrawList, const wxPoint& RefPos, SCH_COMPONENT** libpart = NULL ); diff --git a/eeschema/symbdraw.cpp b/eeschema/symbdraw.cpp index 91f224fe7b..6a20f9fba7 100644 --- a/eeschema/symbdraw.cpp +++ b/eeschema/symbdraw.cpp @@ -22,7 +22,7 @@ /* Routines locales */ static void SymbolDisplayDraw( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ); -static void ComputeArc( LibDrawArc* DrawItem, wxPoint ArcCentre ); +static void ComputeArc( LIB_ARC* DrawItem, wxPoint ArcCentre ); static void RedrawWhileMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ); @@ -83,27 +83,27 @@ void WinEDA_bodygraphics_PropertiesFrame::bodygraphics_PropertiesAccept( wxComma switch( item->Type() ) { case COMPONENT_ARC_DRAW_TYPE: - ( (LibDrawArc*) item )->m_Fill = FlSymbol_Fill; - ( (LibDrawArc*) item )->m_Width = + ( (LIB_ARC*) item )->m_Fill = FlSymbol_Fill; + ( (LIB_ARC*) item )->m_Width = m_GraphicShapeWidthCtrl->GetValue(); break; case COMPONENT_CIRCLE_DRAW_TYPE: - ( (LibDrawCircle*) item )->m_Fill = FlSymbol_Fill; - ( (LibDrawCircle*) item )->m_Width = + ( (LIB_CIRCLE*) item )->m_Fill = FlSymbol_Fill; + ( (LIB_CIRCLE*) item )->m_Width = m_GraphicShapeWidthCtrl->GetValue(); break; case COMPONENT_RECT_DRAW_TYPE: - ( (LibDrawSquare*) item )->m_Fill = FlSymbol_Fill; - ( (LibDrawSquare*) item )->m_Width = + ( (LIB_RECTANGLE*) item )->m_Fill = FlSymbol_Fill; + ( (LIB_RECTANGLE*) item )->m_Width = m_GraphicShapeWidthCtrl->GetValue(); break; case COMPONENT_POLYLINE_DRAW_TYPE: - ( (LibDrawPolyline*) item )->m_Fill = + ( (LIB_POLYLINE*) item )->m_Fill = FlSymbol_Fill; - ( (LibDrawPolyline*) item )->m_Width = + ( (LIB_POLYLINE*) item )->m_Width = m_GraphicShapeWidthCtrl->GetValue(); break; @@ -188,7 +188,7 @@ LIB_DRAW_ITEM* WinEDA_LibeditFrame::CreateGraphicItem( LIB_COMPONENT* LibEntry, { case ID_LIBEDIT_BODY_ARC_BUTT: { - LibDrawArc* Arc = new LibDrawArc( LibEntry ); + LIB_ARC* Arc = new LIB_ARC( LibEntry ); m_drawItem = Arc; ArcStartX = ArcEndX = GetScreen()->m_Curseur.x; @@ -201,7 +201,7 @@ LIB_DRAW_ITEM* WinEDA_LibeditFrame::CreateGraphicItem( LIB_COMPONENT* LibEntry, case ID_LIBEDIT_BODY_CIRCLE_BUTT: { - LibDrawCircle* Circle = new LibDrawCircle( LibEntry ); + LIB_CIRCLE* Circle = new LIB_CIRCLE( LibEntry ); m_drawItem = Circle; Circle->m_Pos = GetScreen()->m_Curseur; @@ -213,7 +213,7 @@ LIB_DRAW_ITEM* WinEDA_LibeditFrame::CreateGraphicItem( LIB_COMPONENT* LibEntry, case ID_LIBEDIT_BODY_RECT_BUTT: { - LibDrawSquare* Square = new LibDrawSquare( LibEntry ); + LIB_RECTANGLE* Square = new LIB_RECTANGLE( LibEntry ); m_drawItem = Square; Square->m_Pos = GetScreen()->m_Curseur; @@ -226,7 +226,7 @@ LIB_DRAW_ITEM* WinEDA_LibeditFrame::CreateGraphicItem( LIB_COMPONENT* LibEntry, case ID_LIBEDIT_BODY_LINE_BUTT: { - LibDrawPolyline* polyline = new LibDrawPolyline( LibEntry ); + LIB_POLYLINE* polyline = new LIB_POLYLINE( LibEntry ); m_drawItem = polyline; wxPoint point = GetScreen()->m_Curseur; NEGATE( point.y ); @@ -239,7 +239,7 @@ LIB_DRAW_ITEM* WinEDA_LibeditFrame::CreateGraphicItem( LIB_COMPONENT* LibEntry, case COMPONENT_LINE_DRAW_TYPE: { - LibDrawSegment* Segment = new LibDrawSegment( LibEntry ); + LIB_SEGMENT* Segment = new LIB_SEGMENT( LibEntry ); m_drawItem = Segment; Segment->m_Pos = GetScreen()->m_Curseur; @@ -251,7 +251,7 @@ LIB_DRAW_ITEM* WinEDA_LibeditFrame::CreateGraphicItem( LIB_COMPONENT* LibEntry, case ID_LIBEDIT_BODY_TEXT_BUTT: { - LibDrawText* Text = new LibDrawText( LibEntry ); + LIB_TEXT* Text = new LIB_TEXT( LibEntry ); m_drawItem = Text; Text->m_Size.x = Text->m_Size.y = g_LastTextSize; @@ -332,7 +332,7 @@ void WinEDA_LibeditFrame::GraphicItemBeginDraw( wxDC* DC ) { wxPoint pos = GetScreen()->m_Curseur; NEGATE( pos.y ); - ( (LibDrawPolyline*) m_drawItem )->AddPoint( pos ); + ( (LIB_POLYLINE*) m_drawItem )->AddPoint( pos ); } break; @@ -432,12 +432,12 @@ static void SymbolDisplayDraw( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) { int Color = ReturnLayerColor( LAYER_DEVICE ); GRDashedLine( &panel->m_ClipBox, DC, ArcStartX, -ArcStartY, - ( (LibDrawArc*) item )->m_Pos.x, - -( (LibDrawArc*) item )->m_Pos.y, + ( (LIB_ARC*) item )->m_Pos.x, + -( (LIB_ARC*) item )->m_Pos.y, 0, Color ); GRDashedLine( &panel->m_ClipBox, DC, ArcEndX, -ArcEndY, - ( (LibDrawArc*) item )->m_Pos.x, - -( (LibDrawArc*) item )->m_Pos.y, + ( (LIB_ARC*) item )->m_Pos.x, + -( (LIB_ARC*) item )->m_Pos.y, 0, Color ); } } @@ -454,34 +454,34 @@ static void SymbolDisplayDraw( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) if( StateDrawArc == 2 ) { - ComputeArc( (LibDrawArc*) item, Screen->m_Curseur ); + ComputeArc( (LIB_ARC*) item, Screen->m_Curseur ); } - ( (LibDrawArc*) item )->m_Fill = FlSymbol_Fill; + ( (LIB_ARC*) item )->m_Fill = FlSymbol_Fill; break; case COMPONENT_CIRCLE_DRAW_TYPE: - dx = ( (LibDrawCircle*) item )->m_Pos.x - curr_pos.x; - dy = ( (LibDrawCircle*) item )->m_Pos.y - curr_pos.y; - ( (LibDrawCircle*) item )->m_Radius = + dx = ( (LIB_CIRCLE*) item )->m_Pos.x - curr_pos.x; + dy = ( (LIB_CIRCLE*) item )->m_Pos.y - curr_pos.y; + ( (LIB_CIRCLE*) item )->m_Radius = (int) sqrt( ( (double) dx * dx ) + ( (double) dy * dy ) ); - ( (LibDrawCircle*) item )->m_Fill = FlSymbol_Fill; + ( (LIB_CIRCLE*) item )->m_Fill = FlSymbol_Fill; break; case COMPONENT_RECT_DRAW_TYPE: - ( (LibDrawSquare*) item )->m_End = curr_pos; - ( (LibDrawSquare*) item )->m_Fill = FlSymbol_Fill; + ( (LIB_RECTANGLE*) item )->m_End = curr_pos; + ( (LIB_RECTANGLE*) item )->m_Fill = FlSymbol_Fill; break; case COMPONENT_POLYLINE_DRAW_TYPE: { - unsigned idx = ( (LibDrawPolyline*) item )->GetCornerCount() - 1; - ( (LibDrawPolyline*) item )->m_PolyPoints[idx] = curr_pos; - ( (LibDrawPolyline*) item )->m_Fill = FlSymbol_Fill; + unsigned idx = ( (LIB_POLYLINE*) item )->GetCornerCount() - 1; + ( (LIB_POLYLINE*) item )->m_PolyPoints[idx] = curr_pos; + ( (LIB_POLYLINE*) item )->m_Fill = FlSymbol_Fill; } break; case COMPONENT_LINE_DRAW_TYPE: - ( (LibDrawSegment*) item )->m_End = curr_pos; + ( (LIB_SEGMENT*) item )->m_End = curr_pos; break; case COMPONENT_GRAPHIC_TEXT_DRAW_TYPE: /* Traite par des routines specifiques */ @@ -506,12 +506,12 @@ static void SymbolDisplayDraw( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) { int Color = ReturnLayerColor( LAYER_DEVICE ); GRDashedLine( &panel->m_ClipBox, DC, ArcStartX, -ArcStartY, - ( (LibDrawArc*) item )->m_Pos.x, - -( (LibDrawArc*) item )->m_Pos.y, + ( (LIB_ARC*) item )->m_Pos.x, + -( (LIB_ARC*) item )->m_Pos.y, 0, Color ); GRDashedLine( &panel->m_ClipBox, DC, ArcEndX, -ArcEndY, - ( (LibDrawArc*) item )->m_Pos.x, - -( (LibDrawArc*) item )->m_Pos.y, + ( (LIB_ARC*) item )->m_Pos.x, + -( (LIB_ARC*) item )->m_Pos.y, 0, Color ); } } @@ -554,19 +554,19 @@ void WinEDA_LibeditFrame::EndDrawGraphicItem( wxDC* DC ) switch( m_drawItem->Type() ) { case COMPONENT_ARC_DRAW_TYPE: - ( (LibDrawArc*) m_drawItem )->m_Fill = FlSymbol_Fill; + ( (LIB_ARC*) m_drawItem )->m_Fill = FlSymbol_Fill; break; case COMPONENT_CIRCLE_DRAW_TYPE: - ( (LibDrawCircle*) m_drawItem )->m_Fill = FlSymbol_Fill; + ( (LIB_CIRCLE*) m_drawItem )->m_Fill = FlSymbol_Fill; break; case COMPONENT_RECT_DRAW_TYPE: - ( (LibDrawSquare*) m_drawItem )->m_Fill = FlSymbol_Fill; + ( (LIB_RECTANGLE*) m_drawItem )->m_Fill = FlSymbol_Fill; break; case COMPONENT_POLYLINE_DRAW_TYPE: - ( (LibDrawPolyline*) m_drawItem )->m_Fill = FlSymbol_Fill; + ( (LIB_POLYLINE*) m_drawItem )->m_Fill = FlSymbol_Fill; break; case COMPONENT_PIN_DRAW_TYPE: @@ -607,7 +607,7 @@ void WinEDA_LibeditFrame::EndDrawGraphicItem( wxDC* DC ) /***************************************************************/ -static void ComputeArc( LibDrawArc* DrawItem, wxPoint ArcCentre ) +static void ComputeArc( LIB_ARC* DrawItem, wxPoint ArcCentre ) /***************************************************************/ /* routine d'ajustage des parametres de l'arc en cours de trace @@ -705,7 +705,7 @@ void WinEDA_LibeditFrame::DeleteDrawPoly( wxDC* DC ) || m_drawItem->Type() != COMPONENT_POLYLINE_DRAW_TYPE ) return; - LibDrawPolyline* Poly = (LibDrawPolyline*) m_drawItem; + LIB_POLYLINE* Poly = (LIB_POLYLINE*) m_drawItem; m_drawItem->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, g_XorMode, NULL, DefaultTransformMatrix ); diff --git a/include/wxEeschemaStruct.h b/include/wxEeschemaStruct.h index b9e0accf4a..978a954440 100644 --- a/include/wxEeschemaStruct.h +++ b/include/wxEeschemaStruct.h @@ -31,9 +31,8 @@ class DrawSheetStruct; class DrawSheetPath; class Hierarchical_PIN_Sheet_Struct; class SCH_COMPONENT; -class LibDrawField; class SCH_CMP_FIELD; -class LibDrawPin; +class LIB_PIN; class DrawJunctionStruct; /* enum used in RotationMiroir() */ @@ -445,7 +444,7 @@ public: // Test des points de connexion en l'air (dangling ends) void TestDanglingEnds( SCH_ITEM* DrawList, wxDC* DC ); - LibDrawPin* LocatePinEnd( SCH_ITEM* DrawList, const wxPoint& pos ); + LIB_PIN* LocatePinEnd( SCH_ITEM* DrawList, const wxPoint& pos ); // ERC: /**