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
This commit is contained in:
jean-pierre charras 2021-01-11 10:01:50 +01:00
parent fc7f1d1d86
commit 60152bc00e
1 changed files with 10 additions and 6 deletions

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2016 CERN * 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 <tomasz.wlostowski@cern.ch> * @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
* @author Maciej Suminski <maciej.suminski@cern.ch> * @author Maciej Suminski <maciej.suminski@cern.ch>
* *
@ -46,6 +46,7 @@
#include <tools/ee_actions.h> #include <tools/ee_actions.h>
#include <eeschema_settings.h> #include <eeschema_settings.h>
#include <wx/ffile.h> #include <wx/ffile.h>
#include <dialog_shim.h>
SIM_PLOT_TYPE operator|( SIM_PLOT_TYPE aFirst, SIM_PLOT_TYPE aSecond ) 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 ) void SIM_PLOT_FRAME::onShowNetlist( wxCommandEvent& event )
{ {
class NETLIST_VIEW_DIALOG : public wxDialog class NETLIST_VIEW_DIALOG : public DIALOG_SHIM
{ {
public: public:
enum enum
@ -1376,12 +1377,13 @@ void SIM_PLOT_FRAME::onShowNetlist( wxCommandEvent& event )
EndModal( GetReturnCode() ); EndModal( GetReturnCode() );
} }
NETLIST_VIEW_DIALOG(wxWindow* parent, wxString source) : NETLIST_VIEW_DIALOG( wxWindow* parent, wxString source) :
wxDialog(parent, wxID_ANY, "SPICE Netlist", DIALOG_SHIM( parent, wxID_ANY, "SPICE Netlist",
wxDefaultPosition, wxSize(1500,900), wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER )
{ {
wxStyledTextCtrl* text = new wxStyledTextCtrl( this, wxID_ANY ); wxStyledTextCtrl* text = new wxStyledTextCtrl( this, wxID_ANY );
text->SetMinSize( wxSize( 600, 400 ) );
text->SetMarginWidth( MARGIN_LINE_NUMBERS, 50 ); text->SetMarginWidth( MARGIN_LINE_NUMBERS, 50 );
text->StyleSetForeground( wxSTC_STYLE_LINENUMBER, wxColour( 75, 75, 75 ) ); 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, Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( NETLIST_VIEW_DIALOG::onClose ), NULL,
this ); this );
finishDialogSettings();
} }
}; };