From e8b47216e4996fc731fbf378e6db8bc35f9fd252 Mon Sep 17 00:00:00 2001 From: Fidel365 <107605960+Fidel365@users.noreply.github.com> Date: Sun, 29 Sep 2024 01:44:08 +0300 Subject: [PATCH 01/22] design changes --- instat/dlgView.Designer.vb | 28 +++++++++++++--------------- instat/dlgView.vb | 24 ++++++++++++++++++++---- 2 files changed, 33 insertions(+), 19 deletions(-) diff --git a/instat/dlgView.Designer.vb b/instat/dlgView.Designer.vb index 08105f3c44f..741bc55fdc1 100644 --- a/instat/dlgView.Designer.vb +++ b/instat/dlgView.Designer.vb @@ -44,7 +44,6 @@ Partial Class dlgView Me.rdoBottom = New System.Windows.Forms.RadioButton() Me.rdoTop = New System.Windows.Forms.RadioButton() Me.lblDisplayFrom = New System.Windows.Forms.Label() - Me.lblNumberofRows = New System.Windows.Forms.Label() Me.rdoHTMLOutputWindow = New System.Windows.Forms.RadioButton() Me.rdoViewAll = New System.Windows.Forms.RadioButton() Me.rdoViewSelectedColumnsRows = New System.Windows.Forms.RadioButton() @@ -59,6 +58,7 @@ Partial Class dlgView Me.ucrReceiverView = New instat.ucrReceiverMultiple() Me.ucrSelectorForView = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrBase = New instat.ucrButtons() + Me.ucrChkRowNumbers = New instat.ucrCheck() Me.SuspendLayout() ' 'lblSelected @@ -129,17 +129,6 @@ Partial Class dlgView Me.lblDisplayFrom.Tag = "" Me.lblDisplayFrom.Text = "Display From:" ' - 'lblNumberofRows - ' - Me.lblNumberofRows.AutoSize = True - Me.lblNumberofRows.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblNumberofRows.Location = New System.Drawing.Point(248, 258) - Me.lblNumberofRows.Name = "lblNumberofRows" - Me.lblNumberofRows.Size = New System.Drawing.Size(89, 13) - Me.lblNumberofRows.TabIndex = 10 - Me.lblNumberofRows.Tag = "Number_of_rows" - Me.lblNumberofRows.Text = "Number of Rows:" - ' 'rdoHTMLOutputWindow ' Me.rdoHTMLOutputWindow.ImeMode = System.Windows.Forms.ImeMode.NoControl @@ -227,7 +216,7 @@ Partial Class dlgView Me.ucrNudNumberRows.AutoSize = True Me.ucrNudNumberRows.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudNumberRows.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudNumberRows.Location = New System.Drawing.Point(343, 256) + Me.ucrNudNumberRows.Location = New System.Drawing.Point(343, 208) Me.ucrNudNumberRows.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudNumberRows.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudNumberRows.Name = "ucrNudNumberRows" @@ -294,12 +283,22 @@ Partial Class dlgView Me.ucrBase.Size = New System.Drawing.Size(408, 52) Me.ucrBase.TabIndex = 17 ' + 'ucrChkRowNumbers + ' + Me.ucrChkRowNumbers.AutoSize = True + Me.ucrChkRowNumbers.Checked = False + Me.ucrChkRowNumbers.Location = New System.Drawing.Point(248, 206) + Me.ucrChkRowNumbers.Name = "ucrChkRowNumbers" + Me.ucrChkRowNumbers.Size = New System.Drawing.Size(89, 23) + Me.ucrChkRowNumbers.TabIndex = 19 + ' 'dlgView ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True Me.ClientSize = New System.Drawing.Size(416, 393) + Me.Controls.Add(Me.ucrChkRowNumbers) Me.Controls.Add(Me.ucrSaveData) Me.Controls.Add(Me.rdoViewAll) Me.Controls.Add(Me.rdoViewSelectedColumnsRows) @@ -313,7 +312,6 @@ Partial Class dlgView Me.Controls.Add(Me.ucrPnlDisplayFrom) Me.Controls.Add(Me.ucrChkSpecifyRows) Me.Controls.Add(Me.lblDisplayFrom) - Me.Controls.Add(Me.lblNumberofRows) Me.Controls.Add(Me.rdoDispOutputWindow) Me.Controls.Add(Me.rdoDispSepOutputWindow) Me.Controls.Add(Me.ucrPnlDisplayWindow) @@ -345,7 +343,6 @@ Partial Class dlgView Friend WithEvents ucrPnlDisplayFrom As UcrPanel Friend WithEvents ucrChkSpecifyRows As ucrCheck Friend WithEvents lblDisplayFrom As Label - Friend WithEvents lblNumberofRows As Label Friend WithEvents ucrChkSortColumn As ucrCheck Friend WithEvents rdoHTMLOutputWindow As RadioButton Friend WithEvents ucrReceiverSortCol As ucrReceiverSingle @@ -353,4 +350,5 @@ Partial Class dlgView Friend WithEvents rdoViewSelectedColumnsRows As RadioButton Friend WithEvents ucrPnlViewData As UcrPanel Friend WithEvents ucrSaveData As ucrSave + Friend WithEvents ucrChkRowNumbers As ucrCheck End Class \ No newline at end of file diff --git a/instat/dlgView.vb b/instat/dlgView.vb index c326c69f397..f97ea881ed5 100644 --- a/instat/dlgView.vb +++ b/instat/dlgView.vb @@ -54,6 +54,8 @@ Public Class dlgView ucrPnlDisplayWindow.AddParameterValuesCondition(rdoDispSepOutputWindow, "checked", "viewer") ucrPnlDisplayWindow.AddToLinkedControls(ucrChkSpecifyRows, {rdoDispOutputWindow}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True) + ucrPnlDisplayWindow.AddToLinkedControls(ucrChkRowNumbers, {rdoDispOutputWindow}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True) + ucrPnlDisplayFrom.AddRadioButton(rdoBottom) ucrPnlDisplayFrom.AddRadioButton(rdoTop) @@ -64,8 +66,11 @@ Public Class dlgView ' This linking only applies if rdoDispOutputWindow is checked ucrChkSpecifyRows.SetText("Specify Rows") ucrChkSpecifyRows.AddToLinkedControls(ucrPnlDisplayFrom, {True}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=rdoTop) - ucrChkSpecifyRows.AddToLinkedControls(ucrNudNumberRows, {True}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=6) - ucrChkSpecifyRows.AddFunctionNamesCondition(True, {"head", "tail"}) + ' ucrChkSpecifyRows.AddToLinkedControls(ucrNudNumberRows, {True}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=6) + ucrChkRowNumbers.AddToLinkedControls(ucrNudNumberRows, {True}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=6) + + + ucrChkRowNumbers.AddFunctionNamesCondition(True, {"head", "tail"}) ucrChkSpecifyRows.AddFunctionNamesCondition(False, {frmMain.clsRLink.strInstatDataObject & "$get_columns_from_data"}) ' ucrChkSpecifyRows.bAllowNonConditionValues = True @@ -97,9 +102,9 @@ Public Class dlgView ucrSelectorForView.SetParameter(New RParameter("title", 1)) ucrSelectorForView.SetParameterIsString() - ucrNudNumberRows.SetParameter(New RParameter("n", 1)) + ucrNudNumberRows.Minimum = 1 - ucrNudNumberRows.SetLinkedDisplayControl(lblNumberofRows) + ' ucrNudNumberRows.SetLinkedDisplayControl(ucrChkNumbersRows) ucrSaveData.SetCheckBoxText("Store Data") ucrSaveData.SetPrefix("last_table") @@ -300,6 +305,17 @@ Public Class dlgView SetSelectorParameterType() End Sub + Private Sub ucrChkRowNumbers_Load(sender As Object, e As EventArgs) Handles ucrChkRowNumbers.Load + If ucrChkRowNumbers.Checked Then + ucrNudNumberRows.SetParameter(New RParameter("n", 1)) + ucrNudNumberRows.Visible = True + Else + 'ucrNudNumberRows.Remove("n") + 'ucrNudNumberRows.UnSetParameter(New RParameter("n", 1)) + ucrNudNumberRows.Visible = False + End If + End Sub + Private Sub VariablesVisible() If rdoViewAll.Checked Then ucrSelectorForView.SetVariablesVisible(False) From 88bf3e3b13fb0d8867d4878f99dbfd67a9996f12 Mon Sep 17 00:00:00 2001 From: Fidel365 <107605960+Fidel365@users.noreply.github.com> Date: Tue, 1 Oct 2024 15:22:11 +0300 Subject: [PATCH 02/22] code --- instat/dlgView.Designer.vb | 130 +++++++-------------------------- instat/dlgView.vb | 145 +++++++++++++++++++------------------ 2 files changed, 100 insertions(+), 175 deletions(-) diff --git a/instat/dlgView.Designer.vb b/instat/dlgView.Designer.vb index 741bc55fdc1..0c81ff8889a 100644 --- a/instat/dlgView.Designer.vb +++ b/instat/dlgView.Designer.vb @@ -41,24 +41,19 @@ Partial Class dlgView Me.lblSelected = New System.Windows.Forms.Label() Me.rdoDispSepOutputWindow = New System.Windows.Forms.RadioButton() Me.rdoDispOutputWindow = New System.Windows.Forms.RadioButton() - Me.rdoBottom = New System.Windows.Forms.RadioButton() - Me.rdoTop = New System.Windows.Forms.RadioButton() - Me.lblDisplayFrom = New System.Windows.Forms.Label() Me.rdoHTMLOutputWindow = New System.Windows.Forms.RadioButton() - Me.rdoViewAll = New System.Windows.Forms.RadioButton() - Me.rdoViewSelectedColumnsRows = New System.Windows.Forms.RadioButton() Me.ucrSaveData = New instat.ucrSave() - Me.ucrPnlViewData = New instat.UcrPanel() Me.ucrReceiverSortCol = New instat.ucrReceiverSingle() Me.ucrChkSortColumn = New instat.ucrCheck() Me.ucrNudNumberRows = New instat.ucrNud() - Me.ucrPnlDisplayFrom = New instat.UcrPanel() Me.ucrChkSpecifyRows = New instat.ucrCheck() Me.ucrPnlDisplayWindow = New instat.UcrPanel() Me.ucrReceiverView = New instat.ucrReceiverMultiple() Me.ucrSelectorForView = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrBase = New instat.ucrButtons() Me.ucrChkRowNumbers = New instat.ucrCheck() + Me.ucrChkDisplayFromTop = New instat.ucrCheck() + Me.cmdTableOptions = New System.Windows.Forms.Button() Me.SuspendLayout() ' 'lblSelected @@ -94,41 +89,6 @@ Partial Class dlgView Me.rdoDispOutputWindow.Text = "Display in Output Window" Me.rdoDispOutputWindow.UseVisualStyleBackColor = True ' - 'rdoBottom - ' - Me.rdoBottom.AutoSize = True - Me.rdoBottom.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoBottom.Location = New System.Drawing.Point(325, 301) - Me.rdoBottom.Name = "rdoBottom" - Me.rdoBottom.Size = New System.Drawing.Size(58, 17) - Me.rdoBottom.TabIndex = 16 - Me.rdoBottom.TabStop = True - Me.rdoBottom.Text = "Bottom" - Me.rdoBottom.UseVisualStyleBackColor = True - ' - 'rdoTop - ' - Me.rdoTop.AutoSize = True - Me.rdoTop.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoTop.Location = New System.Drawing.Point(325, 278) - Me.rdoTop.Name = "rdoTop" - Me.rdoTop.Size = New System.Drawing.Size(44, 17) - Me.rdoTop.TabIndex = 15 - Me.rdoTop.TabStop = True - Me.rdoTop.Text = "Top" - Me.rdoTop.UseVisualStyleBackColor = True - ' - 'lblDisplayFrom - ' - Me.lblDisplayFrom.AutoSize = True - Me.lblDisplayFrom.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblDisplayFrom.Location = New System.Drawing.Point(248, 279) - Me.lblDisplayFrom.Name = "lblDisplayFrom" - Me.lblDisplayFrom.Size = New System.Drawing.Size(70, 13) - Me.lblDisplayFrom.TabIndex = 14 - Me.lblDisplayFrom.Tag = "" - Me.lblDisplayFrom.Text = "Display From:" - ' 'rdoHTMLOutputWindow ' Me.rdoHTMLOutputWindow.ImeMode = System.Windows.Forms.ImeMode.NoControl @@ -140,38 +100,6 @@ Partial Class dlgView Me.rdoHTMLOutputWindow.Text = "Display HTML in Output Window" Me.rdoHTMLOutputWindow.UseVisualStyleBackColor = True ' - 'rdoViewAll - ' - Me.rdoViewAll.Appearance = System.Windows.Forms.Appearance.Button - Me.rdoViewAll.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoViewAll.FlatAppearance.BorderSize = 2 - Me.rdoViewAll.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoViewAll.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.rdoViewAll.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoViewAll.Location = New System.Drawing.Point(67, 6) - Me.rdoViewAll.Name = "rdoViewAll" - Me.rdoViewAll.Size = New System.Drawing.Size(140, 34) - Me.rdoViewAll.TabIndex = 1 - Me.rdoViewAll.Text = "All Columns" - Me.rdoViewAll.TextAlign = System.Drawing.ContentAlignment.MiddleCenter - Me.rdoViewAll.UseVisualStyleBackColor = True - ' - 'rdoViewSelectedColumnsRows - ' - Me.rdoViewSelectedColumnsRows.Appearance = System.Windows.Forms.Appearance.Button - Me.rdoViewSelectedColumnsRows.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoViewSelectedColumnsRows.FlatAppearance.BorderSize = 2 - Me.rdoViewSelectedColumnsRows.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoViewSelectedColumnsRows.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.rdoViewSelectedColumnsRows.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoViewSelectedColumnsRows.Location = New System.Drawing.Point(207, 6) - Me.rdoViewSelectedColumnsRows.Name = "rdoViewSelectedColumnsRows" - Me.rdoViewSelectedColumnsRows.Size = New System.Drawing.Size(143, 34) - Me.rdoViewSelectedColumnsRows.TabIndex = 2 - Me.rdoViewSelectedColumnsRows.Text = "Choose Columns" - Me.rdoViewSelectedColumnsRows.TextAlign = System.Drawing.ContentAlignment.MiddleCenter - Me.rdoViewSelectedColumnsRows.UseVisualStyleBackColor = True - ' 'ucrSaveData ' Me.ucrSaveData.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink @@ -181,14 +109,6 @@ Partial Class dlgView Me.ucrSaveData.Size = New System.Drawing.Size(308, 27) Me.ucrSaveData.TabIndex = 18 ' - 'ucrPnlViewData - ' - Me.ucrPnlViewData.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlViewData.Location = New System.Drawing.Point(56, 5) - Me.ucrPnlViewData.Name = "ucrPnlViewData" - Me.ucrPnlViewData.Size = New System.Drawing.Size(298, 35) - Me.ucrPnlViewData.TabIndex = 0 - ' 'ucrReceiverSortCol ' Me.ucrReceiverSortCol.AutoSize = True @@ -216,7 +136,7 @@ Partial Class dlgView Me.ucrNudNumberRows.AutoSize = True Me.ucrNudNumberRows.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudNumberRows.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudNumberRows.Location = New System.Drawing.Point(343, 208) + Me.ucrNudNumberRows.Location = New System.Drawing.Point(343, 206) Me.ucrNudNumberRows.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudNumberRows.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudNumberRows.Name = "ucrNudNumberRows" @@ -224,14 +144,6 @@ Partial Class dlgView Me.ucrNudNumberRows.TabIndex = 13 Me.ucrNudNumberRows.Value = New Decimal(New Integer() {0, 0, 0, 0}) ' - 'ucrPnlDisplayFrom - ' - Me.ucrPnlDisplayFrom.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlDisplayFrom.Location = New System.Drawing.Point(325, 278) - Me.ucrPnlDisplayFrom.Name = "ucrPnlDisplayFrom" - Me.ucrPnlDisplayFrom.Size = New System.Drawing.Size(66, 40) - Me.ucrPnlDisplayFrom.TabIndex = 14 - ' 'ucrChkSpecifyRows ' Me.ucrChkSpecifyRows.AutoSize = True @@ -292,26 +204,39 @@ Partial Class dlgView Me.ucrChkRowNumbers.Size = New System.Drawing.Size(89, 23) Me.ucrChkRowNumbers.TabIndex = 19 ' + 'ucrChkDisplayFromTop + ' + Me.ucrChkDisplayFromTop.AutoSize = True + Me.ucrChkDisplayFromTop.Checked = False + Me.ucrChkDisplayFromTop.Location = New System.Drawing.Point(248, 261) + Me.ucrChkDisplayFromTop.Name = "ucrChkDisplayFromTop" + Me.ucrChkDisplayFromTop.Size = New System.Drawing.Size(130, 23) + Me.ucrChkDisplayFromTop.TabIndex = 20 + ' + 'cmdTableOptions + ' + Me.cmdTableOptions.Location = New System.Drawing.Point(248, 238) + Me.cmdTableOptions.Name = "cmdTableOptions" + Me.cmdTableOptions.Size = New System.Drawing.Size(141, 23) + Me.cmdTableOptions.TabIndex = 26 + Me.cmdTableOptions.Text = "Table Options" + Me.cmdTableOptions.UseVisualStyleBackColor = True + ' 'dlgView ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True Me.ClientSize = New System.Drawing.Size(416, 393) + Me.Controls.Add(Me.cmdTableOptions) + Me.Controls.Add(Me.ucrChkDisplayFromTop) Me.Controls.Add(Me.ucrChkRowNumbers) Me.Controls.Add(Me.ucrSaveData) - Me.Controls.Add(Me.rdoViewAll) - Me.Controls.Add(Me.rdoViewSelectedColumnsRows) - Me.Controls.Add(Me.ucrPnlViewData) Me.Controls.Add(Me.ucrReceiverSortCol) Me.Controls.Add(Me.ucrChkSortColumn) Me.Controls.Add(Me.rdoHTMLOutputWindow) Me.Controls.Add(Me.ucrNudNumberRows) - Me.Controls.Add(Me.rdoBottom) - Me.Controls.Add(Me.rdoTop) - Me.Controls.Add(Me.ucrPnlDisplayFrom) Me.Controls.Add(Me.ucrChkSpecifyRows) - Me.Controls.Add(Me.lblDisplayFrom) Me.Controls.Add(Me.rdoDispOutputWindow) Me.Controls.Add(Me.rdoDispSepOutputWindow) Me.Controls.Add(Me.ucrPnlDisplayWindow) @@ -338,17 +263,12 @@ Partial Class dlgView Friend WithEvents rdoDispOutputWindow As RadioButton Friend WithEvents ucrPnlDisplayWindow As UcrPanel Friend WithEvents ucrNudNumberRows As ucrNud - Friend WithEvents rdoBottom As RadioButton - Friend WithEvents rdoTop As RadioButton - Friend WithEvents ucrPnlDisplayFrom As UcrPanel Friend WithEvents ucrChkSpecifyRows As ucrCheck - Friend WithEvents lblDisplayFrom As Label Friend WithEvents ucrChkSortColumn As ucrCheck Friend WithEvents rdoHTMLOutputWindow As RadioButton Friend WithEvents ucrReceiverSortCol As ucrReceiverSingle - Friend WithEvents rdoViewAll As RadioButton - Friend WithEvents rdoViewSelectedColumnsRows As RadioButton - Friend WithEvents ucrPnlViewData As UcrPanel Friend WithEvents ucrSaveData As ucrSave Friend WithEvents ucrChkRowNumbers As ucrCheck + Friend WithEvents ucrChkDisplayFromTop As ucrCheck + Friend WithEvents cmdTableOptions As Button End Class \ No newline at end of file diff --git a/instat/dlgView.vb b/instat/dlgView.vb index f97ea881ed5..135c5669ba0 100644 --- a/instat/dlgView.vb +++ b/instat/dlgView.vb @@ -53,36 +53,35 @@ Public Class dlgView ucrPnlDisplayWindow.AddParameterValuesCondition(rdoDispOutputWindow, "checked", "window") ucrPnlDisplayWindow.AddParameterValuesCondition(rdoDispSepOutputWindow, "checked", "viewer") - ucrPnlDisplayWindow.AddToLinkedControls(ucrChkSpecifyRows, {rdoDispOutputWindow}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True) - ucrPnlDisplayWindow.AddToLinkedControls(ucrChkRowNumbers, {rdoDispOutputWindow}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True) - - - ucrPnlDisplayFrom.AddRadioButton(rdoBottom) - ucrPnlDisplayFrom.AddRadioButton(rdoTop) - ucrPnlDisplayFrom.SetLinkedDisplayControl(lblDisplayFrom) - ucrPnlDisplayFrom.AddFunctionNamesCondition(rdoTop, "head") - ucrPnlDisplayFrom.AddFunctionNamesCondition(rdoBottom, "tail") + ucrPnlDisplayWindow.AddToLinkedControls(ucrChkDisplayFromTop, {rdoDispOutputWindow}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True) + ucrPnlDisplayWindow.AddToLinkedControls(ucrChkRowNumbers, {rdoDispOutputWindow, rdoHTMLOutputWindow}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True) + 'ucrPnlDisplayFrom.AddRadioButton(rdoBottom) + 'ucrPnlDisplayFrom.AddRadioButton(rdoTop) + 'ucrPnlDisplayFrom.SetLinkedDisplayControl(lblDisplayFrom) + 'ucrChkDisplayFromTop.AddFunctionNamesCondition("head") + 'ucrChkDisplayFromTop.AddFunctionNamesCondition(rdoBottom, "tail") ' This linking only applies if rdoDispOutputWindow is checked - ucrChkSpecifyRows.SetText("Specify Rows") - ucrChkSpecifyRows.AddToLinkedControls(ucrPnlDisplayFrom, {True}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=rdoTop) + + ' ucrChkSpecifyRows.AddToLinkedControls(ucrChkDisplayFromTop, {True}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True) ' ucrChkSpecifyRows.AddToLinkedControls(ucrNudNumberRows, {True}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=6) + ucrChkRowNumbers.SetText("Rows") ucrChkRowNumbers.AddToLinkedControls(ucrNudNumberRows, {True}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=6) - - ucrChkRowNumbers.AddFunctionNamesCondition(True, {"head", "tail"}) - ucrChkSpecifyRows.AddFunctionNamesCondition(False, {frmMain.clsRLink.strInstatDataObject & "$get_columns_from_data"}) + ucrChkDisplayFromTop.SetText("Display From Top") + ucrChkDisplayFromTop.AddFunctionNamesCondition(True, {"head", "tail"}) + ucrChkDisplayFromTop.AddFunctionNamesCondition(False, {frmMain.clsRLink.strInstatDataObject & "$get_columns_from_data"}) ' ucrChkSpecifyRows.bAllowNonConditionValues = True - ucrPnlViewData.AddRadioButton(rdoViewAll) - ucrPnlViewData.AddRadioButton(rdoViewSelectedColumnsRows) + ' ucrPnlViewData.AddRadioButton(rdoViewAll) + ' ucrPnlViewData.AddRadioButton(rdoViewSelectedColumnsRows) - ucrPnlViewData.AddParameterValueFunctionNamesCondition(rdoViewAll, "x", frmMain.clsRLink.strInstatDataObject & "$get_data_frame") - ucrPnlViewData.AddParameterValueFunctionNamesCondition(rdoViewSelectedColumnsRows, "x", frmMain.clsRLink.strInstatDataObject & "$get_data_frame", bNewIsPositive:=False) + ' ucrPnlViewData.AddParameterValueFunctionNamesCondition(rdoViewAll, "x", frmMain.clsRLink.strInstatDataObject & "$get_data_frame") + ' ucrPnlViewData.AddParameterValueFunctionNamesCondition(rdoViewSelectedColumnsRows, "x", frmMain.clsRLink.strInstatDataObject & "$get_data_frame", bNewIsPositive:=False) - ucrPnlViewData.AddToLinkedControls(ucrReceiverView, {rdoViewSelectedColumnsRows}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True) + ' ucrPnlViewData.AddToLinkedControls(ucrReceiverView, {rdoViewSelectedColumnsRows}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True) ucrReceiverView.SetLinkedDisplayControl(lblSelected) - ucrPnlViewData.AddToLinkedControls(ucrPnlDisplayWindow, {rdoViewSelectedColumnsRows}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True) + ' ucrPnlViewData.AddToLinkedControls(ucrPnlDisplayWindow, {rdoViewSelectedColumnsRows}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True) ucrChkSortColumn.Visible = False 'ucrPnlDisplayWindow.AddToLinkedControls(ucrChkSortColumn, {rdoHTMLOutputWindow}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True) @@ -113,7 +112,6 @@ Public Class dlgView ucrSaveData.SetIsComboBox() ucrSaveData.SetAssignToIfUncheckedValue("last_table") - End Sub Private Sub SetDefaults() @@ -184,11 +182,11 @@ Public Class dlgView ucrReceiverView.SetRCode(clsViewColumnsFunction, bReset) ucrPnlDisplayWindow.SetRCode(clsDummyFunction, bReset) - ucrPnlDisplayFrom.SetRCode(clsOutputWindowFunction, bReset) + ucrChkDisplayFromTop.SetRCode(clsOutputWindowFunction, bReset) ucrNudNumberRows.SetRCode(clsOutputWindowFunction, bReset) - ucrChkSpecifyRows.SetRCode(clsOutputWindowFunction, bReset) + ' ucrChkSpecifyRows.SetRCode(clsOutputWindowFunction, bReset) ucrSelectorForView.SetRCode(clsViewAllFunction, bReset) - ucrPnlViewData.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + ' ucrPnlViewData.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrSaveData.SetRCode(clsAsHtmlWidgetFunction, bReset) DataFrameLength() @@ -201,16 +199,16 @@ Public Class dlgView End Sub Private Sub TestOKEnabled() - If rdoViewSelectedColumnsRows.Checked Then - If Not ucrReceiverView.IsEmpty Then + ' If rdoViewSelectedColumnsRows.Checked Then + If Not ucrReceiverView.IsEmpty Then If rdoDispSepOutputWindow.Checked Then ucrBase.OKEnabled(True) ElseIf rdoDispOutputWindow.Checked Then - If ucrChkSpecifyRows.Checked Then - If ucrNudNumberRows.GetText <> "" AndAlso (rdoTop.Checked OrElse rdoBottom.Checked) Then - ucrBase.OKEnabled(True) - Else - ucrBase.OKEnabled(False) + ' If ucrChkSpecifyRows.Checked Then + If ucrNudNumberRows.GetText <> "" OrElse ucrChkDisplayFromTop.Checked Then + ucrBase.OKEnabled(True) + Else + ucrBase.OKEnabled(False) End If Else ucrBase.OKEnabled(True) @@ -220,16 +218,16 @@ Public Class dlgView Else ucrBase.OKEnabled(False) End If - Else - ucrBase.OKEnabled(False) - End If - Else - If ucrSelectorForView.ucrAvailableDataFrames.cboAvailableDataFrames.Text <> "" Then - ucrBase.OKEnabled(True) - Else - ucrBase.OKEnabled(False) - End If - End If + 'Else + ' ucrBase.OKEnabled(False) + 'End If + 'Else + ' If ucrSelectorForView.ucrAvailableDataFrames.cboAvailableDataFrames.Text <> "" Then + ' ucrBase.OKEnabled(True) + ' Else + ' ucrBase.OKEnabled(False) + ' End If + 'End If End Sub Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset @@ -239,24 +237,24 @@ Public Class dlgView End Sub Private Sub ChangeFunctionParameters() - If rdoViewSelectedColumnsRows.Checked Then - If rdoDispOutputWindow.Checked Then + 'If rdoViewSelectedColumnsRows.Checked Then + If rdoDispOutputWindow.Checked Then clsDummyFunction.AddParameter("checked", "window", iPosition:=0) ucrSaveData.Visible = True ucrBase.clsRsyntax.iCallType = 2 - If ucrChkSpecifyRows.Checked Then - ucrBase.clsRsyntax.SetBaseRFunction(clsOutputWindowFunction) - ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Text) - ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) + If ucrChkRowNumbers.Checked Then + ucrBase.clsRsyntax.SetBaseRFunction(clsOutputWindowFunction) + ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Text) + ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) - If rdoTop.Checked Then - clsOutputWindowFunction.SetRCommand("head") - Else - clsOutputWindowFunction.SetRCommand("tail") - End If + If ucrChkDisplayFromTop.Checked Then + clsOutputWindowFunction.SetRCommand("head") Else - ucrBase.clsRsyntax.SetBaseRFunction(ucrReceiverView.GetVariables(True)) + clsOutputWindowFunction.SetRCommand("tail") + End If + Else + ucrBase.clsRsyntax.SetBaseRFunction(ucrReceiverView.GetVariables(True)) End If ElseIf rdoDispSepOutputWindow.Checked Then clsDummyFunction.AddParameter("checked", "viewer", iPosition:=0) @@ -273,18 +271,18 @@ Public Class dlgView ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) End If - Else - ucrBase.clsRsyntax.SetBaseRFunction(clsViewAllFunction) - ucrBase.clsRsyntax.RemoveFromAfterCodes(clsGetObjectDataFunction) - ucrSaveData.Visible = False - End If + 'Else + ' ucrBase.clsRsyntax.SetBaseRFunction(clsViewAllFunction) + ' ucrBase.clsRsyntax.RemoveFromAfterCodes(clsGetObjectDataFunction) + ' ucrSaveData.Visible = False + 'End If End Sub Private Sub DataFrameLength() ucrNudNumberRows.Maximum = ucrSelectorForView.ucrAvailableDataFrames.iDataFrameLength End Sub - Private Sub FunctionControls_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlDisplayFrom.ControlValueChanged, ucrPnlDisplayWindow.ControlValueChanged, ucrChkSpecifyRows.ControlValueChanged, ucrReceiverView.ControlValueChanged + Private Sub FunctionControls_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkDisplayFromTop.ControlValueChanged, ucrPnlDisplayWindow.ControlValueChanged, ucrChkSpecifyRows.ControlValueChanged, ucrReceiverView.ControlValueChanged If bControlsUpdated Then ChangeFunctionParameters() End If @@ -305,6 +303,11 @@ Public Class dlgView SetSelectorParameterType() End Sub + Private Sub cmdTableOptions_Click(sender As Object, e As EventArgs) Handles cmdTableOptions.Click + 'sdgTableOptions.Setup(ucrSelectorForView.strCurrentDataFrame, ) + sdgTableOptions.ShowDialog(Me) + End Sub + Private Sub ucrChkRowNumbers_Load(sender As Object, e As EventArgs) Handles ucrChkRowNumbers.Load If ucrChkRowNumbers.Checked Then ucrNudNumberRows.SetParameter(New RParameter("n", 1)) @@ -316,24 +319,18 @@ Public Class dlgView End If End Sub - Private Sub VariablesVisible() - If rdoViewAll.Checked Then - ucrSelectorForView.SetVariablesVisible(False) - Else - ucrSelectorForView.SetVariablesVisible(True) - End If - End Sub - - Private Sub ucrPnlViewData_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlViewData.ControlValueChanged + Private Sub ucrPnlViewData_ControlValueChanged(ucrChangedControl As ucrCore) + TableOptions() ChangeFunctionParameters() - VariablesVisible() End Sub - Private Sub CoreControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverView.ControlContentsChanged, ucrPnlDisplayWindow.ControlContentsChanged, ucrChkSpecifyRows.ControlContentsChanged, ucrNudNumberRows.ControlContentsChanged, ucrPnlDisplayFrom.ControlContentsChanged, ucrChkSortColumn.ControlContentsChanged, ucrReceiverSortCol.ControlContentsChanged, ucrPnlViewData.ControlContentsChanged + Private Sub CoreControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverView.ControlContentsChanged, ucrPnlDisplayWindow.ControlContentsChanged, ucrChkSpecifyRows.ControlContentsChanged, ucrNudNumberRows.ControlContentsChanged, ucrChkDisplayFromTop.ControlContentsChanged, ucrChkSortColumn.ControlContentsChanged, ucrReceiverSortCol.ControlContentsChanged + TableOptions() TestOKEnabled() End Sub Private Sub ucrSaveData_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSaveData.ControlValueChanged + TableOptions() GetObjectName() End Sub @@ -347,6 +344,14 @@ Public Class dlgView End If End Sub + Private Sub TableOptions() + If rdoHTMLOutputWindow.Checked Then + cmdTableOptions.Visible = True + Else + cmdTableOptions.Visible = False + End If + End Sub + Private Sub ucrSelectorForView_DataFrameChanged() Handles ucrSelectorForView.DataFrameChanged clsGetObjectDataFunction.AddParameter("data_name", Chr(34) & ucrSelectorForView.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) End Sub From 71aa7478dc2d75c9ab896e0e5f66a603258f8973 Mon Sep 17 00:00:00 2001 From: Fidel365 <107605960+Fidel365@users.noreply.github.com> Date: Tue, 1 Oct 2024 21:47:59 +0300 Subject: [PATCH 03/22] code2 --- instat/dlgView.vb | 64 +++++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/instat/dlgView.vb b/instat/dlgView.vb index 135c5669ba0..1d46305ffb1 100644 --- a/instat/dlgView.vb +++ b/instat/dlgView.vb @@ -201,23 +201,23 @@ Public Class dlgView Private Sub TestOKEnabled() ' If rdoViewSelectedColumnsRows.Checked Then If Not ucrReceiverView.IsEmpty Then - If rdoDispSepOutputWindow.Checked Then - ucrBase.OKEnabled(True) - ElseIf rdoDispOutputWindow.Checked Then + If rdoDispSepOutputWindow.Checked Then + ucrBase.OKEnabled(True) + ElseIf rdoDispOutputWindow.Checked Then ' If ucrChkSpecifyRows.Checked Then If ucrNudNumberRows.GetText <> "" OrElse ucrChkDisplayFromTop.Checked Then - ucrBase.OKEnabled(True) - Else - ucrBase.OKEnabled(False) - End If - Else - ucrBase.OKEnabled(True) - End If - ElseIf rdoHTMLOutputWindow.Checked AndAlso ((ucrChkSortColumn.Checked AndAlso Not ucrReceiverSortCol.IsEmpty) OrElse Not ucrChkSortColumn.Checked) Then ucrBase.OKEnabled(True) Else ucrBase.OKEnabled(False) End If + Else + ucrBase.OKEnabled(True) + End If + ElseIf rdoHTMLOutputWindow.Checked AndAlso ((ucrChkSortColumn.Checked AndAlso Not ucrReceiverSortCol.IsEmpty) OrElse Not ucrChkSortColumn.Checked) Then + ucrBase.OKEnabled(True) + Else + ucrBase.OKEnabled(False) + End If 'Else ' ucrBase.OKEnabled(False) 'End If @@ -239,11 +239,13 @@ Public Class dlgView Private Sub ChangeFunctionParameters() 'If rdoViewSelectedColumnsRows.Checked Then If rdoDispOutputWindow.Checked Then - clsDummyFunction.AddParameter("checked", "window", iPosition:=0) + clsDummyFunction.AddParameter("checked", "window", iPosition:=0) + + ucrSaveData.Visible = True + ucrBase.clsRsyntax.iCallType = 2 - ucrSaveData.Visible = True - ucrBase.clsRsyntax.iCallType = 2 - If ucrChkRowNumbers.Checked Then + ' If ucrNudNumberRows.GetText <> "" Then + If ucrChkRowNumbers.Checked AndAlso ucrNudNumberRows.GetText <> "" OrElse ucrChkDisplayFromTop.Checked Then ucrBase.clsRsyntax.SetBaseRFunction(clsOutputWindowFunction) ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Text) ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) @@ -254,23 +256,25 @@ Public Class dlgView clsOutputWindowFunction.SetRCommand("tail") End If Else - ucrBase.clsRsyntax.SetBaseRFunction(ucrReceiverView.GetVariables(True)) - End If - ElseIf rdoDispSepOutputWindow.Checked Then - clsDummyFunction.AddParameter("checked", "viewer", iPosition:=0) - - ucrBase.clsRsyntax.iCallType = 0 - ucrBase.clsRsyntax.SetBaseRFunction(clsViewColumnsFunction) ucrBase.clsRsyntax.RemoveFromAfterCodes(clsGetObjectDataFunction) - ucrSaveData.Visible = False - Else - clsDummyFunction.AddParameter("checked", "html", iPosition:=0) - ucrBase.clsRsyntax.SetBaseRFunction(clsAsHtmlWidgetFunction) - ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) - ucrSaveData.Visible = True - ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) - + ucrBase.clsRsyntax.SetBaseRFunction(ucrReceiverView.GetVariables(True)) End If + ElseIf rdoDispSepOutputWindow.Checked Then + clsDummyFunction.AddParameter("checked", "viewer", iPosition:=0) + + ucrBase.clsRsyntax.iCallType = 0 + ucrBase.clsRsyntax.SetBaseRFunction(clsViewColumnsFunction) + ' ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) + ucrBase.clsRsyntax.RemoveFromAfterCodes(clsGetObjectDataFunction) + ucrSaveData.Visible = False + Else + clsDummyFunction.AddParameter("checked", "html", iPosition:=0) + ucrBase.clsRsyntax.SetBaseRFunction(clsAsHtmlWidgetFunction) + ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) + ucrSaveData.Visible = True + ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) + + End If 'Else ' ucrBase.clsRsyntax.SetBaseRFunction(clsViewAllFunction) ' ucrBase.clsRsyntax.RemoveFromAfterCodes(clsGetObjectDataFunction) From 432caebf5a2a28eb37e5059a80af18b8600d12a1 Mon Sep 17 00:00:00 2001 From: Fidel365 <107605960+Fidel365@users.noreply.github.com> Date: Wed, 2 Oct 2024 06:01:52 +0300 Subject: [PATCH 04/22] code3 --- instat/dlgView.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instat/dlgView.vb b/instat/dlgView.vb index 1d46305ffb1..c2528071ab3 100644 --- a/instat/dlgView.vb +++ b/instat/dlgView.vb @@ -245,7 +245,7 @@ Public Class dlgView ucrBase.clsRsyntax.iCallType = 2 ' If ucrNudNumberRows.GetText <> "" Then - If ucrChkRowNumbers.Checked AndAlso ucrNudNumberRows.GetText <> "" OrElse ucrChkDisplayFromTop.Checked Then + If ucrNudNumberRows.GetText <> "" OrElse ucrChkDisplayFromTop.Checked Then ucrBase.clsRsyntax.SetBaseRFunction(clsOutputWindowFunction) ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Text) ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) @@ -256,7 +256,7 @@ Public Class dlgView clsOutputWindowFunction.SetRCommand("tail") End If Else - ucrBase.clsRsyntax.RemoveFromAfterCodes(clsGetObjectDataFunction) + ' ucrBase.clsRsyntax.RemoveFromAfterCodes(clsGetObjectDataFunction) ucrBase.clsRsyntax.SetBaseRFunction(ucrReceiverView.GetVariables(True)) End If ElseIf rdoDispSepOutputWindow.Checked Then From 130ff7854a6b5b837ed048d1e1b29fec8a654ee5 Mon Sep 17 00:00:00 2001 From: Fidel365 <107605960+Fidel365@users.noreply.github.com> Date: Mon, 7 Oct 2024 10:06:42 +0300 Subject: [PATCH 05/22] code 4 --- instat/dlgView.Designer.vb | 98 +++++++++++-------------- instat/dlgView.vb | 143 +++++++++++++++++++++++++++---------- 2 files changed, 147 insertions(+), 94 deletions(-) diff --git a/instat/dlgView.Designer.vb b/instat/dlgView.Designer.vb index 0c81ff8889a..6c26c582303 100644 --- a/instat/dlgView.Designer.vb +++ b/instat/dlgView.Designer.vb @@ -42,25 +42,24 @@ Partial Class dlgView Me.rdoDispSepOutputWindow = New System.Windows.Forms.RadioButton() Me.rdoDispOutputWindow = New System.Windows.Forms.RadioButton() Me.rdoHTMLOutputWindow = New System.Windows.Forms.RadioButton() + Me.cmdTableOptions = New System.Windows.Forms.Button() + Me.ucrChkDisplayFromTop = New instat.ucrCheck() + Me.ucrChkRowNumbers = New instat.ucrCheck() Me.ucrSaveData = New instat.ucrSave() Me.ucrReceiverSortCol = New instat.ucrReceiverSingle() Me.ucrChkSortColumn = New instat.ucrCheck() Me.ucrNudNumberRows = New instat.ucrNud() - Me.ucrChkSpecifyRows = New instat.ucrCheck() Me.ucrPnlDisplayWindow = New instat.UcrPanel() Me.ucrReceiverView = New instat.ucrReceiverMultiple() Me.ucrSelectorForView = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrBase = New instat.ucrButtons() - Me.ucrChkRowNumbers = New instat.ucrCheck() - Me.ucrChkDisplayFromTop = New instat.ucrCheck() - Me.cmdTableOptions = New System.Windows.Forms.Button() Me.SuspendLayout() ' 'lblSelected ' Me.lblSelected.AutoSize = True Me.lblSelected.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblSelected.Location = New System.Drawing.Point(248, 80) + Me.lblSelected.Location = New System.Drawing.Point(248, 41) Me.lblSelected.Name = "lblSelected" Me.lblSelected.Size = New System.Drawing.Size(97, 13) Me.lblSelected.TabIndex = 4 @@ -70,7 +69,7 @@ Partial Class dlgView 'rdoDispSepOutputWindow ' Me.rdoDispSepOutputWindow.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoDispSepOutputWindow.Location = New System.Drawing.Point(10, 284) + Me.rdoDispSepOutputWindow.Location = New System.Drawing.Point(10, 245) Me.rdoDispSepOutputWindow.Name = "rdoDispSepOutputWindow" Me.rdoDispSepOutputWindow.Size = New System.Drawing.Size(210, 17) Me.rdoDispSepOutputWindow.TabIndex = 6 @@ -81,7 +80,7 @@ Partial Class dlgView 'rdoDispOutputWindow ' Me.rdoDispOutputWindow.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoDispOutputWindow.Location = New System.Drawing.Point(10, 261) + Me.rdoDispOutputWindow.Location = New System.Drawing.Point(10, 222) Me.rdoDispOutputWindow.Name = "rdoDispOutputWindow" Me.rdoDispOutputWindow.Size = New System.Drawing.Size(210, 17) Me.rdoDispOutputWindow.TabIndex = 7 @@ -92,7 +91,7 @@ Partial Class dlgView 'rdoHTMLOutputWindow ' Me.rdoHTMLOutputWindow.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoHTMLOutputWindow.Location = New System.Drawing.Point(10, 238) + Me.rdoHTMLOutputWindow.Location = New System.Drawing.Point(10, 199) Me.rdoHTMLOutputWindow.Name = "rdoHTMLOutputWindow" Me.rdoHTMLOutputWindow.Size = New System.Drawing.Size(210, 17) Me.rdoHTMLOutputWindow.TabIndex = 8 @@ -100,10 +99,37 @@ Partial Class dlgView Me.rdoHTMLOutputWindow.Text = "Display HTML in Output Window" Me.rdoHTMLOutputWindow.UseVisualStyleBackColor = True ' + 'cmdTableOptions + ' + Me.cmdTableOptions.Location = New System.Drawing.Point(248, 199) + Me.cmdTableOptions.Name = "cmdTableOptions" + Me.cmdTableOptions.Size = New System.Drawing.Size(141, 23) + Me.cmdTableOptions.TabIndex = 26 + Me.cmdTableOptions.Text = "Table Options" + Me.cmdTableOptions.UseVisualStyleBackColor = True + ' + 'ucrChkDisplayFromTop + ' + Me.ucrChkDisplayFromTop.AutoSize = True + Me.ucrChkDisplayFromTop.Checked = False + Me.ucrChkDisplayFromTop.Location = New System.Drawing.Point(248, 222) + Me.ucrChkDisplayFromTop.Name = "ucrChkDisplayFromTop" + Me.ucrChkDisplayFromTop.Size = New System.Drawing.Size(130, 23) + Me.ucrChkDisplayFromTop.TabIndex = 20 + ' + 'ucrChkRowNumbers + ' + Me.ucrChkRowNumbers.AutoSize = True + Me.ucrChkRowNumbers.Checked = False + Me.ucrChkRowNumbers.Location = New System.Drawing.Point(248, 167) + Me.ucrChkRowNumbers.Name = "ucrChkRowNumbers" + Me.ucrChkRowNumbers.Size = New System.Drawing.Size(89, 23) + Me.ucrChkRowNumbers.TabIndex = 19 + ' 'ucrSaveData ' Me.ucrSaveData.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrSaveData.Location = New System.Drawing.Point(10, 309) + Me.ucrSaveData.Location = New System.Drawing.Point(10, 270) Me.ucrSaveData.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.ucrSaveData.Name = "ucrSaveData" Me.ucrSaveData.Size = New System.Drawing.Size(308, 27) @@ -113,7 +139,7 @@ Partial Class dlgView ' Me.ucrReceiverSortCol.AutoSize = True Me.ucrReceiverSortCol.frmParent = Me - Me.ucrReceiverSortCol.Location = New System.Drawing.Point(274, 256) + Me.ucrReceiverSortCol.Location = New System.Drawing.Point(274, 217) Me.ucrReceiverSortCol.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverSortCol.Name = "ucrReceiverSortCol" Me.ucrReceiverSortCol.Selector = Nothing @@ -126,7 +152,7 @@ Partial Class dlgView ' Me.ucrChkSortColumn.AutoSize = True Me.ucrChkSortColumn.Checked = False - Me.ucrChkSortColumn.Location = New System.Drawing.Point(248, 235) + Me.ucrChkSortColumn.Location = New System.Drawing.Point(248, 203) Me.ucrChkSortColumn.Name = "ucrChkSortColumn" Me.ucrChkSortColumn.Size = New System.Drawing.Size(100, 23) Me.ucrChkSortColumn.TabIndex = 9 @@ -136,7 +162,7 @@ Partial Class dlgView Me.ucrNudNumberRows.AutoSize = True Me.ucrNudNumberRows.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudNumberRows.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudNumberRows.Location = New System.Drawing.Point(343, 206) + Me.ucrNudNumberRows.Location = New System.Drawing.Point(343, 167) Me.ucrNudNumberRows.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudNumberRows.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudNumberRows.Name = "ucrNudNumberRows" @@ -144,19 +170,10 @@ Partial Class dlgView Me.ucrNudNumberRows.TabIndex = 13 Me.ucrNudNumberRows.Value = New Decimal(New Integer() {0, 0, 0, 0}) ' - 'ucrChkSpecifyRows - ' - Me.ucrChkSpecifyRows.AutoSize = True - Me.ucrChkSpecifyRows.Checked = False - Me.ucrChkSpecifyRows.Location = New System.Drawing.Point(248, 235) - Me.ucrChkSpecifyRows.Name = "ucrChkSpecifyRows" - Me.ucrChkSpecifyRows.Size = New System.Drawing.Size(100, 23) - Me.ucrChkSpecifyRows.TabIndex = 5 - ' 'ucrPnlDisplayWindow ' Me.ucrPnlDisplayWindow.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlDisplayWindow.Location = New System.Drawing.Point(10, 235) + Me.ucrPnlDisplayWindow.Location = New System.Drawing.Point(10, 192) Me.ucrPnlDisplayWindow.Name = "ucrPnlDisplayWindow" Me.ucrPnlDisplayWindow.Size = New System.Drawing.Size(221, 83) Me.ucrPnlDisplayWindow.TabIndex = 7 @@ -165,7 +182,7 @@ Partial Class dlgView ' Me.ucrReceiverView.AutoSize = True Me.ucrReceiverView.frmParent = Me - Me.ucrReceiverView.Location = New System.Drawing.Point(248, 95) + Me.ucrReceiverView.Location = New System.Drawing.Point(248, 56) Me.ucrReceiverView.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverView.Name = "ucrReceiverView" Me.ucrReceiverView.Selector = Nothing @@ -180,7 +197,7 @@ Partial Class dlgView Me.ucrSelectorForView.bDropUnusedFilterLevels = False Me.ucrSelectorForView.bShowHiddenColumns = False Me.ucrSelectorForView.bUseCurrentFilter = True - Me.ucrSelectorForView.Location = New System.Drawing.Point(10, 45) + Me.ucrSelectorForView.Location = New System.Drawing.Point(10, 6) Me.ucrSelectorForView.Margin = New System.Windows.Forms.Padding(0) Me.ucrSelectorForView.Name = "ucrSelectorForView" Me.ucrSelectorForView.Size = New System.Drawing.Size(213, 183) @@ -190,44 +207,17 @@ Partial Class dlgView ' Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(10, 343) + Me.ucrBase.Location = New System.Drawing.Point(10, 304) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(408, 52) Me.ucrBase.TabIndex = 17 ' - 'ucrChkRowNumbers - ' - Me.ucrChkRowNumbers.AutoSize = True - Me.ucrChkRowNumbers.Checked = False - Me.ucrChkRowNumbers.Location = New System.Drawing.Point(248, 206) - Me.ucrChkRowNumbers.Name = "ucrChkRowNumbers" - Me.ucrChkRowNumbers.Size = New System.Drawing.Size(89, 23) - Me.ucrChkRowNumbers.TabIndex = 19 - ' - 'ucrChkDisplayFromTop - ' - Me.ucrChkDisplayFromTop.AutoSize = True - Me.ucrChkDisplayFromTop.Checked = False - Me.ucrChkDisplayFromTop.Location = New System.Drawing.Point(248, 261) - Me.ucrChkDisplayFromTop.Name = "ucrChkDisplayFromTop" - Me.ucrChkDisplayFromTop.Size = New System.Drawing.Size(130, 23) - Me.ucrChkDisplayFromTop.TabIndex = 20 - ' - 'cmdTableOptions - ' - Me.cmdTableOptions.Location = New System.Drawing.Point(248, 238) - Me.cmdTableOptions.Name = "cmdTableOptions" - Me.cmdTableOptions.Size = New System.Drawing.Size(141, 23) - Me.cmdTableOptions.TabIndex = 26 - Me.cmdTableOptions.Text = "Table Options" - Me.cmdTableOptions.UseVisualStyleBackColor = True - ' 'dlgView ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True - Me.ClientSize = New System.Drawing.Size(416, 393) + Me.ClientSize = New System.Drawing.Size(416, 357) Me.Controls.Add(Me.cmdTableOptions) Me.Controls.Add(Me.ucrChkDisplayFromTop) Me.Controls.Add(Me.ucrChkRowNumbers) @@ -236,7 +226,6 @@ Partial Class dlgView Me.Controls.Add(Me.ucrChkSortColumn) Me.Controls.Add(Me.rdoHTMLOutputWindow) Me.Controls.Add(Me.ucrNudNumberRows) - Me.Controls.Add(Me.ucrChkSpecifyRows) Me.Controls.Add(Me.rdoDispOutputWindow) Me.Controls.Add(Me.rdoDispSepOutputWindow) Me.Controls.Add(Me.ucrPnlDisplayWindow) @@ -263,7 +252,6 @@ Partial Class dlgView Friend WithEvents rdoDispOutputWindow As RadioButton Friend WithEvents ucrPnlDisplayWindow As UcrPanel Friend WithEvents ucrNudNumberRows As ucrNud - Friend WithEvents ucrChkSpecifyRows As ucrCheck Friend WithEvents ucrChkSortColumn As ucrCheck Friend WithEvents rdoHTMLOutputWindow As RadioButton Friend WithEvents ucrReceiverSortCol As ucrReceiverSingle diff --git a/instat/dlgView.vb b/instat/dlgView.vb index c2528071ab3..efae507929b 100644 --- a/instat/dlgView.vb +++ b/instat/dlgView.vb @@ -17,9 +17,11 @@ Imports instat.Translations Public Class dlgView + Private clsBaseOperator As New ROperator + Private bFirstLoad As Boolean = True Private bReset As Boolean = True - Private clsOutputWindowFunction, clsHTMLFunction, clsAsHtmlWidgetFunction, clsViewColumnsFunction, clsDummyFunction, clsGetObjectDataFunction, clsViewAllFunction As New RFunction + Private clsHeadRFunction, clsGtRFunction, clsOutputWindowFunction, clsHTMLFunction, clsAsHtmlWidgetFunction, clsViewColumnsFunction, clsDummyFunction, clsGetObjectDataFunction, clsViewAllFunction As New RFunction Private bControlsUpdated As Boolean = False Private Sub dlgView_Load(sender As Object, e As EventArgs) Handles MyBase.Load @@ -65,6 +67,8 @@ Public Class dlgView ' ucrChkSpecifyRows.AddToLinkedControls(ucrChkDisplayFromTop, {True}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True) ' ucrChkSpecifyRows.AddToLinkedControls(ucrNudNumberRows, {True}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=6) + + ucrNudNumberRows.SetParameter(New RParameter("n", 1)) ucrChkRowNumbers.SetText("Rows") ucrChkRowNumbers.AddToLinkedControls(ucrNudNumberRows, {True}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=6) @@ -115,11 +119,14 @@ Public Class dlgView End Sub Private Sub SetDefaults() + clsBaseOperator = New ROperator clsOutputWindowFunction = New RFunction clsViewColumnsFunction = New RFunction clsHTMLFunction = New RFunction clsViewAllFunction = New RFunction clsGetObjectDataFunction = New RFunction + clsHeadRFunction = New RFunction + clsGtRFunction = New RFunction clsDummyFunction = New RFunction clsAsHtmlWidgetFunction = New RFunction @@ -155,6 +162,17 @@ Public Class dlgView strRDataFrameNameToAddObjectTo:=ucrSelectorForView.strCurrentDataFrame, strObjectName:="last_table") + clsBaseOperator.SetOperation("%>%") + clsBaseOperator.bBrackets = False + + clsHeadRFunction.SetPackageName("utils") + clsHeadRFunction.SetRCommand("head") + clsHeadRFunction.AddParameter(strParameterName:="x", strParameterValue:=6, iPosition:=0, bIncludeArgumentName:=False) + clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=1, bIncludeArgumentName:=False) + + clsGtRFunction.SetPackageName("gt") + clsGtRFunction.SetRCommand("gt") + clsBaseOperator.AddParameter(strParameterName:="gt", clsRFunctionParameter:=clsGtRFunction, iPosition:=2, bIncludeArgumentName:=False) clsViewColumnsFunction.SetPackageName("utils") clsViewColumnsFunction.SetRCommand("View") @@ -184,6 +202,7 @@ Public Class dlgView ucrChkDisplayFromTop.SetRCode(clsOutputWindowFunction, bReset) ucrNudNumberRows.SetRCode(clsOutputWindowFunction, bReset) + ucrChkRowNumbers.SetRCode(clsHeadRFunction, bReset) ' ucrChkSpecifyRows.SetRCode(clsOutputWindowFunction, bReset) ucrSelectorForView.SetRCode(clsViewAllFunction, bReset) ' ucrPnlViewData.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) @@ -241,39 +260,65 @@ Public Class dlgView If rdoDispOutputWindow.Checked Then clsDummyFunction.AddParameter("checked", "window", iPosition:=0) + cmdTableOptions.Visible = False ucrSaveData.Visible = True ucrBase.clsRsyntax.iCallType = 2 + 'If ucrChkDisplayFromTop.Checked Then + ' clsOutputWindowFunction.SetRCommand("head") + 'Else + ' clsOutputWindowFunction.SetRCommand("tail") + 'End If ' If ucrNudNumberRows.GetText <> "" Then - If ucrNudNumberRows.GetText <> "" OrElse ucrChkDisplayFromTop.Checked Then - ucrBase.clsRsyntax.SetBaseRFunction(clsOutputWindowFunction) - ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Text) - ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) + 'If ucrNudNumberRows.GetText <> "" AndAlso rdoDispOutputWindow.Checked Then 'OrElse ucrChkDisplayFromTop.Checked Then + ' ' clsOutputWindowFunction.SetRCommand("head") + ' ucrBase.clsRsyntax.SetBaseRFunction(clsOutputWindowFunction) + ' ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Text) + ' ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) - If ucrChkDisplayFromTop.Checked Then - clsOutputWindowFunction.SetRCommand("head") - Else - clsOutputWindowFunction.SetRCommand("tail") - End If - Else - ' ucrBase.clsRsyntax.RemoveFromAfterCodes(clsGetObjectDataFunction) - ucrBase.clsRsyntax.SetBaseRFunction(ucrReceiverView.GetVariables(True)) - End If + 'Else + ' ' clsViewAllFunction.AddParameter("x", clsRFunctionParameter:=ucrSelectorForView.ucrAvailableDataFrames.clsCurrDataFrame, iPosition:=0) + + ' ' clsOutputWindowFunction.AddParameter("x", clsRFunctionParameter:=ucrSelectorForView.ucrAvailableDataFrames.iColumnCount, iPosition:=0) + + ' ' ucrBase.clsRsyntax.RemoveFromAfterCodes(clsGetObjectDataFunction) + ' ucrBase.clsRsyntax.SetBaseRFunction(ucrReceiverView.GetVariables(True)) + 'End If ElseIf rdoDispSepOutputWindow.Checked Then + clsOutputWindowFunction.SetRCommand("head") clsDummyFunction.AddParameter("checked", "viewer", iPosition:=0) ucrBase.clsRsyntax.iCallType = 0 ucrBase.clsRsyntax.SetBaseRFunction(clsViewColumnsFunction) ' ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) ucrBase.clsRsyntax.RemoveFromAfterCodes(clsGetObjectDataFunction) + cmdTableOptions.Visible = False ucrSaveData.Visible = False Else + 'ucrNudNumberRows.AddParameterPresentCondition(True, "head", bNewIsPositive:=True) + 'ucrNudNumberRows.AddParameterPresentCondition(False, "head", bNewIsPositive:=False) + 'If ucrNudNumberRows.GetText <> "" Then + ' ' clsOutputWindowFunction.RemoveParameterByName("x") + ' ' clsOutputWindowFunction.SetRCommand("head") + ' clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=1, bIncludeArgumentName:=False) + 'Else + ' clsBaseOperator.RemoveParameterByName("head") + 'End If + 'ucrChkRowNumbers.AddParameterPresentCondition(True, "head", bNewIsPositive:=True) + 'ucrChkRowNumbers.AddParameterPresentCondition(False, "head", bNewIsPositive:=False) + 'If ucrChkRowNumbers.Checked AndAlso ucrNudNumberRows.GetText <> "" Then + ' clsOutputWindowFunction.RemoveParameterByName("x") + ' clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=1, bIncludeArgumentName:=False) + 'Else + + ' clsBaseOperator.RemoveParameterByName("head") + 'End If clsDummyFunction.AddParameter("checked", "html", iPosition:=0) ucrBase.clsRsyntax.SetBaseRFunction(clsAsHtmlWidgetFunction) ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) + cmdTableOptions.Visible = True ucrSaveData.Visible = True ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) - End If 'Else ' ucrBase.clsRsyntax.SetBaseRFunction(clsViewAllFunction) @@ -286,13 +331,42 @@ Public Class dlgView ucrNudNumberRows.Maximum = ucrSelectorForView.ucrAvailableDataFrames.iDataFrameLength End Sub - Private Sub FunctionControls_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkDisplayFromTop.ControlValueChanged, ucrPnlDisplayWindow.ControlValueChanged, ucrChkSpecifyRows.ControlValueChanged, ucrReceiverView.ControlValueChanged + Private Sub FunctionControls_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkDisplayFromTop.ControlValueChanged, ucrPnlDisplayWindow.ControlValueChanged, ucrReceiverView.ControlValueChanged If bControlsUpdated Then ChangeFunctionParameters() End If GetObjectName() End Sub + Private Sub ucrChkRowNumbers_Load(sender As Object, e As EventArgs) Handles ucrChkRowNumbers.Load + If ucrChkRowNumbers.Checked Then + If rdoDispOutputWindow.Checked Then + If ucrChkDisplayFromTop.Checked Then + clsOutputWindowFunction.SetRCommand("head") + Else + clsOutputWindowFunction.SetRCommand("tail") + End If + If ucrNudNumberRows.GetText <> "" Then + clsOutputWindowFunction.SetRCommand("head") + ucrBase.clsRsyntax.SetBaseRFunction(clsOutputWindowFunction) + ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Text) + ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) + Else + ucrBase.clsRsyntax.SetBaseRFunction(ucrReceiverView.GetVariables(True)) + End If + ElseIf rdoHTMLOutputWindow.Checked Then + ucrChkRowNumbers.AddParameterPresentCondition(True, "head", bNewIsPositive:=True) + ucrChkRowNumbers.AddParameterPresentCondition(False, "head", bNewIsPositive:=False) + If ucrNudNumberRows.GetText <> "" Then + ' clsOutputWindowFunction.RemoveParameterByName("x") + clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=1, bIncludeArgumentName:=False) + Else + clsBaseOperator.RemoveParameterByName("head") + End If + End If + End If + End Sub + Private Sub ucrChkSortColumn_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkSortColumn.ControlValueChanged, ucrPnlDisplayWindow.ControlValueChanged 'Not yet implemented 'If rdoHTMLOutputWindow.Checked AndAlso ucrChkSortColumn.Checked Then @@ -308,33 +382,32 @@ Public Class dlgView End Sub Private Sub cmdTableOptions_Click(sender As Object, e As EventArgs) Handles cmdTableOptions.Click - 'sdgTableOptions.Setup(ucrSelectorForView.strCurrentDataFrame, ) + sdgTableOptions.Setup(ucrSelectorForView.strCurrentDataFrame, clsBaseOperator) sdgTableOptions.ShowDialog(Me) End Sub - Private Sub ucrChkRowNumbers_Load(sender As Object, e As EventArgs) Handles ucrChkRowNumbers.Load - If ucrChkRowNumbers.Checked Then - ucrNudNumberRows.SetParameter(New RParameter("n", 1)) - ucrNudNumberRows.Visible = True - Else - 'ucrNudNumberRows.Remove("n") - 'ucrNudNumberRows.UnSetParameter(New RParameter("n", 1)) - ucrNudNumberRows.Visible = False - End If - End Sub + 'Private Sub ucrChkRowNumbers_Load(sender As Object, e As EventArgs) Handles ucrChkRowNumbers.Load + ' If ucrChkRowNumbers.Checked Then + ' ucrNudNumberRows.SetParameter(New RParameter("n", 1)) + ' ucrNudNumberRows.Visible = True + ' Else + ' 'ucrNudNumberRows.Remove("n") + ' 'ucrNudNumberRows.UnSetParameter(New RParameter("n", 1)) + ' ucrNudNumberRows.Visible = False + ' End If + 'End Sub Private Sub ucrPnlViewData_ControlValueChanged(ucrChangedControl As ucrCore) - TableOptions() ChangeFunctionParameters() End Sub - Private Sub CoreControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverView.ControlContentsChanged, ucrPnlDisplayWindow.ControlContentsChanged, ucrChkSpecifyRows.ControlContentsChanged, ucrNudNumberRows.ControlContentsChanged, ucrChkDisplayFromTop.ControlContentsChanged, ucrChkSortColumn.ControlContentsChanged, ucrReceiverSortCol.ControlContentsChanged - TableOptions() + Private Sub CoreControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverView.ControlContentsChanged, ucrPnlDisplayWindow.ControlContentsChanged, ucrNudNumberRows.ControlContentsChanged, ucrChkDisplayFromTop.ControlContentsChanged, ucrChkSortColumn.ControlContentsChanged, ucrReceiverSortCol.ControlContentsChanged + ' TableOptions() TestOKEnabled() End Sub Private Sub ucrSaveData_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSaveData.ControlValueChanged - TableOptions() + ' TableOptions() GetObjectName() End Sub @@ -348,14 +421,6 @@ Public Class dlgView End If End Sub - Private Sub TableOptions() - If rdoHTMLOutputWindow.Checked Then - cmdTableOptions.Visible = True - Else - cmdTableOptions.Visible = False - End If - End Sub - Private Sub ucrSelectorForView_DataFrameChanged() Handles ucrSelectorForView.DataFrameChanged clsGetObjectDataFunction.AddParameter("data_name", Chr(34) & ucrSelectorForView.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) End Sub From 968544e4d7637befc3f6f206e0b520d2cd3168a7 Mon Sep 17 00:00:00 2001 From: Fidel365 <107605960+Fidel365@users.noreply.github.com> Date: Mon, 7 Oct 2024 11:41:11 +0300 Subject: [PATCH 06/22] code5 --- instat/dlgView.Designer.vb | 32 +++++++++- instat/dlgView.vb | 127 ++++++++++++------------------------- 2 files changed, 73 insertions(+), 86 deletions(-) diff --git a/instat/dlgView.Designer.vb b/instat/dlgView.Designer.vb index 6c26c582303..701924ad824 100644 --- a/instat/dlgView.Designer.vb +++ b/instat/dlgView.Designer.vb @@ -43,6 +43,8 @@ Partial Class dlgView Me.rdoDispOutputWindow = New System.Windows.Forms.RadioButton() Me.rdoHTMLOutputWindow = New System.Windows.Forms.RadioButton() Me.cmdTableOptions = New System.Windows.Forms.Button() + Me.ucrViewNudPreview = New instat.ucrNud() + Me.ucrViewChkPreview = New instat.ucrCheck() Me.ucrChkDisplayFromTop = New instat.ucrCheck() Me.ucrChkRowNumbers = New instat.ucrCheck() Me.ucrSaveData = New instat.ucrSave() @@ -108,6 +110,30 @@ Partial Class dlgView Me.cmdTableOptions.Text = "Table Options" Me.cmdTableOptions.UseVisualStyleBackColor = True ' + 'ucrViewNudPreview + ' + Me.ucrViewNudPreview.AutoSize = True + Me.ucrViewNudPreview.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrViewNudPreview.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrViewNudPreview.Location = New System.Drawing.Point(343, 167) + Me.ucrViewNudPreview.Margin = New System.Windows.Forms.Padding(6) + Me.ucrViewNudPreview.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrViewNudPreview.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrViewNudPreview.Name = "ucrViewNudPreview" + Me.ucrViewNudPreview.Size = New System.Drawing.Size(50, 20) + Me.ucrViewNudPreview.TabIndex = 33 + Me.ucrViewNudPreview.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrViewChkPreview + ' + Me.ucrViewChkPreview.AutoSize = True + Me.ucrViewChkPreview.Checked = False + Me.ucrViewChkPreview.Location = New System.Drawing.Point(248, 167) + Me.ucrViewChkPreview.Margin = New System.Windows.Forms.Padding(6) + Me.ucrViewChkPreview.Name = "ucrViewChkPreview" + Me.ucrViewChkPreview.Size = New System.Drawing.Size(89, 23) + Me.ucrViewChkPreview.TabIndex = 32 + ' 'ucrChkDisplayFromTop ' Me.ucrChkDisplayFromTop.AutoSize = True @@ -218,9 +244,9 @@ Partial Class dlgView Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True Me.ClientSize = New System.Drawing.Size(416, 357) + Me.Controls.Add(Me.ucrViewNudPreview) Me.Controls.Add(Me.cmdTableOptions) Me.Controls.Add(Me.ucrChkDisplayFromTop) - Me.Controls.Add(Me.ucrChkRowNumbers) Me.Controls.Add(Me.ucrSaveData) Me.Controls.Add(Me.ucrReceiverSortCol) Me.Controls.Add(Me.ucrChkSortColumn) @@ -233,6 +259,8 @@ Partial Class dlgView Me.Controls.Add(Me.ucrReceiverView) Me.Controls.Add(Me.ucrSelectorForView) Me.Controls.Add(Me.ucrBase) + Me.Controls.Add(Me.ucrViewChkPreview) + Me.Controls.Add(Me.ucrChkRowNumbers) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.MaximizeBox = False Me.MinimizeBox = False @@ -259,4 +287,6 @@ Partial Class dlgView Friend WithEvents ucrChkRowNumbers As ucrCheck Friend WithEvents ucrChkDisplayFromTop As ucrCheck Friend WithEvents cmdTableOptions As Button + Friend WithEvents ucrViewNudPreview As ucrNud + Friend WithEvents ucrViewChkPreview As ucrCheck End Class \ No newline at end of file diff --git a/instat/dlgView.vb b/instat/dlgView.vb index efae507929b..0961ccc23f9 100644 --- a/instat/dlgView.vb +++ b/instat/dlgView.vb @@ -56,7 +56,10 @@ Public Class dlgView ucrPnlDisplayWindow.AddParameterValuesCondition(rdoDispSepOutputWindow, "checked", "viewer") ucrPnlDisplayWindow.AddToLinkedControls(ucrChkDisplayFromTop, {rdoDispOutputWindow}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True) - ucrPnlDisplayWindow.AddToLinkedControls(ucrChkRowNumbers, {rdoDispOutputWindow, rdoHTMLOutputWindow}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True) + ucrPnlDisplayWindow.AddToLinkedControls(ucrChkRowNumbers, {rdoDispOutputWindow}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True) + ucrPnlDisplayWindow.AddToLinkedControls(ucrViewChkPreview, {rdoHTMLOutputWindow}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True) + + 'ucrPnlDisplayFrom.AddRadioButton(rdoBottom) 'ucrPnlDisplayFrom.AddRadioButton(rdoTop) 'ucrPnlDisplayFrom.SetLinkedDisplayControl(lblDisplayFrom) @@ -75,6 +78,16 @@ Public Class dlgView ucrChkDisplayFromTop.SetText("Display From Top") ucrChkDisplayFromTop.AddFunctionNamesCondition(True, {"head", "tail"}) ucrChkDisplayFromTop.AddFunctionNamesCondition(False, {frmMain.clsRLink.strInstatDataObject & "$get_columns_from_data"}) + + ucrViewChkPreview.SetText("Rows") + ucrViewChkPreview.AddParameterPresentCondition(True, "head", bNewIsPositive:=True) + ucrViewChkPreview.AddParameterPresentCondition(False, "head", bNewIsPositive:=False) + ucrViewChkPreview.AddToLinkedControls(ucrViewNudPreview, {True}, bNewLinkedHideIfParameterMissing:=True) + + ucrViewNudPreview.SetParameter(New RParameter("x", 0, bNewIncludeArgumentName:=False)) + ucrViewNudPreview.Minimum = 6 + ucrViewNudPreview.Maximum = Decimal.MaxValue + ucrViewNudPreview.SetRDefault(6) ' ucrChkSpecifyRows.bAllowNonConditionValues = True ' ucrPnlViewData.AddRadioButton(rdoViewAll) @@ -130,6 +143,8 @@ Public Class dlgView clsDummyFunction = New RFunction clsAsHtmlWidgetFunction = New RFunction + ucrViewChkPreview.Checked = True + ucrSelectorForView.Reset() ucrReceiverView.SetMeAsReceiver() @@ -167,7 +182,7 @@ Public Class dlgView clsHeadRFunction.SetPackageName("utils") clsHeadRFunction.SetRCommand("head") - clsHeadRFunction.AddParameter(strParameterName:="x", strParameterValue:=6, iPosition:=0, bIncludeArgumentName:=False) + clsHeadRFunction.AddParameter(strParameterName:="x", strParameterValue:=100, iPosition:=0, bIncludeArgumentName:=False) clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=1, bIncludeArgumentName:=False) clsGtRFunction.SetPackageName("gt") @@ -190,6 +205,7 @@ Public Class dlgView 'Correct maximum is then set in DataFrameLength() ucrNudNumberRows.Maximum = Decimal.MaxValue + ucrViewChkPreview.SetRCode(clsBaseOperator, bReset) 'ucrReceiverView.AddAdditionalCodeParameterPair(clsHTMLFunction, New RParameter("mydf"), iAdditionalPairNo:=1) ucrReceiverView.AddAdditionalCodeParameterPair(clsHTMLFunction, New RParameter("x"), iAdditionalPairNo:=1) @@ -202,7 +218,7 @@ Public Class dlgView ucrChkDisplayFromTop.SetRCode(clsOutputWindowFunction, bReset) ucrNudNumberRows.SetRCode(clsOutputWindowFunction, bReset) - ucrChkRowNumbers.SetRCode(clsHeadRFunction, bReset) + ucrViewNudPreview.SetRCode(clsHeadRFunction, bReset) ' ucrChkSpecifyRows.SetRCode(clsOutputWindowFunction, bReset) ucrSelectorForView.SetRCode(clsViewAllFunction, bReset) ' ucrPnlViewData.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) @@ -264,26 +280,18 @@ Public Class dlgView ucrSaveData.Visible = True ucrBase.clsRsyntax.iCallType = 2 - 'If ucrChkDisplayFromTop.Checked Then - ' clsOutputWindowFunction.SetRCommand("head") - 'Else - ' clsOutputWindowFunction.SetRCommand("tail") - 'End If - ' If ucrNudNumberRows.GetText <> "" Then - 'If ucrNudNumberRows.GetText <> "" AndAlso rdoDispOutputWindow.Checked Then 'OrElse ucrChkDisplayFromTop.Checked Then - ' ' clsOutputWindowFunction.SetRCommand("head") - ' ucrBase.clsRsyntax.SetBaseRFunction(clsOutputWindowFunction) - ' ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Text) - ' ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) - - 'Else - ' ' clsViewAllFunction.AddParameter("x", clsRFunctionParameter:=ucrSelectorForView.ucrAvailableDataFrames.clsCurrDataFrame, iPosition:=0) - - ' ' clsOutputWindowFunction.AddParameter("x", clsRFunctionParameter:=ucrSelectorForView.ucrAvailableDataFrames.iColumnCount, iPosition:=0) - - ' ' ucrBase.clsRsyntax.RemoveFromAfterCodes(clsGetObjectDataFunction) - ' ucrBase.clsRsyntax.SetBaseRFunction(ucrReceiverView.GetVariables(True)) - 'End If + If ucrNudNumberRows.GetText <> "" OrElse ucrChkDisplayFromTop.Checked Then + ucrBase.clsRsyntax.SetBaseRFunction(clsOutputWindowFunction) + ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Text) + ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) + If ucrChkDisplayFromTop.Checked Then + clsOutputWindowFunction.SetRCommand("head") + Else + clsOutputWindowFunction.SetRCommand("tail") + End If + Else + ucrBase.clsRsyntax.SetBaseRFunction(ucrReceiverView.GetVariables(True)) + End If ElseIf rdoDispSepOutputWindow.Checked Then clsOutputWindowFunction.SetRCommand("head") clsDummyFunction.AddParameter("checked", "viewer", iPosition:=0) @@ -295,24 +303,7 @@ Public Class dlgView cmdTableOptions.Visible = False ucrSaveData.Visible = False Else - 'ucrNudNumberRows.AddParameterPresentCondition(True, "head", bNewIsPositive:=True) - 'ucrNudNumberRows.AddParameterPresentCondition(False, "head", bNewIsPositive:=False) - 'If ucrNudNumberRows.GetText <> "" Then - ' ' clsOutputWindowFunction.RemoveParameterByName("x") - ' ' clsOutputWindowFunction.SetRCommand("head") - ' clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=1, bIncludeArgumentName:=False) - 'Else - ' clsBaseOperator.RemoveParameterByName("head") - 'End If - 'ucrChkRowNumbers.AddParameterPresentCondition(True, "head", bNewIsPositive:=True) - 'ucrChkRowNumbers.AddParameterPresentCondition(False, "head", bNewIsPositive:=False) - 'If ucrChkRowNumbers.Checked AndAlso ucrNudNumberRows.GetText <> "" Then - ' clsOutputWindowFunction.RemoveParameterByName("x") - ' clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=1, bIncludeArgumentName:=False) - 'Else - - ' clsBaseOperator.RemoveParameterByName("head") - 'End If + clsOutputWindowFunction.SetRCommand("head") clsDummyFunction.AddParameter("checked", "html", iPosition:=0) ucrBase.clsRsyntax.SetBaseRFunction(clsAsHtmlWidgetFunction) ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) @@ -320,53 +311,29 @@ Public Class dlgView ucrSaveData.Visible = True ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) End If - 'Else - ' ucrBase.clsRsyntax.SetBaseRFunction(clsViewAllFunction) - ' ucrBase.clsRsyntax.RemoveFromAfterCodes(clsGetObjectDataFunction) - ' ucrSaveData.Visible = False - 'End If End Sub Private Sub DataFrameLength() ucrNudNumberRows.Maximum = ucrSelectorForView.ucrAvailableDataFrames.iDataFrameLength End Sub - Private Sub FunctionControls_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkDisplayFromTop.ControlValueChanged, ucrPnlDisplayWindow.ControlValueChanged, ucrReceiverView.ControlValueChanged + Private Sub FunctionControls_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrViewChkPreview.ControlValueChanged, ucrViewNudPreview.ControlValueChanged, ucrChkDisplayFromTop.ControlValueChanged, ucrPnlDisplayWindow.ControlValueChanged, ucrReceiverView.ControlValueChanged If bControlsUpdated Then ChangeFunctionParameters() End If GetObjectName() End Sub - Private Sub ucrChkRowNumbers_Load(sender As Object, e As EventArgs) Handles ucrChkRowNumbers.Load - If ucrChkRowNumbers.Checked Then - If rdoDispOutputWindow.Checked Then - If ucrChkDisplayFromTop.Checked Then - clsOutputWindowFunction.SetRCommand("head") - Else - clsOutputWindowFunction.SetRCommand("tail") - End If - If ucrNudNumberRows.GetText <> "" Then - clsOutputWindowFunction.SetRCommand("head") - ucrBase.clsRsyntax.SetBaseRFunction(clsOutputWindowFunction) - ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Text) - ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) - Else - ucrBase.clsRsyntax.SetBaseRFunction(ucrReceiverView.GetVariables(True)) - End If - ElseIf rdoHTMLOutputWindow.Checked Then - ucrChkRowNumbers.AddParameterPresentCondition(True, "head", bNewIsPositive:=True) - ucrChkRowNumbers.AddParameterPresentCondition(False, "head", bNewIsPositive:=False) - If ucrNudNumberRows.GetText <> "" Then - ' clsOutputWindowFunction.RemoveParameterByName("x") - clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=1, bIncludeArgumentName:=False) - Else - clsBaseOperator.RemoveParameterByName("head") - End If - End If + Private Sub ucrViewChkPreview_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrViewChkPreview.ControlValueChanged + ' clsOutputWindowFunction.SetRCommand("head") + If ucrViewChkPreview.Checked Then + clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=1, bIncludeArgumentName:=False) + Else + clsBaseOperator.RemoveParameterByName("head") End If End Sub + Private Sub ucrChkSortColumn_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkSortColumn.ControlValueChanged, ucrPnlDisplayWindow.ControlValueChanged 'Not yet implemented 'If rdoHTMLOutputWindow.Checked AndAlso ucrChkSortColumn.Checked Then @@ -386,22 +353,11 @@ Public Class dlgView sdgTableOptions.ShowDialog(Me) End Sub - 'Private Sub ucrChkRowNumbers_Load(sender As Object, e As EventArgs) Handles ucrChkRowNumbers.Load - ' If ucrChkRowNumbers.Checked Then - ' ucrNudNumberRows.SetParameter(New RParameter("n", 1)) - ' ucrNudNumberRows.Visible = True - ' Else - ' 'ucrNudNumberRows.Remove("n") - ' 'ucrNudNumberRows.UnSetParameter(New RParameter("n", 1)) - ' ucrNudNumberRows.Visible = False - ' End If - 'End Sub - Private Sub ucrPnlViewData_ControlValueChanged(ucrChangedControl As ucrCore) ChangeFunctionParameters() End Sub - Private Sub CoreControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverView.ControlContentsChanged, ucrPnlDisplayWindow.ControlContentsChanged, ucrNudNumberRows.ControlContentsChanged, ucrChkDisplayFromTop.ControlContentsChanged, ucrChkSortColumn.ControlContentsChanged, ucrReceiverSortCol.ControlContentsChanged + Private Sub CoreControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrViewNudPreview.ControlContentsChanged, ucrViewChkPreview.ControlContentsChanged, ucrReceiverView.ControlContentsChanged, ucrPnlDisplayWindow.ControlContentsChanged, ucrNudNumberRows.ControlContentsChanged, ucrChkDisplayFromTop.ControlContentsChanged, ucrChkSortColumn.ControlContentsChanged, ucrReceiverSortCol.ControlContentsChanged ' TableOptions() TestOKEnabled() End Sub @@ -416,6 +372,7 @@ Public Class dlgView Dim strPrefix As String = clsOutputWindowFunction.GetRObjectToAssignTo 'If(ucrSaveData.GetText <> "", ucrSaveData.GetText, "last_table") clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=1) ElseIf rdoHTMLOutputWindow.Checked Then + clsOutputWindowFunction.SetRCommand("head") Dim strPrefix As String = clsAsHtmlWidgetFunction.GetRObjectToAssignTo clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=1) End If From fdc509bc68f22d255333eb8d7677c793e3b066a1 Mon Sep 17 00:00:00 2001 From: Fidel365 <107605960+Fidel365@users.noreply.github.com> Date: Mon, 7 Oct 2024 12:09:21 +0300 Subject: [PATCH 07/22] Final changes --- instat/dlgView.vb | 49 +---------------------------------------------- 1 file changed, 1 insertion(+), 48 deletions(-) diff --git a/instat/dlgView.vb b/instat/dlgView.vb index 0961ccc23f9..5f07adbabc6 100644 --- a/instat/dlgView.vb +++ b/instat/dlgView.vb @@ -59,19 +59,8 @@ Public Class dlgView ucrPnlDisplayWindow.AddToLinkedControls(ucrChkRowNumbers, {rdoDispOutputWindow}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True) ucrPnlDisplayWindow.AddToLinkedControls(ucrViewChkPreview, {rdoHTMLOutputWindow}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True) - - 'ucrPnlDisplayFrom.AddRadioButton(rdoBottom) - 'ucrPnlDisplayFrom.AddRadioButton(rdoTop) - 'ucrPnlDisplayFrom.SetLinkedDisplayControl(lblDisplayFrom) - 'ucrChkDisplayFromTop.AddFunctionNamesCondition("head") - 'ucrChkDisplayFromTop.AddFunctionNamesCondition(rdoBottom, "tail") - - ' This linking only applies if rdoDispOutputWindow is checked - - ' ucrChkSpecifyRows.AddToLinkedControls(ucrChkDisplayFromTop, {True}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True) - ' ucrChkSpecifyRows.AddToLinkedControls(ucrNudNumberRows, {True}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=6) - ucrNudNumberRows.SetParameter(New RParameter("n", 1)) + ucrNudNumberRows.Minimum = 1 ucrChkRowNumbers.SetText("Rows") ucrChkRowNumbers.AddToLinkedControls(ucrNudNumberRows, {True}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=6) @@ -88,17 +77,8 @@ Public Class dlgView ucrViewNudPreview.Minimum = 6 ucrViewNudPreview.Maximum = Decimal.MaxValue ucrViewNudPreview.SetRDefault(6) - ' ucrChkSpecifyRows.bAllowNonConditionValues = True - ' ucrPnlViewData.AddRadioButton(rdoViewAll) - ' ucrPnlViewData.AddRadioButton(rdoViewSelectedColumnsRows) - - ' ucrPnlViewData.AddParameterValueFunctionNamesCondition(rdoViewAll, "x", frmMain.clsRLink.strInstatDataObject & "$get_data_frame") - ' ucrPnlViewData.AddParameterValueFunctionNamesCondition(rdoViewSelectedColumnsRows, "x", frmMain.clsRLink.strInstatDataObject & "$get_data_frame", bNewIsPositive:=False) - - ' ucrPnlViewData.AddToLinkedControls(ucrReceiverView, {rdoViewSelectedColumnsRows}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True) ucrReceiverView.SetLinkedDisplayControl(lblSelected) - ' ucrPnlViewData.AddToLinkedControls(ucrPnlDisplayWindow, {rdoViewSelectedColumnsRows}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True) ucrChkSortColumn.Visible = False 'ucrPnlDisplayWindow.AddToLinkedControls(ucrChkSortColumn, {rdoHTMLOutputWindow}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True) @@ -118,10 +98,6 @@ Public Class dlgView ucrSelectorForView.SetParameter(New RParameter("title", 1)) ucrSelectorForView.SetParameterIsString() - - ucrNudNumberRows.Minimum = 1 - ' ucrNudNumberRows.SetLinkedDisplayControl(ucrChkNumbersRows) - ucrSaveData.SetCheckBoxText("Store Data") ucrSaveData.SetPrefix("last_table") ucrSaveData.SetDataFrameSelector(ucrSelectorForView.ucrAvailableDataFrames) @@ -219,9 +195,7 @@ Public Class dlgView ucrChkDisplayFromTop.SetRCode(clsOutputWindowFunction, bReset) ucrNudNumberRows.SetRCode(clsOutputWindowFunction, bReset) ucrViewNudPreview.SetRCode(clsHeadRFunction, bReset) - ' ucrChkSpecifyRows.SetRCode(clsOutputWindowFunction, bReset) ucrSelectorForView.SetRCode(clsViewAllFunction, bReset) - ' ucrPnlViewData.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrSaveData.SetRCode(clsAsHtmlWidgetFunction, bReset) DataFrameLength() @@ -234,12 +208,10 @@ Public Class dlgView End Sub Private Sub TestOKEnabled() - ' If rdoViewSelectedColumnsRows.Checked Then If Not ucrReceiverView.IsEmpty Then If rdoDispSepOutputWindow.Checked Then ucrBase.OKEnabled(True) ElseIf rdoDispOutputWindow.Checked Then - ' If ucrChkSpecifyRows.Checked Then If ucrNudNumberRows.GetText <> "" OrElse ucrChkDisplayFromTop.Checked Then ucrBase.OKEnabled(True) Else @@ -253,16 +225,6 @@ Public Class dlgView Else ucrBase.OKEnabled(False) End If - 'Else - ' ucrBase.OKEnabled(False) - 'End If - 'Else - ' If ucrSelectorForView.ucrAvailableDataFrames.cboAvailableDataFrames.Text <> "" Then - ' ucrBase.OKEnabled(True) - ' Else - ' ucrBase.OKEnabled(False) - ' End If - 'End If End Sub Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset @@ -272,7 +234,6 @@ Public Class dlgView End Sub Private Sub ChangeFunctionParameters() - 'If rdoViewSelectedColumnsRows.Checked Then If rdoDispOutputWindow.Checked Then clsDummyFunction.AddParameter("checked", "window", iPosition:=0) @@ -293,17 +254,13 @@ Public Class dlgView ucrBase.clsRsyntax.SetBaseRFunction(ucrReceiverView.GetVariables(True)) End If ElseIf rdoDispSepOutputWindow.Checked Then - clsOutputWindowFunction.SetRCommand("head") clsDummyFunction.AddParameter("checked", "viewer", iPosition:=0) - ucrBase.clsRsyntax.iCallType = 0 ucrBase.clsRsyntax.SetBaseRFunction(clsViewColumnsFunction) - ' ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) ucrBase.clsRsyntax.RemoveFromAfterCodes(clsGetObjectDataFunction) cmdTableOptions.Visible = False ucrSaveData.Visible = False Else - clsOutputWindowFunction.SetRCommand("head") clsDummyFunction.AddParameter("checked", "html", iPosition:=0) ucrBase.clsRsyntax.SetBaseRFunction(clsAsHtmlWidgetFunction) ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) @@ -325,7 +282,6 @@ Public Class dlgView End Sub Private Sub ucrViewChkPreview_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrViewChkPreview.ControlValueChanged - ' clsOutputWindowFunction.SetRCommand("head") If ucrViewChkPreview.Checked Then clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=1, bIncludeArgumentName:=False) Else @@ -358,12 +314,10 @@ Public Class dlgView End Sub Private Sub CoreControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrViewNudPreview.ControlContentsChanged, ucrViewChkPreview.ControlContentsChanged, ucrReceiverView.ControlContentsChanged, ucrPnlDisplayWindow.ControlContentsChanged, ucrNudNumberRows.ControlContentsChanged, ucrChkDisplayFromTop.ControlContentsChanged, ucrChkSortColumn.ControlContentsChanged, ucrReceiverSortCol.ControlContentsChanged - ' TableOptions() TestOKEnabled() End Sub Private Sub ucrSaveData_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSaveData.ControlValueChanged - ' TableOptions() GetObjectName() End Sub @@ -381,5 +335,4 @@ Public Class dlgView Private Sub ucrSelectorForView_DataFrameChanged() Handles ucrSelectorForView.DataFrameChanged clsGetObjectDataFunction.AddParameter("data_name", Chr(34) & ucrSelectorForView.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) End Sub - End Class \ No newline at end of file From 5599d942d72728279bc451ddddfce7406931517e Mon Sep 17 00:00:00 2001 From: Fidel365 <107605960+Fidel365@users.noreply.github.com> Date: Mon, 14 Oct 2024 00:51:49 +0300 Subject: [PATCH 08/22] changes --- instat/dlgView.vb | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/instat/dlgView.vb b/instat/dlgView.vb index 5f07adbabc6..5d6005cf690 100644 --- a/instat/dlgView.vb +++ b/instat/dlgView.vb @@ -261,6 +261,11 @@ Public Class dlgView cmdTableOptions.Visible = False ucrSaveData.Visible = False Else + If ucrViewChkPreview.Checked Then + clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=1, bIncludeArgumentName:=False) + Else + clsBaseOperator.RemoveParameterByName("head") + End If clsDummyFunction.AddParameter("checked", "html", iPosition:=0) ucrBase.clsRsyntax.SetBaseRFunction(clsAsHtmlWidgetFunction) ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) @@ -281,13 +286,13 @@ Public Class dlgView GetObjectName() End Sub - Private Sub ucrViewChkPreview_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrViewChkPreview.ControlValueChanged - If ucrViewChkPreview.Checked Then - clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=1, bIncludeArgumentName:=False) - Else - clsBaseOperator.RemoveParameterByName("head") - End If - End Sub + 'Private Sub ucrViewChkPreview_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrViewChkPreview.ControlValueChanged + ' If ucrViewChkPreview.Checked Then + ' clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=1, bIncludeArgumentName:=False) + ' Else + ' clsBaseOperator.RemoveParameterByName("head") + ' End If + 'End Sub Private Sub ucrChkSortColumn_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkSortColumn.ControlValueChanged, ucrPnlDisplayWindow.ControlValueChanged From 54d4e322f6d57196be1f6dc95481e26e2cf52ed8 Mon Sep 17 00:00:00 2001 From: Fidel365 <107605960+Fidel365@users.noreply.github.com> Date: Mon, 21 Oct 2024 16:12:39 +0300 Subject: [PATCH 09/22] sub dialog changes --- instat/UserTables/dlgGeneralTable.vb | 2 +- instat/dlgView.vb | 71 ++++++++++++++++++---------- 2 files changed, 48 insertions(+), 25 deletions(-) diff --git a/instat/UserTables/dlgGeneralTable.vb b/instat/UserTables/dlgGeneralTable.vb index fefc401eee2..d27ad3d3acd 100644 --- a/instat/UserTables/dlgGeneralTable.vb +++ b/instat/UserTables/dlgGeneralTable.vb @@ -1,7 +1,7 @@ Imports instat.Translations Public Class dlgGeneralTable - Private clsBaseOperator As New ROperator + Public clsBaseOperator As New ROperator Private clsHeadRFunction, clsGtRFunction As New RFunction Private bFirstload As Boolean = True diff --git a/instat/dlgView.vb b/instat/dlgView.vb index 5d6005cf690..788ebc4e394 100644 --- a/instat/dlgView.vb +++ b/instat/dlgView.vb @@ -17,7 +17,7 @@ Imports instat.Translations Public Class dlgView - Private clsBaseOperator As New ROperator + Private clsBaseOperator, clsBaseOperatorView As New ROperator Private bFirstLoad As Boolean = True Private bReset As Boolean = True @@ -109,6 +109,7 @@ Public Class dlgView Private Sub SetDefaults() clsBaseOperator = New ROperator + clsBaseOperatorView = New ROperator clsOutputWindowFunction = New RFunction clsViewColumnsFunction = New RFunction clsHTMLFunction = New RFunction @@ -124,12 +125,34 @@ Public Class dlgView ucrSelectorForView.Reset() ucrReceiverView.SetMeAsReceiver() + clsHeadRFunction.SetPackageName("utils") + clsHeadRFunction.SetRCommand("head") + clsHeadRFunction.AddParameter(strParameterName:="x", strParameterValue:=100, iPosition:=0, bIncludeArgumentName:=False) + clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=1, bIncludeArgumentName:=False) + + clsGtRFunction.SetPackageName("gt") + clsGtRFunction.SetRCommand("gt") + clsBaseOperator.AddParameter(strParameterName:="gt", clsRFunctionParameter:=clsGtRFunction, iPosition:=2, bIncludeArgumentName:=False) + + clsBaseOperator.SetAssignToOutputObject(strRObjectToAssignTo:="last_table", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Table, + strRObjectFormatToAssignTo:=RObjectFormat.Html, + strRDataFrameNameToAddObjectTo:=ucrSelectorForView.strCurrentDataFrame, + strObjectName:="last_table") + + clsDummyFunction.AddParameter("checked", "window", iPosition:=0) clsGetObjectDataFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_object_data") clsGetObjectDataFunction.AddParameter("data_name", Chr(34) & ucrSelectorForView.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) clsGetObjectDataFunction.AddParameter("as_file", "TRUE", iPosition:=2) + clsBaseOperator.SetOperation("%>%") + clsBaseOperator.bBrackets = False + + clsBaseOperatorView.SetOperation("%>%") + + clsOutputWindowFunction.SetPackageName("utils") clsOutputWindowFunction.SetAssignToOutputObject(strRObjectToAssignTo:="last_table", @@ -153,18 +176,6 @@ Public Class dlgView strRDataFrameNameToAddObjectTo:=ucrSelectorForView.strCurrentDataFrame, strObjectName:="last_table") - clsBaseOperator.SetOperation("%>%") - clsBaseOperator.bBrackets = False - - clsHeadRFunction.SetPackageName("utils") - clsHeadRFunction.SetRCommand("head") - clsHeadRFunction.AddParameter(strParameterName:="x", strParameterValue:=100, iPosition:=0, bIncludeArgumentName:=False) - clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=1, bIncludeArgumentName:=False) - - clsGtRFunction.SetPackageName("gt") - clsGtRFunction.SetRCommand("gt") - clsBaseOperator.AddParameter(strParameterName:="gt", clsRFunctionParameter:=clsGtRFunction, iPosition:=2, bIncludeArgumentName:=False) - clsViewColumnsFunction.SetPackageName("utils") clsViewColumnsFunction.SetRCommand("View") @@ -172,7 +183,9 @@ Public Class dlgView clsViewAllFunction.SetRCommand("View") clsViewAllFunction.AddParameter("x", clsRFunctionParameter:=ucrSelectorForView.ucrAvailableDataFrames.clsCurrDataFrame, iPosition:=0) + ucrBase.clsRsyntax.SetBaseRFunction(clsViewAllFunction) + ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) End Sub Private Sub SetRCodeForControls(bReset As Boolean) @@ -181,17 +194,18 @@ Public Class dlgView 'Correct maximum is then set in DataFrameLength() ucrNudNumberRows.Maximum = Decimal.MaxValue - ucrViewChkPreview.SetRCode(clsBaseOperator, bReset) + 'ucrReceiverView.AddAdditionalCodeParameterPair(clsHTMLFunction, New RParameter("mydf"), iAdditionalPairNo:=1) ucrReceiverView.AddAdditionalCodeParameterPair(clsHTMLFunction, New RParameter("x"), iAdditionalPairNo:=1) + ucrReceiverView.AddAdditionalCodeParameterPair(clsBaseOperator, New RParameter("x"), iAdditionalPairNo:=2) - ucrReceiverView.AddAdditionalCodeParameterPair(clsOutputWindowFunction, New RParameter("x"), iAdditionalPairNo:=2) + ucrReceiverView.AddAdditionalCodeParameterPair(clsOutputWindowFunction, New RParameter("x"), iAdditionalPairNo:=3) ucrSelectorForView.AddAdditionalCodeParameterPair(clsViewColumnsFunction, ucrSelectorForView.GetParameter(), iAdditionalPairNo:=1) ucrSaveData.AddAdditionalRCode(clsOutputWindowFunction, iAdditionalPairNo:=1) ucrReceiverView.SetRCode(clsViewColumnsFunction, bReset) ucrPnlDisplayWindow.SetRCode(clsDummyFunction, bReset) - + ucrViewChkPreview.SetRCode(clsBaseOperator, bReset) ucrChkDisplayFromTop.SetRCode(clsOutputWindowFunction, bReset) ucrNudNumberRows.SetRCode(clsOutputWindowFunction, bReset) ucrViewNudPreview.SetRCode(clsHeadRFunction, bReset) @@ -262,16 +276,17 @@ Public Class dlgView ucrSaveData.Visible = False Else If ucrViewChkPreview.Checked Then - clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=1, bIncludeArgumentName:=False) + ucrBase.clsRsyntax.RemoveFromAfterCodes(clsGetObjectDataFunction) + ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) Else - clsBaseOperator.RemoveParameterByName("head") + clsDummyFunction.AddParameter("checked", "html", iPosition:=0) + ucrBase.clsRsyntax.SetBaseRFunction(clsAsHtmlWidgetFunction) + ' ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) + ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) + cmdTableOptions.Visible = True + ucrSaveData.Visible = True + ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) End If - clsDummyFunction.AddParameter("checked", "html", iPosition:=0) - ucrBase.clsRsyntax.SetBaseRFunction(clsAsHtmlWidgetFunction) - ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) - cmdTableOptions.Visible = True - ucrSaveData.Visible = True - ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) End If End Sub @@ -279,6 +294,14 @@ Public Class dlgView ucrNudNumberRows.Maximum = ucrSelectorForView.ucrAvailableDataFrames.iDataFrameLength End Sub + Private Sub ucrViewChkPreview_Load(sender As Object, e As EventArgs) Handles ucrViewChkPreview.Load + If ucrViewChkPreview.Checked Then + clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=1, bIncludeArgumentName:=False) + Else + clsBaseOperator.RemoveParameterByName("head") + End If + End Sub + Private Sub FunctionControls_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrViewChkPreview.ControlValueChanged, ucrViewNudPreview.ControlValueChanged, ucrChkDisplayFromTop.ControlValueChanged, ucrPnlDisplayWindow.ControlValueChanged, ucrReceiverView.ControlValueChanged If bControlsUpdated Then ChangeFunctionParameters() From 558a895454f822d846fde2da7f887ab3a1b45d89 Mon Sep 17 00:00:00 2001 From: Fidel365 <107605960+Fidel365@users.noreply.github.com> Date: Wed, 23 Oct 2024 17:10:58 +0300 Subject: [PATCH 10/22] rows --- instat/dlgView.vb | 146 ++++++++++++++++++++++++++++------------------ 1 file changed, 88 insertions(+), 58 deletions(-) diff --git a/instat/dlgView.vb b/instat/dlgView.vb index 788ebc4e394..47d17a40b4f 100644 --- a/instat/dlgView.vb +++ b/instat/dlgView.vb @@ -14,6 +14,7 @@ ' You should have received a copy of the GNU General Public License ' along with this program. If not, see . +Imports System.Windows Imports instat.Translations Public Class dlgView @@ -21,7 +22,7 @@ Public Class dlgView Private bFirstLoad As Boolean = True Private bReset As Boolean = True - Private clsHeadRFunction, clsGtRFunction, clsOutputWindowFunction, clsHTMLFunction, clsAsHtmlWidgetFunction, clsViewColumnsFunction, clsDummyFunction, clsGetObjectDataFunction, clsViewAllFunction As New RFunction + Private clsHeadRFunction, clsGtRFunction, clsOutputWindowFunction, clsHTMLFunction, clsAsHtmlWidgetFunction, clsViewColumnsFunction, clsDummyFunction, clsGetObjectDataFunction As New RFunction Private bControlsUpdated As Boolean = False Private Sub dlgView_Load(sender As Object, e As EventArgs) Handles MyBase.Load @@ -43,7 +44,10 @@ Public Class dlgView 'Needed because window may pop up window which will disappear in a separate thread ucrBase.clsRsyntax.bSeparateThread = False - ucrReceiverView.SetParameter(New RParameter("x", 0)) + ' ucrReceiverView.SetParameter(New RParameter("x", 0)) + ucrReceiverView.SetParameter(New RParameter("df_columns_to_use_param", 0, bNewIncludeArgumentName:=False)) + + ucrReceiverView.SetParameterIsRFunction() ucrReceiverView.Selector = ucrSelectorForView ucrReceiverView.bForceAsDataFrame = True @@ -60,9 +64,16 @@ Public Class dlgView ucrPnlDisplayWindow.AddToLinkedControls(ucrViewChkPreview, {rdoHTMLOutputWindow}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True) ucrNudNumberRows.SetParameter(New RParameter("n", 1)) - ucrNudNumberRows.Minimum = 1 + ' ucrNudNumberRows.Minimum = 1 ucrChkRowNumbers.SetText("Rows") - ucrChkRowNumbers.AddToLinkedControls(ucrNudNumberRows, {True}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=6) + ' ucrChkRowNumbers.AddToLinkedControls(ucrNudNumberRows, {True}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True) + + ucrChkRowNumbers.AddToLinkedControls(ucrNudNumberRows, {True}, bNewLinkedHideIfParameterMissing:=True) + + ' ucrViewNudPreview.SetParameter(New RParameter("x", 0, bNewIncludeArgumentName:=False)) + ' ucrViewNudPreview.Minimum = 6 + 'ucrViewNudPreview.Maximum = Decimal.MaxValue + ucrNudNumberRows.SetRDefault(6) ucrChkDisplayFromTop.SetText("Display From Top") ucrChkDisplayFromTop.AddFunctionNamesCondition(True, {"head", "tail"}) @@ -109,11 +120,11 @@ Public Class dlgView Private Sub SetDefaults() clsBaseOperator = New ROperator - clsBaseOperatorView = New ROperator + 'clsBaseOperatorView = New ROperator clsOutputWindowFunction = New RFunction clsViewColumnsFunction = New RFunction clsHTMLFunction = New RFunction - clsViewAllFunction = New RFunction + ' clsViewAllFunction = New RFunction clsGetObjectDataFunction = New RFunction clsHeadRFunction = New RFunction clsGtRFunction = New RFunction @@ -125,34 +136,12 @@ Public Class dlgView ucrSelectorForView.Reset() ucrReceiverView.SetMeAsReceiver() - clsHeadRFunction.SetPackageName("utils") - clsHeadRFunction.SetRCommand("head") - clsHeadRFunction.AddParameter(strParameterName:="x", strParameterValue:=100, iPosition:=0, bIncludeArgumentName:=False) - clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=1, bIncludeArgumentName:=False) - - clsGtRFunction.SetPackageName("gt") - clsGtRFunction.SetRCommand("gt") - clsBaseOperator.AddParameter(strParameterName:="gt", clsRFunctionParameter:=clsGtRFunction, iPosition:=2, bIncludeArgumentName:=False) - - clsBaseOperator.SetAssignToOutputObject(strRObjectToAssignTo:="last_table", - strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Table, - strRObjectFormatToAssignTo:=RObjectFormat.Html, - strRDataFrameNameToAddObjectTo:=ucrSelectorForView.strCurrentDataFrame, - strObjectName:="last_table") - - clsDummyFunction.AddParameter("checked", "window", iPosition:=0) clsGetObjectDataFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_object_data") clsGetObjectDataFunction.AddParameter("data_name", Chr(34) & ucrSelectorForView.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) clsGetObjectDataFunction.AddParameter("as_file", "TRUE", iPosition:=2) - clsBaseOperator.SetOperation("%>%") - clsBaseOperator.bBrackets = False - - clsBaseOperatorView.SetOperation("%>%") - - clsOutputWindowFunction.SetPackageName("utils") clsOutputWindowFunction.SetAssignToOutputObject(strRObjectToAssignTo:="last_table", @@ -179,12 +168,30 @@ Public Class dlgView clsViewColumnsFunction.SetPackageName("utils") clsViewColumnsFunction.SetRCommand("View") - clsViewAllFunction.SetPackageName("utils") - clsViewAllFunction.SetRCommand("View") - clsViewAllFunction.AddParameter("x", clsRFunctionParameter:=ucrSelectorForView.ucrAvailableDataFrames.clsCurrDataFrame, iPosition:=0) + 'clsViewAllFunction.SetPackageName("utils") + 'clsViewAllFunction.SetRCommand("View") + 'clsViewAllFunction.AddParameter("x", clsRFunctionParameter:=ucrSelectorForView.ucrAvailableDataFrames.clsCurrDataFrame, iPosition:=0) + + clsBaseOperator.SetOperation("%>%") + clsBaseOperator.bBrackets = False + clsHeadRFunction.SetPackageName("utils") + clsHeadRFunction.SetRCommand("head") + clsHeadRFunction.AddParameter(strParameterName:="x", strParameterValue:=6, iPosition:=1, bIncludeArgumentName:=False) + clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=2, bIncludeArgumentName:=False) - ucrBase.clsRsyntax.SetBaseRFunction(clsViewAllFunction) + clsGtRFunction.SetPackageName("gt") + clsGtRFunction.SetRCommand("gt") + clsBaseOperator.AddParameter(strParameterName:="gt", clsRFunctionParameter:=clsGtRFunction, iPosition:=3, bIncludeArgumentName:=False) + + clsBaseOperator.SetAssignToOutputObject(strRObjectToAssignTo:="last_table", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Table, + strRObjectFormatToAssignTo:=RObjectFormat.Html, + strRDataFrameNameToAddObjectTo:=ucrSelectorForView.strCurrentDataFrame, + strObjectName:="last_table") + + + ' ucrBase.clsRsyntax.SetBaseRFunction(clsViewAllFunction) ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) End Sub @@ -197,9 +204,9 @@ Public Class dlgView 'ucrReceiverView.AddAdditionalCodeParameterPair(clsHTMLFunction, New RParameter("mydf"), iAdditionalPairNo:=1) ucrReceiverView.AddAdditionalCodeParameterPair(clsHTMLFunction, New RParameter("x"), iAdditionalPairNo:=1) - ucrReceiverView.AddAdditionalCodeParameterPair(clsBaseOperator, New RParameter("x"), iAdditionalPairNo:=2) + ucrReceiverView.AddAdditionalCodeParameterPair(clsOutputWindowFunction, New RParameter("x"), iAdditionalPairNo:=2) + ucrReceiverView.AddAdditionalCodeParameterPair(clsBaseOperator, New RParameter("x"), iAdditionalPairNo:=3) - ucrReceiverView.AddAdditionalCodeParameterPair(clsOutputWindowFunction, New RParameter("x"), iAdditionalPairNo:=3) ucrSelectorForView.AddAdditionalCodeParameterPair(clsViewColumnsFunction, ucrSelectorForView.GetParameter(), iAdditionalPairNo:=1) ucrSaveData.AddAdditionalRCode(clsOutputWindowFunction, iAdditionalPairNo:=1) @@ -209,7 +216,7 @@ Public Class dlgView ucrChkDisplayFromTop.SetRCode(clsOutputWindowFunction, bReset) ucrNudNumberRows.SetRCode(clsOutputWindowFunction, bReset) ucrViewNudPreview.SetRCode(clsHeadRFunction, bReset) - ucrSelectorForView.SetRCode(clsViewAllFunction, bReset) + 'ucrSelectorForView.SetRCode(clsViewAllFunction, bReset) ucrSaveData.SetRCode(clsAsHtmlWidgetFunction, bReset) DataFrameLength() @@ -217,28 +224,33 @@ Public Class dlgView bControlsUpdated = True End Sub - Private Sub SetSelectorParameterType() - clsViewAllFunction.AddParameter("x", clsRFunctionParameter:=ucrSelectorForView.ucrAvailableDataFrames.clsCurrDataFrame, iPosition:=0) - End Sub + 'Private Sub SetSelectorParameterType() + ' clsViewAllFunction.AddParameter("x", clsRFunctionParameter:=ucrSelectorForView.ucrAvailableDataFrames.clsCurrDataFrame, iPosition:=0) + 'End Sub Private Sub TestOKEnabled() If Not ucrReceiverView.IsEmpty Then If rdoDispSepOutputWindow.Checked Then ucrBase.OKEnabled(True) ElseIf rdoDispOutputWindow.Checked Then - If ucrNudNumberRows.GetText <> "" OrElse ucrChkDisplayFromTop.Checked Then - ucrBase.OKEnabled(True) - Else - ucrBase.OKEnabled(False) - End If + ucrBase.OKEnabled(True) + 'If ucrNudNumberRows.GetText <> "" OrElse ucrChkDisplayFromTop.Checked Then + ' ucrBase.OKEnabled(True) + ' Else + ' ucrBase.OKEnabled(False) + ' End If Else ucrBase.OKEnabled(True) + 'If rdoHTMLOutputWindow.Checked AndAlso ((ucrChkSortColumn.Checked AndAlso Not ucrReceiverSortCol.IsEmpty) OrElse Not ucrChkSortColumn.Checked) Then + ' ucrBase.OKEnabled(True) + 'Else + ' ucrBase.OKEnabled(False) + 'End If End If - ElseIf rdoHTMLOutputWindow.Checked AndAlso ((ucrChkSortColumn.Checked AndAlso Not ucrReceiverSortCol.IsEmpty) OrElse Not ucrChkSortColumn.Checked) Then - ucrBase.OKEnabled(True) Else ucrBase.OKEnabled(False) End If + End Sub Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset @@ -259,13 +271,16 @@ Public Class dlgView ucrBase.clsRsyntax.SetBaseRFunction(clsOutputWindowFunction) ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Text) ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) - If ucrChkDisplayFromTop.Checked Then + If Not ucrChkRowNumbers.Checked Then + cmdTableOptions.Visible = True + ucrNudNumberRows.Maximum = ucrSelectorForView.ucrAvailableDataFrames.iDataFrameLength + ElseIf ucrChkDisplayFromTop.Checked Then clsOutputWindowFunction.SetRCommand("head") Else clsOutputWindowFunction.SetRCommand("tail") - End If - Else - ucrBase.clsRsyntax.SetBaseRFunction(ucrReceiverView.GetVariables(True)) + End If + Else + ucrBase.clsRsyntax.SetBaseRFunction(ucrReceiverView.GetVariables(True)) End If ElseIf rdoDispSepOutputWindow.Checked Then clsDummyFunction.AddParameter("checked", "viewer", iPosition:=0) @@ -275,17 +290,19 @@ Public Class dlgView cmdTableOptions.Visible = False ucrSaveData.Visible = False Else + clsDummyFunction.AddParameter("checked", "html", iPosition:=0) + ucrBase.clsRsyntax.SetBaseRFunction(clsAsHtmlWidgetFunction) + ' ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) + ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) + cmdTableOptions.Visible = True + ucrSaveData.Visible = True + ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) If ucrViewChkPreview.Checked Then + ucrReceiverView.bForceAsDataFrame = False ucrBase.clsRsyntax.RemoveFromAfterCodes(clsGetObjectDataFunction) ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) - Else - clsDummyFunction.AddParameter("checked", "html", iPosition:=0) - ucrBase.clsRsyntax.SetBaseRFunction(clsAsHtmlWidgetFunction) - ' ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) - ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) - cmdTableOptions.Visible = True - ucrSaveData.Visible = True ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) + ' ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) End If End If End Sub @@ -296,12 +313,21 @@ Public Class dlgView Private Sub ucrViewChkPreview_Load(sender As Object, e As EventArgs) Handles ucrViewChkPreview.Load If ucrViewChkPreview.Checked Then - clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=1, bIncludeArgumentName:=False) + clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=2, bIncludeArgumentName:=False) Else clsBaseOperator.RemoveParameterByName("head") End If End Sub + 'Private Sub ucrChkRowNumbers_Load(sender As Object, e As EventArgs) Handles ucrChkRowNumbers.Load + ' If ucrViewChkPreview.Checked Then + ' ucrNudNumberRows.AddParameter("n", iPosition:=1, bIncludeArgumentName:=False) + ' Else + ' ucr.RemoveParameterByName("n") + ' ' clsAsHtmlWidgetFunctionlsViewAllFunction.AddParameter("x", clsRFunctionParameter:=ucrSelectorForView.ucrAvailableDataFrames.clsCurrDataFrame, iPosition:=0) + ' End If + 'End Sub + Private Sub FunctionControls_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrViewChkPreview.ControlValueChanged, ucrViewNudPreview.ControlValueChanged, ucrChkDisplayFromTop.ControlValueChanged, ucrPnlDisplayWindow.ControlValueChanged, ucrReceiverView.ControlValueChanged If bControlsUpdated Then ChangeFunctionParameters() @@ -329,7 +355,7 @@ Public Class dlgView Private Sub ucrSelectorForView_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectorForView.ControlValueChanged DataFrameLength() - SetSelectorParameterType() + 'SetSelectorParameterType() End Sub Private Sub cmdTableOptions_Click(sender As Object, e As EventArgs) Handles cmdTableOptions.Click @@ -357,6 +383,10 @@ Public Class dlgView clsOutputWindowFunction.SetRCommand("head") Dim strPrefix As String = clsAsHtmlWidgetFunction.GetRObjectToAssignTo clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=1) + If ucrViewChkPreview.Checked Then + strPrefix = clsBaseOperator.GetRObjectToAssignTo + clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=1) + End If End If End Sub From 925839d87792ce61e2fe44f6be5cc6fd9e39eb42 Mon Sep 17 00:00:00 2001 From: Fidel365 <107605960+Fidel365@users.noreply.github.com> Date: Mon, 28 Oct 2024 14:08:41 +0300 Subject: [PATCH 11/22] changesv --- instat/dlgView.vb | 192 ++++++++++++++++++++++++++++------------------ 1 file changed, 116 insertions(+), 76 deletions(-) diff --git a/instat/dlgView.vb b/instat/dlgView.vb index 47d17a40b4f..b5a8c77071d 100644 --- a/instat/dlgView.vb +++ b/instat/dlgView.vb @@ -18,7 +18,7 @@ Imports System.Windows Imports instat.Translations Public Class dlgView - Private clsBaseOperator, clsBaseOperatorView As New ROperator + Private clsBaseOperator As New ROperator Private bFirstLoad As Boolean = True Private bReset As Boolean = True @@ -45,7 +45,7 @@ Public Class dlgView ucrBase.clsRsyntax.bSeparateThread = False ' ucrReceiverView.SetParameter(New RParameter("x", 0)) - ucrReceiverView.SetParameter(New RParameter("df_columns_to_use_param", 0, bNewIncludeArgumentName:=False)) + ' ucrReceiverView.SetParameter(New RParameter("df_columns_to_use_param", 0, bNewIncludeArgumentName:=False)) ucrReceiverView.SetParameterIsRFunction() @@ -63,7 +63,9 @@ Public Class dlgView ucrPnlDisplayWindow.AddToLinkedControls(ucrChkRowNumbers, {rdoDispOutputWindow}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True) ucrPnlDisplayWindow.AddToLinkedControls(ucrViewChkPreview, {rdoHTMLOutputWindow}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True) + ucrNudNumberRows.SetParameter(New RParameter("n", 1)) + ' ucrNudNumberRows.Minimum = 1 ucrChkRowNumbers.SetText("Rows") ' ucrChkRowNumbers.AddToLinkedControls(ucrNudNumberRows, {True}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True) @@ -106,7 +108,7 @@ Public Class dlgView 'The sort column checkbox and receiver set to be invisible since the method for allowing variables in receiver1 to be strictly the same variables in receiver2 is yet to be implemented. 'ucrChkSortColumn.SetParameter(ucrReceiverSortCol.GetParameter(), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) - ucrSelectorForView.SetParameter(New RParameter("title", 1)) + ' ucrSelectorForView.SetParameter(New RParameter("title", 1)) ucrSelectorForView.SetParameterIsString() ucrSaveData.SetCheckBoxText("Store Data") @@ -116,6 +118,7 @@ Public Class dlgView ucrSaveData.SetIsComboBox() ucrSaveData.SetAssignToIfUncheckedValue("last_table") + ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False End Sub Private Sub SetDefaults() @@ -123,7 +126,7 @@ Public Class dlgView 'clsBaseOperatorView = New ROperator clsOutputWindowFunction = New RFunction clsViewColumnsFunction = New RFunction - clsHTMLFunction = New RFunction + ' clsHTMLFunction = New RFunction ' clsViewAllFunction = New RFunction clsGetObjectDataFunction = New RFunction clsHeadRFunction = New RFunction @@ -150,49 +153,29 @@ Public Class dlgView strRDataFrameNameToAddObjectTo:=ucrSelectorForView.strCurrentDataFrame, strObjectName:="last_table") - - clsHTMLFunction.SetPackageName("formattable") - clsHTMLFunction.SetRCommand("formattable") - clsHTMLFunction.AddParameter("align", Chr(34) & "l" & Chr(34), iPosition:=1) - - - clsAsHtmlWidgetFunction.SetPackageName("formattable") - clsAsHtmlWidgetFunction.SetRCommand("as.htmlwidget") - clsAsHtmlWidgetFunction.AddParameter("x", clsRFunctionParameter:=clsHTMLFunction, iPosition:=0) - clsAsHtmlWidgetFunction.SetAssignToOutputObject(strRObjectToAssignTo:="last_table", - strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Table, - strRObjectFormatToAssignTo:=RObjectFormat.Html, - strRDataFrameNameToAddObjectTo:=ucrSelectorForView.strCurrentDataFrame, - strObjectName:="last_table") - - clsViewColumnsFunction.SetPackageName("utils") - clsViewColumnsFunction.SetRCommand("View") - 'clsViewAllFunction.SetPackageName("utils") 'clsViewAllFunction.SetRCommand("View") 'clsViewAllFunction.AddParameter("x", clsRFunctionParameter:=ucrSelectorForView.ucrAvailableDataFrames.clsCurrDataFrame, iPosition:=0) + 'ucrReceiverView.AddAdditionalCodeParameterPair(clsBaseOperator, New RParameter("x"), iAdditionalPairNo:=1) + 'ucrSelectorForView.AddAdditionalCodeParameterPair(clsBaseOperator, ucrSelectorForView.GetParameter(), iAdditionalPairNo:=1) + 'ucrSaveData.AddAdditionalRCode(clsBaseOperator, iAdditionalPairNo:=1) + 'clsBaseOperator.SetOperation("%>%") + 'clsBaseOperator.bBrackets = False - clsBaseOperator.SetOperation("%>%") - clsBaseOperator.bBrackets = False - - clsHeadRFunction.SetPackageName("utils") - clsHeadRFunction.SetRCommand("head") - clsHeadRFunction.AddParameter(strParameterName:="x", strParameterValue:=6, iPosition:=1, bIncludeArgumentName:=False) - clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=2, bIncludeArgumentName:=False) + 'clsHeadRFunction.SetPackageName("utils") + 'clsHeadRFunction.SetRCommand("head") + 'clsHeadRFunction.AddParameter(strParameterName:="x", strParameterValue:=6, iPosition:=3, bIncludeArgumentName:=False) + 'clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=4, bIncludeArgumentName:=False) - clsGtRFunction.SetPackageName("gt") - clsGtRFunction.SetRCommand("gt") - clsBaseOperator.AddParameter(strParameterName:="gt", clsRFunctionParameter:=clsGtRFunction, iPosition:=3, bIncludeArgumentName:=False) + 'clsGtRFunction.SetPackageName("gt") + 'clsGtRFunction.SetRCommand("gt") + 'clsBaseOperator.AddParameter(strParameterName:="gt", clsRFunctionParameter:=clsGtRFunction, iPosition:=5, bIncludeArgumentName:=False) - clsBaseOperator.SetAssignToOutputObject(strRObjectToAssignTo:="last_table", - strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Table, - strRObjectFormatToAssignTo:=RObjectFormat.Html, - strRDataFrameNameToAddObjectTo:=ucrSelectorForView.strCurrentDataFrame, - strObjectName:="last_table") - - ' ucrBase.clsRsyntax.SetBaseRFunction(clsViewAllFunction) - ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) + clsViewColumnsFunction.SetPackageName("utils") + clsViewColumnsFunction.SetRCommand("View") + ' ucrBase.clsRsyntax.SetBaseRFunction(clsViewAllFunction) + ' ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) End Sub Private Sub SetRCodeForControls(bReset As Boolean) @@ -203,20 +186,24 @@ Public Class dlgView 'ucrReceiverView.AddAdditionalCodeParameterPair(clsHTMLFunction, New RParameter("mydf"), iAdditionalPairNo:=1) - ucrReceiverView.AddAdditionalCodeParameterPair(clsHTMLFunction, New RParameter("x"), iAdditionalPairNo:=1) - ucrReceiverView.AddAdditionalCodeParameterPair(clsOutputWindowFunction, New RParameter("x"), iAdditionalPairNo:=2) - ucrReceiverView.AddAdditionalCodeParameterPair(clsBaseOperator, New RParameter("x"), iAdditionalPairNo:=3) + ' ucrReceiverView.AddAdditionalCodeParameterPair(clsHTMLFunction, New RParameter("x"), iAdditionalPairNo:=1) - ucrSelectorForView.AddAdditionalCodeParameterPair(clsViewColumnsFunction, ucrSelectorForView.GetParameter(), iAdditionalPairNo:=1) + ucrReceiverView.AddAdditionalCodeParameterPair(clsOutputWindowFunction, New RParameter("x"), iAdditionalPairNo:=1) + ucrSelectorForView.AddAdditionalCodeParameterPair( clsViewColumnsFunction, ucrSelectorForView.GetParameter(), iAdditionalPairNo:=1) ucrSaveData.AddAdditionalRCode(clsOutputWindowFunction, iAdditionalPairNo:=1) + 'ucrReceiverView.AddAdditionalCodeParameterPair(clsBaseOperator, New RParameter("operation"), iAdditionalPairNo:=1) + ' ucrSelectorForView.AddAdditionalCodeParameterPair(clsBaseOperator, ucrSelectorForView.GetParameter(), iAdditionalPairNo:=2) + ' ucrReceiverView.AddAdditionalCodeParameterPair(clsBaseOperator, New RParameter("x"), iAdditionalPairNo:=2) + 'ucrSaveData.AddAdditionalRCode(clsBaseOperator, iAdditionalPairNo:=2) + ucrReceiverView.SetRCode(clsViewColumnsFunction, bReset) ucrPnlDisplayWindow.SetRCode(clsDummyFunction, bReset) ucrViewChkPreview.SetRCode(clsBaseOperator, bReset) ucrChkDisplayFromTop.SetRCode(clsOutputWindowFunction, bReset) ucrNudNumberRows.SetRCode(clsOutputWindowFunction, bReset) ucrViewNudPreview.SetRCode(clsHeadRFunction, bReset) - 'ucrSelectorForView.SetRCode(clsViewAllFunction, bReset) + ucrSelectorForView.SetRCode(clsBaseOperator, bReset) ucrSaveData.SetRCode(clsAsHtmlWidgetFunction, bReset) DataFrameLength() @@ -271,16 +258,13 @@ Public Class dlgView ucrBase.clsRsyntax.SetBaseRFunction(clsOutputWindowFunction) ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Text) ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) - If Not ucrChkRowNumbers.Checked Then - cmdTableOptions.Visible = True - ucrNudNumberRows.Maximum = ucrSelectorForView.ucrAvailableDataFrames.iDataFrameLength - ElseIf ucrChkDisplayFromTop.Checked Then + If ucrChkDisplayFromTop.Checked Then clsOutputWindowFunction.SetRCommand("head") Else clsOutputWindowFunction.SetRCommand("tail") - End If - Else - ucrBase.clsRsyntax.SetBaseRFunction(ucrReceiverView.GetVariables(True)) + End If + Else + ucrBase.clsRsyntax.SetBaseRFunction(ucrReceiverView.GetVariables(True)) End If ElseIf rdoDispSepOutputWindow.Checked Then clsDummyFunction.AddParameter("checked", "viewer", iPosition:=0) @@ -290,34 +274,90 @@ Public Class dlgView cmdTableOptions.Visible = False ucrSaveData.Visible = False Else + 'ucrReceiverView.SetParameter(New RParameter("x", 0)) clsDummyFunction.AddParameter("checked", "html", iPosition:=0) - ucrBase.clsRsyntax.SetBaseRFunction(clsAsHtmlWidgetFunction) - ' ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) - ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) + ' ucrReceiverView.SetParameter(New RParameter("x", 0, bNewIncludeArgumentName:=False)) + 'ucrReceiverView.ClearAdditionalCodeParameterPairs() + ucrReceiverView.AddAdditionalCodeParameterPair(clsBaseOperator, New RParameter("operation"), iAdditionalPairNo:=1) + ' ucrReceiverView.AddAdditionalCodeParameterPair(New RParameter("x"), iAdditionalPairNo:=2) + 'ucrReceiverView.AddAdditionalCodeParameterPair("x", +2) + clsBaseOperator.SetOperation("%>%") + clsBaseOperator.bBrackets = False + + clsHeadRFunction.SetPackageName("utils") + clsHeadRFunction.SetRCommand("head") + clsHeadRFunction.AddParameter(strParameterName:="x", strParameterValue:=6, iPosition:=0, bIncludeArgumentName:=False) + clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=1, bIncludeArgumentName:=False) + + clsGtRFunction.SetPackageName("gt") + clsGtRFunction.SetRCommand("gt") + clsBaseOperator.AddParameter(strParameterName:="gt", clsRFunctionParameter:=clsGtRFunction, iPosition:=2, bIncludeArgumentName:=False) + clsBaseOperator.SetAssignToOutputObject(strRObjectToAssignTo:="last_table", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Table, + strRObjectFormatToAssignTo:=RObjectFormat.Html, + strRDataFrameNameToAddObjectTo:=ucrSelectorForView.strCurrentDataFrame, + strObjectName:="last_table") + + + 'ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) + + 'ucrReceiverView.SetParameter(New RParameter("df_columns_to_use_param", 0, bNewIncludeArgumentName:=False)) + ' ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) + 'clsBaseOperator.SetOperation("%>%") + ' clsBaseOperator.bBrackets = False + + ' clsHeadRFunction.SetPackageName("utils") + ' clsHeadRFunction.SetRCommand("head") + 'clsHeadRFunction.AddParameter(strParameterName:="x", strParameterValue:=6, iPosition:=4, bIncludeArgumentName:=False) + 'clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=5, bIncludeArgumentName:=False) + + 'clsGtRFunction.SetPackageName("gt") + ' clsGtRFunction.SetRCommand("gt") + 'clsBaseOperator.AddParameter(strParameterName:="gt", clsRFunctionParameter:=clsGtRFunction, iPosition:=6, bIncludeArgumentName:=False) + 'clsBaseOperator.SetAssignToOutputObject(strRObjectToAssignTo:="last_table", + ' strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Table, + ' strRObjectFormatToAssignTo:=RObjectFormat.Html, + ' strRDataFrameNameToAddObjectTo:=ucrSelectorForView.strCurrentDataFrame, + ' strObjectName:="last_table") + cmdTableOptions.Visible = True ucrSaveData.Visible = True - ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) - If ucrViewChkPreview.Checked Then - ucrReceiverView.bForceAsDataFrame = False - ucrBase.clsRsyntax.RemoveFromAfterCodes(clsGetObjectDataFunction) - ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) - ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) - ' ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) - End If + + + ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) + 'If ucrViewChkPreview.Checked Then + ' clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=1, bIncludeArgumentName:=False) + 'Else + ' clsBaseOperator.RemoveParameterByName("head") + 'End If End If + + ' ucrBase.clsRsyntax.SetBaseRFunction(clsAsHtmlWidgetFunction) + ' ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) + + + 'If ucrViewChkPreview.Checked Then + ' ucrReceiverView.bForceAsDataFrame = False + ' ucrBase.clsRsyntax.RemoveFromAfterCodes(clsGetObjectDataFunction) + ' ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) + ' ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) + ' ' ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) + 'End If + End Sub Private Sub DataFrameLength() ucrNudNumberRows.Maximum = ucrSelectorForView.ucrAvailableDataFrames.iDataFrameLength End Sub - Private Sub ucrViewChkPreview_Load(sender As Object, e As EventArgs) Handles ucrViewChkPreview.Load - If ucrViewChkPreview.Checked Then - clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=2, bIncludeArgumentName:=False) - Else - clsBaseOperator.RemoveParameterByName("head") - End If - End Sub + 'Private Sub ucrViewChkPreview_Load(sender As Object, e As EventArgs) Handles ucrViewChkPreview.Load + ' If ucrViewChkPreview.Checked Then + ' clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=2, bIncludeArgumentName:=False) + ' Else + ' clsBaseOperator.RemoveParameterByName("head") + ' End If + 'End Sub 'Private Sub ucrChkRowNumbers_Load(sender As Object, e As EventArgs) Handles ucrChkRowNumbers.Load ' If ucrViewChkPreview.Checked Then @@ -380,13 +420,13 @@ Public Class dlgView Dim strPrefix As String = clsOutputWindowFunction.GetRObjectToAssignTo 'If(ucrSaveData.GetText <> "", ucrSaveData.GetText, "last_table") clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=1) ElseIf rdoHTMLOutputWindow.Checked Then - clsOutputWindowFunction.SetRCommand("head") - Dim strPrefix As String = clsAsHtmlWidgetFunction.GetRObjectToAssignTo + ' clsOutputWindowFunction.SetRCommand("head") + Dim strPrefix As String = clsBaseOperator.GetRObjectToAssignTo clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=1) - If ucrViewChkPreview.Checked Then - strPrefix = clsBaseOperator.GetRObjectToAssignTo - clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=1) - End If + 'If ucrViewChkPreview.Checked Then + ' strPrefix = clsBaseOperator.GetRObjectToAssignTo + ' clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=1) + 'End If End If End Sub From f8102f431a943dc95794a2d31f6561788793838d Mon Sep 17 00:00:00 2001 From: Fidel365 <107605960+Fidel365@users.noreply.github.com> Date: Mon, 28 Oct 2024 18:46:07 +0300 Subject: [PATCH 12/22] changes --- instat/dlgView.Designer.vb | 80 ++++++++--------- instat/dlgView.vb | 180 ++++++------------------------------- 2 files changed, 66 insertions(+), 194 deletions(-) diff --git a/instat/dlgView.Designer.vb b/instat/dlgView.Designer.vb index 701924ad824..33a1f42d8ad 100644 --- a/instat/dlgView.Designer.vb +++ b/instat/dlgView.Designer.vb @@ -43,10 +43,7 @@ Partial Class dlgView Me.rdoDispOutputWindow = New System.Windows.Forms.RadioButton() Me.rdoHTMLOutputWindow = New System.Windows.Forms.RadioButton() Me.cmdTableOptions = New System.Windows.Forms.Button() - Me.ucrViewNudPreview = New instat.ucrNud() - Me.ucrViewChkPreview = New instat.ucrCheck() Me.ucrChkDisplayFromTop = New instat.ucrCheck() - Me.ucrChkRowNumbers = New instat.ucrCheck() Me.ucrSaveData = New instat.ucrSave() Me.ucrReceiverSortCol = New instat.ucrReceiverSingle() Me.ucrChkSortColumn = New instat.ucrCheck() @@ -55,6 +52,9 @@ Partial Class dlgView Me.ucrReceiverView = New instat.ucrReceiverMultiple() Me.ucrSelectorForView = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrBase = New instat.ucrButtons() + Me.ucrViewChkPreview = New instat.ucrCheck() + Me.ucrChkRowNumbers = New instat.ucrCheck() + Me.ucrViewNudPreview = New instat.ucrNud() Me.SuspendLayout() ' 'lblSelected @@ -110,30 +110,6 @@ Partial Class dlgView Me.cmdTableOptions.Text = "Table Options" Me.cmdTableOptions.UseVisualStyleBackColor = True ' - 'ucrViewNudPreview - ' - Me.ucrViewNudPreview.AutoSize = True - Me.ucrViewNudPreview.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrViewNudPreview.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrViewNudPreview.Location = New System.Drawing.Point(343, 167) - Me.ucrViewNudPreview.Margin = New System.Windows.Forms.Padding(6) - Me.ucrViewNudPreview.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrViewNudPreview.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrViewNudPreview.Name = "ucrViewNudPreview" - Me.ucrViewNudPreview.Size = New System.Drawing.Size(50, 20) - Me.ucrViewNudPreview.TabIndex = 33 - Me.ucrViewNudPreview.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrViewChkPreview - ' - Me.ucrViewChkPreview.AutoSize = True - Me.ucrViewChkPreview.Checked = False - Me.ucrViewChkPreview.Location = New System.Drawing.Point(248, 167) - Me.ucrViewChkPreview.Margin = New System.Windows.Forms.Padding(6) - Me.ucrViewChkPreview.Name = "ucrViewChkPreview" - Me.ucrViewChkPreview.Size = New System.Drawing.Size(89, 23) - Me.ucrViewChkPreview.TabIndex = 32 - ' 'ucrChkDisplayFromTop ' Me.ucrChkDisplayFromTop.AutoSize = True @@ -143,15 +119,6 @@ Partial Class dlgView Me.ucrChkDisplayFromTop.Size = New System.Drawing.Size(130, 23) Me.ucrChkDisplayFromTop.TabIndex = 20 ' - 'ucrChkRowNumbers - ' - Me.ucrChkRowNumbers.AutoSize = True - Me.ucrChkRowNumbers.Checked = False - Me.ucrChkRowNumbers.Location = New System.Drawing.Point(248, 167) - Me.ucrChkRowNumbers.Name = "ucrChkRowNumbers" - Me.ucrChkRowNumbers.Size = New System.Drawing.Size(89, 23) - Me.ucrChkRowNumbers.TabIndex = 19 - ' 'ucrSaveData ' Me.ucrSaveData.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink @@ -190,11 +157,11 @@ Partial Class dlgView Me.ucrNudNumberRows.Increment = New Decimal(New Integer() {1, 0, 0, 0}) Me.ucrNudNumberRows.Location = New System.Drawing.Point(343, 167) Me.ucrNudNumberRows.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudNumberRows.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudNumberRows.Minimum = New Decimal(New Integer() {100, 0, 0, -2147483648}) Me.ucrNudNumberRows.Name = "ucrNudNumberRows" Me.ucrNudNumberRows.Size = New System.Drawing.Size(50, 20) Me.ucrNudNumberRows.TabIndex = 13 - Me.ucrNudNumberRows.Value = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudNumberRows.Value = New Decimal(New Integer() {6, 0, 0, 0}) ' 'ucrPnlDisplayWindow ' @@ -238,20 +205,51 @@ Partial Class dlgView Me.ucrBase.Size = New System.Drawing.Size(408, 52) Me.ucrBase.TabIndex = 17 ' + 'ucrViewChkPreview + ' + Me.ucrViewChkPreview.AutoSize = True + Me.ucrViewChkPreview.Checked = False + Me.ucrViewChkPreview.Location = New System.Drawing.Point(248, 167) + Me.ucrViewChkPreview.Margin = New System.Windows.Forms.Padding(6) + Me.ucrViewChkPreview.Name = "ucrViewChkPreview" + Me.ucrViewChkPreview.Size = New System.Drawing.Size(89, 23) + Me.ucrViewChkPreview.TabIndex = 32 + ' + 'ucrChkRowNumbers + ' + Me.ucrChkRowNumbers.AutoSize = True + Me.ucrChkRowNumbers.Checked = False + Me.ucrChkRowNumbers.Location = New System.Drawing.Point(248, 167) + Me.ucrChkRowNumbers.Name = "ucrChkRowNumbers" + Me.ucrChkRowNumbers.Size = New System.Drawing.Size(89, 23) + Me.ucrChkRowNumbers.TabIndex = 19 + ' + 'ucrViewNudPreview + ' + Me.ucrViewNudPreview.AutoSize = True + Me.ucrViewNudPreview.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrViewNudPreview.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrViewNudPreview.Location = New System.Drawing.Point(343, 167) + Me.ucrViewNudPreview.Margin = New System.Windows.Forms.Padding(6) + Me.ucrViewNudPreview.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrViewNudPreview.Minimum = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrViewNudPreview.Name = "ucrViewNudPreview" + Me.ucrViewNudPreview.Size = New System.Drawing.Size(50, 20) + Me.ucrViewNudPreview.TabIndex = 33 + Me.ucrViewNudPreview.Value = New Decimal(New Integer() {1, 0, 0, 0}) + ' 'dlgView ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True Me.ClientSize = New System.Drawing.Size(416, 357) - Me.Controls.Add(Me.ucrViewNudPreview) Me.Controls.Add(Me.cmdTableOptions) Me.Controls.Add(Me.ucrChkDisplayFromTop) Me.Controls.Add(Me.ucrSaveData) Me.Controls.Add(Me.ucrReceiverSortCol) Me.Controls.Add(Me.ucrChkSortColumn) Me.Controls.Add(Me.rdoHTMLOutputWindow) - Me.Controls.Add(Me.ucrNudNumberRows) Me.Controls.Add(Me.rdoDispOutputWindow) Me.Controls.Add(Me.rdoDispSepOutputWindow) Me.Controls.Add(Me.ucrPnlDisplayWindow) @@ -261,6 +259,8 @@ Partial Class dlgView Me.Controls.Add(Me.ucrBase) Me.Controls.Add(Me.ucrViewChkPreview) Me.Controls.Add(Me.ucrChkRowNumbers) + Me.Controls.Add(Me.ucrViewNudPreview) + Me.Controls.Add(Me.ucrNudNumberRows) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.MaximizeBox = False Me.MinimizeBox = False diff --git a/instat/dlgView.vb b/instat/dlgView.vb index b5a8c77071d..02e121d08b9 100644 --- a/instat/dlgView.vb +++ b/instat/dlgView.vb @@ -65,21 +65,14 @@ Public Class dlgView ucrNudNumberRows.SetParameter(New RParameter("n", 1)) + ucrReceiverView.SetParameter(New RParameter("x", 1, bNewIncludeArgumentName:=False)) - ' ucrNudNumberRows.Minimum = 1 ucrChkRowNumbers.SetText("Rows") - ' ucrChkRowNumbers.AddToLinkedControls(ucrNudNumberRows, {True}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True) - ucrChkRowNumbers.AddToLinkedControls(ucrNudNumberRows, {True}, bNewLinkedHideIfParameterMissing:=True) - - ' ucrViewNudPreview.SetParameter(New RParameter("x", 0, bNewIncludeArgumentName:=False)) - ' ucrViewNudPreview.Minimum = 6 - 'ucrViewNudPreview.Maximum = Decimal.MaxValue ucrNudNumberRows.SetRDefault(6) ucrChkDisplayFromTop.SetText("Display From Top") ucrChkDisplayFromTop.AddFunctionNamesCondition(True, {"head", "tail"}) - ucrChkDisplayFromTop.AddFunctionNamesCondition(False, {frmMain.clsRLink.strInstatDataObject & "$get_columns_from_data"}) ucrViewChkPreview.SetText("Rows") ucrViewChkPreview.AddParameterPresentCondition(True, "head", bNewIsPositive:=True) @@ -108,7 +101,6 @@ Public Class dlgView 'The sort column checkbox and receiver set to be invisible since the method for allowing variables in receiver1 to be strictly the same variables in receiver2 is yet to be implemented. 'ucrChkSortColumn.SetParameter(ucrReceiverSortCol.GetParameter(), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) - ' ucrSelectorForView.SetParameter(New RParameter("title", 1)) ucrSelectorForView.SetParameterIsString() ucrSaveData.SetCheckBoxText("Store Data") @@ -123,11 +115,8 @@ Public Class dlgView Private Sub SetDefaults() clsBaseOperator = New ROperator - 'clsBaseOperatorView = New ROperator clsOutputWindowFunction = New RFunction clsViewColumnsFunction = New RFunction - ' clsHTMLFunction = New RFunction - ' clsViewAllFunction = New RFunction clsGetObjectDataFunction = New RFunction clsHeadRFunction = New RFunction clsGtRFunction = New RFunction @@ -135,7 +124,6 @@ Public Class dlgView clsAsHtmlWidgetFunction = New RFunction ucrViewChkPreview.Checked = True - ucrSelectorForView.Reset() ucrReceiverView.SetMeAsReceiver() @@ -153,29 +141,25 @@ Public Class dlgView strRDataFrameNameToAddObjectTo:=ucrSelectorForView.strCurrentDataFrame, strObjectName:="last_table") - 'clsViewAllFunction.SetPackageName("utils") - 'clsViewAllFunction.SetRCommand("View") - 'clsViewAllFunction.AddParameter("x", clsRFunctionParameter:=ucrSelectorForView.ucrAvailableDataFrames.clsCurrDataFrame, iPosition:=0) - 'ucrReceiverView.AddAdditionalCodeParameterPair(clsBaseOperator, New RParameter("x"), iAdditionalPairNo:=1) - 'ucrSelectorForView.AddAdditionalCodeParameterPair(clsBaseOperator, ucrSelectorForView.GetParameter(), iAdditionalPairNo:=1) - 'ucrSaveData.AddAdditionalRCode(clsBaseOperator, iAdditionalPairNo:=1) - 'clsBaseOperator.SetOperation("%>%") - 'clsBaseOperator.bBrackets = False + clsBaseOperator.SetOperation("%>%") + clsBaseOperator.bBrackets = False + clsHeadRFunction.SetPackageName("utils") + clsHeadRFunction.SetRCommand("head") + clsHeadRFunction.AddParameter(strParameterName:="x", strParameterValue:=6, iPosition:=2, bIncludeArgumentName:=False) + clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=3, bIncludeArgumentName:=False) - 'clsHeadRFunction.SetPackageName("utils") - 'clsHeadRFunction.SetRCommand("head") - 'clsHeadRFunction.AddParameter(strParameterName:="x", strParameterValue:=6, iPosition:=3, bIncludeArgumentName:=False) - 'clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=4, bIncludeArgumentName:=False) - - 'clsGtRFunction.SetPackageName("gt") - 'clsGtRFunction.SetRCommand("gt") - 'clsBaseOperator.AddParameter(strParameterName:="gt", clsRFunctionParameter:=clsGtRFunction, iPosition:=5, bIncludeArgumentName:=False) + clsGtRFunction.SetPackageName("gt") + clsGtRFunction.SetRCommand("gt") + clsBaseOperator.AddParameter(strParameterName:="gt", clsRFunctionParameter:=clsGtRFunction, iPosition:=4, bIncludeArgumentName:=False) + clsBaseOperator.SetAssignToOutputObject(strRObjectToAssignTo:="last_table", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Table, + strRObjectFormatToAssignTo:=RObjectFormat.Html, + strRDataFrameNameToAddObjectTo:=ucrSelectorForView.strCurrentDataFrame, + strObjectName:="last_table") clsViewColumnsFunction.SetPackageName("utils") clsViewColumnsFunction.SetRCommand("View") - ' ucrBase.clsRsyntax.SetBaseRFunction(clsViewAllFunction) - ' ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) End Sub Private Sub SetRCodeForControls(bReset As Boolean) @@ -184,55 +168,32 @@ Public Class dlgView 'Correct maximum is then set in DataFrameLength() ucrNudNumberRows.Maximum = Decimal.MaxValue - - 'ucrReceiverView.AddAdditionalCodeParameterPair(clsHTMLFunction, New RParameter("mydf"), iAdditionalPairNo:=1) - ' ucrReceiverView.AddAdditionalCodeParameterPair(clsHTMLFunction, New RParameter("x"), iAdditionalPairNo:=1) - ucrReceiverView.AddAdditionalCodeParameterPair(clsOutputWindowFunction, New RParameter("x"), iAdditionalPairNo:=1) - ucrSelectorForView.AddAdditionalCodeParameterPair( clsViewColumnsFunction, ucrSelectorForView.GetParameter(), iAdditionalPairNo:=1) + ucrSelectorForView.AddAdditionalCodeParameterPair(clsViewColumnsFunction, ucrSelectorForView.GetParameter(), iAdditionalPairNo:=1) ucrSaveData.AddAdditionalRCode(clsOutputWindowFunction, iAdditionalPairNo:=1) - 'ucrReceiverView.AddAdditionalCodeParameterPair(clsBaseOperator, New RParameter("operation"), iAdditionalPairNo:=1) - ' ucrSelectorForView.AddAdditionalCodeParameterPair(clsBaseOperator, ucrSelectorForView.GetParameter(), iAdditionalPairNo:=2) - ' ucrReceiverView.AddAdditionalCodeParameterPair(clsBaseOperator, New RParameter("x"), iAdditionalPairNo:=2) - 'ucrSaveData.AddAdditionalRCode(clsBaseOperator, iAdditionalPairNo:=2) - - ucrReceiverView.SetRCode(clsViewColumnsFunction, bReset) + ucrReceiverView.SetRCode(clsBaseOperator, bReset) ucrPnlDisplayWindow.SetRCode(clsDummyFunction, bReset) ucrViewChkPreview.SetRCode(clsBaseOperator, bReset) ucrChkDisplayFromTop.SetRCode(clsOutputWindowFunction, bReset) ucrNudNumberRows.SetRCode(clsOutputWindowFunction, bReset) ucrViewNudPreview.SetRCode(clsHeadRFunction, bReset) ucrSelectorForView.SetRCode(clsBaseOperator, bReset) - ucrSaveData.SetRCode(clsAsHtmlWidgetFunction, bReset) + ucrSaveData.SetRCode(clsBaseOperator, bReset) DataFrameLength() ChangeFunctionParameters() bControlsUpdated = True End Sub - 'Private Sub SetSelectorParameterType() - ' clsViewAllFunction.AddParameter("x", clsRFunctionParameter:=ucrSelectorForView.ucrAvailableDataFrames.clsCurrDataFrame, iPosition:=0) - 'End Sub - Private Sub TestOKEnabled() If Not ucrReceiverView.IsEmpty Then If rdoDispSepOutputWindow.Checked Then ucrBase.OKEnabled(True) ElseIf rdoDispOutputWindow.Checked Then ucrBase.OKEnabled(True) - 'If ucrNudNumberRows.GetText <> "" OrElse ucrChkDisplayFromTop.Checked Then - ' ucrBase.OKEnabled(True) - ' Else - ' ucrBase.OKEnabled(False) - ' End If Else ucrBase.OKEnabled(True) - 'If rdoHTMLOutputWindow.Checked AndAlso ((ucrChkSortColumn.Checked AndAlso Not ucrReceiverSortCol.IsEmpty) OrElse Not ucrChkSortColumn.Checked) Then - ' ucrBase.OKEnabled(True) - 'Else - ' ucrBase.OKEnabled(False) - 'End If End If Else ucrBase.OKEnabled(False) @@ -274,99 +235,24 @@ Public Class dlgView cmdTableOptions.Visible = False ucrSaveData.Visible = False Else - 'ucrReceiverView.SetParameter(New RParameter("x", 0)) clsDummyFunction.AddParameter("checked", "html", iPosition:=0) - ' ucrReceiverView.SetParameter(New RParameter("x", 0, bNewIncludeArgumentName:=False)) - 'ucrReceiverView.ClearAdditionalCodeParameterPairs() - ucrReceiverView.AddAdditionalCodeParameterPair(clsBaseOperator, New RParameter("operation"), iAdditionalPairNo:=1) - ' ucrReceiverView.AddAdditionalCodeParameterPair(New RParameter("x"), iAdditionalPairNo:=2) - 'ucrReceiverView.AddAdditionalCodeParameterPair("x", -2) - clsBaseOperator.SetOperation("%>%") - clsBaseOperator.bBrackets = False - - clsHeadRFunction.SetPackageName("utils") - clsHeadRFunction.SetRCommand("head") - clsHeadRFunction.AddParameter(strParameterName:="x", strParameterValue:=6, iPosition:=0, bIncludeArgumentName:=False) - clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=1, bIncludeArgumentName:=False) - - clsGtRFunction.SetPackageName("gt") - clsGtRFunction.SetRCommand("gt") - clsBaseOperator.AddParameter(strParameterName:="gt", clsRFunctionParameter:=clsGtRFunction, iPosition:=2, bIncludeArgumentName:=False) - clsBaseOperator.SetAssignToOutputObject(strRObjectToAssignTo:="last_table", - strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Table, - strRObjectFormatToAssignTo:=RObjectFormat.Html, - strRDataFrameNameToAddObjectTo:=ucrSelectorForView.strCurrentDataFrame, - strObjectName:="last_table") - - - 'ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) - - 'ucrReceiverView.SetParameter(New RParameter("df_columns_to_use_param", 0, bNewIncludeArgumentName:=False)) - ' ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) - 'clsBaseOperator.SetOperation("%>%") - ' clsBaseOperator.bBrackets = False - - ' clsHeadRFunction.SetPackageName("utils") - ' clsHeadRFunction.SetRCommand("head") - 'clsHeadRFunction.AddParameter(strParameterName:="x", strParameterValue:=6, iPosition:=4, bIncludeArgumentName:=False) - 'clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=5, bIncludeArgumentName:=False) - - 'clsGtRFunction.SetPackageName("gt") - ' clsGtRFunction.SetRCommand("gt") - 'clsBaseOperator.AddParameter(strParameterName:="gt", clsRFunctionParameter:=clsGtRFunction, iPosition:=6, bIncludeArgumentName:=False) - 'clsBaseOperator.SetAssignToOutputObject(strRObjectToAssignTo:="last_table", - ' strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Table, - ' strRObjectFormatToAssignTo:=RObjectFormat.Html, - ' strRDataFrameNameToAddObjectTo:=ucrSelectorForView.strCurrentDataFrame, - ' strObjectName:="last_table") + + ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) cmdTableOptions.Visible = True ucrSaveData.Visible = True - - - ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) - 'If ucrViewChkPreview.Checked Then - ' clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=1, bIncludeArgumentName:=False) - 'Else - ' clsBaseOperator.RemoveParameterByName("head") - 'End If + If ucrViewChkPreview.Checked Then + clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=1, bIncludeArgumentName:=False) + Else + clsBaseOperator.RemoveParameterByName("head") + End If End If - - ' ucrBase.clsRsyntax.SetBaseRFunction(clsAsHtmlWidgetFunction) - ' ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) - - - 'If ucrViewChkPreview.Checked Then - ' ucrReceiverView.bForceAsDataFrame = False - ' ucrBase.clsRsyntax.RemoveFromAfterCodes(clsGetObjectDataFunction) - ' ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) - ' ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) - ' ' ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) - 'End If - End Sub Private Sub DataFrameLength() ucrNudNumberRows.Maximum = ucrSelectorForView.ucrAvailableDataFrames.iDataFrameLength End Sub - 'Private Sub ucrViewChkPreview_Load(sender As Object, e As EventArgs) Handles ucrViewChkPreview.Load - ' If ucrViewChkPreview.Checked Then - ' clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=2, bIncludeArgumentName:=False) - ' Else - ' clsBaseOperator.RemoveParameterByName("head") - ' End If - 'End Sub - - 'Private Sub ucrChkRowNumbers_Load(sender As Object, e As EventArgs) Handles ucrChkRowNumbers.Load - ' If ucrViewChkPreview.Checked Then - ' ucrNudNumberRows.AddParameter("n", iPosition:=1, bIncludeArgumentName:=False) - ' Else - ' ucr.RemoveParameterByName("n") - ' ' clsAsHtmlWidgetFunctionlsViewAllFunction.AddParameter("x", clsRFunctionParameter:=ucrSelectorForView.ucrAvailableDataFrames.clsCurrDataFrame, iPosition:=0) - ' End If - 'End Sub Private Sub FunctionControls_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrViewChkPreview.ControlValueChanged, ucrViewNudPreview.ControlValueChanged, ucrChkDisplayFromTop.ControlValueChanged, ucrPnlDisplayWindow.ControlValueChanged, ucrReceiverView.ControlValueChanged If bControlsUpdated Then @@ -375,15 +261,6 @@ Public Class dlgView GetObjectName() End Sub - 'Private Sub ucrViewChkPreview_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrViewChkPreview.ControlValueChanged - ' If ucrViewChkPreview.Checked Then - ' clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=1, bIncludeArgumentName:=False) - ' Else - ' clsBaseOperator.RemoveParameterByName("head") - ' End If - 'End Sub - - Private Sub ucrChkSortColumn_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkSortColumn.ControlValueChanged, ucrPnlDisplayWindow.ControlValueChanged 'Not yet implemented 'If rdoHTMLOutputWindow.Checked AndAlso ucrChkSortColumn.Checked Then @@ -393,9 +270,9 @@ Public Class dlgView 'End If End Sub + Private Sub ucrSelectorForView_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectorForView.ControlValueChanged DataFrameLength() - 'SetSelectorParameterType() End Sub Private Sub cmdTableOptions_Click(sender As Object, e As EventArgs) Handles cmdTableOptions.Click @@ -420,13 +297,8 @@ Public Class dlgView Dim strPrefix As String = clsOutputWindowFunction.GetRObjectToAssignTo 'If(ucrSaveData.GetText <> "", ucrSaveData.GetText, "last_table") clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=1) ElseIf rdoHTMLOutputWindow.Checked Then - ' clsOutputWindowFunction.SetRCommand("head") Dim strPrefix As String = clsBaseOperator.GetRObjectToAssignTo clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=1) - 'If ucrViewChkPreview.Checked Then - ' strPrefix = clsBaseOperator.GetRObjectToAssignTo - ' clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=1) - 'End If End If End Sub From 328e2861c8209e226933d26928d0a721859abe24 Mon Sep 17 00:00:00 2001 From: Fidel365 <107605960+Fidel365@users.noreply.github.com> Date: Tue, 29 Oct 2024 06:47:17 +0300 Subject: [PATCH 13/22] changes --- instat/dlgView.vb | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/instat/dlgView.vb b/instat/dlgView.vb index 02e121d08b9..2e6c1fba30c 100644 --- a/instat/dlgView.vb +++ b/instat/dlgView.vb @@ -160,6 +160,8 @@ Public Class dlgView clsViewColumnsFunction.SetPackageName("utils") clsViewColumnsFunction.SetRCommand("View") + + ' ChangeFunctionParameters() End Sub Private Sub SetRCodeForControls(bReset As Boolean) @@ -178,9 +180,19 @@ Public Class dlgView ucrChkDisplayFromTop.SetRCode(clsOutputWindowFunction, bReset) ucrNudNumberRows.SetRCode(clsOutputWindowFunction, bReset) ucrViewNudPreview.SetRCode(clsHeadRFunction, bReset) - ucrSelectorForView.SetRCode(clsBaseOperator, bReset) + ucrSelectorForView.SetRCode(clsViewColumnsFunction, bReset) ucrSaveData.SetRCode(clsBaseOperator, bReset) + 'ucrReceiverView.SetRCode(clsViewColumnsFunction, bReset) + 'ucrPnlDisplayWindow.SetRCode(clsDummyFunction, bReset) + + 'ucrPnlDisplayFrom.SetRCode(clsOutputWindowFunction, bReset) + 'ucrNudNumberRows.SetRCode(clsOutputWindowFunction, bReset) + '' ucrChkSpecifyRows.SetRCode(clsOutputWindowFunction, bReset) + ' ucrSelectorForView.SetRCode(clsViewAllFunction, bReset) + ' ucrPnlViewData.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + ' ucrSaveData.SetRCode(clsAsHtmlWidgetFunction, bReset) + DataFrameLength() ChangeFunctionParameters() bControlsUpdated = True @@ -230,19 +242,18 @@ Public Class dlgView ElseIf rdoDispSepOutputWindow.Checked Then clsDummyFunction.AddParameter("checked", "viewer", iPosition:=0) ucrBase.clsRsyntax.iCallType = 0 + ucrReceiverView.SetRCode(clsViewColumnsFunction, bReset) ucrBase.clsRsyntax.SetBaseRFunction(clsViewColumnsFunction) ucrBase.clsRsyntax.RemoveFromAfterCodes(clsGetObjectDataFunction) cmdTableOptions.Visible = False ucrSaveData.Visible = False Else clsDummyFunction.AddParameter("checked", "html", iPosition:=0) - ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) - cmdTableOptions.Visible = True ucrSaveData.Visible = True If ucrViewChkPreview.Checked Then - clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=1, bIncludeArgumentName:=False) + clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=2, bIncludeArgumentName:=False) Else clsBaseOperator.RemoveParameterByName("head") End If @@ -270,7 +281,6 @@ Public Class dlgView 'End If End Sub - Private Sub ucrSelectorForView_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectorForView.ControlValueChanged DataFrameLength() End Sub @@ -295,10 +305,10 @@ Public Class dlgView Private Sub GetObjectName() If rdoDispOutputWindow.Checked Then Dim strPrefix As String = clsOutputWindowFunction.GetRObjectToAssignTo 'If(ucrSaveData.GetText <> "", ucrSaveData.GetText, "last_table") - clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=1) + clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=0) ElseIf rdoHTMLOutputWindow.Checked Then Dim strPrefix As String = clsBaseOperator.GetRObjectToAssignTo - clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=1) + clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=0) End If End Sub From ad93859b8b6e90e4ac129fea08ec8458a83ef716 Mon Sep 17 00:00:00 2001 From: Fidel365 <107605960+Fidel365@users.noreply.github.com> Date: Tue, 29 Oct 2024 07:17:29 +0300 Subject: [PATCH 14/22] tables --- instat/dlgView.vb | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/instat/dlgView.vb b/instat/dlgView.vb index 2e6c1fba30c..c4a2faaa61d 100644 --- a/instat/dlgView.vb +++ b/instat/dlgView.vb @@ -130,8 +130,8 @@ Public Class dlgView clsDummyFunction.AddParameter("checked", "window", iPosition:=0) clsGetObjectDataFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_object_data") - clsGetObjectDataFunction.AddParameter("data_name", Chr(34) & ucrSelectorForView.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) - clsGetObjectDataFunction.AddParameter("as_file", "TRUE", iPosition:=2) + ' clsGetObjectDataFunction.AddParameter("data_name", Chr(34) & ucrSelectorForView.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) + ' clsGetObjectDataFunction.AddParameter("as_file", "TRUE", iPosition:=2) clsOutputWindowFunction.SetPackageName("utils") @@ -174,6 +174,8 @@ Public Class dlgView ucrSelectorForView.AddAdditionalCodeParameterPair(clsViewColumnsFunction, ucrSelectorForView.GetParameter(), iAdditionalPairNo:=1) ucrSaveData.AddAdditionalRCode(clsOutputWindowFunction, iAdditionalPairNo:=1) + ucrReceiverView.AddAdditionalCodeParameterPair(clsViewColumnsFunction, New RParameter("x"), iAdditionalPairNo:=2) + ucrReceiverView.SetRCode(clsBaseOperator, bReset) ucrPnlDisplayWindow.SetRCode(clsDummyFunction, bReset) ucrViewChkPreview.SetRCode(clsBaseOperator, bReset) @@ -229,8 +231,8 @@ Public Class dlgView If ucrNudNumberRows.GetText <> "" OrElse ucrChkDisplayFromTop.Checked Then ucrBase.clsRsyntax.SetBaseRFunction(clsOutputWindowFunction) - ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Text) - ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) + 'ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Text) + 'ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) If ucrChkDisplayFromTop.Checked Then clsOutputWindowFunction.SetRCommand("head") Else @@ -241,13 +243,15 @@ Public Class dlgView End If ElseIf rdoDispSepOutputWindow.Checked Then clsDummyFunction.AddParameter("checked", "viewer", iPosition:=0) + ucrBase.clsRsyntax.iCallType = 0 - ucrReceiverView.SetRCode(clsViewColumnsFunction, bReset) ucrBase.clsRsyntax.SetBaseRFunction(clsViewColumnsFunction) ucrBase.clsRsyntax.RemoveFromAfterCodes(clsGetObjectDataFunction) + ucrSaveData.Visible = False cmdTableOptions.Visible = False ucrSaveData.Visible = False Else + ucrBase.clsRsyntax.RemoveFromAfterCodes(clsGetObjectDataFunction) clsDummyFunction.AddParameter("checked", "html", iPosition:=0) ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) cmdTableOptions.Visible = True @@ -269,7 +273,7 @@ Public Class dlgView If bControlsUpdated Then ChangeFunctionParameters() End If - GetObjectName() + ' GetObjectName() End Sub Private Sub ucrChkSortColumn_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkSortColumn.ControlValueChanged, ucrPnlDisplayWindow.ControlValueChanged @@ -299,18 +303,18 @@ Public Class dlgView End Sub Private Sub ucrSaveData_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSaveData.ControlValueChanged - GetObjectName() + 'GetObjectName() End Sub - Private Sub GetObjectName() - If rdoDispOutputWindow.Checked Then - Dim strPrefix As String = clsOutputWindowFunction.GetRObjectToAssignTo 'If(ucrSaveData.GetText <> "", ucrSaveData.GetText, "last_table") - clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=0) - ElseIf rdoHTMLOutputWindow.Checked Then - Dim strPrefix As String = clsBaseOperator.GetRObjectToAssignTo - clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=0) - End If - End Sub + 'Private Sub GetObjectName() + ' If rdoDispOutputWindow.Checked Then + ' Dim strPrefix As String = clsOutputWindowFunction.GetRObjectToAssignTo 'If(ucrSaveData.GetText <> "", ucrSaveData.GetText, "last_table") + ' clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=0) + ' ElseIf rdoHTMLOutputWindow.Checked Then + ' Dim strPrefix As String = clsBaseOperator.GetRObjectToAssignTo + ' clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=0) + ' End If + 'End Sub Private Sub ucrSelectorForView_DataFrameChanged() Handles ucrSelectorForView.DataFrameChanged clsGetObjectDataFunction.AddParameter("data_name", Chr(34) & ucrSelectorForView.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) From 6f0def8daac7d6d41625867aef523a27029a9d85 Mon Sep 17 00:00:00 2001 From: Fidel365 <107605960+Fidel365@users.noreply.github.com> Date: Tue, 29 Oct 2024 07:30:27 +0300 Subject: [PATCH 15/22] objectname --- instat/dlgView.vb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/instat/dlgView.vb b/instat/dlgView.vb index c4a2faaa61d..e37587895ed 100644 --- a/instat/dlgView.vb +++ b/instat/dlgView.vb @@ -273,7 +273,7 @@ Public Class dlgView If bControlsUpdated Then ChangeFunctionParameters() End If - ' GetObjectName() + GetObjectName() End Sub Private Sub ucrChkSortColumn_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkSortColumn.ControlValueChanged, ucrPnlDisplayWindow.ControlValueChanged @@ -303,18 +303,18 @@ Public Class dlgView End Sub Private Sub ucrSaveData_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSaveData.ControlValueChanged - 'GetObjectName() + GetObjectName() End Sub - 'Private Sub GetObjectName() - ' If rdoDispOutputWindow.Checked Then - ' Dim strPrefix As String = clsOutputWindowFunction.GetRObjectToAssignTo 'If(ucrSaveData.GetText <> "", ucrSaveData.GetText, "last_table") - ' clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=0) - ' ElseIf rdoHTMLOutputWindow.Checked Then - ' Dim strPrefix As String = clsBaseOperator.GetRObjectToAssignTo - ' clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=0) - ' End If - 'End Sub + Private Sub GetObjectName() + If rdoDispOutputWindow.Checked Then + Dim strPrefix As String = clsOutputWindowFunction.GetRObjectToAssignTo 'If(ucrSaveData.GetText <> "", ucrSaveData.GetText, "last_table") + clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=0) + ElseIf rdoHTMLOutputWindow.Checked Then + Dim strPrefix As String = clsBaseOperator.GetRObjectToAssignTo + clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=0) + End If + End Sub Private Sub ucrSelectorForView_DataFrameChanged() Handles ucrSelectorForView.DataFrameChanged clsGetObjectDataFunction.AddParameter("data_name", Chr(34) & ucrSelectorForView.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) From a920bce96401ab3ac1f556356c526825a46e657e Mon Sep 17 00:00:00 2001 From: Fidel365 <107605960+Fidel365@users.noreply.github.com> Date: Tue, 29 Oct 2024 08:19:23 +0300 Subject: [PATCH 16/22] final --- instat/dlgView.vb | 35 +++++++++-------------------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/instat/dlgView.vb b/instat/dlgView.vb index e37587895ed..72be08db817 100644 --- a/instat/dlgView.vb +++ b/instat/dlgView.vb @@ -44,10 +44,6 @@ Public Class dlgView 'Needed because window may pop up window which will disappear in a separate thread ucrBase.clsRsyntax.bSeparateThread = False - ' ucrReceiverView.SetParameter(New RParameter("x", 0)) - ' ucrReceiverView.SetParameter(New RParameter("df_columns_to_use_param", 0, bNewIncludeArgumentName:=False)) - - ucrReceiverView.SetParameterIsRFunction() ucrReceiverView.Selector = ucrSelectorForView ucrReceiverView.bForceAsDataFrame = True @@ -130,8 +126,8 @@ Public Class dlgView clsDummyFunction.AddParameter("checked", "window", iPosition:=0) clsGetObjectDataFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_object_data") - ' clsGetObjectDataFunction.AddParameter("data_name", Chr(34) & ucrSelectorForView.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) - ' clsGetObjectDataFunction.AddParameter("as_file", "TRUE", iPosition:=2) + clsGetObjectDataFunction.AddParameter("data_name", Chr(34) & ucrSelectorForView.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) + clsGetObjectDataFunction.AddParameter("as_file", "TRUE", iPosition:=2) clsOutputWindowFunction.SetPackageName("utils") @@ -160,8 +156,6 @@ Public Class dlgView clsViewColumnsFunction.SetPackageName("utils") clsViewColumnsFunction.SetRCommand("View") - - ' ChangeFunctionParameters() End Sub Private Sub SetRCodeForControls(bReset As Boolean) @@ -185,16 +179,6 @@ Public Class dlgView ucrSelectorForView.SetRCode(clsViewColumnsFunction, bReset) ucrSaveData.SetRCode(clsBaseOperator, bReset) - 'ucrReceiverView.SetRCode(clsViewColumnsFunction, bReset) - 'ucrPnlDisplayWindow.SetRCode(clsDummyFunction, bReset) - - 'ucrPnlDisplayFrom.SetRCode(clsOutputWindowFunction, bReset) - 'ucrNudNumberRows.SetRCode(clsOutputWindowFunction, bReset) - '' ucrChkSpecifyRows.SetRCode(clsOutputWindowFunction, bReset) - ' ucrSelectorForView.SetRCode(clsViewAllFunction, bReset) - ' ucrPnlViewData.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - ' ucrSaveData.SetRCode(clsAsHtmlWidgetFunction, bReset) - DataFrameLength() ChangeFunctionParameters() bControlsUpdated = True @@ -228,11 +212,11 @@ Public Class dlgView cmdTableOptions.Visible = False ucrSaveData.Visible = True ucrBase.clsRsyntax.iCallType = 2 - + ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Text) + ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) If ucrNudNumberRows.GetText <> "" OrElse ucrChkDisplayFromTop.Checked Then ucrBase.clsRsyntax.SetBaseRFunction(clsOutputWindowFunction) - 'ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Text) - 'ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) + If ucrChkDisplayFromTop.Checked Then clsOutputWindowFunction.SetRCommand("head") Else @@ -243,15 +227,14 @@ Public Class dlgView End If ElseIf rdoDispSepOutputWindow.Checked Then clsDummyFunction.AddParameter("checked", "viewer", iPosition:=0) - + ucrBase.clsRsyntax.RemoveFromAfterCodes(clsGetObjectDataFunction) ucrBase.clsRsyntax.iCallType = 0 ucrBase.clsRsyntax.SetBaseRFunction(clsViewColumnsFunction) - ucrBase.clsRsyntax.RemoveFromAfterCodes(clsGetObjectDataFunction) ucrSaveData.Visible = False cmdTableOptions.Visible = False ucrSaveData.Visible = False Else - ucrBase.clsRsyntax.RemoveFromAfterCodes(clsGetObjectDataFunction) + ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) clsDummyFunction.AddParameter("checked", "html", iPosition:=0) ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) cmdTableOptions.Visible = True @@ -309,10 +292,10 @@ Public Class dlgView Private Sub GetObjectName() If rdoDispOutputWindow.Checked Then Dim strPrefix As String = clsOutputWindowFunction.GetRObjectToAssignTo 'If(ucrSaveData.GetText <> "", ucrSaveData.GetText, "last_table") - clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=0) + clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=1) ElseIf rdoHTMLOutputWindow.Checked Then Dim strPrefix As String = clsBaseOperator.GetRObjectToAssignTo - clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=0) + clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=1) End If End Sub From d51d692a2784a3b76cdb4e47a83ac556fc3d5926 Mon Sep 17 00:00:00 2001 From: Fidel365 <107605960+Fidel365@users.noreply.github.com> Date: Wed, 6 Nov 2024 15:55:05 +0300 Subject: [PATCH 17/22] sub changes --- instat/UserTables/dlgGeneralTable.vb | 2 +- instat/dlgView.vb | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/instat/UserTables/dlgGeneralTable.vb b/instat/UserTables/dlgGeneralTable.vb index d27ad3d3acd..fefc401eee2 100644 --- a/instat/UserTables/dlgGeneralTable.vb +++ b/instat/UserTables/dlgGeneralTable.vb @@ -1,7 +1,7 @@ Imports instat.Translations Public Class dlgGeneralTable - Public clsBaseOperator As New ROperator + Private clsBaseOperator As New ROperator Private clsHeadRFunction, clsGtRFunction As New RFunction Private bFirstload As Boolean = True diff --git a/instat/dlgView.vb b/instat/dlgView.vb index 72be08db817..ff3f2aa8c81 100644 --- a/instat/dlgView.vb +++ b/instat/dlgView.vb @@ -22,7 +22,7 @@ Public Class dlgView Private bFirstLoad As Boolean = True Private bReset As Boolean = True - Private clsHeadRFunction, clsGtRFunction, clsOutputWindowFunction, clsHTMLFunction, clsAsHtmlWidgetFunction, clsViewColumnsFunction, clsDummyFunction, clsGetObjectDataFunction As New RFunction + Private clsHeadRFunction, clsGtRFunction, clsOutputWindowFunction, clsViewColumnsFunction, clsDummyFunction, clsGetObjectDataFunction As New RFunction Private bControlsUpdated As Boolean = False Private Sub dlgView_Load(sender As Object, e As EventArgs) Handles MyBase.Load @@ -117,7 +117,6 @@ Public Class dlgView clsHeadRFunction = New RFunction clsGtRFunction = New RFunction clsDummyFunction = New RFunction - clsAsHtmlWidgetFunction = New RFunction ucrViewChkPreview.Checked = True ucrSelectorForView.Reset() From 8e7efa2945585e900d652b5f98c8b2db92820e9c Mon Sep 17 00:00:00 2001 From: Fidel365 <107605960+Fidel365@users.noreply.github.com> Date: Wed, 13 Nov 2024 14:41:46 +0300 Subject: [PATCH 18/22] table changes --- instat/dlgView.vb | 48 ++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/instat/dlgView.vb b/instat/dlgView.vb index ff3f2aa8c81..6b2d2aed01e 100644 --- a/instat/dlgView.vb +++ b/instat/dlgView.vb @@ -124,9 +124,9 @@ Public Class dlgView clsDummyFunction.AddParameter("checked", "window", iPosition:=0) - clsGetObjectDataFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_object_data") - clsGetObjectDataFunction.AddParameter("data_name", Chr(34) & ucrSelectorForView.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) - clsGetObjectDataFunction.AddParameter("as_file", "TRUE", iPosition:=2) + 'clsGetObjectDataFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_object_data") + 'clsGetObjectDataFunction.AddParameter("data_name", Chr(34) & ucrSelectorForView.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) + 'clsGetObjectDataFunction.AddParameter("as_file", "TRUE", iPosition:=2) clsOutputWindowFunction.SetPackageName("utils") @@ -211,8 +211,9 @@ Public Class dlgView cmdTableOptions.Visible = False ucrSaveData.Visible = True ucrBase.clsRsyntax.iCallType = 2 + ucrBase.clsRsyntax.RemoveFromAfterCodes(clsGetObjectDataFunction) ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Text) - ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) + 'ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) If ucrNudNumberRows.GetText <> "" OrElse ucrChkDisplayFromTop.Checked Then ucrBase.clsRsyntax.SetBaseRFunction(clsOutputWindowFunction) @@ -233,7 +234,8 @@ Public Class dlgView cmdTableOptions.Visible = False ucrSaveData.Visible = False Else - ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) + 'ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) + ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) clsDummyFunction.AddParameter("checked", "html", iPosition:=0) ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) cmdTableOptions.Visible = True @@ -255,7 +257,7 @@ Public Class dlgView If bControlsUpdated Then ChangeFunctionParameters() End If - GetObjectName() + ' GetObjectName() End Sub Private Sub ucrChkSortColumn_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkSortColumn.ControlValueChanged, ucrPnlDisplayWindow.ControlValueChanged @@ -284,21 +286,21 @@ Public Class dlgView TestOKEnabled() End Sub - Private Sub ucrSaveData_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSaveData.ControlValueChanged - GetObjectName() - End Sub - - Private Sub GetObjectName() - If rdoDispOutputWindow.Checked Then - Dim strPrefix As String = clsOutputWindowFunction.GetRObjectToAssignTo 'If(ucrSaveData.GetText <> "", ucrSaveData.GetText, "last_table") - clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=1) - ElseIf rdoHTMLOutputWindow.Checked Then - Dim strPrefix As String = clsBaseOperator.GetRObjectToAssignTo - clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=1) - End If - End Sub - - Private Sub ucrSelectorForView_DataFrameChanged() Handles ucrSelectorForView.DataFrameChanged - clsGetObjectDataFunction.AddParameter("data_name", Chr(34) & ucrSelectorForView.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) - End Sub + 'Private Sub ucrSaveData_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSaveData.ControlValueChanged + ' GetObjectName() + 'End Sub + + 'Private Sub GetObjectName() + ' If rdoDispOutputWindow.Checked Then + ' Dim strPrefix As String = clsOutputWindowFunction.GetRObjectToAssignTo 'If(ucrSaveData.GetText <> "", ucrSaveData.GetText, "last_table") + ' clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=1) + ' ElseIf rdoHTMLOutputWindow.Checked Then + ' Dim strPrefix As String = clsBaseOperator.GetRObjectToAssignTo + ' clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=1) + ' End If + 'End Sub + + 'Private Sub ucrSelectorForView_DataFrameChanged() Handles ucrSelectorForView.DataFrameChanged + ' clsGetObjectDataFunction.AddParameter("data_name", Chr(34) & ucrSelectorForView.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) + 'End Sub End Class \ No newline at end of file From 064d434d9170919a47a0724ade9ba6a1da878e3d Mon Sep 17 00:00:00 2001 From: Fidel365 <107605960+Fidel365@users.noreply.github.com> Date: Wed, 13 Nov 2024 14:46:59 +0300 Subject: [PATCH 19/22] design for number of rowa --- instat/dlgView.Designer.vb | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/instat/dlgView.Designer.vb b/instat/dlgView.Designer.vb index 33a1f42d8ad..0b2371e1776 100644 --- a/instat/dlgView.Designer.vb +++ b/instat/dlgView.Designer.vb @@ -53,8 +53,8 @@ Partial Class dlgView Me.ucrSelectorForView = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrBase = New instat.ucrButtons() Me.ucrViewChkPreview = New instat.ucrCheck() - Me.ucrChkRowNumbers = New instat.ucrCheck() Me.ucrViewNudPreview = New instat.ucrNud() + Me.lblNumberofRows = New System.Windows.Forms.Label() Me.SuspendLayout() ' 'lblSelected @@ -215,15 +215,6 @@ Partial Class dlgView Me.ucrViewChkPreview.Size = New System.Drawing.Size(89, 23) Me.ucrViewChkPreview.TabIndex = 32 ' - 'ucrChkRowNumbers - ' - Me.ucrChkRowNumbers.AutoSize = True - Me.ucrChkRowNumbers.Checked = False - Me.ucrChkRowNumbers.Location = New System.Drawing.Point(248, 167) - Me.ucrChkRowNumbers.Name = "ucrChkRowNumbers" - Me.ucrChkRowNumbers.Size = New System.Drawing.Size(89, 23) - Me.ucrChkRowNumbers.TabIndex = 19 - ' 'ucrViewNudPreview ' Me.ucrViewNudPreview.AutoSize = True @@ -238,12 +229,24 @@ Partial Class dlgView Me.ucrViewNudPreview.TabIndex = 33 Me.ucrViewNudPreview.Value = New Decimal(New Integer() {1, 0, 0, 0}) ' + 'lblNumberofRows + ' + Me.lblNumberofRows.AutoSize = True + Me.lblNumberofRows.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblNumberofRows.Location = New System.Drawing.Point(248, 167) + Me.lblNumberofRows.Name = "lblNumberofRows" + Me.lblNumberofRows.Size = New System.Drawing.Size(89, 13) + Me.lblNumberofRows.TabIndex = 34 + Me.lblNumberofRows.Tag = "Number_of_rows" + Me.lblNumberofRows.Text = "Number of Rows:" + ' 'dlgView ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True Me.ClientSize = New System.Drawing.Size(416, 357) + Me.Controls.Add(Me.lblNumberofRows) Me.Controls.Add(Me.cmdTableOptions) Me.Controls.Add(Me.ucrChkDisplayFromTop) Me.Controls.Add(Me.ucrSaveData) @@ -257,10 +260,9 @@ Partial Class dlgView Me.Controls.Add(Me.ucrReceiverView) Me.Controls.Add(Me.ucrSelectorForView) Me.Controls.Add(Me.ucrBase) + Me.Controls.Add(Me.ucrNudNumberRows) Me.Controls.Add(Me.ucrViewChkPreview) - Me.Controls.Add(Me.ucrChkRowNumbers) Me.Controls.Add(Me.ucrViewNudPreview) - Me.Controls.Add(Me.ucrNudNumberRows) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.MaximizeBox = False Me.MinimizeBox = False @@ -284,9 +286,9 @@ Partial Class dlgView Friend WithEvents rdoHTMLOutputWindow As RadioButton Friend WithEvents ucrReceiverSortCol As ucrReceiverSingle Friend WithEvents ucrSaveData As ucrSave - Friend WithEvents ucrChkRowNumbers As ucrCheck Friend WithEvents ucrChkDisplayFromTop As ucrCheck Friend WithEvents cmdTableOptions As Button Friend WithEvents ucrViewNudPreview As ucrNud Friend WithEvents ucrViewChkPreview As ucrCheck + Friend WithEvents lblNumberofRows As Label End Class \ No newline at end of file From 39b99de03eab08277222facdc89a40fb7401cbe9 Mon Sep 17 00:00:00 2001 From: Fidel365 <107605960+Fidel365@users.noreply.github.com> Date: Wed, 13 Nov 2024 15:15:17 +0300 Subject: [PATCH 20/22] Rows_Options --- instat/dlgView.vb | 52 +++++++++++++++++++++-------------------------- 1 file changed, 23 insertions(+), 29 deletions(-) diff --git a/instat/dlgView.vb b/instat/dlgView.vb index 6b2d2aed01e..8ed7890b902 100644 --- a/instat/dlgView.vb +++ b/instat/dlgView.vb @@ -56,16 +56,13 @@ Public Class dlgView ucrPnlDisplayWindow.AddParameterValuesCondition(rdoDispSepOutputWindow, "checked", "viewer") ucrPnlDisplayWindow.AddToLinkedControls(ucrChkDisplayFromTop, {rdoDispOutputWindow}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True) - ucrPnlDisplayWindow.AddToLinkedControls(ucrChkRowNumbers, {rdoDispOutputWindow}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True) + ucrPnlDisplayWindow.AddToLinkedControls(ucrNudNumberRows, {rdoDispOutputWindow}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True) ucrPnlDisplayWindow.AddToLinkedControls(ucrViewChkPreview, {rdoHTMLOutputWindow}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True) - ucrNudNumberRows.SetParameter(New RParameter("n", 1)) ucrReceiverView.SetParameter(New RParameter("x", 1, bNewIncludeArgumentName:=False)) - - ucrChkRowNumbers.SetText("Rows") - ucrChkRowNumbers.AddToLinkedControls(ucrNudNumberRows, {True}, bNewLinkedHideIfParameterMissing:=True) ucrNudNumberRows.SetRDefault(6) + ucrNudNumberRows.SetLinkedDisplayControl(lblNumberofRows) ucrChkDisplayFromTop.SetText("Display From Top") ucrChkDisplayFromTop.AddFunctionNamesCondition(True, {"head", "tail"}) @@ -124,9 +121,9 @@ Public Class dlgView clsDummyFunction.AddParameter("checked", "window", iPosition:=0) - 'clsGetObjectDataFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_object_data") - 'clsGetObjectDataFunction.AddParameter("data_name", Chr(34) & ucrSelectorForView.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) - 'clsGetObjectDataFunction.AddParameter("as_file", "TRUE", iPosition:=2) + clsGetObjectDataFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_object_data") + clsGetObjectDataFunction.AddParameter("data_name", Chr(34) & ucrSelectorForView.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) + clsGetObjectDataFunction.AddParameter("as_file", "TRUE", iPosition:=2) clsOutputWindowFunction.SetPackageName("utils") @@ -207,13 +204,11 @@ Public Class dlgView Private Sub ChangeFunctionParameters() If rdoDispOutputWindow.Checked Then clsDummyFunction.AddParameter("checked", "window", iPosition:=0) - cmdTableOptions.Visible = False ucrSaveData.Visible = True ucrBase.clsRsyntax.iCallType = 2 ucrBase.clsRsyntax.RemoveFromAfterCodes(clsGetObjectDataFunction) ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Text) - 'ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) If ucrNudNumberRows.GetText <> "" OrElse ucrChkDisplayFromTop.Checked Then ucrBase.clsRsyntax.SetBaseRFunction(clsOutputWindowFunction) @@ -234,7 +229,6 @@ Public Class dlgView cmdTableOptions.Visible = False ucrSaveData.Visible = False Else - 'ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction) ucrSaveData.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) clsDummyFunction.AddParameter("checked", "html", iPosition:=0) ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) @@ -257,7 +251,7 @@ Public Class dlgView If bControlsUpdated Then ChangeFunctionParameters() End If - ' GetObjectName() + GetObjectName() End Sub Private Sub ucrChkSortColumn_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkSortColumn.ControlValueChanged, ucrPnlDisplayWindow.ControlValueChanged @@ -286,21 +280,21 @@ Public Class dlgView TestOKEnabled() End Sub - 'Private Sub ucrSaveData_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSaveData.ControlValueChanged - ' GetObjectName() - 'End Sub - - 'Private Sub GetObjectName() - ' If rdoDispOutputWindow.Checked Then - ' Dim strPrefix As String = clsOutputWindowFunction.GetRObjectToAssignTo 'If(ucrSaveData.GetText <> "", ucrSaveData.GetText, "last_table") - ' clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=1) - ' ElseIf rdoHTMLOutputWindow.Checked Then - ' Dim strPrefix As String = clsBaseOperator.GetRObjectToAssignTo - ' clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=1) - ' End If - 'End Sub - - 'Private Sub ucrSelectorForView_DataFrameChanged() Handles ucrSelectorForView.DataFrameChanged - ' clsGetObjectDataFunction.AddParameter("data_name", Chr(34) & ucrSelectorForView.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) - 'End Sub + Private Sub ucrSaveData_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSaveData.ControlValueChanged + GetObjectName() + End Sub + + Private Sub GetObjectName() + If rdoDispOutputWindow.Checked Then + Dim strPrefix As String = clsOutputWindowFunction.GetRObjectToAssignTo 'If(ucrSaveData.GetText <> "", ucrSaveData.GetText, "last_table") + clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=1) + ElseIf rdoHTMLOutputWindow.Checked Then + Dim strPrefix As String = clsBaseOperator.GetRObjectToAssignTo + clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & strPrefix & Chr(34), iPosition:=1) + End If + End Sub + + Private Sub ucrSelectorForView_DataFrameChanged() Handles ucrSelectorForView.DataFrameChanged + clsGetObjectDataFunction.AddParameter("data_name", Chr(34) & ucrSelectorForView.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) + End Sub End Class \ No newline at end of file From ecfde9184a6a63c0a57516b9f4e69c78c45d577f Mon Sep 17 00:00:00 2001 From: Fidel365 <107605960+Fidel365@users.noreply.github.com> Date: Wed, 13 Nov 2024 15:58:28 +0300 Subject: [PATCH 21/22] change --- instat/dlgView.vb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/instat/dlgView.vb b/instat/dlgView.vb index 8ed7890b902..8440aafb5d2 100644 --- a/instat/dlgView.vb +++ b/instat/dlgView.vb @@ -56,11 +56,14 @@ Public Class dlgView ucrPnlDisplayWindow.AddParameterValuesCondition(rdoDispSepOutputWindow, "checked", "viewer") ucrPnlDisplayWindow.AddToLinkedControls(ucrChkDisplayFromTop, {rdoDispOutputWindow}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True) - ucrPnlDisplayWindow.AddToLinkedControls(ucrNudNumberRows, {rdoDispOutputWindow}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True) + ' ucrPnlDisplayWindow.AddToLinkedControls(lblNumberofRows, {rdoDispOutputWindow}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True) ucrPnlDisplayWindow.AddToLinkedControls(ucrViewChkPreview, {rdoHTMLOutputWindow}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True) - ucrNudNumberRows.SetParameter(New RParameter("n", 1)) + ucrNudNumberRows.Visible = rdoDispOutputWindow.Checked ucrReceiverView.SetParameter(New RParameter("x", 1, bNewIncludeArgumentName:=False)) + + ucrNudNumberRows.SetParameter(New RParameter("n", 1)) + 'ucrNudNumberRows.Minimum = 1 ucrNudNumberRows.SetRDefault(6) ucrNudNumberRows.SetLinkedDisplayControl(lblNumberofRows) From 0199a5078ffd08e45b96283b000b7c0905570125 Mon Sep 17 00:00:00 2001 From: Fidel365 <107605960+Fidel365@users.noreply.github.com> Date: Wed, 13 Nov 2024 16:14:06 +0300 Subject: [PATCH 22/22] final changes --- instat/dlgView.Designer.vb | 13 +++++++++++++ instat/dlgView.vb | 5 ++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/instat/dlgView.Designer.vb b/instat/dlgView.Designer.vb index 0b2371e1776..0c941632055 100644 --- a/instat/dlgView.Designer.vb +++ b/instat/dlgView.Designer.vb @@ -55,6 +55,7 @@ Partial Class dlgView Me.ucrViewChkPreview = New instat.ucrCheck() Me.ucrViewNudPreview = New instat.ucrNud() Me.lblNumberofRows = New System.Windows.Forms.Label() + Me.ucrChkRowNumbers = New instat.ucrCheck() Me.SuspendLayout() ' 'lblSelected @@ -240,6 +241,16 @@ Partial Class dlgView Me.lblNumberofRows.Tag = "Number_of_rows" Me.lblNumberofRows.Text = "Number of Rows:" ' + 'ucrChkRowNumbers + ' + Me.ucrChkRowNumbers.AutoSize = True + Me.ucrChkRowNumbers.Checked = True + Me.ucrChkRowNumbers.Location = New System.Drawing.Point(249, 165) + Me.ucrChkRowNumbers.Name = "ucrChkRowNumbers" + Me.ucrChkRowNumbers.Size = New System.Drawing.Size(130, 23) + Me.ucrChkRowNumbers.TabIndex = 35 + Me.ucrChkRowNumbers.Visible = False + ' 'dlgView ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) @@ -263,6 +274,7 @@ Partial Class dlgView Me.Controls.Add(Me.ucrNudNumberRows) Me.Controls.Add(Me.ucrViewChkPreview) Me.Controls.Add(Me.ucrViewNudPreview) + Me.Controls.Add(Me.ucrChkRowNumbers) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.MaximizeBox = False Me.MinimizeBox = False @@ -291,4 +303,5 @@ Partial Class dlgView Friend WithEvents ucrViewNudPreview As ucrNud Friend WithEvents ucrViewChkPreview As ucrCheck Friend WithEvents lblNumberofRows As Label + Friend WithEvents ucrChkRowNumbers As ucrCheck End Class \ No newline at end of file diff --git a/instat/dlgView.vb b/instat/dlgView.vb index 8440aafb5d2..2da68d9390f 100644 --- a/instat/dlgView.vb +++ b/instat/dlgView.vb @@ -56,9 +56,12 @@ Public Class dlgView ucrPnlDisplayWindow.AddParameterValuesCondition(rdoDispSepOutputWindow, "checked", "viewer") ucrPnlDisplayWindow.AddToLinkedControls(ucrChkDisplayFromTop, {rdoDispOutputWindow}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True) - ' ucrPnlDisplayWindow.AddToLinkedControls(lblNumberofRows, {rdoDispOutputWindow}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True) + ucrPnlDisplayWindow.AddToLinkedControls(ucrChkRowNumbers, {rdoDispOutputWindow}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True) ucrPnlDisplayWindow.AddToLinkedControls(ucrViewChkPreview, {rdoHTMLOutputWindow}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True) + ucrChkRowNumbers.AddToLinkedControls(ucrNudNumberRows, {True}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=6) + + ucrNudNumberRows.Visible = rdoDispOutputWindow.Checked ucrReceiverView.SetParameter(New RParameter("x", 1, bNewIncludeArgumentName:=False))