|
|
|
@ -19,7 +19,7 @@ |
|
|
|
/*******************************************************************/ |
|
|
|
|
|
|
|
TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) : |
|
|
|
BOARD_ITEM( parent, TYPE_TEXTE_MODULE ), EDA_TextStruct () |
|
|
|
BOARD_ITEM( parent, TYPE_TEXTE_MODULE ), EDA_TextStruct() |
|
|
|
{ |
|
|
|
MODULE* Module = (MODULE*) m_Parent; |
|
|
|
|
|
|
|
@ -110,7 +110,7 @@ int TEXTE_MODULE::ReadDescr( char* aLine, FILE* aFile, int* aLineNum ) |
|
|
|
BufCar1[0] = 0; |
|
|
|
BufCar2[0] = 0; |
|
|
|
BufCar3[0] = 0; |
|
|
|
if ( sscanf( aLine + 1, "%d %d %d %d %d %d %d %s %s %d %s", |
|
|
|
if( sscanf( aLine + 1, "%d %d %d %d %d %d %d %s %s %d %s", |
|
|
|
&type, |
|
|
|
&m_Pos0.x, &m_Pos0.y, |
|
|
|
&m_Size.y, &m_Size.x, |
|
|
|
@ -124,7 +124,7 @@ int TEXTE_MODULE::ReadDescr( char* aLine, FILE* aFile, int* aLineNum ) |
|
|
|
|
|
|
|
// Due to the pcbnew history, .m_Orient is saved in screen value
|
|
|
|
// but it is handled as relative to its parent footprint
|
|
|
|
m_Orient -= ((MODULE * )m_Parent)->m_Orient; |
|
|
|
m_Orient -= ( (MODULE*) m_Parent )->m_Orient; |
|
|
|
if( BufCar1[0] == 'M' ) |
|
|
|
m_Mirror = true; |
|
|
|
else |
|
|
|
@ -336,7 +336,9 @@ void TEXTE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, |
|
|
|
wxPoint pos; // Center of text
|
|
|
|
PCB_SCREEN* screen; |
|
|
|
WinEDA_BasePcbFrame* frame; |
|
|
|
MODULE* Module = (MODULE*) m_Parent; |
|
|
|
MODULE* Module = (MODULE*) m_Parent; /* parent must *not* be null
|
|
|
|
* (a module text without a footprint parent has no sense) |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
if( panel == NULL ) |
|
|
|
@ -371,18 +373,16 @@ void TEXTE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, |
|
|
|
pos.x, pos.y + anchor_size, 0, g_AnchorColor ); |
|
|
|
} |
|
|
|
|
|
|
|
//@@@@IMB: BIG BIG BUG Here???? May Module be NULL?
|
|
|
|
color = g_DesignSettings.m_LayerColor[Module->GetLayer()]; |
|
|
|
|
|
|
|
|
|
|
|
//@@IMB: Why the next ifs are testing for Module?
|
|
|
|
if( Module && Module->GetLayer() == COPPER_LAYER_N ) |
|
|
|
if( Module->GetLayer() == COPPER_LAYER_N ) |
|
|
|
{ |
|
|
|
if( g_DesignSettings.IsElementVisible( MODULE_TEXT_CU_VISIBLE ) == false ) |
|
|
|
return; |
|
|
|
color = g_ModuleTextCUColor; |
|
|
|
} |
|
|
|
else if( Module && Module->GetLayer() == CMP_N ) |
|
|
|
else if( Module->GetLayer() == CMP_N ) |
|
|
|
{ |
|
|
|
if( g_DesignSettings.IsElementVisible( MODULE_TEXT_CMP_VISIBLE ) == false ) |
|
|
|
return; |
|
|
|
@ -419,12 +419,9 @@ int TEXTE_MODULE::GetDrawRotation() |
|
|
|
NORMALIZE_ANGLE_POS( rotation ); |
|
|
|
|
|
|
|
// For angle = 0 .. 180 deg
|
|
|
|
// if( (rotation > 900 ) && (rotation < 2700 ) ) rotation -= 1800;
|
|
|
|
while( rotation > 900 ) |
|
|
|
rotation -= 1800; |
|
|
|
|
|
|
|
// For angle = -90 .. 90 deg
|
|
|
|
|
|
|
|
return rotation; |
|
|
|
} |
|
|
|
|
|
|
|
@ -433,13 +430,15 @@ int TEXTE_MODULE::GetDrawRotation() |
|
|
|
void TEXTE_MODULE::DisplayInfo( WinEDA_DrawFrame* frame ) |
|
|
|
{ |
|
|
|
MODULE* module = (MODULE*) m_Parent; |
|
|
|
|
|
|
|
if( module == NULL ) // Happens in modedit, and for new texts
|
|
|
|
return; |
|
|
|
|
|
|
|
wxString msg, Line; |
|
|
|
int ii; |
|
|
|
|
|
|
|
static const wxString text_type_msg[3] = { |
|
|
|
static const wxString text_type_msg[3] = |
|
|
|
{ |
|
|
|
_( "Ref." ), _( "Value" ), _( "Text" ) |
|
|
|
}; |
|
|
|
|
|
|
|
@ -523,7 +522,7 @@ bool TEXTE_MODULE::IsOnLayer( int aLayer ) const |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
#if defined (DEBUG)
|
|
|
|
#if defined(DEBUG)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function Show |
|
|
|
|