diff --git a/common/dialogs/panel_common_settings.cpp b/common/dialogs/panel_common_settings.cpp index f4cd5265e4..3da68d0358 100644 --- a/common/dialogs/panel_common_settings.cpp +++ b/common/dialogs/panel_common_settings.cpp @@ -320,8 +320,6 @@ void PANEL_COMMON_SETTINGS::OnPDFViewerClick( wxCommandEvent& event ) void PANEL_COMMON_SETTINGS::onUpdateUIPdfPath( wxUpdateUIEvent& event ) { - bool enabled = m_otherPDFViewer->GetValue(); - m_PDFViewerPath->Enable( enabled ); - m_pdfViewerBtn->Enable( enabled ); + // Used by both the m_pdfViewerBtn and m_PDFViewerPath + event.Enable( m_otherPDFViewer->GetValue() ); } - diff --git a/eeschema/symbol_editor/symbol_edit_frame.cpp b/eeschema/symbol_editor/symbol_edit_frame.cpp index c0ceb22cf2..138bf75c17 100644 --- a/eeschema/symbol_editor/symbol_edit_frame.cpp +++ b/eeschema/symbol_editor/symbol_edit_frame.cpp @@ -598,12 +598,7 @@ void SYMBOL_EDIT_FRAME::OnExitKiCad( wxCommandEvent& event ) void SYMBOL_EDIT_FRAME::OnUpdatePartNumber( wxUpdateUIEvent& event ) { - if( !m_unitSelectBox ) - return; - - // Using the typical event.Enable() call doesn't seem to work with wxGTK - // so use the pointer to alias combobox to directly enable or disable. - m_unitSelectBox->Enable( m_my_part && m_my_part->GetUnitCount() > 1 ); + event.Enable( m_my_part && m_my_part->GetUnitCount() > 1 ); } diff --git a/pcbnew/board_stackup_manager/panel_board_stackup.cpp b/pcbnew/board_stackup_manager/panel_board_stackup.cpp index 93d340fe92..53d6931647 100644 --- a/pcbnew/board_stackup_manager/panel_board_stackup.cpp +++ b/pcbnew/board_stackup_manager/panel_board_stackup.cpp @@ -272,12 +272,12 @@ void PANEL_SETUP_BOARD_STACKUP::onRemoveDielUI( wxUpdateUIEvent& event ) if( item->GetSublayersCount() > 1 ) { - m_buttonRemoveDielectricLayer->Enable( true ); + event.Enable( true ); return; } } - m_buttonRemoveDielectricLayer->Enable( false ); + event.Enable( false ); } @@ -337,8 +337,9 @@ void PANEL_SETUP_BOARD_STACKUP::onUpdateThicknessValue( wxUpdateUIEvent& event ) wxString thicknessStr = StringFromValue( m_units, thickness, true ); - if( m_tcCTValue->GetValue() != thicknessStr ) - m_tcCTValue->SetValue( thicknessStr ); + // The text in the event will translate to the value for the text control + // and is only updated if it changed + event.SetText( thicknessStr ); }