Fix a minimal size for the spice simulator frame.

For an obscure reason, the minimal frame size fixed in EDA_BASE_FRAME was not working.
This commit is contained in:
jean-pierre charras 2018-04-27 20:35:23 +02:00
parent a9dd5b5335
commit 502bed083d
2 changed files with 9 additions and 13 deletions

View File

@ -75,8 +75,6 @@ EDA_BASE_FRAME::EDA_BASE_FRAME( wxWindow* aParent, FRAME_T aFrameType,
long aStyle, const wxString& aFrameName ) : long aStyle, const wxString& aFrameName ) :
wxFrame( aParent, wxID_ANY, aTitle, aPos, aSize, aStyle, aFrameName ) wxFrame( aParent, wxID_ANY, aTitle, aPos, aSize, aStyle, aFrameName )
{ {
wxSize minsize;
m_Ident = aFrameType; m_Ident = aFrameType;
m_mainToolBar = NULL; m_mainToolBar = NULL;
m_hasAutoSave = false; m_hasAutoSave = false;
@ -84,21 +82,15 @@ EDA_BASE_FRAME::EDA_BASE_FRAME( wxWindow* aParent, FRAME_T aFrameType,
m_autoSaveInterval = -1; m_autoSaveInterval = -1;
m_autoSaveTimer = new wxTimer( this, ID_AUTO_SAVE_TIMER ); m_autoSaveTimer = new wxTimer( this, ID_AUTO_SAVE_TIMER );
m_mruPath = wxStandardPaths::Get().GetDocumentsDir(); m_mruPath = wxStandardPaths::Get().GetDocumentsDir();
minsize.x = 470;
minsize.y = 350;
SetSizeHints( minsize.x, minsize.y, -1, -1, -1, -1 ); // Gives a reasonable minimal size to the frame:
const int minsize_x = 500;
const int minsize_y = 400;
SetSizeHints( minsize_x, minsize_y, -1, -1, -1, -1 );
if( ( aSize.x < minsize.x ) || ( aSize.y < minsize.y ) ) // Store dimensions of the user area of the main window.
SetSize( 0, 0, minsize.x, minsize.y );
// Create child subwindows.
// Dimensions of the user area of the main window.
GetClientSize( &m_FrameSize.x, &m_FrameSize.y ); GetClientSize( &m_FrameSize.x, &m_FrameSize.y );
m_FramePos.x = m_FramePos.y = 0;
Connect( ID_AUTO_SAVE_TIMER, wxEVT_TIMER, Connect( ID_AUTO_SAVE_TIMER, wxEVT_TIMER,
wxTimerEventHandler( EDA_BASE_FRAME::onAutoSaveTimer ) ); wxTimerEventHandler( EDA_BASE_FRAME::onAutoSaveTimer ) );
@ -137,6 +129,7 @@ void EDA_BASE_FRAME::windowClosing( wxCloseEvent& event )
{ {
// Don't allow closing when a quasi-modal is open. // Don't allow closing when a quasi-modal is open.
wxWindow* quasiModal = findQuasiModalDialog(); wxWindow* quasiModal = findQuasiModalDialog();
if( quasiModal ) if( quasiModal )
{ {
// Raise and notify; don't give the user a warning regarding "quasi-modal dialogs" // Raise and notify; don't give the user a warning regarding "quasi-modal dialogs"

View File

@ -133,6 +133,9 @@ SIM_PLOT_FRAME::SIM_PLOT_FRAME( KIWAY* aKiway, wxWindow* aParent )
icon.CopyFromBitmap( KiBitmap( simulator_xpm ) ); icon.CopyFromBitmap( KiBitmap( simulator_xpm ) );
SetIcon( icon ); SetIcon( icon );
// Gives a minimal size
SetSizeHints( 500, 400, -1, -1, -1, -1 );
// Get the previous size and position of windows: // Get the previous size and position of windows:
LoadSettings( config() ); LoadSettings( config() );