Commit ce9db78c authored by charras's avatar charras

Cleaned and optimized code about new hershey fonts and bold texts handling (see changelog)

parent b4c639a6
...@@ -4,6 +4,16 @@ KiCad ChangeLog 2009 ...@@ -4,6 +4,16 @@ KiCad ChangeLog 2009
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. email address.
2009-may-30 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
++All:
Cleaned and optimized code about new hershey fonts and bold texts handling.
Bold texts use now the same font as normal texts.
Only the pen size used to draw them is bigger.
- The max pen size allowed depending on texts sizes is now tested
when loading boards and modules, and clamped if too large.
2009-may-28 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr> 2009-may-28 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================ ================================================================================
......
...@@ -19,13 +19,56 @@ ...@@ -19,13 +19,56 @@
#define EDA_DRAWBASE #define EDA_DRAWBASE
#include "hershey_fonts.h" #include "hershey_fonts.h"
/* factor used to calculate actual size of shapes from hershey fonts (could be adjusted depending on the font name) /* factor used to calculate actual size of shapes from hershey fonts (could be adjusted depending on the font name)
* Its value is choosen in order to have letters like M, P .. vertical size equal to the vertical char size parameter * Its value is choosen in order to have letters like M, P .. vertical size equal to the vertical char size parameter
* Of course some shapes can be bigger or smaller than the vertical char size parameter * Of course some shapes can be bigger or smaller than the vertical char size parameter
*/ */
#define HERSHEY_SCALE_FACTOR 1/21.0 #define HERSHEY_SCALE_FACTOR 1 / 21.0
double s_HerscheyScaleFactor = HERSHEY_SCALE_FACTOR; double s_HerscheyScaleFactor = HERSHEY_SCALE_FACTOR;
/** Function GetPensizeForBold
* @return the "best" value for a pen size to draw/plot a bold text
* @param aTextSize = the char size (height or width)
*/
int GetPenSizeForBold( int aTextSize )
{
return wxRound( aTextSize / 5.0 );
}
/** Function Clamp_Text_PenSize
*As a rule, pen width should not be >1/4em, otherwise the character
* will be cluttered up in its own fatness
* so pen width max is aSize/4 for bold text, and aSize/6 for normal text
* The "best" pen width is aSize/5 for bold texts,
* so the clamp is consistant with bold option.
* @param aPenSize = the pen size to clamp
* @param aSize the char size (height or width)
* @param aBold = true if text accept bold pen size
* @return the max pen size allowed
*/
int Clamp_Text_PenSize( int aPenSize, int aSize, bool aBold )
{
int penSize = aPenSize;
double scale = aBold ? 4.0 : 6.0;
int maxWidth = wxRound( ABS( aSize ) / scale );
if( penSize > maxWidth )
penSize = maxWidth;
return penSize;
}
int Clamp_Text_PenSize( int aPenSize, wxSize aSize, bool aBold )
{
int size = MIN( ABS( aSize.x ), ABS( aSize.y ) );
return Clamp_Text_PenSize(aPenSize, size, aBold);;
}
/* Functions to draw / plot a string. /* Functions to draw / plot a string.
* texts have only one line. * texts have only one line.
* They can be in italic. * They can be in italic.
...@@ -53,9 +96,15 @@ int NegableTextLength( const wxString& aText ) ...@@ -53,9 +96,15 @@ int NegableTextLength( const wxString& aText )
} }
static const char* get_hershey_recipe( int AsciiCode, bool bold )
{
/* Function GetHersheyShapeDescription()
* return a pointer to the shape corresponding to unicode value AsciiCode
* Note we use the same font for Bold and Normal texts
* because kicad handles a variable pen size to do that
* that gives better results in XOR draw mode.
*/
static const char* GetHersheyShapeDescription( int AsciiCode )
{
#if defined(KICAD_CYRILLIC) #if defined(KICAD_CYRILLIC)
AsciiCode &= 0x7FF; AsciiCode &= 0x7FF;
if( AsciiCode > 0x40F && AsciiCode < 0x450 ) // big small Cyr if( AsciiCode > 0x40F && AsciiCode < 0x450 ) // big small Cyr
...@@ -77,18 +126,11 @@ static const char* get_hershey_recipe( int AsciiCode, bool bold ) ...@@ -77,18 +126,11 @@ static const char* get_hershey_recipe( int AsciiCode, bool bold )
AsciiCode = 32; /* Clamp control chars */ AsciiCode = 32; /* Clamp control chars */
AsciiCode -= 32; AsciiCode -= 32;
if( bold ) return hershey_simplex[AsciiCode];
{
return hershey_duplex[AsciiCode];
}
else
{
return hershey_simplex[AsciiCode];
}
} }
int ReturnGraphicTextWidth( const wxString& aText, int aXSize, bool italic, bool bold ) int ReturnGraphicTextWidth( const wxString& aText, int aXSize, bool aItalic, bool aWidth )
{ {
int tally = 0; int tally = 0;
int char_count = aText.length(); int char_count = aText.length();
...@@ -102,7 +144,7 @@ int ReturnGraphicTextWidth( const wxString& aText, int aXSize, bool italic, bool ...@@ -102,7 +144,7 @@ int ReturnGraphicTextWidth( const wxString& aText, int aXSize, bool italic, bool
continue; continue;
} }
const char* ptcar = get_hershey_recipe( AsciiCode, bold ); const char* ptcar = GetHersheyShapeDescription( AsciiCode );
/* Get metrics */ /* Get metrics */
int xsta = *ptcar++ - 'R'; int xsta = *ptcar++ - 'R';
int xsto = *ptcar++ - 'R'; int xsto = *ptcar++ - 'R';
...@@ -110,7 +152,7 @@ int ReturnGraphicTextWidth( const wxString& aText, int aXSize, bool italic, bool ...@@ -110,7 +152,7 @@ int ReturnGraphicTextWidth( const wxString& aText, int aXSize, bool italic, bool
} }
/* Italic correction, 1/8em */ /* Italic correction, 1/8em */
if( italic ) if( aItalic )
{ {
tally += wxRound( aXSize * 0.125 ); tally += wxRound( aXSize * 0.125 );
} }
...@@ -149,35 +191,11 @@ static void DrawGraphicTextPline( ...@@ -149,35 +191,11 @@ static void DrawGraphicTextPline(
} }
/* Helper function for texts with over bar
*/
static int overbar_position( int size_v, int thickness ) static int overbar_position( int size_v, int thickness )
{ {
return wxRound( ((double) size_v * 26 * s_HerscheyScaleFactor ) + ((double) thickness * 1.5) ); return wxRound( ( (double) size_v * 26 * s_HerscheyScaleFactor ) + ( (double) thickness * 1.5 ) );
}
static int clamp_text_pen_size( int width, int size_h, bool bold )
{
/* As a rule, pen width should not be >1/8em, otherwise the character
* will be cluttered up in its own fatness */
/* XXX @todo: Should be handled in the UI and gerber plotter too */
int maxWidth = wxRound( ABS( size_h ) / 8.0 );
if( width > maxWidth )
{
width = maxWidth;
}
/* Special rule for bold text: the width should be at least 1.42 times the
* quantum unit, otherwise the line pairs will be visible! */
if( bold )
{
int minWidth = wxRound( ABS( size_h ) * 1.42 * s_HerscheyScaleFactor + 0.5 );
if( width < minWidth )
{
width = minWidth;
}
}
return width;
} }
...@@ -192,10 +210,11 @@ static int clamp_text_pen_size( int width, int size_h, bool bold ) ...@@ -192,10 +210,11 @@ static int clamp_text_pen_size( int width, int size_h, bool bold )
* @param aSize = text size (size.x or size.y can be < 0 for mirrored texts) * @param aSize = text size (size.x or size.y can be < 0 for mirrored texts)
* @param aH_justify = horizontal justification (Left, center, right) * @param aH_justify = horizontal justification (Left, center, right)
* @param aV_justify = vertical justification (bottom, center, top) * @param aV_justify = vertical justification (bottom, center, top)
* @param aWidth = line width (pen width) (default = 0) * @param aWidth = line width (pen width) (use default width if aWidth = 0)
* if width < 0 : draw segments in sketch mode, width = abs(width) * if width < 0 : draw segments in sketch mode, width = abs(width)
* Use a value min(aSize.x, aSize.y) / 5 for a bold text
* @param aItalic = true to simulate an italic font * @param aItalic = true to simulate an italic font
* @param aBold = true to use a bold font * @param aBold = true to use a bold font. Useful only with default width value (aWidth = 0)
* @param aCallback() = function called (if non null) to draw each segment. * @param aCallback() = function called (if non null) to draw each segment.
* used to draw 3D texts or for plotting, NULL for normal drawings * used to draw 3D texts or for plotting, NULL for normal drawings
*/ */
...@@ -233,6 +252,9 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel, ...@@ -233,6 +252,9 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
size_h = aSize.x; /* PLEASE NOTE: H is for HORIZONTAL not for HEIGHT */ size_h = aSize.x; /* PLEASE NOTE: H is for HORIZONTAL not for HEIGHT */
size_v = aSize.y; size_v = aSize.y;
if( aWidth == 0 && aBold ) // Use default values if aWidth == 0
aWidth = GetPenSizeForBold( MIN( aSize.x, aSize.y ) );
if( aWidth < 0 ) if( aWidth < 0 )
{ {
aWidth = -aWidth; aWidth = -aWidth;
...@@ -241,15 +263,13 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel, ...@@ -241,15 +263,13 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
if( size_h < 0 ) // text is mirrored using size.x < 0 (mirror / Y axis) if( size_h < 0 ) // text is mirrored using size.x < 0 (mirror / Y axis)
italic_reverse = true; italic_reverse = true;
aWidth = clamp_text_pen_size( aWidth, size_h, aBold );
char_count = NegableTextLength( aText ); char_count = NegableTextLength( aText );
if( char_count == 0 ) if( char_count == 0 )
return; return;
current_char_pos = aPos; current_char_pos = aPos;
dx = ReturnGraphicTextWidth( aText, size_h, aItalic, aBold ); dx = ReturnGraphicTextWidth( aText, size_h, aItalic, aWidth );
dy = size_v; dy = size_v;
/* Do not draw the text if out of draw area! */ /* Do not draw the text if out of draw area! */
...@@ -381,7 +401,7 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel, ...@@ -381,7 +401,7 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
AsciiCode = aText.GetChar( ptr + overbars ); AsciiCode = aText.GetChar( ptr + overbars );
const char* ptcar = get_hershey_recipe( AsciiCode, aBold ); const char* ptcar = GetHersheyShapeDescription( AsciiCode );
/* Get metrics */ /* Get metrics */
int xsta = *ptcar++ - 'R'; int xsta = *ptcar++ - 'R';
int xsto = *ptcar++ - 'R'; int xsto = *ptcar++ - 'R';
...@@ -468,7 +488,7 @@ static bool s_Plotbegin; // Flag to init plot ...@@ -468,7 +488,7 @@ static bool s_Plotbegin; // Flag to init plot
* The call back function * The call back function
*/ */
/****************************************************************/ /****************************************************************/
static void s_Callback_plot( int x0, int y0, int xf, int yf ) static void s_Callback_plot( int x0, int y0, int xf, int yf )
/****************************************************************/ /****************************************************************/
{ {
static wxPoint PenLastPos; static wxPoint PenLastPos;
...@@ -514,8 +534,9 @@ static void s_Callback_plot( int x0, int y0, int xf, int yf ) ...@@ -514,8 +534,9 @@ static void s_Callback_plot( int x0, int y0, int xf, int yf )
* @param aV_justify = vertical justification (bottom, center, top) * @param aV_justify = vertical justification (bottom, center, top)
* @param aWidth = line width (pen width) (default = 0) * @param aWidth = line width (pen width) (default = 0)
* if width < 0 : draw segments in sketch mode, width = abs(width) * if width < 0 : draw segments in sketch mode, width = abs(width)
* Use a value min(aSize.x, aSize.y) / 5 for a bold text
* @param aItalic = true to simulate an italic font * @param aItalic = true to simulate an italic font
* @param aBold = true to use a bold font * @param aBold = true to use a bold font Useful only with default width value (aWidth = 0)
*/ */
/******************************************************************************************/ /******************************************************************************************/
void PlotGraphicText( int aFormat_plot, void PlotGraphicText( int aFormat_plot,
...@@ -531,14 +552,8 @@ void PlotGraphicText( int aFormat_plot, ...@@ -531,14 +552,8 @@ void PlotGraphicText( int aFormat_plot,
bool aBold ) bool aBold )
/******************************************************************************************/ /******************************************************************************************/
{ {
if( aWidth > 0 ) if( aWidth == 0 && aBold ) // Use default values if aWidth == 0
{ aWidth = GetPenSizeForBold( MIN( aSize.x, aSize.y ) );
aWidth = clamp_text_pen_size( aWidth, aSize.x, aBold );
}
else
{
aWidth = -clamp_text_pen_size( -aWidth, aSize.x, aBold );
}
// Initialise the actual function used to plot lines: // Initialise the actual function used to plot lines:
switch( aFormat_plot ) switch( aFormat_plot )
...@@ -568,7 +583,8 @@ void PlotGraphicText( int aFormat_plot, ...@@ -568,7 +583,8 @@ void PlotGraphicText( int aFormat_plot,
DrawGraphicText( NULL, NULL, aPos, aColor, aText, DrawGraphicText( NULL, NULL, aPos, aColor, aText,
aOrient, aSize, aOrient, aSize,
aH_justify, aV_justify, aH_justify, aV_justify,
aWidth, aItalic, aBold, aWidth, aItalic,
aBold,
s_Callback_plot ); s_Callback_plot );
/* end text : pen UP ,no move */ /* end text : pen UP ,no move */
......
...@@ -325,11 +325,7 @@ void GRSetBrush( wxDC* DC, int Color, int fill ) ...@@ -325,11 +325,7 @@ void GRSetBrush( wxDC* DC, int Color, int fill )
if( ForceBlackPen ) if( ForceBlackPen )
Color = BLACK; Color = BLACK;
wxBrush DrawBrush; wxBrush DrawBrush;
DrawBrush.SetColour( DrawBrush.SetColour( MakeColour( Color ) );
ColorRefs[Color].m_Red,
ColorRefs[Color].m_Green,
ColorRefs[Color].m_Blue
);
if( fill ) if( fill )
DrawBrush.SetStyle( wxSOLID ); DrawBrush.SetStyle( wxSOLID );
......
...@@ -19,901 +19,901 @@ ...@@ -19,901 +19,901 @@
Ki_WorkSheetData WS_Date = Ki_WorkSheetData WS_Date =
{ {
WS_DATE, WS_DATE,
&WS_Licence, &WS_Licence,
BLOCK_DATE_X, BLOCK_DATE_Y, BLOCK_DATE_X, BLOCK_DATE_Y,
0,0, 0, 0,
#if defined(KICAD_GOST) #if defined(KICAD_GOST)
NULL, NULL NULL, NULL
#else #else
wxT("Date: "), NULL wxT( "Date: " ),NULL
#endif #endif
}; };
Ki_WorkSheetData WS_Licence = Ki_WorkSheetData WS_Licence =
{ {
WS_KICAD_VERSION, WS_KICAD_VERSION,
&WS_Revision, &WS_Revision,
BLOCK_KICAD_VERSION_X, BLOCK_KICAD_VERSION_Y, BLOCK_KICAD_VERSION_X,BLOCK_KICAD_VERSION_Y,
0,0, 0, 0,
NULL, NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Revision = Ki_WorkSheetData WS_Revision =
{ {
WS_REV, WS_REV,
&WS_SizeSheet, &WS_SizeSheet,
#if defined(KICAD_GOST) #if defined(KICAD_GOST)
STAMP_X_185 - 30, STAMP_Y_30 + 90, STAMP_X_185 - 30,STAMP_Y_30 + 90,
#else #else
BLOCK_REV_X, BLOCK_REV_Y, BLOCK_REV_X, BLOCK_REV_Y,
#endif #endif
0,0, 0, 0,
#if defined(KICAD_GOST) #if defined(KICAD_GOST)
NULL, NULL NULL, NULL
#else #else
wxT("Rev: "), NULL wxT( "Rev: " ), NULL
#endif #endif
}; };
Ki_WorkSheetData WS_SizeSheet = Ki_WorkSheetData WS_SizeSheet =
{ {
WS_SIZESHEET, WS_SIZESHEET,
#if defined(KICAD_GOST) #if defined(KICAD_GOST)
&WS_Title, &WS_Title,
BLOCK_SIZE_SHEET_X, BLOCK_SIZE_SHEET_Y, BLOCK_SIZE_SHEET_X,BLOCK_SIZE_SHEET_Y,
0,0, 0, 0,
NULL, NULL NULL, NULL
}; };
#else #else
&WS_IdentSheet, &WS_IdentSheet,
BLOCK_SIZE_SHEET_X, BLOCK_SIZE_SHEET_Y, BLOCK_SIZE_SHEET_X, BLOCK_SIZE_SHEET_Y,
0,0, 0, 0,
wxT("Size: "),NULL wxT( "Size: " ), NULL
}; };
Ki_WorkSheetData WS_IdentSheet = Ki_WorkSheetData WS_IdentSheet =
{ {
WS_IDENTSHEET, WS_IDENTSHEET,
&WS_Title, &WS_Title,
BLOCK_ID_SHEET_X, BLOCK_ID_SHEET_Y, BLOCK_ID_SHEET_X,BLOCK_ID_SHEET_Y,
0,0, 0, 0,
wxT("Id: "),NULL wxT( "Id: " ), NULL
}; };
#endif #endif
Ki_WorkSheetData WS_Title = Ki_WorkSheetData WS_Title =
{ {
WS_TITLE, WS_TITLE,
&WS_SheetFilename, &WS_SheetFilename,
BLOCK_TITLE_X, BLOCK_TITLE_Y, BLOCK_TITLE_X, BLOCK_TITLE_Y,
0,0, 0, 0,
#if defined(KICAD_GOST) #if defined(KICAD_GOST)
NULL, NULL NULL, NULL
#else #else
wxT("Title: "),NULL wxT( "Title: " ), NULL
#endif #endif
}; };
Ki_WorkSheetData WS_SheetFilename = Ki_WorkSheetData WS_SheetFilename =
{ {
WS_FILENAME, WS_FILENAME,
&WS_FullSheetName, &WS_FullSheetName,
BLOCK_FILENAME_X, BLOCK_FILENAME_Y, BLOCK_FILENAME_X, BLOCK_FILENAME_Y,
0,0, 0, 0,
wxT("File: "),NULL wxT( "File: " ), NULL
}; };
Ki_WorkSheetData WS_FullSheetName = Ki_WorkSheetData WS_FullSheetName =
{ {
WS_FULLSHEETNAME, WS_FULLSHEETNAME,
&WS_Company, &WS_Company,
BLOCK_FULLSHEETNAME_X, BLOCK_FULLSHEETNAME_Y, BLOCK_FULLSHEETNAME_X,BLOCK_FULLSHEETNAME_Y,
0,0, 0, 0,
wxT("Sheet: "),NULL wxT( "Sheet: " ), NULL
}; };
Ki_WorkSheetData WS_Company = Ki_WorkSheetData WS_Company =
{ {
WS_COMPANY_NAME, WS_COMPANY_NAME,
&WS_Comment1, &WS_Comment1,
BLOCK_COMMENT_X, BLOCK_COMPANY_Y, BLOCK_COMMENT_X,BLOCK_COMPANY_Y,
0,0, 0, 0,
NULL,NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Comment1 = Ki_WorkSheetData WS_Comment1 =
{ {
WS_COMMENT1, WS_COMMENT1,
&WS_Comment2, &WS_Comment2,
#if defined(KICAD_GOST) #if defined(KICAD_GOST)
STAMP_OX, STAMP_OY, STAMP_OX, STAMP_OY,
STAMP_OX, 0, STAMP_OX, 0,
#else #else
BLOCK_COMMENT_X, BLOCK_COMMENT1_Y, BLOCK_COMMENT_X,BLOCK_COMMENT1_Y,
0,0, 0, 0,
#endif #endif
NULL,NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Comment2 = Ki_WorkSheetData WS_Comment2 =
{ {
WS_COMMENT2, WS_COMMENT2,
&WS_Comment3, &WS_Comment3,
#if defined(KICAD_GOST) #if defined(KICAD_GOST)
STAMP_OX, STAMP_OY, STAMP_OX, STAMP_OY,
STAMP_OX, 0, STAMP_OX, 0,
#else #else
BLOCK_COMMENT_X, BLOCK_COMMENT2_Y, BLOCK_COMMENT_X,BLOCK_COMMENT2_Y,
0,0, 0, 0,
#endif #endif
NULL,NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Comment3 = Ki_WorkSheetData WS_Comment3 =
{ {
WS_COMMENT3, WS_COMMENT3,
&WS_Comment4, &WS_Comment4,
#if defined(KICAD_GOST) #if defined(KICAD_GOST)
STAMP_OX, STAMP_OY, STAMP_OX, STAMP_OY,
STAMP_OX, 0, STAMP_OX, 0,
#else #else
BLOCK_COMMENT_X, BLOCK_COMMENT3_Y, BLOCK_COMMENT_X,BLOCK_COMMENT3_Y,
0,0, 0, 0,
#endif #endif
NULL,NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Comment4 = Ki_WorkSheetData WS_Comment4 =
{ {
WS_COMMENT4, WS_COMMENT4,
&WS_MostLeftLine, &WS_MostLeftLine,
#if defined(KICAD_GOST) #if defined(KICAD_GOST)
STAMP_OX, STAMP_OY, STAMP_OX, STAMP_OY,
STAMP_OX, 0, STAMP_OX, 0,
#else #else
BLOCK_COMMENT_X, BLOCK_COMMENT4_Y, BLOCK_COMMENT_X, BLOCK_COMMENT4_Y,
0,0, 0, 0,
#endif #endif
NULL,NULL NULL, NULL
}; };
Ki_WorkSheetData WS_MostLeftLine = /* segment vertical gauche */ Ki_WorkSheetData WS_MostLeftLine = /* segment vertical gauche */
{ {
WS_LEFT_SEGMENT, WS_LEFT_SEGMENT,
#if defined(KICAD_GOST) #if defined(KICAD_GOST)
&WS_MostUpperLine, &WS_MostUpperLine,
STAMP_OX, STAMP_OY, STAMP_OX, STAMP_OY,
STAMP_OX, 0, STAMP_OX, 0,
#else #else
&WS_SeparatorLine, &WS_SeparatorLine,
BLOCK_OX, SIZETEXT * 16, BLOCK_OX, SIZETEXT * 16,
BLOCK_OX, 0, BLOCK_OX, 0,
NULL,NULL NULL, NULL
}; };
Ki_WorkSheetData WS_SeparatorLine = /* horizontal segment between filename and comments*/ Ki_WorkSheetData WS_SeparatorLine = /* horizontal segment between filename and comments*/
{ {
WS_SEGMENT, WS_SEGMENT,
&WS_MostUpperLine, &WS_MostUpperLine,
BLOCK_OX, VARIABLE_BLOCK_START_POSITION, BLOCK_OX, VARIABLE_BLOCK_START_POSITION,
0, VARIABLE_BLOCK_START_POSITION, 0, VARIABLE_BLOCK_START_POSITION,
#endif #endif
NULL,NULL NULL, NULL
}; };
Ki_WorkSheetData WS_MostUpperLine = /* segment horizontal superieur */ Ki_WorkSheetData WS_MostUpperLine = /* segment horizontal superieur */
{ {
WS_UPPER_SEGMENT, WS_UPPER_SEGMENT,
&WS_Segm3, &WS_Segm3,
#if defined(KICAD_GOST) #if defined(KICAD_GOST)
STAMP_OX, STAMP_OY, STAMP_OX, STAMP_OY,
0, STAMP_OY, 0, STAMP_OY,
#else #else
BLOCK_OX, SIZETEXT * 16, BLOCK_OX, SIZETEXT * 16,
0, SIZETEXT * 16, 0, SIZETEXT * 16,
#endif #endif
NULL,NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm3 = /* segment horizontal au dessus de NAME COMPANY */ Ki_WorkSheetData WS_Segm3 = /* segment horizontal au dessus de NAME COMPANY */
{ {
WS_SEGMENT, WS_SEGMENT,
&WS_Segm4, &WS_Segm4,
#if defined(KICAD_GOST) #if defined(KICAD_GOST)
STAMP_OX, STAMP_Y_50, STAMP_OX, STAMP_Y_50,
STAMP_X_120, STAMP_Y_50, STAMP_X_120,STAMP_Y_50,
#else #else
BLOCK_OX, SIZETEXT * 6, BLOCK_OX, SIZETEXT * 6,
0, SIZETEXT * 6, 0, SIZETEXT * 6,
#endif #endif
NULL,NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm4 = /* segment vertical a gauche de SHEET et REV */ Ki_WorkSheetData WS_Segm4 = /* segment vertical a gauche de SHEET et REV */
{ {
WS_SEGMENT, WS_SEGMENT,
&WS_Segm5, &WS_Segm5,
#if defined(KICAD_GOST) #if defined(KICAD_GOST)
STAMP_OX, STAMP_Y_45, STAMP_OX, STAMP_Y_45,
STAMP_X_120, STAMP_Y_45, STAMP_X_120, STAMP_Y_45,
#else #else
BLOCK_REV_X + SIZETEXT, SIZETEXT * 4, BLOCK_REV_X + SIZETEXT,SIZETEXT * 4,
BLOCK_REV_X + SIZETEXT, 0, BLOCK_REV_X + SIZETEXT,0,
#endif #endif
NULL,NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm5 = /* 1er segment horizontal */ Ki_WorkSheetData WS_Segm5 = /* 1er segment horizontal */
{ {
WS_SEGMENT, WS_SEGMENT,
&WS_Segm6, &WS_Segm6,
#if defined(KICAD_GOST) #if defined(KICAD_GOST)
STAMP_OX, STAMP_Y_40, STAMP_OX, STAMP_Y_40,
0, STAMP_Y_40, 0, STAMP_Y_40,
#else #else
BLOCK_OX, SIZETEXT * 2, BLOCK_OX, SIZETEXT * 2,
0, SIZETEXT * 2, 0, SIZETEXT * 2,
#endif #endif
NULL,NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm6 = /* 2eme segment horizontal */ Ki_WorkSheetData WS_Segm6 = /* 2eme segment horizontal */
{ {
WS_SEGMENT, WS_SEGMENT,
&WS_Segm7, &WS_Segm7,
#if defined(KICAD_GOST) #if defined(KICAD_GOST)
STAMP_OX, STAMP_Y_35, STAMP_OX, STAMP_Y_35,
STAMP_X_120, STAMP_Y_35, STAMP_X_120,STAMP_Y_35,
#else #else
BLOCK_OX, SIZETEXT * 4, BLOCK_OX, SIZETEXT * 4,
0, SIZETEXT * 4, 0, SIZETEXT * 4,
#endif #endif
NULL,NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm7 = /* segment vertical apres SIZE */ Ki_WorkSheetData WS_Segm7 = /* segment vertical apres SIZE */
{ {
WS_SEGMENT, WS_SEGMENT,
#if defined(KICAD_GOST) #if defined(KICAD_GOST)
&WS_Segm8, &WS_Segm8,
STAMP_X_50, STAMP_Y_35, STAMP_X_50,STAMP_Y_35,
0, STAMP_Y_35, 0, STAMP_Y_35,
NULL,NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm8 = /* segment vertical apres SIZE */ Ki_WorkSheetData WS_Segm8 = /* segment vertical apres SIZE */
{ {
WS_SEGMENT, WS_SEGMENT,
&WS_Segm9, &WS_Segm9,
STAMP_OX, STAMP_Y_30, STAMP_OX, STAMP_Y_30,
STAMP_X_120, STAMP_Y_30, STAMP_X_120,STAMP_Y_30,
NULL,NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm9 = /* segment vertical apres SIZE */ Ki_WorkSheetData WS_Segm9 = /* segment vertical apres SIZE */
{ {
WS_SEGMENT, WS_SEGMENT,
&WS_Segm10, &WS_Segm10,
STAMP_OX, STAMP_Y_25, STAMP_OX, STAMP_Y_25,
STAMP_X_120, STAMP_Y_25, STAMP_X_120,STAMP_Y_25,
NULL,NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm10 = /* segment vertical apres SIZE */ Ki_WorkSheetData WS_Segm10 = /* segment vertical apres SIZE */
{ {
WS_SEGMENT, WS_SEGMENT,
&WS_Segm11, &WS_Segm11,
STAMP_OX, STAMP_Y_20, STAMP_OX, STAMP_Y_20,
STAMP_X_120, STAMP_Y_20, STAMP_X_120,STAMP_Y_20,
NULL,NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm11 = /* segment vertical apres SIZE */ Ki_WorkSheetData WS_Segm11 = /* segment vertical apres SIZE */
{ {
WS_SEGMENT, WS_SEGMENT,
&WS_Segm12, &WS_Segm12,
STAMP_X_50, STAMP_Y_20, STAMP_X_50,STAMP_Y_20,
0, STAMP_Y_20, 0, STAMP_Y_20,
NULL,NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm12 = /* segment vertical apres SIZE */ Ki_WorkSheetData WS_Segm12 = /* segment vertical apres SIZE */
{ {
WS_SEGMENT, WS_SEGMENT,
&WS_Segm13, &WS_Segm13,
STAMP_OX, STAMP_Y_15, STAMP_OX, STAMP_Y_15,
0, STAMP_Y_15, 0, STAMP_Y_15,
NULL,NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm13 = /* segment vertical apres SIZE */ Ki_WorkSheetData WS_Segm13 = /* segment vertical apres SIZE */
{ {
WS_SEGMENT, WS_SEGMENT,
&WS_Segm14, &WS_Segm14,
STAMP_OX, STAMP_Y_10, STAMP_OX, STAMP_Y_10,
STAMP_X_120, STAMP_Y_10, STAMP_X_120,STAMP_Y_10,
NULL,NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm14 = /* segment vertical apres SIZE */ Ki_WorkSheetData WS_Segm14 = /* segment vertical apres SIZE */
{ {
WS_SEGMENT, WS_SEGMENT,
&WS_Segm15, &WS_Segm15,
STAMP_OX, STAMP_Y_5, STAMP_OX, STAMP_Y_5,
STAMP_X_120, STAMP_Y_5, STAMP_X_120,STAMP_Y_5,
NULL,NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm15 = /* segment vertical apres SIZE */ Ki_WorkSheetData WS_Segm15 = /* segment vertical apres SIZE */
{ {
WS_SEGMENT, WS_SEGMENT,
&WS_Segm16, &WS_Segm16,
STAMP_X_178, STAMP_OY, STAMP_X_178,STAMP_OY,
STAMP_X_178, STAMP_Y_30, STAMP_X_178,STAMP_Y_30,
NULL,NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm16 = /* segment vertical apres SIZE */ Ki_WorkSheetData WS_Segm16 = /* segment vertical apres SIZE */
{ {
WS_SEGMENT, WS_SEGMENT,
&WS_Segm17, &WS_Segm17,
STAMP_X_168, STAMP_OY, STAMP_X_168,STAMP_OY,
STAMP_X_168, 0, STAMP_X_168,0,
NULL,NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm17 = /* segment vertical apres SIZE */ Ki_WorkSheetData WS_Segm17 = /* segment vertical apres SIZE */
{ {
WS_SEGMENT, WS_SEGMENT,
&WS_Segm18, &WS_Segm18,
STAMP_X_145, STAMP_OY, STAMP_X_145,STAMP_OY,
STAMP_X_145, 0, STAMP_X_145,0,
NULL,NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm18 = /* segment vertical apres SIZE */ Ki_WorkSheetData WS_Segm18 = /* segment vertical apres SIZE */
{ {
WS_SEGMENT, WS_SEGMENT,
&WS_Segm19, &WS_Segm19,
STAMP_X_130, STAMP_OY, STAMP_X_130,STAMP_OY,
STAMP_X_130, 0, STAMP_X_130,0,
NULL,NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm19 = /* segment vertical apres SIZE */ Ki_WorkSheetData WS_Segm19 = /* segment vertical apres SIZE */
{ {
WS_SEGMENT, WS_SEGMENT,
&WS_Segm20, &WS_Segm20,
STAMP_X_120, STAMP_OY, STAMP_X_120,STAMP_OY,
STAMP_X_120, 0, STAMP_X_120,0,
NULL,NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm20 = /* segment vertical apres SIZE */ Ki_WorkSheetData WS_Segm20 = /* segment vertical apres SIZE */
{ {
WS_SEGMENT, WS_SEGMENT,
&WS_Segm21, &WS_Segm21,
STAMP_X_50, STAMP_Y_40, STAMP_X_50,STAMP_Y_40,
STAMP_X_50, 0, STAMP_X_50,0,
NULL,NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm21 = /* segment vertical apres SIZE */ Ki_WorkSheetData WS_Segm21 = /* segment vertical apres SIZE */
{ {
WS_SEGMENT, WS_SEGMENT,
&WS_Segm22, &WS_Segm22,
STAMP_X_45, STAMP_Y_35, STAMP_X_45,STAMP_Y_35,
STAMP_X_45, STAMP_Y_20, STAMP_X_45,STAMP_Y_20,
NULL,NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm22 = /* segment vertical apres SIZE */ Ki_WorkSheetData WS_Segm22 = /* segment vertical apres SIZE */
{ {
WS_SEGMENT, WS_SEGMENT,
&WS_Segm23, &WS_Segm23,
STAMP_X_40, STAMP_Y_35, STAMP_X_40,STAMP_Y_35,
STAMP_X_40, STAMP_Y_20, STAMP_X_40,STAMP_Y_20,
NULL,NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm23 = /* segment vertical apres SIZE */ Ki_WorkSheetData WS_Segm23 = /* segment vertical apres SIZE */
{ {
WS_SEGMENT, WS_SEGMENT,
&WS_Segm24, &WS_Segm24,
STAMP_X_35, STAMP_Y_40, STAMP_X_35,STAMP_Y_40,
STAMP_X_35, STAMP_Y_20, STAMP_X_35,STAMP_Y_20,
NULL,NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm24 = /* segment vertical apres SIZE */ Ki_WorkSheetData WS_Segm24 = /* segment vertical apres SIZE */
{ {
WS_SEGMENT, WS_SEGMENT,
&WS_Segm25, &WS_Segm25,
STAMP_X_30, STAMP_Y_20, STAMP_X_30,STAMP_Y_20,
STAMP_X_30, STAMP_Y_15, STAMP_X_30,STAMP_Y_15,
NULL,NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm25 = /* segment vertical apres SIZE */ Ki_WorkSheetData WS_Segm25 = /* segment vertical apres SIZE */
{ {
WS_SEGMENT, WS_SEGMENT,
&WS_Izm, &WS_Izm,
STAMP_X_18, STAMP_Y_40, STAMP_X_18,STAMP_Y_40,
STAMP_X_18, STAMP_Y_20, STAMP_X_18,STAMP_Y_20,
NULL,NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Izm = Ki_WorkSheetData WS_Izm =
{ {
WS_PODPIS, WS_PODPIS,
&WS_Razr, &WS_Razr,
STAMP_X_185 - 30,STAMP_Y_30 + 90, STAMP_X_185 - 30,STAMP_Y_30 + 90,
0,0, 0, 0,
wxT("Изм."), NULL wxT( "Изм." ),NULL
}; };
Ki_WorkSheetData WS_Razr = Ki_WorkSheetData WS_Razr =
{ {
WS_PODPIS, WS_PODPIS,
&WS_Prov, &WS_Prov,
STAMP_X_185 - 30,STAMP_Y_25 + 90, STAMP_X_185 - 30, STAMP_Y_25 + 90,
0,0, 0, 0,
wxT("Разраб."), NULL wxT( "Разраб." ),NULL
}; };
Ki_WorkSheetData WS_Prov = Ki_WorkSheetData WS_Prov =
{ {
WS_PODPIS, WS_PODPIS,
&WS_TKon, &WS_TKon,
STAMP_X_185 - 30,STAMP_Y_20 + 90, STAMP_X_185 - 30, STAMP_Y_20 + 90,
0,0, 0, 0,
wxT("Пров."), NULL wxT( "Пров." ),NULL
}; };
Ki_WorkSheetData WS_TKon = Ki_WorkSheetData WS_TKon =
{ {
WS_PODPIS, WS_PODPIS,
&WS_NKon, &WS_NKon,
STAMP_X_185 - 30,STAMP_Y_15 + 90, STAMP_X_185 - 30, STAMP_Y_15 + 90,
0,0, 0, 0,
wxT("Т.контр."), NULL wxT( "Т.контр." ),NULL
}; };
Ki_WorkSheetData WS_NKon = Ki_WorkSheetData WS_NKon =
{ {
WS_PODPIS, WS_PODPIS,
&WS_Utv, &WS_Utv,
STAMP_X_185 - 30,STAMP_Y_5 + 90, STAMP_X_185 - 30, STAMP_Y_5 + 90,
0,0, 0, 0,
wxT("Н.контр."), NULL wxT( "Н.контр." ),NULL
}; };
Ki_WorkSheetData WS_Utv = Ki_WorkSheetData WS_Utv =
{ {
WS_PODPIS, WS_PODPIS,
&WS_List, &WS_List,
STAMP_X_185 - 30,STAMP_Y_0 + 90, STAMP_X_185 - 30,STAMP_Y_0 + 90,
0,0, 0, 0,
wxT("Утв."), NULL wxT( "Утв." ),NULL
}; };
Ki_WorkSheetData WS_List = Ki_WorkSheetData WS_List =
{ {
WS_PODPIS, WS_PODPIS,
&WS_NDoc, &WS_NDoc,
STAMP_X_178 - 30,STAMP_Y_30 + 90, STAMP_X_178 - 30, STAMP_Y_30 + 90,
0,0, 0, 0,
wxT("Лист"), NULL wxT( "Лист" ),NULL
}; };
Ki_WorkSheetData WS_NDoc = Ki_WorkSheetData WS_NDoc =
{ {
WS_PODPIS, WS_PODPIS,
&WS_Podp, &WS_Podp,
STAMP_X_168 - 30,STAMP_Y_30 + 90, STAMP_X_168 - 30, STAMP_Y_30 + 90,
0,0, 0, 0,
wxT("N докум."), NULL wxT( "N докум." ),NULL
}; };
Ki_WorkSheetData WS_Podp = Ki_WorkSheetData WS_Podp =
{ {
WS_PODPIS, WS_PODPIS,
&WS_Data, &WS_Data,
STAMP_X_145 - 30,STAMP_Y_30 + 90, STAMP_X_145 - 30, STAMP_Y_30 + 90,
0,0, 0, 0,
wxT("Подп."), NULL wxT( "Подп." ),NULL
}; };
Ki_WorkSheetData WS_Data = Ki_WorkSheetData WS_Data =
{ {
WS_PODPIS, WS_PODPIS,
&WS_Art, &WS_Art,
STAMP_X_130 - 30,STAMP_Y_30 + 90, STAMP_X_130 - 30, STAMP_Y_30 + 90,
0,0, 0, 0,
wxT("Дата"), NULL wxT( "Дата" ),NULL
}; };
Ki_WorkSheetData WS_Art = Ki_WorkSheetData WS_Art =
{ {
WS_PODPIS, WS_PODPIS,
&WS_Mass, &WS_Mass,
STAMP_X_50 - 30,STAMP_Y_35 + 90, STAMP_X_50 - 30, STAMP_Y_35 + 90,
0,0, 0, 0,
wxT("Арт."), NULL wxT( "Арт." ),NULL
}; };
Ki_WorkSheetData WS_Mass = Ki_WorkSheetData WS_Mass =
{ {
WS_PODPIS, WS_PODPIS,
&WS_Msht, &WS_Msht,
STAMP_X_35 - 30,STAMP_Y_35 + 90, STAMP_X_35 - 30, STAMP_Y_35 + 90,
0,0, 0, 0,
wxT("Масса"), NULL wxT( "Масса" ),NULL
}; };
Ki_WorkSheetData WS_Msht = Ki_WorkSheetData WS_Msht =
{ {
WS_PODPIS, WS_PODPIS,
&WS_List1, &WS_List1,
STAMP_X_18 - 30,STAMP_Y_35 + 90, STAMP_X_18 - 30, STAMP_Y_35 + 90,
0,0, 0, 0,
wxT("Масштаб"), NULL wxT( "Масштаб" ),NULL
}; };
Ki_WorkSheetData WS_List1 = Ki_WorkSheetData WS_List1 =
{ {
WS_IDENTSHEET, WS_IDENTSHEET,
&WS_List2, &WS_List2,
STAMP_X_50 - 30,STAMP_Y_15 + 90, STAMP_X_50 - 30, STAMP_Y_15 + 90,
0,0, 0, 0,
wxT("Лист "), NULL wxT( "Лист " ),NULL
}; };
Ki_WorkSheetData WS_List2 = Ki_WorkSheetData WS_List2 =
{ {
WS_SHEETS, WS_SHEETS,
NULL, NULL,
STAMP_X_30 - 30,STAMP_Y_15 + 90, STAMP_X_30 - 30, STAMP_Y_15 + 90,
0,0, 0, 0,
wxT("Листов "), NULL wxT( "Листов " ),NULL
}; };
Ki_WorkSheetData WS_CADRE_D = Ki_WorkSheetData WS_CADRE_D =
{ {
WS_CADRE, WS_CADRE,
&WS_Segm1_D, &WS_Segm1_D,
STAMP_OX, 0, STAMP_OX, 0,
0,0, 0, 0,
NULL, NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm1_D = Ki_WorkSheetData WS_Segm1_D =
{ {
WS_LEFT_SEGMENT_D, WS_LEFT_SEGMENT_D,
&WS_Segm2_D, &WS_Segm2_D,
STAMP_OX, STAMP_Y_15, STAMP_OX, STAMP_Y_15,
STAMP_OX, 0, STAMP_OX, 0,
NULL, NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm2_D = Ki_WorkSheetData WS_Segm2_D =
{ {
WS_SEGMENT_D, WS_SEGMENT_D,
&WS_Segm3_D, &WS_Segm3_D,
STAMP_X_178, STAMP_Y_15, STAMP_X_178, STAMP_Y_15,
STAMP_X_178, 0, STAMP_X_178, 0,
NULL, NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm3_D = Ki_WorkSheetData WS_Segm3_D =
{ {
WS_SEGMENT_D, WS_SEGMENT_D,
&WS_Segm4_D, &WS_Segm4_D,
STAMP_X_168, STAMP_Y_15, STAMP_X_168, STAMP_Y_15,
STAMP_X_168, 0, STAMP_X_168, 0,
NULL, NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm4_D = Ki_WorkSheetData WS_Segm4_D =
{ {
WS_SEGMENT_D, WS_SEGMENT_D,
&WS_Segm5_D, &WS_Segm5_D,
STAMP_X_145, STAMP_Y_15, STAMP_X_145, STAMP_Y_15,
STAMP_X_145, 0, STAMP_X_145, 0,
NULL, NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm5_D = Ki_WorkSheetData WS_Segm5_D =
{ {
WS_SEGMENT_D, WS_SEGMENT_D,
&WS_Segm6_D, &WS_Segm6_D,
STAMP_X_130, STAMP_Y_15, STAMP_X_130, STAMP_Y_15,
STAMP_X_130, 0, STAMP_X_130, 0,
NULL, NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm6_D = Ki_WorkSheetData WS_Segm6_D =
{ {
WS_SEGMENT_D, WS_SEGMENT_D,
&WS_Segm7_D, &WS_Segm7_D,
STAMP_X_120, STAMP_Y_15, STAMP_X_120, STAMP_Y_15,
STAMP_X_120, 0, STAMP_X_120, 0,
NULL, NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm7_D = Ki_WorkSheetData WS_Segm7_D =
{ {
WS_SEGMENT_D, WS_SEGMENT_D,
&WS_Segm8_D, &WS_Segm8_D,
STAMP_X_10, STAMP_Y_15, STAMP_X_10, STAMP_Y_15,
STAMP_X_10, 0, STAMP_X_10, 0,
NULL, NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm8_D = Ki_WorkSheetData WS_Segm8_D =
{ {
WS_SEGMENT_D, WS_SEGMENT_D,
&WS_Segm9_D, &WS_Segm9_D,
STAMP_X_185, STAMP_Y_10, STAMP_X_185, STAMP_Y_10,
STAMP_X_120, STAMP_Y_10, STAMP_X_120, STAMP_Y_10,
NULL, NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm9_D = Ki_WorkSheetData WS_Segm9_D =
{ {
WS_SEGMENT_D, WS_SEGMENT_D,
&WS_Segm10_D, &WS_Segm10_D,
STAMP_X_185, STAMP_Y_5, STAMP_X_185, STAMP_Y_5,
STAMP_X_120, STAMP_Y_5, STAMP_X_120, STAMP_Y_5,
NULL, NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm10_D = Ki_WorkSheetData WS_Segm10_D =
{ {
WS_SEGMENT_D, WS_SEGMENT_D,
&WS_Segm11_D, &WS_Segm11_D,
STAMP_X_10, STAMP_Y_8, STAMP_X_10, STAMP_Y_8,
0, STAMP_Y_8, 0, STAMP_Y_8,
NULL, NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm11_D = Ki_WorkSheetData WS_Segm11_D =
{ {
WS_SEGMENT_D, WS_SEGMENT_D,
&WS_Izm_D, &WS_Izm_D,
STAMP_X_185, STAMP_Y_15, STAMP_X_185, STAMP_Y_15,
0, STAMP_Y_15, 0, STAMP_Y_15,
NULL, NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Izm_D = Ki_WorkSheetData WS_Izm_D =
{ {
WS_PODPIS_D, WS_PODPIS_D,
&WS_List_D, &WS_List_D,
STAMP_X_185 - 30, STAMP_Y_0 + 90, STAMP_X_185 - 30,STAMP_Y_0 + 90,
0, 0, 0, 0,
wxT("Изм."), NULL wxT( "Изм." ),NULL
}; };
Ki_WorkSheetData WS_List_D = Ki_WorkSheetData WS_List_D =
{ {
WS_PODPIS_D, WS_PODPIS_D,
&WS_NDoc_D, &WS_NDoc_D,
STAMP_X_178 - 30, STAMP_Y_0 + 90, STAMP_X_178 - 30, STAMP_Y_0 + 90,
0, 0, 0, 0,
wxT("Лист"), NULL wxT( "Лист" ),NULL
}; };
Ki_WorkSheetData WS_NDoc_D = Ki_WorkSheetData WS_NDoc_D =
{ {
WS_PODPIS_D, WS_PODPIS_D,
&WS_Podp_D, &WS_Podp_D,
STAMP_X_168 - 30, STAMP_Y_0 + 90, STAMP_X_168 - 30, STAMP_Y_0 + 90,
0, 0, 0, 0,
wxT("N докум."), NULL wxT( "N докум." ),NULL
}; };
Ki_WorkSheetData WS_Podp_D = Ki_WorkSheetData WS_Podp_D =
{ {
WS_PODPIS_D, WS_PODPIS_D,
&WS_Date_D, &WS_Date_D,
STAMP_X_145 - 30, STAMP_Y_0 + 90, STAMP_X_145 - 30, STAMP_Y_0 + 90,
0, 0, 0, 0,
wxT("Подп."), NULL wxT( "Подп." ),NULL
}; };
Ki_WorkSheetData WS_Date_D = Ki_WorkSheetData WS_Date_D =
{ {
WS_PODPIS_D, WS_PODPIS_D,
&WS_List1_D, &WS_List1_D,
STAMP_X_130 - 30, STAMP_Y_0 + 90, STAMP_X_130 - 30, STAMP_Y_0 + 90,
0, 0, 0, 0,
wxT("Дата"), NULL wxT( "Дата" ),NULL
}; };
Ki_WorkSheetData WS_List1_D = Ki_WorkSheetData WS_List1_D =
{ {
WS_PODPIS_D, WS_PODPIS_D,
&WS_ListN_D, &WS_ListN_D,
STAMP_X_10 - 30, STAMP_Y_8 + 90, STAMP_X_10 - 30, STAMP_Y_8 + 90,
0, 0, 0, 0,
wxT("Лист"), NULL wxT( "Лист" ),NULL
}; };
Ki_WorkSheetData WS_ListN_D = Ki_WorkSheetData WS_ListN_D =
{ {
WS_IDENTSHEET_D, WS_IDENTSHEET_D,
NULL, NULL,
STAMP_Y_0 + 196, STAMP_Y_0 + 90, STAMP_Y_0 + 196,STAMP_Y_0 + 90,
0, 0, 0, 0,
NULL, NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm1_LU = Ki_WorkSheetData WS_Segm1_LU =
{ {
WS_SEGMENT_LU, WS_SEGMENT_LU,
&WS_Segm2_LU, &WS_Segm2_LU,
STAMP_12, STAMP_145, STAMP_12, STAMP_145,
STAMP_12, 0, STAMP_12, 0,
NULL, NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm2_LU = Ki_WorkSheetData WS_Segm2_LU =
{ {
WS_SEGMENT_LU, WS_SEGMENT_LU,
&WS_Segm3_LU, &WS_Segm3_LU,
STAMP_7, STAMP_145, STAMP_7, STAMP_145,
STAMP_7, 0, STAMP_7, 0,
NULL, NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm3_LU = Ki_WorkSheetData WS_Segm3_LU =
{ {
WS_SEGMENT_LU, WS_SEGMENT_LU,
&WS_Segm4_LU, &WS_Segm4_LU,
STAMP_12, STAMP_145, STAMP_12, STAMP_145,
0, STAMP_145, 0, STAMP_145,
NULL, NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm4_LU = Ki_WorkSheetData WS_Segm4_LU =
{ {
WS_SEGMENT_LU, WS_SEGMENT_LU,
&WS_Segm5_LU, &WS_Segm5_LU,
STAMP_12, STAMP_110, STAMP_12, STAMP_110,
0, STAMP_110, 0, STAMP_110,
NULL, NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm5_LU = Ki_WorkSheetData WS_Segm5_LU =
{ {
WS_SEGMENT_LU, WS_SEGMENT_LU,
&WS_Segm6_LU, &WS_Segm6_LU,
STAMP_12, STAMP_85, STAMP_12, STAMP_85,
0, STAMP_85, 0, STAMP_85,
NULL, NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm6_LU = Ki_WorkSheetData WS_Segm6_LU =
{ {
WS_SEGMENT_LU, WS_SEGMENT_LU,
&WS_Segm7_LU, &WS_Segm7_LU,
STAMP_12, STAMP_60, STAMP_12, STAMP_60,
0, STAMP_60, 0, STAMP_60,
NULL, NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm7_LU = Ki_WorkSheetData WS_Segm7_LU =
{ {
WS_SEGMENT_LU, WS_SEGMENT_LU,
&WS_Segm8_LU, &WS_Segm8_LU,
STAMP_12, STAMP_25, STAMP_12, STAMP_25,
0, STAMP_25, 0, STAMP_25,
NULL, NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm8_LU = Ki_WorkSheetData WS_Segm8_LU =
{ {
WS_SEGMENT_LU, WS_SEGMENT_LU,
&WS_Podp1_LU, &WS_Podp1_LU,
STAMP_12, 0, STAMP_12, 0,
0, 0, 0, 0,
NULL, NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Podp1_LU = Ki_WorkSheetData WS_Podp1_LU =
{ {
WS_PODPIS_LU, WS_PODPIS_LU,
&WS_Podp2_LU, &WS_Podp2_LU,
STAMP_7 + 90, 0 + 492, STAMP_7 + 90, 0 + 492,
0, 0, 0, 0,
wxT("Инв.N подл."), NULL wxT( "Инв.N подл." ),NULL
}; };
Ki_WorkSheetData WS_Podp2_LU = Ki_WorkSheetData WS_Podp2_LU =
{ {
WS_PODPIS_LU, WS_PODPIS_LU,
&WS_Podp3_LU, &WS_Podp3_LU,
STAMP_7 + 90, STAMP_25 + 688, STAMP_7 + 90, STAMP_25 + 688,
0, 0, 0, 0,
wxT("Подп. и дата"), NULL wxT( "Подп. и дата" ),NULL
}; };
Ki_WorkSheetData WS_Podp3_LU = Ki_WorkSheetData WS_Podp3_LU =
{ {
WS_PODPIS_LU, WS_PODPIS_LU,
&WS_Podp4_LU, &WS_Podp4_LU,
STAMP_7 + 90, STAMP_60 + 492, STAMP_7 + 90, STAMP_60 + 492,
0, 0, 0, 0,
wxT("Взам.инв.N"), NULL wxT( "Взам.инв.N" ),NULL
}; };
Ki_WorkSheetData WS_Podp4_LU = Ki_WorkSheetData WS_Podp4_LU =
{ {
WS_PODPIS_LU, WS_PODPIS_LU,
&WS_Podp5_LU, &WS_Podp5_LU,
STAMP_7 + 90, STAMP_85 + 492, STAMP_7 + 90, STAMP_85 + 492,
0, 0, 0, 0,
wxT("Инв.N дубл."), NULL wxT( "Инв.N дубл." ),NULL
}; };
Ki_WorkSheetData WS_Podp5_LU = Ki_WorkSheetData WS_Podp5_LU =
{ {
WS_PODPIS_LU, WS_PODPIS_LU,
NULL, NULL,
STAMP_7 + 90, STAMP_110 + 688, STAMP_7 + 90, STAMP_110 + 688,
0, 0, 0, 0,
wxT("Подп. и дата"), NULL wxT( "Подп. и дата" ),NULL
}; };
Ki_WorkSheetData WS_Segm1_LT = Ki_WorkSheetData WS_Segm1_LT =
{ {
WS_SEGMENT_LT, WS_SEGMENT_LT,
&WS_Segm2_LT, &WS_Segm2_LT,
STAMP_X_0, STAMP_Y_14, STAMP_X_0, STAMP_Y_14,
STAMP_X_137, STAMP_Y_14, STAMP_X_137, STAMP_Y_14,
NULL, NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm2_LT = Ki_WorkSheetData WS_Segm2_LT =
{ {
WS_SEGMENT_LT, WS_SEGMENT_LT,
&WS_Segm3_LT, &WS_Segm3_LT,
STAMP_X_137, STAMP_Y_14, STAMP_X_137, STAMP_Y_14,
STAMP_X_137, 0, STAMP_X_137, 0,
NULL, NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm3_LT = Ki_WorkSheetData WS_Segm3_LT =
{ {
WS_SEGMENT_LT, WS_SEGMENT_LT,
&WS_Segm4_LT, &WS_Segm4_LT,
STAMP_X_137, STAMP_Y_7, STAMP_X_137, STAMP_Y_7,
STAMP_X_84, STAMP_Y_7, STAMP_X_84, STAMP_Y_7,
NULL, NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm4_LT = Ki_WorkSheetData WS_Segm4_LT =
{ {
WS_SEGMENT_LT, WS_SEGMENT_LT,
&WS_Segm5_LT, &WS_Segm5_LT,
STAMP_X_84, STAMP_Y_14, STAMP_X_84, STAMP_Y_14,
STAMP_X_84, 0, STAMP_X_84, 0,
NULL, NULL NULL, NULL
}; };
Ki_WorkSheetData WS_Segm5_LT = Ki_WorkSheetData WS_Segm5_LT =
{ {
WS_SEGMENT_LT, WS_SEGMENT_LT,
NULL, NULL,
STAMP_X_70, STAMP_Y_14, STAMP_X_70, STAMP_Y_14,
STAMP_X_70, 0, STAMP_X_70, 0,
#else #else
NULL, NULL,
BLOCK_OX - (SIZETEXT * 11), SIZETEXT * 4, BLOCK_OX - (SIZETEXT * 11),SIZETEXT * 4,
BLOCK_OX - (SIZETEXT * 11), SIZETEXT * 2, BLOCK_OX - (SIZETEXT * 11),SIZETEXT * 2,
#endif #endif
NULL, NULL NULL, NULL
}; };
/*************************************************************************************/ /*************************************************************************************/
...@@ -926,26 +926,26 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w ...@@ -926,26 +926,26 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
if( !m_Draw_Sheet_Ref ) if( !m_Draw_Sheet_Ref )
return; return;
Ki_PageDescr* Sheet = screen->m_CurrentSheetDesc; Ki_PageDescr* Sheet = screen->m_CurrentSheetDesc;
int ii, jj, xg, yg, ipas, gxpas, gypas; int ii, jj, xg, yg, ipas, gxpas, gypas;
wxPoint pos; wxPoint pos;
int refx, refy; int refx, refy;
EDA_Colors Color; EDA_Colors Color;
wxString Line; wxString Line;
Ki_WorkSheetData* WsItem; Ki_WorkSheetData* WsItem;
int scale = m_InternalUnits / 1000; int scale = m_InternalUnits / 1000;
wxSize size( SIZETEXT * scale, SIZETEXT * scale ); wxSize size( SIZETEXT * scale, SIZETEXT * scale );
wxSize size_ref( SIZETEXT_REF * scale, SIZETEXT_REF * scale ); wxSize size_ref( SIZETEXT_REF * scale, SIZETEXT_REF * scale );
wxString msg; wxString msg;
int UpperLimit = VARIABLE_BLOCK_START_POSITION; int UpperLimit = VARIABLE_BLOCK_START_POSITION;
int width = line_width; int width = line_width;
Color = RED; Color = RED;
if( Sheet == NULL ) if( Sheet == NULL )
{ {
DisplayError( this, DisplayError( this,
wxT( "WinEDA_DrawFrame::TraceWorkSheet() error: NULL Sheet" ) ); wxT( "WinEDA_DrawFrame::TraceWorkSheet() error: NULL Sheet" ) );
return; return;
} }
...@@ -978,6 +978,7 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w ...@@ -978,6 +978,7 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
refx += GRID_REF_W; refy += GRID_REF_W; refx += GRID_REF_W; refy += GRID_REF_W;
xg -= GRID_REF_W; yg -= GRID_REF_W; xg -= GRID_REF_W; yg -= GRID_REF_W;
} }
#endif #endif
/* trace des reperes */ /* trace des reperes */
...@@ -986,44 +987,49 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w ...@@ -986,44 +987,49 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
refy = Sheet->m_Size.y - Sheet->m_BottomMargin; /* Lower left corner */ refy = Sheet->m_Size.y - Sheet->m_BottomMargin; /* Lower left corner */
for( WsItem = &WS_Segm1_LU; WsItem != NULL; WsItem = WsItem->Pnext ) for( WsItem = &WS_Segm1_LU; WsItem != NULL; WsItem = WsItem->Pnext )
{ {
pos.x = (refx - WsItem->m_Posx)* scale; pos.x = (refx - WsItem->m_Posx) * scale;
pos.y = (refy - WsItem->m_Posy)* scale; pos.y = (refy - WsItem->m_Posy) * scale;
msg.Empty(); msg.Empty();
switch( WsItem->m_Type ) switch( WsItem->m_Type )
{ {
case WS_CADRE: case WS_CADRE:
break; break;
case WS_PODPIS_LU:
if(WsItem->m_Legende) msg = WsItem->m_Legende; case WS_PODPIS_LU:
DrawGraphicText(DrawPanel, DC, pos, Color, if( WsItem->m_Legende )
msg, TEXT_ORIENT_VERT, size, msg = WsItem->m_Legende;
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM,width, DrawGraphicText( DrawPanel, DC, pos, Color,
false, false, false); msg, TEXT_ORIENT_VERT, size,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM, width,
false, false );
break; break;
case WS_SEGMENT_LU:
case WS_SEGMENT_LU:
xg = Sheet->m_LeftMargin - WsItem->m_Endx; xg = Sheet->m_LeftMargin - WsItem->m_Endx;
yg = Sheet->m_Size.y - Sheet->m_BottomMargin - WsItem->m_Endy; yg = Sheet->m_Size.y - Sheet->m_BottomMargin - WsItem->m_Endy;
GRLine(&DrawPanel->m_ClipBox, DC, pos.x, pos.y, GRLine( &DrawPanel->m_ClipBox, DC, pos.x, pos.y,
xg * scale, yg * scale, width, Color); xg * scale, yg * scale, width, Color );
break; break;
} }
} }
refy = Sheet->m_BottomMargin; /* Left Top corner */ refy = Sheet->m_BottomMargin; /* Left Top corner */
for( WsItem = &WS_Segm1_LT; WsItem != NULL; WsItem = WsItem->Pnext ) for( WsItem = &WS_Segm1_LT; WsItem != NULL; WsItem = WsItem->Pnext )
{ {
pos.x = (refx + WsItem->m_Posx)* scale; pos.x = (refx + WsItem->m_Posx) * scale;
pos.y = (refy + WsItem->m_Posy)* scale; pos.y = (refy + WsItem->m_Posy) * scale;
msg.Empty(); msg.Empty();
switch( WsItem->m_Type ) switch( WsItem->m_Type )
{ {
case WS_SEGMENT_LT: case WS_SEGMENT_LT:
xg = Sheet->m_LeftMargin + WsItem->m_Endx; xg = Sheet->m_LeftMargin + WsItem->m_Endx;
yg = Sheet->m_BottomMargin + WsItem->m_Endy; yg = Sheet->m_BottomMargin + WsItem->m_Endy;
GRLine(&DrawPanel->m_ClipBox, DC, pos.x, pos.y, GRLine( &DrawPanel->m_ClipBox, DC, pos.x, pos.y,
xg * scale, yg * scale, width, Color); xg * scale, yg * scale, width, Color );
break; break;
} }
} }
#else #else
refy = Sheet->m_TopMargin; /* Upper left corner */ refy = Sheet->m_TopMargin; /* Upper left corner */
xg = Sheet->m_Size.x - Sheet->m_RightMargin; xg = Sheet->m_Size.x - Sheet->m_RightMargin;
...@@ -1045,7 +1051,7 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w ...@@ -1045,7 +1051,7 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
Color, Color,
Line, TEXT_ORIENT_HORIZ, size_ref, Line, TEXT_ORIENT_HORIZ, size_ref,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
width, false, false, false ); width, false, false );
if( ii < xg - PAS_REF / 2 ) if( ii < xg - PAS_REF / 2 )
{ {
GRLine( &DrawPanel->m_ClipBox, DC, ii * scale, yg * scale, GRLine( &DrawPanel->m_ClipBox, DC, ii * scale, yg * scale,
...@@ -1053,10 +1059,10 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w ...@@ -1053,10 +1059,10 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
} }
DrawGraphicText( DrawPanel, DC, DrawGraphicText( DrawPanel, DC,
wxPoint( (ii - gxpas / 2) * scale, wxPoint( (ii - gxpas / 2) * scale,
(yg - GRID_REF_W / 2) * scale ), (yg - GRID_REF_W / 2) * scale ),
Color, Line, TEXT_ORIENT_HORIZ, size_ref, Color, Line, TEXT_ORIENT_HORIZ, size_ref,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
width, false, false, false ); width, false, false );
} }
/* Trace des reperes selon l'axe Y */ /* Trace des reperes selon l'axe Y */
...@@ -1076,11 +1082,11 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w ...@@ -1076,11 +1082,11 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
} }
DrawGraphicText( DrawPanel, DC, DrawGraphicText( DrawPanel, DC,
wxPoint( (refx + GRID_REF_W / 2) * scale, wxPoint( (refx + GRID_REF_W / 2) * scale,
(ii - gypas / 2) * scale ), (ii - gypas / 2) * scale ),
Color, Color,
Line, TEXT_ORIENT_HORIZ, size_ref, Line, TEXT_ORIENT_HORIZ, size_ref,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
width, false, false, false ); width, false, false );
if( ii < yg - PAS_REF / 2 ) if( ii < yg - PAS_REF / 2 )
{ {
GRLine( &DrawPanel->m_ClipBox, DC, xg * scale, ii * scale, GRLine( &DrawPanel->m_ClipBox, DC, xg * scale, ii * scale,
...@@ -1088,118 +1094,160 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w ...@@ -1088,118 +1094,160 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
} }
DrawGraphicText( DrawPanel, DC, DrawGraphicText( DrawPanel, DC,
wxPoint( (xg - GRID_REF_W / 2) * scale, wxPoint( (xg - GRID_REF_W / 2) * scale,
(ii - gxpas / 2) * scale ), (ii - gxpas / 2) * scale ),
Color, Line, TEXT_ORIENT_HORIZ, size_ref, Color, Line, TEXT_ORIENT_HORIZ, size_ref,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
width, false, false, false ); width, false, false );
} }
#endif #endif
/* Trace du cartouche */ /* Trace du cartouche */
#if defined(KICAD_GOST) #if defined(KICAD_GOST)
refx = Sheet->m_Size.x - Sheet->m_RightMargin; refx = Sheet->m_Size.x - Sheet->m_RightMargin;
refy = Sheet->m_Size.y - Sheet->m_BottomMargin; /* lower right corner */ refy = Sheet->m_Size.y - Sheet->m_BottomMargin; /* lower right corner */
if (screen->m_ScreenNumber == 1) if( screen->m_ScreenNumber == 1 )
{ {
for( WsItem = &WS_Date; WsItem != NULL; WsItem = WsItem->Pnext ) for( WsItem = &WS_Date; WsItem != NULL; WsItem = WsItem->Pnext )
{ {
pos.x = (refx - WsItem->m_Posx)* scale; pos.x = (refx - WsItem->m_Posx) * scale;
pos.y = (refy - WsItem->m_Posy)* scale; pos.y = (refy - WsItem->m_Posy) * scale;
msg.Empty(); msg.Empty();
switch( WsItem->m_Type ) switch( WsItem->m_Type )
{ {
case WS_DATE: case WS_DATE:
break; break;
case WS_REV: case WS_REV:
break; break;
case WS_KICAD_VERSION: case WS_KICAD_VERSION:
break; break;
case WS_PODPIS: case WS_PODPIS:
if( WsItem->m_Legende ) if( WsItem->m_Legende )
msg = WsItem->m_Legende; msg = WsItem->m_Legende;
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( DrawPanel, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size, msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
width, false, false, false ); width, false, false );
break; break;
case WS_SIZESHEET: case WS_SIZESHEET:
break; break;
case WS_IDENTSHEET: case WS_IDENTSHEET:
if(WsItem->m_Legende) if( WsItem->m_Legende )
msg = WsItem->m_Legende; msg = WsItem->m_Legende;
msg << screen->m_ScreenNumber; msg << screen->m_ScreenNumber;
DrawGraphicText( DrawPanel, DC, pos, Color, msg, DrawGraphicText( DrawPanel, DC, pos, Color, msg,
TEXT_ORIENT_HORIZ, size, GR_TEXT_HJUSTIFY_LEFT, TEXT_ORIENT_HORIZ, size, GR_TEXT_HJUSTIFY_LEFT,
GR_TEXT_VJUSTIFY_CENTER, width, false, false, false); GR_TEXT_VJUSTIFY_CENTER, width, false, false, false );
break; break;
case WS_SHEETS: case WS_SHEETS:
if(WsItem->m_Legende) if( WsItem->m_Legende )
msg = WsItem->m_Legende; msg = WsItem->m_Legende;
msg << screen->m_NumberOfScreen; msg << screen->m_NumberOfScreen;
DrawGraphicText( DrawPanel, DC, pos, Color, msg, DrawGraphicText( DrawPanel, DC, pos, Color, msg,
TEXT_ORIENT_HORIZ, size, GR_TEXT_HJUSTIFY_LEFT, TEXT_ORIENT_HORIZ, size, GR_TEXT_HJUSTIFY_LEFT,
GR_TEXT_VJUSTIFY_CENTER, width, false, false, false); GR_TEXT_VJUSTIFY_CENTER, width, false, false, false );
break; break;
case WS_COMPANY_NAME: case WS_COMPANY_NAME:
break; break;
case WS_TITLE: case WS_TITLE:
break; break;
case WS_COMMENT1: case WS_COMMENT1:
break; break;
case WS_COMMENT2: case WS_COMMENT2:
break; break;
case WS_COMMENT3: case WS_COMMENT3:
break; break;
case WS_COMMENT4: case WS_COMMENT4:
break; break;
case WS_UPPER_SEGMENT: case WS_UPPER_SEGMENT:
case WS_LEFT_SEGMENT: case WS_LEFT_SEGMENT:
WS_MostUpperLine.m_Posy = WS_MostUpperLine.m_Posy =
WS_MostUpperLine.m_Endy = WS_MostUpperLine.m_Endy =
WS_MostLeftLine.m_Posy = STAMP_OY; WS_MostLeftLine.m_Posy = STAMP_OY;
pos.y = (refy - WsItem->m_Posy)* scale; pos.y = (refy - WsItem->m_Posy) * scale;
case WS_SEGMENT: case WS_SEGMENT:
xg = Sheet->m_Size.x - xg = Sheet->m_Size.x -
Sheet->m_RightMargin - WsItem->m_Endx; Sheet->m_RightMargin - WsItem->m_Endx;
yg = Sheet->m_Size.y - yg = Sheet->m_Size.y -
Sheet->m_BottomMargin - WsItem->m_Endy; Sheet->m_BottomMargin - WsItem->m_Endy;
GRLine(&DrawPanel->m_ClipBox, DC, pos.x, pos.y, GRLine( &DrawPanel->m_ClipBox, DC, pos.x, pos.y,
xg * scale, yg * scale, width, Color); xg * scale, yg * scale, width, Color );
break; break;
} }
} }
} else { }
else
{
for( WsItem = &WS_CADRE_D; WsItem != NULL; WsItem = WsItem->Pnext ) for( WsItem = &WS_CADRE_D; WsItem != NULL; WsItem = WsItem->Pnext )
{ {
pos.x = (refx - WsItem->m_Posx)* scale; pos.x = (refx - WsItem->m_Posx) * scale;
pos.y = (refy - WsItem->m_Posy)* scale; pos.y = (refy - WsItem->m_Posy) * scale;
msg.Empty(); msg.Empty();
switch( WsItem->m_Type ) switch( WsItem->m_Type )
{ {
case WS_CADRE: case WS_CADRE:
/* Begin list number > 1 */ /* Begin list number > 1 */
case WS_PODPIS_D: case WS_PODPIS_D:
if(WsItem->m_Legende) msg = WsItem->m_Legende; if( WsItem->m_Legende )
DrawGraphicText(DrawPanel, DC, pos, Color, msg = WsItem->m_Legende;
msg, TEXT_ORIENT_HORIZ, size, DrawGraphicText( DrawPanel,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,width, false, false, false); DC,
pos,
Color,
msg,
TEXT_ORIENT_HORIZ,
size,
GR_TEXT_HJUSTIFY_LEFT,
GR_TEXT_VJUSTIFY_CENTER,
width,
false,
false,
false );
break; break;
case WS_IDENTSHEET_D: case WS_IDENTSHEET_D:
if(WsItem->m_Legende) msg = WsItem->m_Legende; if( WsItem->m_Legende )
msg = WsItem->m_Legende;
msg << screen->m_ScreenNumber; msg << screen->m_ScreenNumber;
DrawGraphicText(DrawPanel, DC, pos, Color, DrawGraphicText( DrawPanel,
msg, TEXT_ORIENT_HORIZ, size, DC,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,width, false, false, false); pos,
Color,
msg,
TEXT_ORIENT_HORIZ,
size,
GR_TEXT_HJUSTIFY_LEFT,
GR_TEXT_VJUSTIFY_CENTER,
width,
false,
false,
false );
break; break;
case WS_LEFT_SEGMENT_D: case WS_LEFT_SEGMENT_D:
pos.y = (refy - WsItem->m_Posy)* scale; pos.y = (refy - WsItem->m_Posy) * scale;
case WS_SEGMENT_D: case WS_SEGMENT_D:
xg = Sheet->m_Size.x - xg = Sheet->m_Size.x -
Sheet->m_RightMargin - WsItem->m_Endx; Sheet->m_RightMargin - WsItem->m_Endx;
yg = Sheet->m_Size.y - yg = Sheet->m_Size.y -
Sheet->m_BottomMargin - WsItem->m_Endy; Sheet->m_BottomMargin - WsItem->m_Endy;
GRLine(&DrawPanel->m_ClipBox, DC, pos.x, pos.y, GRLine( &DrawPanel->m_ClipBox, DC, pos.x, pos.y,
xg * scale, yg * scale, width, Color); xg * scale, yg * scale, width, Color );
break; break;
} }
} }
...@@ -1222,8 +1270,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w ...@@ -1222,8 +1270,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
msg += screen->m_Date; msg += screen->m_Date;
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( DrawPanel, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size, msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width,
false, true, false ); false, true );
break; break;
case WS_REV: case WS_REV:
...@@ -1232,8 +1280,9 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w ...@@ -1232,8 +1280,9 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
msg += screen->m_Revision; msg += screen->m_Revision;
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( DrawPanel, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size, msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
false, true, false ); GetPenSizeForBold( MIN( size.x, size.y ) ),
false, true );
break; break;
case WS_KICAD_VERSION: case WS_KICAD_VERSION:
...@@ -1243,8 +1292,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w ...@@ -1243,8 +1292,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
msg += wxT( " " ) + GetBuildVersion(); msg += wxT( " " ) + GetBuildVersion();
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( DrawPanel, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size, msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width,
false, false, false ); false, false );
break; break;
case WS_SIZESHEET: case WS_SIZESHEET:
...@@ -1253,8 +1302,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w ...@@ -1253,8 +1302,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
msg += Sheet->m_Name; msg += Sheet->m_Name;
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( DrawPanel, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size, msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width,
false, false, false ); false, false );
break; break;
...@@ -1264,8 +1313,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w ...@@ -1264,8 +1313,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
msg << screen->m_ScreenNumber << wxT( "/" ) << screen->m_NumberOfScreen; msg << screen->m_ScreenNumber << wxT( "/" ) << screen->m_NumberOfScreen;
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( DrawPanel, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size, msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width,
false, false, false ); false, false );
break; break;
case WS_FILENAME: case WS_FILENAME:
...@@ -1277,8 +1326,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w ...@@ -1277,8 +1326,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
msg << fname << wxT( "." ) << fext; msg << fname << wxT( "." ) << fext;
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( DrawPanel, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size, msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width,
false, false, false ); false, false );
} }
break; break;
...@@ -1288,8 +1337,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w ...@@ -1288,8 +1337,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
msg += GetScreenDesc(); msg += GetScreenDesc();
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( DrawPanel, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size, msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width,
false, false, false ); false, false );
break; break;
...@@ -1301,8 +1350,9 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w ...@@ -1301,8 +1350,9 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
{ {
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( DrawPanel, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size, msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
false, true, false ); GetPenSizeForBold( MIN( size.x, size.y ) ),
false, true );
UpperLimit = MAX( UpperLimit, WsItem->m_Posy + SIZETEXT ); UpperLimit = MAX( UpperLimit, WsItem->m_Posy + SIZETEXT );
} }
break; break;
...@@ -1313,8 +1363,9 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w ...@@ -1313,8 +1363,9 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
msg += screen->m_Title; msg += screen->m_Title;
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( DrawPanel, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size, msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
false, true, false ); GetPenSizeForBold( MIN( size.x, size.y ) ),
false, true );
break; break;
case WS_COMMENT1: case WS_COMMENT1:
...@@ -1325,8 +1376,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w ...@@ -1325,8 +1376,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
{ {
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( DrawPanel, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size, msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width,
false, false, false ); false, false );
UpperLimit = MAX( UpperLimit, WsItem->m_Posy + SIZETEXT ); UpperLimit = MAX( UpperLimit, WsItem->m_Posy + SIZETEXT );
} }
break; break;
...@@ -1339,8 +1390,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w ...@@ -1339,8 +1390,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
{ {
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( DrawPanel, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size, msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width,
false, false, false ); false, false );
UpperLimit = MAX( UpperLimit, WsItem->m_Posy + SIZETEXT ); UpperLimit = MAX( UpperLimit, WsItem->m_Posy + SIZETEXT );
} }
break; break;
...@@ -1353,8 +1404,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w ...@@ -1353,8 +1404,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
{ {
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( DrawPanel, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size, msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width,
false, false, false ); false, false );
UpperLimit = MAX( UpperLimit, WsItem->m_Posy + SIZETEXT ); UpperLimit = MAX( UpperLimit, WsItem->m_Posy + SIZETEXT );
} }
break; break;
...@@ -1367,8 +1418,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w ...@@ -1367,8 +1418,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
{ {
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( DrawPanel, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size, msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width,
false, false, false ); false, false );
UpperLimit = MAX( UpperLimit, WsItem->m_Posy + SIZETEXT ); UpperLimit = MAX( UpperLimit, WsItem->m_Posy + SIZETEXT );
} }
break; break;
...@@ -1378,21 +1429,22 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w ...@@ -1378,21 +1429,22 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
break; break;
case WS_LEFT_SEGMENT: case WS_LEFT_SEGMENT:
WS_MostUpperLine.m_Posy = WS_MostUpperLine.m_Posy =
WS_MostUpperLine.m_Endy = WS_MostUpperLine.m_Endy =
WS_MostLeftLine.m_Posy = UpperLimit; WS_MostLeftLine.m_Posy = UpperLimit;
pos.y = (refy - WsItem->m_Posy) * scale; pos.y = (refy - WsItem->m_Posy) * scale;
case WS_SEGMENT: case WS_SEGMENT:
xg = Sheet->m_Size.x - xg = Sheet->m_Size.x -
GRID_REF_W - Sheet->m_RightMargin - WsItem->m_Endx; GRID_REF_W - Sheet->m_RightMargin - WsItem->m_Endx;
yg = Sheet->m_Size.y - yg = Sheet->m_Size.y -
GRID_REF_W - Sheet->m_BottomMargin - WsItem->m_Endy; GRID_REF_W - Sheet->m_BottomMargin - WsItem->m_Endy;
GRLine( &DrawPanel->m_ClipBox, DC, pos.x, pos.y, GRLine( &DrawPanel->m_ClipBox, DC, pos.x, pos.y,
xg * scale, yg * scale, width, Color ); xg * scale, yg * scale, width, Color );
break; break;
} }
} }
#endif #endif
} }
...@@ -1409,14 +1461,14 @@ wxString WinEDA_DrawFrame::GetXYSheetReferences( BASE_SCREEN* aScreen, const wxP ...@@ -1409,14 +1461,14 @@ wxString WinEDA_DrawFrame::GetXYSheetReferences( BASE_SCREEN* aScreen, const wxP
*/ */
{ {
Ki_PageDescr* Sheet = aScreen->m_CurrentSheetDesc; Ki_PageDescr* Sheet = aScreen->m_CurrentSheetDesc;
int ii, xg, yg, ipas, gxpas, gypas; int ii, xg, yg, ipas, gxpas, gypas;
int refx, refy; int refx, refy;
wxString msg; wxString msg;
if( Sheet == NULL ) if( Sheet == NULL )
{ {
DisplayError( this, DisplayError( this,
wxT( "WinEDA_DrawFrame::GetXYSheetReferences() error: NULL Sheet" ) ); wxT( "WinEDA_DrawFrame::GetXYSheetReferences() error: NULL Sheet" ) );
return msg; return msg;
} }
......
...@@ -520,7 +520,7 @@ bool SCH_TEXT::Save( FILE* aFile ) const ...@@ -520,7 +520,7 @@ bool SCH_TEXT::Save( FILE* aFile ) const
if( fprintf( aFile, "Text Notes %-4d %-4d %-4d %-4d %s %d\n%s\n", if( fprintf( aFile, "Text Notes %-4d %-4d %-4d %-4d %s %d\n%s\n",
m_Pos.x, m_Pos.y, m_Pos.x, m_Pos.y,
m_SchematicOrientation, m_Size.x, m_SchematicOrientation, m_Size.x,
shape, (m_Bold?1:0), shape, m_Width,
CONV_TO_UTF8( text ) ) == EOF ) CONV_TO_UTF8( text ) ) == EOF )
{ {
success = false; success = false;
...@@ -577,7 +577,7 @@ bool SCH_LABEL::Save( FILE* aFile ) const ...@@ -577,7 +577,7 @@ bool SCH_LABEL::Save( FILE* aFile ) const
if( fprintf( aFile, "Text Label %-4d %-4d %-4d %-4d %s %d\n%s\n", if( fprintf( aFile, "Text Label %-4d %-4d %-4d %-4d %s %d\n%s\n",
m_Pos.x, m_Pos.y, m_Pos.x, m_Pos.y,
m_SchematicOrientation, m_Size.x, shape, (m_Bold?1:0), m_SchematicOrientation, m_Size.x, shape, m_Width,
CONV_TO_UTF8( m_Text ) ) == EOF ) CONV_TO_UTF8( m_Text ) ) == EOF )
{ {
success = false; success = false;
...@@ -616,7 +616,7 @@ bool SCH_GLOBALLABEL::Save( FILE* aFile ) const ...@@ -616,7 +616,7 @@ bool SCH_GLOBALLABEL::Save( FILE* aFile ) const
m_Pos.x, m_Pos.y, m_Pos.x, m_Pos.y,
m_SchematicOrientation, m_Size.x, m_SchematicOrientation, m_Size.x,
SheetLabelType[m_Shape], SheetLabelType[m_Shape],
shape, (m_Bold?1:0), shape, m_Width,
CONV_TO_UTF8( m_Text ) ) == EOF ) CONV_TO_UTF8( m_Text ) ) == EOF )
{ {
success = false; success = false;
...@@ -670,7 +670,7 @@ bool SCH_HIERLABEL::Save( FILE* aFile ) const ...@@ -670,7 +670,7 @@ bool SCH_HIERLABEL::Save( FILE* aFile ) const
m_Pos.x, m_Pos.y, m_Pos.x, m_Pos.y,
m_SchematicOrientation, m_Size.x, m_SchematicOrientation, m_Size.x,
SheetLabelType[m_Shape], SheetLabelType[m_Shape],
shape, (m_Bold?1:0), shape, m_Width,
CONV_TO_UTF8( m_Text ) ) == EOF ) CONV_TO_UTF8( m_Text ) ) == EOF )
{ {
success = false; success = false;
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h" #include "common.h"
#include "base_struct.h"
#include "drawtxt.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
...@@ -61,9 +63,15 @@ void DialogLabelEditor::TextPropertiesAccept( wxCommandEvent& event ) ...@@ -61,9 +63,15 @@ void DialogLabelEditor::TextPropertiesAccept( wxCommandEvent& event )
m_CurrentText->m_Italic = 0; m_CurrentText->m_Italic = 0;
if ( ( style & 2 ) ) if ( ( style & 2 ) )
{
m_CurrentText->m_Bold = true; m_CurrentText->m_Bold = true;
m_CurrentText->m_Width = GetPenSizeForBold( m_CurrentText->m_Size.x );
}
else else
{
m_CurrentText->m_Bold = false; m_CurrentText->m_Bold = false;
m_CurrentText->m_Width = 0;
}
m_Parent->GetScreen()->SetModify(); m_Parent->GetScreen()->SetModify();
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "program.h" #include "program.h"
#include "libcmp.h" #include "libcmp.h"
#include "general.h" #include "general.h"
#include "drawtxt.h"
#include "protos.h" #include "protos.h"
...@@ -69,7 +70,7 @@ SCH_ITEM* ReadTextDescr( FILE* aFile, ...@@ -69,7 +70,7 @@ SCH_ITEM* ReadTextDescr( FILE* aFile,
if( text == NULL ) if( text == NULL )
return NULL; return NULL;
if( Name1[0] == 'L' ) if( Name1[0] == 'L' ) // Reading a simple label (SCH_LABEL item)
{ {
SCH_LABEL* TextStruct = SCH_LABEL* TextStruct =
new SCH_LABEL( pos, CONV_FROM_UTF8( text ) ); new SCH_LABEL( pos, CONV_FROM_UTF8( text ) );
...@@ -80,12 +81,13 @@ SCH_ITEM* ReadTextDescr( FILE* aFile, ...@@ -80,12 +81,13 @@ SCH_ITEM* ReadTextDescr( FILE* aFile,
{ {
thickness = atol( Name3 ); thickness = atol( Name3 );
TextStruct->m_Bold = (thickness != 0); TextStruct->m_Bold = (thickness != 0);
TextStruct->m_Width = TextStruct->m_Bold ? GetPenSizeForBold( size ) : 0;
} }
Struct = TextStruct; Struct = TextStruct;
if( stricmp( Name2, "Italic" ) == 0 ) if( stricmp( Name2, "Italic" ) == 0 )
TextStruct->m_Italic = 1; TextStruct->m_Italic = 1;
} }
else if( Name1[0] == 'G' && aSchematicFileVersion > '1' ) else if( Name1[0] == 'G' && aSchematicFileVersion > '1' ) // Reading a global label (SCH_GLOBALLABEL item)
{ {
SCH_GLOBALLABEL* TextStruct = SCH_GLOBALLABEL* TextStruct =
new SCH_GLOBALLABEL( pos, CONV_FROM_UTF8( text ) ); new SCH_GLOBALLABEL( pos, CONV_FROM_UTF8( text ) );
...@@ -94,7 +96,8 @@ SCH_ITEM* ReadTextDescr( FILE* aFile, ...@@ -94,7 +96,8 @@ SCH_ITEM* ReadTextDescr( FILE* aFile,
TextStruct->m_Size.x = TextStruct->m_Size.y = size; TextStruct->m_Size.x = TextStruct->m_Size.y = size;
TextStruct->SetSchematicTextOrientation( orient ); TextStruct->SetSchematicTextOrientation( orient );
TextStruct->m_Shape = NET_INPUT; TextStruct->m_Shape = NET_INPUT;
TextStruct->m_Bold = (thickness != 0); TextStruct->m_Bold = (thickness != 0);
TextStruct->m_Width = TextStruct->m_Bold ? GetPenSizeForBold( size ) : 0;
if( stricmp( Name2, SheetLabelType[NET_OUTPUT] ) == 0 ) if( stricmp( Name2, SheetLabelType[NET_OUTPUT] ) == 0 )
TextStruct->m_Shape = NET_OUTPUT; TextStruct->m_Shape = NET_OUTPUT;
...@@ -107,7 +110,7 @@ SCH_ITEM* ReadTextDescr( FILE* aFile, ...@@ -107,7 +110,7 @@ SCH_ITEM* ReadTextDescr( FILE* aFile,
if( stricmp( Name3, "Italic" ) == 0 ) if( stricmp( Name3, "Italic" ) == 0 )
TextStruct->m_Italic = 1; TextStruct->m_Italic = 1;
} }
else if( (Name1[0] == 'H') else if( (Name1[0] == 'H') // Reading a hierarchical label (SCH_HIERLABEL item)
|| (Name1[0] == 'G' && aSchematicFileVersion == '1') ) //in schematic file version 1, glabels were actually hierarchal labels. || (Name1[0] == 'G' && aSchematicFileVersion == '1') ) //in schematic file version 1, glabels were actually hierarchal labels.
{ {
SCH_HIERLABEL* TextStruct = SCH_HIERLABEL* TextStruct =
...@@ -117,7 +120,8 @@ SCH_ITEM* ReadTextDescr( FILE* aFile, ...@@ -117,7 +120,8 @@ SCH_ITEM* ReadTextDescr( FILE* aFile,
TextStruct->m_Size.x = TextStruct->m_Size.y = size; TextStruct->m_Size.x = TextStruct->m_Size.y = size;
TextStruct->SetSchematicTextOrientation( orient ); TextStruct->SetSchematicTextOrientation( orient );
TextStruct->m_Shape = NET_INPUT; TextStruct->m_Shape = NET_INPUT;
TextStruct->m_Bold = (thickness != 0); TextStruct->m_Bold = (thickness != 0);
TextStruct->m_Width = TextStruct->m_Bold ? GetPenSizeForBold( size ) : 0;
if( stricmp( Name2, SheetLabelType[NET_OUTPUT] ) == 0 ) if( stricmp( Name2, SheetLabelType[NET_OUTPUT] ) == 0 )
TextStruct->m_Shape = NET_OUTPUT; TextStruct->m_Shape = NET_OUTPUT;
...@@ -130,7 +134,7 @@ SCH_ITEM* ReadTextDescr( FILE* aFile, ...@@ -130,7 +134,7 @@ SCH_ITEM* ReadTextDescr( FILE* aFile,
if( stricmp( Name3, "Italic" ) == 0 ) if( stricmp( Name3, "Italic" ) == 0 )
TextStruct->m_Italic = 1; TextStruct->m_Italic = 1;
} }
else else // reading a graphic text (comment)
{ {
wxString val = CONV_FROM_UTF8( text ); wxString val = CONV_FROM_UTF8( text );
...@@ -152,7 +156,8 @@ SCH_ITEM* ReadTextDescr( FILE* aFile, ...@@ -152,7 +156,8 @@ SCH_ITEM* ReadTextDescr( FILE* aFile,
if( isdigit( Name3[0] ) ) if( isdigit( Name3[0] ) )
{ {
thickness = atol( Name3 ); thickness = atol( Name3 );
TextStruct->m_Bold = (thickness != 0); TextStruct->m_Bold = (thickness != 0);
TextStruct->m_Width = TextStruct->m_Bold ? GetPenSizeForBold( size ) : 0;
} }
if( strnicmp( Name2, "Italic", 6 ) == 0 ) if( strnicmp( Name2, "Italic", 6 ) == 0 )
......
/* Hershey Cyrillic definition
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 RPMP[ RLMSM RPTTTWUXWXXWZT[L[ RTTVUWWWXVZT[", /* ь */
"H]LIKFKLLINGQFSFVGXIYKZNZSYVXXVZS[P[MZLYKWKVLUMVLW RSFUGWIXKYNYSXVWXUZS[ RPPYP", /* э */
"DaIMI[ RJMJ[ RFMMM RF[M[ RVMSNQPPSPUQXSZV[X[[Z]X^U^S]P[NXMVM RVMTNRPQSQURXTZV[ RX[ZZ\\X]U]S\\PZNXM RJTPT", /* ю */
"G\\VMV[ RWMW[ RZMOMLNKPKQLSOTVT ROMMNLPLQMSOT RTTQUPVNZM[ RTTRUQVOZN[L[KZJX RS[Z[" /* я */
};
/* Hershey Simplex Roman (sans) definition
* First shape has unicode (or ascii) value 0x20 (space)
*/
const static char* hershey_simplex[] =
{
"JZ",
"MWRFRT RRYQZR[SZRY",
"JZNFNM RVFVM",
"H]SBLb RYBRb RLOZO RKUYU",
"H\\PBP_ RTBT_ RYIWGTFPFMGKIKKLMMNOOUQWRXSYUYXWZT[P[MZKX",
"F^[FI[ RNFPHPJOLMMKMIKIIJGLFNFPGSHVHYG[F RWTUUTWTYV[X[ZZ[X[VYTWT",
"E_\\O\\N[MZMYNXPVUTXRZP[L[JZIYHWHUISJRQNRMSKSIRGPFNGMIMKNNPQUXWZY[[[\\Z\\Y",
"MWRHQGRFSGSIRKQL",
"KYVBTDRGPKOPOTPYR]T`Vb",
"KYNBPDRGTKUPUTTYR]P`Nb",
"JZRFRR RMIWO RWIMO",
"E_RIR[ RIR[R",
"MWSZR[QZRYSZS\\R^Q_",
"E_IR[R",
"MWRYQZR[SZRY",
"G][BIb",
"H\\QFNGLJKOKRLWNZQ[S[VZXWYRYOXJVGSFQF",
"H\\NJPISFS[",
"H\\LKLJMHNGPFTFVGWHXJXLWNUQK[Y[",
"H\\MFXFRNUNWOXPYSYUXXVZS[P[MZLYKW",
"H\\UFKTZT RUFU[",
"H\\WFMFLOMNPMSMVNXPYSYUXXVZS[P[MZLYKW",
"H\\XIWGTFRFOGMJL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QGRISJTLTNSPORSTTVTXSZR[Q]Q_Ra RQSSUSWRYQZP\\P^Q`RaTb",
"NVRBRb",
"KYPBRCSDTFTHSJRKQMQOSQ RRCSESGRIQJPLPNQPURQTPVPXQZR[S]S_Ra RSSQUQWRYSZT\\T^S`RaPb",
"F^IUISJPLONOPPTSVTXTZS[Q RISJQLPNPPQTTVUXUZT[Q[O",
"KYQFOGNINKOMQNSNUMVKVIUGSFQF"
};
...@@ -491,14 +491,14 @@ public: ...@@ -491,14 +491,14 @@ public:
wxString m_Text; /* text! */ wxString m_Text; /* text! */
wxPoint m_Pos; /* XY position of anchor text. */ wxPoint m_Pos; /* XY position of anchor text. */
wxSize m_Size; /* XY size of text */ wxSize m_Size; /* XY size of text */
int m_Width; /* text width */ int m_Width; /* pen size used to draw this text */
int m_Orient; /* Orient in 0.1 degrees */ int m_Orient; /* Orient in 0.1 degrees */
bool m_Mirror; // Display Normal / mirror bool m_Mirror; /* Display Normal / mirror */
int m_Attributs; /* flags (visible...) */ int m_Attributs; /* flags (visible...) */
bool m_Italic; /* true to simulate an italic font... */ bool m_Italic; /* true to simulate (or use if exists) an italic font... */
bool m_Bold; /* true to use a bold font... */ bool m_Bold; /* true to simulate a bold font ... */
GRTextHorizJustifyType m_HJustify; /* Horiz Justify */ GRTextHorizJustifyType m_HJustify; /* Horiz justification */
GRTextVertJustifyType m_VJustify; /* Vertical and Vert Justify */ GRTextVertJustifyType m_VJustify; /* Vertical justification */
bool m_MultilineAllowed; /* true to use multiline option, false to use only single line text bool m_MultilineAllowed; /* true to use multiline option, false to use only single line text
* Single line is faster in calculations than multiline */ * Single line is faster in calculations than multiline */
...@@ -576,7 +576,7 @@ public: ...@@ -576,7 +576,7 @@ public:
* If aLine == -1, the full area (considering all lines) is returned * If aLine == -1, the full area (considering all lines) is returned
*/ */
EDA_Rect GetTextBox( int aLine = -1); EDA_Rect GetTextBox( int aLine = -1);
/** Function GetInterline /** Function GetInterline
* return the distance between 2 text lines * return the distance between 2 text lines
* has meaning only for multiline texts * has meaning only for multiline texts
......
...@@ -9,6 +9,26 @@ ...@@ -9,6 +9,26 @@
class WinEDA_DrawPanel; class WinEDA_DrawPanel;
/** Function Clamp_Text_PenSize
*As a rule, pen width should not be >1/4em, otherwise the character
* will be cluttered up in its own fatness
* The pen width max is aSize/4 for bold texts, and aSize/6 for normal texts
* The "best" pen width is aSize/5 for bold texts,
* so the clamp is consistant with bold option.
* @param aPenSize = the pen size to clamp
* @param aSize the char size (height or width, od its wxSize)
* @param aBold = true if text accept bold pen size
* @return the max pen size allowed
*/
int Clamp_Text_PenSize( int aPenSize, int aSize, bool aBold = true);
int Clamp_Text_PenSize( int aPenSize, wxSize aSize, bool aBold = true);
/** Function GetPensizeForBold
* @return the "best" value for a pen size to draw/plot a bold text
* @param aTextSize = the char size (height or width)
*/
int GetPenSizeForBold( int aTextSize );
/** Function ReturnGraphicTextWidth /** Function ReturnGraphicTextWidth
* @return the X size of the graphic text * @return the X size of the graphic text
* the full X size is ReturnGraphicTextWidth + the thickness of graphic lines * the full X size is ReturnGraphicTextWidth + the thickness of graphic lines
...@@ -32,9 +52,9 @@ int NegableTextLength( const wxString& aText ); ...@@ -32,9 +52,9 @@ int NegableTextLength( const wxString& aText );
* @param aV_justify = vertical justification (bottom, center, top) * @param aV_justify = vertical justification (bottom, center, top)
* @param aWidth = line width (pen width) (default = 0) * @param aWidth = line width (pen width) (default = 0)
* if width < 0 : draw segments in sketch mode, width = abs(width) * if width < 0 : draw segments in sketch mode, width = abs(width)
* Use a value min(aSize.x, aSize.y) / 5 for a bold text
* @param aItalic = true to simulate an italic font * @param aItalic = true to simulate an italic font
* @param aBold = true to use a bold font * @param aBold = true to use a bold font
* @param aNegable = true to enable the ~ char for overbarring
* @param aCallback() = function called (if non null) to draw each segment. * @param aCallback() = function called (if non null) to draw each segment.
* used to draw 3D texts or for plotting, NULL for normal drawings * used to draw 3D texts or for plotting, NULL for normal drawings
*/ */
...@@ -49,7 +69,7 @@ void DrawGraphicText( WinEDA_DrawPanel * aPanel, ...@@ -49,7 +69,7 @@ void DrawGraphicText( WinEDA_DrawPanel * aPanel,
enum GRTextVertJustifyType aV_justify, enum GRTextVertJustifyType aV_justify,
int aWidth, int aWidth,
bool aItalic, bool aItalic,
bool aBold, bool aBold,
void (*aCallback)( int x0, int y0, int xf, int yf ) = NULL ); void (*aCallback)( int x0, int y0, int xf, int yf ) = NULL );
/** Function PlotGraphicText /** Function PlotGraphicText
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
/* /*
* Hershey fonts are vectored fonts. * Hershey fonts are vectored fonts.
* Note one can find many formats for these vectored fonts * Note one can find many formats for these vectored fonts
* here is the formats used : * here is the format used :
* >shapes are a set of polygons. * >shapes are a set of polygons.
* >A given shape includes one or more polygons. * >A given shape includes one or more polygons.
* >corner coordinates are coded by a XY pair. * >corner coordinates are coded by a XY pair.
...@@ -35,273 +35,8 @@ ...@@ -35,273 +35,8 @@
* >The coordinate (-50,0) or " R" is the Pen Up command (end of the current polygon) * >The coordinate (-50,0) or " R" is the Pen Up command (end of the current polygon)
*/ */
/* Hershey Simplex Roman (sans) definition */ #include "HersheySimplexRoman_sans_normal.h"
const static char* hershey_simplex[] =
{
"JZ",
"MWRFRT RRYQZR[SZRY",
"JZNFNM RVFVM",
"H]SBLb RYBRb RLOZO RKUYU",
"H\\PBP_ RTBT_ RYIWGTFPFMGKIKKLMMNOOUQWRXSYUYXWZT[P[MZKX",
"F^[FI[ RNFPHPJOLMMKMIKIIJGLFNFPGSHVHYG[F RWTUUTWTYV[X[ZZ[X[VYTWT",
"E_\\O\\N[MZMYNXPVUTXRZP[L[JZIYHWHUISJRQNRMSKSIRGPFNGMIMKNNPQUXWZY[[[\\Z\\Y",
"MWRHQGRFSGSIRKQL",
"KYVBTDRGPKOPOTPYR]T`Vb",
"KYNBPDRGTKUPUTTYR]P`Nb",
"JZRFRR RMIWO RWIMO",
"E_RIR[ RIR[R",
"MWSZR[QZRYSZS\\R^Q_",
"E_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[Q[OZMX RMPQNTNVOWPXSXUWXVYTZQZMX",
"H\\WMWbXb RWMXMXb RWPUNSMPMNNLPKSKULXNZP[S[UZWX RWPSNPNNOMPLSLUMXNYPZSZWX",
"KYOMO[P[ ROMPMP[ RPSQPSNUMXM RPSQQSOUNXNXM",
"J[XPWNTMQMNNMPNRPSUUWV RVUWWWXVZ RWYTZQZNY ROZNXMX RXPWPVN RWOTNQNNO RONNPOR RNQPRUTWUXWXXWZT[Q[NZMX",
"MXRFR[S[ RRFSFS[ ROMVMVN ROMONVN",
"H\\LMLWMZO[R[TZWW RLMMMMWNYPZRZTYWW RWMW[X[ RWMXMX[",
"JZLMR[ RLMMMRY RXMWMRY RXMR[",
"F^IMN[ RIMJMNX RRMNX RRPN[ RRPV[ RRMVX R[MZMVX R[MV[",
"I[LMW[X[ RLMMMX[ RXMWML[ RXMM[L[",
"JZLMR[ RLMMMRY RXMWMRYNb RXMR[ObNb",
"I[VNL[ RXMNZ RLMXM RLMLNVN RNZXZX[ RL[X[",
"KYTBRCQDPFPHQJRKSMSOQQ RRCQEQGRISJTLTNSPORSTTVTXSZR[Q]Q_Ra RQSSUSWRYQZP\\P^Q`RaTb",
"NVRBRb",
"KYPBRCSDTFTHSJRKQMQOSQ RRCSESGRIQJPLPNQPURQTPVPXQZR[S]S_Ra RSSQUQWRYSZT\\T^S`RaPb",
"F^IUISJPLONOPPTSVTXTZS[Q RISJQLPNPPQTTVUXUZT[Q[O",
"KYQFOGNINKOMQNSNUMVKVIUGSFQF RQFNIOMSNVKUGQF RSFOGNKQNUMVISF"
};
#if defined(KICAD_CYRILLIC) #if defined(KICAD_CYRILLIC)
const static char* hershey_cyrillic[] = #include "HersheyCyrillic.h"
{
"H\\RFK[ RRFY[ RRIX[ RMUVU RI[O[ RU[[[",
"G]LFL[ RMFM[ RIFYFYLXF RMPUPXQYRZTZWYYXZU[I[ RUPWQXRYTYWXYWZU[",
"G]LFL[ RMFM[ RIFUFXGYHZJZLYNXOUP RUFWGXHY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z]X^U^S]P[NXMVM RVMTNRPQSQURXTZV[ RX[ZZ\\X]U]S\\PZNXM RJTPT", /* ю */
"G\\VMV[ RWMW[ RZMOMLNKPKQLSOTVT ROMMNLPLQMSOT RTTQUPVNZM[ RTTRUQVOZN[L[KZJX RS[Z[" /* я */
};
#endif #endif
...@@ -11,32 +11,32 @@ ...@@ -11,32 +11,32 @@
#ifndef __WORKSHEET_H__ #ifndef __WORKSHEET_H__
#define __WORKSHEET_H__ #define __WORKSHEET_H__
#define GRID_REF_W 70 /* hauteur de la bande de reference grille */ #define GRID_REF_W 70 /* hauteur de la bande de reference grille */
#define SIZETEXT 60 /* Dimension des textes du cartouche */ #define SIZETEXT 60 /* Dimension des textes du cartouche */
#define SIZETEXT_REF 50 /* Dimension des lettres du marquage des reperes */ #define SIZETEXT_REF 50 /* Dimension des lettres du marquage des reperes */
#define PAS_REF 2000 /* pas des marquages de reference des reperes */ #define PAS_REF 2000 /* pas des marquages de reference des reperes */
#define TEXT_VTAB_HEIGHT SIZETEXT*2 #define TEXT_VTAB_HEIGHT SIZETEXT * 2
#if defined(KICAD_GOST) #if defined(KICAD_GOST)
/* Shtamp */ /* Shtamp */
#define STAMP_OX 185 * 10000 / 254 #define STAMP_OX 185 * 10000 / 254
#define STAMP_OY 55 * 10000 / 254 #define STAMP_OY 55 * 10000 / 254
#define STAMP_Y_0 0 #define STAMP_Y_0 0
#define STAMP_Y_5 5 * 10000 / 254 #define STAMP_Y_5 5 * 10000 / 254
#define STAMP_Y_8 8 * 10000 / 254 #define STAMP_Y_8 8 * 10000 / 254
#define STAMP_Y_7 7 * 10000 / 254 #define STAMP_Y_7 7 * 10000 / 254
#define STAMP_Y_10 10 * 10000 / 254 #define STAMP_Y_10 10 * 10000 / 254
#define STAMP_Y_14 14 * 10000 / 254 #define STAMP_Y_14 14 * 10000 / 254
#define STAMP_Y_15 15 * 10000 / 254 #define STAMP_Y_15 15 * 10000 / 254
#define STAMP_Y_20 20 * 10000 / 254 #define STAMP_Y_20 20 * 10000 / 254
#define STAMP_Y_25 25 * 10000 / 254 #define STAMP_Y_25 25 * 10000 / 254
#define STAMP_Y_30 30 * 10000 / 254 #define STAMP_Y_30 30 * 10000 / 254
#define STAMP_Y_35 35 * 10000 / 254 #define STAMP_Y_35 35 * 10000 / 254
#define STAMP_Y_40 40 * 10000 / 254 #define STAMP_Y_40 40 * 10000 / 254
#define STAMP_Y_45 45 * 10000 / 254 #define STAMP_Y_45 45 * 10000 / 254
#define STAMP_Y_50 50 * 10000 / 254 #define STAMP_Y_50 50 * 10000 / 254
#define STAMP_Y_55 55 * 10000 / 254 #define STAMP_Y_55 55 * 10000 / 254
#define STAMP_X_0 0 #define STAMP_X_0 0
#define STAMP_X_10 10 * 10000 / 254 #define STAMP_X_10 10 * 10000 / 254
...@@ -58,59 +58,58 @@ ...@@ -58,59 +58,58 @@
#define STAMP_X_178 178 * 10000 / 254 #define STAMP_X_178 178 * 10000 / 254
#define STAMP_X_185 185 * 10000 / 254 #define STAMP_X_185 185 * 10000 / 254
#define STAMP_5 5 * 10000 / 254 #define STAMP_5 5 * 10000 / 254
#define STAMP_7 7 * 10000 / 254 #define STAMP_7 7 * 10000 / 254
#define STAMP_12 12 * 10000 / 254 #define STAMP_12 12 * 10000 / 254
#define STAMP_145 145 * 10000 / 254 #define STAMP_145 145 * 10000 / 254
#define STAMP_110 110 * 10000 / 254 #define STAMP_110 110 * 10000 / 254
#define STAMP_85 85 * 10000 / 254 #define STAMP_85 85 * 10000 / 254
#define STAMP_60 60 * 10000 / 254 #define STAMP_60 60 * 10000 / 254
#define STAMP_25 25 * 10000 / 254 #define STAMP_25 25 * 10000 / 254
#endif #endif
/* Les coord ci dessous sont relatives au coin bas - droit de la feuille, et /* Les coord ci dessous sont relatives au coin bas - droit de la feuille, et
seront soustraires de cette origine * seront soustraires de cette origine
*/ */
#define BLOCK_OX 4200 #define BLOCK_OX 4200
#define BLOCK_KICAD_VERSION_X BLOCK_OX - SIZETEXT #define BLOCK_KICAD_VERSION_X BLOCK_OX - SIZETEXT
#define BLOCK_KICAD_VERSION_Y SIZETEXT #define BLOCK_KICAD_VERSION_Y SIZETEXT
#define BLOCK_REV_X 820 #define BLOCK_REV_X 820
#define BLOCK_REV_Y (SIZETEXT*3) #define BLOCK_REV_Y (SIZETEXT * 3)
#define BLOCK_DATE_X BLOCK_OX - (SIZETEXT*15) #define BLOCK_DATE_X BLOCK_OX - (SIZETEXT * 15)
#define BLOCK_DATE_Y (SIZETEXT*3) #define BLOCK_DATE_Y (SIZETEXT * 3)
#define BLOCK_ID_SHEET_X 820 #define BLOCK_ID_SHEET_X 820
#define BLOCK_ID_SHEET_Y SIZETEXT #define BLOCK_ID_SHEET_Y SIZETEXT
#define BLOCK_SIZE_SHEET_X BLOCK_OX - SIZETEXT #define BLOCK_SIZE_SHEET_X BLOCK_OX - SIZETEXT
#define BLOCK_SIZE_SHEET_Y (SIZETEXT*3) #define BLOCK_SIZE_SHEET_Y (SIZETEXT * 3)
#define BLOCK_TITLE_X BLOCK_OX - SIZETEXT #define BLOCK_TITLE_X BLOCK_OX - SIZETEXT
#define BLOCK_TITLE_Y (SIZETEXT*5) #define BLOCK_TITLE_Y (SIZETEXT * 5)
#define BLOCK_FULLSHEETNAME_X BLOCK_OX - SIZETEXT #define BLOCK_FULLSHEETNAME_X BLOCK_OX - SIZETEXT
#define BLOCK_FULLSHEETNAME_Y (SIZETEXT * 7) #define BLOCK_FULLSHEETNAME_Y (SIZETEXT * 7)
#define BLOCK_FILENAME_X BLOCK_OX - SIZETEXT #define BLOCK_FILENAME_X BLOCK_OX - SIZETEXT
#define BLOCK_FILENAME_Y (SIZETEXT * 9) #define BLOCK_FILENAME_Y (SIZETEXT * 9)
#define BLOCK_COMMENT_X BLOCK_OX - SIZETEXT #define BLOCK_COMMENT_X BLOCK_OX - SIZETEXT
#define VARIABLE_BLOCK_START_POSITION (SIZETEXT * 10) #define VARIABLE_BLOCK_START_POSITION (SIZETEXT * 10)
#define BLOCK_COMPANY_Y (SIZETEXT*11) #define BLOCK_COMPANY_Y (SIZETEXT * 11)
#define BLOCK_COMMENT1_Y (SIZETEXT*13) #define BLOCK_COMMENT1_Y (SIZETEXT * 13)
#define BLOCK_COMMENT2_Y (SIZETEXT*15) #define BLOCK_COMMENT2_Y (SIZETEXT * 15)
#define BLOCK_COMMENT3_Y (SIZETEXT*17) #define BLOCK_COMMENT3_Y (SIZETEXT * 17)
#define BLOCK_COMMENT4_Y (SIZETEXT*19) #define BLOCK_COMMENT4_Y (SIZETEXT * 19)
struct Ki_WorkSheetData struct Ki_WorkSheetData
{ {
public: public:
int m_Type; /* nombre permettant de reconnaitre la description */ int m_Type; /* nombre permettant de reconnaitre la description */
Ki_WorkSheetData * Pnext; Ki_WorkSheetData* Pnext;
int m_Posx, m_Posy; /* position de l'element ou point de depart du segment */ int m_Posx, m_Posy; /* position de l'element ou point de depart du segment */
int m_Endx, m_Endy; /* extremite d'un element type segment ou cadre */ int m_Endx, m_Endy; /* extremite d'un element type segment ou cadre */
const wxChar * m_Legende; /* Pour m_Textes: texte a afficher avant le texte lui meme */ const wxChar* m_Legende; /* Pour m_Textes: texte a afficher avant le texte lui meme */
const wxChar * m_Text; /* Pour m_Textes:pointeur sur le texte a afficher */ const wxChar* m_Text; /* Pour m_Textes:pointeur sur le texte a afficher */
}; };
/* Type des descriptions Ki_WorkSheetData */ /* Type des descriptions Ki_WorkSheetData */
enum TypeKi_WorkSheetData enum TypeKi_WorkSheetData {
{
WS_DATE, WS_DATE,
WS_REV, WS_REV,
WS_KICAD_VERSION, WS_KICAD_VERSION,
......
No preview for this file type
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -205,6 +205,8 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin ...@@ -205,6 +205,8 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
if( ( m_Masque_Layer & ALL_CU_LAYERS ) == 0 ) if( ( m_Masque_Layer & ALL_CU_LAYERS ) == 0 )
DisplayIsol = FALSE; DisplayIsol = FALSE;
SetAlpha(&color, 170);
switch( GetShape() ) switch( GetShape() )
{ {
case PAD_CIRCLE: case PAD_CIRCLE:
......
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
#include "fctsys.h" #include "fctsys.h"
#include "wxstruct.h" #include "wxstruct.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "base_struct.h"
#include "common.h" #include "common.h"
#include "drawtxt.h"
#include "kicad_string.h" #include "kicad_string.h"
#include "pcbnew.h" #include "pcbnew.h"
...@@ -42,6 +44,7 @@ void TEXTE_PCB::Copy( TEXTE_PCB* source ) ...@@ -42,6 +44,7 @@ void TEXTE_PCB::Copy( TEXTE_PCB* source )
m_Width = source->m_Width; m_Width = source->m_Width;
m_Attributs = source->m_Attributs; m_Attributs = source->m_Attributs;
m_Italic = source->m_Italic; m_Italic = source->m_Italic;
m_Bold = source->m_Bold;
m_HJustify = source->m_HJustify; m_HJustify = source->m_HJustify;
m_VJustify = source->m_VJustify; m_VJustify = source->m_VJustify;
m_MultilineAllowed = m_MultilineAllowed; m_MultilineAllowed = m_MultilineAllowed;
...@@ -131,6 +134,11 @@ int TEXTE_PCB::ReadTextePcbDescr( FILE* File, int* LineNum ) ...@@ -131,6 +134,11 @@ int TEXTE_PCB::ReadTextePcbDescr( FILE* File, int* LineNum )
} }
} }
// Set a reasonnable width:
if( m_Width < 1 )
m_Width = 1;
m_Width = Clamp_Text_PenSize( m_Width, m_Size );
return 1; return 1;
} }
...@@ -194,7 +202,7 @@ void TEXTE_PCB::Draw( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -194,7 +202,7 @@ void TEXTE_PCB::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
GRFillMode fillmode = FILLED; GRFillMode fillmode = FILLED;
if ( DisplayOpt.DisplayDrawItems == SKETCH) if ( DisplayOpt.DisplayDrawItems == SKETCH)
fillmode = SKETCH; fillmode = SKETCH;
EDA_TextStruct::Draw( EDA_TextStruct::Draw(
panel, DC, panel, DC,
offset, offset,
......
...@@ -166,19 +166,18 @@ int TEXTE_MODULE::ReadDescr( char* aLine, FILE* aFile, int* aLineNum ) ...@@ -166,19 +166,18 @@ int TEXTE_MODULE::ReadDescr( char* aLine, FILE* aFile, int* aLineNum )
ReadDelimitedText( BufLine, aLine, sizeof(BufLine) ); ReadDelimitedText( BufLine, aLine, sizeof(BufLine) );
m_Text = CONV_FROM_UTF8( BufLine ); m_Text = CONV_FROM_UTF8( BufLine );
// Test for a reasonnable width:
if( m_Width <= 1 )
m_Width = 1;
if( m_Width > TEXTS_MAX_WIDTH )
m_Width = TEXTS_MAX_WIDTH;
// Test for a reasonnable size: // Test for a reasonnable size:
if( m_Size.x < TEXTS_MIN_SIZE ) if( m_Size.x < TEXTS_MIN_SIZE )
m_Size.x = TEXTS_MIN_SIZE; m_Size.x = TEXTS_MIN_SIZE;
if( m_Size.y < TEXTS_MIN_SIZE ) if( m_Size.y < TEXTS_MIN_SIZE )
m_Size.y = TEXTS_MIN_SIZE; m_Size.y = TEXTS_MIN_SIZE;
return success; // Set a reasonnable width:
if( m_Width < 1 )
m_Width = 1;
m_Width = Clamp_Text_PenSize( m_Width, m_Size );
return success;
} }
...@@ -203,6 +202,8 @@ void TEXTE_MODULE::Copy( TEXTE_MODULE* source ) ...@@ -203,6 +202,8 @@ void TEXTE_MODULE::Copy( TEXTE_MODULE* source )
m_Size = source->m_Size; m_Size = source->m_Size;
m_Width = source->m_Width; m_Width = source->m_Width;
m_Italic = source->m_Italic;
m_Bold = source->m_Bold;
m_Text = source->m_Text; m_Text = source->m_Text;
} }
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
#include "common.h" #include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "drawtxt.h"
#include "confirm.h"
#include "dialog_edit_module_text_base.h" #include "dialog_edit_module_text_base.h"
...@@ -178,9 +180,12 @@ void DialogEditModuleText::OnOkClick( wxCommandEvent& event ) ...@@ -178,9 +180,12 @@ void DialogEditModuleText::OnOkClick( wxCommandEvent& event )
// Test for a reasonnable width: // Test for a reasonnable width:
if( width <= 1 ) if( width <= 1 )
width = 1; width = 1;
int minthickness = min(m_CurrentTextMod->m_Size.x, m_CurrentTextMod->m_Size.y) / 4; int maxthickness = Clamp_Text_PenSize(width, m_CurrentTextMod->m_Size );
if( width > minthickness ) if( width > maxthickness )
width = minthickness; {
DisplayError(this, _("The text thickness is too large for the text size. It will be clamped"));
width = maxthickness;
}
m_CurrentTextMod->SetWidth( width ); m_CurrentTextMod->SetWidth( width );
m_CurrentTextMod->m_NoShow = (m_Show->GetSelection() == 0) ? 0 : 1; m_CurrentTextMod->m_NoShow = (m_Show->GetSelection() == 0) ? 0 : 1;
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
#include "common.h" #include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "drawtxt.h"
#include "confirm.h"
enum id_TextPCB_properties { enum id_TextPCB_properties {
ID_TEXTPCB_SELECT_LAYER = 1900 ID_TEXTPCB_SELECT_LAYER = 1900
...@@ -221,10 +223,12 @@ void WinEDA_TextPCBPropertiesFrame::OnOkClick( wxCommandEvent& event ) ...@@ -221,10 +223,12 @@ void WinEDA_TextPCBPropertiesFrame::OnOkClick( wxCommandEvent& event )
CurrentTextPCB->m_Width = m_TxtWidthCtlr->GetValue(); CurrentTextPCB->m_Width = m_TxtWidthCtlr->GetValue();
// test for acceptable values for parameters: // test for acceptable values for parameters:
int max_tickness = min( CurrentTextPCB->m_Size.x, CurrentTextPCB->m_Size.y ); int maxthickness = Clamp_Text_PenSize( CurrentTextPCB->m_Width, CurrentTextPCB->m_Size );
max_tickness /= 4; if( CurrentTextPCB->m_Width > maxthickness )
if( CurrentTextPCB->m_Width > max_tickness ) {
CurrentTextPCB->m_Width = max_tickness; DisplayError(this, _("The text thickness is too large for the text size. It will be clamped"));
CurrentTextPCB->m_Width = maxthickness;
}
CurrentTextPCB->m_Mirror = (m_Mirror->GetSelection() == 1) ? true : false; CurrentTextPCB->m_Mirror = (m_Mirror->GetSelection() == 1) ? true : false;
CurrentTextPCB->m_Orient = m_Orient->GetSelection() * 900; CurrentTextPCB->m_Orient = m_Orient->GetSelection() * 900;
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "drawtxt.h"
#include "trigo.h" #include "trigo.h"
#include "protos.h" #include "protos.h"
...@@ -44,6 +45,8 @@ TEXTE_MODULE* WinEDA_BasePcbFrame::CreateTextModule( MODULE* Module, wxDC* DC ) ...@@ -44,6 +45,8 @@ TEXTE_MODULE* WinEDA_BasePcbFrame::CreateTextModule( MODULE* Module, wxDC* DC )
Text->m_Text = wxT( "text" ); Text->m_Text = wxT( "text" );
ModuleTextWidth = Clamp_Text_PenSize( ModuleTextWidth,
MIN(ModuleTextSize.x, ModuleTextSize.y), true );
Text->m_Size = ModuleTextSize; Text->m_Size = ModuleTextSize;
Text->m_Width = ModuleTextWidth; Text->m_Width = ModuleTextWidth;
Text->m_Pos = GetScreen()->m_Curseur; Text->m_Pos = GetScreen()->m_Curseur;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment