Eeschema : Add A5 sheet size

This commit is contained in:
Fabien Corona 2020-07-21 00:00:36 +00:00 committed by Jon Evans
parent a107f7ce5b
commit a1437f4a95
5 changed files with 15 additions and 2 deletions

View File

@ -61,6 +61,7 @@
#define _HKI( x ) wxT( x ) #define _HKI( x ) wxT( x )
static const wxString pageFmts[] = static const wxString pageFmts[] =
{ {
_HKI("A5 148x210mm"),
_HKI("A4 210x297mm"), _HKI("A4 210x297mm"),
_HKI("A3 297x420mm"), _HKI("A3 297x420mm"),
_HKI("A2 420x594mm"), _HKI("A2 420x594mm"),
@ -559,6 +560,8 @@ bool DIALOG_PAGES_SETTINGS::SavePageSettings()
success = m_pageInfo.SetType( PAGE_INFO::USLedger ); success = m_pageInfo.SetType( PAGE_INFO::USLedger );
else if( paperType.Contains( PAGE_INFO::GERBER ) ) else if( paperType.Contains( PAGE_INFO::GERBER ) )
success = m_pageInfo.SetType( PAGE_INFO::GERBER ); success = m_pageInfo.SetType( PAGE_INFO::GERBER );
else if( paperType.Contains( PAGE_INFO::A5 ) )
success = m_pageInfo.SetType( PAGE_INFO::A5 );
else if( paperType.Contains( PAGE_INFO::A4 ) ) else if( paperType.Contains( PAGE_INFO::A4 ) )
success = m_pageInfo.SetType( PAGE_INFO::A4 ); success = m_pageInfo.SetType( PAGE_INFO::A4 );
else if( paperType.Contains( PAGE_INFO::A3 ) ) else if( paperType.Contains( PAGE_INFO::A3 ) )
@ -808,6 +811,7 @@ void DIALOG_PAGES_SETTINGS::GetPageLayoutInfoFromDialog()
static const wxChar* papers[] = { static const wxChar* papers[] = {
// longest common string first, since sequential search below // longest common string first, since sequential search below
PAGE_INFO::A5,
PAGE_INFO::A4, PAGE_INFO::A4,
PAGE_INFO::A3, PAGE_INFO::A3,
PAGE_INFO::A2, PAGE_INFO::A2,

View File

@ -39,6 +39,7 @@
// Standard paper sizes nicknames. // Standard paper sizes nicknames.
const wxChar PAGE_INFO::A5[] = wxT( "A5" );
const wxChar PAGE_INFO::A4[] = wxT( "A4" ); const wxChar PAGE_INFO::A4[] = wxT( "A4" );
const wxChar PAGE_INFO::A3[] = wxT( "A3" ); const wxChar PAGE_INFO::A3[] = wxT( "A3" );
const wxChar PAGE_INFO::A2[] = wxT( "A2" ); const wxChar PAGE_INFO::A2[] = wxT( "A2" );
@ -65,6 +66,7 @@ const wxChar PAGE_INFO::Custom[] = wxT( "User" );
#define MMsize( x, y ) wxSize( Mm2mils( x ), Mm2mils( y ) ) #define MMsize( x, y ) wxSize( Mm2mils( x ), Mm2mils( y ) )
// All MUST be defined as landscape. // All MUST be defined as landscape.
const PAGE_INFO PAGE_INFO::pageA5( MMsize( 210, 148 ), wxT( "A5" ), wxPAPER_A5 );
const PAGE_INFO PAGE_INFO::pageA4( MMsize( 297, 210 ), wxT( "A4" ), wxPAPER_A4 ); const PAGE_INFO PAGE_INFO::pageA4( MMsize( 297, 210 ), wxT( "A4" ), wxPAPER_A4 );
const PAGE_INFO PAGE_INFO::pageA3( MMsize( 420, 297 ), wxT( "A3" ), wxPAPER_A3 ); const PAGE_INFO PAGE_INFO::pageA3( MMsize( 420, 297 ), wxT( "A3" ), wxPAPER_A3 );
const PAGE_INFO PAGE_INFO::pageA2( MMsize( 594, 420 ), wxT( "A2" ), wxPAPER_A2 ); const PAGE_INFO PAGE_INFO::pageA2( MMsize( 594, 420 ), wxT( "A2" ), wxPAPER_A2 );
@ -119,7 +121,9 @@ bool PAGE_INFO::SetType( const wxString& aType, bool aIsPortrait )
bool rc = true; bool rc = true;
// all are landscape initially // all are landscape initially
if( aType == pageA4.GetType() ) if( aType == pageA5.GetType() )
*this = pageA5;
else if( aType == pageA4.GetType() )
*this = pageA4; *this = pageA4;
else if( aType == pageA3.GetType() ) else if( aType == pageA3.GetType() )
*this = pageA3; *this = pageA3;

View File

@ -216,6 +216,7 @@ void DIALOG_PLOT_SCHEMATIC::OnUpdateUI( wxUpdateUIEvent& event )
if( fmt == PLOT_FORMAT::HPGL ) if( fmt == PLOT_FORMAT::HPGL )
{ {
paperSizes.push_back( _( "A5" ) );
paperSizes.push_back( _( "A4" ) ); paperSizes.push_back( _( "A4" ) );
paperSizes.push_back( _( "A3" ) ); paperSizes.push_back( _( "A3" ) );
paperSizes.push_back( _( "A2" ) ); paperSizes.push_back( _( "A2" ) );

View File

@ -40,6 +40,7 @@
enum HPGL_PAGEZ_T { enum HPGL_PAGEZ_T {
PAGE_DEFAULT = 0, PAGE_DEFAULT = 0,
HPGL_PAGE_SIZE_A5,
HPGL_PAGE_SIZE_A4, HPGL_PAGE_SIZE_A4,
HPGL_PAGE_SIZE_A3, HPGL_PAGE_SIZE_A3,
HPGL_PAGE_SIZE_A2, HPGL_PAGE_SIZE_A2,
@ -59,6 +60,7 @@ static const wxChar* plot_sheet_list( int aSize )
{ {
default: default:
case PAGE_DEFAULT: return nullptr; case PAGE_DEFAULT: return nullptr;
case HPGL_PAGE_SIZE_A5: return wxT( "A5" );
case HPGL_PAGE_SIZE_A4: return wxT( "A4" ); case HPGL_PAGE_SIZE_A4: return wxT( "A4" );
case HPGL_PAGE_SIZE_A3: return wxT( "A3" ); case HPGL_PAGE_SIZE_A3: return wxT( "A3" );
case HPGL_PAGE_SIZE_A2: return wxT( "A2" ); case HPGL_PAGE_SIZE_A2: return wxT( "A2" );

View File

@ -61,6 +61,7 @@ public:
// above constructor. // above constructor.
// these were once wxStrings, but it caused static construction sequence problems: // these were once wxStrings, but it caused static construction sequence problems:
static const wxChar A5[];
static const wxChar A4[]; static const wxChar A4[];
static const wxChar A3[]; static const wxChar A3[];
static const wxChar A2[]; static const wxChar A2[];
@ -84,7 +85,7 @@ public:
* commonly associated with that type name. * commonly associated with that type name.
* *
* @param aStandardPageDescriptionName is a wxString constant giving one of: * @param aStandardPageDescriptionName is a wxString constant giving one of:
* "A4" "A3" "A2" "A1" "A0" "A" "B" "C" "D" "E" "GERBER", "USLetter", "USLegal", * "A5" "A4" "A3" "A2" "A1" "A0" "A" "B" "C" "D" "E" "GERBER", "USLetter", "USLegal",
* "USLedger", or "User". If "User" then the width and height are custom, * "USLedger", or "User". If "User" then the width and height are custom,
* and will be set according to <b>previous</b> calls to * and will be set according to <b>previous</b> calls to
* static PAGE_INFO::SetUserWidthMils() and * static PAGE_INFO::SetUserWidthMils() and
@ -200,6 +201,7 @@ protected:
private: private:
// standard pre-defined sizes // standard pre-defined sizes
static const PAGE_INFO pageA5;
static const PAGE_INFO pageA4; static const PAGE_INFO pageA4;
static const PAGE_INFO pageA3; static const PAGE_INFO pageA3;
static const PAGE_INFO pageA2; static const PAGE_INFO pageA2;