diff --git a/instat/dlgGeneralForGraphics.Designer.vb b/instat/dlgGeneralForGraphics.Designer.vb index 83bc3139f89..a175bff8c64 100644 --- a/instat/dlgGeneralForGraphics.Designer.vb +++ b/instat/dlgGeneralForGraphics.Designer.vb @@ -491,7 +491,7 @@ Partial Class dlgGeneralForGraphics Me.ucrInputAddCode.IsReadOnly = False Me.ucrInputAddCode.Location = New System.Drawing.Point(159, 362) Me.ucrInputAddCode.Name = "ucrInputAddCode" - Me.ucrInputAddCode.Size = New System.Drawing.Size(267, 21) + Me.ucrInputAddCode.Size = New System.Drawing.Size(316, 21) Me.ucrInputAddCode.TabIndex = 218 ' 'ucrChkAddCode diff --git a/instat/dlgGeneralForGraphics.vb b/instat/dlgGeneralForGraphics.vb index 3db68c1e86d..04112a21464 100644 --- a/instat/dlgGeneralForGraphics.vb +++ b/instat/dlgGeneralForGraphics.vb @@ -167,7 +167,7 @@ Public Class dlgGeneralForGraphics ucrChkAddCode.SetText("Add Code:") ucrChkAddCode.AddToLinkedControls({ucrInputAddCode}, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="") - ucrInputAddCode.SetItems({"geom_hline(yintercept=20)", "geom_vline(xintercept = 5)", "geom_vline(xintercept = 5)", "scale_x_binned()", "scale_x_binned(n.breaks=20)"}) + ucrInputAddCode.SetItems({"scale_colour_manual(values=c(" & Chr(34) & "red" & Chr(34) & "," & Chr(34) & "blue" & Chr(34) & "," & Chr(34) & "green" & Chr(34) & "," & Chr(34) & "black" & Chr(34) & "," & Chr(34) & "brown" & Chr(34) & "))", "scale_fill_manual(values = c(" & Chr(34) & "coral" & Chr(34) & "," & Chr(34) & "bisque4" & Chr(34) & "," & Chr(34) & "gold" & Chr(34) & "," & Chr(34) & "cyan" & Chr(34) & "," & Chr(34) & "khaki" & Chr(34) & "," & Chr(34) & "orange" & Chr(34) & "," & Chr(34) & "orchid" & Chr(34) & "))", "geom_hline(yintercept=20)", "geom_vline(xintercept=5) + geom_hline(yintercept = 1)", "geom_vline(xintercept=c(1,3,5),colour=" & Chr(34) & "green" & Chr(34) & ")", "scale_x_binned()", "scale_x_binned(n.breaks=20)", "scale_y_continuous(trans=" & Chr(34) & "log10" & Chr(34) & ", label=scales::dollar)"}) ucrSave.SetPrefix("graph") ucrSave.SetIsComboBox() @@ -272,6 +272,14 @@ Public Class dlgGeneralForGraphics TestOKEnabled() End Sub + Private Sub SetCalculationHistory() + 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) ucrReceiverX.AddAdditionalCodeParameterPair(clsLevelsFunction, New RParameter("y", ucrReceiverX.GetVariableNames(False), bNewIncludeArgumentName:=False), iAdditionalPairNo:=1) ucrGraphicsSelector.SetRCode(clsGgplotFunction, bReset) @@ -670,7 +678,7 @@ Public Class dlgGeneralForGraphics End Sub Private Sub UpdateParameters() - clsFacetVariablesOperator.RemoveParameterByName("wrap" & ucrInputStation.Name) + clsFacetVariablesOperator.RemoveParameterByName("var1") clsFacetColOp.RemoveParameterByName("col" & ucrInputStation.Name) clsFacetRowOp.RemoveParameterByName("row" & ucrInputStation.Name) @@ -794,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)