From 88a8f1ed3bc7418427ed560950ae8683d284617f Mon Sep 17 00:00:00 2001 From: anastasia-mbithe Date: Tue, 28 Feb 2023 10:35:31 +0300 Subject: [PATCH 01/44] Enabling Print and Updating object types --- instat/dlgRenameObjects.vb | 7 ++++--- instat/dlgViewObjects.vb | 11 ++++------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/instat/dlgRenameObjects.vb b/instat/dlgRenameObjects.vb index 3b8b65f260d..739d8b9e940 100644 --- a/instat/dlgRenameObjects.vb +++ b/instat/dlgRenameObjects.vb @@ -68,12 +68,13 @@ Public Class dlgRenameObjects ucrInputType.SetParameter(New RParameter("object_type", 3)) dctTypes.Add("Objects", Chr(34) & "object" & Chr(34)) - dctTypes.Add("Filters", Chr(34) & "filter" & Chr(34)) - dctTypes.Add("Column selections", Chr(34) & "column_selection" & Chr(34)) - dctTypes.Add("Calculations", Chr(34) & "calculation" & Chr(34)) + dctTypes.Add("Summaries", Chr(34) & "summaries" & Chr(34)) dctTypes.Add("Tables", Chr(34) & "table" & Chr(34)) dctTypes.Add("Graphs", Chr(34) & "graph" & Chr(34)) dctTypes.Add("Models", Chr(34) & "model" & Chr(34)) + dctTypes.Add("Filters", Chr(34) & "filter" & Chr(34)) + dctTypes.Add("Column selections", Chr(34) & "column_selection" & Chr(34)) + dctTypes.Add("Calculations", Chr(34) & "calculation" & Chr(34)) ucrInputType.SetItems(dctTypes) ucrInputType.SetDropDownStyleAsNonEditable() End Sub diff --git a/instat/dlgViewObjects.vb b/instat/dlgViewObjects.vb index 0d213eb734e..d164ce59769 100644 --- a/instat/dlgViewObjects.vb +++ b/instat/dlgViewObjects.vb @@ -39,7 +39,7 @@ Public Class dlgViewObjects Private Sub InitialiseDialog() ucrBase.iHelpTopicID = 349 'todo. temporary to have the str() output captured as text - ucrBase.clsRsyntax.iCallType = -1 + 'ucrBase.clsRsyntax.iCallType = -1 ' ucr receiver ucrReceiverSelectedObject.SetParameter(New RParameter("x", 1)) @@ -52,15 +52,15 @@ Public Class dlgViewObjects 'todo. disabling and hiding this for now until they're working correctly. 'calling print via a dialog currently does not work correctly - rdoPrint.Enabled = False + 'rdoPrint.Enabled = False rdoAllContents.Visible = False rdoComponent.Visible = False 'add radio buttons to the panel rdo's - 'ucrPnlContentsToView.AddRadioButton(rdoPrint) + ucrPnlContentsToView.AddRadioButton(rdoPrint) ucrPnlContentsToView.AddRadioButton(rdoStructure) - 'ucrPnlContentsToView.AddFunctionNamesCondition(rdoPrint, "print") + ucrPnlContentsToView.AddFunctionNamesCondition(rdoPrint, "print") ucrPnlContentsToView.AddFunctionNamesCondition(rdoStructure, "str") End Sub @@ -78,7 +78,6 @@ Public Class dlgViewObjects clsPrintRFunction.SetRCommand("print") clsStructureRFunction.SetRCommand("str") - 'set the base function ucrBase.clsRsyntax.SetBaseRFunction(clsStructureRFunction) End Sub @@ -111,6 +110,4 @@ Public Class dlgViewObjects SetRCodeforControls(True) TestOKEnabled() End Sub - - End Class From 01853e09fb4c8af6ae3a0f5dd372b7d506a1ae0d Mon Sep 17 00:00:00 2001 From: anastasia-mbithe Date: Fri, 3 Mar 2023 10:59:46 +0300 Subject: [PATCH 02/44] More changes --- instat/clsRLink.vb | 1 + instat/dlgRenameObjects.vb | 2 +- instat/dlgViewObjects.Designer.vb | 52 +++++++++++++++++++++-------- instat/dlgViewObjects.vb | 54 ++++++++++++++++++++++++------- 4 files changed, 84 insertions(+), 25 deletions(-) diff --git a/instat/clsRLink.vb b/instat/clsRLink.vb index a62e3807c6a..44214f0fb10 100644 --- a/instat/clsRLink.vb +++ b/instat/clsRLink.vb @@ -827,6 +827,7 @@ Public Class RLink bDisplayOutputInExternalViewer = strLastScript.Contains("view_object_data") ElseIf strLastScript.StartsWith("print") Then + 'Todo. This is not yet supported for printing object formats like html bAsFile = False Evaluate(strScript, bSilent:=bSilent, bSeparateThread:=bSeparateThread, bShowWaitDialogOverride:=bShowWaitDialogOverride) ElseIf iCallType = 0 Then diff --git a/instat/dlgRenameObjects.vb b/instat/dlgRenameObjects.vb index 739d8b9e940..6cdadc0915b 100644 --- a/instat/dlgRenameObjects.vb +++ b/instat/dlgRenameObjects.vb @@ -68,7 +68,7 @@ Public Class dlgRenameObjects ucrInputType.SetParameter(New RParameter("object_type", 3)) dctTypes.Add("Objects", Chr(34) & "object" & Chr(34)) - dctTypes.Add("Summaries", Chr(34) & "summaries" & Chr(34)) + dctTypes.Add("Summaries", Chr(34) & "summary" & Chr(34)) dctTypes.Add("Tables", Chr(34) & "table" & Chr(34)) dctTypes.Add("Graphs", Chr(34) & "graph" & Chr(34)) dctTypes.Add("Models", Chr(34) & "model" & Chr(34)) diff --git a/instat/dlgViewObjects.Designer.vb b/instat/dlgViewObjects.Designer.vb index 93cd343fd03..15efef2bb4c 100644 --- a/instat/dlgViewObjects.Designer.vb +++ b/instat/dlgViewObjects.Designer.vb @@ -47,21 +47,23 @@ Partial Class dlgViewObjects Me.ucrSelectorForViewObject = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrBase = New instat.ucrButtons() Me.ucrPnlContentsToView = New instat.UcrPanel() + Me.ucrInputObjectType = New instat.ucrInputComboBox() + Me.lblObjectType = New System.Windows.Forms.Label() Me.SuspendLayout() ' 'lblSelectedObject ' Me.lblSelectedObject.AutoSize = True - Me.lblSelectedObject.Location = New System.Drawing.Point(250, 45) + Me.lblSelectedObject.Location = New System.Drawing.Point(250, 72) Me.lblSelectedObject.Name = "lblSelectedObject" - Me.lblSelectedObject.Size = New System.Drawing.Size(79, 13) + Me.lblSelectedObject.Size = New System.Drawing.Size(41, 13) Me.lblSelectedObject.TabIndex = 1 - Me.lblSelectedObject.Text = "Object to View:" + Me.lblSelectedObject.Text = "Object:" ' 'rdoStructure ' Me.rdoStructure.AutoSize = True - Me.rdoStructure.Location = New System.Drawing.Point(256, 116) + Me.rdoStructure.Location = New System.Drawing.Point(256, 144) Me.rdoStructure.Name = "rdoStructure" Me.rdoStructure.Size = New System.Drawing.Size(68, 17) Me.rdoStructure.TabIndex = 5 @@ -73,7 +75,7 @@ Partial Class dlgViewObjects 'rdoAllContents ' Me.rdoAllContents.AutoSize = True - Me.rdoAllContents.Location = New System.Drawing.Point(256, 136) + Me.rdoAllContents.Location = New System.Drawing.Point(256, 166) Me.rdoAllContents.Name = "rdoAllContents" Me.rdoAllContents.Size = New System.Drawing.Size(81, 17) Me.rdoAllContents.TabIndex = 6 @@ -85,7 +87,7 @@ Partial Class dlgViewObjects 'rdoComponent ' Me.rdoComponent.AutoSize = True - Me.rdoComponent.Location = New System.Drawing.Point(256, 158) + Me.rdoComponent.Location = New System.Drawing.Point(256, 188) Me.rdoComponent.Name = "rdoComponent" Me.rdoComponent.Size = New System.Drawing.Size(79, 17) Me.rdoComponent.TabIndex = 7 @@ -97,7 +99,7 @@ Partial Class dlgViewObjects 'rdoPrint ' Me.rdoPrint.AutoSize = True - Me.rdoPrint.Location = New System.Drawing.Point(256, 94) + Me.rdoPrint.Location = New System.Drawing.Point(256, 122) Me.rdoPrint.Name = "rdoPrint" Me.rdoPrint.Size = New System.Drawing.Size(46, 17) Me.rdoPrint.TabIndex = 4 @@ -109,11 +111,11 @@ Partial Class dlgViewObjects ' Me.ucrReceiverSelectedObject.AutoSize = True Me.ucrReceiverSelectedObject.frmParent = Me - Me.ucrReceiverSelectedObject.Location = New System.Drawing.Point(250, 60) + Me.ucrReceiverSelectedObject.Location = New System.Drawing.Point(250, 87) Me.ucrReceiverSelectedObject.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverSelectedObject.Name = "ucrReceiverSelectedObject" Me.ucrReceiverSelectedObject.Selector = Nothing - Me.ucrReceiverSelectedObject.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverSelectedObject.Size = New System.Drawing.Size(137, 20) Me.ucrReceiverSelectedObject.strNcFilePath = "" Me.ucrReceiverSelectedObject.TabIndex = 2 Me.ucrReceiverSelectedObject.ucrSelector = Nothing @@ -134,27 +136,49 @@ Partial Class dlgViewObjects ' Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(10, 206) + Me.ucrBase.Location = New System.Drawing.Point(8, 222) Me.ucrBase.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.ucrBase.Name = "ucrBase" - Me.ucrBase.Size = New System.Drawing.Size(405, 52) + Me.ucrBase.Size = New System.Drawing.Size(408, 52) Me.ucrBase.TabIndex = 8 ' 'ucrPnlContentsToView ' Me.ucrPnlContentsToView.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlContentsToView.Location = New System.Drawing.Point(250, 90) + Me.ucrPnlContentsToView.Location = New System.Drawing.Point(250, 113) Me.ucrPnlContentsToView.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) Me.ucrPnlContentsToView.Name = "ucrPnlContentsToView" Me.ucrPnlContentsToView.Size = New System.Drawing.Size(120, 100) Me.ucrPnlContentsToView.TabIndex = 3 ' + 'ucrInputObjectType + ' + Me.ucrInputObjectType.AddQuotesIfUnrecognised = True + Me.ucrInputObjectType.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrInputObjectType.GetSetSelectedIndex = -1 + Me.ucrInputObjectType.IsReadOnly = False + Me.ucrInputObjectType.Location = New System.Drawing.Point(250, 47) + Me.ucrInputObjectType.Name = "ucrInputObjectType" + Me.ucrInputObjectType.Size = New System.Drawing.Size(137, 21) + Me.ucrInputObjectType.TabIndex = 9 + ' + 'lblObjectType + ' + Me.lblObjectType.AutoSize = True + Me.lblObjectType.Location = New System.Drawing.Point(250, 32) + Me.lblObjectType.Name = "lblObjectType" + Me.lblObjectType.Size = New System.Drawing.Size(106, 13) + Me.lblObjectType.TabIndex = 10 + Me.lblObjectType.Text = "Object Type to View:" + ' 'dlgViewObjects ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True - Me.ClientSize = New System.Drawing.Size(416, 262) + Me.ClientSize = New System.Drawing.Size(416, 277) + Me.Controls.Add(Me.lblObjectType) + Me.Controls.Add(Me.ucrInputObjectType) Me.Controls.Add(Me.rdoPrint) Me.Controls.Add(Me.rdoComponent) Me.Controls.Add(Me.rdoAllContents) @@ -185,4 +209,6 @@ Partial Class dlgViewObjects Friend WithEvents rdoComponent As RadioButton Friend WithEvents rdoPrint As RadioButton Friend WithEvents ucrPnlContentsToView As UcrPanel + Friend WithEvents lblObjectType As Label + Friend WithEvents ucrInputObjectType As ucrInputComboBox End Class diff --git a/instat/dlgViewObjects.vb b/instat/dlgViewObjects.vb index d164ce59769..7256b509fe3 100644 --- a/instat/dlgViewObjects.vb +++ b/instat/dlgViewObjects.vb @@ -20,7 +20,8 @@ Imports RDotNet Public Class dlgViewObjects Private bFirstLoad As Boolean = True Private bReset As Boolean = True - Private clsStructureRFunction, clsPrintRFunction As New RFunction + Private clsStructureRFunction, clsPrintRFunction, clsDummyFunction As New RFunction + Private dctTypes As New Dictionary(Of String, String) Private Sub dlgViewObjects_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstLoad Then @@ -40,10 +41,12 @@ Public Class dlgViewObjects ucrBase.iHelpTopicID = 349 'todo. temporary to have the str() output captured as text 'ucrBase.clsRsyntax.iCallType = -1 + ucrSelectorForViewObject.SetParameter(New RParameter("data_name", 0)) + ucrSelectorForViewObject.SetParameterIsString() ' ucr receiver - ucrReceiverSelectedObject.SetParameter(New RParameter("x", 1)) - ucrReceiverSelectedObject.SetParameterIsRFunction() + ucrReceiverSelectedObject.SetParameter(New RParameter("object_name", 1)) + 'ucrReceiverSelectedObject.SetParameterIsRFunction() ucrReceiverSelectedObject.Selector = ucrSelectorForViewObject ucrReceiverSelectedObject.SetMeAsReceiver() ucrReceiverSelectedObject.strSelectorHeading = "Objects" @@ -51,8 +54,6 @@ Public Class dlgViewObjects ucrReceiverSelectedObject.bAutoFill = True 'todo. disabling and hiding this for now until they're working correctly. - 'calling print via a dialog currently does not work correctly - 'rdoPrint.Enabled = False rdoAllContents.Visible = False rdoComponent.Visible = False @@ -60,8 +61,17 @@ Public Class dlgViewObjects ucrPnlContentsToView.AddRadioButton(rdoPrint) ucrPnlContentsToView.AddRadioButton(rdoStructure) - ucrPnlContentsToView.AddFunctionNamesCondition(rdoPrint, "print") - ucrPnlContentsToView.AddFunctionNamesCondition(rdoStructure, "str") + ucrPnlContentsToView.AddParameterValuesCondition(rdoPrint, "check", "print") + ucrPnlContentsToView.AddParameterValuesCondition(rdoStructure, "check", "str") + + ucrInputObjectType.SetParameter(New RParameter("object_type", 0)) + dctTypes.Add("Objects", Chr(34) & "object" & Chr(34)) + dctTypes.Add("Summaries", Chr(34) & "summary" & Chr(34)) + dctTypes.Add("Tables", Chr(34) & "table" & Chr(34)) + dctTypes.Add("Graphs", Chr(34) & "graph" & Chr(34)) + dctTypes.Add("Models", Chr(34) & "model" & Chr(34)) + ucrInputObjectType.SetItems(dctTypes) + ucrInputObjectType.SetDropDownStyleAsNonEditable() End Sub @@ -69,23 +79,31 @@ Public Class dlgViewObjects 'initialise the Rfunctions clsStructureRFunction = New RFunction clsPrintRFunction = New RFunction + clsDummyFunction = New RFunction 'reset controls to default states ucrSelectorForViewObject.Reset() - rdoStructure.Checked = True + + clsDummyFunction.AddParameter("object_type", Chr(34) & "object" & Chr(34), iPosition:=0) + clsDummyFunction.AddParameter("check", "print", iPosition:=1) + + 'as of 02/3/2023 get object data is used instead of print command because the print command is not yet supported for html formats. + clsPrintRFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_object_data") + clsPrintRFunction.AddParameter("as_file", "TRUE", iPosition:=2) 'set R function for showing selected object structure - clsPrintRFunction.SetRCommand("print") clsStructureRFunction.SetRCommand("str") 'set the base function - ucrBase.clsRsyntax.SetBaseRFunction(clsStructureRFunction) + ucrBase.clsRsyntax.SetBaseRFunction(clsPrintRFunction) End Sub Private Sub SetRCodeforControls(bReset As Boolean) ucrReceiverSelectedObject.AddAdditionalCodeParameterPair(clsStructureRFunction, New RParameter("object", 1)) + ucrSelectorForViewObject.SetRCode(clsPrintRFunction, bReset) ucrReceiverSelectedObject.SetRCode(clsPrintRFunction, bReset) - ucrPnlContentsToView.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + ucrInputObjectType.SetRCode(clsDummyFunction, bReset) + ucrPnlContentsToView.SetRCode(clsDummyFunction, bReset) End Sub Private Sub TestOKEnabled() @@ -95,8 +113,12 @@ Public Class dlgViewObjects Private Sub ucrPnlContentsToReview_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrPnlContentsToView.ControlContentsChanged 'set the appropriate Base RFunction If rdoPrint.Checked Then + ucrReceiverSelectedObject.SetParameterIsString() + clsDummyFunction.AddParameter("check", "print", iPosition:=1) ucrBase.clsRsyntax.SetBaseRFunction(clsPrintRFunction) ElseIf rdoStructure.Checked Then + ucrReceiverSelectedObject.SetParameterIsRFunction() + clsDummyFunction.AddParameter("check", "str", iPosition:=1) ucrBase.clsRsyntax.SetBaseRFunction(clsStructureRFunction) End If End Sub @@ -110,4 +132,14 @@ Public Class dlgViewObjects SetRCodeforControls(True) TestOKEnabled() End Sub + + Private Sub ucrInputObjectType_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputObjectType.ControlValueChanged + Dim key As String = dctTypes.Keys(ucrInputObjectType.cboInput.SelectedIndex) + Dim value As String = "" + + If key IsNot Nothing AndAlso dctTypes.TryGetValue(key, value) Then + ucrReceiverSelectedObject.strSelectorHeading = key + ucrReceiverSelectedObject.SetItemType(value.Replace(Chr(34), "")) + End If + End Sub End Class From 99ef85f74b81407d2360b83b5e17438ac11805f3 Mon Sep 17 00:00:00 2001 From: anastasia-mbithe Date: Fri, 3 Mar 2023 16:07:19 +0300 Subject: [PATCH 03/44] minor change --- instat/dlgViewObjects.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/dlgViewObjects.vb b/instat/dlgViewObjects.vb index 7256b509fe3..27dac70329f 100644 --- a/instat/dlgViewObjects.vb +++ b/instat/dlgViewObjects.vb @@ -40,7 +40,7 @@ Public Class dlgViewObjects Private Sub InitialiseDialog() ucrBase.iHelpTopicID = 349 'todo. temporary to have the str() output captured as text - 'ucrBase.clsRsyntax.iCallType = -1 + ucrBase.clsRsyntax.iCallType = -1 ucrSelectorForViewObject.SetParameter(New RParameter("data_name", 0)) ucrSelectorForViewObject.SetParameterIsString() From a3e2535f03129f455a4a28e59d9ae1e1d7d0a6d1 Mon Sep 17 00:00:00 2001 From: anastasia-mbithe Date: Fri, 3 Mar 2023 16:55:08 +0300 Subject: [PATCH 04/44] more change --- instat/dlgDeleteObjects.vb | 7 ++++--- instat/dlgViewObjects.Designer.vb | 12 ++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/instat/dlgDeleteObjects.vb b/instat/dlgDeleteObjects.vb index 018bf8b2ee3..d8409c89e5c 100644 --- a/instat/dlgDeleteObjects.vb +++ b/instat/dlgDeleteObjects.vb @@ -52,12 +52,13 @@ Public Class dlgDeleteObjects ucrInputComboType.SetParameter(New RParameter("object_type", 2)) dctTypes.Add("Objects", Chr(34) & "object" & Chr(34)) - dctTypes.Add("Filters", Chr(34) & "filter" & Chr(34)) - dctTypes.Add("Column selections", Chr(34) & "column_selection" & Chr(34)) - dctTypes.Add("Calculations", Chr(34) & "calculation" & Chr(34)) + dctTypes.Add("Summaries", Chr(34) & "summary" & Chr(34)) dctTypes.Add("Tables", Chr(34) & "table" & Chr(34)) dctTypes.Add("Graphs", Chr(34) & "graph" & Chr(34)) dctTypes.Add("Models", Chr(34) & "model" & Chr(34)) + dctTypes.Add("Filters", Chr(34) & "filter" & Chr(34)) + dctTypes.Add("Column selections", Chr(34) & "column_selection" & Chr(34)) + dctTypes.Add("Calculations", Chr(34) & "calculation" & Chr(34)) ucrInputComboType.SetItems(dctTypes) ucrInputComboType.SetDropDownStyleAsNonEditable() End Sub diff --git a/instat/dlgViewObjects.Designer.vb b/instat/dlgViewObjects.Designer.vb index 15efef2bb4c..2df4e79b32d 100644 --- a/instat/dlgViewObjects.Designer.vb +++ b/instat/dlgViewObjects.Designer.vb @@ -56,9 +56,9 @@ Partial Class dlgViewObjects Me.lblSelectedObject.AutoSize = True Me.lblSelectedObject.Location = New System.Drawing.Point(250, 72) Me.lblSelectedObject.Name = "lblSelectedObject" - Me.lblSelectedObject.Size = New System.Drawing.Size(41, 13) + Me.lblSelectedObject.Size = New System.Drawing.Size(83, 13) Me.lblSelectedObject.TabIndex = 1 - Me.lblSelectedObject.Text = "Object:" + Me.lblSelectedObject.Text = "Object To View:" ' 'rdoStructure ' @@ -145,10 +145,10 @@ Partial Class dlgViewObjects 'ucrPnlContentsToView ' Me.ucrPnlContentsToView.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlContentsToView.Location = New System.Drawing.Point(250, 113) + Me.ucrPnlContentsToView.Location = New System.Drawing.Point(250, 115) Me.ucrPnlContentsToView.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) Me.ucrPnlContentsToView.Name = "ucrPnlContentsToView" - Me.ucrPnlContentsToView.Size = New System.Drawing.Size(120, 100) + Me.ucrPnlContentsToView.Size = New System.Drawing.Size(120, 98) Me.ucrPnlContentsToView.TabIndex = 3 ' 'ucrInputObjectType @@ -167,9 +167,9 @@ Partial Class dlgViewObjects Me.lblObjectType.AutoSize = True Me.lblObjectType.Location = New System.Drawing.Point(250, 32) Me.lblObjectType.Name = "lblObjectType" - Me.lblObjectType.Size = New System.Drawing.Size(106, 13) + Me.lblObjectType.Size = New System.Drawing.Size(34, 13) Me.lblObjectType.TabIndex = 10 - Me.lblObjectType.Text = "Object Type to View:" + Me.lblObjectType.Text = "Type:" ' 'dlgViewObjects ' From 5bd0b7ec8da9fe2aa1f62252f352e770e442fd2f Mon Sep 17 00:00:00 2001 From: anastasia-mbithe Date: Fri, 31 Mar 2023 12:08:05 +0300 Subject: [PATCH 05/44] minor change --- instat/dlgViewObjects.vb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/instat/dlgViewObjects.vb b/instat/dlgViewObjects.vb index 27dac70329f..0075691c089 100644 --- a/instat/dlgViewObjects.vb +++ b/instat/dlgViewObjects.vb @@ -48,7 +48,7 @@ Public Class dlgViewObjects ucrReceiverSelectedObject.SetParameter(New RParameter("object_name", 1)) 'ucrReceiverSelectedObject.SetParameterIsRFunction() ucrReceiverSelectedObject.Selector = ucrSelectorForViewObject - ucrReceiverSelectedObject.SetMeAsReceiver() + 'ucrReceiverSelectedObject.SetMeAsReceiver() ucrReceiverSelectedObject.strSelectorHeading = "Objects" ucrReceiverSelectedObject.SetItemType("object") ucrReceiverSelectedObject.bAutoFill = True @@ -66,10 +66,10 @@ Public Class dlgViewObjects ucrInputObjectType.SetParameter(New RParameter("object_type", 0)) dctTypes.Add("Objects", Chr(34) & "object" & Chr(34)) - dctTypes.Add("Summaries", Chr(34) & "summary" & Chr(34)) - dctTypes.Add("Tables", Chr(34) & "table" & Chr(34)) - dctTypes.Add("Graphs", Chr(34) & "graph" & Chr(34)) - dctTypes.Add("Models", Chr(34) & "model" & Chr(34)) + dctTypes.Add("Summaries", RObjectTypeLabel.Summary) + dctTypes.Add("Tables", RObjectTypeLabel.Table) + dctTypes.Add("Graphs", RObjectTypeLabel.Graph) + dctTypes.Add("Models", RObjectTypeLabel.Model) ucrInputObjectType.SetItems(dctTypes) ucrInputObjectType.SetDropDownStyleAsNonEditable() @@ -133,12 +133,13 @@ Public Class dlgViewObjects TestOKEnabled() End Sub - Private Sub ucrInputObjectType_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputObjectType.ControlValueChanged + Private Sub ucrInputObjectType_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputObjectType.ControlValueChanged, ucrReceiverSelectedObject.ControlValueChanged Dim key As String = dctTypes.Keys(ucrInputObjectType.cboInput.SelectedIndex) Dim value As String = "" If key IsNot Nothing AndAlso dctTypes.TryGetValue(key, value) Then ucrReceiverSelectedObject.strSelectorHeading = key + ucrReceiverSelectedObject.SetMeAsReceiver() ucrReceiverSelectedObject.SetItemType(value.Replace(Chr(34), "")) End If End Sub From 0907b81fb962da0c82ef0f82875476cea838e14c Mon Sep 17 00:00:00 2001 From: anastasia-mbithe Date: Wed, 3 May 2023 11:47:02 +0300 Subject: [PATCH 06/44] minor change --- instat/dlgViewObjects.vb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/instat/dlgViewObjects.vb b/instat/dlgViewObjects.vb index 0075691c089..03d8546a8b7 100644 --- a/instat/dlgViewObjects.vb +++ b/instat/dlgViewObjects.vb @@ -137,10 +137,15 @@ Public Class dlgViewObjects Dim key As String = dctTypes.Keys(ucrInputObjectType.cboInput.SelectedIndex) Dim value As String = "" + ucrReceiverSelectedObject.ResetText() + If key IsNot Nothing AndAlso dctTypes.TryGetValue(key, value) Then ucrReceiverSelectedObject.strSelectorHeading = key ucrReceiverSelectedObject.SetMeAsReceiver() ucrReceiverSelectedObject.SetItemType(value.Replace(Chr(34), "")) End If + 'If ucrSelectorForViewObject.lstAvailableVariable.FindItemWithText(ucrReceiverSelectedObject.GetVariableNames(False)) Is Nothing Then + ' ucrReceiverSelectedObject.RemoveAnyVariablesNotInList() + 'End If End Sub End Class From c416655c46ddf36953ec0047008f6ee5e76bbe72 Mon Sep 17 00:00:00 2001 From: anastasia-mbithe Date: Wed, 3 May 2023 15:27:58 +0300 Subject: [PATCH 07/44] Refreshing the receiver depending on selector items --- instat/dlgViewObjects.vb | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/instat/dlgViewObjects.vb b/instat/dlgViewObjects.vb index 03d8546a8b7..cd4b208123f 100644 --- a/instat/dlgViewObjects.vb +++ b/instat/dlgViewObjects.vb @@ -46,9 +46,8 @@ Public Class dlgViewObjects ' ucr receiver ucrReceiverSelectedObject.SetParameter(New RParameter("object_name", 1)) - 'ucrReceiverSelectedObject.SetParameterIsRFunction() ucrReceiverSelectedObject.Selector = ucrSelectorForViewObject - 'ucrReceiverSelectedObject.SetMeAsReceiver() + ucrReceiverSelectedObject.SetMeAsReceiver() ucrReceiverSelectedObject.strSelectorHeading = "Objects" ucrReceiverSelectedObject.SetItemType("object") ucrReceiverSelectedObject.bAutoFill = True @@ -133,19 +132,16 @@ Public Class dlgViewObjects TestOKEnabled() End Sub - Private Sub ucrInputObjectType_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputObjectType.ControlValueChanged, ucrReceiverSelectedObject.ControlValueChanged + Private Sub ucrInputObjectType_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputObjectType.ControlValueChanged Dim key As String = dctTypes.Keys(ucrInputObjectType.cboInput.SelectedIndex) Dim value As String = "" - ucrReceiverSelectedObject.ResetText() - + If Not ucrReceiverSelectedObject.IsEmpty AndAlso ucrSelectorForViewObject.lstAvailableVariable.FindItemWithText(ucrReceiverSelectedObject.GetVariableNames(False), True, 0, False) Is Nothing Then + ucrReceiverSelectedObject.SetText("") + End If If key IsNot Nothing AndAlso dctTypes.TryGetValue(key, value) Then ucrReceiverSelectedObject.strSelectorHeading = key - ucrReceiverSelectedObject.SetMeAsReceiver() ucrReceiverSelectedObject.SetItemType(value.Replace(Chr(34), "")) End If - 'If ucrSelectorForViewObject.lstAvailableVariable.FindItemWithText(ucrReceiverSelectedObject.GetVariableNames(False)) Is Nothing Then - ' ucrReceiverSelectedObject.RemoveAnyVariablesNotInList() - 'End If End Sub End Class From 14f3c171048acced52cd83b4b0bb1e26171dd473 Mon Sep 17 00:00:00 2001 From: anastasia-mbithe Date: Wed, 24 May 2023 16:01:59 +0300 Subject: [PATCH 08/44] Minor changes --- instat/dlgDeleteObjects.vb | 8 ++++---- instat/dlgViewObjects.vb | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/instat/dlgDeleteObjects.vb b/instat/dlgDeleteObjects.vb index 2f5ac75454f..5e30fa00a13 100644 --- a/instat/dlgDeleteObjects.vb +++ b/instat/dlgDeleteObjects.vb @@ -53,10 +53,10 @@ Public Class dlgDeleteObjects ucrInputComboType.SetParameter(New RParameter("object_type", 2)) dctTypes.Add("Objects", Chr(34) & "object" & Chr(34)) - dctTypes.Add("Summaries", Chr(34) & "summary" & Chr(34)) - dctTypes.Add("Tables", Chr(34) & "table" & Chr(34)) - dctTypes.Add("Graphs", Chr(34) & "graph" & Chr(34)) - dctTypes.Add("Models", Chr(34) & "model" & Chr(34)) + dctTypes.Add("Summaries", RObjectTypeLabel.Summary) + dctTypes.Add("Tables", RObjectTypeLabel.Table) + dctTypes.Add("Graphs", RObjectTypeLabel.Graph) + dctTypes.Add("Models", RObjectTypeLabel.Model) dctTypes.Add("Filters", Chr(34) & "filter" & Chr(34)) dctTypes.Add("Column selections", Chr(34) & "column_selection" & Chr(34)) dctTypes.Add("Calculations", Chr(34) & "calculation" & Chr(34)) diff --git a/instat/dlgViewObjects.vb b/instat/dlgViewObjects.vb index cd4b208123f..f677f7079ed 100644 --- a/instat/dlgViewObjects.vb +++ b/instat/dlgViewObjects.vb @@ -69,6 +69,7 @@ Public Class dlgViewObjects dctTypes.Add("Tables", RObjectTypeLabel.Table) dctTypes.Add("Graphs", RObjectTypeLabel.Graph) dctTypes.Add("Models", RObjectTypeLabel.Model) + dctTypes.Add("Structured", RObjectTypeLabel.StructureLabel) ucrInputObjectType.SetItems(dctTypes) ucrInputObjectType.SetDropDownStyleAsNonEditable() @@ -139,6 +140,7 @@ Public Class dlgViewObjects If Not ucrReceiverSelectedObject.IsEmpty AndAlso ucrSelectorForViewObject.lstAvailableVariable.FindItemWithText(ucrReceiverSelectedObject.GetVariableNames(False), True, 0, False) Is Nothing Then ucrReceiverSelectedObject.SetText("") End If + If key IsNot Nothing AndAlso dctTypes.TryGetValue(key, value) Then ucrReceiverSelectedObject.strSelectorHeading = key ucrReceiverSelectedObject.SetItemType(value.Replace(Chr(34), "")) From 507b5d64fb6e51d3595be9af65f91a427f95fa99 Mon Sep 17 00:00:00 2001 From: anastasia-mbithe Date: Thu, 25 May 2023 11:50:33 +0300 Subject: [PATCH 09/44] minor change --- instat/dlgDeleteObjects.vb | 5 ++--- instat/dlgViewObjects.vb | 10 ++++------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/instat/dlgDeleteObjects.vb b/instat/dlgDeleteObjects.vb index 5e30fa00a13..88352107d56 100644 --- a/instat/dlgDeleteObjects.vb +++ b/instat/dlgDeleteObjects.vb @@ -57,9 +57,8 @@ Public Class dlgDeleteObjects dctTypes.Add("Tables", RObjectTypeLabel.Table) dctTypes.Add("Graphs", RObjectTypeLabel.Graph) dctTypes.Add("Models", RObjectTypeLabel.Model) - dctTypes.Add("Filters", Chr(34) & "filter" & Chr(34)) - dctTypes.Add("Column selections", Chr(34) & "column_selection" & Chr(34)) - dctTypes.Add("Calculations", Chr(34) & "calculation" & Chr(34)) + 'dctTypes.Add("Filters", Chr(34) & "filter" & Chr(34)) + 'dctTypes.Add("Column selections", Chr(34) & "column_selection" & Chr(34)) ucrInputComboType.SetItems(dctTypes) ucrInputComboType.SetDropDownStyleAsNonEditable() diff --git a/instat/dlgViewObjects.vb b/instat/dlgViewObjects.vb index f677f7079ed..8fbd3bdb03d 100644 --- a/instat/dlgViewObjects.vb +++ b/instat/dlgViewObjects.vb @@ -134,16 +134,14 @@ Public Class dlgViewObjects End Sub Private Sub ucrInputObjectType_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputObjectType.ControlValueChanged - Dim key As String = dctTypes.Keys(ucrInputObjectType.cboInput.SelectedIndex) - Dim value As String = "" - + 'Checks whether the item in the receiver is contained in the selector. I.e when a selected object is renamed, the receiver clears. If Not ucrReceiverSelectedObject.IsEmpty AndAlso ucrSelectorForViewObject.lstAvailableVariable.FindItemWithText(ucrReceiverSelectedObject.GetVariableNames(False), True, 0, False) Is Nothing Then ucrReceiverSelectedObject.SetText("") End If - If key IsNot Nothing AndAlso dctTypes.TryGetValue(key, value) Then - ucrReceiverSelectedObject.strSelectorHeading = key - ucrReceiverSelectedObject.SetItemType(value.Replace(Chr(34), "")) + If dctTypes.ContainsKey(ucrInputObjectType.cboInput.Text) Then + ucrReceiverSelectedObject.strSelectorHeading = ucrInputObjectType.cboInput.Text + ucrReceiverSelectedObject.SetItemType(dctTypes.Item(ucrInputObjectType.cboInput.Text).Replace(Chr(34), "")) End If End Sub End Class From e352cca7081c1e127bf33cf14b3ef395ec934630 Mon Sep 17 00:00:00 2001 From: Stephen Lloyd Date: Sat, 23 Sep 2023 12:11:28 +0200 Subject: [PATCH 10/44] upgraded to RScript 1.0.7 --- .gitignore | 4 + instat/instat.vbproj | 9 +- instat/packages.config | 3 +- packages/RScript.1.0.6/.signature.p7s | Bin 9466 -> 0 bytes packages/RScript.1.0.6/lib/net461/RScript.dll | Bin 34304 -> 0 bytes packages/RScript.1.0.6/lib/net461/RScript.xml | 691 ------------------ 6 files changed, 13 insertions(+), 694 deletions(-) delete mode 100644 packages/RScript.1.0.6/.signature.p7s delete mode 100644 packages/RScript.1.0.6/lib/net461/RScript.dll delete mode 100644 packages/RScript.1.0.6/lib/net461/RScript.xml diff --git a/.gitignore b/.gitignore index cc25c123cb9..1ed6e973e09 100644 --- a/.gitignore +++ b/.gitignore @@ -252,3 +252,7 @@ installer/Output/ /packages/NLog.*/ /packages/Newtonsoft.Json.*/ + +# RScript package and dependencies +/packages/RScript.*/ +/packages/System.Collections.Specialized.*/ diff --git a/instat/instat.vbproj b/instat/instat.vbproj index b850753f663..4a69a7255d8 100644 --- a/instat/instat.vbproj +++ b/instat/instat.vbproj @@ -155,13 +155,18 @@ ..\packages\R.NET.1.8.2\lib\netstandard2.0\RDotNet.dll - - ..\packages\RScript.1.0.6\lib\net461\RScript.dll + + ..\packages\RScript.1.0.7\lib\net461\RScript.dll ..\packages\jacobslusser.ScintillaNET.3.6.3\lib\net40\ScintillaNET.dll + + ..\packages\System.Collections.Specialized.4.3.0\lib\net46\System.Collections.Specialized.dll + True + True + diff --git a/instat/packages.config b/instat/packages.config index 706fdd44476..cafd184b5b5 100644 --- a/instat/packages.config +++ b/instat/packages.config @@ -11,8 +11,9 @@ - + + diff --git a/packages/RScript.1.0.6/.signature.p7s b/packages/RScript.1.0.6/.signature.p7s deleted file mode 100644 index 6db6249328f760b0f4cc897879f16bf1f3f84adf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9466 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 ZTu|wpw29ob-ErYh`U(2mxS5ST{tI_}J0k!9 diff --git a/packages/RScript.1.0.6/lib/net461/RScript.dll b/packages/RScript.1.0.6/lib/net461/RScript.dll deleted file mode 100644 index 731e11dfaa67a7fe5a8fe75b73ced610db877421..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 34304 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 - - - -RScript - - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - The text representation of the element (e.g. '+', '/', 'myFunction', - '"my string constant"' etc.). - - - If true, then the element is surrounded by round brackets. For example, if the - script is 'a*(b+c)', then the element representing the '+' operator will have - 'bBracketed' set to true. - - - - Any formatting text that precedes the element. The formatting text may consist of spaces, - comments and new lines to make the script more readable for humans. For example, in the - example below, 'strprefix' for the 'myFunction' element shall be set to - "#comment1\n #comment2\n ". - - #comment1 - #comment2 - myFunction() - - --------------------------------------------------------------------------------------------- - TODO. - - as debug string. --------------------------------------------------------------------------------------------- - - - - The statement where this element is assigned. For example, for the following R script, on the 2nd line, the statement associated with 'a' will be 'a=1'. - - a=1 - b=a - - --------------------------------------------------------------------------------------------- - TODO. - - as debug string. --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - TODO. - - as debug string. --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - TODO. - - as debug string. --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - TODO. - - as debug string. --------------------------------------------------------------------------------------------- - - - TODO Add class summary. - - - The R statements in the script - - - The current state of the token parsing. - - --------------------------------------------------------------------------------------------- - Parses the R script in and populates the list of - R statements. - - This subroutine will accept, and correctly process all valid R. However, this - class does not attempt to validate . If it is not - valid R then this subroutine may still process the script without throwing an - exception. In this case, the list of R statements will be undefined. - - In other words, this subroutine will not generate false negatives (reject - valid R) but may generate false positives (accept invalid R). - - - The R script to parse. This must be valid R according to the - R language specification at - https://cran.r-project.org/doc/manuals/r-release/R-lang.html - (referenced 01 Feb 2021). --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - Returns as a list of its constituent lexemes. - A lexeme is a string of characters that represent a valid R element - (identifier, operator, keyword, seperator, bracket etc.). A lexeme does not - include any type information. - - This function identifies lexemes using a technique known as 'longest match' - or 'maximal munch'. It keeps adding characters to the lexeme one at a time - until it reaches a character that is not in the set of characters acceptable - for that lexeme. - - - The R script to convert (must be syntactically correct R). - - as a list of its constituent lexemes. --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - Returns as a list of tokens. - - A token is a string of characters that represent a valid R element, plus meta - data about the token type (identifier, operator, keyword, bracket etc.). - - - The list of lexemes to convert to tokens. - - as a list of tokens. --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - Returns this object as a valid, executable R script. - - The current state of this object as a valid, executable R script. --------------------------------------------------------------------------------------------- - - - TODO Add class summary. - - - If true, then when this R statement is converted to a script, then it will be - terminated with a newline (else if false then a semicolon) - - - - The assignment operator used in this statement (e.g. '=' in the statement 'a=b'). - If there is no assignment (e.g. as in 'myFunction(a)' then set to 'nothing'. - - - If this R statement is converted to a script, then contains the formatting - string that will prefix the assignment operator. - This is typically used to insert spaces before the assignment operator to line - up the assignment operators in a list of assignments. For example: - - shortName = 1 - veryLongName = 2 - - - - If this R statement is converted to a script, then contains the formatting - string that will be placed at the end of the statement. - This is typically used to insert a comment at the end of the statement. - For example: - - a = b * 2 # comment1 - - - - The element assigned to by the statement (e.g. 'a' in the statement 'a=b'). - If there is no assignment (e.g. as in 'myFunction(a)' then set to 'nothing'. - - - The element assigned in the statement (e.g. 'b' in the statement 'a=b'). - If there is no assignment (e.g. as in 'myFunction(a)' then set to the top- - level element in the statement (e.g. 'myFunction'). - - - The relative precedence of the R operators. This is a two-dimensional array - because the operators are stored in groups together with operators that - have the same precedence. - - --------------------------------------------------------------------------------------------- - - Constructs an object representing a valid R statement. - Processes the tokens from from position - to the end of statement, end of script or end of list (whichever comes first). - - The list of R tokens to process - [in,out] The position in the list to start processing --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - - Returns this object as a valid, executable R statement. - The script may contain formatting information such as spaces, comments and extra new lines. - If this object was created by analysing original R script, then the returned script's - formatting will be as close as possible to the original. - The script may vary slightly because some formatting information is lost in the object - model. For lost formatting, the formatting will be done according to the guidelines in - https://style.tidyverse.org/syntax.html - The returned script will always show: - No spaces before commas - No spaces before brackets - No spaces before package ('::') and object ('$') operators - One space before parameter assignments ('=') - For example, 'pkg ::obj1 $obj2$fn1 (a ,b=1, c = 2 )' will be returned as - 'pkg::obj1$obj2$fn1(a, b =1, c = 2)' - - - The current state of this object as a valid, executable R statement. --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - Returns as an executable R script. - - The R element to convert to an executable R script. - The R element may be a function, operator, constant, - syntactic name, key word etc. - - as an executable R script. --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - Returns as an executable R script. - - The R element to convert to an executable R script. The R element - may have an associated package name, and a list of associated - objects e.g. 'pkg::obj1$obj2$fn1(a)'. - - as an executable R script. --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - - Iterates through the tokens in and makes each presentation - element a child of the next non-presentation element. - - A presentation element is an element that has no functionality and is only used to make - the script easier to read. It may be a block of spaces, a comment or a newline that does - not end a statement. - - For example, the list of tokens representing the following block of script: - - # comment1 - a =b # comment2 - - Will be structured as: - a - .."# comment1\n" - = - .." " - b - (endStatement) - .." # comment2" - - - The list of tokens to process. - - A token tree where presentation information is stored as a child of the next - non-presentation element. --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - - Iterates through the tokens in . - If the token is a '(' then it makes everything inside the brackets a child of the '(' token. - If the '(' belongs to a function then makes the '(' a child of the function. Brackets may - be nested. For example, '(a*(b+c))' is structured as: - ( - ..a - ..* - ..( - ....b - ....+ - ....c - ....) - ..) - - The token tree to restructure. - - A token tree restructured for round brackets. --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - - Traverses the tree of tokens in . If the token is a function name then it - makes the subsequent '(' a child of the function name token. - - The token tree to restructure. - - A token tree restructured for function names. --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - - Traverses the tree of tokens in . If the token is a ',' then it - makes everything up to the next ',' or ')' a child of the ',' token. Commas are used to - separate function parameters. Parameters between commas are optional. For example, - 'myFunction(a,,b)' is structured as: - myFunction ( - ..a - .., - .., - ....b - ....) - - - The token tree to restructure. - [in,out] The position in the list to start processing. - (Optional) True to processing comma. - - A token tree restructured for function commas. --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - - Iterates through all the possible operators in order of precedence. For each operator, - traverses the tree of tokens in . If the operator is found then - the operator's parameters (typically the tokens to the left and right of the operator) are - made children of the operator. For example, 'a*b+c' is structured as: - + - ..* - ....a - ....b - ..c - - The token tree to restructure. - - A token tree restructured for all the possible operators. --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - - Traverses the tree of tokens in . If one of the operators in - the group is found, then the operator's parameters - (typically the tokens to the left and right of the operator) are made children of the - operator. For example, 'a*b+c' is structured as: - + - ..* - ....a - ....b - ..c - - Edge case: This function cannot process the case where a binary operator is immediately - followed by a unary operator with the same or a lower precedence (e.g. 'a^-b', 'a+~b', - 'a~~b' etc.). This is because of the R default precedence rules. The workaround is to - enclose the unary operator in brackets (e.g. 'a^(-b)', 'a+(~b)', 'a~(~b)' etc.). - - The token tree to restructure. - The group of operators to search for in the tree. - - A token tree restructured for the specified group of operators. --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - Returns a clone of the next token in the list, - after . If there is no next token then throws - an error. - - The list of tokens. - The position of the current token in the list. - - A clone of the next token in the list. --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - Returns an R element object constructed from the - token. - - The token to convert into an R element object. - Dictionary containing all the current existing assignments. - The key is the name of the variable. The value is a reference - to the R statement that performed the assignment. - (Optional) True if the token is enclosed in brackets. - (Optional) The package name associated with the token. - (Optional) The formatting string that prefixes the package - name (e.g. spaces or comment lines). - (Optional) The list of objects associated with the token - (e.g. 'obj1$obj2$myFn()'). - - An R element object constructed from the - token. --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - Returns the package name token associated with the - package operator. - - Package operator ('::') token. - - The package name associated with the package - operator. --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - Returns the formatting prefix (spaces or comment lines) associated with the - package operator. If the package operator has no - associated formatting, then returns an empty string. - - Package operator ('::') token. - - The formatting prefix (spaces or comment lines) associated with the - package operator. --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - - Returns a named parameter element constructed from the token - tree. The top-level element in the token tree may be: - 'value' e.g. for fn(a) - '=' e.g. for 'fn(a=1)' - ',' e.g. for 'fn(a,b) or 'fn(a=1,b,,c,)' - ')' indicates the end of the parameter list, returns nothing - - - The token tree to convert into a named parameter element. - Dictionary containing all the current existing assignments. - The key is the name of the variable. The value is a reference - to the R statement that performed the assignment. - - A named parameter element constructed from the token - tree. --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - Returns the first child of that is not a - presentation token or a close bracket ')'. - - The token tree to search for non-presentation children. - - The first child of that is not a presentation token - or a close bracket ')'. --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - Returns a parameter element constructed from the - token tree. - - The token tree to convert into a parameter element. - Dictionary containing all the current existing assignments. - The key is the name of the variable. The value is a reference - to the R statement that performed the assignment. - - A parameter element constructed from the token tree. --------------------------------------------------------------------------------------------- - - - The different types of R element (function name, key word, comment etc.) - that the token may represent. - - - The lexeme associated with the token. - - - The token type (function name, key word, comment etc.). - - - The token's children. - - --------------------------------------------------------------------------------------------- - - Constructs a new token with lexeme and token type - . - - A token is a string of characters that represent a valid R element, plus meta data about - the token type (identifier, operator, keyword, bracket etc.). - - - - The lexeme to associate with the token. - The token type (function name, key word, comment etc.). --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - - Constructs a token from . - - A token is a string of characters that represent a valid R element, plus meta data about - the token type (identifier, operator, keyword, bracket etc.). - - and are needed - to correctly identify if is a unary or binary - operator. - - - The non-space lexeme immediately to the left of - . - The lexeme to convert to a token. - The non-space lexeme immediately to the right of - . - --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - Creates and returns a clone of this object. - - Thrown when the object has an empty child token. - - A clone of this object. --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - Returns true if is a valid lexeme (either partial or - complete), else returns false. - - - A sequence of characters from a syntactically correct R script - - True if is a valid lexeme, else false. --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - Returns true if is a complete or partial - valid R syntactic name or key word, else returns false. - Please note that the rules for syntactic names are actually stricter than - the rules used in this function, but this library assumes it is parsing valid - R code. - - The text to check. - - True if is a valid R syntactic name or key word, - else returns false. --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - Returns true if is a complete or partial string - constant, else returns false. - String constants are delimited by a pair of single (‘'’), double (‘"’) - or backtick ('`') quotes and can contain all other printable characters. - Quotes and other special characters within strings are specified using escape - sequences. - - The text to check. - - True if is a complete or partial string constant, - else returns false. --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - Returns true if is a comment, else returns false. - - Any text from a # character to the end of the line is taken to be a comment, - unless the # character is inside a quoted string. - - The text to check. - - True if is a comment, else returns false. --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - Returns true if is sequence of spaces (and no other - characters), else returns false. - - The text to check . - - True if is sequence of spaces (and no other - characters), else returns false. --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - Returns true if is a functional R element - (i.e. not empty, and not a space, comment or new line), else returns false. - - The text to check . - - True if is a functional R element - (i.e. not a space, comment or new line), else returns false. --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - Returns true if is a complete or partial - user-defined operator, else returns false. - - The text to check. - - True if is a complete or partial - user-defined operator, else returns false. --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - Returns true if is a resrved operator, else returns - false. - - The text to check. - - True if is a reserved operator, else returns false. - --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - Returns true if is a bracket operator, else returns - false. - - The text to check. - - True if is a bracket operator, else returns false. - --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - Returns true if is a unary operator, else returns - false. - - The text to check. - - True if is a unary operator, else returns false. - --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - Returns true if is a bracket, else returns - false. - - The text to check. - - True if is a bracket, else returns false. - --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - Returns true if is a new line, else returns - false. - - The text to check. - - True if is a new line, else returns false. - --------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------- - Returns true if is a key word, else returns - false. - - The text to check. - - True if is a key word, else returns false. - --------------------------------------------------------------------------------------------- - - - From fd1d50e90c9e03aa764889206c59b0ba561b51f6 Mon Sep 17 00:00:00 2001 From: Stephen Lloyd Date: Sun, 24 Sep 2023 10:12:48 +0200 Subject: [PATCH 11/44] checked out from PR #8494 branch --- instat/ucrScript.Designer.vb | 68 ++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/instat/ucrScript.Designer.vb b/instat/ucrScript.Designer.vb index 8721a9711a3..4b5e8b5c6dd 100644 --- a/instat/ucrScript.Designer.vb +++ b/instat/ucrScript.Designer.vb @@ -49,7 +49,7 @@ Partial Class ucrScript Me.mnuSelectAll = New System.Windows.Forms.ToolStripMenuItem() Me.mnuClear = New System.Windows.Forms.ToolStripMenuItem() Me.ToolStripSeparator2 = New System.Windows.Forms.ToolStripSeparator() - Me.mnuRunCurrentLineSelection = New System.Windows.Forms.ToolStripMenuItem() + Me.mnuRunCurrentStatementSelection = New System.Windows.Forms.ToolStripMenuItem() Me.mnuRunAllText = New System.Windows.Forms.ToolStripMenuItem() Me.ToolStripSeparator3 = New System.Windows.Forms.ToolStripSeparator() Me.mnuOpenScriptasFile = New System.Windows.Forms.ToolStripMenuItem() @@ -67,7 +67,7 @@ Partial Class ucrScript Me.cmdHelp = New System.Windows.Forms.Button() Me.cmdClear = New System.Windows.Forms.Button() Me.cmdRunAll = New System.Windows.Forms.Button() - Me.cmdRunLineSelection = New System.Windows.Forms.Button() + Me.cmdRunStatementSelection = New System.Windows.Forms.Button() Me.TabControl = New System.Windows.Forms.TabControl() Me.toolTipScriptWindow = New System.Windows.Forms.ToolTip(Me.components) Me.mnuContextScript.SuspendLayout() @@ -78,115 +78,115 @@ Partial Class ucrScript 'mnuContextScript ' Me.mnuContextScript.ImageScalingSize = New System.Drawing.Size(24, 24) - Me.mnuContextScript.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuUndo, Me.mnuRedo, Me.ToolStripSeparator1, Me.mnuCut, Me.mnuCopy, Me.mnuPaste, Me.mnuSelectAll, Me.mnuClear, Me.ToolStripSeparator2, Me.mnuRunCurrentLineSelection, Me.mnuRunAllText, Me.ToolStripSeparator3, Me.mnuOpenScriptasFile, Me.mnuLoadScriptFromFile, Me.mnuSaveScript, Me.ToolStripSeparator4, Me.mnuHelp}) + Me.mnuContextScript.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuUndo, Me.mnuRedo, Me.ToolStripSeparator1, Me.mnuCut, Me.mnuCopy, Me.mnuPaste, Me.mnuSelectAll, Me.mnuClear, Me.ToolStripSeparator2, Me.mnuRunCurrentStatementSelection, Me.mnuRunAllText, Me.ToolStripSeparator3, Me.mnuOpenScriptasFile, Me.mnuLoadScriptFromFile, Me.mnuSaveScript, Me.ToolStripSeparator4, Me.mnuHelp}) Me.mnuContextScript.Name = "mnuContextLogFile" - Me.mnuContextScript.Size = New System.Drawing.Size(274, 314) + Me.mnuContextScript.Size = New System.Drawing.Size(306, 314) ' 'mnuUndo ' Me.mnuUndo.Name = "mnuUndo" Me.mnuUndo.ShortcutKeys = CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.Z), System.Windows.Forms.Keys) - Me.mnuUndo.Size = New System.Drawing.Size(273, 22) + Me.mnuUndo.Size = New System.Drawing.Size(305, 22) Me.mnuUndo.Text = "Undo" ' 'mnuRedo ' Me.mnuRedo.Name = "mnuRedo" Me.mnuRedo.ShortcutKeys = CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.Y), System.Windows.Forms.Keys) - Me.mnuRedo.Size = New System.Drawing.Size(273, 22) + Me.mnuRedo.Size = New System.Drawing.Size(305, 22) Me.mnuRedo.Text = "Redo" ' 'ToolStripSeparator1 ' Me.ToolStripSeparator1.Name = "ToolStripSeparator1" - Me.ToolStripSeparator1.Size = New System.Drawing.Size(270, 6) + Me.ToolStripSeparator1.Size = New System.Drawing.Size(302, 6) ' 'mnuCut ' Me.mnuCut.Name = "mnuCut" Me.mnuCut.ShortcutKeys = CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.X), System.Windows.Forms.Keys) - Me.mnuCut.Size = New System.Drawing.Size(273, 22) + Me.mnuCut.Size = New System.Drawing.Size(305, 22) Me.mnuCut.Text = "Cut" ' 'mnuCopy ' Me.mnuCopy.Name = "mnuCopy" Me.mnuCopy.ShortcutKeys = CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.C), System.Windows.Forms.Keys) - Me.mnuCopy.Size = New System.Drawing.Size(273, 22) + Me.mnuCopy.Size = New System.Drawing.Size(305, 22) Me.mnuCopy.Text = "Copy" ' 'mnuPaste ' Me.mnuPaste.Name = "mnuPaste" Me.mnuPaste.ShortcutKeys = CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.V), System.Windows.Forms.Keys) - Me.mnuPaste.Size = New System.Drawing.Size(273, 22) + Me.mnuPaste.Size = New System.Drawing.Size(305, 22) Me.mnuPaste.Text = "Paste" ' 'mnuSelectAll ' Me.mnuSelectAll.Name = "mnuSelectAll" Me.mnuSelectAll.ShortcutKeys = CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.A), System.Windows.Forms.Keys) - Me.mnuSelectAll.Size = New System.Drawing.Size(273, 22) + Me.mnuSelectAll.Size = New System.Drawing.Size(305, 22) Me.mnuSelectAll.Text = "Select All" ' 'mnuClear ' Me.mnuClear.Name = "mnuClear" Me.mnuClear.ShortcutKeys = CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.L), System.Windows.Forms.Keys) - Me.mnuClear.Size = New System.Drawing.Size(273, 22) + Me.mnuClear.Size = New System.Drawing.Size(305, 22) Me.mnuClear.Text = "Clear All" ' 'ToolStripSeparator2 ' Me.ToolStripSeparator2.Name = "ToolStripSeparator2" - Me.ToolStripSeparator2.Size = New System.Drawing.Size(270, 6) + Me.ToolStripSeparator2.Size = New System.Drawing.Size(302, 6) ' - 'mnuRunCurrentLineSelection + 'mnuRunCurrentStatementSelection ' - Me.mnuRunCurrentLineSelection.Name = "mnuRunCurrentLineSelection" - Me.mnuRunCurrentLineSelection.Size = New System.Drawing.Size(273, 22) - Me.mnuRunCurrentLineSelection.Text = "Run Current Line/Selection Ctrl+Enter" + Me.mnuRunCurrentStatementSelection.Name = "mnuRunCurrentStatementSelection" + Me.mnuRunCurrentStatementSelection.Size = New System.Drawing.Size(305, 22) + Me.mnuRunCurrentStatementSelection.Text = "Run Current Statement/Selection Ctrl+Enter" ' 'mnuRunAllText ' Me.mnuRunAllText.Name = "mnuRunAllText" Me.mnuRunAllText.ShortcutKeys = CType(((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.Alt) _ Or System.Windows.Forms.Keys.R), System.Windows.Forms.Keys) - Me.mnuRunAllText.Size = New System.Drawing.Size(273, 22) + Me.mnuRunAllText.Size = New System.Drawing.Size(305, 22) Me.mnuRunAllText.Text = "Run All Text" ' 'ToolStripSeparator3 ' Me.ToolStripSeparator3.Name = "ToolStripSeparator3" - Me.ToolStripSeparator3.Size = New System.Drawing.Size(270, 6) + Me.ToolStripSeparator3.Size = New System.Drawing.Size(302, 6) ' 'mnuOpenScriptasFile ' Me.mnuOpenScriptasFile.Name = "mnuOpenScriptasFile" - Me.mnuOpenScriptasFile.Size = New System.Drawing.Size(273, 22) + Me.mnuOpenScriptasFile.Size = New System.Drawing.Size(305, 22) Me.mnuOpenScriptasFile.Text = "Open Script as File" ' 'mnuLoadScriptFromFile ' Me.mnuLoadScriptFromFile.Name = "mnuLoadScriptFromFile" - Me.mnuLoadScriptFromFile.Size = New System.Drawing.Size(273, 22) + Me.mnuLoadScriptFromFile.Size = New System.Drawing.Size(305, 22) Me.mnuLoadScriptFromFile.Text = "Load Script from File..." ' 'mnuSaveScript ' Me.mnuSaveScript.Name = "mnuSaveScript" - Me.mnuSaveScript.Size = New System.Drawing.Size(273, 22) + Me.mnuSaveScript.Size = New System.Drawing.Size(305, 22) Me.mnuSaveScript.Text = "Save Script..." ' 'ToolStripSeparator4 ' Me.ToolStripSeparator4.Name = "ToolStripSeparator4" - Me.ToolStripSeparator4.Size = New System.Drawing.Size(270, 6) + Me.ToolStripSeparator4.Size = New System.Drawing.Size(302, 6) ' 'mnuHelp ' Me.mnuHelp.Name = "mnuHelp" - Me.mnuHelp.Size = New System.Drawing.Size(273, 22) + Me.mnuHelp.Size = New System.Drawing.Size(305, 22) Me.mnuHelp.Text = "Help" ' 'lblHeaderScript @@ -231,7 +231,7 @@ Partial Class ucrScript Me.Panel.Controls.Add(Me.cmdHelp) Me.Panel.Controls.Add(Me.cmdClear) Me.Panel.Controls.Add(Me.cmdRunAll) - Me.Panel.Controls.Add(Me.cmdRunLineSelection) + Me.Panel.Controls.Add(Me.cmdRunStatementSelection) Me.Panel.Dock = System.Windows.Forms.DockStyle.Fill Me.Panel.Location = New System.Drawing.Point(3, 23) Me.Panel.Name = "Panel" @@ -301,14 +301,14 @@ Partial Class ucrScript Me.cmdRunAll.Text = "Run All" Me.cmdRunAll.UseVisualStyleBackColor = True ' - 'cmdRunLineSelection + 'cmdRunStatementSelection ' - Me.cmdRunLineSelection.Location = New System.Drawing.Point(2, 1) - Me.cmdRunLineSelection.Name = "cmdRunLineSelection" - Me.cmdRunLineSelection.Size = New System.Drawing.Size(55, 23) - Me.cmdRunLineSelection.TabIndex = 0 - Me.cmdRunLineSelection.Text = "Run" - Me.cmdRunLineSelection.UseVisualStyleBackColor = True + Me.cmdRunStatementSelection.Location = New System.Drawing.Point(2, 1) + Me.cmdRunStatementSelection.Name = "cmdRunStatementSelection" + Me.cmdRunStatementSelection.Size = New System.Drawing.Size(55, 23) + Me.cmdRunStatementSelection.TabIndex = 0 + Me.cmdRunStatementSelection.Text = "Run" + Me.cmdRunStatementSelection.UseVisualStyleBackColor = True ' 'TabControl ' @@ -345,12 +345,12 @@ Partial Class ucrScript Friend WithEvents mnuCut As ToolStripMenuItem Friend WithEvents mnuPaste As ToolStripMenuItem Friend WithEvents mnuRunAllText As ToolStripMenuItem - Friend WithEvents mnuRunCurrentLineSelection As ToolStripMenuItem + Friend WithEvents mnuRunCurrentStatementSelection As ToolStripMenuItem Friend WithEvents ToolStripSeparator4 As ToolStripSeparator Friend WithEvents mnuHelp As ToolStripMenuItem Friend WithEvents Panel As Panel Friend WithEvents cmdRunAll As Button - Friend WithEvents cmdRunLineSelection As Button + Friend WithEvents cmdRunStatementSelection As Button Friend WithEvents toolTipScriptWindow As ToolTip Friend WithEvents cmdClear As Button Friend WithEvents cmdHelp As Button From 600497f50db32a87103e9a3ee1d0474febacf3e3 Mon Sep 17 00:00:00 2001 From: Stephen Lloyd Date: Sun, 24 Sep 2023 10:13:20 +0200 Subject: [PATCH 12/44] Integrated changes from PR #8494 --- instat/clsRLink.vb | 123 ++++++++++++++++++-------------------------- instat/dlgScript.vb | 2 +- instat/ucrScript.vb | 82 +++++++++++++++++++---------- 3 files changed, 106 insertions(+), 101 deletions(-) diff --git a/instat/clsRLink.vb b/instat/clsRLink.vb index 76c2baca7d9..f2276bd953f 100644 --- a/instat/clsRLink.vb +++ b/instat/clsRLink.vb @@ -715,6 +715,50 @@ Public Class RLink End Function + '''-------------------------------------------------------------------------------------------- + ''' TODO. + ''' + ''' + ''' TODO. + '''-------------------------------------------------------------------------------------------- + Public Sub RunRStatement(clsRStatement As clsRStatement) + + Dim strRStatement = clsRStatement.GetAsExecutableScript() + + 'if there is no script to run then just ignore and exit sub + If String.IsNullOrWhiteSpace(strRStatement) Then + Exit Sub + End If + + frmMain.ucrScriptWindow.LogText(strRStatement.TrimEnd(vbCr, vbLf)) + Try + Dim strOutput As String = "" + Dim bSuccess As Boolean = Evaluate(strRStatement, bSilent:=False, bSeparateThread:=False, + bShowWaitDialogOverride:=Nothing) + + 'if not an assignment operation, then capture the output + If clsRStatement.clsAssignment Is Nothing AndAlso bSuccess Then + strOutput = GetFileOutput("view_object_data(object = " & + clsRStatement.GetAsExecutableScript(bIncludeFormatting:=False) & + " , object_format = 'text' )", bSilent:=False, + bSeparateThread:=False, bShowWaitDialogOverride:=Nothing) + End If + + 'log script and output + clsOutputLogger.AddOutput(strRStatement, strOutput, bAsFile:=True, + bDisplayOutputInExternalViewer:=False) + + Catch e As Exception + MsgBox(e.Message & Environment.NewLine & + "The error occurred in attempting to run the following R command:" & + Environment.NewLine & strRStatement, MsgBoxStyle.Critical, + "Error running R command") + End Try + + AppendToAutoSaveLog(strRStatement) + frmMain.UpdateAllGrids() + End Sub + '''-------------------------------------------------------------------------------------------- ''' ''' This method executes the R script(s) and displays the output. The @@ -865,7 +909,8 @@ Public Class RLink ''' ''' Gets the file path name if file is available and has contents, else returns an empty string ''' - ''' Script that produces a file output + ''' Script that produces a file output. The last line of the script + ''' must be a single line R statement that generates output. ''' ''' ''' @@ -890,76 +935,6 @@ Public Class RLink Return strFilePath End Function - '''-------------------------------------------------------------------------------------------- - ''' This method executes the R script and displays - ''' the output as text or graph (determined by ). - ''' R commands may be split over multiple lines. This is only allowed if the - ''' non-final line ends with '+', ',', or '%>%'; or there are one or more '{' - ''' brackets that have not been closed with an equivalent '}' bracket. - ''' This function is named '...FromWindow' because it's designed to execute scripts - ''' entered by a human from a dialog window (e.g. a script window). These scripts - ''' may contain R commands split over multiple lines to make the commands more - ''' readable. - ''' - ''' The R script to execute. - ''' Shown as a comment. If this parameter is "" then shows - ''' as the comment. - ''' - ''' Any text at the end of that was not executed. - ''' If all the text in was executed then returns "". - ''' - '''-------------------------------------------------------------------------------------------- - Public Function RunScriptFromWindow(strNewScript As String, strNewComment As String) As String - Dim strScriptCmd As String = "" - - - 'for each line in script - For Each strScriptLine As String In strNewScript.Split(Environment.NewLine) - 'remove any comments (character '#' and anything after) - Dim iCommentPos As Integer = strScriptLine.IndexOf("#") - Select Case iCommentPos - Case 0 'a normal comment line (starts with '#') - Continue For - Case Is > 0 ' a line with an appended comment (e.g. 'x <- 1 # generate data' converted to 'x <- 1 ') - strScriptLine = strScriptLine.Substring(0, iCommentPos - 1) - End Select - - 'if line is empty or only whitespace then ignore line - Dim strTrimmedLine As String = strScriptLine.Trim(vbLf).Trim() - If strTrimmedLine.Length <= 0 Then - Continue For - End If - - 'else append line of script to command - strScriptCmd &= strScriptLine - - 'if line ends in a '+', ',', or '%>%'; or there are open curly braces; or open quotations, - ' then assume command is not complete - Dim cLastChar As Char = strTrimmedLine.Last - Dim strLast3Chars As String = "" - Dim iNumOpenRound As Integer = strScriptCmd.Where(Function(c) c = "("c).Count - Dim iNumClosedRound As Integer = strScriptCmd.Where(Function(c) c = ")"c).Count - Dim iNumOpenCurlies As Integer = strScriptCmd.Where(Function(c) c = "{"c).Count - Dim iNumClosedCurlies As Integer = strScriptCmd.Where(Function(c) c = "}"c).Count - Dim iNumDoubleQuotes As Integer = strScriptCmd.Where(Function(c) c = """"c).Count - If strTrimmedLine.Length >= 3 Then - strLast3Chars = strTrimmedLine.Substring(strTrimmedLine.Length - 3) - End If - If cLastChar = "+" OrElse cLastChar = "," OrElse strLast3Chars = "%>%" _ - OrElse iNumOpenRound <> iNumClosedRound _ - OrElse iNumOpenCurlies <> iNumClosedCurlies _ - OrElse iNumDoubleQuotes Mod 2 Then - Continue For - End If - - 'else execute command - RunScript(strScriptCmd.Trim(vbLf), iCallType:=5, strComment:=strNewComment, bSeparateThread:=False, bSilent:=False) - strScriptCmd = "" - strNewComment = "" - Next - Return strScriptCmd - End Function - '''-------------------------------------------------------------------------------------------- ''' Executes the the R script and returns the result ''' as a 'SymbolicExpression' object. @@ -2167,13 +2142,13 @@ Public Class RLink 'check to remove the [1] notation before some parameter values If expTemp.AsCharacter(iParameterValue).Contains("[1]") Then Dim strcleanArgument As String = expTemp.AsCharacter(iParameterValue).Remove(expTemp.AsCharacter(iParameterValue).IndexOf("["), 3) - clsNewRParameter.clsArgValueDefault = New clsRScript(strcleanArgument).lstRStatements(0).clsElement + clsNewRParameter.clsArgValueDefault = New clsRScript(strcleanArgument).dctRStatements(0).clsElement Else 'Empty String are Not accepted hence the modification below If String.IsNullOrEmpty(expTemp.AsCharacter(iParameterValue)) Then - clsNewRParameter.clsArgValueDefault = New clsRScript("NODEFAULTVALUE").lstRStatements(0).clsElement + clsNewRParameter.clsArgValueDefault = New clsRScript("NODEFAULTVALUE").dctRStatements(0).clsElement Else - clsNewRParameter.clsArgValueDefault = New clsRScript(expTemp.AsCharacter(iParameterValue)).lstRStatements(0).clsElement + clsNewRParameter.clsArgValueDefault = New clsRScript(expTemp.AsCharacter(iParameterValue)).dctRStatements(0).clsElement End If End If diff --git a/instat/dlgScript.vb b/instat/dlgScript.vb index 1c929fb7f78..feb172ad9fc 100644 --- a/instat/dlgScript.vb +++ b/instat/dlgScript.vb @@ -192,7 +192,7 @@ Public Class dlgScript End Sub Private Sub ucrBase_ClickOk(sender As Object, e As EventArgs) Handles ucrBase.ClickOk - frmMain.clsRLink.RunScriptFromWindow(strNewScript:=txtScript.Text, strNewComment:=strComment) + frmMain.clsRLink.RunScript(txtScript.Text.Trim(vbLf), iCallType:=5, strComment:=strComment, bSeparateThread:=False, bSilent:=False) End Sub Private Sub ucrPnlGetData_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlGetData.ControlValueChanged diff --git a/instat/ucrScript.vb b/instat/ucrScript.vb index 18ed4a10d54..289b77c5a15 100644 --- a/instat/ucrScript.vb +++ b/instat/ucrScript.vb @@ -14,8 +14,10 @@ ' You should have received a copy of the GNU General Public License ' along with this program. If not, see . +Imports System.Collections.Specialized Imports System.IO Imports System.Windows.Controls +Imports RScript Imports ScintillaNET Public Class ucrScript @@ -41,7 +43,7 @@ Public Class ucrScript Private Sub ucrScript_Load(sender As Object, e As EventArgs) Handles Me.Load - toolTipScriptWindow.SetToolTip(cmdRunLineSelection, "Run the current line or selection. (Ctrl+Enter)") + toolTipScriptWindow.SetToolTip(cmdRunStatementSelection, "Run the current statement or selection. (Ctrl+Enter)") toolTipScriptWindow.SetToolTip(cmdRunAll, "Run all the text in the tab. (Ctrl+Alt+R)") toolTipScriptWindow.SetToolTip(cmdLoadScript, "Load a script from file into the current tab.") toolTipScriptWindow.SetToolTip(cmdSave, "Save the script in the current tab to a file.") @@ -57,7 +59,7 @@ Public Class ucrScript mnuPaste.ToolTipText = "Paste the contents of the clipboard into the current tab. (Ctrl+V)" mnuSelectAll.ToolTipText = "Select all the contents of the current tab. (Ctrl+A)" mnuClear.ToolTipText = "Clear the contents of the current tab. (Ctrl+L)" - mnuRunCurrentLineSelection.ToolTipText = "Run the current line or selection. (Ctrl+Enter)" + mnuRunCurrentStatementSelection.ToolTipText = "Run the current statement or selection. (Ctrl+Enter)" mnuRunAllText.ToolTipText = "Run all the text in the tab. (Ctrl+Alt+R)" mnuOpenScriptasFile.ToolTipText = "Save file to log folder and open file in external editor." mnuLoadScriptFromFile.ToolTipText = "Load script from file into the current tab." @@ -65,7 +67,7 @@ Public Class ucrScript mnuHelp.ToolTipText = "Display the Script Window help information." 'normally we would do this in the designer, but designer doesn't allow enter key as shortcut - mnuRunCurrentLineSelection.ShortcutKeys = Keys.Enter Or Keys.Control + mnuRunCurrentStatementSelection.ShortcutKeys = Keys.Enter Or Keys.Control 'Make the log tab the selected tab TabControl.SelectTab(iTabIndexLog) @@ -288,7 +290,7 @@ Public Class ucrScript Dim bIsLogTab As Boolean = TabControl.SelectedIndex = iTabIndexLog Dim bScriptExists As Boolean = clsScriptActive.TextLength > 0 - cmdRunLineSelection.Enabled = bScriptExists + cmdRunStatementSelection.Enabled = bScriptExists cmdRunAll.Enabled = bScriptExists cmdLoadScript.Enabled = Not bIsLogTab cmdSave.Enabled = bScriptExists @@ -298,7 +300,7 @@ Public Class ucrScript End Sub Private Sub EnableRunButtons(bEnable As Boolean) - cmdRunLineSelection.Enabled = bEnable + cmdRunStatementSelection.Enabled = bEnable cmdRunAll.Enabled = bEnable End Sub @@ -314,7 +316,7 @@ Public Class ucrScript mnuPaste.Enabled = bEnable mnuSelectAll.Enabled = bEnable mnuClear.Enabled = bEnable - mnuRunCurrentLineSelection.Enabled = bEnable + mnuRunCurrentStatementSelection.Enabled = bEnable mnuRunAllText.Enabled = bEnable mnuLoadScriptFromFile.Enabled = bEnable mnuOpenScriptasFile.Enabled = bEnable @@ -600,24 +602,52 @@ Public Class ucrScript Return clsNewScript End Function - Private Sub RunCurrentLine() - Static strScriptCmd As String = "" 'static so that script can be added to with successive calls of this function + Private Sub RunCurrentStatement() - If clsScriptActive.TextLength > 0 Then - Dim strLineTextString = clsScriptActive.Lines(clsScriptActive.CurrentLine).Text - strScriptCmd &= vbCrLf & strLineTextString 'insert carriage return to ensure that new text starts on new line - strScriptCmd = RunText(strScriptCmd) + If clsScriptActive.TextLength <= 0 Then + Exit Sub + End If - Dim iNextLinePos As Integer = clsScriptActive.Lines(clsScriptActive.CurrentLine).EndPosition - clsScriptActive.GotoPosition(iNextLinePos) + Dim dctRStatements As OrderedDictionary = New clsRScript(clsScriptActive.Text).dctRStatements + If dctRStatements.Count = 0 Then + Exit Sub End If - End Sub - Private Function RunText(strText As String) As String - Return If(Not String.IsNullOrEmpty(strText), - frmMain.clsRLink.RunScriptFromWindow(strNewScript:=strText, strNewComment:=strComment), - "") - End Function + Dim iCaretPos As Integer = clsScriptActive.CurrentPosition + Dim iNextStatementPos As Integer = 0 + Dim clsRStatement As clsRStatement = Nothing + + For Each kvpDictEntry As DictionaryEntry In dctRStatements + If kvpDictEntry.Key > iCaretPos Then + iNextStatementPos = kvpDictEntry.Key + Exit For + End If + clsRStatement = kvpDictEntry.Value + Next + + frmMain.clsRLink.RunRStatement(clsRStatement) + + ' if we executed the only/last statement + If iNextStatementPos = 0 Then + ' if there is no blank line at end of text, then add blank line + If Not (clsScriptActive.Text.EndsWith(vbCr) _ + OrElse clsScriptActive.Text.EndsWith(vbLf)) Then + clsScriptActive.AppendText(vbCrLf) + End If + iNextStatementPos = clsScriptActive.TextLength + + Else 'else move caret to first non-blank line of next statement + For iTextPos As Integer = iNextStatementPos To clsScriptActive.Text.Length - 1 + Dim chrNext As Char = clsScriptActive.Text.Chars(iTextPos) + If chrNext <> vbLf AndAlso chrNext <> vbCr Then + iNextStatementPos = iTextPos + Exit For + End If + Next + End If + + clsScriptActive.GotoPosition(iNextStatementPos) + End Sub '''-------------------------------------------------------------------------------------------- ''' @@ -714,7 +744,7 @@ Public Class ucrScript 'enable remaining options based on tab state mnuSelectAll.Enabled = bScriptExists - mnuRunCurrentLineSelection.Enabled = bScriptExists + mnuRunCurrentStatementSelection.Enabled = bScriptExists mnuRunAllText.Enabled = bScriptExists mnuOpenScriptasFile.Enabled = bScriptExists mnuSaveScript.Enabled = bScriptExists @@ -809,19 +839,19 @@ Public Class ucrScript EnableRunButtons(False) 'temporarily disable the run buttons in case its a long operation EnableRightClickMenuOptions(False) - RunText(clsScriptActive.Text) + frmMain.clsRLink.RunScript(clsScriptActive.Text.Trim(vbLf), iCallType:=5, strComment:=strComment, bSeparateThread:=False, bSilent:=False) EnableRunButtons(True) EnableRightClickMenuOptions(True) End Sub - Private Sub mnuRunCurrentLineSelection_Click(sender As Object, e As EventArgs) Handles mnuRunCurrentLineSelection.Click, cmdRunLineSelection.Click + Private Sub mnuRunCurrentStatementSelection_Click(sender As Object, e As EventArgs) Handles mnuRunCurrentStatementSelection.Click, cmdRunStatementSelection.Click 'temporarily disable the buttons in case its a long operation EnableRunButtons(False) EnableRightClickMenuOptions(False) If clsScriptActive.SelectedText.Length > 0 Then - RunText(clsScriptActive.SelectedText) + frmMain.clsRLink.RunScript(clsScriptActive.SelectedText.Trim(vbLf), iCallType:=5, strComment:=strComment, bSeparateThread:=False, bSilent:=False) Else - RunCurrentLine() + RunCurrentStatement() End If EnableRunButtons(True) EnableRightClickMenuOptions(True) @@ -869,7 +899,7 @@ Public Class ucrScript Next If IsNothing(clsScriptActive) Then - MsgBox("Developer error: could not find editor winfow in tab.") + MsgBox("Developer error: could not find editor window in tab.") End If End Sub From d9eb85d264cd161b9a24d71f31accb478538c624 Mon Sep 17 00:00:00 2001 From: Stephen Lloyd Date: Mon, 25 Sep 2023 16:47:51 +0200 Subject: [PATCH 13/44] allow script that cannot be parsed by RScript to run as simple string --- instat/clsRLink.vb | 159 +++++++++++++++++++++++++++++++++++++++++--- instat/dlgScript.vb | 2 +- instat/ucrScript.vb | 5 +- 3 files changed, 154 insertions(+), 12 deletions(-) diff --git a/instat/clsRLink.vb b/instat/clsRLink.vb index f2276bd953f..5c84cfdb742 100644 --- a/instat/clsRLink.vb +++ b/instat/clsRLink.vb @@ -759,6 +759,154 @@ Public Class RLink frmMain.UpdateAllGrids() End Sub + Public Sub RunScriptFromWindow(strScript As String, strComment As String) + + If String.IsNullOrWhiteSpace(strScript) Then + Exit Sub + End If + + 'Prefix comment to script + Dim strRStatement As String = "" + Dim strRStatementComment As String = If(String.IsNullOrEmpty(strComment), "", GetFormattedComment(strComment)) + + 'for each line in script + For Each strScriptLine As String In strScript.Split(Environment.NewLine) + + 'if line is empty or only whitespace then ignore line + Dim strTrimmedLine As String = strScriptLine.Trim(vbLf).Trim() + If strTrimmedLine.Length <= 0 Then + Continue For + End If + + 'remove any comments (character '#' and anything after) + Dim iCommentPos As Integer = strTrimmedLine.IndexOf("#") + Select Case iCommentPos + Case 0 'a normal comment line (starts with '#') + strRStatementComment &= If(String.IsNullOrEmpty(strRStatementComment), "", Environment.NewLine) _ + & strTrimmedLine + Continue For + Case Is > 0 ' a line with an appended comment (e.g. 'x <- 1 # generate data' converted to 'x <- 1 ') + strRStatementComment &= If(String.IsNullOrEmpty(strRStatementComment), "", Environment.NewLine) _ + & strTrimmedLine.Substring(strTrimmedLine.IndexOf("#"c)) + strTrimmedLine = strTrimmedLine.Substring(0, iCommentPos).Trim() + End Select + + 'else append line of script to command + strRStatement &= If(String.IsNullOrEmpty(strRStatement), "", Environment.NewLine) & strTrimmedLine + + 'if line ends in a '+', ',', or '%>%'; or there are open curly braces; or open quotations, + ' then assume command is not complete + Dim cLastChar As Char = strTrimmedLine.Last + Dim strLast3Chars As String = "" + Dim iNumOpenRound As Integer = strRStatement.Where(Function(c) c = "("c).Count + Dim iNumClosedRound As Integer = strRStatement.Where(Function(c) c = ")"c).Count + Dim iNumOpenCurlies As Integer = strRStatement.Where(Function(c) c = "{"c).Count + Dim iNumClosedCurlies As Integer = strRStatement.Where(Function(c) c = "}"c).Count + Dim iNumDoubleQuotes As Integer = strRStatement.Where(Function(c) c = """"c).Count + If strTrimmedLine.Length >= 3 Then + strLast3Chars = strTrimmedLine.Substring(strTrimmedLine.Length - 3) + End If + If cLastChar = "+" OrElse cLastChar = "," OrElse strLast3Chars = "%>%" _ + OrElse iNumOpenRound <> iNumClosedRound _ + OrElse iNumOpenCurlies <> iNumClosedCurlies _ + OrElse iNumDoubleQuotes Mod 2 Then + Continue For + End If + + 'We now have what we think is a complete R statement, so try and execute it + Try + Dim strOutput As String = "" + Dim bAsFile As Boolean = True + Dim bDisplayOutputInExternalViewer As Boolean = False + + If strRStatement.StartsWith(strInstatDataObject & "$get_object_data") _ + OrElse strRStatement.StartsWith(strInstatDataObject & "$get_last_object_data") _ + OrElse strRStatement.StartsWith("view_object_data") Then + strOutput = GetFileOutput(strRStatement, False, False, Nothing) + 'if statement generates a view_object then display in external viewer (maximised) + bDisplayOutputInExternalViewer = strRStatement.Contains("view_object_data") + ElseIf strRStatement.StartsWith("print") Then + bAsFile = False + Evaluate(strRStatement, bSilent:=False, bSeparateThread:=False, bShowWaitDialogOverride:=Nothing) + ElseIf Not strRStatement.Contains("<-") Then 'if not an assignment operation, then capture the output + Dim strRStatementAsSingleLine As String = strRStatement.Replace(vbCr, String.Empty) + strRStatementAsSingleLine = strRStatementAsSingleLine.Replace(vbLf, String.Empty) + 'wrap final command inside view_object_data just in case there is an output object + strOutput = GetFileOutput("view_object_data(object = " & strRStatementAsSingleLine & " , object_format = 'text' )", False, False, Nothing) + Else + Evaluate(strRStatement, bSilent:=False, bSeparateThread:=False, bShowWaitDialogOverride:=Nothing) + End If + + clsOutputLogger.AddOutput(strRStatementComment & If(String.IsNullOrEmpty(strRStatementComment), "", Environment.NewLine) & strRStatement, strOutput, bAsFile, bDisplayOutputInExternalViewer) + + Catch e As Exception + MsgBox(e.Message & Environment.NewLine & + "The error occurred in attempting to run the following R command(s):" & + Environment.NewLine & + strRStatement, MsgBoxStyle.Critical, "Error running R command(s)") + End Try + + AppendToAutoSaveLog(strRStatementComment & If(String.IsNullOrEmpty(strRStatementComment), "", Environment.NewLine) & strRStatement & Environment.NewLine) + frmMain.UpdateAllGrids() + + strRStatement = "" + strRStatementComment = "" + Next + + 'log script and output + Dim strScriptWithComment As String = If(String.IsNullOrEmpty(strComment), strScript, GetFormattedComment(strComment) & Environment.NewLine & strScript) + frmMain.ucrScriptWindow.LogText(strScriptWithComment & Environment.NewLine) + + ''Prefix comment to script + 'Dim strScriptWithComment As String = If(String.IsNullOrEmpty(strComment), strScript, GetFormattedComment(strComment) & Environment.NewLine & strScript) + + 'frmMain.ucrScriptWindow.LogText(strScriptWithComment & Environment.NewLine) + + 'Try + ' Dim strOutput As String = "" + ' Dim bAsFile As Boolean = True + ' Dim bDisplayOutputInExternalViewer As Boolean = False + + ' 'exclude lines not needed for execution e.g comments, empty lines. + ' Dim arrExecutableRScriptLines() As String = GetRunnableCommandLines(strScript) + ' If arrExecutableRScriptLines.Length > 0 Then + ' 'get the last R script command. todo, this should eventually use the RScript library functions to identify the last R script command + ' Dim strLastScript As String = arrExecutableRScriptLines.Last() + ' If strLastScript.StartsWith(strInstatDataObject & "$get_object_data") _ + ' OrElse strLastScript.StartsWith(strInstatDataObject & "$get_last_object_data") _ + ' OrElse strLastScript.StartsWith("view_object_data") Then + ' strOutput = GetFileOutput(strScript, False, False, Nothing) + ' 'if last function is view_object then display in external viewer (maximised) + ' bDisplayOutputInExternalViewer = strLastScript.Contains("view_object_data") + + ' ElseIf strLastScript.StartsWith("print") Then + ' bAsFile = False + ' Evaluate(strScript, bSilent:=False, bSeparateThread:=False, bShowWaitDialogOverride:=Nothing) + ' Else + ' 'else if script comes from script window + ' Dim bSuccess As Boolean = Evaluate(strScript, bSilent:=False, bSeparateThread:=False, bShowWaitDialogOverride:=Nothing) + + ' 'if not an assignment operation, then capture the output + ' If Not strScript.Contains("<-") AndAlso bSuccess Then + ' Dim strScriptAsSingleLine As String = strScript.Replace(vbCrLf, String.Empty) + ' strScriptAsSingleLine = strScriptAsSingleLine.Replace(vbCr, String.Empty) + ' strScriptAsSingleLine = strScriptAsSingleLine.Replace(vbLf, String.Empty) + ' 'wrap final command inside view_object_data just incase there is an output object + ' strOutput = GetFileOutput("view_object_data(object = " & strScriptAsSingleLine & " , object_format = 'text' )", False, False, Nothing) + ' End If + ' End If + ' End If + + + ' 'log script and output + ' clsOutputLogger.AddOutput(strScriptWithComment, strOutput, bAsFile, bDisplayOutputInExternalViewer) + + 'Catch e As Exception + ' MsgBox(e.Message & Environment.NewLine & "The error occurred in attempting to run the following R command(s):" & Environment.NewLine & strScript, MsgBoxStyle.Critical, "Error running R command(s)") + 'End Try + + End Sub + '''-------------------------------------------------------------------------------------------- ''' ''' This method executes the R script(s) and displays the output. The @@ -838,10 +986,9 @@ Public Class RLink If arrExecutableRScriptLines.Length > 0 Then 'get the last R script command. todo, this should eventually use the RScript library functions to identify the last R script command Dim strLastScript As String = arrExecutableRScriptLines.Last() - If strLastScript.StartsWith(strInstatDataObject & "$get_object_data") OrElse - strLastScript.StartsWith(strInstatDataObject & "$get_last_object_data") OrElse - strLastScript.StartsWith("view_object_data") Then - + If strLastScript.StartsWith(strInstatDataObject & "$get_object_data") _ + OrElse strLastScript.StartsWith(strInstatDataObject & "$get_last_object_data") _ + OrElse strLastScript.StartsWith("view_object_data") Then strOutput = GetFileOutput(strScript, bSilent, bSeparateThread, bShowWaitDialogOverride) 'if last function is view_object then display in external viewer (maximised) bDisplayOutputInExternalViewer = strLastScript.Contains("view_object_data") @@ -866,10 +1013,6 @@ Public Class RLink If expTemp IsNot Nothing Then strOutput = String.Join(Environment.NewLine, expTemp.AsCharacter()) & Environment.NewLine End If - ElseIf iCallType = 5 Then - 'else if script comes from script window - 'wrap command inside view_object_data just incase there is an output object - strOutput = GetFileOutput("view_object_data(object = " & strScript & " , object_format = 'text' )", bSilent, bSeparateThread, bShowWaitDialogOverride) Else 'else if script output should not be ignored or not stored as an object or variable diff --git a/instat/dlgScript.vb b/instat/dlgScript.vb index feb172ad9fc..0fc7d6eb369 100644 --- a/instat/dlgScript.vb +++ b/instat/dlgScript.vb @@ -192,7 +192,7 @@ Public Class dlgScript End Sub Private Sub ucrBase_ClickOk(sender As Object, e As EventArgs) Handles ucrBase.ClickOk - frmMain.clsRLink.RunScript(txtScript.Text.Trim(vbLf), iCallType:=5, strComment:=strComment, bSeparateThread:=False, bSilent:=False) + frmMain.clsRLink.RunScriptFromWindow(txtScript.Text.Trim(vbLf), strComment:=strComment) End Sub Private Sub ucrPnlGetData_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlGetData.ControlValueChanged diff --git a/instat/ucrScript.vb b/instat/ucrScript.vb index 289b77c5a15..ed8d119b396 100644 --- a/instat/ucrScript.vb +++ b/instat/ucrScript.vb @@ -25,7 +25,6 @@ Public Class ucrScript Private bIsTextChanged = False Private iMaxLineNumberCharLength As Integer = 0 Private Const iTabIndexLog As Integer = 0 - Private Const strComment As String = "Code run from Script Window" Private strRInstatLogFilesFolderPath As String = Path.Combine(Path.GetFullPath(FileIO.SpecialDirectories.MyDocuments), "R-Instat_Log_files") Friend WithEvents clsScriptActive As Scintilla @@ -839,7 +838,7 @@ Public Class ucrScript EnableRunButtons(False) 'temporarily disable the run buttons in case its a long operation EnableRightClickMenuOptions(False) - frmMain.clsRLink.RunScript(clsScriptActive.Text.Trim(vbLf), iCallType:=5, strComment:=strComment, bSeparateThread:=False, bSilent:=False) + frmMain.clsRLink.RunScriptFromWindow(clsScriptActive.Text.Trim(vbLf), "Code run from Script Window (all text)") EnableRunButtons(True) EnableRightClickMenuOptions(True) End Sub @@ -849,7 +848,7 @@ Public Class ucrScript EnableRunButtons(False) EnableRightClickMenuOptions(False) If clsScriptActive.SelectedText.Length > 0 Then - frmMain.clsRLink.RunScript(clsScriptActive.SelectedText.Trim(vbLf), iCallType:=5, strComment:=strComment, bSeparateThread:=False, bSilent:=False) + frmMain.clsRLink.RunScriptFromWindow(clsScriptActive.SelectedText.Trim(vbLf), "Code run from Script Window (selected text)") Else RunCurrentStatement() End If From 40598db19c93e7388746ada6686dcc584ba5d9d0 Mon Sep 17 00:00:00 2001 From: Stephen Lloyd Date: Sat, 30 Sep 2023 16:56:17 +0200 Subject: [PATCH 14/44] Prevented exception if non-ASCII character checked to see if it is a bracket character --- instat/ucrScript.vb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/instat/ucrScript.vb b/instat/ucrScript.vb index ed8d119b396..f09b50678b2 100644 --- a/instat/ucrScript.vb +++ b/instat/ucrScript.vb @@ -472,6 +472,12 @@ Public Class ucrScript End Sub Private Function IsBracket(iNewChar As Integer) As Boolean + 'the `Chr()` function may throw an exception for higher value integers, + ' so check value in a reasonable range. Note: 40 = `(` and 125 = `}` + If iNewChar < 40 OrElse iNewChar > 125 Then + Return False + End If + Dim arrRBrackets() As String = {"(", ")", "{", "}", "[", "]"} Return arrRBrackets.Contains(Chr(iNewChar)) End Function From 65646d426a84a996e38bc6fe8543692f71901a6a Mon Sep 17 00:00:00 2001 From: n-thony Date: Tue, 3 Oct 2023 10:41:16 +0300 Subject: [PATCH 15/44] Made Column metadata consistent with Data View grid when selection is applied --- instat/static/InstatObject/R/data_object_R6.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index 1d2fdc62855..cba92495fb5 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -456,9 +456,11 @@ DataSheet$set("public", "get_variables_metadata", function(data_type = "all", co if(missing(column)) { curr_data <- private$data cols <- names(curr_data) + if(self$column_selection_applied()) cols <- self$current_column_selection } else { cols <- column + if(self$column_selection_applied()) cols <- self$current_column_selection curr_data <- private$data[column] } for(i in seq_along(cols)) { From 4fde644da52f79528d9e3b986fbb58f9eba5ffd8 Mon Sep 17 00:00:00 2001 From: n-thony Date: Tue, 3 Oct 2023 16:11:02 +0300 Subject: [PATCH 16/44] minor code change --- instat/static/InstatObject/R/data_object_R6.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index cba92495fb5..c7d05dec6f3 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -463,8 +463,8 @@ DataSheet$set("public", "get_variables_metadata", function(data_type = "all", co if(self$column_selection_applied()) cols <- self$current_column_selection curr_data <- private$data[column] } - for(i in seq_along(cols)) { - col <- curr_data[[i]] + for(c in cols) { + col <- curr_data[[c]] ind <- which(names(attributes(col)) == "levels") if(length(ind) > 0) col_attributes <- attributes(col)[-ind] else col_attributes <- attributes(col) @@ -487,7 +487,7 @@ DataSheet$set("public", "get_variables_metadata", function(data_type = "all", co # col_attributes <- data.frame(class = NA) #} col_attributes <- data.frame(col_attributes, stringsAsFactors = FALSE) - out[[i]] <- col_attributes + out[[c]] <- col_attributes } #RLink crashes with bind_rows for some data frames with ~50+ columns #rbind.fill safer alternative currently From b39877a0e94bd5cdbb834e401de5d32a2d1ca359 Mon Sep 17 00:00:00 2001 From: Stephen Lloyd Date: Thu, 5 Oct 2023 13:06:48 +0200 Subject: [PATCH 17/44] if RScript exception raised, then execute using heuristics approach --- instat/clsRLink.vb | 63 ++++---------------- instat/ucrScript.vb | 141 +++++++++++++++++++++++++++++--------------- 2 files changed, 104 insertions(+), 100 deletions(-) diff --git a/instat/clsRLink.vb b/instat/clsRLink.vb index 5c84cfdb742..31407683325 100644 --- a/instat/clsRLink.vb +++ b/instat/clsRLink.vb @@ -733,15 +733,16 @@ Public Class RLink frmMain.ucrScriptWindow.LogText(strRStatement.TrimEnd(vbCr, vbLf)) Try Dim strOutput As String = "" - Dim bSuccess As Boolean = Evaluate(strRStatement, bSilent:=False, bSeparateThread:=False, - bShowWaitDialogOverride:=Nothing) 'if not an assignment operation, then capture the output - If clsRStatement.clsAssignment Is Nothing AndAlso bSuccess Then + If clsRStatement.clsAssignment Is Nothing Then strOutput = GetFileOutput("view_object_data(object = " & clsRStatement.GetAsExecutableScript(bIncludeFormatting:=False) & " , object_format = 'text' )", bSilent:=False, bSeparateThread:=False, bShowWaitDialogOverride:=Nothing) + Else + Evaluate(strRStatement, bSilent:=False, bSeparateThread:=False, + bShowWaitDialogOverride:=Nothing) End If 'log script and output @@ -759,6 +760,13 @@ Public Class RLink frmMain.UpdateAllGrids() End Sub + '''-------------------------------------------------------------------------------------------- + ''' TODO. + ''' + ''' + ''' TODO. + ''' TODO. + '''-------------------------------------------------------------------------------------------- Public Sub RunScriptFromWindow(strScript As String, strComment As String) If String.IsNullOrWhiteSpace(strScript) Then @@ -856,55 +864,6 @@ Public Class RLink 'log script and output Dim strScriptWithComment As String = If(String.IsNullOrEmpty(strComment), strScript, GetFormattedComment(strComment) & Environment.NewLine & strScript) frmMain.ucrScriptWindow.LogText(strScriptWithComment & Environment.NewLine) - - ''Prefix comment to script - 'Dim strScriptWithComment As String = If(String.IsNullOrEmpty(strComment), strScript, GetFormattedComment(strComment) & Environment.NewLine & strScript) - - 'frmMain.ucrScriptWindow.LogText(strScriptWithComment & Environment.NewLine) - - 'Try - ' Dim strOutput As String = "" - ' Dim bAsFile As Boolean = True - ' Dim bDisplayOutputInExternalViewer As Boolean = False - - ' 'exclude lines not needed for execution e.g comments, empty lines. - ' Dim arrExecutableRScriptLines() As String = GetRunnableCommandLines(strScript) - ' If arrExecutableRScriptLines.Length > 0 Then - ' 'get the last R script command. todo, this should eventually use the RScript library functions to identify the last R script command - ' Dim strLastScript As String = arrExecutableRScriptLines.Last() - ' If strLastScript.StartsWith(strInstatDataObject & "$get_object_data") _ - ' OrElse strLastScript.StartsWith(strInstatDataObject & "$get_last_object_data") _ - ' OrElse strLastScript.StartsWith("view_object_data") Then - ' strOutput = GetFileOutput(strScript, False, False, Nothing) - ' 'if last function is view_object then display in external viewer (maximised) - ' bDisplayOutputInExternalViewer = strLastScript.Contains("view_object_data") - - ' ElseIf strLastScript.StartsWith("print") Then - ' bAsFile = False - ' Evaluate(strScript, bSilent:=False, bSeparateThread:=False, bShowWaitDialogOverride:=Nothing) - ' Else - ' 'else if script comes from script window - ' Dim bSuccess As Boolean = Evaluate(strScript, bSilent:=False, bSeparateThread:=False, bShowWaitDialogOverride:=Nothing) - - ' 'if not an assignment operation, then capture the output - ' If Not strScript.Contains("<-") AndAlso bSuccess Then - ' Dim strScriptAsSingleLine As String = strScript.Replace(vbCrLf, String.Empty) - ' strScriptAsSingleLine = strScriptAsSingleLine.Replace(vbCr, String.Empty) - ' strScriptAsSingleLine = strScriptAsSingleLine.Replace(vbLf, String.Empty) - ' 'wrap final command inside view_object_data just incase there is an output object - ' strOutput = GetFileOutput("view_object_data(object = " & strScriptAsSingleLine & " , object_format = 'text' )", False, False, Nothing) - ' End If - ' End If - ' End If - - - ' 'log script and output - ' clsOutputLogger.AddOutput(strScriptWithComment, strOutput, bAsFile, bDisplayOutputInExternalViewer) - - 'Catch e As Exception - ' MsgBox(e.Message & Environment.NewLine & "The error occurred in attempting to run the following R command(s):" & Environment.NewLine & strScript, MsgBoxStyle.Critical, "Error running R command(s)") - 'End Try - End Sub '''-------------------------------------------------------------------------------------------- diff --git a/instat/ucrScript.vb b/instat/ucrScript.vb index f09b50678b2..6b3e9cdfac4 100644 --- a/instat/ucrScript.vb +++ b/instat/ucrScript.vb @@ -298,15 +298,10 @@ Public Class ucrScript cmdRemoveTab.Enabled = TabControl.TabCount > 2 AndAlso Not bIsLogTab End Sub - Private Sub EnableRunButtons(bEnable As Boolean) - cmdRunStatementSelection.Enabled = bEnable - cmdRunAll.Enabled = bEnable - End Sub - ''' ''' Enables or disables all right click menu options ''' - ''' If true, enables all right click options,false otherwise + ''' If true, enables all right click options, false disables them Private Sub EnableRightClickMenuOptions(bEnable As Boolean) mnuUndo.Enabled = bEnable mnuRedo.Enabled = bEnable @@ -322,6 +317,16 @@ Public Class ucrScript mnuSaveScript.Enabled = bEnable End Sub + ''' + ''' Enables or disables the run buttons and all right click menu options + ''' + ''' If true, enables buttons/options, false disables them + Private Sub EnableRunOptions(bEnable As Boolean) + cmdRunStatementSelection.Enabled = bEnable + cmdRunAll.Enabled = bEnable + EnableRightClickMenuOptions(bEnable) + End Sub + '''-------------------------------------------------------------------------------------------- ''' ''' If the caret is next to a bracket, then it highlights the paired open/close bracket. @@ -613,45 +618,95 @@ Public Class ucrScript Exit Sub End If - Dim dctRStatements As OrderedDictionary = New clsRScript(clsScriptActive.Text).dctRStatements - If dctRStatements.Count = 0 Then - Exit Sub - End If + 'temporarily disable the buttons in case its a long operation + EnableRunOptions(False) - Dim iCaretPos As Integer = clsScriptActive.CurrentPosition - Dim iNextStatementPos As Integer = 0 - Dim clsRStatement As clsRStatement = Nothing + Try + Dim dctRStatements As OrderedDictionary + Try + dctRStatements = New clsRScript(clsScriptActive.Text).dctRStatements + Catch ex As Exception + MsgBox("R script parsing failed with message below. " _ + & "Try using 'Run All' or 'Run Selected'. This will execute the script using a less strict method." _ + & Environment.NewLine & Environment.NewLine & ex.Message & Environment.NewLine, + MsgBoxStyle.Information, "Could not execute current statement") + Exit Sub + End Try - For Each kvpDictEntry As DictionaryEntry In dctRStatements - If kvpDictEntry.Key > iCaretPos Then - iNextStatementPos = kvpDictEntry.Key - Exit For + If IsNothing(dctRStatements) OrElse dctRStatements.Count = 0 Then + Exit Sub End If - clsRStatement = kvpDictEntry.Value - Next - frmMain.clsRLink.RunRStatement(clsRStatement) + Dim iCaretPos As Integer = clsScriptActive.CurrentPosition + Dim iNextStatementPos As Integer = 0 + Dim clsRStatement As clsRStatement = Nothing + + For Each kvpDictEntry As DictionaryEntry In dctRStatements + If kvpDictEntry.Key > iCaretPos Then + iNextStatementPos = kvpDictEntry.Key + Exit For + End If + clsRStatement = kvpDictEntry.Value + Next - ' if we executed the only/last statement - If iNextStatementPos = 0 Then - ' if there is no blank line at end of text, then add blank line - If Not (clsScriptActive.Text.EndsWith(vbCr) _ + ' if we will execute the only/last statement + If iNextStatementPos = 0 Then + ' if there is no blank line at end of text, then add blank line + If Not (clsScriptActive.Text.EndsWith(vbCr) _ OrElse clsScriptActive.Text.EndsWith(vbLf)) Then - clsScriptActive.AppendText(vbCrLf) + clsScriptActive.AppendText(vbCrLf) + End If + iNextStatementPos = clsScriptActive.TextLength + + Else 'else move caret to first non-blank line of next statement + For iTextPos As Integer = iNextStatementPos To clsScriptActive.Text.Length - 1 + Dim chrNext As Char = clsScriptActive.Text.Chars(iTextPos) + If chrNext <> vbLf AndAlso chrNext <> vbCr Then + iNextStatementPos = iTextPos + Exit For + End If + Next End If - iNextStatementPos = clsScriptActive.TextLength - Else 'else move caret to first non-blank line of next statement - For iTextPos As Integer = iNextStatementPos To clsScriptActive.Text.Length - 1 - Dim chrNext As Char = clsScriptActive.Text.Chars(iTextPos) - If chrNext <> vbLf AndAlso chrNext <> vbCr Then - iNextStatementPos = iTextPos - Exit For - End If + clsScriptActive.GotoPosition(iNextStatementPos) + + frmMain.clsRLink.RunRStatement(clsRStatement) + Finally + EnableRunOptions(True) + End Try + End Sub + + '''-------------------------------------------------------------------------------------------- + ''' + ''' Executes the R script. + ''' + ''' The R script to execute. + ''' Converted into an R comment and prefixed to the script. + '''-------------------------------------------------------------------------------------------- + Private Sub RunScript(strScript As String, strComment As String) + + EnableRunOptions(False) 'temporarily disable the run buttons in case its a long operation + + Dim dctRStatements As OrderedDictionary + Try + dctRStatements = New clsRScript(frmMain.clsRLink.GetFormattedComment(strComment) _ + & Environment.NewLine & strScript).dctRStatements + Catch ex As Exception + MsgBox("R script parsing failed with message:" & Environment.NewLine _ + & Environment.NewLine & ex.Message & Environment.NewLine & Environment.NewLine _ + & "R-Instat will now attempt to execute the script using a less strict method.", + MsgBoxStyle.Information, "Could Not Parse R Script") + frmMain.clsRLink.RunScriptFromWindow(strScript.Trim(vbLf), strComment) + dctRStatements = Nothing + End Try + + If Not IsNothing(dctRStatements) Then + For Each kvpDictEntry As DictionaryEntry In dctRStatements + frmMain.clsRLink.RunRStatement(kvpDictEntry.Value) Next End If - clsScriptActive.GotoPosition(iNextStatementPos) + EnableRunOptions(True) End Sub '''-------------------------------------------------------------------------------------------- @@ -725,7 +780,6 @@ Public Class ucrScript EnableDisableButtons() End Sub - Private Sub mnuContextScript_Opening(sender As Object, e As EventArgs) Handles mnuContextScript.Opening 'enable and disable menu options based on the active script properties before the user views them @@ -842,24 +896,15 @@ Public Class ucrScript Exit Sub End If - EnableRunButtons(False) 'temporarily disable the run buttons in case its a long operation - EnableRightClickMenuOptions(False) - frmMain.clsRLink.RunScriptFromWindow(clsScriptActive.Text.Trim(vbLf), "Code run from Script Window (all text)") - EnableRunButtons(True) - EnableRightClickMenuOptions(True) + RunScript(clsScriptActive.Text, "Code run from Script Window (all text)") End Sub Private Sub mnuRunCurrentStatementSelection_Click(sender As Object, e As EventArgs) Handles mnuRunCurrentStatementSelection.Click, cmdRunStatementSelection.Click - 'temporarily disable the buttons in case its a long operation - EnableRunButtons(False) - EnableRightClickMenuOptions(False) If clsScriptActive.SelectedText.Length > 0 Then - frmMain.clsRLink.RunScriptFromWindow(clsScriptActive.SelectedText.Trim(vbLf), "Code run from Script Window (selected text)") + RunScript(clsScriptActive.SelectedText, "Code run from Script Window (selected text)") Else RunCurrentStatement() End If - EnableRunButtons(True) - EnableRightClickMenuOptions(True) End Sub Private Sub cmdSave_Click(sender As Object, e As EventArgs) Handles cmdSave.Click @@ -876,7 +921,7 @@ Public Class ucrScript Private Sub mnuUndo_Click(sender As Object, e As EventArgs) Handles mnuUndo.Click If TabControl.SelectedIndex = iTabIndexLog Then - MsgBox("You can only undo from a script tab, not the log tab.", MsgBoxStyle.Exclamation, "Undo log tab") + MsgBox("You can only undo from a script tab, Not the log tab.", MsgBoxStyle.Exclamation, "Undo log tab") Exit Sub End If @@ -904,7 +949,7 @@ Public Class ucrScript Next If IsNothing(clsScriptActive) Then - MsgBox("Developer error: could not find editor window in tab.") + MsgBox("Developer error: could Not find editor window in tab.") End If End Sub From 0fdcc14f8efad3437409e4710f0ae05642d694f2 Mon Sep 17 00:00:00 2001 From: Stephen Lloyd Date: Fri, 6 Oct 2023 16:57:00 +0200 Subject: [PATCH 18/44] Tidied up logging --- instat/clsRLink.vb | 36 ++++++++++++++++++++++++------------ instat/ucrScript.vb | 10 ++++++---- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/instat/clsRLink.vb b/instat/clsRLink.vb index 31407683325..084d932c081 100644 --- a/instat/clsRLink.vb +++ b/instat/clsRLink.vb @@ -730,7 +730,6 @@ Public Class RLink Exit Sub End If - frmMain.ucrScriptWindow.LogText(strRStatement.TrimEnd(vbCr, vbLf)) Try Dim strOutput As String = "" @@ -745,9 +744,9 @@ Public Class RLink bShowWaitDialogOverride:=Nothing) End If - 'log script and output clsOutputLogger.AddOutput(strRStatement, strOutput, bAsFile:=True, bDisplayOutputInExternalViewer:=False) + LogScript(strRStatement.TrimEnd(vbCr, vbLf)) Catch e As Exception MsgBox(e.Message & Environment.NewLine & @@ -755,9 +754,6 @@ Public Class RLink Environment.NewLine & strRStatement, MsgBoxStyle.Critical, "Error running R command") End Try - - AppendToAutoSaveLog(strRStatement) - frmMain.UpdateAllGrids() End Sub '''-------------------------------------------------------------------------------------------- @@ -845,7 +841,10 @@ Public Class RLink Evaluate(strRStatement, bSilent:=False, bSeparateThread:=False, bShowWaitDialogOverride:=Nothing) End If - clsOutputLogger.AddOutput(strRStatementComment & If(String.IsNullOrEmpty(strRStatementComment), "", Environment.NewLine) & strRStatement, strOutput, bAsFile, bDisplayOutputInExternalViewer) + clsOutputLogger.AddOutput(strRStatementComment _ + & If(String.IsNullOrEmpty(strRStatementComment), "", Environment.NewLine) _ + & strRStatement, strOutput, bAsFile, bDisplayOutputInExternalViewer) + LogScript(strRStatement, strRStatementComment) Catch e As Exception MsgBox(e.Message & Environment.NewLine & @@ -854,16 +853,11 @@ Public Class RLink strRStatement, MsgBoxStyle.Critical, "Error running R command(s)") End Try - AppendToAutoSaveLog(strRStatementComment & If(String.IsNullOrEmpty(strRStatementComment), "", Environment.NewLine) & strRStatement & Environment.NewLine) - frmMain.UpdateAllGrids() - strRStatement = "" strRStatementComment = "" Next - 'log script and output - Dim strScriptWithComment As String = If(String.IsNullOrEmpty(strComment), strScript, GetFormattedComment(strComment) & Environment.NewLine & strScript) - frmMain.ucrScriptWindow.LogText(strScriptWithComment & Environment.NewLine) + frmMain.UpdateAllGrids() End Sub '''-------------------------------------------------------------------------------------------- @@ -1517,6 +1511,24 @@ Public Class RLink End If End Sub + Private Sub LogScript(strScript As String, Optional strComment As String = "") + + Dim strScriptWithComment As String = + If(String.IsNullOrWhiteSpace(strComment), + "", + GetFormattedComment(strComment) & Environment.NewLine) & + If(String.IsNullOrWhiteSpace(strScript), + "", + strScript & Environment.NewLine) + + If String.IsNullOrWhiteSpace(strScriptWithComment) Then + Exit Sub + End If + + frmMain.ucrScriptWindow.LogText(strScriptWithComment) + AppendToAutoSaveLog(strScriptWithComment) + End Sub + '''-------------------------------------------------------------------------------------------- ''' Selects the specified data frame columns in ''' the receiver. diff --git a/instat/ucrScript.vb b/instat/ucrScript.vb index 6b3e9cdfac4..1f2bb0eff71 100644 --- a/instat/ucrScript.vb +++ b/instat/ucrScript.vb @@ -626,9 +626,9 @@ Public Class ucrScript Try dctRStatements = New clsRScript(clsScriptActive.Text).dctRStatements Catch ex As Exception - MsgBox("R script parsing failed with message below. " _ - & "Try using 'Run All' or 'Run Selected'. This will execute the script using a less strict method." _ - & Environment.NewLine & Environment.NewLine & ex.Message & Environment.NewLine, + MsgBox("R script parsing failed with message:" & Environment.NewLine _ + & Environment.NewLine & ex.Message & Environment.NewLine & Environment.NewLine _ + & "Try using 'Run All' or 'Run Selected'. This will execute the script using a less strict method.", MsgBoxStyle.Information, "Could not execute current statement") Exit Sub End Try @@ -671,6 +671,7 @@ Public Class ucrScript clsScriptActive.GotoPosition(iNextStatementPos) frmMain.clsRLink.RunRStatement(clsRStatement) + frmMain.UpdateAllGrids() Finally EnableRunOptions(True) End Try @@ -704,6 +705,7 @@ Public Class ucrScript For Each kvpDictEntry As DictionaryEntry In dctRStatements frmMain.clsRLink.RunRStatement(kvpDictEntry.Value) Next + frmMain.UpdateAllGrids() End If EnableRunOptions(True) @@ -949,7 +951,7 @@ Public Class ucrScript Next If IsNothing(clsScriptActive) Then - MsgBox("Developer error: could Not find editor window in tab.") + MsgBox("Developer error: could not find editor window in tab.") End If End Sub From 5a06bcf206d444dc66f624228c2aacc104fb938a Mon Sep 17 00:00:00 2001 From: Stephen Lloyd Date: Fri, 6 Oct 2023 17:04:09 +0200 Subject: [PATCH 19/44] typo correction --- instat/ucrScript.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/ucrScript.vb b/instat/ucrScript.vb index 1f2bb0eff71..2251a8d3d69 100644 --- a/instat/ucrScript.vb +++ b/instat/ucrScript.vb @@ -923,7 +923,7 @@ Public Class ucrScript Private Sub mnuUndo_Click(sender As Object, e As EventArgs) Handles mnuUndo.Click If TabControl.SelectedIndex = iTabIndexLog Then - MsgBox("You can only undo from a script tab, Not the log tab.", MsgBoxStyle.Exclamation, "Undo log tab") + MsgBox("You can only undo from a script tab, not the log tab.", MsgBoxStyle.Exclamation, "Undo log tab") Exit Sub End If From dc720c555346530db1d3708ad9a5d1af775b3300 Mon Sep 17 00:00:00 2001 From: Stephen Lloyd Date: Fri, 6 Oct 2023 18:36:35 +0200 Subject: [PATCH 20/44] Fixed bug in comment handling --- instat/clsRLink.vb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/instat/clsRLink.vb b/instat/clsRLink.vb index 084d932c081..d6ec93d2edb 100644 --- a/instat/clsRLink.vb +++ b/instat/clsRLink.vb @@ -782,7 +782,7 @@ Public Class RLink Continue For End If - 'remove any comments (character '#' and anything after) + 'find any comments (character '#' and anything after) Dim iCommentPos As Integer = strTrimmedLine.IndexOf("#") Select Case iCommentPos Case 0 'a normal comment line (starts with '#') @@ -841,9 +841,9 @@ Public Class RLink Evaluate(strRStatement, bSilent:=False, bSeparateThread:=False, bShowWaitDialogOverride:=Nothing) End If - clsOutputLogger.AddOutput(strRStatementComment _ - & If(String.IsNullOrEmpty(strRStatementComment), "", Environment.NewLine) _ - & strRStatement, strOutput, bAsFile, bDisplayOutputInExternalViewer) + clsOutputLogger.AddOutput(If(String.IsNullOrEmpty(strRStatementComment), "", + strRStatementComment & Environment.NewLine) & strRStatement, + strOutput, bAsFile, bDisplayOutputInExternalViewer) LogScript(strRStatement, strRStatementComment) Catch e As Exception @@ -1515,8 +1515,7 @@ Public Class RLink Dim strScriptWithComment As String = If(String.IsNullOrWhiteSpace(strComment), - "", - GetFormattedComment(strComment) & Environment.NewLine) & + "", strComment & Environment.NewLine) & If(String.IsNullOrWhiteSpace(strScript), "", strScript & Environment.NewLine) From 3c2136005372f458a037be8fe93a6f734f1725d3 Mon Sep 17 00:00:00 2001 From: Stephen Lloyd Date: Tue, 10 Oct 2023 10:15:34 +0200 Subject: [PATCH 21/44] Small refactoring changes --- instat/ucrScript.vb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/instat/ucrScript.vb b/instat/ucrScript.vb index 2251a8d3d69..417d6c36fcc 100644 --- a/instat/ucrScript.vb +++ b/instat/ucrScript.vb @@ -320,7 +320,7 @@ Public Class ucrScript ''' ''' Enables or disables the run buttons and all right click menu options ''' - ''' If true, enables buttons/options, false disables them + ''' If true, enables buttons/options, else disables them Private Sub EnableRunOptions(bEnable As Boolean) cmdRunStatementSelection.Enabled = bEnable cmdRunAll.Enabled = bEnable @@ -478,7 +478,7 @@ Public Class ucrScript Private Function IsBracket(iNewChar As Integer) As Boolean 'the `Chr()` function may throw an exception for higher value integers, - ' so check value in a reasonable range. Note: 40 = `(` and 125 = `}` + ' so check value is in a reasonable range. Note: 40 = `(` and 125 = `}` If iNewChar < 40 OrElse iNewChar > 125 Then Return False End If @@ -629,7 +629,7 @@ Public Class ucrScript MsgBox("R script parsing failed with message:" & Environment.NewLine _ & Environment.NewLine & ex.Message & Environment.NewLine & Environment.NewLine _ & "Try using 'Run All' or 'Run Selected'. This will execute the script using a less strict method.", - MsgBoxStyle.Information, "Could not execute current statement") + MsgBoxStyle.Information, "Could not parse R script") Exit Sub End Try @@ -649,7 +649,7 @@ Public Class ucrScript clsRStatement = kvpDictEntry.Value Next - ' if we will execute the only/last statement + 'if we will execute the only/last statement If iNextStatementPos = 0 Then ' if there is no blank line at end of text, then add blank line If Not (clsScriptActive.Text.EndsWith(vbCr) _ @@ -661,7 +661,7 @@ Public Class ucrScript Else 'else move caret to first non-blank line of next statement For iTextPos As Integer = iNextStatementPos To clsScriptActive.Text.Length - 1 Dim chrNext As Char = clsScriptActive.Text.Chars(iTextPos) - If chrNext <> vbLf AndAlso chrNext <> vbCr Then + If chrNext <> vbLf AndAlso chrNext <> vbCr AndAlso Not Char.IsWhiteSpace(chrNext) Then iNextStatementPos = iTextPos Exit For End If From 5d3b6082a718f049d13ff3d5a4ed44662bbfa370 Mon Sep 17 00:00:00 2001 From: Stephen Lloyd Date: Tue, 10 Oct 2023 10:33:29 +0200 Subject: [PATCH 22/44] Improved comments --- instat/clsRLink.vb | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/instat/clsRLink.vb b/instat/clsRLink.vb index d6ec93d2edb..75b17c40abe 100644 --- a/instat/clsRLink.vb +++ b/instat/clsRLink.vb @@ -716,10 +716,10 @@ Public Class RLink End Function '''-------------------------------------------------------------------------------------------- - ''' TODO. - ''' + ''' Executes . If it is not an assignment + ''' statement, then attempts to display the output. ''' - ''' TODO. + ''' The R code statement to execute '''-------------------------------------------------------------------------------------------- Public Sub RunRStatement(clsRStatement As clsRStatement) @@ -757,11 +757,19 @@ Public Class RLink End Sub '''-------------------------------------------------------------------------------------------- - ''' TODO. - ''' - ''' - ''' TODO. - ''' TODO. + ''' This method executes the R script and displays + ''' the output as text or graph (determined by ). + ''' R commands may be split over multiple lines. This is only allowed if the + ''' non-final line ends with '+', ',', or '%>%'; or there are one or more brackets/ + ''' quotations that have not been closed. + ''' This function is named '...FromWindow' because it's designed to execute scripts + ''' entered by a human from a dialog window (e.g. a script window). These scripts + ''' may contain R commands split over multiple lines to make the commands more + ''' readable. + ''' + ''' + ''' The R script to execute. + ''' The comment to prefix to the script. '''-------------------------------------------------------------------------------------------- Public Sub RunScriptFromWindow(strScript As String, strComment As String) @@ -798,7 +806,7 @@ Public Class RLink 'else append line of script to command strRStatement &= If(String.IsNullOrEmpty(strRStatement), "", Environment.NewLine) & strTrimmedLine - 'if line ends in a '+', ',', or '%>%'; or there are open curly braces; or open quotations, + 'if line ends in a '+', ',', or '%>%'; or there are open brackets; or open quotations, ' then assume command is not complete Dim cLastChar As Char = strTrimmedLine.Last Dim strLast3Chars As String = "" From 3c857516edeb42f8a114a421f8a1eca6e324e234 Mon Sep 17 00:00:00 2001 From: Stephen Lloyd Date: Tue, 17 Oct 2023 11:59:56 +0200 Subject: [PATCH 23/44] upgraded to rscript 1.0.8 to allow commas in square brackets --- instat/instat.vbproj | 4 ++-- instat/packages.config | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/instat/instat.vbproj b/instat/instat.vbproj index 4a69a7255d8..53ccc34b468 100644 --- a/instat/instat.vbproj +++ b/instat/instat.vbproj @@ -155,8 +155,8 @@ ..\packages\R.NET.1.8.2\lib\netstandard2.0\RDotNet.dll - - ..\packages\RScript.1.0.7\lib\net461\RScript.dll + + ..\packages\RScript.1.0.8\lib\net461\RScript.dll ..\packages\jacobslusser.ScintillaNET.3.6.3\lib\net40\ScintillaNET.dll diff --git a/instat/packages.config b/instat/packages.config index cafd184b5b5..6e3f907769b 100644 --- a/instat/packages.config +++ b/instat/packages.config @@ -11,7 +11,7 @@ - + From b5719a3f068765632874e119141dac465787fe45 Mon Sep 17 00:00:00 2001 From: Stephen Lloyd Date: Mon, 23 Oct 2023 10:31:18 +0200 Subject: [PATCH 24/44] upgraded to RScript 1.0.9 (support comments at end of script) --- instat/clsRLink.vb | 11 +++++++---- instat/instat.vbproj | 4 ++-- instat/packages.config | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/instat/clsRLink.vb b/instat/clsRLink.vb index 75b17c40abe..c60e51f8247 100644 --- a/instat/clsRLink.vb +++ b/instat/clsRLink.vb @@ -734,10 +734,13 @@ Public Class RLink Dim strOutput As String = "" 'if not an assignment operation, then capture the output - If clsRStatement.clsAssignment Is Nothing Then - strOutput = GetFileOutput("view_object_data(object = " & - clsRStatement.GetAsExecutableScript(bIncludeFormatting:=False) & - " , object_format = 'text' )", bSilent:=False, + Dim strRStatementNoFormatting As String = + clsRStatement.GetAsExecutableScript(bIncludeFormatting:=False) + If clsRStatement.clsAssignment Is Nothing _ + AndAlso Not String.IsNullOrWhiteSpace(strRStatementNoFormatting) Then + strOutput = GetFileOutput("view_object_data(object = " _ + & strRStatementNoFormatting _ + & " , object_format = 'text' )", bSilent:=False, bSeparateThread:=False, bShowWaitDialogOverride:=Nothing) Else Evaluate(strRStatement, bSilent:=False, bSeparateThread:=False, diff --git a/instat/instat.vbproj b/instat/instat.vbproj index 53ccc34b468..33e2130a98d 100644 --- a/instat/instat.vbproj +++ b/instat/instat.vbproj @@ -155,8 +155,8 @@ ..\packages\R.NET.1.8.2\lib\netstandard2.0\RDotNet.dll - - ..\packages\RScript.1.0.8\lib\net461\RScript.dll + + ..\packages\RScript.1.0.9\lib\net461\RScript.dll ..\packages\jacobslusser.ScintillaNET.3.6.3\lib\net40\ScintillaNET.dll diff --git a/instat/packages.config b/instat/packages.config index 6e3f907769b..51f542b07de 100644 --- a/instat/packages.config +++ b/instat/packages.config @@ -11,7 +11,7 @@ - + From 5bdd6fc9e4f383f6dcdef3a062d0d1a77f8048e7 Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Thu, 26 Oct 2023 10:41:41 +0100 Subject: [PATCH 25/44] minor change --- instat/dlgScatterPlot.Designer.vb | 334 ++++++++++++++++++++++-------- instat/dlgScatterPlot.vb | 155 ++++++++++++-- 2 files changed, 387 insertions(+), 102 deletions(-) diff --git a/instat/dlgScatterPlot.Designer.vb b/instat/dlgScatterPlot.Designer.vb index 614b377b877..481e57dd3e7 100644 --- a/instat/dlgScatterPlot.Designer.vb +++ b/instat/dlgScatterPlot.Designer.vb @@ -51,11 +51,7 @@ Partial Class dlgScatterPlot Me.toolStripMenuItemSmoothOptions = New System.Windows.Forms.ToolStripMenuItem() Me.toolStripMenuItemTextrepelOptions = New System.Windows.Forms.ToolStripMenuItem() Me.toolStripMenuItemJitterOptions = New System.Windows.Forms.ToolStripMenuItem() - Me.lblWidth = New System.Windows.Forms.Label() - Me.lblHeith = New System.Windows.Forms.Label() - Me.ucrNudHeigth = New instat.ucrNud() - Me.ucrNudWidth = New instat.ucrNud() - Me.ucrChkJitter = New instat.ucrCheck() + Me.toolStripMenuItemCountOptions = New System.Windows.Forms.ToolStripMenuItem() Me.cmdOptions = New instat.ucrSplitButton() Me.ucrInputSides = New instat.ucrInputComboBox() Me.ucrNudSize = New instat.ucrNud() @@ -69,14 +65,32 @@ Partial Class dlgScatterPlot Me.ucrFactorOptionalReceiver = New instat.ucrReceiverSingle() Me.ucrReceiverX = New instat.ucrReceiverSingle() Me.ucrBase = New instat.ucrButtons() + Me.grpGeom = New System.Windows.Forms.GroupBox() + Me.ucrInputPosition = New instat.ucrInputComboBox() + Me.lblPosition = New System.Windows.Forms.Label() + Me.ucrInputLegend = New instat.ucrInputComboBox() + Me.lblLegend = New System.Windows.Forms.Label() + Me.ucrInputShape = New instat.ucrInputComboBox() + Me.lblPointsize = New System.Windows.Forms.Label() + Me.ucrNudPointsize = New instat.ucrNud() + Me.lblShape = New System.Windows.Forms.Label() + Me.rdoCount = New System.Windows.Forms.RadioButton() + Me.rdoPoint = New System.Windows.Forms.RadioButton() + Me.lblHeith = New System.Windows.Forms.Label() + Me.ucrNudHeigth = New instat.ucrNud() + Me.lblWidth = New System.Windows.Forms.Label() + Me.ucrNudWidth = New instat.ucrNud() + Me.rdoJitter = New System.Windows.Forms.RadioButton() + Me.ucrPnlGeoms = New instat.UcrPanel() Me.contextMenuStripOptions.SuspendLayout() + Me.grpGeom.SuspendLayout() Me.SuspendLayout() ' 'lblFactorOptional ' Me.lblFactorOptional.AutoSize = True Me.lblFactorOptional.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblFactorOptional.Location = New System.Drawing.Point(334, 224) + Me.lblFactorOptional.Location = New System.Drawing.Point(347, 224) Me.lblFactorOptional.Name = "lblFactorOptional" Me.lblFactorOptional.Size = New System.Drawing.Size(111, 13) Me.lblFactorOptional.TabIndex = 4 @@ -87,7 +101,7 @@ Partial Class dlgScatterPlot ' Me.lblXVariable.AutoSize = True Me.lblXVariable.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblXVariable.Location = New System.Drawing.Point(334, 175) + Me.lblXVariable.Location = New System.Drawing.Point(347, 175) Me.lblXVariable.Name = "lblXVariable" Me.lblXVariable.Size = New System.Drawing.Size(58, 13) Me.lblXVariable.TabIndex = 2 @@ -98,7 +112,7 @@ Partial Class dlgScatterPlot ' Me.lblVariable.AutoSize = True Me.lblVariable.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblVariable.Location = New System.Drawing.Point(334, 273) + Me.lblVariable.Location = New System.Drawing.Point(347, 273) Me.lblVariable.Name = "lblVariable" Me.lblVariable.Size = New System.Drawing.Size(125, 13) Me.lblVariable.TabIndex = 6 @@ -125,98 +139,51 @@ Partial Class dlgScatterPlot ' 'contextMenuStripOptions ' - Me.contextMenuStripOptions.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.toolStripMenuItemPlotOptions, Me.toolStripMenuItemPointOptions, Me.toolStripMenuItemRugOptions, Me.toolStripMenuItemSmoothOptions, Me.toolStripMenuItemTextrepelOptions, Me.toolStripMenuItemJitterOptions}) + Me.contextMenuStripOptions.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.toolStripMenuItemPlotOptions, Me.toolStripMenuItemPointOptions, Me.toolStripMenuItemRugOptions, Me.toolStripMenuItemSmoothOptions, Me.toolStripMenuItemTextrepelOptions, Me.toolStripMenuItemJitterOptions, Me.toolStripMenuItemCountOptions}) Me.contextMenuStripOptions.Name = "contextMenuStripOk" - Me.contextMenuStripOptions.Size = New System.Drawing.Size(181, 158) + Me.contextMenuStripOptions.Size = New System.Drawing.Size(172, 158) ' 'toolStripMenuItemPlotOptions ' Me.toolStripMenuItemPlotOptions.Name = "toolStripMenuItemPlotOptions" - Me.toolStripMenuItemPlotOptions.Size = New System.Drawing.Size(180, 22) + Me.toolStripMenuItemPlotOptions.Size = New System.Drawing.Size(171, 22) Me.toolStripMenuItemPlotOptions.Text = "Plot Options" ' 'toolStripMenuItemPointOptions ' Me.toolStripMenuItemPointOptions.Name = "toolStripMenuItemPointOptions" - Me.toolStripMenuItemPointOptions.Size = New System.Drawing.Size(180, 22) + Me.toolStripMenuItemPointOptions.Size = New System.Drawing.Size(171, 22) Me.toolStripMenuItemPointOptions.Text = "Point Options" ' 'toolStripMenuItemRugOptions ' Me.toolStripMenuItemRugOptions.Name = "toolStripMenuItemRugOptions" - Me.toolStripMenuItemRugOptions.Size = New System.Drawing.Size(180, 22) + Me.toolStripMenuItemRugOptions.Size = New System.Drawing.Size(171, 22) Me.toolStripMenuItemRugOptions.Text = "Rug Options" ' 'toolStripMenuItemSmoothOptions ' Me.toolStripMenuItemSmoothOptions.Name = "toolStripMenuItemSmoothOptions" - Me.toolStripMenuItemSmoothOptions.Size = New System.Drawing.Size(180, 22) + Me.toolStripMenuItemSmoothOptions.Size = New System.Drawing.Size(171, 22) Me.toolStripMenuItemSmoothOptions.Text = "Smooth Options" ' 'toolStripMenuItemTextrepelOptions ' Me.toolStripMenuItemTextrepelOptions.Name = "toolStripMenuItemTextrepelOptions" - Me.toolStripMenuItemTextrepelOptions.Size = New System.Drawing.Size(180, 22) + Me.toolStripMenuItemTextrepelOptions.Size = New System.Drawing.Size(171, 22) Me.toolStripMenuItemTextrepelOptions.Text = "Text_repel Options" ' 'toolStripMenuItemJitterOptions ' Me.toolStripMenuItemJitterOptions.Name = "toolStripMenuItemJitterOptions" - Me.toolStripMenuItemJitterOptions.Size = New System.Drawing.Size(180, 22) + Me.toolStripMenuItemJitterOptions.Size = New System.Drawing.Size(171, 22) Me.toolStripMenuItemJitterOptions.Text = "Jitter Options" ' - 'lblWidth - ' - Me.lblWidth.AutoSize = True - Me.lblWidth.Location = New System.Drawing.Point(111, 314) - Me.lblWidth.Name = "lblWidth" - Me.lblWidth.Size = New System.Drawing.Size(38, 13) - Me.lblWidth.TabIndex = 19 - Me.lblWidth.Text = "Width:" - ' - 'lblHeith - ' - Me.lblHeith.AutoSize = True - Me.lblHeith.Location = New System.Drawing.Point(221, 314) - Me.lblHeith.Name = "lblHeith" - Me.lblHeith.Size = New System.Drawing.Size(41, 13) - Me.lblHeith.TabIndex = 21 - Me.lblHeith.Text = "Heigth:" - ' - 'ucrNudHeigth - ' - Me.ucrNudHeigth.AutoSize = True - Me.ucrNudHeigth.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudHeigth.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudHeigth.Location = New System.Drawing.Point(262, 312) - Me.ucrNudHeigth.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudHeigth.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudHeigth.Name = "ucrNudHeigth" - Me.ucrNudHeigth.Size = New System.Drawing.Size(45, 20) - Me.ucrNudHeigth.TabIndex = 22 - Me.ucrNudHeigth.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrNudWidth - ' - Me.ucrNudWidth.AutoSize = True - Me.ucrNudWidth.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudWidth.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudWidth.Location = New System.Drawing.Point(152, 312) - Me.ucrNudWidth.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudWidth.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudWidth.Name = "ucrNudWidth" - Me.ucrNudWidth.Size = New System.Drawing.Size(45, 20) - Me.ucrNudWidth.TabIndex = 20 - Me.ucrNudWidth.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrChkJitter + 'toolStripMenuItemCountOptions ' - Me.ucrChkJitter.AutoSize = True - Me.ucrChkJitter.Checked = False - Me.ucrChkJitter.Location = New System.Drawing.Point(10, 312) - Me.ucrChkJitter.Name = "ucrChkJitter" - Me.ucrChkJitter.Size = New System.Drawing.Size(89, 23) - Me.ucrChkJitter.TabIndex = 18 + Me.toolStripMenuItemCountOptions.Name = "toolStripMenuItemCountOptions" + Me.toolStripMenuItemCountOptions.Size = New System.Drawing.Size(171, 22) + Me.toolStripMenuItemCountOptions.Text = "Count Options" ' 'cmdOptions ' @@ -268,7 +235,7 @@ Partial Class dlgScatterPlot ' Me.ucrReceiverLabel.AutoSize = True Me.ucrReceiverLabel.frmParent = Me - Me.ucrReceiverLabel.Location = New System.Drawing.Point(334, 289) + Me.ucrReceiverLabel.Location = New System.Drawing.Point(347, 289) Me.ucrReceiverLabel.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverLabel.Name = "ucrReceiverLabel" Me.ucrReceiverLabel.Selector = Nothing @@ -298,7 +265,7 @@ Partial Class dlgScatterPlot 'ucrSaveScatterPlot ' Me.ucrSaveScatterPlot.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrSaveScatterPlot.Location = New System.Drawing.Point(10, 346) + Me.ucrSaveScatterPlot.Location = New System.Drawing.Point(10, 428) Me.ucrSaveScatterPlot.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.ucrSaveScatterPlot.Name = "ucrSaveScatterPlot" Me.ucrSaveScatterPlot.Size = New System.Drawing.Size(312, 24) @@ -320,7 +287,7 @@ Partial Class dlgScatterPlot ' Me.ucrVariablesAsFactorForScatter.AutoSize = True Me.ucrVariablesAsFactorForScatter.frmParent = Me - Me.ucrVariablesAsFactorForScatter.Location = New System.Drawing.Point(334, 30) + Me.ucrVariablesAsFactorForScatter.Location = New System.Drawing.Point(347, 30) Me.ucrVariablesAsFactorForScatter.Name = "ucrVariablesAsFactorForScatter" Me.ucrVariablesAsFactorForScatter.Selector = Nothing Me.ucrVariablesAsFactorForScatter.Size = New System.Drawing.Size(125, 136) @@ -333,7 +300,7 @@ Partial Class dlgScatterPlot ' Me.ucrFactorOptionalReceiver.AutoSize = True Me.ucrFactorOptionalReceiver.frmParent = Me - Me.ucrFactorOptionalReceiver.Location = New System.Drawing.Point(334, 237) + Me.ucrFactorOptionalReceiver.Location = New System.Drawing.Point(347, 237) Me.ucrFactorOptionalReceiver.Margin = New System.Windows.Forms.Padding(0) Me.ucrFactorOptionalReceiver.Name = "ucrFactorOptionalReceiver" Me.ucrFactorOptionalReceiver.Selector = Nothing @@ -346,7 +313,7 @@ Partial Class dlgScatterPlot ' Me.ucrReceiverX.AutoSize = True Me.ucrReceiverX.frmParent = Me - Me.ucrReceiverX.Location = New System.Drawing.Point(334, 188) + Me.ucrReceiverX.Location = New System.Drawing.Point(347, 188) Me.ucrReceiverX.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverX.Name = "ucrReceiverX" Me.ucrReceiverX.Selector = Nothing @@ -359,22 +326,210 @@ Partial Class dlgScatterPlot ' Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(10, 377) + Me.ucrBase.Location = New System.Drawing.Point(10, 459) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(408, 52) Me.ucrBase.TabIndex = 17 ' + 'grpGeom + ' + Me.grpGeom.Controls.Add(Me.ucrInputPosition) + Me.grpGeom.Controls.Add(Me.lblPosition) + Me.grpGeom.Controls.Add(Me.ucrInputLegend) + Me.grpGeom.Controls.Add(Me.lblLegend) + Me.grpGeom.Controls.Add(Me.ucrInputShape) + Me.grpGeom.Controls.Add(Me.lblPointsize) + Me.grpGeom.Controls.Add(Me.ucrNudPointsize) + Me.grpGeom.Controls.Add(Me.lblShape) + Me.grpGeom.Controls.Add(Me.rdoCount) + Me.grpGeom.Controls.Add(Me.rdoPoint) + Me.grpGeom.Controls.Add(Me.lblHeith) + Me.grpGeom.Controls.Add(Me.ucrNudHeigth) + Me.grpGeom.Controls.Add(Me.lblWidth) + Me.grpGeom.Controls.Add(Me.ucrNudWidth) + Me.grpGeom.Controls.Add(Me.rdoJitter) + Me.grpGeom.Controls.Add(Me.ucrPnlGeoms) + Me.grpGeom.Location = New System.Drawing.Point(10, 298) + Me.grpGeom.Name = "grpGeom" + Me.grpGeom.Size = New System.Drawing.Size(334, 122) + Me.grpGeom.TabIndex = 23 + Me.grpGeom.TabStop = False + Me.grpGeom.Text = "Geoms" + ' + 'ucrInputPosition + ' + Me.ucrInputPosition.AddQuotesIfUnrecognised = True + Me.ucrInputPosition.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrInputPosition.GetSetSelectedIndex = -1 + Me.ucrInputPosition.IsReadOnly = False + Me.ucrInputPosition.Location = New System.Drawing.Point(242, 49) + Me.ucrInputPosition.Name = "ucrInputPosition" + Me.ucrInputPosition.Size = New System.Drawing.Size(83, 21) + Me.ucrInputPosition.TabIndex = 39 + ' + 'lblPosition + ' + Me.lblPosition.AutoSize = True + Me.lblPosition.Location = New System.Drawing.Point(194, 54) + Me.lblPosition.Name = "lblPosition" + Me.lblPosition.Size = New System.Drawing.Size(47, 13) + Me.lblPosition.TabIndex = 38 + Me.lblPosition.Text = "Position:" + ' + 'ucrInputLegend + ' + Me.ucrInputLegend.AddQuotesIfUnrecognised = True + Me.ucrInputLegend.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrInputLegend.GetSetSelectedIndex = -1 + Me.ucrInputLegend.IsReadOnly = False + Me.ucrInputLegend.Location = New System.Drawing.Point(138, 53) + Me.ucrInputLegend.Name = "ucrInputLegend" + Me.ucrInputLegend.Size = New System.Drawing.Size(48, 21) + Me.ucrInputLegend.TabIndex = 37 + ' + 'lblLegend + ' + Me.lblLegend.AutoSize = True + Me.lblLegend.Location = New System.Drawing.Point(59, 55) + Me.lblLegend.Name = "lblLegend" + Me.lblLegend.Size = New System.Drawing.Size(76, 13) + Me.lblLegend.TabIndex = 36 + Me.lblLegend.Text = "Show Legend:" + ' + 'ucrInputShape + ' + Me.ucrInputShape.AddQuotesIfUnrecognised = True + Me.ucrInputShape.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrInputShape.GetSetSelectedIndex = -1 + Me.ucrInputShape.IsReadOnly = False + Me.ucrInputShape.Location = New System.Drawing.Point(227, 16) + Me.ucrInputShape.Name = "ucrInputShape" + Me.ucrInputShape.Size = New System.Drawing.Size(89, 21) + Me.ucrInputShape.TabIndex = 35 + ' + 'lblPointsize + ' + Me.lblPointsize.AutoSize = True + Me.lblPointsize.Location = New System.Drawing.Point(59, 21) + Me.lblPointsize.Name = "lblPointsize" + Me.lblPointsize.Size = New System.Drawing.Size(30, 13) + Me.lblPointsize.TabIndex = 33 + Me.lblPointsize.Text = "Size:" + ' + 'ucrNudPointsize + ' + Me.ucrNudPointsize.AutoSize = True + Me.ucrNudPointsize.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudPointsize.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudPointsize.Location = New System.Drawing.Point(113, 17) + Me.ucrNudPointsize.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudPointsize.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudPointsize.Name = "ucrNudPointsize" + Me.ucrNudPointsize.Size = New System.Drawing.Size(45, 20) + Me.ucrNudPointsize.TabIndex = 34 + Me.ucrNudPointsize.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'lblShape + ' + Me.lblShape.AutoSize = True + Me.lblShape.Location = New System.Drawing.Point(186, 21) + Me.lblShape.Name = "lblShape" + Me.lblShape.Size = New System.Drawing.Size(41, 13) + Me.lblShape.TabIndex = 31 + Me.lblShape.Text = "Shape:" + ' + 'rdoCount + ' + Me.rdoCount.AutoSize = True + Me.rdoCount.Location = New System.Drawing.Point(4, 53) + Me.rdoCount.Name = "rdoCount" + Me.rdoCount.Size = New System.Drawing.Size(53, 17) + Me.rdoCount.TabIndex = 30 + Me.rdoCount.TabStop = True + Me.rdoCount.Text = "Count" + Me.rdoCount.UseVisualStyleBackColor = True + ' + 'rdoPoint + ' + Me.rdoPoint.AutoSize = True + Me.rdoPoint.Location = New System.Drawing.Point(4, 20) + Me.rdoPoint.Name = "rdoPoint" + Me.rdoPoint.Size = New System.Drawing.Size(49, 17) + Me.rdoPoint.TabIndex = 29 + Me.rdoPoint.TabStop = True + Me.rdoPoint.Text = "Point" + Me.rdoPoint.UseVisualStyleBackColor = True + ' + 'lblHeith + ' + Me.lblHeith.AutoSize = True + Me.lblHeith.Location = New System.Drawing.Point(182, 92) + Me.lblHeith.Name = "lblHeith" + Me.lblHeith.Size = New System.Drawing.Size(41, 13) + Me.lblHeith.TabIndex = 27 + Me.lblHeith.Text = "Heigth:" + ' + 'ucrNudHeigth + ' + Me.ucrNudHeigth.AutoSize = True + Me.ucrNudHeigth.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudHeigth.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudHeigth.Location = New System.Drawing.Point(223, 90) + Me.ucrNudHeigth.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudHeigth.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudHeigth.Name = "ucrNudHeigth" + Me.ucrNudHeigth.Size = New System.Drawing.Size(45, 20) + Me.ucrNudHeigth.TabIndex = 28 + Me.ucrNudHeigth.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'lblWidth + ' + Me.lblWidth.AutoSize = True + Me.lblWidth.Location = New System.Drawing.Point(59, 92) + Me.lblWidth.Name = "lblWidth" + Me.lblWidth.Size = New System.Drawing.Size(38, 13) + Me.lblWidth.TabIndex = 25 + Me.lblWidth.Text = "Width:" + ' + 'ucrNudWidth + ' + Me.ucrNudWidth.AutoSize = True + Me.ucrNudWidth.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudWidth.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudWidth.Location = New System.Drawing.Point(113, 90) + Me.ucrNudWidth.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudWidth.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudWidth.Name = "ucrNudWidth" + Me.ucrNudWidth.Size = New System.Drawing.Size(45, 20) + Me.ucrNudWidth.TabIndex = 26 + Me.ucrNudWidth.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'rdoJitter + ' + Me.rdoJitter.AutoSize = True + Me.rdoJitter.Location = New System.Drawing.Point(4, 90) + Me.rdoJitter.Name = "rdoJitter" + Me.rdoJitter.Size = New System.Drawing.Size(47, 17) + Me.rdoJitter.TabIndex = 24 + Me.rdoJitter.TabStop = True + Me.rdoJitter.Text = "Jitter" + Me.rdoJitter.UseVisualStyleBackColor = True + ' + 'ucrPnlGeoms + ' + Me.ucrPnlGeoms.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlGeoms.Location = New System.Drawing.Point(2, 14) + Me.ucrPnlGeoms.Name = "ucrPnlGeoms" + Me.ucrPnlGeoms.Size = New System.Drawing.Size(321, 102) + Me.ucrPnlGeoms.TabIndex = 24 + ' 'dlgScatterPlot ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True - Me.ClientSize = New System.Drawing.Size(477, 438) - Me.Controls.Add(Me.lblHeith) - Me.Controls.Add(Me.ucrNudHeigth) - Me.Controls.Add(Me.lblWidth) - Me.Controls.Add(Me.ucrNudWidth) - Me.Controls.Add(Me.ucrChkJitter) + Me.ClientSize = New System.Drawing.Size(483, 521) + Me.Controls.Add(Me.grpGeom) Me.Controls.Add(Me.cmdOptions) Me.Controls.Add(Me.ucrInputSides) Me.Controls.Add(Me.lblSides) @@ -398,8 +553,10 @@ Partial Class dlgScatterPlot Me.MinimizeBox = False Me.Name = "dlgScatterPlot" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen - Me.Text = "Point Plot" + Me.Text = "Scatter Plot" Me.contextMenuStripOptions.ResumeLayout(False) + Me.grpGeom.ResumeLayout(False) + Me.grpGeom.PerformLayout() Me.ResumeLayout(False) Me.PerformLayout() @@ -429,10 +586,23 @@ Partial Class dlgScatterPlot Friend WithEvents toolStripMenuItemRugOptions As ToolStripMenuItem Friend WithEvents toolStripMenuItemSmoothOptions As ToolStripMenuItem Friend WithEvents toolStripMenuItemTextrepelOptions As ToolStripMenuItem + Friend WithEvents toolStripMenuItemJitterOptions As ToolStripMenuItem + Friend WithEvents grpGeom As GroupBox Friend WithEvents lblHeith As Label Friend WithEvents ucrNudHeigth As ucrNud Friend WithEvents lblWidth As Label Friend WithEvents ucrNudWidth As ucrNud - Friend WithEvents ucrChkJitter As ucrCheck - Friend WithEvents toolStripMenuItemJitterOptions As ToolStripMenuItem + Friend WithEvents rdoJitter As RadioButton + Friend WithEvents ucrPnlGeoms As UcrPanel + Friend WithEvents rdoCount As RadioButton + Friend WithEvents rdoPoint As RadioButton + Friend WithEvents toolStripMenuItemCountOptions As ToolStripMenuItem + Friend WithEvents lblPointsize As Label + Friend WithEvents ucrNudPointsize As ucrNud + Friend WithEvents lblShape As Label + Friend WithEvents ucrInputShape As ucrInputComboBox + Friend WithEvents ucrInputPosition As ucrInputComboBox + Friend WithEvents lblPosition As Label + Friend WithEvents ucrInputLegend As ucrInputComboBox + Friend WithEvents lblLegend As Label End Class diff --git a/instat/dlgScatterPlot.vb b/instat/dlgScatterPlot.vb index 51dd512edf0..4deefa151dc 100644 --- a/instat/dlgScatterPlot.vb +++ b/instat/dlgScatterPlot.vb @@ -43,12 +43,14 @@ Public Class dlgScatterPlot Private clsAnnotateFunction As New RFunction Private clsGeomRugFunction As New RFunction Private clsGeomJitterFunction As New RFunction + Private clsCountGeomFunction, clsDummyFunction As New RFunction 'Parameter names for geoms Private strFirstParameterName As String = "geomfunc" Private strGeomSmoothParameterName As String = "geom_smooth" Private strGeomTextRepelParameterName As String = "geom_text_repel" Private strGeomJitterParameterName As String = "geom_jitter" - Private strGeomParameterNames() As String = {strFirstParameterName, strGeomJitterParameterName, strGeomSmoothParameterName, strGeomTextRepelParameterName} + Private strGeomCountParameterName As String = "geom_count" + Private strGeomParameterNames() As String = {strFirstParameterName, strGeomJitterParameterName, strGeomCountParameterName, strGeomSmoothParameterName, strGeomTextRepelParameterName} Private Sub dlgScatterPlot_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstLoad Then @@ -67,6 +69,9 @@ Public Class dlgScatterPlot Private Sub InitialiseDialog() Dim clsGeomRugParameter As New RParameter Dim dctSidesOptions As New Dictionary(Of String, String) + Dim dctShapePoint As New Dictionary(Of String, String) + Dim dctPositioncount As New Dictionary(Of String, String) + Dim dctLegendcount As New Dictionary(Of String, String) ucrBase.iHelpTopicID = 433 ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False @@ -119,10 +124,19 @@ Public Class dlgScatterPlot ucrChkAddRugPlot.AddParameterPresentCondition(False, "geom_rug", False) ucrChkAddRugPlot.AddToLinkedControls({ucrNudSize, ucrInputSides}, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - ucrChkJitter.SetText("Jitter") - ucrChkJitter.AddParameterPresentCondition(True, "geom_jitter") - ucrChkJitter.AddParameterPresentCondition(False, "geom_jitter", False) - ucrChkJitter.AddToLinkedControls({ucrNudHeigth, ucrNudWidth}, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="0.40") + + ucrPnlGeoms.AddRadioButton(rdoJitter) + ucrPnlGeoms.AddRadioButton(rdoPoint) + ucrPnlGeoms.AddRadioButton(rdoCount) + ucrPnlGeoms.SetParameter(New RParameter("checked", 9)) + ucrPnlGeoms.AddParameterValuesCondition(rdoPoint, "checked", "geom_point") + ucrPnlGeoms.AddParameterValuesCondition(rdoCount, "checked", "geom_count") + ucrPnlGeoms.AddParameterValuesCondition(rdoJitter, "checked", "geom_jitter") + ucrPnlGeoms.AddToLinkedControls({ucrNudWidth, ucrNudHeigth}, {rdoJitter}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="0.40") + ucrPnlGeoms.AddToLinkedControls({ucrNudPointsize, ucrInputShape}, {rdoPoint}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ', bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="1.5") + ' ucrPnlGeoms.AddToLinkedControls(ucrInputShape, {rdoPoint}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="Circle") + ucrPnlGeoms.AddToLinkedControls({ucrInputLegend, ucrInputPosition}, {rdoCount}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ', bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="NA") + ' ucrPnlGeoms.AddToLinkedControls(ucrInputPosition, {rdoCount}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ', bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="Identity") ucrSaveScatterPlot.SetPrefix("scatter_plot") ucrSaveScatterPlot.SetSaveType(strRObjectType:=RObjectTypeLabel.Graph, @@ -148,6 +162,61 @@ Public Class dlgScatterPlot ucrNudWidth.Increment = 0.01 ucrNudWidth.DecimalPlaces = 2 + ucrNudPointsize.SetParameter(New RParameter("size", 7)) + ucrNudPointsize.Increment = 0.1 + ucrNudPointsize.DecimalPlaces = 1 + ucrNudPointsize.SetRDefault("1.5") + + ucrInputShape.SetParameter(New RParameter("shape", 8)) + dctShapePoint.Add("Circle", Chr(34) & "circle" & Chr(34)) + dctShapePoint.Add("Circle Open", Chr(34) & "circle open" & Chr(34)) + dctShapePoint.Add("Circle Filled", Chr(34) & "circle filled" & Chr(34)) + dctShapePoint.Add("Circle Cross", Chr(34) & "circle cross" & Chr(34)) + dctShapePoint.Add("circle Plus", Chr(34) & "circle plus" & Chr(34)) + dctShapePoint.Add("Circle Small", Chr(34) & "circle small" & Chr(34)) + dctShapePoint.Add("Bullet", Chr(34) & "bullet" & Chr(34)) + dctShapePoint.Add("Square", Chr(34) & "square" & Chr(34)) + dctShapePoint.Add("Square Triangle", Chr(34) & "square triangle" & Chr(34)) + dctShapePoint.Add("Square Plus", Chr(34) & "square plus" & Chr(34)) + dctShapePoint.Add("Square Cross", Chr(34) & "square cross" & Chr(34)) + dctShapePoint.Add("Square Filled", Chr(34) & "square filled" & Chr(34)) + dctShapePoint.Add("Square Open", Chr(34) & "square open" & Chr(34)) + dctShapePoint.Add("Diamond", Chr(34) & "diamond" & Chr(34)) + dctShapePoint.Add("Diamond Open", Chr(34) & "diamond open" & Chr(34)) + dctShapePoint.Add("Diamond Filled", Chr(34) & "diamond filled" & Chr(34)) + dctShapePoint.Add("Diamond Plus", Chr(34) & "diamond plus" & Chr(34)) + dctShapePoint.Add("Triangle", Chr(34) & "triangle" & Chr(34)) + dctShapePoint.Add("Triangle Open", Chr(34) & "triangle open" & Chr(34)) + dctShapePoint.Add("Triangle Filled", Chr(34) & "triangle filled" & Chr(34)) + dctShapePoint.Add("Triangle Square", Chr(34) & "triangle square" & Chr(34)) + dctShapePoint.Add("Triangle Down Open", Chr(34) & "triangle down open" & Chr(34)) + dctShapePoint.Add("Triangle Down Filled", Chr(34) & "triangle down filled" & Chr(34)) + dctShapePoint.Add("Plus", Chr(34) & "plus" & Chr(34)) + dctShapePoint.Add("Cross", Chr(34) & "cross" & Chr(34)) + dctShapePoint.Add("Asterisk", Chr(34) & "asterisk" & Chr(34)) + ucrInputShape.SetItems(dctShapePoint) + ucrInputShape.SetRDefault(Chr(34) & "circle" & Chr(34)) + ucrInputShape.SetDropDownStyleAsNonEditable() + + ucrInputPosition.SetParameter(New RParameter("position", 10)) + dctPositioncount.Add("Identity", Chr(34) & "identity" & Chr(34)) + dctPositioncount.Add("Bin", Chr(34) & "bin" & Chr(34)) + dctPositioncount.Add("Count", Chr(34) & "count" & Chr(34)) + dctPositioncount.Add("Density", Chr(34) & "density" & Chr(34)) + dctPositioncount.Add("Sum", Chr(34) & "sum" & Chr(34)) + dctPositioncount.Add("Unique", Chr(34) & "unique" & Chr(34)) + ucrInputPosition.SetItems(dctPositioncount) + ucrInputPosition.SetRDefault(Chr(34) & "identity" & Chr(34)) + ucrInputPosition.SetDropDownStyleAsNonEditable() + + ucrInputLegend.SetParameter(New RParameter("show.legend", 11)) + dctLegendcount.Add("NA", Chr(34) & "NA" & Chr(34)) + dctLegendcount.Add("TRUE", Chr(34) & "TRUE" & Chr(34)) + dctLegendcount.Add("FALSE", Chr(34) & "FALSE" & Chr(34)) + ucrInputLegend.SetItems(dctLegendcount) + ucrInputLegend.SetRDefault(Chr(34) & "NA" & Chr(34)) + ucrInputLegend.SetDropDownStyleAsNonEditable() + ucrInputSides.SetParameter(New RParameter("sides", 1)) dctSidesOptions.Add("Bottom and left", Chr(34) & "bl" & Chr(34)) dctSidesOptions.Add("Top, right and bottom", Chr(34) & "trb" & Chr(34)) @@ -170,7 +239,11 @@ Public Class dlgScatterPlot ucrNudSize.SetLinkedDisplayControl(lblSize) ucrNudWidth.SetLinkedDisplayControl(lblWidth) ucrNudHeigth.SetLinkedDisplayControl(lblHeith) + ucrInputShape.SetLinkedDisplayControl(lblShape) + ucrNudPointsize.SetLinkedDisplayControl(lblPointsize) ucrInputSides.SetLinkedDisplayControl(lblSides) + ucrInputPosition.SetLinkedDisplayControl(lblPosition) + ucrInputLegend.SetLinkedDisplayControl(lblLegend) End Sub Private Sub SetDefaults() @@ -182,6 +255,8 @@ Public Class dlgScatterPlot clsGeomSmoothFunction = New RFunction clsGeomRugFunction = New RFunction clsGeomJitterFunction = New RFunction + clsCountGeomFunction = New RFunction + clsDummyFunction = New RFunction ucrSelectorForScatter.Reset() ucrSelectorForScatter.SetGgplotFunction(clsBaseOperator) @@ -195,6 +270,9 @@ Public Class dlgScatterPlot toolStripMenuItemSmoothOptions.Enabled = False toolStripMenuItemTextrepelOptions.Enabled = False toolStripMenuItemJitterOptions.Enabled = False + toolStripMenuItemCountOptions.Enabled = False + + clsDummyFunction.AddParameter("checked", "geom_point", iPosition:=0) clsBaseOperator.SetOperation("+") clsBaseOperator.AddParameter("ggplot", clsRFunctionParameter:=clsRggplotFunction, iPosition:=0) @@ -212,6 +290,9 @@ Public Class dlgScatterPlot clsRScatterGeomFunction.SetPackageName("ggplot2") clsRScatterGeomFunction.SetRCommand("geom_point") + clsCountGeomFunction.SetPackageName("ggplot2") + clsCountGeomFunction.SetRCommand("geom_count") + clsLabelFunction.SetPackageName("ggrepel") clsLabelFunction.SetRCommand("geom_text_repel") @@ -267,12 +348,14 @@ Public Class dlgScatterPlot ucrChkWithSE.SetRCode(clsGeomSmoothFunction, bReset) ucrChkAddRugPlot.SetRCode(clsBaseOperator, bReset) ucrNudSize.SetRCode(clsGeomRugFunction, bReset) - If bReset Then - ucrChkJitter.SetRCode(clsBaseOperator, bReset) - End If ucrNudHeigth.SetRCode(clsGeomJitterFunction, bReset) ucrNudWidth.SetRCode(clsGeomJitterFunction, bReset) ucrInputSides.SetRCode(clsGeomRugFunction, bReset) + ucrInputShape.SetRCode(clsRScatterGeomFunction, bReset) + ucrNudPointsize.SetRCode(clsRScatterGeomFunction, bReset) + ucrInputLegend.SetRCode(clsCountGeomFunction, bReset) + ucrInputPosition.SetRCode(clsCountGeomFunction, bReset) + ucrPnlGeoms.SetRCode(clsDummyFunction, bReset) End Sub Private Sub TestOkEnabled() @@ -308,18 +391,18 @@ Public Class dlgScatterPlot toolStripMenuItemRugOptions.Enabled = ucrChkAddRugPlot.Checked End Sub - Private Sub ucrChkJitter_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkJitter.ControlValueChanged - If ucrChkJitter.Checked Then - clsGeomJitterFunction.AddParameter("width", ucrNudWidth.GetText, iPosition:=0) - clsGeomJitterFunction.AddParameter("height", ucrNudHeigth.GetText, iPosition:=1) - clsBaseOperator.AddParameter(strGeomJitterParameterName, clsRFunctionParameter:=clsGeomJitterFunction, iPosition:=2) - clsBaseOperator.RemoveParameterByName(strFirstParameterName) - Else - clsBaseOperator.AddParameter(strFirstParameterName, clsRFunctionParameter:=clsRScatterGeomFunction, iPosition:=2) - clsBaseOperator.RemoveParameterByName(strGeomJitterParameterName) - End If - toolStripMenuItemJitterOptions.Enabled = ucrChkJitter.Checked - End Sub + 'Private Sub ucrChkJitter_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkJitter.ControlValueChanged + ' If ucrChkJitter.Checked Then + ' clsGeomJitterFunction.AddParameter("width", ucrNudWidth.GetText, iPosition:=0) + ' clsGeomJitterFunction.AddParameter("height", ucrNudHeigth.GetText, iPosition:=1) + ' clsBaseOperator.AddParameter(strGeomJitterParameterName, clsRFunctionParameter:=clsGeomJitterFunction, iPosition:=2) + ' clsBaseOperator.RemoveParameterByName(strFirstParameterName) + ' Else + ' clsBaseOperator.AddParameter(strFirstParameterName, clsRFunctionParameter:=clsRScatterGeomFunction, iPosition:=2) + ' clsBaseOperator.RemoveParameterByName(strGeomJitterParameterName) + ' End If + ' toolStripMenuItemJitterOptions.Enabled = ucrChkJitter.Checked + 'End Sub Private Sub cmdOptions_Click(sender As Object, e As EventArgs) Handles cmdOptions.Click, toolStripMenuItemPlotOptions.Click sdgPlots.SetRCode(clsNewOperator:=ucrBase.clsRsyntax.clsBaseOperator, clsNewGlobalAesFunction:=clsRaesFunction, @@ -354,6 +437,10 @@ Public Class dlgScatterPlot EnableDisableOptions(clsGeomJitterFunction) End Sub + Private Sub toolStripMenuItemCountOptions_Click(sender As Object, e As EventArgs) Handles toolStripMenuItemCountOptions.Click + EnableDisableOptions(clsCountGeomFunction) + End Sub + Private Sub EnableDisableOptions(clsTempFunction As RFunction) 'SetupLayer sends the components storing the plot info (clsRaesFunction, clsRggplotFunction, ...) of dlgScatteredPlot through to sdgLayerOptions where these will be edited. sdgLayerOptions.SetupLayer(clsNewGgPlot:=clsRggplotFunction, clsNewGeomFunc:=clsTempFunction, @@ -397,6 +484,10 @@ Public Class dlgScatterPlot TestOkEnabled() End Sub + Private Sub ucrSaveScatterPlot_ContentsChanged(ucrChangedControl As ucrCore) Handles ucrVariablesAsFactorForScatter.ControlContentsChanged, ucrSaveScatterPlot.ControlContentsChanged, ucrReceiverX.ControlContentsChanged + + End Sub + Private Sub ucrReceiverLabel_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverLabel.ControlValueChanged If ucrReceiverLabel.IsEmpty Then clsBaseOperator.RemoveParameterByName(strGeomTextRepelParameterName) @@ -405,4 +496,28 @@ Public Class dlgScatterPlot End If toolStripMenuItemTextrepelOptions.Enabled = Not ucrReceiverLabel.IsEmpty End Sub + + Private Sub ucrPnlGeoms_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlGeoms.ControlValueChanged, ucrNudHeigth.ControlValueChanged, ucrNudWidth.ControlValueChanged, ucrInputLegend.ControlValueChanged, ucrInputPosition.ControlValueChanged, ucrInputShape.ControlValueChanged, ucrNudPointsize.ControlValueChanged + If rdoJitter.Checked Then + clsGeomJitterFunction.AddParameter("width", ucrNudWidth.GetText, iPosition:=0) + clsGeomJitterFunction.AddParameter("height", ucrNudHeigth.GetText, iPosition:=1) + clsBaseOperator.AddParameter(strGeomJitterParameterName, clsRFunctionParameter:=clsGeomJitterFunction, iPosition:=2) + clsBaseOperator.RemoveParameterByName(strFirstParameterName) + clsBaseOperator.RemoveParameterByName(strGeomCountParameterName) + ElseIf rdoPoint.Checked Then + clsRScatterGeomFunction.AddParameter("side", ucrNudPointsize.GetText, iPosition:=0) + clsRScatterGeomFunction.AddParameter("shape", Chr(34) & ucrInputShape.GetText() & Chr(34), iPosition:=1) + clsBaseOperator.AddParameter(strFirstParameterName, clsRFunctionParameter:=clsRScatterGeomFunction, iPosition:=2) + clsBaseOperator.RemoveParameterByName(strGeomJitterParameterName) + clsBaseOperator.RemoveParameterByName(strGeomCountParameterName) + ElseIf rdoCount.Checked Then + clsCountGeomFunction.AddParameter("position", Chr(34) & ucrInputPosition.GetText() & Chr(34), iPosition:=0) + clsCountGeomFunction.AddParameter("show.legend", Chr(34) & ucrInputLegend.GetText() & Chr(34), iPosition:=1) + clsBaseOperator.AddParameter(strGeomCountParameterName, clsRFunctionParameter:=clsCountGeomFunction, iPosition:=2) + clsBaseOperator.RemoveParameterByName(strGeomJitterParameterName) + clsBaseOperator.RemoveParameterByName(strFirstParameterName) + End If + toolStripMenuItemJitterOptions.Enabled = rdoJitter.Checked + toolStripMenuItemCountOptions.Enabled = rdoCount.Checked + End Sub End Class From aaf4f323ab22c3d7a0c924f4689d3457e8f44c48 Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Thu, 26 Oct 2023 13:21:21 +0100 Subject: [PATCH 26/44] Added geom count on scatter plot dialog --- instat/dlgScatterPlot.Designer.vb | 418 +++++++++++++++--------------- instat/dlgScatterPlot.vb | 26 +- 2 files changed, 218 insertions(+), 226 deletions(-) diff --git a/instat/dlgScatterPlot.Designer.vb b/instat/dlgScatterPlot.Designer.vb index 481e57dd3e7..4b4551d21fb 100644 --- a/instat/dlgScatterPlot.Designer.vb +++ b/instat/dlgScatterPlot.Designer.vb @@ -52,6 +52,23 @@ Partial Class dlgScatterPlot Me.toolStripMenuItemTextrepelOptions = New System.Windows.Forms.ToolStripMenuItem() Me.toolStripMenuItemJitterOptions = New System.Windows.Forms.ToolStripMenuItem() Me.toolStripMenuItemCountOptions = New System.Windows.Forms.ToolStripMenuItem() + Me.grpGeom = New System.Windows.Forms.GroupBox() + Me.lblPosition = New System.Windows.Forms.Label() + Me.lblLegend = New System.Windows.Forms.Label() + Me.lblPointsize = New System.Windows.Forms.Label() + Me.lblShape = New System.Windows.Forms.Label() + Me.rdoCount = New System.Windows.Forms.RadioButton() + Me.rdoPoint = New System.Windows.Forms.RadioButton() + Me.lblHeith = New System.Windows.Forms.Label() + Me.lblWidth = New System.Windows.Forms.Label() + Me.rdoJitter = New System.Windows.Forms.RadioButton() + Me.ucrInputPosition = New instat.ucrInputComboBox() + Me.ucrInputLegend = New instat.ucrInputComboBox() + Me.ucrInputShape = New instat.ucrInputComboBox() + Me.ucrNudPointsize = New instat.ucrNud() + Me.ucrNudHeigth = New instat.ucrNud() + Me.ucrNudWidth = New instat.ucrNud() + Me.ucrPnlGeoms = New instat.UcrPanel() Me.cmdOptions = New instat.ucrSplitButton() Me.ucrInputSides = New instat.ucrInputComboBox() Me.ucrNudSize = New instat.ucrNud() @@ -65,23 +82,6 @@ Partial Class dlgScatterPlot Me.ucrFactorOptionalReceiver = New instat.ucrReceiverSingle() Me.ucrReceiverX = New instat.ucrReceiverSingle() Me.ucrBase = New instat.ucrButtons() - Me.grpGeom = New System.Windows.Forms.GroupBox() - Me.ucrInputPosition = New instat.ucrInputComboBox() - Me.lblPosition = New System.Windows.Forms.Label() - Me.ucrInputLegend = New instat.ucrInputComboBox() - Me.lblLegend = New System.Windows.Forms.Label() - Me.ucrInputShape = New instat.ucrInputComboBox() - Me.lblPointsize = New System.Windows.Forms.Label() - Me.ucrNudPointsize = New instat.ucrNud() - Me.lblShape = New System.Windows.Forms.Label() - Me.rdoCount = New System.Windows.Forms.RadioButton() - Me.rdoPoint = New System.Windows.Forms.RadioButton() - Me.lblHeith = New System.Windows.Forms.Label() - Me.ucrNudHeigth = New instat.ucrNud() - Me.lblWidth = New System.Windows.Forms.Label() - Me.ucrNudWidth = New instat.ucrNud() - Me.rdoJitter = New System.Windows.Forms.RadioButton() - Me.ucrPnlGeoms = New instat.UcrPanel() Me.contextMenuStripOptions.SuspendLayout() Me.grpGeom.SuspendLayout() Me.SuspendLayout() @@ -185,6 +185,198 @@ Partial Class dlgScatterPlot Me.toolStripMenuItemCountOptions.Size = New System.Drawing.Size(171, 22) Me.toolStripMenuItemCountOptions.Text = "Count Options" ' + 'grpGeom + ' + Me.grpGeom.Controls.Add(Me.ucrInputPosition) + Me.grpGeom.Controls.Add(Me.lblPosition) + Me.grpGeom.Controls.Add(Me.ucrInputLegend) + Me.grpGeom.Controls.Add(Me.lblLegend) + Me.grpGeom.Controls.Add(Me.ucrInputShape) + Me.grpGeom.Controls.Add(Me.lblPointsize) + Me.grpGeom.Controls.Add(Me.ucrNudPointsize) + Me.grpGeom.Controls.Add(Me.lblShape) + Me.grpGeom.Controls.Add(Me.rdoCount) + Me.grpGeom.Controls.Add(Me.rdoPoint) + Me.grpGeom.Controls.Add(Me.lblHeith) + Me.grpGeom.Controls.Add(Me.ucrNudHeigth) + Me.grpGeom.Controls.Add(Me.lblWidth) + Me.grpGeom.Controls.Add(Me.ucrNudWidth) + Me.grpGeom.Controls.Add(Me.rdoJitter) + Me.grpGeom.Controls.Add(Me.ucrPnlGeoms) + Me.grpGeom.Location = New System.Drawing.Point(10, 298) + Me.grpGeom.Name = "grpGeom" + Me.grpGeom.Size = New System.Drawing.Size(334, 122) + Me.grpGeom.TabIndex = 23 + Me.grpGeom.TabStop = False + Me.grpGeom.Text = "Geoms" + ' + 'lblPosition + ' + Me.lblPosition.AutoSize = True + Me.lblPosition.Location = New System.Drawing.Point(194, 57) + Me.lblPosition.Name = "lblPosition" + Me.lblPosition.Size = New System.Drawing.Size(47, 13) + Me.lblPosition.TabIndex = 38 + Me.lblPosition.Text = "Position:" + ' + 'lblLegend + ' + Me.lblLegend.AutoSize = True + Me.lblLegend.Location = New System.Drawing.Point(59, 57) + Me.lblLegend.Name = "lblLegend" + Me.lblLegend.Size = New System.Drawing.Size(76, 13) + Me.lblLegend.TabIndex = 36 + Me.lblLegend.Text = "Show Legend:" + ' + 'lblPointsize + ' + Me.lblPointsize.AutoSize = True + Me.lblPointsize.Location = New System.Drawing.Point(59, 21) + Me.lblPointsize.Name = "lblPointsize" + Me.lblPointsize.Size = New System.Drawing.Size(30, 13) + Me.lblPointsize.TabIndex = 33 + Me.lblPointsize.Text = "Size:" + ' + 'lblShape + ' + Me.lblShape.AutoSize = True + Me.lblShape.Location = New System.Drawing.Point(186, 21) + Me.lblShape.Name = "lblShape" + Me.lblShape.Size = New System.Drawing.Size(41, 13) + Me.lblShape.TabIndex = 31 + Me.lblShape.Text = "Shape:" + ' + 'rdoCount + ' + Me.rdoCount.AutoSize = True + Me.rdoCount.Location = New System.Drawing.Point(4, 55) + Me.rdoCount.Name = "rdoCount" + Me.rdoCount.Size = New System.Drawing.Size(53, 17) + Me.rdoCount.TabIndex = 30 + Me.rdoCount.TabStop = True + Me.rdoCount.Text = "Count" + Me.rdoCount.UseVisualStyleBackColor = True + ' + 'rdoPoint + ' + Me.rdoPoint.AutoSize = True + Me.rdoPoint.Location = New System.Drawing.Point(4, 20) + Me.rdoPoint.Name = "rdoPoint" + Me.rdoPoint.Size = New System.Drawing.Size(49, 17) + Me.rdoPoint.TabIndex = 29 + Me.rdoPoint.TabStop = True + Me.rdoPoint.Text = "Point" + Me.rdoPoint.UseVisualStyleBackColor = True + ' + 'lblHeith + ' + Me.lblHeith.AutoSize = True + Me.lblHeith.Location = New System.Drawing.Point(182, 92) + Me.lblHeith.Name = "lblHeith" + Me.lblHeith.Size = New System.Drawing.Size(41, 13) + Me.lblHeith.TabIndex = 27 + Me.lblHeith.Text = "Heigth:" + ' + 'lblWidth + ' + Me.lblWidth.AutoSize = True + Me.lblWidth.Location = New System.Drawing.Point(59, 92) + Me.lblWidth.Name = "lblWidth" + Me.lblWidth.Size = New System.Drawing.Size(38, 13) + Me.lblWidth.TabIndex = 25 + Me.lblWidth.Text = "Width:" + ' + 'rdoJitter + ' + Me.rdoJitter.AutoSize = True + Me.rdoJitter.Location = New System.Drawing.Point(4, 90) + Me.rdoJitter.Name = "rdoJitter" + Me.rdoJitter.Size = New System.Drawing.Size(47, 17) + Me.rdoJitter.TabIndex = 24 + Me.rdoJitter.TabStop = True + Me.rdoJitter.Text = "Jitter" + Me.rdoJitter.UseVisualStyleBackColor = True + ' + 'ucrInputPosition + ' + Me.ucrInputPosition.AddQuotesIfUnrecognised = True + Me.ucrInputPosition.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrInputPosition.GetSetSelectedIndex = -1 + Me.ucrInputPosition.IsReadOnly = False + Me.ucrInputPosition.Location = New System.Drawing.Point(242, 52) + Me.ucrInputPosition.Name = "ucrInputPosition" + Me.ucrInputPosition.Size = New System.Drawing.Size(83, 21) + Me.ucrInputPosition.TabIndex = 39 + ' + 'ucrInputLegend + ' + Me.ucrInputLegend.AddQuotesIfUnrecognised = True + Me.ucrInputLegend.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrInputLegend.GetSetSelectedIndex = -1 + Me.ucrInputLegend.IsReadOnly = False + Me.ucrInputLegend.Location = New System.Drawing.Point(138, 52) + Me.ucrInputLegend.Name = "ucrInputLegend" + Me.ucrInputLegend.Size = New System.Drawing.Size(48, 21) + Me.ucrInputLegend.TabIndex = 37 + ' + 'ucrInputShape + ' + Me.ucrInputShape.AddQuotesIfUnrecognised = True + Me.ucrInputShape.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrInputShape.GetSetSelectedIndex = -1 + Me.ucrInputShape.IsReadOnly = False + Me.ucrInputShape.Location = New System.Drawing.Point(227, 16) + Me.ucrInputShape.Name = "ucrInputShape" + Me.ucrInputShape.Size = New System.Drawing.Size(89, 21) + Me.ucrInputShape.TabIndex = 35 + ' + 'ucrNudPointsize + ' + Me.ucrNudPointsize.AutoSize = True + Me.ucrNudPointsize.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudPointsize.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudPointsize.Location = New System.Drawing.Point(113, 17) + Me.ucrNudPointsize.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudPointsize.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudPointsize.Name = "ucrNudPointsize" + Me.ucrNudPointsize.Size = New System.Drawing.Size(45, 20) + Me.ucrNudPointsize.TabIndex = 34 + Me.ucrNudPointsize.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrNudHeigth + ' + Me.ucrNudHeigth.AutoSize = True + Me.ucrNudHeigth.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudHeigth.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudHeigth.Location = New System.Drawing.Point(223, 90) + Me.ucrNudHeigth.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudHeigth.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudHeigth.Name = "ucrNudHeigth" + Me.ucrNudHeigth.Size = New System.Drawing.Size(45, 20) + Me.ucrNudHeigth.TabIndex = 28 + Me.ucrNudHeigth.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrNudWidth + ' + Me.ucrNudWidth.AutoSize = True + Me.ucrNudWidth.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudWidth.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudWidth.Location = New System.Drawing.Point(113, 90) + Me.ucrNudWidth.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudWidth.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudWidth.Name = "ucrNudWidth" + Me.ucrNudWidth.Size = New System.Drawing.Size(45, 20) + Me.ucrNudWidth.TabIndex = 26 + Me.ucrNudWidth.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrPnlGeoms + ' + Me.ucrPnlGeoms.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlGeoms.Location = New System.Drawing.Point(2, 14) + Me.ucrPnlGeoms.Name = "ucrPnlGeoms" + Me.ucrPnlGeoms.Size = New System.Drawing.Size(321, 102) + Me.ucrPnlGeoms.TabIndex = 24 + ' 'cmdOptions ' Me.cmdOptions.AutoSize = True @@ -331,198 +523,6 @@ Partial Class dlgScatterPlot Me.ucrBase.Size = New System.Drawing.Size(408, 52) Me.ucrBase.TabIndex = 17 ' - 'grpGeom - ' - Me.grpGeom.Controls.Add(Me.ucrInputPosition) - Me.grpGeom.Controls.Add(Me.lblPosition) - Me.grpGeom.Controls.Add(Me.ucrInputLegend) - Me.grpGeom.Controls.Add(Me.lblLegend) - Me.grpGeom.Controls.Add(Me.ucrInputShape) - Me.grpGeom.Controls.Add(Me.lblPointsize) - Me.grpGeom.Controls.Add(Me.ucrNudPointsize) - Me.grpGeom.Controls.Add(Me.lblShape) - Me.grpGeom.Controls.Add(Me.rdoCount) - Me.grpGeom.Controls.Add(Me.rdoPoint) - Me.grpGeom.Controls.Add(Me.lblHeith) - Me.grpGeom.Controls.Add(Me.ucrNudHeigth) - Me.grpGeom.Controls.Add(Me.lblWidth) - Me.grpGeom.Controls.Add(Me.ucrNudWidth) - Me.grpGeom.Controls.Add(Me.rdoJitter) - Me.grpGeom.Controls.Add(Me.ucrPnlGeoms) - Me.grpGeom.Location = New System.Drawing.Point(10, 298) - Me.grpGeom.Name = "grpGeom" - Me.grpGeom.Size = New System.Drawing.Size(334, 122) - Me.grpGeom.TabIndex = 23 - Me.grpGeom.TabStop = False - Me.grpGeom.Text = "Geoms" - ' - 'ucrInputPosition - ' - Me.ucrInputPosition.AddQuotesIfUnrecognised = True - Me.ucrInputPosition.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrInputPosition.GetSetSelectedIndex = -1 - Me.ucrInputPosition.IsReadOnly = False - Me.ucrInputPosition.Location = New System.Drawing.Point(242, 49) - Me.ucrInputPosition.Name = "ucrInputPosition" - Me.ucrInputPosition.Size = New System.Drawing.Size(83, 21) - Me.ucrInputPosition.TabIndex = 39 - ' - 'lblPosition - ' - Me.lblPosition.AutoSize = True - Me.lblPosition.Location = New System.Drawing.Point(194, 54) - Me.lblPosition.Name = "lblPosition" - Me.lblPosition.Size = New System.Drawing.Size(47, 13) - Me.lblPosition.TabIndex = 38 - Me.lblPosition.Text = "Position:" - ' - 'ucrInputLegend - ' - Me.ucrInputLegend.AddQuotesIfUnrecognised = True - Me.ucrInputLegend.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrInputLegend.GetSetSelectedIndex = -1 - Me.ucrInputLegend.IsReadOnly = False - Me.ucrInputLegend.Location = New System.Drawing.Point(138, 53) - Me.ucrInputLegend.Name = "ucrInputLegend" - Me.ucrInputLegend.Size = New System.Drawing.Size(48, 21) - Me.ucrInputLegend.TabIndex = 37 - ' - 'lblLegend - ' - Me.lblLegend.AutoSize = True - Me.lblLegend.Location = New System.Drawing.Point(59, 55) - Me.lblLegend.Name = "lblLegend" - Me.lblLegend.Size = New System.Drawing.Size(76, 13) - Me.lblLegend.TabIndex = 36 - Me.lblLegend.Text = "Show Legend:" - ' - 'ucrInputShape - ' - Me.ucrInputShape.AddQuotesIfUnrecognised = True - Me.ucrInputShape.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrInputShape.GetSetSelectedIndex = -1 - Me.ucrInputShape.IsReadOnly = False - Me.ucrInputShape.Location = New System.Drawing.Point(227, 16) - Me.ucrInputShape.Name = "ucrInputShape" - Me.ucrInputShape.Size = New System.Drawing.Size(89, 21) - Me.ucrInputShape.TabIndex = 35 - ' - 'lblPointsize - ' - Me.lblPointsize.AutoSize = True - Me.lblPointsize.Location = New System.Drawing.Point(59, 21) - Me.lblPointsize.Name = "lblPointsize" - Me.lblPointsize.Size = New System.Drawing.Size(30, 13) - Me.lblPointsize.TabIndex = 33 - Me.lblPointsize.Text = "Size:" - ' - 'ucrNudPointsize - ' - Me.ucrNudPointsize.AutoSize = True - Me.ucrNudPointsize.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudPointsize.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudPointsize.Location = New System.Drawing.Point(113, 17) - Me.ucrNudPointsize.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudPointsize.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudPointsize.Name = "ucrNudPointsize" - Me.ucrNudPointsize.Size = New System.Drawing.Size(45, 20) - Me.ucrNudPointsize.TabIndex = 34 - Me.ucrNudPointsize.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'lblShape - ' - Me.lblShape.AutoSize = True - Me.lblShape.Location = New System.Drawing.Point(186, 21) - Me.lblShape.Name = "lblShape" - Me.lblShape.Size = New System.Drawing.Size(41, 13) - Me.lblShape.TabIndex = 31 - Me.lblShape.Text = "Shape:" - ' - 'rdoCount - ' - Me.rdoCount.AutoSize = True - Me.rdoCount.Location = New System.Drawing.Point(4, 53) - Me.rdoCount.Name = "rdoCount" - Me.rdoCount.Size = New System.Drawing.Size(53, 17) - Me.rdoCount.TabIndex = 30 - Me.rdoCount.TabStop = True - Me.rdoCount.Text = "Count" - Me.rdoCount.UseVisualStyleBackColor = True - ' - 'rdoPoint - ' - Me.rdoPoint.AutoSize = True - Me.rdoPoint.Location = New System.Drawing.Point(4, 20) - Me.rdoPoint.Name = "rdoPoint" - Me.rdoPoint.Size = New System.Drawing.Size(49, 17) - Me.rdoPoint.TabIndex = 29 - Me.rdoPoint.TabStop = True - Me.rdoPoint.Text = "Point" - Me.rdoPoint.UseVisualStyleBackColor = True - ' - 'lblHeith - ' - Me.lblHeith.AutoSize = True - Me.lblHeith.Location = New System.Drawing.Point(182, 92) - Me.lblHeith.Name = "lblHeith" - Me.lblHeith.Size = New System.Drawing.Size(41, 13) - Me.lblHeith.TabIndex = 27 - Me.lblHeith.Text = "Heigth:" - ' - 'ucrNudHeigth - ' - Me.ucrNudHeigth.AutoSize = True - Me.ucrNudHeigth.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudHeigth.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudHeigth.Location = New System.Drawing.Point(223, 90) - Me.ucrNudHeigth.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudHeigth.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudHeigth.Name = "ucrNudHeigth" - Me.ucrNudHeigth.Size = New System.Drawing.Size(45, 20) - Me.ucrNudHeigth.TabIndex = 28 - Me.ucrNudHeigth.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'lblWidth - ' - Me.lblWidth.AutoSize = True - Me.lblWidth.Location = New System.Drawing.Point(59, 92) - Me.lblWidth.Name = "lblWidth" - Me.lblWidth.Size = New System.Drawing.Size(38, 13) - Me.lblWidth.TabIndex = 25 - Me.lblWidth.Text = "Width:" - ' - 'ucrNudWidth - ' - Me.ucrNudWidth.AutoSize = True - Me.ucrNudWidth.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudWidth.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudWidth.Location = New System.Drawing.Point(113, 90) - Me.ucrNudWidth.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudWidth.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudWidth.Name = "ucrNudWidth" - Me.ucrNudWidth.Size = New System.Drawing.Size(45, 20) - Me.ucrNudWidth.TabIndex = 26 - Me.ucrNudWidth.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'rdoJitter - ' - Me.rdoJitter.AutoSize = True - Me.rdoJitter.Location = New System.Drawing.Point(4, 90) - Me.rdoJitter.Name = "rdoJitter" - Me.rdoJitter.Size = New System.Drawing.Size(47, 17) - Me.rdoJitter.TabIndex = 24 - Me.rdoJitter.TabStop = True - Me.rdoJitter.Text = "Jitter" - Me.rdoJitter.UseVisualStyleBackColor = True - ' - 'ucrPnlGeoms - ' - Me.ucrPnlGeoms.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlGeoms.Location = New System.Drawing.Point(2, 14) - Me.ucrPnlGeoms.Name = "ucrPnlGeoms" - Me.ucrPnlGeoms.Size = New System.Drawing.Size(321, 102) - Me.ucrPnlGeoms.TabIndex = 24 - ' 'dlgScatterPlot ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) diff --git a/instat/dlgScatterPlot.vb b/instat/dlgScatterPlot.vb index 4deefa151dc..0b5b9d1d1b2 100644 --- a/instat/dlgScatterPlot.vb +++ b/instat/dlgScatterPlot.vb @@ -124,7 +124,6 @@ Public Class dlgScatterPlot ucrChkAddRugPlot.AddParameterPresentCondition(False, "geom_rug", False) ucrChkAddRugPlot.AddToLinkedControls({ucrNudSize, ucrInputSides}, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - ucrPnlGeoms.AddRadioButton(rdoJitter) ucrPnlGeoms.AddRadioButton(rdoPoint) ucrPnlGeoms.AddRadioButton(rdoCount) @@ -134,9 +133,7 @@ Public Class dlgScatterPlot ucrPnlGeoms.AddParameterValuesCondition(rdoJitter, "checked", "geom_jitter") ucrPnlGeoms.AddToLinkedControls({ucrNudWidth, ucrNudHeigth}, {rdoJitter}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="0.40") ucrPnlGeoms.AddToLinkedControls({ucrNudPointsize, ucrInputShape}, {rdoPoint}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ', bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="1.5") - ' ucrPnlGeoms.AddToLinkedControls(ucrInputShape, {rdoPoint}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="Circle") ucrPnlGeoms.AddToLinkedControls({ucrInputLegend, ucrInputPosition}, {rdoCount}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ', bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="NA") - ' ucrPnlGeoms.AddToLinkedControls(ucrInputPosition, {rdoCount}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ', bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="Identity") ucrSaveScatterPlot.SetPrefix("scatter_plot") ucrSaveScatterPlot.SetSaveType(strRObjectType:=RObjectTypeLabel.Graph, @@ -200,11 +197,12 @@ Public Class dlgScatterPlot ucrInputPosition.SetParameter(New RParameter("position", 10)) dctPositioncount.Add("Identity", Chr(34) & "identity" & Chr(34)) - dctPositioncount.Add("Bin", Chr(34) & "bin" & Chr(34)) - dctPositioncount.Add("Count", Chr(34) & "count" & Chr(34)) - dctPositioncount.Add("Density", Chr(34) & "density" & Chr(34)) - dctPositioncount.Add("Sum", Chr(34) & "sum" & Chr(34)) - dctPositioncount.Add("Unique", Chr(34) & "unique" & Chr(34)) + dctPositioncount.Add("Stack", Chr(34) & "stack" & Chr(34)) + dctPositioncount.Add("Dodge", Chr(34) & "dodge" & Chr(34)) + dctPositioncount.Add("Dodge2", Chr(34) & "dodge2" & Chr(34)) + dctPositioncount.Add("Jitter", Chr(34) & "jitter" & Chr(34)) + dctPositioncount.Add("Fill", Chr(34) & "fill" & Chr(34)) + dctPositioncount.Add("PositionDodge", Chr(34) & "position_dodge" & Chr(34)) ucrInputPosition.SetItems(dctPositioncount) ucrInputPosition.SetRDefault(Chr(34) & "identity" & Chr(34)) ucrInputPosition.SetDropDownStyleAsNonEditable() @@ -355,7 +353,9 @@ Public Class dlgScatterPlot ucrNudPointsize.SetRCode(clsRScatterGeomFunction, bReset) ucrInputLegend.SetRCode(clsCountGeomFunction, bReset) ucrInputPosition.SetRCode(clsCountGeomFunction, bReset) - ucrPnlGeoms.SetRCode(clsDummyFunction, bReset) + If bReset Then + ucrPnlGeoms.SetRCode(clsDummyFunction, bReset) + End If End Sub Private Sub TestOkEnabled() @@ -484,10 +484,6 @@ Public Class dlgScatterPlot TestOkEnabled() End Sub - Private Sub ucrSaveScatterPlot_ContentsChanged(ucrChangedControl As ucrCore) Handles ucrVariablesAsFactorForScatter.ControlContentsChanged, ucrSaveScatterPlot.ControlContentsChanged, ucrReceiverX.ControlContentsChanged - - End Sub - Private Sub ucrReceiverLabel_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverLabel.ControlValueChanged If ucrReceiverLabel.IsEmpty Then clsBaseOperator.RemoveParameterByName(strGeomTextRepelParameterName) @@ -505,14 +501,10 @@ Public Class dlgScatterPlot clsBaseOperator.RemoveParameterByName(strFirstParameterName) clsBaseOperator.RemoveParameterByName(strGeomCountParameterName) ElseIf rdoPoint.Checked Then - clsRScatterGeomFunction.AddParameter("side", ucrNudPointsize.GetText, iPosition:=0) - clsRScatterGeomFunction.AddParameter("shape", Chr(34) & ucrInputShape.GetText() & Chr(34), iPosition:=1) clsBaseOperator.AddParameter(strFirstParameterName, clsRFunctionParameter:=clsRScatterGeomFunction, iPosition:=2) clsBaseOperator.RemoveParameterByName(strGeomJitterParameterName) clsBaseOperator.RemoveParameterByName(strGeomCountParameterName) ElseIf rdoCount.Checked Then - clsCountGeomFunction.AddParameter("position", Chr(34) & ucrInputPosition.GetText() & Chr(34), iPosition:=0) - clsCountGeomFunction.AddParameter("show.legend", Chr(34) & ucrInputLegend.GetText() & Chr(34), iPosition:=1) clsBaseOperator.AddParameter(strGeomCountParameterName, clsRFunctionParameter:=clsCountGeomFunction, iPosition:=2) clsBaseOperator.RemoveParameterByName(strGeomJitterParameterName) clsBaseOperator.RemoveParameterByName(strFirstParameterName) From 250c418143c2579b1101fc273059c38fde230c97 Mon Sep 17 00:00:00 2001 From: Stephen Lloyd Date: Thu, 26 Oct 2023 20:16:21 +0200 Subject: [PATCH 27/44] Ensure actual output displayed, not file path of output --- instat/clsRLink.vb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/instat/clsRLink.vb b/instat/clsRLink.vb index c60e51f8247..cb27acd42dd 100644 --- a/instat/clsRLink.vb +++ b/instat/clsRLink.vb @@ -736,8 +736,13 @@ Public Class RLink 'if not an assignment operation, then capture the output Dim strRStatementNoFormatting As String = clsRStatement.GetAsExecutableScript(bIncludeFormatting:=False) - If clsRStatement.clsAssignment Is Nothing _ - AndAlso Not String.IsNullOrWhiteSpace(strRStatementNoFormatting) Then + If strRStatementNoFormatting.StartsWith(strInstatDataObject & "$get_object_data") _ + OrElse strRStatementNoFormatting.StartsWith(strInstatDataObject & "$get_last_object_data") _ + OrElse strRStatementNoFormatting.StartsWith("view_object_data") Then + strOutput = GetFileOutput(strRStatementNoFormatting, bSilent:=False, + bSeparateThread:=False, bShowWaitDialogOverride:=Nothing) + ElseIf clsRStatement.clsAssignment Is Nothing _ + AndAlso Not String.IsNullOrWhiteSpace(strRStatementNoFormatting) Then strOutput = GetFileOutput("view_object_data(object = " _ & strRStatementNoFormatting _ & " , object_format = 'text' )", bSilent:=False, @@ -748,7 +753,7 @@ Public Class RLink End If clsOutputLogger.AddOutput(strRStatement, strOutput, bAsFile:=True, - bDisplayOutputInExternalViewer:=False) + bDisplayOutputInExternalViewer:=strRStatementNoFormatting.StartsWith("view_object_data")) LogScript(strRStatement.TrimEnd(vbCr, vbLf)) Catch e As Exception From 837a23ff3aa501b7df3e37f52a410850de5f01d5 Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Tue, 31 Oct 2023 10:08:12 +0100 Subject: [PATCH 28/44] minor change --- instat/dlgScatterPlot.Designer.vb | 150 +++++++++++++++--------------- instat/dlgScatterPlot.vb | 14 ++- 2 files changed, 81 insertions(+), 83 deletions(-) diff --git a/instat/dlgScatterPlot.Designer.vb b/instat/dlgScatterPlot.Designer.vb index 4b4551d21fb..a722c9958a4 100644 --- a/instat/dlgScatterPlot.Designer.vb +++ b/instat/dlgScatterPlot.Designer.vb @@ -53,21 +53,21 @@ Partial Class dlgScatterPlot Me.toolStripMenuItemJitterOptions = New System.Windows.Forms.ToolStripMenuItem() Me.toolStripMenuItemCountOptions = New System.Windows.Forms.ToolStripMenuItem() Me.grpGeom = New System.Windows.Forms.GroupBox() + Me.ucrInputPosition = New instat.ucrInputComboBox() Me.lblPosition = New System.Windows.Forms.Label() + Me.ucrInputLegend = New instat.ucrInputComboBox() Me.lblLegend = New System.Windows.Forms.Label() + Me.ucrInputShape = New instat.ucrInputComboBox() Me.lblPointsize = New System.Windows.Forms.Label() + Me.ucrNudPointsize = New instat.ucrNud() Me.lblShape = New System.Windows.Forms.Label() Me.rdoCount = New System.Windows.Forms.RadioButton() Me.rdoPoint = New System.Windows.Forms.RadioButton() Me.lblHeith = New System.Windows.Forms.Label() - Me.lblWidth = New System.Windows.Forms.Label() - Me.rdoJitter = New System.Windows.Forms.RadioButton() - Me.ucrInputPosition = New instat.ucrInputComboBox() - Me.ucrInputLegend = New instat.ucrInputComboBox() - Me.ucrInputShape = New instat.ucrInputComboBox() - Me.ucrNudPointsize = New instat.ucrNud() Me.ucrNudHeigth = New instat.ucrNud() + Me.lblWidth = New System.Windows.Forms.Label() Me.ucrNudWidth = New instat.ucrNud() + Me.rdoJitter = New System.Windows.Forms.RadioButton() Me.ucrPnlGeoms = New instat.UcrPanel() Me.cmdOptions = New instat.ucrSplitButton() Me.ucrInputSides = New instat.ucrInputComboBox() @@ -210,23 +210,56 @@ Partial Class dlgScatterPlot Me.grpGeom.TabStop = False Me.grpGeom.Text = "Geoms" ' + 'ucrInputPosition + ' + Me.ucrInputPosition.AddQuotesIfUnrecognised = True + Me.ucrInputPosition.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrInputPosition.GetSetSelectedIndex = -1 + Me.ucrInputPosition.IsReadOnly = False + Me.ucrInputPosition.Location = New System.Drawing.Point(240, 52) + Me.ucrInputPosition.Name = "ucrInputPosition" + Me.ucrInputPosition.Size = New System.Drawing.Size(83, 21) + Me.ucrInputPosition.TabIndex = 39 + ' 'lblPosition ' Me.lblPosition.AutoSize = True - Me.lblPosition.Location = New System.Drawing.Point(194, 57) + Me.lblPosition.Location = New System.Drawing.Point(192, 57) Me.lblPosition.Name = "lblPosition" Me.lblPosition.Size = New System.Drawing.Size(47, 13) Me.lblPosition.TabIndex = 38 Me.lblPosition.Text = "Position:" ' + 'ucrInputLegend + ' + Me.ucrInputLegend.AddQuotesIfUnrecognised = True + Me.ucrInputLegend.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrInputLegend.GetSetSelectedIndex = -1 + Me.ucrInputLegend.IsReadOnly = False + Me.ucrInputLegend.Location = New System.Drawing.Point(113, 52) + Me.ucrInputLegend.Name = "ucrInputLegend" + Me.ucrInputLegend.Size = New System.Drawing.Size(61, 21) + Me.ucrInputLegend.TabIndex = 37 + ' 'lblLegend ' Me.lblLegend.AutoSize = True Me.lblLegend.Location = New System.Drawing.Point(59, 57) Me.lblLegend.Name = "lblLegend" - Me.lblLegend.Size = New System.Drawing.Size(76, 13) + Me.lblLegend.Size = New System.Drawing.Size(46, 13) Me.lblLegend.TabIndex = 36 - Me.lblLegend.Text = "Show Legend:" + Me.lblLegend.Text = "Legend:" + ' + 'ucrInputShape + ' + Me.ucrInputShape.AddQuotesIfUnrecognised = True + Me.ucrInputShape.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrInputShape.GetSetSelectedIndex = -1 + Me.ucrInputShape.IsReadOnly = False + Me.ucrInputShape.Location = New System.Drawing.Point(227, 16) + Me.ucrInputShape.Name = "ucrInputShape" + Me.ucrInputShape.Size = New System.Drawing.Size(96, 21) + Me.ucrInputShape.TabIndex = 35 ' 'lblPointsize ' @@ -237,6 +270,19 @@ Partial Class dlgScatterPlot Me.lblPointsize.TabIndex = 33 Me.lblPointsize.Text = "Size:" ' + 'ucrNudPointsize + ' + Me.ucrNudPointsize.AutoSize = True + Me.ucrNudPointsize.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudPointsize.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudPointsize.Location = New System.Drawing.Point(113, 17) + Me.ucrNudPointsize.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudPointsize.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudPointsize.Name = "ucrNudPointsize" + Me.ucrNudPointsize.Size = New System.Drawing.Size(45, 20) + Me.ucrNudPointsize.TabIndex = 34 + Me.ucrNudPointsize.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' 'lblShape ' Me.lblShape.AutoSize = True @@ -277,72 +323,6 @@ Partial Class dlgScatterPlot Me.lblHeith.TabIndex = 27 Me.lblHeith.Text = "Heigth:" ' - 'lblWidth - ' - Me.lblWidth.AutoSize = True - Me.lblWidth.Location = New System.Drawing.Point(59, 92) - Me.lblWidth.Name = "lblWidth" - Me.lblWidth.Size = New System.Drawing.Size(38, 13) - Me.lblWidth.TabIndex = 25 - Me.lblWidth.Text = "Width:" - ' - 'rdoJitter - ' - Me.rdoJitter.AutoSize = True - Me.rdoJitter.Location = New System.Drawing.Point(4, 90) - Me.rdoJitter.Name = "rdoJitter" - Me.rdoJitter.Size = New System.Drawing.Size(47, 17) - Me.rdoJitter.TabIndex = 24 - Me.rdoJitter.TabStop = True - Me.rdoJitter.Text = "Jitter" - Me.rdoJitter.UseVisualStyleBackColor = True - ' - 'ucrInputPosition - ' - Me.ucrInputPosition.AddQuotesIfUnrecognised = True - Me.ucrInputPosition.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrInputPosition.GetSetSelectedIndex = -1 - Me.ucrInputPosition.IsReadOnly = False - Me.ucrInputPosition.Location = New System.Drawing.Point(242, 52) - Me.ucrInputPosition.Name = "ucrInputPosition" - Me.ucrInputPosition.Size = New System.Drawing.Size(83, 21) - Me.ucrInputPosition.TabIndex = 39 - ' - 'ucrInputLegend - ' - Me.ucrInputLegend.AddQuotesIfUnrecognised = True - Me.ucrInputLegend.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrInputLegend.GetSetSelectedIndex = -1 - Me.ucrInputLegend.IsReadOnly = False - Me.ucrInputLegend.Location = New System.Drawing.Point(138, 52) - Me.ucrInputLegend.Name = "ucrInputLegend" - Me.ucrInputLegend.Size = New System.Drawing.Size(48, 21) - Me.ucrInputLegend.TabIndex = 37 - ' - 'ucrInputShape - ' - Me.ucrInputShape.AddQuotesIfUnrecognised = True - Me.ucrInputShape.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrInputShape.GetSetSelectedIndex = -1 - Me.ucrInputShape.IsReadOnly = False - Me.ucrInputShape.Location = New System.Drawing.Point(227, 16) - Me.ucrInputShape.Name = "ucrInputShape" - Me.ucrInputShape.Size = New System.Drawing.Size(89, 21) - Me.ucrInputShape.TabIndex = 35 - ' - 'ucrNudPointsize - ' - Me.ucrNudPointsize.AutoSize = True - Me.ucrNudPointsize.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudPointsize.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudPointsize.Location = New System.Drawing.Point(113, 17) - Me.ucrNudPointsize.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudPointsize.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudPointsize.Name = "ucrNudPointsize" - Me.ucrNudPointsize.Size = New System.Drawing.Size(45, 20) - Me.ucrNudPointsize.TabIndex = 34 - Me.ucrNudPointsize.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' 'ucrNudHeigth ' Me.ucrNudHeigth.AutoSize = True @@ -356,6 +336,15 @@ Partial Class dlgScatterPlot Me.ucrNudHeigth.TabIndex = 28 Me.ucrNudHeigth.Value = New Decimal(New Integer() {0, 0, 0, 0}) ' + 'lblWidth + ' + Me.lblWidth.AutoSize = True + Me.lblWidth.Location = New System.Drawing.Point(59, 92) + Me.lblWidth.Name = "lblWidth" + Me.lblWidth.Size = New System.Drawing.Size(38, 13) + Me.lblWidth.TabIndex = 25 + Me.lblWidth.Text = "Width:" + ' 'ucrNudWidth ' Me.ucrNudWidth.AutoSize = True @@ -369,6 +358,17 @@ Partial Class dlgScatterPlot Me.ucrNudWidth.TabIndex = 26 Me.ucrNudWidth.Value = New Decimal(New Integer() {0, 0, 0, 0}) ' + 'rdoJitter + ' + Me.rdoJitter.AutoSize = True + Me.rdoJitter.Location = New System.Drawing.Point(4, 90) + Me.rdoJitter.Name = "rdoJitter" + Me.rdoJitter.Size = New System.Drawing.Size(47, 17) + Me.rdoJitter.TabIndex = 24 + Me.rdoJitter.TabStop = True + Me.rdoJitter.Text = "Jitter" + Me.rdoJitter.UseVisualStyleBackColor = True + ' 'ucrPnlGeoms ' Me.ucrPnlGeoms.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink diff --git a/instat/dlgScatterPlot.vb b/instat/dlgScatterPlot.vb index 0b5b9d1d1b2..b8904e640fe 100644 --- a/instat/dlgScatterPlot.vb +++ b/instat/dlgScatterPlot.vb @@ -71,7 +71,6 @@ Public Class dlgScatterPlot Dim dctSidesOptions As New Dictionary(Of String, String) Dim dctShapePoint As New Dictionary(Of String, String) Dim dctPositioncount As New Dictionary(Of String, String) - Dim dctLegendcount As New Dictionary(Of String, String) ucrBase.iHelpTopicID = 433 ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False @@ -132,8 +131,9 @@ Public Class dlgScatterPlot ucrPnlGeoms.AddParameterValuesCondition(rdoCount, "checked", "geom_count") ucrPnlGeoms.AddParameterValuesCondition(rdoJitter, "checked", "geom_jitter") ucrPnlGeoms.AddToLinkedControls({ucrNudWidth, ucrNudHeigth}, {rdoJitter}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="0.40") - ucrPnlGeoms.AddToLinkedControls({ucrNudPointsize, ucrInputShape}, {rdoPoint}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ', bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="1.5") - ucrPnlGeoms.AddToLinkedControls({ucrInputLegend, ucrInputPosition}, {rdoCount}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ', bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="NA") + ucrPnlGeoms.AddToLinkedControls({ucrNudPointsize, ucrInputShape}, {rdoPoint}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlGeoms.AddToLinkedControls(ucrInputPosition, {rdoCount}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlGeoms.AddToLinkedControls(ucrInputLegend, {rdoCount}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="NA") ucrSaveScatterPlot.SetPrefix("scatter_plot") ucrSaveScatterPlot.SetSaveType(strRObjectType:=RObjectTypeLabel.Graph, @@ -146,6 +146,7 @@ Public Class dlgScatterPlot ucrNudSize.SetParameter(New RParameter("size", 0)) ucrNudSize.Increment = 0.1 ucrNudSize.DecimalPlaces = 1 + ucrNudSize.SetRDefault("0.5") ucrNudHeigth.SetParameter(New RParameter("height", 5)) ucrNudHeigth.Maximum = 0.5 @@ -208,12 +209,9 @@ Public Class dlgScatterPlot ucrInputPosition.SetDropDownStyleAsNonEditable() ucrInputLegend.SetParameter(New RParameter("show.legend", 11)) - dctLegendcount.Add("NA", Chr(34) & "NA" & Chr(34)) - dctLegendcount.Add("TRUE", Chr(34) & "TRUE" & Chr(34)) - dctLegendcount.Add("FALSE", Chr(34) & "FALSE" & Chr(34)) - ucrInputLegend.SetItems(dctLegendcount) - ucrInputLegend.SetRDefault(Chr(34) & "NA" & Chr(34)) + ucrInputLegend.SetItems({"NA", "TRUE", "FALSE"}) ucrInputLegend.SetDropDownStyleAsNonEditable() + ucrInputLegend.AddQuotesIfUnrecognised = False ucrInputSides.SetParameter(New RParameter("sides", 1)) dctSidesOptions.Add("Bottom and left", Chr(34) & "bl" & Chr(34)) From 50e2e9e161a5958766ff14f66aca417791d4d1a1 Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Tue, 31 Oct 2023 12:25:31 +0100 Subject: [PATCH 29/44] minor change --- instat/dlgScatterPlot.vb | 21 +++++++++++---------- instat/ucrGeom.vb | 2 +- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/instat/dlgScatterPlot.vb b/instat/dlgScatterPlot.vb index b8904e640fe..06d378ffb8c 100644 --- a/instat/dlgScatterPlot.vb +++ b/instat/dlgScatterPlot.vb @@ -132,7 +132,7 @@ Public Class dlgScatterPlot ucrPnlGeoms.AddParameterValuesCondition(rdoJitter, "checked", "geom_jitter") ucrPnlGeoms.AddToLinkedControls({ucrNudWidth, ucrNudHeigth}, {rdoJitter}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="0.40") ucrPnlGeoms.AddToLinkedControls({ucrNudPointsize, ucrInputShape}, {rdoPoint}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - ucrPnlGeoms.AddToLinkedControls(ucrInputPosition, {rdoCount}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlGeoms.AddToLinkedControls(ucrInputPosition, {rdoCount}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="identity") ucrPnlGeoms.AddToLinkedControls(ucrInputLegend, {rdoCount}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="NA") ucrSaveScatterPlot.SetPrefix("scatter_plot") @@ -197,15 +197,7 @@ Public Class dlgScatterPlot ucrInputShape.SetDropDownStyleAsNonEditable() ucrInputPosition.SetParameter(New RParameter("position", 10)) - dctPositioncount.Add("Identity", Chr(34) & "identity" & Chr(34)) - dctPositioncount.Add("Stack", Chr(34) & "stack" & Chr(34)) - dctPositioncount.Add("Dodge", Chr(34) & "dodge" & Chr(34)) - dctPositioncount.Add("Dodge2", Chr(34) & "dodge2" & Chr(34)) - dctPositioncount.Add("Jitter", Chr(34) & "jitter" & Chr(34)) - dctPositioncount.Add("Fill", Chr(34) & "fill" & Chr(34)) - dctPositioncount.Add("PositionDodge", Chr(34) & "position_dodge" & Chr(34)) - ucrInputPosition.SetItems(dctPositioncount) - ucrInputPosition.SetRDefault(Chr(34) & "identity" & Chr(34)) + ucrInputPosition.SetItems({"identity", "stack", "dodge", "jitter", "fill", "position_dodge"}) ucrInputPosition.SetDropDownStyleAsNonEditable() ucrInputLegend.SetParameter(New RParameter("show.legend", 11)) @@ -503,6 +495,7 @@ Public Class dlgScatterPlot clsBaseOperator.RemoveParameterByName(strGeomJitterParameterName) clsBaseOperator.RemoveParameterByName(strGeomCountParameterName) ElseIf rdoCount.Checked Then + ChangePositionCount() clsBaseOperator.AddParameter(strGeomCountParameterName, clsRFunctionParameter:=clsCountGeomFunction, iPosition:=2) clsBaseOperator.RemoveParameterByName(strGeomJitterParameterName) clsBaseOperator.RemoveParameterByName(strFirstParameterName) @@ -510,4 +503,12 @@ Public Class dlgScatterPlot toolStripMenuItemJitterOptions.Enabled = rdoJitter.Checked toolStripMenuItemCountOptions.Enabled = rdoCount.Checked End Sub + + Private Sub ChangePositionCount() + If ucrInputPosition.GetText = "Jitter" Then + clsCountGeomFunction.AddParameter("position", "position_jitter(width=0.2,height=0.0)", iPosition:=0) + Else + clsCountGeomFunction.AddParameter("position", Chr(34) & ucrInputPosition.GetText & Chr(34), iPosition:=0) + End If + End Sub End Class diff --git a/instat/ucrGeom.vb b/instat/ucrGeom.vb index 114757d40f9..253d19ba4b5 100644 --- a/instat/ucrGeom.vb +++ b/instat/ucrGeom.vb @@ -1793,7 +1793,7 @@ Public Class ucrGeom 'Geom_line Parameters clsgeom_rug.AddLayerParameter("sides", "list", Chr(34) & "bl" & Chr(34), lstParameterStrings:={Chr(34) & "trbl" & Chr(34), Chr(34) & "trb" & Chr(34), Chr(34) & "trl" & Chr(34), Chr(34) & "tbl" & Chr(34), Chr(34) & "rbl" & Chr(34), Chr(34) & "tr" & Chr(34), Chr(34) & "tb" & Chr(34), Chr(34) & "tl" & Chr(34), Chr(34) & "rb" & Chr(34), Chr(34) & "rl" & Chr(34), Chr(34) & "bl" & Chr(34), Chr(34) & "t" & Chr(34), Chr(34) & "r" & Chr(34), Chr(34) & "b" & Chr(34), Chr(34) & "l" & Chr(34)}) 'Global Layer parameters - clsgeom_rug.AddLayerParameter("position", "list", Chr(34) & "identity" & Chr(34), lstParameterStrings:={Chr(34) & "stack" & Chr(34), Chr(34) & "dodge" & Chr(34), Chr(34) & "dodge2" & Chr(34), Chr(34) & "identity" & Chr(34), Chr(34) & "jitter" & Chr(34), Chr(34) & "fill" & Chr(34)}) + clsgeom_rug.AddLayerParameter("position", "list", Chr(34) & "identity" & Chr(34), lstParameterStrings:={Chr(34) & "stack" & Chr(34), Chr(34) & "dodge" & Chr(34), Chr(34) & "dodge2" & Chr(34), Chr(34) & "identity" & Chr(34), "position_jitter(width=0.2,height=0.1)", Chr(34) & "fill" & Chr(34)}) clsgeom_rug.AddLayerParameter("outside", "boolean", "FALSE") clsgeom_rug.AddLayerParameter("stat", "list", Chr(34) & "identity" & Chr(34), lstParameterStrings:={Chr(34) & "identity" & Chr(34), Chr(34) & "ecdf" & Chr(34), Chr(34) & "sum" & Chr(34), Chr(34) & "summary" & Chr(34), Chr(34) & "unique" & Chr(34)}) 'Warning, stat count cannot be used with y aesthetic !!! clsgeom_rug.AddLayerParameter("show.legend", "list", "TRUE", lstParameterStrings:={"NA", "TRUE", "FALSE"}) From 0ac1d1316bff0a76873e25a561eca71522264611 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Tue, 31 Oct 2023 14:38:24 +0300 Subject: [PATCH 30/44] removed changes from clsRLink --- instat/clsRLink.vb | 1 - 1 file changed, 1 deletion(-) diff --git a/instat/clsRLink.vb b/instat/clsRLink.vb index 69120586fd6..b1d9032204c 100644 --- a/instat/clsRLink.vb +++ b/instat/clsRLink.vb @@ -797,7 +797,6 @@ Public Class RLink If strLastScript.StartsWith(strInstatDataObject & "$get_object_data") OrElse strLastScript.StartsWith(strInstatDataObject & "$get_last_object_data") OrElse strLastScript.StartsWith("view_object_data") Then - strOutput = GetFileOutput(strScript, bSilent, bSeparateThread, bShowWaitDialogOverride) 'if last function is view_object then display in external viewer (maximised) bDisplayOutputInExternalViewer = strLastScript.Contains("view_object_data") From c9d534f05bf76ec86e70ebb9021aa5b0b7c1a0e3 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Tue, 31 Oct 2023 15:20:45 +0300 Subject: [PATCH 31/44] view, rename and delete dialogs --- instat/dlgDeleteObjects.Designer.vb | 46 ++++------ instat/dlgDeleteObjects.vb | 54 +++++------ instat/dlgRenameObjects.Designer.vb | 45 +++++---- instat/dlgRenameObjects.vb | 91 +++++++------------ instat/dlgReorderObjects.vb | 6 +- instat/dlgViewObjects.Designer.vb | 82 ++++++----------- instat/dlgViewObjects.vb | 75 +++++++-------- instat/static/InstatObject/R/data_object_R6.R | 8 +- 8 files changed, 172 insertions(+), 235 deletions(-) diff --git a/instat/dlgDeleteObjects.Designer.vb b/instat/dlgDeleteObjects.Designer.vb index 61f7fe01e2d..2e3ccaab2c1 100644 --- a/instat/dlgDeleteObjects.Designer.vb +++ b/instat/dlgDeleteObjects.Designer.vb @@ -44,15 +44,15 @@ Partial Class dlgDeleteObjects Me.ucrReceiverObjectsToDelete = New instat.ucrReceiverMultiple() Me.ucrSelectorDeleteObject = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrBase = New instat.ucrButtons() - Me.lblDeleteNumber = New System.Windows.Forms.Label() Me.SuspendLayout() ' 'lblObjectsToDelete ' Me.lblObjectsToDelete.AutoSize = True - Me.lblObjectsToDelete.Location = New System.Drawing.Point(251, 24) + Me.lblObjectsToDelete.Location = New System.Drawing.Point(372, 124) + Me.lblObjectsToDelete.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblObjectsToDelete.Name = "lblObjectsToDelete" - Me.lblObjectsToDelete.Size = New System.Drawing.Size(92, 13) + Me.lblObjectsToDelete.Size = New System.Drawing.Size(136, 20) Me.lblObjectsToDelete.TabIndex = 1 Me.lblObjectsToDelete.Tag = "Objects_to_Delete" Me.lblObjectsToDelete.Text = "Objects to Delete:" @@ -60,9 +60,10 @@ Partial Class dlgDeleteObjects 'lblType ' Me.lblType.AutoSize = True - Me.lblType.Location = New System.Drawing.Point(251, 149) + Me.lblType.Location = New System.Drawing.Point(373, 56) + Me.lblType.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblType.Name = "lblType" - Me.lblType.Size = New System.Drawing.Size(34, 13) + Me.lblType.Size = New System.Drawing.Size(47, 20) Me.lblType.TabIndex = 3 Me.lblType.Text = "Type:" ' @@ -72,20 +73,21 @@ Partial Class dlgDeleteObjects Me.ucrInputComboType.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrInputComboType.GetSetSelectedIndex = -1 Me.ucrInputComboType.IsReadOnly = False - Me.ucrInputComboType.Location = New System.Drawing.Point(254, 165) + Me.ucrInputComboType.Location = New System.Drawing.Point(378, 80) + Me.ucrInputComboType.Margin = New System.Windows.Forms.Padding(14) Me.ucrInputComboType.Name = "ucrInputComboType" - Me.ucrInputComboType.Size = New System.Drawing.Size(120, 21) + Me.ucrInputComboType.Size = New System.Drawing.Size(194, 32) Me.ucrInputComboType.TabIndex = 4 ' 'ucrReceiverObjectsToDelete ' Me.ucrReceiverObjectsToDelete.AutoSize = True Me.ucrReceiverObjectsToDelete.frmParent = Me - Me.ucrReceiverObjectsToDelete.Location = New System.Drawing.Point(254, 39) + Me.ucrReceiverObjectsToDelete.Location = New System.Drawing.Point(377, 146) Me.ucrReceiverObjectsToDelete.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverObjectsToDelete.Name = "ucrReceiverObjectsToDelete" Me.ucrReceiverObjectsToDelete.Selector = Nothing - Me.ucrReceiverObjectsToDelete.Size = New System.Drawing.Size(120, 100) + Me.ucrReceiverObjectsToDelete.Size = New System.Drawing.Size(195, 150) Me.ucrReceiverObjectsToDelete.strNcFilePath = "" Me.ucrReceiverObjectsToDelete.TabIndex = 2 Me.ucrReceiverObjectsToDelete.ucrSelector = Nothing @@ -96,38 +98,28 @@ Partial Class dlgDeleteObjects Me.ucrSelectorDeleteObject.bDropUnusedFilterLevels = False Me.ucrSelectorDeleteObject.bShowHiddenColumns = False Me.ucrSelectorDeleteObject.bUseCurrentFilter = True - Me.ucrSelectorDeleteObject.Location = New System.Drawing.Point(10, 10) + Me.ucrSelectorDeleteObject.Location = New System.Drawing.Point(15, 15) Me.ucrSelectorDeleteObject.Margin = New System.Windows.Forms.Padding(0) Me.ucrSelectorDeleteObject.Name = "ucrSelectorDeleteObject" - Me.ucrSelectorDeleteObject.Size = New System.Drawing.Size(213, 183) + Me.ucrSelectorDeleteObject.Size = New System.Drawing.Size(320, 274) Me.ucrSelectorDeleteObject.TabIndex = 0 ' 'ucrBase ' Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(10, 204) + Me.ucrBase.Location = New System.Drawing.Point(15, 306) + Me.ucrBase.Margin = New System.Windows.Forms.Padding(6) Me.ucrBase.Name = "ucrBase" - Me.ucrBase.Size = New System.Drawing.Size(408, 52) + Me.ucrBase.Size = New System.Drawing.Size(611, 77) Me.ucrBase.TabIndex = 5 ' - 'lblDeleteNumber - ' - Me.lblDeleteNumber.AutoSize = True - Me.lblDeleteNumber.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblDeleteNumber.Location = New System.Drawing.Point(338, 24) - Me.lblDeleteNumber.Name = "lblDeleteNumber" - Me.lblDeleteNumber.Size = New System.Drawing.Size(21, 13) - Me.lblDeleteNumber.TabIndex = 9 - Me.lblDeleteNumber.Text = "DF" - ' 'dlgDeleteObjects ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) + Me.AutoScaleDimensions = New System.Drawing.SizeF(144.0!, 144.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True - Me.ClientSize = New System.Drawing.Size(416, 260) - Me.Controls.Add(Me.lblDeleteNumber) + Me.ClientSize = New System.Drawing.Size(624, 390) Me.Controls.Add(Me.lblType) Me.Controls.Add(Me.ucrInputComboType) Me.Controls.Add(Me.ucrReceiverObjectsToDelete) @@ -135,6 +127,7 @@ Partial Class dlgDeleteObjects Me.Controls.Add(Me.ucrSelectorDeleteObject) Me.Controls.Add(Me.ucrBase) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.Margin = New System.Windows.Forms.Padding(4) Me.MaximizeBox = False Me.MinimizeBox = False Me.Name = "dlgDeleteObjects" @@ -152,5 +145,4 @@ Partial Class dlgDeleteObjects Friend WithEvents ucrReceiverObjectsToDelete As ucrReceiverMultiple Friend WithEvents lblType As Label Friend WithEvents ucrInputComboType As ucrInputComboBox - Friend WithEvents lblDeleteNumber As Label End Class diff --git a/instat/dlgDeleteObjects.vb b/instat/dlgDeleteObjects.vb index 88352107d56..ec4ef844269 100644 --- a/instat/dlgDeleteObjects.vb +++ b/instat/dlgDeleteObjects.vb @@ -25,8 +25,6 @@ Public Class dlgDeleteObjects If bFirstLoad Then InitialiseDialog() bFirstLoad = False - Else - ReopenDialog() End If If bReset Then SetDefaults() @@ -34,35 +32,35 @@ Public Class dlgDeleteObjects SetRCodeforControls(bReset) bReset = False autoTranslate(Me) - CountLevels() TestOKEnabled() End Sub Private Sub InitialiseDialog() ucrBase.iHelpTopicID = 352 - ' Selector ucrSelectorDeleteObject.SetParameter(New RParameter("data_name", 0)) ucrSelectorDeleteObject.SetParameterIsString() - ' Receiver + ucrInputComboType.SetParameter(New RParameter("object_type", 2)) + dctTypes.Add("Objects", Chr(34) & "object" & Chr(34)) + dctTypes.Add("Summaries", Chr(34) & RObjectTypeLabel.Summary & Chr(34)) + dctTypes.Add("Tables", Chr(34) & RObjectTypeLabel.Table & Chr(34)) + dctTypes.Add("Graphs", Chr(34) & RObjectTypeLabel.Graph & Chr(34)) + dctTypes.Add("Models", Chr(34) & RObjectTypeLabel.Model & Chr(34)) + dctTypes.Add("Structured", Chr(34) & RObjectTypeLabel.StructureLabel & Chr(34)) + dctTypes.Add("Filters", Chr(34) & "filter" & Chr(34)) + dctTypes.Add("Column selections", Chr(34) & "column_selection" & Chr(34)) + dctTypes.Add("Calculations", Chr(34) & "calculation" & Chr(34)) + ucrInputComboType.SetItems(dctTypes) + ucrInputComboType.SetDropDownStyleAsNonEditable() + ucrReceiverObjectsToDelete.SetParameter(New RParameter("object_names", 1)) ucrReceiverObjectsToDelete.SetParameterIsString() ucrReceiverObjectsToDelete.Selector = ucrSelectorDeleteObject ucrReceiverObjectsToDelete.SetMeAsReceiver() - ucrInputComboType.SetParameter(New RParameter("object_type", 2)) - dctTypes.Add("Objects", Chr(34) & "object" & Chr(34)) - dctTypes.Add("Summaries", RObjectTypeLabel.Summary) - dctTypes.Add("Tables", RObjectTypeLabel.Table) - dctTypes.Add("Graphs", RObjectTypeLabel.Graph) - dctTypes.Add("Models", RObjectTypeLabel.Model) - 'dctTypes.Add("Filters", Chr(34) & "filter" & Chr(34)) - 'dctTypes.Add("Column selections", Chr(34) & "column_selection" & Chr(34)) - ucrInputComboType.SetItems(dctTypes) - ucrInputComboType.SetDropDownStyleAsNonEditable() - lblDeleteNumber.ForeColor = Color.Red + End Sub Private Sub SetDefaults() @@ -77,7 +75,10 @@ Public Class dlgDeleteObjects End Sub Private Sub SetRCodeforControls(bReset As Boolean) - SetRCode(Me, ucrBase.clsRsyntax.clsBaseFunction, bReset) + ucrSelectorDeleteObject.SetRCode(clsDefaultFunction, bReset) + ucrInputComboType.SetRCode(clsDefaultFunction, bReset) + ucrReceiverObjectsToDelete.SetRCode(clsDefaultFunction, bReset) + 'SetRCode(Me, ucrBase.clsRsyntax.clsBaseFunction, bReset) End Sub Private Sub TestOKEnabled() @@ -88,10 +89,6 @@ Public Class dlgDeleteObjects End If End Sub - Private Sub ReopenDialog() - ucrSelectorDeleteObject.Reset() ' temporary fix - End Sub - Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset SetDefaults() SetRCodeforControls(True) @@ -99,22 +96,15 @@ Public Class dlgDeleteObjects End Sub Private Sub ucrInputComboType_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputComboType.ControlValueChanged - Dim key As String = dctTypes.Keys(ucrInputComboType.cboInput.SelectedIndex) - Dim value As String = "" - - If key IsNot Nothing AndAlso dctTypes.TryGetValue(key, value) Then - ucrReceiverObjectsToDelete.strSelectorHeading = key - ucrReceiverObjectsToDelete.SetItemType(value.Replace(Chr(34), "")) + ucrReceiverObjectsToDelete.Clear() + If dctTypes.ContainsKey(ucrInputComboType.GetText()) Then + ucrReceiverObjectsToDelete.strSelectorHeading = ucrInputComboType.GetText() + ucrReceiverObjectsToDelete.SetItemType(dctTypes.Item(ucrInputComboType.GetText()).Replace(Chr(34), "")) End If End Sub Private Sub ucrReceiverObjectsToDelete_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverObjectsToDelete.ControlContentsChanged TestOKEnabled() - CountLevels() End Sub - Private Sub CountLevels() - lblDeleteNumber.Text = " " & ucrReceiverObjectsToDelete.Count - lblDeleteNumber.Visible = ucrReceiverObjectsToDelete.Count > 0 - End Sub End Class diff --git a/instat/dlgRenameObjects.Designer.vb b/instat/dlgRenameObjects.Designer.vb index fd37c9950c1..ff50e46eed6 100644 --- a/instat/dlgRenameObjects.Designer.vb +++ b/instat/dlgRenameObjects.Designer.vb @@ -52,9 +52,10 @@ Partial Class dlgRenameObjects ' Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(10, 207) + Me.ucrBase.Location = New System.Drawing.Point(15, 310) + Me.ucrBase.Margin = New System.Windows.Forms.Padding(6) Me.ucrBase.Name = "ucrBase" - Me.ucrBase.Size = New System.Drawing.Size(405, 52) + Me.ucrBase.Size = New System.Drawing.Size(611, 77) Me.ucrBase.TabIndex = 7 ' 'ucrSelectorForRenameObject @@ -63,39 +64,41 @@ Partial Class dlgRenameObjects Me.ucrSelectorForRenameObject.bDropUnusedFilterLevels = False Me.ucrSelectorForRenameObject.bShowHiddenColumns = False Me.ucrSelectorForRenameObject.bUseCurrentFilter = True - Me.ucrSelectorForRenameObject.Location = New System.Drawing.Point(10, 10) + Me.ucrSelectorForRenameObject.Location = New System.Drawing.Point(15, 15) Me.ucrSelectorForRenameObject.Margin = New System.Windows.Forms.Padding(0) Me.ucrSelectorForRenameObject.Name = "ucrSelectorForRenameObject" - Me.ucrSelectorForRenameObject.Size = New System.Drawing.Size(213, 183) + Me.ucrSelectorForRenameObject.Size = New System.Drawing.Size(320, 274) Me.ucrSelectorForRenameObject.TabIndex = 0 ' 'ucrReceiverCurrentName ' Me.ucrReceiverCurrentName.AutoSize = True Me.ucrReceiverCurrentName.frmParent = Me - Me.ucrReceiverCurrentName.Location = New System.Drawing.Point(262, 60) + Me.ucrReceiverCurrentName.Location = New System.Drawing.Point(389, 152) Me.ucrReceiverCurrentName.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverCurrentName.Name = "ucrReceiverCurrentName" Me.ucrReceiverCurrentName.Selector = Nothing - Me.ucrReceiverCurrentName.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverCurrentName.Size = New System.Drawing.Size(180, 30) Me.ucrReceiverCurrentName.strNcFilePath = "" Me.ucrReceiverCurrentName.TabIndex = 2 Me.ucrReceiverCurrentName.ucrSelector = Nothing ' 'lblCurrentName ' - Me.lblCurrentName.Location = New System.Drawing.Point(262, 45) + Me.lblCurrentName.Location = New System.Drawing.Point(389, 130) + Me.lblCurrentName.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblCurrentName.Name = "lblCurrentName" - Me.lblCurrentName.Size = New System.Drawing.Size(100, 15) + Me.lblCurrentName.Size = New System.Drawing.Size(150, 22) Me.lblCurrentName.TabIndex = 1 Me.lblCurrentName.Tag = "Current_Name" Me.lblCurrentName.Text = "Current Name:" ' 'lblNewName ' - Me.lblNewName.Location = New System.Drawing.Point(262, 93) + Me.lblNewName.Location = New System.Drawing.Point(389, 202) + Me.lblNewName.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblNewName.Name = "lblNewName" - Me.lblNewName.Size = New System.Drawing.Size(100, 13) + Me.lblNewName.Size = New System.Drawing.Size(150, 20) Me.lblNewName.TabIndex = 3 Me.lblNewName.Tag = "New_Name" Me.lblNewName.Text = "New Name:" @@ -106,9 +109,10 @@ Partial Class dlgRenameObjects Me.ucrInputNewName.AutoSize = True Me.ucrInputNewName.IsMultiline = False Me.ucrInputNewName.IsReadOnly = False - Me.ucrInputNewName.Location = New System.Drawing.Point(262, 106) + Me.ucrInputNewName.Location = New System.Drawing.Point(389, 234) + Me.ucrInputNewName.Margin = New System.Windows.Forms.Padding(14) Me.ucrInputNewName.Name = "ucrInputNewName" - Me.ucrInputNewName.Size = New System.Drawing.Size(120, 21) + Me.ucrInputNewName.Size = New System.Drawing.Size(180, 32) Me.ucrInputNewName.TabIndex = 4 ' 'ucrInputType @@ -117,27 +121,29 @@ Partial Class dlgRenameObjects Me.ucrInputType.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrInputType.GetSetSelectedIndex = -1 Me.ucrInputType.IsReadOnly = False - Me.ucrInputType.Location = New System.Drawing.Point(262, 153) + Me.ucrInputType.Location = New System.Drawing.Point(389, 84) + Me.ucrInputType.Margin = New System.Windows.Forms.Padding(14) Me.ucrInputType.Name = "ucrInputType" - Me.ucrInputType.Size = New System.Drawing.Size(120, 21) + Me.ucrInputType.Size = New System.Drawing.Size(180, 32) Me.ucrInputType.TabIndex = 6 ' 'lblType ' Me.lblType.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblType.Location = New System.Drawing.Point(262, 140) + Me.lblType.Location = New System.Drawing.Point(389, 64) + Me.lblType.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblType.Name = "lblType" - Me.lblType.Size = New System.Drawing.Size(65, 13) + Me.lblType.Size = New System.Drawing.Size(98, 20) Me.lblType.TabIndex = 5 Me.lblType.Tag = "New_Name" Me.lblType.Text = "Type:" ' 'dlgRenameObjects ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) + Me.AutoScaleDimensions = New System.Drawing.SizeF(144.0!, 144.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True - Me.ClientSize = New System.Drawing.Size(417, 264) + Me.ClientSize = New System.Drawing.Size(626, 396) Me.Controls.Add(Me.lblType) Me.Controls.Add(Me.ucrInputType) Me.Controls.Add(Me.ucrReceiverCurrentName) @@ -147,12 +153,13 @@ Partial Class dlgRenameObjects Me.Controls.Add(Me.ucrSelectorForRenameObject) Me.Controls.Add(Me.ucrBase) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.Margin = New System.Windows.Forms.Padding(4) Me.MaximizeBox = False Me.MinimizeBox = False Me.Name = "dlgRenameObjects" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Tag = "Rename_Object" - Me.Text = "Rename Objects" + Me.Text = "Rename Object" Me.ResumeLayout(False) Me.PerformLayout() diff --git a/instat/dlgRenameObjects.vb b/instat/dlgRenameObjects.vb index 6cdadc0915b..87bd7bc2e6d 100644 --- a/instat/dlgRenameObjects.vb +++ b/instat/dlgRenameObjects.vb @@ -18,18 +18,13 @@ Imports instat.Translations Public Class dlgRenameObjects Public bFirstLoad As Boolean = True Private bReset As Boolean = True - Dim bUseSelectedColumn As Boolean = False - Dim strSelectedColumn As String = "" - Dim strSelectedDataFrame As String = "" - Private clsDefaultFunction As New RFunction + Private clsRenameRFunction As New RFunction Private dctTypes As New Dictionary(Of String, String) Private Sub dlgRenameObjects_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstLoad Then InitialiseDialog() bFirstLoad = False - Else - ReopenDialog() End If If bReset Then SetDefaults() @@ -37,60 +32,53 @@ Public Class dlgRenameObjects SetRCodeforControls(bReset) bReset = False TestOKEnabled() - If bUseSelectedColumn Then - SetDefaultColumn() - End If autoTranslate(Me) End Sub - Private Sub ReopenDialog() - ' temp. fix, the receivers should clear only if the name of the object in it has changed - ucrSelectorForRenameObject.Reset() - ucrInputNewName.SetName("") - End Sub - Private Sub InitialiseDialog() ucrBase.iHelpTopicID = 350 - 'ucrSelector ucrSelectorForRenameObject.SetParameter(New RParameter("data_name", 0)) ucrSelectorForRenameObject.SetParameterIsString() - 'ucrReceiver + ucrInputType.SetParameter(New RParameter("object_type", 3)) + dctTypes.Add("Objects", Chr(34) & "object" & Chr(34)) + dctTypes.Add("Summaries", Chr(34) & RObjectTypeLabel.Summary & Chr(34)) + dctTypes.Add("Tables", Chr(34) & RObjectTypeLabel.Table & Chr(34)) + dctTypes.Add("Graphs", Chr(34) & RObjectTypeLabel.Graph & Chr(34)) + dctTypes.Add("Models", Chr(34) & RObjectTypeLabel.Model & Chr(34)) + dctTypes.Add("Structured", Chr(34) & RObjectTypeLabel.StructureLabel & Chr(34)) + dctTypes.Add("Filters", Chr(34) & "filter" & Chr(34)) + dctTypes.Add("Column selections", Chr(34) & "column_selection" & Chr(34)) + dctTypes.Add("Calculations", Chr(34) & "calculation" & Chr(34)) + ucrInputType.SetItems(dctTypes) + ucrInputType.SetDropDownStyleAsNonEditable() + ucrReceiverCurrentName.SetParameter(New RParameter("object_name", 1)) ucrReceiverCurrentName.Selector = ucrSelectorForRenameObject ucrReceiverCurrentName.SetMeAsReceiver() ucrReceiverCurrentName.SetParameterIsString() - 'ucrNewName ucrInputNewName.SetParameter(New RParameter("new_name", 2)) ucrInputNewName.SetValidationTypeAsRVariable() - ucrInputType.SetParameter(New RParameter("object_type", 3)) - dctTypes.Add("Objects", Chr(34) & "object" & Chr(34)) - dctTypes.Add("Summaries", Chr(34) & "summary" & Chr(34)) - dctTypes.Add("Tables", Chr(34) & "table" & Chr(34)) - dctTypes.Add("Graphs", Chr(34) & "graph" & Chr(34)) - dctTypes.Add("Models", Chr(34) & "model" & Chr(34)) - dctTypes.Add("Filters", Chr(34) & "filter" & Chr(34)) - dctTypes.Add("Column selections", Chr(34) & "column_selection" & Chr(34)) - dctTypes.Add("Calculations", Chr(34) & "calculation" & Chr(34)) - ucrInputType.SetItems(dctTypes) - ucrInputType.SetDropDownStyleAsNonEditable() End Sub Private Sub SetDefaults() - clsDefaultFunction = New RFunction + clsRenameRFunction = New RFunction ucrSelectorForRenameObject.Reset() - clsDefaultFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$rename_object") - clsDefaultFunction.AddParameter("object_type", Chr(34) & "object" & Chr(34), iPosition:=3) - ucrBase.clsRsyntax.SetBaseRFunction(clsDefaultFunction) + clsRenameRFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$rename_object") + clsRenameRFunction.AddParameter("object_type", Chr(34) & "object" & Chr(34), iPosition:=3) + ucrBase.clsRsyntax.SetBaseRFunction(clsRenameRFunction) End Sub Private Sub SetRCodeforControls(bReset As Boolean) - SetRCode(Me, ucrBase.clsRsyntax.clsBaseFunction, bReset) + ucrSelectorForRenameObject.SetRCode(clsRenameRFunction, bReset) + ucrInputType.SetRCode(clsRenameRFunction, bReset) + ucrReceiverCurrentName.SetRCode(clsRenameRFunction, bReset) + ucrInputNewName.SetRCode(clsRenameRFunction, bReset) End Sub Private Sub TestOKEnabled() @@ -101,22 +89,17 @@ Public Class dlgRenameObjects End If End Sub - Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset - SetDefaults() - SetRCodeforControls(True) - TestOKEnabled() - End Sub - Public Sub SetCurrentColumn(strcolumn As String, strdataframe As String) - strSelectedColumn = strcolumn - strSelectedDataFrame = strdataframe - bUseSelectedColumn = True + Private Sub CoreControls_ContentsChanged() Handles ucrInputNewName.ControlContentsChanged, ucrSelectorForRenameObject.ControlContentsChanged, ucrReceiverCurrentName.ControlContentsChanged + TestOKEnabled() End Sub - Private Sub SetDefaultColumn() - ucrSelectorForRenameObject.SetDataframe(strSelectedDataFrame) - ucrReceiverCurrentName.Add(strSelectedColumn, strSelectedDataFrame) - bUseSelectedColumn = False + Private Sub ucrInputType_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputType.ControlValueChanged + ucrReceiverCurrentName.Clear() + If dctTypes.ContainsKey(ucrInputType.GetText()) Then + ucrReceiverCurrentName.strSelectorHeading = ucrInputType.GetText() + ucrReceiverCurrentName.SetItemType(dctTypes.Item(ucrInputType.GetText()).Replace(Chr(34), "")) + End If End Sub Private Sub ucrReceiverCurrentName_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverCurrentName.ControlValueChanged @@ -125,17 +108,13 @@ Public Class dlgRenameObjects End If End Sub - Private Sub ucrInputType_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputType.ControlValueChanged - Dim key As String = dctTypes.Keys(ucrInputType.cboInput.SelectedIndex) - Dim value As String = "" - If key IsNot Nothing AndAlso dctTypes.TryGetValue(key, value) Then - ucrReceiverCurrentName.strSelectorHeading = key - ucrReceiverCurrentName.SetItemType(value.Replace(Chr(34), "")) - End If - End Sub - Private Sub CoreControls_ContentsChanged() Handles ucrInputNewName.ControlContentsChanged, ucrSelectorForRenameObject.ControlContentsChanged, ucrReceiverCurrentName.ControlContentsChanged + Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset + SetDefaults() + SetRCodeforControls(True) TestOKEnabled() End Sub + + End Class \ No newline at end of file diff --git a/instat/dlgReorderObjects.vb b/instat/dlgReorderObjects.vb index bf5eecbc8c5..7bb9fa018bd 100644 --- a/instat/dlgReorderObjects.vb +++ b/instat/dlgReorderObjects.vb @@ -69,10 +69,10 @@ Public Class dlgReorderObjects SetRCode(Me, ucrBase.clsRsyntax.clsBaseFunction, bReset) End Sub - Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset - SetDefaults() + Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset + SetDefaults() SetRCodeforControls(True) - TestOKEnabled() + TestOKEnabled() End Sub Private Sub ucrReorderObjects_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReorderObjects.ControlContentsChanged diff --git a/instat/dlgViewObjects.Designer.vb b/instat/dlgViewObjects.Designer.vb index 2df4e79b32d..02f79953bcf 100644 --- a/instat/dlgViewObjects.Designer.vb +++ b/instat/dlgViewObjects.Designer.vb @@ -40,8 +40,6 @@ Partial Class dlgViewObjects Private Sub InitializeComponent() Me.lblSelectedObject = New System.Windows.Forms.Label() Me.rdoStructure = New System.Windows.Forms.RadioButton() - Me.rdoAllContents = New System.Windows.Forms.RadioButton() - Me.rdoComponent = New System.Windows.Forms.RadioButton() Me.rdoPrint = New System.Windows.Forms.RadioButton() Me.ucrReceiverSelectedObject = New instat.ucrReceiverSingle() Me.ucrSelectorForViewObject = New instat.ucrSelectorByDataFrameAddRemove() @@ -54,54 +52,33 @@ Partial Class dlgViewObjects 'lblSelectedObject ' Me.lblSelectedObject.AutoSize = True - Me.lblSelectedObject.Location = New System.Drawing.Point(250, 72) + Me.lblSelectedObject.Location = New System.Drawing.Point(375, 108) + Me.lblSelectedObject.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblSelectedObject.Name = "lblSelectedObject" - Me.lblSelectedObject.Size = New System.Drawing.Size(83, 13) + Me.lblSelectedObject.Size = New System.Drawing.Size(89, 30) Me.lblSelectedObject.TabIndex = 1 - Me.lblSelectedObject.Text = "Object To View:" + Me.lblSelectedObject.Text = "Object:" ' 'rdoStructure ' Me.rdoStructure.AutoSize = True - Me.rdoStructure.Location = New System.Drawing.Point(256, 144) + Me.rdoStructure.Location = New System.Drawing.Point(384, 216) + Me.rdoStructure.Margin = New System.Windows.Forms.Padding(4) Me.rdoStructure.Name = "rdoStructure" - Me.rdoStructure.Size = New System.Drawing.Size(68, 17) + Me.rdoStructure.Size = New System.Drawing.Size(100, 24) Me.rdoStructure.TabIndex = 5 Me.rdoStructure.TabStop = True Me.rdoStructure.Tag = "Structure" Me.rdoStructure.Text = "Structure" Me.rdoStructure.UseVisualStyleBackColor = True ' - 'rdoAllContents - ' - Me.rdoAllContents.AutoSize = True - Me.rdoAllContents.Location = New System.Drawing.Point(256, 166) - Me.rdoAllContents.Name = "rdoAllContents" - Me.rdoAllContents.Size = New System.Drawing.Size(81, 17) - Me.rdoAllContents.TabIndex = 6 - Me.rdoAllContents.TabStop = True - Me.rdoAllContents.Tag = "All_Contents" - Me.rdoAllContents.Text = "All Contents" - Me.rdoAllContents.UseVisualStyleBackColor = True - ' - 'rdoComponent - ' - Me.rdoComponent.AutoSize = True - Me.rdoComponent.Location = New System.Drawing.Point(256, 188) - Me.rdoComponent.Name = "rdoComponent" - Me.rdoComponent.Size = New System.Drawing.Size(79, 17) - Me.rdoComponent.TabIndex = 7 - Me.rdoComponent.TabStop = True - Me.rdoComponent.Tag = "Component" - Me.rdoComponent.Text = "Component" - Me.rdoComponent.UseVisualStyleBackColor = True - ' 'rdoPrint ' Me.rdoPrint.AutoSize = True - Me.rdoPrint.Location = New System.Drawing.Point(256, 122) + Me.rdoPrint.Location = New System.Drawing.Point(384, 183) + Me.rdoPrint.Margin = New System.Windows.Forms.Padding(4) Me.rdoPrint.Name = "rdoPrint" - Me.rdoPrint.Size = New System.Drawing.Size(46, 17) + Me.rdoPrint.Size = New System.Drawing.Size(66, 24) Me.rdoPrint.TabIndex = 4 Me.rdoPrint.TabStop = True Me.rdoPrint.Text = "Print" @@ -111,11 +88,11 @@ Partial Class dlgViewObjects ' Me.ucrReceiverSelectedObject.AutoSize = True Me.ucrReceiverSelectedObject.frmParent = Me - Me.ucrReceiverSelectedObject.Location = New System.Drawing.Point(250, 87) + Me.ucrReceiverSelectedObject.Location = New System.Drawing.Point(375, 130) Me.ucrReceiverSelectedObject.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverSelectedObject.Name = "ucrReceiverSelectedObject" Me.ucrReceiverSelectedObject.Selector = Nothing - Me.ucrReceiverSelectedObject.Size = New System.Drawing.Size(137, 20) + Me.ucrReceiverSelectedObject.Size = New System.Drawing.Size(206, 30) Me.ucrReceiverSelectedObject.strNcFilePath = "" Me.ucrReceiverSelectedObject.TabIndex = 2 Me.ucrReceiverSelectedObject.ucrSelector = Nothing @@ -126,29 +103,29 @@ Partial Class dlgViewObjects Me.ucrSelectorForViewObject.bDropUnusedFilterLevels = False Me.ucrSelectorForViewObject.bShowHiddenColumns = False Me.ucrSelectorForViewObject.bUseCurrentFilter = True - Me.ucrSelectorForViewObject.Location = New System.Drawing.Point(10, 10) + Me.ucrSelectorForViewObject.Location = New System.Drawing.Point(15, 15) Me.ucrSelectorForViewObject.Margin = New System.Windows.Forms.Padding(0) Me.ucrSelectorForViewObject.Name = "ucrSelectorForViewObject" - Me.ucrSelectorForViewObject.Size = New System.Drawing.Size(213, 183) + Me.ucrSelectorForViewObject.Size = New System.Drawing.Size(320, 274) Me.ucrSelectorForViewObject.TabIndex = 0 ' 'ucrBase ' Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(8, 222) - Me.ucrBase.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.ucrBase.Location = New System.Drawing.Point(12, 333) + Me.ucrBase.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) Me.ucrBase.Name = "ucrBase" - Me.ucrBase.Size = New System.Drawing.Size(408, 52) + Me.ucrBase.Size = New System.Drawing.Size(611, 77) Me.ucrBase.TabIndex = 8 ' 'ucrPnlContentsToView ' Me.ucrPnlContentsToView.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlContentsToView.Location = New System.Drawing.Point(250, 115) - Me.ucrPnlContentsToView.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) + Me.ucrPnlContentsToView.Location = New System.Drawing.Point(375, 172) + Me.ucrPnlContentsToView.Margin = New System.Windows.Forms.Padding(9, 12, 9, 12) Me.ucrPnlContentsToView.Name = "ucrPnlContentsToView" - Me.ucrPnlContentsToView.Size = New System.Drawing.Size(120, 98) + Me.ucrPnlContentsToView.Size = New System.Drawing.Size(180, 100) Me.ucrPnlContentsToView.TabIndex = 3 ' 'ucrInputObjectType @@ -157,31 +134,31 @@ Partial Class dlgViewObjects Me.ucrInputObjectType.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrInputObjectType.GetSetSelectedIndex = -1 Me.ucrInputObjectType.IsReadOnly = False - Me.ucrInputObjectType.Location = New System.Drawing.Point(250, 47) + Me.ucrInputObjectType.Location = New System.Drawing.Point(375, 70) + Me.ucrInputObjectType.Margin = New System.Windows.Forms.Padding(14) Me.ucrInputObjectType.Name = "ucrInputObjectType" - Me.ucrInputObjectType.Size = New System.Drawing.Size(137, 21) + Me.ucrInputObjectType.Size = New System.Drawing.Size(206, 32) Me.ucrInputObjectType.TabIndex = 9 ' 'lblObjectType ' Me.lblObjectType.AutoSize = True - Me.lblObjectType.Location = New System.Drawing.Point(250, 32) + Me.lblObjectType.Location = New System.Drawing.Point(375, 48) + Me.lblObjectType.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblObjectType.Name = "lblObjectType" - Me.lblObjectType.Size = New System.Drawing.Size(34, 13) + Me.lblObjectType.Size = New System.Drawing.Size(47, 20) Me.lblObjectType.TabIndex = 10 Me.lblObjectType.Text = "Type:" ' 'dlgViewObjects ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) + Me.AutoScaleDimensions = New System.Drawing.SizeF(144.0!, 144.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True - Me.ClientSize = New System.Drawing.Size(416, 277) + Me.ClientSize = New System.Drawing.Size(624, 416) Me.Controls.Add(Me.lblObjectType) Me.Controls.Add(Me.ucrInputObjectType) Me.Controls.Add(Me.rdoPrint) - Me.Controls.Add(Me.rdoComponent) - Me.Controls.Add(Me.rdoAllContents) Me.Controls.Add(Me.rdoStructure) Me.Controls.Add(Me.ucrReceiverSelectedObject) Me.Controls.Add(Me.lblSelectedObject) @@ -189,6 +166,7 @@ Partial Class dlgViewObjects Me.Controls.Add(Me.ucrBase) Me.Controls.Add(Me.ucrPnlContentsToView) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.Margin = New System.Windows.Forms.Padding(4) Me.MaximizeBox = False Me.MinimizeBox = False Me.Name = "dlgViewObjects" @@ -205,8 +183,6 @@ Partial Class dlgViewObjects Friend WithEvents lblSelectedObject As Label Friend WithEvents ucrReceiverSelectedObject As ucrReceiverSingle Friend WithEvents rdoStructure As RadioButton - Friend WithEvents rdoAllContents As RadioButton - Friend WithEvents rdoComponent As RadioButton Friend WithEvents rdoPrint As RadioButton Friend WithEvents ucrPnlContentsToView As UcrPanel Friend WithEvents lblObjectType As Label diff --git a/instat/dlgViewObjects.vb b/instat/dlgViewObjects.vb index 8fbd3bdb03d..3cf9bd02936 100644 --- a/instat/dlgViewObjects.vb +++ b/instat/dlgViewObjects.vb @@ -20,7 +20,7 @@ Imports RDotNet Public Class dlgViewObjects Private bFirstLoad As Boolean = True Private bReset As Boolean = True - Private clsStructureRFunction, clsPrintRFunction, clsDummyFunction As New RFunction + Private clsStructureRFunction, clsPrintRFunction As New RFunction Private dctTypes As New Dictionary(Of String, String) Private Sub dlgViewObjects_Load(sender As Object, e As EventArgs) Handles MyBase.Load @@ -41,10 +41,25 @@ Public Class dlgViewObjects ucrBase.iHelpTopicID = 349 'todo. temporary to have the str() output captured as text ucrBase.clsRsyntax.iCallType = -1 + + 'ucrPnlOptions.AddRadioButton(rdoOutputObjects) + 'ucrPnlOptions.AddRadioButton(rdoDataObjects) + 'rdoDataObjects.Enabled = False + + 'ucrPnlOptions.AddFunctionNamesCondition(rdoOutputObjects, {frmMain.clsRLink.strInstatDataObject & "$get_object_data", "str"}) + ucrSelectorForViewObject.SetParameter(New RParameter("data_name", 0)) ucrSelectorForViewObject.SetParameterIsString() - ' ucr receiver + dctTypes.Add("Objects", "object") + dctTypes.Add("Summaries", RObjectTypeLabel.Summary) + dctTypes.Add("Tables", RObjectTypeLabel.Table) + dctTypes.Add("Graphs", RObjectTypeLabel.Graph) + dctTypes.Add("Models", RObjectTypeLabel.Model) + dctTypes.Add("Structured", RObjectTypeLabel.StructureLabel) + ucrInputObjectType.SetItems(dctTypes, bSetConditions:=False) + ucrInputObjectType.SetDropDownStyleAsNonEditable() + ucrReceiverSelectedObject.SetParameter(New RParameter("object_name", 1)) ucrReceiverSelectedObject.Selector = ucrSelectorForViewObject ucrReceiverSelectedObject.SetMeAsReceiver() @@ -52,26 +67,11 @@ Public Class dlgViewObjects ucrReceiverSelectedObject.SetItemType("object") ucrReceiverSelectedObject.bAutoFill = True - 'todo. disabling and hiding this for now until they're working correctly. - rdoAllContents.Visible = False - rdoComponent.Visible = False - - 'add radio buttons to the panel rdo's ucrPnlContentsToView.AddRadioButton(rdoPrint) ucrPnlContentsToView.AddRadioButton(rdoStructure) - ucrPnlContentsToView.AddParameterValuesCondition(rdoPrint, "check", "print") - ucrPnlContentsToView.AddParameterValuesCondition(rdoStructure, "check", "str") - - ucrInputObjectType.SetParameter(New RParameter("object_type", 0)) - dctTypes.Add("Objects", Chr(34) & "object" & Chr(34)) - dctTypes.Add("Summaries", RObjectTypeLabel.Summary) - dctTypes.Add("Tables", RObjectTypeLabel.Table) - dctTypes.Add("Graphs", RObjectTypeLabel.Graph) - dctTypes.Add("Models", RObjectTypeLabel.Model) - dctTypes.Add("Structured", RObjectTypeLabel.StructureLabel) - ucrInputObjectType.SetItems(dctTypes) - ucrInputObjectType.SetDropDownStyleAsNonEditable() + ucrPnlContentsToView.AddFunctionNamesCondition(rdoPrint, frmMain.clsRLink.strInstatDataObject & "$get_object_data", bNewIsPositive:=True) + ucrPnlContentsToView.AddFunctionNamesCondition(rdoStructure, "str", bNewIsPositive:=True) End Sub @@ -79,22 +79,19 @@ Public Class dlgViewObjects 'initialise the Rfunctions clsStructureRFunction = New RFunction clsPrintRFunction = New RFunction - clsDummyFunction = New RFunction 'reset controls to default states ucrSelectorForViewObject.Reset() + ucrInputObjectType.GetSetSelectedIndex = 0 + rdoPrint.Checked = True - clsDummyFunction.AddParameter("object_type", Chr(34) & "object" & Chr(34), iPosition:=0) - clsDummyFunction.AddParameter("check", "print", iPosition:=1) + 'set R function for showing selected object structure + clsStructureRFunction.SetRCommand("str") 'as of 02/3/2023 get object data is used instead of print command because the print command is not yet supported for html formats. clsPrintRFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_object_data") clsPrintRFunction.AddParameter("as_file", "TRUE", iPosition:=2) - 'set R function for showing selected object structure - clsStructureRFunction.SetRCommand("str") - - 'set the base function ucrBase.clsRsyntax.SetBaseRFunction(clsPrintRFunction) End Sub @@ -102,23 +99,29 @@ Public Class dlgViewObjects ucrReceiverSelectedObject.AddAdditionalCodeParameterPair(clsStructureRFunction, New RParameter("object", 1)) ucrSelectorForViewObject.SetRCode(clsPrintRFunction, bReset) ucrReceiverSelectedObject.SetRCode(clsPrintRFunction, bReset) - ucrInputObjectType.SetRCode(clsDummyFunction, bReset) - ucrPnlContentsToView.SetRCode(clsDummyFunction, bReset) + ucrPnlContentsToView.SetRCode(ucrBase.clsRsyntax.clsBaseFunction) + 'ucrPnlOptions.SetRCode(ucrBase.clsRsyntax.clsBaseFunction) End Sub Private Sub TestOKEnabled() ucrBase.OKEnabled(Not ucrReceiverSelectedObject.IsEmpty) End Sub + Private Sub ucrInputObjectType_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputObjectType.ControlValueChanged + ucrReceiverSelectedObject.Clear() + If dctTypes.ContainsKey(ucrInputObjectType.GetText()) Then + ucrReceiverSelectedObject.strSelectorHeading = ucrInputObjectType.GetText() + ucrReceiverSelectedObject.SetItemType(dctTypes.Item(ucrInputObjectType.GetText())) + End If + End Sub + Private Sub ucrPnlContentsToReview_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrPnlContentsToView.ControlContentsChanged - 'set the appropriate Base RFunction + 'set the appropriate base RFunction If rdoPrint.Checked Then ucrReceiverSelectedObject.SetParameterIsString() - clsDummyFunction.AddParameter("check", "print", iPosition:=1) ucrBase.clsRsyntax.SetBaseRFunction(clsPrintRFunction) ElseIf rdoStructure.Checked Then ucrReceiverSelectedObject.SetParameterIsRFunction() - clsDummyFunction.AddParameter("check", "str", iPosition:=1) ucrBase.clsRsyntax.SetBaseRFunction(clsStructureRFunction) End If End Sub @@ -133,15 +136,5 @@ Public Class dlgViewObjects TestOKEnabled() End Sub - Private Sub ucrInputObjectType_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputObjectType.ControlValueChanged - 'Checks whether the item in the receiver is contained in the selector. I.e when a selected object is renamed, the receiver clears. - If Not ucrReceiverSelectedObject.IsEmpty AndAlso ucrSelectorForViewObject.lstAvailableVariable.FindItemWithText(ucrReceiverSelectedObject.GetVariableNames(False), True, 0, False) Is Nothing Then - ucrReceiverSelectedObject.SetText("") - End If - If dctTypes.ContainsKey(ucrInputObjectType.cboInput.Text) Then - ucrReceiverSelectedObject.strSelectorHeading = ucrInputObjectType.cboInput.Text - ucrReceiverSelectedObject.SetItemType(dctTypes.Item(ucrInputObjectType.cboInput.Text).Replace(Chr(34), "")) - End If - End Sub End Class diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index bd57034b5f9..ea602730142 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -2157,9 +2157,9 @@ DataSheet$set("public", "get_object", function(object_name) { ) DataSheet$set("public", "rename_object", function(object_name, new_name, object_type = "object") { - if(!object_type %in% c("object", "filter", "calculation", "graph", "table","model", "column_selection")) stop(object_type, " must be either object (graph, table or model), filter, column_selection or a calculation.") + if(!object_type %in% c("object", "filter", "calculation", "graph", "table","model","structure","Summary", "column_selection")) stop(object_type, " must be either object (graph, table or model), filter, column_selection or a calculation.") #Temp fix:: added graph, table and model so as to distinguish this when implementing it in the dialog. Otherwise they remain as objects - if (object_type %in% c("object", "graph", "table","model")){ + if (object_type %in% c("object", "graph", "table","model","structure","Summary")){ if(!object_name %in% names(private$objects)) stop(object_name, " not found in objects list") if(new_name %in% names(private$objects)) stop(new_name, " is already an object name. Cannot rename ", object_name, " to ", new_name) names(private$objects)[names(private$objects) == object_name] <- new_name @@ -2187,8 +2187,8 @@ DataSheet$set("public", "rename_object", function(object_name, new_name, object_ ) DataSheet$set("public", "delete_objects", function(data_name, object_names, object_type = "object") { - if(!object_type %in% c("object", "graph", "table","model","filter", "calculation", "column_selection")) stop(object_type, " must be either object (graph, table or model), filter, column selection or a calculation.") - if(any(object_type %in% c("object", "graph", "table","model"))){ + if(!object_type %in% c("object", "graph", "table","model","structure","Summary","filter", "calculation", "column_selection")) stop(object_type, " must be either object (graph, table or model), filter, column selection or a calculation.") + if(any(object_type %in% c("object", "graph", "table","model","structure","Summary"))){ if(!all(object_names %in% names(private$objects))) stop("Not all object_names found in overall objects list.") private$objects[names(private$objects) %in% object_names] <- NULL }else if(object_type == "filter"){ From 01178950eeb156878a27281318c2ce9cd81825e3 Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Tue, 31 Oct 2023 13:54:25 +0100 Subject: [PATCH 32/44] minor change --- instat/dlgScatterPlot.vb | 4 ++-- instat/ucrGeom.vb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/instat/dlgScatterPlot.vb b/instat/dlgScatterPlot.vb index 06d378ffb8c..b74fea3f11b 100644 --- a/instat/dlgScatterPlot.vb +++ b/instat/dlgScatterPlot.vb @@ -197,7 +197,7 @@ Public Class dlgScatterPlot ucrInputShape.SetDropDownStyleAsNonEditable() ucrInputPosition.SetParameter(New RParameter("position", 10)) - ucrInputPosition.SetItems({"identity", "stack", "dodge", "jitter", "fill", "position_dodge"}) + ucrInputPosition.SetItems({"identity", "stack", "dodge", "jitter", "fill", "position_dodge", "position_jitter(width=0.2,height=0.0)"}) ucrInputPosition.SetDropDownStyleAsNonEditable() ucrInputLegend.SetParameter(New RParameter("show.legend", 11)) @@ -505,7 +505,7 @@ Public Class dlgScatterPlot End Sub Private Sub ChangePositionCount() - If ucrInputPosition.GetText = "Jitter" Then + If ucrInputPosition.GetText = "position_jitter(width=0.2,height=0.0)" Then clsCountGeomFunction.AddParameter("position", "position_jitter(width=0.2,height=0.0)", iPosition:=0) Else clsCountGeomFunction.AddParameter("position", Chr(34) & ucrInputPosition.GetText & Chr(34), iPosition:=0) diff --git a/instat/ucrGeom.vb b/instat/ucrGeom.vb index 253d19ba4b5..48dd0d564fd 100644 --- a/instat/ucrGeom.vb +++ b/instat/ucrGeom.vb @@ -1793,7 +1793,7 @@ Public Class ucrGeom 'Geom_line Parameters clsgeom_rug.AddLayerParameter("sides", "list", Chr(34) & "bl" & Chr(34), lstParameterStrings:={Chr(34) & "trbl" & Chr(34), Chr(34) & "trb" & Chr(34), Chr(34) & "trl" & Chr(34), Chr(34) & "tbl" & Chr(34), Chr(34) & "rbl" & Chr(34), Chr(34) & "tr" & Chr(34), Chr(34) & "tb" & Chr(34), Chr(34) & "tl" & Chr(34), Chr(34) & "rb" & Chr(34), Chr(34) & "rl" & Chr(34), Chr(34) & "bl" & Chr(34), Chr(34) & "t" & Chr(34), Chr(34) & "r" & Chr(34), Chr(34) & "b" & Chr(34), Chr(34) & "l" & Chr(34)}) 'Global Layer parameters - clsgeom_rug.AddLayerParameter("position", "list", Chr(34) & "identity" & Chr(34), lstParameterStrings:={Chr(34) & "stack" & Chr(34), Chr(34) & "dodge" & Chr(34), Chr(34) & "dodge2" & Chr(34), Chr(34) & "identity" & Chr(34), "position_jitter(width=0.2,height=0.1)", Chr(34) & "fill" & Chr(34)}) + clsgeom_rug.AddLayerParameter("position", "list", Chr(34) & "identity" & Chr(34), lstParameterStrings:={Chr(34) & "stack" & Chr(34), Chr(34) & "dodge" & Chr(34), Chr(34) & "dodge2" & Chr(34), Chr(34) & "identity" & Chr(34), "position_jitter(width=0.2,height=0.1)", Chr(34) & "fill" & Chr(34), Chr(34) & "jitter" & Chr(34)}) clsgeom_rug.AddLayerParameter("outside", "boolean", "FALSE") clsgeom_rug.AddLayerParameter("stat", "list", Chr(34) & "identity" & Chr(34), lstParameterStrings:={Chr(34) & "identity" & Chr(34), Chr(34) & "ecdf" & Chr(34), Chr(34) & "sum" & Chr(34), Chr(34) & "summary" & Chr(34), Chr(34) & "unique" & Chr(34)}) 'Warning, stat count cannot be used with y aesthetic !!! clsgeom_rug.AddLayerParameter("show.legend", "list", "TRUE", lstParameterStrings:={"NA", "TRUE", "FALSE"}) From 32be1ba9cca8f2b2d03abf1f2d0f2d7003af1776 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Tue, 31 Oct 2023 16:32:18 +0300 Subject: [PATCH 33/44] Removed regression and added comments --- instat/dlgDeleteObjects.vb | 16 +++---- instat/dlgViewObjects.Designer.vb | 80 ++++++++++++++++++++++++++----- instat/dlgViewObjects.vb | 12 ++--- instat/ucrReceiver.vb | 6 ++- instat/ucrReceiverSingle.vb | 10 ++++ instat/ucrSelector.vb | 2 + 6 files changed, 100 insertions(+), 26 deletions(-) diff --git a/instat/dlgDeleteObjects.vb b/instat/dlgDeleteObjects.vb index ec4ef844269..fa78b766a2c 100644 --- a/instat/dlgDeleteObjects.vb +++ b/instat/dlgDeleteObjects.vb @@ -19,7 +19,7 @@ Public Class dlgDeleteObjects Private bFirstLoad As Boolean = True Private dctTypes As New Dictionary(Of String, String) Private bReset As Boolean = True - Private clsDefaultFunction As New RFunction + Private clsDeleteRFunction As New RFunction Private Sub dlgDeleteObjects_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstLoad Then @@ -64,20 +64,20 @@ Public Class dlgDeleteObjects End Sub Private Sub SetDefaults() - clsDefaultFunction = New RFunction + clsDeleteRFunction = New RFunction ucrSelectorDeleteObject.Reset() - clsDefaultFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$delete_objects") - clsDefaultFunction.AddParameter("object_type", Chr(34) & "object" & Chr(34), iPosition:=2) + clsDeleteRFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$delete_objects") + clsDeleteRFunction.AddParameter("object_type", Chr(34) & "object" & Chr(34), iPosition:=2) - ucrBase.clsRsyntax.SetBaseRFunction(clsDefaultFunction) + ucrBase.clsRsyntax.SetBaseRFunction(clsDeleteRFunction) End Sub Private Sub SetRCodeforControls(bReset As Boolean) - ucrSelectorDeleteObject.SetRCode(clsDefaultFunction, bReset) - ucrInputComboType.SetRCode(clsDefaultFunction, bReset) - ucrReceiverObjectsToDelete.SetRCode(clsDefaultFunction, bReset) + ucrSelectorDeleteObject.SetRCode(clsDeleteRFunction, bReset) + ucrInputComboType.SetRCode(clsDeleteRFunction, bReset) + ucrReceiverObjectsToDelete.SetRCode(clsDeleteRFunction, bReset) 'SetRCode(Me, ucrBase.clsRsyntax.clsBaseFunction, bReset) End Sub diff --git a/instat/dlgViewObjects.Designer.vb b/instat/dlgViewObjects.Designer.vb index 02f79953bcf..08b8c508d04 100644 --- a/instat/dlgViewObjects.Designer.vb +++ b/instat/dlgViewObjects.Designer.vb @@ -47,22 +47,25 @@ Partial Class dlgViewObjects Me.ucrPnlContentsToView = New instat.UcrPanel() Me.ucrInputObjectType = New instat.ucrInputComboBox() Me.lblObjectType = New System.Windows.Forms.Label() + Me.rdoOutputObjects = New System.Windows.Forms.RadioButton() + Me.rdoDataObjects = New System.Windows.Forms.RadioButton() + Me.ucrPnlOptions = New instat.UcrPanel() Me.SuspendLayout() ' 'lblSelectedObject ' Me.lblSelectedObject.AutoSize = True - Me.lblSelectedObject.Location = New System.Drawing.Point(375, 108) + Me.lblSelectedObject.Location = New System.Drawing.Point(369, 144) Me.lblSelectedObject.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblSelectedObject.Name = "lblSelectedObject" - Me.lblSelectedObject.Size = New System.Drawing.Size(89, 30) + Me.lblSelectedObject.Size = New System.Drawing.Size(59, 20) Me.lblSelectedObject.TabIndex = 1 Me.lblSelectedObject.Text = "Object:" ' 'rdoStructure ' Me.rdoStructure.AutoSize = True - Me.rdoStructure.Location = New System.Drawing.Point(384, 216) + Me.rdoStructure.Location = New System.Drawing.Point(378, 252) Me.rdoStructure.Margin = New System.Windows.Forms.Padding(4) Me.rdoStructure.Name = "rdoStructure" Me.rdoStructure.Size = New System.Drawing.Size(100, 24) @@ -75,7 +78,7 @@ Partial Class dlgViewObjects 'rdoPrint ' Me.rdoPrint.AutoSize = True - Me.rdoPrint.Location = New System.Drawing.Point(384, 183) + Me.rdoPrint.Location = New System.Drawing.Point(378, 219) Me.rdoPrint.Margin = New System.Windows.Forms.Padding(4) Me.rdoPrint.Name = "rdoPrint" Me.rdoPrint.Size = New System.Drawing.Size(66, 24) @@ -88,7 +91,7 @@ Partial Class dlgViewObjects ' Me.ucrReceiverSelectedObject.AutoSize = True Me.ucrReceiverSelectedObject.frmParent = Me - Me.ucrReceiverSelectedObject.Location = New System.Drawing.Point(375, 130) + Me.ucrReceiverSelectedObject.Location = New System.Drawing.Point(369, 166) Me.ucrReceiverSelectedObject.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverSelectedObject.Name = "ucrReceiverSelectedObject" Me.ucrReceiverSelectedObject.Selector = Nothing @@ -103,7 +106,7 @@ Partial Class dlgViewObjects Me.ucrSelectorForViewObject.bDropUnusedFilterLevels = False Me.ucrSelectorForViewObject.bShowHiddenColumns = False Me.ucrSelectorForViewObject.bUseCurrentFilter = True - Me.ucrSelectorForViewObject.Location = New System.Drawing.Point(15, 15) + Me.ucrSelectorForViewObject.Location = New System.Drawing.Point(9, 51) Me.ucrSelectorForViewObject.Margin = New System.Windows.Forms.Padding(0) Me.ucrSelectorForViewObject.Name = "ucrSelectorForViewObject" Me.ucrSelectorForViewObject.Size = New System.Drawing.Size(320, 274) @@ -113,7 +116,7 @@ Partial Class dlgViewObjects ' Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(12, 333) + Me.ucrBase.Location = New System.Drawing.Point(6, 369) Me.ucrBase.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(611, 77) @@ -122,7 +125,7 @@ Partial Class dlgViewObjects 'ucrPnlContentsToView ' Me.ucrPnlContentsToView.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlContentsToView.Location = New System.Drawing.Point(375, 172) + Me.ucrPnlContentsToView.Location = New System.Drawing.Point(369, 208) Me.ucrPnlContentsToView.Margin = New System.Windows.Forms.Padding(9, 12, 9, 12) Me.ucrPnlContentsToView.Name = "ucrPnlContentsToView" Me.ucrPnlContentsToView.Size = New System.Drawing.Size(180, 100) @@ -134,7 +137,7 @@ Partial Class dlgViewObjects Me.ucrInputObjectType.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrInputObjectType.GetSetSelectedIndex = -1 Me.ucrInputObjectType.IsReadOnly = False - Me.ucrInputObjectType.Location = New System.Drawing.Point(375, 70) + Me.ucrInputObjectType.Location = New System.Drawing.Point(369, 106) Me.ucrInputObjectType.Margin = New System.Windows.Forms.Padding(14) Me.ucrInputObjectType.Name = "ucrInputObjectType" Me.ucrInputObjectType.Size = New System.Drawing.Size(206, 32) @@ -143,19 +146,71 @@ Partial Class dlgViewObjects 'lblObjectType ' Me.lblObjectType.AutoSize = True - Me.lblObjectType.Location = New System.Drawing.Point(375, 48) + Me.lblObjectType.Location = New System.Drawing.Point(369, 84) Me.lblObjectType.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblObjectType.Name = "lblObjectType" Me.lblObjectType.Size = New System.Drawing.Size(47, 20) Me.lblObjectType.TabIndex = 10 Me.lblObjectType.Text = "Type:" ' + 'rdoOutputObjects + ' + Me.rdoOutputObjects.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoOutputObjects.BackColor = System.Drawing.SystemColors.Control + Me.rdoOutputObjects.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoOutputObjects.FlatAppearance.BorderSize = 2 + Me.rdoOutputObjects.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoOutputObjects.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoOutputObjects.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoOutputObjects.Location = New System.Drawing.Point(141, 3) + Me.rdoOutputObjects.Margin = New System.Windows.Forms.Padding(4) + Me.rdoOutputObjects.Name = "rdoOutputObjects" + Me.rdoOutputObjects.Size = New System.Drawing.Size(180, 42) + Me.rdoOutputObjects.TabIndex = 15 + Me.rdoOutputObjects.TabStop = True + Me.rdoOutputObjects.Tag = "" + Me.rdoOutputObjects.Text = "Output Objects" + Me.rdoOutputObjects.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoOutputObjects.UseVisualStyleBackColor = False + ' + 'rdoDataObjects + ' + Me.rdoDataObjects.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoDataObjects.BackColor = System.Drawing.SystemColors.Control + Me.rdoDataObjects.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoDataObjects.FlatAppearance.BorderSize = 2 + Me.rdoDataObjects.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoDataObjects.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoDataObjects.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoDataObjects.Location = New System.Drawing.Point(320, 3) + Me.rdoDataObjects.Margin = New System.Windows.Forms.Padding(4) + Me.rdoDataObjects.Name = "rdoDataObjects" + Me.rdoDataObjects.Size = New System.Drawing.Size(180, 42) + Me.rdoDataObjects.TabIndex = 16 + Me.rdoDataObjects.TabStop = True + Me.rdoDataObjects.Tag = "" + Me.rdoDataObjects.Text = "Data Objects" + Me.rdoDataObjects.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoDataObjects.UseVisualStyleBackColor = False + ' + 'ucrPnlOptions + ' + Me.ucrPnlOptions.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlOptions.Location = New System.Drawing.Point(4, -2) + Me.ucrPnlOptions.Margin = New System.Windows.Forms.Padding(9) + Me.ucrPnlOptions.Name = "ucrPnlOptions" + Me.ucrPnlOptions.Size = New System.Drawing.Size(602, 54) + Me.ucrPnlOptions.TabIndex = 14 + ' 'dlgViewObjects ' Me.AutoScaleDimensions = New System.Drawing.SizeF(144.0!, 144.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True - Me.ClientSize = New System.Drawing.Size(624, 416) + Me.ClientSize = New System.Drawing.Size(624, 453) + Me.Controls.Add(Me.rdoOutputObjects) + Me.Controls.Add(Me.rdoDataObjects) + Me.Controls.Add(Me.ucrPnlOptions) Me.Controls.Add(Me.lblObjectType) Me.Controls.Add(Me.ucrInputObjectType) Me.Controls.Add(Me.rdoPrint) @@ -187,4 +242,7 @@ Partial Class dlgViewObjects Friend WithEvents ucrPnlContentsToView As UcrPanel Friend WithEvents lblObjectType As Label Friend WithEvents ucrInputObjectType As ucrInputComboBox + Friend WithEvents rdoOutputObjects As RadioButton + Friend WithEvents rdoDataObjects As RadioButton + Friend WithEvents ucrPnlOptions As UcrPanel End Class diff --git a/instat/dlgViewObjects.vb b/instat/dlgViewObjects.vb index 3cf9bd02936..216af6b2ba4 100644 --- a/instat/dlgViewObjects.vb +++ b/instat/dlgViewObjects.vb @@ -42,11 +42,11 @@ Public Class dlgViewObjects 'todo. temporary to have the str() output captured as text ucrBase.clsRsyntax.iCallType = -1 - 'ucrPnlOptions.AddRadioButton(rdoOutputObjects) - 'ucrPnlOptions.AddRadioButton(rdoDataObjects) - 'rdoDataObjects.Enabled = False - - 'ucrPnlOptions.AddFunctionNamesCondition(rdoOutputObjects, {frmMain.clsRLink.strInstatDataObject & "$get_object_data", "str"}) + ucrPnlOptions.AddRadioButton(rdoOutputObjects) + ucrPnlOptions.AddRadioButton(rdoDataObjects) + 'todo disabled until functionality of viewing data objects is implemented + rdoDataObjects.Enabled = False + ucrPnlOptions.AddFunctionNamesCondition(rdoOutputObjects, {frmMain.clsRLink.strInstatDataObject & "$get_object_data", "str"}) ucrSelectorForViewObject.SetParameter(New RParameter("data_name", 0)) ucrSelectorForViewObject.SetParameterIsString() @@ -100,7 +100,7 @@ Public Class dlgViewObjects ucrSelectorForViewObject.SetRCode(clsPrintRFunction, bReset) ucrReceiverSelectedObject.SetRCode(clsPrintRFunction, bReset) ucrPnlContentsToView.SetRCode(ucrBase.clsRsyntax.clsBaseFunction) - 'ucrPnlOptions.SetRCode(ucrBase.clsRsyntax.clsBaseFunction) + ucrPnlOptions.SetRCode(ucrBase.clsRsyntax.clsBaseFunction) End Sub Private Sub TestOKEnabled() diff --git a/instat/ucrReceiver.vb b/instat/ucrReceiver.vb index 8594abe6044..77ee806b729 100644 --- a/instat/ucrReceiver.vb +++ b/instat/ucrReceiver.vb @@ -486,14 +486,18 @@ Public Class ucrReceiver Next DirectCast(Me, ucrReceiverMultiple).AddMultiple(lstItems) + 'TODO. In PR #8605, this subroutine was found to also be called in the selector control when LoadList is called (CurrentReceiver.RemoveAnyVariablesNotInSelector()). + 'This can lead to slow perfomance in dialogs when it comes to wide datasets RemoveAnyVariablesNotInSelector() 'needed due to the Autofill option Else For Each strTemp As String In lstCurrentVariables 'TODO This only works if the selector is updated before receivers and dialog only uses one data frame! ' Needs to change eventually. + 'TODO. This subroutine call also makes the single receiver automatically clear deleted columns when dialogs are reopened + 'However, it does not clear output objects and other data objects. What causes clearing of such objects is + 'when CurrentReceiver.RemoveAnyVariablesNotInSelector() is called in the LoadList() of selector control Add(strTemp, strTempDataName) Next - End If diff --git a/instat/ucrReceiverSingle.vb b/instat/ucrReceiverSingle.vb index 6ae7be192e6..156dbbd5601 100644 --- a/instat/ucrReceiverSingle.vb +++ b/instat/ucrReceiverSingle.vb @@ -123,6 +123,16 @@ Public Class ucrReceiverSingle MyBase.RemoveSelected() End Sub + ''' + ''' Removes any variable in the single receiver + ''' that is not in the list of variables of the selector + ''' + Public Overrides Sub RemoveAnyVariablesNotInSelector() + If Not IsEmpty() AndAlso Selector?.lstAvailableVariable.FindItemWithText(txtReceiverSingle.Text) Is Nothing Then + Clear() + End If + End Sub + Public Overrides Sub Clear() RemoveSelected() End Sub diff --git a/instat/ucrSelector.vb b/instat/ucrSelector.vb index 19c21d3620b..879349ac503 100644 --- a/instat/ucrSelector.vb +++ b/instat/ucrSelector.vb @@ -149,6 +149,8 @@ Public Class ucrSelector strHeading:=CurrentReceiver.strSelectorHeading, strDataFrameName:=strCurrentDataFrame, strExcludedItems:=arrStrExclud, strDatabaseQuery:=CurrentReceiver.strDatabaseQuery, strNcFilePath:=CurrentReceiver.strNcFilePath) If Not CurrentReceiver.bExcludeFromSelector Then + 'TODO. Investigate why this has to be called here instead of just being called in ucrReceiver control.SetControlValue() + 'See PR #8605 for related comments added in ucrReceiver. CurrentReceiver.RemoveAnyVariablesNotInSelector() 'this needed for the multiple receiver(s) where the autofill is not applied End If EnableDataOptions(strCurrentType) From bb0c0b2a55cfab414c003c50f08187ebb9f03f02 Mon Sep 17 00:00:00 2001 From: Stephen Lloyd Date: Tue, 31 Oct 2023 18:05:05 +0100 Subject: [PATCH 34/44] replaced duplicate code with common functions --- instat/clsRLink.vb | 43 +++++++++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/instat/clsRLink.vb b/instat/clsRLink.vb index cb27acd42dd..c0974c90af9 100644 --- a/instat/clsRLink.vb +++ b/instat/clsRLink.vb @@ -736,9 +736,7 @@ Public Class RLink 'if not an assignment operation, then capture the output Dim strRStatementNoFormatting As String = clsRStatement.GetAsExecutableScript(bIncludeFormatting:=False) - If strRStatementNoFormatting.StartsWith(strInstatDataObject & "$get_object_data") _ - OrElse strRStatementNoFormatting.StartsWith(strInstatDataObject & "$get_last_object_data") _ - OrElse strRStatementNoFormatting.StartsWith("view_object_data") Then + If IsStatementViewObject(strRStatementNoFormatting) Then strOutput = GetFileOutput(strRStatementNoFormatting, bSilent:=False, bSeparateThread:=False, bShowWaitDialogOverride:=Nothing) ElseIf clsRStatement.clsAssignment Is Nothing _ @@ -839,16 +837,14 @@ Public Class RLink Dim bAsFile As Boolean = True Dim bDisplayOutputInExternalViewer As Boolean = False - If strRStatement.StartsWith(strInstatDataObject & "$get_object_data") _ - OrElse strRStatement.StartsWith(strInstatDataObject & "$get_last_object_data") _ - OrElse strRStatement.StartsWith("view_object_data") Then + If IsStatementViewObject(strRStatement) Then strOutput = GetFileOutput(strRStatement, False, False, Nothing) 'if statement generates a view_object then display in external viewer (maximised) bDisplayOutputInExternalViewer = strRStatement.Contains("view_object_data") - ElseIf strRStatement.StartsWith("print") Then + ElseIf IsStatementPrint(strRStatement) Then bAsFile = False Evaluate(strRStatement, bSilent:=False, bSeparateThread:=False, bShowWaitDialogOverride:=Nothing) - ElseIf Not strRStatement.Contains("<-") Then 'if not an assignment operation, then capture the output + ElseIf Not IsStatementAssignment(strRStatement) Then 'if not an assignment operation, then capture the output Dim strRStatementAsSingleLine As String = strRStatement.Replace(vbCr, String.Empty) strRStatementAsSingleLine = strRStatementAsSingleLine.Replace(vbLf, String.Empty) 'wrap final command inside view_object_data just in case there is an output object @@ -955,14 +951,11 @@ Public Class RLink If arrExecutableRScriptLines.Length > 0 Then 'get the last R script command. todo, this should eventually use the RScript library functions to identify the last R script command Dim strLastScript As String = arrExecutableRScriptLines.Last() - If strLastScript.StartsWith(strInstatDataObject & "$get_object_data") _ - OrElse strLastScript.StartsWith(strInstatDataObject & "$get_last_object_data") _ - OrElse strLastScript.StartsWith("view_object_data") Then + If IsStatementViewObject(strLastScript) Then strOutput = GetFileOutput(strScript, bSilent, bSeparateThread, bShowWaitDialogOverride) 'if last function is view_object then display in external viewer (maximised) bDisplayOutputInExternalViewer = strLastScript.Contains("view_object_data") - - ElseIf strLastScript.StartsWith("print") Then + ElseIf IsStatementPrint(strLastScript) Then bAsFile = False Evaluate(strScript, bSilent:=bSilent, bSeparateThread:=bSeparateThread, bShowWaitDialogOverride:=bShowWaitDialogOverride) ElseIf iCallType = 0 Then @@ -986,7 +979,7 @@ Public Class RLink 'else if script output should not be ignored or not stored as an object or variable 'if output should be stored as a variable just execute the script - If arrExecutableRScriptLines.Last().Contains("<-") Then + If IsStatementAssignment(arrExecutableRScriptLines.Last()) Then Evaluate(strScript, bSilent:=bSilent, bSeparateThread:=bSeparateThread, bShowWaitDialogOverride:=bShowWaitDialogOverride) Else 'else capture the output as plain text @@ -2298,4 +2291,26 @@ Public Class RLink Return lstRParameters End Function + + Private Function IsStatementAssignment(strRStatement As String) As Boolean + Return strRStatement.Contains("<-") + End Function + + Private Function IsStatementPrint(strRStatement As String) As Boolean + Dim strRStatementTrimmed As String = TrimStartRStatement(strRStatement) + Return strRStatementTrimmed.StartsWith("print") + End Function + + Private Function IsStatementViewObject(strRStatement As String) As Boolean + Dim strRStatementTrimmed As String = TrimStartRStatement(strRStatement) + Return strRStatementTrimmed.StartsWith(strInstatDataObject & "$get_object_data") _ + OrElse strRStatementTrimmed.StartsWith(strInstatDataObject & "$get_last_object_data") _ + OrElse strRStatementTrimmed.StartsWith("view_object_data") + End Function + + Private Function TrimStartRStatement(strRStatement As String) As String + Dim arrTrimChars As Char() = {" "c, vbTab, vbLf, vbCr} + Return strRStatement.TrimStart(arrTrimChars) + End Function + End Class \ No newline at end of file From e1960789bf61b1627cf94cf834c52d547b739872 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Wed, 1 Nov 2023 11:46:32 +0300 Subject: [PATCH 35/44] new changes --- .../DataGrid/ReoGrid/ucrDataViewReoGrid.vb | 63 ++++++++++++++----- 1 file changed, 46 insertions(+), 17 deletions(-) diff --git a/instat/UserControls/DataGrid/ReoGrid/ucrDataViewReoGrid.vb b/instat/UserControls/DataGrid/ReoGrid/ucrDataViewReoGrid.vb index 648c7193873..4110cd78891 100644 --- a/instat/UserControls/DataGrid/ReoGrid/ucrDataViewReoGrid.vb +++ b/instat/UserControls/DataGrid/ReoGrid/ucrDataViewReoGrid.vb @@ -14,6 +14,7 @@ ' You should have received a copy of the GNU General Public License ' along with this program. If not, see . +Imports System.Text.RegularExpressions Imports unvell.ReoGrid Imports unvell.ReoGrid.Events @@ -76,10 +77,8 @@ Public Class ucrDataViewReoGrid For i = 0 To grdData.CurrentWorksheet.Rows - 1 For j = 0 To grdData.CurrentWorksheet.Columns - 1 Dim strData As String = dataFrame.DisplayedData(i, j) - If grdData.CurrentWorksheet.ColumnHeaders.Item(j).Text.Contains("(LT)") AndAlso - strData IsNot Nothing Then - strData = GetInnerBracketedString(strData) - strData = If(strData.Contains(":"), strData.Replace(":", ", "), strData) + If strData IsNot Nothing AndAlso grdData.CurrentWorksheet.ColumnHeaders.Item(j).Text.Contains("(LT)") Then + strData = GetTransformedLTColumnContents(strData) End If grdData.CurrentWorksheet(row:=i, col:=j) = strData Next @@ -104,6 +103,49 @@ Public Class ucrDataViewReoGrid grdData.CurrentWorksheet.RowHeaderWidth = TextRenderer.MeasureText(strLongestRowHeaderText, Me.Font).Width End Sub + ''' + ''' Transforms contents of LT column(s) that have structured R-like data into a more readable and user-friendly format that is consistent with R Viewer. + ''' For example, content like list(Birmingham = list(IATA = c("BHM", NA, NA, NA), Hartford = list(IATA = "BDL", ICAO = "KBDL")) will be transformed to BHM, NA, NA, NA,BDL,KBDL + ''' + ''' Data from column type LT + ''' Transformed data + Private Function GetTransformedLTColumnContents(strLstData As String) As String + ' Check if strLstData is "numeric(0)", + If strLstData = "numeric(0)" Then + '"numeric(0)" represents an empty data set in R so just return an empty output + Return String.Empty + End If + + ' Check if strLstData contains "list(" or "c(". These are patterns found in R list and vector data structures. + If Not strLstData.Contains("list(") AndAlso Not strLstData.Contains("c(") Then + Return strLstData + End If + + ' Regular expression pattern to match values inside c(...) or "..." + Dim pattern As String = "c\(([^)]+)\)|""([^""]+)""" + Dim matches As MatchCollection = Regex.Matches(strLstData, pattern) + Dim lstExtractedContents As New List(Of String) + + ' Iterate through matches + For Each match As Match In matches + ' If it's a c(...) match, extracts the content inside the parentheses. Split the extracted content by commas, trimm extra spaces and double quotes then added to a list of extracted contents. + ' if it's a string "..." match, directly add the content (minus the double quotes) to the list of extracted contents. + + Dim strInnerListContent As String = If(match.Value.Contains("c("), match.Groups(1).Value, match.Value) + Dim arrInnerListContentTrimmed As String() = strInnerListContent.Split(","c).Select(Function(item) item.Trim().Trim(""""c)).ToArray() + lstExtractedContents.AddRange(arrInnerListContentTrimmed) + Next + + ' Join the extracted contents + Dim strExtractedContents As String = String.Join(", ", lstExtractedContents) + + ' Replace ":" with ", " because, in R data structure format, colons are often used to separate key-value pairs. + ' Replacing colons with commas and spaces make the data more user-friendly. + strExtractedContents = strExtractedContents.Replace(":", ", ") + + Return strExtractedContents + End Function + Public Sub AdjustColumnWidthAfterWrapping(strColumn As String, Optional bApplyWrap As Boolean = False) Implements IDataViewGrid.AdjustColumnWidthAfterWrapping Dim iColumnIndex As Integer = GetColumnIndex(strColName:=strColumn) If iColumnIndex < 0 OrElse grdData.CurrentWorksheet.ColumnHeaders(iColumnIndex).Text.Contains("(G)") Then @@ -126,19 +168,6 @@ Public Class ucrDataViewReoGrid grdData.CurrentWorksheet(iRow, iColumn) = GetCurrentDataFrameFocus.DisplayedData(iRow, iColumn) End Sub - Private Function GetInnerBracketedString(strData As String) As String - Dim intFirstRightBracket As Integer = InStr(strData, ")") - Dim intLastLeftBracket As Integer = InStrRev(strData, "(") - If intFirstRightBracket = 0 Or intLastLeftBracket = 0 Then - Return strData - ElseIf strData = "numeric(0)" Then - Return String.Empty - Else - Dim strOutput As String = Mid(strData, intLastLeftBracket + 1, intFirstRightBracket - intLastLeftBracket - 1) - Return strOutput - End If - End Function - Public Function GetSelectedColumns() As List(Of clsColumnHeaderDisplay) Implements IDataViewGrid.GetSelectedColumns Dim lstColumns As New List(Of clsColumnHeaderDisplay) For i As Integer = grdData.CurrentWorksheet.SelectionRange.Col To grdData.CurrentWorksheet.SelectionRange.Col + grdData.CurrentWorksheet.SelectionRange.Cols - 1 From 129ed68bd29c47a11938a0a398a318db1904f142 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Wed, 1 Nov 2023 11:49:39 +0300 Subject: [PATCH 36/44] editted comment --- instat/UserControls/DataGrid/ReoGrid/ucrDataViewReoGrid.vb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/instat/UserControls/DataGrid/ReoGrid/ucrDataViewReoGrid.vb b/instat/UserControls/DataGrid/ReoGrid/ucrDataViewReoGrid.vb index 4110cd78891..cc7bfc838c0 100644 --- a/instat/UserControls/DataGrid/ReoGrid/ucrDataViewReoGrid.vb +++ b/instat/UserControls/DataGrid/ReoGrid/ucrDataViewReoGrid.vb @@ -105,7 +105,8 @@ Public Class ucrDataViewReoGrid ''' ''' Transforms contents of LT column(s) that have structured R-like data into a more readable and user-friendly format that is consistent with R Viewer. - ''' For example, content like list(Birmingham = list(IATA = c("BHM", NA, NA, NA), Hartford = list(IATA = "BDL", ICAO = "KBDL")) will be transformed to BHM, NA, NA, NA,BDL,KBDL + ''' For example, content like list(Birmingham = list(IATA = c("BHM", NA, NA, NA), Hartford = list(IATA = "BDL", ICAO = "KBDL")) + ''' will be transformed to BHM, NA, NA, NA,BDL,KBDL ''' ''' Data from column type LT ''' Transformed data From 3d54cabbfd80d24f7ad1a95cd15ff7f1f10dedf8 Mon Sep 17 00:00:00 2001 From: n-thony Date: Wed, 1 Nov 2023 12:23:53 +0300 Subject: [PATCH 37/44] minor code change --- instat/static/InstatObject/R/data_object_R6.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index c7d05dec6f3..2d941bef383 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -463,8 +463,8 @@ DataSheet$set("public", "get_variables_metadata", function(data_type = "all", co if(self$column_selection_applied()) cols <- self$current_column_selection curr_data <- private$data[column] } - for(c in cols) { - col <- curr_data[[c]] + for (i in seq_along(cols)) { + col <- curr_data[[cols[i]]] ind <- which(names(attributes(col)) == "levels") if(length(ind) > 0) col_attributes <- attributes(col)[-ind] else col_attributes <- attributes(col) @@ -487,7 +487,7 @@ DataSheet$set("public", "get_variables_metadata", function(data_type = "all", co # col_attributes <- data.frame(class = NA) #} col_attributes <- data.frame(col_attributes, stringsAsFactors = FALSE) - out[[c]] <- col_attributes + out[[i]] <- col_attributes } #RLink crashes with bind_rows for some data frames with ~50+ columns #rbind.fill safer alternative currently From 970d7f2fd6f7a4cdb21e28ce085bc14685c79fa0 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Wed, 1 Nov 2023 13:39:11 +0300 Subject: [PATCH 38/44] made changes to reorder dialog to explicitly differentiate object types --- instat/dlgReorderObjects.Designer.vb | 70 +++++++++++++++++++++++++--- instat/dlgReorderObjects.vb | 7 +++ 2 files changed, 71 insertions(+), 6 deletions(-) diff --git a/instat/dlgReorderObjects.Designer.vb b/instat/dlgReorderObjects.Designer.vb index fd83943c9cb..9d1b1eee4e0 100644 --- a/instat/dlgReorderObjects.Designer.vb +++ b/instat/dlgReorderObjects.Designer.vb @@ -42,21 +42,25 @@ Partial Class dlgReorderObjects Me.lblObjectsToReoder = New System.Windows.Forms.Label() Me.ucrDataFrameReorder = New instat.ucrDataFrame() Me.ucrReorderObjects = New instat.ucrReorder() + Me.rdoOutputObjects = New System.Windows.Forms.RadioButton() + Me.rdoDataObjects = New System.Windows.Forms.RadioButton() + Me.ucrPnlOptions = New instat.UcrPanel() Me.SuspendLayout() ' 'ucrBase ' Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(10, 229) + Me.ucrBase.Location = New System.Drawing.Point(6, 270) + Me.ucrBase.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.ucrBase.Name = "ucrBase" - Me.ucrBase.Size = New System.Drawing.Size(405, 52) + Me.ucrBase.Size = New System.Drawing.Size(408, 52) Me.ucrBase.TabIndex = 3 ' 'lblObjectsToReoder ' Me.lblObjectsToReoder.AutoSize = True - Me.lblObjectsToReoder.Location = New System.Drawing.Point(182, 28) + Me.lblObjectsToReoder.Location = New System.Drawing.Point(178, 67) Me.lblObjectsToReoder.Name = "lblObjectsToReoder" Me.lblObjectsToReoder.Size = New System.Drawing.Size(99, 13) Me.lblObjectsToReoder.TabIndex = 1 @@ -68,7 +72,7 @@ Partial Class dlgReorderObjects Me.ucrDataFrameReorder.AutoSize = True Me.ucrDataFrameReorder.bDropUnusedFilterLevels = False Me.ucrDataFrameReorder.bUseCurrentFilter = True - Me.ucrDataFrameReorder.Location = New System.Drawing.Point(10, 10) + Me.ucrDataFrameReorder.Location = New System.Drawing.Point(6, 49) Me.ucrDataFrameReorder.Margin = New System.Windows.Forms.Padding(0) Me.ucrDataFrameReorder.Name = "ucrDataFrameReorder" Me.ucrDataFrameReorder.Size = New System.Drawing.Size(153, 43) @@ -76,19 +80,70 @@ Partial Class dlgReorderObjects ' 'ucrReorderObjects ' - Me.ucrReorderObjects.Location = New System.Drawing.Point(182, 45) + Me.ucrReorderObjects.Location = New System.Drawing.Point(178, 85) + Me.ucrReorderObjects.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) Me.ucrReorderObjects.Name = "ucrReorderObjects" Me.ucrReorderObjects.Size = New System.Drawing.Size(209, 178) Me.ucrReorderObjects.TabIndex = 2 Me.ucrReorderObjects.ucrDataFrameList = Nothing Me.ucrReorderObjects.ucrReceiver = Nothing ' + 'rdoOutputObjects + ' + Me.rdoOutputObjects.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoOutputObjects.BackColor = System.Drawing.SystemColors.Control + Me.rdoOutputObjects.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoOutputObjects.FlatAppearance.BorderSize = 2 + Me.rdoOutputObjects.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoOutputObjects.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoOutputObjects.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoOutputObjects.Location = New System.Drawing.Point(93, 7) + Me.rdoOutputObjects.Name = "rdoOutputObjects" + Me.rdoOutputObjects.Size = New System.Drawing.Size(120, 28) + Me.rdoOutputObjects.TabIndex = 18 + Me.rdoOutputObjects.TabStop = True + Me.rdoOutputObjects.Tag = "" + Me.rdoOutputObjects.Text = "Output Objects" + Me.rdoOutputObjects.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoOutputObjects.UseVisualStyleBackColor = False + ' + 'rdoDataObjects + ' + Me.rdoDataObjects.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoDataObjects.BackColor = System.Drawing.SystemColors.Control + Me.rdoDataObjects.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoDataObjects.FlatAppearance.BorderSize = 2 + Me.rdoDataObjects.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoDataObjects.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoDataObjects.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoDataObjects.Location = New System.Drawing.Point(213, 7) + Me.rdoDataObjects.Name = "rdoDataObjects" + Me.rdoDataObjects.Size = New System.Drawing.Size(120, 28) + Me.rdoDataObjects.TabIndex = 19 + Me.rdoDataObjects.TabStop = True + Me.rdoDataObjects.Tag = "" + Me.rdoDataObjects.Text = "Data Objects" + Me.rdoDataObjects.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoDataObjects.UseVisualStyleBackColor = False + ' + 'ucrPnlOptions + ' + Me.ucrPnlOptions.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlOptions.Location = New System.Drawing.Point(2, 5) + Me.ucrPnlOptions.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) + Me.ucrPnlOptions.Name = "ucrPnlOptions" + Me.ucrPnlOptions.Size = New System.Drawing.Size(401, 36) + Me.ucrPnlOptions.TabIndex = 17 + ' 'dlgReorderObjects ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True - Me.ClientSize = New System.Drawing.Size(418, 287) + Me.ClientSize = New System.Drawing.Size(418, 325) + Me.Controls.Add(Me.rdoOutputObjects) + Me.Controls.Add(Me.rdoDataObjects) + Me.Controls.Add(Me.ucrPnlOptions) Me.Controls.Add(Me.lblObjectsToReoder) Me.Controls.Add(Me.ucrDataFrameReorder) Me.Controls.Add(Me.ucrBase) @@ -109,4 +164,7 @@ Partial Class dlgReorderObjects Friend WithEvents lblObjectsToReoder As Label Friend WithEvents ucrDataFrameReorder As ucrDataFrame Friend WithEvents ucrReorderObjects As ucrReorder + Friend WithEvents rdoOutputObjects As RadioButton + Friend WithEvents rdoDataObjects As RadioButton + Friend WithEvents ucrPnlOptions As UcrPanel End Class diff --git a/instat/dlgReorderObjects.vb b/instat/dlgReorderObjects.vb index 7bb9fa018bd..cb14c909bec 100644 --- a/instat/dlgReorderObjects.vb +++ b/instat/dlgReorderObjects.vb @@ -38,6 +38,13 @@ Public Class dlgReorderObjects Private Sub InitialiseDialog() ucrBase.iHelpTopicID = 351 + ucrPnlOptions.AddRadioButton(rdoOutputObjects) + ucrPnlOptions.AddRadioButton(rdoDataObjects) + 'todo disabled until functionality of viewing data objects is implemented + rdoDataObjects.Enabled = False + ucrPnlOptions.AddFunctionNamesCondition(rdoOutputObjects, frmMain.clsRLink.strInstatDataObject & "$reorder_objects") + + ' ucrSelector DataFrame ucrDataFrameReorder.SetParameter(New RParameter("data_name", 0)) ucrDataFrameReorder.SetParameterIsString() From cd6bbe3253b80281a8b502e1c53ec67242a5038e Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Wed, 1 Nov 2023 12:09:28 +0100 Subject: [PATCH 39/44] minor change --- instat/dlgScatterPlot.vb | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/instat/dlgScatterPlot.vb b/instat/dlgScatterPlot.vb index b74fea3f11b..24238bce012 100644 --- a/instat/dlgScatterPlot.vb +++ b/instat/dlgScatterPlot.vb @@ -381,19 +381,6 @@ Public Class dlgScatterPlot toolStripMenuItemRugOptions.Enabled = ucrChkAddRugPlot.Checked End Sub - 'Private Sub ucrChkJitter_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkJitter.ControlValueChanged - ' If ucrChkJitter.Checked Then - ' clsGeomJitterFunction.AddParameter("width", ucrNudWidth.GetText, iPosition:=0) - ' clsGeomJitterFunction.AddParameter("height", ucrNudHeigth.GetText, iPosition:=1) - ' clsBaseOperator.AddParameter(strGeomJitterParameterName, clsRFunctionParameter:=clsGeomJitterFunction, iPosition:=2) - ' clsBaseOperator.RemoveParameterByName(strFirstParameterName) - ' Else - ' clsBaseOperator.AddParameter(strFirstParameterName, clsRFunctionParameter:=clsRScatterGeomFunction, iPosition:=2) - ' clsBaseOperator.RemoveParameterByName(strGeomJitterParameterName) - ' End If - ' toolStripMenuItemJitterOptions.Enabled = ucrChkJitter.Checked - 'End Sub - Private Sub cmdOptions_Click(sender As Object, e As EventArgs) Handles cmdOptions.Click, toolStripMenuItemPlotOptions.Click sdgPlots.SetRCode(clsNewOperator:=ucrBase.clsRsyntax.clsBaseOperator, clsNewGlobalAesFunction:=clsRaesFunction, clsNewYScalecontinuousFunction:=clsYScalecontinuousFunction, clsNewXScalecontinuousFunction:=clsXScalecontinuousFunction, From 045834eb4e9e63b5362eafd6f2ecfdbcb6dfe9dd Mon Sep 17 00:00:00 2001 From: patowhiz Date: Wed, 1 Nov 2023 13:49:25 +0200 Subject: [PATCH 40/44] Update instat/static/InstatObject/R/data_object_R6.R --- instat/static/InstatObject/R/data_object_R6.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index ea602730142..b116a702af3 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -2157,7 +2157,8 @@ DataSheet$set("public", "get_object", function(object_name) { ) DataSheet$set("public", "rename_object", function(object_name, new_name, object_type = "object") { - if(!object_type %in% c("object", "filter", "calculation", "graph", "table","model","structure","Summary", "column_selection")) stop(object_type, " must be either object (graph, table or model), filter, column_selection or a calculation.") + if(!object_type %in% c("object", "filter", "calculation", "graph", "table","model","structure","summary", "column_selection")) stop(object_type, " must be either object (graph, table or model), filter, column_selection or a calculation.") + #Temp fix:: added graph, table and model so as to distinguish this when implementing it in the dialog. Otherwise they remain as objects if (object_type %in% c("object", "graph", "table","model","structure","Summary")){ if(!object_name %in% names(private$objects)) stop(object_name, " not found in objects list") From 5ec79a9386d5bf52d44bca48aff768ecad5bf80a Mon Sep 17 00:00:00 2001 From: patowhiz Date: Wed, 1 Nov 2023 13:49:37 +0200 Subject: [PATCH 41/44] Update instat/static/InstatObject/R/data_object_R6.R --- instat/static/InstatObject/R/data_object_R6.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index b116a702af3..780b28cb91b 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -2160,7 +2160,8 @@ DataSheet$set("public", "rename_object", function(object_name, new_name, object_ if(!object_type %in% c("object", "filter", "calculation", "graph", "table","model","structure","summary", "column_selection")) stop(object_type, " must be either object (graph, table or model), filter, column_selection or a calculation.") #Temp fix:: added graph, table and model so as to distinguish this when implementing it in the dialog. Otherwise they remain as objects - if (object_type %in% c("object", "graph", "table","model","structure","Summary")){ + if (object_type %in% c("object", "graph", "table","model","structure","summary")){ + if(!object_name %in% names(private$objects)) stop(object_name, " not found in objects list") if(new_name %in% names(private$objects)) stop(new_name, " is already an object name. Cannot rename ", object_name, " to ", new_name) names(private$objects)[names(private$objects) == object_name] <- new_name From 61fabb51b56edfbbe8523d92d5274b2f4f3ec435 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Wed, 1 Nov 2023 13:49:45 +0200 Subject: [PATCH 42/44] Update instat/static/InstatObject/R/data_object_R6.R --- instat/static/InstatObject/R/data_object_R6.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index 780b28cb91b..50aa7b574c4 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -2189,7 +2189,8 @@ DataSheet$set("public", "rename_object", function(object_name, new_name, object_ ) DataSheet$set("public", "delete_objects", function(data_name, object_names, object_type = "object") { - if(!object_type %in% c("object", "graph", "table","model","structure","Summary","filter", "calculation", "column_selection")) stop(object_type, " must be either object (graph, table or model), filter, column selection or a calculation.") + if(!object_type %in% c("object", "graph", "table","model","structure","summary","filter", "calculation", "column_selection")) stop(object_type, " must be either object (graph, table or model), filter, column selection or a calculation.") + if(any(object_type %in% c("object", "graph", "table","model","structure","Summary"))){ if(!all(object_names %in% names(private$objects))) stop("Not all object_names found in overall objects list.") private$objects[names(private$objects) %in% object_names] <- NULL From 77a2af717ac2bcf83844fa3d4d64be2bdecd0297 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Wed, 1 Nov 2023 13:49:59 +0200 Subject: [PATCH 43/44] Update instat/static/InstatObject/R/data_object_R6.R --- instat/static/InstatObject/R/data_object_R6.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index 50aa7b574c4..7e86ad9f91e 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -2191,7 +2191,8 @@ DataSheet$set("public", "rename_object", function(object_name, new_name, object_ DataSheet$set("public", "delete_objects", function(data_name, object_names, object_type = "object") { if(!object_type %in% c("object", "graph", "table","model","structure","summary","filter", "calculation", "column_selection")) stop(object_type, " must be either object (graph, table or model), filter, column selection or a calculation.") - if(any(object_type %in% c("object", "graph", "table","model","structure","Summary"))){ + if(any(object_type %in% c("object", "graph", "table","model","structure","summary"))){ + if(!all(object_names %in% names(private$objects))) stop("Not all object_names found in overall objects list.") private$objects[names(private$objects) %in% object_names] <- NULL }else if(object_type == "filter"){ From 1fa3ace5994595d9a106bed6cd22f52ebbd07b51 Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Thu, 2 Nov 2023 08:59:54 +0100 Subject: [PATCH 44/44] added some Geoms on General Graphics Dialog --- instat/ucrAdditionalLayers.Designer.vb | 170 ++++++++++++++----------- instat/ucrAdditionalLayers.vb | 24 ++-- 2 files changed, 107 insertions(+), 87 deletions(-) diff --git a/instat/ucrAdditionalLayers.Designer.vb b/instat/ucrAdditionalLayers.Designer.vb index 88b5190cd5e..5588aabaaf2 100644 --- a/instat/ucrAdditionalLayers.Designer.vb +++ b/instat/ucrAdditionalLayers.Designer.vb @@ -50,12 +50,8 @@ Partial Class ucrAdditionalLayers Me.toolStripMenuItemGeomCol = New System.Windows.Forms.ToolStripMenuItem() Me.toolStripMenuItemGeomCount = New System.Windows.Forms.ToolStripMenuItem() Me.toolStripMenuItemGeomDensity = New System.Windows.Forms.ToolStripMenuItem() - Me.toolStripMenuItemGeomJitter = New System.Windows.Forms.ToolStripMenuItem() - Me.toolStripMenuItemGeomPath = New System.Windows.Forms.ToolStripMenuItem() - Me.toolStripMenuItemGeomEncircle = New System.Windows.Forms.ToolStripMenuItem() - Me.toolStripMenuItemGeomDumbbell = New System.Windows.Forms.ToolStripMenuItem() - Me.cmdEdit = New System.Windows.Forms.Button() Me.toolStripMenuItemGeomDensityRidges = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItemGeomJitter = New System.Windows.Forms.ToolStripMenuItem() Me.toolStripMenuItemGeomLabel = New System.Windows.Forms.ToolStripMenuItem() Me.toolStripMenuItemGeomLabelRepel = New System.Windows.Forms.ToolStripMenuItem() Me.toolStripMenuItemGeomLine = New System.Windows.Forms.ToolStripMenuItem() @@ -63,6 +59,13 @@ Partial Class ucrAdditionalLayers Me.toolStripMenuItemGeomRugSmooth = New System.Windows.Forms.ToolStripMenuItem() Me.toolStripMenuItemGeomText = New System.Windows.Forms.ToolStripMenuItem() Me.toolStripMenuItemGeomTextRepel = New System.Windows.Forms.ToolStripMenuItem() + Me.cmdEdit = New System.Windows.Forms.Button() + Me.toolStripMenuItemGeomtile = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItemGeomparallelslopes = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItemGeomcategoricalmodel = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItemGeomhistogram = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItemGeomcontour = New System.Windows.Forms.ToolStripMenuItem() + Me.GeomsmoothToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.grpGeoms.SuspendLayout() Me.contextMenuStripAdd.SuspendLayout() Me.SuspendLayout() @@ -70,10 +73,9 @@ Partial Class ucrAdditionalLayers 'lblLayers ' Me.lblLayers.AutoSize = True - Me.lblLayers.Location = New System.Drawing.Point(6, 20) - Me.lblLayers.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblLayers.Location = New System.Drawing.Point(4, 13) Me.lblLayers.Name = "lblLayers" - Me.lblLayers.Size = New System.Drawing.Size(60, 20) + Me.lblLayers.Size = New System.Drawing.Size(41, 13) Me.lblLayers.TabIndex = 5 Me.lblLayers.Text = "Layers:" ' @@ -81,10 +83,9 @@ Partial Class ucrAdditionalLayers ' Me.lstLayers.FullRowSelect = True Me.lstLayers.HideSelection = False - Me.lstLayers.Location = New System.Drawing.Point(4, 42) - Me.lstLayers.Margin = New System.Windows.Forms.Padding(4) + Me.lstLayers.Location = New System.Drawing.Point(3, 28) Me.lstLayers.Name = "lstLayers" - Me.lstLayers.Size = New System.Drawing.Size(186, 222) + Me.lstLayers.Size = New System.Drawing.Size(125, 149) Me.lstLayers.TabIndex = 4 Me.lstLayers.UseCompatibleStateImageBehavior = False Me.lstLayers.View = System.Windows.Forms.View.List @@ -94,21 +95,18 @@ Partial Class ucrAdditionalLayers Me.grpGeoms.Controls.Add(Me.cmdDelete) Me.grpGeoms.Controls.Add(Me.cmdAdd) Me.grpGeoms.Controls.Add(Me.cmdEdit) - Me.grpGeoms.Location = New System.Drawing.Point(201, 80) - Me.grpGeoms.Margin = New System.Windows.Forms.Padding(4) + Me.grpGeoms.Location = New System.Drawing.Point(134, 53) Me.grpGeoms.Name = "grpGeoms" - Me.grpGeoms.Padding = New System.Windows.Forms.Padding(4) - Me.grpGeoms.Size = New System.Drawing.Size(159, 150) + Me.grpGeoms.Size = New System.Drawing.Size(106, 100) Me.grpGeoms.TabIndex = 9 Me.grpGeoms.TabStop = False Me.grpGeoms.Text = "Geoms:" ' 'cmdDelete ' - Me.cmdDelete.Location = New System.Drawing.Point(24, 108) - Me.cmdDelete.Margin = New System.Windows.Forms.Padding(4) + Me.cmdDelete.Location = New System.Drawing.Point(16, 72) Me.cmdDelete.Name = "cmdDelete" - Me.cmdDelete.Size = New System.Drawing.Size(112, 34) + Me.cmdDelete.Size = New System.Drawing.Size(75, 23) Me.cmdDelete.TabIndex = 9 Me.cmdDelete.Text = "Delete" Me.cmdDelete.UseVisualStyleBackColor = True @@ -117,10 +115,9 @@ Partial Class ucrAdditionalLayers ' Me.cmdAdd.AutoSize = True Me.cmdAdd.ContextMenuStrip = Me.contextMenuStripAdd - Me.cmdAdd.Location = New System.Drawing.Point(24, 22) - Me.cmdAdd.Margin = New System.Windows.Forms.Padding(4) + Me.cmdAdd.Location = New System.Drawing.Point(16, 15) Me.cmdAdd.Name = "cmdAdd" - Me.cmdAdd.Size = New System.Drawing.Size(112, 34) + Me.cmdAdd.Size = New System.Drawing.Size(75, 23) Me.cmdAdd.SplitMenuStrip = Me.contextMenuStripAdd Me.cmdAdd.TabIndex = 11 Me.cmdAdd.Tag = "Add" @@ -130,133 +127,149 @@ Partial Class ucrAdditionalLayers 'contextMenuStripAdd ' Me.contextMenuStripAdd.ImageScalingSize = New System.Drawing.Size(24, 24) - Me.contextMenuStripAdd.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.toolStripMenuItemGeomBoxPlot, Me.toolStripMenuItemGeomBar, Me.toolStripMenuItemGeomCol, Me.toolStripMenuItemGeomCount, Me.toolStripMenuItemGeomDensity, Me.toolStripMenuItemGeomDensityRidges, Me.toolStripMenuItemGeomJitter, Me.toolStripMenuItemGeomPath, Me.toolStripMenuItemGeomEncircle, Me.toolStripMenuItemGeomDumbbell, Me.toolStripMenuItemGeomLabel, Me.toolStripMenuItemGeomLabelRepel, Me.toolStripMenuItemGeomLine, Me.toolStripMenuItemGeomPoint, Me.toolStripMenuItemGeomRugSmooth, Me.toolStripMenuItemGeomText, Me.toolStripMenuItemGeomTextRepel}) + Me.contextMenuStripAdd.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.toolStripMenuItemGeomBar, Me.toolStripMenuItemGeomBoxPlot, Me.toolStripMenuItemGeomcategoricalmodel, Me.toolStripMenuItemGeomCol, Me.toolStripMenuItemGeomcontour, Me.toolStripMenuItemGeomCount, Me.toolStripMenuItemGeomDensity, Me.toolStripMenuItemGeomDensityRidges, Me.toolStripMenuItemGeomhistogram, Me.toolStripMenuItemGeomJitter, Me.toolStripMenuItemGeomLabel, Me.toolStripMenuItemGeomLabelRepel, Me.toolStripMenuItemGeomLine, Me.toolStripMenuItemGeomparallelslopes, Me.toolStripMenuItemGeomPoint, Me.toolStripMenuItemGeomRugSmooth, Me.GeomsmoothToolStripMenuItem, Me.toolStripMenuItemGeomText, Me.toolStripMenuItemGeomTextRepel, Me.toolStripMenuItemGeomtile}) Me.contextMenuStripAdd.Name = "contextMenuStripOk" - Me.contextMenuStripAdd.Size = New System.Drawing.Size(252, 581) + Me.contextMenuStripAdd.Size = New System.Drawing.Size(208, 466) ' 'toolStripMenuItemGeomBoxPlot ' Me.toolStripMenuItemGeomBoxPlot.Name = "toolStripMenuItemGeomBoxPlot" - Me.toolStripMenuItemGeomBoxPlot.Size = New System.Drawing.Size(251, 32) + Me.toolStripMenuItemGeomBoxPlot.Size = New System.Drawing.Size(207, 22) Me.toolStripMenuItemGeomBoxPlot.Text = "geom_boxplot" ' 'toolStripMenuItemGeomBar ' Me.toolStripMenuItemGeomBar.Name = "toolStripMenuItemGeomBar" - Me.toolStripMenuItemGeomBar.Size = New System.Drawing.Size(251, 32) + Me.toolStripMenuItemGeomBar.Size = New System.Drawing.Size(207, 22) Me.toolStripMenuItemGeomBar.Text = "geom_bar" ' 'toolStripMenuItemGeomCol ' Me.toolStripMenuItemGeomCol.Name = "toolStripMenuItemGeomCol" - Me.toolStripMenuItemGeomCol.Size = New System.Drawing.Size(251, 32) + Me.toolStripMenuItemGeomCol.Size = New System.Drawing.Size(207, 22) Me.toolStripMenuItemGeomCol.Text = "geom_col" ' 'toolStripMenuItemGeomCount ' Me.toolStripMenuItemGeomCount.Name = "toolStripMenuItemGeomCount" - Me.toolStripMenuItemGeomCount.Size = New System.Drawing.Size(251, 32) + Me.toolStripMenuItemGeomCount.Size = New System.Drawing.Size(207, 22) Me.toolStripMenuItemGeomCount.Text = "geom_count" ' 'toolStripMenuItemGeomDensity ' Me.toolStripMenuItemGeomDensity.Name = "toolStripMenuItemGeomDensity" - Me.toolStripMenuItemGeomDensity.Size = New System.Drawing.Size(251, 32) + Me.toolStripMenuItemGeomDensity.Size = New System.Drawing.Size(207, 22) Me.toolStripMenuItemGeomDensity.Text = "geom_density" ' - 'toolStripMenuItemGeomJitter - ' - Me.toolStripMenuItemGeomJitter.Name = "toolStripMenuItemGeomJitter" - Me.toolStripMenuItemGeomJitter.Size = New System.Drawing.Size(251, 32) - Me.toolStripMenuItemGeomJitter.Text = "geom_jitter" - ' - 'toolStripMenuItemGeomPath - ' - Me.toolStripMenuItemGeomPath.Name = "toolStripMenuItemGeomPath" - Me.toolStripMenuItemGeomPath.Size = New System.Drawing.Size(251, 32) - Me.toolStripMenuItemGeomPath.Text = "geom_path" - ' - 'toolStripMenuItemGeomEncircle - ' - Me.toolStripMenuItemGeomEncircle.Name = "toolStripMenuItemGeomEncircle" - Me.toolStripMenuItemGeomEncircle.Size = New System.Drawing.Size(251, 32) - Me.toolStripMenuItemGeomEncircle.Text = "geom_encircle" - ' - 'toolStripMenuItemGeomDumbbell - ' - Me.toolStripMenuItemGeomDumbbell.Name = "toolStripMenuItemGeomDumbbell" - Me.toolStripMenuItemGeomDumbbell.Size = New System.Drawing.Size(251, 32) - Me.toolStripMenuItemGeomDumbbell.Text = "geom_dumbbell" - ' - 'cmdEdit - ' - Me.cmdEdit.Location = New System.Drawing.Point(24, 64) - Me.cmdEdit.Margin = New System.Windows.Forms.Padding(4) - Me.cmdEdit.Name = "cmdEdit" - Me.cmdEdit.Size = New System.Drawing.Size(112, 34) - Me.cmdEdit.TabIndex = 10 - Me.cmdEdit.Text = "Edit" - Me.cmdEdit.UseVisualStyleBackColor = True - ' 'toolStripMenuItemGeomDensityRidges ' Me.toolStripMenuItemGeomDensityRidges.Name = "toolStripMenuItemGeomDensityRidges" - Me.toolStripMenuItemGeomDensityRidges.Size = New System.Drawing.Size(251, 32) + Me.toolStripMenuItemGeomDensityRidges.Size = New System.Drawing.Size(207, 22) Me.toolStripMenuItemGeomDensityRidges.Text = "geom_density_ridges" ' + 'toolStripMenuItemGeomJitter + ' + Me.toolStripMenuItemGeomJitter.Name = "toolStripMenuItemGeomJitter" + Me.toolStripMenuItemGeomJitter.Size = New System.Drawing.Size(207, 22) + Me.toolStripMenuItemGeomJitter.Text = "geom_jitter" + ' 'toolStripMenuItemGeomLabel ' Me.toolStripMenuItemGeomLabel.Name = "toolStripMenuItemGeomLabel" - Me.toolStripMenuItemGeomLabel.Size = New System.Drawing.Size(251, 32) + Me.toolStripMenuItemGeomLabel.Size = New System.Drawing.Size(207, 22) Me.toolStripMenuItemGeomLabel.Text = "geom_label" ' 'toolStripMenuItemGeomLabelRepel ' Me.toolStripMenuItemGeomLabelRepel.Name = "toolStripMenuItemGeomLabelRepel" - Me.toolStripMenuItemGeomLabelRepel.Size = New System.Drawing.Size(251, 32) + Me.toolStripMenuItemGeomLabelRepel.Size = New System.Drawing.Size(207, 22) Me.toolStripMenuItemGeomLabelRepel.Text = "geom_label_repel" ' 'toolStripMenuItemGeomLine ' Me.toolStripMenuItemGeomLine.Name = "toolStripMenuItemGeomLine" - Me.toolStripMenuItemGeomLine.Size = New System.Drawing.Size(251, 32) + Me.toolStripMenuItemGeomLine.Size = New System.Drawing.Size(207, 22) Me.toolStripMenuItemGeomLine.Text = "geom_line" ' 'toolStripMenuItemGeomPoint ' Me.toolStripMenuItemGeomPoint.Name = "toolStripMenuItemGeomPoint" - Me.toolStripMenuItemGeomPoint.Size = New System.Drawing.Size(251, 32) + Me.toolStripMenuItemGeomPoint.Size = New System.Drawing.Size(207, 22) Me.toolStripMenuItemGeomPoint.Text = "geom_point" ' 'toolStripMenuItemGeomRugSmooth ' Me.toolStripMenuItemGeomRugSmooth.Name = "toolStripMenuItemGeomRugSmooth" - Me.toolStripMenuItemGeomRugSmooth.Size = New System.Drawing.Size(251, 32) - Me.toolStripMenuItemGeomRugSmooth.Text = "geom_rug_smooth" + Me.toolStripMenuItemGeomRugSmooth.Size = New System.Drawing.Size(207, 22) + Me.toolStripMenuItemGeomRugSmooth.Text = "geom_rug" ' 'toolStripMenuItemGeomText ' Me.toolStripMenuItemGeomText.Name = "toolStripMenuItemGeomText" - Me.toolStripMenuItemGeomText.Size = New System.Drawing.Size(251, 32) + Me.toolStripMenuItemGeomText.Size = New System.Drawing.Size(207, 22) Me.toolStripMenuItemGeomText.Text = "geom_text" ' 'toolStripMenuItemGeomTextRepel ' Me.toolStripMenuItemGeomTextRepel.Name = "toolStripMenuItemGeomTextRepel" - Me.toolStripMenuItemGeomTextRepel.Size = New System.Drawing.Size(251, 32) + Me.toolStripMenuItemGeomTextRepel.Size = New System.Drawing.Size(207, 22) Me.toolStripMenuItemGeomTextRepel.Text = "geom_text_repel" ' + 'cmdEdit + ' + Me.cmdEdit.Location = New System.Drawing.Point(16, 43) + Me.cmdEdit.Name = "cmdEdit" + Me.cmdEdit.Size = New System.Drawing.Size(75, 23) + Me.cmdEdit.TabIndex = 10 + Me.cmdEdit.Text = "Edit" + Me.cmdEdit.UseVisualStyleBackColor = True + ' + 'toolStripMenuItemGeomtile + ' + Me.toolStripMenuItemGeomtile.Name = "toolStripMenuItemGeomtile" + Me.toolStripMenuItemGeomtile.Size = New System.Drawing.Size(207, 22) + Me.toolStripMenuItemGeomtile.Text = "geom_tile" + ' + 'toolStripMenuItemGeomparallelslopes + ' + Me.toolStripMenuItemGeomparallelslopes.Name = "toolStripMenuItemGeomparallelslopes" + Me.toolStripMenuItemGeomparallelslopes.Size = New System.Drawing.Size(207, 22) + Me.toolStripMenuItemGeomparallelslopes.Text = "geom_parallel_slopes" + ' + 'toolStripMenuItemGeomcategoricalmodel + ' + Me.toolStripMenuItemGeomcategoricalmodel.Name = "toolStripMenuItemGeomcategoricalmodel" + Me.toolStripMenuItemGeomcategoricalmodel.Size = New System.Drawing.Size(207, 22) + Me.toolStripMenuItemGeomcategoricalmodel.Text = "geom_categorical_model" + ' + 'toolStripMenuItemGeomhistogram + ' + Me.toolStripMenuItemGeomhistogram.Name = "toolStripMenuItemGeomhistogram" + Me.toolStripMenuItemGeomhistogram.Size = New System.Drawing.Size(207, 22) + Me.toolStripMenuItemGeomhistogram.Text = "geom_histogram " + ' + 'toolStripMenuItemGeomcontour + ' + Me.toolStripMenuItemGeomcontour.Name = "toolStripMenuItemGeomcontour" + Me.toolStripMenuItemGeomcontour.Size = New System.Drawing.Size(207, 22) + Me.toolStripMenuItemGeomcontour.Text = "geom_contour" + ' + 'GeomsmoothToolStripMenuItem + ' + Me.GeomsmoothToolStripMenuItem.Name = "GeomsmoothToolStripMenuItem" + Me.GeomsmoothToolStripMenuItem.Size = New System.Drawing.Size(207, 22) + Me.GeomsmoothToolStripMenuItem.Text = "geom_smooth" + ' 'ucrAdditionalLayers ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(144.0!, 144.0!) + Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True Me.Controls.Add(Me.grpGeoms) Me.Controls.Add(Me.lblLayers) Me.Controls.Add(Me.lstLayers) - Me.Margin = New System.Windows.Forms.Padding(4) Me.Name = "ucrAdditionalLayers" - Me.Size = New System.Drawing.Size(374, 270) + Me.Size = New System.Drawing.Size(249, 180) Me.grpGeoms.ResumeLayout(False) Me.grpGeoms.PerformLayout() Me.contextMenuStripAdd.ResumeLayout(False) @@ -277,9 +290,6 @@ Partial Class ucrAdditionalLayers Friend WithEvents toolStripMenuItemGeomCount As ToolStripMenuItem Friend WithEvents toolStripMenuItemGeomDensity As ToolStripMenuItem Friend WithEvents toolStripMenuItemGeomJitter As ToolStripMenuItem - Friend WithEvents toolStripMenuItemGeomPath As ToolStripMenuItem - Friend WithEvents toolStripMenuItemGeomEncircle As ToolStripMenuItem - Friend WithEvents toolStripMenuItemGeomDumbbell As ToolStripMenuItem Friend WithEvents toolStripMenuItemGeomDensityRidges As ToolStripMenuItem Friend WithEvents toolStripMenuItemGeomLabel As ToolStripMenuItem Friend WithEvents toolStripMenuItemGeomLabelRepel As ToolStripMenuItem @@ -288,4 +298,10 @@ Partial Class ucrAdditionalLayers Friend WithEvents toolStripMenuItemGeomRugSmooth As ToolStripMenuItem Friend WithEvents toolStripMenuItemGeomText As ToolStripMenuItem Friend WithEvents toolStripMenuItemGeomTextRepel As ToolStripMenuItem + Friend WithEvents toolStripMenuItemGeomcategoricalmodel As ToolStripMenuItem + Friend WithEvents toolStripMenuItemGeomcontour As ToolStripMenuItem + Friend WithEvents toolStripMenuItemGeomhistogram As ToolStripMenuItem + Friend WithEvents toolStripMenuItemGeomparallelslopes As ToolStripMenuItem + Friend WithEvents GeomsmoothToolStripMenuItem As ToolStripMenuItem + Friend WithEvents toolStripMenuItemGeomtile As ToolStripMenuItem End Class diff --git a/instat/ucrAdditionalLayers.vb b/instat/ucrAdditionalLayers.vb index 77857eed708..a5431af837e 100644 --- a/instat/ucrAdditionalLayers.vb +++ b/instat/ucrAdditionalLayers.vb @@ -90,8 +90,8 @@ Public Class ucrAdditionalLayers SetEditDeleteEnabled() End Sub - Private Sub cmdAdd_Click(sender As Object, e As EventArgs) Handles cmdAdd.Click, toolStripMenuItemGeomBar.Click, toolStripMenuItemGeomBoxPlot.Click, toolStripMenuItemGeomCol.Click, toolStripMenuItemGeomCount.Click, - toolStripMenuItemGeomDensity.Click, toolStripMenuItemGeomEncircle.Click, toolStripMenuItemGeomJitter.Click, toolStripMenuItemGeomPath.Click, toolStripMenuItemGeomDumbbell.Click, toolStripMenuItemGeomLabel.Click, + Private Sub cmdAdd_Click(sender As Object, e As EventArgs) Handles cmdAdd.Click, toolStripMenuItemGeomBar.Click, toolStripMenuItemGeomBoxPlot.Click, toolStripMenuItemGeomCol.Click, toolStripMenuItemGeomCount.Click, toolStripMenuItemGeomcategoricalmodel.Click, + toolStripMenuItemGeomDensity.Click, toolStripMenuItemGeomJitter.Click, toolStripMenuItemGeomLabel.Click, toolStripMenuItemGeomparallelslopes.Click, toolStripMenuItemGeomtile.Click, toolStripMenuItemGeomcontour.Click, toolStripMenuItemGeomhistogram.Click, toolStripMenuItemGeomLabelRepel.Click, toolStripMenuItemGeomLine.Click, toolStripMenuItemGeomPoint.Click, toolStripMenuItemGeomRugSmooth.Click, toolStripMenuItemGeomText.Click, toolStripMenuItemGeomTextRepel.Click, toolStripMenuItemGeomDensityRidges.Click 'setup the geom function to use @@ -110,16 +110,14 @@ Public Class ucrAdditionalLayers strGeomRCommand = "geom_col" ElseIf sender Is toolStripMenuItemGeomDensity Then strGeomRCommand = "geom_density" - ElseIf sender Is toolStripMenuItemGeomEncircle Then - strPackage = "ggalt" - strGeomRCommand = "geom_encircle" + ElseIf sender Is toolStripMenuItemGeomtile Then + strGeomRCommand = "geom_tile" ElseIf sender Is toolStripMenuItemGeomJitter Then strGeomRCommand = "geom_jitter" - ElseIf sender Is toolStripMenuItemGeomPath Then - strGeomRCommand = "geom_path" - ElseIf sender Is toolStripMenuItemGeomDumbbell Then - strPackage = "ggalt" - strGeomRCommand = "geom_dumbbell" + ElseIf sender Is toolStripMenuItemGeomhistogram Then + strGeomRCommand = "geom_histogram" + ElseIf sender Is toolStripMenuItemGeomcontour Then + strGeomRCommand = "geom_contour" ElseIf sender Is toolStripMenuItemGeomDensityRidges Then strPackage = "ggridges" strGeomRCommand = "geom_density_ridges" @@ -139,6 +137,12 @@ Public Class ucrAdditionalLayers ElseIf sender Is toolStripMenuItemGeomTextRepel Then strPackage = "ggrepel" strGeomRCommand = "geom_text_repel" + ElseIf sender Is toolStripMenuItemGeomcategoricalmodel Then + strPackage = "moderndive" + strGeomRCommand = "geom_categorical_model" + ElseIf sender Is toolStripMenuItemGeomparallelslopes Then + strPackage = "moderndive" + strGeomRCommand = "geom_parallel_slopes" ElseIf sender Is cmdAdd Then bShowLayerSubdialog = True End If