diff --git a/instat/dlgScript.Designer.vb b/instat/dlgScript.Designer.vb index 8df12cb676..52f3f0312d 100644 --- a/instat/dlgScript.Designer.vb +++ b/instat/dlgScript.Designer.vb @@ -100,6 +100,21 @@ Partial Class dlgScript Me.lblSelectColumns = New System.Windows.Forms.Label() Me.ucrReceiverRank = New instat.ucrReceiverSingle() Me.ucrSelectorForRank = New instat.ucrSelectorByDataFrameAddRemove() + Me.tbGraphs = New System.Windows.Forms.TabPage() + Me.ucrChkLabel = New instat.ucrCheck() + Me.ucrChkText = New instat.ucrCheck() + Me.ucrCboInputYSide = New instat.ucrInputComboBox() + Me.ucrCboInputXSide = New instat.ucrInputComboBox() + Me.ucrReceiverTextPath = New instat.ucrReceiverSingle() + Me.rdoTextPath = New System.Windows.Forms.RadioButton() + Me.lblText = New System.Windows.Forms.Label() + Me.ucrCboInputText = New instat.ucrInputComboBox() + Me.ucrCboInputlabel = New instat.ucrInputComboBox() + Me.ucrSelectorTextPath = New instat.ucrSelectorByDataFrameAddRemove() + Me.rdoSidePlot = New System.Windows.Forms.RadioButton() + Me.ucrChkYSide = New instat.ucrCheck() + Me.ucrChkXSide = New instat.ucrCheck() + Me.ucrPnlGraph = New instat.UcrPanel() Me.lblPreview = New System.Windows.Forms.Label() Me.txtScript = New System.Windows.Forms.TextBox() Me.ucrBase = New instat.ucrButtons() @@ -109,6 +124,7 @@ Partial Class dlgScript Me.tbPageCommand.SuspendLayout() Me.tbPageExamples.SuspendLayout() Me.tbPageRepeat.SuspendLayout() + Me.tbGraphs.SuspendLayout() Me.SuspendLayout() ' 'tbFeatures @@ -118,6 +134,7 @@ Partial Class dlgScript Me.tbFeatures.Controls.Add(Me.tbPageCommand) Me.tbFeatures.Controls.Add(Me.tbPageExamples) Me.tbFeatures.Controls.Add(Me.tbPageRepeat) + Me.tbFeatures.Controls.Add(Me.tbGraphs) Me.tbFeatures.Location = New System.Drawing.Point(8, 7) Me.tbFeatures.Name = "tbFeatures" Me.tbFeatures.SelectedIndex = 0 @@ -159,7 +176,7 @@ Partial Class dlgScript 'rdoFromRFile ' Me.rdoFromRFile.AutoSize = True - Me.rdoFromRFile.Location = New System.Drawing.Point(49, 202) + Me.rdoFromRFile.Location = New System.Drawing.Point(49, 206) Me.rdoFromRFile.Margin = New System.Windows.Forms.Padding(2) Me.rdoFromRFile.Name = "rdoFromRFile" Me.rdoFromRFile.Size = New System.Drawing.Size(81, 17) @@ -174,7 +191,7 @@ Partial Class dlgScript Me.ucrInputSaveRFile.AutoSize = True Me.ucrInputSaveRFile.IsMultiline = False Me.ucrInputSaveRFile.IsReadOnly = False - Me.ucrInputSaveRFile.Location = New System.Drawing.Point(67, 228) + Me.ucrInputSaveRFile.Location = New System.Drawing.Point(67, 231) Me.ucrInputSaveRFile.Margin = New System.Windows.Forms.Padding(9) Me.ucrInputSaveRFile.Name = "ucrInputSaveRFile" Me.ucrInputSaveRFile.Size = New System.Drawing.Size(145, 21) @@ -259,7 +276,7 @@ Partial Class dlgScript ' Me.ucrChkDisplayGraph.AutoSize = True Me.ucrChkDisplayGraph.Checked = False - Me.ucrChkDisplayGraph.Location = New System.Drawing.Point(88, 217) + Me.ucrChkDisplayGraph.Location = New System.Drawing.Point(88, 225) Me.ucrChkDisplayGraph.Margin = New System.Windows.Forms.Padding(6) Me.ucrChkDisplayGraph.Name = "ucrChkDisplayGraph" Me.ucrChkDisplayGraph.Size = New System.Drawing.Size(113, 34) @@ -1075,6 +1092,185 @@ Partial Class dlgScript Me.ucrSelectorForRank.Size = New System.Drawing.Size(318, 274) Me.ucrSelectorForRank.TabIndex = 9 ' + 'tbGraphs + ' + Me.tbGraphs.Controls.Add(Me.ucrCboInputText) + Me.tbGraphs.Controls.Add(Me.ucrCboInputlabel) + Me.tbGraphs.Controls.Add(Me.ucrChkLabel) + Me.tbGraphs.Controls.Add(Me.ucrChkText) + Me.tbGraphs.Controls.Add(Me.ucrCboInputYSide) + Me.tbGraphs.Controls.Add(Me.ucrCboInputXSide) + Me.tbGraphs.Controls.Add(Me.ucrReceiverTextPath) + Me.tbGraphs.Controls.Add(Me.rdoTextPath) + Me.tbGraphs.Controls.Add(Me.lblText) + Me.tbGraphs.Controls.Add(Me.ucrSelectorTextPath) + Me.tbGraphs.Controls.Add(Me.rdoSidePlot) + Me.tbGraphs.Controls.Add(Me.ucrChkYSide) + Me.tbGraphs.Controls.Add(Me.ucrChkXSide) + Me.tbGraphs.Controls.Add(Me.ucrPnlGraph) + Me.tbGraphs.Location = New System.Drawing.Point(4, 22) + Me.tbGraphs.Name = "tbGraphs" + Me.tbGraphs.Padding = New System.Windows.Forms.Padding(3) + Me.tbGraphs.Size = New System.Drawing.Size(438, 278) + Me.tbGraphs.TabIndex = 6 + Me.tbGraphs.Text = "Graphs" + Me.tbGraphs.UseVisualStyleBackColor = True + ' + 'ucrChkLabel + ' + Me.ucrChkLabel.AutoSize = True + Me.ucrChkLabel.Checked = False + Me.ucrChkLabel.Location = New System.Drawing.Point(225, 141) + Me.ucrChkLabel.Margin = New System.Windows.Forms.Padding(6) + Me.ucrChkLabel.Name = "ucrChkLabel" + Me.ucrChkLabel.Size = New System.Drawing.Size(98, 34) + Me.ucrChkLabel.TabIndex = 82 + ' + 'ucrChkText + ' + Me.ucrChkText.AutoSize = True + Me.ucrChkText.Checked = False + Me.ucrChkText.Location = New System.Drawing.Point(225, 102) + Me.ucrChkText.Margin = New System.Windows.Forms.Padding(6) + Me.ucrChkText.Name = "ucrChkText" + Me.ucrChkText.Size = New System.Drawing.Size(98, 34) + Me.ucrChkText.TabIndex = 81 + ' + 'ucrCboInputYSide + ' + Me.ucrCboInputYSide.AddQuotesIfUnrecognised = True + Me.ucrCboInputYSide.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboInputYSide.GetSetSelectedIndex = -1 + Me.ucrCboInputYSide.IsReadOnly = False + Me.ucrCboInputYSide.Location = New System.Drawing.Point(291, 238) + Me.ucrCboInputYSide.Margin = New System.Windows.Forms.Padding(9) + Me.ucrCboInputYSide.Name = "ucrCboInputYSide" + Me.ucrCboInputYSide.Size = New System.Drawing.Size(117, 21) + Me.ucrCboInputYSide.TabIndex = 73 + ' + 'ucrCboInputXSide + ' + Me.ucrCboInputXSide.AddQuotesIfUnrecognised = True + Me.ucrCboInputXSide.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboInputXSide.GetSetSelectedIndex = -1 + Me.ucrCboInputXSide.IsReadOnly = False + Me.ucrCboInputXSide.Location = New System.Drawing.Point(86, 238) + Me.ucrCboInputXSide.Margin = New System.Windows.Forms.Padding(9) + Me.ucrCboInputXSide.Name = "ucrCboInputXSide" + Me.ucrCboInputXSide.Size = New System.Drawing.Size(111, 21) + Me.ucrCboInputXSide.TabIndex = 72 + ' + 'ucrReceiverTextPath + ' + Me.ucrReceiverTextPath.AutoSize = True + Me.ucrReceiverTextPath.frmParent = Nothing + Me.ucrReceiverTextPath.Location = New System.Drawing.Point(287, 63) + Me.ucrReceiverTextPath.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverTextPath.Name = "ucrReceiverTextPath" + Me.ucrReceiverTextPath.Selector = Nothing + Me.ucrReceiverTextPath.Size = New System.Drawing.Size(145, 20) + Me.ucrReceiverTextPath.strNcFilePath = "" + Me.ucrReceiverTextPath.TabIndex = 80 + Me.ucrReceiverTextPath.ucrSelector = Nothing + ' + 'rdoTextPath + ' + Me.rdoTextPath.AutoSize = True + Me.rdoTextPath.Location = New System.Drawing.Point(5, 6) + Me.rdoTextPath.Margin = New System.Windows.Forms.Padding(2) + Me.rdoTextPath.Name = "rdoTextPath" + Me.rdoTextPath.Size = New System.Drawing.Size(98, 17) + Me.rdoTextPath.TabIndex = 77 + Me.rdoTextPath.TabStop = True + Me.rdoTextPath.Text = "Text on a Path:" + Me.rdoTextPath.UseVisualStyleBackColor = True + ' + 'lblText + ' + Me.lblText.AutoSize = True + Me.lblText.Location = New System.Drawing.Point(287, 43) + Me.lblText.Name = "lblText" + Me.lblText.Size = New System.Drawing.Size(36, 13) + Me.lblText.TabIndex = 70 + Me.lblText.Text = "Label:" + ' + 'ucrCboInputText + ' + Me.ucrCboInputText.AddQuotesIfUnrecognised = True + Me.ucrCboInputText.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboInputText.GetSetSelectedIndex = -1 + Me.ucrCboInputText.IsReadOnly = False + Me.ucrCboInputText.Location = New System.Drawing.Point(315, 102) + Me.ucrCboInputText.Margin = New System.Windows.Forms.Padding(9) + Me.ucrCboInputText.Name = "ucrCboInputText" + Me.ucrCboInputText.Size = New System.Drawing.Size(117, 21) + Me.ucrCboInputText.TabIndex = 60 + ' + 'ucrCboInputlabel + ' + Me.ucrCboInputlabel.AddQuotesIfUnrecognised = True + Me.ucrCboInputlabel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboInputlabel.GetSetSelectedIndex = -1 + Me.ucrCboInputlabel.IsReadOnly = False + Me.ucrCboInputlabel.Location = New System.Drawing.Point(315, 141) + Me.ucrCboInputlabel.Margin = New System.Windows.Forms.Padding(9) + Me.ucrCboInputlabel.Name = "ucrCboInputlabel" + Me.ucrCboInputlabel.Size = New System.Drawing.Size(117, 21) + Me.ucrCboInputlabel.TabIndex = 61 + ' + 'ucrSelectorTextPath + ' + Me.ucrSelectorTextPath.AutoSize = True + Me.ucrSelectorTextPath.bDropUnusedFilterLevels = False + Me.ucrSelectorTextPath.bShowHiddenColumns = False + Me.ucrSelectorTextPath.bUseCurrentFilter = True + Me.ucrSelectorTextPath.Location = New System.Drawing.Point(7, 23) + Me.ucrSelectorTextPath.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectorTextPath.Name = "ucrSelectorTextPath" + Me.ucrSelectorTextPath.Size = New System.Drawing.Size(213, 183) + Me.ucrSelectorTextPath.TabIndex = 79 + ' + 'rdoSidePlot + ' + Me.rdoSidePlot.AutoSize = True + Me.rdoSidePlot.Location = New System.Drawing.Point(9, 211) + Me.rdoSidePlot.Margin = New System.Windows.Forms.Padding(2) + Me.rdoSidePlot.Name = "rdoSidePlot" + Me.rdoSidePlot.Size = New System.Drawing.Size(70, 17) + Me.rdoSidePlot.TabIndex = 78 + Me.rdoSidePlot.TabStop = True + Me.rdoSidePlot.Text = "Side Plot:" + Me.rdoSidePlot.UseVisualStyleBackColor = True + ' + 'ucrChkYSide + ' + Me.ucrChkYSide.AutoSize = True + Me.ucrChkYSide.Checked = False + Me.ucrChkYSide.Location = New System.Drawing.Point(209, 238) + Me.ucrChkYSide.Margin = New System.Windows.Forms.Padding(6) + Me.ucrChkYSide.Name = "ucrChkYSide" + Me.ucrChkYSide.Size = New System.Drawing.Size(86, 34) + Me.ucrChkYSide.TabIndex = 75 + ' + 'ucrChkXSide + ' + Me.ucrChkXSide.AutoSize = True + Me.ucrChkXSide.Checked = False + Me.ucrChkXSide.Location = New System.Drawing.Point(8, 238) + Me.ucrChkXSide.Margin = New System.Windows.Forms.Padding(6) + Me.ucrChkXSide.Name = "ucrChkXSide" + Me.ucrChkXSide.Size = New System.Drawing.Size(81, 34) + Me.ucrChkXSide.TabIndex = 74 + ' + 'ucrPnlGraph + ' + Me.ucrPnlGraph.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlGraph.Location = New System.Drawing.Point(5, 6) + Me.ucrPnlGraph.Margin = New System.Windows.Forms.Padding(6) + Me.ucrPnlGraph.Name = "ucrPnlGraph" + Me.ucrPnlGraph.Size = New System.Drawing.Size(429, 272) + Me.ucrPnlGraph.TabIndex = 76 + ' 'lblPreview ' Me.lblPreview.AutoSize = True @@ -1131,6 +1327,8 @@ Partial Class dlgScript Me.tbPageExamples.PerformLayout() Me.tbPageRepeat.ResumeLayout(False) Me.tbPageRepeat.PerformLayout() + Me.tbGraphs.ResumeLayout(False) + Me.tbGraphs.PerformLayout() Me.ResumeLayout(False) Me.PerformLayout() @@ -1217,4 +1415,19 @@ Partial Class dlgScript Friend WithEvents lblExpression As Label Friend WithEvents lblColumns As Label Friend WithEvents ucrReceiverColumns As ucrReceiverSingle + Friend WithEvents tbGraphs As TabPage + Friend WithEvents ucrChkYSide As ucrCheck + Friend WithEvents ucrChkXSide As ucrCheck + Friend WithEvents ucrCboInputYSide As ucrInputComboBox + Friend WithEvents ucrCboInputXSide As ucrInputComboBox + Friend WithEvents lblText As Label + Friend WithEvents ucrCboInputlabel As ucrInputComboBox + Friend WithEvents ucrCboInputText As ucrInputComboBox + Friend WithEvents ucrPnlGraph As UcrPanel + Friend WithEvents rdoSidePlot As RadioButton + Friend WithEvents rdoTextPath As RadioButton + Friend WithEvents ucrSelectorTextPath As ucrSelectorByDataFrameAddRemove + Friend WithEvents ucrReceiverTextPath As ucrReceiverSingle + Friend WithEvents ucrChkLabel As ucrCheck + Friend WithEvents ucrChkText As ucrCheck End Class diff --git a/instat/dlgScript.vb b/instat/dlgScript.vb index 8604fd5f5c..9f98cd25ef 100644 --- a/instat/dlgScript.vb +++ b/instat/dlgScript.vb @@ -23,6 +23,10 @@ Public Class dlgScript Private clsGetRObjectFunction, clsGetSelectedDataFrameFunction As New RFunction Private dctOutputObjectTypes As New Dictionary(Of String, String) Private dctOutputObjectFormats As New Dictionary(Of String, String) + Private dctXSidePlot As New Dictionary(Of String, String) + Private dctYSidePlot As New Dictionary(Of String, String) + Private dctLabel As New Dictionary(Of String, String) + Private dctText As New Dictionary(Of String, String) Private Sub dlgScript_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstload Then @@ -56,6 +60,54 @@ Public Class dlgScript dctOutputObjectFormats.Add("Text", RObjectFormat.Text) dctOutputObjectFormats.Add("Html", RObjectFormat.Html) + dctText.Add("None ", " ") + dctText.Add("Textpath", "geomtextpath::geom_textpath") + dctText.Add("Textabline", "geomtextpath::geom_textabline") + dctText.Add("Textsegment", "geomtextpath::geom_textsegment") + dctText.Add("Textline", "geomtextpath::geom_textline") + dctText.Add("Texthline", "geomtextpath::geom_texthline") + dctText.Add("Textvline", "geomtextpath::geom_textvline") + dctText.Add("Textdensity", "geomtextpath::geom_textdensity") + dctText.Add("Textsmooth", "geomtextpath::geom_textsmooth") + dctText.Add("Textdensity2d", "geomtextpath::geom_textdensity2d") + dctText.Add("Textsf", "geomtextpath::geom_textsf") + + dctLabel.Add("None ", " ") + dctLabel.Add("labelpath", "geomtextpath::geom_labelpath") + dctLabel.Add("labelabline", "geomtextpath::geom_labelabline") + dctLabel.Add("labelsegment", "geomtextpath::geom_labelsegment") + dctLabel.Add("labelline", "geomtextpath::geom_labelline") + dctLabel.Add("labelhline", "geomtextpath::geom_labelhline") + dctLabel.Add("labelvline", "geomtextpath::geom_labelvline") + dctLabel.Add("labeldensity", "geomtextpath::geom_labeldensity") + dctLabel.Add("labelsmooth", "geomtextpath::geom_labelsmooth") + dctLabel.Add("labeldensity2d", "geomtextpath::geom_labeldensity2d") + dctLabel.Add("labelsf", "geomtextpath::geom_labelsf") + + dctXSidePlot.Add("None ", " ") + dctXSidePlot.Add("GeomBar", "ggside::geom_xsidebar()") + dctXSidePlot.Add("GeomBoxplot", "ggside::geom_xsideboxplot()") + dctXSidePlot.Add("GeomDensity", "ggside::geom_xsidedensity()") + dctXSidePlot.Add("GeomFreqpoly", "ggside::geom_xsidefreqpoly()") + dctXSidePlot.Add("GeomHistogram", "ggside::geom_xsidehistogram()") + dctXSidePlot.Add("GeomLine", "ggside::geom_xsideline()") + dctXSidePlot.Add("GeomPoint", "ggside::geom_xsidepoint()") + dctXSidePlot.Add("GeomText", "ggside::geom_xsidetext()") + dctXSidePlot.Add("GeomTile", "ggside::geom_xsidetile()") + dctXSidePlot.Add("GeomViolin", "ggside::geom_xsideviolin()") + + dctYSidePlot.Add("None ", " ") + dctYSidePlot.Add("GeomBar", "ggside::geom_ysidebar()") + dctYSidePlot.Add("GeomBoxplot", "ggside::geom_ysideboxplot()") + dctYSidePlot.Add("GeomDensity", "ggside::geom_ysidedensity()") + dctYSidePlot.Add("GeomFreqpoly", "ggside::geom_ysidefreqpoly()") + dctYSidePlot.Add("GeomHistogram", "ggside::geom_ysidehistogram()") + dctYSidePlot.Add("GeomLine", "ggside::geom_ysideline()") + dctYSidePlot.Add("GeomPoint", "ggside::geom_ysidepoint()") + dctYSidePlot.Add("GeomText", "ggside::geom_ysidetext()") + dctYSidePlot.Add("GeomTile", "ggside::geom_ysidetile()") + dctYSidePlot.Add("GeomViolin", "ggside::geom_ysideviolin()") + '-------------------------------- 'save controls ucrPnlSaveData.AddRadioButton(rdoSaveDataFrame) @@ -72,6 +124,22 @@ Public Class dlgScript ucrCboSaveOutputObjectFormat.SetLinkedDisplayControl(lblSaveObjectFormat) ucrCboSaveOutputObjectFormat.GetSetSelectedIndex = 0 + ucrCboInputXSide.SetItems(dctXSidePlot, bSetConditions:=False) + ucrCboInputXSide.SetDropDownStyleAsNonEditable() + ucrCboInputXSide.GetSetSelectedIndex = 0 + + ucrCboInputYSide.SetItems(dctYSidePlot, bSetConditions:=False) + ucrCboInputYSide.SetDropDownStyleAsNonEditable() + ucrCboInputYSide.GetSetSelectedIndex = 0 + + ucrCboInputText.SetItems(dctText, bSetConditions:=False) + ucrCboInputText.SetDropDownStyleAsNonEditable() + ucrCboInputText.GetSetSelectedIndex = 0 + + ucrCboInputlabel.SetItems(dctLabel, bSetConditions:=False) + ucrCboInputlabel.SetDropDownStyleAsNonEditable() + ucrCboInputlabel.GetSetSelectedIndex = 0 + ucrSaveObject.SetLabelText("Store Graph") ucrSaveObject.SetIsComboBox() ucrSaveObject.SetDataFrameSelector(ucrDataFrameSaveOutputSelect) @@ -84,6 +152,11 @@ Public Class dlgScript ucrChkDisplayGraph.SetText("Display Output") + ucrChkLabel.SetText("Label Option") + ucrChkText.SetText("Text Option") + + ucrChkXSide.SetText("Top") + ucrChkYSide.SetText("Right") '-------------------------------- 'Get data controls @@ -91,6 +164,9 @@ Public Class dlgScript ucrPnlGetData.AddRadioButton(rdoGetColumn) ucrPnlGetData.AddRadioButton(rdoGetOutputObject) + ucrPnlGraph.AddRadioButton(rdoTextPath) + ucrPnlGraph.AddRadioButton(rdoSidePlot) + ucrDataFrameGetDF.SetLabelText("Get Data Frame:") ucrReceiverGetColumns.Selector = ucrSelectorGetObject @@ -163,6 +239,15 @@ Public Class dlgScript ucrSelectorForRank.SetItemType("column_selection") ucrReceiverRank.strSelectorHeading = "Column selections" + ucrReceiverTextPath.SetParameter(New RParameter("label", 0)) + ucrReceiverTextPath.Selector = ucrSelectorTextPath + ucrReceiverTextPath.SetMeAsReceiver() + ucrReceiverTextPath.bUseFilteredData = False + ucrReceiverTextPath.SetParameterIsRFunction() + + ucrSelectorTextPath.SetItemType("column") + ucrReceiverTextPath.strSelectorHeading = "Variables" + End Sub 'todo. this function should eventually be removed once we have a control that displays packages @@ -208,6 +293,8 @@ Public Class dlgScript ucrDataFrameGetDF.Reset() rdoGetDataFrame.Checked = True rdoDataFrame.Checked = True + rdoSidePlot.Checked = True + rdoTextPath.Enabled = False ucrSelectorForRank.Reset() ucrReceiverForCalculation.Clear() 'activate the selected tab to library tab @@ -237,6 +324,11 @@ Public Class dlgScript ucrInputSaveDataFrame.SetVisible(False) ucrChkSaveDataFrameSingle.SetVisible(False) ucrPnlSaveDataFrame.SetVisible(False) + ucrInputSaveColumn.SetVisible(False) + ucrInputDataframeColumn.SetVisible(False) + lblSaveColumn.Visible = False + lblSaveDataFrame.Visible = False + lblSaveText.Visible = False SetupSaveDataControl("Column", RObjectTypeLabel.Column, "") ElseIf rdoSaveOutputObject.Checked Then ucrSaveObject.Location = New Point(ucrSaveObject.Location.X, ucrCboSaveOutputObjectFormat.Location.Y + 33) @@ -249,6 +341,11 @@ Public Class dlgScript ucrCboSaveOutputObjectFormat.SetVisible(True) ucrChkSaveDataFrameSingle.SetVisible(False) ucrPnlSaveDataFrame.SetVisible(False) + ucrInputSaveColumn.SetVisible(False) + ucrInputDataframeColumn.SetVisible(False) + lblSaveColumn.Visible = False + lblSaveDataFrame.Visible = False + lblSaveText.Visible = False SetupSaveDataControl(ucrCboSaveOutputObjectType.GetText(), dctOutputObjectTypes.Item(ucrCboSaveOutputObjectType.GetText()), dctOutputObjectFormats.Item(ucrCboSaveOutputObjectFormat.GetText())) End If End Sub @@ -895,4 +992,176 @@ Public Class dlgScript ucrSelectorForRank.SetItemType("column_selection") End Sub + Private Sub ucrPnlGraph_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlGraph.ControlValueChanged + If rdoTextPath.Checked Then + ucrSelectorTextPath.SetVisible(True) + lblText.Visible = True + ucrReceiverTextPath.SetVisible(True) + ucrCboInputText.SetVisible(True) + ucrCboInputText.OnControlValueChanged() + ucrCboInputlabel.SetVisible(True) + ucrCboInputlabel.OnControlValueChanged() + ucrChkText.SetVisible(True) + ucrChkText.OnControlValueChanged() + ucrChkLabel.SetVisible(True) + ucrChkLabel.OnControlValueChanged() + ucrChkXSide.SetVisible(False) + ucrChkYSide.SetVisible(False) + ucrCboInputXSide.SetVisible(False) + ucrCboInputYSide.SetVisible(False) + ElseIf rdoSidePlot.Checked Then + ucrChkXSide.SetVisible(True) + ucrChkXSide.OnControlValueChanged() + ucrChkYSide.SetVisible(True) + ucrChkYSide.OnControlValueChanged() + ucrCboInputXSide.SetVisible(True) + ucrCboInputXSide.OnControlValueChanged() + ucrCboInputYSide.SetVisible(True) + ucrCboInputYSide.OnControlValueChanged() + lblText.Visible = False + ucrSelectorTextPath.SetVisible(False) + ucrReceiverTextPath.SetVisible(False) + ucrCboInputText.SetVisible(False) + ucrCboInputlabel.SetVisible(False) + ucrChkText.SetVisible(False) + ucrChkLabel.SetVisible(False) + End If + End Sub + + Private Sub ucrChkLabel_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkLabel.ControlValueChanged, ucrCboInputlabel.ControlValueChanged + ucrCboInputlabel.Visible = ucrChkLabel.Checked + End Sub + + Private Sub ucrChkText_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkText.ControlValueChanged, ucrCboInputText.ControlValueChanged + ucrCboInputText.Visible = ucrChkText.Checked + End Sub + + Private Sub ucrChkXSide_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkXSide.ControlValueChanged, ucrCboInputXSide.ControlValueChanged + ucrCboInputXSide.Visible = ucrChkXSide.Checked + End Sub + + Private Sub ucrChkYSide_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkYSide.ControlValueChanged, ucrCboInputYSide.ControlValueChanged + ucrCboInputYSide.Visible = ucrChkYSide.Checked + End Sub + + Private Sub ucrCboInputXSide_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrCboInputXSide.ControlContentsChanged, ucrCboInputYSide.ControlContentsChanged + Dim strScript As String = "" + Dim strXSide As String = "" + Dim strYSide As String = "" + + If ucrChkXSide.Checked Then + If Not ucrCboInputXSide.IsEmpty() Then + Dim strSelectedX As String = ucrCboInputXSide.GetValue() + If dctXSidePlot.ContainsKey(strSelectedX) Then + strXSide = dctXSidePlot(strSelectedX) + End If + End If + End If + + If ucrChkYSide.Checked Then + If Not ucrCboInputYSide.IsEmpty() Then + Dim strSelectedY As String = ucrCboInputYSide.GetValue() + If dctYSidePlot.ContainsKey(strSelectedY) Then + strYSide = dctYSidePlot(strSelectedY) + End If + End If + End If + + If Not String.IsNullOrEmpty(strXSide) Then + strScript &= " + " & strXSide + End If + If Not String.IsNullOrEmpty(strYSide) Then + strScript &= " + " & strYSide + End If + + PreviewScript(strScript) + End Sub + + Private Sub ucrCboInputText_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrCboInputText.ControlContentsChanged, ucrCboInputlabel.ControlContentsChanged + Dim strSelectedText As String = ucrCboInputText.GetValue() + Dim strSelectedLabel As String = ucrCboInputlabel.GetValue() + Dim strLabel As String = ucrReceiverTextPath.GetVariableNames() + + ' Define additional parameters for specific text geoms + Dim dctAdditionalTextParams As New Dictionary(Of String, String) + dctAdditionalTextParams.Add("geomtextpath::geom_textabline", "slope=0.5, intercept=4") + dctAdditionalTextParams.Add("geomtextpath::geom_textvline", "xintercept=2") + dctAdditionalTextParams.Add("geomtextpath::geom_texthline", "yintercept=3") + dctAdditionalTextParams.Add("geomtextpath::geom_textdensity", "y=..density..") + dctAdditionalTextParams.Add("geomtextpath::geom_textsegment", "xend=4, yend=7") + + ' Define additional parameters for specific label geoms + Dim dctAdditionalLabelParams As New Dictionary(Of String, String) + dctAdditionalLabelParams.Add("geomtextpath::geom_labelabline", "slope=0.5, intercept=4") + dctAdditionalLabelParams.Add("geomtextpath::geom_labelvline", "xintercept=2") + dctAdditionalLabelParams.Add("geomtextpath::geom_labelhline", "yintercept=3") + dctAdditionalLabelParams.Add("geomtextpath::geom_labeldensity", "y=..density..") + dctAdditionalLabelParams.Add("geomtextpath::geom_labelsegment", "xend=4, yend=7") + + ' Initialize the script + Dim strScript As String = "" + + ' Check if either ucrChkLabel or ucrChkText is checked + Dim bShowLabel As Boolean = ucrChkLabel.Checked + Dim strAesLabel As String = "" + Dim bShowText As Boolean = ucrChkText.Checked + Dim strAesText As String = "" + + ' If either is checked and label is not empty, construct aes(label=) + If bShowLabel AndAlso Not String.IsNullOrEmpty(strLabel) Then + strAesLabel = "label=" & strLabel + End If + If bShowText AndAlso Not String.IsNullOrEmpty(strLabel) Then + strAesText = "label=" & strLabel + End If + + ' Check if a valid geom_textpath is selected + If ucrChkText.Checked Then + If Not ucrCboInputText.IsEmpty Then + If dctText.ContainsKey(strSelectedText) Then + Dim strGeomFunction As String = dctText(strSelectedText) + Dim strAdditionalParams As String = "" + If dctAdditionalTextParams.ContainsKey(strGeomFunction) Then + strAdditionalParams = dctAdditionalTextParams(strGeomFunction) + End If + If Not String.IsNullOrEmpty(strAdditionalParams) Then + If Not String.IsNullOrEmpty(strAesText) Then + strAesText &= ", " + End If + strAesText &= strAdditionalParams + End If + + ' Construct the script with all aes() params combined + strScript &= " + " & strGeomFunction & "(aes(" & strAesText & "))" + End If + End If + End If + + ' Check if a valid geom_label is selected + If ucrChkLabel.Checked Then + If Not ucrCboInputlabel.IsEmpty Then + If dctLabel.ContainsKey(strSelectedLabel) Then + Dim strGeomLabelFunction As String = dctLabel(strSelectedLabel) + Dim strAdditionalParams As String = "" + + If dctAdditionalLabelParams.ContainsKey(strGeomLabelFunction) Then + strAdditionalParams = dctAdditionalLabelParams(strGeomLabelFunction) + End If + If Not String.IsNullOrEmpty(strAdditionalParams) Then + If Not String.IsNullOrEmpty(strAesLabel) Then + strAesLabel &= ", " + End If + strAesLabel &= strAdditionalParams + End If + ' Construct the script with all aes() params combined + strScript &= " + " & strGeomLabelFunction & "(aes(" & strAesLabel & "))" + End If + End If + End If + + ' Display or preview the constructed script + PreviewScript(strScript) + End Sub + + End Class \ No newline at end of file