From 25389014cffc83a570a0348de6d91788e4bc7013 Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Thu, 24 Oct 2024 10:26:53 +0200 Subject: [PATCH 1/5] Fixed Legend position option in the Line graph > slope option --- instat/dlgLinePlot.designer.vb | 14 ++++++++++++++ instat/dlgLinePlot.vb | 22 ++++++++++++++++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/instat/dlgLinePlot.designer.vb b/instat/dlgLinePlot.designer.vb index 855b50854a0..8da1ac0ce88 100644 --- a/instat/dlgLinePlot.designer.vb +++ b/instat/dlgLinePlot.designer.vb @@ -148,6 +148,7 @@ Partial Class dlgLinePlot Me.ucrInputLegendPosition = New instat.ucrInputComboBox() Me.ucrChkLegend = New instat.ucrCheck() Me.ucrChkAddLineLineRange = New instat.ucrCheck() + Me.ucrInputSlopeLegendPosition = New instat.ucrInputComboBox() Me.grpSmoothOptions.SuspendLayout() Me.contextMenuStripOptions.SuspendLayout() Me.SuspendLayout() @@ -1313,11 +1314,23 @@ Partial Class dlgLinePlot Me.ucrChkAddLineLineRange.Size = New System.Drawing.Size(77, 24) Me.ucrChkAddLineLineRange.TabIndex = 84 ' + 'ucrInputSlopeLegendPosition + ' + Me.ucrInputSlopeLegendPosition.AddQuotesIfUnrecognised = True + Me.ucrInputSlopeLegendPosition.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrInputSlopeLegendPosition.GetSetSelectedIndex = -1 + Me.ucrInputSlopeLegendPosition.IsReadOnly = False + Me.ucrInputSlopeLegendPosition.Location = New System.Drawing.Point(91, 287) + Me.ucrInputSlopeLegendPosition.Name = "ucrInputSlopeLegendPosition" + Me.ucrInputSlopeLegendPosition.Size = New System.Drawing.Size(112, 21) + Me.ucrInputSlopeLegendPosition.TabIndex = 85 + ' 'dlgLinePlot ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.ClientSize = New System.Drawing.Size(423, 563) + Me.Controls.Add(Me.ucrInputSlopeLegendPosition) Me.Controls.Add(Me.ucrChkAddLineLineRange) Me.Controls.Add(Me.ucrInputStation) Me.Controls.Add(Me.ucr1stFactorReceiver) @@ -1527,4 +1540,5 @@ Partial Class dlgLinePlot Friend WithEvents ucrInputLegendPosition As ucrInputComboBox Friend WithEvents ucrChkLegend As ucrCheck Friend WithEvents ucrChkAddLineLineRange As ucrCheck + Friend WithEvents ucrInputSlopeLegendPosition As ucrInputComboBox End Class diff --git a/instat/dlgLinePlot.vb b/instat/dlgLinePlot.vb index 68609714cc8..06cbac27556 100644 --- a/instat/dlgLinePlot.vb +++ b/instat/dlgLinePlot.vb @@ -105,6 +105,7 @@ Public Class dlgLinePlot Dim dctColourOptions As New Dictionary(Of String, String) Dim dctSlopeLineColourOptions As New Dictionary(Of String, String) Dim dctLegendPosition As New Dictionary(Of String, String) + Dim dctSlopePosition As New Dictionary(Of String, String) ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False ucrBase.clsRsyntax.iCallType = 3 @@ -394,8 +395,17 @@ Public Class dlgLinePlot ucrChkSlopeLineOptions.AddParameterPresentCondition(False, "line_colour", False) ucrChkSlopeLegend.SetText("Legend") - ucrChkSlopeLegend.AddParameterPresentCondition(True, "slopetheme") - ucrChkSlopeLegend.AddParameterPresentCondition(False, "slopetheme", False) + ucrChkSlopeLegend.AddToLinkedControls({ucrInputSlopeLegendPosition}, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="None") + ucrInputSlopeLegendPosition.SetDropDownStyleAsNonEditable() + ucrInputSlopeLegendPosition.SetParameter(New RParameter("legend.position")) + dctSlopePosition.Add("None", Chr(34) & "none" & Chr(34)) + dctSlopePosition.Add("Left", Chr(34) & "left" & Chr(34)) + dctSlopePosition.Add("Right", Chr(34) & "right" & Chr(34)) + dctSlopePosition.Add("Top", Chr(34) & "top" & Chr(34)) + dctSlopePosition.Add("Bottom", Chr(34) & "bottom" & Chr(34)) + ucrInputSlopeLegendPosition.SetItems(dctSlopePosition) + ucrChkSlopeLegend.AddParameterPresentCondition(True, "legend.position") + ucrChkSlopeLegend.AddParameterPresentCondition(False, "legend.position", False) ucrChkLegend.SetText("Legend:") ucrChkLegend.AddToLinkedControls({ucrInputLegendPosition}, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="None") @@ -669,6 +679,7 @@ Public Class dlgLinePlot ucrChkSlopeLineOptions.SetRCode(clsGgSlopeFunction, bReset) ucrChkLegend.SetRCode(clsThemeFunction, bReset, bCloneIfNeeded:=True) ucrInputLegendPosition.SetRCode(clsThemeFunction, bReset, bCloneIfNeeded:=True) + ucrInputSlopeLegendPosition.SetRCode(clsThemeFunction, bReset, bCloneIfNeeded:=True) If bReset Then ucrInputMethod.SetRCode(clsGeomSmoothFunction, bReset) ucrChkRibbon.SetRCode(clsBaseOperator, bReset) @@ -861,6 +872,7 @@ Public Class dlgLinePlot AddRemoveTheme() End Sub + Private Sub cmdOptions_Click(sender As Object, e As EventArgs) Handles cmdOptions.Click, PlotOptionsToolStripMenuItem.Click sdgPlots.SetRCode(clsNewOperator:=ucrBase.clsRsyntax.clsBaseOperator, clsNewYScalecontinuousFunction:=clsYScalecontinuousFunction, clsNewXScalecontinuousFunction:=clsXScalecontinuousFunction, clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, clsNewFacetFunction:=clsRFacetFunction, @@ -1195,6 +1207,8 @@ Public Class dlgLinePlot Private Sub AddRemoveSlopeGraph() If rdoSlope.Checked Then + ucrChkLegend.Enabled = False + ucrInputLegendPosition.Enabled = False If ucrChkSlopeLegend.Checked Then clsBaseOperator.RemoveParameterByName("slopetheme") Else @@ -1278,4 +1292,8 @@ Public Class dlgLinePlot Private Sub ucrChkAddLineLineRange_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkAddLineLineRange.ControlValueChanged AddRemoveLineOnLineRange() End Sub + + Private Sub AllControl_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrVariablesAsFactorForLinePlot.ControlContentsChanged, ucrSave.ControlContentsChanged, ucrReceiverYMin.ControlContentsChanged, ucrReceiverYMax.ControlContentsChanged, ucrReceiverXEnd.ControlContentsChanged, ucrReceiverX.ControlContentsChanged, ucrReceiverSlopeY.ControlContentsChanged, ucrReceiverSlopeX.ControlContentsChanged, ucrReceiverSlopeColour.ControlContentsChanged, ucrFactorOptionalReceiver.ControlContentsChanged + + End Sub End Class \ No newline at end of file From 15beb726253583819a0bd952d09d59e1258f4e5d Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Thu, 24 Oct 2024 15:54:20 +0200 Subject: [PATCH 2/5] Making the General legend position option work for all options --- instat/dlgLinePlot.designer.vb | 26 -------------------- instat/dlgLinePlot.vb | 44 ++++++++-------------------------- 2 files changed, 10 insertions(+), 60 deletions(-) diff --git a/instat/dlgLinePlot.designer.vb b/instat/dlgLinePlot.designer.vb index 8da1ac0ce88..da5c5ae0b69 100644 --- a/instat/dlgLinePlot.designer.vb +++ b/instat/dlgLinePlot.designer.vb @@ -104,7 +104,6 @@ Partial Class dlgLinePlot Me.ucrReceiverYMin = New instat.ucrReceiverSingle() Me.ucrReceiverYMax = New instat.ucrReceiverSingle() Me.cmdOptions = New instat.ucrSplitButton() - Me.ucrChkSlopeLegend = New instat.ucrCheck() Me.ucrInputSlopeLineColour = New instat.ucrInputComboBox() Me.ucrInputSlopeTextColour = New instat.ucrInputComboBox() Me.ucrNudSlopeTextSize = New instat.ucrNud() @@ -148,7 +147,6 @@ Partial Class dlgLinePlot Me.ucrInputLegendPosition = New instat.ucrInputComboBox() Me.ucrChkLegend = New instat.ucrCheck() Me.ucrChkAddLineLineRange = New instat.ucrCheck() - Me.ucrInputSlopeLegendPosition = New instat.ucrInputComboBox() Me.grpSmoothOptions.SuspendLayout() Me.contextMenuStripOptions.SuspendLayout() Me.SuspendLayout() @@ -836,15 +834,6 @@ Partial Class dlgLinePlot Me.cmdOptions.Text = "Plot Options" Me.cmdOptions.UseVisualStyleBackColor = True ' - 'ucrChkSlopeLegend - ' - Me.ucrChkSlopeLegend.AutoSize = True - Me.ucrChkSlopeLegend.Checked = False - Me.ucrChkSlopeLegend.Location = New System.Drawing.Point(9, 292) - Me.ucrChkSlopeLegend.Name = "ucrChkSlopeLegend" - Me.ucrChkSlopeLegend.Size = New System.Drawing.Size(80, 24) - Me.ucrChkSlopeLegend.TabIndex = 21 - ' 'ucrInputSlopeLineColour ' Me.ucrInputSlopeLineColour.AddQuotesIfUnrecognised = True @@ -1314,23 +1303,11 @@ Partial Class dlgLinePlot Me.ucrChkAddLineLineRange.Size = New System.Drawing.Size(77, 24) Me.ucrChkAddLineLineRange.TabIndex = 84 ' - 'ucrInputSlopeLegendPosition - ' - Me.ucrInputSlopeLegendPosition.AddQuotesIfUnrecognised = True - Me.ucrInputSlopeLegendPosition.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrInputSlopeLegendPosition.GetSetSelectedIndex = -1 - Me.ucrInputSlopeLegendPosition.IsReadOnly = False - Me.ucrInputSlopeLegendPosition.Location = New System.Drawing.Point(91, 287) - Me.ucrInputSlopeLegendPosition.Name = "ucrInputSlopeLegendPosition" - Me.ucrInputSlopeLegendPosition.Size = New System.Drawing.Size(112, 21) - Me.ucrInputSlopeLegendPosition.TabIndex = 85 - ' 'dlgLinePlot ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.ClientSize = New System.Drawing.Size(423, 563) - Me.Controls.Add(Me.ucrInputSlopeLegendPosition) Me.Controls.Add(Me.ucrChkAddLineLineRange) Me.Controls.Add(Me.ucrInputStation) Me.Controls.Add(Me.ucr1stFactorReceiver) @@ -1350,7 +1327,6 @@ Partial Class dlgLinePlot Me.Controls.Add(Me.ucrReceiverYMax) Me.Controls.Add(Me.rdoLinerange) Me.Controls.Add(Me.cmdOptions) - Me.Controls.Add(Me.ucrChkSlopeLegend) Me.Controls.Add(Me.lblSlopeLineColour) Me.Controls.Add(Me.lblSlopeLabelSize) Me.Controls.Add(Me.lblSlopeLabelPadding) @@ -1484,7 +1460,6 @@ Partial Class dlgLinePlot Friend WithEvents ucrNudDumbbellX As ucrNud Friend WithEvents ucrChkDumbbellColour As ucrCheck Friend WithEvents ucrChkDumbbellSize As ucrCheck - Friend WithEvents ucrChkSlopeLegend As ucrCheck Friend WithEvents ucrNudSlopeLabelPadding As ucrNud Friend WithEvents lblSlopeLineTicknes As Label Friend WithEvents ucrNudSlopeLineThickness As ucrNud @@ -1540,5 +1515,4 @@ Partial Class dlgLinePlot Friend WithEvents ucrInputLegendPosition As ucrInputComboBox Friend WithEvents ucrChkLegend As ucrCheck Friend WithEvents ucrChkAddLineLineRange As ucrCheck - Friend WithEvents ucrInputSlopeLegendPosition As ucrInputComboBox End Class diff --git a/instat/dlgLinePlot.vb b/instat/dlgLinePlot.vb index 06cbac27556..80f5c656116 100644 --- a/instat/dlgLinePlot.vb +++ b/instat/dlgLinePlot.vb @@ -394,18 +394,6 @@ Public Class dlgLinePlot ucrChkSlopeLineOptions.AddParameterPresentCondition(True, "line_colour") ucrChkSlopeLineOptions.AddParameterPresentCondition(False, "line_colour", False) - ucrChkSlopeLegend.SetText("Legend") - ucrChkSlopeLegend.AddToLinkedControls({ucrInputSlopeLegendPosition}, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="None") - ucrInputSlopeLegendPosition.SetDropDownStyleAsNonEditable() - ucrInputSlopeLegendPosition.SetParameter(New RParameter("legend.position")) - dctSlopePosition.Add("None", Chr(34) & "none" & Chr(34)) - dctSlopePosition.Add("Left", Chr(34) & "left" & Chr(34)) - dctSlopePosition.Add("Right", Chr(34) & "right" & Chr(34)) - dctSlopePosition.Add("Top", Chr(34) & "top" & Chr(34)) - dctSlopePosition.Add("Bottom", Chr(34) & "bottom" & Chr(34)) - ucrInputSlopeLegendPosition.SetItems(dctSlopePosition) - ucrChkSlopeLegend.AddParameterPresentCondition(True, "legend.position") - ucrChkSlopeLegend.AddParameterPresentCondition(False, "legend.position", False) ucrChkLegend.SetText("Legend:") ucrChkLegend.AddToLinkedControls({ucrInputLegendPosition}, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="None") @@ -443,7 +431,7 @@ Public Class dlgLinePlot ucrPnlOptions.AddToLinkedControls({ucrReceiverSlopeY}, {rdoDumbbell, rdoSlope, rdoLinerange}, bNewLinkedHideIfParameterMissing:=True) ucrPnlOptions.AddToLinkedControls({ucrReceiverX}, {rdoLine, rdoDumbbell, rdoSmoothing, rdoLinerange}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrPnlOptions.AddToLinkedControls({ucrVariablesAsFactorForLinePlot}, {rdoLine, rdoSmoothing}, bNewLinkedHideIfParameterMissing:=True) - ucrPnlOptions.AddToLinkedControls({ucrReceiverSlopeX, ucrReceiverSlopeColour, ucrChkSlopeLabelOptions, ucrChkSlopeTextOptions, ucrChkSlopeLineOptions, ucrChkSlopeLegend}, {rdoSlope}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlOptions.AddToLinkedControls({ucrReceiverSlopeX, ucrReceiverSlopeColour, ucrChkSlopeLabelOptions, ucrChkSlopeTextOptions, ucrChkSlopeLineOptions}, {rdoSlope}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrPnlOptions.AddToLinkedControls({ucrReceiverYMax, ucrChkAddLineLineRange, ucrReceiverYMin, ucrChkRibbon}, {rdoLinerange}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrChkDumbbellColour.AddToLinkedControls({ucrInputDumbbellX}, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedUpdateFunction:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="Orange") ucrChkDumbbellColour.AddToLinkedControls({ucrInputDumbbellXEnd}, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedUpdateFunction:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="Blue") @@ -679,7 +667,7 @@ Public Class dlgLinePlot ucrChkSlopeLineOptions.SetRCode(clsGgSlopeFunction, bReset) ucrChkLegend.SetRCode(clsThemeFunction, bReset, bCloneIfNeeded:=True) ucrInputLegendPosition.SetRCode(clsThemeFunction, bReset, bCloneIfNeeded:=True) - ucrInputSlopeLegendPosition.SetRCode(clsThemeFunction, bReset, bCloneIfNeeded:=True) + 'ucrInputSlopeLegendPosition.SetRCode(clsThemeFunction, bReset, bCloneIfNeeded:=True) If bReset Then ucrInputMethod.SetRCode(clsGeomSmoothFunction, bReset) ucrChkRibbon.SetRCode(clsBaseOperator, bReset) @@ -812,7 +800,6 @@ Public Class dlgLinePlot AddRemoveFormula() AddRemoveGeomLine() AddRemoveLineRange() - AddRemoveSlopeGraph() AddRemoveMethodArgs() AddRemoveLine() AddRemoveSE() @@ -869,7 +856,14 @@ Public Class dlgLinePlot End Sub Private Sub ucrChkLegend_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkLegend.ControlValueChanged, ucrInputLegendPosition.ControlValueChanged - AddRemoveTheme() + If rdoSlope.Checked Then + clsBaseOperator.AddParameter("theme", clsRFunctionParameter:=clsThemeFunction, iPosition:=-1) + clsThemeFunction.AddParameter("legend.position", Chr(34) & ucrInputLegendPosition.GetValueToSet & Chr(34), iPosition:=1) + clsBaseOperator.RemoveParameterByName("c") + Else + AddRemoveTheme() + clsBaseOperator.RemoveParameterByName("slopetheme") + End If End Sub @@ -1205,24 +1199,6 @@ Public Class dlgLinePlot AddRemoveLineRange() End Sub - Private Sub AddRemoveSlopeGraph() - If rdoSlope.Checked Then - ucrChkLegend.Enabled = False - ucrInputLegendPosition.Enabled = False - If ucrChkSlopeLegend.Checked Then - clsBaseOperator.RemoveParameterByName("slopetheme") - Else - clsBaseOperator.AddParameter("slopetheme", clsRFunctionParameter:=clsSlopeThemeFunction, iPosition:=-1) - End If - Else - clsBaseOperator.RemoveParameterByName("slopetheme") - End If - End Sub - - Private Sub ucrChkSlopeLegend_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkSlopeLegend.ControlValueChanged - AddRemoveSlopeGraph() - End Sub - Private Sub AddRemoveLine() If rdoSmoothing.Checked Then If ucrChkAddLine.Checked Then From d34e167be23f3828e34b1703ac03668dccf7e3dd Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Thu, 24 Oct 2024 15:56:12 +0200 Subject: [PATCH 3/5] Removing unnecessary code --- instat/dlgLinePlot.vb | 2 -- 1 file changed, 2 deletions(-) diff --git a/instat/dlgLinePlot.vb b/instat/dlgLinePlot.vb index 80f5c656116..1c9db1c32c2 100644 --- a/instat/dlgLinePlot.vb +++ b/instat/dlgLinePlot.vb @@ -394,7 +394,6 @@ Public Class dlgLinePlot ucrChkSlopeLineOptions.AddParameterPresentCondition(True, "line_colour") ucrChkSlopeLineOptions.AddParameterPresentCondition(False, "line_colour", False) - ucrChkLegend.SetText("Legend:") ucrChkLegend.AddToLinkedControls({ucrInputLegendPosition}, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="None") ucrInputLegendPosition.SetDropDownStyleAsNonEditable() @@ -667,7 +666,6 @@ Public Class dlgLinePlot ucrChkSlopeLineOptions.SetRCode(clsGgSlopeFunction, bReset) ucrChkLegend.SetRCode(clsThemeFunction, bReset, bCloneIfNeeded:=True) ucrInputLegendPosition.SetRCode(clsThemeFunction, bReset, bCloneIfNeeded:=True) - 'ucrInputSlopeLegendPosition.SetRCode(clsThemeFunction, bReset, bCloneIfNeeded:=True) If bReset Then ucrInputMethod.SetRCode(clsGeomSmoothFunction, bReset) ucrChkRibbon.SetRCode(clsBaseOperator, bReset) From 5fbbe54e0070f88b1cb08496bf4c976fb71a889b Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Mon, 28 Oct 2024 09:47:45 +0100 Subject: [PATCH 4/5] Fixed possible regression --- instat/dlgLinePlot.vb | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/instat/dlgLinePlot.vb b/instat/dlgLinePlot.vb index 1c9db1c32c2..5444c36a299 100644 --- a/instat/dlgLinePlot.vb +++ b/instat/dlgLinePlot.vb @@ -664,8 +664,7 @@ Public Class dlgLinePlot ucrChkSlopeLabelOptions.SetRCode(clsGgSlopeFunction, bReset) ucrChkSlopeTextOptions.SetRCode(clsGgSlopeFunction, bReset) ucrChkSlopeLineOptions.SetRCode(clsGgSlopeFunction, bReset) - ucrChkLegend.SetRCode(clsThemeFunction, bReset, bCloneIfNeeded:=True) - ucrInputLegendPosition.SetRCode(clsThemeFunction, bReset, bCloneIfNeeded:=True) + If bReset Then ucrInputMethod.SetRCode(clsGeomSmoothFunction, bReset) ucrChkRibbon.SetRCode(clsBaseOperator, bReset) @@ -675,6 +674,8 @@ Public Class dlgLinePlot ucrChkAddLineLineRange.SetRCode(clsBaseOperator, bReset) ucrChkAddLine.SetRCode(clsBaseOperator, bReset) ucrChkSpan.SetRCode(clsGeomSmoothFunction, bReset) + ucrChkLegend.SetRCode(clsThemeFunction, bReset, bCloneIfNeeded:=True) + ucrInputLegendPosition.SetRCode(clsThemeFunction, bReset, bCloneIfNeeded:=True) End If SetGroupParam() End Sub @@ -855,12 +856,17 @@ Public Class dlgLinePlot Private Sub ucrChkLegend_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkLegend.ControlValueChanged, ucrInputLegendPosition.ControlValueChanged If rdoSlope.Checked Then - clsBaseOperator.AddParameter("theme", clsRFunctionParameter:=clsThemeFunction, iPosition:=-1) - clsThemeFunction.AddParameter("legend.position", Chr(34) & ucrInputLegendPosition.GetValueToSet & Chr(34), iPosition:=1) - clsBaseOperator.RemoveParameterByName("c") - Else + If ucrChkLegend.Checked Then + clsBaseOperator.AddParameter("theme", clsRFunctionParameter:=clsThemeFunction, iPosition:=-1) + clsThemeFunction.AddParameter("legend.position", Chr(34) & ucrInputLegendPosition.GetValueToSet & Chr(34), iPosition:=1) + clsBaseOperator.RemoveParameterByName("c") + Else + clsBaseOperator.RemoveParameterByName("theme") + clsBaseOperator.RemoveParameterByName("slopetheme") + End If + End If + If rdoLine.Checked AndAlso rdoLinerange.Checked AndAlso rdoSmoothing.Checked AndAlso rdoDumbbell.Checked Then AddRemoveTheme() - clsBaseOperator.RemoveParameterByName("slopetheme") End If End Sub From 77ed5873781e716f45600407f0ff35b50ea52bbf Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Thu, 31 Oct 2024 09:20:44 +0100 Subject: [PATCH 5/5] Minor Code Changes --- instat/dlgLinePlot.vb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/instat/dlgLinePlot.vb b/instat/dlgLinePlot.vb index 5444c36a299..81389c9c753 100644 --- a/instat/dlgLinePlot.vb +++ b/instat/dlgLinePlot.vb @@ -865,7 +865,7 @@ Public Class dlgLinePlot clsBaseOperator.RemoveParameterByName("slopetheme") End If End If - If rdoLine.Checked AndAlso rdoLinerange.Checked AndAlso rdoSmoothing.Checked AndAlso rdoDumbbell.Checked Then + If rdoLine.Checked OrElse rdoLinerange.Checked OrElse rdoSmoothing.Checked OrElse rdoDumbbell.Checked Then AddRemoveTheme() End If End Sub @@ -1273,7 +1273,4 @@ Public Class dlgLinePlot AddRemoveLineOnLineRange() End Sub - Private Sub AllControl_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrVariablesAsFactorForLinePlot.ControlContentsChanged, ucrSave.ControlContentsChanged, ucrReceiverYMin.ControlContentsChanged, ucrReceiverYMax.ControlContentsChanged, ucrReceiverXEnd.ControlContentsChanged, ucrReceiverX.ControlContentsChanged, ucrReceiverSlopeY.ControlContentsChanged, ucrReceiverSlopeX.ControlContentsChanged, ucrReceiverSlopeColour.ControlContentsChanged, ucrFactorOptionalReceiver.ControlContentsChanged - - End Sub End Class \ No newline at end of file