Commit 0d459865 authored by Dick Hollenbeck's avatar Dick Hollenbeck
Browse files

rename Ki_PageDescr to PAGE_INFO, encapsulate it in accessors, and move it into the BOARD

parent 0e27f45f
Loading
Loading
Loading
Loading
+29 −48
Original line number Original line Diff line number Diff line
@@ -40,7 +40,6 @@


BASE_SCREEN::BASE_SCREEN( KICAD_T aType ) : EDA_ITEM( aType )
BASE_SCREEN::BASE_SCREEN( KICAD_T aType ) : EDA_ITEM( aType )
{
{
    m_drawList         = NULL;   /* Draw items list */
    m_UndoRedoCountMax = 10;     /* undo/Redo command Max depth, 10 is a reasonable value */
    m_UndoRedoCountMax = 10;     /* undo/Redo command Max depth, 10 is a reasonable value */
    m_FirstRedraw      = true;
    m_FirstRedraw      = true;
    m_ScreenNumber     = 1;
    m_ScreenNumber     = 1;
@@ -49,12 +48,9 @@ BASE_SCREEN::BASE_SCREEN( KICAD_T aType ) : EDA_ITEM( aType )
    m_Grid.m_Size      = wxRealPoint( 50, 50 );   /* Default grid size */
    m_Grid.m_Size      = wxRealPoint( 50, 50 );   /* Default grid size */
    m_Grid.m_Id        = ID_POPUP_GRID_LEVEL_50;
    m_Grid.m_Id        = ID_POPUP_GRID_LEVEL_50;
    m_Center           = true;
    m_Center           = true;
    m_CurrentSheetDesc = &g_Sheet_A4;
    m_IsPrinting       = false;
    m_IsPrinting       = false;
    m_ScrollPixelsPerUnitX = 1;
    m_ScrollPixelsPerUnitX = 1;
    m_ScrollPixelsPerUnitY = 1;
    m_ScrollPixelsPerUnitY = 1;

    InitDatas();
}
}




@@ -63,26 +59,49 @@ BASE_SCREEN::~BASE_SCREEN()
}
}




void BASE_SCREEN::InitDatas()
/*
wxSize BASE_SCREEN::ReturnPageSize( void )
{
    int internal_units = GetInternalUnits();
    wxSize size = m_CurrentSheetDesc->m_Size;
    size.x =  (int)( (double)size.x * internal_units / 1000 );
    size.y =  (int)( (double)size.y * internal_units / 1000 );

    return size;
}

void BASE_SCREEN::SetPageSize( wxSize& aPageSize )
{
    int internal_units = GetInternalUnits();

    m_CurrentSheetDesc->m_Size.x = (int) ((double)aPageSize.x * 1000 / internal_units);
    m_CurrentSheetDesc->m_Size.y = (int) ((double)aPageSize.y * 1000 / internal_units);
}
*/


void BASE_SCREEN::InitDataPoints( const wxSize& aPageSizeInternalUnits )
{
{
    if( m_Center )
    if( m_Center )
    {
    {
        m_crossHairPosition.x = m_crossHairPosition.y = 0;
        m_crossHairPosition.x = m_crossHairPosition.y = 0;
        m_DrawOrg.x = -ReturnPageSize().x / 2;

        m_DrawOrg.y = -ReturnPageSize().y / 2;
        m_DrawOrg.x = -aPageSizeInternalUnits.x / 2;
        m_DrawOrg.y = -aPageSizeInternalUnits.y / 2;
    }
    }
    else
    else
    {
    {
        m_DrawOrg.x = m_DrawOrg.y = 0;
        m_DrawOrg.x = m_DrawOrg.y = 0;
        m_crossHairPosition.x = ReturnPageSize().x / 2;

        m_crossHairPosition.y = ReturnPageSize().y / 2;
        m_crossHairPosition.x = aPageSizeInternalUnits.x / 2;
        m_crossHairPosition.y = aPageSizeInternalUnits.y / 2;
    }
    }


    m_O_Curseur.x = m_O_Curseur.y = 0;
    m_O_Curseur.x = m_O_Curseur.y = 0;


    SetCurItem( NULL );
    SetCurItem( NULL );


    m_FlagModified = false;   // Set when any change is made on broad.
    m_FlagModified = false;   // Set when any change is made on board.
    m_FlagSave = false;       // Used in auto save set when an auto save is required.
    m_FlagSave = false;       // Used in auto save set when an auto save is required.
}
}


