From f8fb351b11aabd17a3b03db160320c403a5a6cde Mon Sep 17 00:00:00 2001 From: ivanluv Date: Tue, 19 Nov 2019 15:12:32 +0300 Subject: [PATCH 1/4] Adding the segmented keyboad to the useModel dialogue --- instat/dlgUseModel.Designer.vb | 244 ++++++++++++++++++++++++++++++--- instat/dlgUseModel.vb | 61 ++++++++- 2 files changed, 288 insertions(+), 17 deletions(-) diff --git a/instat/dlgUseModel.Designer.vb b/instat/dlgUseModel.Designer.vb index f0d905bacdd..26ea952f2e6 100644 --- a/instat/dlgUseModel.Designer.vb +++ b/instat/dlgUseModel.Designer.vb @@ -46,16 +46,32 @@ Partial Class dlgUseModel Me.cmdDistill = New System.Windows.Forms.Button() Me.cmdCi = New System.Windows.Forms.Button() Me.cmdErlevd = New System.Windows.Forms.Button() + Me.cmdClear = New System.Windows.Forms.Button() + Me.grpSegmented = New System.Windows.Forms.GroupBox() + Me.cmdIntercept = New System.Windows.Forms.Button() + Me.cmdBroken = New System.Windows.Forms.Button() + Me.cmdPoints = New System.Windows.Forms.Button() + Me.cmdPlotLines = New System.Windows.Forms.Button() + Me.cmdSegmentedPredict = New System.Windows.Forms.Button() + Me.cmdVcov = New System.Windows.Forms.Button() + Me.cmdConfint = New System.Windows.Forms.Button() + Me.cmdSegmentedSummary = New System.Windows.Forms.Button() + Me.cmdAapc = New System.Windows.Forms.Button() + Me.cmdSegmented = New System.Windows.Forms.Button() + Me.cmdSegmentedPrint = New System.Windows.Forms.Button() + Me.cmdDavies = New System.Windows.Forms.Button() + Me.cmdPscore = New System.Windows.Forms.Button() + Me.cmdSlope = New System.Windows.Forms.Button() Me.ucrInputModels = New instat.ucrInputTextBox() Me.ucrSelectorUseModel = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrInputTryMessage = New instat.ucrInputTextBox() Me.ucrBase = New instat.ucrButtons() Me.ucrReceiverForTestColumn = New instat.ucrReceiverExpression() Me.ucrInputComboRPackage = New instat.ucrInputComboBox() - Me.cmdClear = New System.Windows.Forms.Button() Me.grpGeneral.SuspendLayout() Me.grpPrediction.SuspendLayout() Me.grpExtrRemes.SuspendLayout() + Me.grpSegmented.SuspendLayout() Me.SuspendLayout() ' 'lblModel @@ -127,7 +143,7 @@ Partial Class dlgUseModel Me.grpGeneral.Controls.Add(Me.cmdsummary) Me.grpGeneral.Controls.Add(Me.cmdanova) Me.grpGeneral.Controls.Add(Me.cmdresiduals) - Me.grpGeneral.Location = New System.Drawing.Point(262, 106) + Me.grpGeneral.Location = New System.Drawing.Point(260, 110) Me.grpGeneral.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) Me.grpGeneral.Name = "grpGeneral" Me.grpGeneral.Padding = New System.Windows.Forms.Padding(2, 3, 2, 3) @@ -264,7 +280,7 @@ Partial Class dlgUseModel Me.grpExtrRemes.Controls.Add(Me.cmdDistill) Me.grpExtrRemes.Controls.Add(Me.cmdCi) Me.grpExtrRemes.Controls.Add(Me.cmdErlevd) - Me.grpExtrRemes.Location = New System.Drawing.Point(264, 106) + Me.grpExtrRemes.Location = New System.Drawing.Point(260, 108) Me.grpExtrRemes.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) Me.grpExtrRemes.Name = "grpExtrRemes" Me.grpExtrRemes.Padding = New System.Windows.Forms.Padding(2, 3, 2, 3) @@ -339,6 +355,196 @@ Partial Class dlgUseModel Me.cmdErlevd.Text = "erlevd" Me.cmdErlevd.UseVisualStyleBackColor = True ' + 'cmdClear + ' + Me.cmdClear.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdClear.Location = New System.Drawing.Point(397, 254) + Me.cmdClear.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdClear.Name = "cmdClear" + Me.cmdClear.Size = New System.Drawing.Size(74, 23) + Me.cmdClear.TabIndex = 31 + Me.cmdClear.Text = "Clear" + Me.cmdClear.UseVisualStyleBackColor = True + ' + 'grpSegmented + ' + Me.grpSegmented.Controls.Add(Me.cmdSlope) + Me.grpSegmented.Controls.Add(Me.cmdPscore) + Me.grpSegmented.Controls.Add(Me.cmdDavies) + Me.grpSegmented.Controls.Add(Me.cmdIntercept) + Me.grpSegmented.Controls.Add(Me.cmdBroken) + Me.grpSegmented.Controls.Add(Me.cmdPoints) + Me.grpSegmented.Controls.Add(Me.cmdPlotLines) + Me.grpSegmented.Controls.Add(Me.cmdSegmentedPredict) + Me.grpSegmented.Controls.Add(Me.cmdVcov) + Me.grpSegmented.Controls.Add(Me.cmdConfint) + Me.grpSegmented.Controls.Add(Me.cmdSegmentedSummary) + Me.grpSegmented.Controls.Add(Me.cmdAapc) + Me.grpSegmented.Controls.Add(Me.cmdSegmented) + Me.grpSegmented.Controls.Add(Me.cmdSegmentedPrint) + Me.grpSegmented.Location = New System.Drawing.Point(260, 112) + Me.grpSegmented.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.grpSegmented.Name = "grpSegmented" + Me.grpSegmented.Padding = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.grpSegmented.Size = New System.Drawing.Size(277, 134) + Me.grpSegmented.TabIndex = 162 + Me.grpSegmented.TabStop = False + Me.grpSegmented.Text = "segmented" + ' + 'cmdIntercept + ' + Me.cmdIntercept.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdIntercept.Location = New System.Drawing.Point(140, 100) + Me.cmdIntercept.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdIntercept.Name = "cmdIntercept" + Me.cmdIntercept.Size = New System.Drawing.Size(69, 30) + Me.cmdIntercept.TabIndex = 161 + Me.cmdIntercept.Text = "intercept" + Me.cmdIntercept.UseVisualStyleBackColor = True + ' + 'cmdBroken + ' + Me.cmdBroken.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdBroken.Location = New System.Drawing.Point(3, 100) + Me.cmdBroken.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdBroken.Name = "cmdBroken" + Me.cmdBroken.Size = New System.Drawing.Size(69, 30) + Me.cmdBroken.TabIndex = 160 + Me.cmdBroken.Text = "broken" + Me.cmdBroken.UseVisualStyleBackColor = True + ' + 'cmdPoints + ' + Me.cmdPoints.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdPoints.Location = New System.Drawing.Point(140, 70) + Me.cmdPoints.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdPoints.Name = "cmdPoints" + Me.cmdPoints.Size = New System.Drawing.Size(69, 30) + Me.cmdPoints.TabIndex = 159 + Me.cmdPoints.Text = "points" + Me.cmdPoints.UseVisualStyleBackColor = True + ' + 'cmdPlotLines + ' + Me.cmdPlotLines.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdPlotLines.Location = New System.Drawing.Point(72, 70) + Me.cmdPlotLines.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdPlotLines.Name = "cmdPlotLines" + Me.cmdPlotLines.Size = New System.Drawing.Size(69, 30) + Me.cmdPlotLines.TabIndex = 158 + Me.cmdPlotLines.Text = "plot lines" + Me.cmdPlotLines.UseVisualStyleBackColor = True + ' + 'cmdSegmentedPredict + ' + Me.cmdSegmentedPredict.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdSegmentedPredict.Location = New System.Drawing.Point(3, 70) + Me.cmdSegmentedPredict.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdSegmentedPredict.Name = "cmdSegmentedPredict" + Me.cmdSegmentedPredict.Size = New System.Drawing.Size(69, 30) + Me.cmdSegmentedPredict.TabIndex = 157 + Me.cmdSegmentedPredict.Text = "predict" + Me.cmdSegmentedPredict.UseVisualStyleBackColor = True + ' + 'cmdVcov + ' + Me.cmdVcov.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdVcov.Location = New System.Drawing.Point(140, 41) + Me.cmdVcov.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdVcov.Name = "cmdVcov" + Me.cmdVcov.Size = New System.Drawing.Size(69, 30) + Me.cmdVcov.TabIndex = 156 + Me.cmdVcov.Text = "vcov" + Me.cmdVcov.UseVisualStyleBackColor = True + ' + 'cmdConfint + ' + Me.cmdConfint.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdConfint.Location = New System.Drawing.Point(72, 41) + Me.cmdConfint.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdConfint.Name = "cmdConfint" + Me.cmdConfint.Size = New System.Drawing.Size(69, 30) + Me.cmdConfint.TabIndex = 155 + Me.cmdConfint.Text = "confint" + Me.cmdConfint.UseVisualStyleBackColor = True + ' + 'cmdSegmentedSummary + ' + Me.cmdSegmentedSummary.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdSegmentedSummary.Location = New System.Drawing.Point(3, 41) + Me.cmdSegmentedSummary.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdSegmentedSummary.Name = "cmdSegmentedSummary" + Me.cmdSegmentedSummary.Size = New System.Drawing.Size(69, 30) + Me.cmdSegmentedSummary.TabIndex = 154 + Me.cmdSegmentedSummary.Text = "summary" + Me.cmdSegmentedSummary.UseVisualStyleBackColor = True + ' + 'cmdAapc + ' + Me.cmdAapc.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdAapc.Location = New System.Drawing.Point(72, 12) + Me.cmdAapc.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdAapc.Name = "cmdAapc" + Me.cmdAapc.Size = New System.Drawing.Size(69, 30) + Me.cmdAapc.TabIndex = 126 + Me.cmdAapc.Text = "aapc" + Me.cmdAapc.UseVisualStyleBackColor = True + ' + 'cmdSegmented + ' + Me.cmdSegmented.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdSegmented.Location = New System.Drawing.Point(3, 12) + Me.cmdSegmented.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdSegmented.Name = "cmdSegmented" + Me.cmdSegmented.Size = New System.Drawing.Size(69, 30) + Me.cmdSegmented.TabIndex = 124 + Me.cmdSegmented.Text = "segmented" + Me.cmdSegmented.UseVisualStyleBackColor = True + ' + 'cmdSegmentedPrint + ' + Me.cmdSegmentedPrint.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdSegmentedPrint.Location = New System.Drawing.Point(140, 12) + Me.cmdSegmentedPrint.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdSegmentedPrint.Name = "cmdSegmentedPrint" + Me.cmdSegmentedPrint.Size = New System.Drawing.Size(69, 30) + Me.cmdSegmentedPrint.TabIndex = 153 + Me.cmdSegmentedPrint.Text = "print" + Me.cmdSegmentedPrint.UseVisualStyleBackColor = True + ' + 'cmdDavies + ' + Me.cmdDavies.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdDavies.Location = New System.Drawing.Point(72, 100) + Me.cmdDavies.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdDavies.Name = "cmdDavies" + Me.cmdDavies.Size = New System.Drawing.Size(69, 30) + Me.cmdDavies.TabIndex = 162 + Me.cmdDavies.Text = "davies" + Me.cmdDavies.UseVisualStyleBackColor = True + ' + 'cmdPscore + ' + Me.cmdPscore.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdPscore.Location = New System.Drawing.Point(208, 12) + Me.cmdPscore.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdPscore.Name = "cmdPscore" + Me.cmdPscore.Size = New System.Drawing.Size(69, 30) + Me.cmdPscore.TabIndex = 163 + Me.cmdPscore.Text = "pscore" + Me.cmdPscore.UseVisualStyleBackColor = True + ' + 'cmdSlope + ' + Me.cmdSlope.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdSlope.Location = New System.Drawing.Point(208, 41) + Me.cmdSlope.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdSlope.Name = "cmdSlope" + Me.cmdSlope.Size = New System.Drawing.Size(69, 30) + Me.cmdSlope.TabIndex = 164 + Me.cmdSlope.Text = "slope" + Me.cmdSlope.UseVisualStyleBackColor = True + ' 'ucrInputModels ' Me.ucrInputModels.AddQuotesIfUnrecognised = True @@ -399,24 +605,14 @@ Partial Class dlgUseModel Me.ucrInputComboRPackage.Size = New System.Drawing.Size(141, 21) Me.ucrInputComboRPackage.TabIndex = 5 ' - 'cmdClear - ' - Me.cmdClear.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdClear.Location = New System.Drawing.Point(397, 254) - Me.cmdClear.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) - Me.cmdClear.Name = "cmdClear" - Me.cmdClear.Size = New System.Drawing.Size(74, 23) - Me.cmdClear.TabIndex = 31 - Me.cmdClear.Text = "Clear" - Me.cmdClear.UseVisualStyleBackColor = True - ' 'dlgUseModel ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(502, 381) - Me.Controls.Add(Me.cmdClear) + Me.ClientSize = New System.Drawing.Size(746, 381) + Me.Controls.Add(Me.grpSegmented) Me.Controls.Add(Me.grpGeneral) + Me.Controls.Add(Me.cmdClear) Me.Controls.Add(Me.grpExtrRemes) Me.Controls.Add(Me.ucrInputModels) Me.Controls.Add(Me.lblModels) @@ -436,6 +632,7 @@ Partial Class dlgUseModel Me.grpGeneral.ResumeLayout(False) Me.grpPrediction.ResumeLayout(False) Me.grpExtrRemes.ResumeLayout(False) + Me.grpSegmented.ResumeLayout(False) Me.ResumeLayout(False) Me.PerformLayout() @@ -472,4 +669,19 @@ Partial Class dlgUseModel Friend WithEvents cmdCi As Button Friend WithEvents cmdErlevd As Button Friend WithEvents cmdClear As Button + Friend WithEvents grpSegmented As GroupBox + Friend WithEvents cmdIntercept As Button + Friend WithEvents cmdBroken As Button + Friend WithEvents cmdPoints As Button + Friend WithEvents cmdPlotLines As Button + Friend WithEvents cmdSegmentedPredict As Button + Friend WithEvents cmdVcov As Button + Friend WithEvents cmdConfint As Button + Friend WithEvents cmdSegmentedSummary As Button + Friend WithEvents cmdAapc As Button + Friend WithEvents cmdSegmented As Button + Friend WithEvents cmdSegmentedPrint As Button + Friend WithEvents cmdDavies As Button + Friend WithEvents cmdSlope As Button + Friend WithEvents cmdPscore As Button End Class diff --git a/instat/dlgUseModel.vb b/instat/dlgUseModel.vb index 0ed852d2037..07283bebdb6 100644 --- a/instat/dlgUseModel.vb +++ b/instat/dlgUseModel.vb @@ -42,7 +42,7 @@ Public Class dlgUseModel ucrReceiverForTestColumn.Selector = ucrSelectorUseModel ucrReceiverForTestColumn.SetMeAsReceiver() - ucrInputComboRPackage.SetItems({"General", "Prediction", "extRemes"}) + ucrInputComboRPackage.SetItems({"General", "Prediction", "extRemes", "segmented"}) ucrInputComboRPackage.SetDropDownStyleAsNonEditable() ucrInputTryMessage.Hide() @@ -117,6 +117,7 @@ Public Class dlgUseModel grpGeneral.Visible = False grpPrediction.Visible = False grpExtrRemes.Visible = False + grpSegmented.Visible = False Select Case ucrInputComboRPackage.GetText Case "General" grpGeneral.Visible = True @@ -124,6 +125,8 @@ Public Class dlgUseModel grpPrediction.Visible = True Case "extRemes" grpExtrRemes.Visible = True + Case "segmented" + grpSegmented.Visible = True End Select End Sub @@ -229,4 +232,60 @@ Public Class dlgUseModel Private Sub cmdClear_Click(sender As Object, e As EventArgs) Handles cmdClear.Click ucrReceiverForTestColumn.Clear() End Sub + + Private Sub cmdSegmented_Click(sender As Object, e As EventArgs) Handles cmdSegmented.Click + ucrReceiverForTestColumn.AddToReceiverAtCursorPosition(" segmented::segmented()", 1) + End Sub + + Private Sub cmdAapc_Click(sender As Object, e As EventArgs) Handles cmdAapc.Click + ucrReceiverForTestColumn.AddToReceiverAtCursorPosition(" segmented::aapc()", 1) + End Sub + + Private Sub cmdSegmentedPrint_Click(sender As Object, e As EventArgs) Handles cmdSegmentedPrint.Click + ucrReceiverForTestColumn.AddToReceiverAtCursorPosition(" print()", 1) + End Sub + + Private Sub cmdPscore_Click(sender As Object, e As EventArgs) Handles cmdPscore.Click + ucrReceiverForTestColumn.AddToReceiverAtCursorPosition(" segmented::pscore.test()", 1) + End Sub + + Private Sub cmdSegmentedSummary_Click(sender As Object, e As EventArgs) Handles cmdSegmentedSummary.Click + ucrReceiverForTestColumn.AddToReceiverAtCursorPosition(" summary()", 1) + End Sub + + Private Sub cmdConfint_Click(sender As Object, e As EventArgs) Handles cmdConfint.Click + ucrReceiverForTestColumn.AddToReceiverAtCursorPosition(" confint()", 1) + End Sub + + Private Sub cmdVcov_Click(sender As Object, e As EventArgs) Handles cmdVcov.Click + ucrReceiverForTestColumn.AddToReceiverAtCursorPosition(" vcov()", 1) + End Sub + + Private Sub cmdSlope_Click(sender As Object, e As EventArgs) Handles cmdSlope.Click + ucrReceiverForTestColumn.AddToReceiverAtCursorPosition(" segmented::slope()", 1) + End Sub + + Private Sub cmdSegmentedPredict_Click(sender As Object, e As EventArgs) Handles cmdSegmentedPredict.Click + ucrReceiverForTestColumn.AddToReceiverAtCursorPosition(" predict()", 1) + End Sub + + Private Sub cmdPlotLines_Click(sender As Object, e As EventArgs) Handles cmdPlotLines.Click + ucrReceiverForTestColumn.AddToReceiverAtCursorPosition(" plot lines()", 1) + End Sub + + Private Sub cmdPoints_Click(sender As Object, e As EventArgs) Handles cmdPoints.Click + ucrReceiverForTestColumn.AddToReceiverAtCursorPosition(" points()", 1) + End Sub + + Private Sub cmdBroken_Click(sender As Object, e As EventArgs) Handles cmdBroken.Click + ucrReceiverForTestColumn.AddToReceiverAtCursorPosition(" segmented::broken.line()", 1) + End Sub + + Private Sub cmdDavies_Click(sender As Object, e As EventArgs) Handles cmdDavies.Click + ucrReceiverForTestColumn.AddToReceiverAtCursorPosition(" segmented::davies.test()", 1) + End Sub + + Private Sub cmdIntercept_Click(sender As Object, e As EventArgs) Handles cmdIntercept.Click + ucrReceiverForTestColumn.AddToReceiverAtCursorPosition(" segmented::intercept()", 1) + End Sub End Class \ No newline at end of file From df45ae9ff3838282f96d39ee776f0454176ef1f9 Mon Sep 17 00:00:00 2001 From: ivanluv Date: Thu, 21 Nov 2019 16:57:16 +0300 Subject: [PATCH 2/4] Minor modifications --- instat/dlgUseModel.Designer.vb | 78 +++++++++++++++++----------------- instat/dlgUseModel.vb | 36 ++++++++++------ 2 files changed, 61 insertions(+), 53 deletions(-) diff --git a/instat/dlgUseModel.Designer.vb b/instat/dlgUseModel.Designer.vb index 26ea952f2e6..a68eabfae7d 100644 --- a/instat/dlgUseModel.Designer.vb +++ b/instat/dlgUseModel.Designer.vb @@ -48,6 +48,9 @@ Partial Class dlgUseModel Me.cmdErlevd = New System.Windows.Forms.Button() Me.cmdClear = New System.Windows.Forms.Button() Me.grpSegmented = New System.Windows.Forms.GroupBox() + Me.cmdSlope = New System.Windows.Forms.Button() + Me.cmdPscore = New System.Windows.Forms.Button() + Me.cmdDavies = New System.Windows.Forms.Button() Me.cmdIntercept = New System.Windows.Forms.Button() Me.cmdBroken = New System.Windows.Forms.Button() Me.cmdPoints = New System.Windows.Forms.Button() @@ -59,9 +62,6 @@ Partial Class dlgUseModel Me.cmdAapc = New System.Windows.Forms.Button() Me.cmdSegmented = New System.Windows.Forms.Button() Me.cmdSegmentedPrint = New System.Windows.Forms.Button() - Me.cmdDavies = New System.Windows.Forms.Button() - Me.cmdPscore = New System.Windows.Forms.Button() - Me.cmdSlope = New System.Windows.Forms.Button() Me.ucrInputModels = New instat.ucrInputTextBox() Me.ucrSelectorUseModel = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrInputTryMessage = New instat.ucrInputTextBox() @@ -391,6 +391,39 @@ Partial Class dlgUseModel Me.grpSegmented.TabStop = False Me.grpSegmented.Text = "segmented" ' + 'cmdSlope + ' + Me.cmdSlope.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdSlope.Location = New System.Drawing.Point(208, 70) + Me.cmdSlope.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdSlope.Name = "cmdSlope" + Me.cmdSlope.Size = New System.Drawing.Size(69, 30) + Me.cmdSlope.TabIndex = 164 + Me.cmdSlope.Text = "slope" + Me.cmdSlope.UseVisualStyleBackColor = True + ' + 'cmdPscore + ' + Me.cmdPscore.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdPscore.Location = New System.Drawing.Point(140, 10) + Me.cmdPscore.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdPscore.Name = "cmdPscore" + Me.cmdPscore.Size = New System.Drawing.Size(69, 30) + Me.cmdPscore.TabIndex = 163 + Me.cmdPscore.Text = "pscore" + Me.cmdPscore.UseVisualStyleBackColor = True + ' + 'cmdDavies + ' + Me.cmdDavies.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdDavies.Location = New System.Drawing.Point(3, 10) + Me.cmdDavies.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdDavies.Name = "cmdDavies" + Me.cmdDavies.Size = New System.Drawing.Size(69, 30) + Me.cmdDavies.TabIndex = 162 + Me.cmdDavies.Text = "davies" + Me.cmdDavies.UseVisualStyleBackColor = True + ' 'cmdIntercept ' Me.cmdIntercept.ImeMode = System.Windows.Forms.ImeMode.NoControl @@ -482,7 +515,7 @@ Partial Class dlgUseModel 'cmdAapc ' Me.cmdAapc.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdAapc.Location = New System.Drawing.Point(72, 12) + Me.cmdAapc.Location = New System.Drawing.Point(72, 100) Me.cmdAapc.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) Me.cmdAapc.Name = "cmdAapc" Me.cmdAapc.Size = New System.Drawing.Size(69, 30) @@ -493,7 +526,7 @@ Partial Class dlgUseModel 'cmdSegmented ' Me.cmdSegmented.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdSegmented.Location = New System.Drawing.Point(3, 12) + Me.cmdSegmented.Location = New System.Drawing.Point(72, 10) Me.cmdSegmented.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) Me.cmdSegmented.Name = "cmdSegmented" Me.cmdSegmented.Size = New System.Drawing.Size(69, 30) @@ -504,7 +537,7 @@ Partial Class dlgUseModel 'cmdSegmentedPrint ' Me.cmdSegmentedPrint.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdSegmentedPrint.Location = New System.Drawing.Point(140, 12) + Me.cmdSegmentedPrint.Location = New System.Drawing.Point(208, 41) Me.cmdSegmentedPrint.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) Me.cmdSegmentedPrint.Name = "cmdSegmentedPrint" Me.cmdSegmentedPrint.Size = New System.Drawing.Size(69, 30) @@ -512,39 +545,6 @@ Partial Class dlgUseModel Me.cmdSegmentedPrint.Text = "print" Me.cmdSegmentedPrint.UseVisualStyleBackColor = True ' - 'cmdDavies - ' - Me.cmdDavies.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdDavies.Location = New System.Drawing.Point(72, 100) - Me.cmdDavies.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) - Me.cmdDavies.Name = "cmdDavies" - Me.cmdDavies.Size = New System.Drawing.Size(69, 30) - Me.cmdDavies.TabIndex = 162 - Me.cmdDavies.Text = "davies" - Me.cmdDavies.UseVisualStyleBackColor = True - ' - 'cmdPscore - ' - Me.cmdPscore.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdPscore.Location = New System.Drawing.Point(208, 12) - Me.cmdPscore.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) - Me.cmdPscore.Name = "cmdPscore" - Me.cmdPscore.Size = New System.Drawing.Size(69, 30) - Me.cmdPscore.TabIndex = 163 - Me.cmdPscore.Text = "pscore" - Me.cmdPscore.UseVisualStyleBackColor = True - ' - 'cmdSlope - ' - Me.cmdSlope.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdSlope.Location = New System.Drawing.Point(208, 41) - Me.cmdSlope.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) - Me.cmdSlope.Name = "cmdSlope" - Me.cmdSlope.Size = New System.Drawing.Size(69, 30) - Me.cmdSlope.TabIndex = 164 - Me.cmdSlope.Text = "slope" - Me.cmdSlope.UseVisualStyleBackColor = True - ' 'ucrInputModels ' Me.ucrInputModels.AddQuotesIfUnrecognised = True diff --git a/instat/dlgUseModel.vb b/instat/dlgUseModel.vb index 07283bebdb6..264ce6b5c55 100644 --- a/instat/dlgUseModel.vb +++ b/instat/dlgUseModel.vb @@ -22,6 +22,7 @@ Public Class dlgUseModel Public bReset As Boolean = True Public bUpdating As Boolean = False + Private clsAttach As New RFunction Private Sub dlgUseModelLoad(sender As Object, e As EventArgs) Handles Me.Load If bFirstLoad Then InitialiseDialog() @@ -56,6 +57,10 @@ Public Class dlgUseModel Private Sub SetDefaults() ' ucrBase.iHelpTopicID = 379 + clsAttach = New RFunction + + clsAttach.SetRCommand("attach") + clsAttach.AddParameter("what", clsRFunctionParameter:=ucrSelectorUseModel.ucrAvailableDataFrames.clsCurrDataFrame, iPosition:=0) ucrSelectorUseModel.Reset() @@ -65,8 +70,10 @@ Public Class dlgUseModel ucrInputComboRPackage.SetName("General") ucrBase.clsRsyntax.ClearCodes() + ucrBase.clsRsyntax.AddToBeforeCodes(clsAttach, 1) ucrBase.clsRsyntax.SetCommandString("") ucrBase.clsRsyntax.iCallType = 2 + KeyboardsVisibility() GetModels() TestOkEnabled() @@ -165,6 +172,7 @@ Public Class dlgUseModel If i > 0 Then ucrInputModels.SetName(String.Join(", ", lstModels)) End If + End Sub Private Sub cmdPrint_Click(sender As Object, e As EventArgs) Handles cmdPrint.Click @@ -234,58 +242,58 @@ Public Class dlgUseModel End Sub Private Sub cmdSegmented_Click(sender As Object, e As EventArgs) Handles cmdSegmented.Click - ucrReceiverForTestColumn.AddToReceiverAtCursorPosition(" segmented::segmented()", 1) + ucrReceiverForTestColumn.AddToReceiverAtCursorPosition("segmented::segmented()", 1) End Sub Private Sub cmdAapc_Click(sender As Object, e As EventArgs) Handles cmdAapc.Click - ucrReceiverForTestColumn.AddToReceiverAtCursorPosition(" segmented::aapc()", 1) + ucrReceiverForTestColumn.AddToReceiverAtCursorPosition("segmented::aapc()", 1) End Sub Private Sub cmdSegmentedPrint_Click(sender As Object, e As EventArgs) Handles cmdSegmentedPrint.Click - ucrReceiverForTestColumn.AddToReceiverAtCursorPosition(" print()", 1) + ucrReceiverForTestColumn.AddToReceiverAtCursorPosition("print()", 1) End Sub Private Sub cmdPscore_Click(sender As Object, e As EventArgs) Handles cmdPscore.Click - ucrReceiverForTestColumn.AddToReceiverAtCursorPosition(" segmented::pscore.test()", 1) + ucrReceiverForTestColumn.AddToReceiverAtCursorPosition("segmented::pscore.test()", 1) End Sub Private Sub cmdSegmentedSummary_Click(sender As Object, e As EventArgs) Handles cmdSegmentedSummary.Click - ucrReceiverForTestColumn.AddToReceiverAtCursorPosition(" summary()", 1) + ucrReceiverForTestColumn.AddToReceiverAtCursorPosition("summary()", 1) End Sub Private Sub cmdConfint_Click(sender As Object, e As EventArgs) Handles cmdConfint.Click - ucrReceiverForTestColumn.AddToReceiverAtCursorPosition(" confint()", 1) + ucrReceiverForTestColumn.AddToReceiverAtCursorPosition("confint()", 1) End Sub Private Sub cmdVcov_Click(sender As Object, e As EventArgs) Handles cmdVcov.Click - ucrReceiverForTestColumn.AddToReceiverAtCursorPosition(" vcov()", 1) + ucrReceiverForTestColumn.AddToReceiverAtCursorPosition("vcov()", 1) End Sub Private Sub cmdSlope_Click(sender As Object, e As EventArgs) Handles cmdSlope.Click - ucrReceiverForTestColumn.AddToReceiverAtCursorPosition(" segmented::slope()", 1) + ucrReceiverForTestColumn.AddToReceiverAtCursorPosition("segmented::slope()", 1) End Sub Private Sub cmdSegmentedPredict_Click(sender As Object, e As EventArgs) Handles cmdSegmentedPredict.Click - ucrReceiverForTestColumn.AddToReceiverAtCursorPosition(" predict()", 1) + ucrReceiverForTestColumn.AddToReceiverAtCursorPosition("predict()", 1) End Sub Private Sub cmdPlotLines_Click(sender As Object, e As EventArgs) Handles cmdPlotLines.Click - ucrReceiverForTestColumn.AddToReceiverAtCursorPosition(" plot lines()", 1) + ucrReceiverForTestColumn.AddToReceiverAtCursorPosition("plot lines()", 1) End Sub Private Sub cmdPoints_Click(sender As Object, e As EventArgs) Handles cmdPoints.Click - ucrReceiverForTestColumn.AddToReceiverAtCursorPosition(" points()", 1) + ucrReceiverForTestColumn.AddToReceiverAtCursorPosition("points()", 1) End Sub Private Sub cmdBroken_Click(sender As Object, e As EventArgs) Handles cmdBroken.Click - ucrReceiverForTestColumn.AddToReceiverAtCursorPosition(" segmented::broken.line()", 1) + ucrReceiverForTestColumn.AddToReceiverAtCursorPosition("segmented::broken.line()", 1) End Sub Private Sub cmdDavies_Click(sender As Object, e As EventArgs) Handles cmdDavies.Click - ucrReceiverForTestColumn.AddToReceiverAtCursorPosition(" segmented::davies.test()", 1) + ucrReceiverForTestColumn.AddToReceiverAtCursorPosition("segmented::davies.test()", 1) End Sub Private Sub cmdIntercept_Click(sender As Object, e As EventArgs) Handles cmdIntercept.Click - ucrReceiverForTestColumn.AddToReceiverAtCursorPosition(" segmented::intercept()", 1) + ucrReceiverForTestColumn.AddToReceiverAtCursorPosition("segmented::intercept()", 1) End Sub End Class \ No newline at end of file From 8205325b897323204dcb34802514607e7c68a315 Mon Sep 17 00:00:00 2001 From: ivanluv Date: Fri, 22 Nov 2019 14:57:11 +0300 Subject: [PATCH 3/4] Minor additions --- instat/dlgUseModel.vb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/instat/dlgUseModel.vb b/instat/dlgUseModel.vb index 264ce6b5c55..6b3c4f4227c 100644 --- a/instat/dlgUseModel.vb +++ b/instat/dlgUseModel.vb @@ -23,6 +23,7 @@ Public Class dlgUseModel Public bUpdating As Boolean = False Private clsAttach As New RFunction + Private Sub dlgUseModelLoad(sender As Object, e As EventArgs) Handles Me.Load If bFirstLoad Then InitialiseDialog() @@ -53,6 +54,7 @@ Public Class dlgUseModel ucrInputModels.IsReadOnly = True bUpdating = False + End Sub Private Sub SetDefaults() @@ -70,7 +72,7 @@ Public Class dlgUseModel ucrInputComboRPackage.SetName("General") ucrBase.clsRsyntax.ClearCodes() - ucrBase.clsRsyntax.AddToBeforeCodes(clsAttach, 1) + ucrBase.clsRsyntax.SetCommandString("") ucrBase.clsRsyntax.iCallType = 2 @@ -172,7 +174,13 @@ Public Class dlgUseModel If i > 0 Then ucrInputModels.SetName(String.Join(", ", lstModels)) End If + 'Checking if the commandString contains the commands from the segmented ,davie and pscore buttons.If so Again check if the list of before codes contains the clsAttach function before adiing + If Not (InStr(ucrBase.clsRsyntax.strCommandString, "segmented::segmented") = 0) Or Not (InStr(ucrBase.clsRsyntax.strCommandString, "segmented::davies.test") = 0) Or Not (InStr(ucrBase.clsRsyntax.strCommandString, "segmented::pscore.test") = 0) Then + If Not ucrBase.clsRsyntax.lstBeforeCodes.Contains(clsAttach) Then + ucrBase.clsRsyntax.AddToBeforeCodes(clsAttach) + End If + End If End Sub Private Sub cmdPrint_Click(sender As Object, e As EventArgs) Handles cmdPrint.Click From 33524df151973df92011e3fcef01ef1a1b691334 Mon Sep 17 00:00:00 2001 From: ivanluv Date: Mon, 25 Nov 2019 14:33:26 +0300 Subject: [PATCH 4/4] changing from plot lines to plot --- instat/dlgUseModel.Designer.vb | 2 +- instat/dlgUseModel.vb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/instat/dlgUseModel.Designer.vb b/instat/dlgUseModel.Designer.vb index a68eabfae7d..0a5150aea44 100644 --- a/instat/dlgUseModel.Designer.vb +++ b/instat/dlgUseModel.Designer.vb @@ -465,7 +465,7 @@ Partial Class dlgUseModel Me.cmdPlotLines.Name = "cmdPlotLines" Me.cmdPlotLines.Size = New System.Drawing.Size(69, 30) Me.cmdPlotLines.TabIndex = 158 - Me.cmdPlotLines.Text = "plot lines" + Me.cmdPlotLines.Text = "plot " Me.cmdPlotLines.UseVisualStyleBackColor = True ' 'cmdSegmentedPredict diff --git a/instat/dlgUseModel.vb b/instat/dlgUseModel.vb index 6b3c4f4227c..6314d306974 100644 --- a/instat/dlgUseModel.vb +++ b/instat/dlgUseModel.vb @@ -286,7 +286,7 @@ Public Class dlgUseModel End Sub Private Sub cmdPlotLines_Click(sender As Object, e As EventArgs) Handles cmdPlotLines.Click - ucrReceiverForTestColumn.AddToReceiverAtCursorPosition("plot lines()", 1) + ucrReceiverForTestColumn.AddToReceiverAtCursorPosition("plot()", 1) End Sub Private Sub cmdPoints_Click(sender As Object, e As EventArgs) Handles cmdPoints.Click