diff --git a/instat/dlgLinePlot.designer.vb b/instat/dlgLinePlot.designer.vb index 855b50854a..da5c5ae0b6 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() @@ -835,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 @@ -1337,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) @@ -1471,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 diff --git a/instat/dlgLinePlot.vb b/instat/dlgLinePlot.vb index 68609714cc..81389c9c75 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 @@ -393,10 +394,6 @@ Public Class dlgLinePlot ucrChkSlopeLineOptions.AddParameterPresentCondition(True, "line_colour") ucrChkSlopeLineOptions.AddParameterPresentCondition(False, "line_colour", False) - ucrChkSlopeLegend.SetText("Legend") - ucrChkSlopeLegend.AddParameterPresentCondition(True, "slopetheme") - ucrChkSlopeLegend.AddParameterPresentCondition(False, "slopetheme", False) - ucrChkLegend.SetText("Legend:") ucrChkLegend.AddToLinkedControls({ucrInputLegendPosition}, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="None") ucrInputLegendPosition.SetDropDownStyleAsNonEditable() @@ -433,7 +430,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") @@ -667,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) @@ -678,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 @@ -801,7 +799,6 @@ Public Class dlgLinePlot AddRemoveFormula() AddRemoveGeomLine() AddRemoveLineRange() - AddRemoveSlopeGraph() AddRemoveMethodArgs() AddRemoveLine() AddRemoveSE() @@ -858,9 +855,22 @@ Public Class dlgLinePlot End Sub Private Sub ucrChkLegend_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkLegend.ControlValueChanged, ucrInputLegendPosition.ControlValueChanged - AddRemoveTheme() + If rdoSlope.Checked Then + 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 OrElse rdoLinerange.Checked OrElse rdoSmoothing.Checked OrElse rdoDumbbell.Checked Then + AddRemoveTheme() + End If 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, @@ -1193,22 +1203,6 @@ Public Class dlgLinePlot AddRemoveLineRange() End Sub - Private Sub AddRemoveSlopeGraph() - If rdoSlope.Checked Then - 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 @@ -1278,4 +1272,5 @@ Public Class dlgLinePlot Private Sub ucrChkAddLineLineRange_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkAddLineLineRange.ControlValueChanged AddRemoveLineOnLineRange() End Sub + End Class \ No newline at end of file