@@ -93,25 +112,6 @@ int BASE_SCREEN::GetInternalUnits( void )
}
}




wxSize BASE_SCREEN::ReturnPageSize( void )
{
    int internal_units = GetInternalUnits();
    wxSize size = m_CurrentSheetDesc->m_Size;
    size.x =  (int)( (double)size.x * internal_units / 1000 );
    size.y =  (int)( (double)size.y * internal_units / 1000 );

    return size;
}

void BASE_SCREEN::SetPageSize( wxSize& aPageSize )
{
    int internal_units = GetInternalUnits();

    m_CurrentSheetDesc->m_Size.x = (int) ((double)aPageSize.x * 1000 / internal_units);
    m_CurrentSheetDesc->m_Size.y = (int) ((double)aPageSize.y * 1000 / internal_units);
}


double BASE_SCREEN::GetScalingFactor() const
double BASE_SCREEN::GetScalingFactor() const
{
{
    double scale = 1.0 / GetZoom();
    double scale = 1.0 / GetZoom();
@@ -513,22 +513,3 @@ void BASE_SCREEN::InsertItem( EDA_ITEMS::iterator aIter, EDA_ITEM* aItem )
    m_items.insert( aIter, aItem );
    m_items.insert( aIter, aItem );
}
}

#if defined(DEBUG)

void BASE_SCREEN::Show( int nestLevel, std::ostream& os ) const
{
    EDA_ITEM* item = m_drawList;

    // for now, make it look like XML, expand on this later.
    NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << ">\n";

    for(  ; item;  item = item->Next() )
    {
        item->Show( nestLevel+1, os );
    }

    NestedSpace( nestLevel, os ) << "</" << GetClass().Lower().mb_str() << ">\n";
}

#endif
+5 −6
Original line number Original line Diff line number Diff line
@@ -32,7 +32,6 @@ PLOTTER::PLOTTER( PlotFormat aPlotType )
    output_file   = 0;
    output_file   = 0;
    color_mode    = false;      /* Start as a BW plot */
    color_mode    = false;      /* Start as a BW plot */
    negative_mode = false;
    negative_mode = false;
    sheet = NULL;
}
}




@@ -424,12 +423,12 @@ void PLOTTER::thick_circle( wxPoint pos, int diametre, int width,
}
}




void PLOTTER::set_paper_size( Ki_PageDescr* asheet )
void PLOTTER::SetPageSettings( const PAGE_INFO& aPageSettings )
{
{
    wxASSERT( !output_file );
    wxASSERT( !output_file );
    sheet = asheet;
    pageInfo = aPageSettings;


    // Sheets are in mils, plotter works with decimals
    // PAGE_INFO is in mils, plotter works with decimals
    paper_size.x = sheet->m_Size.x * 10;
    paper_size = pageInfo.GetSizeMils() * 10;
    paper_size.y = sheet->m_Size.y * 10;
}
}
+125 −30
Original line number Original line Diff line number Diff line
@@ -46,31 +46,6 @@
 *       application class.
 *       application class.
 */
 */


