From fa2f396a7c725330e6f735f55542e9bed7bae977 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 2 Jun 2020 21:49:44 +0100 Subject: [PATCH] Cleanup. --- cvpcb/dialogs/dialog_display_options.cpp | 100 ---- cvpcb/dialogs/dialog_display_options.h | 56 --- cvpcb/dialogs/dialog_display_options_base.cpp | 90 ---- cvpcb/dialogs/dialog_display_options_base.fbp | 461 ------------------ cvpcb/dialogs/dialog_display_options_base.h | 57 --- 5 files changed, 764 deletions(-) delete mode 100644 cvpcb/dialogs/dialog_display_options.cpp delete mode 100644 cvpcb/dialogs/dialog_display_options.h delete mode 100644 cvpcb/dialogs/dialog_display_options_base.cpp delete mode 100644 cvpcb/dialogs/dialog_display_options_base.fbp delete mode 100644 cvpcb/dialogs/dialog_display_options_base.h diff --git a/cvpcb/dialogs/dialog_display_options.cpp b/cvpcb/dialogs/dialog_display_options.cpp deleted file mode 100644 index ffd9fd24fd..0000000000 --- a/cvpcb/dialogs/dialog_display_options.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * 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 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 -#include - - -void DISPLAY_FOOTPRINTS_FRAME::InstallOptionsDisplay( wxCommandEvent& event ) -{ - DIALOG_FOOTPRINTS_DISPLAY_OPTIONS OptionWindow( this ); - - OptionWindow.ShowModal(); -} - - -DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::DIALOG_FOOTPRINTS_DISPLAY_OPTIONS( DISPLAY_FOOTPRINTS_FRAME* parent ) - : DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE( parent ) -{ - m_Parent = parent; - - initDialog(); - m_sdbSizerOK->SetDefault(); - - FinishDialogSettings();; -} - - -DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::~DIALOG_FOOTPRINTS_DISPLAY_OPTIONS( ) -{ -} - - -void DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::initDialog() -{ - /* mandatory to use escape key as cancel under wxGTK. */ - SetFocus(); - - auto& displ_opts = m_Parent->GetDisplayOptions(); - - m_ShowPadNum->SetValue( displ_opts.m_DisplayPadNum ); - - MAGNETIC_SETTINGS* magSettings = m_Parent->GetMagneticItemsSettings(); - - m_MagneticPads->SetValue( magSettings->pads == MAGNETIC_OPTIONS::CAPTURE_ALWAYS ); - m_MagneticGraphics->SetValue( magSettings->graphics ); - - m_autoZoomOption->SetValue( m_Parent->GetAutoZoom() ); -} - - -void DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::UpdateObjectSettings( void ) -{ - PCB_DISPLAY_OPTIONS displ_opts = m_Parent->GetDisplayOptions(); - - displ_opts.m_DisplayPadNum = m_ShowPadNum->GetValue(); - - m_Parent->ApplyDisplaySettingsToGAL(); - m_Parent->SetDisplayOptions( displ_opts ); - - MAGNETIC_SETTINGS* magSettings = m_Parent->GetMagneticItemsSettings(); - - magSettings->pads = m_MagneticPads->GetValue() ? MAGNETIC_OPTIONS::CAPTURE_ALWAYS - : MAGNETIC_OPTIONS::NO_EFFECT; - magSettings->graphics = m_MagneticGraphics->GetValue(); - - m_Parent->SetAutoZoom( m_autoZoomOption->GetValue() ); -} - - -bool DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::TransferDataFromWindow() -{ - UpdateObjectSettings(); - return true; -} - - -void DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::OnApplyClick( wxCommandEvent& event ) -{ - UpdateObjectSettings(); -} diff --git a/cvpcb/dialogs/dialog_display_options.h b/cvpcb/dialogs/dialog_display_options.h deleted file mode 100644 index a902b5d653..0000000000 --- a/cvpcb/dialogs/dialog_display_options.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 1992-2016 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 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 - */ - -/** - * @file cvpcb/dialogs/dialog_display_options.h - */ - -#ifndef _DIALOG_DISPLAY_OPTIONS_H_ -#define _DIALOG_DISPLAY_OPTIONS_H_ - -#include - -/* Class DIALOG_FOOTPRINTS_DISPLAY_OPTIONS - * derived from DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE, - * created by wxformBuilder -*/ - -class DIALOG_FOOTPRINTS_DISPLAY_OPTIONS : - public DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE -{ -private: - DISPLAY_FOOTPRINTS_FRAME * m_Parent; - -public: - DIALOG_FOOTPRINTS_DISPLAY_OPTIONS( DISPLAY_FOOTPRINTS_FRAME* parent ); - ~DIALOG_FOOTPRINTS_DISPLAY_OPTIONS(); - - -private: - void initDialog(); - void UpdateObjectSettings( void ); - void OnApplyClick( wxCommandEvent& event ) override; - bool TransferDataFromWindow() override; -}; - -#endif // _DIALOG_DISPLAY_OPTIONS_H_ diff --git a/cvpcb/dialogs/dialog_display_options_base.cpp b/cvpcb/dialogs/dialog_display_options_base.cpp deleted file mode 100644 index dcb053e243..0000000000 --- a/cvpcb/dialogs/dialog_display_options_base.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 26 2018) -// http://www.wxformbuilder.org/ -// -// PLEASE DO *NOT* EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#include "dialog_display_options_base.h" - -/////////////////////////////////////////////////////////////////////////// - -DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE::DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) -{ - this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - - wxBoxSizer* bSizerMain; - bSizerMain = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bUpperSizer; - bUpperSizer = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizerLeft; - bSizerLeft = new wxBoxSizer( wxVERTICAL ); - - wxStaticBoxSizer* sbMagneticPoints; - sbMagneticPoints = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Magnetic Points") ), wxVERTICAL ); - - m_MagneticPads = new wxCheckBox( sbMagneticPoints->GetStaticBox(), wxID_ANY, _("Snap to pads"), wxDefaultPosition, wxDefaultSize, 0 ); - sbMagneticPoints->Add( m_MagneticPads, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - m_MagneticGraphics = new wxCheckBox( sbMagneticPoints->GetStaticBox(), wxID_ANY, _("Snap to graphics"), wxDefaultPosition, wxDefaultSize, 0 ); - sbMagneticPoints->Add( m_MagneticGraphics, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); - - - bSizerLeft->Add( sbMagneticPoints, 1, wxALL|wxEXPAND, 5 ); - - wxStaticBoxSizer* sbSizerDrawMode; - sbSizerDrawMode = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Drawing Options") ), wxVERTICAL ); - - m_ShowPadNum = new wxCheckBox( sbSizerDrawMode->GetStaticBox(), wxID_ANY, _("Show pad &numbers"), wxDefaultPosition, wxDefaultSize, 0 ); - sbSizerDrawMode->Add( m_ShowPadNum, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - - bSizerLeft->Add( sbSizerDrawMode, 1, wxEXPAND|wxALL, 5 ); - - - bUpperSizer->Add( bSizerLeft, 1, wxEXPAND, 5 ); - - wxStaticBoxSizer* sbSizerViewOpt; - sbSizerViewOpt = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Auto-zoom") ), wxVERTICAL ); - - m_autoZoomOption = new wxCheckBox( sbSizerViewOpt->GetStaticBox(), wxID_ANY, _("Zoom to fit when changing footprint"), wxDefaultPosition, wxDefaultSize, 0 ); - m_autoZoomOption->SetValue(true); - sbSizerViewOpt->Add( m_autoZoomOption, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - - bUpperSizer->Add( sbSizerViewOpt, 1, wxALL|wxEXPAND, 5 ); - - - bSizerMain->Add( bUpperSizer, 1, wxEXPAND|wxALL, 5 ); - - m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizerMain->Add( m_staticline1, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); - - m_sdbSizer = new wxStdDialogButtonSizer(); - m_sdbSizerOK = new wxButton( this, wxID_OK ); - m_sdbSizer->AddButton( m_sdbSizerOK ); - m_sdbSizerApply = new wxButton( this, wxID_APPLY ); - m_sdbSizer->AddButton( m_sdbSizerApply ); - m_sdbSizerCancel = new wxButton( this, wxID_CANCEL ); - m_sdbSizer->AddButton( m_sdbSizerCancel ); - m_sdbSizer->Realize(); - - bSizerMain->Add( m_sdbSizer, 0, wxEXPAND|wxALL, 5 ); - - - this->SetSizer( bSizerMain ); - this->Layout(); - bSizerMain->Fit( this ); - - // Connect Events - m_sdbSizerApply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE::OnApplyClick ), NULL, this ); -} - -DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE::~DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE() -{ - // Disconnect Events - m_sdbSizerApply->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE::OnApplyClick ), NULL, this ); - -} diff --git a/cvpcb/dialogs/dialog_display_options_base.fbp b/cvpcb/dialogs/dialog_display_options_base.fbp deleted file mode 100644 index 34f85b0080..0000000000 --- a/cvpcb/dialogs/dialog_display_options_base.fbp +++ /dev/null @@ -1,461 +0,0 @@ - - - - - - C++ - 1 - source_name - 0 - 0 - res - UTF-8 - connect - dialog_display_options_base - 1000 - none - - 1 - dialog_display_options_base - - . - - 1 - 1 - 1 - 1 - UI - 0 - 0 - - 0 - wxAUI_MGR_DEFAULT - - - - 1 - 1 - impl_virtual - - - - 0 - wxID_ANY - - - DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE - - -1,-1 - wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - DIALOG_SHIM; dialog_shim.h - Display Options - - - - - - - bSizerMain - wxVERTICAL - none - - 5 - wxEXPAND|wxALL - 1 - - - bUpperSizer - wxHORIZONTAL - none - - 5 - wxEXPAND - 1 - - - bSizerLeft - wxVERTICAL - none - - 5 - wxALL|wxEXPAND - 1 - - wxID_ANY - Magnetic Points - - sbMagneticPoints - wxVERTICAL - 1 - none - - 5 - wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Snap to pads - - 0 - - - 0 - - 1 - m_MagneticPads - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxBOTTOM|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Snap to graphics - - 0 - - - 0 - - 1 - m_MagneticGraphics - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - 5 - wxEXPAND|wxALL - 1 - - wxID_ANY - Drawing Options - - sbSizerDrawMode - wxVERTICAL - 1 - none - - 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Show pad &numbers - - 0 - - - 0 - - 1 - m_ShowPadNum - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 1 - - wxID_ANY - Auto-zoom - - sbSizerViewOpt - wxVERTICAL - 1 - none - - 5 - wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Zoom to fit when changing footprint - - 0 - - - 0 - - 1 - m_autoZoomOption - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - 5 - wxEXPAND|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_staticline1 - 1 - - - protected - 1 - - Resizable - 1 - - wxLI_HORIZONTAL - - 0 - - - - - - - - 5 - wxEXPAND|wxALL - 0 - - 1 - 1 - 0 - 0 - 0 - 1 - 0 - 0 - - m_sdbSizer - protected - OnApplyClick - - - - - - diff --git a/cvpcb/dialogs/dialog_display_options_base.h b/cvpcb/dialogs/dialog_display_options_base.h deleted file mode 100644 index 9cbabf4988..0000000000 --- a/cvpcb/dialogs/dialog_display_options_base.h +++ /dev/null @@ -1,57 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 26 2018) -// http://www.wxformbuilder.org/ -// -// PLEASE DO *NOT* EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include -#include -#include -#include "dialog_shim.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////// - - -/////////////////////////////////////////////////////////////////////////////// -/// Class DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE -/////////////////////////////////////////////////////////////////////////////// -class DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE : public DIALOG_SHIM -{ - private: - - protected: - wxCheckBox* m_MagneticPads; - wxCheckBox* m_MagneticGraphics; - wxCheckBox* m_ShowPadNum; - wxCheckBox* m_autoZoomOption; - wxStaticLine* m_staticline1; - wxStdDialogButtonSizer* m_sdbSizer; - wxButton* m_sdbSizerOK; - wxButton* m_sdbSizerApply; - wxButton* m_sdbSizerCancel; - - // Virtual event handlers, overide them in your derived class - virtual void OnApplyClick( wxCommandEvent& event ) { event.Skip(); } - - - public: - - DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Display Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE(); - -}; -