From 842f659997b6943a3e506e6be99fa62548544253 Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Fri, 16 Feb 2024 12:44:01 +0100 Subject: [PATCH] Minor Change --- instat/dlgGeneralForGraphics.vb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/instat/dlgGeneralForGraphics.vb b/instat/dlgGeneralForGraphics.vb index 0efb0d1a226..04112a21464 100644 --- a/instat/dlgGeneralForGraphics.vb +++ b/instat/dlgGeneralForGraphics.vb @@ -273,7 +273,11 @@ Public Class dlgGeneralForGraphics End Sub Private Sub SetCalculationHistory() - ucrInputAddCode.AddItems({ucrInputAddCode.GetText()}) + Dim newItem As String = ucrInputAddCode.GetText().Trim() + + If Not String.IsNullOrEmpty(newItem) AndAlso Not ucrInputAddCode.cboInput.Items.Contains(newItem) Then + ucrInputAddCode.AddItems({newItem}) + End If End Sub Private Sub SetRCodeForControls(bReset As Boolean) @@ -301,10 +305,6 @@ Public Class dlgGeneralForGraphics TestOKEnabled() End Sub - Private Sub ucrBase_ClickOk(sender As Object, e As EventArgs) Handles ucrBase.ClickOk - SetCalculationHistory() - End Sub - Private Sub TestOKEnabled() If Not ucrSave.IsComplete OrElse (ucrReceiverX.IsEmpty AndAlso ucrReceiverY.IsEmpty) Then ucrBase.OKEnabled(False) @@ -802,6 +802,7 @@ Public Class dlgGeneralForGraphics End Sub Private Sub ucrChkAddCode_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkAddCode.ControlValueChanged, ucrInputAddCode.ControlValueChanged + SetCalculationHistory() If ucrChkAddCode.Checked AndAlso Not ucrInputAddCode.IsEmpty Then clsAddCodeOperator.AddParameter("code1", ucrInputAddCode.GetText(), bIncludeArgumentName:=False, iPosition:=1) clsBaseOperator.AddParameter("newcode", clsROperatorParameter:=clsAddCodeOperator, bIncludeArgumentName:=False)