Avoid implementation dependent on events
Adding a page in the ctor can generate events that change the default page. Instead, we set the default after all pages have been added, avoiding the reset Fixes https://gitlab.com/kicad/code/kicad/issues/10910
This commit is contained in:
parent
c465a6ebc7
commit
5314ba6440
|
@ -217,11 +217,7 @@ NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent, const wxString& ti
|
||||||
m_TitleStringCtrl = nullptr;
|
m_TitleStringCtrl = nullptr;
|
||||||
m_AdjustPassiveValues = nullptr;
|
m_AdjustPassiveValues = nullptr;
|
||||||
|
|
||||||
wxString netfmtName = static_cast<NETLIST_DIALOG*>( parent->GetParent() )->m_DefaultNetFmtName;
|
parent->AddPage( this, title, false );
|
||||||
|
|
||||||
bool selected = m_pageNetFmtName == netfmtName;
|
|
||||||
|
|
||||||
parent->AddPage( this, title, selected );
|
|
||||||
|
|
||||||
wxBoxSizer* MainBoxSizer = new wxBoxSizer( wxVERTICAL );
|
wxBoxSizer* MainBoxSizer = new wxBoxSizer( wxVERTICAL );
|
||||||
SetSizer( MainBoxSizer );
|
SetSizer( MainBoxSizer );
|
||||||
|
@ -271,6 +267,15 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) :
|
||||||
|
|
||||||
m_sdbSizer2OK->SetDefault();
|
m_sdbSizer2OK->SetDefault();
|
||||||
|
|
||||||
|
for( int ii = 0; m_PanelNetType[ii] && ii < 4 + CUSTOMPANEL_COUNTMAX; ++ii )
|
||||||
|
{
|
||||||
|
if( m_PanelNetType[ii]->GetPageNetFmtName() == settings.m_NetFormatName )
|
||||||
|
{
|
||||||
|
m_NoteBook->ChangeSelection( ii );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Now all widgets have the size fixed, call FinishDialogSettings
|
// Now all widgets have the size fixed, call FinishDialogSettings
|
||||||
finishDialogSettings();
|
finishDialogSettings();
|
||||||
}
|
}
|
||||||
|
@ -431,7 +436,6 @@ void NETLIST_DIALOG::NetlistUpdateOpt()
|
||||||
|
|
||||||
settings.m_SpiceAdjustPassiveValues = adjust;
|
settings.m_SpiceAdjustPassiveValues = adjust;
|
||||||
settings.m_SpiceCommandString = spice_cmd_string;
|
settings.m_SpiceCommandString = spice_cmd_string;
|
||||||
settings.m_NetFormatName = wxEmptyString;
|
|
||||||
settings.m_NetFormatName = m_DefaultNetFmtName;
|
settings.m_NetFormatName = m_DefaultNetFmtName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue