Refinement in NETLIST_DIALOG, spice panel.

The run simulator button is enabled only if the command line is not empty.
This commit is contained in:
jean-pierre charras 2020-08-04 13:57:41 +02:00
parent 7f91a1f5da
commit c01bf9c911
1 changed files with 13 additions and 0 deletions

View File

@ -153,6 +153,11 @@ private:
*/
void OnRunExternSpiceCommand( wxCommandEvent& event );
/**
* Enable (if the command line is not empty or disable the button to run spice command
*/
void OnRunSpiceButtUI( wxUpdateUIEvent& event );
/**
* Function WriteCurrentNetlistSetup
* Write the current netlist options setup in the configuration
@ -213,6 +218,7 @@ enum id_netlist {
BEGIN_EVENT_TABLE( NETLIST_DIALOG, NETLIST_DIALOG_BASE )
EVT_CHECKBOX( ID_CURRENT_FORMAT_IS_DEFAULT, NETLIST_DIALOG::SelectDefaultNetlistType )
EVT_BUTTON( ID_RUN_SIMULATOR, NETLIST_DIALOG::OnRunExternSpiceCommand )
EVT_UPDATE_UI( ID_RUN_SIMULATOR, NETLIST_DIALOG::OnRunSpiceButtUI )
END_EVENT_TABLE()
@ -346,6 +352,13 @@ void NETLIST_DIALOG::OnRunExternSpiceCommand( wxCommandEvent& event )
}
void NETLIST_DIALOG::OnRunSpiceButtUI( wxUpdateUIEvent& aEvent )
{
bool disable = m_PanelNetType[PANELSPICE]->m_CommandStringCtrl->IsEmpty();
aEvent.Enable( !disable );
}
void NETLIST_DIALOG::InstallPageSpice()
{
NETLIST_PAGE_DIALOG* page = m_PanelNetType[PANELSPICE] =