From 60152bc00edda2052c198ebd1b9d647bc0b768e1 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 11 Jan 2021 10:01:50 +0100 Subject: [PATCH] Spice sim: fix incorrect (very large) dialog size displaying the netlist. It was previously fixed to 1500x900 pixels, that can be too large. The window size and position is also now retained during a session. Fixes #7043 https://gitlab.com/kicad/code/kicad/issues/7043 --- eeschema/sim/sim_plot_frame.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/eeschema/sim/sim_plot_frame.cpp b/eeschema/sim/sim_plot_frame.cpp index 30b015023b..01ef9263a8 100644 --- a/eeschema/sim/sim_plot_frame.cpp +++ b/eeschema/sim/sim_plot_frame.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2016 CERN - * Copyright (C) 2016-2018 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors. * @author Tomasz Wlostowski * @author Maciej Suminski * @@ -46,6 +46,7 @@ #include #include #include +#include SIM_PLOT_TYPE operator|( SIM_PLOT_TYPE aFirst, SIM_PLOT_TYPE aSecond ) { @@ -1363,7 +1364,7 @@ void SIM_PLOT_FRAME::onTune( wxCommandEvent& event ) void SIM_PLOT_FRAME::onShowNetlist( wxCommandEvent& event ) { - class NETLIST_VIEW_DIALOG : public wxDialog + class NETLIST_VIEW_DIALOG : public DIALOG_SHIM { public: enum @@ -1376,12 +1377,13 @@ void SIM_PLOT_FRAME::onShowNetlist( wxCommandEvent& event ) EndModal( GetReturnCode() ); } - NETLIST_VIEW_DIALOG(wxWindow* parent, wxString source) : - wxDialog(parent, wxID_ANY, "SPICE Netlist", - wxDefaultPosition, wxSize(1500,900), - wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) + NETLIST_VIEW_DIALOG( wxWindow* parent, wxString source) : + DIALOG_SHIM( parent, wxID_ANY, "SPICE Netlist", + wxDefaultPosition, wxDefaultSize, + wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER ) { wxStyledTextCtrl* text = new wxStyledTextCtrl( this, wxID_ANY ); + text->SetMinSize( wxSize( 600, 400 ) ); text->SetMarginWidth( MARGIN_LINE_NUMBERS, 50 ); text->StyleSetForeground( wxSTC_STYLE_LINENUMBER, wxColour( 75, 75, 75 ) ); @@ -1405,6 +1407,8 @@ void SIM_PLOT_FRAME::onShowNetlist( wxCommandEvent& event ) Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( NETLIST_VIEW_DIALOG::onClose ), NULL, this ); + + finishDialogSettings(); } };