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.
From master branch, commit 60152bc
This commit is contained in:
jean-pierre charras 2021-01-11 10:25:03 +01:00
parent 20909d4948
commit f292f1628b
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>
* *
@ -44,6 +44,7 @@
#include "spice_reporter.h" #include "spice_reporter.h"
#include <menus_helpers.h> #include <menus_helpers.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 )
{ {
@ -1134,7 +1135,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
@ -1147,12 +1148,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 ) );
@ -1172,6 +1174,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();
} }
}; };