Cvpcb: remove fixed size and use the last stored size.

It fixes a bug created by commit b1eed74b55.
Other very minor fix in Cvpcb
This commit is contained in:
jean-pierre charras 2018-02-11 18:55:14 +01:00
parent 6588bef1b1
commit 62ef63501c
4 changed files with 15 additions and 11 deletions

View File

@ -270,10 +270,10 @@ void EDA_BASE_FRAME::LoadSettings( wxConfigBase* aCfg )
aCfg->Read( text, &m_FramePos.y );
text = baseCfgName + entrySizeX;
aCfg->Read( text, &m_FrameSize.x, 600 );
aCfg->Read( text, &m_FrameSize.x, wxDefaultSize.x );
text = baseCfgName + entrySizeY;
aCfg->Read( text, &m_FrameSize.y, 400 );
aCfg->Read( text, &m_FrameSize.y, wxDefaultSize.x );
text = baseCfgName + entryMaximized;
aCfg->Read( text, &maximized, 0 );

View File

@ -32,11 +32,9 @@
#include <fp_lib_table.h>
#include <kiface_i.h>
#include <pgm_base.h>
//#include <wxstruct.h>
#include <confirm.h>
#include <cvpcb.h>
#include <zones.h>
#include <cvpcb_mainframe.h>
#include <cvpcb_id.h>

View File

@ -51,8 +51,8 @@
#include <cvpcb_id.h>
wxSize const FRAME_MIN_SIZE_DU( 300, 120 );
wxSize const FRAME_DEFAULT_SIZE_DU( 500, 250 );
wxSize const FRAME_MIN_SIZE_DU( 350, 250 );
wxSize const FRAME_DEFAULT_SIZE_DU( 450, 300 );
///@{
/// \ingroup config
@ -136,11 +136,12 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) :
LoadSettings( config() );
wxSize const frame_min( ConvertDialogToPixels( FRAME_MIN_SIZE_DU ) );
wxSize const frame_default( ConvertDialogToPixels( FRAME_DEFAULT_SIZE_DU ) );
m_FrameSize = frame_default;
SetSizeHints( frame_min );
// Frame size and position
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
// create the status bar
static const int dims[3] = { -1, -1, 250 };
@ -184,9 +185,6 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) :
wxAuiPaneInfo( info ).Name( wxT( "m_footprintListBox" ) ).
Right().BestSize( (int) ( m_FrameSize.x * 0.30 ), m_FrameSize.y ) );
// Frame size and position
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
m_auimgr.Update();
}
@ -201,6 +199,11 @@ void CVPCB_MAINFRAME::LoadSettings( wxConfigBase* aCfg )
{
EDA_BASE_FRAME::LoadSettings( aCfg );
wxSize const frame_default( ConvertDialogToPixels( FRAME_DEFAULT_SIZE_DU ) );
if( m_FrameSize == wxDefaultSize )
m_FrameSize = frame_default;
aCfg->Read( KeepCvpcbOpenEntry, &m_keepCvpcbOpen, true );
aCfg->Read( FilterFootprintEntry, &m_filteringOptions, FOOTPRINTS_LISTBOX::UNFILTERED_FP_LIST );
}

View File

@ -187,6 +187,9 @@ bool CVPCB_MAINFRAME::ReadNetListAndFpFiles( const std::string& aNetlist )
return false;
LoadProjectFile();
wxSafeYield();
LoadFootprintFiles();
BuildFOOTPRINTS_LISTBOX();