/* Standard page sizes in 1/1000 inch */
#if defined(KICAD_GOST)
Ki_PageDescr  g_Sheet_A4( wxSize( 8283, 11700 ), wxPoint( 0, 0 ), wxT( "A4" ) );
#else
Ki_PageDescr  g_Sheet_A4( wxSize( 11700, 8267 ), wxPoint( 0, 0 ), wxT( "A4" ) );
#endif
Ki_PageDescr  g_Sheet_A3( wxSize( 16535, 11700 ), wxPoint( 0, 0 ), wxT( "A3" ) );
Ki_PageDescr  g_Sheet_A2( wxSize( 23400, 16535 ), wxPoint( 0, 0 ), wxT( "A2" ) );
Ki_PageDescr  g_Sheet_A1( wxSize( 33070, 23400 ), wxPoint( 0, 0 ), wxT( "A1" ) );
Ki_PageDescr  g_Sheet_A0( wxSize( 46800, 33070 ), wxPoint( 0, 0 ), wxT( "A0" ) );
Ki_PageDescr  g_Sheet_A( wxSize( 11000, 8500 ), wxPoint( 0, 0 ), wxT( "A" ) );
Ki_PageDescr  g_Sheet_B( wxSize( 17000, 11000 ), wxPoint( 0, 0 ), wxT( "B" ) );
Ki_PageDescr  g_Sheet_C( wxSize( 22000, 17000 ), wxPoint( 0, 0 ), wxT( "C" ) );
Ki_PageDescr  g_Sheet_D( wxSize( 34000, 22000 ), wxPoint( 0, 0 ), wxT( "D" ) );
Ki_PageDescr  g_Sheet_E( wxSize( 44000, 34000 ), wxPoint( 0, 0 ), wxT( "E" ) );
Ki_PageDescr  g_Sheet_GERBER( wxSize( 32000, 32000 ), wxPoint( 0, 0 ), wxT( "GERBER" ) );
Ki_PageDescr  g_Sheet_user( wxSize( 17000, 11000 ), wxPoint( 0, 0 ), wxT( "User" ) );

Ki_PageDescr* g_SheetSizeList[NB_ITEMS + 1] =
{
    &g_Sheet_A4,   &g_Sheet_A3, &g_Sheet_A2, &g_Sheet_A1, &g_Sheet_A0,
    &g_Sheet_A,    &g_Sheet_B,  &g_Sheet_C,  &g_Sheet_D,  &g_Sheet_E,
    &g_Sheet_user, NULL
};



const wxString ProjectFileExtension( wxT( "pro" ) );
const wxString ProjectFileExtension( wxT( "pro" ) );
const wxString SchematicFileExtension( wxT( "sch" ) );
const wxString SchematicFileExtension( wxT( "sch" ) );
@@ -199,12 +174,88 @@ bool EnsureTextCtrlWidth( wxTextCtrl* aCtrl, const wxString* aString )
}
}




Ki_PageDescr::Ki_PageDescr( const wxSize& size, const wxPoint& offset, const wxString& name )
//-----<PAGE_INFO>-------------------------------------------------------------

// Standard page sizes in 1/1000 inch
#if defined(KICAD_GOST)
static const PAGE_INFO  pageA4(    wxSize(  8283, 11700 ),  wxPoint( 0, 0 ), wxT( "A4" ) );
#else
static const PAGE_INFO  pageA4(    wxSize( 11700,  8267 ),  wxPoint( 0, 0 ), wxT( "A4" ) );
#endif
static const PAGE_INFO  pageA3(    wxSize( 16535, 11700 ),  wxPoint( 0, 0 ), wxT( "A3" ) );
static const PAGE_INFO  pageA2(    wxSize( 23400, 16535 ),  wxPoint( 0, 0 ), wxT( "A2" ) );
static const PAGE_INFO  pageA1(    wxSize( 33070, 23400 ),  wxPoint( 0, 0 ), wxT( "A1" ) );
static const PAGE_INFO  pageA0(    wxSize( 46800, 33070 ),  wxPoint( 0, 0 ), wxT( "A0" ) );
static const PAGE_INFO  pageA(     wxSize( 11000,  8500 ),  wxPoint( 0, 0 ), wxT( "A" ) );
static const PAGE_INFO  pageB(     wxSize( 17000, 11000 ),  wxPoint( 0, 0 ), wxT( "B" ) );
static const PAGE_INFO  pageC(     wxSize( 22000, 17000 ),  wxPoint( 0, 0 ), wxT( "C" ) );
static const PAGE_INFO  pageD(     wxSize( 34000, 22000 ),  wxPoint( 0, 0 ), wxT( "D" ) );
static const PAGE_INFO  pageE(     wxSize( 44000, 34000 ),  wxPoint( 0, 0 ), wxT( "E" ) );
static const PAGE_INFO  pageGERBER(wxSize( 32000, 32000 ),  wxPoint( 0, 0 ), wxT( "GERBER" ) );

