From ff3d22dcd9db4fbdd261c1abc278703b170501ca Mon Sep 17 00:00:00 2001 From: Chris Pavlina Date: Sun, 17 Apr 2016 10:11:14 -0400 Subject: [PATCH] Remove DIALOG_ORIENT_FOOTPRINTS --- pcbnew/CMakeLists.txt | 2 - pcbnew/dialogs/dialog_orient_footprints.cpp | 162 ---- .../dialogs/dialog_orient_footprints_base.cpp | 81 -- .../dialogs/dialog_orient_footprints_base.fbp | 741 ------------------ .../dialogs/dialog_orient_footprints_base.h | 58 -- pcbnew/onrightclick.cpp | 4 - pcbnew/pcbframe.cpp | 2 - pcbnew/pcbnew_id.h | 2 - 8 files changed, 1052 deletions(-) delete mode 100644 pcbnew/dialogs/dialog_orient_footprints.cpp delete mode 100644 pcbnew/dialogs/dialog_orient_footprints_base.cpp delete mode 100644 pcbnew/dialogs/dialog_orient_footprints_base.fbp delete mode 100644 pcbnew/dialogs/dialog_orient_footprints_base.h diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 6fc2c9fa43..b49989356e 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -123,8 +123,6 @@ set( PCBNEW_DIALOGS dialogs/dialog_print_for_modedit_base.cpp dialogs/dialog_print_using_printer.cpp dialogs/dialog_print_using_printer_base.cpp - dialogs/dialog_orient_footprints.cpp - dialogs/dialog_orient_footprints_base.cpp dialogs/dialog_mask_clearance.cpp dialogs/dialog_mask_clearance_base.cpp dialogs/dialog_SVG_print.cpp diff --git a/pcbnew/dialogs/dialog_orient_footprints.cpp b/pcbnew/dialogs/dialog_orient_footprints.cpp deleted file mode 100644 index 4c6dd832d5..0000000000 --- a/pcbnew/dialogs/dialog_orient_footprints.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/** - * @file dialog_orient_footprints.cpp - */ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 1992-2010 Jean_Pierre Charras - * Copyright (C) 1992-2010 KiCad Developers, see change_log.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 -#include -#include -#include -#include -#include - -#include -#include - -#include - - - -/* DIALOG_ORIENT_FOOTPRINTS class declaration - */ - -class DIALOG_ORIENT_FOOTPRINTS: public DIALOG_ORIENT_FOOTPRINTS_BASE -{ -private: - PCB_EDIT_FRAME * m_Parent; - static int newOrientation; - -public: - DIALOG_ORIENT_FOOTPRINTS( PCB_EDIT_FRAME* parent ); - ~DIALOG_ORIENT_FOOTPRINTS() {} - - bool ApplyToLockedModules() - { - return m_ApplyToLocked->IsChecked(); - } - - int GetOrientation() - { - return newOrientation; - } - - wxString GetFilter() - { - return m_FilterPattern->GetValue(); - } - -private: - void init(); - - void OnOkClick( wxCommandEvent& event ); - void OnCancelClick( wxCommandEvent& event ); -}; - - -int DIALOG_ORIENT_FOOTPRINTS::newOrientation = 0; - - -DIALOG_ORIENT_FOOTPRINTS::DIALOG_ORIENT_FOOTPRINTS( PCB_EDIT_FRAME* parent ) - : DIALOG_ORIENT_FOOTPRINTS_BASE( parent ) -{ - m_Parent = parent; - wxString txt; - txt.Printf( wxT( "%g" ), (double) newOrientation/10 ); - m_OrientationCtrl->SetValue( txt ); - SetFocus(); - GetSizer()->SetSizeHints( this ); - Centre(); -} - - -void PCB_EDIT_FRAME::OnOrientFootprints( wxCommandEvent& event ) -{ - DIALOG_ORIENT_FOOTPRINTS dlg( this ); - - if( dlg.ShowModal() != wxID_OK ) - return; - - wxString text = dlg.GetFilter(); - - if( ReOrientModules( text, dlg.GetOrientation(), dlg.ApplyToLockedModules() ) ) - { - m_canvas->Refresh(); - Compile_Ratsnest( NULL, true ); - } -} - - -bool PCB_EDIT_FRAME::ReOrientModules( const wxString& ModuleMask, double Orient, - bool include_fixe ) -{ - wxString line; - bool modified = false; - - line.Printf( _( "OK to set footprints orientation to %.1f degrees ?" ), Orient / 10.0 ); - - if( !IsOK( this, line ) ) - return false; - - for( MODULE* module = GetBoard()->m_Modules; module; module = module->Next() ) - { - if( module->IsLocked() && !include_fixe ) - continue; - - if( WildCompareString( ModuleMask, module->GetReference(), false ) ) - { - modified = true; - Rotate_Module( NULL, module, Orient, false ); - } - } - - if ( modified ) - OnModify(); - - return modified; -} - - -void DIALOG_ORIENT_FOOTPRINTS::OnOkClick( wxCommandEvent& event ) -{ - double d_orient; - wxString text = m_OrientationCtrl->GetValue(); - - if ( ! text.ToDouble( &d_orient ) ) - { - DisplayError( this, _( "Bad value for footprints orientation" ) ); - return; - } - - newOrientation = KiROUND( d_orient * 10 ); - NORMALIZE_ANGLE_180( newOrientation ); - EndModal( wxID_OK ); -} - -void DIALOG_ORIENT_FOOTPRINTS::OnCancelClick( wxCommandEvent& event ) -{ - EndModal( wxID_CANCEL ); -} diff --git a/pcbnew/dialogs/dialog_orient_footprints_base.cpp b/pcbnew/dialogs/dialog_orient_footprints_base.cpp deleted file mode 100644 index 9500469cd1..0000000000 --- a/pcbnew/dialogs/dialog_orient_footprints_base.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 10 2012) -// http://www.wxformbuilder.org/ -// -// PLEASE DO "NOT" EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#include "dialog_orient_footprints_base.h" - -/////////////////////////////////////////////////////////////////////////// - -DIALOG_ORIENT_FOOTPRINTS_BASE::DIALOG_ORIENT_FOOTPRINTS_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( wxHORIZONTAL ); - - wxBoxSizer* bSizerLeft; - bSizerLeft = new wxBoxSizer( wxVERTICAL ); - - m_staticText1 = new wxStaticText( this, wxID_ANY, _("Orientation:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText1->Wrap( -1 ); - bSizerLeft->Add( m_staticText1, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_OrientationCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_OrientationCtrl->SetToolTip( _("New orientation (0.1 degree resolution)") ); - - bSizerLeft->Add( m_OrientationCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - - m_staticText2 = new wxStaticText( this, wxID_ANY, _("Filter:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText2->Wrap( -1 ); - bSizerLeft->Add( m_staticText2, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_FilterPattern = new wxTextCtrl( this, wxID_ANY, _("*"), wxDefaultPosition, wxDefaultSize, 0 ); - m_FilterPattern->SetToolTip( _("Filter to select footprints by reference") ); - - bSizerLeft->Add( m_FilterPattern, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - - bSizerLeft->Add( 0, 0, 0, wxTOP|wxBOTTOM, 5 ); - - m_ApplyToLocked = new wxCheckBox( this, wxID_ANY, _("Include Locked Footprints"), wxDefaultPosition, wxDefaultSize, 0 ); - m_ApplyToLocked->SetToolTip( _("Force locked footprints to be modified") ); - - bSizerLeft->Add( m_ApplyToLocked, 0, wxALL, 5 ); - - - bSizerMain->Add( bSizerLeft, 1, wxEXPAND, 5 ); - - wxBoxSizer* bSizerRight; - bSizerRight = new wxBoxSizer( wxVERTICAL ); - - m_buttonOK = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonOK->SetDefault(); - bSizerRight->Add( m_buttonOK, 0, wxALL, 5 ); - - m_buttonClose = new wxButton( this, wxID_ANY, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerRight->Add( m_buttonClose, 0, wxALL, 5 ); - - - bSizerMain->Add( bSizerRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - this->SetSizer( bSizerMain ); - this->Layout(); - - this->Centre( wxBOTH ); - - // Connect Events - m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ORIENT_FOOTPRINTS_BASE::OnOkClick ), NULL, this ); - m_buttonClose->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ORIENT_FOOTPRINTS_BASE::OnCancelClick ), NULL, this ); -} - -DIALOG_ORIENT_FOOTPRINTS_BASE::~DIALOG_ORIENT_FOOTPRINTS_BASE() -{ - // Disconnect Events - m_buttonOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ORIENT_FOOTPRINTS_BASE::OnOkClick ), NULL, this ); - m_buttonClose->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ORIENT_FOOTPRINTS_BASE::OnCancelClick ), NULL, this ); - -} diff --git a/pcbnew/dialogs/dialog_orient_footprints_base.fbp b/pcbnew/dialogs/dialog_orient_footprints_base.fbp deleted file mode 100644 index a0f53cd309..0000000000 --- a/pcbnew/dialogs/dialog_orient_footprints_base.fbp +++ /dev/null @@ -1,741 +0,0 @@ - - - - - - C++ - 1 - source_name - 0 - 0 - res - UTF-8 - connect - dialog_orient_footprints_base - 1000 - none - 1 - dialog_orient_footprints - - . - - 1 - 1 - 1 - 0 - 0 - - 0 - wxAUI_MGR_DEFAULT - - wxBOTH - - 1 - 1 - impl_virtual - - - - 0 - wxID_ANY - - - DIALOG_ORIENT_FOOTPRINTS_BASE - - 403,160 - wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - DIALOG_SHIM; dialog_shim.h - Footprints Orientation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bSizerMain - wxHORIZONTAL - none - - 5 - wxEXPAND - 1 - - - bSizerLeft - wxVERTICAL - none - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Orientation: - - 0 - - - 0 - - 1 - m_staticText1 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_OrientationCtrl - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - New orientation (0.1 degree resolution) - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Filter: - - 0 - - - 0 - - 1 - m_staticText2 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_FilterPattern - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Filter to select footprints by reference - - wxFILTER_NONE - wxDefaultValidator - - * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxBOTTOM - 0 - - 0 - protected - 0 - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Include Locked Footprints - - 0 - - - 0 - - 1 - m_ApplyToLocked - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Force locked footprints to be modified - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - - bSizerRight - wxVERTICAL - none - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_OK - OK - - 0 - - - 0 - - 1 - m_buttonOK - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnOkClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Close - - 0 - - - 0 - - 1 - m_buttonClose - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnCancelClick - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pcbnew/dialogs/dialog_orient_footprints_base.h b/pcbnew/dialogs/dialog_orient_footprints_base.h deleted file mode 100644 index 37429c6858..0000000000 --- a/pcbnew/dialogs/dialog_orient_footprints_base.h +++ /dev/null @@ -1,58 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 10 2012) -// http://www.wxformbuilder.org/ -// -// PLEASE DO "NOT" EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#ifndef __DIALOG_ORIENT_FOOTPRINTS_BASE_H__ -#define __DIALOG_ORIENT_FOOTPRINTS_BASE_H__ - -#include -#include -#include -#include "dialog_shim.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////// - - -/////////////////////////////////////////////////////////////////////////////// -/// Class DIALOG_ORIENT_FOOTPRINTS_BASE -/////////////////////////////////////////////////////////////////////////////// -class DIALOG_ORIENT_FOOTPRINTS_BASE : public DIALOG_SHIM -{ - private: - - protected: - wxStaticText* m_staticText1; - wxTextCtrl* m_OrientationCtrl; - wxStaticText* m_staticText2; - wxTextCtrl* m_FilterPattern; - wxCheckBox* m_ApplyToLocked; - wxButton* m_buttonOK; - wxButton* m_buttonClose; - - // Virtual event handlers, overide them in your derived class - virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } - virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } - - - public: - - DIALOG_ORIENT_FOOTPRINTS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Footprints Orientation"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 403,160 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~DIALOG_ORIENT_FOOTPRINTS_BASE(); - -}; - -#endif //__DIALOG_ORIENT_FOOTPRINTS_BASE_H__ diff --git a/pcbnew/onrightclick.cpp b/pcbnew/onrightclick.cpp index 7434b25a93..ea8b301919 100644 --- a/pcbnew/onrightclick.cpp +++ b/pcbnew/onrightclick.cpp @@ -443,10 +443,6 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) _( "Automatically Place New Footprints" ) ); commands->Append( ID_POPUP_PCB_AUTOPLACE_NEXT_MODULE, _( "Automatically Place Next Footprints" ) ); - commands->AppendSeparator(); - AddMenuItem( commands, ID_POPUP_PCB_REORIENT_ALL_MODULES, - _( "Orient All Footprints" ), KiBitmap( rotate_module_cw_xpm ) ); - aPopMenu->AppendSeparator(); } if( m_mainToolBar->GetToolToggled( ID_TOOLBARH_PCB_MODE_TRACKS ) ) diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index 959e90dd76..7b87ad3f51 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -254,8 +254,6 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME ) EVT_MENU_RANGE( ID_POPUP_PCB_AUTOPLACE_START_RANGE, ID_POPUP_PCB_AUTOPLACE_END_RANGE, PCB_EDIT_FRAME::OnPlaceOrRouteFootprints ) - EVT_MENU( ID_POPUP_PCB_REORIENT_ALL_MODULES, PCB_EDIT_FRAME::OnOrientFootprints ) - EVT_MENU_RANGE( ID_POPUP_PCB_START_RANGE, ID_POPUP_PCB_END_RANGE, PCB_EDIT_FRAME::Process_Special_Functions ) diff --git a/pcbnew/pcbnew_id.h b/pcbnew/pcbnew_id.h index fe7df117dd..cd93db86b4 100644 --- a/pcbnew/pcbnew_id.h +++ b/pcbnew/pcbnew_id.h @@ -252,8 +252,6 @@ enum pcbnew_ids ID_POPUP_PCB_AUTOROUTE_SELECT_LAYERS, ID_POPUP_PCB_AUTOPLACE_END_RANGE, - ID_POPUP_PCB_REORIENT_ALL_MODULES, - ID_MENU_READ_BOARD_BACKUP_FILE, ID_MENU_RECOVER_BOARD_AUTOSAVE, ID_MENU_ARCHIVE_MODULES,