mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-21 09:41:41 +00:00
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.
This commit is contained in:
parent
498f0c9164
commit
ee918d7d29
eeschema
CMakeLists.txtblock.cppbus-wire-junction.cppclass_BodyItem_Text.cppclass_libentry.cppclass_libentry.hclass_libentry_fields.cppclass_libentry_fields.hclass_library.cppclass_library.hclass_pin.cppclass_sch_cmp_field.cppclass_sch_cmp_field.hclass_sch_component.cppclasses_body_items.cppclasses_body_items.hcontrole.cppcross-probing.cppdangling_ends.cppdialog_cmp_graphic_properties.cppdialog_create_component.hdialog_create_component.pjddialog_create_component.rcdialog_edit_libentry_fields_in_lib.cppdialog_lib_new_component.cppdialog_lib_new_component.fbpdialog_lib_new_component.hdialog_lib_new_component_base.cppdialog_lib_new_component_base.hedit_graphic_bodyitem_text.cppfind.cppgetpart.cpphotkeys.cpplibedit.cpplibedit_onleftclick.cpplibedit_onrightclick.cpplibeditfrm.hlibfield.cpplibframe.cpplocate.cppnetform.cppnetlist.cpppinedit-dialog.cpppinedit.cppprotos.hsymbdraw.cpp
include
@ -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
|
||||
|
@ -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 )
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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 <LibDrawField> to import.
|
||||
* @param aFields a std::vector <LIB_FIELD> to import.
|
||||
*/
|
||||
void LIB_COMPONENT::SetFields( const std::vector <LibDrawField> aFields )
|
||||
void LIB_COMPONENT::SetFields( const std::vector <LIB_FIELD> 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 <LibDrawField> 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 <LibDrawField> 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 )
|
||||
{
|
||||
|
@ -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<LibDrawField> m_Fields; /* Auxiliary Field list (id >= 2 ) */
|
||||
long m_LastDate; // Last change Date
|
||||
DLIST<LIB_FIELD> 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 <LibDrawField> to import.
|
||||
* @param aFields - a std::vector <LIB_FIELD> to import.
|
||||
*/
|
||||
void SetFields( const std::vector <LibDrawField> aFields );
|
||||
void SetFields( const std::vector <LIB_FIELD> 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 );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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;
|
||||
|
@ -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 <LibDrawField> aFields );
|
||||
void SetFields( const std::vector <LIB_FIELD> 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
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
#include <wx/tokenzr.h>
|
||||
#include <wx/regex.h>
|
||||
|
||||
|
||||
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 )
|
||||
|
@ -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.
|
||||
*
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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
|
||||
|
@ -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( "??" );
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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<wxPoint> 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<wxPoint> 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
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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 );
|
||||
|
@ -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;
|
||||
|
@ -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_
|
File diff suppressed because it is too large
Load Diff
@ -1,3 +0,0 @@
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
#include "wx/msw/wx.rc"
|
||||
#endif
|
@ -32,8 +32,8 @@ private:
|
||||
LIB_COMPONENT* m_LibEntry;
|
||||
bool m_skipCopyFromPanel;
|
||||
|
||||
/// a copy of the edited component's LibDrawFields
|
||||
std::vector <LibDrawField> m_FieldsBuf;
|
||||
/// a copy of the edited component's LIB_FIELDs
|
||||
std::vector <LIB_FIELD> 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;
|
||||
|
7
eeschema/dialog_lib_new_component.cpp
Normal file
7
eeschema/dialog_lib_new_component.cpp
Normal file
@ -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 );
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user