double PAGE_INFO::s_user_width  = 17.0;
double PAGE_INFO::s_user_height = 11.0;
static const PAGE_INFO  pageUser(  wxSize( 17000, 11000 ),  wxPoint( 0, 0 ), wxT( "User" ) );

/*
static const PAGE_INFO* pageSizes[] =
{
    &pageA4,    &pageA3,    &pageA2,    &pageA1,    &pageA0,
    &pageA,     &pageB,     &pageC,     &pageD,     &pageE,      &pageUser,
};


PAGE_INFOS PAGE_INFO::GetStandardSizes()
{
    return PAGE_INFOS( pageSizes, pageSizes + DIM( pageSizes ) );
}
*/

bool PAGE_INFO::SetType( const wxString& aType )
{
    bool rc = true;

    if( aType == pageA4.GetType() )
        *this = pageA4;
    else if( aType == pageA3.GetType() )
        *this = pageA3;
    else if( aType == pageA2.GetType() )
        *this = pageA2;
    else if( aType == pageA1.GetType() )
        *this = pageA1;
    else if( aType == pageA0.GetType() )
        *this = pageA0;
    else if( aType == pageA.GetType() )
        *this = pageA;
    else if( aType == pageB.GetType() )
        *this = pageB;
    else if( aType == pageC.GetType() )
        *this = pageC;
    else if( aType == pageD.GetType() )
        *this = pageD;
    else if( aType == pageE.GetType() )
        *this = pageE;
    else if( aType == pageUser.GetType() )
    {
        *this  = pageUser;
        m_widthInches  = s_user_width;
        m_heightInches = s_user_height;
    }
    else
        rc = false;

    return rc;
}


