From c01bf9c911a284137d9aaf0c86f208f634e877e4 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Tue, 4 Aug 2020 13:57:41 +0200 Subject: [PATCH] Refinement in NETLIST_DIALOG, spice panel. The run simulator button is enabled only if the command line is not empty. --- eeschema/dialogs/dialog_netlist.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/eeschema/dialogs/dialog_netlist.cpp b/eeschema/dialogs/dialog_netlist.cpp index 5e9579b906..a8155fc933 100644 --- a/eeschema/dialogs/dialog_netlist.cpp +++ b/eeschema/dialogs/dialog_netlist.cpp @@ -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] =