PAGED_DIALOG: allow setting initial size in ctor.

This commit is contained in:
Alex Shvartzkop 2023-06-16 17:42:15 +03:00
parent e7fac08c2f
commit f5da58e17d
5 changed files with 7 additions and 18 deletions

View File

@ -1042,7 +1042,7 @@ void EDA_BASE_FRAME::ShowPreferences( wxString aStartPage, wxString aStartParent
{
wxBeginBusyCursor( wxHOURGLASS_CURSOR );
PAGED_DIALOG dlg( this, _( "Preferences" ), true );
PAGED_DIALOG dlg( this, _( "Preferences" ), true, wxEmptyString, wxSize( 980, 560 ) );
dlg.SetEvtHandlerEnabled( false );
@ -1203,10 +1203,6 @@ void EDA_BASE_FRAME::ShowPreferences( wxString aStartPage, wxString aStartParent
if( !aStartPage.IsEmpty() )
dlg.SetInitialPage( aStartPage, aStartParentPage );
// This is unfortunate, but it's the cost of lazy-loading the panels
book->SetMinSize( wxSize( 980, 560 ) );
book->SetInitialSize( wxSize( 980, 560 ) );
dlg.SetEvtHandlerEnabled( true );
wxEndBusyCursor();

View File

@ -41,8 +41,8 @@ std::map<wxString, wxString> g_lastParentPage;
PAGED_DIALOG::PAGED_DIALOG( wxWindow* aParent, const wxString& aTitle, bool aShowReset,
const wxString& aAuxiliaryAction ) :
DIALOG_SHIM( aParent, wxID_ANY, aTitle, wxDefaultPosition, wxDefaultSize,
const wxString& aAuxiliaryAction, const wxSize& aInitialSize ) :
DIALOG_SHIM( aParent, wxID_ANY, aTitle, wxDefaultPosition, aInitialSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER ),
m_auxiliaryButton( nullptr ),
m_resetButton( nullptr ),

View File

@ -38,7 +38,7 @@
DIALOG_SCHEMATIC_SETUP::DIALOG_SCHEMATIC_SETUP( SCH_EDIT_FRAME* aFrame ) :
PAGED_DIALOG( aFrame, _( "Schematic Setup" ), true,
_( "Import Settings from Another Project..." ) ),
_( "Import Settings from Another Project..." ), wxSize( 920, 460 ) ),
m_frame( aFrame )
{
SetEvtHandlerEnabled( false );
@ -114,10 +114,6 @@ DIALOG_SCHEMATIC_SETUP::DIALOG_SCHEMATIC_SETUP( SCH_EDIT_FRAME* aFrame ) :
for( size_t i = 0; i < m_treebook->GetPageCount(); ++i )
m_treebook->ExpandNode( i );
// This is unfortunate, but it's the cost of lazy-loading the panels
m_treebook->SetMinSize( wxSize( 920, 460 ) );
m_treebook->SetInitialSize( wxSize( 920, 460 ) );
SetEvtHandlerEnabled( true );
finishDialogSettings();

View File

@ -32,7 +32,8 @@ class PAGED_DIALOG : public DIALOG_SHIM
{
public:
PAGED_DIALOG( wxWindow* aParent, const wxString& aTitle, bool aShowReset,
const wxString& aAuxiliaryAction = wxEmptyString );
const wxString& aAuxiliaryAction = wxEmptyString,
const wxSize& aInitialSize = wxDefaultSize );
~PAGED_DIALOG() override;
WX_TREEBOOK* GetTreebook() { return m_treebook; }

View File

@ -52,7 +52,7 @@ std::mutex DIALOG_BOARD_SETUP::g_Mutex;
DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP( PCB_EDIT_FRAME* aFrame ) :
PAGED_DIALOG( aFrame, _( "Board Setup" ), false,
_( "Import Settings from Another Board..." ) ),
_( "Import Settings from Another Board..." ), wxSize( 980, 600 ) ),
m_frame( aFrame ),
m_layers( nullptr ),
m_physicalStackup( nullptr ),
@ -187,10 +187,6 @@ DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP( PCB_EDIT_FRAME* aFrame ) :
for( size_t i = 0; i < m_treebook->GetPageCount(); ++i )
m_treebook->ExpandNode( i );
// This is unfortunate, but it's the cost of lazy-loading the panels
m_treebook->SetMinSize( wxSize( 980, 600 ) );
m_treebook->SetInitialSize( wxSize( 980, 600 ) );
SetEvtHandlerEnabled( true );
finishDialogSettings();