2008-12-31 09:27:19 +00:00
|
|
|
/**************************************************************/
|
|
|
|
/* Lib component definitions (libentry) definition of fields */
|
|
|
|
/**************************************************************/
|
|
|
|
|
|
|
|
#ifndef CLASS_LIBENTRY_FIELDS_H
|
|
|
|
#define CLASS_LIBENTRY_FIELDS_H
|
|
|
|
|
|
|
|
|
|
|
|
/* Fields , same as component fields.
|
|
|
|
* can be defined in libraries (mandatory for ref and value, ca be useful for footprints)
|
|
|
|
* 2 Fields are always defined :
|
|
|
|
* Prefix (U, IC..) with gives the reference in schematic)
|
|
|
|
* Name (74LS00..) used to find the component in libraries, and give the default value in schematic
|
|
|
|
*/
|
|
|
|
|
2008-12-31 15:01:29 +00:00
|
|
|
class LibDrawField : public LibEDA_BaseStruct,
|
|
|
|
public EDA_TextStruct
|
2008-12-31 09:27:19 +00:00
|
|
|
{
|
|
|
|
public:
|
2008-12-31 15:01:29 +00:00
|
|
|
int m_FieldId; /* 0 = REFERENCE
|
|
|
|
* 1 = VALUE
|
|
|
|
* 3 = FOOTPRINT (default Footprint)
|
|
|
|
* 4 = DOCUMENTATION (user doc link)
|
|
|
|
* others = free fields
|
|
|
|
*/
|
2008-12-31 09:27:19 +00:00
|
|
|
wxString m_Name; /* Field Name (not the field text itself, that is .m_Text) */
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
LibDrawField* Next() const { return (LibDrawField*) Pnext; }
|
|
|
|
LibDrawField* Back() const { return (LibDrawField*) Pback; }
|
|
|
|
|
|
|
|
|
|
|
|
LibDrawField( int idfield = 2 );
|
|
|
|
~LibDrawField();
|
|
|
|
virtual wxString GetClass() const
|
|
|
|
{
|
|
|
|
return wxT( "LibDrawField" );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function Save
|
|
|
|
* writes the data structures for this object out to a FILE in "*.brd" format.
|
|
|
|
* @param aFile The FILE to write to.
|
|
|
|
* @return bool - true if success writing else false.
|
|
|
|
*/
|
2008-12-31 15:01:29 +00:00
|
|
|
virtual bool Save( FILE* aFile ) const;
|
2008-12-31 09:27:19 +00:00
|
|
|
|
|
|
|
|
2008-12-31 15:01:29 +00:00
|
|
|
LibDrawField* GenCopy();
|
2008-12-31 09:27:19 +00:00
|
|
|
|
|
|
|
/** Function Copy
|
|
|
|
* copy parameters of this to Target. Pointers are not copied
|
2008-12-31 15:01:29 +00:00
|
|
|
* @param aTarget = the LibDrawField to set with "this" values
|
2008-12-31 09:27:19 +00:00
|
|
|
*/
|
2008-12-31 15:01:29 +00:00
|
|
|
void Copy( LibDrawField* aTarget ) const;
|
2008-12-31 09:27:19 +00:00
|
|
|
|
2008-12-31 15:01:29 +00:00
|
|
|
void SetFields( const std::vector <LibDrawField> aFields );
|
2008-12-31 09:27:19 +00:00
|
|
|
|
|
|
|
void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC, const wxPoint &aOffset, int aColor,
|
2009-01-02 17:07:50 +00:00
|
|
|
int aDrawMode, void* aData, const int aTransformMatrix[2][2] );
|
2008-12-31 09:27:19 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function HitTest
|
|
|
|
* tests if the given wxPoint is within the bounds of this object.
|
|
|
|
* @param refPos A wxPoint to test, in Field coordinate system
|
|
|
|
* @return bool - true if a hit, else false
|
|
|
|
*/
|
2008-12-31 15:01:29 +00:00
|
|
|
bool HitTest( const wxPoint& refPos );
|
2008-12-31 09:27:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CLASS_LIBENTRY_FIELDS_H
|