2018-05-14 17:34:18 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2010-2014 Jean-Pierre Charras jp.charras at wanadoo.fr
|
|
|
|
* Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation, either version 3 of the License, or (at your
|
|
|
|
* option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <gerbview.h>
|
|
|
|
#include <gerbview_frame.h>
|
2020-11-18 01:21:04 +00:00
|
|
|
#include <core/arraydim.h>
|
2018-05-14 17:34:18 +00:00
|
|
|
|
|
|
|
#include "panel_gerbview_settings.h"
|
|
|
|
|
|
|
|
|
2020-09-30 09:24:02 +00:00
|
|
|
/// List of page sizes
|
|
|
|
static const wxChar* gerberPageSizeList[] =
|
|
|
|
{
|
|
|
|
wxT( "GERBER" ), // index 0: full size page selection
|
|
|
|
wxT( "A4" ),
|
|
|
|
wxT( "A3" ),
|
|
|
|
wxT( "A2" ),
|
|
|
|
wxT( "A" ),
|
|
|
|
wxT( "B" ),
|
|
|
|
wxT( "C" ),
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2018-05-14 17:34:18 +00:00
|
|
|
PANEL_GERBVIEW_SETTINGS::PANEL_GERBVIEW_SETTINGS( GERBVIEW_FRAME *aFrame, wxWindow* aWindow ) :
|
|
|
|
PANEL_GERBVIEW_SETTINGS_BASE( aWindow, wxID_ANY ),
|
|
|
|
m_Parent( aFrame )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool PANEL_GERBVIEW_SETTINGS::TransferDataToWindow( )
|
|
|
|
{
|
2019-11-07 14:23:09 +00:00
|
|
|
m_ShowPageLimitsOpt->SetValue( m_Parent->GetDisplayOptions().m_DisplayPageLimits );
|
2018-05-14 17:34:18 +00:00
|
|
|
|
2020-09-30 09:24:02 +00:00
|
|
|
for( unsigned i = 0; i < arrayDim( gerberPageSizeList ); ++i )
|
2018-05-14 17:34:18 +00:00
|
|
|
{
|
2020-09-30 09:24:02 +00:00
|
|
|
if( gerberPageSizeList[i] == m_Parent->GetPageSettings().GetType() )
|
2018-05-14 17:34:18 +00:00
|
|
|
{
|
|
|
|
m_PageSize->SetSelection( i );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool PANEL_GERBVIEW_SETTINGS::TransferDataFromWindow()
|
|
|
|
{
|
2019-11-07 14:23:09 +00:00
|
|
|
auto opts = m_Parent->GetDisplayOptions();
|
|
|
|
opts.m_DisplayPageLimits = m_ShowPageLimitsOpt->GetValue();
|
2018-05-14 17:34:18 +00:00
|
|
|
|
2020-09-30 09:24:02 +00:00
|
|
|
PAGE_INFO pageInfo( gerberPageSizeList[ m_PageSize->GetSelection() ] );
|
2018-05-14 17:34:18 +00:00
|
|
|
m_Parent->SetPageSettings( pageInfo );
|
|
|
|
|
2019-11-07 14:23:09 +00:00
|
|
|
m_Parent->UpdateDisplayOptions( opts );
|
|
|
|
|
2018-05-14 17:34:18 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|