2018-05-14 17:34:18 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2020-02-13 14:19:40 +00:00
|
|
|
* Copyright (C) 2009 Wayne Stambaugh <stambaughw@gmail.com>
|
|
|
|
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
2018-05-14 17:34:18 +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 2
|
|
|
|
* 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, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <fctsys.h>
|
|
|
|
#include <sch_edit_frame.h>
|
2018-08-29 18:31:43 +00:00
|
|
|
#include <sch_painter.h>
|
2018-05-14 17:34:18 +00:00
|
|
|
#include <class_libentry.h>
|
|
|
|
#include <panel_eeschema_display_options.h>
|
2018-09-04 00:00:17 +00:00
|
|
|
#include <widgets/gal_options_panel.h>
|
2018-09-09 23:04:42 +00:00
|
|
|
#include <sch_junction.h>
|
2020-01-09 00:13:02 +00:00
|
|
|
#include <gr_text.h>
|
2018-05-14 17:34:18 +00:00
|
|
|
|
|
|
|
PANEL_EESCHEMA_DISPLAY_OPTIONS::PANEL_EESCHEMA_DISPLAY_OPTIONS( SCH_EDIT_FRAME* aFrame,
|
|
|
|
wxWindow* aWindow ) :
|
|
|
|
PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE( aWindow ),
|
2020-03-13 09:53:44 +00:00
|
|
|
m_frame( aFrame )
|
2018-05-14 17:34:18 +00:00
|
|
|
{
|
2018-09-04 00:00:17 +00:00
|
|
|
KIGFX::GAL_DISPLAY_OPTIONS& galOptions = m_frame->GetGalDisplayOptions();
|
|
|
|
m_galOptsPanel = new GAL_OPTIONS_PANEL( this, galOptions );
|
2018-05-14 17:34:18 +00:00
|
|
|
|
2018-09-04 00:00:17 +00:00
|
|
|
m_galOptionsSizer->Add( m_galOptsPanel, 1, wxEXPAND, 0 );
|
2019-12-11 20:49:58 +00:00
|
|
|
|
|
|
|
wxFont infoFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
|
|
|
|
infoFont.SetSymbolicSize( wxFONTSIZE_SMALL );
|
|
|
|
m_highlightColorNote->SetFont( infoFont );
|
2018-09-04 00:00:17 +00:00
|
|
|
}
|
2018-05-14 17:34:18 +00:00
|
|
|
|
|
|
|
|
2018-09-04 00:00:17 +00:00
|
|
|
bool PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataToWindow()
|
|
|
|
{
|
2020-04-12 23:09:17 +00:00
|
|
|
EESCHEMA_SETTINGS* cfg = m_frame->eeconfig();
|
|
|
|
|
|
|
|
m_checkShowHiddenPins->SetValue( cfg->m_Appearance.show_hidden_pins );
|
2020-04-18 15:36:29 +00:00
|
|
|
m_checkShowHiddenFields->SetValue( cfg->m_Appearance.show_hidden_fields );
|
2020-04-12 23:09:17 +00:00
|
|
|
m_checkPageLimits->SetValue( cfg->m_Appearance.show_page_limits );
|
2018-09-04 00:00:17 +00:00
|
|
|
|
2020-04-12 23:09:17 +00:00
|
|
|
m_checkSelTextBox->SetValue( cfg->m_Selection.text_as_box );
|
|
|
|
m_checkSelDrawChildItems->SetValue( cfg->m_Selection.draw_selected_children );
|
|
|
|
m_checkSelFillShapes->SetValue( cfg->m_Selection.fill_shapes );
|
|
|
|
m_selWidthCtrl->SetValue( cfg->m_Selection.thickness );
|
2019-11-21 15:48:44 +00:00
|
|
|
|
2018-09-04 00:00:17 +00:00
|
|
|
m_galOptsPanel->TransferDataToWindow();
|
2018-05-14 17:34:18 +00:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataFromWindow()
|
|
|
|
{
|
2020-04-12 23:09:17 +00:00
|
|
|
EESCHEMA_SETTINGS* cfg = m_frame->eeconfig();
|
2018-05-14 17:34:18 +00:00
|
|
|
|
2020-04-12 23:09:17 +00:00
|
|
|
cfg->m_Appearance.show_hidden_pins = m_checkShowHiddenPins->GetValue();
|
2020-04-18 15:36:29 +00:00
|
|
|
cfg->m_Appearance.show_hidden_fields = m_checkShowHiddenFields->GetValue();
|
2020-04-12 23:09:17 +00:00
|
|
|
cfg->m_Appearance.show_page_limits = m_checkPageLimits->GetValue();
|
2020-04-12 23:28:33 +00:00
|
|
|
|
2020-04-12 23:09:17 +00:00
|
|
|
cfg->m_Selection.text_as_box = m_checkSelTextBox->GetValue();
|
|
|
|
cfg->m_Selection.draw_selected_children = m_checkSelDrawChildItems->GetValue();
|
|
|
|
cfg->m_Selection.fill_shapes = m_checkSelFillShapes->GetValue();
|
|
|
|
cfg->m_Selection.thickness = KiROUND( m_selWidthCtrl->GetValue() );
|
2019-10-21 18:03:54 +00:00
|
|
|
|
2020-04-12 23:09:17 +00:00
|
|
|
// Update canvas
|
|
|
|
m_frame->GetRenderSettings()->m_ShowHiddenPins = m_checkShowHiddenPins->GetValue();
|
2020-04-18 15:36:29 +00:00
|
|
|
m_frame->GetRenderSettings()->m_ShowHiddenText = m_checkShowHiddenFields->GetValue();
|
2020-04-12 23:09:17 +00:00
|
|
|
m_frame->GetRenderSettings()->SetShowPageLimits( cfg->m_Appearance.show_page_limits );
|
2018-09-02 20:19:22 +00:00
|
|
|
m_frame->GetCanvas()->GetView()->MarkDirty();
|
2019-02-20 02:17:14 +00:00
|
|
|
m_frame->GetCanvas()->GetView()->UpdateAllItems( KIGFX::REPAINT );
|
2018-09-02 20:19:22 +00:00
|
|
|
m_frame->GetCanvas()->Refresh();
|
2018-08-29 18:31:43 +00:00
|
|
|
|
2018-09-04 00:00:17 +00:00
|
|
|
m_galOptsPanel->TransferDataFromWindow();
|
|
|
|
|
2018-05-14 17:34:18 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|