From 6cdce0e87460a2bdf96d27cf821fc11930b6a9ee Mon Sep 17 00:00:00 2001 From: KWAMBAI VITALIS Date: Fri, 29 Nov 2024 14:46:02 +0300 Subject: [PATCH 1/2] changes --- instat/clsInstatOptions.vb | 17 +++++++++++++++++ instat/clsInstatOptionsDefaults.vb | 1 + instat/dlgOptions.Designer.vb | 29 +++++++++++++++++++++++++++++ instat/dlgOptions.vb | 7 +++++-- 4 files changed, 52 insertions(+), 2 deletions(-) diff --git a/instat/clsInstatOptions.vb b/instat/clsInstatOptions.vb index 548562707c..4ef7f357b3 100644 --- a/instat/clsInstatOptions.vb +++ b/instat/clsInstatOptions.vb @@ -30,6 +30,7 @@ Imports RDotNet Public bIncludeRDefaultParameters As Nullable(Of Boolean) Public iPreviewRows As Nullable(Of Integer) Public iMaxRows As Nullable(Of Integer) + Public iMaxWidth As Nullable(Of Integer) Public iMaxCols As Nullable(Of Integer) Public iUndoColLimit As Nullable(Of Integer) Public iUndoRowLimit As Nullable(Of Integer) @@ -78,6 +79,7 @@ Imports RDotNet clrEditor = clsInstatOptionsDefaults.DEFAULTclrEditor iPreviewRows = clsInstatOptionsDefaults.DEFAULTiPreviewRows iMaxRows = clsInstatOptionsDefaults.DEFAULTiMaxRows + iMaxWidth = clsInstatOptionsDefaults.DEFAULTiMaxWidth iMaxCols = clsInstatOptionsDefaults.DEFAULTiMaxCols iUndoColLimit = clsInstatOptionsDefaults.DEFAULTiUndoColLimit iUndoRowLimit = clsInstatOptionsDefaults.DEFAULTiUndoRowLimit @@ -145,6 +147,12 @@ Imports RDotNet SetMaxRows(clsInstatOptionsDefaults.DEFAULTiMaxRows) End If + If iMaxWidth.HasValue Then + SetMaxWidth(iMaxWidth) + Else + SetMaxWidth(clsInstatOptionsDefaults.DEFAULTiMaxWidth) + End If + If iMaxCols.HasValue Then SetMaxCols(iMaxCols) Else @@ -348,6 +356,11 @@ Imports RDotNet clsOptionsFunction.AddParameter("dplyr.summarise.inform", "FALSE") End If + strROption = GetROption("width") + If strROption Is Nothing OrElse strROption <> iMaxWidth.ToString Then + clsOptionsFunction.AddParameter("width", iMaxWidth) + End If + 'add "R.commands.displayed.in.the.output.window" as options parameter of its been changed If frmMain.mnuShowRCommand.Checked Then clsOptionsFunction.AddParameter("R.commands.displayed.in.the.output.window", "TRUE") @@ -394,6 +407,10 @@ Imports RDotNet frmMain.UpdateAllGrids() End Sub + Public Sub SetMaxWidth(iNewMaxWidth As Integer) + iMaxWidth = iNewMaxWidth + 'frmMain.UpdateAllGrids() + End Sub Public Sub SetMaxCols(iCols As Integer) iMaxCols = iCols frmMain.UpdateAllGrids() diff --git a/instat/clsInstatOptionsDefaults.vb b/instat/clsInstatOptionsDefaults.vb index 8a4ee9b62c..a4ab65e6ad 100644 --- a/instat/clsInstatOptionsDefaults.vb +++ b/instat/clsInstatOptionsDefaults.vb @@ -57,5 +57,6 @@ Public Class clsInstatOptionsDefaults Public Shared ReadOnly DEFAULTstrClimsoftPort As String = "3308" Public Shared ReadOnly DEFAULTstrClimsoftUsername As String = "root" Public Shared ReadOnly DEFAULTiMaxOutputsHeight As Integer = 500 + Public Shared ReadOnly DEFAULTiMaxWidth As Integer = 80 Public Shared ReadOnly DEFAULTbRemindLaterOption As Boolean = False End Class diff --git a/instat/dlgOptions.Designer.vb b/instat/dlgOptions.Designer.vb index 53fdd6c58d..54a9edc109 100644 --- a/instat/dlgOptions.Designer.vb +++ b/instat/dlgOptions.Designer.vb @@ -135,6 +135,8 @@ Partial Class dlgOptions Me.ucrInputDatabaseName = New instat.ucrInputTextBox() Me.tbpWebsite = New System.Windows.Forms.TabPage() Me.ucrChkReminder = New instat.ucrCheck() + Me.ucrNudWidth = New instat.ucrNud() + Me.lblWidth = New System.Windows.Forms.Label() CType(Me.spltControls, System.ComponentModel.ISupportInitialize).BeginInit() Me.spltControls.Panel1.SuspendLayout() Me.spltControls.Panel2.SuspendLayout() @@ -440,6 +442,8 @@ Partial Class dlgOptions ' 'tbpOutputWindow ' + Me.tbpOutputWindow.Controls.Add(Me.lblWidth) + Me.tbpOutputWindow.Controls.Add(Me.ucrNudWidth) Me.tbpOutputWindow.Controls.Add(Me.ucrNudMaxOutputsHeight) Me.tbpOutputWindow.Controls.Add(Me.ucrChkMaxOutputsHeight) Me.tbpOutputWindow.Controls.Add(Me.ucrChkShowRCommandsinOutputWindow) @@ -1260,6 +1264,29 @@ Partial Class dlgOptions Me.ucrChkReminder.Size = New System.Drawing.Size(620, 51) Me.ucrChkReminder.TabIndex = 2 ' + 'ucrNudWidth + ' + Me.ucrNudWidth.AutoSize = True + Me.ucrNudWidth.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudWidth.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudWidth.Location = New System.Drawing.Point(759, 277) + Me.ucrNudWidth.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) + Me.ucrNudWidth.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudWidth.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudWidth.Name = "ucrNudWidth" + Me.ucrNudWidth.Size = New System.Drawing.Size(75, 30) + Me.ucrNudWidth.TabIndex = 30 + Me.ucrNudWidth.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'lblWidth + ' + Me.lblWidth.AutoSize = True + Me.lblWidth.Location = New System.Drawing.Point(543, 281) + Me.lblWidth.Name = "lblWidth" + Me.lblWidth.Size = New System.Drawing.Size(127, 20) + Me.lblWidth.TabIndex = 31 + Me.lblWidth.Text = "Width to Display:" + ' 'dlgOptions ' Me.AutoScaleDimensions = New System.Drawing.SizeF(144.0!, 144.0!) @@ -1410,4 +1437,6 @@ Partial Class dlgOptions Friend WithEvents ucrNudRowUndoLimit As ucrNud Friend WithEvents Label4 As Label Friend WithEvents ucrChkTurnOffUndo As ucrCheck + Friend WithEvents lblWidth As Label + Friend WithEvents ucrNudWidth As ucrNud End Class diff --git a/instat/dlgOptions.vb b/instat/dlgOptions.vb index f1c25588dc..7e049aa79d 100644 --- a/instat/dlgOptions.vb +++ b/instat/dlgOptions.vb @@ -75,6 +75,7 @@ Public Class dlgOptions SetView() ucrNudDigits.SetMinMax(0, 22) + ucrNudWidth.SetMinMax(0, Integer.MaxValue) ucrChkIncludeCommentsbyDefault.SetText("Include Comments by Default") ucrChkViewStructuredMenu.SetText("Show Structured Menu") ucrChkViewClimaticMenu.SetText("Show Climatic Menu") @@ -130,6 +131,7 @@ Public Class dlgOptions ucrChkViewClimaticMenu.Checked = frmMain.clsInstatOptions.bShowClimaticMenu ucrChkShowRCommandsinOutputWindow.Checked = frmMain.clsInstatOptions.bCommandsinOutput ucrNudDigits.Value = frmMain.clsInstatOptions.iDigits + ucrNudWidth.Value = frmMain.clsInstatOptions.iMaxWidth ucrChkShowSignifStars.Checked = frmMain.clsInstatOptions.bShowSignifStars ucrChkShowDataonGrid.Checked = frmMain.clsInstatOptions.bChangeDataFrame ucrChkShowWaitDialog.Checked = frmMain.clsInstatOptions.bShowWaitDialog @@ -197,6 +199,7 @@ Public Class dlgOptions frmMain.clsInstatOptions.SetShowClimaticMenu(ucrChkViewClimaticMenu.Checked) frmMain.clsInstatOptions.SetCommandInOutpt(ucrChkShowRCommandsinOutputWindow.Checked) frmMain.clsInstatOptions.SetDigits(ucrNudDigits.Value) + frmMain.clsInstatOptions.SetMaxWidth(ucrNudWidth.Value) frmMain.clsInstatOptions.SetSignifStars(ucrChkShowSignifStars.Checked) frmMain.clsInstatOptions.SetChangeDataFrame(ucrChkShowDataonGrid.Checked) frmMain.clsInstatOptions.SetShowWaitDialog(ucrChkShowWaitDialog.Checked) @@ -375,7 +378,7 @@ Public Class dlgOptions End Sub - Private Sub AllControls_ControlValueChanged() Handles ucrNudMaxCols.ControlValueChanged, ucrNudAutoSaveMinutes.ControlValueChanged, ucrNudPreviewRows.ControlValueChanged, ucrInputComment.ControlContentsChanged, ucrChkIncludeCommentsbyDefault.ControlValueChanged, ucrNudMaxRows.ControlValueChanged, ucrChkIncludeDefaultParams.ControlValueChanged, ucrChkShowRCommandsinOutputWindow.ControlValueChanged, ucrNudDigits.ControlValueChanged, ucrChkShowSignifStars.ControlValueChanged, ucrChkShowDataonGrid.ControlValueChanged, ucrChkAutoSave.ControlValueChanged, ucrChkTurnOffUndo.ControlValueChanged, ucrChkShowWaitDialog.ControlValueChanged, ucrNudWaitSeconds.ControlValueChanged, ucrChkViewClimaticMenu.ControlValueChanged, ucrChkViewStructuredMenu.ControlValueChanged, ucrChkViewProcurementMenu.ControlValueChanged, ucrChkViewOptionsByContextMenu.ControlValueChanged, ucrInputDatabaseName.ControlValueChanged, ucrInputHost.ControlValueChanged, ucrInputPort.ControlValueChanged, ucrInputUserName.ControlValueChanged, ucrChkMaxOutputsHeight.ControlValueChanged, ucrNudMaxOutputsHeight.ControlValueChanged, ucrChkReminder.ControlValueChanged, ucrNudColUndoLimit.ControlValueChanged, ucrNudRowUndoLimit.ControlValueChanged + Private Sub AllControls_ControlValueChanged() Handles ucrNudMaxCols.ControlValueChanged, ucrNudAutoSaveMinutes.ControlValueChanged, ucrNudPreviewRows.ControlValueChanged, ucrInputComment.ControlContentsChanged, ucrChkIncludeCommentsbyDefault.ControlValueChanged, ucrNudMaxRows.ControlValueChanged, ucrNudWidth.ControlValueChanged, ucrChkIncludeDefaultParams.ControlValueChanged, ucrChkShowRCommandsinOutputWindow.ControlValueChanged, ucrNudDigits.ControlValueChanged, ucrChkShowSignifStars.ControlValueChanged, ucrChkShowDataonGrid.ControlValueChanged, ucrChkAutoSave.ControlValueChanged, ucrChkTurnOffUndo.ControlValueChanged, ucrChkShowWaitDialog.ControlValueChanged, ucrNudWaitSeconds.ControlValueChanged, ucrChkViewClimaticMenu.ControlValueChanged, ucrChkViewStructuredMenu.ControlValueChanged, ucrChkViewProcurementMenu.ControlValueChanged, ucrChkViewOptionsByContextMenu.ControlValueChanged, ucrInputDatabaseName.ControlValueChanged, ucrInputHost.ControlValueChanged, ucrInputPort.ControlValueChanged, ucrInputUserName.ControlValueChanged, ucrChkMaxOutputsHeight.ControlValueChanged, ucrNudMaxOutputsHeight.ControlValueChanged, ucrChkReminder.ControlValueChanged, ucrNudColUndoLimit.ControlValueChanged, ucrNudRowUndoLimit.ControlValueChanged ApplyEnabled(True) End Sub @@ -443,7 +446,7 @@ Public Class dlgOptions ApplyEnabled(True) End Sub - Private Sub AllControls_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrNudWaitSeconds.ControlValueChanged, ucrNudPreviewRows.ControlValueChanged, ucrNudMaxRows.ControlValueChanged, ucrNudMaxCols.ControlValueChanged, ucrNudDigits.ControlValueChanged, ucrNudAutoSaveMinutes.ControlValueChanged, ucrInputUserName.ControlValueChanged, ucrInputPort.ControlValueChanged, ucrInputHost.ControlValueChanged, ucrInputDatabaseName.ControlValueChanged, ucrInputComment.ControlContentsChanged, ucrChkViewStructuredMenu.ControlValueChanged, ucrChkViewProcurementMenu.ControlValueChanged, ucrChkViewOptionsByContextMenu.ControlValueChanged, ucrChkViewClimaticMenu.ControlValueChanged, ucrChkShowWaitDialog.ControlValueChanged, ucrChkShowSignifStars.ControlValueChanged, ucrChkShowRCommandsinOutputWindow.ControlValueChanged, ucrChkShowDataonGrid.ControlValueChanged, ucrChkIncludeDefaultParams.ControlValueChanged, ucrChkIncludeCommentsbyDefault.ControlValueChanged, ucrChkAutoSave.ControlValueChanged, ucrNudMaxOutputsHeight.ControlValueChanged, ucrChkMaxOutputsHeight.ControlValueChanged, ucrChkReminder.ControlValueChanged, ucrNudColUndoLimit.ControlValueChanged, ucrNudRowUndoLimit.ControlValueChanged, ucrChkTurnOffUndo.ControlValueChanged + Private Sub AllControls_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrNudWaitSeconds.ControlValueChanged, ucrNudPreviewRows.ControlValueChanged, ucrNudMaxRows.ControlValueChanged, ucrNudWidth.ControlValueChanged, ucrNudMaxCols.ControlValueChanged, ucrNudDigits.ControlValueChanged, ucrNudAutoSaveMinutes.ControlValueChanged, ucrInputUserName.ControlValueChanged, ucrInputPort.ControlValueChanged, ucrInputHost.ControlValueChanged, ucrInputDatabaseName.ControlValueChanged, ucrInputComment.ControlContentsChanged, ucrChkViewStructuredMenu.ControlValueChanged, ucrChkViewProcurementMenu.ControlValueChanged, ucrChkViewOptionsByContextMenu.ControlValueChanged, ucrChkViewClimaticMenu.ControlValueChanged, ucrChkShowWaitDialog.ControlValueChanged, ucrChkShowSignifStars.ControlValueChanged, ucrChkShowRCommandsinOutputWindow.ControlValueChanged, ucrChkShowDataonGrid.ControlValueChanged, ucrChkIncludeDefaultParams.ControlValueChanged, ucrChkIncludeCommentsbyDefault.ControlValueChanged, ucrChkAutoSave.ControlValueChanged, ucrNudMaxOutputsHeight.ControlValueChanged, ucrChkMaxOutputsHeight.ControlValueChanged, ucrChkReminder.ControlValueChanged, ucrNudColUndoLimit.ControlValueChanged, ucrNudRowUndoLimit.ControlValueChanged, ucrChkTurnOffUndo.ControlValueChanged End Sub From 98e8c12847509fc4286932d6444493f9ca62abdb Mon Sep 17 00:00:00 2001 From: KWAMBAI VITALIS Date: Mon, 2 Dec 2024 10:23:47 +0300 Subject: [PATCH 2/2] changes to the code --- instat/dlgDescribeTwoVariable.Designer.vb | 2 +- instat/dlgDescribeTwoVariable.vb | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/instat/dlgDescribeTwoVariable.Designer.vb b/instat/dlgDescribeTwoVariable.Designer.vb index 5eb45c48ae..63a73b2d76 100644 --- a/instat/dlgDescribeTwoVariable.Designer.vb +++ b/instat/dlgDescribeTwoVariable.Designer.vb @@ -574,7 +574,7 @@ Partial Class dlgDescribeTwoVariable Me.ucrReceiverSkimrGroupByFactor.Selector = Nothing Me.ucrReceiverSkimrGroupByFactor.Size = New System.Drawing.Size(180, 30) Me.ucrReceiverSkimrGroupByFactor.strNcFilePath = "" - Me.ucrReceiverSkimrGroupByFactor.TabIndex = 2 + Me.ucrReceiverSkimrGroupByFactor.TabIndex = 8 Me.ucrReceiverSkimrGroupByFactor.ucrSelector = Nothing ' 'ucrChkDisplayMargins diff --git a/instat/dlgDescribeTwoVariable.vb b/instat/dlgDescribeTwoVariable.vb index 0da50e2892..acf4564b56 100644 --- a/instat/dlgDescribeTwoVariable.vb +++ b/instat/dlgDescribeTwoVariable.vb @@ -539,7 +539,6 @@ Public Class dlgDescribeTwoVariable ucrSaveTable.AddAdditionalRCode(clsGroupByPipeOperator4, iAdditionalPairNo:=2) ucrChkOmitMissing.SetRCode(clsSummaryTableFunction, bReset) - ucrReceiverFirstVars.SetRCode(clsDummyFunction, bReset) ucrReceiverSecondTwoVariableFactor.SetRCode(clsDummyFunction, bReset) ucrSelectorDescribeTwoVar.SetRCode(clsRCorrelationFunction, bReset) ucrReceiverSkimrGroupByFactor.SetRCode(clsGroupByFunction, bReset) @@ -558,6 +557,9 @@ Public Class dlgDescribeTwoVariable ucrReceiverThreeVariableThirdVariable.SetRCode(clsSummaryTableCombineFactorsFunction, bReset) ucrChkDisplayMargins.SetRCode(clsCombineFrequencyParametersFunction, bReset) ucrSaveTable.SetRCode(clsGroupByPipeOperator, bReset) + If bReset Then + ucrReceiverFirstVars.SetRCode(clsDummyFunction, bReset) + End If bRcodeSet = True FillListView() @@ -1436,8 +1438,11 @@ Public Class dlgDescribeTwoVariable Else ucrReceiverFirstVars.SetMeAsReceiver() End If + ElseIf rdoSkim.Checked Then + ucrReceiverFirstVars.SetMeAsReceiver() Else ucrReceiverFirstVars.SetMeAsReceiver() + End If If rdoORow.Checked OrElse rdoOCell.Checked Then If ucrChkDisplayMargins.Checked Then