~cern-kicad/kicad/kicad-pns-tom

« back to all changes in this revision

Viewing changes to common/class_page_info.cpp

  • Committer: Maciej Suminski
  • Date: 2013-08-02 13:57:24 UTC
  • mfrom: (4024.1.238 kicad)
  • mto: This revision was merged to the branch mainline in revision 4221.
  • Revision ID: maciej.suminski@cern.ch-20130802135724-gix6orezshkukodv
Upstream merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
#define MMsize( x, y )  wxSize( Mm2mils( x ), Mm2mils( y ) )
64
64
 
65
65
// All MUST be defined as landscape.
66
 
// If IsGOST() is true, A4 is dynamically rotated later.
67
66
const PAGE_INFO  PAGE_INFO::pageA4(     MMsize( 297,   210 ),   wxT( "A4" ),    wxPAPER_A4 );
68
67
const PAGE_INFO  PAGE_INFO::pageA3(     MMsize( 420,   297 ),   wxT( "A3" ),    wxPAPER_A3 );
69
68
const PAGE_INFO  PAGE_INFO::pageA2(     MMsize( 594,   420 ),   wxT( "A2" ),    wxPAPER_A2 );
126
125
}
127
126
 
128
127
 
129
 
void PAGE_INFO::setMargins()
130
 
{
131
 
    if( IsGOST() )
132
 
    {
133
 
        m_left_margin   = Mm2mils( 20 );    // 20mm
134
 
        m_right_margin  =                   // 5mm
135
 
        m_top_margin    =                   // 5mm
136
 
        m_bottom_margin = Mm2mils( 5 );     // 5mm
137
 
    }
138
 
    else
139
 
    {
140
 
        m_left_margin   =
141
 
        m_right_margin  =
142
 
        m_top_margin    =
143
 
        m_bottom_margin = Mm2mils( 10 );
144
 
    }
145
 
}
146
 
 
147
 
 
148
128
PAGE_INFO::PAGE_INFO( const wxSize& aSizeMils, const wxString& aType, wxPaperSize aPaperId ) :
149
 
    m_type( aType ),
150
 
    m_size( aSizeMils ),
151
 
    m_paper_id( aPaperId )
 
129
    m_type( aType ), m_size( aSizeMils ), m_paper_id( aPaperId )
152
130
{
153
131
    updatePortrait();
154
132
 
155
 
    setMargins();
156
 
 
157
133
    // This constructor is protected, and only used by const PAGE_INFO's known
158
134
    // only to class implementation, so no further changes to "this" object are
159
 
    // expected.  Therefore we should also setMargin() again when copying this
160
 
    // object in SetType() so that a runtime IsGOST() change does not break.
 
135
    // expected.
161
136
}
162
137
 
163
138
 
222
197
        updatePortrait();
223
198
    }
224
199
 
225
 
    setMargins();
226
 
 
227
200
    return rc;
228
201
}
229
202