diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt index f3e38da0ee..9e9ba2237f 100644 --- a/eeschema/CMakeLists.txt +++ b/eeschema/CMakeLists.txt @@ -238,7 +238,6 @@ set( EESCHEMA_SIM_SRCS sim/legacy_workbook.cpp - widgets/sim_notebook.cpp widgets/tuner_slider.cpp widgets/tuner_slider_base.cpp ) diff --git a/eeschema/dialogs/dialog_sim_command.cpp b/eeschema/dialogs/dialog_sim_command.cpp index 9d9790a793..5893930252 100644 --- a/eeschema/dialogs/dialog_sim_command.cpp +++ b/eeschema/dialogs/dialog_sim_command.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include diff --git a/eeschema/sim/simulator_frame.h b/eeschema/sim/simulator_frame.h index 68f6383fd0..7032321a4a 100644 --- a/eeschema/sim/simulator_frame.h +++ b/eeschema/sim/simulator_frame.h @@ -46,6 +46,7 @@ class SCH_SYMBOL; class SIMULATOR_FRAME_UI; class SIM_THREAD_REPORTER; class ACTION_TOOLBAR; +class SPICE_SIMULATOR; /** diff --git a/eeschema/sim/simulator_frame_ui.cpp b/eeschema/sim/simulator_frame_ui.cpp index b8f6458cd1..ee17b9ada6 100644 --- a/eeschema/sim/simulator_frame_ui.cpp +++ b/eeschema/sim/simulator_frame_ui.cpp @@ -523,7 +523,6 @@ SIMULATOR_FRAME_UI::SIMULATOR_FRAME_UI( SIMULATOR_FRAME* aSimulatorFrame, SIM_PLOT_COLORS::FillDefaultColorList( m_darkMode ); Bind( EVT_SIM_CURSOR_UPDATE, &SIMULATOR_FRAME_UI::onPlotCursorUpdate, this ); - Bind( EVT_WORKBOOK_MODIFIED, &SIMULATOR_FRAME_UI::onNotebookModified, this ); Bind( wxEVT_TIMER, [&]( wxTimerEvent& aEvent ) @@ -2343,13 +2342,6 @@ void SIMULATOR_FRAME_UI::onPlotDragged( wxAuiNotebookEvent& event ) } -void SIMULATOR_FRAME_UI::onNotebookModified( wxCommandEvent& event ) -{ - m_simulatorFrame->OnModify(); - m_simulatorFrame->UpdateTitle(); -} - - std::shared_ptr SIMULATOR_FRAME_UI::simulator() const { return m_simulatorFrame->GetSimulator(); diff --git a/eeschema/sim/simulator_frame_ui.h b/eeschema/sim/simulator_frame_ui.h index afa8545fb8..49f2549aec 100644 --- a/eeschema/sim/simulator_frame_ui.h +++ b/eeschema/sim/simulator_frame_ui.h @@ -307,8 +307,6 @@ private: bool loadLegacyWorkbook( const wxString & aPath ); bool loadJsonWorkbook( const wxString & aPath ); - void onNotebookModified( wxCommandEvent& event ); - void onPlotCursorUpdate( wxCommandEvent& aEvent ); public: diff --git a/eeschema/sim/simulator_frame_ui_base.cpp b/eeschema/sim/simulator_frame_ui_base.cpp index 7a3b5c7643..a0252c940a 100644 --- a/eeschema/sim/simulator_frame_ui_base.cpp +++ b/eeschema/sim/simulator_frame_ui_base.cpp @@ -36,7 +36,7 @@ SIMULATOR_FRAME_UI_BASE::SIMULATOR_FRAME_UI_BASE( wxWindow* parent, wxWindowID i m_sizerPlot = new wxBoxSizer( wxHORIZONTAL ); - m_plotNotebook = new SIM_NOTEBOOK( m_plotPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_CLOSE_ON_ALL_TABS|wxAUI_NB_MIDDLE_CLICK_CLOSE|wxAUI_NB_TAB_MOVE|wxAUI_NB_TOP ); + m_plotNotebook = new wxAuiNotebook( m_plotPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_CLOSE_ON_ALL_TABS|wxAUI_NB_MIDDLE_CLICK_CLOSE|wxAUI_NB_TAB_MOVE|wxAUI_NB_TOP ); m_plotNotebook->SetMinSize( wxSize( 200,200 ) ); diff --git a/eeschema/sim/simulator_frame_ui_base.fbp b/eeschema/sim/simulator_frame_ui_base.fbp index 1cee77b8a3..e0e5c52419 100644 --- a/eeschema/sim/simulator_frame_ui_base.fbp +++ b/eeschema/sim/simulator_frame_ui_base.fbp @@ -343,7 +343,7 @@ 1 wxAUI_NB_CLOSE_ON_ALL_TABS|wxAUI_NB_MIDDLE_CLICK_CLOSE|wxAUI_NB_TAB_MOVE|wxAUI_NB_TOP - SIM_NOTEBOOK; sim_notebook.h; + -1 0 diff --git a/eeschema/sim/simulator_frame_ui_base.h b/eeschema/sim/simulator_frame_ui_base.h index 80578f6bab..6b447d92cc 100644 --- a/eeschema/sim/simulator_frame_ui_base.h +++ b/eeschema/sim/simulator_frame_ui_base.h @@ -12,7 +12,6 @@ #include class WX_GRID; -#include "sim_notebook.h" #include #include #include @@ -43,7 +42,7 @@ class SIMULATOR_FRAME_UI_BASE : public wxPanel wxSplitterWindow* m_splitterPlotAndConsole; wxPanel* m_plotPanel; wxBoxSizer* m_sizerPlot; - SIM_NOTEBOOK* m_plotNotebook; + wxAuiNotebook* m_plotNotebook; wxPanel* m_panelConsole; wxBoxSizer* m_sizerConsole; wxTextCtrl* m_simConsole; diff --git a/eeschema/tools/simulator_control.cpp b/eeschema/tools/simulator_control.cpp index 22f7cdceaa..4f27944a82 100644 --- a/eeschema/tools/simulator_control.cpp +++ b/eeschema/tools/simulator_control.cpp @@ -33,10 +33,12 @@ #include #include #include +#include #include #include #include #include +#include #include diff --git a/eeschema/widgets/sim_notebook.cpp b/eeschema/widgets/sim_notebook.cpp deleted file mode 100644 index b2661f46e2..0000000000 --- a/eeschema/widgets/sim_notebook.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 2021 Mikołaj Wielgus - * Copyright (C) 2021-2023 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 "widgets/sim_notebook.h" - - -SIM_NOTEBOOK::SIM_NOTEBOOK() : - wxAuiNotebook() -{ } - - -SIM_NOTEBOOK::SIM_NOTEBOOK( wxWindow* aParent, wxWindowID aId, const wxPoint& aPos, const wxSize& - aSize, long aStyle ) : - wxAuiNotebook( aParent, aId, aPos, aSize, aStyle ) -{ } - - -bool SIM_NOTEBOOK::AddPage( wxWindow* page, const wxString& caption, bool select, const wxBitmap& bitmap ) -{ - if( wxAuiNotebook::AddPage( page, caption, select, bitmap ) ) - { - wxPostEvent( GetParent(), wxCommandEvent( EVT_WORKBOOK_MODIFIED ) ); - return true; - } - - return false; -} - - -bool SIM_NOTEBOOK::AddPage( wxWindow* page, const wxString& text, bool select, int imageId ) -{ - if( wxAuiNotebook::AddPage( page, text, select, imageId ) ) - { - wxPostEvent( GetParent(), wxCommandEvent( EVT_WORKBOOK_MODIFIED ) ); - return true; - } - - return false; -} - - -bool SIM_NOTEBOOK::DeleteAllPages() -{ - if( wxAuiNotebook::DeleteAllPages() ) - { - wxPostEvent( GetParent(), wxCommandEvent( EVT_WORKBOOK_MODIFIED ) ); - return true; - } - - return false; -} - - -bool SIM_NOTEBOOK::DeletePage( size_t page ) -{ - if( wxAuiNotebook::DeletePage( page ) ) - { - wxPostEvent( GetParent(), wxCommandEvent( EVT_WORKBOOK_MODIFIED ) ); - return true; - } - - return false; -} - - -wxDEFINE_EVENT( EVT_WORKBOOK_MODIFIED, wxCommandEvent ); diff --git a/eeschema/widgets/sim_notebook.h b/eeschema/widgets/sim_notebook.h deleted file mode 100644 index f161a41c18..0000000000 --- a/eeschema/widgets/sim_notebook.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 2021 Mikołaj Wielgus - * Copyright (C) 2021-2023 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 - */ - -#ifndef SIM_NOTEBOOK_H -#define SIM_NOTEBOOK_H - -#include "dialogs/dialog_sim_command.h" -#include "sim/sim_tab.h" -#include "sim/sim_plot_tab.h" - - -class SIM_NOTEBOOK : public wxAuiNotebook -{ -public: - SIM_NOTEBOOK(); - SIM_NOTEBOOK( wxWindow* aParent, wxWindowID aId = wxID_ANY, - const wxPoint& aPos = wxDefaultPosition, const wxSize& aSize = wxDefaultSize, - long aStyle = wxAUI_NB_DEFAULT_STYLE ); - - // Methods from wxAuiNotebook - - bool AddPage( wxWindow* aPage, const wxString& aCaption, bool aSelect=false, - const wxBitmap& aBitmap = wxNullBitmap ); - bool AddPage( wxWindow* aPage, const wxString& aText, bool aSelect, int aImageId ) override; - - bool DeleteAllPages() override; - bool DeletePage( size_t aPage ) override; -}; - -wxDECLARE_EVENT( EVT_WORKBOOK_MODIFIED, wxCommandEvent ); - -#endif // SIM_NOTEBOOK_H