2007-08-04 20:05:54 +00:00
|
|
|
|
/***************************************************/
|
|
|
|
|
/* class_text_module.h : texts module description */
|
|
|
|
|
/***************************************************/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-14 19:24:48 +00:00
|
|
|
|
|
|
|
|
|
#ifndef TEXT_MODULE_H
|
|
|
|
|
#define TEXT_MODULE_H
|
|
|
|
|
|
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
|
/* Description des Textes sur Modules : */
|
|
|
|
|
#define TEXT_is_REFERENCE 0
|
2007-08-04 20:05:54 +00:00
|
|
|
|
#define TEXT_is_VALUE 1
|
|
|
|
|
#define TEXT_is_DIVERS 2
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
|
2007-08-04 20:05:54 +00:00
|
|
|
|
class TEXTE_MODULE : public EDA_BaseStruct
|
2007-06-05 12:10:51 +00:00
|
|
|
|
{
|
|
|
|
|
public:
|
2007-08-04 20:05:54 +00:00
|
|
|
|
int m_Layer; // layer number
|
|
|
|
|
int m_Width;
|
|
|
|
|
wxPoint m_Pos; // Real coord
|
|
|
|
|
wxPoint m_Pos0; // coord du debut du texte /ancre, orient 0
|
|
|
|
|
char m_Unused; // unused (reserved for future extensions)
|
|
|
|
|
char m_Miroir; // vue normale / miroir
|
|
|
|
|
char m_NoShow; // 0: visible 1: invisible (bool)
|
|
|
|
|
char m_Type; // 0: ref,1: val, autre = 2..255
|
|
|
|
|
int m_Orient; // orientation en 1/10 degre
|
|
|
|
|
wxSize m_Size; // dimensions (en X et Y) du texte
|
|
|
|
|
wxString m_Text;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
TEXTE_MODULE( MODULE* parent, int text_type = TEXT_is_DIVERS );
|
|
|
|
|
~TEXTE_MODULE( void );
|
|
|
|
|
|
|
|
|
|
/* supprime du chainage la structure Struct */
|
|
|
|
|
void UnLink( void );
|
|
|
|
|
|
|
|
|
|
void Copy( TEXTE_MODULE* source ); // copy structure
|
|
|
|
|
|
|
|
|
|
/* Gestion du texte */
|
|
|
|
|
void SetWidth( int new_width );
|
|
|
|
|
int GetLength( void ); /* text length */
|
|
|
|
|
int Pitch( void ); /* retourne le pas entre 2 caracteres */
|
|
|
|
|
int GetDrawRotation( void ); // Return text rotation for drawings and plotting
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-04 20:05:54 +00:00
|
|
|
|
void SetDrawCoord( void ); // mise a jour des coordonn<6E>s absolues de trac<61>
|
|
|
|
|
// a partir des coord relatives
|
|
|
|
|
|
|
|
|
|
void SetLocalCoord( void ); // mise a jour des coordonn<6E>s relatives
|
|
|
|
|
|
|
|
|
|
// a partir des coord absolues de trac<61>
|
|
|
|
|
/* Reading and writing data on files */
|
|
|
|
|
int WriteDescr( FILE* File );
|
|
|
|
|
int ReadDescr( FILE* File, int* LineNum = NULL );
|
|
|
|
|
|
|
|
|
|
/* drawing functions */
|
|
|
|
|
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, wxPoint offset, int draw_mode );
|
|
|
|
|
|
2007-08-20 19:33:15 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Function Display_Infos
|
|
|
|
|
* has knowledge about the frame and how and where to put status information
|
|
|
|
|
* about this object into the frame's message panel.
|
|
|
|
|
* Is virtual from EDA_BaseStruct.
|
|
|
|
|
* @param frame A WinEDA_BasePcbFrame in which to print status information.
|
|
|
|
|
*/
|
|
|
|
|
void Display_Infos( WinEDA_DrawFrame* frame );
|
|
|
|
|
|
|
|
|
|
|
2007-08-04 20:05:54 +00:00
|
|
|
|
/**
|
|
|
|
|
* Function HitTest
|
|
|
|
|
* tests if the given wxPoint is within the bounds of this object.
|
|
|
|
|
* @param posref A wxPoint to test
|
|
|
|
|
* @return bool - true if a hit, else false
|
|
|
|
|
*/
|
|
|
|
|
bool HitTest( const wxPoint& posref );
|
2007-08-06 20:26:59 +00:00
|
|
|
|
|
|
|
|
|
#if defined(DEBUG)
|
2007-08-07 06:21:19 +00:00
|
|
|
|
/**
|
|
|
|
|
* Function GetClass
|
|
|
|
|
* returns the class name.
|
|
|
|
|
* @return wxString
|
|
|
|
|
*/
|
|
|
|
|
virtual wxString GetClass() const
|
|
|
|
|
{
|
|
|
|
|
return wxT( "MTEXT" );
|
|
|
|
|
}
|
|
|
|
|
|
2007-08-06 20:26:59 +00:00
|
|
|
|
/**
|
|
|
|
|
* Function Show
|
|
|
|
|
* is used to output the object tree, currently for debugging only.
|
|
|
|
|
* @param nestLevel An aid to prettier tree indenting, and is the level
|
|
|
|
|
* of nesting of this object within the overall tree.
|
|
|
|
|
* @param os The ostream& to output to.
|
|
|
|
|
*/
|
|
|
|
|
virtual void Show( int nestLevel, std::ostream& os );
|
|
|
|
|
#endif
|
2007-08-04 20:05:54 +00:00
|
|
|
|
};
|
2007-08-14 19:24:48 +00:00
|
|
|
|
|
|
|
|
|
#endif // TEXT_MODULE_H
|
|
|
|
|
|