示例#1
0
void LIB_FIELD::Init( int id )
{
    m_id = id;

    SetTextWidth( GetDefaultTextSize() );
    SetTextHeight( GetDefaultTextSize() );

    SetTextAngle( TEXT_ANGLE_HORIZ );    // constructor already did this.

    // fields in RAM must always have names, because we are trying to get
    // less dependent on field ids and more dependent on names.
    // Plus assumptions are made in the field editors.
    m_name = TEMPLATE_FIELDNAME::GetDefaultFieldName( id );

    switch( id )
    {
    case DATASHEET:
    case FOOTPRINT:
        // by contrast, VALUE and REFERENCE are are always constructed as
        // initially visible, and template fieldsnames' initial visibility
        // is controlled by the template fieldname configuration record.
        SetVisible( false );
        break;
    }
}
示例#2
0
void CGeoAnno::CaculateTextWidth()
{
	long width=m_EndPosition.x-m_Position.x;

    int length=m_Content.GetLength();
	
	SetTextWidth(width/length);
}