From 4e40818cf1c917476fe028e2032055aedc3c860b Mon Sep 17 00:00:00 2001 From: patowhiz Date: Thu, 2 Nov 2023 18:33:02 +0300 Subject: [PATCH 01/27] script window changes --- instat/dlgScript.Designer.vb | 854 ++++++++++++++--------------------- instat/dlgScript.vb | 452 +++++++++--------- instat/ucrSelector.vb | 10 +- 3 files changed, 551 insertions(+), 765 deletions(-) diff --git a/instat/dlgScript.Designer.vb b/instat/dlgScript.Designer.vb index 3e90b96edc3..3cd119c34f5 100644 --- a/instat/dlgScript.Designer.vb +++ b/instat/dlgScript.Designer.vb @@ -22,423 +22,164 @@ Partial Class dlgScript 'Do not modify it using the code editor. _ Private Sub InitializeComponent() - Me.btnGetDataFrame = New System.Windows.Forms.Button() - Me.btnSaveDataframe = New System.Windows.Forms.Button() - Me.TabControl1 = New System.Windows.Forms.TabControl() - Me.TabPage2 = New System.Windows.Forms.TabPage() - Me.rdoGetObject = New System.Windows.Forms.RadioButton() - Me.lblGet = New System.Windows.Forms.Label() - Me.btnGet = New System.Windows.Forms.Button() - Me.ucrReceiverGet = New instat.ucrReceiverSingle() - Me.rdoGetDataFrame = New System.Windows.Forms.RadioButton() - Me.rdoGetColumn = New System.Windows.Forms.RadioButton() - Me.rdoGetPackage = New System.Windows.Forms.RadioButton() - Me.ucrPnlGetData = New instat.UcrPanel() - Me.rdoGetTable = New System.Windows.Forms.RadioButton() - Me.rdoGetModel = New System.Windows.Forms.RadioButton() - Me.rdoGetGraph = New System.Windows.Forms.RadioButton() - Me.ucrPnlGetObject = New instat.UcrPanel() - Me.ucrDataFrameGet = New instat.ucrDataFrame() - Me.ucrComboGetPackage = New instat.ucrInputComboBox() + Me.TbFeatures = New System.Windows.Forms.TabControl() + Me.tbPageLibrary = New System.Windows.Forms.TabPage() + Me.ucrCboLibPackage = New instat.ucrInputComboBox() Me.lblGetPackage = New System.Windows.Forms.Label() - Me.ucrSelectorGet = New instat.ucrSelectorByDataFrameAddRemove() - Me.btnGetPackage = New System.Windows.Forms.Button() - Me.TabPage3 = New System.Windows.Forms.TabPage() - Me.btnSaveModel = New System.Windows.Forms.Button() - Me.btnSaveTable = New System.Windows.Forms.Button() - Me.lblSaveDataFrame = New System.Windows.Forms.Label() - Me.btnSaveGraph = New System.Windows.Forms.Button() - Me.rdoSaveObject = New System.Windows.Forms.RadioButton() + Me.tbPageSaveData = New System.Windows.Forms.TabPage() + Me.lblSaveObjectFormat = New System.Windows.Forms.Label() + Me.ucrCboSaveOutputObjectFormat = New instat.ucrInputComboBox() + Me.lblSaveObjectType = New System.Windows.Forms.Label() + Me.ucrCboSaveOutputObjectType = New instat.ucrInputComboBox() + Me.rdoSaveOutputObject = New System.Windows.Forms.RadioButton() Me.rdoSaveDataFrame = New System.Windows.Forms.RadioButton() Me.rdoSaveColumn = New System.Windows.Forms.RadioButton() - Me.ucrSaveModel = New instat.ucrSave() - Me.ucrSaveTable = New instat.ucrSave() - Me.ucrSaveColumn = New instat.ucrSave() - Me.ucrDataFrameSave = New instat.ucrDataFrame() - Me.ucrInputSaveDataFrame = New instat.ucrInputTextBox() - Me.ucrSaveGraph = New instat.ucrSave() + Me.ucrSaveData = New instat.ucrSave() + Me.ucrDataFrameSaveOutputSelect = New instat.ucrDataFrame() Me.ucrPnlSaveData = New instat.UcrPanel() - Me.btnSaveColumn = New System.Windows.Forms.Button() - Me.TabPage4 = New System.Windows.Forms.TabPage() + Me.tbPageGetData = New System.Windows.Forms.TabPage() + Me.ucrDataFrameGetDF = New instat.ucrDataFrame() + Me.lblGetObjectType = New System.Windows.Forms.Label() + Me.ucrCboGetOutputObjectType = New instat.ucrInputComboBox() + Me.rdoGetOutputObject = New System.Windows.Forms.RadioButton() + Me.lblGetObject = New System.Windows.Forms.Label() + Me.ucrReceiverGetObject = New instat.ucrReceiverSingle() + Me.rdoGetDataFrame = New System.Windows.Forms.RadioButton() + Me.rdoGetColumn = New System.Windows.Forms.RadioButton() + Me.ucrPnlGetData = New instat.UcrPanel() + Me.ucrSelectorGetObject = New instat.ucrSelectorByDataFrameAddRemove() + Me.tbPageFinally = New System.Windows.Forms.TabPage() Me.btnRemoveObjects = New System.Windows.Forms.Button() Me.Label1 = New System.Windows.Forms.Label() Me.txtScript = New System.Windows.Forms.TextBox() Me.ucrBase = New instat.ucrButtons() - Me.TabControl1.SuspendLayout() - Me.TabPage2.SuspendLayout() - Me.TabPage3.SuspendLayout() - Me.TabPage4.SuspendLayout() + Me.TbFeatures.SuspendLayout() + Me.tbPageLibrary.SuspendLayout() + Me.tbPageSaveData.SuspendLayout() + Me.tbPageGetData.SuspendLayout() + Me.tbPageFinally.SuspendLayout() Me.SuspendLayout() ' - 'btnGetDataFrame - ' - Me.btnGetDataFrame.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.btnGetDataFrame.Location = New System.Drawing.Point(188, 69) - Me.btnGetDataFrame.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) - Me.btnGetDataFrame.Name = "btnGetDataFrame" - Me.btnGetDataFrame.Size = New System.Drawing.Size(74, 23) - Me.btnGetDataFrame.TabIndex = 32 - Me.btnGetDataFrame.Text = "Add" - Me.btnGetDataFrame.UseVisualStyleBackColor = True - ' - 'btnSaveDataframe - ' - Me.btnSaveDataframe.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.btnSaveDataframe.Location = New System.Drawing.Point(276, 59) - Me.btnSaveDataframe.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) - Me.btnSaveDataframe.Name = "btnSaveDataframe" - Me.btnSaveDataframe.Size = New System.Drawing.Size(74, 23) - Me.btnSaveDataframe.TabIndex = 32 - Me.btnSaveDataframe.Text = "Add" - Me.btnSaveDataframe.UseVisualStyleBackColor = True - ' - 'TabControl1 - ' - Me.TabControl1.Controls.Add(Me.TabPage2) - Me.TabControl1.Controls.Add(Me.TabPage3) - Me.TabControl1.Controls.Add(Me.TabPage4) - Me.TabControl1.Location = New System.Drawing.Point(8, 7) - Me.TabControl1.Name = "TabControl1" - Me.TabControl1.SelectedIndex = 0 - Me.TabControl1.Size = New System.Drawing.Size(446, 455) - Me.TabControl1.TabIndex = 31 - ' - 'TabPage2 - ' - Me.TabPage2.Controls.Add(Me.rdoGetObject) - Me.TabPage2.Controls.Add(Me.lblGet) - Me.TabPage2.Controls.Add(Me.btnGet) - Me.TabPage2.Controls.Add(Me.ucrReceiverGet) - Me.TabPage2.Controls.Add(Me.rdoGetDataFrame) - Me.TabPage2.Controls.Add(Me.rdoGetColumn) - Me.TabPage2.Controls.Add(Me.rdoGetPackage) - Me.TabPage2.Controls.Add(Me.ucrPnlGetData) - Me.TabPage2.Controls.Add(Me.rdoGetTable) - Me.TabPage2.Controls.Add(Me.rdoGetModel) - Me.TabPage2.Controls.Add(Me.rdoGetGraph) - Me.TabPage2.Controls.Add(Me.ucrPnlGetObject) - Me.TabPage2.Controls.Add(Me.ucrDataFrameGet) - Me.TabPage2.Controls.Add(Me.ucrComboGetPackage) - Me.TabPage2.Controls.Add(Me.lblGetPackage) - Me.TabPage2.Controls.Add(Me.ucrSelectorGet) - Me.TabPage2.Controls.Add(Me.btnGetDataFrame) - Me.TabPage2.Controls.Add(Me.btnGetPackage) - Me.TabPage2.Location = New System.Drawing.Point(4, 22) - Me.TabPage2.Name = "TabPage2" - Me.TabPage2.Padding = New System.Windows.Forms.Padding(3) - Me.TabPage2.Size = New System.Drawing.Size(438, 429) - Me.TabPage2.TabIndex = 1 - Me.TabPage2.Text = "Get Data" - Me.TabPage2.UseVisualStyleBackColor = True - ' - 'rdoGetObject - ' - Me.rdoGetObject.Appearance = System.Windows.Forms.Appearance.Button - Me.rdoGetObject.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoGetObject.FlatAppearance.BorderSize = 2 - Me.rdoGetObject.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoGetObject.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.rdoGetObject.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoGetObject.Location = New System.Drawing.Point(267, 12) - Me.rdoGetObject.Name = "rdoGetObject" - Me.rdoGetObject.Size = New System.Drawing.Size(80, 30) - Me.rdoGetObject.TabIndex = 46 - Me.rdoGetObject.TabStop = True - Me.rdoGetObject.Text = "Object" - Me.rdoGetObject.TextAlign = System.Drawing.ContentAlignment.MiddleCenter - Me.rdoGetObject.UseVisualStyleBackColor = True - ' - 'lblGet - ' - Me.lblGet.AutoSize = True - Me.lblGet.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblGet.Location = New System.Drawing.Point(269, 108) - Me.lblGet.Name = "lblGet" - Me.lblGet.Size = New System.Drawing.Size(86, 13) - Me.lblGet.TabIndex = 26 - Me.lblGet.Text = "Selected Object:" - ' - 'btnGet - ' - Me.btnGet.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.btnGet.Location = New System.Drawing.Point(270, 156) - Me.btnGet.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) - Me.btnGet.Name = "btnGet" - Me.btnGet.Size = New System.Drawing.Size(74, 23) - Me.btnGet.TabIndex = 28 - Me.btnGet.Text = "Add" - Me.btnGet.UseVisualStyleBackColor = True - ' - 'ucrReceiverGet - ' - Me.ucrReceiverGet.AutoSize = True - Me.ucrReceiverGet.frmParent = Nothing - Me.ucrReceiverGet.Location = New System.Drawing.Point(267, 124) - Me.ucrReceiverGet.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverGet.Name = "ucrReceiverGet" - Me.ucrReceiverGet.Selector = Nothing - Me.ucrReceiverGet.Size = New System.Drawing.Size(158, 20) - Me.ucrReceiverGet.strNcFilePath = "" - Me.ucrReceiverGet.TabIndex = 27 - Me.ucrReceiverGet.ucrSelector = Nothing - ' - 'rdoGetDataFrame - ' - Me.rdoGetDataFrame.Appearance = System.Windows.Forms.Appearance.Button - Me.rdoGetDataFrame.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoGetDataFrame.FlatAppearance.BorderSize = 2 - Me.rdoGetDataFrame.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoGetDataFrame.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.rdoGetDataFrame.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoGetDataFrame.Location = New System.Drawing.Point(111, 12) - Me.rdoGetDataFrame.Name = "rdoGetDataFrame" - Me.rdoGetDataFrame.Size = New System.Drawing.Size(80, 30) - Me.rdoGetDataFrame.TabIndex = 44 - Me.rdoGetDataFrame.TabStop = True - Me.rdoGetDataFrame.Text = "Data Frame" - Me.rdoGetDataFrame.TextAlign = System.Drawing.ContentAlignment.MiddleCenter - Me.rdoGetDataFrame.UseVisualStyleBackColor = True - ' - 'rdoGetColumn - ' - Me.rdoGetColumn.Appearance = System.Windows.Forms.Appearance.Button - Me.rdoGetColumn.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoGetColumn.FlatAppearance.BorderSize = 2 - Me.rdoGetColumn.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoGetColumn.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.rdoGetColumn.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoGetColumn.Location = New System.Drawing.Point(189, 12) - Me.rdoGetColumn.Name = "rdoGetColumn" - Me.rdoGetColumn.Size = New System.Drawing.Size(80, 30) - Me.rdoGetColumn.TabIndex = 45 - Me.rdoGetColumn.TabStop = True - Me.rdoGetColumn.Text = "Column" - Me.rdoGetColumn.TextAlign = System.Drawing.ContentAlignment.MiddleCenter - Me.rdoGetColumn.UseVisualStyleBackColor = True - ' - 'rdoGetPackage - ' - Me.rdoGetPackage.Appearance = System.Windows.Forms.Appearance.Button - Me.rdoGetPackage.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoGetPackage.FlatAppearance.BorderSize = 2 - Me.rdoGetPackage.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoGetPackage.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.rdoGetPackage.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoGetPackage.Location = New System.Drawing.Point(27, 12) - Me.rdoGetPackage.Name = "rdoGetPackage" - Me.rdoGetPackage.Size = New System.Drawing.Size(86, 30) - Me.rdoGetPackage.TabIndex = 43 - Me.rdoGetPackage.TabStop = True - Me.rdoGetPackage.Text = "Package" - Me.rdoGetPackage.TextAlign = System.Drawing.ContentAlignment.MiddleCenter - Me.rdoGetPackage.UseVisualStyleBackColor = True - ' - 'ucrPnlGetData - ' - Me.ucrPnlGetData.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlGetData.Location = New System.Drawing.Point(6, 10) - Me.ucrPnlGetData.Name = "ucrPnlGetData" - Me.ucrPnlGetData.Size = New System.Drawing.Size(402, 36) - Me.ucrPnlGetData.TabIndex = 42 - ' - 'rdoGetTable - ' - Me.rdoGetTable.Appearance = System.Windows.Forms.Appearance.Button - Me.rdoGetTable.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoGetTable.FlatAppearance.BorderSize = 2 - Me.rdoGetTable.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoGetTable.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.rdoGetTable.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoGetTable.Location = New System.Drawing.Point(154, 55) - Me.rdoGetTable.Name = "rdoGetTable" - Me.rdoGetTable.Size = New System.Drawing.Size(80, 30) - Me.rdoGetTable.TabIndex = 32 - Me.rdoGetTable.TabStop = True - Me.rdoGetTable.Text = "Table" - Me.rdoGetTable.TextAlign = System.Drawing.ContentAlignment.MiddleCenter - Me.rdoGetTable.UseVisualStyleBackColor = True - ' - 'rdoGetModel - ' - Me.rdoGetModel.Appearance = System.Windows.Forms.Appearance.Button - Me.rdoGetModel.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoGetModel.FlatAppearance.BorderSize = 2 - Me.rdoGetModel.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoGetModel.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.rdoGetModel.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoGetModel.Location = New System.Drawing.Point(232, 55) - Me.rdoGetModel.Name = "rdoGetModel" - Me.rdoGetModel.Size = New System.Drawing.Size(80, 30) - Me.rdoGetModel.TabIndex = 33 - Me.rdoGetModel.TabStop = True - Me.rdoGetModel.Text = "Model" - Me.rdoGetModel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter - Me.rdoGetModel.UseVisualStyleBackColor = True - ' - 'rdoGetGraph - ' - Me.rdoGetGraph.Appearance = System.Windows.Forms.Appearance.Button - Me.rdoGetGraph.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoGetGraph.FlatAppearance.BorderSize = 2 - Me.rdoGetGraph.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoGetGraph.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.rdoGetGraph.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoGetGraph.Location = New System.Drawing.Point(70, 55) - Me.rdoGetGraph.Name = "rdoGetGraph" - Me.rdoGetGraph.Size = New System.Drawing.Size(86, 30) - Me.rdoGetGraph.TabIndex = 31 - Me.rdoGetGraph.TabStop = True - Me.rdoGetGraph.Text = "Graph" - Me.rdoGetGraph.TextAlign = System.Drawing.ContentAlignment.MiddleCenter - Me.rdoGetGraph.UseVisualStyleBackColor = True - ' - 'ucrPnlGetObject - ' - Me.ucrPnlGetObject.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlGetObject.Location = New System.Drawing.Point(19, 51) - Me.ucrPnlGetObject.Name = "ucrPnlGetObject" - Me.ucrPnlGetObject.Size = New System.Drawing.Size(402, 36) - Me.ucrPnlGetObject.TabIndex = 30 - ' - 'ucrDataFrameGet - ' - Me.ucrDataFrameGet.AutoSize = True - Me.ucrDataFrameGet.bDropUnusedFilterLevels = False - Me.ucrDataFrameGet.bUseCurrentFilter = True - Me.ucrDataFrameGet.Location = New System.Drawing.Point(19, 51) - Me.ucrDataFrameGet.Margin = New System.Windows.Forms.Padding(0) - Me.ucrDataFrameGet.Name = "ucrDataFrameGet" - Me.ucrDataFrameGet.Size = New System.Drawing.Size(151, 50) - Me.ucrDataFrameGet.TabIndex = 31 - ' - 'ucrComboGetPackage - ' - Me.ucrComboGetPackage.AddQuotesIfUnrecognised = True - Me.ucrComboGetPackage.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrComboGetPackage.GetSetSelectedIndex = -1 - Me.ucrComboGetPackage.IsReadOnly = False - Me.ucrComboGetPackage.Location = New System.Drawing.Point(19, 68) - Me.ucrComboGetPackage.Name = "ucrComboGetPackage" - Me.ucrComboGetPackage.Size = New System.Drawing.Size(137, 21) - Me.ucrComboGetPackage.TabIndex = 40 + 'TbFeatures + ' + Me.TbFeatures.Controls.Add(Me.tbPageLibrary) + Me.TbFeatures.Controls.Add(Me.tbPageSaveData) + Me.TbFeatures.Controls.Add(Me.tbPageGetData) + Me.TbFeatures.Controls.Add(Me.tbPageFinally) + Me.TbFeatures.Location = New System.Drawing.Point(8, 7) + Me.TbFeatures.Name = "TbFeatures" + Me.TbFeatures.SelectedIndex = 0 + Me.TbFeatures.Size = New System.Drawing.Size(446, 455) + Me.TbFeatures.TabIndex = 31 + ' + 'tbPageLibrary + ' + Me.tbPageLibrary.Controls.Add(Me.ucrCboLibPackage) + Me.tbPageLibrary.Controls.Add(Me.lblGetPackage) + Me.tbPageLibrary.Location = New System.Drawing.Point(4, 22) + Me.tbPageLibrary.Name = "tbPageLibrary" + Me.tbPageLibrary.Size = New System.Drawing.Size(438, 429) + Me.tbPageLibrary.TabIndex = 4 + Me.tbPageLibrary.Text = "Library" + Me.tbPageLibrary.UseVisualStyleBackColor = True + ' + 'ucrCboLibPackage + ' + Me.ucrCboLibPackage.AddQuotesIfUnrecognised = True + Me.ucrCboLibPackage.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboLibPackage.GetSetSelectedIndex = -1 + Me.ucrCboLibPackage.IsReadOnly = False + Me.ucrCboLibPackage.Location = New System.Drawing.Point(138, 38) + Me.ucrCboLibPackage.Name = "ucrCboLibPackage" + Me.ucrCboLibPackage.Size = New System.Drawing.Size(137, 21) + Me.ucrCboLibPackage.TabIndex = 42 ' 'lblGetPackage ' Me.lblGetPackage.AutoSize = True - Me.lblGetPackage.Location = New System.Drawing.Point(16, 52) + Me.lblGetPackage.Location = New System.Drawing.Point(135, 22) Me.lblGetPackage.Name = "lblGetPackage" Me.lblGetPackage.Size = New System.Drawing.Size(73, 13) - Me.lblGetPackage.TabIndex = 39 + Me.lblGetPackage.TabIndex = 41 Me.lblGetPackage.Text = "Get Package:" ' - 'ucrSelectorGet - ' - Me.ucrSelectorGet.AutoSize = True - Me.ucrSelectorGet.bDropUnusedFilterLevels = False - Me.ucrSelectorGet.bShowHiddenColumns = False - Me.ucrSelectorGet.bUseCurrentFilter = True - Me.ucrSelectorGet.Location = New System.Drawing.Point(19, 55) - Me.ucrSelectorGet.Margin = New System.Windows.Forms.Padding(0) - Me.ucrSelectorGet.Name = "ucrSelectorGet" - Me.ucrSelectorGet.Size = New System.Drawing.Size(213, 183) - Me.ucrSelectorGet.TabIndex = 34 - ' - 'btnGetPackage - ' - Me.btnGetPackage.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.btnGetPackage.Location = New System.Drawing.Point(186, 68) - Me.btnGetPackage.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) - Me.btnGetPackage.Name = "btnGetPackage" - Me.btnGetPackage.Size = New System.Drawing.Size(74, 23) - Me.btnGetPackage.TabIndex = 41 - Me.btnGetPackage.Text = "Add" - Me.btnGetPackage.UseVisualStyleBackColor = True - ' - 'TabPage3 - ' - Me.TabPage3.Controls.Add(Me.btnSaveModel) - Me.TabPage3.Controls.Add(Me.btnSaveTable) - Me.TabPage3.Controls.Add(Me.lblSaveDataFrame) - Me.TabPage3.Controls.Add(Me.btnSaveGraph) - Me.TabPage3.Controls.Add(Me.rdoSaveObject) - Me.TabPage3.Controls.Add(Me.btnSaveDataframe) - Me.TabPage3.Controls.Add(Me.rdoSaveDataFrame) - Me.TabPage3.Controls.Add(Me.rdoSaveColumn) - Me.TabPage3.Controls.Add(Me.ucrSaveModel) - Me.TabPage3.Controls.Add(Me.ucrSaveTable) - Me.TabPage3.Controls.Add(Me.ucrSaveColumn) - Me.TabPage3.Controls.Add(Me.ucrDataFrameSave) - Me.TabPage3.Controls.Add(Me.ucrInputSaveDataFrame) - Me.TabPage3.Controls.Add(Me.ucrSaveGraph) - Me.TabPage3.Controls.Add(Me.ucrPnlSaveData) - Me.TabPage3.Controls.Add(Me.btnSaveColumn) - Me.TabPage3.Location = New System.Drawing.Point(4, 22) - Me.TabPage3.Name = "TabPage3" - Me.TabPage3.Size = New System.Drawing.Size(438, 429) - Me.TabPage3.TabIndex = 2 - Me.TabPage3.Text = "Save Results" - Me.TabPage3.UseVisualStyleBackColor = True - ' - 'btnSaveModel - ' - Me.btnSaveModel.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.btnSaveModel.Location = New System.Drawing.Point(291, 168) - Me.btnSaveModel.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) - Me.btnSaveModel.Name = "btnSaveModel" - Me.btnSaveModel.Size = New System.Drawing.Size(74, 23) - Me.btnSaveModel.TabIndex = 33 - Me.btnSaveModel.Text = "Add" - Me.btnSaveModel.UseVisualStyleBackColor = True - ' - 'btnSaveTable - ' - Me.btnSaveTable.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.btnSaveTable.Location = New System.Drawing.Point(290, 134) - Me.btnSaveTable.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) - Me.btnSaveTable.Name = "btnSaveTable" - Me.btnSaveTable.Size = New System.Drawing.Size(74, 23) - Me.btnSaveTable.TabIndex = 31 - Me.btnSaveTable.Text = "Add" - Me.btnSaveTable.UseVisualStyleBackColor = True - ' - 'lblSaveDataFrame - ' - Me.lblSaveDataFrame.AutoSize = True - Me.lblSaveDataFrame.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblSaveDataFrame.Location = New System.Drawing.Point(14, 64) - Me.lblSaveDataFrame.Name = "lblSaveDataFrame" - Me.lblSaveDataFrame.Size = New System.Drawing.Size(96, 13) - Me.lblSaveDataFrame.TabIndex = 21 - Me.lblSaveDataFrame.Tag = "" - Me.lblSaveDataFrame.Text = "Data Frame Name:" - ' - 'btnSaveGraph - ' - Me.btnSaveGraph.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.btnSaveGraph.Location = New System.Drawing.Point(291, 100) - Me.btnSaveGraph.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) - Me.btnSaveGraph.Name = "btnSaveGraph" - Me.btnSaveGraph.Size = New System.Drawing.Size(74, 23) - Me.btnSaveGraph.TabIndex = 27 - Me.btnSaveGraph.Text = "Add" - Me.btnSaveGraph.UseVisualStyleBackColor = True - ' - 'rdoSaveObject - ' - Me.rdoSaveObject.Appearance = System.Windows.Forms.Appearance.Button - Me.rdoSaveObject.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoSaveObject.FlatAppearance.BorderSize = 2 - Me.rdoSaveObject.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoSaveObject.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.rdoSaveObject.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoSaveObject.Location = New System.Drawing.Point(235, 14) - Me.rdoSaveObject.Name = "rdoSaveObject" - Me.rdoSaveObject.Size = New System.Drawing.Size(80, 30) - Me.rdoSaveObject.TabIndex = 51 - Me.rdoSaveObject.TabStop = True - Me.rdoSaveObject.Text = "Object" - Me.rdoSaveObject.TextAlign = System.Drawing.ContentAlignment.MiddleCenter - Me.rdoSaveObject.UseVisualStyleBackColor = True + 'tbPageSaveData + ' + Me.tbPageSaveData.Controls.Add(Me.lblSaveObjectFormat) + Me.tbPageSaveData.Controls.Add(Me.ucrCboSaveOutputObjectFormat) + Me.tbPageSaveData.Controls.Add(Me.lblSaveObjectType) + Me.tbPageSaveData.Controls.Add(Me.ucrCboSaveOutputObjectType) + Me.tbPageSaveData.Controls.Add(Me.rdoSaveOutputObject) + Me.tbPageSaveData.Controls.Add(Me.rdoSaveDataFrame) + Me.tbPageSaveData.Controls.Add(Me.rdoSaveColumn) + Me.tbPageSaveData.Controls.Add(Me.ucrSaveData) + Me.tbPageSaveData.Controls.Add(Me.ucrDataFrameSaveOutputSelect) + Me.tbPageSaveData.Controls.Add(Me.ucrPnlSaveData) + Me.tbPageSaveData.Location = New System.Drawing.Point(4, 22) + Me.tbPageSaveData.Name = "tbPageSaveData" + Me.tbPageSaveData.Size = New System.Drawing.Size(438, 429) + Me.tbPageSaveData.TabIndex = 2 + Me.tbPageSaveData.Text = "Save Data" + Me.tbPageSaveData.UseVisualStyleBackColor = True + ' + 'lblSaveObjectFormat + ' + Me.lblSaveObjectFormat.AutoSize = True + Me.lblSaveObjectFormat.Location = New System.Drawing.Point(296, 64) + Me.lblSaveObjectFormat.Name = "lblSaveObjectFormat" + Me.lblSaveObjectFormat.Size = New System.Drawing.Size(42, 13) + Me.lblSaveObjectFormat.TabIndex = 56 + Me.lblSaveObjectFormat.Text = "Format:" + ' + 'ucrCboSaveOutputObjectFormat + ' + Me.ucrCboSaveOutputObjectFormat.AddQuotesIfUnrecognised = True + Me.ucrCboSaveOutputObjectFormat.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboSaveOutputObjectFormat.GetSetSelectedIndex = -1 + Me.ucrCboSaveOutputObjectFormat.IsReadOnly = False + Me.ucrCboSaveOutputObjectFormat.Location = New System.Drawing.Point(298, 79) + Me.ucrCboSaveOutputObjectFormat.Margin = New System.Windows.Forms.Padding(9) + Me.ucrCboSaveOutputObjectFormat.Name = "ucrCboSaveOutputObjectFormat" + Me.ucrCboSaveOutputObjectFormat.Size = New System.Drawing.Size(117, 21) + Me.ucrCboSaveOutputObjectFormat.TabIndex = 55 + ' + 'lblSaveObjectType + ' + Me.lblSaveObjectType.AutoSize = True + Me.lblSaveObjectType.Location = New System.Drawing.Point(164, 65) + Me.lblSaveObjectType.Name = "lblSaveObjectType" + Me.lblSaveObjectType.Size = New System.Drawing.Size(34, 13) + Me.lblSaveObjectType.TabIndex = 54 + Me.lblSaveObjectType.Text = "Type:" + ' + 'ucrCboSaveOutputObjectType + ' + Me.ucrCboSaveOutputObjectType.AddQuotesIfUnrecognised = True + Me.ucrCboSaveOutputObjectType.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboSaveOutputObjectType.GetSetSelectedIndex = -1 + Me.ucrCboSaveOutputObjectType.IsReadOnly = False + Me.ucrCboSaveOutputObjectType.Location = New System.Drawing.Point(166, 80) + Me.ucrCboSaveOutputObjectType.Margin = New System.Windows.Forms.Padding(9) + Me.ucrCboSaveOutputObjectType.Name = "ucrCboSaveOutputObjectType" + Me.ucrCboSaveOutputObjectType.Size = New System.Drawing.Size(114, 21) + Me.ucrCboSaveOutputObjectType.TabIndex = 53 + ' + 'rdoSaveOutputObject + ' + Me.rdoSaveOutputObject.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoSaveOutputObject.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoSaveOutputObject.FlatAppearance.BorderSize = 2 + Me.rdoSaveOutputObject.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoSaveOutputObject.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoSaveOutputObject.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoSaveOutputObject.Location = New System.Drawing.Point(235, 14) + Me.rdoSaveOutputObject.Name = "rdoSaveOutputObject" + Me.rdoSaveOutputObject.Size = New System.Drawing.Size(86, 30) + Me.rdoSaveOutputObject.TabIndex = 51 + Me.rdoSaveOutputObject.TabStop = True + Me.rdoSaveOutputObject.Text = "Output Object" + Me.rdoSaveOutputObject.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoSaveOutputObject.UseVisualStyleBackColor = True ' 'rdoSaveDataFrame ' @@ -474,63 +215,25 @@ Partial Class dlgScript Me.rdoSaveColumn.TextAlign = System.Drawing.ContentAlignment.MiddleCenter Me.rdoSaveColumn.UseVisualStyleBackColor = True ' - 'ucrSaveModel - ' - Me.ucrSaveModel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrSaveModel.Location = New System.Drawing.Point(13, 169) - Me.ucrSaveModel.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) - Me.ucrSaveModel.Name = "ucrSaveModel" - Me.ucrSaveModel.Size = New System.Drawing.Size(271, 22) - Me.ucrSaveModel.TabIndex = 32 - ' - 'ucrSaveTable - ' - Me.ucrSaveTable.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrSaveTable.Location = New System.Drawing.Point(12, 135) - Me.ucrSaveTable.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) - Me.ucrSaveTable.Name = "ucrSaveTable" - Me.ucrSaveTable.Size = New System.Drawing.Size(272, 22) - Me.ucrSaveTable.TabIndex = 30 - ' - 'ucrSaveColumn - ' - Me.ucrSaveColumn.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrSaveColumn.Location = New System.Drawing.Point(12, 102) - Me.ucrSaveColumn.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) - Me.ucrSaveColumn.Name = "ucrSaveColumn" - Me.ucrSaveColumn.Size = New System.Drawing.Size(274, 22) - Me.ucrSaveColumn.TabIndex = 35 - ' - 'ucrDataFrameSave - ' - Me.ucrDataFrameSave.AutoSize = True - Me.ucrDataFrameSave.bDropUnusedFilterLevels = False - Me.ucrDataFrameSave.bUseCurrentFilter = True - Me.ucrDataFrameSave.Location = New System.Drawing.Point(13, 49) - Me.ucrDataFrameSave.Margin = New System.Windows.Forms.Padding(0) - Me.ucrDataFrameSave.Name = "ucrDataFrameSave" - Me.ucrDataFrameSave.Size = New System.Drawing.Size(151, 50) - Me.ucrDataFrameSave.TabIndex = 29 - ' - 'ucrInputSaveDataFrame - ' - Me.ucrInputSaveDataFrame.AddQuotesIfUnrecognised = True - Me.ucrInputSaveDataFrame.AutoSize = True - Me.ucrInputSaveDataFrame.IsMultiline = False - Me.ucrInputSaveDataFrame.IsReadOnly = False - Me.ucrInputSaveDataFrame.Location = New System.Drawing.Point(127, 59) - Me.ucrInputSaveDataFrame.Name = "ucrInputSaveDataFrame" - Me.ucrInputSaveDataFrame.Size = New System.Drawing.Size(137, 21) - Me.ucrInputSaveDataFrame.TabIndex = 31 - ' - 'ucrSaveGraph - ' - Me.ucrSaveGraph.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrSaveGraph.Location = New System.Drawing.Point(13, 101) - Me.ucrSaveGraph.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) - Me.ucrSaveGraph.Name = "ucrSaveGraph" - Me.ucrSaveGraph.Size = New System.Drawing.Size(271, 22) - Me.ucrSaveGraph.TabIndex = 26 + 'ucrSaveData + ' + Me.ucrSaveData.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrSaveData.Location = New System.Drawing.Point(127, 116) + Me.ucrSaveData.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.ucrSaveData.Name = "ucrSaveData" + Me.ucrSaveData.Size = New System.Drawing.Size(177, 22) + Me.ucrSaveData.TabIndex = 35 + ' + 'ucrDataFrameSaveOutputSelect + ' + Me.ucrDataFrameSaveOutputSelect.AutoSize = True + Me.ucrDataFrameSaveOutputSelect.bDropUnusedFilterLevels = False + Me.ucrDataFrameSaveOutputSelect.bUseCurrentFilter = True + Me.ucrDataFrameSaveOutputSelect.Location = New System.Drawing.Point(8, 60) + Me.ucrDataFrameSaveOutputSelect.Margin = New System.Windows.Forms.Padding(0) + Me.ucrDataFrameSaveOutputSelect.Name = "ucrDataFrameSaveOutputSelect" + Me.ucrDataFrameSaveOutputSelect.Size = New System.Drawing.Size(151, 50) + Me.ucrDataFrameSaveOutputSelect.TabIndex = 29 ' 'ucrPnlSaveData ' @@ -540,26 +243,161 @@ Partial Class dlgScript Me.ucrPnlSaveData.Size = New System.Drawing.Size(402, 36) Me.ucrPnlSaveData.TabIndex = 47 ' - 'btnSaveColumn + 'tbPageGetData + ' + Me.tbPageGetData.Controls.Add(Me.ucrDataFrameGetDF) + Me.tbPageGetData.Controls.Add(Me.lblGetObjectType) + Me.tbPageGetData.Controls.Add(Me.ucrCboGetOutputObjectType) + Me.tbPageGetData.Controls.Add(Me.rdoGetOutputObject) + Me.tbPageGetData.Controls.Add(Me.lblGetObject) + Me.tbPageGetData.Controls.Add(Me.ucrReceiverGetObject) + Me.tbPageGetData.Controls.Add(Me.rdoGetDataFrame) + Me.tbPageGetData.Controls.Add(Me.rdoGetColumn) + Me.tbPageGetData.Controls.Add(Me.ucrPnlGetData) + Me.tbPageGetData.Controls.Add(Me.ucrSelectorGetObject) + Me.tbPageGetData.Location = New System.Drawing.Point(4, 22) + Me.tbPageGetData.Name = "tbPageGetData" + Me.tbPageGetData.Padding = New System.Windows.Forms.Padding(3) + Me.tbPageGetData.Size = New System.Drawing.Size(438, 429) + Me.tbPageGetData.TabIndex = 1 + Me.tbPageGetData.Text = "Get Data" + Me.tbPageGetData.UseVisualStyleBackColor = True + ' + 'ucrDataFrameGetDF + ' + Me.ucrDataFrameGetDF.AutoSize = True + Me.ucrDataFrameGetDF.bDropUnusedFilterLevels = False + Me.ucrDataFrameGetDF.bUseCurrentFilter = True + Me.ucrDataFrameGetDF.Location = New System.Drawing.Point(10, 55) + Me.ucrDataFrameGetDF.Margin = New System.Windows.Forms.Padding(0) + Me.ucrDataFrameGetDF.Name = "ucrDataFrameGetDF" + Me.ucrDataFrameGetDF.Size = New System.Drawing.Size(151, 50) + Me.ucrDataFrameGetDF.TabIndex = 31 + ' + 'lblGetObjectType + ' + Me.lblGetObjectType.AutoSize = True + Me.lblGetObjectType.Location = New System.Drawing.Point(266, 57) + Me.lblGetObjectType.Name = "lblGetObjectType" + Me.lblGetObjectType.Size = New System.Drawing.Size(34, 13) + Me.lblGetObjectType.TabIndex = 48 + Me.lblGetObjectType.Text = "Type:" + ' + 'ucrCboGetOutputObjectType + ' + Me.ucrCboGetOutputObjectType.AddQuotesIfUnrecognised = True + Me.ucrCboGetOutputObjectType.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboGetOutputObjectType.GetSetSelectedIndex = -1 + Me.ucrCboGetOutputObjectType.IsReadOnly = False + Me.ucrCboGetOutputObjectType.Location = New System.Drawing.Point(268, 72) + Me.ucrCboGetOutputObjectType.Margin = New System.Windows.Forms.Padding(9) + Me.ucrCboGetOutputObjectType.Name = "ucrCboGetOutputObjectType" + Me.ucrCboGetOutputObjectType.Size = New System.Drawing.Size(137, 21) + Me.ucrCboGetOutputObjectType.TabIndex = 47 + ' + 'rdoGetOutputObject + ' + Me.rdoGetOutputObject.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoGetOutputObject.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoGetOutputObject.FlatAppearance.BorderSize = 2 + Me.rdoGetOutputObject.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoGetOutputObject.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoGetOutputObject.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoGetOutputObject.Location = New System.Drawing.Point(235, 12) + Me.rdoGetOutputObject.Name = "rdoGetOutputObject" + Me.rdoGetOutputObject.Size = New System.Drawing.Size(85, 30) + Me.rdoGetOutputObject.TabIndex = 46 + Me.rdoGetOutputObject.TabStop = True + Me.rdoGetOutputObject.Text = "Output Object" + Me.rdoGetOutputObject.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoGetOutputObject.UseVisualStyleBackColor = True + ' + 'lblGetObject + ' + Me.lblGetObject.AutoSize = True + Me.lblGetObject.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblGetObject.Location = New System.Drawing.Point(269, 101) + Me.lblGetObject.Name = "lblGetObject" + Me.lblGetObject.Size = New System.Drawing.Size(41, 13) + Me.lblGetObject.TabIndex = 26 + Me.lblGetObject.Text = "Object:" + ' + 'ucrReceiverGetObject + ' + Me.ucrReceiverGetObject.AutoSize = True + Me.ucrReceiverGetObject.frmParent = Nothing + Me.ucrReceiverGetObject.Location = New System.Drawing.Point(267, 117) + Me.ucrReceiverGetObject.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverGetObject.Name = "ucrReceiverGetObject" + Me.ucrReceiverGetObject.Selector = Nothing + Me.ucrReceiverGetObject.Size = New System.Drawing.Size(158, 20) + Me.ucrReceiverGetObject.strNcFilePath = "" + Me.ucrReceiverGetObject.TabIndex = 27 + Me.ucrReceiverGetObject.ucrSelector = Nothing + ' + 'rdoGetDataFrame + ' + Me.rdoGetDataFrame.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoGetDataFrame.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoGetDataFrame.FlatAppearance.BorderSize = 2 + Me.rdoGetDataFrame.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoGetDataFrame.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoGetDataFrame.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoGetDataFrame.Location = New System.Drawing.Point(79, 12) + Me.rdoGetDataFrame.Name = "rdoGetDataFrame" + Me.rdoGetDataFrame.Size = New System.Drawing.Size(80, 30) + Me.rdoGetDataFrame.TabIndex = 44 + Me.rdoGetDataFrame.TabStop = True + Me.rdoGetDataFrame.Text = "Data Frame" + Me.rdoGetDataFrame.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoGetDataFrame.UseVisualStyleBackColor = True + ' + 'rdoGetColumn + ' + Me.rdoGetColumn.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoGetColumn.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoGetColumn.FlatAppearance.BorderSize = 2 + Me.rdoGetColumn.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoGetColumn.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoGetColumn.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoGetColumn.Location = New System.Drawing.Point(157, 12) + Me.rdoGetColumn.Name = "rdoGetColumn" + Me.rdoGetColumn.Size = New System.Drawing.Size(80, 30) + Me.rdoGetColumn.TabIndex = 45 + Me.rdoGetColumn.TabStop = True + Me.rdoGetColumn.Text = "Column" + Me.rdoGetColumn.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoGetColumn.UseVisualStyleBackColor = True ' - Me.btnSaveColumn.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.btnSaveColumn.Location = New System.Drawing.Point(292, 102) - Me.btnSaveColumn.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) - Me.btnSaveColumn.Name = "btnSaveColumn" - Me.btnSaveColumn.Size = New System.Drawing.Size(74, 23) - Me.btnSaveColumn.TabIndex = 36 - Me.btnSaveColumn.Text = "Add" - Me.btnSaveColumn.UseVisualStyleBackColor = True + 'ucrPnlGetData ' - 'TabPage4 + Me.ucrPnlGetData.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlGetData.Location = New System.Drawing.Point(5, 10) + Me.ucrPnlGetData.Name = "ucrPnlGetData" + Me.ucrPnlGetData.Size = New System.Drawing.Size(402, 36) + Me.ucrPnlGetData.TabIndex = 42 ' - Me.TabPage4.Controls.Add(Me.btnRemoveObjects) - Me.TabPage4.Location = New System.Drawing.Point(4, 22) - Me.TabPage4.Name = "TabPage4" - Me.TabPage4.Size = New System.Drawing.Size(438, 429) - Me.TabPage4.TabIndex = 3 - Me.TabPage4.Text = "Finally" - Me.TabPage4.UseVisualStyleBackColor = True + 'ucrSelectorGetObject + ' + Me.ucrSelectorGetObject.AutoSize = True + Me.ucrSelectorGetObject.bDropUnusedFilterLevels = False + Me.ucrSelectorGetObject.bShowHiddenColumns = False + Me.ucrSelectorGetObject.bUseCurrentFilter = True + Me.ucrSelectorGetObject.Location = New System.Drawing.Point(9, 54) + Me.ucrSelectorGetObject.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectorGetObject.Name = "ucrSelectorGetObject" + Me.ucrSelectorGetObject.Size = New System.Drawing.Size(213, 183) + Me.ucrSelectorGetObject.TabIndex = 34 + ' + 'tbPageFinally + ' + Me.tbPageFinally.Controls.Add(Me.btnRemoveObjects) + Me.tbPageFinally.Location = New System.Drawing.Point(4, 22) + Me.tbPageFinally.Name = "tbPageFinally" + Me.tbPageFinally.Size = New System.Drawing.Size(438, 429) + Me.tbPageFinally.TabIndex = 3 + Me.tbPageFinally.Text = "Finally" + Me.tbPageFinally.UseVisualStyleBackColor = True ' 'btnRemoveObjects ' @@ -596,7 +434,7 @@ Partial Class dlgScript Me.ucrBase.Location = New System.Drawing.Point(287, 464) 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 = 16 ' 'dlgScript @@ -607,7 +445,7 @@ Partial Class dlgScript Me.ClientSize = New System.Drawing.Size(1042, 529) Me.Controls.Add(Me.txtScript) Me.Controls.Add(Me.Label1) - Me.Controls.Add(Me.TabControl1) + Me.Controls.Add(Me.TbFeatures) Me.Controls.Add(Me.ucrBase) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.MaximizeBox = False @@ -615,58 +453,48 @@ Partial Class dlgScript Me.Name = "dlgScript" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Script" - Me.TabControl1.ResumeLayout(False) - Me.TabPage2.ResumeLayout(False) - Me.TabPage2.PerformLayout() - Me.TabPage3.ResumeLayout(False) - Me.TabPage3.PerformLayout() - Me.TabPage4.ResumeLayout(False) + Me.TbFeatures.ResumeLayout(False) + Me.tbPageLibrary.ResumeLayout(False) + Me.tbPageLibrary.PerformLayout() + Me.tbPageSaveData.ResumeLayout(False) + Me.tbPageSaveData.PerformLayout() + Me.tbPageGetData.ResumeLayout(False) + Me.tbPageGetData.PerformLayout() + Me.tbPageFinally.ResumeLayout(False) Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents ucrBase As ucrButtons - Friend WithEvents ucrDataFrameGet As ucrDataFrame - Friend WithEvents ucrInputSaveDataFrame As ucrInputTextBox - Friend WithEvents btnGetDataFrame As Button - Friend WithEvents btnSaveDataframe As Button - Friend WithEvents TabControl1 As TabControl - Friend WithEvents TabPage2 As TabPage - Friend WithEvents TabPage3 As TabPage + Friend WithEvents ucrDataFrameGetDF As ucrDataFrame + Friend WithEvents TbFeatures As TabControl + Friend WithEvents tbPageGetData As TabPage + Friend WithEvents tbPageSaveData As TabPage Friend WithEvents Label1 As Label - Friend WithEvents btnSaveColumn As Button - Friend WithEvents ucrSaveColumn As ucrSave - Friend WithEvents TabPage4 As TabPage - Friend WithEvents ucrDataFrameSave As ucrDataFrame - Friend WithEvents btnSaveGraph As Button - Friend WithEvents ucrSaveGraph As ucrSave - Friend WithEvents btnSaveModel As Button - Friend WithEvents ucrSaveModel As ucrSave - Friend WithEvents btnSaveTable As Button - Friend WithEvents ucrSaveTable As ucrSave - Friend WithEvents lblSaveDataFrame As Label - Friend WithEvents ucrSelectorGet As ucrSelectorByDataFrameAddRemove + Friend WithEvents ucrSaveData As ucrSave + Friend WithEvents tbPageFinally As TabPage + Friend WithEvents ucrDataFrameSaveOutputSelect As ucrDataFrame Friend WithEvents ucrSelectorGetObject As ucrSelectorByDataFrameAddRemove - Friend WithEvents lblGet As Label - Friend WithEvents btnGet As Button - Friend WithEvents ucrReceiverGet As ucrReceiverSingle - Friend WithEvents ucrPnlGetObject As UcrPanel - Friend WithEvents rdoGetTable As RadioButton - Friend WithEvents rdoGetModel As RadioButton - Friend WithEvents rdoGetGraph As RadioButton + Friend WithEvents lblGetObject As Label + Friend WithEvents ucrReceiverGetObject As ucrReceiverSingle Friend WithEvents btnRemoveObjects As Button - Friend WithEvents lblGetPackage As Label - Friend WithEvents ucrComboGetPackage As ucrInputComboBox - Friend WithEvents btnGetPackage As Button Friend WithEvents ucrPnlGetData As UcrPanel Friend WithEvents rdoGetDataFrame As RadioButton Friend WithEvents rdoGetColumn As RadioButton - Friend WithEvents rdoGetPackage As RadioButton - Friend WithEvents rdoGetObject As RadioButton - Friend WithEvents rdoSaveObject As RadioButton + Friend WithEvents rdoGetOutputObject As RadioButton + Friend WithEvents rdoSaveOutputObject As RadioButton Friend WithEvents rdoSaveDataFrame As RadioButton Friend WithEvents rdoSaveColumn As RadioButton Friend WithEvents ucrPnlSaveData As UcrPanel Friend WithEvents txtScript As TextBox + Friend WithEvents lblGetObjectType As Label + Friend WithEvents ucrCboGetOutputObjectType As ucrInputComboBox + Friend WithEvents tbPageLibrary As TabPage + Friend WithEvents ucrCboLibPackage As ucrInputComboBox + Friend WithEvents lblGetPackage As Label + Friend WithEvents lblSaveObjectType As Label + Friend WithEvents ucrCboSaveOutputObjectType As ucrInputComboBox + Friend WithEvents lblSaveObjectFormat As Label + Friend WithEvents ucrCboSaveOutputObjectFormat As ucrInputComboBox End Class diff --git a/instat/dlgScript.vb b/instat/dlgScript.vb index 1c929fb7f78..6bc7138c219 100644 --- a/instat/dlgScript.vb +++ b/instat/dlgScript.vb @@ -20,8 +20,9 @@ Public Class dlgScript Private strComment As String = "Code generated by the dialog, Script" Private bFirstload As Boolean = True Private bReset As Boolean = True - Private clsLibraryFunction, clsGetDataFrameFunction, clsSaveColumnFunction, clsSaveGraphFunction, clsSaveTableFunction, clsSaveModelFunction As New RFunction - Private lstAssignToStrings As New List(Of String) + Private clsSaveDataFunction As New RFunction + Private dctOutputObjectTypes As New Dictionary(Of String, String) + Private dctOutputObjectFormats As New Dictionary(Of String, String) Private Sub dlgScript_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstload Then @@ -42,74 +43,69 @@ Public Class dlgScript 'ucrBase.clsRsyntax.iCallType = 2 'ucrBase.clsRsyntax.bSeparateThread = False + 'dctOutputObjectTypes.Add("Objects", "object") + dctOutputObjectTypes.Add("Summary", RObjectTypeLabel.Summary) + dctOutputObjectTypes.Add("Table", RObjectTypeLabel.Table) + dctOutputObjectTypes.Add("Graph", RObjectTypeLabel.Graph) + dctOutputObjectTypes.Add("Model", RObjectTypeLabel.Model) + dctOutputObjectTypes.Add("Structure", RObjectTypeLabel.StructureLabel) + + dctOutputObjectFormats.Add("Image", RObjectFormat.Image) + dctOutputObjectFormats.Add("Text", RObjectFormat.Text) + dctOutputObjectFormats.Add("Html", RObjectFormat.Html) '-------------------------------- - 'get data controls - ucrPnlGetData.AddRadioButton(rdoGetPackage) - ucrPnlGetData.AddRadioButton(rdoGetDataFrame) - ucrPnlGetData.AddRadioButton(rdoGetColumn) - ucrPnlGetData.AddRadioButton(rdoGetObject) + ' Library controls 'todo. this combobox can be a custom package control in future. Its also needed in dlgHelpVignettes - ucrComboGetPackage.SetParameter(New RParameter("package", 0)) - ucrComboGetPackage.SetItems(GetPackages(), bAddConditions:=True) - ucrComboGetPackage.SetDropDownStyleAsNonEditable() - ucrComboGetPackage.SetLinkedDisplayControl(New List(Of Control)({lblGetPackage, btnGetPackage})) + ucrCboLibPackage.SetParameter(New RParameter("package", 0)) + ucrCboLibPackage.SetItems(GetPackages(), bAddConditions:=True) + ucrCboLibPackage.SetDropDownStyleAsNonEditable() - ucrDataFrameGet.SetLabelText("Get Data Frame:") - ucrDataFrameGet.SetParameter(New RParameter("data_name", 0)) - ucrDataFrameGet.SetParameterIsString() - ucrDataFrameGet.SetLinkedDisplayControl(btnGetDataFrame) + '-------------------------------- + 'save controls + ucrPnlSaveData.AddRadioButton(rdoSaveDataFrame) + ucrPnlSaveData.AddRadioButton(rdoSaveColumn) + ucrPnlSaveData.AddRadioButton(rdoSaveOutputObject) - ucrSelectorGet.SetParameterIsString() + ucrCboSaveOutputObjectType.SetItems(dctOutputObjectTypes, bSetConditions:=False) + ucrCboSaveOutputObjectType.SetDropDownStyleAsNonEditable() + ucrCboSaveOutputObjectType.SetLinkedDisplayControl(lblSaveObjectType) + ucrCboSaveOutputObjectType.GetSetSelectedIndex = 0 - 'get object controls - ucrPnlGetObject.AddRadioButton(rdoGetGraph) - ucrPnlGetObject.AddRadioButton(rdoGetTable) - ucrPnlGetObject.AddRadioButton(rdoGetModel) + ucrCboSaveOutputObjectFormat.SetItems(dctOutputObjectFormats, bSetConditions:=False) + ucrCboSaveOutputObjectFormat.SetDropDownStyleAsNonEditable() + ucrCboSaveOutputObjectFormat.SetLinkedDisplayControl(lblSaveObjectFormat) + ucrCboSaveOutputObjectFormat.GetSetSelectedIndex = 0 - ucrReceiverGet.SetParameter(New RParameter("string", 0)) - ucrReceiverGet.SetParameterIsRFunction() - ucrReceiverGet.Selector = ucrSelectorGet - ucrReceiverGet.bUseFilteredData = False - ucrReceiverGet.SetMeAsReceiver() - ucrReceiverGet.SetLinkedDisplayControl(New List(Of Control)({lblGet, btnGet})) + ucrSaveData.SetSaveTypeAsGraph() + ucrSaveData.SetCheckBoxText("Save Graph") + ucrSaveData.SetIsComboBox() + ucrSaveData.SetDataFrameSelector(ucrDataFrameSaveOutputSelect) - '--------------------------------------------------- - 'save controls - ucrPnlSaveData.AddRadioButton(rdoSaveDataFrame) - ucrPnlSaveData.AddRadioButton(rdoSaveColumn) - ucrPnlSaveData.AddRadioButton(rdoSaveObject) - - ucrInputSaveDataFrame.SetValidationTypeAsRVariable() - ucrInputSaveDataFrame.SetLinkedDisplayControl(New List(Of Control)({lblSaveDataFrame, btnSaveDataframe})) - - ucrSaveColumn.SetSaveTypeAsColumn() - ucrSaveColumn.SetDataFrameSelector(ucrDataFrameSave) - ucrSaveColumn.SetIsComboBox() - ucrSaveColumn.SetLabelText("Column Name:") - ucrSaveColumn.SetLinkedDisplayControl(btnSaveColumn) - - ucrSaveGraph.SetSaveTypeAsGraph() - ucrSaveGraph.SetDataFrameSelector(ucrDataFrameSave) - ucrSaveGraph.SetIsComboBox() - ucrSaveGraph.SetLabelText("Graph Name:") - ucrSaveGraph.SetLinkedDisplayControl(btnSaveGraph) - - ucrSaveTable.SetSaveTypeAsTable() - ucrSaveTable.SetDataFrameSelector(ucrDataFrameSave) - ucrSaveTable.SetIsComboBox() - ucrSaveTable.SetLabelText("Table Name:") - ucrSaveTable.SetLinkedDisplayControl(btnSaveTable) - - ucrSaveModel.SetSaveTypeAsModel() - ucrSaveModel.SetDataFrameSelector(ucrDataFrameSave) - ucrSaveModel.SetIsComboBox() - ucrSaveModel.SetLabelText("Model Name:") - ucrSaveModel.SetLinkedDisplayControl(btnSaveModel) - - 'hide base button comment controls + '-------------------------------- + 'Get data controls + + ucrPnlGetData.AddRadioButton(rdoGetDataFrame) + ucrPnlGetData.AddRadioButton(rdoGetColumn) + ucrPnlGetData.AddRadioButton(rdoGetOutputObject) + + ucrDataFrameGetDF.SetLabelText("Get Data Frame:") + + ucrCboGetOutputObjectType.SetItems(dctOutputObjectTypes, bSetConditions:=False) + ucrCboGetOutputObjectType.SetDropDownStyleAsNonEditable() + ucrCboGetOutputObjectType.SetLinkedDisplayControl(lblGetObjectType) + ucrCboGetOutputObjectType.GetSetSelectedIndex = 0 + + ucrReceiverGetObject.Selector = ucrSelectorGetObject + ucrReceiverGetObject.SetMeAsReceiver() + ucrReceiverGetObject.bAutoFill = True + ucrReceiverGetObject.SetLinkedDisplayControl(lblGetObject) + + '------------------------------- + ' Hide base button comment controls + ucrBase.chkComment.Checked = False ucrBase.chkComment.Visible = False ucrBase.txtComment.Visible = False @@ -132,251 +128,211 @@ Public Class dlgScript End Function Private Sub SetDefaults() - clsLibraryFunction = New RFunction - clsGetDataFrameFunction = New RFunction - clsSaveColumnFunction = New RFunction - clsSaveGraphFunction = New RFunction - clsSaveTableFunction = New RFunction - clsSaveModelFunction = New RFunction - - lstAssignToStrings.Clear() - - 'get controls reset - rdoGetPackage.Checked = True - ucrComboGetPackage.Reset() - ucrDataFrameGet.Reset() - ucrSelectorGet.Reset() - 'ucrReceiverGetCol.SetMeAsReceiver() - rdoGetGraph.Checked = True - 'ucrReceiverGetObject.SetItemType("graph") - - - 'save controls reset + + ' Library controls + ucrCboLibPackage.Reset() + + ' Save controls reset rdoSaveDataFrame.Checked = True - ucrInputSaveDataFrame.SetName("") - ucrDataFrameSave.Reset() - ucrSaveColumn.Reset() - ucrSaveGraph.Reset() - ucrSaveTable.Reset() - ucrSaveModel.Reset() + ucrDataFrameSaveOutputSelect.Reset() + ucrSaveData.Reset() - 'script text control reset - txtScript.Text = "# Code generated by the dialog, Script" & Environment.NewLine + ' Get controls + ucrDataFrameGetDF.Reset() + rdoGetDataFrame.Checked = True + ucrCboGetOutputObjectType.GetSetSelectedIndex = 0 + ucrSelectorGetObject.Reset() - 'global function resets - clsLibraryFunction.SetRCommand("library") - clsLibraryFunction.AddParameter("package", Chr(34) & "datasets" & Chr(34)) - clsGetDataFrameFunction.SetRCommand("data_book$get_data_frame") - clsGetDataFrameFunction.AddParameter("data_name", Chr(34) & ucrDataFrameGet.strCurrDataFrame & Chr(34)) - End Sub + ' Script text control reset + 'txtScript.Text = "# Code generated by the dialog, Script" & Environment.NewLine - Private Sub TestOKEnabled() - ucrBase.OKEnabled(txtScript.Text.Length > 0) - End Sub - Private Sub SetRCodeForControls(bReset As Boolean) - ucrComboGetPackage.SetRCode(clsLibraryFunction, bReset) - ucrDataFrameGet.SetRCode(clsGetDataFrameFunction, bReset) - - 'saving results - ucrSaveColumn.SetRCode(clsSaveColumnFunction, bReset) - ucrSaveGraph.SetRCode(clsSaveGraphFunction, bReset) - ucrSaveTable.SetRCode(clsSaveTableFunction, bReset) - ucrSaveModel.SetRCode(clsSaveModelFunction, bReset) + + 'ucrBase.clsRsyntax.SetBaseRFunction(clsGetDataObjectFunction) End Sub - Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset - SetDefaults() - SetRCodeForControls(True) + + + Private Sub SetRCodeForControls(bReset As Boolean) + ucrSaveData.SetRCode(clsSaveDataFunction, bReset) End Sub - Private Sub ucrBase_ClickOk(sender As Object, e As EventArgs) Handles ucrBase.ClickOk - frmMain.clsRLink.RunScriptFromWindow(strNewScript:=txtScript.Text, strNewComment:=strComment) + Private Sub ucrCboLibPackage_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrCboLibPackage.ControlContentsChanged + Dim clsLibraryFunction As New RFunction + clsLibraryFunction.SetRCommand("library") + clsLibraryFunction.AddParameter("package", Chr(34) & ucrCboLibPackage.GetText() & Chr(34)) + PreviewScript(clsLibraryFunction.ToScript) End Sub Private Sub ucrPnlGetData_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlGetData.ControlValueChanged - ucrComboGetPackage.SetVisible(False) - ucrDataFrameGet.SetVisible(False) - ucrSelectorGet.SetVisible(False) - ucrPnlGetObject.SetVisible(False) - ucrReceiverGet.SetVisible(False) - If rdoGetPackage.Checked Then - ucrComboGetPackage.SetVisible(True) - ElseIf rdoGetDataFrame.Checked Then - ucrDataFrameGet.SetVisible(True) - ElseIf rdoGetColumn.Checked OrElse rdoGetObject.Checked Then - ucrPnlGetObject.SetVisible(False) - ucrSelectorGet.SetVisible(True) - ucrReceiverGet.SetVisible(True) - SetGetReceiverItemType() + ucrDataFrameGetDF.SetVisible(False) + ucrCboGetOutputObjectType.SetVisible(False) + ucrSelectorGetObject.SetVisible(False) + ucrReceiverGetObject.SetVisible(False) + If rdoGetDataFrame.Checked Then + ucrDataFrameGetDF.SetVisible(True) + ucrReceiverGetObject.SetVisible(False) + ucrDataFrameGetDF.Reset() + ElseIf rdoGetColumn.Checked Then + ucrSelectorGetObject.SetVisible(True) + ucrReceiverGetObject.SetVisible(True) + SetupReceiverForGetData("Column", RObjectTypeLabel.Column) + ElseIf rdoGetOutputObject.Checked Then + ucrSelectorGetObject.SetVisible(True) + ucrCboGetOutputObjectType.SetVisible(True) + lblGetObject.Text = ucrCboGetOutputObjectType.GetText() + ucrReceiverGetObject.SetVisible(True) + SetupReceiverForGetData(ucrCboGetOutputObjectType.GetText(), dctOutputObjectTypes.Item(ucrCboGetOutputObjectType.GetText())) End If End Sub - Private Sub ucrPnlGetObject_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlGetObject.ControlValueChanged - SetGetReceiverItemType() + Private Sub SetupReceiverForGetData(strLabel As String, strDataType As String) + ucrReceiverGetObject.Clear() + lblGetObject.Text = strLabel & ":" + ucrReceiverGetObject.SetSelectorHeading(strLabel) + ucrReceiverGetObject.SetItemType(strDataType) End Sub - Private Sub SetGetReceiverItemType() - ucrReceiverGet.Clear() - If rdoGetColumn.Checked Then - lblGet.Text = "Selected Column:" - ucrReceiverGet.SetItemType("column") - ElseIf rdoGetGraph.Checked Then - lblGet.Text = "Selected Graph:" - ucrReceiverGet.SetItemType("graph") - ElseIf rdoGetTable.Checked Then - lblGet.Text = "Selected Table:" - ucrReceiverGet.SetItemType("table") - ElseIf rdoGetModel.Checked Then - lblGet.Text = "Selected Model:" - ucrReceiverGet.SetItemType("model") - End If + Private Sub ucrDataFrameGet_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrDataFrameGetDF.ControlContentsChanged + Dim strAssignedScript As String = "" + Dim strAssignedTo As String = ucrDataFrameGetDF.clsCurrDataFrame.Clone().ToScript(strAssignedScript) + PreviewScript(strAssignedScript) End Sub - Private Sub ucrPnlSaveData_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlSaveData.ControlValueChanged - ucrInputSaveDataFrame.SetVisible(False) - ucrDataFrameSave.SetVisible(False) - ucrSaveColumn.SetVisible(False) - ucrSaveGraph.SetVisible(False) - ucrSaveTable.SetVisible(False) - ucrSaveModel.SetVisible(False) - If rdoSaveDataFrame.Checked Then - ucrInputSaveDataFrame.SetVisible(True) - ElseIf rdoSaveColumn.Checked Then - ucrDataFrameSave.SetVisible(True) - ucrSaveColumn.SetVisible(True) - ElseIf rdoSaveObject.Checked Then - ucrDataFrameSave.SetVisible(True) - ucrSaveGraph.SetVisible(True) - ucrSaveTable.SetVisible(True) - ucrSaveModel.SetVisible(True) + Private Sub ucrInputGetObjectType_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrCboGetOutputObjectType.ControlValueChanged + If Not ucrCboGetOutputObjectType.IsEmpty() Then + SetupReceiverForGetData(ucrCboGetOutputObjectType.GetText(), dctOutputObjectTypes.Item(ucrCboGetOutputObjectType.GetText())) End If End Sub - Private Sub btnGetPackage_Click(sender As Object, e As EventArgs) Handles btnGetPackage.Click - AppendTextScript(clsLibraryFunction.Clone.ToScript) - End Sub - - Private Sub btnGetDataFrame_Click(sender As Object, e As EventArgs) Handles btnGetDataFrame.Click - If ucrDataFrameGet.cboAvailableDataFrames.Text.Length < 1 Then - Exit Sub - End If + Private Sub ucrReceiverGet_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverGetObject.ControlContentsChanged + 'If ucrReceiverGet.IsEmpty Then + ' Exit Sub + 'End If + Dim clsFunction As RFunction = ucrReceiverGetObject.GetVariables() Dim strAssignedScript As String = "" - clsGetDataFrameFunction.SetAssignTo(ucrDataFrameGet.cboAvailableDataFrames.Text) - Dim strAssignedTo As String = clsGetDataFrameFunction.Clone.ToScript(strScript:=strAssignedScript) - AppendTextScript(strAssignedScript) - AddAssignToString(strAssignedTo) + Dim strAssignedTo As String = clsFunction.ToScript(strScript:=strAssignedScript) + PreviewScript(strAssignedScript) End Sub - Private Sub btnGetObject_Click(sender As Object, e As EventArgs) Handles btnGet.Click - If ucrReceiverGet.IsEmpty Then - Exit Sub + Private Sub ucrPnlSaveData_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlSaveData.ControlValueChanged + ucrDataFrameSaveOutputSelect.SetVisible(False) + ucrCboSaveOutputObjectType.SetVisible(False) + ucrCboSaveOutputObjectFormat.SetVisible(False) + If rdoSaveDataFrame.Checked Then + SetupSaveDataControl("Data Frame", RObjectTypeLabel.Dataframe, "") + ElseIf rdoSaveColumn.Checked Then + ucrDataFrameSaveOutputSelect.SetVisible(True) + ucrCboSaveOutputObjectType.SetVisible(True) + SetupSaveDataControl("Column", RObjectTypeLabel.Column, "") + ElseIf rdoSaveOutputObject.Checked Then + ucrDataFrameSaveOutputSelect.SetVisible(True) + ucrCboSaveOutputObjectType.SetVisible(True) + ucrCboSaveOutputObjectFormat.SetVisible(True) + SetupSaveDataControl(ucrCboSaveOutputObjectType.GetText(), dctOutputObjectTypes.Item(ucrCboSaveOutputObjectType.GetText()), dctOutputObjectFormats.Item(ucrCboSaveOutputObjectFormat.GetText())) End If - - Dim clsFunction As RFunction = ucrReceiverGet.GetVariables() - Dim strAssignedScript As String = "" - Dim strAssignedTo As String = clsFunction.ToScript(strScript:=strAssignedScript) - AppendTextScript(strAssignedScript) - AddAssignToString(strAssignedTo) End Sub - Private Sub btnSaveNewDataframe_Click(sender As Object, e As EventArgs) Handles btnSaveDataframe.Click - If ucrInputSaveDataFrame.IsEmpty Then - Exit Sub + Private Sub ucrCboSaveOutputObjectTypee_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrCboSaveOutputObjectType.ControlValueChanged, ucrCboSaveOutputObjectFormat.ControlValueChanged + If Not ucrCboSaveOutputObjectType.IsEmpty() AndAlso Not ucrCboSaveOutputObjectFormat.IsEmpty() Then + SetupSaveDataControl(ucrCboSaveOutputObjectType.GetText(), dctOutputObjectTypes.Item(ucrCboSaveOutputObjectType.GetText()), dctOutputObjectFormats.Item(ucrCboSaveOutputObjectFormat.GetText())) End If + End Sub - Dim clsImportNewDataFrame As New RFunction - Dim clsRFunctionList As New RFunction + Private Sub SetupSaveDataControl(strLabel As String, strDataType As String, strFormat As String) + ucrSaveData.SetLabelText(strLabel & ":") + ucrSaveData.SetSaveType(strDataType, strFormat) + End Sub - clsImportNewDataFrame.SetRCommand("data_book$import_data") + Private Sub ucrSaveData_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSaveData.ControlContentsChanged + 'If ucrReceiverGet.IsEmpty Then + ' Exit Sub + 'End If - clsRFunctionList.SetRCommand("list") - clsRFunctionList.AddParameter(ucrInputSaveDataFrame.GetText(), ucrInputSaveDataFrame.GetText()) - clsImportNewDataFrame.AddParameter("data_tables", clsRFunctionList.ToScript) - AppendTextScript(ucrInputSaveDataFrame.GetText() & "<-" & Environment.NewLine & clsImportNewDataFrame.ToScript) + Dim strAssignedScript As String = "" + Dim strAssignedTo As String = clsSaveDataFunction.Clone.ToScript(strScript:=strAssignedScript) + PreviewScript(strAssignedScript) End Sub - Private Sub btnSaveNewColumn_Click(sender As Object, e As EventArgs) Handles btnSaveColumn.Click - If Not ucrSaveColumn.IsComplete Then - Exit Sub - End If + 'Private Sub btnSaveNewDataframe_Click(sender As Object, e As EventArgs) + ' If ucrInputSaveDataFrame.IsEmpty Then + ' Exit Sub + ' End If - Dim strAssignedScript As String = "" - 'clone the function first because the ToScript function modifies the contents of the function. - Dim strAssignedTo As String = clsSaveColumnFunction.Clone.ToScript(strScript:=strAssignedScript) - AppendTextScript(strAssignedScript) - AddAssignToString(ucrSaveColumn.GetText) - End Sub + ' Dim clsImportNewDataFrame As New RFunction + ' Dim clsRFunctionList As New RFunction - Private Sub btnSaveNewGraph_Click(sender As Object, e As EventArgs) Handles btnSaveGraph.Click - If Not ucrSaveGraph.IsComplete Then - Exit Sub - End If + ' clsImportNewDataFrame.SetRCommand("data_book$import_data") - Dim strAssignedScript As String = "" - 'clone the function first because the ToScript function modifies the contents of the function. - Dim strGetScript As String = clsSaveGraphFunction.Clone.ToScript(strScript:=strAssignedScript) - AppendTextScript(strAssignedScript.Trim & Environment.NewLine & strGetScript) - AddAssignToString(ucrSaveGraph.GetText) - End Sub + ' clsRFunctionList.SetRCommand("list") + ' clsRFunctionList.AddParameter(ucrInputSaveDataFrame.GetText(), ucrInputSaveDataFrame.GetText()) + ' clsImportNewDataFrame.AddParameter("data_tables", clsRFunctionList.ToScript) - Private Sub btnSaveNewTable_Click(sender As Object, e As EventArgs) Handles btnSaveTable.Click - If Not ucrSaveTable.IsComplete Then - Exit Sub - End If + ' PreviewScript(ucrInputSaveDataFrame.GetText() & "<-" & Environment.NewLine & clsImportNewDataFrame.ToScript) + 'End Sub - Dim strAssignedScript As String = "" - 'clone the function first because the ToScript function modifies the contents of the function. - Dim strGetScript As String = clsSaveTableFunction.Clone.ToScript(strScript:=strAssignedScript) - AppendTextScript(strAssignedScript.Trim & Environment.NewLine & strGetScript) - AddAssignToString(ucrSaveTable.GetText) - End Sub + 'Private Sub btnSaveNewColumn_Click(sender As Object, e As EventArgs) + ' If Not ucrSaveData.IsComplete Then + ' Exit Sub + ' End If - Private Sub btnSaveNewModel_Click(sender As Object, e As EventArgs) Handles btnSaveModel.Click + ' Dim strAssignedScript As String = "" + ' 'clone the function first because the ToScript function modifies the contents of the function. + ' Dim strAssignedTo As String = clsSaveColumnFunction.Clone.ToScript(strScript:=strAssignedScript) + ' PreviewScript(strAssignedScript) + ' AddAssignToString(ucrSaveData.GetText) + 'End Sub - If Not ucrSaveModel.IsComplete Then - Exit Sub - End If + 'Private Sub btnSaveNewGraph_Click(sender As Object, e As EventArgs) + ' If Not ucrSaveGraph.IsComplete Then + ' Exit Sub + ' End If - Dim strAssignedScript As String = "" - 'clone the function first because the ToScript function modifies the contents of the function. - Dim strGetScript As String = clsSaveModelFunction.Clone.ToScript(strScript:=strAssignedScript) - AppendTextScript(strAssignedScript.Trim & Environment.NewLine & strGetScript) - AddAssignToString(ucrSaveModel.GetText) - End Sub + ' Dim strAssignedScript As String = "" + ' 'clone the function first because the ToScript function modifies the contents of the function. + ' Dim strGetScript As String = clsSaveGraphFunction.Clone.ToScript(strScript:=strAssignedScript) + ' PreviewScript(strAssignedScript.Trim & Environment.NewLine & strGetScript) + ' AddAssignToString(ucrSaveGraph.GetText) + 'End Sub Private Sub btnRemoveObjects_Click(sender As Object, e As EventArgs) Handles btnRemoveObjects.Click 'create function to remove the objects added in the script - Dim clsRemoveFunc As New RFunction - Dim clsRemoveListFun As New RFunction - clsRemoveFunc.SetRCommand("rm") - clsRemoveListFun.SetRCommand("c") - For i As Integer = 0 To lstAssignToStrings.Count - 1 - clsRemoveListFun.AddParameter(i, Chr(34) & lstAssignToStrings(i) & Chr(34), bIncludeArgumentName:=False) - Next - clsRemoveFunc.AddParameter("list", clsRFunctionParameter:=clsRemoveListFun) - - AppendTextScript(clsRemoveFunc.ToScript()) + 'Dim clsRemoveFunc As New RFunction + 'Dim clsRemoveListFun As New RFunction + 'clsRemoveFunc.SetRCommand("rm") + 'clsRemoveListFun.SetRCommand("c") + 'For i As Integer = 0 To lstAssignToStrings.Count - 1 + ' clsRemoveListFun.AddParameter(i, Chr(34) & lstAssignToStrings(i) & Chr(34), bIncludeArgumentName:=False) + 'Next + 'clsRemoveFunc.AddParameter("list", clsRFunctionParameter:=clsRemoveListFun) + + 'PreviewScript(clsRemoveFunc.ToScript()) End Sub Private Sub txtScript_TextChanged(sender As Object, e As EventArgs) Handles txtScript.TextChanged ucrBase.clsRsyntax.SetCommandString(txtScript.Text) - TestOKEnabled() + ucrBase.OKEnabled(txtScript.Text.Length > 0) + End Sub + + Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset + SetDefaults() + SetRCodeForControls(True) + End Sub + + Private Sub ucrBase_ClickOk(sender As Object, e As EventArgs) Handles ucrBase.ClickOk + frmMain.clsRLink.RunScriptFromWindow(strNewScript:=txtScript.Text, strNewComment:=strComment) End Sub - Private Sub AppendTextScript(strNewScript As String) - txtScript.Text = txtScript.Text & Environment.NewLine & Environment.NewLine & strNewScript.Trim + Private Sub PreviewScript(strNewScript As String) + txtScript.Text = strNewScript.Trim() & Environment.NewLine txtScript.SelectionStart = txtScript.Text.Length txtScript.ScrollToCaret() txtScript.Refresh() End Sub - Private Sub AddAssignToString(strObjectName As String) - If Not lstAssignToStrings.Contains(strObjectName) Then - lstAssignToStrings.Add(strObjectName) - End If - End Sub + + End Class \ No newline at end of file diff --git a/instat/ucrSelector.vb b/instat/ucrSelector.vb index 879349ac503..eadd554619a 100644 --- a/instat/ucrSelector.vb +++ b/instat/ucrSelector.vb @@ -119,13 +119,12 @@ Public Class ucrSelector 'set the type of 'elements' to show. If current receiver is set to a particular 'element' type then use it strCurrentType = If(CurrentReceiver.bTypeSet, CurrentReceiver.GetItemType(), strType) + 'holds the selector's list view 'fill conditions' + 'used as a 'cache' to check if there is need to clear and refill list view based on supplied parameters + Static _strCurrentSelectorFillCondition As String = "" 'if selector contains columns check if fill conditions are just the same If strCurrentType = "column" Then - 'holds the selector's list view 'fill conditions' - 'used as a 'cache' to check if there is need to clear and refill list view based on supplied parameters - Static _strCurrentSelectorFillCondition As String = "" - 'check if the fill condition is the same, if it is then no need to refill the listview with the same data. 'LoadList is called several times by different events raised in different places(e.g by linked receivers clearing and setting their contents ). 'this makes refilling of the listview unnecessarily slow, especially for wide data sets (see comments in issue #7162) @@ -142,6 +141,9 @@ Public Class ucrSelector End If _strCurrentSelectorFillCondition = strNewSelectorFillCondition + Else + 'reset selector fill conditions + _strCurrentSelectorFillCondition = "" End If 'todo, for columns, the list view should be field with variables from the .Net metadata object From 44b8345fd589e81b871a5e9cdc940c2e20908046 Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Fri, 3 Nov 2023 12:55:25 +0100 Subject: [PATCH 02/27] Added FlipCoordinates control in the data base --- instat/translations/rInstatTranslations.db | Bin 8302592 -> 8302592 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/instat/translations/rInstatTranslations.db b/instat/translations/rInstatTranslations.db index 2d8d33a1844ceaa7429051a8819c228a8f2ad42f..54df330d4313510ca27103637faaf8ab54d2013b 100644 GIT binary patch delta 765 zcmY+?$xjmj6vy$I>DX3ht7BQDQ~^b$DpmoD;!;~Eipx0e3n~aY2t|<*cMXj(4W8g2 z6Hbj6Zzd!hns};z0LF`n2cz5!2TinA&uc9spf-YIpjDTdld}f<@+Y}+e2N}!YM*u-A$BLqDDzk5D)gOYUP6)O5ie1=^HtfM( z?8AN}aR4c#(T)ye(20XMgf1M$5gf%aSU3(FCvXy{a2jWD7Uyst7jO~XxP;5Nf*$nZ zD*DimYq$;v1Gs@f3?YkQ+{7)6;C8VzKiWR(YZYg_K+<(|aZ#L+U&~!mTx=0OdGC^L zg}2b{M!ngj`^_&17N7o`PIkDJOT~!zt?3L^`9C#jXFi^CaR+0#i+i|_2Y84_c#J2- Jcam+K;@xSRD7UTD6J2Q$i?>~7>6bf zrpClGI2ac<5)xu=;#B_t)P=;sC?+Px!MHp58HeBW4d2YtAMXqbRU-4WIw3NzQbAq( z63^$;!LQ=k2W37=hVsdffCpaaD8VxLP>SVP;U+`I+-$9;X+}V4^0Ry^AIlc$F&E8w zbKI;Cd>PsY?hbIjHg4_}t6$@fNmzPMn( zj{rFZ$4r!#IKgBykjjIELdm zfgzm4DV)X`4C5@$;XG2ffDw!$jWJ}9#YJ4gWn95Ha+ttXOyZhbT$t*d^0s;`<+Giv zslV2HJeK$_3L>U`QtxahqLzl88Z~D-Kh)1br(f^Y+j9Ryq06aM^0!e|Ix;=ckxo~< d$y;#;)3}ZsxQSc1jXSuDd${jf@dqDse*rH3Pj~ Date: Sun, 5 Nov 2023 18:13:49 +0300 Subject: [PATCH 03/27] more changes --- instat/dlgScript.Designer.vb | 109 ++++++++++++++++++++--------------- instat/dlgScript.vb | 18 ++++-- 2 files changed, 76 insertions(+), 51 deletions(-) diff --git a/instat/dlgScript.Designer.vb b/instat/dlgScript.Designer.vb index 3cd119c34f5..90b77588e03 100644 --- a/instat/dlgScript.Designer.vb +++ b/instat/dlgScript.Designer.vb @@ -49,10 +49,11 @@ Partial Class dlgScript Me.ucrPnlGetData = New instat.UcrPanel() Me.ucrSelectorGetObject = New instat.ucrSelectorByDataFrameAddRemove() Me.tbPageFinally = New System.Windows.Forms.TabPage() - Me.btnRemoveObjects = New System.Windows.Forms.Button() - Me.Label1 = New System.Windows.Forms.Label() + Me.lblPreview = New System.Windows.Forms.Label() Me.txtScript = New System.Windows.Forms.TextBox() Me.ucrBase = New instat.ucrButtons() + Me.ucrInputFinallyRemoveObject = New instat.ucrInputTextBox() + Me.lblFinallyRemoveObject = New System.Windows.Forms.Label() Me.TbFeatures.SuspendLayout() Me.tbPageLibrary.SuspendLayout() Me.tbPageSaveData.SuspendLayout() @@ -69,7 +70,7 @@ Partial Class dlgScript Me.TbFeatures.Location = New System.Drawing.Point(8, 7) Me.TbFeatures.Name = "TbFeatures" Me.TbFeatures.SelectedIndex = 0 - Me.TbFeatures.Size = New System.Drawing.Size(446, 455) + Me.TbFeatures.Size = New System.Drawing.Size(446, 271) Me.TbFeatures.TabIndex = 31 ' 'tbPageLibrary @@ -78,7 +79,7 @@ Partial Class dlgScript Me.tbPageLibrary.Controls.Add(Me.lblGetPackage) Me.tbPageLibrary.Location = New System.Drawing.Point(4, 22) Me.tbPageLibrary.Name = "tbPageLibrary" - Me.tbPageLibrary.Size = New System.Drawing.Size(438, 429) + Me.tbPageLibrary.Size = New System.Drawing.Size(438, 245) Me.tbPageLibrary.TabIndex = 4 Me.tbPageLibrary.Text = "Library" Me.tbPageLibrary.UseVisualStyleBackColor = True @@ -89,7 +90,7 @@ Partial Class dlgScript Me.ucrCboLibPackage.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrCboLibPackage.GetSetSelectedIndex = -1 Me.ucrCboLibPackage.IsReadOnly = False - Me.ucrCboLibPackage.Location = New System.Drawing.Point(138, 38) + Me.ucrCboLibPackage.Location = New System.Drawing.Point(14, 30) Me.ucrCboLibPackage.Name = "ucrCboLibPackage" Me.ucrCboLibPackage.Size = New System.Drawing.Size(137, 21) Me.ucrCboLibPackage.TabIndex = 42 @@ -97,7 +98,7 @@ Partial Class dlgScript 'lblGetPackage ' Me.lblGetPackage.AutoSize = True - Me.lblGetPackage.Location = New System.Drawing.Point(135, 22) + Me.lblGetPackage.Location = New System.Drawing.Point(11, 14) Me.lblGetPackage.Name = "lblGetPackage" Me.lblGetPackage.Size = New System.Drawing.Size(73, 13) Me.lblGetPackage.TabIndex = 41 @@ -117,7 +118,7 @@ Partial Class dlgScript Me.tbPageSaveData.Controls.Add(Me.ucrPnlSaveData) Me.tbPageSaveData.Location = New System.Drawing.Point(4, 22) Me.tbPageSaveData.Name = "tbPageSaveData" - Me.tbPageSaveData.Size = New System.Drawing.Size(438, 429) + Me.tbPageSaveData.Size = New System.Drawing.Size(438, 245) Me.tbPageSaveData.TabIndex = 2 Me.tbPageSaveData.Text = "Save Data" Me.tbPageSaveData.UseVisualStyleBackColor = True @@ -125,7 +126,7 @@ Partial Class dlgScript 'lblSaveObjectFormat ' Me.lblSaveObjectFormat.AutoSize = True - Me.lblSaveObjectFormat.Location = New System.Drawing.Point(296, 64) + Me.lblSaveObjectFormat.Location = New System.Drawing.Point(16, 145) Me.lblSaveObjectFormat.Name = "lblSaveObjectFormat" Me.lblSaveObjectFormat.Size = New System.Drawing.Size(42, 13) Me.lblSaveObjectFormat.TabIndex = 56 @@ -137,16 +138,16 @@ Partial Class dlgScript Me.ucrCboSaveOutputObjectFormat.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrCboSaveOutputObjectFormat.GetSetSelectedIndex = -1 Me.ucrCboSaveOutputObjectFormat.IsReadOnly = False - Me.ucrCboSaveOutputObjectFormat.Location = New System.Drawing.Point(298, 79) + Me.ucrCboSaveOutputObjectFormat.Location = New System.Drawing.Point(18, 160) Me.ucrCboSaveOutputObjectFormat.Margin = New System.Windows.Forms.Padding(9) Me.ucrCboSaveOutputObjectFormat.Name = "ucrCboSaveOutputObjectFormat" - Me.ucrCboSaveOutputObjectFormat.Size = New System.Drawing.Size(117, 21) + Me.ucrCboSaveOutputObjectFormat.Size = New System.Drawing.Size(141, 21) Me.ucrCboSaveOutputObjectFormat.TabIndex = 55 ' 'lblSaveObjectType ' Me.lblSaveObjectType.AutoSize = True - Me.lblSaveObjectType.Location = New System.Drawing.Point(164, 65) + Me.lblSaveObjectType.Location = New System.Drawing.Point(13, 101) Me.lblSaveObjectType.Name = "lblSaveObjectType" Me.lblSaveObjectType.Size = New System.Drawing.Size(34, 13) Me.lblSaveObjectType.TabIndex = 54 @@ -158,10 +159,10 @@ Partial Class dlgScript Me.ucrCboSaveOutputObjectType.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrCboSaveOutputObjectType.GetSetSelectedIndex = -1 Me.ucrCboSaveOutputObjectType.IsReadOnly = False - Me.ucrCboSaveOutputObjectType.Location = New System.Drawing.Point(166, 80) + Me.ucrCboSaveOutputObjectType.Location = New System.Drawing.Point(15, 116) Me.ucrCboSaveOutputObjectType.Margin = New System.Windows.Forms.Padding(9) Me.ucrCboSaveOutputObjectType.Name = "ucrCboSaveOutputObjectType" - Me.ucrCboSaveOutputObjectType.Size = New System.Drawing.Size(114, 21) + Me.ucrCboSaveOutputObjectType.Size = New System.Drawing.Size(144, 21) Me.ucrCboSaveOutputObjectType.TabIndex = 53 ' 'rdoSaveOutputObject @@ -218,10 +219,10 @@ Partial Class dlgScript 'ucrSaveData ' Me.ucrSaveData.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrSaveData.Location = New System.Drawing.Point(127, 116) + Me.ucrSaveData.Location = New System.Drawing.Point(185, 70) Me.ucrSaveData.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.ucrSaveData.Name = "ucrSaveData" - Me.ucrSaveData.Size = New System.Drawing.Size(177, 22) + Me.ucrSaveData.Size = New System.Drawing.Size(230, 22) Me.ucrSaveData.TabIndex = 35 ' 'ucrDataFrameSaveOutputSelect @@ -229,7 +230,7 @@ Partial Class dlgScript Me.ucrDataFrameSaveOutputSelect.AutoSize = True Me.ucrDataFrameSaveOutputSelect.bDropUnusedFilterLevels = False Me.ucrDataFrameSaveOutputSelect.bUseCurrentFilter = True - Me.ucrDataFrameSaveOutputSelect.Location = New System.Drawing.Point(8, 60) + Me.ucrDataFrameSaveOutputSelect.Location = New System.Drawing.Point(14, 54) Me.ucrDataFrameSaveOutputSelect.Margin = New System.Windows.Forms.Padding(0) Me.ucrDataFrameSaveOutputSelect.Name = "ucrDataFrameSaveOutputSelect" Me.ucrDataFrameSaveOutputSelect.Size = New System.Drawing.Size(151, 50) @@ -258,7 +259,7 @@ Partial Class dlgScript Me.tbPageGetData.Location = New System.Drawing.Point(4, 22) Me.tbPageGetData.Name = "tbPageGetData" Me.tbPageGetData.Padding = New System.Windows.Forms.Padding(3) - Me.tbPageGetData.Size = New System.Drawing.Size(438, 429) + Me.tbPageGetData.Size = New System.Drawing.Size(438, 245) Me.tbPageGetData.TabIndex = 1 Me.tbPageGetData.Text = "Get Data" Me.tbPageGetData.UseVisualStyleBackColor = True @@ -277,7 +278,7 @@ Partial Class dlgScript 'lblGetObjectType ' Me.lblGetObjectType.AutoSize = True - Me.lblGetObjectType.Location = New System.Drawing.Point(266, 57) + Me.lblGetObjectType.Location = New System.Drawing.Point(238, 57) Me.lblGetObjectType.Name = "lblGetObjectType" Me.lblGetObjectType.Size = New System.Drawing.Size(34, 13) Me.lblGetObjectType.TabIndex = 48 @@ -289,7 +290,7 @@ Partial Class dlgScript Me.ucrCboGetOutputObjectType.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrCboGetOutputObjectType.GetSetSelectedIndex = -1 Me.ucrCboGetOutputObjectType.IsReadOnly = False - Me.ucrCboGetOutputObjectType.Location = New System.Drawing.Point(268, 72) + Me.ucrCboGetOutputObjectType.Location = New System.Drawing.Point(240, 72) Me.ucrCboGetOutputObjectType.Margin = New System.Windows.Forms.Padding(9) Me.ucrCboGetOutputObjectType.Name = "ucrCboGetOutputObjectType" Me.ucrCboGetOutputObjectType.Size = New System.Drawing.Size(137, 21) @@ -316,7 +317,7 @@ Partial Class dlgScript ' Me.lblGetObject.AutoSize = True Me.lblGetObject.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblGetObject.Location = New System.Drawing.Point(269, 101) + Me.lblGetObject.Location = New System.Drawing.Point(241, 101) Me.lblGetObject.Name = "lblGetObject" Me.lblGetObject.Size = New System.Drawing.Size(41, 13) Me.lblGetObject.TabIndex = 26 @@ -326,7 +327,7 @@ Partial Class dlgScript ' Me.ucrReceiverGetObject.AutoSize = True Me.ucrReceiverGetObject.frmParent = Nothing - Me.ucrReceiverGetObject.Location = New System.Drawing.Point(267, 117) + Me.ucrReceiverGetObject.Location = New System.Drawing.Point(239, 117) Me.ucrReceiverGetObject.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverGetObject.Name = "ucrReceiverGetObject" Me.ucrReceiverGetObject.Selector = Nothing @@ -391,60 +392,72 @@ Partial Class dlgScript ' 'tbPageFinally ' - Me.tbPageFinally.Controls.Add(Me.btnRemoveObjects) + Me.tbPageFinally.Controls.Add(Me.lblFinallyRemoveObject) + Me.tbPageFinally.Controls.Add(Me.ucrInputFinallyRemoveObject) Me.tbPageFinally.Location = New System.Drawing.Point(4, 22) Me.tbPageFinally.Name = "tbPageFinally" - Me.tbPageFinally.Size = New System.Drawing.Size(438, 429) + Me.tbPageFinally.Size = New System.Drawing.Size(438, 245) Me.tbPageFinally.TabIndex = 3 Me.tbPageFinally.Text = "Finally" Me.tbPageFinally.UseVisualStyleBackColor = True ' - 'btnRemoveObjects + 'lblPreview ' - Me.btnRemoveObjects.Location = New System.Drawing.Point(13, 29) - Me.btnRemoveObjects.Name = "btnRemoveObjects" - Me.btnRemoveObjects.Size = New System.Drawing.Size(75, 23) - Me.btnRemoveObjects.TabIndex = 1 - Me.btnRemoveObjects.Text = "Remove Objects" - Me.btnRemoveObjects.UseVisualStyleBackColor = True - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.Label1.Location = New System.Drawing.Point(460, 11) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(37, 13) - Me.Label1.TabIndex = 30 - Me.Label1.Text = "Script:" + Me.lblPreview.AutoSize = True + Me.lblPreview.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblPreview.Location = New System.Drawing.Point(9, 281) + Me.lblPreview.Name = "lblPreview" + Me.lblPreview.Size = New System.Drawing.Size(48, 13) + Me.lblPreview.TabIndex = 30 + Me.lblPreview.Text = "Preview:" ' 'txtScript ' - Me.txtScript.Location = New System.Drawing.Point(456, 29) + Me.txtScript.Location = New System.Drawing.Point(5, 299) Me.txtScript.Multiline = True Me.txtScript.Name = "txtScript" Me.txtScript.ScrollBars = System.Windows.Forms.ScrollBars.Both - Me.txtScript.Size = New System.Drawing.Size(576, 429) + Me.txtScript.Size = New System.Drawing.Size(445, 96) Me.txtScript.TabIndex = 32 ' 'ucrBase ' Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(287, 464) + Me.ucrBase.Location = New System.Drawing.Point(6, 399) Me.ucrBase.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(408, 52) Me.ucrBase.TabIndex = 16 ' + 'ucrInputFinallyRemoveObject + ' + Me.ucrInputFinallyRemoveObject.AddQuotesIfUnrecognised = True + Me.ucrInputFinallyRemoveObject.AutoSize = True + Me.ucrInputFinallyRemoveObject.IsMultiline = False + Me.ucrInputFinallyRemoveObject.IsReadOnly = False + Me.ucrInputFinallyRemoveObject.Location = New System.Drawing.Point(17, 30) + Me.ucrInputFinallyRemoveObject.Name = "ucrInputFinallyRemoveObject" + Me.ucrInputFinallyRemoveObject.Size = New System.Drawing.Size(197, 21) + Me.ucrInputFinallyRemoveObject.TabIndex = 2 + ' + 'lblFinallyRemoveObject + ' + Me.lblFinallyRemoveObject.AutoSize = True + Me.lblFinallyRemoveObject.Location = New System.Drawing.Point(14, 14) + Me.lblFinallyRemoveObject.Name = "lblFinallyRemoveObject" + Me.lblFinallyRemoveObject.Size = New System.Drawing.Size(95, 13) + Me.lblFinallyRemoveObject.TabIndex = 3 + Me.lblFinallyRemoveObject.Text = "Remove Object(s):" + ' 'dlgScript ' 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(1042, 529) + Me.ClientSize = New System.Drawing.Size(458, 458) Me.Controls.Add(Me.txtScript) - Me.Controls.Add(Me.Label1) + Me.Controls.Add(Me.lblPreview) Me.Controls.Add(Me.TbFeatures) Me.Controls.Add(Me.ucrBase) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow @@ -461,6 +474,7 @@ Partial Class dlgScript Me.tbPageGetData.ResumeLayout(False) Me.tbPageGetData.PerformLayout() Me.tbPageFinally.ResumeLayout(False) + Me.tbPageFinally.PerformLayout() Me.ResumeLayout(False) Me.PerformLayout() @@ -471,14 +485,13 @@ Partial Class dlgScript Friend WithEvents TbFeatures As TabControl Friend WithEvents tbPageGetData As TabPage Friend WithEvents tbPageSaveData As TabPage - Friend WithEvents Label1 As Label + Friend WithEvents lblPreview As Label Friend WithEvents ucrSaveData As ucrSave Friend WithEvents tbPageFinally As TabPage Friend WithEvents ucrDataFrameSaveOutputSelect As ucrDataFrame Friend WithEvents ucrSelectorGetObject As ucrSelectorByDataFrameAddRemove Friend WithEvents lblGetObject As Label Friend WithEvents ucrReceiverGetObject As ucrReceiverSingle - Friend WithEvents btnRemoveObjects As Button Friend WithEvents ucrPnlGetData As UcrPanel Friend WithEvents rdoGetDataFrame As RadioButton Friend WithEvents rdoGetColumn As RadioButton @@ -497,4 +510,6 @@ Partial Class dlgScript Friend WithEvents ucrCboSaveOutputObjectType As ucrInputComboBox Friend WithEvents lblSaveObjectFormat As Label Friend WithEvents ucrCboSaveOutputObjectFormat As ucrInputComboBox + Friend WithEvents lblFinallyRemoveObject As Label + Friend WithEvents ucrInputFinallyRemoveObject As ucrInputTextBox End Class diff --git a/instat/dlgScript.vb b/instat/dlgScript.vb index 6bc7138c219..b48bb03130d 100644 --- a/instat/dlgScript.vb +++ b/instat/dlgScript.vb @@ -78,8 +78,8 @@ Public Class dlgScript ucrCboSaveOutputObjectFormat.SetLinkedDisplayControl(lblSaveObjectFormat) ucrCboSaveOutputObjectFormat.GetSetSelectedIndex = 0 - ucrSaveData.SetSaveTypeAsGraph() - ucrSaveData.SetCheckBoxText("Save Graph") + + ucrSaveData.SetLabelText("Save Graph") ucrSaveData.SetIsComboBox() ucrSaveData.SetDataFrameSelector(ucrDataFrameSaveOutputSelect) @@ -242,8 +242,17 @@ Public Class dlgScript End Sub Private Sub SetupSaveDataControl(strLabel As String, strDataType As String, strFormat As String) - ucrSaveData.SetLabelText(strLabel & ":") + 'ucrSaveData.SetIsComboBox() ucrSaveData.SetSaveType(strDataType, strFormat) + ucrSaveData.SetLabelText(strLabel & ":") + ucrSaveData.SetName("") + + 'change location of the save control if it's the data frame option selected + ucrSaveData.Location = If(strDataType = RObjectTypeLabel.Dataframe, + New Point(185 - 100, ucrSaveData.Location.Y), + New Point(185, ucrSaveData.Location.Y)) + + End Sub Private Sub ucrSaveData_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSaveData.ControlContentsChanged @@ -251,6 +260,7 @@ Public Class dlgScript ' Exit Sub 'End If + ucrSaveData.UpdateRCode() Dim strAssignedScript As String = "" Dim strAssignedTo As String = clsSaveDataFunction.Clone.ToScript(strScript:=strAssignedScript) @@ -298,7 +308,7 @@ Public Class dlgScript ' AddAssignToString(ucrSaveGraph.GetText) 'End Sub - Private Sub btnRemoveObjects_Click(sender As Object, e As EventArgs) Handles btnRemoveObjects.Click + Private Sub btnRemoveObjects_Click(sender As Object, e As EventArgs) 'create function to remove the objects added in the script 'Dim clsRemoveFunc As New RFunction 'Dim clsRemoveListFun As New RFunction From 130d87c68ecec50a4ac50e10c9a0f3f7fc84c2fb Mon Sep 17 00:00:00 2001 From: patowhiz Date: Sun, 5 Nov 2023 18:14:07 +0300 Subject: [PATCH 04/27] more changes --- instat/dlgScript.Designer.vb | 82 +++++++++--------- instat/dlgScript.vb | 163 +++++++++++++---------------------- 2 files changed, 101 insertions(+), 144 deletions(-) diff --git a/instat/dlgScript.Designer.vb b/instat/dlgScript.Designer.vb index 90b77588e03..6a6d5f35af1 100644 --- a/instat/dlgScript.Designer.vb +++ b/instat/dlgScript.Designer.vb @@ -22,7 +22,7 @@ Partial Class dlgScript 'Do not modify it using the code editor. _ Private Sub InitializeComponent() - Me.TbFeatures = New System.Windows.Forms.TabControl() + Me.tbFeatures = New System.Windows.Forms.TabControl() Me.tbPageLibrary = New System.Windows.Forms.TabPage() Me.ucrCboLibPackage = New instat.ucrInputComboBox() Me.lblGetPackage = New System.Windows.Forms.Label() @@ -49,29 +49,29 @@ Partial Class dlgScript Me.ucrPnlGetData = New instat.UcrPanel() Me.ucrSelectorGetObject = New instat.ucrSelectorByDataFrameAddRemove() Me.tbPageFinally = New System.Windows.Forms.TabPage() + Me.lblRemoveObject = New System.Windows.Forms.Label() + Me.ucrInputRemoveObjects = New instat.ucrInputTextBox() Me.lblPreview = New System.Windows.Forms.Label() Me.txtScript = New System.Windows.Forms.TextBox() Me.ucrBase = New instat.ucrButtons() - Me.ucrInputFinallyRemoveObject = New instat.ucrInputTextBox() - Me.lblFinallyRemoveObject = New System.Windows.Forms.Label() - Me.TbFeatures.SuspendLayout() + Me.tbFeatures.SuspendLayout() Me.tbPageLibrary.SuspendLayout() Me.tbPageSaveData.SuspendLayout() Me.tbPageGetData.SuspendLayout() Me.tbPageFinally.SuspendLayout() Me.SuspendLayout() ' - 'TbFeatures + 'tbFeatures ' - Me.TbFeatures.Controls.Add(Me.tbPageLibrary) - Me.TbFeatures.Controls.Add(Me.tbPageSaveData) - Me.TbFeatures.Controls.Add(Me.tbPageGetData) - Me.TbFeatures.Controls.Add(Me.tbPageFinally) - Me.TbFeatures.Location = New System.Drawing.Point(8, 7) - Me.TbFeatures.Name = "TbFeatures" - Me.TbFeatures.SelectedIndex = 0 - Me.TbFeatures.Size = New System.Drawing.Size(446, 271) - Me.TbFeatures.TabIndex = 31 + Me.tbFeatures.Controls.Add(Me.tbPageLibrary) + Me.tbFeatures.Controls.Add(Me.tbPageSaveData) + Me.tbFeatures.Controls.Add(Me.tbPageGetData) + Me.tbFeatures.Controls.Add(Me.tbPageFinally) + Me.tbFeatures.Location = New System.Drawing.Point(8, 7) + Me.tbFeatures.Name = "tbFeatures" + Me.tbFeatures.SelectedIndex = 0 + Me.tbFeatures.Size = New System.Drawing.Size(446, 271) + Me.tbFeatures.TabIndex = 31 ' 'tbPageLibrary ' @@ -392,8 +392,8 @@ Partial Class dlgScript ' 'tbPageFinally ' - Me.tbPageFinally.Controls.Add(Me.lblFinallyRemoveObject) - Me.tbPageFinally.Controls.Add(Me.ucrInputFinallyRemoveObject) + Me.tbPageFinally.Controls.Add(Me.lblRemoveObject) + Me.tbPageFinally.Controls.Add(Me.ucrInputRemoveObjects) Me.tbPageFinally.Location = New System.Drawing.Point(4, 22) Me.tbPageFinally.Name = "tbPageFinally" Me.tbPageFinally.Size = New System.Drawing.Size(438, 245) @@ -401,6 +401,26 @@ Partial Class dlgScript Me.tbPageFinally.Text = "Finally" Me.tbPageFinally.UseVisualStyleBackColor = True ' + 'lblRemoveObject + ' + Me.lblRemoveObject.AutoSize = True + Me.lblRemoveObject.Location = New System.Drawing.Point(14, 14) + Me.lblRemoveObject.Name = "lblRemoveObject" + Me.lblRemoveObject.Size = New System.Drawing.Size(95, 13) + Me.lblRemoveObject.TabIndex = 3 + Me.lblRemoveObject.Text = "Remove Object(s):" + ' + 'ucrInputRemoveObjects + ' + Me.ucrInputRemoveObjects.AddQuotesIfUnrecognised = True + Me.ucrInputRemoveObjects.AutoSize = True + Me.ucrInputRemoveObjects.IsMultiline = False + Me.ucrInputRemoveObjects.IsReadOnly = False + Me.ucrInputRemoveObjects.Location = New System.Drawing.Point(17, 30) + Me.ucrInputRemoveObjects.Name = "ucrInputRemoveObjects" + Me.ucrInputRemoveObjects.Size = New System.Drawing.Size(197, 21) + Me.ucrInputRemoveObjects.TabIndex = 2 + ' 'lblPreview ' Me.lblPreview.AutoSize = True @@ -430,26 +450,6 @@ Partial Class dlgScript Me.ucrBase.Size = New System.Drawing.Size(408, 52) Me.ucrBase.TabIndex = 16 ' - 'ucrInputFinallyRemoveObject - ' - Me.ucrInputFinallyRemoveObject.AddQuotesIfUnrecognised = True - Me.ucrInputFinallyRemoveObject.AutoSize = True - Me.ucrInputFinallyRemoveObject.IsMultiline = False - Me.ucrInputFinallyRemoveObject.IsReadOnly = False - Me.ucrInputFinallyRemoveObject.Location = New System.Drawing.Point(17, 30) - Me.ucrInputFinallyRemoveObject.Name = "ucrInputFinallyRemoveObject" - Me.ucrInputFinallyRemoveObject.Size = New System.Drawing.Size(197, 21) - Me.ucrInputFinallyRemoveObject.TabIndex = 2 - ' - 'lblFinallyRemoveObject - ' - Me.lblFinallyRemoveObject.AutoSize = True - Me.lblFinallyRemoveObject.Location = New System.Drawing.Point(14, 14) - Me.lblFinallyRemoveObject.Name = "lblFinallyRemoveObject" - Me.lblFinallyRemoveObject.Size = New System.Drawing.Size(95, 13) - Me.lblFinallyRemoveObject.TabIndex = 3 - Me.lblFinallyRemoveObject.Text = "Remove Object(s):" - ' 'dlgScript ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) @@ -458,7 +458,7 @@ Partial Class dlgScript Me.ClientSize = New System.Drawing.Size(458, 458) Me.Controls.Add(Me.txtScript) Me.Controls.Add(Me.lblPreview) - Me.Controls.Add(Me.TbFeatures) + Me.Controls.Add(Me.tbFeatures) Me.Controls.Add(Me.ucrBase) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.MaximizeBox = False @@ -466,7 +466,7 @@ Partial Class dlgScript Me.Name = "dlgScript" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Script" - Me.TbFeatures.ResumeLayout(False) + Me.tbFeatures.ResumeLayout(False) Me.tbPageLibrary.ResumeLayout(False) Me.tbPageLibrary.PerformLayout() Me.tbPageSaveData.ResumeLayout(False) @@ -482,7 +482,7 @@ Partial Class dlgScript Friend WithEvents ucrBase As ucrButtons Friend WithEvents ucrDataFrameGetDF As ucrDataFrame - Friend WithEvents TbFeatures As TabControl + Friend WithEvents tbFeatures As TabControl Friend WithEvents tbPageGetData As TabPage Friend WithEvents tbPageSaveData As TabPage Friend WithEvents lblPreview As Label @@ -510,6 +510,6 @@ Partial Class dlgScript Friend WithEvents ucrCboSaveOutputObjectType As ucrInputComboBox Friend WithEvents lblSaveObjectFormat As Label Friend WithEvents ucrCboSaveOutputObjectFormat As ucrInputComboBox - Friend WithEvents lblFinallyRemoveObject As Label - Friend WithEvents ucrInputFinallyRemoveObject As ucrInputTextBox + Friend WithEvents lblRemoveObject As Label + Friend WithEvents ucrInputRemoveObjects As ucrInputTextBox End Class diff --git a/instat/dlgScript.vb b/instat/dlgScript.vb index b48bb03130d..fa54c18c418 100644 --- a/instat/dlgScript.vb +++ b/instat/dlgScript.vb @@ -19,7 +19,6 @@ Imports instat.Translations Public Class dlgScript Private strComment As String = "Code generated by the dialog, Script" Private bFirstload As Boolean = True - Private bReset As Boolean = True Private clsSaveDataFunction As New RFunction Private dctOutputObjectTypes As New Dictionary(Of String, String) Private dctOutputObjectFormats As New Dictionary(Of String, String) @@ -27,23 +26,15 @@ Public Class dlgScript Private Sub dlgScript_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstload Then InitialiseDialog() - bFirstload = False - End If - If bReset Then SetDefaults() + bFirstload = False End If - SetRCodeForControls(bReset) - bReset = False autoTranslate(Me) End Sub Private Sub InitialiseDialog() - 'todo. the iCallType will probably be dynamic - 'ucrBase.clsRsyntax.iCallType = 2 - 'ucrBase.clsRsyntax.bSeparateThread = False - - 'dctOutputObjectTypes.Add("Objects", "object") + ' Supported output object types and formats dctOutputObjectTypes.Add("Summary", RObjectTypeLabel.Summary) dctOutputObjectTypes.Add("Table", RObjectTypeLabel.Table) dctOutputObjectTypes.Add("Graph", RObjectTypeLabel.Graph) @@ -57,7 +48,7 @@ Public Class dlgScript '-------------------------------- ' Library controls - 'todo. this combobox can be a custom package control in future. Its also needed in dlgHelpVignettes + 'todo. this combo box can be a custom package control in future. Its also needed in dlgHelpVignettes ucrCboLibPackage.SetParameter(New RParameter("package", 0)) ucrCboLibPackage.SetItems(GetPackages(), bAddConditions:=True) ucrCboLibPackage.SetDropDownStyleAsNonEditable() @@ -104,12 +95,12 @@ Public Class dlgScript ucrReceiverGetObject.SetLinkedDisplayControl(lblGetObject) '------------------------------- - ' Hide base button comment controls + ' Hide base controls not supported in this dialog ucrBase.chkComment.Checked = False ucrBase.chkComment.Visible = False ucrBase.txtComment.Visible = False - + ucrBase.cmdOk.Visible = False End Sub @@ -129,33 +120,30 @@ Public Class dlgScript Private Sub SetDefaults() - ' Library controls - ucrCboLibPackage.Reset() + 'Finally controls + ucrInputRemoveObjects.Reset() ' Save controls reset + ucrSaveData.SetRCode(clsSaveDataFunction, True) + ucrSaveData.Reset() rdoSaveDataFrame.Checked = True ucrDataFrameSaveOutputSelect.Reset() - ucrSaveData.Reset() - ' Get controls + ' Get controls reset + ucrSelectorGetObject.Reset() + ucrCboGetOutputObjectType.GetSetSelectedIndex = 0 ucrDataFrameGetDF.Reset() rdoGetDataFrame.Checked = True - ucrCboGetOutputObjectType.GetSetSelectedIndex = 0 - ucrSelectorGetObject.Reset() - - - ' Script text control reset - 'txtScript.Text = "# Code generated by the dialog, Script" & Environment.NewLine - - 'ucrBase.clsRsyntax.SetBaseRFunction(clsGetDataObjectFunction) - End Sub + ' Library controls + ucrCboLibPackage.GetSetSelectedIndex = 0 + 'activate the selected tab to library tab + tbFeatures.SelectedIndex = -1 + tbFeatures.SelectedTab = tbPageLibrary - Private Sub SetRCodeForControls(bReset As Boolean) - ucrSaveData.SetRCode(clsSaveDataFunction, bReset) End Sub Private Sub ucrCboLibPackage_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrCboLibPackage.ControlContentsChanged @@ -170,6 +158,7 @@ Public Class dlgScript ucrCboGetOutputObjectType.SetVisible(False) ucrSelectorGetObject.SetVisible(False) ucrReceiverGetObject.SetVisible(False) + PreviewScript("") If rdoGetDataFrame.Checked Then ucrDataFrameGetDF.SetVisible(True) ucrReceiverGetObject.SetVisible(False) @@ -196,7 +185,7 @@ Public Class dlgScript Private Sub ucrDataFrameGet_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrDataFrameGetDF.ControlContentsChanged Dim strAssignedScript As String = "" - Dim strAssignedTo As String = ucrDataFrameGetDF.clsCurrDataFrame.Clone().ToScript(strAssignedScript) + ucrDataFrameGetDF.clsCurrDataFrame.Clone().ToScript(strAssignedScript) PreviewScript(strAssignedScript) End Sub @@ -207,13 +196,9 @@ Public Class dlgScript End Sub Private Sub ucrReceiverGet_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverGetObject.ControlContentsChanged - 'If ucrReceiverGet.IsEmpty Then - ' Exit Sub - 'End If - Dim clsFunction As RFunction = ucrReceiverGetObject.GetVariables() Dim strAssignedScript As String = "" - Dim strAssignedTo As String = clsFunction.ToScript(strScript:=strAssignedScript) + clsFunction.ToScript(strScript:=strAssignedScript) PreviewScript(strAssignedScript) End Sub @@ -242,84 +227,49 @@ Public Class dlgScript End Sub Private Sub SetupSaveDataControl(strLabel As String, strDataType As String, strFormat As String) - 'ucrSaveData.SetIsComboBox() + ucrSaveData.SetSaveType(strDataType, strFormat) - ucrSaveData.SetLabelText(strLabel & ":") + ucrSaveData.SetLabelText(strLabel & "Name:") ucrSaveData.SetName("") 'change location of the save control if it's the data frame option selected - ucrSaveData.Location = If(strDataType = RObjectTypeLabel.Dataframe, - New Point(185 - 100, ucrSaveData.Location.Y), - New Point(185, ucrSaveData.Location.Y)) - + If strDataType = RObjectTypeLabel.Dataframe Then + ucrSaveData.Location = New Point(185 - 100, ucrSaveData.Location.Y) + ucrSaveData.SetIsComboBox() + Else + ucrSaveData.Location = New Point(185, ucrSaveData.Location.Y) + ucrSaveData.SetIsTextBox() + If strDataType = RObjectTypeLabel.Column Then + ucrSaveData.btnColumnPosition.Visible = False + End If + End If End Sub Private Sub ucrSaveData_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSaveData.ControlContentsChanged - 'If ucrReceiverGet.IsEmpty Then - ' Exit Sub - 'End If + ' R code is not automatiucally updated by save control when control contents changed event is raised by the control ucrSaveData.UpdateRCode() Dim strAssignedScript As String = "" - Dim strAssignedTo As String = clsSaveDataFunction.Clone.ToScript(strScript:=strAssignedScript) + clsSaveDataFunction.Clone.ToScript(strScript:=strAssignedScript) PreviewScript(strAssignedScript) End Sub - 'Private Sub btnSaveNewDataframe_Click(sender As Object, e As EventArgs) - ' If ucrInputSaveDataFrame.IsEmpty Then - ' Exit Sub - ' End If - - ' Dim clsImportNewDataFrame As New RFunction - ' Dim clsRFunctionList As New RFunction - - ' clsImportNewDataFrame.SetRCommand("data_book$import_data") - - ' clsRFunctionList.SetRCommand("list") - ' clsRFunctionList.AddParameter(ucrInputSaveDataFrame.GetText(), ucrInputSaveDataFrame.GetText()) - ' clsImportNewDataFrame.AddParameter("data_tables", clsRFunctionList.ToScript) - - ' PreviewScript(ucrInputSaveDataFrame.GetText() & "<-" & Environment.NewLine & clsImportNewDataFrame.ToScript) - 'End Sub - - 'Private Sub btnSaveNewColumn_Click(sender As Object, e As EventArgs) - ' If Not ucrSaveData.IsComplete Then - ' Exit Sub - ' End If - - ' Dim strAssignedScript As String = "" - ' 'clone the function first because the ToScript function modifies the contents of the function. - ' Dim strAssignedTo As String = clsSaveColumnFunction.Clone.ToScript(strScript:=strAssignedScript) - ' PreviewScript(strAssignedScript) - ' AddAssignToString(ucrSaveData.GetText) - 'End Sub - - 'Private Sub btnSaveNewGraph_Click(sender As Object, e As EventArgs) - ' If Not ucrSaveGraph.IsComplete Then - ' Exit Sub - ' End If - - ' Dim strAssignedScript As String = "" - ' 'clone the function first because the ToScript function modifies the contents of the function. - ' Dim strGetScript As String = clsSaveGraphFunction.Clone.ToScript(strScript:=strAssignedScript) - ' PreviewScript(strAssignedScript.Trim & Environment.NewLine & strGetScript) - ' AddAssignToString(ucrSaveGraph.GetText) - 'End Sub - - Private Sub btnRemoveObjects_Click(sender As Object, e As EventArgs) + Private Sub ucrInputRemoveObject_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputRemoveObjects.ControlContentsChanged 'create function to remove the objects added in the script - 'Dim clsRemoveFunc As New RFunction - 'Dim clsRemoveListFun As New RFunction - 'clsRemoveFunc.SetRCommand("rm") - 'clsRemoveListFun.SetRCommand("c") - 'For i As Integer = 0 To lstAssignToStrings.Count - 1 - ' clsRemoveListFun.AddParameter(i, Chr(34) & lstAssignToStrings(i) & Chr(34), bIncludeArgumentName:=False) - 'Next - 'clsRemoveFunc.AddParameter("list", clsRFunctionParameter:=clsRemoveListFun) - - 'PreviewScript(clsRemoveFunc.ToScript()) + Dim lstAssignToStrings As String() = ucrInputRemoveObjects.GetText().Split(",") + Dim clsRemoveFunc As New RFunction + Dim clsRemoveListFun As New RFunction + clsRemoveFunc.SetRCommand("rm") + clsRemoveListFun.SetRCommand("c") + + For i As Integer = 0 To lstAssignToStrings.Count - 1 + clsRemoveListFun.AddParameter(i, Chr(34) & lstAssignToStrings(i) & Chr(34), bIncludeArgumentName:=False) + Next + clsRemoveFunc.AddParameter("list", clsRFunctionParameter:=clsRemoveListFun) + + PreviewScript(clsRemoveFunc.ToScript()) End Sub Private Sub txtScript_TextChanged(sender As Object, e As EventArgs) Handles txtScript.TextChanged @@ -329,11 +279,6 @@ Public Class dlgScript Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset SetDefaults() - SetRCodeForControls(True) - End Sub - - Private Sub ucrBase_ClickOk(sender As Object, e As EventArgs) Handles ucrBase.ClickOk - frmMain.clsRLink.RunScriptFromWindow(strNewScript:=txtScript.Text, strNewComment:=strComment) End Sub Private Sub PreviewScript(strNewScript As String) @@ -343,6 +288,18 @@ Public Class dlgScript txtScript.Refresh() End Sub - + Private Sub TbFeatures_Selected(sender As Object, e As TabControlEventArgs) Handles tbFeatures.Selected + If e.TabPage Is tbPageLibrary Then + ucrCboLibPackage.OnControlContentsChanged() + ElseIf e.TabPage Is tbPageGetData Then + rdoGetDataFrame.Checked = True + ucrPnlGetData.OnControlValueChanged() + ElseIf e.TabPage Is tbPageSaveData Then + rdoSaveDataFrame.Checked = True + ucrPnlSaveData.OnControlValueChanged() + ElseIf e.TabPage Is tbPageFinally Then + ucrInputRemoveObjects.OnControlContentsChanged() + End If + End Sub End Class \ No newline at end of file From d2a6b257148b304fe666262ea9b59c153d82a031 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Sun, 5 Nov 2023 18:42:10 +0300 Subject: [PATCH 05/27] more changes --- instat/dlgScript.Designer.vb | 14 +++++++------- instat/dlgScript.vb | 16 +++++++--------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/instat/dlgScript.Designer.vb b/instat/dlgScript.Designer.vb index 6a6d5f35af1..d5688320c99 100644 --- a/instat/dlgScript.Designer.vb +++ b/instat/dlgScript.Designer.vb @@ -126,7 +126,7 @@ Partial Class dlgScript 'lblSaveObjectFormat ' Me.lblSaveObjectFormat.AutoSize = True - Me.lblSaveObjectFormat.Location = New System.Drawing.Point(16, 145) + Me.lblSaveObjectFormat.Location = New System.Drawing.Point(116, 145) Me.lblSaveObjectFormat.Name = "lblSaveObjectFormat" Me.lblSaveObjectFormat.Size = New System.Drawing.Size(42, 13) Me.lblSaveObjectFormat.TabIndex = 56 @@ -138,7 +138,7 @@ Partial Class dlgScript Me.ucrCboSaveOutputObjectFormat.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrCboSaveOutputObjectFormat.GetSetSelectedIndex = -1 Me.ucrCboSaveOutputObjectFormat.IsReadOnly = False - Me.ucrCboSaveOutputObjectFormat.Location = New System.Drawing.Point(18, 160) + Me.ucrCboSaveOutputObjectFormat.Location = New System.Drawing.Point(117, 160) Me.ucrCboSaveOutputObjectFormat.Margin = New System.Windows.Forms.Padding(9) Me.ucrCboSaveOutputObjectFormat.Name = "ucrCboSaveOutputObjectFormat" Me.ucrCboSaveOutputObjectFormat.Size = New System.Drawing.Size(141, 21) @@ -147,7 +147,7 @@ Partial Class dlgScript 'lblSaveObjectType ' Me.lblSaveObjectType.AutoSize = True - Me.lblSaveObjectType.Location = New System.Drawing.Point(13, 101) + Me.lblSaveObjectType.Location = New System.Drawing.Point(114, 101) Me.lblSaveObjectType.Name = "lblSaveObjectType" Me.lblSaveObjectType.Size = New System.Drawing.Size(34, 13) Me.lblSaveObjectType.TabIndex = 54 @@ -159,7 +159,7 @@ Partial Class dlgScript Me.ucrCboSaveOutputObjectType.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrCboSaveOutputObjectType.GetSetSelectedIndex = -1 Me.ucrCboSaveOutputObjectType.IsReadOnly = False - Me.ucrCboSaveOutputObjectType.Location = New System.Drawing.Point(15, 116) + Me.ucrCboSaveOutputObjectType.Location = New System.Drawing.Point(116, 116) Me.ucrCboSaveOutputObjectType.Margin = New System.Windows.Forms.Padding(9) Me.ucrCboSaveOutputObjectType.Name = "ucrCboSaveOutputObjectType" Me.ucrCboSaveOutputObjectType.Size = New System.Drawing.Size(144, 21) @@ -219,10 +219,10 @@ Partial Class dlgScript 'ucrSaveData ' Me.ucrSaveData.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrSaveData.Location = New System.Drawing.Point(185, 70) + Me.ucrSaveData.Location = New System.Drawing.Point(117, 193) Me.ucrSaveData.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.ucrSaveData.Name = "ucrSaveData" - Me.ucrSaveData.Size = New System.Drawing.Size(230, 22) + Me.ucrSaveData.Size = New System.Drawing.Size(258, 22) Me.ucrSaveData.TabIndex = 35 ' 'ucrDataFrameSaveOutputSelect @@ -230,7 +230,7 @@ Partial Class dlgScript Me.ucrDataFrameSaveOutputSelect.AutoSize = True Me.ucrDataFrameSaveOutputSelect.bDropUnusedFilterLevels = False Me.ucrDataFrameSaveOutputSelect.bUseCurrentFilter = True - Me.ucrDataFrameSaveOutputSelect.Location = New System.Drawing.Point(14, 54) + Me.ucrDataFrameSaveOutputSelect.Location = New System.Drawing.Point(115, 54) Me.ucrDataFrameSaveOutputSelect.Margin = New System.Windows.Forms.Padding(0) Me.ucrDataFrameSaveOutputSelect.Name = "ucrDataFrameSaveOutputSelect" Me.ucrDataFrameSaveOutputSelect.Size = New System.Drawing.Size(151, 50) diff --git a/instat/dlgScript.vb b/instat/dlgScript.vb index fa54c18c418..08a8193c81f 100644 --- a/instat/dlgScript.vb +++ b/instat/dlgScript.vb @@ -210,7 +210,6 @@ Public Class dlgScript SetupSaveDataControl("Data Frame", RObjectTypeLabel.Dataframe, "") ElseIf rdoSaveColumn.Checked Then ucrDataFrameSaveOutputSelect.SetVisible(True) - ucrCboSaveOutputObjectType.SetVisible(True) SetupSaveDataControl("Column", RObjectTypeLabel.Column, "") ElseIf rdoSaveOutputObject.Checked Then ucrDataFrameSaveOutputSelect.SetVisible(True) @@ -229,19 +228,18 @@ Public Class dlgScript Private Sub SetupSaveDataControl(strLabel As String, strDataType As String, strFormat As String) ucrSaveData.SetSaveType(strDataType, strFormat) - ucrSaveData.SetLabelText(strLabel & "Name:") + ucrSaveData.SetLabelText(strLabel) ucrSaveData.SetName("") 'change location of the save control if it's the data frame option selected If strDataType = RObjectTypeLabel.Dataframe Then - ucrSaveData.Location = New Point(185 - 100, ucrSaveData.Location.Y) - ucrSaveData.SetIsComboBox() - Else - ucrSaveData.Location = New Point(185, ucrSaveData.Location.Y) + ucrSaveData.Location = New Point(ucrSaveData.Location.X, ucrDataFrameSaveOutputSelect.Location.Y) ucrSaveData.SetIsTextBox() - If strDataType = RObjectTypeLabel.Column Then - ucrSaveData.btnColumnPosition.Visible = False - End If + Else + ucrSaveData.SetIsComboBox() + ucrSaveData.Location = If(strDataType = RObjectTypeLabel.Column, + New Point(ucrSaveData.Location.X, ucrCboSaveOutputObjectType.Location.Y), + New Point(ucrSaveData.Location.X, ucrCboSaveOutputObjectFormat.Location.Y + 33)) End If End Sub From 660ba311489bf8bca7e4aa55a717ec3bd4d6e63b Mon Sep 17 00:00:00 2001 From: patowhiz Date: Sun, 5 Nov 2023 18:44:11 +0300 Subject: [PATCH 06/27] more changes --- instat/dlgScript.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/dlgScript.vb b/instat/dlgScript.vb index 08a8193c81f..199035bd9f7 100644 --- a/instat/dlgScript.vb +++ b/instat/dlgScript.vb @@ -233,8 +233,8 @@ Public Class dlgScript 'change location of the save control if it's the data frame option selected If strDataType = RObjectTypeLabel.Dataframe Then - ucrSaveData.Location = New Point(ucrSaveData.Location.X, ucrDataFrameSaveOutputSelect.Location.Y) ucrSaveData.SetIsTextBox() + ucrSaveData.Location = New Point(ucrSaveData.Location.X, ucrDataFrameSaveOutputSelect.Location.Y) Else ucrSaveData.SetIsComboBox() ucrSaveData.Location = If(strDataType = RObjectTypeLabel.Column, From 3e5a6ed4c9653bd524161d7d08b03f0888608705 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Sun, 5 Nov 2023 18:59:59 +0300 Subject: [PATCH 07/27] more changes --- instat/dlgScript.Designer.vb | 24 +++++++++--------------- instat/dlgScript.vb | 8 -------- 2 files changed, 9 insertions(+), 23 deletions(-) diff --git a/instat/dlgScript.Designer.vb b/instat/dlgScript.Designer.vb index c965b36165a..1507da9d9c9 100644 --- a/instat/dlgScript.Designer.vb +++ b/instat/dlgScript.Designer.vb @@ -190,10 +190,9 @@ Partial Class dlgScript Me.rdoSaveDataFrame.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption Me.rdoSaveDataFrame.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.rdoSaveDataFrame.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoSaveDataFrame.Location = New System.Drawing.Point(118, 21) - Me.rdoSaveDataFrame.Margin = New System.Windows.Forms.Padding(4) + Me.rdoSaveDataFrame.Location = New System.Drawing.Point(79, 14) Me.rdoSaveDataFrame.Name = "rdoSaveDataFrame" - Me.rdoSaveDataFrame.Size = New System.Drawing.Size(120, 45) + Me.rdoSaveDataFrame.Size = New System.Drawing.Size(80, 30) Me.rdoSaveDataFrame.TabIndex = 49 Me.rdoSaveDataFrame.TabStop = True Me.rdoSaveDataFrame.Text = "Data Frame" @@ -208,10 +207,9 @@ Partial Class dlgScript Me.rdoSaveColumn.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption Me.rdoSaveColumn.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.rdoSaveColumn.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoSaveColumn.Location = New System.Drawing.Point(236, 21) - Me.rdoSaveColumn.Margin = New System.Windows.Forms.Padding(4) + Me.rdoSaveColumn.Location = New System.Drawing.Point(157, 14) Me.rdoSaveColumn.Name = "rdoSaveColumn" - Me.rdoSaveColumn.Size = New System.Drawing.Size(120, 45) + Me.rdoSaveColumn.Size = New System.Drawing.Size(80, 30) Me.rdoSaveColumn.TabIndex = 50 Me.rdoSaveColumn.TabStop = True Me.rdoSaveColumn.Text = "Column" @@ -241,10 +239,9 @@ Partial Class dlgScript 'ucrPnlSaveData ' Me.ucrPnlSaveData.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlSaveData.Location = New System.Drawing.Point(20, 18) - Me.ucrPnlSaveData.Margin = New System.Windows.Forms.Padding(9) + Me.ucrPnlSaveData.Location = New System.Drawing.Point(13, 12) Me.ucrPnlSaveData.Name = "ucrPnlSaveData" - Me.ucrPnlSaveData.Size = New System.Drawing.Size(603, 54) + Me.ucrPnlSaveData.Size = New System.Drawing.Size(402, 36) Me.ucrPnlSaveData.TabIndex = 47 ' 'tbPageGetData @@ -455,7 +452,7 @@ Partial Class dlgScript ' 'dlgScript ' - 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.ClientSize = New System.Drawing.Size(458, 458) @@ -463,11 +460,7 @@ Partial Class dlgScript Me.Controls.Add(Me.lblPreview) Me.Controls.Add(Me.tbFeatures) Me.Controls.Add(Me.ucrBase) - Me.Controls.Add(Me.TabControl1) - Me.Controls.Add(Me.ucrChkEditLibrary) - Me.Controls.Add(Me.ucrInputPreviewLibrary) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow - Me.Margin = New System.Windows.Forms.Padding(4) Me.MaximizeBox = False Me.MinimizeBox = False Me.Name = "dlgScript" @@ -486,7 +479,8 @@ Partial Class dlgScript Me.PerformLayout() End Sub - Friend WithEvents ucrBase As ucrButtons + + Friend WithEvents ucrBase As ucrButtons Friend WithEvents ucrDataFrameGetDF As ucrDataFrame Friend WithEvents tbFeatures As TabControl Friend WithEvents tbPageGetData As TabPage diff --git a/instat/dlgScript.vb b/instat/dlgScript.vb index 2eceba01bd2..199035bd9f7 100644 --- a/instat/dlgScript.vb +++ b/instat/dlgScript.vb @@ -19,12 +19,10 @@ Imports instat.Translations Public Class dlgScript Private strComment As String = "Code generated by the dialog, Script" Private bFirstload As Boolean = True - Private clsSaveDataFunction As New RFunction Private dctOutputObjectTypes As New Dictionary(Of String, String) Private dctOutputObjectFormats As New Dictionary(Of String, String) - Private Sub dlgScript_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstload Then InitialiseDialog() @@ -99,13 +97,11 @@ Public Class dlgScript '------------------------------- ' Hide base controls not supported in this dialog - ucrBase.chkComment.Checked = False ucrBase.chkComment.Visible = False ucrBase.txtComment.Visible = False ucrBase.cmdOk.Visible = False - End Sub 'todo. this function should eventually be removed once we have a control that displays packages @@ -244,10 +240,7 @@ Public Class dlgScript ucrSaveData.Location = If(strDataType = RObjectTypeLabel.Column, New Point(ucrSaveData.Location.X, ucrCboSaveOutputObjectType.Location.Y), New Point(ucrSaveData.Location.X, ucrCboSaveOutputObjectFormat.Location.Y + 33)) - End If - End Sub - End Sub @@ -305,7 +298,6 @@ Public Class dlgScript ElseIf e.TabPage Is tbPageFinally Then ucrInputRemoveObjects.OnControlContentsChanged() End If - End Sub End Class \ No newline at end of file From 644b556f4dca27ad5b3ab968b91799110702d992 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Mon, 6 Nov 2023 10:30:57 +0300 Subject: [PATCH 08/27] more changes --- instat/dlgScript.Designer.vb | 228 ++++++++++++++++++++--------------- instat/dlgScript.vb | 147 +++++++++++----------- instat/ucrScript.vb | 2 +- 3 files changed, 209 insertions(+), 168 deletions(-) diff --git a/instat/dlgScript.Designer.vb b/instat/dlgScript.Designer.vb index 1507da9d9c9..4f0d1c931c2 100644 --- a/instat/dlgScript.Designer.vb +++ b/instat/dlgScript.Designer.vb @@ -23,9 +23,6 @@ Partial Class dlgScript Private Sub InitializeComponent() Me.tbFeatures = New System.Windows.Forms.TabControl() - Me.tbPageLibrary = New System.Windows.Forms.TabPage() - Me.ucrCboLibPackage = New instat.ucrInputComboBox() - Me.lblGetPackage = New System.Windows.Forms.Label() Me.tbPageSaveData = New System.Windows.Forms.TabPage() Me.lblSaveObjectFormat = New System.Windows.Forms.Label() Me.ucrCboSaveOutputObjectFormat = New instat.ucrInputComboBox() @@ -38,72 +35,45 @@ Partial Class dlgScript Me.ucrDataFrameSaveOutputSelect = New instat.ucrDataFrame() Me.ucrPnlSaveData = New instat.UcrPanel() Me.tbPageGetData = New System.Windows.Forms.TabPage() + Me.lblGetColumn = New System.Windows.Forms.Label() + Me.ucrReceiverGetOutputObject = New instat.ucrReceiverSingle() + Me.ucrReceiverGetColumns = New instat.ucrReceiverMultiple() Me.ucrDataFrameGetDF = New instat.ucrDataFrame() Me.lblGetObjectType = New System.Windows.Forms.Label() Me.ucrCboGetOutputObjectType = New instat.ucrInputComboBox() Me.rdoGetOutputObject = New System.Windows.Forms.RadioButton() - Me.lblGetObject = New System.Windows.Forms.Label() - Me.ucrReceiverGetObject = New instat.ucrReceiverSingle() + Me.lblGetOutputObject = New System.Windows.Forms.Label() Me.rdoGetDataFrame = New System.Windows.Forms.RadioButton() Me.rdoGetColumn = New System.Windows.Forms.RadioButton() Me.ucrPnlGetData = New instat.UcrPanel() Me.ucrSelectorGetObject = New instat.ucrSelectorByDataFrameAddRemove() - Me.tbPageFinally = New System.Windows.Forms.TabPage() + Me.tbPageCommon = New System.Windows.Forms.TabPage() + Me.ucrCboLibPackage = New instat.ucrInputComboBox() + Me.lblGetPackage = New System.Windows.Forms.Label() Me.lblRemoveObject = New System.Windows.Forms.Label() Me.ucrInputRemoveObjects = New instat.ucrInputTextBox() + Me.tbPageLibrary = New System.Windows.Forms.TabPage() Me.lblPreview = New System.Windows.Forms.Label() Me.txtScript = New System.Windows.Forms.TextBox() Me.ucrBase = New instat.ucrButtons() Me.tbFeatures.SuspendLayout() - Me.tbPageLibrary.SuspendLayout() Me.tbPageSaveData.SuspendLayout() Me.tbPageGetData.SuspendLayout() - Me.tbPageFinally.SuspendLayout() + Me.tbPageCommon.SuspendLayout() Me.SuspendLayout() ' 'tbFeatures ' - Me.tbFeatures.Controls.Add(Me.tbPageLibrary) Me.tbFeatures.Controls.Add(Me.tbPageSaveData) Me.tbFeatures.Controls.Add(Me.tbPageGetData) - Me.tbFeatures.Controls.Add(Me.tbPageFinally) + Me.tbFeatures.Controls.Add(Me.tbPageCommon) + Me.tbFeatures.Controls.Add(Me.tbPageLibrary) Me.tbFeatures.Location = New System.Drawing.Point(8, 7) Me.tbFeatures.Name = "tbFeatures" Me.tbFeatures.SelectedIndex = 0 Me.tbFeatures.Size = New System.Drawing.Size(446, 271) Me.tbFeatures.TabIndex = 31 ' - 'tbPageLibrary - ' - Me.tbPageLibrary.Controls.Add(Me.ucrCboLibPackage) - Me.tbPageLibrary.Controls.Add(Me.lblGetPackage) - Me.tbPageLibrary.Location = New System.Drawing.Point(4, 22) - Me.tbPageLibrary.Name = "tbPageLibrary" - Me.tbPageLibrary.Size = New System.Drawing.Size(438, 245) - Me.tbPageLibrary.TabIndex = 4 - Me.tbPageLibrary.Text = "Library" - Me.tbPageLibrary.UseVisualStyleBackColor = True - ' - 'ucrCboLibPackage - ' - Me.ucrCboLibPackage.AddQuotesIfUnrecognised = True - Me.ucrCboLibPackage.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrCboLibPackage.GetSetSelectedIndex = -1 - Me.ucrCboLibPackage.IsReadOnly = False - Me.ucrCboLibPackage.Location = New System.Drawing.Point(14, 30) - Me.ucrCboLibPackage.Name = "ucrCboLibPackage" - Me.ucrCboLibPackage.Size = New System.Drawing.Size(137, 21) - Me.ucrCboLibPackage.TabIndex = 42 - ' - 'lblGetPackage - ' - Me.lblGetPackage.AutoSize = True - Me.lblGetPackage.Location = New System.Drawing.Point(11, 14) - Me.lblGetPackage.Name = "lblGetPackage" - Me.lblGetPackage.Size = New System.Drawing.Size(73, 13) - Me.lblGetPackage.TabIndex = 41 - Me.lblGetPackage.Text = "Get Package:" - ' 'tbPageSaveData ' Me.tbPageSaveData.Controls.Add(Me.lblSaveObjectFormat) @@ -126,7 +96,7 @@ Partial Class dlgScript 'lblSaveObjectFormat ' Me.lblSaveObjectFormat.AutoSize = True - Me.lblSaveObjectFormat.Location = New System.Drawing.Point(116, 145) + Me.lblSaveObjectFormat.Location = New System.Drawing.Point(87, 145) Me.lblSaveObjectFormat.Name = "lblSaveObjectFormat" Me.lblSaveObjectFormat.Size = New System.Drawing.Size(42, 13) Me.lblSaveObjectFormat.TabIndex = 56 @@ -138,7 +108,7 @@ Partial Class dlgScript Me.ucrCboSaveOutputObjectFormat.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrCboSaveOutputObjectFormat.GetSetSelectedIndex = -1 Me.ucrCboSaveOutputObjectFormat.IsReadOnly = False - Me.ucrCboSaveOutputObjectFormat.Location = New System.Drawing.Point(117, 160) + Me.ucrCboSaveOutputObjectFormat.Location = New System.Drawing.Point(88, 160) Me.ucrCboSaveOutputObjectFormat.Margin = New System.Windows.Forms.Padding(9) Me.ucrCboSaveOutputObjectFormat.Name = "ucrCboSaveOutputObjectFormat" Me.ucrCboSaveOutputObjectFormat.Size = New System.Drawing.Size(141, 21) @@ -147,7 +117,7 @@ Partial Class dlgScript 'lblSaveObjectType ' Me.lblSaveObjectType.AutoSize = True - Me.lblSaveObjectType.Location = New System.Drawing.Point(114, 101) + Me.lblSaveObjectType.Location = New System.Drawing.Point(85, 101) Me.lblSaveObjectType.Name = "lblSaveObjectType" Me.lblSaveObjectType.Size = New System.Drawing.Size(34, 13) Me.lblSaveObjectType.TabIndex = 54 @@ -159,7 +129,7 @@ Partial Class dlgScript Me.ucrCboSaveOutputObjectType.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrCboSaveOutputObjectType.GetSetSelectedIndex = -1 Me.ucrCboSaveOutputObjectType.IsReadOnly = False - Me.ucrCboSaveOutputObjectType.Location = New System.Drawing.Point(116, 116) + Me.ucrCboSaveOutputObjectType.Location = New System.Drawing.Point(87, 116) Me.ucrCboSaveOutputObjectType.Margin = New System.Windows.Forms.Padding(9) Me.ucrCboSaveOutputObjectType.Name = "ucrCboSaveOutputObjectType" Me.ucrCboSaveOutputObjectType.Size = New System.Drawing.Size(144, 21) @@ -219,7 +189,7 @@ Partial Class dlgScript 'ucrSaveData ' Me.ucrSaveData.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrSaveData.Location = New System.Drawing.Point(117, 193) + Me.ucrSaveData.Location = New System.Drawing.Point(88, 193) Me.ucrSaveData.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.ucrSaveData.Name = "ucrSaveData" Me.ucrSaveData.Size = New System.Drawing.Size(258, 22) @@ -230,28 +200,31 @@ Partial Class dlgScript Me.ucrDataFrameSaveOutputSelect.AutoSize = True Me.ucrDataFrameSaveOutputSelect.bDropUnusedFilterLevels = False Me.ucrDataFrameSaveOutputSelect.bUseCurrentFilter = True - Me.ucrDataFrameSaveOutputSelect.Location = New System.Drawing.Point(115, 54) + Me.ucrDataFrameSaveOutputSelect.Location = New System.Drawing.Point(86, 54) Me.ucrDataFrameSaveOutputSelect.Margin = New System.Windows.Forms.Padding(0) Me.ucrDataFrameSaveOutputSelect.Name = "ucrDataFrameSaveOutputSelect" - Me.ucrDataFrameSaveOutputSelect.Size = New System.Drawing.Size(151, 50) + Me.ucrDataFrameSaveOutputSelect.Size = New System.Drawing.Size(158, 47) Me.ucrDataFrameSaveOutputSelect.TabIndex = 29 ' 'ucrPnlSaveData ' Me.ucrPnlSaveData.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrPnlSaveData.Location = New System.Drawing.Point(13, 12) + Me.ucrPnlSaveData.Margin = New System.Windows.Forms.Padding(6) Me.ucrPnlSaveData.Name = "ucrPnlSaveData" Me.ucrPnlSaveData.Size = New System.Drawing.Size(402, 36) Me.ucrPnlSaveData.TabIndex = 47 ' 'tbPageGetData ' + Me.tbPageGetData.Controls.Add(Me.ucrReceiverGetOutputObject) + Me.tbPageGetData.Controls.Add(Me.ucrReceiverGetColumns) + Me.tbPageGetData.Controls.Add(Me.lblGetColumn) Me.tbPageGetData.Controls.Add(Me.ucrDataFrameGetDF) Me.tbPageGetData.Controls.Add(Me.lblGetObjectType) Me.tbPageGetData.Controls.Add(Me.ucrCboGetOutputObjectType) Me.tbPageGetData.Controls.Add(Me.rdoGetOutputObject) - Me.tbPageGetData.Controls.Add(Me.lblGetObject) - Me.tbPageGetData.Controls.Add(Me.ucrReceiverGetObject) + Me.tbPageGetData.Controls.Add(Me.lblGetOutputObject) Me.tbPageGetData.Controls.Add(Me.rdoGetDataFrame) Me.tbPageGetData.Controls.Add(Me.rdoGetColumn) Me.tbPageGetData.Controls.Add(Me.ucrPnlGetData) @@ -264,21 +237,57 @@ Partial Class dlgScript Me.tbPageGetData.Text = "Get Data" Me.tbPageGetData.UseVisualStyleBackColor = True ' + 'lblGetColumn + ' + Me.lblGetColumn.AutoSize = True + Me.lblGetColumn.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblGetColumn.Location = New System.Drawing.Point(252, 88) + Me.lblGetColumn.Name = "lblGetColumn" + Me.lblGetColumn.Size = New System.Drawing.Size(45, 13) + Me.lblGetColumn.TabIndex = 50 + Me.lblGetColumn.Text = "Column:" + ' + 'ucrReceiverGetOutputObject + ' + Me.ucrReceiverGetOutputObject.AutoSize = True + Me.ucrReceiverGetOutputObject.frmParent = Nothing + Me.ucrReceiverGetOutputObject.Location = New System.Drawing.Point(240, 117) + Me.ucrReceiverGetOutputObject.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverGetOutputObject.Name = "ucrReceiverGetOutputObject" + Me.ucrReceiverGetOutputObject.Selector = Nothing + Me.ucrReceiverGetOutputObject.Size = New System.Drawing.Size(138, 20) + Me.ucrReceiverGetOutputObject.strNcFilePath = "" + Me.ucrReceiverGetOutputObject.TabIndex = 27 + Me.ucrReceiverGetOutputObject.ucrSelector = Nothing + ' + 'ucrReceiverGetColumns + ' + Me.ucrReceiverGetColumns.AutoSize = True + Me.ucrReceiverGetColumns.frmParent = Nothing + Me.ucrReceiverGetColumns.Location = New System.Drawing.Point(243, 104) + Me.ucrReceiverGetColumns.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverGetColumns.Name = "ucrReceiverGetColumns" + Me.ucrReceiverGetColumns.Selector = Nothing + Me.ucrReceiverGetColumns.Size = New System.Drawing.Size(137, 105) + Me.ucrReceiverGetColumns.strNcFilePath = "" + Me.ucrReceiverGetColumns.TabIndex = 49 + Me.ucrReceiverGetColumns.ucrSelector = Nothing + ' 'ucrDataFrameGetDF ' Me.ucrDataFrameGetDF.AutoSize = True Me.ucrDataFrameGetDF.bDropUnusedFilterLevels = False Me.ucrDataFrameGetDF.bUseCurrentFilter = True - Me.ucrDataFrameGetDF.Location = New System.Drawing.Point(10, 55) + Me.ucrDataFrameGetDF.Location = New System.Drawing.Point(81, 55) Me.ucrDataFrameGetDF.Margin = New System.Windows.Forms.Padding(0) Me.ucrDataFrameGetDF.Name = "ucrDataFrameGetDF" - Me.ucrDataFrameGetDF.Size = New System.Drawing.Size(151, 50) + Me.ucrDataFrameGetDF.Size = New System.Drawing.Size(224, 59) Me.ucrDataFrameGetDF.TabIndex = 31 ' 'lblGetObjectType ' Me.lblGetObjectType.AutoSize = True - Me.lblGetObjectType.Location = New System.Drawing.Point(238, 57) + Me.lblGetObjectType.Location = New System.Drawing.Point(239, 57) Me.lblGetObjectType.Name = "lblGetObjectType" Me.lblGetObjectType.Size = New System.Drawing.Size(34, 13) Me.lblGetObjectType.TabIndex = 48 @@ -290,7 +299,7 @@ Partial Class dlgScript Me.ucrCboGetOutputObjectType.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrCboGetOutputObjectType.GetSetSelectedIndex = -1 Me.ucrCboGetOutputObjectType.IsReadOnly = False - Me.ucrCboGetOutputObjectType.Location = New System.Drawing.Point(240, 72) + Me.ucrCboGetOutputObjectType.Location = New System.Drawing.Point(241, 72) Me.ucrCboGetOutputObjectType.Margin = New System.Windows.Forms.Padding(9) Me.ucrCboGetOutputObjectType.Name = "ucrCboGetOutputObjectType" Me.ucrCboGetOutputObjectType.Size = New System.Drawing.Size(137, 21) @@ -313,28 +322,15 @@ Partial Class dlgScript Me.rdoGetOutputObject.TextAlign = System.Drawing.ContentAlignment.MiddleCenter Me.rdoGetOutputObject.UseVisualStyleBackColor = True ' - 'lblGetObject - ' - Me.lblGetObject.AutoSize = True - Me.lblGetObject.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblGetObject.Location = New System.Drawing.Point(241, 101) - Me.lblGetObject.Name = "lblGetObject" - Me.lblGetObject.Size = New System.Drawing.Size(41, 13) - Me.lblGetObject.TabIndex = 26 - Me.lblGetObject.Text = "Object:" - ' - 'ucrReceiverGetObject - ' - Me.ucrReceiverGetObject.AutoSize = True - Me.ucrReceiverGetObject.frmParent = Nothing - Me.ucrReceiverGetObject.Location = New System.Drawing.Point(239, 117) - Me.ucrReceiverGetObject.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverGetObject.Name = "ucrReceiverGetObject" - Me.ucrReceiverGetObject.Selector = Nothing - Me.ucrReceiverGetObject.Size = New System.Drawing.Size(158, 20) - Me.ucrReceiverGetObject.strNcFilePath = "" - Me.ucrReceiverGetObject.TabIndex = 27 - Me.ucrReceiverGetObject.ucrSelector = Nothing + 'lblGetOutputObject + ' + Me.lblGetOutputObject.AutoSize = True + Me.lblGetOutputObject.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblGetOutputObject.Location = New System.Drawing.Point(242, 101) + Me.lblGetOutputObject.Name = "lblGetOutputObject" + Me.lblGetOutputObject.Size = New System.Drawing.Size(41, 13) + Me.lblGetOutputObject.TabIndex = 26 + Me.lblGetOutputObject.Text = "Object:" ' 'rdoGetDataFrame ' @@ -374,6 +370,7 @@ Partial Class dlgScript ' Me.ucrPnlGetData.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrPnlGetData.Location = New System.Drawing.Point(5, 10) + Me.ucrPnlGetData.Margin = New System.Windows.Forms.Padding(6) Me.ucrPnlGetData.Name = "ucrPnlGetData" Me.ucrPnlGetData.Size = New System.Drawing.Size(402, 36) Me.ucrPnlGetData.TabIndex = 42 @@ -384,27 +381,50 @@ Partial Class dlgScript Me.ucrSelectorGetObject.bDropUnusedFilterLevels = False Me.ucrSelectorGetObject.bShowHiddenColumns = False Me.ucrSelectorGetObject.bUseCurrentFilter = True - Me.ucrSelectorGetObject.Location = New System.Drawing.Point(9, 54) + Me.ucrSelectorGetObject.Location = New System.Drawing.Point(9, 52) Me.ucrSelectorGetObject.Margin = New System.Windows.Forms.Padding(0) Me.ucrSelectorGetObject.Name = "ucrSelectorGetObject" - Me.ucrSelectorGetObject.Size = New System.Drawing.Size(213, 183) + Me.ucrSelectorGetObject.Size = New System.Drawing.Size(222, 188) Me.ucrSelectorGetObject.TabIndex = 34 ' - 'tbPageFinally + 'tbPageCommon + ' + Me.tbPageCommon.Controls.Add(Me.ucrCboLibPackage) + Me.tbPageCommon.Controls.Add(Me.lblGetPackage) + Me.tbPageCommon.Controls.Add(Me.lblRemoveObject) + Me.tbPageCommon.Controls.Add(Me.ucrInputRemoveObjects) + Me.tbPageCommon.Location = New System.Drawing.Point(4, 22) + Me.tbPageCommon.Name = "tbPageCommon" + Me.tbPageCommon.Size = New System.Drawing.Size(438, 245) + Me.tbPageCommon.TabIndex = 3 + Me.tbPageCommon.Text = "Common" + Me.tbPageCommon.UseVisualStyleBackColor = True + ' + 'ucrCboLibPackage + ' + Me.ucrCboLibPackage.AddQuotesIfUnrecognised = True + Me.ucrCboLibPackage.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboLibPackage.GetSetSelectedIndex = -1 + Me.ucrCboLibPackage.IsReadOnly = False + Me.ucrCboLibPackage.Location = New System.Drawing.Point(18, 28) + Me.ucrCboLibPackage.Margin = New System.Windows.Forms.Padding(9) + Me.ucrCboLibPackage.Name = "ucrCboLibPackage" + Me.ucrCboLibPackage.Size = New System.Drawing.Size(137, 21) + Me.ucrCboLibPackage.TabIndex = 44 ' - Me.tbPageFinally.Controls.Add(Me.lblRemoveObject) - Me.tbPageFinally.Controls.Add(Me.ucrInputRemoveObjects) - Me.tbPageFinally.Location = New System.Drawing.Point(4, 22) - Me.tbPageFinally.Name = "tbPageFinally" - Me.tbPageFinally.Size = New System.Drawing.Size(438, 245) - Me.tbPageFinally.TabIndex = 3 - Me.tbPageFinally.Text = "Finally" - Me.tbPageFinally.UseVisualStyleBackColor = True + 'lblGetPackage + ' + Me.lblGetPackage.AutoSize = True + Me.lblGetPackage.Location = New System.Drawing.Point(15, 11) + Me.lblGetPackage.Name = "lblGetPackage" + Me.lblGetPackage.Size = New System.Drawing.Size(73, 13) + Me.lblGetPackage.TabIndex = 43 + Me.lblGetPackage.Text = "Get Package:" ' 'lblRemoveObject ' Me.lblRemoveObject.AutoSize = True - Me.lblRemoveObject.Location = New System.Drawing.Point(14, 14) + Me.lblRemoveObject.Location = New System.Drawing.Point(12, 68) Me.lblRemoveObject.Name = "lblRemoveObject" Me.lblRemoveObject.Size = New System.Drawing.Size(95, 13) Me.lblRemoveObject.TabIndex = 3 @@ -416,11 +436,21 @@ Partial Class dlgScript Me.ucrInputRemoveObjects.AutoSize = True Me.ucrInputRemoveObjects.IsMultiline = False Me.ucrInputRemoveObjects.IsReadOnly = False - Me.ucrInputRemoveObjects.Location = New System.Drawing.Point(17, 30) + Me.ucrInputRemoveObjects.Location = New System.Drawing.Point(11, 86) + Me.ucrInputRemoveObjects.Margin = New System.Windows.Forms.Padding(9) Me.ucrInputRemoveObjects.Name = "ucrInputRemoveObjects" - Me.ucrInputRemoveObjects.Size = New System.Drawing.Size(197, 21) + Me.ucrInputRemoveObjects.Size = New System.Drawing.Size(145, 21) Me.ucrInputRemoveObjects.TabIndex = 2 ' + 'tbPageLibrary + ' + Me.tbPageLibrary.Location = New System.Drawing.Point(4, 22) + Me.tbPageLibrary.Name = "tbPageLibrary" + Me.tbPageLibrary.Size = New System.Drawing.Size(438, 245) + Me.tbPageLibrary.TabIndex = 4 + Me.tbPageLibrary.Text = "Examples" + Me.tbPageLibrary.UseVisualStyleBackColor = True + ' 'lblPreview ' Me.lblPreview.AutoSize = True @@ -467,14 +497,12 @@ Partial Class dlgScript Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Script" Me.tbFeatures.ResumeLayout(False) - Me.tbPageLibrary.ResumeLayout(False) - Me.tbPageLibrary.PerformLayout() Me.tbPageSaveData.ResumeLayout(False) Me.tbPageSaveData.PerformLayout() Me.tbPageGetData.ResumeLayout(False) Me.tbPageGetData.PerformLayout() - Me.tbPageFinally.ResumeLayout(False) - Me.tbPageFinally.PerformLayout() + Me.tbPageCommon.ResumeLayout(False) + Me.tbPageCommon.PerformLayout() Me.ResumeLayout(False) Me.PerformLayout() @@ -487,11 +515,11 @@ Partial Class dlgScript Friend WithEvents tbPageSaveData As TabPage Friend WithEvents lblPreview As Label Friend WithEvents ucrSaveData As ucrSave - Friend WithEvents tbPageFinally As TabPage + Friend WithEvents tbPageCommon As TabPage Friend WithEvents ucrDataFrameSaveOutputSelect As ucrDataFrame Friend WithEvents ucrSelectorGetObject As ucrSelectorByDataFrameAddRemove - Friend WithEvents lblGetObject As Label - Friend WithEvents ucrReceiverGetObject As ucrReceiverSingle + Friend WithEvents lblGetOutputObject As Label + Friend WithEvents ucrReceiverGetOutputObject As ucrReceiverSingle Friend WithEvents ucrPnlGetData As UcrPanel Friend WithEvents rdoGetDataFrame As RadioButton Friend WithEvents rdoGetColumn As RadioButton @@ -504,12 +532,14 @@ Partial Class dlgScript Friend WithEvents lblGetObjectType As Label Friend WithEvents ucrCboGetOutputObjectType As ucrInputComboBox Friend WithEvents tbPageLibrary As TabPage - Friend WithEvents ucrCboLibPackage As ucrInputComboBox - Friend WithEvents lblGetPackage As Label Friend WithEvents lblSaveObjectType As Label Friend WithEvents ucrCboSaveOutputObjectType As ucrInputComboBox Friend WithEvents lblSaveObjectFormat As Label Friend WithEvents ucrCboSaveOutputObjectFormat As ucrInputComboBox Friend WithEvents lblRemoveObject As Label Friend WithEvents ucrInputRemoveObjects As ucrInputTextBox + Friend WithEvents ucrCboLibPackage As ucrInputComboBox + Friend WithEvents lblGetPackage As Label + Friend WithEvents ucrReceiverGetColumns As ucrReceiverMultiple + Friend WithEvents lblGetColumn As Label End Class diff --git a/instat/dlgScript.vb b/instat/dlgScript.vb index 199035bd9f7..ad0bc22baef 100644 --- a/instat/dlgScript.vb +++ b/instat/dlgScript.vb @@ -84,15 +84,16 @@ Public Class dlgScript ucrDataFrameGetDF.SetLabelText("Get Data Frame:") + ucrReceiverGetColumns.Selector = ucrSelectorGetObject + ucrReceiverGetColumns.SetLinkedDisplayControl(lblGetColumn) + ucrCboGetOutputObjectType.SetItems(dctOutputObjectTypes, bSetConditions:=False) ucrCboGetOutputObjectType.SetDropDownStyleAsNonEditable() ucrCboGetOutputObjectType.SetLinkedDisplayControl(lblGetObjectType) ucrCboGetOutputObjectType.GetSetSelectedIndex = 0 - ucrReceiverGetObject.Selector = ucrSelectorGetObject - ucrReceiverGetObject.SetMeAsReceiver() - ucrReceiverGetObject.bAutoFill = True - ucrReceiverGetObject.SetLinkedDisplayControl(lblGetObject) + ucrReceiverGetOutputObject.Selector = ucrSelectorGetObject + ucrReceiverGetOutputObject.SetLinkedDisplayControl(lblGetOutputObject) '------------------------------- ' Hide base controls not supported in this dialog @@ -136,70 +137,10 @@ Public Class dlgScript rdoGetDataFrame.Checked = True - ' Library controls - ucrCboLibPackage.GetSetSelectedIndex = 0 - - 'activate the selected tab to library tab tbFeatures.SelectedIndex = -1 - tbFeatures.SelectedTab = tbPageLibrary - - End Sub - - Private Sub ucrCboLibPackage_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrCboLibPackage.ControlContentsChanged - Dim clsLibraryFunction As New RFunction - clsLibraryFunction.SetRCommand("library") - clsLibraryFunction.AddParameter("package", Chr(34) & ucrCboLibPackage.GetText() & Chr(34)) - PreviewScript(clsLibraryFunction.ToScript) - End Sub - - Private Sub ucrPnlGetData_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlGetData.ControlValueChanged - ucrDataFrameGetDF.SetVisible(False) - ucrCboGetOutputObjectType.SetVisible(False) - ucrSelectorGetObject.SetVisible(False) - ucrReceiverGetObject.SetVisible(False) - PreviewScript("") - If rdoGetDataFrame.Checked Then - ucrDataFrameGetDF.SetVisible(True) - ucrReceiverGetObject.SetVisible(False) - ucrDataFrameGetDF.Reset() - ElseIf rdoGetColumn.Checked Then - ucrSelectorGetObject.SetVisible(True) - ucrReceiverGetObject.SetVisible(True) - SetupReceiverForGetData("Column", RObjectTypeLabel.Column) - ElseIf rdoGetOutputObject.Checked Then - ucrSelectorGetObject.SetVisible(True) - ucrCboGetOutputObjectType.SetVisible(True) - lblGetObject.Text = ucrCboGetOutputObjectType.GetText() - ucrReceiverGetObject.SetVisible(True) - SetupReceiverForGetData(ucrCboGetOutputObjectType.GetText(), dctOutputObjectTypes.Item(ucrCboGetOutputObjectType.GetText())) - End If - End Sub + tbFeatures.SelectedTab = tbPageSaveData - Private Sub SetupReceiverForGetData(strLabel As String, strDataType As String) - ucrReceiverGetObject.Clear() - lblGetObject.Text = strLabel & ":" - ucrReceiverGetObject.SetSelectorHeading(strLabel) - ucrReceiverGetObject.SetItemType(strDataType) - End Sub - - Private Sub ucrDataFrameGet_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrDataFrameGetDF.ControlContentsChanged - Dim strAssignedScript As String = "" - ucrDataFrameGetDF.clsCurrDataFrame.Clone().ToScript(strAssignedScript) - PreviewScript(strAssignedScript) - End Sub - - Private Sub ucrInputGetObjectType_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrCboGetOutputObjectType.ControlValueChanged - If Not ucrCboGetOutputObjectType.IsEmpty() Then - SetupReceiverForGetData(ucrCboGetOutputObjectType.GetText(), dctOutputObjectTypes.Item(ucrCboGetOutputObjectType.GetText())) - End If - End Sub - - Private Sub ucrReceiverGet_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverGetObject.ControlContentsChanged - Dim clsFunction As RFunction = ucrReceiverGetObject.GetVariables() - Dim strAssignedScript As String = "" - clsFunction.ToScript(strScript:=strAssignedScript) - PreviewScript(strAssignedScript) End Sub Private Sub ucrPnlSaveData_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlSaveData.ControlValueChanged @@ -219,7 +160,7 @@ Public Class dlgScript End If End Sub - Private Sub ucrCboSaveOutputObjectTypee_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrCboSaveOutputObjectType.ControlValueChanged, ucrCboSaveOutputObjectFormat.ControlValueChanged + Private Sub ucrCboSaveOutputObjectType_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrCboSaveOutputObjectType.ControlValueChanged, ucrCboSaveOutputObjectFormat.ControlValueChanged If Not ucrCboSaveOutputObjectType.IsEmpty() AndAlso Not ucrCboSaveOutputObjectFormat.IsEmpty() Then SetupSaveDataControl(ucrCboSaveOutputObjectType.GetText(), dctOutputObjectTypes.Item(ucrCboSaveOutputObjectType.GetText()), dctOutputObjectFormats.Item(ucrCboSaveOutputObjectFormat.GetText())) End If @@ -254,6 +195,72 @@ Public Class dlgScript PreviewScript(strAssignedScript) End Sub + Private Sub ucrPnlGetData_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlGetData.ControlValueChanged + ucrDataFrameGetDF.SetVisible(False) + ucrCboGetOutputObjectType.SetVisible(False) + ucrSelectorGetObject.SetVisible(False) + ucrReceiverGetColumns.SetVisible(False) + ucrReceiverGetOutputObject.SetVisible(False) + PreviewScript("") + If rdoGetDataFrame.Checked Then + ucrDataFrameGetDF.SetVisible(True) + ucrReceiverGetOutputObject.SetVisible(False) + ucrDataFrameGetDF.Reset() + ElseIf rdoGetColumn.Checked Then + ucrSelectorGetObject.SetVisible(True) + ucrReceiverGetColumns.SetVisible(True) + ucrReceiverGetColumns.SetMeAsReceiver() + 'SetupReceiverForGetData("Column", RObjectTypeLabel.Column) + ElseIf rdoGetOutputObject.Checked Then + ucrSelectorGetObject.SetVisible(True) + ucrCboGetOutputObjectType.SetVisible(True) + ucrReceiverGetOutputObject.SetVisible(True) + SetupReceiverForGetData(ucrCboGetOutputObjectType.GetText(), dctOutputObjectTypes.Item(ucrCboGetOutputObjectType.GetText())) + ucrReceiverGetOutputObject.SetMeAsReceiver() + End If + End Sub + + Private Sub SetupReceiverForGetData(strLabel As String, strDataType As String) + ucrReceiverGetOutputObject.Clear() + lblGetOutputObject.Text = strLabel & ":" + ucrReceiverGetOutputObject.SetSelectorHeading(strLabel) + ucrReceiverGetOutputObject.SetItemType(strDataType) + End Sub + + Private Sub ucrDataFrameGet_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrDataFrameGetDF.ControlContentsChanged + Dim strAssignedScript As String = "" + ucrDataFrameGetDF.clsCurrDataFrame.Clone().ToScript(strAssignedScript) + PreviewScript(strAssignedScript) + End Sub + + Private Sub ucrReceiverGetColumns_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverGetColumns.ControlContentsChanged + Dim clsRFunction As RFunction = ucrReceiverGetColumns.GetVariables() + Dim strAssignedScript As String = "" + + Dim k = clsRFunction.ToScript(strScript:=strAssignedScript) + PreviewScript(k) + End Sub + + Private Sub ucrInputGetObjectType_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrCboGetOutputObjectType.ControlValueChanged + If Not ucrCboGetOutputObjectType.IsEmpty() Then + SetupReceiverForGetData(ucrCboGetOutputObjectType.GetText(), dctOutputObjectTypes.Item(ucrCboGetOutputObjectType.GetText())) + End If + End Sub + + Private Sub ucrReceiverGetOutputObject_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverGetOutputObject.ControlContentsChanged + Dim clsRFunction As RFunction = ucrReceiverGetOutputObject.GetVariables() + Dim strAssignedScript As String = "" + clsRFunction.ToScript(strScript:=strAssignedScript) + PreviewScript(strAssignedScript) + End Sub + + Private Sub ucrCboLibPackage_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrCboLibPackage.ControlValueChanged + Dim clsLibraryFunction As New RFunction + clsLibraryFunction.SetRCommand("library") + clsLibraryFunction.AddParameter("package", Chr(34) & ucrCboLibPackage.GetText() & Chr(34)) + PreviewScript(clsLibraryFunction.ToScript) + End Sub + Private Sub ucrInputRemoveObject_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputRemoveObjects.ControlContentsChanged 'create function to remove the objects added in the script Dim lstAssignToStrings As String() = ucrInputRemoveObjects.GetText().Split(",") @@ -295,8 +302,12 @@ Public Class dlgScript ElseIf e.TabPage Is tbPageSaveData Then rdoSaveDataFrame.Checked = True ucrPnlSaveData.OnControlValueChanged() - ElseIf e.TabPage Is tbPageFinally Then - ucrInputRemoveObjects.OnControlContentsChanged() + ElseIf e.TabPage Is tbPageCommon Then + 'alwys reset the common controls to be blank. + 'the controls functionalities are not related + ucrCboLibPackage.GetSetSelectedIndex = -1 + ucrInputRemoveObjects.SetName("") + PreviewScript("") End If End Sub diff --git a/instat/ucrScript.vb b/instat/ucrScript.vb index 5feee07316d..fafef95b118 100644 --- a/instat/ucrScript.vb +++ b/instat/ucrScript.vb @@ -1001,7 +1001,7 @@ Public Class ucrScript End Sub Private Sub mnuInsertScript_Click(sender As Object, e As EventArgs) Handles mnuInsertScript.Click, cmdInsertScript.Click - dlgScript.iCurrentPos = clsScriptActive.CurrentPosition + 'dlgScript.iCurrentPos = clsScriptActive.CurrentPosition dlgScript.ShowDialog() End Sub From 27796e9e9de67a766105b2983ab7e0e4cdda7915 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Mon, 6 Nov 2023 11:16:42 +0300 Subject: [PATCH 09/27] Get data changes --- instat/dlgScript.Designer.vb | 26 +++++++++++++------------- instat/dlgScript.vb | 14 +++++++------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/instat/dlgScript.Designer.vb b/instat/dlgScript.Designer.vb index 4f0d1c931c2..1b9fdbded2e 100644 --- a/instat/dlgScript.Designer.vb +++ b/instat/dlgScript.Designer.vb @@ -35,9 +35,9 @@ Partial Class dlgScript Me.ucrDataFrameSaveOutputSelect = New instat.ucrDataFrame() Me.ucrPnlSaveData = New instat.UcrPanel() Me.tbPageGetData = New System.Windows.Forms.TabPage() - Me.lblGetColumn = New System.Windows.Forms.Label() Me.ucrReceiverGetOutputObject = New instat.ucrReceiverSingle() Me.ucrReceiverGetColumns = New instat.ucrReceiverMultiple() + Me.lblGetColumn = New System.Windows.Forms.Label() Me.ucrDataFrameGetDF = New instat.ucrDataFrame() Me.lblGetObjectType = New System.Windows.Forms.Label() Me.ucrCboGetOutputObjectType = New instat.ucrInputComboBox() @@ -237,16 +237,6 @@ Partial Class dlgScript Me.tbPageGetData.Text = "Get Data" Me.tbPageGetData.UseVisualStyleBackColor = True ' - 'lblGetColumn - ' - Me.lblGetColumn.AutoSize = True - Me.lblGetColumn.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblGetColumn.Location = New System.Drawing.Point(252, 88) - Me.lblGetColumn.Name = "lblGetColumn" - Me.lblGetColumn.Size = New System.Drawing.Size(45, 13) - Me.lblGetColumn.TabIndex = 50 - Me.lblGetColumn.Text = "Column:" - ' 'ucrReceiverGetOutputObject ' Me.ucrReceiverGetOutputObject.AutoSize = True @@ -273,6 +263,16 @@ Partial Class dlgScript Me.ucrReceiverGetColumns.TabIndex = 49 Me.ucrReceiverGetColumns.ucrSelector = Nothing ' + 'lblGetColumn + ' + Me.lblGetColumn.AutoSize = True + Me.lblGetColumn.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblGetColumn.Location = New System.Drawing.Point(252, 88) + Me.lblGetColumn.Name = "lblGetColumn" + Me.lblGetColumn.Size = New System.Drawing.Size(45, 13) + Me.lblGetColumn.TabIndex = 50 + Me.lblGetColumn.Text = "Column:" + ' 'ucrDataFrameGetDF ' Me.ucrDataFrameGetDF.AutoSize = True @@ -406,7 +406,7 @@ Partial Class dlgScript Me.ucrCboLibPackage.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrCboLibPackage.GetSetSelectedIndex = -1 Me.ucrCboLibPackage.IsReadOnly = False - Me.ucrCboLibPackage.Location = New System.Drawing.Point(18, 28) + Me.ucrCboLibPackage.Location = New System.Drawing.Point(14, 28) Me.ucrCboLibPackage.Margin = New System.Windows.Forms.Padding(9) Me.ucrCboLibPackage.Name = "ucrCboLibPackage" Me.ucrCboLibPackage.Size = New System.Drawing.Size(137, 21) @@ -415,7 +415,7 @@ Partial Class dlgScript 'lblGetPackage ' Me.lblGetPackage.AutoSize = True - Me.lblGetPackage.Location = New System.Drawing.Point(15, 11) + Me.lblGetPackage.Location = New System.Drawing.Point(11, 11) Me.lblGetPackage.Name = "lblGetPackage" Me.lblGetPackage.Size = New System.Drawing.Size(73, 13) Me.lblGetPackage.TabIndex = 43 diff --git a/instat/dlgScript.vb b/instat/dlgScript.vb index ad0bc22baef..30c0a8d7f1f 100644 --- a/instat/dlgScript.vb +++ b/instat/dlgScript.vb @@ -210,17 +210,17 @@ Public Class dlgScript ucrSelectorGetObject.SetVisible(True) ucrReceiverGetColumns.SetVisible(True) ucrReceiverGetColumns.SetMeAsReceiver() - 'SetupReceiverForGetData("Column", RObjectTypeLabel.Column) + ucrReceiverGetColumns.Clear() ElseIf rdoGetOutputObject.Checked Then ucrSelectorGetObject.SetVisible(True) ucrCboGetOutputObjectType.SetVisible(True) ucrReceiverGetOutputObject.SetVisible(True) - SetupReceiverForGetData(ucrCboGetOutputObjectType.GetText(), dctOutputObjectTypes.Item(ucrCboGetOutputObjectType.GetText())) + SetupReceiverForGetOutputObject(ucrCboGetOutputObjectType.GetText(), dctOutputObjectTypes.Item(ucrCboGetOutputObjectType.GetText())) ucrReceiverGetOutputObject.SetMeAsReceiver() End If End Sub - Private Sub SetupReceiverForGetData(strLabel As String, strDataType As String) + Private Sub SetupReceiverForGetOutputObject(strLabel As String, strDataType As String) ucrReceiverGetOutputObject.Clear() lblGetOutputObject.Text = strLabel & ":" ucrReceiverGetOutputObject.SetSelectorHeading(strLabel) @@ -236,14 +236,14 @@ Public Class dlgScript Private Sub ucrReceiverGetColumns_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverGetColumns.ControlContentsChanged Dim clsRFunction As RFunction = ucrReceiverGetColumns.GetVariables() Dim strAssignedScript As String = "" - - Dim k = clsRFunction.ToScript(strScript:=strAssignedScript) - PreviewScript(k) + clsRFunction.SetAssignTo(ucrSelectorGetObject.strCurrentDataFrame & "_cols") + clsRFunction.ToScript(strScript:=strAssignedScript) + PreviewScript(strAssignedScript) End Sub Private Sub ucrInputGetObjectType_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrCboGetOutputObjectType.ControlValueChanged If Not ucrCboGetOutputObjectType.IsEmpty() Then - SetupReceiverForGetData(ucrCboGetOutputObjectType.GetText(), dctOutputObjectTypes.Item(ucrCboGetOutputObjectType.GetText())) + SetupReceiverForGetOutputObject(ucrCboGetOutputObjectType.GetText(), dctOutputObjectTypes.Item(ucrCboGetOutputObjectType.GetText())) End If End Sub From c18910d8109f5320671db8d021c39138f0cb7eeb Mon Sep 17 00:00:00 2001 From: patowhiz Date: Tue, 7 Nov 2023 09:27:23 +0300 Subject: [PATCH 10/27] Get examples design changes --- instat/dlgScript.Designer.vb | 94 ++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/instat/dlgScript.Designer.vb b/instat/dlgScript.Designer.vb index 1b9fdbded2e..10acd71ef53 100644 --- a/instat/dlgScript.Designer.vb +++ b/instat/dlgScript.Designer.vb @@ -56,10 +56,18 @@ Partial Class dlgScript Me.lblPreview = New System.Windows.Forms.Label() Me.txtScript = New System.Windows.Forms.TextBox() Me.ucrBase = New instat.ucrButtons() + Me.rdoExampleFunction = New System.Windows.Forms.RadioButton() + Me.rdoExampleData = New System.Windows.Forms.RadioButton() + Me.lstExampleCollection = New System.Windows.Forms.ListView() + Me.clmDatasets = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader) + Me.clmDesc = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader) + Me.Label3 = New System.Windows.Forms.Label() + Me.ucrCboExamplePackages = New instat.ucrInputComboBox() Me.tbFeatures.SuspendLayout() Me.tbPageSaveData.SuspendLayout() Me.tbPageGetData.SuspendLayout() Me.tbPageCommon.SuspendLayout() + Me.tbPageLibrary.SuspendLayout() Me.SuspendLayout() ' 'tbFeatures @@ -444,6 +452,11 @@ Partial Class dlgScript ' 'tbPageLibrary ' + Me.tbPageLibrary.Controls.Add(Me.rdoExampleFunction) + Me.tbPageLibrary.Controls.Add(Me.rdoExampleData) + Me.tbPageLibrary.Controls.Add(Me.lstExampleCollection) + Me.tbPageLibrary.Controls.Add(Me.Label3) + Me.tbPageLibrary.Controls.Add(Me.ucrCboExamplePackages) Me.tbPageLibrary.Location = New System.Drawing.Point(4, 22) Me.tbPageLibrary.Name = "tbPageLibrary" Me.tbPageLibrary.Size = New System.Drawing.Size(438, 245) @@ -480,6 +493,78 @@ Partial Class dlgScript Me.ucrBase.Size = New System.Drawing.Size(408, 52) Me.ucrBase.TabIndex = 16 ' + 'rdoExampleFunction + ' + Me.rdoExampleFunction.AutoSize = True + Me.rdoExampleFunction.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoExampleFunction.Location = New System.Drawing.Point(157, 36) + Me.rdoExampleFunction.Name = "rdoExampleFunction" + Me.rdoExampleFunction.Size = New System.Drawing.Size(66, 17) + Me.rdoExampleFunction.TabIndex = 55 + Me.rdoExampleFunction.TabStop = True + Me.rdoExampleFunction.Text = "Function" + Me.rdoExampleFunction.UseVisualStyleBackColor = True + ' + 'rdoExampleData + ' + Me.rdoExampleData.AutoSize = True + Me.rdoExampleData.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoExampleData.Location = New System.Drawing.Point(37, 36) + Me.rdoExampleData.Name = "rdoExampleData" + Me.rdoExampleData.Size = New System.Drawing.Size(48, 17) + Me.rdoExampleData.TabIndex = 54 + Me.rdoExampleData.TabStop = True + Me.rdoExampleData.Text = "Data" + Me.rdoExampleData.UseVisualStyleBackColor = True + ' + 'lstExampleCollection + ' + Me.lstExampleCollection.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.clmDatasets, Me.clmDesc}) + Me.lstExampleCollection.FullRowSelect = True + Me.lstExampleCollection.HideSelection = False + Me.lstExampleCollection.Location = New System.Drawing.Point(21, 62) + Me.lstExampleCollection.MultiSelect = False + Me.lstExampleCollection.Name = "lstExampleCollection" + Me.lstExampleCollection.ShowGroups = False + Me.lstExampleCollection.ShowItemToolTips = True + Me.lstExampleCollection.Size = New System.Drawing.Size(397, 173) + Me.lstExampleCollection.Sorting = System.Windows.Forms.SortOrder.Ascending + Me.lstExampleCollection.TabIndex = 53 + Me.lstExampleCollection.UseCompatibleStateImageBehavior = False + Me.lstExampleCollection.View = System.Windows.Forms.View.Details + ' + 'clmDatasets + ' + Me.clmDatasets.Text = "Data" + Me.clmDatasets.Width = 142 + ' + 'clmDesc + ' + Me.clmDesc.Text = "Description" + Me.clmDesc.Width = 266 + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(21, 14) + Me.Label3.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(50, 13) + Me.Label3.TabIndex = 52 + Me.Label3.Text = "Package" + ' + 'ucrCboExamplePackages + ' + Me.ucrCboExamplePackages.AddQuotesIfUnrecognised = True + Me.ucrCboExamplePackages.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboExamplePackages.GetSetSelectedIndex = -1 + Me.ucrCboExamplePackages.IsReadOnly = False + Me.ucrCboExamplePackages.Location = New System.Drawing.Point(87, 10) + Me.ucrCboExamplePackages.Margin = New System.Windows.Forms.Padding(9) + Me.ucrCboExamplePackages.Name = "ucrCboExamplePackages" + Me.ucrCboExamplePackages.Size = New System.Drawing.Size(137, 21) + Me.ucrCboExamplePackages.TabIndex = 51 + ' 'dlgScript ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) @@ -503,6 +588,8 @@ Partial Class dlgScript Me.tbPageGetData.PerformLayout() Me.tbPageCommon.ResumeLayout(False) Me.tbPageCommon.PerformLayout() + Me.tbPageLibrary.ResumeLayout(False) + Me.tbPageLibrary.PerformLayout() Me.ResumeLayout(False) Me.PerformLayout() @@ -542,4 +629,11 @@ Partial Class dlgScript Friend WithEvents lblGetPackage As Label Friend WithEvents ucrReceiverGetColumns As ucrReceiverMultiple Friend WithEvents lblGetColumn As Label + Friend WithEvents rdoExampleFunction As RadioButton + Friend WithEvents rdoExampleData As RadioButton + Friend WithEvents lstExampleCollection As ListView + Friend WithEvents clmDatasets As ColumnHeader + Friend WithEvents clmDesc As ColumnHeader + Friend WithEvents Label3 As Label + Friend WithEvents ucrCboExamplePackages As ucrInputComboBox End Class From 5b2cacfb11035b2ec658d76d65e686cf323510c7 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Tue, 7 Nov 2023 09:37:22 +0300 Subject: [PATCH 11/27] Get example design additions --- instat/dlgScript.Designer.vb | 126 ++++++++++++++++++++--------------- 1 file changed, 74 insertions(+), 52 deletions(-) diff --git a/instat/dlgScript.Designer.vb b/instat/dlgScript.Designer.vb index 10acd71ef53..ab8b76b708f 100644 --- a/instat/dlgScript.Designer.vb +++ b/instat/dlgScript.Designer.vb @@ -53,16 +53,17 @@ Partial Class dlgScript Me.lblRemoveObject = New System.Windows.Forms.Label() Me.ucrInputRemoveObjects = New instat.ucrInputTextBox() Me.tbPageLibrary = New System.Windows.Forms.TabPage() - Me.lblPreview = New System.Windows.Forms.Label() - Me.txtScript = New System.Windows.Forms.TextBox() - Me.ucrBase = New instat.ucrButtons() - Me.rdoExampleFunction = New System.Windows.Forms.RadioButton() Me.rdoExampleData = New System.Windows.Forms.RadioButton() + Me.rdoExampleFunction = New System.Windows.Forms.RadioButton() + Me.ucrPnlExample = New instat.UcrPanel() Me.lstExampleCollection = New System.Windows.Forms.ListView() Me.clmDatasets = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader) Me.clmDesc = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader) Me.Label3 = New System.Windows.Forms.Label() Me.ucrCboExamplePackages = New instat.ucrInputComboBox() + Me.lblPreview = New System.Windows.Forms.Label() + Me.txtScript = New System.Windows.Forms.TextBox() + Me.ucrBase = New instat.ucrButtons() Me.tbFeatures.SuspendLayout() Me.tbPageSaveData.SuspendLayout() Me.tbPageGetData.SuspendLayout() @@ -452,8 +453,9 @@ Partial Class dlgScript ' 'tbPageLibrary ' - Me.tbPageLibrary.Controls.Add(Me.rdoExampleFunction) Me.tbPageLibrary.Controls.Add(Me.rdoExampleData) + Me.tbPageLibrary.Controls.Add(Me.rdoExampleFunction) + Me.tbPageLibrary.Controls.Add(Me.ucrPnlExample) Me.tbPageLibrary.Controls.Add(Me.lstExampleCollection) Me.tbPageLibrary.Controls.Add(Me.Label3) Me.tbPageLibrary.Controls.Add(Me.ucrCboExamplePackages) @@ -464,70 +466,60 @@ Partial Class dlgScript Me.tbPageLibrary.Text = "Examples" Me.tbPageLibrary.UseVisualStyleBackColor = True ' - 'lblPreview - ' - Me.lblPreview.AutoSize = True - Me.lblPreview.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblPreview.Location = New System.Drawing.Point(9, 281) - Me.lblPreview.Name = "lblPreview" - Me.lblPreview.Size = New System.Drawing.Size(48, 13) - Me.lblPreview.TabIndex = 30 - Me.lblPreview.Text = "Preview:" - ' - 'txtScript - ' - Me.txtScript.Location = New System.Drawing.Point(5, 299) - Me.txtScript.Multiline = True - Me.txtScript.Name = "txtScript" - Me.txtScript.ScrollBars = System.Windows.Forms.ScrollBars.Both - Me.txtScript.Size = New System.Drawing.Size(445, 96) - Me.txtScript.TabIndex = 32 - ' - 'ucrBase + 'rdoExampleData ' - Me.ucrBase.AutoSize = True - Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(6, 399) - Me.ucrBase.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) - Me.ucrBase.Name = "ucrBase" - Me.ucrBase.Size = New System.Drawing.Size(408, 52) - Me.ucrBase.TabIndex = 16 + Me.rdoExampleData.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoExampleData.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoExampleData.FlatAppearance.BorderSize = 2 + Me.rdoExampleData.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoExampleData.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoExampleData.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoExampleData.Location = New System.Drawing.Point(14, 54) + Me.rdoExampleData.Name = "rdoExampleData" + Me.rdoExampleData.Size = New System.Drawing.Size(80, 30) + Me.rdoExampleData.TabIndex = 57 + Me.rdoExampleData.TabStop = True + Me.rdoExampleData.Text = "Data" + Me.rdoExampleData.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoExampleData.UseVisualStyleBackColor = True ' 'rdoExampleFunction ' - Me.rdoExampleFunction.AutoSize = True + Me.rdoExampleFunction.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoExampleFunction.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoExampleFunction.FlatAppearance.BorderSize = 2 + Me.rdoExampleFunction.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoExampleFunction.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.rdoExampleFunction.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoExampleFunction.Location = New System.Drawing.Point(157, 36) + Me.rdoExampleFunction.Location = New System.Drawing.Point(92, 54) Me.rdoExampleFunction.Name = "rdoExampleFunction" - Me.rdoExampleFunction.Size = New System.Drawing.Size(66, 17) - Me.rdoExampleFunction.TabIndex = 55 + Me.rdoExampleFunction.Size = New System.Drawing.Size(80, 30) + Me.rdoExampleFunction.TabIndex = 58 Me.rdoExampleFunction.TabStop = True Me.rdoExampleFunction.Text = "Function" + Me.rdoExampleFunction.TextAlign = System.Drawing.ContentAlignment.MiddleCenter Me.rdoExampleFunction.UseVisualStyleBackColor = True ' - 'rdoExampleData + 'ucrPnlExample ' - Me.rdoExampleData.AutoSize = True - Me.rdoExampleData.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoExampleData.Location = New System.Drawing.Point(37, 36) - Me.rdoExampleData.Name = "rdoExampleData" - Me.rdoExampleData.Size = New System.Drawing.Size(48, 17) - Me.rdoExampleData.TabIndex = 54 - Me.rdoExampleData.TabStop = True - Me.rdoExampleData.Text = "Data" - Me.rdoExampleData.UseVisualStyleBackColor = True + Me.ucrPnlExample.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlExample.Location = New System.Drawing.Point(7, 51) + Me.ucrPnlExample.Margin = New System.Windows.Forms.Padding(6) + Me.ucrPnlExample.Name = "ucrPnlExample" + Me.ucrPnlExample.Size = New System.Drawing.Size(402, 34) + Me.ucrPnlExample.TabIndex = 56 ' 'lstExampleCollection ' Me.lstExampleCollection.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.clmDatasets, Me.clmDesc}) Me.lstExampleCollection.FullRowSelect = True Me.lstExampleCollection.HideSelection = False - Me.lstExampleCollection.Location = New System.Drawing.Point(21, 62) + Me.lstExampleCollection.Location = New System.Drawing.Point(3, 93) Me.lstExampleCollection.MultiSelect = False Me.lstExampleCollection.Name = "lstExampleCollection" Me.lstExampleCollection.ShowGroups = False Me.lstExampleCollection.ShowItemToolTips = True - Me.lstExampleCollection.Size = New System.Drawing.Size(397, 173) + Me.lstExampleCollection.Size = New System.Drawing.Size(415, 146) Me.lstExampleCollection.Sorting = System.Windows.Forms.SortOrder.Ascending Me.lstExampleCollection.TabIndex = 53 Me.lstExampleCollection.UseCompatibleStateImageBehavior = False @@ -546,7 +538,7 @@ Partial Class dlgScript 'Label3 ' Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(21, 14) + Me.Label3.Location = New System.Drawing.Point(13, 5) Me.Label3.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(50, 13) @@ -559,12 +551,41 @@ Partial Class dlgScript Me.ucrCboExamplePackages.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrCboExamplePackages.GetSetSelectedIndex = -1 Me.ucrCboExamplePackages.IsReadOnly = False - Me.ucrCboExamplePackages.Location = New System.Drawing.Point(87, 10) + Me.ucrCboExamplePackages.Location = New System.Drawing.Point(14, 22) Me.ucrCboExamplePackages.Margin = New System.Windows.Forms.Padding(9) Me.ucrCboExamplePackages.Name = "ucrCboExamplePackages" Me.ucrCboExamplePackages.Size = New System.Drawing.Size(137, 21) Me.ucrCboExamplePackages.TabIndex = 51 ' + 'lblPreview + ' + Me.lblPreview.AutoSize = True + Me.lblPreview.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblPreview.Location = New System.Drawing.Point(9, 281) + Me.lblPreview.Name = "lblPreview" + Me.lblPreview.Size = New System.Drawing.Size(48, 13) + Me.lblPreview.TabIndex = 30 + Me.lblPreview.Text = "Preview:" + ' + 'txtScript + ' + Me.txtScript.Location = New System.Drawing.Point(5, 299) + Me.txtScript.Multiline = True + Me.txtScript.Name = "txtScript" + Me.txtScript.ScrollBars = System.Windows.Forms.ScrollBars.Both + Me.txtScript.Size = New System.Drawing.Size(445, 96) + Me.txtScript.TabIndex = 32 + ' + 'ucrBase + ' + Me.ucrBase.AutoSize = True + Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrBase.Location = New System.Drawing.Point(6, 399) + Me.ucrBase.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.ucrBase.Name = "ucrBase" + Me.ucrBase.Size = New System.Drawing.Size(408, 52) + Me.ucrBase.TabIndex = 16 + ' 'dlgScript ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) @@ -629,11 +650,12 @@ Partial Class dlgScript Friend WithEvents lblGetPackage As Label Friend WithEvents ucrReceiverGetColumns As ucrReceiverMultiple Friend WithEvents lblGetColumn As Label - Friend WithEvents rdoExampleFunction As RadioButton - Friend WithEvents rdoExampleData As RadioButton Friend WithEvents lstExampleCollection As ListView Friend WithEvents clmDatasets As ColumnHeader Friend WithEvents clmDesc As ColumnHeader Friend WithEvents Label3 As Label Friend WithEvents ucrCboExamplePackages As ucrInputComboBox + Friend WithEvents rdoExampleData As RadioButton + Friend WithEvents rdoExampleFunction As RadioButton + Friend WithEvents ucrPnlExample As UcrPanel End Class From 1779b516a39f05d286a47c3e272059a1c3651582 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Tue, 7 Nov 2023 10:02:20 +0300 Subject: [PATCH 12/27] get examples code additions --- instat/dlgScript.Designer.vb | 40 ++++++------- instat/dlgScript.vb | 107 +++++++++++++++++++++++++++++++++-- 2 files changed, 123 insertions(+), 24 deletions(-) diff --git a/instat/dlgScript.Designer.vb b/instat/dlgScript.Designer.vb index ab8b76b708f..c63160df3f1 100644 --- a/instat/dlgScript.Designer.vb +++ b/instat/dlgScript.Designer.vb @@ -52,7 +52,7 @@ Partial Class dlgScript Me.lblGetPackage = New System.Windows.Forms.Label() Me.lblRemoveObject = New System.Windows.Forms.Label() Me.ucrInputRemoveObjects = New instat.ucrInputTextBox() - Me.tbPageLibrary = New System.Windows.Forms.TabPage() + Me.tbPageExamples = New System.Windows.Forms.TabPage() Me.rdoExampleData = New System.Windows.Forms.RadioButton() Me.rdoExampleFunction = New System.Windows.Forms.RadioButton() Me.ucrPnlExample = New instat.UcrPanel() @@ -68,7 +68,7 @@ Partial Class dlgScript Me.tbPageSaveData.SuspendLayout() Me.tbPageGetData.SuspendLayout() Me.tbPageCommon.SuspendLayout() - Me.tbPageLibrary.SuspendLayout() + Me.tbPageExamples.SuspendLayout() Me.SuspendLayout() ' 'tbFeatures @@ -76,7 +76,7 @@ Partial Class dlgScript Me.tbFeatures.Controls.Add(Me.tbPageSaveData) Me.tbFeatures.Controls.Add(Me.tbPageGetData) Me.tbFeatures.Controls.Add(Me.tbPageCommon) - Me.tbFeatures.Controls.Add(Me.tbPageLibrary) + Me.tbFeatures.Controls.Add(Me.tbPageExamples) Me.tbFeatures.Location = New System.Drawing.Point(8, 7) Me.tbFeatures.Name = "tbFeatures" Me.tbFeatures.SelectedIndex = 0 @@ -451,20 +451,20 @@ Partial Class dlgScript Me.ucrInputRemoveObjects.Size = New System.Drawing.Size(145, 21) Me.ucrInputRemoveObjects.TabIndex = 2 ' - 'tbPageLibrary - ' - Me.tbPageLibrary.Controls.Add(Me.rdoExampleData) - Me.tbPageLibrary.Controls.Add(Me.rdoExampleFunction) - Me.tbPageLibrary.Controls.Add(Me.ucrPnlExample) - Me.tbPageLibrary.Controls.Add(Me.lstExampleCollection) - Me.tbPageLibrary.Controls.Add(Me.Label3) - Me.tbPageLibrary.Controls.Add(Me.ucrCboExamplePackages) - Me.tbPageLibrary.Location = New System.Drawing.Point(4, 22) - Me.tbPageLibrary.Name = "tbPageLibrary" - Me.tbPageLibrary.Size = New System.Drawing.Size(438, 245) - Me.tbPageLibrary.TabIndex = 4 - Me.tbPageLibrary.Text = "Examples" - Me.tbPageLibrary.UseVisualStyleBackColor = True + 'tbPageExamples + ' + Me.tbPageExamples.Controls.Add(Me.rdoExampleData) + Me.tbPageExamples.Controls.Add(Me.rdoExampleFunction) + Me.tbPageExamples.Controls.Add(Me.ucrPnlExample) + Me.tbPageExamples.Controls.Add(Me.lstExampleCollection) + Me.tbPageExamples.Controls.Add(Me.Label3) + Me.tbPageExamples.Controls.Add(Me.ucrCboExamplePackages) + Me.tbPageExamples.Location = New System.Drawing.Point(4, 22) + Me.tbPageExamples.Name = "tbPageExamples" + Me.tbPageExamples.Size = New System.Drawing.Size(438, 245) + Me.tbPageExamples.TabIndex = 4 + Me.tbPageExamples.Text = "Examples" + Me.tbPageExamples.UseVisualStyleBackColor = True ' 'rdoExampleData ' @@ -609,8 +609,8 @@ Partial Class dlgScript Me.tbPageGetData.PerformLayout() Me.tbPageCommon.ResumeLayout(False) Me.tbPageCommon.PerformLayout() - Me.tbPageLibrary.ResumeLayout(False) - Me.tbPageLibrary.PerformLayout() + Me.tbPageExamples.ResumeLayout(False) + Me.tbPageExamples.PerformLayout() Me.ResumeLayout(False) Me.PerformLayout() @@ -639,7 +639,7 @@ Partial Class dlgScript Friend WithEvents txtScript As TextBox Friend WithEvents lblGetObjectType As Label Friend WithEvents ucrCboGetOutputObjectType As ucrInputComboBox - Friend WithEvents tbPageLibrary As TabPage + Friend WithEvents tbPageExamples As TabPage Friend WithEvents lblSaveObjectType As Label Friend WithEvents ucrCboSaveOutputObjectType As ucrInputComboBox Friend WithEvents lblSaveObjectFormat As Label diff --git a/instat/dlgScript.vb b/instat/dlgScript.vb index 30c0a8d7f1f..ea4370c24a0 100644 --- a/instat/dlgScript.vb +++ b/instat/dlgScript.vb @@ -95,6 +95,14 @@ Public Class dlgScript ucrReceiverGetOutputObject.Selector = ucrSelectorGetObject ucrReceiverGetOutputObject.SetLinkedDisplayControl(lblGetOutputObject) + '-------------------------------- + 'Get example controls + ucrPnlExample.AddRadioButton(rdoExampleData) + ucrPnlExample.AddRadioButton(rdoExampleFunction) + + ucrCboExamplePackages.SetItems(GetPackages(), bAddConditions:=False) + ucrCboExamplePackages.SetDropDownStyleAsNonEditable() + '------------------------------- ' Hide base controls not supported in this dialog @@ -121,7 +129,10 @@ Public Class dlgScript Private Sub SetDefaults() - 'Finally controls + ' Examples controls + rdoExampleData.Checked = True + + ' Common controls ucrInputRemoveObjects.Reset() ' Save controls reset @@ -277,6 +288,93 @@ Public Class dlgScript PreviewScript(clsRemoveFunc.ToScript()) End Sub + Private Sub ucrComboGetPackages_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrCboExamplePackages.ControlValueChanged, ucrPnlExample.ControlValueChanged + + PreviewScript("") + lstExampleCollection.Items.Clear() + + If ucrCboExamplePackages.IsEmpty Then + Exit Sub + End If + + Dim strSelectedPackage As String = ucrCboExamplePackages.GetText() + + If rdoExampleData.Checked Then + lstExampleCollection.Columns(0).Text = "Data" + lstExampleCollection.Items.AddRange(GetDatasets(strSelectedPackage)) + ElseIf rdoExampleFunction.Checked Then + lstExampleCollection.Columns(0).Text = "Functions" + lstExampleCollection.Items.AddRange(GetFunctions(strSelectedPackage)) + End If + lstExampleCollection.Select() + + End Sub + + Private Function GetDatasets(strPackage As String) As ListViewItem() + + Dim dfDataframe As DataFrame = frmMain.clsRLink.RunInternalScriptGetValue( + "data.frame(data(package =" & Chr(34) & strPackage & Chr(34) & ")$results)[ ,3:4]", bSilent:=True)?.AsDataFrame() + + If dfDataframe Is Nothing Then + Return {} + End If + + Dim lstViewItems(dfDataframe.RowCount - 1) As ListViewItem + For i As Integer = 0 To dfDataframe.RowCount - 1 + Dim lstViewItem As New ListViewItem With { + .Text = dfDataframe(i, 0) + } + + 'lstViewItem.SubItems.Add(dfDataframe(i, 0)) + lstViewItem.SubItems.Add(If(dfDataframe.ColumnCount > 1, dfDataframe(i, 1), "")) + lstViewItems(i) = lstViewItem + Next + Return lstViewItems + + End Function + + Private Function GetFunctions(strPackage As String) As ListViewItem() + + Dim expTemp As GenericVector = frmMain.clsRLink.RunInternalScriptGetValue("ls(pos = asNamespace(" & Chr(34) & strPackage & Chr(34) & "))", bSilent:=True)?.AsList() + + If expTemp Is Nothing Then + Return {} + End If + + Dim lstViewItems(expTemp.Length - 1) As ListViewItem + For i = 0 To expTemp.Length - 1 + Dim lstViewItem As New ListViewItem With { + .Text = expTemp.AsCharacter(i) + } + lstViewItem.SubItems.Add("") + lstViewItems(i) = lstViewItem + Next + Return lstViewItems + + End Function + + Private Sub lstExampleCollection_Click(sender As Object, e As EventArgs) Handles lstExampleCollection.Click + If lstExampleCollection.SelectedItems.Count = 0 Then + Exit Sub + End If + + Dim strTopic As String = lstExampleCollection.SelectedItems(0).SubItems(0).Text + Try + + Dim clsLibraryExpFunction As New RFunction + clsLibraryExpFunction.SetRCommand("getExample") + clsLibraryExpFunction.AddParameter("package", Chr(34) & ucrCboExamplePackages.GetText() & Chr(34), iPosition:=1) + clsLibraryExpFunction.AddParameter("topic", Chr(34) & strTopic & Chr(34), iPosition:=0) + + Dim strExample As String = frmMain.clsRLink.RunInternalScriptGetValue(clsLibraryExpFunction.Clone.ToScript(), bSilent:=True).AsCharacter(0) + PreviewScript(strExample) + Catch ex As Exception + MsgBox(strTopic & " has a help file but no examples.") + End Try + End Sub + + + Private Sub txtScript_TextChanged(sender As Object, e As EventArgs) Handles txtScript.TextChanged ucrBase.clsRsyntax.SetCommandString(txtScript.Text) ucrBase.OKEnabled(txtScript.Text.Length > 0) @@ -294,9 +392,7 @@ Public Class dlgScript End Sub Private Sub TbFeatures_Selected(sender As Object, e As TabControlEventArgs) Handles tbFeatures.Selected - If e.TabPage Is tbPageLibrary Then - ucrCboLibPackage.OnControlContentsChanged() - ElseIf e.TabPage Is tbPageGetData Then + If e.TabPage Is tbPageGetData Then rdoGetDataFrame.Checked = True ucrPnlGetData.OnControlValueChanged() ElseIf e.TabPage Is tbPageSaveData Then @@ -308,7 +404,10 @@ Public Class dlgScript ucrCboLibPackage.GetSetSelectedIndex = -1 ucrInputRemoveObjects.SetName("") PreviewScript("") + ElseIf e.TabPage Is tbPageExamples Then + ucrCboExamplePackages.OnControlValueChanged() End If End Sub + End Class \ No newline at end of file From 2bcc6ebe168020bbbbd25dc21ae4ef646c2e3615 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Tue, 7 Nov 2023 12:16:26 +0300 Subject: [PATCH 13/27] inserting script to current cusror position changes --- instat/dlgScript.vb | 8 +++++++- instat/frmMain.vb | 8 ++------ instat/ucrButtons.vb | 17 ++++++++++++----- instat/ucrScript.vb | 40 ++++++++++++++++++---------------------- 4 files changed, 39 insertions(+), 34 deletions(-) diff --git a/instat/dlgScript.vb b/instat/dlgScript.vb index ea4370c24a0..880fc0fc95b 100644 --- a/instat/dlgScript.vb +++ b/instat/dlgScript.vb @@ -104,8 +104,10 @@ Public Class dlgScript ucrCboExamplePackages.SetDropDownStyleAsNonEditable() '------------------------------- - ' Hide base controls not supported in this dialog + ' base buttons controls not supported in this dialog + ucrBase.bAppendScriptsAtCurrentScriptWindowCursorPosition = True + ' hide controls not supported in this dialog ucrBase.chkComment.Checked = False ucrBase.chkComment.Visible = False ucrBase.txtComment.Visible = False @@ -409,5 +411,9 @@ Public Class dlgScript End If End Sub + 'Private Sub ucrBase_ClickOk(sender As Object, e As EventArgs) Handles ucrBase.ClickOk + ' frmMain.ucrScriptWindow.InsertText(0, txtScript.Text) + 'End Sub + End Class \ No newline at end of file diff --git a/instat/frmMain.vb b/instat/frmMain.vb index f0e8b145088..f9e59234716 100644 --- a/instat/frmMain.vb +++ b/instat/frmMain.vb @@ -553,10 +553,6 @@ Public Class frmMain Tool_strip.Enabled = bEnabled End Sub - Public Sub InsertTextToScriptWindow(iCurrentPos As Integer, strText As String) - ucrScriptWindow.InsertText(iCurrentPos, strText) - End Sub - Private Sub Application_Idle(sender As Object, e As EventArgs) If clsInstatOptions.bAutoSaveData AndAlso Not timer.Enabled AndAlso (ActiveForm Is Nothing OrElse ActiveForm.Equals(Me)) AndAlso Not clsRLink.bRCodeRunning Then AutoSaveData() @@ -606,8 +602,8 @@ Public Class frmMain End Try End Sub - Public Sub AddToScriptWindow(strText As String, Optional bMakeVisible As Boolean = True) - ucrScriptWindow.AppendText(strText) + Public Sub AddToScriptWindow(strText As String, Optional bMakeVisible As Boolean = True, Optional bAppendAtCurrentCursorPosition As Boolean = False) + ucrScriptWindow.AppendText(strText, bAppendAtCurrentCursorPosition:=bAppendAtCurrentCursorPosition) If bMakeVisible Then mnuViewLogScript.Checked = True UpdateLayout() diff --git a/instat/ucrButtons.vb b/instat/ucrButtons.vb index 3b2d8845bdd..ffbf5e0f2b0 100644 --- a/instat/ucrButtons.vb +++ b/instat/ucrButtons.vb @@ -20,6 +20,13 @@ Public Class ucrButtons Public clsRsyntax As RSyntax Public iHelpTopicID As Integer Public bFirstLoad As Boolean + + ''' + ''' When set to true, scripts will be appended at the current cursor position of the script window + ''' When set to false, scripts will appended at the below the last script in the script window + ''' + Public bAppendScriptsAtCurrentScriptWindowCursorPosition As Boolean = False + Public Event BeforeClickOk(sender As Object, e As EventArgs) Public Event ClickOk(sender As Object, e As EventArgs) Public Event ClickReset(sender As Object, e As EventArgs) @@ -128,7 +135,7 @@ Public Class ucrButtons strComments = "" End If If Not bRun AndAlso strComments <> "" Then - frmMain.AddToScriptWindow(frmMain.clsRLink.GetFormattedComment(strComments) & Environment.NewLine) + frmMain.AddToScriptWindow(frmMain.clsRLink.GetFormattedComment(strComments) & Environment.NewLine, bAppendAtCurrentCursorPosition:=bAppendScriptsAtCurrentScriptWindowCursorPosition) End If 'Get this list before doing ToScript then no need for global variable name @@ -147,7 +154,7 @@ Public Class ucrButtons If bRun Then frmMain.clsRLink.RunScript(lstBeforeScripts(i), iCallType:=lstBeforeCodes(i).iCallType, strComment:=strComment, bSeparateThread:=clsRsyntax.bSeparateThread) Else - frmMain.AddToScriptWindow(lstBeforeScripts(i)) + frmMain.AddToScriptWindow(lstBeforeScripts(i), bAppendAtCurrentCursorPosition:=bAppendScriptsAtCurrentScriptWindowCursorPosition) End If Next @@ -161,7 +168,7 @@ Public Class ucrButtons End If frmMain.clsRLink.RunScript(clsRsyntax.GetScript(), clsRsyntax.iCallType, strComment:=strComment, bSeparateThread:=clsRsyntax.bSeparateThread) Else - frmMain.AddToScriptWindow(clsRsyntax.GetScript()) + frmMain.AddToScriptWindow(clsRsyntax.GetScript(), bAppendAtCurrentCursorPosition:=bAppendScriptsAtCurrentScriptWindowCursorPosition) End If 'This clears the script after it has been run, but leave the function and parameters in the base function @@ -181,7 +188,7 @@ Public Class ucrButtons End If frmMain.clsRLink.RunScript(lstAfterScripts(i), iCallType:=lstAfterCodes(i).iCallType, strComment:=strComment, bSeparateThread:=clsRsyntax.bSeparateThread, bShowWaitDialogOverride:=clsRsyntax.bShowWaitDialogOverride) Else - frmMain.AddToScriptWindow(lstAfterScripts(i)) + frmMain.AddToScriptWindow(lstAfterScripts(i), bAppendAtCurrentCursorPosition:=bAppendScriptsAtCurrentScriptWindowCursorPosition) End If Next @@ -206,7 +213,7 @@ Public Class ucrButtons If bRun Then frmMain.clsRLink.RunScript(clsRemoveFunc.ToScript(), iCallType:=0) Else - frmMain.AddToScriptWindow(clsRemoveFunc.ToScript()) + frmMain.AddToScriptWindow(clsRemoveFunc.ToScript(), bAppendAtCurrentCursorPosition:=bAppendScriptsAtCurrentScriptWindowCursorPosition) End If End If End Sub diff --git a/instat/ucrScript.vb b/instat/ucrScript.vb index fafef95b118..ebba8e8493a 100644 --- a/instat/ucrScript.vb +++ b/instat/ucrScript.vb @@ -99,9 +99,20 @@ Public Class ucrScript ''' Appends to the end of the text in the active tab. ''' ''' The text to append to the contents of the active tab. - Public Sub AppendText(strText As String) - clsScriptActive.AppendText(Environment.NewLine & strText) - clsScriptActive.GotoPosition(clsScriptActive.TextLength) + Public Sub AppendText(strText As String, Optional bAppendAtCurrentCursorPosition As Boolean = False) + If String.IsNullOrEmpty(strText) Then + Exit Sub + End If + + If bAppendAtCurrentCursorPosition Then + clsScriptActive.InsertText(clsScriptActive.CurrentPosition, strText & Environment.NewLine) + clsScriptActive.GotoPosition(clsScriptActive.Lines(clsScriptActive.CurrentLine).EndPosition) + Else + clsScriptActive.AppendText(Environment.NewLine & strText) + clsScriptActive.GotoPosition(clsScriptActive.TextLength) + End If + + EnableDisableButtons() End Sub @@ -765,6 +776,10 @@ Public Class ucrScript LoadScript() End Sub + Private Sub mnuInsertScript_Click(sender As Object, e As EventArgs) Handles mnuInsertScript.Click, cmdInsertScript.Click + dlgScript.ShowDialog() + End Sub + Private Sub cmdRemoveTab_Click(sender As Object, e As EventArgs) Handles cmdRemoveTab.Click 'never remove last script tab If TabControl.TabCount < 2 Then @@ -960,7 +975,6 @@ Public Class ucrScript End If End Sub - Private Sub TabControl_DoubleClick(sender As Object, e As EventArgs) Handles TabControl.DoubleClick Dim rectangle = TabControl.GetTabRect(TabControl.SelectedIndex()) rectangle = TabControl.RectangleToScreen(rectangle) @@ -988,22 +1002,4 @@ Public Class ucrScript sender.Dispose() End Sub - ''' - ''' Insert to the current cursor position in the active tab. - ''' - ''' The current cursor position in the active tab. - ''' The text to insert to the contents of the active tab. - Public Sub InsertText(iCurrentPosition As Integer, strText As String) - strText = strText & Environment.NewLine - clsScriptActive.InsertText(iCurrentPosition, strText) - Dim iNextLinePos As Integer = clsScriptActive.Lines(clsScriptActive.CurrentLine).EndPosition - clsScriptActive.GotoPosition(iNextLinePos) - End Sub - - Private Sub mnuInsertScript_Click(sender As Object, e As EventArgs) Handles mnuInsertScript.Click, cmdInsertScript.Click - 'dlgScript.iCurrentPos = clsScriptActive.CurrentPosition - dlgScript.ShowDialog() - End Sub - - End Class From 9ada007492d33a481ea6736498d1eb3906a7129d Mon Sep 17 00:00:00 2001 From: patowhiz Date: Tue, 7 Nov 2023 13:19:23 +0300 Subject: [PATCH 14/27] added comment --- instat/ucrScript.vb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/instat/ucrScript.vb b/instat/ucrScript.vb index ebba8e8493a..b61537e146f 100644 --- a/instat/ucrScript.vb +++ b/instat/ucrScript.vb @@ -106,6 +106,8 @@ Public Class ucrScript If bAppendAtCurrentCursorPosition Then clsScriptActive.InsertText(clsScriptActive.CurrentPosition, strText & Environment.NewLine) + ' Todo. find a way of going to the last position of the inserted "group of text". + ' Currently this just goes to the last position of the first line of inserted text clsScriptActive.GotoPosition(clsScriptActive.Lines(clsScriptActive.CurrentLine).EndPosition) Else clsScriptActive.AppendText(Environment.NewLine & strText) From 14913b87517d1187a6123e2c91110b07b366c5db Mon Sep 17 00:00:00 2001 From: patowhiz Date: Wed, 8 Nov 2023 00:51:07 +0300 Subject: [PATCH 15/27] R command changes --- instat/dlgScript.Designer.vb | 132 ++++++++++++++++++++--------------- instat/dlgScript.vb | 46 ++++++++---- 2 files changed, 106 insertions(+), 72 deletions(-) diff --git a/instat/dlgScript.Designer.vb b/instat/dlgScript.Designer.vb index c63160df3f1..21f9ddf116c 100644 --- a/instat/dlgScript.Designer.vb +++ b/instat/dlgScript.Designer.vb @@ -47,11 +47,12 @@ Partial Class dlgScript Me.rdoGetColumn = New System.Windows.Forms.RadioButton() Me.ucrPnlGetData = New instat.UcrPanel() Me.ucrSelectorGetObject = New instat.ucrSelectorByDataFrameAddRemove() - Me.tbPageCommon = New System.Windows.Forms.TabPage() - Me.ucrCboLibPackage = New instat.ucrInputComboBox() - Me.lblGetPackage = New System.Windows.Forms.Label() - Me.lblRemoveObject = New System.Windows.Forms.Label() + Me.tbPageCommand = New System.Windows.Forms.TabPage() Me.ucrInputRemoveObjects = New instat.ucrInputTextBox() + Me.rdoCommandPackage = New System.Windows.Forms.RadioButton() + Me.ucrCboCommandPackage = New instat.ucrInputComboBox() + Me.rdoCommandObject = New System.Windows.Forms.RadioButton() + Me.ucrPnlCommands = New instat.UcrPanel() Me.tbPageExamples = New System.Windows.Forms.TabPage() Me.rdoExampleData = New System.Windows.Forms.RadioButton() Me.rdoExampleFunction = New System.Windows.Forms.RadioButton() @@ -67,7 +68,7 @@ Partial Class dlgScript Me.tbFeatures.SuspendLayout() Me.tbPageSaveData.SuspendLayout() Me.tbPageGetData.SuspendLayout() - Me.tbPageCommon.SuspendLayout() + Me.tbPageCommand.SuspendLayout() Me.tbPageExamples.SuspendLayout() Me.SuspendLayout() ' @@ -75,7 +76,7 @@ Partial Class dlgScript ' Me.tbFeatures.Controls.Add(Me.tbPageSaveData) Me.tbFeatures.Controls.Add(Me.tbPageGetData) - Me.tbFeatures.Controls.Add(Me.tbPageCommon) + Me.tbFeatures.Controls.Add(Me.tbPageCommand) Me.tbFeatures.Controls.Add(Me.tbPageExamples) Me.tbFeatures.Location = New System.Drawing.Point(8, 7) Me.tbFeatures.Name = "tbFeatures" @@ -212,7 +213,7 @@ Partial Class dlgScript Me.ucrDataFrameSaveOutputSelect.Location = New System.Drawing.Point(86, 54) Me.ucrDataFrameSaveOutputSelect.Margin = New System.Windows.Forms.Padding(0) Me.ucrDataFrameSaveOutputSelect.Name = "ucrDataFrameSaveOutputSelect" - Me.ucrDataFrameSaveOutputSelect.Size = New System.Drawing.Size(158, 47) + Me.ucrDataFrameSaveOutputSelect.Size = New System.Drawing.Size(224, 59) Me.ucrDataFrameSaveOutputSelect.TabIndex = 29 ' 'ucrPnlSaveData @@ -393,51 +394,22 @@ Partial Class dlgScript Me.ucrSelectorGetObject.Location = New System.Drawing.Point(9, 52) Me.ucrSelectorGetObject.Margin = New System.Windows.Forms.Padding(0) Me.ucrSelectorGetObject.Name = "ucrSelectorGetObject" - Me.ucrSelectorGetObject.Size = New System.Drawing.Size(222, 188) + Me.ucrSelectorGetObject.Size = New System.Drawing.Size(320, 274) Me.ucrSelectorGetObject.TabIndex = 34 ' - 'tbPageCommon - ' - Me.tbPageCommon.Controls.Add(Me.ucrCboLibPackage) - Me.tbPageCommon.Controls.Add(Me.lblGetPackage) - Me.tbPageCommon.Controls.Add(Me.lblRemoveObject) - Me.tbPageCommon.Controls.Add(Me.ucrInputRemoveObjects) - Me.tbPageCommon.Location = New System.Drawing.Point(4, 22) - Me.tbPageCommon.Name = "tbPageCommon" - Me.tbPageCommon.Size = New System.Drawing.Size(438, 245) - Me.tbPageCommon.TabIndex = 3 - Me.tbPageCommon.Text = "Common" - Me.tbPageCommon.UseVisualStyleBackColor = True - ' - 'ucrCboLibPackage - ' - Me.ucrCboLibPackage.AddQuotesIfUnrecognised = True - Me.ucrCboLibPackage.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrCboLibPackage.GetSetSelectedIndex = -1 - Me.ucrCboLibPackage.IsReadOnly = False - Me.ucrCboLibPackage.Location = New System.Drawing.Point(14, 28) - Me.ucrCboLibPackage.Margin = New System.Windows.Forms.Padding(9) - Me.ucrCboLibPackage.Name = "ucrCboLibPackage" - Me.ucrCboLibPackage.Size = New System.Drawing.Size(137, 21) - Me.ucrCboLibPackage.TabIndex = 44 - ' - 'lblGetPackage - ' - Me.lblGetPackage.AutoSize = True - Me.lblGetPackage.Location = New System.Drawing.Point(11, 11) - Me.lblGetPackage.Name = "lblGetPackage" - Me.lblGetPackage.Size = New System.Drawing.Size(73, 13) - Me.lblGetPackage.TabIndex = 43 - Me.lblGetPackage.Text = "Get Package:" - ' - 'lblRemoveObject - ' - Me.lblRemoveObject.AutoSize = True - Me.lblRemoveObject.Location = New System.Drawing.Point(12, 68) - Me.lblRemoveObject.Name = "lblRemoveObject" - Me.lblRemoveObject.Size = New System.Drawing.Size(95, 13) - Me.lblRemoveObject.TabIndex = 3 - Me.lblRemoveObject.Text = "Remove Object(s):" + 'tbPageCommand + ' + Me.tbPageCommand.Controls.Add(Me.ucrInputRemoveObjects) + Me.tbPageCommand.Controls.Add(Me.rdoCommandPackage) + Me.tbPageCommand.Controls.Add(Me.ucrCboCommandPackage) + Me.tbPageCommand.Controls.Add(Me.rdoCommandObject) + Me.tbPageCommand.Controls.Add(Me.ucrPnlCommands) + Me.tbPageCommand.Location = New System.Drawing.Point(4, 22) + Me.tbPageCommand.Name = "tbPageCommand" + Me.tbPageCommand.Size = New System.Drawing.Size(438, 245) + Me.tbPageCommand.TabIndex = 3 + Me.tbPageCommand.Text = "Commands" + Me.tbPageCommand.UseVisualStyleBackColor = True ' 'ucrInputRemoveObjects ' @@ -445,12 +417,57 @@ Partial Class dlgScript Me.ucrInputRemoveObjects.AutoSize = True Me.ucrInputRemoveObjects.IsMultiline = False Me.ucrInputRemoveObjects.IsReadOnly = False - Me.ucrInputRemoveObjects.Location = New System.Drawing.Point(11, 86) + Me.ucrInputRemoveObjects.Location = New System.Drawing.Point(156, 56) Me.ucrInputRemoveObjects.Margin = New System.Windows.Forms.Padding(9) Me.ucrInputRemoveObjects.Name = "ucrInputRemoveObjects" Me.ucrInputRemoveObjects.Size = New System.Drawing.Size(145, 21) Me.ucrInputRemoveObjects.TabIndex = 2 ' + 'rdoCommandPackage + ' + Me.rdoCommandPackage.AutoSize = True + Me.rdoCommandPackage.Location = New System.Drawing.Point(25, 23) + Me.rdoCommandPackage.Margin = New System.Windows.Forms.Padding(2) + Me.rdoCommandPackage.Name = "rdoCommandPackage" + Me.rdoCommandPackage.Size = New System.Drawing.Size(91, 17) + Me.rdoCommandPackage.TabIndex = 46 + Me.rdoCommandPackage.TabStop = True + Me.rdoCommandPackage.Text = "Get Package:" + Me.rdoCommandPackage.UseVisualStyleBackColor = True + ' + 'ucrCboCommandPackage + ' + Me.ucrCboCommandPackage.AddQuotesIfUnrecognised = True + Me.ucrCboCommandPackage.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboCommandPackage.GetSetSelectedIndex = -1 + Me.ucrCboCommandPackage.IsReadOnly = False + Me.ucrCboCommandPackage.Location = New System.Drawing.Point(156, 19) + Me.ucrCboCommandPackage.Margin = New System.Windows.Forms.Padding(9) + Me.ucrCboCommandPackage.Name = "ucrCboCommandPackage" + Me.ucrCboCommandPackage.Size = New System.Drawing.Size(137, 21) + Me.ucrCboCommandPackage.TabIndex = 44 + ' + 'rdoCommandObject + ' + Me.rdoCommandObject.AutoSize = True + Me.rdoCommandObject.Location = New System.Drawing.Point(25, 60) + Me.rdoCommandObject.Margin = New System.Windows.Forms.Padding(2) + Me.rdoCommandObject.Name = "rdoCommandObject" + Me.rdoCommandObject.Size = New System.Drawing.Size(113, 17) + Me.rdoCommandObject.TabIndex = 48 + Me.rdoCommandObject.TabStop = True + Me.rdoCommandObject.Text = "Remove Object(s):" + Me.rdoCommandObject.UseVisualStyleBackColor = True + ' + 'ucrPnlCommands + ' + Me.ucrPnlCommands.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlCommands.Location = New System.Drawing.Point(9, 8) + Me.ucrPnlCommands.Margin = New System.Windows.Forms.Padding(6) + Me.ucrPnlCommands.Name = "ucrPnlCommands" + Me.ucrPnlCommands.Size = New System.Drawing.Size(333, 143) + Me.ucrPnlCommands.TabIndex = 47 + ' 'tbPageExamples ' Me.tbPageExamples.Controls.Add(Me.rdoExampleData) @@ -607,8 +624,8 @@ Partial Class dlgScript Me.tbPageSaveData.PerformLayout() Me.tbPageGetData.ResumeLayout(False) Me.tbPageGetData.PerformLayout() - Me.tbPageCommon.ResumeLayout(False) - Me.tbPageCommon.PerformLayout() + Me.tbPageCommand.ResumeLayout(False) + Me.tbPageCommand.PerformLayout() Me.tbPageExamples.ResumeLayout(False) Me.tbPageExamples.PerformLayout() Me.ResumeLayout(False) @@ -623,7 +640,7 @@ Partial Class dlgScript Friend WithEvents tbPageSaveData As TabPage Friend WithEvents lblPreview As Label Friend WithEvents ucrSaveData As ucrSave - Friend WithEvents tbPageCommon As TabPage + Friend WithEvents tbPageCommand As TabPage Friend WithEvents ucrDataFrameSaveOutputSelect As ucrDataFrame Friend WithEvents ucrSelectorGetObject As ucrSelectorByDataFrameAddRemove Friend WithEvents lblGetOutputObject As Label @@ -644,10 +661,8 @@ Partial Class dlgScript Friend WithEvents ucrCboSaveOutputObjectType As ucrInputComboBox Friend WithEvents lblSaveObjectFormat As Label Friend WithEvents ucrCboSaveOutputObjectFormat As ucrInputComboBox - Friend WithEvents lblRemoveObject As Label Friend WithEvents ucrInputRemoveObjects As ucrInputTextBox - Friend WithEvents ucrCboLibPackage As ucrInputComboBox - Friend WithEvents lblGetPackage As Label + Friend WithEvents ucrCboCommandPackage As ucrInputComboBox Friend WithEvents ucrReceiverGetColumns As ucrReceiverMultiple Friend WithEvents lblGetColumn As Label Friend WithEvents lstExampleCollection As ListView @@ -658,4 +673,7 @@ Partial Class dlgScript Friend WithEvents rdoExampleData As RadioButton Friend WithEvents rdoExampleFunction As RadioButton Friend WithEvents ucrPnlExample As UcrPanel + Friend WithEvents ucrPnlCommands As UcrPanel + Friend WithEvents rdoCommandPackage As RadioButton + Friend WithEvents rdoCommandObject As RadioButton End Class diff --git a/instat/dlgScript.vb b/instat/dlgScript.vb index 880fc0fc95b..56f800df6d8 100644 --- a/instat/dlgScript.vb +++ b/instat/dlgScript.vb @@ -45,14 +45,6 @@ Public Class dlgScript dctOutputObjectFormats.Add("Text", RObjectFormat.Text) dctOutputObjectFormats.Add("Html", RObjectFormat.Html) - '-------------------------------- - ' Library controls - - 'todo. this combo box can be a custom package control in future. Its also needed in dlgHelpVignettes - ucrCboLibPackage.SetParameter(New RParameter("package", 0)) - ucrCboLibPackage.SetItems(GetPackages(), bAddConditions:=True) - ucrCboLibPackage.SetDropDownStyleAsNonEditable() - '-------------------------------- 'save controls ucrPnlSaveData.AddRadioButton(rdoSaveDataFrame) @@ -95,6 +87,18 @@ Public Class dlgScript ucrReceiverGetOutputObject.Selector = ucrSelectorGetObject ucrReceiverGetOutputObject.SetLinkedDisplayControl(lblGetOutputObject) + '-------------------------------- + ' Command controls + + 'todo. this combo box can be a custom package control in future. Its also needed in dlgHelpVignettes + ucrCboCommandPackage.SetParameter(New RParameter("package", 0)) + ucrCboCommandPackage.SetItems(GetPackages(), bAddConditions:=True) + ucrCboCommandPackage.SetDropDownStyleAsNonEditable() + + + ucrPnlCommands.AddRadioButton(rdoCommandPackage) + ucrPnlCommands.AddRadioButton(rdoCommandObject) + '-------------------------------- 'Get example controls ucrPnlExample.AddRadioButton(rdoExampleData) @@ -134,7 +138,9 @@ Public Class dlgScript ' Examples controls rdoExampleData.Checked = True - ' Common controls + ' Command controls + rdoCommandPackage.Checked = True + ucrCboCommandPackage.GetSetSelectedIndex = -1 ucrInputRemoveObjects.Reset() ' Save controls reset @@ -267,10 +273,22 @@ Public Class dlgScript PreviewScript(strAssignedScript) End Sub - Private Sub ucrCboLibPackage_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrCboLibPackage.ControlValueChanged + Private Sub ucrPnlCommands_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlCommands.ControlValueChanged + ucrCboCommandPackage.SetVisible(False) + ucrInputRemoveObjects.SetVisible(False) + If rdoCommandPackage.Checked Then + ucrCboCommandPackage.SetVisible(True) + ucrCboCommandPackage.OnControlValueChanged() + ElseIf rdoCommandObject.Checked Then + ucrInputRemoveObjects.SetVisible(True) + ucrInputRemoveObjects.OnControlValueChanged() + End If + End Sub + + Private Sub ucrCboLibPackage_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrCboCommandPackage.ControlValueChanged Dim clsLibraryFunction As New RFunction clsLibraryFunction.SetRCommand("library") - clsLibraryFunction.AddParameter("package", Chr(34) & ucrCboLibPackage.GetText() & Chr(34)) + clsLibraryFunction.AddParameter("package", Chr(34) & ucrCboCommandPackage.GetText() & Chr(34)) PreviewScript(clsLibraryFunction.ToScript) End Sub @@ -375,8 +393,6 @@ Public Class dlgScript End Try End Sub - - Private Sub txtScript_TextChanged(sender As Object, e As EventArgs) Handles txtScript.TextChanged ucrBase.clsRsyntax.SetCommandString(txtScript.Text) ucrBase.OKEnabled(txtScript.Text.Length > 0) @@ -400,10 +416,10 @@ Public Class dlgScript ElseIf e.TabPage Is tbPageSaveData Then rdoSaveDataFrame.Checked = True ucrPnlSaveData.OnControlValueChanged() - ElseIf e.TabPage Is tbPageCommon Then + ElseIf e.TabPage Is tbPageCommand Then 'alwys reset the common controls to be blank. 'the controls functionalities are not related - ucrCboLibPackage.GetSetSelectedIndex = -1 + ucrCboCommandPackage.GetSetSelectedIndex = -1 ucrInputRemoveObjects.SetName("") PreviewScript("") ElseIf e.TabPage Is tbPageExamples Then From cbc5c24183bdef4185f00c3be9870dd896fd46df Mon Sep 17 00:00:00 2001 From: patowhiz Date: Wed, 8 Nov 2023 00:51:32 +0300 Subject: [PATCH 16/27] script dialog changes --- instat/dlgScript.vb | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/instat/dlgScript.vb b/instat/dlgScript.vb index 56f800df6d8..5f015e68b62 100644 --- a/instat/dlgScript.vb +++ b/instat/dlgScript.vb @@ -402,13 +402,6 @@ Public Class dlgScript SetDefaults() End Sub - Private Sub PreviewScript(strNewScript As String) - txtScript.Text = strNewScript.Trim() & Environment.NewLine - txtScript.SelectionStart = txtScript.Text.Length - txtScript.ScrollToCaret() - txtScript.Refresh() - End Sub - Private Sub TbFeatures_Selected(sender As Object, e As TabControlEventArgs) Handles tbFeatures.Selected If e.TabPage Is tbPageGetData Then rdoGetDataFrame.Checked = True @@ -427,9 +420,12 @@ Public Class dlgScript End If End Sub - 'Private Sub ucrBase_ClickOk(sender As Object, e As EventArgs) Handles ucrBase.ClickOk - ' frmMain.ucrScriptWindow.InsertText(0, txtScript.Text) - 'End Sub + Private Sub PreviewScript(strNewScript As String) + txtScript.Text = strNewScript.Trim() & Environment.NewLine + txtScript.SelectionStart = txtScript.Text.Length + txtScript.ScrollToCaret() + txtScript.Refresh() + End Sub End Class \ No newline at end of file From a8c6eb859e5afacf240579b68bca1d1fca4439fa Mon Sep 17 00:00:00 2001 From: patowhiz Date: Wed, 8 Nov 2023 00:54:39 +0300 Subject: [PATCH 17/27] renamed an event --- instat/dlgScript.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/dlgScript.vb b/instat/dlgScript.vb index 5f015e68b62..f3155530ed9 100644 --- a/instat/dlgScript.vb +++ b/instat/dlgScript.vb @@ -402,7 +402,7 @@ Public Class dlgScript SetDefaults() End Sub - Private Sub TbFeatures_Selected(sender As Object, e As TabControlEventArgs) Handles tbFeatures.Selected + Private Sub tbFeatures_Selected(sender As Object, e As TabControlEventArgs) Handles tbFeatures.Selected If e.TabPage Is tbPageGetData Then rdoGetDataFrame.Checked = True ucrPnlGetData.OnControlValueChanged() From c7d9015979aa41f3fc4d5d06cdff41814741ffa8 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Thu, 9 Nov 2023 18:32:15 +0300 Subject: [PATCH 18/27] aded Ok button --- instat/dlgScript.vb | 2 +- instat/ucrButtons.vb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/instat/dlgScript.vb b/instat/dlgScript.vb index f3155530ed9..dd9938802c1 100644 --- a/instat/dlgScript.vb +++ b/instat/dlgScript.vb @@ -115,7 +115,7 @@ Public Class dlgScript ucrBase.chkComment.Checked = False ucrBase.chkComment.Visible = False ucrBase.txtComment.Visible = False - ucrBase.cmdOk.Visible = False + ucrBase.bAddScriptToScriptWindowOnClickOk = False End Sub diff --git a/instat/ucrButtons.vb b/instat/ucrButtons.vb index ffbf5e0f2b0..90a1302b5ef 100644 --- a/instat/ucrButtons.vb +++ b/instat/ucrButtons.vb @@ -26,6 +26,7 @@ Public Class ucrButtons ''' When set to false, scripts will appended at the below the last script in the script window ''' Public bAppendScriptsAtCurrentScriptWindowCursorPosition As Boolean = False + Public bAddScriptToScriptWindowOnClickOk As Boolean = True Public Event BeforeClickOk(sender As Object, e As EventArgs) Public Event ClickOk(sender As Object, e As EventArgs) @@ -56,7 +57,7 @@ Public Class ucrButtons '"Ok", "Ok and Close" and "Ok and Keep" Click event Private Sub Ok_Click(sender As Object, e As EventArgs) Handles cmdOk.Click, toolStripMenuItemOkClose.Click, toolStripMenuItemOkKeep.Click - OnScriptButtonsClick(sender, e, True, Not sender Is toolStripMenuItemOkKeep) + OnScriptButtonsClick(sender, e, bAddScriptToScriptWindowOnClickOk, Not sender Is toolStripMenuItemOkKeep) End Sub '"To Script", "To Script and Close" and "To Script and Keep" Click event From 67b256b041966e9d749167321070834a8c24efcb Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Fri, 10 Nov 2023 11:29:31 +0100 Subject: [PATCH 19/27] Fixed small issue on General Graphic Dialog --- instat/dlgGeneralForGraphics.vb | 2 - instat/ucrAdditionalLayers.Designer.vb | 110 ++++++++++++------------- instat/ucrAdditionalLayers.vb | 8 +- 3 files changed, 60 insertions(+), 60 deletions(-) diff --git a/instat/dlgGeneralForGraphics.vb b/instat/dlgGeneralForGraphics.vb index 0cbfcf389c5..d7df34f2472 100644 --- a/instat/dlgGeneralForGraphics.vb +++ b/instat/dlgGeneralForGraphics.vb @@ -245,14 +245,12 @@ Public Class dlgGeneralForGraphics End Sub Private Sub cmdOptions_Click(sender As Object, e As EventArgs) Handles cmdOptions.Click - sdgPlots.DisableLayersTab() sdgPlots.SetRCode(clsNewOperator:=ucrBase.clsRsyntax.clsBaseOperator, clsNewThemeFunction:=clsThemeFunction, dctNewThemeFunctions:=dctThemeFunctions, clsNewYScalecontinuousFunction:=clsYScalecontinuousFunction, clsNewXScalecontinuousFunction:=clsXScalecontinuousFunction, clsNewLabsFunction:=clsLabsFunction, clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabsFunction, clsNewFacetFunction:=clsFacetsFunction, clsNewScaleFillViridisFunction:=clsScaleFillViridisFunction, clsNewScaleColourViridisFunction:=clsScaleColourViridisFunction, clsNewGlobalAesFunction:=clsGlobalAesFunction, clsNewXScaleDateFunction:=clsXScaleDateFunction, clsNewYScaleDateFunction:=clsYScaleDateFunction, ucrNewBaseSelector:=sdgLayerOptions.ucrGeomWithAes.ucrGeomWithAesSelector, clsNewAnnotateFunction:=clsAnnotateFunction, clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, bReset:=bResetSubdialog) sdgPlots.ShowDialog() - sdgPlots.EnableLayersTab() bResetSubdialog = False End Sub diff --git a/instat/ucrAdditionalLayers.Designer.vb b/instat/ucrAdditionalLayers.Designer.vb index 5588aabaaf2..5498932ab25 100644 --- a/instat/ucrAdditionalLayers.Designer.vb +++ b/instat/ucrAdditionalLayers.Designer.vb @@ -45,27 +45,27 @@ Partial Class ucrAdditionalLayers Me.cmdDelete = New System.Windows.Forms.Button() Me.cmdAdd = New instat.ucrSplitButton() Me.contextMenuStripAdd = New System.Windows.Forms.ContextMenuStrip(Me.components) - Me.toolStripMenuItemGeomBoxPlot = New System.Windows.Forms.ToolStripMenuItem() Me.toolStripMenuItemGeomBar = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItemGeomBoxPlot = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItemGeomcategoricalmodel = New System.Windows.Forms.ToolStripMenuItem() Me.toolStripMenuItemGeomCol = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItemGeomcontour = New System.Windows.Forms.ToolStripMenuItem() Me.toolStripMenuItemGeomCount = New System.Windows.Forms.ToolStripMenuItem() Me.toolStripMenuItemGeomDensity = New System.Windows.Forms.ToolStripMenuItem() Me.toolStripMenuItemGeomDensityRidges = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItemGeomhistogram = 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() + Me.toolStripMenuItemGeomparallelslopes = New System.Windows.Forms.ToolStripMenuItem() Me.toolStripMenuItemGeomPoint = New System.Windows.Forms.ToolStripMenuItem() - Me.toolStripMenuItemGeomRugSmooth = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItemGeomRug = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItemGeomsmooth = 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.cmdEdit = New System.Windows.Forms.Button() Me.grpGeoms.SuspendLayout() Me.contextMenuStripAdd.SuspendLayout() Me.SuspendLayout() @@ -127,21 +127,27 @@ Partial Class ucrAdditionalLayers 'contextMenuStripAdd ' Me.contextMenuStripAdd.ImageScalingSize = New System.Drawing.Size(24, 24) - 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.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.toolStripMenuItemGeomRug, Me.toolStripMenuItemGeomsmooth, Me.toolStripMenuItemGeomText, Me.toolStripMenuItemGeomTextRepel, Me.toolStripMenuItemGeomtile}) Me.contextMenuStripAdd.Name = "contextMenuStripOk" Me.contextMenuStripAdd.Size = New System.Drawing.Size(208, 466) ' + 'toolStripMenuItemGeomBar + ' + Me.toolStripMenuItemGeomBar.Name = "toolStripMenuItemGeomBar" + Me.toolStripMenuItemGeomBar.Size = New System.Drawing.Size(207, 22) + Me.toolStripMenuItemGeomBar.Text = "geom_bar" + ' 'toolStripMenuItemGeomBoxPlot ' Me.toolStripMenuItemGeomBoxPlot.Name = "toolStripMenuItemGeomBoxPlot" Me.toolStripMenuItemGeomBoxPlot.Size = New System.Drawing.Size(207, 22) Me.toolStripMenuItemGeomBoxPlot.Text = "geom_boxplot" ' - 'toolStripMenuItemGeomBar + 'toolStripMenuItemGeomcategoricalmodel ' - Me.toolStripMenuItemGeomBar.Name = "toolStripMenuItemGeomBar" - Me.toolStripMenuItemGeomBar.Size = New System.Drawing.Size(207, 22) - Me.toolStripMenuItemGeomBar.Text = "geom_bar" + Me.toolStripMenuItemGeomcategoricalmodel.Name = "toolStripMenuItemGeomcategoricalmodel" + Me.toolStripMenuItemGeomcategoricalmodel.Size = New System.Drawing.Size(207, 22) + Me.toolStripMenuItemGeomcategoricalmodel.Text = "geom_categorical_model" ' 'toolStripMenuItemGeomCol ' @@ -149,6 +155,12 @@ Partial Class ucrAdditionalLayers Me.toolStripMenuItemGeomCol.Size = New System.Drawing.Size(207, 22) Me.toolStripMenuItemGeomCol.Text = "geom_col" ' + 'toolStripMenuItemGeomcontour + ' + Me.toolStripMenuItemGeomcontour.Name = "toolStripMenuItemGeomcontour" + Me.toolStripMenuItemGeomcontour.Size = New System.Drawing.Size(207, 22) + Me.toolStripMenuItemGeomcontour.Text = "geom_contour" + ' 'toolStripMenuItemGeomCount ' Me.toolStripMenuItemGeomCount.Name = "toolStripMenuItemGeomCount" @@ -167,6 +179,12 @@ Partial Class ucrAdditionalLayers Me.toolStripMenuItemGeomDensityRidges.Size = New System.Drawing.Size(207, 22) Me.toolStripMenuItemGeomDensityRidges.Text = "geom_density_ridges" ' + 'toolStripMenuItemGeomhistogram + ' + Me.toolStripMenuItemGeomhistogram.Name = "toolStripMenuItemGeomhistogram" + Me.toolStripMenuItemGeomhistogram.Size = New System.Drawing.Size(207, 22) + Me.toolStripMenuItemGeomhistogram.Text = "geom_histogram " + ' 'toolStripMenuItemGeomJitter ' Me.toolStripMenuItemGeomJitter.Name = "toolStripMenuItemGeomJitter" @@ -191,17 +209,29 @@ Partial Class ucrAdditionalLayers Me.toolStripMenuItemGeomLine.Size = New System.Drawing.Size(207, 22) Me.toolStripMenuItemGeomLine.Text = "geom_line" ' + 'toolStripMenuItemGeomparallelslopes + ' + Me.toolStripMenuItemGeomparallelslopes.Name = "toolStripMenuItemGeomparallelslopes" + Me.toolStripMenuItemGeomparallelslopes.Size = New System.Drawing.Size(207, 22) + Me.toolStripMenuItemGeomparallelslopes.Text = "geom_parallel_slopes" + ' 'toolStripMenuItemGeomPoint ' Me.toolStripMenuItemGeomPoint.Name = "toolStripMenuItemGeomPoint" Me.toolStripMenuItemGeomPoint.Size = New System.Drawing.Size(207, 22) Me.toolStripMenuItemGeomPoint.Text = "geom_point" ' - 'toolStripMenuItemGeomRugSmooth + 'toolStripMenuItemGeomRug + ' + Me.toolStripMenuItemGeomRug.Name = "toolStripMenuItemGeomRug" + Me.toolStripMenuItemGeomRug.Size = New System.Drawing.Size(207, 22) + Me.toolStripMenuItemGeomRug.Text = "geom_rug" ' - Me.toolStripMenuItemGeomRugSmooth.Name = "toolStripMenuItemGeomRugSmooth" - Me.toolStripMenuItemGeomRugSmooth.Size = New System.Drawing.Size(207, 22) - Me.toolStripMenuItemGeomRugSmooth.Text = "geom_rug" + 'toolStripMenuItemGeomsmooth + ' + Me.toolStripMenuItemGeomsmooth.Name = "toolStripMenuItemGeomsmooth" + Me.toolStripMenuItemGeomsmooth.Size = New System.Drawing.Size(207, 22) + Me.toolStripMenuItemGeomsmooth.Text = "geom_smooth" ' 'toolStripMenuItemGeomText ' @@ -215,6 +245,12 @@ Partial Class ucrAdditionalLayers Me.toolStripMenuItemGeomTextRepel.Size = New System.Drawing.Size(207, 22) Me.toolStripMenuItemGeomTextRepel.Text = "geom_text_repel" ' + 'toolStripMenuItemGeomtile + ' + Me.toolStripMenuItemGeomtile.Name = "toolStripMenuItemGeomtile" + Me.toolStripMenuItemGeomtile.Size = New System.Drawing.Size(207, 22) + Me.toolStripMenuItemGeomtile.Text = "geom_tile" + ' 'cmdEdit ' Me.cmdEdit.Location = New System.Drawing.Point(16, 43) @@ -224,42 +260,6 @@ Partial Class ucrAdditionalLayers 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(96.0!, 96.0!) @@ -295,13 +295,13 @@ Partial Class ucrAdditionalLayers Friend WithEvents toolStripMenuItemGeomLabelRepel As ToolStripMenuItem Friend WithEvents toolStripMenuItemGeomLine As ToolStripMenuItem Friend WithEvents toolStripMenuItemGeomPoint As ToolStripMenuItem - Friend WithEvents toolStripMenuItemGeomRugSmooth As ToolStripMenuItem + Friend WithEvents toolStripMenuItemGeomRug 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 toolStripMenuItemGeomsmooth As ToolStripMenuItem Friend WithEvents toolStripMenuItemGeomtile As ToolStripMenuItem End Class diff --git a/instat/ucrAdditionalLayers.vb b/instat/ucrAdditionalLayers.vb index a5431af837e..eda967b1579 100644 --- a/instat/ucrAdditionalLayers.vb +++ b/instat/ucrAdditionalLayers.vb @@ -92,7 +92,7 @@ Public Class ucrAdditionalLayers 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 + toolStripMenuItemGeomLabelRepel.Click, toolStripMenuItemGeomLine.Click, toolStripMenuItemGeomsmooth.Click, toolStripMenuItemGeomPoint.Click, toolStripMenuItemGeomRug.Click, toolStripMenuItemGeomText.Click, toolStripMenuItemGeomTextRepel.Click, toolStripMenuItemGeomDensityRidges.Click 'setup the geom function to use Dim clsNewGeomFunction As New RFunction @@ -130,8 +130,10 @@ Public Class ucrAdditionalLayers strGeomRCommand = "geom_line" ElseIf sender Is toolStripMenuItemGeomPoint Then strGeomRCommand = "geom_point" - ElseIf sender Is toolStripMenuItemGeomRugSmooth Then - strGeomRCommand = "geom_rug_smooth" + ElseIf sender Is toolStripMenuItemGeomRug Then + strGeomRCommand = "geom_rug" + ElseIf sender Is toolStripMenuItemGeomsmooth Then + strGeomRCommand = "geom_smooth" ElseIf sender Is toolStripMenuItemGeomText Then strGeomRCommand = "geom_text" ElseIf sender Is toolStripMenuItemGeomTextRepel Then From 3c5c2263555c7bc0111dd72a24eeceb4b9413b91 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Fri, 10 Nov 2023 21:44:13 +0300 Subject: [PATCH 20/27] Added comments that describe the commands inserted --- instat/dlgScript.vb | 122 +++++++++++++++++++++++++++++--------------- 1 file changed, 80 insertions(+), 42 deletions(-) diff --git a/instat/dlgScript.vb b/instat/dlgScript.vb index dd9938802c1..ac3107c2e7a 100644 --- a/instat/dlgScript.vb +++ b/instat/dlgScript.vb @@ -167,11 +167,14 @@ Public Class dlgScript ucrCboSaveOutputObjectType.SetVisible(False) ucrCboSaveOutputObjectFormat.SetVisible(False) If rdoSaveDataFrame.Checked Then + ucrSaveData.Location = New Point(ucrSaveData.Location.X, ucrDataFrameSaveOutputSelect.Location.Y) SetupSaveDataControl("Data Frame", RObjectTypeLabel.Dataframe, "") ElseIf rdoSaveColumn.Checked Then + ucrSaveData.Location = New Point(ucrSaveData.Location.X, ucrCboSaveOutputObjectType.Location.Y) ucrDataFrameSaveOutputSelect.SetVisible(True) SetupSaveDataControl("Column", RObjectTypeLabel.Column, "") ElseIf rdoSaveOutputObject.Checked Then + ucrSaveData.Location = New Point(ucrSaveData.Location.X, ucrCboSaveOutputObjectFormat.Location.Y + 33) ucrDataFrameSaveOutputSelect.SetVisible(True) ucrCboSaveOutputObjectType.SetVisible(True) ucrCboSaveOutputObjectFormat.SetVisible(True) @@ -191,27 +194,33 @@ Public Class dlgScript ucrSaveData.SetLabelText(strLabel) ucrSaveData.SetName("") - 'change location of the save control if it's the data frame option selected If strDataType = RObjectTypeLabel.Dataframe Then ucrSaveData.SetIsTextBox() - ucrSaveData.Location = New Point(ucrSaveData.Location.X, ucrDataFrameSaveOutputSelect.Location.Y) Else ucrSaveData.SetIsComboBox() - ucrSaveData.Location = If(strDataType = RObjectTypeLabel.Column, - New Point(ucrSaveData.Location.X, ucrCboSaveOutputObjectType.Location.Y), - New Point(ucrSaveData.Location.X, ucrCboSaveOutputObjectFormat.Location.Y + 33)) End If - End Sub Private Sub ucrSaveData_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSaveData.ControlContentsChanged + Dim strScript As String = "" + + If ucrSaveData.IsComplete Then + ' R code is not automatiucally updated by save control when control contents changed event is raised by the control + ucrSaveData.UpdateRCode() + + Dim strDataType As String = "" + If rdoSaveDataFrame.Checked Then + strDataType = "data frame" + ElseIf rdoSaveColumn.Checked Then + strDataType = "column" + ElseIf rdoSaveOutputObject.Checked Then + strDataType = ucrCboSaveOutputObjectType.GetText().ToLower() + End If + + strScript = "# Save " & strDataType & " """ & ucrSaveData.GetText() & """" & Environment.NewLine & clsSaveDataFunction.Clone.ToScript() + End If - ' R code is not automatiucally updated by save control when control contents changed event is raised by the control - ucrSaveData.UpdateRCode() - - Dim strAssignedScript As String = "" - clsSaveDataFunction.Clone.ToScript(strScript:=strAssignedScript) - PreviewScript(strAssignedScript) + PreviewScript(strScript) End Sub Private Sub ucrPnlGetData_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlGetData.ControlValueChanged @@ -247,17 +256,29 @@ Public Class dlgScript End Sub Private Sub ucrDataFrameGet_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrDataFrameGetDF.ControlContentsChanged - Dim strAssignedScript As String = "" - ucrDataFrameGetDF.clsCurrDataFrame.Clone().ToScript(strAssignedScript) - PreviewScript(strAssignedScript) + Dim strScript As String = "" + + If String.IsNullOrEmpty(ucrDataFrameGetDF.strCurrDataFrame) Then + Dim strAssignedScript As String = "" + ucrDataFrameGetDF.clsCurrDataFrame.Clone().ToScript(strAssignedScript) + strScript = "# Get data frame """ & ucrDataFrameGetDF.strCurrDataFrame & """" & Environment.NewLine & strAssignedScript + End If + + PreviewScript(strScript) End Sub Private Sub ucrReceiverGetColumns_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverGetColumns.ControlContentsChanged - Dim clsRFunction As RFunction = ucrReceiverGetColumns.GetVariables() - Dim strAssignedScript As String = "" - clsRFunction.SetAssignTo(ucrSelectorGetObject.strCurrentDataFrame & "_cols") - clsRFunction.ToScript(strScript:=strAssignedScript) - PreviewScript(strAssignedScript) + Dim strScript As String = "" + + If Not ucrReceiverGetColumns.IsEmpty() Then + Dim clsRFunction As RFunction = ucrReceiverGetColumns.GetVariables() + Dim strAssignedScript As String = "" + clsRFunction.SetAssignTo(ucrSelectorGetObject.strCurrentDataFrame & "_cols") + clsRFunction.ToScript(strScript:=strAssignedScript) + strScript = "# Get column(s) " & String.Join(",", ucrReceiverGetColumns.GetVariableNamesList(bWithQuotes:=True)) & Environment.NewLine & strAssignedScript + End If + + PreviewScript(strScript) End Sub Private Sub ucrInputGetObjectType_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrCboGetOutputObjectType.ControlValueChanged @@ -267,10 +288,16 @@ Public Class dlgScript End Sub Private Sub ucrReceiverGetOutputObject_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverGetOutputObject.ControlContentsChanged - Dim clsRFunction As RFunction = ucrReceiverGetOutputObject.GetVariables() - Dim strAssignedScript As String = "" - clsRFunction.ToScript(strScript:=strAssignedScript) - PreviewScript(strAssignedScript) + Dim strScript As String = "" + + If Not ucrReceiverGetOutputObject.IsEmpty() Then + Dim clsRFunction As RFunction = ucrReceiverGetOutputObject.GetVariables() + Dim strAssignedScript As String = "" + clsRFunction.ToScript(strScript:=strAssignedScript) + strScript = "# Get " & ucrCboGetOutputObjectType.GetText().ToLower() & " " & ucrReceiverGetOutputObject.GetVariableNames(bWithQuotes:=True) & Environment.NewLine & strAssignedScript + End If + + PreviewScript(strScript) End Sub Private Sub ucrPnlCommands_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlCommands.ControlValueChanged @@ -286,30 +313,41 @@ Public Class dlgScript End Sub Private Sub ucrCboLibPackage_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrCboCommandPackage.ControlValueChanged - Dim clsLibraryFunction As New RFunction - clsLibraryFunction.SetRCommand("library") - clsLibraryFunction.AddParameter("package", Chr(34) & ucrCboCommandPackage.GetText() & Chr(34)) - PreviewScript(clsLibraryFunction.ToScript) + Dim strScript As String = "" + + If Not ucrCboCommandPackage.IsEmpty() Then + Dim clsLibraryFunction As New RFunction + clsLibraryFunction.SetRCommand("library") + clsLibraryFunction.AddParameter("package", Chr(34) & ucrCboCommandPackage.GetText() & Chr(34)) + strScript = "# Load library """ & ucrCboCommandPackage.GetText() & """" & Environment.NewLine & clsLibraryFunction.ToScript + End If + + PreviewScript(strScript) End Sub Private Sub ucrInputRemoveObject_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputRemoveObjects.ControlContentsChanged - 'create function to remove the objects added in the script - Dim lstAssignToStrings As String() = ucrInputRemoveObjects.GetText().Split(",") - Dim clsRemoveFunc As New RFunction - Dim clsRemoveListFun As New RFunction - clsRemoveFunc.SetRCommand("rm") - clsRemoveListFun.SetRCommand("c") - - For i As Integer = 0 To lstAssignToStrings.Count - 1 - clsRemoveListFun.AddParameter(i, Chr(34) & lstAssignToStrings(i) & Chr(34), bIncludeArgumentName:=False) - Next - clsRemoveFunc.AddParameter("list", clsRFunctionParameter:=clsRemoveListFun) + Dim strScript As String = "" + + If Not ucrInputRemoveObjects.IsEmpty() Then + ' Create function to remove the objects added in the script + Dim lstAssignToStrings As String() = ucrInputRemoveObjects.GetText().Split(",") + Dim clsRemoveFunc As New RFunction + Dim clsRemoveListFun As New RFunction + clsRemoveFunc.SetRCommand("rm") + clsRemoveListFun.SetRCommand("c") + + For i As Integer = 0 To lstAssignToStrings.Count - 1 + lstAssignToStrings.SetValue(Chr(34) & lstAssignToStrings(i) & Chr(34), i) + clsRemoveListFun.AddParameter(i, lstAssignToStrings(i), bIncludeArgumentName:=False) + Next + clsRemoveFunc.AddParameter("list", clsRFunctionParameter:=clsRemoveListFun) + strScript = "# Remove object(s) " & String.Join(",", lstAssignToStrings) & Environment.NewLine & clsRemoveFunc.ToScript() + End If - PreviewScript(clsRemoveFunc.ToScript()) + PreviewScript(strScript) End Sub Private Sub ucrComboGetPackages_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrCboExamplePackages.ControlValueChanged, ucrPnlExample.ControlValueChanged - PreviewScript("") lstExampleCollection.Items.Clear() @@ -421,7 +459,7 @@ Public Class dlgScript End Sub Private Sub PreviewScript(strNewScript As String) - txtScript.Text = strNewScript.Trim() & Environment.NewLine + txtScript.Text = strNewScript & Environment.NewLine txtScript.SelectionStart = txtScript.Text.Length txtScript.ScrollToCaret() txtScript.Refresh() From 094b7bf751a9ae89ed38902c5c0e77e29b6453c8 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Fri, 10 Nov 2023 22:56:31 +0300 Subject: [PATCH 21/27] removed ##D --- instat/dlgScript.vb | 1 + 1 file changed, 1 insertion(+) diff --git a/instat/dlgScript.vb b/instat/dlgScript.vb index ac3107c2e7a..d6767c0ca2b 100644 --- a/instat/dlgScript.vb +++ b/instat/dlgScript.vb @@ -425,6 +425,7 @@ Public Class dlgScript clsLibraryExpFunction.AddParameter("topic", Chr(34) & strTopic & Chr(34), iPosition:=0) Dim strExample As String = frmMain.clsRLink.RunInternalScriptGetValue(clsLibraryExpFunction.Clone.ToScript(), bSilent:=True).AsCharacter(0) + strExample = strExample.Replace("##D", String.Empty) PreviewScript(strExample) Catch ex As Exception MsgBox(strTopic & " has a help file but no examples.") From f655af0d75245ffcf2c798a72fc796701db75025 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Sat, 11 Nov 2023 19:24:12 +0300 Subject: [PATCH 22/27] Rectified the commands --- instat/dlgScript.vb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/instat/dlgScript.vb b/instat/dlgScript.vb index d6767c0ca2b..292b58dae73 100644 --- a/instat/dlgScript.vb +++ b/instat/dlgScript.vb @@ -216,8 +216,14 @@ Public Class dlgScript ElseIf rdoSaveOutputObject.Checked Then strDataType = ucrCboSaveOutputObjectType.GetText().ToLower() End If - - strScript = "# Save " & strDataType & " """ & ucrSaveData.GetText() & """" & Environment.NewLine & clsSaveDataFunction.Clone.ToScript() + Dim strTemp As String = "" + clsSaveDataFunction.Clone.ToScript(strTemp) + Dim arrtemp() As String = strTemp.Trim().Split(Environment.NewLine) + If arrtemp.Length > 1 Then + 'ignore the first line of the script because it is an "empty" assignment + strTemp = arrtemp(1) + strScript = "# Save " & strDataType & " """ & ucrSaveData.GetText() & """" & Environment.NewLine & strTemp + End If End If PreviewScript(strScript) @@ -258,7 +264,7 @@ Public Class dlgScript Private Sub ucrDataFrameGet_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrDataFrameGetDF.ControlContentsChanged Dim strScript As String = "" - If String.IsNullOrEmpty(ucrDataFrameGetDF.strCurrDataFrame) Then + If Not String.IsNullOrEmpty(ucrDataFrameGetDF.strCurrDataFrame) Then Dim strAssignedScript As String = "" ucrDataFrameGetDF.clsCurrDataFrame.Clone().ToScript(strAssignedScript) strScript = "# Get data frame """ & ucrDataFrameGetDF.strCurrDataFrame & """" & Environment.NewLine & strAssignedScript From a1f18b625de611e65713d91e8799fff6e814532a Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Wed, 15 Nov 2023 16:37:44 +0100 Subject: [PATCH 23/27] change made --- instat/dlgGeneralForGraphics.Designer.vb | 198 ++++++++++++----------- instat/dlgGeneralForGraphics.vb | 12 ++ instat/sdgPlots.vb | 44 ++--- 3 files changed, 141 insertions(+), 113 deletions(-) diff --git a/instat/dlgGeneralForGraphics.Designer.vb b/instat/dlgGeneralForGraphics.Designer.vb index 83f97eba464..cd1d1872096 100644 --- a/instat/dlgGeneralForGraphics.Designer.vb +++ b/instat/dlgGeneralForGraphics.Designer.vb @@ -46,17 +46,11 @@ Partial Class dlgGeneralForGraphics Me.cmdXAxis = New System.Windows.Forms.Button() Me.cmdTitles = New System.Windows.Forms.Button() Me.grpAethetics = New System.Windows.Forms.GroupBox() - Me.ucrChkUseasNumeric = New instat.ucrCheck() - Me.ucrReceiverY = New instat.ucrReceiverSingle() Me.lblYVariable = New System.Windows.Forms.Label() Me.lblXVariable = New System.Windows.Forms.Label() - Me.ucrReceiverX = New instat.ucrReceiverSingle() Me.lblLabel = New System.Windows.Forms.Label() - Me.ucrLabelReceiver = New instat.ucrReceiverSingle() Me.lblColour = New System.Windows.Forms.Label() - Me.ucrColourReceiver = New instat.ucrReceiverSingle() Me.lblFill = New System.Windows.Forms.Label() - Me.ucrFillReceiver = New instat.ucrReceiverSingle() Me.ContextMenuPackagesList = New System.Windows.Forms.ContextMenuStrip(Me.components) Me.ListBaseToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.GeomtextpathToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() @@ -83,6 +77,12 @@ Partial Class dlgGeneralForGraphics Me.GgthemesToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.GgwordbuildToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.cmdRHelp = New instat.ucrSplitButton() + Me.ucrChkUseasNumeric = New instat.ucrCheck() + Me.ucrReceiverY = New instat.ucrReceiverSingle() + Me.ucrReceiverX = New instat.ucrReceiverSingle() + Me.ucrLabelReceiver = New instat.ucrReceiverSingle() + Me.ucrColourReceiver = New instat.ucrReceiverSingle() + Me.ucrFillReceiver = New instat.ucrReceiverSingle() Me.ucrInputLegendPosition = New instat.ucrInputComboBox() Me.ucrChkFlipCoordinates = New instat.ucrCheck() Me.ucrChkLegend = New instat.ucrCheck() @@ -90,6 +90,7 @@ Partial Class dlgGeneralForGraphics Me.ucrGraphicsSelector = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrAdditionalLayers = New instat.ucrAdditionalLayers() Me.ucrBase = New instat.ucrButtons() + Me.cmdColour = New System.Windows.Forms.Button() Me.grpAethetics.SuspendLayout() Me.ContextMenuPackagesList.SuspendLayout() Me.SuspendLayout() @@ -99,18 +100,18 @@ Partial Class dlgGeneralForGraphics Me.cmdOptions.ImeMode = System.Windows.Forms.ImeMode.NoControl Me.cmdOptions.Location = New System.Drawing.Point(6, 401) Me.cmdOptions.Name = "cmdOptions" - Me.cmdOptions.Size = New System.Drawing.Size(135, 25) + Me.cmdOptions.Size = New System.Drawing.Size(81, 25) Me.cmdOptions.TabIndex = 7 Me.cmdOptions.Tag = "Options" - Me.cmdOptions.Text = "Plot Options" + Me.cmdOptions.Text = "Plot" Me.cmdOptions.UseVisualStyleBackColor = True ' 'cmdFacets ' Me.cmdFacets.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdFacets.Location = New System.Drawing.Point(139, 401) + Me.cmdFacets.Location = New System.Drawing.Point(86, 401) Me.cmdFacets.Name = "cmdFacets" - Me.cmdFacets.Size = New System.Drawing.Size(64, 25) + Me.cmdFacets.Size = New System.Drawing.Size(57, 25) Me.cmdFacets.TabIndex = 17 Me.cmdFacets.Tag = "Facets" Me.cmdFacets.Text = "Facets" @@ -119,20 +120,20 @@ Partial Class dlgGeneralForGraphics 'cmdTheme ' Me.cmdTheme.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdTheme.Location = New System.Drawing.Point(401, 401) + Me.cmdTheme.Location = New System.Drawing.Point(324, 401) Me.cmdTheme.Name = "cmdTheme" Me.cmdTheme.Size = New System.Drawing.Size(65, 25) Me.cmdTheme.TabIndex = 21 Me.cmdTheme.Tag = "Theme" - Me.cmdTheme.Text = "Theme" + Me.cmdTheme.Text = "Themes" Me.cmdTheme.UseVisualStyleBackColor = True ' 'cmdYAxis ' Me.cmdYAxis.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdYAxis.Location = New System.Drawing.Point(334, 401) + Me.cmdYAxis.Location = New System.Drawing.Point(261, 401) Me.cmdYAxis.Name = "cmdYAxis" - Me.cmdYAxis.Size = New System.Drawing.Size(69, 25) + Me.cmdYAxis.Size = New System.Drawing.Size(64, 25) Me.cmdYAxis.TabIndex = 20 Me.cmdYAxis.Tag = "" Me.cmdYAxis.Text = "Y-Axis" @@ -141,9 +142,9 @@ Partial Class dlgGeneralForGraphics 'cmdXAxis ' Me.cmdXAxis.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdXAxis.Location = New System.Drawing.Point(266, 401) + Me.cmdXAxis.Location = New System.Drawing.Point(201, 401) Me.cmdXAxis.Name = "cmdXAxis" - Me.cmdXAxis.Size = New System.Drawing.Size(71, 25) + Me.cmdXAxis.Size = New System.Drawing.Size(61, 25) Me.cmdXAxis.TabIndex = 19 Me.cmdXAxis.Tag = "" Me.cmdXAxis.Text = "X-Axis" @@ -152,9 +153,9 @@ Partial Class dlgGeneralForGraphics 'cmdTitles ' Me.cmdTitles.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdTitles.Location = New System.Drawing.Point(201, 401) + Me.cmdTitles.Location = New System.Drawing.Point(142, 401) Me.cmdTitles.Name = "cmdTitles" - Me.cmdTitles.Size = New System.Drawing.Size(67, 25) + Me.cmdTitles.Size = New System.Drawing.Size(60, 25) Me.cmdTitles.TabIndex = 18 Me.cmdTitles.Tag = "" Me.cmdTitles.Text = "Titles" @@ -180,28 +181,6 @@ Partial Class dlgGeneralForGraphics Me.grpAethetics.TabStop = False Me.grpAethetics.Text = "Aethetics:" ' - 'ucrChkUseasNumeric - ' - Me.ucrChkUseasNumeric.AutoSize = True - Me.ucrChkUseasNumeric.Checked = False - Me.ucrChkUseasNumeric.Location = New System.Drawing.Point(24, 107) - Me.ucrChkUseasNumeric.Name = "ucrChkUseasNumeric" - Me.ucrChkUseasNumeric.Size = New System.Drawing.Size(126, 24) - Me.ucrChkUseasNumeric.TabIndex = 4 - ' - 'ucrReceiverY - ' - Me.ucrReceiverY.AutoSize = True - Me.ucrReceiverY.frmParent = Me - Me.ucrReceiverY.Location = New System.Drawing.Point(24, 36) - Me.ucrReceiverY.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverY.Name = "ucrReceiverY" - Me.ucrReceiverY.Selector = Nothing - Me.ucrReceiverY.Size = New System.Drawing.Size(125, 20) - Me.ucrReceiverY.strNcFilePath = "" - Me.ucrReceiverY.TabIndex = 1 - Me.ucrReceiverY.ucrSelector = Nothing - ' 'lblYVariable ' Me.lblYVariable.AutoSize = True @@ -224,19 +203,6 @@ Partial Class dlgGeneralForGraphics Me.lblXVariable.Tag = "X_Variable:" Me.lblXVariable.Text = "X Variable:" ' - 'ucrReceiverX - ' - Me.ucrReceiverX.AutoSize = True - Me.ucrReceiverX.frmParent = Me - Me.ucrReceiverX.Location = New System.Drawing.Point(24, 81) - Me.ucrReceiverX.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverX.Name = "ucrReceiverX" - Me.ucrReceiverX.Selector = Nothing - Me.ucrReceiverX.Size = New System.Drawing.Size(125, 27) - Me.ucrReceiverX.strNcFilePath = "" - Me.ucrReceiverX.TabIndex = 3 - Me.ucrReceiverX.ucrSelector = Nothing - ' 'lblLabel ' Me.lblLabel.AutoSize = True @@ -248,19 +214,6 @@ Partial Class dlgGeneralForGraphics Me.lblLabel.Tag = "Label:" Me.lblLabel.Text = "Label:" ' - 'ucrLabelReceiver - ' - Me.ucrLabelReceiver.AutoSize = True - Me.ucrLabelReceiver.frmParent = Me - Me.ucrLabelReceiver.Location = New System.Drawing.Point(25, 229) - Me.ucrLabelReceiver.Margin = New System.Windows.Forms.Padding(0) - Me.ucrLabelReceiver.Name = "ucrLabelReceiver" - Me.ucrLabelReceiver.Selector = Nothing - Me.ucrLabelReceiver.Size = New System.Drawing.Size(125, 25) - Me.ucrLabelReceiver.strNcFilePath = "" - Me.ucrLabelReceiver.TabIndex = 9 - Me.ucrLabelReceiver.ucrSelector = Nothing - ' 'lblColour ' Me.lblColour.AutoSize = True @@ -272,19 +225,6 @@ Partial Class dlgGeneralForGraphics Me.lblColour.Tag = "Fill_Colour:" Me.lblColour.Text = "Colour:" ' - 'ucrColourReceiver - ' - Me.ucrColourReceiver.AutoSize = True - Me.ucrColourReceiver.frmParent = Me - Me.ucrColourReceiver.Location = New System.Drawing.Point(25, 189) - Me.ucrColourReceiver.Margin = New System.Windows.Forms.Padding(0) - Me.ucrColourReceiver.Name = "ucrColourReceiver" - Me.ucrColourReceiver.Selector = Nothing - Me.ucrColourReceiver.Size = New System.Drawing.Size(125, 25) - Me.ucrColourReceiver.strNcFilePath = "" - Me.ucrColourReceiver.TabIndex = 7 - Me.ucrColourReceiver.ucrSelector = Nothing - ' 'lblFill ' Me.lblFill.AutoSize = True @@ -296,19 +236,6 @@ Partial Class dlgGeneralForGraphics Me.lblFill.Tag = "Fill_Colour:" Me.lblFill.Text = "Fill:" ' - 'ucrFillReceiver - ' - Me.ucrFillReceiver.AutoSize = True - Me.ucrFillReceiver.frmParent = Me - Me.ucrFillReceiver.Location = New System.Drawing.Point(25, 150) - Me.ucrFillReceiver.Margin = New System.Windows.Forms.Padding(0) - Me.ucrFillReceiver.Name = "ucrFillReceiver" - Me.ucrFillReceiver.Selector = Nothing - Me.ucrFillReceiver.Size = New System.Drawing.Size(125, 25) - Me.ucrFillReceiver.strNcFilePath = "" - Me.ucrFillReceiver.TabIndex = 5 - Me.ucrFillReceiver.ucrSelector = Nothing - ' 'ContextMenuPackagesList ' Me.ContextMenuPackagesList.ImageScalingSize = New System.Drawing.Size(24, 24) @@ -472,6 +399,80 @@ Partial Class dlgGeneralForGraphics Me.cmdRHelp.Text = "R Help" Me.cmdRHelp.UseVisualStyleBackColor = True ' + 'ucrChkUseasNumeric + ' + Me.ucrChkUseasNumeric.AutoSize = True + Me.ucrChkUseasNumeric.Checked = False + Me.ucrChkUseasNumeric.Location = New System.Drawing.Point(24, 107) + Me.ucrChkUseasNumeric.Name = "ucrChkUseasNumeric" + Me.ucrChkUseasNumeric.Size = New System.Drawing.Size(126, 24) + Me.ucrChkUseasNumeric.TabIndex = 4 + ' + 'ucrReceiverY + ' + Me.ucrReceiverY.AutoSize = True + Me.ucrReceiverY.frmParent = Nothing + Me.ucrReceiverY.Location = New System.Drawing.Point(24, 36) + Me.ucrReceiverY.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverY.Name = "ucrReceiverY" + Me.ucrReceiverY.Selector = Nothing + Me.ucrReceiverY.Size = New System.Drawing.Size(125, 20) + Me.ucrReceiverY.strNcFilePath = "" + Me.ucrReceiverY.TabIndex = 1 + Me.ucrReceiverY.ucrSelector = Nothing + ' + 'ucrReceiverX + ' + Me.ucrReceiverX.AutoSize = True + Me.ucrReceiverX.frmParent = Nothing + Me.ucrReceiverX.Location = New System.Drawing.Point(24, 81) + Me.ucrReceiverX.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverX.Name = "ucrReceiverX" + Me.ucrReceiverX.Selector = Nothing + Me.ucrReceiverX.Size = New System.Drawing.Size(125, 27) + Me.ucrReceiverX.strNcFilePath = "" + Me.ucrReceiverX.TabIndex = 3 + Me.ucrReceiverX.ucrSelector = Nothing + ' + 'ucrLabelReceiver + ' + Me.ucrLabelReceiver.AutoSize = True + Me.ucrLabelReceiver.frmParent = Nothing + Me.ucrLabelReceiver.Location = New System.Drawing.Point(25, 229) + Me.ucrLabelReceiver.Margin = New System.Windows.Forms.Padding(0) + Me.ucrLabelReceiver.Name = "ucrLabelReceiver" + Me.ucrLabelReceiver.Selector = Nothing + Me.ucrLabelReceiver.Size = New System.Drawing.Size(125, 25) + Me.ucrLabelReceiver.strNcFilePath = "" + Me.ucrLabelReceiver.TabIndex = 9 + Me.ucrLabelReceiver.ucrSelector = Nothing + ' + 'ucrColourReceiver + ' + Me.ucrColourReceiver.AutoSize = True + Me.ucrColourReceiver.frmParent = Nothing + Me.ucrColourReceiver.Location = New System.Drawing.Point(25, 189) + Me.ucrColourReceiver.Margin = New System.Windows.Forms.Padding(0) + Me.ucrColourReceiver.Name = "ucrColourReceiver" + Me.ucrColourReceiver.Selector = Nothing + Me.ucrColourReceiver.Size = New System.Drawing.Size(125, 25) + Me.ucrColourReceiver.strNcFilePath = "" + Me.ucrColourReceiver.TabIndex = 7 + Me.ucrColourReceiver.ucrSelector = Nothing + ' + 'ucrFillReceiver + ' + Me.ucrFillReceiver.AutoSize = True + Me.ucrFillReceiver.frmParent = Nothing + Me.ucrFillReceiver.Location = New System.Drawing.Point(25, 150) + Me.ucrFillReceiver.Margin = New System.Windows.Forms.Padding(0) + Me.ucrFillReceiver.Name = "ucrFillReceiver" + Me.ucrFillReceiver.Selector = Nothing + Me.ucrFillReceiver.Size = New System.Drawing.Size(125, 25) + Me.ucrFillReceiver.strNcFilePath = "" + Me.ucrFillReceiver.TabIndex = 5 + Me.ucrFillReceiver.ucrSelector = Nothing + ' 'ucrInputLegendPosition ' Me.ucrInputLegendPosition.AddQuotesIfUnrecognised = True @@ -539,12 +540,24 @@ Partial Class dlgGeneralForGraphics Me.ucrBase.Size = New System.Drawing.Size(408, 52) Me.ucrBase.TabIndex = 9 ' + 'cmdColour + ' + Me.cmdColour.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdColour.Location = New System.Drawing.Point(386, 401) + Me.cmdColour.Name = "cmdColour" + Me.cmdColour.Size = New System.Drawing.Size(65, 25) + Me.cmdColour.TabIndex = 214 + Me.cmdColour.Tag = "Colour" + Me.cmdColour.Text = "Colour" + Me.cmdColour.UseVisualStyleBackColor = True + ' 'dlgGeneralForGraphics ' 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(478, 547) + Me.Controls.Add(Me.cmdColour) Me.Controls.Add(Me.cmdRHelp) Me.Controls.Add(Me.grpAethetics) Me.Controls.Add(Me.ucrInputLegendPosition) @@ -626,4 +639,5 @@ Partial Class dlgGeneralForGraphics Friend WithEvents lblYVariable As Label Friend WithEvents lblXVariable As Label Friend WithEvents ucrReceiverX As ucrReceiverSingle + Friend WithEvents cmdColour As Button End Class diff --git a/instat/dlgGeneralForGraphics.vb b/instat/dlgGeneralForGraphics.vb index d7df34f2472..eec9155014b 100644 --- a/instat/dlgGeneralForGraphics.vb +++ b/instat/dlgGeneralForGraphics.vb @@ -326,6 +326,18 @@ Public Class dlgGeneralForGraphics sdgPlots.EnableLayersTab() End Sub + Private Sub cmdColour_Click(sender As Object, e As EventArgs) Handles cmdColour.Click + sdgPlots.DisableLayersTab() + sdgPlots.SetRCode(clsNewOperator:=ucrBase.clsRsyntax.clsBaseOperator, clsNewThemeFunction:=clsThemeFunction, dctNewThemeFunctions:=dctThemeFunctions, clsNewYScalecontinuousFunction:=clsYScalecontinuousFunction, + clsNewXScalecontinuousFunction:=clsXScalecontinuousFunction, clsNewLabsFunction:=clsLabsFunction, clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabsFunction, + clsNewFacetFunction:=clsFacetsFunction, clsNewScaleFillViridisFunction:=clsScaleFillViridisFunction, clsNewScaleColourViridisFunction:=clsScaleColourViridisFunction, clsNewGlobalAesFunction:=clsGlobalAesFunction, + clsNewXScaleDateFunction:=clsXScaleDateFunction, clsNewYScaleDateFunction:=clsYScaleDateFunction, ucrNewBaseSelector:=sdgLayerOptions.ucrGeomWithAes.ucrGeomWithAesSelector, clsNewAnnotateFunction:=clsAnnotateFunction, + clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, bReset:=bResetOptionsSubdialog) + sdgPlots.tbpPlotsOptions.SelectedIndex = 7 + sdgPlots.ShowDialog() + bResetOptionsSubdialog = False + sdgPlots.EnableLayersTab() + End Sub Private Sub ucrReceiverY_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverY.ControlValueChanged, ucrReceiverX.ControlValueChanged If Not ucrReceiverY.IsEmpty Then clsGlobalAesFunction.AddParameter("y", ucrReceiverY.GetVariableNames(False), iPosition:=1) diff --git a/instat/sdgPlots.vb b/instat/sdgPlots.vb index 5dd726c3388..53975f24814 100644 --- a/instat/sdgPlots.vb +++ b/instat/sdgPlots.vb @@ -694,26 +694,11 @@ Public Class sdgPlots dctThemeFunctions.TryGetValue("axis.text.x", clsXElementText) dctThemeFunctions.TryGetValue("axis.title.x", clsXElementTitle) dctThemeFunctions.TryGetValue("axis.text.y", clsYElemetText) - dctThemeFunctions.TryGetValue("title", clsPlotElementTitleFunction) - dctThemeFunctions.TryGetValue("sub.title", clsPlotElementSubTitleFunction) - dctThemeFunctions.TryGetValue("caption", clsPlotElementCaptionFunction) dctThemeFunctions.TryGetValue("tag", clsPlotElementTagFunction) dctThemeFunctions.TryGetValue("colour", clsPlotLegendTitleFunction) dctNewThemeFunctions.TryGetValue("axis.title.y", clsYElemetTitle) - If dctThemeFunctions.TryGetValue("caption", clsPlotElementCaptionFunction) Then - clsThemeFunction.AddParameter("plot.caption", clsRFunctionParameter:=clsPlotElementCaptionFunction) - End If - - If dctThemeFunctions.TryGetValue("title", clsPlotElementTitleFunction) Then - clsThemeFunction.AddParameter("plot.title", clsRFunctionParameter:=clsPlotElementTitleFunction) - End If - - If dctThemeFunctions.TryGetValue("sub.title", clsPlotElementSubTitleFunction) Then - clsThemeFunction.AddParameter("plot.subtitle", clsRFunctionParameter:=clsPlotElementSubTitleFunction) - End If - If clsFacetFunction.ContainsParameter("facets") Then clsTempParam = clsFacetFunction.GetParameter("facets") If clsTempParam.bIsOperator AndAlso clsTempParam.clsArgumentCodeStructure IsNot Nothing Then @@ -757,9 +742,11 @@ Public Class sdgPlots ucrChkMargin.SetRCode(clsFacetFunction, bReset, bCloneIfNeeded:=True) ucrChkFreeSpace.SetRCode(clsFacetFunction, bReset, bCloneIfNeeded:=True) ucrChkFreeScalesX.SetRCode(clsFacetFunction, bReset, bCloneIfNeeded:=True) - ucrChkFreeScalesY.SetRCode(clsFacetFunction, bReset, bCloneIfNeeded:=True) + If bReset Then + ucrChkFreeScalesY.SetRCode(clsFacetFunction, bReset, bCloneIfNeeded:=True) + End If ucrNudNumberofRows.SetRCode(clsFacetFunction, bReset, bCloneIfNeeded:=True) - ucrChkLabeler.SetRCode(clsFacetFunction, bReset, bCloneIfNeeded:=True) + ucrChkLabeler.SetRCode(clsFacetFunction, bReset, bCloneIfNeeded:=True) ucrChkDrop.SetRCode(clsFacetFunction, bReset, bCloneIfNeeded:=True) ucrChkIncludeFacets.SetRCode(clsBaseOperator, bReset, bCloneIfNeeded:=True) @@ -1208,8 +1195,8 @@ Public Class sdgPlots ucrChkYaxisSize.SetRCode(clsYElemetTitle, bReset, bCloneIfNeeded:=True) ucrNudYSize.SetRCode(clsYElemetTitle, bReset, bCloneIfNeeded:=True) - ucrNudXaxisMarkSize.SetRCode(clsXElementText, bReset, bCloneIfNeeded:=True) ucrChkXaxisTickMarkLabelSize.SetRCode(clsXElementText, bReset, bCloneIfNeeded:=True) + ucrNudXaxisMarkSize.SetRCode(clsXElementText, bReset, bCloneIfNeeded:=True) End Sub Private Sub cmdSimpleOptions_Click(sender As Object, e As EventArgs) Handles cmdSimpleOptions.Click @@ -1331,15 +1318,30 @@ Public Class sdgPlots End Sub Private Sub ucrNudCaptionSize_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrNudCaptionSize.ControlValueChanged - clsPlotElementCaptionFunction.AddParameter("size", ucrNudCaptionSize.GetText) + If clsPlotElementCaptionFunction.clsParameters.Count > 0 Then + clsThemeFunction.AddParameter("plot.caption", clsRFunctionParameter:=clsPlotElementCaptionFunction) + Else + clsThemeFunction.RemoveParameterByName("plot.caption") + End If + AddRemoveTheme() End Sub Private Sub ucrNudTitleSize_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrNudTitleSize.ControlValueChanged - clsPlotElementTitleFunction.AddParameter("size", ucrNudTitleSize.GetText) + If clsPlotElementTitleFunction.clsParameters.Count > 0 Then + clsThemeFunction.AddParameter("plot.title", clsRFunctionParameter:=clsPlotElementTitleFunction) + Else + clsThemeFunction.RemoveParameterByName("plot.title") + End If + AddRemoveTheme() End Sub Private Sub ucrNudSubTitleSize_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrNudSubTitleSize.ControlValueChanged - clsPlotElementSubTitleFunction.AddParameter("size", ucrNudSubTitleSize.GetText) + If clsPlotElementSubTitleFunction.clsParameters.Count > 0 Then + clsThemeFunction.AddParameter("plot.title", clsRFunctionParameter:=clsPlotElementSubTitleFunction) + Else + clsThemeFunction.RemoveParameterByName("plot.title") + End If + AddRemoveTheme() End Sub Private Sub ucrNudTagSize_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrNudTagSize.ControlValueChanged From 5c7bb2545d8ad43b274c88038a7cdf91af8a77cb Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Thu, 16 Nov 2023 09:01:05 +0100 Subject: [PATCH 24/27] minor text change on the General Graphics design --- instat/dlgGeneralForGraphics.Designer.vb | 176 +++++++++++------------ 1 file changed, 88 insertions(+), 88 deletions(-) diff --git a/instat/dlgGeneralForGraphics.Designer.vb b/instat/dlgGeneralForGraphics.Designer.vb index cd1d1872096..7b585b8bc6c 100644 --- a/instat/dlgGeneralForGraphics.Designer.vb +++ b/instat/dlgGeneralForGraphics.Designer.vb @@ -46,11 +46,17 @@ Partial Class dlgGeneralForGraphics Me.cmdXAxis = New System.Windows.Forms.Button() Me.cmdTitles = New System.Windows.Forms.Button() Me.grpAethetics = New System.Windows.Forms.GroupBox() + Me.ucrChkUseasNumeric = New instat.ucrCheck() + Me.ucrReceiverY = New instat.ucrReceiverSingle() Me.lblYVariable = New System.Windows.Forms.Label() Me.lblXVariable = New System.Windows.Forms.Label() + Me.ucrReceiverX = New instat.ucrReceiverSingle() Me.lblLabel = New System.Windows.Forms.Label() + Me.ucrLabelReceiver = New instat.ucrReceiverSingle() Me.lblColour = New System.Windows.Forms.Label() + Me.ucrColourReceiver = New instat.ucrReceiverSingle() Me.lblFill = New System.Windows.Forms.Label() + Me.ucrFillReceiver = New instat.ucrReceiverSingle() Me.ContextMenuPackagesList = New System.Windows.Forms.ContextMenuStrip(Me.components) Me.ListBaseToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.GeomtextpathToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() @@ -77,12 +83,6 @@ Partial Class dlgGeneralForGraphics Me.GgthemesToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.GgwordbuildToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.cmdRHelp = New instat.ucrSplitButton() - Me.ucrChkUseasNumeric = New instat.ucrCheck() - Me.ucrReceiverY = New instat.ucrReceiverSingle() - Me.ucrReceiverX = New instat.ucrReceiverSingle() - Me.ucrLabelReceiver = New instat.ucrReceiverSingle() - Me.ucrColourReceiver = New instat.ucrReceiverSingle() - Me.ucrFillReceiver = New instat.ucrReceiverSingle() Me.ucrInputLegendPosition = New instat.ucrInputComboBox() Me.ucrChkFlipCoordinates = New instat.ucrCheck() Me.ucrChkLegend = New instat.ucrCheck() @@ -100,16 +100,16 @@ Partial Class dlgGeneralForGraphics Me.cmdOptions.ImeMode = System.Windows.Forms.ImeMode.NoControl Me.cmdOptions.Location = New System.Drawing.Point(6, 401) Me.cmdOptions.Name = "cmdOptions" - Me.cmdOptions.Size = New System.Drawing.Size(81, 25) + Me.cmdOptions.Size = New System.Drawing.Size(60, 25) Me.cmdOptions.TabIndex = 7 Me.cmdOptions.Tag = "Options" - Me.cmdOptions.Text = "Plot" + Me.cmdOptions.Text = "Options" Me.cmdOptions.UseVisualStyleBackColor = True ' 'cmdFacets ' Me.cmdFacets.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdFacets.Location = New System.Drawing.Point(86, 401) + Me.cmdFacets.Location = New System.Drawing.Point(65, 401) Me.cmdFacets.Name = "cmdFacets" Me.cmdFacets.Size = New System.Drawing.Size(57, 25) Me.cmdFacets.TabIndex = 17 @@ -120,7 +120,7 @@ Partial Class dlgGeneralForGraphics 'cmdTheme ' Me.cmdTheme.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdTheme.Location = New System.Drawing.Point(324, 401) + Me.cmdTheme.Location = New System.Drawing.Point(303, 401) Me.cmdTheme.Name = "cmdTheme" Me.cmdTheme.Size = New System.Drawing.Size(65, 25) Me.cmdTheme.TabIndex = 21 @@ -131,7 +131,7 @@ Partial Class dlgGeneralForGraphics 'cmdYAxis ' Me.cmdYAxis.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdYAxis.Location = New System.Drawing.Point(261, 401) + Me.cmdYAxis.Location = New System.Drawing.Point(240, 401) Me.cmdYAxis.Name = "cmdYAxis" Me.cmdYAxis.Size = New System.Drawing.Size(64, 25) Me.cmdYAxis.TabIndex = 20 @@ -142,7 +142,7 @@ Partial Class dlgGeneralForGraphics 'cmdXAxis ' Me.cmdXAxis.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdXAxis.Location = New System.Drawing.Point(201, 401) + Me.cmdXAxis.Location = New System.Drawing.Point(180, 401) Me.cmdXAxis.Name = "cmdXAxis" Me.cmdXAxis.Size = New System.Drawing.Size(61, 25) Me.cmdXAxis.TabIndex = 19 @@ -153,7 +153,7 @@ Partial Class dlgGeneralForGraphics 'cmdTitles ' Me.cmdTitles.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdTitles.Location = New System.Drawing.Point(142, 401) + Me.cmdTitles.Location = New System.Drawing.Point(121, 401) Me.cmdTitles.Name = "cmdTitles" Me.cmdTitles.Size = New System.Drawing.Size(60, 25) Me.cmdTitles.TabIndex = 18 @@ -181,6 +181,28 @@ Partial Class dlgGeneralForGraphics Me.grpAethetics.TabStop = False Me.grpAethetics.Text = "Aethetics:" ' + 'ucrChkUseasNumeric + ' + Me.ucrChkUseasNumeric.AutoSize = True + Me.ucrChkUseasNumeric.Checked = False + Me.ucrChkUseasNumeric.Location = New System.Drawing.Point(24, 107) + Me.ucrChkUseasNumeric.Name = "ucrChkUseasNumeric" + Me.ucrChkUseasNumeric.Size = New System.Drawing.Size(126, 24) + Me.ucrChkUseasNumeric.TabIndex = 4 + ' + 'ucrReceiverY + ' + Me.ucrReceiverY.AutoSize = True + Me.ucrReceiverY.frmParent = Me + Me.ucrReceiverY.Location = New System.Drawing.Point(24, 36) + Me.ucrReceiverY.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverY.Name = "ucrReceiverY" + Me.ucrReceiverY.Selector = Nothing + Me.ucrReceiverY.Size = New System.Drawing.Size(125, 20) + Me.ucrReceiverY.strNcFilePath = "" + Me.ucrReceiverY.TabIndex = 1 + Me.ucrReceiverY.ucrSelector = Nothing + ' 'lblYVariable ' Me.lblYVariable.AutoSize = True @@ -203,6 +225,19 @@ Partial Class dlgGeneralForGraphics Me.lblXVariable.Tag = "X_Variable:" Me.lblXVariable.Text = "X Variable:" ' + 'ucrReceiverX + ' + Me.ucrReceiverX.AutoSize = True + Me.ucrReceiverX.frmParent = Me + Me.ucrReceiverX.Location = New System.Drawing.Point(24, 81) + Me.ucrReceiverX.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverX.Name = "ucrReceiverX" + Me.ucrReceiverX.Selector = Nothing + Me.ucrReceiverX.Size = New System.Drawing.Size(125, 27) + Me.ucrReceiverX.strNcFilePath = "" + Me.ucrReceiverX.TabIndex = 3 + Me.ucrReceiverX.ucrSelector = Nothing + ' 'lblLabel ' Me.lblLabel.AutoSize = True @@ -214,6 +249,19 @@ Partial Class dlgGeneralForGraphics Me.lblLabel.Tag = "Label:" Me.lblLabel.Text = "Label:" ' + 'ucrLabelReceiver + ' + Me.ucrLabelReceiver.AutoSize = True + Me.ucrLabelReceiver.frmParent = Me + Me.ucrLabelReceiver.Location = New System.Drawing.Point(25, 229) + Me.ucrLabelReceiver.Margin = New System.Windows.Forms.Padding(0) + Me.ucrLabelReceiver.Name = "ucrLabelReceiver" + Me.ucrLabelReceiver.Selector = Nothing + Me.ucrLabelReceiver.Size = New System.Drawing.Size(125, 25) + Me.ucrLabelReceiver.strNcFilePath = "" + Me.ucrLabelReceiver.TabIndex = 9 + Me.ucrLabelReceiver.ucrSelector = Nothing + ' 'lblColour ' Me.lblColour.AutoSize = True @@ -225,6 +273,19 @@ Partial Class dlgGeneralForGraphics Me.lblColour.Tag = "Fill_Colour:" Me.lblColour.Text = "Colour:" ' + 'ucrColourReceiver + ' + Me.ucrColourReceiver.AutoSize = True + Me.ucrColourReceiver.frmParent = Me + Me.ucrColourReceiver.Location = New System.Drawing.Point(25, 189) + Me.ucrColourReceiver.Margin = New System.Windows.Forms.Padding(0) + Me.ucrColourReceiver.Name = "ucrColourReceiver" + Me.ucrColourReceiver.Selector = Nothing + Me.ucrColourReceiver.Size = New System.Drawing.Size(125, 25) + Me.ucrColourReceiver.strNcFilePath = "" + Me.ucrColourReceiver.TabIndex = 7 + Me.ucrColourReceiver.ucrSelector = Nothing + ' 'lblFill ' Me.lblFill.AutoSize = True @@ -236,6 +297,19 @@ Partial Class dlgGeneralForGraphics Me.lblFill.Tag = "Fill_Colour:" Me.lblFill.Text = "Fill:" ' + 'ucrFillReceiver + ' + Me.ucrFillReceiver.AutoSize = True + Me.ucrFillReceiver.frmParent = Me + Me.ucrFillReceiver.Location = New System.Drawing.Point(25, 150) + Me.ucrFillReceiver.Margin = New System.Windows.Forms.Padding(0) + Me.ucrFillReceiver.Name = "ucrFillReceiver" + Me.ucrFillReceiver.Selector = Nothing + Me.ucrFillReceiver.Size = New System.Drawing.Size(125, 25) + Me.ucrFillReceiver.strNcFilePath = "" + Me.ucrFillReceiver.TabIndex = 5 + Me.ucrFillReceiver.ucrSelector = Nothing + ' 'ContextMenuPackagesList ' Me.ContextMenuPackagesList.ImageScalingSize = New System.Drawing.Size(24, 24) @@ -399,80 +473,6 @@ Partial Class dlgGeneralForGraphics Me.cmdRHelp.Text = "R Help" Me.cmdRHelp.UseVisualStyleBackColor = True ' - 'ucrChkUseasNumeric - ' - Me.ucrChkUseasNumeric.AutoSize = True - Me.ucrChkUseasNumeric.Checked = False - Me.ucrChkUseasNumeric.Location = New System.Drawing.Point(24, 107) - Me.ucrChkUseasNumeric.Name = "ucrChkUseasNumeric" - Me.ucrChkUseasNumeric.Size = New System.Drawing.Size(126, 24) - Me.ucrChkUseasNumeric.TabIndex = 4 - ' - 'ucrReceiverY - ' - Me.ucrReceiverY.AutoSize = True - Me.ucrReceiverY.frmParent = Nothing - Me.ucrReceiverY.Location = New System.Drawing.Point(24, 36) - Me.ucrReceiverY.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverY.Name = "ucrReceiverY" - Me.ucrReceiverY.Selector = Nothing - Me.ucrReceiverY.Size = New System.Drawing.Size(125, 20) - Me.ucrReceiverY.strNcFilePath = "" - Me.ucrReceiverY.TabIndex = 1 - Me.ucrReceiverY.ucrSelector = Nothing - ' - 'ucrReceiverX - ' - Me.ucrReceiverX.AutoSize = True - Me.ucrReceiverX.frmParent = Nothing - Me.ucrReceiverX.Location = New System.Drawing.Point(24, 81) - Me.ucrReceiverX.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverX.Name = "ucrReceiverX" - Me.ucrReceiverX.Selector = Nothing - Me.ucrReceiverX.Size = New System.Drawing.Size(125, 27) - Me.ucrReceiverX.strNcFilePath = "" - Me.ucrReceiverX.TabIndex = 3 - Me.ucrReceiverX.ucrSelector = Nothing - ' - 'ucrLabelReceiver - ' - Me.ucrLabelReceiver.AutoSize = True - Me.ucrLabelReceiver.frmParent = Nothing - Me.ucrLabelReceiver.Location = New System.Drawing.Point(25, 229) - Me.ucrLabelReceiver.Margin = New System.Windows.Forms.Padding(0) - Me.ucrLabelReceiver.Name = "ucrLabelReceiver" - Me.ucrLabelReceiver.Selector = Nothing - Me.ucrLabelReceiver.Size = New System.Drawing.Size(125, 25) - Me.ucrLabelReceiver.strNcFilePath = "" - Me.ucrLabelReceiver.TabIndex = 9 - Me.ucrLabelReceiver.ucrSelector = Nothing - ' - 'ucrColourReceiver - ' - Me.ucrColourReceiver.AutoSize = True - Me.ucrColourReceiver.frmParent = Nothing - Me.ucrColourReceiver.Location = New System.Drawing.Point(25, 189) - Me.ucrColourReceiver.Margin = New System.Windows.Forms.Padding(0) - Me.ucrColourReceiver.Name = "ucrColourReceiver" - Me.ucrColourReceiver.Selector = Nothing - Me.ucrColourReceiver.Size = New System.Drawing.Size(125, 25) - Me.ucrColourReceiver.strNcFilePath = "" - Me.ucrColourReceiver.TabIndex = 7 - Me.ucrColourReceiver.ucrSelector = Nothing - ' - 'ucrFillReceiver - ' - Me.ucrFillReceiver.AutoSize = True - Me.ucrFillReceiver.frmParent = Nothing - Me.ucrFillReceiver.Location = New System.Drawing.Point(25, 150) - Me.ucrFillReceiver.Margin = New System.Windows.Forms.Padding(0) - Me.ucrFillReceiver.Name = "ucrFillReceiver" - Me.ucrFillReceiver.Selector = Nothing - Me.ucrFillReceiver.Size = New System.Drawing.Size(125, 25) - Me.ucrFillReceiver.strNcFilePath = "" - Me.ucrFillReceiver.TabIndex = 5 - Me.ucrFillReceiver.ucrSelector = Nothing - ' 'ucrInputLegendPosition ' Me.ucrInputLegendPosition.AddQuotesIfUnrecognised = True @@ -543,7 +543,7 @@ Partial Class dlgGeneralForGraphics 'cmdColour ' Me.cmdColour.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdColour.Location = New System.Drawing.Point(386, 401) + Me.cmdColour.Location = New System.Drawing.Point(367, 401) Me.cmdColour.Name = "cmdColour" Me.cmdColour.Size = New System.Drawing.Size(65, 25) Me.cmdColour.TabIndex = 214 From 9a7ab6d6ab43f916c226a95fcbac1bb7455c0987 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Thu, 16 Nov 2023 20:05:02 +0300 Subject: [PATCH 25/27] made changes to saving data frame feature --- instat/dlgScript.Designer.vb | 435 +++++++++++++++++++---------------- instat/dlgScript.vb | 72 ++++-- 2 files changed, 285 insertions(+), 222 deletions(-) diff --git a/instat/dlgScript.Designer.vb b/instat/dlgScript.Designer.vb index 21f9ddf116c..50afe38c308 100644 --- a/instat/dlgScript.Designer.vb +++ b/instat/dlgScript.Designer.vb @@ -24,47 +24,50 @@ Partial Class dlgScript Private Sub InitializeComponent() Me.tbFeatures = New System.Windows.Forms.TabControl() Me.tbPageSaveData = New System.Windows.Forms.TabPage() + Me.lblSaveDataFrame = New System.Windows.Forms.Label() Me.lblSaveObjectFormat = New System.Windows.Forms.Label() - Me.ucrCboSaveOutputObjectFormat = New instat.ucrInputComboBox() Me.lblSaveObjectType = New System.Windows.Forms.Label() - Me.ucrCboSaveOutputObjectType = New instat.ucrInputComboBox() Me.rdoSaveOutputObject = New System.Windows.Forms.RadioButton() Me.rdoSaveDataFrame = New System.Windows.Forms.RadioButton() Me.rdoSaveColumn = New System.Windows.Forms.RadioButton() - Me.ucrSaveData = New instat.ucrSave() - Me.ucrDataFrameSaveOutputSelect = New instat.ucrDataFrame() - Me.ucrPnlSaveData = New instat.UcrPanel() Me.tbPageGetData = New System.Windows.Forms.TabPage() - Me.ucrReceiverGetOutputObject = New instat.ucrReceiverSingle() - Me.ucrReceiverGetColumns = New instat.ucrReceiverMultiple() Me.lblGetColumn = New System.Windows.Forms.Label() - Me.ucrDataFrameGetDF = New instat.ucrDataFrame() Me.lblGetObjectType = New System.Windows.Forms.Label() - Me.ucrCboGetOutputObjectType = New instat.ucrInputComboBox() Me.rdoGetOutputObject = New System.Windows.Forms.RadioButton() Me.lblGetOutputObject = New System.Windows.Forms.Label() Me.rdoGetDataFrame = New System.Windows.Forms.RadioButton() Me.rdoGetColumn = New System.Windows.Forms.RadioButton() - Me.ucrPnlGetData = New instat.UcrPanel() - Me.ucrSelectorGetObject = New instat.ucrSelectorByDataFrameAddRemove() Me.tbPageCommand = New System.Windows.Forms.TabPage() - Me.ucrInputRemoveObjects = New instat.ucrInputTextBox() Me.rdoCommandPackage = New System.Windows.Forms.RadioButton() - Me.ucrCboCommandPackage = New instat.ucrInputComboBox() Me.rdoCommandObject = New System.Windows.Forms.RadioButton() - Me.ucrPnlCommands = New instat.UcrPanel() Me.tbPageExamples = New System.Windows.Forms.TabPage() Me.rdoExampleData = New System.Windows.Forms.RadioButton() Me.rdoExampleFunction = New System.Windows.Forms.RadioButton() - Me.ucrPnlExample = New instat.UcrPanel() Me.lstExampleCollection = New System.Windows.Forms.ListView() Me.clmDatasets = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader) Me.clmDesc = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader) Me.Label3 = New System.Windows.Forms.Label() - Me.ucrCboExamplePackages = New instat.ucrInputComboBox() Me.lblPreview = New System.Windows.Forms.Label() Me.txtScript = New System.Windows.Forms.TextBox() + Me.ucrInputSaveDataFrame = New instat.ucrInputTextBox() + Me.ucrCboSaveOutputObjectFormat = New instat.ucrInputComboBox() + Me.ucrCboSaveOutputObjectType = New instat.ucrInputComboBox() + Me.ucrSaveObject = New instat.ucrSave() + Me.ucrDataFrameSaveOutputSelect = New instat.ucrDataFrame() + Me.ucrPnlSaveData = New instat.UcrPanel() + Me.ucrReceiverGetOutputObject = New instat.ucrReceiverSingle() + Me.ucrReceiverGetColumns = New instat.ucrReceiverMultiple() + Me.ucrDataFrameGetDF = New instat.ucrDataFrame() + Me.ucrCboGetOutputObjectType = New instat.ucrInputComboBox() + Me.ucrPnlGetData = New instat.UcrPanel() + Me.ucrSelectorGetObject = New instat.ucrSelectorByDataFrameAddRemove() + Me.ucrInputRemoveObjects = New instat.ucrInputTextBox() + Me.ucrCboCommandPackage = New instat.ucrInputComboBox() + Me.ucrPnlCommands = New instat.UcrPanel() + Me.ucrPnlExample = New instat.UcrPanel() + Me.ucrCboExamplePackages = New instat.ucrInputComboBox() Me.ucrBase = New instat.ucrButtons() + Me.ucrChkSaveDataFrameList = New instat.ucrCheck() Me.tbFeatures.SuspendLayout() Me.tbPageSaveData.SuspendLayout() Me.tbPageGetData.SuspendLayout() @@ -86,6 +89,9 @@ Partial Class dlgScript ' 'tbPageSaveData ' + Me.tbPageSaveData.Controls.Add(Me.ucrChkSaveDataFrameList) + Me.tbPageSaveData.Controls.Add(Me.lblSaveDataFrame) + Me.tbPageSaveData.Controls.Add(Me.ucrInputSaveDataFrame) Me.tbPageSaveData.Controls.Add(Me.lblSaveObjectFormat) Me.tbPageSaveData.Controls.Add(Me.ucrCboSaveOutputObjectFormat) Me.tbPageSaveData.Controls.Add(Me.lblSaveObjectType) @@ -93,7 +99,7 @@ Partial Class dlgScript Me.tbPageSaveData.Controls.Add(Me.rdoSaveOutputObject) Me.tbPageSaveData.Controls.Add(Me.rdoSaveDataFrame) Me.tbPageSaveData.Controls.Add(Me.rdoSaveColumn) - Me.tbPageSaveData.Controls.Add(Me.ucrSaveData) + Me.tbPageSaveData.Controls.Add(Me.ucrSaveObject) Me.tbPageSaveData.Controls.Add(Me.ucrDataFrameSaveOutputSelect) Me.tbPageSaveData.Controls.Add(Me.ucrPnlSaveData) Me.tbPageSaveData.Location = New System.Drawing.Point(4, 22) @@ -103,6 +109,15 @@ Partial Class dlgScript Me.tbPageSaveData.Text = "Save Data" Me.tbPageSaveData.UseVisualStyleBackColor = True ' + 'lblSaveDataFrame + ' + Me.lblSaveDataFrame.AutoSize = True + Me.lblSaveDataFrame.Location = New System.Drawing.Point(89, 52) + Me.lblSaveDataFrame.Name = "lblSaveDataFrame" + Me.lblSaveDataFrame.Size = New System.Drawing.Size(65, 13) + Me.lblSaveDataFrame.TabIndex = 58 + Me.lblSaveDataFrame.Text = "Data Frame:" + ' 'lblSaveObjectFormat ' Me.lblSaveObjectFormat.AutoSize = True @@ -112,18 +127,6 @@ Partial Class dlgScript Me.lblSaveObjectFormat.TabIndex = 56 Me.lblSaveObjectFormat.Text = "Format:" ' - 'ucrCboSaveOutputObjectFormat - ' - Me.ucrCboSaveOutputObjectFormat.AddQuotesIfUnrecognised = True - Me.ucrCboSaveOutputObjectFormat.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrCboSaveOutputObjectFormat.GetSetSelectedIndex = -1 - Me.ucrCboSaveOutputObjectFormat.IsReadOnly = False - Me.ucrCboSaveOutputObjectFormat.Location = New System.Drawing.Point(88, 160) - Me.ucrCboSaveOutputObjectFormat.Margin = New System.Windows.Forms.Padding(9) - Me.ucrCboSaveOutputObjectFormat.Name = "ucrCboSaveOutputObjectFormat" - Me.ucrCboSaveOutputObjectFormat.Size = New System.Drawing.Size(141, 21) - Me.ucrCboSaveOutputObjectFormat.TabIndex = 55 - ' 'lblSaveObjectType ' Me.lblSaveObjectType.AutoSize = True @@ -133,18 +136,6 @@ Partial Class dlgScript Me.lblSaveObjectType.TabIndex = 54 Me.lblSaveObjectType.Text = "Type:" ' - 'ucrCboSaveOutputObjectType - ' - Me.ucrCboSaveOutputObjectType.AddQuotesIfUnrecognised = True - Me.ucrCboSaveOutputObjectType.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrCboSaveOutputObjectType.GetSetSelectedIndex = -1 - Me.ucrCboSaveOutputObjectType.IsReadOnly = False - Me.ucrCboSaveOutputObjectType.Location = New System.Drawing.Point(87, 116) - Me.ucrCboSaveOutputObjectType.Margin = New System.Windows.Forms.Padding(9) - Me.ucrCboSaveOutputObjectType.Name = "ucrCboSaveOutputObjectType" - Me.ucrCboSaveOutputObjectType.Size = New System.Drawing.Size(144, 21) - Me.ucrCboSaveOutputObjectType.TabIndex = 53 - ' 'rdoSaveOutputObject ' Me.rdoSaveOutputObject.Appearance = System.Windows.Forms.Appearance.Button @@ -196,47 +187,18 @@ Partial Class dlgScript Me.rdoSaveColumn.TextAlign = System.Drawing.ContentAlignment.MiddleCenter Me.rdoSaveColumn.UseVisualStyleBackColor = True ' - 'ucrSaveData - ' - Me.ucrSaveData.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrSaveData.Location = New System.Drawing.Point(88, 193) - Me.ucrSaveData.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) - Me.ucrSaveData.Name = "ucrSaveData" - Me.ucrSaveData.Size = New System.Drawing.Size(258, 22) - Me.ucrSaveData.TabIndex = 35 - ' - 'ucrDataFrameSaveOutputSelect - ' - Me.ucrDataFrameSaveOutputSelect.AutoSize = True - Me.ucrDataFrameSaveOutputSelect.bDropUnusedFilterLevels = False - Me.ucrDataFrameSaveOutputSelect.bUseCurrentFilter = True - Me.ucrDataFrameSaveOutputSelect.Location = New System.Drawing.Point(86, 54) - Me.ucrDataFrameSaveOutputSelect.Margin = New System.Windows.Forms.Padding(0) - Me.ucrDataFrameSaveOutputSelect.Name = "ucrDataFrameSaveOutputSelect" - Me.ucrDataFrameSaveOutputSelect.Size = New System.Drawing.Size(224, 59) - Me.ucrDataFrameSaveOutputSelect.TabIndex = 29 - ' - 'ucrPnlSaveData - ' - Me.ucrPnlSaveData.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlSaveData.Location = New System.Drawing.Point(13, 12) - Me.ucrPnlSaveData.Margin = New System.Windows.Forms.Padding(6) - Me.ucrPnlSaveData.Name = "ucrPnlSaveData" - Me.ucrPnlSaveData.Size = New System.Drawing.Size(402, 36) - Me.ucrPnlSaveData.TabIndex = 47 - ' 'tbPageGetData ' Me.tbPageGetData.Controls.Add(Me.ucrReceiverGetOutputObject) Me.tbPageGetData.Controls.Add(Me.ucrReceiverGetColumns) Me.tbPageGetData.Controls.Add(Me.lblGetColumn) - Me.tbPageGetData.Controls.Add(Me.ucrDataFrameGetDF) Me.tbPageGetData.Controls.Add(Me.lblGetObjectType) - Me.tbPageGetData.Controls.Add(Me.ucrCboGetOutputObjectType) Me.tbPageGetData.Controls.Add(Me.rdoGetOutputObject) Me.tbPageGetData.Controls.Add(Me.lblGetOutputObject) Me.tbPageGetData.Controls.Add(Me.rdoGetDataFrame) Me.tbPageGetData.Controls.Add(Me.rdoGetColumn) + Me.tbPageGetData.Controls.Add(Me.ucrDataFrameGetDF) + Me.tbPageGetData.Controls.Add(Me.ucrCboGetOutputObjectType) Me.tbPageGetData.Controls.Add(Me.ucrPnlGetData) Me.tbPageGetData.Controls.Add(Me.ucrSelectorGetObject) Me.tbPageGetData.Location = New System.Drawing.Point(4, 22) @@ -247,32 +209,6 @@ Partial Class dlgScript Me.tbPageGetData.Text = "Get Data" Me.tbPageGetData.UseVisualStyleBackColor = True ' - 'ucrReceiverGetOutputObject - ' - Me.ucrReceiverGetOutputObject.AutoSize = True - Me.ucrReceiverGetOutputObject.frmParent = Nothing - Me.ucrReceiverGetOutputObject.Location = New System.Drawing.Point(240, 117) - Me.ucrReceiverGetOutputObject.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverGetOutputObject.Name = "ucrReceiverGetOutputObject" - Me.ucrReceiverGetOutputObject.Selector = Nothing - Me.ucrReceiverGetOutputObject.Size = New System.Drawing.Size(138, 20) - Me.ucrReceiverGetOutputObject.strNcFilePath = "" - Me.ucrReceiverGetOutputObject.TabIndex = 27 - Me.ucrReceiverGetOutputObject.ucrSelector = Nothing - ' - 'ucrReceiverGetColumns - ' - Me.ucrReceiverGetColumns.AutoSize = True - Me.ucrReceiverGetColumns.frmParent = Nothing - Me.ucrReceiverGetColumns.Location = New System.Drawing.Point(243, 104) - Me.ucrReceiverGetColumns.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverGetColumns.Name = "ucrReceiverGetColumns" - Me.ucrReceiverGetColumns.Selector = Nothing - Me.ucrReceiverGetColumns.Size = New System.Drawing.Size(137, 105) - Me.ucrReceiverGetColumns.strNcFilePath = "" - Me.ucrReceiverGetColumns.TabIndex = 49 - Me.ucrReceiverGetColumns.ucrSelector = Nothing - ' 'lblGetColumn ' Me.lblGetColumn.AutoSize = True @@ -283,17 +219,6 @@ Partial Class dlgScript Me.lblGetColumn.TabIndex = 50 Me.lblGetColumn.Text = "Column:" ' - 'ucrDataFrameGetDF - ' - Me.ucrDataFrameGetDF.AutoSize = True - Me.ucrDataFrameGetDF.bDropUnusedFilterLevels = False - Me.ucrDataFrameGetDF.bUseCurrentFilter = True - Me.ucrDataFrameGetDF.Location = New System.Drawing.Point(81, 55) - Me.ucrDataFrameGetDF.Margin = New System.Windows.Forms.Padding(0) - Me.ucrDataFrameGetDF.Name = "ucrDataFrameGetDF" - Me.ucrDataFrameGetDF.Size = New System.Drawing.Size(224, 59) - Me.ucrDataFrameGetDF.TabIndex = 31 - ' 'lblGetObjectType ' Me.lblGetObjectType.AutoSize = True @@ -303,18 +228,6 @@ Partial Class dlgScript Me.lblGetObjectType.TabIndex = 48 Me.lblGetObjectType.Text = "Type:" ' - 'ucrCboGetOutputObjectType - ' - Me.ucrCboGetOutputObjectType.AddQuotesIfUnrecognised = True - Me.ucrCboGetOutputObjectType.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrCboGetOutputObjectType.GetSetSelectedIndex = -1 - Me.ucrCboGetOutputObjectType.IsReadOnly = False - Me.ucrCboGetOutputObjectType.Location = New System.Drawing.Point(241, 72) - Me.ucrCboGetOutputObjectType.Margin = New System.Windows.Forms.Padding(9) - Me.ucrCboGetOutputObjectType.Name = "ucrCboGetOutputObjectType" - Me.ucrCboGetOutputObjectType.Size = New System.Drawing.Size(137, 21) - Me.ucrCboGetOutputObjectType.TabIndex = 47 - ' 'rdoGetOutputObject ' Me.rdoGetOutputObject.Appearance = System.Windows.Forms.Appearance.Button @@ -376,33 +289,12 @@ Partial Class dlgScript Me.rdoGetColumn.TextAlign = System.Drawing.ContentAlignment.MiddleCenter Me.rdoGetColumn.UseVisualStyleBackColor = True ' - 'ucrPnlGetData - ' - Me.ucrPnlGetData.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlGetData.Location = New System.Drawing.Point(5, 10) - Me.ucrPnlGetData.Margin = New System.Windows.Forms.Padding(6) - Me.ucrPnlGetData.Name = "ucrPnlGetData" - Me.ucrPnlGetData.Size = New System.Drawing.Size(402, 36) - Me.ucrPnlGetData.TabIndex = 42 - ' - 'ucrSelectorGetObject - ' - Me.ucrSelectorGetObject.AutoSize = True - Me.ucrSelectorGetObject.bDropUnusedFilterLevels = False - Me.ucrSelectorGetObject.bShowHiddenColumns = False - Me.ucrSelectorGetObject.bUseCurrentFilter = True - Me.ucrSelectorGetObject.Location = New System.Drawing.Point(9, 52) - Me.ucrSelectorGetObject.Margin = New System.Windows.Forms.Padding(0) - Me.ucrSelectorGetObject.Name = "ucrSelectorGetObject" - Me.ucrSelectorGetObject.Size = New System.Drawing.Size(320, 274) - Me.ucrSelectorGetObject.TabIndex = 34 - ' 'tbPageCommand ' Me.tbPageCommand.Controls.Add(Me.ucrInputRemoveObjects) Me.tbPageCommand.Controls.Add(Me.rdoCommandPackage) - Me.tbPageCommand.Controls.Add(Me.ucrCboCommandPackage) Me.tbPageCommand.Controls.Add(Me.rdoCommandObject) + Me.tbPageCommand.Controls.Add(Me.ucrCboCommandPackage) Me.tbPageCommand.Controls.Add(Me.ucrPnlCommands) Me.tbPageCommand.Location = New System.Drawing.Point(4, 22) Me.tbPageCommand.Name = "tbPageCommand" @@ -411,18 +303,6 @@ Partial Class dlgScript Me.tbPageCommand.Text = "Commands" Me.tbPageCommand.UseVisualStyleBackColor = True ' - 'ucrInputRemoveObjects - ' - Me.ucrInputRemoveObjects.AddQuotesIfUnrecognised = True - Me.ucrInputRemoveObjects.AutoSize = True - Me.ucrInputRemoveObjects.IsMultiline = False - Me.ucrInputRemoveObjects.IsReadOnly = False - Me.ucrInputRemoveObjects.Location = New System.Drawing.Point(156, 56) - Me.ucrInputRemoveObjects.Margin = New System.Windows.Forms.Padding(9) - Me.ucrInputRemoveObjects.Name = "ucrInputRemoveObjects" - Me.ucrInputRemoveObjects.Size = New System.Drawing.Size(145, 21) - Me.ucrInputRemoveObjects.TabIndex = 2 - ' 'rdoCommandPackage ' Me.rdoCommandPackage.AutoSize = True @@ -435,18 +315,6 @@ Partial Class dlgScript Me.rdoCommandPackage.Text = "Get Package:" Me.rdoCommandPackage.UseVisualStyleBackColor = True ' - 'ucrCboCommandPackage - ' - Me.ucrCboCommandPackage.AddQuotesIfUnrecognised = True - Me.ucrCboCommandPackage.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrCboCommandPackage.GetSetSelectedIndex = -1 - Me.ucrCboCommandPackage.IsReadOnly = False - Me.ucrCboCommandPackage.Location = New System.Drawing.Point(156, 19) - Me.ucrCboCommandPackage.Margin = New System.Windows.Forms.Padding(9) - Me.ucrCboCommandPackage.Name = "ucrCboCommandPackage" - Me.ucrCboCommandPackage.Size = New System.Drawing.Size(137, 21) - Me.ucrCboCommandPackage.TabIndex = 44 - ' 'rdoCommandObject ' Me.rdoCommandObject.AutoSize = True @@ -459,15 +327,6 @@ Partial Class dlgScript Me.rdoCommandObject.Text = "Remove Object(s):" Me.rdoCommandObject.UseVisualStyleBackColor = True ' - 'ucrPnlCommands - ' - Me.ucrPnlCommands.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlCommands.Location = New System.Drawing.Point(9, 8) - Me.ucrPnlCommands.Margin = New System.Windows.Forms.Padding(6) - Me.ucrPnlCommands.Name = "ucrPnlCommands" - Me.ucrPnlCommands.Size = New System.Drawing.Size(333, 143) - Me.ucrPnlCommands.TabIndex = 47 - ' 'tbPageExamples ' Me.tbPageExamples.Controls.Add(Me.rdoExampleData) @@ -517,15 +376,6 @@ Partial Class dlgScript Me.rdoExampleFunction.TextAlign = System.Drawing.ContentAlignment.MiddleCenter Me.rdoExampleFunction.UseVisualStyleBackColor = True ' - 'ucrPnlExample - ' - Me.ucrPnlExample.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlExample.Location = New System.Drawing.Point(7, 51) - Me.ucrPnlExample.Margin = New System.Windows.Forms.Padding(6) - Me.ucrPnlExample.Name = "ucrPnlExample" - Me.ucrPnlExample.Size = New System.Drawing.Size(402, 34) - Me.ucrPnlExample.TabIndex = 56 - ' 'lstExampleCollection ' Me.lstExampleCollection.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.clmDatasets, Me.clmDesc}) @@ -562,18 +412,6 @@ Partial Class dlgScript Me.Label3.TabIndex = 52 Me.Label3.Text = "Package" ' - 'ucrCboExamplePackages - ' - Me.ucrCboExamplePackages.AddQuotesIfUnrecognised = True - Me.ucrCboExamplePackages.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrCboExamplePackages.GetSetSelectedIndex = -1 - Me.ucrCboExamplePackages.IsReadOnly = False - Me.ucrCboExamplePackages.Location = New System.Drawing.Point(14, 22) - Me.ucrCboExamplePackages.Margin = New System.Windows.Forms.Padding(9) - Me.ucrCboExamplePackages.Name = "ucrCboExamplePackages" - Me.ucrCboExamplePackages.Size = New System.Drawing.Size(137, 21) - Me.ucrCboExamplePackages.TabIndex = 51 - ' 'lblPreview ' Me.lblPreview.AutoSize = True @@ -593,6 +431,195 @@ Partial Class dlgScript Me.txtScript.Size = New System.Drawing.Size(445, 96) Me.txtScript.TabIndex = 32 ' + 'ucrInputSaveDataFrame + ' + Me.ucrInputSaveDataFrame.AddQuotesIfUnrecognised = True + Me.ucrInputSaveDataFrame.AutoSize = True + Me.ucrInputSaveDataFrame.IsMultiline = False + Me.ucrInputSaveDataFrame.IsReadOnly = False + Me.ucrInputSaveDataFrame.Location = New System.Drawing.Point(92, 70) + Me.ucrInputSaveDataFrame.Margin = New System.Windows.Forms.Padding(9) + Me.ucrInputSaveDataFrame.Name = "ucrInputSaveDataFrame" + Me.ucrInputSaveDataFrame.Size = New System.Drawing.Size(145, 21) + Me.ucrInputSaveDataFrame.TabIndex = 57 + ' + 'ucrCboSaveOutputObjectFormat + ' + Me.ucrCboSaveOutputObjectFormat.AddQuotesIfUnrecognised = True + Me.ucrCboSaveOutputObjectFormat.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboSaveOutputObjectFormat.GetSetSelectedIndex = -1 + Me.ucrCboSaveOutputObjectFormat.IsReadOnly = False + Me.ucrCboSaveOutputObjectFormat.Location = New System.Drawing.Point(88, 160) + Me.ucrCboSaveOutputObjectFormat.Margin = New System.Windows.Forms.Padding(9) + Me.ucrCboSaveOutputObjectFormat.Name = "ucrCboSaveOutputObjectFormat" + Me.ucrCboSaveOutputObjectFormat.Size = New System.Drawing.Size(141, 21) + Me.ucrCboSaveOutputObjectFormat.TabIndex = 55 + ' + 'ucrCboSaveOutputObjectType + ' + Me.ucrCboSaveOutputObjectType.AddQuotesIfUnrecognised = True + Me.ucrCboSaveOutputObjectType.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboSaveOutputObjectType.GetSetSelectedIndex = -1 + Me.ucrCboSaveOutputObjectType.IsReadOnly = False + Me.ucrCboSaveOutputObjectType.Location = New System.Drawing.Point(87, 116) + Me.ucrCboSaveOutputObjectType.Margin = New System.Windows.Forms.Padding(9) + Me.ucrCboSaveOutputObjectType.Name = "ucrCboSaveOutputObjectType" + Me.ucrCboSaveOutputObjectType.Size = New System.Drawing.Size(144, 21) + Me.ucrCboSaveOutputObjectType.TabIndex = 53 + ' + 'ucrSaveObject + ' + Me.ucrSaveObject.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrSaveObject.Location = New System.Drawing.Point(88, 193) + Me.ucrSaveObject.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.ucrSaveObject.Name = "ucrSaveObject" + Me.ucrSaveObject.Size = New System.Drawing.Size(258, 22) + Me.ucrSaveObject.TabIndex = 35 + ' + 'ucrDataFrameSaveOutputSelect + ' + Me.ucrDataFrameSaveOutputSelect.AutoSize = True + Me.ucrDataFrameSaveOutputSelect.bDropUnusedFilterLevels = False + Me.ucrDataFrameSaveOutputSelect.bUseCurrentFilter = True + Me.ucrDataFrameSaveOutputSelect.Location = New System.Drawing.Point(86, 54) + Me.ucrDataFrameSaveOutputSelect.Margin = New System.Windows.Forms.Padding(0) + Me.ucrDataFrameSaveOutputSelect.Name = "ucrDataFrameSaveOutputSelect" + Me.ucrDataFrameSaveOutputSelect.Size = New System.Drawing.Size(224, 59) + Me.ucrDataFrameSaveOutputSelect.TabIndex = 29 + ' + 'ucrPnlSaveData + ' + Me.ucrPnlSaveData.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlSaveData.Location = New System.Drawing.Point(13, 12) + Me.ucrPnlSaveData.Margin = New System.Windows.Forms.Padding(6) + Me.ucrPnlSaveData.Name = "ucrPnlSaveData" + Me.ucrPnlSaveData.Size = New System.Drawing.Size(402, 36) + Me.ucrPnlSaveData.TabIndex = 47 + ' + 'ucrReceiverGetOutputObject + ' + Me.ucrReceiverGetOutputObject.AutoSize = True + Me.ucrReceiverGetOutputObject.frmParent = Me + Me.ucrReceiverGetOutputObject.Location = New System.Drawing.Point(240, 117) + Me.ucrReceiverGetOutputObject.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverGetOutputObject.Name = "ucrReceiverGetOutputObject" + Me.ucrReceiverGetOutputObject.Selector = Nothing + Me.ucrReceiverGetOutputObject.Size = New System.Drawing.Size(138, 20) + Me.ucrReceiverGetOutputObject.strNcFilePath = "" + Me.ucrReceiverGetOutputObject.TabIndex = 27 + Me.ucrReceiverGetOutputObject.ucrSelector = Nothing + ' + 'ucrReceiverGetColumns + ' + Me.ucrReceiverGetColumns.AutoSize = True + Me.ucrReceiverGetColumns.frmParent = Me + Me.ucrReceiverGetColumns.Location = New System.Drawing.Point(243, 104) + Me.ucrReceiverGetColumns.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverGetColumns.Name = "ucrReceiverGetColumns" + Me.ucrReceiverGetColumns.Selector = Nothing + Me.ucrReceiverGetColumns.Size = New System.Drawing.Size(137, 105) + Me.ucrReceiverGetColumns.strNcFilePath = "" + Me.ucrReceiverGetColumns.TabIndex = 49 + Me.ucrReceiverGetColumns.ucrSelector = Nothing + ' + 'ucrDataFrameGetDF + ' + Me.ucrDataFrameGetDF.AutoSize = True + Me.ucrDataFrameGetDF.bDropUnusedFilterLevels = False + Me.ucrDataFrameGetDF.bUseCurrentFilter = True + Me.ucrDataFrameGetDF.Location = New System.Drawing.Point(81, 55) + Me.ucrDataFrameGetDF.Margin = New System.Windows.Forms.Padding(0) + Me.ucrDataFrameGetDF.Name = "ucrDataFrameGetDF" + Me.ucrDataFrameGetDF.Size = New System.Drawing.Size(224, 59) + Me.ucrDataFrameGetDF.TabIndex = 31 + ' + 'ucrCboGetOutputObjectType + ' + Me.ucrCboGetOutputObjectType.AddQuotesIfUnrecognised = True + Me.ucrCboGetOutputObjectType.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboGetOutputObjectType.GetSetSelectedIndex = -1 + Me.ucrCboGetOutputObjectType.IsReadOnly = False + Me.ucrCboGetOutputObjectType.Location = New System.Drawing.Point(241, 72) + Me.ucrCboGetOutputObjectType.Margin = New System.Windows.Forms.Padding(9) + Me.ucrCboGetOutputObjectType.Name = "ucrCboGetOutputObjectType" + Me.ucrCboGetOutputObjectType.Size = New System.Drawing.Size(137, 21) + Me.ucrCboGetOutputObjectType.TabIndex = 47 + ' + 'ucrPnlGetData + ' + Me.ucrPnlGetData.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlGetData.Location = New System.Drawing.Point(5, 10) + Me.ucrPnlGetData.Margin = New System.Windows.Forms.Padding(6) + Me.ucrPnlGetData.Name = "ucrPnlGetData" + Me.ucrPnlGetData.Size = New System.Drawing.Size(402, 36) + Me.ucrPnlGetData.TabIndex = 42 + ' + 'ucrSelectorGetObject + ' + Me.ucrSelectorGetObject.AutoSize = True + Me.ucrSelectorGetObject.bDropUnusedFilterLevels = False + Me.ucrSelectorGetObject.bShowHiddenColumns = False + Me.ucrSelectorGetObject.bUseCurrentFilter = True + Me.ucrSelectorGetObject.Location = New System.Drawing.Point(9, 52) + Me.ucrSelectorGetObject.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectorGetObject.Name = "ucrSelectorGetObject" + Me.ucrSelectorGetObject.Size = New System.Drawing.Size(320, 274) + Me.ucrSelectorGetObject.TabIndex = 34 + ' + 'ucrInputRemoveObjects + ' + Me.ucrInputRemoveObjects.AddQuotesIfUnrecognised = True + Me.ucrInputRemoveObjects.AutoSize = True + Me.ucrInputRemoveObjects.IsMultiline = False + Me.ucrInputRemoveObjects.IsReadOnly = False + Me.ucrInputRemoveObjects.Location = New System.Drawing.Point(156, 56) + Me.ucrInputRemoveObjects.Margin = New System.Windows.Forms.Padding(9) + Me.ucrInputRemoveObjects.Name = "ucrInputRemoveObjects" + Me.ucrInputRemoveObjects.Size = New System.Drawing.Size(145, 21) + Me.ucrInputRemoveObjects.TabIndex = 2 + ' + 'ucrCboCommandPackage + ' + Me.ucrCboCommandPackage.AddQuotesIfUnrecognised = True + Me.ucrCboCommandPackage.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboCommandPackage.GetSetSelectedIndex = -1 + Me.ucrCboCommandPackage.IsReadOnly = False + Me.ucrCboCommandPackage.Location = New System.Drawing.Point(156, 19) + Me.ucrCboCommandPackage.Margin = New System.Windows.Forms.Padding(9) + Me.ucrCboCommandPackage.Name = "ucrCboCommandPackage" + Me.ucrCboCommandPackage.Size = New System.Drawing.Size(137, 21) + Me.ucrCboCommandPackage.TabIndex = 44 + ' + 'ucrPnlCommands + ' + Me.ucrPnlCommands.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlCommands.Location = New System.Drawing.Point(9, 8) + Me.ucrPnlCommands.Margin = New System.Windows.Forms.Padding(6) + Me.ucrPnlCommands.Name = "ucrPnlCommands" + Me.ucrPnlCommands.Size = New System.Drawing.Size(333, 143) + Me.ucrPnlCommands.TabIndex = 47 + ' + 'ucrPnlExample + ' + Me.ucrPnlExample.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlExample.Location = New System.Drawing.Point(7, 51) + Me.ucrPnlExample.Margin = New System.Windows.Forms.Padding(6) + Me.ucrPnlExample.Name = "ucrPnlExample" + Me.ucrPnlExample.Size = New System.Drawing.Size(402, 34) + Me.ucrPnlExample.TabIndex = 56 + ' + 'ucrCboExamplePackages + ' + Me.ucrCboExamplePackages.AddQuotesIfUnrecognised = True + Me.ucrCboExamplePackages.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboExamplePackages.GetSetSelectedIndex = -1 + Me.ucrCboExamplePackages.IsReadOnly = False + Me.ucrCboExamplePackages.Location = New System.Drawing.Point(14, 22) + Me.ucrCboExamplePackages.Margin = New System.Windows.Forms.Padding(9) + Me.ucrCboExamplePackages.Name = "ucrCboExamplePackages" + Me.ucrCboExamplePackages.Size = New System.Drawing.Size(137, 21) + Me.ucrCboExamplePackages.TabIndex = 51 + ' 'ucrBase ' Me.ucrBase.AutoSize = True @@ -603,6 +630,15 @@ Partial Class dlgScript Me.ucrBase.Size = New System.Drawing.Size(408, 52) Me.ucrBase.TabIndex = 16 ' + 'ucrChkSaveDataFrameList + ' + Me.ucrChkSaveDataFrameList.AutoSize = True + Me.ucrChkSaveDataFrameList.Checked = False + Me.ucrChkSaveDataFrameList.Location = New System.Drawing.Point(91, 101) + Me.ucrChkSaveDataFrameList.Name = "ucrChkSaveDataFrameList" + Me.ucrChkSaveDataFrameList.Size = New System.Drawing.Size(146, 23) + Me.ucrChkSaveDataFrameList.TabIndex = 59 + ' 'dlgScript ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) @@ -639,7 +675,7 @@ Partial Class dlgScript Friend WithEvents tbPageGetData As TabPage Friend WithEvents tbPageSaveData As TabPage Friend WithEvents lblPreview As Label - Friend WithEvents ucrSaveData As ucrSave + Friend WithEvents ucrSaveObject As ucrSave Friend WithEvents tbPageCommand As TabPage Friend WithEvents ucrDataFrameSaveOutputSelect As ucrDataFrame Friend WithEvents ucrSelectorGetObject As ucrSelectorByDataFrameAddRemove @@ -676,4 +712,7 @@ Partial Class dlgScript Friend WithEvents ucrPnlCommands As UcrPanel Friend WithEvents rdoCommandPackage As RadioButton Friend WithEvents rdoCommandObject As RadioButton + Friend WithEvents lblSaveDataFrame As Label + Friend WithEvents ucrInputSaveDataFrame As ucrInputTextBox + Friend WithEvents ucrChkSaveDataFrameList As ucrCheck End Class diff --git a/instat/dlgScript.vb b/instat/dlgScript.vb index 292b58dae73..fecebeb42a9 100644 --- a/instat/dlgScript.vb +++ b/instat/dlgScript.vb @@ -61,11 +61,12 @@ Public Class dlgScript ucrCboSaveOutputObjectFormat.SetLinkedDisplayControl(lblSaveObjectFormat) ucrCboSaveOutputObjectFormat.GetSetSelectedIndex = 0 + ucrSaveObject.SetLabelText("Save Graph") + ucrSaveObject.SetIsComboBox() + ucrSaveObject.SetDataFrameSelector(ucrDataFrameSaveOutputSelect) - ucrSaveData.SetLabelText("Save Graph") - ucrSaveData.SetIsComboBox() - ucrSaveData.SetDataFrameSelector(ucrDataFrameSaveOutputSelect) - + ucrInputSaveDataFrame.SetLinkedDisplayControl(lblSaveDataFrame) + ucrChkSaveDataFrameList.SetText("Single") '-------------------------------- 'Get data controls @@ -144,9 +145,10 @@ Public Class dlgScript ucrInputRemoveObjects.Reset() ' Save controls reset - ucrSaveData.SetRCode(clsSaveDataFunction, True) - ucrSaveData.Reset() + ucrSaveObject.SetRCode(clsSaveDataFunction, True) + ucrSaveObject.Reset() rdoSaveDataFrame.Checked = True + ucrChkSaveDataFrameList.Checked = True ucrDataFrameSaveOutputSelect.Reset() ' Get controls reset @@ -166,15 +168,21 @@ Public Class dlgScript ucrDataFrameSaveOutputSelect.SetVisible(False) ucrCboSaveOutputObjectType.SetVisible(False) ucrCboSaveOutputObjectFormat.SetVisible(False) + ucrSaveObject.SetVisible(False) + ucrInputSaveDataFrame.SetVisible(False) + ucrChkSaveDataFrameList.SetVisible(False) If rdoSaveDataFrame.Checked Then - ucrSaveData.Location = New Point(ucrSaveData.Location.X, ucrDataFrameSaveOutputSelect.Location.Y) - SetupSaveDataControl("Data Frame", RObjectTypeLabel.Dataframe, "") + ucrInputSaveDataFrame.SetVisible(True) + ucrChkSaveDataFrameList.SetVisible(True) + ucrInputSaveDataFrame.SetName("") ElseIf rdoSaveColumn.Checked Then - ucrSaveData.Location = New Point(ucrSaveData.Location.X, ucrCboSaveOutputObjectType.Location.Y) + ucrSaveObject.Location = New Point(ucrSaveObject.Location.X, ucrCboSaveOutputObjectType.Location.Y) + ucrSaveObject.SetVisible(True) ucrDataFrameSaveOutputSelect.SetVisible(True) SetupSaveDataControl("Column", RObjectTypeLabel.Column, "") ElseIf rdoSaveOutputObject.Checked Then - ucrSaveData.Location = New Point(ucrSaveData.Location.X, ucrCboSaveOutputObjectFormat.Location.Y + 33) + ucrSaveObject.Location = New Point(ucrSaveObject.Location.X, ucrCboSaveOutputObjectFormat.Location.Y + 33) + ucrSaveObject.SetVisible(True) ucrDataFrameSaveOutputSelect.SetVisible(True) ucrCboSaveOutputObjectType.SetVisible(True) ucrCboSaveOutputObjectFormat.SetVisible(True) @@ -189,29 +197,45 @@ Public Class dlgScript End Sub Private Sub SetupSaveDataControl(strLabel As String, strDataType As String, strFormat As String) + ucrSaveObject.SetSaveType(strDataType, strFormat) + ucrSaveObject.SetLabelText(strLabel) + ucrSaveObject.SetName("") + End Sub + + Private Sub ucrSaveDataFrameControls_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputSaveDataFrame.ControlContentsChanged, ucrChkSaveDataFrameList.ControlContentsChanged + Dim strScript As String = "" + + If Not ucrInputSaveDataFrame.IsEmpty() Then + Dim strDataFrameName As String = ucrInputSaveDataFrame.GetText() + Dim clsImportRFunction As New RFunction - ucrSaveData.SetSaveType(strDataType, strFormat) - ucrSaveData.SetLabelText(strLabel) - ucrSaveData.SetName("") + clsImportRFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$import_data") - If strDataType = RObjectTypeLabel.Dataframe Then - ucrSaveData.SetIsTextBox() - Else - ucrSaveData.SetIsComboBox() + If ucrChkSaveDataFrameList.Checked Then + Dim clsDataListRFunction As New RFunction + clsDataListRFunction.SetRCommand("list") + clsDataListRFunction.AddParameter(strParameterValue:=strDataFrameName, bIncludeArgumentName:=False) + clsImportRFunction.AddParameter(strParameterName:="data_tables", clsRFunctionParameter:=clsDataListRFunction) + Else + clsImportRFunction.AddParameter(strParameterName:="data_tables", strParameterValue:=strDataFrameName) + End If + + strScript = "# Save data frame(s) """ & strDataFrameName & """" & Environment.NewLine & clsImportRFunction.ToScript() End If + + + PreviewScript(strScript) End Sub - Private Sub ucrSaveData_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSaveData.ControlContentsChanged + Private Sub ucrSaveData_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrSaveObject.ControlContentsChanged Dim strScript As String = "" - If ucrSaveData.IsComplete Then + If ucrSaveObject.IsComplete Then ' R code is not automatiucally updated by save control when control contents changed event is raised by the control - ucrSaveData.UpdateRCode() + ucrSaveObject.UpdateRCode() Dim strDataType As String = "" - If rdoSaveDataFrame.Checked Then - strDataType = "data frame" - ElseIf rdoSaveColumn.Checked Then + If rdoSaveColumn.Checked Then strDataType = "column" ElseIf rdoSaveOutputObject.Checked Then strDataType = ucrCboSaveOutputObjectType.GetText().ToLower() @@ -222,7 +246,7 @@ Public Class dlgScript If arrtemp.Length > 1 Then 'ignore the first line of the script because it is an "empty" assignment strTemp = arrtemp(1) - strScript = "# Save " & strDataType & " """ & ucrSaveData.GetText() & """" & Environment.NewLine & strTemp + strScript = "# Save " & strDataType & " """ & ucrSaveObject.GetText() & """" & Environment.NewLine & strTemp End If End If From dc9e7d9f61d71d928f62efd85e947cb104a4542c Mon Sep 17 00:00:00 2001 From: patowhiz Date: Thu, 16 Nov 2023 20:09:26 +0300 Subject: [PATCH 26/27] insert the script --- instat/dlgScript.Designer.vb | 436 +++++++++++++++++------------------ instat/dlgScript.vb | 17 +- 2 files changed, 227 insertions(+), 226 deletions(-) diff --git a/instat/dlgScript.Designer.vb b/instat/dlgScript.Designer.vb index 50afe38c308..87f9545cc1c 100644 --- a/instat/dlgScript.Designer.vb +++ b/instat/dlgScript.Designer.vb @@ -24,50 +24,50 @@ Partial Class dlgScript Private Sub InitializeComponent() Me.tbFeatures = New System.Windows.Forms.TabControl() Me.tbPageSaveData = New System.Windows.Forms.TabPage() + Me.ucrChkSaveDataFrameSingle = New instat.ucrCheck() Me.lblSaveDataFrame = New System.Windows.Forms.Label() + Me.ucrInputSaveDataFrame = New instat.ucrInputTextBox() Me.lblSaveObjectFormat = New System.Windows.Forms.Label() + Me.ucrCboSaveOutputObjectFormat = New instat.ucrInputComboBox() Me.lblSaveObjectType = New System.Windows.Forms.Label() + Me.ucrCboSaveOutputObjectType = New instat.ucrInputComboBox() Me.rdoSaveOutputObject = New System.Windows.Forms.RadioButton() Me.rdoSaveDataFrame = New System.Windows.Forms.RadioButton() Me.rdoSaveColumn = New System.Windows.Forms.RadioButton() + Me.ucrSaveObject = New instat.ucrSave() + Me.ucrDataFrameSaveOutputSelect = New instat.ucrDataFrame() + Me.ucrPnlSaveData = New instat.UcrPanel() Me.tbPageGetData = New System.Windows.Forms.TabPage() + Me.ucrReceiverGetOutputObject = New instat.ucrReceiverSingle() + Me.ucrReceiverGetColumns = New instat.ucrReceiverMultiple() Me.lblGetColumn = New System.Windows.Forms.Label() Me.lblGetObjectType = New System.Windows.Forms.Label() Me.rdoGetOutputObject = New System.Windows.Forms.RadioButton() Me.lblGetOutputObject = New System.Windows.Forms.Label() Me.rdoGetDataFrame = New System.Windows.Forms.RadioButton() Me.rdoGetColumn = New System.Windows.Forms.RadioButton() + Me.ucrDataFrameGetDF = New instat.ucrDataFrame() + Me.ucrCboGetOutputObjectType = New instat.ucrInputComboBox() + Me.ucrPnlGetData = New instat.UcrPanel() + Me.ucrSelectorGetObject = New instat.ucrSelectorByDataFrameAddRemove() Me.tbPageCommand = New System.Windows.Forms.TabPage() + Me.ucrInputRemoveObjects = New instat.ucrInputTextBox() Me.rdoCommandPackage = New System.Windows.Forms.RadioButton() Me.rdoCommandObject = New System.Windows.Forms.RadioButton() + Me.ucrCboCommandPackage = New instat.ucrInputComboBox() + Me.ucrPnlCommands = New instat.UcrPanel() Me.tbPageExamples = New System.Windows.Forms.TabPage() Me.rdoExampleData = New System.Windows.Forms.RadioButton() Me.rdoExampleFunction = New System.Windows.Forms.RadioButton() + Me.ucrPnlExample = New instat.UcrPanel() Me.lstExampleCollection = New System.Windows.Forms.ListView() Me.clmDatasets = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader) Me.clmDesc = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader) Me.Label3 = New System.Windows.Forms.Label() + Me.ucrCboExamplePackages = New instat.ucrInputComboBox() Me.lblPreview = New System.Windows.Forms.Label() Me.txtScript = New System.Windows.Forms.TextBox() - Me.ucrInputSaveDataFrame = New instat.ucrInputTextBox() - Me.ucrCboSaveOutputObjectFormat = New instat.ucrInputComboBox() - Me.ucrCboSaveOutputObjectType = New instat.ucrInputComboBox() - Me.ucrSaveObject = New instat.ucrSave() - Me.ucrDataFrameSaveOutputSelect = New instat.ucrDataFrame() - Me.ucrPnlSaveData = New instat.UcrPanel() - Me.ucrReceiverGetOutputObject = New instat.ucrReceiverSingle() - Me.ucrReceiverGetColumns = New instat.ucrReceiverMultiple() - Me.ucrDataFrameGetDF = New instat.ucrDataFrame() - Me.ucrCboGetOutputObjectType = New instat.ucrInputComboBox() - Me.ucrPnlGetData = New instat.UcrPanel() - Me.ucrSelectorGetObject = New instat.ucrSelectorByDataFrameAddRemove() - Me.ucrInputRemoveObjects = New instat.ucrInputTextBox() - Me.ucrCboCommandPackage = New instat.ucrInputComboBox() - Me.ucrPnlCommands = New instat.UcrPanel() - Me.ucrPnlExample = New instat.UcrPanel() - Me.ucrCboExamplePackages = New instat.ucrInputComboBox() Me.ucrBase = New instat.ucrButtons() - Me.ucrChkSaveDataFrameList = New instat.ucrCheck() Me.tbFeatures.SuspendLayout() Me.tbPageSaveData.SuspendLayout() Me.tbPageGetData.SuspendLayout() @@ -89,7 +89,7 @@ Partial Class dlgScript ' 'tbPageSaveData ' - Me.tbPageSaveData.Controls.Add(Me.ucrChkSaveDataFrameList) + Me.tbPageSaveData.Controls.Add(Me.ucrChkSaveDataFrameSingle) Me.tbPageSaveData.Controls.Add(Me.lblSaveDataFrame) Me.tbPageSaveData.Controls.Add(Me.ucrInputSaveDataFrame) Me.tbPageSaveData.Controls.Add(Me.lblSaveObjectFormat) @@ -109,6 +109,15 @@ Partial Class dlgScript Me.tbPageSaveData.Text = "Save Data" Me.tbPageSaveData.UseVisualStyleBackColor = True ' + 'ucrChkSaveDataFrameSingle + ' + Me.ucrChkSaveDataFrameSingle.AutoSize = True + Me.ucrChkSaveDataFrameSingle.Checked = False + Me.ucrChkSaveDataFrameSingle.Location = New System.Drawing.Point(91, 101) + Me.ucrChkSaveDataFrameSingle.Name = "ucrChkSaveDataFrameSingle" + Me.ucrChkSaveDataFrameSingle.Size = New System.Drawing.Size(146, 23) + Me.ucrChkSaveDataFrameSingle.TabIndex = 59 + ' 'lblSaveDataFrame ' Me.lblSaveDataFrame.AutoSize = True @@ -118,6 +127,18 @@ Partial Class dlgScript Me.lblSaveDataFrame.TabIndex = 58 Me.lblSaveDataFrame.Text = "Data Frame:" ' + 'ucrInputSaveDataFrame + ' + Me.ucrInputSaveDataFrame.AddQuotesIfUnrecognised = True + Me.ucrInputSaveDataFrame.AutoSize = True + Me.ucrInputSaveDataFrame.IsMultiline = False + Me.ucrInputSaveDataFrame.IsReadOnly = False + Me.ucrInputSaveDataFrame.Location = New System.Drawing.Point(92, 70) + Me.ucrInputSaveDataFrame.Margin = New System.Windows.Forms.Padding(9) + Me.ucrInputSaveDataFrame.Name = "ucrInputSaveDataFrame" + Me.ucrInputSaveDataFrame.Size = New System.Drawing.Size(145, 21) + Me.ucrInputSaveDataFrame.TabIndex = 57 + ' 'lblSaveObjectFormat ' Me.lblSaveObjectFormat.AutoSize = True @@ -127,6 +148,18 @@ Partial Class dlgScript Me.lblSaveObjectFormat.TabIndex = 56 Me.lblSaveObjectFormat.Text = "Format:" ' + 'ucrCboSaveOutputObjectFormat + ' + Me.ucrCboSaveOutputObjectFormat.AddQuotesIfUnrecognised = True + Me.ucrCboSaveOutputObjectFormat.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboSaveOutputObjectFormat.GetSetSelectedIndex = -1 + Me.ucrCboSaveOutputObjectFormat.IsReadOnly = False + Me.ucrCboSaveOutputObjectFormat.Location = New System.Drawing.Point(88, 160) + Me.ucrCboSaveOutputObjectFormat.Margin = New System.Windows.Forms.Padding(9) + Me.ucrCboSaveOutputObjectFormat.Name = "ucrCboSaveOutputObjectFormat" + Me.ucrCboSaveOutputObjectFormat.Size = New System.Drawing.Size(141, 21) + Me.ucrCboSaveOutputObjectFormat.TabIndex = 55 + ' 'lblSaveObjectType ' Me.lblSaveObjectType.AutoSize = True @@ -136,6 +169,18 @@ Partial Class dlgScript Me.lblSaveObjectType.TabIndex = 54 Me.lblSaveObjectType.Text = "Type:" ' + 'ucrCboSaveOutputObjectType + ' + Me.ucrCboSaveOutputObjectType.AddQuotesIfUnrecognised = True + Me.ucrCboSaveOutputObjectType.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboSaveOutputObjectType.GetSetSelectedIndex = -1 + Me.ucrCboSaveOutputObjectType.IsReadOnly = False + Me.ucrCboSaveOutputObjectType.Location = New System.Drawing.Point(87, 116) + Me.ucrCboSaveOutputObjectType.Margin = New System.Windows.Forms.Padding(9) + Me.ucrCboSaveOutputObjectType.Name = "ucrCboSaveOutputObjectType" + Me.ucrCboSaveOutputObjectType.Size = New System.Drawing.Size(144, 21) + Me.ucrCboSaveOutputObjectType.TabIndex = 53 + ' 'rdoSaveOutputObject ' Me.rdoSaveOutputObject.Appearance = System.Windows.Forms.Appearance.Button @@ -187,6 +232,35 @@ Partial Class dlgScript Me.rdoSaveColumn.TextAlign = System.Drawing.ContentAlignment.MiddleCenter Me.rdoSaveColumn.UseVisualStyleBackColor = True ' + 'ucrSaveObject + ' + Me.ucrSaveObject.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrSaveObject.Location = New System.Drawing.Point(88, 193) + Me.ucrSaveObject.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.ucrSaveObject.Name = "ucrSaveObject" + Me.ucrSaveObject.Size = New System.Drawing.Size(258, 22) + Me.ucrSaveObject.TabIndex = 35 + ' + 'ucrDataFrameSaveOutputSelect + ' + Me.ucrDataFrameSaveOutputSelect.AutoSize = True + Me.ucrDataFrameSaveOutputSelect.bDropUnusedFilterLevels = False + Me.ucrDataFrameSaveOutputSelect.bUseCurrentFilter = True + Me.ucrDataFrameSaveOutputSelect.Location = New System.Drawing.Point(86, 54) + Me.ucrDataFrameSaveOutputSelect.Margin = New System.Windows.Forms.Padding(0) + Me.ucrDataFrameSaveOutputSelect.Name = "ucrDataFrameSaveOutputSelect" + Me.ucrDataFrameSaveOutputSelect.Size = New System.Drawing.Size(224, 59) + Me.ucrDataFrameSaveOutputSelect.TabIndex = 29 + ' + 'ucrPnlSaveData + ' + Me.ucrPnlSaveData.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlSaveData.Location = New System.Drawing.Point(13, 12) + Me.ucrPnlSaveData.Margin = New System.Windows.Forms.Padding(6) + Me.ucrPnlSaveData.Name = "ucrPnlSaveData" + Me.ucrPnlSaveData.Size = New System.Drawing.Size(402, 36) + Me.ucrPnlSaveData.TabIndex = 47 + ' 'tbPageGetData ' Me.tbPageGetData.Controls.Add(Me.ucrReceiverGetOutputObject) @@ -209,6 +283,32 @@ Partial Class dlgScript Me.tbPageGetData.Text = "Get Data" Me.tbPageGetData.UseVisualStyleBackColor = True ' + 'ucrReceiverGetOutputObject + ' + Me.ucrReceiverGetOutputObject.AutoSize = True + Me.ucrReceiverGetOutputObject.frmParent = Nothing + Me.ucrReceiverGetOutputObject.Location = New System.Drawing.Point(240, 117) + Me.ucrReceiverGetOutputObject.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverGetOutputObject.Name = "ucrReceiverGetOutputObject" + Me.ucrReceiverGetOutputObject.Selector = Nothing + Me.ucrReceiverGetOutputObject.Size = New System.Drawing.Size(138, 20) + Me.ucrReceiverGetOutputObject.strNcFilePath = "" + Me.ucrReceiverGetOutputObject.TabIndex = 27 + Me.ucrReceiverGetOutputObject.ucrSelector = Nothing + ' + 'ucrReceiverGetColumns + ' + Me.ucrReceiverGetColumns.AutoSize = True + Me.ucrReceiverGetColumns.frmParent = Nothing + Me.ucrReceiverGetColumns.Location = New System.Drawing.Point(243, 104) + Me.ucrReceiverGetColumns.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverGetColumns.Name = "ucrReceiverGetColumns" + Me.ucrReceiverGetColumns.Selector = Nothing + Me.ucrReceiverGetColumns.Size = New System.Drawing.Size(137, 105) + Me.ucrReceiverGetColumns.strNcFilePath = "" + Me.ucrReceiverGetColumns.TabIndex = 49 + Me.ucrReceiverGetColumns.ucrSelector = Nothing + ' 'lblGetColumn ' Me.lblGetColumn.AutoSize = True @@ -289,6 +389,50 @@ Partial Class dlgScript Me.rdoGetColumn.TextAlign = System.Drawing.ContentAlignment.MiddleCenter Me.rdoGetColumn.UseVisualStyleBackColor = True ' + 'ucrDataFrameGetDF + ' + Me.ucrDataFrameGetDF.AutoSize = True + Me.ucrDataFrameGetDF.bDropUnusedFilterLevels = False + Me.ucrDataFrameGetDF.bUseCurrentFilter = True + Me.ucrDataFrameGetDF.Location = New System.Drawing.Point(81, 55) + Me.ucrDataFrameGetDF.Margin = New System.Windows.Forms.Padding(0) + Me.ucrDataFrameGetDF.Name = "ucrDataFrameGetDF" + Me.ucrDataFrameGetDF.Size = New System.Drawing.Size(224, 59) + Me.ucrDataFrameGetDF.TabIndex = 31 + ' + 'ucrCboGetOutputObjectType + ' + Me.ucrCboGetOutputObjectType.AddQuotesIfUnrecognised = True + Me.ucrCboGetOutputObjectType.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboGetOutputObjectType.GetSetSelectedIndex = -1 + Me.ucrCboGetOutputObjectType.IsReadOnly = False + Me.ucrCboGetOutputObjectType.Location = New System.Drawing.Point(241, 72) + Me.ucrCboGetOutputObjectType.Margin = New System.Windows.Forms.Padding(9) + Me.ucrCboGetOutputObjectType.Name = "ucrCboGetOutputObjectType" + Me.ucrCboGetOutputObjectType.Size = New System.Drawing.Size(137, 21) + Me.ucrCboGetOutputObjectType.TabIndex = 47 + ' + 'ucrPnlGetData + ' + Me.ucrPnlGetData.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlGetData.Location = New System.Drawing.Point(5, 10) + Me.ucrPnlGetData.Margin = New System.Windows.Forms.Padding(6) + Me.ucrPnlGetData.Name = "ucrPnlGetData" + Me.ucrPnlGetData.Size = New System.Drawing.Size(402, 36) + Me.ucrPnlGetData.TabIndex = 42 + ' + 'ucrSelectorGetObject + ' + Me.ucrSelectorGetObject.AutoSize = True + Me.ucrSelectorGetObject.bDropUnusedFilterLevels = False + Me.ucrSelectorGetObject.bShowHiddenColumns = False + Me.ucrSelectorGetObject.bUseCurrentFilter = True + Me.ucrSelectorGetObject.Location = New System.Drawing.Point(9, 52) + Me.ucrSelectorGetObject.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectorGetObject.Name = "ucrSelectorGetObject" + Me.ucrSelectorGetObject.Size = New System.Drawing.Size(320, 274) + Me.ucrSelectorGetObject.TabIndex = 34 + ' 'tbPageCommand ' Me.tbPageCommand.Controls.Add(Me.ucrInputRemoveObjects) @@ -303,6 +447,18 @@ Partial Class dlgScript Me.tbPageCommand.Text = "Commands" Me.tbPageCommand.UseVisualStyleBackColor = True ' + 'ucrInputRemoveObjects + ' + Me.ucrInputRemoveObjects.AddQuotesIfUnrecognised = True + Me.ucrInputRemoveObjects.AutoSize = True + Me.ucrInputRemoveObjects.IsMultiline = False + Me.ucrInputRemoveObjects.IsReadOnly = False + Me.ucrInputRemoveObjects.Location = New System.Drawing.Point(156, 56) + Me.ucrInputRemoveObjects.Margin = New System.Windows.Forms.Padding(9) + Me.ucrInputRemoveObjects.Name = "ucrInputRemoveObjects" + Me.ucrInputRemoveObjects.Size = New System.Drawing.Size(145, 21) + Me.ucrInputRemoveObjects.TabIndex = 2 + ' 'rdoCommandPackage ' Me.rdoCommandPackage.AutoSize = True @@ -327,6 +483,27 @@ Partial Class dlgScript Me.rdoCommandObject.Text = "Remove Object(s):" Me.rdoCommandObject.UseVisualStyleBackColor = True ' + 'ucrCboCommandPackage + ' + Me.ucrCboCommandPackage.AddQuotesIfUnrecognised = True + Me.ucrCboCommandPackage.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboCommandPackage.GetSetSelectedIndex = -1 + Me.ucrCboCommandPackage.IsReadOnly = False + Me.ucrCboCommandPackage.Location = New System.Drawing.Point(156, 19) + Me.ucrCboCommandPackage.Margin = New System.Windows.Forms.Padding(9) + Me.ucrCboCommandPackage.Name = "ucrCboCommandPackage" + Me.ucrCboCommandPackage.Size = New System.Drawing.Size(137, 21) + Me.ucrCboCommandPackage.TabIndex = 44 + ' + 'ucrPnlCommands + ' + Me.ucrPnlCommands.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlCommands.Location = New System.Drawing.Point(9, 8) + Me.ucrPnlCommands.Margin = New System.Windows.Forms.Padding(6) + Me.ucrPnlCommands.Name = "ucrPnlCommands" + Me.ucrPnlCommands.Size = New System.Drawing.Size(333, 143) + Me.ucrPnlCommands.TabIndex = 47 + ' 'tbPageExamples ' Me.tbPageExamples.Controls.Add(Me.rdoExampleData) @@ -376,6 +553,15 @@ Partial Class dlgScript Me.rdoExampleFunction.TextAlign = System.Drawing.ContentAlignment.MiddleCenter Me.rdoExampleFunction.UseVisualStyleBackColor = True ' + 'ucrPnlExample + ' + Me.ucrPnlExample.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlExample.Location = New System.Drawing.Point(7, 51) + Me.ucrPnlExample.Margin = New System.Windows.Forms.Padding(6) + Me.ucrPnlExample.Name = "ucrPnlExample" + Me.ucrPnlExample.Size = New System.Drawing.Size(402, 34) + Me.ucrPnlExample.TabIndex = 56 + ' 'lstExampleCollection ' Me.lstExampleCollection.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.clmDatasets, Me.clmDesc}) @@ -412,6 +598,18 @@ Partial Class dlgScript Me.Label3.TabIndex = 52 Me.Label3.Text = "Package" ' + 'ucrCboExamplePackages + ' + Me.ucrCboExamplePackages.AddQuotesIfUnrecognised = True + Me.ucrCboExamplePackages.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboExamplePackages.GetSetSelectedIndex = -1 + Me.ucrCboExamplePackages.IsReadOnly = False + Me.ucrCboExamplePackages.Location = New System.Drawing.Point(14, 22) + Me.ucrCboExamplePackages.Margin = New System.Windows.Forms.Padding(9) + Me.ucrCboExamplePackages.Name = "ucrCboExamplePackages" + Me.ucrCboExamplePackages.Size = New System.Drawing.Size(137, 21) + Me.ucrCboExamplePackages.TabIndex = 51 + ' 'lblPreview ' Me.lblPreview.AutoSize = True @@ -431,195 +629,6 @@ Partial Class dlgScript Me.txtScript.Size = New System.Drawing.Size(445, 96) Me.txtScript.TabIndex = 32 ' - 'ucrInputSaveDataFrame - ' - Me.ucrInputSaveDataFrame.AddQuotesIfUnrecognised = True - Me.ucrInputSaveDataFrame.AutoSize = True - Me.ucrInputSaveDataFrame.IsMultiline = False - Me.ucrInputSaveDataFrame.IsReadOnly = False - Me.ucrInputSaveDataFrame.Location = New System.Drawing.Point(92, 70) - Me.ucrInputSaveDataFrame.Margin = New System.Windows.Forms.Padding(9) - Me.ucrInputSaveDataFrame.Name = "ucrInputSaveDataFrame" - Me.ucrInputSaveDataFrame.Size = New System.Drawing.Size(145, 21) - Me.ucrInputSaveDataFrame.TabIndex = 57 - ' - 'ucrCboSaveOutputObjectFormat - ' - Me.ucrCboSaveOutputObjectFormat.AddQuotesIfUnrecognised = True - Me.ucrCboSaveOutputObjectFormat.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrCboSaveOutputObjectFormat.GetSetSelectedIndex = -1 - Me.ucrCboSaveOutputObjectFormat.IsReadOnly = False - Me.ucrCboSaveOutputObjectFormat.Location = New System.Drawing.Point(88, 160) - Me.ucrCboSaveOutputObjectFormat.Margin = New System.Windows.Forms.Padding(9) - Me.ucrCboSaveOutputObjectFormat.Name = "ucrCboSaveOutputObjectFormat" - Me.ucrCboSaveOutputObjectFormat.Size = New System.Drawing.Size(141, 21) - Me.ucrCboSaveOutputObjectFormat.TabIndex = 55 - ' - 'ucrCboSaveOutputObjectType - ' - Me.ucrCboSaveOutputObjectType.AddQuotesIfUnrecognised = True - Me.ucrCboSaveOutputObjectType.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrCboSaveOutputObjectType.GetSetSelectedIndex = -1 - Me.ucrCboSaveOutputObjectType.IsReadOnly = False - Me.ucrCboSaveOutputObjectType.Location = New System.Drawing.Point(87, 116) - Me.ucrCboSaveOutputObjectType.Margin = New System.Windows.Forms.Padding(9) - Me.ucrCboSaveOutputObjectType.Name = "ucrCboSaveOutputObjectType" - Me.ucrCboSaveOutputObjectType.Size = New System.Drawing.Size(144, 21) - Me.ucrCboSaveOutputObjectType.TabIndex = 53 - ' - 'ucrSaveObject - ' - Me.ucrSaveObject.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrSaveObject.Location = New System.Drawing.Point(88, 193) - Me.ucrSaveObject.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) - Me.ucrSaveObject.Name = "ucrSaveObject" - Me.ucrSaveObject.Size = New System.Drawing.Size(258, 22) - Me.ucrSaveObject.TabIndex = 35 - ' - 'ucrDataFrameSaveOutputSelect - ' - Me.ucrDataFrameSaveOutputSelect.AutoSize = True - Me.ucrDataFrameSaveOutputSelect.bDropUnusedFilterLevels = False - Me.ucrDataFrameSaveOutputSelect.bUseCurrentFilter = True - Me.ucrDataFrameSaveOutputSelect.Location = New System.Drawing.Point(86, 54) - Me.ucrDataFrameSaveOutputSelect.Margin = New System.Windows.Forms.Padding(0) - Me.ucrDataFrameSaveOutputSelect.Name = "ucrDataFrameSaveOutputSelect" - Me.ucrDataFrameSaveOutputSelect.Size = New System.Drawing.Size(224, 59) - Me.ucrDataFrameSaveOutputSelect.TabIndex = 29 - ' - 'ucrPnlSaveData - ' - Me.ucrPnlSaveData.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlSaveData.Location = New System.Drawing.Point(13, 12) - Me.ucrPnlSaveData.Margin = New System.Windows.Forms.Padding(6) - Me.ucrPnlSaveData.Name = "ucrPnlSaveData" - Me.ucrPnlSaveData.Size = New System.Drawing.Size(402, 36) - Me.ucrPnlSaveData.TabIndex = 47 - ' - 'ucrReceiverGetOutputObject - ' - Me.ucrReceiverGetOutputObject.AutoSize = True - Me.ucrReceiverGetOutputObject.frmParent = Me - Me.ucrReceiverGetOutputObject.Location = New System.Drawing.Point(240, 117) - Me.ucrReceiverGetOutputObject.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverGetOutputObject.Name = "ucrReceiverGetOutputObject" - Me.ucrReceiverGetOutputObject.Selector = Nothing - Me.ucrReceiverGetOutputObject.Size = New System.Drawing.Size(138, 20) - Me.ucrReceiverGetOutputObject.strNcFilePath = "" - Me.ucrReceiverGetOutputObject.TabIndex = 27 - Me.ucrReceiverGetOutputObject.ucrSelector = Nothing - ' - 'ucrReceiverGetColumns - ' - Me.ucrReceiverGetColumns.AutoSize = True - Me.ucrReceiverGetColumns.frmParent = Me - Me.ucrReceiverGetColumns.Location = New System.Drawing.Point(243, 104) - Me.ucrReceiverGetColumns.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverGetColumns.Name = "ucrReceiverGetColumns" - Me.ucrReceiverGetColumns.Selector = Nothing - Me.ucrReceiverGetColumns.Size = New System.Drawing.Size(137, 105) - Me.ucrReceiverGetColumns.strNcFilePath = "" - Me.ucrReceiverGetColumns.TabIndex = 49 - Me.ucrReceiverGetColumns.ucrSelector = Nothing - ' - 'ucrDataFrameGetDF - ' - Me.ucrDataFrameGetDF.AutoSize = True - Me.ucrDataFrameGetDF.bDropUnusedFilterLevels = False - Me.ucrDataFrameGetDF.bUseCurrentFilter = True - Me.ucrDataFrameGetDF.Location = New System.Drawing.Point(81, 55) - Me.ucrDataFrameGetDF.Margin = New System.Windows.Forms.Padding(0) - Me.ucrDataFrameGetDF.Name = "ucrDataFrameGetDF" - Me.ucrDataFrameGetDF.Size = New System.Drawing.Size(224, 59) - Me.ucrDataFrameGetDF.TabIndex = 31 - ' - 'ucrCboGetOutputObjectType - ' - Me.ucrCboGetOutputObjectType.AddQuotesIfUnrecognised = True - Me.ucrCboGetOutputObjectType.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrCboGetOutputObjectType.GetSetSelectedIndex = -1 - Me.ucrCboGetOutputObjectType.IsReadOnly = False - Me.ucrCboGetOutputObjectType.Location = New System.Drawing.Point(241, 72) - Me.ucrCboGetOutputObjectType.Margin = New System.Windows.Forms.Padding(9) - Me.ucrCboGetOutputObjectType.Name = "ucrCboGetOutputObjectType" - Me.ucrCboGetOutputObjectType.Size = New System.Drawing.Size(137, 21) - Me.ucrCboGetOutputObjectType.TabIndex = 47 - ' - 'ucrPnlGetData - ' - Me.ucrPnlGetData.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlGetData.Location = New System.Drawing.Point(5, 10) - Me.ucrPnlGetData.Margin = New System.Windows.Forms.Padding(6) - Me.ucrPnlGetData.Name = "ucrPnlGetData" - Me.ucrPnlGetData.Size = New System.Drawing.Size(402, 36) - Me.ucrPnlGetData.TabIndex = 42 - ' - 'ucrSelectorGetObject - ' - Me.ucrSelectorGetObject.AutoSize = True - Me.ucrSelectorGetObject.bDropUnusedFilterLevels = False - Me.ucrSelectorGetObject.bShowHiddenColumns = False - Me.ucrSelectorGetObject.bUseCurrentFilter = True - Me.ucrSelectorGetObject.Location = New System.Drawing.Point(9, 52) - Me.ucrSelectorGetObject.Margin = New System.Windows.Forms.Padding(0) - Me.ucrSelectorGetObject.Name = "ucrSelectorGetObject" - Me.ucrSelectorGetObject.Size = New System.Drawing.Size(320, 274) - Me.ucrSelectorGetObject.TabIndex = 34 - ' - 'ucrInputRemoveObjects - ' - Me.ucrInputRemoveObjects.AddQuotesIfUnrecognised = True - Me.ucrInputRemoveObjects.AutoSize = True - Me.ucrInputRemoveObjects.IsMultiline = False - Me.ucrInputRemoveObjects.IsReadOnly = False - Me.ucrInputRemoveObjects.Location = New System.Drawing.Point(156, 56) - Me.ucrInputRemoveObjects.Margin = New System.Windows.Forms.Padding(9) - Me.ucrInputRemoveObjects.Name = "ucrInputRemoveObjects" - Me.ucrInputRemoveObjects.Size = New System.Drawing.Size(145, 21) - Me.ucrInputRemoveObjects.TabIndex = 2 - ' - 'ucrCboCommandPackage - ' - Me.ucrCboCommandPackage.AddQuotesIfUnrecognised = True - Me.ucrCboCommandPackage.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrCboCommandPackage.GetSetSelectedIndex = -1 - Me.ucrCboCommandPackage.IsReadOnly = False - Me.ucrCboCommandPackage.Location = New System.Drawing.Point(156, 19) - Me.ucrCboCommandPackage.Margin = New System.Windows.Forms.Padding(9) - Me.ucrCboCommandPackage.Name = "ucrCboCommandPackage" - Me.ucrCboCommandPackage.Size = New System.Drawing.Size(137, 21) - Me.ucrCboCommandPackage.TabIndex = 44 - ' - 'ucrPnlCommands - ' - Me.ucrPnlCommands.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlCommands.Location = New System.Drawing.Point(9, 8) - Me.ucrPnlCommands.Margin = New System.Windows.Forms.Padding(6) - Me.ucrPnlCommands.Name = "ucrPnlCommands" - Me.ucrPnlCommands.Size = New System.Drawing.Size(333, 143) - Me.ucrPnlCommands.TabIndex = 47 - ' - 'ucrPnlExample - ' - Me.ucrPnlExample.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlExample.Location = New System.Drawing.Point(7, 51) - Me.ucrPnlExample.Margin = New System.Windows.Forms.Padding(6) - Me.ucrPnlExample.Name = "ucrPnlExample" - Me.ucrPnlExample.Size = New System.Drawing.Size(402, 34) - Me.ucrPnlExample.TabIndex = 56 - ' - 'ucrCboExamplePackages - ' - Me.ucrCboExamplePackages.AddQuotesIfUnrecognised = True - Me.ucrCboExamplePackages.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrCboExamplePackages.GetSetSelectedIndex = -1 - Me.ucrCboExamplePackages.IsReadOnly = False - Me.ucrCboExamplePackages.Location = New System.Drawing.Point(14, 22) - Me.ucrCboExamplePackages.Margin = New System.Windows.Forms.Padding(9) - Me.ucrCboExamplePackages.Name = "ucrCboExamplePackages" - Me.ucrCboExamplePackages.Size = New System.Drawing.Size(137, 21) - Me.ucrCboExamplePackages.TabIndex = 51 - ' 'ucrBase ' Me.ucrBase.AutoSize = True @@ -630,15 +639,6 @@ Partial Class dlgScript Me.ucrBase.Size = New System.Drawing.Size(408, 52) Me.ucrBase.TabIndex = 16 ' - 'ucrChkSaveDataFrameList - ' - Me.ucrChkSaveDataFrameList.AutoSize = True - Me.ucrChkSaveDataFrameList.Checked = False - Me.ucrChkSaveDataFrameList.Location = New System.Drawing.Point(91, 101) - Me.ucrChkSaveDataFrameList.Name = "ucrChkSaveDataFrameList" - Me.ucrChkSaveDataFrameList.Size = New System.Drawing.Size(146, 23) - Me.ucrChkSaveDataFrameList.TabIndex = 59 - ' 'dlgScript ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) @@ -714,5 +714,5 @@ Partial Class dlgScript Friend WithEvents rdoCommandObject As RadioButton Friend WithEvents lblSaveDataFrame As Label Friend WithEvents ucrInputSaveDataFrame As ucrInputTextBox - Friend WithEvents ucrChkSaveDataFrameList As ucrCheck + Friend WithEvents ucrChkSaveDataFrameSingle As ucrCheck End Class diff --git a/instat/dlgScript.vb b/instat/dlgScript.vb index fecebeb42a9..7fd90ccb96d 100644 --- a/instat/dlgScript.vb +++ b/instat/dlgScript.vb @@ -66,7 +66,7 @@ Public Class dlgScript ucrSaveObject.SetDataFrameSelector(ucrDataFrameSaveOutputSelect) ucrInputSaveDataFrame.SetLinkedDisplayControl(lblSaveDataFrame) - ucrChkSaveDataFrameList.SetText("Single") + ucrChkSaveDataFrameSingle.SetText("Single") '-------------------------------- 'Get data controls @@ -148,7 +148,7 @@ Public Class dlgScript ucrSaveObject.SetRCode(clsSaveDataFunction, True) ucrSaveObject.Reset() rdoSaveDataFrame.Checked = True - ucrChkSaveDataFrameList.Checked = True + ucrChkSaveDataFrameSingle.Checked = True ucrDataFrameSaveOutputSelect.Reset() ' Get controls reset @@ -170,10 +170,10 @@ Public Class dlgScript ucrCboSaveOutputObjectFormat.SetVisible(False) ucrSaveObject.SetVisible(False) ucrInputSaveDataFrame.SetVisible(False) - ucrChkSaveDataFrameList.SetVisible(False) + ucrChkSaveDataFrameSingle.SetVisible(False) If rdoSaveDataFrame.Checked Then ucrInputSaveDataFrame.SetVisible(True) - ucrChkSaveDataFrameList.SetVisible(True) + ucrChkSaveDataFrameSingle.SetVisible(True) ucrInputSaveDataFrame.SetName("") ElseIf rdoSaveColumn.Checked Then ucrSaveObject.Location = New Point(ucrSaveObject.Location.X, ucrCboSaveOutputObjectType.Location.Y) @@ -202,7 +202,7 @@ Public Class dlgScript ucrSaveObject.SetName("") End Sub - Private Sub ucrSaveDataFrameControls_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputSaveDataFrame.ControlContentsChanged, ucrChkSaveDataFrameList.ControlContentsChanged + Private Sub ucrSaveDataFrameControls_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputSaveDataFrame.ControlContentsChanged, ucrChkSaveDataFrameSingle.ControlContentsChanged Dim strScript As String = "" If Not ucrInputSaveDataFrame.IsEmpty() Then @@ -211,19 +211,20 @@ Public Class dlgScript clsImportRFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$import_data") - If ucrChkSaveDataFrameList.Checked Then + If ucrChkSaveDataFrameSingle.Checked Then + ' If it's a single data frame then wrap it into a list Dim clsDataListRFunction As New RFunction clsDataListRFunction.SetRCommand("list") - clsDataListRFunction.AddParameter(strParameterValue:=strDataFrameName, bIncludeArgumentName:=False) + clsDataListRFunction.AddParameter(strParameterValue:=strDataFrameName) clsImportRFunction.AddParameter(strParameterName:="data_tables", clsRFunctionParameter:=clsDataListRFunction) Else + ' If it's already a list of data frames, then add the name directly clsImportRFunction.AddParameter(strParameterName:="data_tables", strParameterValue:=strDataFrameName) End If strScript = "# Save data frame(s) """ & strDataFrameName & """" & Environment.NewLine & clsImportRFunction.ToScript() End If - PreviewScript(strScript) End Sub From 01ab73269dbdcc4437da780406c12b8669be88bc Mon Sep 17 00:00:00 2001 From: patowhiz Date: Thu, 16 Nov 2023 20:12:31 +0300 Subject: [PATCH 27/27] made changes to named list --- instat/dlgScript.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/dlgScript.vb b/instat/dlgScript.vb index 7fd90ccb96d..92a0c4b4ca8 100644 --- a/instat/dlgScript.vb +++ b/instat/dlgScript.vb @@ -215,7 +215,7 @@ Public Class dlgScript ' If it's a single data frame then wrap it into a list Dim clsDataListRFunction As New RFunction clsDataListRFunction.SetRCommand("list") - clsDataListRFunction.AddParameter(strParameterValue:=strDataFrameName) + clsDataListRFunction.AddParameter(strParameterName:=strDataFrameName, strParameterValue:=strDataFrameName) clsImportRFunction.AddParameter(strParameterName:="data_tables", clsRFunctionParameter:=clsDataListRFunction) Else ' If it's already a list of data frames, then add the name directly