PAGE_INFO::PAGE_INFO( const wxSize& aSizeMils, const wxPoint& aOffsetMils, const wxString& aType )
{
{
    // All sizes are in 1/1000 inch
    // aSizeMils is in 1/1000th of an inch
    m_Size   = size;
    SetWidthInches(  aSizeMils.x / 1000.0 );
    m_Offset = offset;
    SetHeightInches( aSizeMils.y / 1000.0 );
    m_Name   = name;

    m_Offset = aOffsetMils;
    m_Type   = aType;


    // Adjust the default value for margins to 400 mils (0,4 inch or 10 mm)
    // Adjust the default value for margins to 400 mils (0,4 inch or 10 mm)
#if defined(KICAD_GOST)
#if defined(KICAD_GOST)
@@ -218,6 +269,50 @@ Ki_PageDescr::Ki_PageDescr( const wxSize& size, const wxPoint& offset, const wxS
}
}




PAGE_INFO::PAGE_INFO( const wxString& aType )
{
    SetType( aType );
}


void PAGE_INFO::SetWidthInches( double aWidthInInches )
{
    // limit resolution to 1/1000th of an inch
    m_widthInches = double( int( aWidthInInches * 1000 + 500 ) / 1000 );
}


void PAGE_INFO::SetHeightInches( double aHeightInInches )
{
    // limit resolution to 1/1000th of an inch
    m_heightInches = double( int( aHeightInInches * 1000 + 500 ) / 1000 );
}


void PAGE_INFO::SetUserWidthInches( double aWidthInInches )
{
    if( aWidthInInches < 6.0 )
        aWidthInInches = 6.0;
    else if( aWidthInInches > 44.0 )
        aWidthInInches = 44.0;

    s_user_width = aWidthInInches;
}

void PAGE_INFO::SetUserHeightInches( double aHeightInInches )
{
    if( aHeightInInches < 4.0 )
        aHeightInInches = 4.0;
    else if( aHeightInInches > 44.0 )
        aHeightInInches = 44.0;

    s_user_height = aHeightInInches;
}


//-----</PAGE_INFO>------------------------------------------------------------


wxString ReturnUnitSymbol( EDA_UNITS_T aUnit, const wxString& formatString )
wxString ReturnUnitSymbol( EDA_UNITS_T aUnit, const wxString& formatString )
{
{
    wxString tmp;
    wxString tmp;
+11 −9
Original line number Original line Diff line number Diff line
@@ -366,7 +366,7 @@ bool PS_PLOTTER::start_plot( FILE* fout )
    fprintf( output_file, "%%%%Pages: 1\n" );
    fprintf( output_file, "%%%%Pages: 1\n" );
    fprintf( output_file, "%%%%PageOrder: Ascend\n" );
    fprintf( output_file, "%%%%PageOrder: Ascend\n" );


    // Print boundary box in 1/72 pixels per inch, box is in decimals
    // Print boundary box in 1/72 pixels per inch, box is in deci-mils
    const double CONV_SCALE = DECIMIL_TO_INCH * 72;
    const double CONV_SCALE = DECIMIL_TO_INCH * 72;


    // The coordinates of the lower left corner of the boundary
    // The coordinates of the lower left corner of the boundary
@@ -388,18 +388,20 @@ bool PS_PLOTTER::start_plot( FILE* fout )
    //
    //
    // (NOTE: m_Size.y is *supposed* to be listed before m_Size.x;
    // (NOTE: m_Size.y is *supposed* to be listed before m_Size.x;
    // the order in which they are specified is not wrong!)
    // the order in which they are specified is not wrong!)
    // Also note sheet->m_Size is given in mils, not in decimils and must be
    // Also note pageSize is given in mils, not in internal units and must be
    // sheet->m_Size * 10 in decimals
    // converted to internal units.
    if( sheet->m_Name.Cmp( wxT( "User" ) ) == 0 )
    wxSize pageSize = pageInfo.GetSizeMils();

    if( pageInfo.GetType().Cmp( wxT( "User" ) ) == 0 )
        fprintf( output_file, "%%%%DocumentMedia: Custom %d %d 0 () ()\n",
        fprintf( output_file, "%%%%DocumentMedia: Custom %d %d 0 () ()\n",
                 wxRound( sheet->m_Size.y * 10 * CONV_SCALE ),
                 wxRound( pageSize.y * 10 * CONV_SCALE ),
                 wxRound( sheet->m_Size.x * 10 * CONV_SCALE ) );
                 wxRound( pageSize.x * 10 * CONV_SCALE ) );


    else  // ( if sheet->m_Name does not equal "User" )
    else  // ( if sheet->m_Name does not equal "User" )
        fprintf( output_file, "%%%%DocumentMedia: %s %d %d 0 () ()\n",
        fprintf( output_file, "%%%%DocumentMedia: %s %d %d 0 () ()\n",
                 TO_UTF8( sheet->m_Name ),
                 TO_UTF8( pageInfo.GetType() ),
                 wxRound( sheet->m_Size.y * 10 * CONV_SCALE ),
                 wxRound( pageSize.y * 10 * CONV_SCALE ),
                 wxRound( sheet->m_Size.x * 10 * CONV_SCALE ) );
                 wxRound( pageSize.x * 10 * CONV_SCALE ) );


    fprintf( output_file, "%%%%Orientation: Landscape\n" );
    fprintf( output_file, "%%%%Orientation: Landscape\n" );


+32 −29
Original line number Original line Diff line number Diff line
@@ -22,15 +22,17 @@
void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
{
{
#define WSTEXTSIZE 50   // Text size in mils
#define WSTEXTSIZE 50   // Text size in mils
    Ki_PageDescr* Sheet = screen->m_CurrentSheetDesc;
    const PAGE_INFO&    pageInfo = GetPageSettings();
    wxSize              pageSize = pageInfo.GetSizeMils();  // mils
    int                 xg, yg;
    int                 xg, yg;
    wxSize        PageSize;

    wxPoint             pos, ref;
    wxPoint             pos, ref;
    EDA_Colors          color;
    EDA_Colors          color;


    /* Scale to convert dimension in 1/1000 in into internal units
    /* Scale to convert dimension in 1/1000 in into internal units
     * (1/1000 inc for Eeschema, 1/10000 for Pcbnew. */
     * (1/1000 inc for Eeschema, 1/10000 for Pcbnew. */
    int      conv_unit = screen->GetInternalUnits() / 1000;
    int      conv_unit = screen->GetInternalUnits() / 1000;

    wxString msg;
    wxString msg;
    wxSize   text_size;
    wxSize   text_size;
#if defined(KICAD_GOST)
#if defined(KICAD_GOST)
@@ -47,14 +49,11 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
    color = BLACK;
    color = BLACK;
    plotter->set_color( color );
    plotter->set_color( color );


    PageSize.x = Sheet->m_Size.x;
    PageSize.y = Sheet->m_Size.y;

    /* Plot edge. */
    /* Plot edge. */
    ref.x = Sheet->m_LeftMargin * conv_unit;
    ref.x = pageInfo.GetLeftMarginMils() * conv_unit;
    ref.y = Sheet->m_TopMargin * conv_unit;
    ref.y = pageInfo.GetTopMarginMils() * conv_unit;
    xg    = ( PageSize.x - Sheet->m_RightMargin ) * conv_unit;
    xg    = ( pageSize.x - pageInfo.GetRightMarginMils() ) * conv_unit;
    yg    = ( PageSize.y - Sheet->m_BottomMargin ) * conv_unit;
    yg    = ( pageSize.y - pageInfo.GetBottomMarginMils() ) * conv_unit;


#if defined(KICAD_GOST)
#if defined(KICAD_GOST)
    plotter->move_to( ref );
    plotter->move_to( ref );
@@ -93,12 +92,13 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
    text_size.x = WSTEXTSIZE * conv_unit;
    text_size.x = WSTEXTSIZE * conv_unit;
    text_size.y = WSTEXTSIZE * conv_unit;
    text_size.y = WSTEXTSIZE * conv_unit;


    ref.x = Sheet->m_LeftMargin;
    // upper left corner in mils
    ref.y = Sheet->m_TopMargin;                         /* Upper left corner in
    ref.x = pageInfo.GetLeftMarginMils();
                                                         * 1/1000 inch */
    ref.y = pageInfo.GetTopMarginMils();
    xg    = ( PageSize.x - Sheet->m_RightMargin );

    yg    = ( PageSize.y - Sheet->m_BottomMargin );     /* lower right corner
    // lower right corner in mils
                                                         * in 1/1000 inch */
    xg    = ( pageSize.x - pageInfo.GetRightMarginMils() );
    yg    = ( pageSize.y - pageInfo.GetBottomMarginMils() );


#if defined(KICAD_GOST)
#if defined(KICAD_GOST)
    for( Ki_WorkSheetData* WsItem = &WS_Segm1_LU;
    for( Ki_WorkSheetData* WsItem = &WS_Segm1_LU;
@@ -240,6 +240,7 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
    /* Plot the worksheet. */
    /* Plot the worksheet. */
    text_size.x = SIZETEXT * conv_unit;
    text_size.x = SIZETEXT * conv_unit;
    text_size.y = SIZETEXT * conv_unit;
    text_size.y = SIZETEXT * conv_unit;

#if defined(KICAD_GOST)
#if defined(KICAD_GOST)
    text_size2.x = SIZETEXT * conv_unit * 2;
    text_size2.x = SIZETEXT * conv_unit * 2;
    text_size2.y = SIZETEXT * conv_unit * 2;
    text_size2.y = SIZETEXT * conv_unit * 2;
@@ -247,8 +248,8 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
    text_size3.y = SIZETEXT * conv_unit * 3;
    text_size3.y = SIZETEXT * conv_unit * 3;
    text_size1_5.x = SIZETEXT * conv_unit * 1.5;
    text_size1_5.x = SIZETEXT * conv_unit * 1.5;
    text_size1_5.y = SIZETEXT * conv_unit * 1.5;
    text_size1_5.y = SIZETEXT * conv_unit * 1.5;
    ref.x = PageSize.x - Sheet->m_RightMargin;
    ref.x = pageSize.x - pageInfo.GetRightMarginMils();
    ref.y = PageSize.y - Sheet->m_BottomMargin;
    ref.y = pageSize.y - pageInfo.GetBottomMarginMils();


    if( screen->m_ScreenNumber == 1 )
    if( screen->m_ScreenNumber == 1 )
    {
    {
@@ -334,8 +335,8 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
                                   msg, TEXT_ORIENT_HORIZ, text_size3,
                                   msg, TEXT_ORIENT_HORIZ, text_size3,
                                   GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
                                   GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
                                   thickness, italic, false );
                                   thickness, italic, false );
                    pos.x = (Sheet->m_LeftMargin + 1260) * conv_unit;
                    pos.x = (pageInfo.GetLeftMarginMils() + 1260) * conv_unit;
                    pos.y = (Sheet->m_TopMargin + 270) * conv_unit;
                    pos.y = (pageInfo.GetTopMarginMils() + 270) * conv_unit;
                    plotter->text( pos, color,
                    plotter->text( pos, color,
                                   msg.GetData(), 1800, text_size2,
                                   msg.GetData(), 1800, text_size2,
                                   GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
                                   GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
@@ -408,8 +409,8 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
                                   msg, TEXT_ORIENT_HORIZ, text_size3,
                                   msg, TEXT_ORIENT_HORIZ, text_size3,
                                   GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
                                   GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
                                   thickness, italic, false );
                                   thickness, italic, false );
                    pos.x = (Sheet->m_LeftMargin + 1260) * conv_unit;
                    pos.x = (pageInfo.GetLeftMarginMils() + 1260) * conv_unit;
                    pos.y = (Sheet->m_TopMargin + 270) * conv_unit;
                    pos.y = (pageInfo.GetTopMarginMils() + 270) * conv_unit;
                    plotter->text( pos, color,
                    plotter->text( pos, color,
                                   msg, 1800, text_size2,
                                   msg, 1800, text_size2,
                                   GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
                                   GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
@@ -444,9 +445,11 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
            }
            }
        }
        }
    }
    }

#else
#else
    ref.x = PageSize.x - GRID_REF_W - Sheet->m_RightMargin;

    ref.y = PageSize.y - GRID_REF_W - Sheet->m_BottomMargin;
    ref.x = pageSize.x - GRID_REF_W - pageInfo.GetRightMarginMils();
    ref.y = pageSize.y - GRID_REF_W - pageInfo.GetBottomMarginMils();


    for( Ki_WorkSheetData* WsItem = &WS_Date;
    for( Ki_WorkSheetData* WsItem = &WS_Date;
         WsItem != NULL;
         WsItem != NULL;
@@ -477,7 +480,7 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
            break;
            break;


        case WS_SIZESHEET:
        case WS_SIZESHEET:
            msg += screen->m_CurrentSheetDesc->m_Name;
            msg += pageInfo.GetType();
            break;
            break;


        case WS_IDENTSHEET:
        case WS_IDENTSHEET:
Loading