2017-03-13 15:18:30 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2018-01-08 04:05:03 +00:00
|
|
|
* Copyright (C) 2017-2018 KiCad Developers, see AUTHORS.txt for contributors.
|
2017-03-13 15:18:30 +00:00
|
|
|
*
|
2018-01-08 04:05:03 +00:00
|
|
|
* 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.
|
2017-03-13 15:18:30 +00:00
|
|
|
*
|
2018-01-08 04:05:03 +00:00
|
|
|
* 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.
|
2017-03-13 15:18:30 +00:00
|
|
|
*
|
2018-01-08 04:05:03 +00:00
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
2017-03-13 15:18:30 +00:00
|
|
|
*/
|
|
|
|
|
2018-01-29 20:58:58 +00:00
|
|
|
#include <footprint_edit_frame.h>
|
2017-03-13 15:18:30 +00:00
|
|
|
#include <view/view.h>
|
|
|
|
#include <widgets/gal_options_panel.h>
|
2018-07-15 23:15:48 +00:00
|
|
|
#include <widgets/paged_dialog.h>
|
|
|
|
|
|
|
|
#include <panel_modedit_display_options.h>
|
2017-03-13 15:18:30 +00:00
|
|
|
|
|
|
|
|
2018-05-14 17:34:18 +00:00
|
|
|
PANEL_MODEDIT_DISPLAY_OPTIONS::PANEL_MODEDIT_DISPLAY_OPTIONS( FOOTPRINT_EDIT_FRAME* aFrame,
|
2018-07-15 23:15:48 +00:00
|
|
|
PAGED_DIALOG* aParent ) :
|
|
|
|
wxPanel( aParent->GetTreebook(), wxID_ANY ),
|
2018-05-14 17:34:18 +00:00
|
|
|
m_frame( aFrame )
|
2017-03-13 15:18:30 +00:00
|
|
|
{
|
2018-05-14 17:34:18 +00:00
|
|
|
auto mainSizer = new wxBoxSizer( wxHORIZONTAL );
|
2017-03-13 15:18:30 +00:00
|
|
|
SetSizer( mainSizer );
|
|
|
|
|
|
|
|
// install GAL options pane
|
2018-05-14 17:34:18 +00:00
|
|
|
KIGFX::GAL_DISPLAY_OPTIONS& galOptions = m_frame->GetGalDisplayOptions();
|
2017-03-13 15:18:30 +00:00
|
|
|
|
|
|
|
m_galOptsPanel = new GAL_OPTIONS_PANEL( this, galOptions );
|
2018-07-16 06:25:27 +00:00
|
|
|
mainSizer->Add( m_galOptsPanel, 1, wxEXPAND | wxLEFT, 5 );
|
2017-03-13 15:18:30 +00:00
|
|
|
|
2018-05-14 17:34:18 +00:00
|
|
|
// a spacer to take up the other half of the width
|
|
|
|
auto spacer = new wxPanel( this, wxID_ANY );
|
2018-07-16 06:25:27 +00:00
|
|
|
mainSizer->Add( spacer, 1, wxEXPAND | wxLEFT, 5 );
|
2017-03-13 15:18:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-05-14 17:34:18 +00:00
|
|
|
bool PANEL_MODEDIT_DISPLAY_OPTIONS::TransferDataToWindow()
|
2017-03-13 15:18:30 +00:00
|
|
|
{
|
2018-01-08 04:05:03 +00:00
|
|
|
m_galOptsPanel->TransferDataToWindow();
|
|
|
|
return true;
|
2017-03-13 15:18:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-05-14 17:34:18 +00:00
|
|
|
bool PANEL_MODEDIT_DISPLAY_OPTIONS::TransferDataFromWindow()
|
2017-03-13 15:18:30 +00:00
|
|
|
{
|
|
|
|
m_galOptsPanel->TransferDataFromWindow();
|
|
|
|
|
|
|
|
// refresh view
|
2019-06-13 17:28:55 +00:00
|
|
|
m_frame->GetCanvas()->GetView()->RecacheAllItems();
|
|
|
|
m_frame->GetCanvas()->GetView()->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
|
|
|
|
m_frame->GetCanvas()->Refresh();
|
2017-03-13 15:18:30 +00:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|