From ee82f5cdbbedcbdcc235eb330bf0052eb2340816 Mon Sep 17 00:00:00 2001 From: Alex Sananka Date: Mon, 6 Mar 2017 08:15:57 +0300 Subject: [PATCH 01/34] Edits --- instat/dlgRegularSequence.designer.vb | 326 +++++++++++++------------- instat/dlgRegularSequence.vb | 123 +++++----- 2 files changed, 224 insertions(+), 225 deletions(-) diff --git a/instat/dlgRegularSequence.designer.vb b/instat/dlgRegularSequence.designer.vb index ab3673ea3c3..4ba30da5a3e 100644 --- a/instat/dlgRegularSequence.designer.vb +++ b/instat/dlgRegularSequence.designer.vb @@ -22,18 +22,9 @@ Partial Class dlgRegularSequence 'Do not modify it using the code editor. Private Sub InitializeComponent() - Me.grpSequenceType = New System.Windows.Forms.GroupBox() - Me.rdoDates = New System.Windows.Forms.RadioButton() - Me.rdoNumeric = New System.Windows.Forms.RadioButton() Me.grpSequenceDefinition = New System.Windows.Forms.GroupBox() - Me.lblNumberDecimalPlaces = New System.Windows.Forms.Label() - Me.nudNumberofDecimalPlaces = New System.Windows.Forms.NumericUpDown() - Me.nudTo = New System.Windows.Forms.NumericUpDown() - Me.nudFrom = New System.Windows.Forms.NumericUpDown() - Me.nudRepeatValues = New System.Windows.Forms.NumericUpDown() Me.ucrDataFrameLengthForRegularSequence = New instat.ucrDataFrameLength() Me.dtpSelectorB = New System.Windows.Forms.DateTimePicker() - Me.nudInStepsOf = New System.Windows.Forms.NumericUpDown() Me.dtpSelectorA = New System.Windows.Forms.DateTimePicker() Me.lblLength = New System.Windows.Forms.Label() Me.chkDefineAsFactor = New System.Windows.Forms.CheckBox() @@ -44,70 +35,34 @@ Partial Class dlgRegularSequence Me.lblFrom = New System.Windows.Forms.Label() Me.lblPreview = New System.Windows.Forms.Label() Me.txtGetPreview = New System.Windows.Forms.RichTextBox() - Me.lblNewColumnName = New System.Windows.Forms.Label() Me.txtMessage = New System.Windows.Forms.TextBox() - Me.ucrNewColumnName = New instat.ucrInputComboBox() Me.ucrSelectDataFrameRegularSequence = New instat.ucrDataFrame() Me.ucrBase = New instat.ucrButtons() - Me.grpSequenceType.SuspendLayout() + Me.ucrNudFrom = New instat.ucrNud() + Me.ucrNudTo = New instat.ucrNud() + Me.ucrNudInStepsOf = New instat.ucrNud() + Me.ucrNudRepeatValues = New instat.ucrNud() + Me.lblNumberDecimalPlaces = New System.Windows.Forms.Label() + Me.ucrNewColumnName = New instat.ucrSave() + Me.grpSequenceType = New System.Windows.Forms.GroupBox() + Me.ucrPnlSequenceType = New instat.UcrPanel() + Me.rdoDates = New System.Windows.Forms.RadioButton() + Me.rdoNumeric = New System.Windows.Forms.RadioButton() + Me.ucrNudNumberOfDecimalPlaces = New instat.ucrNud() Me.grpSequenceDefinition.SuspendLayout() - CType(Me.nudNumberofDecimalPlaces, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.nudTo, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.nudFrom, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.nudRepeatValues, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.nudInStepsOf, System.ComponentModel.ISupportInitialize).BeginInit() + Me.grpSequenceType.SuspendLayout() Me.SuspendLayout() ' - 'grpSequenceType - ' - Me.grpSequenceType.Controls.Add(Me.rdoDates) - Me.grpSequenceType.Controls.Add(Me.rdoNumeric) - Me.grpSequenceType.FlatStyle = System.Windows.Forms.FlatStyle.Popup - Me.grpSequenceType.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.grpSequenceType.Location = New System.Drawing.Point(11, 58) - Me.grpSequenceType.Name = "grpSequenceType" - Me.grpSequenceType.Size = New System.Drawing.Size(204, 47) - Me.grpSequenceType.TabIndex = 1 - Me.grpSequenceType.TabStop = False - Me.grpSequenceType.Tag = "Sequence_type" - Me.grpSequenceType.Text = "Sequence Type" - ' - 'rdoDates - ' - Me.rdoDates.AutoSize = True - Me.rdoDates.FlatStyle = System.Windows.Forms.FlatStyle.System - Me.rdoDates.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.rdoDates.Location = New System.Drawing.Point(103, 19) - Me.rdoDates.Name = "rdoDates" - Me.rdoDates.Size = New System.Drawing.Size(59, 18) - Me.rdoDates.TabIndex = 1 - Me.rdoDates.Tag = "Dates" - Me.rdoDates.Text = "Dates" - Me.rdoDates.UseVisualStyleBackColor = True - ' - 'rdoNumeric - ' - Me.rdoNumeric.AutoSize = True - Me.rdoNumeric.FlatStyle = System.Windows.Forms.FlatStyle.System - Me.rdoNumeric.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.rdoNumeric.Location = New System.Drawing.Point(6, 19) - Me.rdoNumeric.Name = "rdoNumeric" - Me.rdoNumeric.Size = New System.Drawing.Size(70, 18) - Me.rdoNumeric.TabIndex = 0 - Me.rdoNumeric.Tag = "Numeric" - Me.rdoNumeric.Text = "Numeric" - Me.rdoNumeric.UseVisualStyleBackColor = True - ' 'grpSequenceDefinition ' + Me.grpSequenceDefinition.Controls.Add(Me.ucrNudNumberOfDecimalPlaces) + Me.grpSequenceDefinition.Controls.Add(Me.ucrNudRepeatValues) + Me.grpSequenceDefinition.Controls.Add(Me.ucrNudInStepsOf) + Me.grpSequenceDefinition.Controls.Add(Me.ucrNudTo) + Me.grpSequenceDefinition.Controls.Add(Me.ucrNudFrom) Me.grpSequenceDefinition.Controls.Add(Me.lblNumberDecimalPlaces) - Me.grpSequenceDefinition.Controls.Add(Me.nudNumberofDecimalPlaces) - Me.grpSequenceDefinition.Controls.Add(Me.nudTo) - Me.grpSequenceDefinition.Controls.Add(Me.nudFrom) - Me.grpSequenceDefinition.Controls.Add(Me.nudRepeatValues) Me.grpSequenceDefinition.Controls.Add(Me.ucrDataFrameLengthForRegularSequence) Me.grpSequenceDefinition.Controls.Add(Me.dtpSelectorB) - Me.grpSequenceDefinition.Controls.Add(Me.nudInStepsOf) Me.grpSequenceDefinition.Controls.Add(Me.dtpSelectorA) Me.grpSequenceDefinition.Controls.Add(Me.lblLength) Me.grpSequenceDefinition.Controls.Add(Me.chkDefineAsFactor) @@ -126,58 +81,13 @@ Partial Class dlgRegularSequence Me.grpSequenceDefinition.Text = "Sequence Definition" Me.grpSequenceDefinition.UseCompatibleTextRendering = True ' - 'lblNumberDecimalPlaces - ' - Me.lblNumberDecimalPlaces.AutoSize = True - Me.lblNumberDecimalPlaces.Location = New System.Drawing.Point(12, 183) - Me.lblNumberDecimalPlaces.Name = "lblNumberDecimalPlaces" - Me.lblNumberDecimalPlaces.Size = New System.Drawing.Size(135, 13) - Me.lblNumberDecimalPlaces.TabIndex = 14 - Me.lblNumberDecimalPlaces.Text = "Number of Decimal Places:" - ' - 'nudNumberofDecimalPlaces - ' - Me.nudNumberofDecimalPlaces.Location = New System.Drawing.Point(150, 180) - Me.nudNumberofDecimalPlaces.Maximum = New Decimal(New Integer() {5, 0, 0, 0}) - Me.nudNumberofDecimalPlaces.Name = "nudNumberofDecimalPlaces" - Me.nudNumberofDecimalPlaces.Size = New System.Drawing.Size(45, 20) - Me.nudNumberofDecimalPlaces.TabIndex = 15 - ' - 'nudTo - ' - Me.nudTo.Location = New System.Drawing.Point(98, 51) - Me.nudTo.Maximum = New Decimal(New Integer() {2147483647, 0, 0, 0}) - Me.nudTo.Minimum = New Decimal(New Integer() {2147483647, 0, 0, -2147483648}) - Me.nudTo.Name = "nudTo" - Me.nudTo.Size = New System.Drawing.Size(51, 20) - Me.nudTo.TabIndex = 4 - ' - 'nudFrom - ' - Me.nudFrom.Location = New System.Drawing.Point(98, 24) - Me.nudFrom.Maximum = New Decimal(New Integer() {2147483647, 0, 0, 0}) - Me.nudFrom.Minimum = New Decimal(New Integer() {2147483647, 0, 0, -2147483648}) - Me.nudFrom.Name = "nudFrom" - Me.nudFrom.Size = New System.Drawing.Size(51, 20) - Me.nudFrom.TabIndex = 1 - ' - 'nudRepeatValues - ' - Me.nudRepeatValues.Location = New System.Drawing.Point(98, 104) - Me.nudRepeatValues.Maximum = New Decimal(New Integer() {2147483647, 0, 0, 0}) - Me.nudRepeatValues.Minimum = New Decimal(New Integer() {1, 0, 0, 0}) - Me.nudRepeatValues.Name = "nudRepeatValues" - Me.nudRepeatValues.Size = New System.Drawing.Size(51, 20) - Me.nudRepeatValues.TabIndex = 9 - Me.nudRepeatValues.Value = New Decimal(New Integer() {1, 0, 0, 0}) - ' 'ucrDataFrameLengthForRegularSequence ' - Me.ucrDataFrameLengthForRegularSequence.ucrDataFrameSelector = Nothing Me.ucrDataFrameLengthForRegularSequence.Location = New System.Drawing.Point(98, 130) Me.ucrDataFrameLengthForRegularSequence.Name = "ucrDataFrameLengthForRegularSequence" Me.ucrDataFrameLengthForRegularSequence.Size = New System.Drawing.Size(51, 23) Me.ucrDataFrameLengthForRegularSequence.TabIndex = 12 + Me.ucrDataFrameLengthForRegularSequence.ucrDataFrameSelector = Nothing ' 'dtpSelectorB ' @@ -186,16 +96,6 @@ Partial Class dlgRegularSequence Me.dtpSelectorB.Size = New System.Drawing.Size(87, 20) Me.dtpSelectorB.TabIndex = 5 ' - 'nudInStepsOf - ' - Me.nudInStepsOf.Location = New System.Drawing.Point(98, 78) - Me.nudInStepsOf.Maximum = New Decimal(New Integer() {2147483647, 0, 0, 0}) - Me.nudInStepsOf.Minimum = New Decimal(New Integer() {2147483647, 0, 0, -2147483648}) - Me.nudInStepsOf.Name = "nudInStepsOf" - Me.nudInStepsOf.Size = New System.Drawing.Size(51, 20) - Me.nudInStepsOf.TabIndex = 7 - Me.nudInStepsOf.Value = New Decimal(New Integer() {1, 0, 0, 0}) - ' 'dtpSelectorA ' Me.dtpSelectorA.Location = New System.Drawing.Point(98, 24) @@ -206,7 +106,7 @@ Partial Class dlgRegularSequence 'lblLength ' Me.lblLength.AutoSize = True - Me.lblLength.Location = New System.Drawing.Point(12, 133) + Me.lblLength.Location = New System.Drawing.Point(10, 133) Me.lblLength.Name = "lblLength" Me.lblLength.Size = New System.Drawing.Size(43, 13) Me.lblLength.TabIndex = 11 @@ -218,7 +118,7 @@ Partial Class dlgRegularSequence Me.chkDefineAsFactor.AutoSize = True Me.chkDefineAsFactor.Checked = True Me.chkDefineAsFactor.CheckState = System.Windows.Forms.CheckState.Checked - Me.chkDefineAsFactor.Location = New System.Drawing.Point(15, 159) + Me.chkDefineAsFactor.Location = New System.Drawing.Point(10, 159) Me.chkDefineAsFactor.Name = "chkDefineAsFactor" Me.chkDefineAsFactor.Size = New System.Drawing.Size(104, 17) Me.chkDefineAsFactor.TabIndex = 13 @@ -239,7 +139,7 @@ Partial Class dlgRegularSequence 'lblRepeatValues ' Me.lblRepeatValues.AutoSize = True - Me.lblRepeatValues.Location = New System.Drawing.Point(12, 108) + Me.lblRepeatValues.Location = New System.Drawing.Point(10, 108) Me.lblRepeatValues.Name = "lblRepeatValues" Me.lblRepeatValues.Size = New System.Drawing.Size(80, 13) Me.lblRepeatValues.TabIndex = 8 @@ -250,7 +150,7 @@ Partial Class dlgRegularSequence ' Me.lblSteps.AutoSize = True Me.lblSteps.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.lblSteps.Location = New System.Drawing.Point(12, 82) + Me.lblSteps.Location = New System.Drawing.Point(10, 82) Me.lblSteps.Name = "lblSteps" Me.lblSteps.Size = New System.Drawing.Size(61, 13) Me.lblSteps.TabIndex = 6 @@ -261,7 +161,7 @@ Partial Class dlgRegularSequence ' Me.lblTo.AutoSize = True Me.lblTo.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.lblTo.Location = New System.Drawing.Point(12, 56) + Me.lblTo.Location = New System.Drawing.Point(10, 56) Me.lblTo.Name = "lblTo" Me.lblTo.Size = New System.Drawing.Size(23, 13) Me.lblTo.TabIndex = 3 @@ -272,12 +172,12 @@ Partial Class dlgRegularSequence ' Me.lblFrom.AutoSize = True Me.lblFrom.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.lblFrom.Location = New System.Drawing.Point(12, 30) + Me.lblFrom.Location = New System.Drawing.Point(10, 30) Me.lblFrom.Name = "lblFrom" - Me.lblFrom.Size = New System.Drawing.Size(30, 13) + Me.lblFrom.Size = New System.Drawing.Size(33, 13) Me.lblFrom.TabIndex = 0 Me.lblFrom.Tag = "From:" - Me.lblFrom.Text = "From" + Me.lblFrom.Text = "From:" ' 'lblPreview ' @@ -297,16 +197,6 @@ Partial Class dlgRegularSequence Me.txtGetPreview.TabIndex = 4 Me.txtGetPreview.Text = "" ' - 'lblNewColumnName - ' - Me.lblNewColumnName.AutoSize = True - Me.lblNewColumnName.Location = New System.Drawing.Point(10, 325) - Me.lblNewColumnName.Name = "lblNewColumnName" - Me.lblNewColumnName.Size = New System.Drawing.Size(101, 13) - Me.lblNewColumnName.TabIndex = 6 - Me.lblNewColumnName.Tag = "New_Column_Name" - Me.lblNewColumnName.Text = "New Column Name:" - ' 'txtMessage ' Me.txtMessage.Enabled = False @@ -317,14 +207,6 @@ Partial Class dlgRegularSequence Me.txtMessage.Size = New System.Drawing.Size(171, 58) Me.txtMessage.TabIndex = 5 ' - 'ucrNewColumnName - ' - Me.ucrNewColumnName.IsReadOnly = False - Me.ucrNewColumnName.Location = New System.Drawing.Point(113, 321) - Me.ucrNewColumnName.Name = "ucrNewColumnName" - Me.ucrNewColumnName.Size = New System.Drawing.Size(141, 21) - Me.ucrNewColumnName.TabIndex = 7 - ' 'ucrSelectDataFrameRegularSequence ' Me.ucrSelectDataFrameRegularSequence.bUseCurrentFilter = True @@ -341,20 +223,140 @@ Partial Class dlgRegularSequence Me.ucrBase.Size = New System.Drawing.Size(410, 52) Me.ucrBase.TabIndex = 8 ' + 'ucrNudFrom + ' + Me.ucrNudFrom.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudFrom.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudFrom.Location = New System.Drawing.Point(99, 25) + Me.ucrNudFrom.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudFrom.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudFrom.Name = "ucrNudFrom" + Me.ucrNudFrom.Size = New System.Drawing.Size(50, 20) + Me.ucrNudFrom.TabIndex = 17 + Me.ucrNudFrom.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrNudTo + ' + Me.ucrNudTo.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudTo.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudTo.Location = New System.Drawing.Point(99, 51) + Me.ucrNudTo.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudTo.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudTo.Name = "ucrNudTo" + Me.ucrNudTo.Size = New System.Drawing.Size(50, 20) + Me.ucrNudTo.TabIndex = 18 + Me.ucrNudTo.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrNudInStepsOf + ' + Me.ucrNudInStepsOf.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudInStepsOf.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudInStepsOf.Location = New System.Drawing.Point(99, 75) + Me.ucrNudInStepsOf.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudInStepsOf.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudInStepsOf.Name = "ucrNudInStepsOf" + Me.ucrNudInStepsOf.Size = New System.Drawing.Size(50, 20) + Me.ucrNudInStepsOf.TabIndex = 19 + Me.ucrNudInStepsOf.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrNudRepeatValues + ' + Me.ucrNudRepeatValues.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudRepeatValues.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudRepeatValues.Location = New System.Drawing.Point(99, 101) + Me.ucrNudRepeatValues.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudRepeatValues.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudRepeatValues.Name = "ucrNudRepeatValues" + Me.ucrNudRepeatValues.Size = New System.Drawing.Size(50, 20) + Me.ucrNudRepeatValues.TabIndex = 20 + Me.ucrNudRepeatValues.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'lblNumberDecimalPlaces + ' + Me.lblNumberDecimalPlaces.AutoSize = True + Me.lblNumberDecimalPlaces.Location = New System.Drawing.Point(10, 183) + Me.lblNumberDecimalPlaces.Name = "lblNumberDecimalPlaces" + Me.lblNumberDecimalPlaces.Size = New System.Drawing.Size(135, 13) + Me.lblNumberDecimalPlaces.TabIndex = 14 + Me.lblNumberDecimalPlaces.Text = "Number of Decimal Places:" + ' + 'ucrNewColumnName + ' + Me.ucrNewColumnName.Location = New System.Drawing.Point(11, 321) + Me.ucrNewColumnName.Name = "ucrNewColumnName" + Me.ucrNewColumnName.Size = New System.Drawing.Size(294, 24) + Me.ucrNewColumnName.TabIndex = 9 + ' + 'grpSequenceType + ' + Me.grpSequenceType.Controls.Add(Me.rdoNumeric) + Me.grpSequenceType.Controls.Add(Me.rdoDates) + Me.grpSequenceType.Controls.Add(Me.ucrPnlSequenceType) + Me.grpSequenceType.Location = New System.Drawing.Point(16, 53) + Me.grpSequenceType.Name = "grpSequenceType" + Me.grpSequenceType.Size = New System.Drawing.Size(199, 52) + Me.grpSequenceType.TabIndex = 16 + Me.grpSequenceType.TabStop = False + Me.grpSequenceType.Text = "Sequence Type" + ' + 'ucrPnlSequenceType + ' + Me.ucrPnlSequenceType.Location = New System.Drawing.Point(3, 20) + Me.ucrPnlSequenceType.Name = "ucrPnlSequenceType" + Me.ucrPnlSequenceType.Size = New System.Drawing.Size(176, 17) + Me.ucrPnlSequenceType.TabIndex = 0 + ' + 'rdoDates + ' + Me.rdoDates.AutoSize = True + Me.rdoDates.FlatStyle = System.Windows.Forms.FlatStyle.System + Me.rdoDates.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.rdoDates.Location = New System.Drawing.Point(122, 20) + Me.rdoDates.Name = "rdoDates" + Me.rdoDates.Size = New System.Drawing.Size(59, 18) + Me.rdoDates.TabIndex = 2 + Me.rdoDates.Tag = "Dates" + Me.rdoDates.Text = "Dates" + Me.rdoDates.UseVisualStyleBackColor = True + ' + 'rdoNumeric + ' + Me.rdoNumeric.AutoSize = True + Me.rdoNumeric.FlatStyle = System.Windows.Forms.FlatStyle.System + Me.rdoNumeric.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.rdoNumeric.Location = New System.Drawing.Point(10, 19) + Me.rdoNumeric.Name = "rdoNumeric" + Me.rdoNumeric.Size = New System.Drawing.Size(70, 18) + Me.rdoNumeric.TabIndex = 1 + Me.rdoNumeric.Tag = "Numeric" + Me.rdoNumeric.Text = "Numeric" + Me.rdoNumeric.UseVisualStyleBackColor = True + ' + 'ucrNudNumberOfDecimalPlaces + ' + Me.ucrNudNumberOfDecimalPlaces.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudNumberOfDecimalPlaces.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudNumberOfDecimalPlaces.Location = New System.Drawing.Point(142, 178) + Me.ucrNudNumberOfDecimalPlaces.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudNumberOfDecimalPlaces.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudNumberOfDecimalPlaces.Name = "ucrNudNumberOfDecimalPlaces" + Me.ucrNudNumberOfDecimalPlaces.Size = New System.Drawing.Size(50, 20) + Me.ucrNudNumberOfDecimalPlaces.TabIndex = 24 + Me.ucrNudNumberOfDecimalPlaces.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' 'dlgRegularSequence ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(419, 412) - Me.Controls.Add(Me.txtMessage) - Me.Controls.Add(Me.lblNewColumnName) + Me.Controls.Add(Me.grpSequenceType) Me.Controls.Add(Me.ucrNewColumnName) + Me.Controls.Add(Me.txtMessage) Me.Controls.Add(Me.txtGetPreview) Me.Controls.Add(Me.grpSequenceDefinition) Me.Controls.Add(Me.lblPreview) Me.Controls.Add(Me.ucrSelectDataFrameRegularSequence) Me.Controls.Add(Me.ucrBase) - Me.Controls.Add(Me.grpSequenceType) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.MaximizeBox = False Me.MinimizeBox = False @@ -363,24 +365,15 @@ Partial Class dlgRegularSequence Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Tag = "Entry_of_regular_sequence" Me.Text = "Regular Sequence" - Me.grpSequenceType.ResumeLayout(False) - Me.grpSequenceType.PerformLayout() Me.grpSequenceDefinition.ResumeLayout(False) Me.grpSequenceDefinition.PerformLayout() - CType(Me.nudNumberofDecimalPlaces, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.nudTo, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.nudFrom, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.nudRepeatValues, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.nudInStepsOf, System.ComponentModel.ISupportInitialize).EndInit() + Me.grpSequenceType.ResumeLayout(False) + Me.grpSequenceType.PerformLayout() Me.ResumeLayout(False) Me.PerformLayout() End Sub - - Friend WithEvents grpSequenceType As GroupBox - Friend WithEvents rdoNumeric As RadioButton Friend WithEvents grpSequenceDefinition As GroupBox - Friend WithEvents rdoDates As RadioButton Friend WithEvents lblSteps As Label Friend WithEvents lblTo As Label Friend WithEvents lblFrom As Label @@ -394,14 +387,17 @@ Partial Class dlgRegularSequence Friend WithEvents dtpSelectorA As DateTimePicker Friend WithEvents dtpSelectorB As DateTimePicker Friend WithEvents txtGetPreview As RichTextBox - Friend WithEvents nudTo As NumericUpDown - Friend WithEvents nudFrom As NumericUpDown - Friend WithEvents nudRepeatValues As NumericUpDown - Friend WithEvents nudInStepsOf As NumericUpDown Friend WithEvents ucrDataFrameLengthForRegularSequence As ucrDataFrameLength - Friend WithEvents ucrNewColumnName As ucrInputComboBox - Friend WithEvents lblNewColumnName As Label Friend WithEvents txtMessage As TextBox + Friend WithEvents ucrNudRepeatValues As ucrNud + Friend WithEvents ucrNudInStepsOf As ucrNud + Friend WithEvents ucrNudTo As ucrNud + Friend WithEvents ucrNudFrom As ucrNud Friend WithEvents lblNumberDecimalPlaces As Label - Friend WithEvents nudNumberofDecimalPlaces As NumericUpDown + Friend WithEvents ucrNewColumnName As ucrSave + Friend WithEvents grpSequenceType As GroupBox + Friend WithEvents rdoNumeric As RadioButton + Friend WithEvents rdoDates As RadioButton + Friend WithEvents ucrPnlSequenceType As UcrPanel + Friend WithEvents ucrNudNumberOfDecimalPlaces As ucrNud End Class diff --git a/instat/dlgRegularSequence.vb b/instat/dlgRegularSequence.vb index 149b6714aa3..3ffadff66ec 100644 --- a/instat/dlgRegularSequence.vb +++ b/instat/dlgRegularSequence.vb @@ -18,73 +18,76 @@ Imports RDotNet Public Class dlgRegularSequence Dim bIsExtended As Boolean = False - Public bFirstLoad As Boolean = True - Dim clsSeqFunction As New RFunction - Dim clsRepFunction As New RFunction - + Public bFirstLoad As Boolean = True + Private bReset As Boolean = True + Private clsSeqFunction, clsRepFunction As New RFunction Private Sub dlgRegularSequence_Load(sender As Object, e As EventArgs) Handles MyBase.Load autoTranslate(Me) If bFirstLoad Then InitialiseDialog() - SetDefaults() bFirstLoad = False - Else - ReopenDialog() End If + If bReset Then + SetDefaults() + End If + SetRCodeForControls(bReset) + bReset = False TestOKEnabled() End Sub + Private Sub SetRCodeForControls(bReset As Boolean) + End Sub Private Sub InitialiseDialog() clsSeqFunction.SetRCommand("seq") clsRepFunction.SetRCommand("rep") clsRepFunction.AddParameter("x", clsRFunctionParameter:=clsSeqFunction) - nudFrom.Minimum = Integer.MinValue - nudFrom.Maximum = Integer.MaxValue - nudTo.Minimum = Integer.MinValue - nudTo.Maximum = Integer.MaxValue - nudInStepsOf.Maximum = Integer.MaxValue - nudRepeatValues.Maximum = Integer.MaxValue + ucrNudFrom.Minimum = Integer.MinValue + ucrNudFrom.Maximum = Integer.MaxValue + ucrNudTo.Minimum = Integer.MinValue + ucrNudTo.Maximum = Integer.MaxValue + ucrNudInStepsOf.Maximum = Integer.MaxValue + ucrNudRepeatValues.Maximum = Integer.MaxValue ucrBase.iHelpTopicID = 30 ucrDataFrameLengthForRegularSequence.SetDataFrameSelector(ucrSelectDataFrameRegularSequence) ucrNewColumnName.SetPrefix("Regular") - ucrNewColumnName.SetItemsTypeAsColumns() - ucrNewColumnName.SetDefaultTypeAsColumn() + 'ucrNewColumnName.SetItemsTypeAsColumns() + 'ucrNewColumnName.SetDefaultTypeAsColumn() + 'ucrNewColumnName.SetDataFrameSelector(ucrSelectDataFrameRegularSequence) + 'ucrNewColumnName.SetValidationTypeAsRVariable() + ucrNewColumnName.SetIsTextBox() + ucrNewColumnName.SetSaveTypeAsColumn() ucrNewColumnName.SetDataFrameSelector(ucrSelectDataFrameRegularSequence) - ucrNewColumnName.SetValidationTypeAsRVariable() 'TODO complete dates option rdoDates.Enabled = False End Sub Private Sub SetDefaults() + clsRepFunction = New RFunction + clsSeqFunction = New RFunction rdoNumeric.Checked = True rdoDates.Checked = False ucrSelectDataFrameRegularSequence.Reset() ucrSelectDataFrameRegularSequence.Focus() - nudFrom.Value = 1 + ucrNudFrom.Value = 1 If ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text <> "" Then - nudTo.Value = ucrSelectDataFrameRegularSequence.iDataFrameLength + ucrNudTo.Value = ucrSelectDataFrameRegularSequence.iDataFrameLength End If - nudInStepsOf.Value = 1 - nudRepeatValues.Value = 1 + ucrNudInStepsOf.Value = 1 + ucrNudRepeatValues.Value = 1 SetNumericOrDatesParameters() CheckSequenceLength() - nudNumberofDecimalPlaces.Value = 2 + ucrNudNumberOfDecimalPlaces.Value = 2 ucrNewColumnName.SetPrefix("Regular") End Sub - - Private Sub ReopenDialog() - - End Sub - Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset SetDefaults() TestOKEnabled() End Sub Private Sub TestOKEnabled() - If Not ucrNewColumnName.IsEmpty Then + If Not ucrNewColumnName.IsComplete Then If rdoNumeric.Checked Then - If nudFrom.Text <> "" AndAlso nudTo.Text <> "" AndAlso nudInStepsOf.Text <> "" AndAlso nudRepeatValues.Text <> "" AndAlso ucrDataFrameLengthForRegularSequence.ucrDataFrameSelector.cboAvailableDataFrames.Text <> "" Then + If ucrNudFrom.Text <> "" AndAlso ucrNudTo.Text <> "" AndAlso ucrNudInStepsOf.Text <> "" AndAlso ucrNudRepeatValues.Text <> "" AndAlso ucrDataFrameLengthForRegularSequence.ucrDataFrameSelector.cboAvailableDataFrames.Text <> "" Then ucrBase.OKEnabled(True) Else ucrBase.OKEnabled(False) @@ -99,22 +102,22 @@ Public Class dlgRegularSequence End If End Sub - Private Sub grpSequenceType_CheckedChanged(sender As Object, e As EventArgs) Handles rdoDates.CheckedChanged, rdoNumeric.CheckedChanged + Private Sub grpSequenceType_CheckedChanged(sender As Object, e As EventArgs) End Sub Private Sub SetNumericOrDatesParameters() If rdoNumeric.Checked Then - nudFrom.Visible = True - nudTo.Visible = True + ucrNudFrom.Visible = True + ucrNudTo.Visible = True dtpSelectorA.Visible = False dtpSelectorB.Visible = False chkDefineAsFactor.Visible = False ElseIf rdoDates.Checked Then dtpSelectorA.Visible = True dtpSelectorB.Visible = True - nudFrom.Visible = False - nudTo.Visible = False + ucrNudFrom.Visible = False + ucrNudTo.Visible = False chkDefineAsFactor.Visible = True End If SetFromParameter() @@ -125,7 +128,7 @@ Public Class dlgRegularSequence TestOKEnabled() End Sub - Private Sub nudInstepsOf_TextChanged(sender As Object, e As EventArgs) Handles nudInStepsOf.TextChanged + Private Sub nudInstepsOf_TextChanged(sender As Object, e As EventArgs) SetInStepsOfParameter() CheckSequenceLength() TestOKEnabled() @@ -133,12 +136,12 @@ Public Class dlgRegularSequence Private Sub SetInStepsOfParameter() If rdoNumeric.Checked Then - If nudInStepsOf.Text <> "" Then - If (nudInStepsOf.Value = 1 AndAlso frmMain.clsInstatOptions.bIncludeRDefaultParameters) OrElse nudInStepsOf.Value <> 1 Then - If nudTo.Value >= nudFrom.Value Then - clsSeqFunction.AddParameter("by", nudInStepsOf.Value) + If ucrNudInStepsOf.Text <> "" Then + If (ucrNudInStepsOf.Value = 1 AndAlso frmMain.clsInstatOptions.bIncludeRDefaultParameters) OrElse ucrNudInStepsOf.Value <> 1 Then + If ucrNudTo.Value >= ucrNudFrom.Value Then + clsSeqFunction.AddParameter("by", ucrNudInStepsOf.Value) Else - clsSeqFunction.AddParameter("by", -nudInStepsOf.Value) + clsSeqFunction.AddParameter("by", -ucrNudInStepsOf.Value) End If Else clsSeqFunction.RemoveParameterByName("by") @@ -150,17 +153,17 @@ Public Class dlgRegularSequence clsSeqFunction.RemoveParameterByName("by") End If End Sub - Private Sub nudRepeatValues_TextChanged(sender As Object, e As EventArgs) Handles nudRepeatValues.TextChanged + Private Sub nudRepeatValues_TextChanged(sender As Object, e As EventArgs) SetRepeatProperties() TestOKEnabled() End Sub Private Sub SetRepeatProperties() - If nudRepeatValues.Text <> "" Then - If nudRepeatValues.Value > 1 Then + If ucrNudRepeatValues.Text <> "" Then + If ucrNudRepeatValues.Value > 1 Then ucrBase.clsRsyntax.SetBaseRFunction(clsRepFunction) clsSeqFunction.RemoveAssignTo() - clsRepFunction.AddParameter("each", nudRepeatValues.Value) + clsRepFunction.AddParameter("each", ucrNudRepeatValues.Value) Else clsRepFunction.RemoveParameterByName("each") ucrBase.clsRsyntax.SetBaseRFunction(clsSeqFunction) @@ -173,7 +176,7 @@ Public Class dlgRegularSequence CheckSequenceLength() End Sub - Private Sub nudFrom_TextChanged(sender As Object, e As EventArgs) Handles nudFrom.TextChanged + Private Sub nudFrom_TextChanged(sender As Object, e As EventArgs) SetFromParameter() CheckSequenceLength() TestOKEnabled() @@ -181,8 +184,8 @@ Public Class dlgRegularSequence Private Sub SetFromParameter() If rdoNumeric.Checked Then - If nudFrom.Text <> "" Then - clsSeqFunction.AddParameter("from", nudFrom.Value) + If ucrNudFrom.Text <> "" Then + clsSeqFunction.AddParameter("from", ucrNudFrom.Value) Else clsSeqFunction.RemoveParameterByName("from") End If @@ -191,7 +194,7 @@ Public Class dlgRegularSequence End If End Sub - Private Sub nudTo_TextChanged(sender As Object, e As EventArgs) Handles nudTo.TextChanged + Private Sub nudTo_TextChanged(sender As Object, e As EventArgs) SetToParameter() CheckSequenceLength() TestOKEnabled() @@ -199,8 +202,8 @@ Public Class dlgRegularSequence Private Sub SetToParameter() If rdoNumeric.Checked Then - If nudTo.Text <> "" Then - clsSeqFunction.AddParameter("to", nudTo.Value) + If ucrNudTo.Text <> "" Then + clsSeqFunction.AddParameter("to", ucrNudTo.Value) Else clsSeqFunction.RemoveParameterByName("to") End If @@ -219,7 +222,7 @@ Public Class dlgRegularSequence CheckSequenceLength() End Sub - Private Sub ucrInputCboRegularSequence_NameChanged() Handles ucrNewColumnName.NameChanged + Private Sub ucrInputCboRegularSequence_NameChanged() SetAssignTo() TestOKEnabled() End Sub @@ -228,9 +231,9 @@ Public Class dlgRegularSequence ucrBase.clsRsyntax.SetAssignTo(strAssignToName:=ucrNewColumnName.GetText, strTempDataframe:=ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text, strTempColumn:=ucrNewColumnName.GetText) End Sub Private Sub ucrSelectDataFrameRegularSequence_DataFrameChanged(sender As Object, e As EventArgs, strPrevDataFrame As String) Handles ucrSelectDataFrameRegularSequence.DataFrameChanged - nudTo.Value = ucrSelectDataFrameRegularSequence.iDataFrameLength - nudFrom.Value = 1 - nudTo.Value = ucrSelectDataFrameRegularSequence.iDataFrameLength + ucrNudTo.Value = ucrSelectDataFrameRegularSequence.iDataFrameLength + ucrNudFrom.Value = 1 + ucrNudTo.Value = ucrSelectDataFrameRegularSequence.iDataFrameLength SetNumericOrDatesParameters() CheckSequenceLength() TestOKEnabled() @@ -280,13 +283,13 @@ Public Class dlgRegularSequence End Try End Sub - Private Sub nudNumberofDecimalPlaces_TextChanged(sender As Object, e As EventArgs) Handles nudNumberofDecimalPlaces.TextChanged - nudFrom.DecimalPlaces = nudNumberofDecimalPlaces.Value - nudTo.DecimalPlaces = nudNumberofDecimalPlaces.Value - nudInStepsOf.DecimalPlaces = nudNumberofDecimalPlaces.Value - nudFrom.Increment = 10 ^ -(nudNumberofDecimalPlaces.Value) - nudTo.Increment = 10 ^ -(nudNumberofDecimalPlaces.Value) - nudInStepsOf.Increment = 10 ^ -(nudNumberofDecimalPlaces.Value) + Private Sub nudNumberofDecimalPlaces_TextChanged(sender As Object, e As EventArgs) + ucrNudFrom.DecimalPlaces = ucrNudNumberofDecimalPlaces.Value + ucrNudTo.DecimalPlaces = ucrNudNumberOfDecimalPlaces.Value + ucrNudInStepsOf.DecimalPlaces = ucrNudNumberOfDecimalPlaces.Value + ucrNudFrom.Increment = 10 ^ -(ucrNudNumberOfDecimalPlaces.Value) + ucrNudTo.Increment = 10 ^ -(ucrNudNumberOfDecimalPlaces.Value) + ucrNudInStepsOf.Increment = 10 ^ -(ucrNudNumberOfDecimalPlaces.Value) End Sub End Class \ No newline at end of file From 6a4ad98de04f3bfb7e237609a382945f42a26f21 Mon Sep 17 00:00:00 2001 From: Alex Sananka Date: Mon, 6 Mar 2017 19:31:09 +0300 Subject: [PATCH 02/34] More edits --- instat/dlgRegularSequence.designer.vb | 236 +++++++++++++------------- instat/dlgRegularSequence.vb | 113 +++++++----- 2 files changed, 184 insertions(+), 165 deletions(-) diff --git a/instat/dlgRegularSequence.designer.vb b/instat/dlgRegularSequence.designer.vb index 4ba30da5a3e..6a3767a07e8 100644 --- a/instat/dlgRegularSequence.designer.vb +++ b/instat/dlgRegularSequence.designer.vb @@ -23,6 +23,12 @@ Partial Class dlgRegularSequence Private Sub InitializeComponent() Me.grpSequenceDefinition = New System.Windows.Forms.GroupBox() + Me.ucrNudNumberOfDecimalPlaces = New instat.ucrNud() + Me.ucrNudRepeatValues = New instat.ucrNud() + Me.ucrNudInStepsOf = New instat.ucrNud() + Me.ucrNudTo = New instat.ucrNud() + Me.ucrNudFrom = New instat.ucrNud() + Me.lblNumberDecimalPlaces = New System.Windows.Forms.Label() Me.ucrDataFrameLengthForRegularSequence = New instat.ucrDataFrameLength() Me.dtpSelectorB = New System.Windows.Forms.DateTimePicker() Me.dtpSelectorA = New System.Windows.Forms.DateTimePicker() @@ -36,19 +42,13 @@ Partial Class dlgRegularSequence Me.lblPreview = New System.Windows.Forms.Label() Me.txtGetPreview = New System.Windows.Forms.RichTextBox() Me.txtMessage = New System.Windows.Forms.TextBox() - Me.ucrSelectDataFrameRegularSequence = New instat.ucrDataFrame() - Me.ucrBase = New instat.ucrButtons() - Me.ucrNudFrom = New instat.ucrNud() - Me.ucrNudTo = New instat.ucrNud() - Me.ucrNudInStepsOf = New instat.ucrNud() - Me.ucrNudRepeatValues = New instat.ucrNud() - Me.lblNumberDecimalPlaces = New System.Windows.Forms.Label() - Me.ucrNewColumnName = New instat.ucrSave() Me.grpSequenceType = New System.Windows.Forms.GroupBox() - Me.ucrPnlSequenceType = New instat.UcrPanel() - Me.rdoDates = New System.Windows.Forms.RadioButton() Me.rdoNumeric = New System.Windows.Forms.RadioButton() - Me.ucrNudNumberOfDecimalPlaces = New instat.ucrNud() + Me.rdoDates = New System.Windows.Forms.RadioButton() + Me.ucrPnlSequenceType = New instat.UcrPanel() + Me.ucrNewColumnName = New instat.ucrSave() + Me.ucrSelectDataFrameRegularSequence = New instat.ucrDataFrame() + Me.ucrBase = New instat.ucrButtons() Me.grpSequenceDefinition.SuspendLayout() Me.grpSequenceType.SuspendLayout() Me.SuspendLayout() @@ -81,6 +81,75 @@ Partial Class dlgRegularSequence Me.grpSequenceDefinition.Text = "Sequence Definition" Me.grpSequenceDefinition.UseCompatibleTextRendering = True ' + 'ucrNudNumberOfDecimalPlaces + ' + Me.ucrNudNumberOfDecimalPlaces.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudNumberOfDecimalPlaces.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudNumberOfDecimalPlaces.Location = New System.Drawing.Point(142, 178) + Me.ucrNudNumberOfDecimalPlaces.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudNumberOfDecimalPlaces.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudNumberOfDecimalPlaces.Name = "ucrNudNumberOfDecimalPlaces" + Me.ucrNudNumberOfDecimalPlaces.Size = New System.Drawing.Size(50, 20) + Me.ucrNudNumberOfDecimalPlaces.TabIndex = 24 + Me.ucrNudNumberOfDecimalPlaces.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrNudRepeatValues + ' + Me.ucrNudRepeatValues.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudRepeatValues.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudRepeatValues.Location = New System.Drawing.Point(99, 101) + Me.ucrNudRepeatValues.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudRepeatValues.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudRepeatValues.Name = "ucrNudRepeatValues" + Me.ucrNudRepeatValues.Size = New System.Drawing.Size(50, 20) + Me.ucrNudRepeatValues.TabIndex = 20 + Me.ucrNudRepeatValues.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrNudInStepsOf + ' + Me.ucrNudInStepsOf.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudInStepsOf.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudInStepsOf.Location = New System.Drawing.Point(99, 75) + Me.ucrNudInStepsOf.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudInStepsOf.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudInStepsOf.Name = "ucrNudInStepsOf" + Me.ucrNudInStepsOf.Size = New System.Drawing.Size(50, 20) + Me.ucrNudInStepsOf.TabIndex = 19 + Me.ucrNudInStepsOf.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrNudTo + ' + Me.ucrNudTo.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudTo.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudTo.Location = New System.Drawing.Point(99, 51) + Me.ucrNudTo.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudTo.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudTo.Name = "ucrNudTo" + Me.ucrNudTo.Size = New System.Drawing.Size(50, 20) + Me.ucrNudTo.TabIndex = 18 + Me.ucrNudTo.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrNudFrom + ' + Me.ucrNudFrom.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudFrom.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudFrom.Location = New System.Drawing.Point(99, 25) + Me.ucrNudFrom.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudFrom.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudFrom.Name = "ucrNudFrom" + Me.ucrNudFrom.Size = New System.Drawing.Size(50, 20) + Me.ucrNudFrom.TabIndex = 17 + Me.ucrNudFrom.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'lblNumberDecimalPlaces + ' + Me.lblNumberDecimalPlaces.AutoSize = True + Me.lblNumberDecimalPlaces.Location = New System.Drawing.Point(10, 183) + Me.lblNumberDecimalPlaces.Name = "lblNumberDecimalPlaces" + Me.lblNumberDecimalPlaces.Size = New System.Drawing.Size(135, 13) + Me.lblNumberDecimalPlaces.TabIndex = 14 + Me.lblNumberDecimalPlaces.Text = "Number of Decimal Places:" + ' 'ucrDataFrameLengthForRegularSequence ' Me.ucrDataFrameLengthForRegularSequence.Location = New System.Drawing.Point(98, 130) @@ -207,86 +276,6 @@ Partial Class dlgRegularSequence Me.txtMessage.Size = New System.Drawing.Size(171, 58) Me.txtMessage.TabIndex = 5 ' - 'ucrSelectDataFrameRegularSequence - ' - Me.ucrSelectDataFrameRegularSequence.bUseCurrentFilter = True - Me.ucrSelectDataFrameRegularSequence.Location = New System.Drawing.Point(10, 10) - Me.ucrSelectDataFrameRegularSequence.Margin = New System.Windows.Forms.Padding(0) - Me.ucrSelectDataFrameRegularSequence.Name = "ucrSelectDataFrameRegularSequence" - Me.ucrSelectDataFrameRegularSequence.Size = New System.Drawing.Size(120, 40) - Me.ucrSelectDataFrameRegularSequence.TabIndex = 0 - ' - 'ucrBase - ' - Me.ucrBase.Location = New System.Drawing.Point(10, 348) - Me.ucrBase.Name = "ucrBase" - Me.ucrBase.Size = New System.Drawing.Size(410, 52) - Me.ucrBase.TabIndex = 8 - ' - 'ucrNudFrom - ' - Me.ucrNudFrom.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudFrom.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudFrom.Location = New System.Drawing.Point(99, 25) - Me.ucrNudFrom.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudFrom.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudFrom.Name = "ucrNudFrom" - Me.ucrNudFrom.Size = New System.Drawing.Size(50, 20) - Me.ucrNudFrom.TabIndex = 17 - Me.ucrNudFrom.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrNudTo - ' - Me.ucrNudTo.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudTo.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudTo.Location = New System.Drawing.Point(99, 51) - Me.ucrNudTo.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudTo.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudTo.Name = "ucrNudTo" - Me.ucrNudTo.Size = New System.Drawing.Size(50, 20) - Me.ucrNudTo.TabIndex = 18 - Me.ucrNudTo.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrNudInStepsOf - ' - Me.ucrNudInStepsOf.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudInStepsOf.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudInStepsOf.Location = New System.Drawing.Point(99, 75) - Me.ucrNudInStepsOf.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudInStepsOf.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudInStepsOf.Name = "ucrNudInStepsOf" - Me.ucrNudInStepsOf.Size = New System.Drawing.Size(50, 20) - Me.ucrNudInStepsOf.TabIndex = 19 - Me.ucrNudInStepsOf.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrNudRepeatValues - ' - Me.ucrNudRepeatValues.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudRepeatValues.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudRepeatValues.Location = New System.Drawing.Point(99, 101) - Me.ucrNudRepeatValues.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudRepeatValues.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudRepeatValues.Name = "ucrNudRepeatValues" - Me.ucrNudRepeatValues.Size = New System.Drawing.Size(50, 20) - Me.ucrNudRepeatValues.TabIndex = 20 - Me.ucrNudRepeatValues.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'lblNumberDecimalPlaces - ' - Me.lblNumberDecimalPlaces.AutoSize = True - Me.lblNumberDecimalPlaces.Location = New System.Drawing.Point(10, 183) - Me.lblNumberDecimalPlaces.Name = "lblNumberDecimalPlaces" - Me.lblNumberDecimalPlaces.Size = New System.Drawing.Size(135, 13) - Me.lblNumberDecimalPlaces.TabIndex = 14 - Me.lblNumberDecimalPlaces.Text = "Number of Decimal Places:" - ' - 'ucrNewColumnName - ' - Me.ucrNewColumnName.Location = New System.Drawing.Point(11, 321) - Me.ucrNewColumnName.Name = "ucrNewColumnName" - Me.ucrNewColumnName.Size = New System.Drawing.Size(294, 24) - Me.ucrNewColumnName.TabIndex = 9 - ' 'grpSequenceType ' Me.grpSequenceType.Controls.Add(Me.rdoNumeric) @@ -299,19 +288,25 @@ Partial Class dlgRegularSequence Me.grpSequenceType.TabStop = False Me.grpSequenceType.Text = "Sequence Type" ' - 'ucrPnlSequenceType + 'rdoNumeric ' - Me.ucrPnlSequenceType.Location = New System.Drawing.Point(3, 20) - Me.ucrPnlSequenceType.Name = "ucrPnlSequenceType" - Me.ucrPnlSequenceType.Size = New System.Drawing.Size(176, 17) - Me.ucrPnlSequenceType.TabIndex = 0 + Me.rdoNumeric.AutoSize = True + Me.rdoNumeric.FlatStyle = System.Windows.Forms.FlatStyle.System + Me.rdoNumeric.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.rdoNumeric.Location = New System.Drawing.Point(10, 19) + Me.rdoNumeric.Name = "rdoNumeric" + Me.rdoNumeric.Size = New System.Drawing.Size(70, 18) + Me.rdoNumeric.TabIndex = 1 + Me.rdoNumeric.Tag = "Numeric" + Me.rdoNumeric.Text = "Numeric" + Me.rdoNumeric.UseVisualStyleBackColor = True ' 'rdoDates ' Me.rdoDates.AutoSize = True Me.rdoDates.FlatStyle = System.Windows.Forms.FlatStyle.System Me.rdoDates.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.rdoDates.Location = New System.Drawing.Point(122, 20) + Me.rdoDates.Location = New System.Drawing.Point(93, 20) Me.rdoDates.Name = "rdoDates" Me.rdoDates.Size = New System.Drawing.Size(59, 18) Me.rdoDates.TabIndex = 2 @@ -319,30 +314,35 @@ Partial Class dlgRegularSequence Me.rdoDates.Text = "Dates" Me.rdoDates.UseVisualStyleBackColor = True ' - 'rdoNumeric + 'ucrPnlSequenceType ' - Me.rdoNumeric.AutoSize = True - Me.rdoNumeric.FlatStyle = System.Windows.Forms.FlatStyle.System - Me.rdoNumeric.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.rdoNumeric.Location = New System.Drawing.Point(10, 19) - Me.rdoNumeric.Name = "rdoNumeric" - Me.rdoNumeric.Size = New System.Drawing.Size(70, 18) - Me.rdoNumeric.TabIndex = 1 - Me.rdoNumeric.Tag = "Numeric" - Me.rdoNumeric.Text = "Numeric" - Me.rdoNumeric.UseVisualStyleBackColor = True + Me.ucrPnlSequenceType.Location = New System.Drawing.Point(4, 9) + Me.ucrPnlSequenceType.Name = "ucrPnlSequenceType" + Me.ucrPnlSequenceType.Size = New System.Drawing.Size(189, 29) + Me.ucrPnlSequenceType.TabIndex = 0 ' - 'ucrNudNumberOfDecimalPlaces + 'ucrNewColumnName ' - Me.ucrNudNumberOfDecimalPlaces.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudNumberOfDecimalPlaces.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudNumberOfDecimalPlaces.Location = New System.Drawing.Point(142, 178) - Me.ucrNudNumberOfDecimalPlaces.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudNumberOfDecimalPlaces.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudNumberOfDecimalPlaces.Name = "ucrNudNumberOfDecimalPlaces" - Me.ucrNudNumberOfDecimalPlaces.Size = New System.Drawing.Size(50, 20) - Me.ucrNudNumberOfDecimalPlaces.TabIndex = 24 - Me.ucrNudNumberOfDecimalPlaces.Value = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNewColumnName.Location = New System.Drawing.Point(11, 321) + Me.ucrNewColumnName.Name = "ucrNewColumnName" + Me.ucrNewColumnName.Size = New System.Drawing.Size(294, 24) + Me.ucrNewColumnName.TabIndex = 9 + ' + 'ucrSelectDataFrameRegularSequence + ' + Me.ucrSelectDataFrameRegularSequence.bUseCurrentFilter = True + Me.ucrSelectDataFrameRegularSequence.Location = New System.Drawing.Point(10, 10) + Me.ucrSelectDataFrameRegularSequence.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectDataFrameRegularSequence.Name = "ucrSelectDataFrameRegularSequence" + Me.ucrSelectDataFrameRegularSequence.Size = New System.Drawing.Size(120, 40) + Me.ucrSelectDataFrameRegularSequence.TabIndex = 0 + ' + 'ucrBase + ' + Me.ucrBase.Location = New System.Drawing.Point(10, 348) + Me.ucrBase.Name = "ucrBase" + Me.ucrBase.Size = New System.Drawing.Size(410, 52) + Me.ucrBase.TabIndex = 8 ' 'dlgRegularSequence ' diff --git a/instat/dlgRegularSequence.vb b/instat/dlgRegularSequence.vb index 3ffadff66ec..2598f5921a6 100644 --- a/instat/dlgRegularSequence.vb +++ b/instat/dlgRegularSequence.vb @@ -13,6 +13,7 @@ ' ' You should have received a copy of the GNU General Public License k ' along with this program. If not, see . +Imports instat Imports instat.Translations Imports RDotNet @@ -35,46 +36,64 @@ Public Class dlgRegularSequence TestOKEnabled() End Sub Private Sub SetRCodeForControls(bReset As Boolean) - + ucrNudFrom.SetRCode(clsSeqFunction, bReset) + ucrNudTo.SetRCode(clsSeqFunction, bReset) + ucrNudRepeatValues.SetRCode(clsRepFunction) End Sub Private Sub InitialiseDialog() - clsSeqFunction.SetRCommand("seq") - clsRepFunction.SetRCommand("rep") - clsRepFunction.AddParameter("x", clsRFunctionParameter:=clsSeqFunction) - ucrNudFrom.Minimum = Integer.MinValue - ucrNudFrom.Maximum = Integer.MaxValue - ucrNudTo.Minimum = Integer.MinValue - ucrNudTo.Maximum = Integer.MaxValue + ucrBase.iHelpTopicID = 30 + + ucrPnlSequenceType.AddRadioButton(rdoNumeric) + ucrPnlSequenceType.AddRadioButton(rdoDates) + + ucrPnlSequenceType.AddFunctionNamesCondition(rdoNumeric, "seq") + ucrPnlSequenceType.AddFunctionNamesCondition(rdoDates, "as.Date") + + ucrPnlSequenceType.AddToLinkedControls(ucrNudFrom, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlSequenceType.AddToLinkedControls(ucrNudTo, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + 'ucrPnlSequenceType.AddToLinkedControls(dtpSelectorA, {rdoDates}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + 'ucrPnlSequenceType.AddToLinkedControls(dtpSelectorB, {rdoDates}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + + ucrNudFrom.SetParameter(New RParameter("from", 0)) + ucrNudTo.SetParameter(New RParameter("to", 1)) + ucrNudRepeatValues.SetParameter(New RParameter("by", 2)) + ucrNudFrom.SetMinMax(Integer.MinValue, Integer.MaxValue) + ucrNudTo.SetMinMax(Integer.MinValue, Integer.MaxValue) ucrNudInStepsOf.Maximum = Integer.MaxValue ucrNudRepeatValues.Maximum = Integer.MaxValue - ucrBase.iHelpTopicID = 30 - ucrDataFrameLengthForRegularSequence.SetDataFrameSelector(ucrSelectDataFrameRegularSequence) + + ucrNewColumnName.SetPrefix("Regular") - 'ucrNewColumnName.SetItemsTypeAsColumns() - 'ucrNewColumnName.SetDefaultTypeAsColumn() - 'ucrNewColumnName.SetDataFrameSelector(ucrSelectDataFrameRegularSequence) - 'ucrNewColumnName.SetValidationTypeAsRVariable() - ucrNewColumnName.SetIsTextBox() - ucrNewColumnName.SetSaveTypeAsColumn() ucrNewColumnName.SetDataFrameSelector(ucrSelectDataFrameRegularSequence) + ucrNewColumnName.SetIsComboBox() + ucrNewColumnName.SetSaveTypeAsColumn() + 'TODO complete dates option rdoDates.Enabled = False + dtpSelectorB.Visible = False + ucrNudFrom.Visible = False + ucrNudTo.Visible = False + chkDefineAsFactor.Visible = False End Sub Private Sub SetDefaults() clsRepFunction = New RFunction clsSeqFunction = New RFunction - rdoNumeric.Checked = True - rdoDates.Checked = False ucrSelectDataFrameRegularSequence.Reset() - ucrSelectDataFrameRegularSequence.Focus() - ucrNudFrom.Value = 1 + + clsSeqFunction.SetRCommand("seq") + clsSeqFunction.AddParameter("from", 1) + clsSeqFunction.AddParameter("to") + clsSeqFunction.AddParameter("by", 1) + clsRepFunction.SetRCommand("rep") + clsRepFunction.AddParameter("x", clsRFunctionParameter:=clsSeqFunction) + clsRepFunction.AddParameter("each", 1) + If ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text <> "" Then ucrNudTo.Value = ucrSelectDataFrameRegularSequence.iDataFrameLength End If - ucrNudInStepsOf.Value = 1 - ucrNudRepeatValues.Value = 1 - SetNumericOrDatesParameters() + + 'SetNumericOrDatesParameters() CheckSequenceLength() ucrNudNumberOfDecimalPlaces.Value = 2 ucrNewColumnName.SetPrefix("Regular") @@ -85,7 +104,7 @@ Public Class dlgRegularSequence End Sub Private Sub TestOKEnabled() - If Not ucrNewColumnName.IsComplete Then + If ucrNewColumnName.IsComplete Then If rdoNumeric.Checked Then If ucrNudFrom.Text <> "" AndAlso ucrNudTo.Text <> "" AndAlso ucrNudInStepsOf.Text <> "" AndAlso ucrNudRepeatValues.Text <> "" AndAlso ucrDataFrameLengthForRegularSequence.ucrDataFrameSelector.cboAvailableDataFrames.Text <> "" Then ucrBase.OKEnabled(True) @@ -106,27 +125,24 @@ Public Class dlgRegularSequence End Sub - Private Sub SetNumericOrDatesParameters() - If rdoNumeric.Checked Then - ucrNudFrom.Visible = True - ucrNudTo.Visible = True - dtpSelectorA.Visible = False - dtpSelectorB.Visible = False - chkDefineAsFactor.Visible = False - ElseIf rdoDates.Checked Then - dtpSelectorA.Visible = True - dtpSelectorB.Visible = True - ucrNudFrom.Visible = False - ucrNudTo.Visible = False - chkDefineAsFactor.Visible = True - End If - SetFromParameter() - SetToParameter() - SetInStepsOfParameter() - SetRepeatProperties() - CheckSequenceLength() - TestOKEnabled() - End Sub + ' ' Private Sub SetNumericOrDatesParameters() + ' If rdoNumeric.Checked Then + ' ucrNudFrom.Visible = True + ' ucrNudTo.Visible = True + ' dtpSelectorA.Visible = False + ' dtpSelectorB.Visible = False + ' chkDefineAsFactor.Visible = False + ' ElseIf rdoDates.Checked Then + ' dtpSelectorA.Visible = True + ' + ' End If + ' SetFromParameter() + ' SetToParameter() + ' SetInStepsOfParameter() + ' SetRepeatProperties() + ' CheckSequenceLength() + ' TestOKEnabled() + '' End Sub Private Sub nudInstepsOf_TextChanged(sender As Object, e As EventArgs) SetInStepsOfParameter() @@ -234,7 +250,7 @@ Public Class dlgRegularSequence ucrNudTo.Value = ucrSelectDataFrameRegularSequence.iDataFrameLength ucrNudFrom.Value = 1 ucrNudTo.Value = ucrSelectDataFrameRegularSequence.iDataFrameLength - SetNumericOrDatesParameters() + ' SetNumericOrDatesParameters() CheckSequenceLength() TestOKEnabled() End Sub @@ -284,7 +300,7 @@ Public Class dlgRegularSequence End Sub Private Sub nudNumberofDecimalPlaces_TextChanged(sender As Object, e As EventArgs) - ucrNudFrom.DecimalPlaces = ucrNudNumberofDecimalPlaces.Value + ucrNudFrom.DecimalPlaces = ucrNudNumberOfDecimalPlaces.Value ucrNudTo.DecimalPlaces = ucrNudNumberOfDecimalPlaces.Value ucrNudInStepsOf.DecimalPlaces = ucrNudNumberOfDecimalPlaces.Value ucrNudFrom.Increment = 10 ^ -(ucrNudNumberOfDecimalPlaces.Value) @@ -292,4 +308,7 @@ Public Class dlgRegularSequence ucrNudInStepsOf.Increment = 10 ^ -(ucrNudNumberOfDecimalPlaces.Value) End Sub + Private Sub ucrSelectDataFrameRegularSequence_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectDataFrameRegularSequence.ControlValueChanged, ucrNudTo.ControlValueChanged, ucrNudFrom.ControlValueChanged + CheckSequenceLength() + End Sub End Class \ No newline at end of file From e82a3823995350fa4da91b2fd97f2a89adec2a70 Mon Sep 17 00:00:00 2001 From: Alex Sananka Date: Tue, 7 Mar 2017 14:47:37 +0300 Subject: [PATCH 03/34] Minor edits --- instat/dlgRegularSequence.vb | 64 ++++++++++-------------------------- 1 file changed, 18 insertions(+), 46 deletions(-) diff --git a/instat/dlgRegularSequence.vb b/instat/dlgRegularSequence.vb index 2598f5921a6..a9063ab6b5e 100644 --- a/instat/dlgRegularSequence.vb +++ b/instat/dlgRegularSequence.vb @@ -36,9 +36,12 @@ Public Class dlgRegularSequence TestOKEnabled() End Sub Private Sub SetRCodeForControls(bReset As Boolean) + ucrDataFrameLengthForRegularSequence.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrNudFrom.SetRCode(clsSeqFunction, bReset) ucrNudTo.SetRCode(clsSeqFunction, bReset) - ucrNudRepeatValues.SetRCode(clsRepFunction) + ucrNudRepeatValues.SetRCode(clsRepFunction, bReset) + ucrNudInStepsOf.SetRCode(clsSeqFunction, bReset) + End Sub Private Sub InitialiseDialog() ucrBase.iHelpTopicID = 30 @@ -83,8 +86,9 @@ Public Class dlgRegularSequence clsSeqFunction.SetRCommand("seq") clsSeqFunction.AddParameter("from", 1) - clsSeqFunction.AddParameter("to") + clsSeqFunction.AddParameter("to", ucrSelectDataFrameRegularSequence.iDataFrameLength) clsSeqFunction.AddParameter("by", 1) + clsRepFunction.SetRCommand("rep") clsRepFunction.AddParameter("x", clsRFunctionParameter:=clsSeqFunction) clsRepFunction.AddParameter("each", 1) @@ -98,9 +102,20 @@ Public Class dlgRegularSequence ucrNudNumberOfDecimalPlaces.Value = 2 ucrNewColumnName.SetPrefix("Regular") End Sub + Private Sub ucrPnlSequenceTyp_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlSequenceType.ControlValueChanged + If rdoNumeric.Checked Then + ucrBase.clsRsyntax.SetBaseRFunction(clsSeqFunction) + ucrBase.clsRsyntax.SetBaseRFunction(clsRepFunction) + ElseIf rdoDates.Checked Then + ucrBase.clsRsyntax.SetFunction(frmMain.clsRLink.strInstatDataObject & "$as.Date") + + End If + End Sub + Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset SetDefaults() - TestOKEnabled() + TestOKEnabled() + SetRCodeForControls(True) End Sub Private Sub TestOKEnabled() @@ -159,14 +174,8 @@ Public Class dlgRegularSequence Else clsSeqFunction.AddParameter("by", -ucrNudInStepsOf.Value) End If - Else - clsSeqFunction.RemoveParameterByName("by") End If - Else - clsSeqFunction.RemoveParameterByName("by") End If - Else - clsSeqFunction.RemoveParameterByName("by") End If End Sub Private Sub nudRepeatValues_TextChanged(sender As Object, e As EventArgs) @@ -192,42 +201,6 @@ Public Class dlgRegularSequence CheckSequenceLength() End Sub - Private Sub nudFrom_TextChanged(sender As Object, e As EventArgs) - SetFromParameter() - CheckSequenceLength() - TestOKEnabled() - End Sub - - Private Sub SetFromParameter() - If rdoNumeric.Checked Then - If ucrNudFrom.Text <> "" Then - clsSeqFunction.AddParameter("from", ucrNudFrom.Value) - Else - clsSeqFunction.RemoveParameterByName("from") - End If - Else - clsSeqFunction.RemoveParameterByName("from") - End If - End Sub - - Private Sub nudTo_TextChanged(sender As Object, e As EventArgs) - SetToParameter() - CheckSequenceLength() - TestOKEnabled() - End Sub - - Private Sub SetToParameter() - If rdoNumeric.Checked Then - If ucrNudTo.Text <> "" Then - clsSeqFunction.AddParameter("to", ucrNudTo.Value) - Else - clsSeqFunction.RemoveParameterByName("to") - End If - Else - clsSeqFunction.RemoveParameterByName("to") - End If - End Sub - Private Sub dtpSelectorA_ValueChanged(sender As Object, e As EventArgs) Handles dtpSelectorA.ValueChanged ucrBase.clsRsyntax.AddParameter("from", "as.Date('" & Format(dtpSelectorA.Value, "yyyy/MM/dd") & "')") CheckSequenceLength() @@ -249,7 +222,6 @@ Public Class dlgRegularSequence Private Sub ucrSelectDataFrameRegularSequence_DataFrameChanged(sender As Object, e As EventArgs, strPrevDataFrame As String) Handles ucrSelectDataFrameRegularSequence.DataFrameChanged ucrNudTo.Value = ucrSelectDataFrameRegularSequence.iDataFrameLength ucrNudFrom.Value = 1 - ucrNudTo.Value = ucrSelectDataFrameRegularSequence.iDataFrameLength ' SetNumericOrDatesParameters() CheckSequenceLength() TestOKEnabled() From e1978b66b7749d1d08d6e3b43c7faee234c0571a Mon Sep 17 00:00:00 2001 From: Alex Sananka Date: Wed, 8 Mar 2017 19:17:28 +0300 Subject: [PATCH 04/34] Edits --- instat/dlgRegularSequence.designer.vb | 150 +++++++++++++------------- instat/dlgRegularSequence.vb | 102 ++++++------------ 2 files changed, 108 insertions(+), 144 deletions(-) diff --git a/instat/dlgRegularSequence.designer.vb b/instat/dlgRegularSequence.designer.vb index 6a3767a07e8..de6abdaa22c 100644 --- a/instat/dlgRegularSequence.designer.vb +++ b/instat/dlgRegularSequence.designer.vb @@ -23,13 +23,7 @@ Partial Class dlgRegularSequence Private Sub InitializeComponent() Me.grpSequenceDefinition = New System.Windows.Forms.GroupBox() - Me.ucrNudNumberOfDecimalPlaces = New instat.ucrNud() - Me.ucrNudRepeatValues = New instat.ucrNud() - Me.ucrNudInStepsOf = New instat.ucrNud() - Me.ucrNudTo = New instat.ucrNud() - Me.ucrNudFrom = New instat.ucrNud() Me.lblNumberDecimalPlaces = New System.Windows.Forms.Label() - Me.ucrDataFrameLengthForRegularSequence = New instat.ucrDataFrameLength() Me.dtpSelectorB = New System.Windows.Forms.DateTimePicker() Me.dtpSelectorA = New System.Windows.Forms.DateTimePicker() Me.lblLength = New System.Windows.Forms.Label() @@ -47,6 +41,12 @@ Partial Class dlgRegularSequence Me.rdoDates = New System.Windows.Forms.RadioButton() Me.ucrPnlSequenceType = New instat.UcrPanel() Me.ucrNewColumnName = New instat.ucrSave() + Me.ucrNudNumberOfDecimalPlaces = New instat.ucrNud() + Me.ucrNudRepeatValues = New instat.ucrNud() + Me.ucrNudInStepsOf = New instat.ucrNud() + Me.ucrNudTo = New instat.ucrNud() + Me.ucrNudFrom = New instat.ucrNud() + Me.ucrDataFrameLengthForRegularSequence = New instat.ucrDataFrameLength() Me.ucrSelectDataFrameRegularSequence = New instat.ucrDataFrame() Me.ucrBase = New instat.ucrButtons() Me.grpSequenceDefinition.SuspendLayout() @@ -81,66 +81,6 @@ Partial Class dlgRegularSequence Me.grpSequenceDefinition.Text = "Sequence Definition" Me.grpSequenceDefinition.UseCompatibleTextRendering = True ' - 'ucrNudNumberOfDecimalPlaces - ' - Me.ucrNudNumberOfDecimalPlaces.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudNumberOfDecimalPlaces.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudNumberOfDecimalPlaces.Location = New System.Drawing.Point(142, 178) - Me.ucrNudNumberOfDecimalPlaces.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudNumberOfDecimalPlaces.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudNumberOfDecimalPlaces.Name = "ucrNudNumberOfDecimalPlaces" - Me.ucrNudNumberOfDecimalPlaces.Size = New System.Drawing.Size(50, 20) - Me.ucrNudNumberOfDecimalPlaces.TabIndex = 24 - Me.ucrNudNumberOfDecimalPlaces.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrNudRepeatValues - ' - Me.ucrNudRepeatValues.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudRepeatValues.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudRepeatValues.Location = New System.Drawing.Point(99, 101) - Me.ucrNudRepeatValues.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudRepeatValues.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudRepeatValues.Name = "ucrNudRepeatValues" - Me.ucrNudRepeatValues.Size = New System.Drawing.Size(50, 20) - Me.ucrNudRepeatValues.TabIndex = 20 - Me.ucrNudRepeatValues.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrNudInStepsOf - ' - Me.ucrNudInStepsOf.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudInStepsOf.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudInStepsOf.Location = New System.Drawing.Point(99, 75) - Me.ucrNudInStepsOf.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudInStepsOf.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudInStepsOf.Name = "ucrNudInStepsOf" - Me.ucrNudInStepsOf.Size = New System.Drawing.Size(50, 20) - Me.ucrNudInStepsOf.TabIndex = 19 - Me.ucrNudInStepsOf.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrNudTo - ' - Me.ucrNudTo.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudTo.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudTo.Location = New System.Drawing.Point(99, 51) - Me.ucrNudTo.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudTo.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudTo.Name = "ucrNudTo" - Me.ucrNudTo.Size = New System.Drawing.Size(50, 20) - Me.ucrNudTo.TabIndex = 18 - Me.ucrNudTo.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrNudFrom - ' - Me.ucrNudFrom.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudFrom.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudFrom.Location = New System.Drawing.Point(99, 25) - Me.ucrNudFrom.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudFrom.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudFrom.Name = "ucrNudFrom" - Me.ucrNudFrom.Size = New System.Drawing.Size(50, 20) - Me.ucrNudFrom.TabIndex = 17 - Me.ucrNudFrom.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' 'lblNumberDecimalPlaces ' Me.lblNumberDecimalPlaces.AutoSize = True @@ -150,14 +90,6 @@ Partial Class dlgRegularSequence Me.lblNumberDecimalPlaces.TabIndex = 14 Me.lblNumberDecimalPlaces.Text = "Number of Decimal Places:" ' - 'ucrDataFrameLengthForRegularSequence - ' - Me.ucrDataFrameLengthForRegularSequence.Location = New System.Drawing.Point(98, 130) - Me.ucrDataFrameLengthForRegularSequence.Name = "ucrDataFrameLengthForRegularSequence" - Me.ucrDataFrameLengthForRegularSequence.Size = New System.Drawing.Size(51, 23) - Me.ucrDataFrameLengthForRegularSequence.TabIndex = 12 - Me.ucrDataFrameLengthForRegularSequence.ucrDataFrameSelector = Nothing - ' 'dtpSelectorB ' Me.dtpSelectorB.Location = New System.Drawing.Point(98, 51) @@ -316,7 +248,7 @@ Partial Class dlgRegularSequence ' 'ucrPnlSequenceType ' - Me.ucrPnlSequenceType.Location = New System.Drawing.Point(4, 9) + Me.ucrPnlSequenceType.Location = New System.Drawing.Point(4, 18) Me.ucrPnlSequenceType.Name = "ucrPnlSequenceType" Me.ucrPnlSequenceType.Size = New System.Drawing.Size(189, 29) Me.ucrPnlSequenceType.TabIndex = 0 @@ -328,6 +260,74 @@ Partial Class dlgRegularSequence Me.ucrNewColumnName.Size = New System.Drawing.Size(294, 24) Me.ucrNewColumnName.TabIndex = 9 ' + 'ucrNudNumberOfDecimalPlaces + ' + Me.ucrNudNumberOfDecimalPlaces.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudNumberOfDecimalPlaces.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudNumberOfDecimalPlaces.Location = New System.Drawing.Point(142, 178) + Me.ucrNudNumberOfDecimalPlaces.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudNumberOfDecimalPlaces.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudNumberOfDecimalPlaces.Name = "ucrNudNumberOfDecimalPlaces" + Me.ucrNudNumberOfDecimalPlaces.Size = New System.Drawing.Size(50, 20) + Me.ucrNudNumberOfDecimalPlaces.TabIndex = 24 + Me.ucrNudNumberOfDecimalPlaces.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrNudRepeatValues + ' + Me.ucrNudRepeatValues.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudRepeatValues.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudRepeatValues.Location = New System.Drawing.Point(99, 101) + Me.ucrNudRepeatValues.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudRepeatValues.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudRepeatValues.Name = "ucrNudRepeatValues" + Me.ucrNudRepeatValues.Size = New System.Drawing.Size(50, 20) + Me.ucrNudRepeatValues.TabIndex = 20 + Me.ucrNudRepeatValues.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrNudInStepsOf + ' + Me.ucrNudInStepsOf.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudInStepsOf.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudInStepsOf.Location = New System.Drawing.Point(99, 75) + Me.ucrNudInStepsOf.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudInStepsOf.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudInStepsOf.Name = "ucrNudInStepsOf" + Me.ucrNudInStepsOf.Size = New System.Drawing.Size(50, 20) + Me.ucrNudInStepsOf.TabIndex = 19 + Me.ucrNudInStepsOf.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrNudTo + ' + Me.ucrNudTo.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudTo.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudTo.Location = New System.Drawing.Point(99, 51) + Me.ucrNudTo.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudTo.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudTo.Name = "ucrNudTo" + Me.ucrNudTo.Size = New System.Drawing.Size(50, 20) + Me.ucrNudTo.TabIndex = 18 + Me.ucrNudTo.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrNudFrom + ' + Me.ucrNudFrom.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudFrom.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudFrom.Location = New System.Drawing.Point(99, 25) + Me.ucrNudFrom.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudFrom.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudFrom.Name = "ucrNudFrom" + Me.ucrNudFrom.Size = New System.Drawing.Size(50, 20) + Me.ucrNudFrom.TabIndex = 17 + Me.ucrNudFrom.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrDataFrameLengthForRegularSequence + ' + Me.ucrDataFrameLengthForRegularSequence.Location = New System.Drawing.Point(98, 130) + Me.ucrDataFrameLengthForRegularSequence.Name = "ucrDataFrameLengthForRegularSequence" + Me.ucrDataFrameLengthForRegularSequence.Size = New System.Drawing.Size(51, 23) + Me.ucrDataFrameLengthForRegularSequence.TabIndex = 12 + Me.ucrDataFrameLengthForRegularSequence.ucrDataFrameSelector = Nothing + ' 'ucrSelectDataFrameRegularSequence ' Me.ucrSelectDataFrameRegularSequence.bUseCurrentFilter = True diff --git a/instat/dlgRegularSequence.vb b/instat/dlgRegularSequence.vb index a9063ab6b5e..3f4b1ddad6c 100644 --- a/instat/dlgRegularSequence.vb +++ b/instat/dlgRegularSequence.vb @@ -33,10 +33,9 @@ Public Class dlgRegularSequence End If SetRCodeForControls(bReset) bReset = False - TestOKEnabled() End Sub Private Sub SetRCodeForControls(bReset As Boolean) - ucrDataFrameLengthForRegularSequence.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + ucrNewColumnName.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrNudFrom.SetRCode(clsSeqFunction, bReset) ucrNudTo.SetRCode(clsSeqFunction, bReset) ucrNudRepeatValues.SetRCode(clsRepFunction, bReset) @@ -53,13 +52,20 @@ Public Class dlgRegularSequence ucrPnlSequenceType.AddFunctionNamesCondition(rdoDates, "as.Date") ucrPnlSequenceType.AddToLinkedControls(ucrNudFrom, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrNudFrom.SetLinkedDisplayControl(lblFrom) ucrPnlSequenceType.AddToLinkedControls(ucrNudTo, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrNudTo.SetLinkedDisplayControl(lblTo) + ucrPnlSequenceType.AddToLinkedControls(ucrNudInStepsOf, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrNudInStepsOf.SetLinkedDisplayControl(lblSteps) + ucrPnlSequenceType.AddToLinkedControls(ucrNudRepeatValues, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrNudRepeatValues.SetLinkedDisplayControl(lblRepeatValues) 'ucrPnlSequenceType.AddToLinkedControls(dtpSelectorA, {rdoDates}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) 'ucrPnlSequenceType.AddToLinkedControls(dtpSelectorB, {rdoDates}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrNudFrom.SetParameter(New RParameter("from", 0)) ucrNudTo.SetParameter(New RParameter("to", 1)) - ucrNudRepeatValues.SetParameter(New RParameter("by", 2)) + ucrNudRepeatValues.SetParameter(New RParameter("each", 1)) + ucrNudInStepsOf.SetParameter(New RParameter("by", 2)) ucrNudFrom.SetMinMax(Integer.MinValue, Integer.MaxValue) ucrNudTo.SetMinMax(Integer.MinValue, Integer.MaxValue) ucrNudInStepsOf.Maximum = Integer.MaxValue @@ -74,6 +80,7 @@ Public Class dlgRegularSequence 'TODO complete dates option rdoDates.Enabled = False dtpSelectorB.Visible = False + dtpSelectorA.Visible = False ucrNudFrom.Visible = False ucrNudTo.Visible = False chkDefineAsFactor.Visible = False @@ -92,6 +99,7 @@ Public Class dlgRegularSequence clsRepFunction.SetRCommand("rep") clsRepFunction.AddParameter("x", clsRFunctionParameter:=clsSeqFunction) clsRepFunction.AddParameter("each", 1) + clsRepFunction.AddParameter("length.out", ucrSelectDataFrameRegularSequence.iDataFrameLength) If ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text <> "" Then ucrNudTo.Value = ucrSelectDataFrameRegularSequence.iDataFrameLength @@ -99,17 +107,9 @@ Public Class dlgRegularSequence 'SetNumericOrDatesParameters() CheckSequenceLength() - ucrNudNumberOfDecimalPlaces.Value = 2 - ucrNewColumnName.SetPrefix("Regular") - End Sub - Private Sub ucrPnlSequenceTyp_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlSequenceType.ControlValueChanged - If rdoNumeric.Checked Then - ucrBase.clsRsyntax.SetBaseRFunction(clsSeqFunction) - ucrBase.clsRsyntax.SetBaseRFunction(clsRepFunction) - ElseIf rdoDates.Checked Then - ucrBase.clsRsyntax.SetFunction(frmMain.clsRLink.strInstatDataObject & "$as.Date") + clsSeqFunction.SetAssignTo(strTemp:=ucrNewColumnName.GetText, strTempDataframe:=ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text, strTempColumn:=ucrNewColumnName.GetText) + ucrBase.clsRsyntax.SetBaseRFunction(clsSeqFunction) - End If End Sub Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset @@ -121,7 +121,7 @@ Public Class dlgRegularSequence Private Sub TestOKEnabled() If ucrNewColumnName.IsComplete Then If rdoNumeric.Checked Then - If ucrNudFrom.Text <> "" AndAlso ucrNudTo.Text <> "" AndAlso ucrNudInStepsOf.Text <> "" AndAlso ucrNudRepeatValues.Text <> "" AndAlso ucrDataFrameLengthForRegularSequence.ucrDataFrameSelector.cboAvailableDataFrames.Text <> "" Then + If ucrNudFrom.GetText <> "" AndAlso ucrNudTo.GetText <> "" AndAlso ucrNudInStepsOf.GetText <> "" AndAlso ucrNudRepeatValues.GetText <> "" AndAlso ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text <> "" Then ucrBase.OKEnabled(True) Else ucrBase.OKEnabled(False) @@ -140,34 +140,9 @@ Public Class dlgRegularSequence End Sub - ' ' Private Sub SetNumericOrDatesParameters() - ' If rdoNumeric.Checked Then - ' ucrNudFrom.Visible = True - ' ucrNudTo.Visible = True - ' dtpSelectorA.Visible = False - ' dtpSelectorB.Visible = False - ' chkDefineAsFactor.Visible = False - ' ElseIf rdoDates.Checked Then - ' dtpSelectorA.Visible = True - ' - ' End If - ' SetFromParameter() - ' SetToParameter() - ' SetInStepsOfParameter() - ' SetRepeatProperties() - ' CheckSequenceLength() - ' TestOKEnabled() - '' End Sub - - Private Sub nudInstepsOf_TextChanged(sender As Object, e As EventArgs) - SetInStepsOfParameter() - CheckSequenceLength() - TestOKEnabled() - End Sub - Private Sub SetInStepsOfParameter() If rdoNumeric.Checked Then - If ucrNudInStepsOf.Text <> "" Then + If ucrNudInStepsOf.GetText <> "" Then If (ucrNudInStepsOf.Value = 1 AndAlso frmMain.clsInstatOptions.bIncludeRDefaultParameters) OrElse ucrNudInStepsOf.Value <> 1 Then If ucrNudTo.Value >= ucrNudFrom.Value Then clsSeqFunction.AddParameter("by", ucrNudInStepsOf.Value) @@ -178,27 +153,16 @@ Public Class dlgRegularSequence End If End If End Sub - Private Sub nudRepeatValues_TextChanged(sender As Object, e As EventArgs) - SetRepeatProperties() - TestOKEnabled() - End Sub + 'Private Sub nudRepeatValues_TextChanged(sender As Object, e As EventArgs) + ' SetRepeatProperties() + ' TestOKEnabled() + 'End Sub - Private Sub SetRepeatProperties() - If ucrNudRepeatValues.Text <> "" Then - If ucrNudRepeatValues.Value > 1 Then - ucrBase.clsRsyntax.SetBaseRFunction(clsRepFunction) - clsSeqFunction.RemoveAssignTo() - clsRepFunction.AddParameter("each", ucrNudRepeatValues.Value) - Else - clsRepFunction.RemoveParameterByName("each") - ucrBase.clsRsyntax.SetBaseRFunction(clsSeqFunction) - clsRepFunction.RemoveAssignTo() - End If - SetAssignTo() - Else - clsRepFunction.RemoveParameterByName("each") + Private Sub SetRepeatFunction() + If ucrNudRepeatValues.Value > 1 Then + ucrBase.clsRsyntax.SetBaseRFunction(clsRepFunction) End If - CheckSequenceLength() + ' CheckSequenceLength() End Sub Private Sub dtpSelectorA_ValueChanged(sender As Object, e As EventArgs) Handles dtpSelectorA.ValueChanged @@ -211,20 +175,16 @@ Public Class dlgRegularSequence CheckSequenceLength() End Sub - Private Sub ucrInputCboRegularSequence_NameChanged() - SetAssignTo() - TestOKEnabled() - End Sub + 'Private Sub ucrInputCboRegularSequence_NameChanged() + ' SetAssignTo() + ' TestOKEnabled() + 'End Sub - Private Sub SetAssignTo() - ucrBase.clsRsyntax.SetAssignTo(strAssignToName:=ucrNewColumnName.GetText, strTempDataframe:=ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text, strTempColumn:=ucrNewColumnName.GetText) - End Sub Private Sub ucrSelectDataFrameRegularSequence_DataFrameChanged(sender As Object, e As EventArgs, strPrevDataFrame As String) Handles ucrSelectDataFrameRegularSequence.DataFrameChanged ucrNudTo.Value = ucrSelectDataFrameRegularSequence.iDataFrameLength ucrNudFrom.Value = 1 ' SetNumericOrDatesParameters() CheckSequenceLength() - TestOKEnabled() End Sub Private Sub CheckSequenceLength() @@ -251,7 +211,6 @@ Public Class dlgRegularSequence strRCommand = ucrBase.clsRsyntax.clsBaseFunction.ToScript() bIsAssigned = False vecSequence = frmMain.clsRLink.RunInternalScriptGetValue(strRCommand, bSilent:=True).AsNumeric - SetAssignTo() If iLength < ucrSelectDataFrameRegularSequence.iDataFrameLength Then txtMessage.Text = "Sequence has been extended by repeating to match the length of the dataframe." ElseIf iLength > ucrSelectDataFrameRegularSequence.iDataFrameLength Then @@ -280,7 +239,12 @@ Public Class dlgRegularSequence ucrNudInStepsOf.Increment = 10 ^ -(ucrNudNumberOfDecimalPlaces.Value) End Sub - Private Sub ucrSelectDataFrameRegularSequence_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectDataFrameRegularSequence.ControlValueChanged, ucrNudTo.ControlValueChanged, ucrNudFrom.ControlValueChanged + Private Sub ucrSelectDataFrameRegularSequence_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectDataFrameRegularSequence.ControlValueChanged, ucrNudTo.ControlValueChanged, ucrNudFrom.ControlValueChanged, ucrNudRepeatValues.ControlValueChanged CheckSequenceLength() + SetRepeatFunction() + End Sub + + Private Sub ucrNewColumnName_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrNewColumnName.ControlContentsChanged, ucrNudTo.ControlContentsChanged, ucrNudFrom.ControlContentsChanged, ucrNudInStepsOf.ControlContentsChanged, ucrNudRepeatValues.ControlContentsChanged, ucrPnlSequenceType.ControlContentsChanged + TestOKEnabled() End Sub End Class \ No newline at end of file From 24546a8d1019e5ac0faebd4d3c0766986d9ee2cc Mon Sep 17 00:00:00 2001 From: Alex Sananka Date: Thu, 9 Mar 2017 11:05:52 +0300 Subject: [PATCH 05/34] More edits --- instat/dlgRegularSequence.vb | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/instat/dlgRegularSequence.vb b/instat/dlgRegularSequence.vb index 3f4b1ddad6c..f4d0ede47fd 100644 --- a/instat/dlgRegularSequence.vb +++ b/instat/dlgRegularSequence.vb @@ -51,39 +51,41 @@ Public Class dlgRegularSequence ucrPnlSequenceType.AddFunctionNamesCondition(rdoNumeric, "seq") ucrPnlSequenceType.AddFunctionNamesCondition(rdoDates, "as.Date") + ucrNudFrom.SetParameter(New RParameter("from", 0)) + ucrNudTo.SetParameter(New RParameter("to", 1)) + ucrNudRepeatValues.SetParameter(New RParameter("each", 1)) + ucrNudInStepsOf.SetParameter(New RParameter("by", 2)) + ucrNudFrom.SetMinMax(Integer.MinValue, Integer.MaxValue) + ucrNudTo.SetMinMax(Integer.MinValue, Integer.MaxValue) + ucrNudInStepsOf.Maximum = Integer.MaxValue + ucrNudRepeatValues.Maximum = Integer.MaxValue + ucrPnlSequenceType.AddToLinkedControls(ucrNudFrom, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrNudFrom.SetLinkedDisplayControl(lblFrom) ucrPnlSequenceType.AddToLinkedControls(ucrNudTo, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrNudTo.SetLinkedDisplayControl(lblTo) ucrPnlSequenceType.AddToLinkedControls(ucrNudInStepsOf, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - ucrNudInStepsOf.SetLinkedDisplayControl(lblSteps) - ucrPnlSequenceType.AddToLinkedControls(ucrNudRepeatValues, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrNudRepeatValues.SetLinkedDisplayControl(lblRepeatValues) + ucrPnlSequenceType.AddToLinkedControls(ucrNudRepeatValues, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrNudInStepsOf.SetLinkedDisplayControl(lblSteps) 'ucrPnlSequenceType.AddToLinkedControls(dtpSelectorA, {rdoDates}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) 'ucrPnlSequenceType.AddToLinkedControls(dtpSelectorB, {rdoDates}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - ucrNudFrom.SetParameter(New RParameter("from", 0)) - ucrNudTo.SetParameter(New RParameter("to", 1)) - ucrNudRepeatValues.SetParameter(New RParameter("each", 1)) - ucrNudInStepsOf.SetParameter(New RParameter("by", 2)) - ucrNudFrom.SetMinMax(Integer.MinValue, Integer.MaxValue) - ucrNudTo.SetMinMax(Integer.MinValue, Integer.MaxValue) - ucrNudInStepsOf.Maximum = Integer.MaxValue - ucrNudRepeatValues.Maximum = Integer.MaxValue ucrNewColumnName.SetPrefix("Regular") ucrNewColumnName.SetDataFrameSelector(ucrSelectDataFrameRegularSequence) ucrNewColumnName.SetIsComboBox() ucrNewColumnName.SetSaveTypeAsColumn() + ucrNewColumnName.SetLabelText("New Column Name") 'TODO complete dates option rdoDates.Enabled = False dtpSelectorB.Visible = False dtpSelectorA.Visible = False - ucrNudFrom.Visible = False - ucrNudTo.Visible = False - chkDefineAsFactor.Visible = False + 'ucrNudFrom.Visible = False + ' ucrNudTo.Visible = False + 'chkDefineAsFactor.Visible = False End Sub Private Sub SetDefaults() From 11f789ce27682bf0ba85974c4931cd519f94e972 Mon Sep 17 00:00:00 2001 From: Alex Sananka Date: Thu, 9 Mar 2017 18:26:56 +0300 Subject: [PATCH 06/34] Fixed change of dataframes and displaying length of sequence --- instat/dlgRegularSequence.vb | 82 ++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 46 deletions(-) diff --git a/instat/dlgRegularSequence.vb b/instat/dlgRegularSequence.vb index f4d0ede47fd..ebdebc7372d 100644 --- a/instat/dlgRegularSequence.vb +++ b/instat/dlgRegularSequence.vb @@ -48,8 +48,8 @@ Public Class dlgRegularSequence ucrPnlSequenceType.AddRadioButton(rdoNumeric) ucrPnlSequenceType.AddRadioButton(rdoDates) - ucrPnlSequenceType.AddFunctionNamesCondition(rdoNumeric, "seq") - ucrPnlSequenceType.AddFunctionNamesCondition(rdoDates, "as.Date") + 'ucrPnlSequenceType.AddFunctionNamesCondition(rdoNumeric, "seq") + 'ucrPnlSequenceType.AddFunctionNamesCondition(rdoDates, "as.Date") ucrNudFrom.SetParameter(New RParameter("from", 0)) ucrNudTo.SetParameter(New RParameter("to", 1)) @@ -59,6 +59,7 @@ Public Class dlgRegularSequence ucrNudTo.SetMinMax(Integer.MinValue, Integer.MaxValue) ucrNudInStepsOf.Maximum = Integer.MaxValue ucrNudRepeatValues.Maximum = Integer.MaxValue + ucrDataFrameLengthForRegularSequence.SetDataFrameSelector(ucrSelectDataFrameRegularSequence) ucrPnlSequenceType.AddToLinkedControls(ucrNudFrom, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrNudFrom.SetLinkedDisplayControl(lblFrom) @@ -77,7 +78,7 @@ Public Class dlgRegularSequence ucrNewColumnName.SetDataFrameSelector(ucrSelectDataFrameRegularSequence) ucrNewColumnName.SetIsComboBox() ucrNewColumnName.SetSaveTypeAsColumn() - ucrNewColumnName.SetLabelText("New Column Name") + ucrNewColumnName.SetLabelText("New Column Name:") 'TODO complete dates option rdoDates.Enabled = False @@ -103,10 +104,6 @@ Public Class dlgRegularSequence clsRepFunction.AddParameter("each", 1) clsRepFunction.AddParameter("length.out", ucrSelectDataFrameRegularSequence.iDataFrameLength) - If ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text <> "" Then - ucrNudTo.Value = ucrSelectDataFrameRegularSequence.iDataFrameLength - End If - 'SetNumericOrDatesParameters() CheckSequenceLength() clsSeqFunction.SetAssignTo(strTemp:=ucrNewColumnName.GetText, strTempDataframe:=ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text, strTempColumn:=ucrNewColumnName.GetText) @@ -115,9 +112,9 @@ Public Class dlgRegularSequence End Sub Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset - SetDefaults() - TestOKEnabled() - SetRCodeForControls(True) + SetDefaults() + SetRCodeForControls(True) + TestOKEnabled() End Sub Private Sub TestOKEnabled() @@ -138,54 +135,47 @@ Public Class dlgRegularSequence End If End Sub - Private Sub grpSequenceType_CheckedChanged(sender As Object, e As EventArgs) - - End Sub - - Private Sub SetInStepsOfParameter() - If rdoNumeric.Checked Then - If ucrNudInStepsOf.GetText <> "" Then - If (ucrNudInStepsOf.Value = 1 AndAlso frmMain.clsInstatOptions.bIncludeRDefaultParameters) OrElse ucrNudInStepsOf.Value <> 1 Then - If ucrNudTo.Value >= ucrNudFrom.Value Then - clsSeqFunction.AddParameter("by", ucrNudInStepsOf.Value) - Else - clsSeqFunction.AddParameter("by", -ucrNudInStepsOf.Value) - End If - End If - End If - End If - End Sub + 'Private Sub SetInStepsOfParameter() + ' If rdoNumeric.Checked Then + ' If ucrNudInStepsOf.GetText <> "" Then + ' If (ucrNudInStepsOf.Value = 1 AndAlso frmMain.clsInstatOptions.bIncludeRDefaultParameters) OrElse ucrNudInStepsOf.Value <> 1 Then + ' If ucrNudTo.Value >= ucrNudFrom.Value Then + ' clsSeqFunction.AddParameter("by", ucrNudInStepsOf.Value) + ' Else + ' clsSeqFunction.AddParameter("by", -ucrNudInStepsOf.Value) + ' End If + ' End If + ' End If + ' End If + 'End Sub 'Private Sub nudRepeatValues_TextChanged(sender As Object, e As EventArgs) ' SetRepeatProperties() ' TestOKEnabled() 'End Sub - Private Sub SetRepeatFunction() + Private Sub SetBaseFunction() If ucrNudRepeatValues.Value > 1 Then ucrBase.clsRsyntax.SetBaseRFunction(clsRepFunction) + Else + ucrBase.clsRsyntax.SetBaseRFunction(clsSeqFunction) End If - ' CheckSequenceLength() - End Sub - - Private Sub dtpSelectorA_ValueChanged(sender As Object, e As EventArgs) Handles dtpSelectorA.ValueChanged - ucrBase.clsRsyntax.AddParameter("from", "as.Date('" & Format(dtpSelectorA.Value, "yyyy/MM/dd") & "')") - CheckSequenceLength() End Sub - Private Sub dtpSelectorB_ValueChanged(sender As Object, e As EventArgs) Handles dtpSelectorB.ValueChanged - ucrBase.clsRsyntax.AddParameter("to", "as.Date('" & Format(dtpSelectorB.Value, "yyyy/MM/dd") & "')") - CheckSequenceLength() - End Sub + 'Private Sub dtpSelectorA_ValueChanged(sender As Object, e As EventArgs) Handles dtpSelectorA.ValueChanged + ' ucrBase.clsRsyntax.AddParameter("from", "as.Date('" & Format(dtpSelectorA.Value, "yyyy/MM/dd") & "')") + ' CheckSequenceLength() + 'End Sub - 'Private Sub ucrInputCboRegularSequence_NameChanged() - ' SetAssignTo() - ' TestOKEnabled() + 'Private Sub dtpSelectorB_ValueChanged(sender As Object, e As EventArgs) Handles dtpSelectorB.ValueChanged + ' ucrBase.clsRsyntax.AddParameter("to", "as.Date('" & Format(dtpSelectorB.Value, "yyyy/MM/dd") & "')") + ' CheckSequenceLength() 'End Sub + Private Sub ucrSelectDataFrameRegularSequence_DataFrameChanged(sender As Object, e As EventArgs, strPrevDataFrame As String) Handles ucrSelectDataFrameRegularSequence.DataFrameChanged - ucrNudTo.Value = ucrSelectDataFrameRegularSequence.iDataFrameLength - ucrNudFrom.Value = 1 - ' SetNumericOrDatesParameters() + If ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text <> "" Then + ucrNudTo.Value = frmMain.clsRLink.GetDataFrameLength(ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text) + End If CheckSequenceLength() End Sub @@ -241,9 +231,9 @@ Public Class dlgRegularSequence ucrNudInStepsOf.Increment = 10 ^ -(ucrNudNumberOfDecimalPlaces.Value) End Sub - Private Sub ucrSelectDataFrameRegularSequence_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectDataFrameRegularSequence.ControlValueChanged, ucrNudTo.ControlValueChanged, ucrNudFrom.ControlValueChanged, ucrNudRepeatValues.ControlValueChanged + Private Sub ucrSelectDataFrameRegularSequence_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectDataFrameRegularSequence.ControlValueChanged, ucrNudRepeatValues.ControlValueChanged, ucrNudInStepsOf.ControlValueChanged CheckSequenceLength() - SetRepeatFunction() + SetBaseFunction() End Sub Private Sub ucrNewColumnName_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrNewColumnName.ControlContentsChanged, ucrNudTo.ControlContentsChanged, ucrNudFrom.ControlContentsChanged, ucrNudInStepsOf.ControlContentsChanged, ucrNudRepeatValues.ControlContentsChanged, ucrPnlSequenceType.ControlContentsChanged From c54681873e5a15ea7de22ecb98fcfad82a75fddf Mon Sep 17 00:00:00 2001 From: Alex Sananka Date: Fri, 10 Mar 2017 16:25:44 +0300 Subject: [PATCH 07/34] Activating all Nud controls and reseting New column name --- instat/dlgRegularSequence.vb | 46 +++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/instat/dlgRegularSequence.vb b/instat/dlgRegularSequence.vb index ebdebc7372d..8ee413686c1 100644 --- a/instat/dlgRegularSequence.vb +++ b/instat/dlgRegularSequence.vb @@ -14,13 +14,13 @@ ' You should have received a copy of the GNU General Public License k ' along with this program. If not, see . Imports instat -Imports instat.Translations -Imports RDotNet - +Imports instat.Translations +Imports RDotNet + Public Class dlgRegularSequence - Dim bIsExtended As Boolean = False + Dim bIsExtended As Boolean = False Public bFirstLoad As Boolean = True - Private bReset As Boolean = True + Private bReset As Boolean = True Private clsSeqFunction, clsRepFunction As New RFunction Private Sub dlgRegularSequence_Load(sender As Object, e As EventArgs) Handles MyBase.Load autoTranslate(Me) @@ -93,7 +93,7 @@ Public Class dlgRegularSequence clsRepFunction = New RFunction clsSeqFunction = New RFunction ucrSelectDataFrameRegularSequence.Reset() - + ucrNewColumnName.Reset() clsSeqFunction.SetRCommand("seq") clsSeqFunction.AddParameter("from", 1) clsSeqFunction.AddParameter("to", ucrSelectDataFrameRegularSequence.iDataFrameLength) @@ -111,10 +111,10 @@ Public Class dlgRegularSequence End Sub - Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset + Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset SetDefaults() SetRCodeForControls(True) - TestOKEnabled() + TestOKEnabled() End Sub Private Sub TestOKEnabled() @@ -135,19 +135,19 @@ Public Class dlgRegularSequence End If End Sub - 'Private Sub SetInStepsOfParameter() - ' If rdoNumeric.Checked Then - ' If ucrNudInStepsOf.GetText <> "" Then - ' If (ucrNudInStepsOf.Value = 1 AndAlso frmMain.clsInstatOptions.bIncludeRDefaultParameters) OrElse ucrNudInStepsOf.Value <> 1 Then - ' If ucrNudTo.Value >= ucrNudFrom.Value Then - ' clsSeqFunction.AddParameter("by", ucrNudInStepsOf.Value) - ' Else - ' clsSeqFunction.AddParameter("by", -ucrNudInStepsOf.Value) - ' End If - ' End If - ' End If - ' End If - 'End Sub + Private Sub SetInStepsOfParameter() + If rdoNumeric.Checked Then + If ucrNudInStepsOf.GetText <> "" Then + If (ucrNudInStepsOf.Value = 1 AndAlso frmMain.clsInstatOptions.bIncludeRDefaultParameters) OrElse ucrNudInStepsOf.Value <> 1 Then + If ucrNudTo.Value >= ucrNudFrom.Value Then + clsSeqFunction.AddParameter("by", ucrNudInStepsOf.Value) + Else + clsSeqFunction.AddParameter("by", -ucrNudInStepsOf.Value) + End If + End If + End If + End If + End Sub 'Private Sub nudRepeatValues_TextChanged(sender As Object, e As EventArgs) ' SetRepeatProperties() ' TestOKEnabled() @@ -159,6 +159,7 @@ Public Class dlgRegularSequence Else ucrBase.clsRsyntax.SetBaseRFunction(clsSeqFunction) End If + CheckSequenceLength() End Sub 'Private Sub dtpSelectorA_ValueChanged(sender As Object, e As EventArgs) Handles dtpSelectorA.ValueChanged @@ -231,9 +232,10 @@ Public Class dlgRegularSequence ucrNudInStepsOf.Increment = 10 ^ -(ucrNudNumberOfDecimalPlaces.Value) End Sub - Private Sub ucrSelectDataFrameRegularSequence_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectDataFrameRegularSequence.ControlValueChanged, ucrNudRepeatValues.ControlValueChanged, ucrNudInStepsOf.ControlValueChanged + Private Sub ucrSelectDataFrameRegularSequence_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectDataFrameRegularSequence.ControlValueChanged, ucrNudRepeatValues.ControlValueChanged, ucrNudInStepsOf.ControlValueChanged, ucrNudFrom.ControlValueChanged, ucrNudTo.ControlValueChanged CheckSequenceLength() SetBaseFunction() + SetInStepsOfParameter() End Sub Private Sub ucrNewColumnName_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrNewColumnName.ControlContentsChanged, ucrNudTo.ControlContentsChanged, ucrNudFrom.ControlContentsChanged, ucrNudInStepsOf.ControlContentsChanged, ucrNudRepeatValues.ControlContentsChanged, ucrPnlSequenceType.ControlContentsChanged From dec0e4ce40c0f161b022eeb2dfc4c5a332ffb67a Mon Sep 17 00:00:00 2001 From: Alex Sananka Date: Tue, 14 Mar 2017 13:42:52 +0300 Subject: [PATCH 08/34] SetAssignTo issue --- instat/dlgRegularSequence.vb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/instat/dlgRegularSequence.vb b/instat/dlgRegularSequence.vb index 8ee413686c1..6976885c098 100644 --- a/instat/dlgRegularSequence.vb +++ b/instat/dlgRegularSequence.vb @@ -106,7 +106,7 @@ Public Class dlgRegularSequence 'SetNumericOrDatesParameters() CheckSequenceLength() - clsSeqFunction.SetAssignTo(strTemp:=ucrNewColumnName.GetText, strTempDataframe:=ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text, strTempColumn:=ucrNewColumnName.GetText) + clsSeqFunction.SetAssignTo(strTemp:=ucrNewColumnName.GetText, strTempDataframe:=ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text, strTempColumn:=ucrNewColumnName.GetText, bAssignToIsPrefix:=True) ucrBase.clsRsyntax.SetBaseRFunction(clsSeqFunction) End Sub @@ -232,12 +232,15 @@ Public Class dlgRegularSequence ucrNudInStepsOf.Increment = 10 ^ -(ucrNudNumberOfDecimalPlaces.Value) End Sub - Private Sub ucrSelectDataFrameRegularSequence_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectDataFrameRegularSequence.ControlValueChanged, ucrNudRepeatValues.ControlValueChanged, ucrNudInStepsOf.ControlValueChanged, ucrNudFrom.ControlValueChanged, ucrNudTo.ControlValueChanged - CheckSequenceLength() + Private Sub ucrSelectDataFrameRegularSequence_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectDataFrameRegularSequence.ControlValueChanged, ucrNudInStepsOf.ControlValueChanged, ucrNudFrom.ControlValueChanged, ucrNudTo.ControlValueChanged SetBaseFunction() SetInStepsOfParameter() End Sub + Private Sub ucrNudRepeatValues_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrNudRepeatValues.ControlValueChanged + SetBaseFunction() + End Sub + Private Sub ucrNewColumnName_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrNewColumnName.ControlContentsChanged, ucrNudTo.ControlContentsChanged, ucrNudFrom.ControlContentsChanged, ucrNudInStepsOf.ControlContentsChanged, ucrNudRepeatValues.ControlContentsChanged, ucrPnlSequenceType.ControlContentsChanged TestOKEnabled() End Sub From 48f5d2cd9c1a5c23ab1db61894b7dccce53087df Mon Sep 17 00:00:00 2001 From: Alex Sananka Date: Wed, 15 Mar 2017 15:44:27 +0300 Subject: [PATCH 09/34] More Edits --- instat/dlgRegularSequence.designer.vb | 194 +++++++++++++------------- instat/dlgRegularSequence.vb | 77 +++++----- 2 files changed, 137 insertions(+), 134 deletions(-) diff --git a/instat/dlgRegularSequence.designer.vb b/instat/dlgRegularSequence.designer.vb index de6abdaa22c..75b3a320c92 100644 --- a/instat/dlgRegularSequence.designer.vb +++ b/instat/dlgRegularSequence.designer.vb @@ -23,7 +23,13 @@ Partial Class dlgRegularSequence Private Sub InitializeComponent() Me.grpSequenceDefinition = New System.Windows.Forms.GroupBox() + Me.ucrNudNumberOfDecimalPlaces = New instat.ucrNud() + Me.ucrNudRepeatValues = New instat.ucrNud() + Me.ucrNudInStepsOf = New instat.ucrNud() + Me.ucrNudTo = New instat.ucrNud() + Me.ucrNudFrom = New instat.ucrNud() Me.lblNumberDecimalPlaces = New System.Windows.Forms.Label() + Me.ucrDataFrameLengthForRegularSequence = New instat.ucrDataFrameLength() Me.dtpSelectorB = New System.Windows.Forms.DateTimePicker() Me.dtpSelectorA = New System.Windows.Forms.DateTimePicker() Me.lblLength = New System.Windows.Forms.Label() @@ -41,12 +47,6 @@ Partial Class dlgRegularSequence Me.rdoDates = New System.Windows.Forms.RadioButton() Me.ucrPnlSequenceType = New instat.UcrPanel() Me.ucrNewColumnName = New instat.ucrSave() - Me.ucrNudNumberOfDecimalPlaces = New instat.ucrNud() - Me.ucrNudRepeatValues = New instat.ucrNud() - Me.ucrNudInStepsOf = New instat.ucrNud() - Me.ucrNudTo = New instat.ucrNud() - Me.ucrNudFrom = New instat.ucrNud() - Me.ucrDataFrameLengthForRegularSequence = New instat.ucrDataFrameLength() Me.ucrSelectDataFrameRegularSequence = New instat.ucrDataFrame() Me.ucrBase = New instat.ucrButtons() Me.grpSequenceDefinition.SuspendLayout() @@ -75,21 +75,89 @@ Partial Class dlgRegularSequence Me.grpSequenceDefinition.Location = New System.Drawing.Point(10, 111) Me.grpSequenceDefinition.Name = "grpSequenceDefinition" Me.grpSequenceDefinition.Size = New System.Drawing.Size(205, 204) - Me.grpSequenceDefinition.TabIndex = 2 + Me.grpSequenceDefinition.TabIndex = 4 Me.grpSequenceDefinition.TabStop = False Me.grpSequenceDefinition.Tag = "Sequence_definition" Me.grpSequenceDefinition.Text = "Sequence Definition" Me.grpSequenceDefinition.UseCompatibleTextRendering = True ' + 'ucrNudNumberOfDecimalPlaces + ' + Me.ucrNudNumberOfDecimalPlaces.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudNumberOfDecimalPlaces.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudNumberOfDecimalPlaces.Location = New System.Drawing.Point(142, 180) + Me.ucrNudNumberOfDecimalPlaces.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudNumberOfDecimalPlaces.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudNumberOfDecimalPlaces.Name = "ucrNudNumberOfDecimalPlaces" + Me.ucrNudNumberOfDecimalPlaces.Size = New System.Drawing.Size(50, 20) + Me.ucrNudNumberOfDecimalPlaces.TabIndex = 13 + Me.ucrNudNumberOfDecimalPlaces.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrNudRepeatValues + ' + Me.ucrNudRepeatValues.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudRepeatValues.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudRepeatValues.Location = New System.Drawing.Point(99, 105) + Me.ucrNudRepeatValues.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudRepeatValues.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudRepeatValues.Name = "ucrNudRepeatValues" + Me.ucrNudRepeatValues.Size = New System.Drawing.Size(50, 20) + Me.ucrNudRepeatValues.TabIndex = 7 + Me.ucrNudRepeatValues.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrNudInStepsOf + ' + Me.ucrNudInStepsOf.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudInStepsOf.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudInStepsOf.Location = New System.Drawing.Point(99, 75) + Me.ucrNudInStepsOf.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudInStepsOf.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudInStepsOf.Name = "ucrNudInStepsOf" + Me.ucrNudInStepsOf.Size = New System.Drawing.Size(50, 20) + Me.ucrNudInStepsOf.TabIndex = 5 + Me.ucrNudInStepsOf.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrNudTo + ' + Me.ucrNudTo.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudTo.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudTo.Location = New System.Drawing.Point(99, 51) + Me.ucrNudTo.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudTo.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudTo.Name = "ucrNudTo" + Me.ucrNudTo.Size = New System.Drawing.Size(50, 20) + Me.ucrNudTo.TabIndex = 3 + Me.ucrNudTo.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrNudFrom + ' + Me.ucrNudFrom.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudFrom.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudFrom.Location = New System.Drawing.Point(99, 25) + Me.ucrNudFrom.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudFrom.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudFrom.Name = "ucrNudFrom" + Me.ucrNudFrom.Size = New System.Drawing.Size(50, 20) + Me.ucrNudFrom.TabIndex = 1 + Me.ucrNudFrom.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' 'lblNumberDecimalPlaces ' Me.lblNumberDecimalPlaces.AutoSize = True - Me.lblNumberDecimalPlaces.Location = New System.Drawing.Point(10, 183) + Me.lblNumberDecimalPlaces.Location = New System.Drawing.Point(10, 180) Me.lblNumberDecimalPlaces.Name = "lblNumberDecimalPlaces" Me.lblNumberDecimalPlaces.Size = New System.Drawing.Size(135, 13) - Me.lblNumberDecimalPlaces.TabIndex = 14 + Me.lblNumberDecimalPlaces.TabIndex = 12 Me.lblNumberDecimalPlaces.Text = "Number of Decimal Places:" ' + 'ucrDataFrameLengthForRegularSequence + ' + Me.ucrDataFrameLengthForRegularSequence.Location = New System.Drawing.Point(98, 130) + Me.ucrDataFrameLengthForRegularSequence.Name = "ucrDataFrameLengthForRegularSequence" + Me.ucrDataFrameLengthForRegularSequence.Size = New System.Drawing.Size(51, 23) + Me.ucrDataFrameLengthForRegularSequence.TabIndex = 10 + Me.ucrDataFrameLengthForRegularSequence.ucrDataFrameSelector = Nothing + ' 'dtpSelectorB ' Me.dtpSelectorB.Location = New System.Drawing.Point(98, 51) @@ -110,7 +178,7 @@ Partial Class dlgRegularSequence Me.lblLength.Location = New System.Drawing.Point(10, 133) Me.lblLength.Name = "lblLength" Me.lblLength.Size = New System.Drawing.Size(43, 13) - Me.lblLength.TabIndex = 11 + Me.lblLength.TabIndex = 9 Me.lblLength.Tag = "Length" Me.lblLength.Text = "Length:" ' @@ -122,7 +190,7 @@ Partial Class dlgRegularSequence Me.chkDefineAsFactor.Location = New System.Drawing.Point(10, 159) Me.chkDefineAsFactor.Name = "chkDefineAsFactor" Me.chkDefineAsFactor.Size = New System.Drawing.Size(104, 17) - Me.chkDefineAsFactor.TabIndex = 13 + Me.chkDefineAsFactor.TabIndex = 11 Me.chkDefineAsFactor.Tag = "Define_as_factor" Me.chkDefineAsFactor.Text = "Define as Factor" Me.chkDefineAsFactor.UseVisualStyleBackColor = True @@ -133,17 +201,17 @@ Partial Class dlgRegularSequence Me.lblTimes1.Location = New System.Drawing.Point(151, 108) Me.lblTimes1.Name = "lblTimes1" Me.lblTimes1.Size = New System.Drawing.Size(41, 13) - Me.lblTimes1.TabIndex = 10 + Me.lblTimes1.TabIndex = 8 Me.lblTimes1.Tag = "Times" Me.lblTimes1.Text = "Time(s)" ' 'lblRepeatValues ' Me.lblRepeatValues.AutoSize = True - Me.lblRepeatValues.Location = New System.Drawing.Point(10, 108) + Me.lblRepeatValues.Location = New System.Drawing.Point(6, 105) Me.lblRepeatValues.Name = "lblRepeatValues" Me.lblRepeatValues.Size = New System.Drawing.Size(80, 13) - Me.lblRepeatValues.TabIndex = 8 + Me.lblRepeatValues.TabIndex = 6 Me.lblRepeatValues.Tag = "Repeat_values" Me.lblRepeatValues.Text = "Repeat Values:" ' @@ -151,10 +219,10 @@ Partial Class dlgRegularSequence ' Me.lblSteps.AutoSize = True Me.lblSteps.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.lblSteps.Location = New System.Drawing.Point(10, 82) + Me.lblSteps.Location = New System.Drawing.Point(10, 75) Me.lblSteps.Name = "lblSteps" Me.lblSteps.Size = New System.Drawing.Size(61, 13) - Me.lblSteps.TabIndex = 6 + Me.lblSteps.TabIndex = 4 Me.lblSteps.Tag = "In_steps_of" Me.lblSteps.Text = "In Steps of:" ' @@ -162,10 +230,10 @@ Partial Class dlgRegularSequence ' Me.lblTo.AutoSize = True Me.lblTo.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.lblTo.Location = New System.Drawing.Point(10, 56) + Me.lblTo.Location = New System.Drawing.Point(10, 51) Me.lblTo.Name = "lblTo" Me.lblTo.Size = New System.Drawing.Size(23, 13) - Me.lblTo.TabIndex = 3 + Me.lblTo.TabIndex = 2 Me.lblTo.Tag = "To" Me.lblTo.Text = "To:" ' @@ -173,7 +241,7 @@ Partial Class dlgRegularSequence ' Me.lblFrom.AutoSize = True Me.lblFrom.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.lblFrom.Location = New System.Drawing.Point(10, 30) + Me.lblFrom.Location = New System.Drawing.Point(10, 25) Me.lblFrom.Name = "lblFrom" Me.lblFrom.Size = New System.Drawing.Size(33, 13) Me.lblFrom.TabIndex = 0 @@ -183,25 +251,25 @@ Partial Class dlgRegularSequence 'lblPreview ' Me.lblPreview.AutoSize = True - Me.lblPreview.Location = New System.Drawing.Point(239, 28) + Me.lblPreview.Location = New System.Drawing.Point(239, 45) Me.lblPreview.Name = "lblPreview" Me.lblPreview.Size = New System.Drawing.Size(100, 13) - Me.lblPreview.TabIndex = 3 + Me.lblPreview.TabIndex = 2 Me.lblPreview.Tag = "Preview" Me.lblPreview.Text = "Sequence Preview:" ' 'txtGetPreview ' - Me.txtGetPreview.Location = New System.Drawing.Point(238, 44) + Me.txtGetPreview.Location = New System.Drawing.Point(239, 60) Me.txtGetPreview.Name = "txtGetPreview" Me.txtGetPreview.Size = New System.Drawing.Size(171, 172) - Me.txtGetPreview.TabIndex = 4 + Me.txtGetPreview.TabIndex = 3 Me.txtGetPreview.Text = "" ' 'txtMessage ' Me.txtMessage.Enabled = False - Me.txtMessage.Location = New System.Drawing.Point(238, 232) + Me.txtMessage.Location = New System.Drawing.Point(239, 234) Me.txtMessage.Multiline = True Me.txtMessage.Name = "txtMessage" Me.txtMessage.ReadOnly = True @@ -216,7 +284,7 @@ Partial Class dlgRegularSequence Me.grpSequenceType.Location = New System.Drawing.Point(16, 53) Me.grpSequenceType.Name = "grpSequenceType" Me.grpSequenceType.Size = New System.Drawing.Size(199, 52) - Me.grpSequenceType.TabIndex = 16 + Me.grpSequenceType.TabIndex = 1 Me.grpSequenceType.TabStop = False Me.grpSequenceType.Text = "Sequence Type" ' @@ -228,7 +296,7 @@ Partial Class dlgRegularSequence Me.rdoNumeric.Location = New System.Drawing.Point(10, 19) Me.rdoNumeric.Name = "rdoNumeric" Me.rdoNumeric.Size = New System.Drawing.Size(70, 18) - Me.rdoNumeric.TabIndex = 1 + Me.rdoNumeric.TabIndex = 0 Me.rdoNumeric.Tag = "Numeric" Me.rdoNumeric.Text = "Numeric" Me.rdoNumeric.UseVisualStyleBackColor = True @@ -241,7 +309,7 @@ Partial Class dlgRegularSequence Me.rdoDates.Location = New System.Drawing.Point(93, 20) Me.rdoDates.Name = "rdoDates" Me.rdoDates.Size = New System.Drawing.Size(59, 18) - Me.rdoDates.TabIndex = 2 + Me.rdoDates.TabIndex = 1 Me.rdoDates.Tag = "Dates" Me.rdoDates.Text = "Dates" Me.rdoDates.UseVisualStyleBackColor = True @@ -258,75 +326,7 @@ Partial Class dlgRegularSequence Me.ucrNewColumnName.Location = New System.Drawing.Point(11, 321) Me.ucrNewColumnName.Name = "ucrNewColumnName" Me.ucrNewColumnName.Size = New System.Drawing.Size(294, 24) - Me.ucrNewColumnName.TabIndex = 9 - ' - 'ucrNudNumberOfDecimalPlaces - ' - Me.ucrNudNumberOfDecimalPlaces.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudNumberOfDecimalPlaces.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudNumberOfDecimalPlaces.Location = New System.Drawing.Point(142, 178) - Me.ucrNudNumberOfDecimalPlaces.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudNumberOfDecimalPlaces.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudNumberOfDecimalPlaces.Name = "ucrNudNumberOfDecimalPlaces" - Me.ucrNudNumberOfDecimalPlaces.Size = New System.Drawing.Size(50, 20) - Me.ucrNudNumberOfDecimalPlaces.TabIndex = 24 - Me.ucrNudNumberOfDecimalPlaces.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrNudRepeatValues - ' - Me.ucrNudRepeatValues.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudRepeatValues.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudRepeatValues.Location = New System.Drawing.Point(99, 101) - Me.ucrNudRepeatValues.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudRepeatValues.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudRepeatValues.Name = "ucrNudRepeatValues" - Me.ucrNudRepeatValues.Size = New System.Drawing.Size(50, 20) - Me.ucrNudRepeatValues.TabIndex = 20 - Me.ucrNudRepeatValues.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrNudInStepsOf - ' - Me.ucrNudInStepsOf.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudInStepsOf.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudInStepsOf.Location = New System.Drawing.Point(99, 75) - Me.ucrNudInStepsOf.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudInStepsOf.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudInStepsOf.Name = "ucrNudInStepsOf" - Me.ucrNudInStepsOf.Size = New System.Drawing.Size(50, 20) - Me.ucrNudInStepsOf.TabIndex = 19 - Me.ucrNudInStepsOf.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrNudTo - ' - Me.ucrNudTo.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudTo.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudTo.Location = New System.Drawing.Point(99, 51) - Me.ucrNudTo.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudTo.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudTo.Name = "ucrNudTo" - Me.ucrNudTo.Size = New System.Drawing.Size(50, 20) - Me.ucrNudTo.TabIndex = 18 - Me.ucrNudTo.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrNudFrom - ' - Me.ucrNudFrom.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudFrom.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudFrom.Location = New System.Drawing.Point(99, 25) - Me.ucrNudFrom.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudFrom.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudFrom.Name = "ucrNudFrom" - Me.ucrNudFrom.Size = New System.Drawing.Size(50, 20) - Me.ucrNudFrom.TabIndex = 17 - Me.ucrNudFrom.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrDataFrameLengthForRegularSequence - ' - Me.ucrDataFrameLengthForRegularSequence.Location = New System.Drawing.Point(98, 130) - Me.ucrDataFrameLengthForRegularSequence.Name = "ucrDataFrameLengthForRegularSequence" - Me.ucrDataFrameLengthForRegularSequence.Size = New System.Drawing.Size(51, 23) - Me.ucrDataFrameLengthForRegularSequence.TabIndex = 12 - Me.ucrDataFrameLengthForRegularSequence.ucrDataFrameSelector = Nothing + Me.ucrNewColumnName.TabIndex = 6 ' 'ucrSelectDataFrameRegularSequence ' @@ -342,7 +342,7 @@ Partial Class dlgRegularSequence Me.ucrBase.Location = New System.Drawing.Point(10, 348) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(410, 52) - Me.ucrBase.TabIndex = 8 + Me.ucrBase.TabIndex = 7 ' 'dlgRegularSequence ' diff --git a/instat/dlgRegularSequence.vb b/instat/dlgRegularSequence.vb index 6976885c098..2b9af396352 100644 --- a/instat/dlgRegularSequence.vb +++ b/instat/dlgRegularSequence.vb @@ -34,45 +34,50 @@ Public Class dlgRegularSequence SetRCodeForControls(bReset) bReset = False End Sub + Private Sub SetRCodeForControls(bReset As Boolean) ucrNewColumnName.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + ucrPnlSequenceType.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrNudFrom.SetRCode(clsSeqFunction, bReset) ucrNudTo.SetRCode(clsSeqFunction, bReset) ucrNudRepeatValues.SetRCode(clsRepFunction, bReset) ucrNudInStepsOf.SetRCode(clsSeqFunction, bReset) End Sub + Private Sub InitialiseDialog() ucrBase.iHelpTopicID = 30 ucrPnlSequenceType.AddRadioButton(rdoNumeric) ucrPnlSequenceType.AddRadioButton(rdoDates) - 'ucrPnlSequenceType.AddFunctionNamesCondition(rdoNumeric, "seq") - 'ucrPnlSequenceType.AddFunctionNamesCondition(rdoDates, "as.Date") - ucrNudFrom.SetParameter(New RParameter("from", 0)) ucrNudTo.SetParameter(New RParameter("to", 1)) ucrNudRepeatValues.SetParameter(New RParameter("each", 1)) ucrNudInStepsOf.SetParameter(New RParameter("by", 2)) - ucrNudFrom.SetMinMax(Integer.MinValue, Integer.MaxValue) - ucrNudTo.SetMinMax(Integer.MinValue, Integer.MaxValue) + ucrNudInStepsOf.Minimum = 1 + ucrNudInStepsOf.SetRDefault(1) ucrNudInStepsOf.Maximum = Integer.MaxValue + ucrNudFrom.Minimum = 1 + ucrNudFrom.Maximum = Integer.MaxValue + ucrNudTo.Minimum = 1 ucrNudRepeatValues.Maximum = Integer.MaxValue ucrDataFrameLengthForRegularSequence.SetDataFrameSelector(ucrSelectDataFrameRegularSequence) - ucrPnlSequenceType.AddToLinkedControls(ucrNudFrom, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlSequenceType.AddToLinkedControls(ucrNudFrom, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, objNewDefaultState:=1) ucrNudFrom.SetLinkedDisplayControl(lblFrom) - ucrPnlSequenceType.AddToLinkedControls(ucrNudTo, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlSequenceType.AddToLinkedControls(ucrNudTo, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, objNewDefaultState:=ucrSelectDataFrameRegularSequence.iDataFrameLength) ucrNudTo.SetLinkedDisplayControl(lblTo) - ucrPnlSequenceType.AddToLinkedControls(ucrNudInStepsOf, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlSequenceType.AddToLinkedControls(ucrNudInStepsOf, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, objNewDefaultState:=1) ucrNudRepeatValues.SetLinkedDisplayControl(lblRepeatValues) - ucrPnlSequenceType.AddToLinkedControls(ucrNudRepeatValues, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlSequenceType.AddToLinkedControls(ucrNudRepeatValues, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, objNewDefaultState:=1) ucrNudInStepsOf.SetLinkedDisplayControl(lblSteps) 'ucrPnlSequenceType.AddToLinkedControls(dtpSelectorA, {rdoDates}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) 'ucrPnlSequenceType.AddToLinkedControls(dtpSelectorB, {rdoDates}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - + ucrPnlSequenceType.bAllowNonConditionValues = True + ucrPnlSequenceType.AddFunctionNamesCondition(rdoNumeric, "seq") + ucrPnlSequenceType.AddFunctionNamesCondition(rdoDates, "as.date") ucrNewColumnName.SetPrefix("Regular") ucrNewColumnName.SetDataFrameSelector(ucrSelectDataFrameRegularSequence) @@ -104,9 +109,7 @@ Public Class dlgRegularSequence clsRepFunction.AddParameter("each", 1) clsRepFunction.AddParameter("length.out", ucrSelectDataFrameRegularSequence.iDataFrameLength) - 'SetNumericOrDatesParameters() - CheckSequenceLength() - clsSeqFunction.SetAssignTo(strTemp:=ucrNewColumnName.GetText, strTempDataframe:=ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text, strTempColumn:=ucrNewColumnName.GetText, bAssignToIsPrefix:=True) + clsSeqFunction.SetAssignTo(ucrNewColumnName.GetText, strTempDataframe:=ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text, strTempColumn:=ucrNewColumnName.GetText) ucrBase.clsRsyntax.SetBaseRFunction(clsSeqFunction) End Sub @@ -120,7 +123,7 @@ Public Class dlgRegularSequence Private Sub TestOKEnabled() If ucrNewColumnName.IsComplete Then If rdoNumeric.Checked Then - If ucrNudFrom.GetText <> "" AndAlso ucrNudTo.GetText <> "" AndAlso ucrNudInStepsOf.GetText <> "" AndAlso ucrNudRepeatValues.GetText <> "" AndAlso ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text <> "" Then + If ucrNudFrom.GetText <> "" AndAlso ucrNudTo.GetText <> "" AndAlso ucrNudInStepsOf.GetText <> "" AndAlso ucrNudRepeatValues.GetText <> "" AndAlso ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text <> "" AndAlso txtGetPreview.Text <> "" Then ucrBase.OKEnabled(True) Else ucrBase.OKEnabled(False) @@ -148,10 +151,6 @@ Public Class dlgRegularSequence End If End If End Sub - 'Private Sub nudRepeatValues_TextChanged(sender As Object, e As EventArgs) - ' SetRepeatProperties() - ' TestOKEnabled() - 'End Sub Private Sub SetBaseFunction() If ucrNudRepeatValues.Value > 1 Then @@ -172,14 +171,6 @@ Public Class dlgRegularSequence ' CheckSequenceLength() 'End Sub - - Private Sub ucrSelectDataFrameRegularSequence_DataFrameChanged(sender As Object, e As EventArgs, strPrevDataFrame As String) Handles ucrSelectDataFrameRegularSequence.DataFrameChanged - If ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text <> "" Then - ucrNudTo.Value = frmMain.clsRLink.GetDataFrameLength(ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text) - End If - CheckSequenceLength() - End Sub - Private Sub CheckSequenceLength() Dim iLength As Integer Dim vecSequence As NumericVector @@ -223,25 +214,37 @@ Public Class dlgRegularSequence End Try End Sub - Private Sub nudNumberofDecimalPlaces_TextChanged(sender As Object, e As EventArgs) - ucrNudFrom.DecimalPlaces = ucrNudNumberOfDecimalPlaces.Value - ucrNudTo.DecimalPlaces = ucrNudNumberOfDecimalPlaces.Value - ucrNudInStepsOf.DecimalPlaces = ucrNudNumberOfDecimalPlaces.Value - ucrNudFrom.Increment = 10 ^ -(ucrNudNumberOfDecimalPlaces.Value) - ucrNudTo.Increment = 10 ^ -(ucrNudNumberOfDecimalPlaces.Value) - ucrNudInStepsOf.Increment = 10 ^ -(ucrNudNumberOfDecimalPlaces.Value) + Private Sub ucrSelectDataFrameRegularSequence_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectDataFrameRegularSequence.ControlValueChanged + If ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text <> "" Then + ucrNudTo.Value = frmMain.clsRLink.GetDataFrameLength(ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text) + End If + CheckSequenceLength() End Sub - Private Sub ucrSelectDataFrameRegularSequence_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectDataFrameRegularSequence.ControlValueChanged, ucrNudInStepsOf.ControlValueChanged, ucrNudFrom.ControlValueChanged, ucrNudTo.ControlValueChanged - SetBaseFunction() - SetInStepsOfParameter() - End Sub Private Sub ucrNudRepeatValues_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrNudRepeatValues.ControlValueChanged SetBaseFunction() + SetInStepsOfParameter() End Sub Private Sub ucrNewColumnName_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrNewColumnName.ControlContentsChanged, ucrNudTo.ControlContentsChanged, ucrNudFrom.ControlContentsChanged, ucrNudInStepsOf.ControlContentsChanged, ucrNudRepeatValues.ControlContentsChanged, ucrPnlSequenceType.ControlContentsChanged TestOKEnabled() End Sub + + Private Sub ucrNudFrom_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrNudFrom.ControlValueChanged, ucrNudInStepsOf.ControlValueChanged, ucrNudTo.ControlValueChanged, ucrPnlSequenceType.ControlValueChanged + SetInStepsOfParameter() + End Sub + + Private Sub ucrNudNumberOfDecimalPlaces_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrNudNumberOfDecimalPlaces.ControlContentsChanged + ucrNudFrom.DecimalPlaces = ucrNudNumberOfDecimalPlaces.Value + ucrNudTo.DecimalPlaces = ucrNudNumberOfDecimalPlaces.Value + ucrNudInStepsOf.DecimalPlaces = ucrNudNumberOfDecimalPlaces.Value + ucrNudFrom.Increment = 10 ^ -(ucrNudNumberOfDecimalPlaces.Value) + ucrNudTo.Increment = 10 ^ -(ucrNudNumberOfDecimalPlaces.Value) + ucrNudInStepsOf.Increment = 10 ^ -(ucrNudNumberOfDecimalPlaces.Value) + End Sub + + Private Sub txtGetPreview_TextChanged(sender As Object, e As EventArgs) Handles txtGetPreview.TextChanged + TestOKEnabled() + End Sub End Class \ No newline at end of file From 21c2132d6d3fb3cee68eedc39ef3199c476930b5 Mon Sep 17 00:00:00 2001 From: Alex Sananka Date: Thu, 16 Mar 2017 15:14:33 +0300 Subject: [PATCH 10/34] Designer and more edits --- instat/dlgRegularSequence.designer.vb | 18 +++++++++--------- instat/dlgRegularSequence.vb | 12 ++++++++---- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/instat/dlgRegularSequence.designer.vb b/instat/dlgRegularSequence.designer.vb index 75b3a320c92..f815add972c 100644 --- a/instat/dlgRegularSequence.designer.vb +++ b/instat/dlgRegularSequence.designer.vb @@ -85,7 +85,7 @@ Partial Class dlgRegularSequence ' Me.ucrNudNumberOfDecimalPlaces.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudNumberOfDecimalPlaces.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudNumberOfDecimalPlaces.Location = New System.Drawing.Point(142, 180) + Me.ucrNudNumberOfDecimalPlaces.Location = New System.Drawing.Point(143, 178) Me.ucrNudNumberOfDecimalPlaces.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudNumberOfDecimalPlaces.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudNumberOfDecimalPlaces.Name = "ucrNudNumberOfDecimalPlaces" @@ -97,7 +97,7 @@ Partial Class dlgRegularSequence ' Me.ucrNudRepeatValues.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudRepeatValues.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudRepeatValues.Location = New System.Drawing.Point(99, 105) + Me.ucrNudRepeatValues.Location = New System.Drawing.Point(99, 103) Me.ucrNudRepeatValues.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudRepeatValues.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudRepeatValues.Name = "ucrNudRepeatValues" @@ -109,7 +109,7 @@ Partial Class dlgRegularSequence ' Me.ucrNudInStepsOf.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudInStepsOf.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudInStepsOf.Location = New System.Drawing.Point(99, 75) + Me.ucrNudInStepsOf.Location = New System.Drawing.Point(99, 77) Me.ucrNudInStepsOf.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudInStepsOf.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudInStepsOf.Name = "ucrNudInStepsOf" @@ -169,7 +169,7 @@ Partial Class dlgRegularSequence ' Me.dtpSelectorA.Location = New System.Drawing.Point(98, 24) Me.dtpSelectorA.Name = "dtpSelectorA" - Me.dtpSelectorA.Size = New System.Drawing.Size(91, 20) + Me.dtpSelectorA.Size = New System.Drawing.Size(87, 20) Me.dtpSelectorA.TabIndex = 2 ' 'lblLength @@ -198,7 +198,7 @@ Partial Class dlgRegularSequence 'lblTimes1 ' Me.lblTimes1.AutoSize = True - Me.lblTimes1.Location = New System.Drawing.Point(151, 108) + Me.lblTimes1.Location = New System.Drawing.Point(155, 105) Me.lblTimes1.Name = "lblTimes1" Me.lblTimes1.Size = New System.Drawing.Size(41, 13) Me.lblTimes1.TabIndex = 8 @@ -208,7 +208,7 @@ Partial Class dlgRegularSequence 'lblRepeatValues ' Me.lblRepeatValues.AutoSize = True - Me.lblRepeatValues.Location = New System.Drawing.Point(6, 105) + Me.lblRepeatValues.Location = New System.Drawing.Point(10, 105) Me.lblRepeatValues.Name = "lblRepeatValues" Me.lblRepeatValues.Size = New System.Drawing.Size(80, 13) Me.lblRepeatValues.TabIndex = 6 @@ -219,7 +219,7 @@ Partial Class dlgRegularSequence ' Me.lblSteps.AutoSize = True Me.lblSteps.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.lblSteps.Location = New System.Drawing.Point(10, 75) + Me.lblSteps.Location = New System.Drawing.Point(10, 81) Me.lblSteps.Name = "lblSteps" Me.lblSteps.Size = New System.Drawing.Size(61, 13) Me.lblSteps.TabIndex = 4 @@ -241,7 +241,7 @@ Partial Class dlgRegularSequence ' Me.lblFrom.AutoSize = True Me.lblFrom.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.lblFrom.Location = New System.Drawing.Point(10, 25) + Me.lblFrom.Location = New System.Drawing.Point(10, 24) Me.lblFrom.Name = "lblFrom" Me.lblFrom.Size = New System.Drawing.Size(33, 13) Me.lblFrom.TabIndex = 0 @@ -281,7 +281,7 @@ Partial Class dlgRegularSequence Me.grpSequenceType.Controls.Add(Me.rdoNumeric) Me.grpSequenceType.Controls.Add(Me.rdoDates) Me.grpSequenceType.Controls.Add(Me.ucrPnlSequenceType) - Me.grpSequenceType.Location = New System.Drawing.Point(16, 53) + Me.grpSequenceType.Location = New System.Drawing.Point(10, 60) Me.grpSequenceType.Name = "grpSequenceType" Me.grpSequenceType.Size = New System.Drawing.Size(199, 52) Me.grpSequenceType.TabIndex = 1 diff --git a/instat/dlgRegularSequence.vb b/instat/dlgRegularSequence.vb index 2b9af396352..380233cc3a6 100644 --- a/instat/dlgRegularSequence.vb +++ b/instat/dlgRegularSequence.vb @@ -13,7 +13,7 @@ ' ' You should have received a copy of the GNU General Public License k ' along with this program. If not, see . -Imports instat + Imports instat.Translations Imports RDotNet @@ -42,6 +42,8 @@ Public Class dlgRegularSequence ucrNudTo.SetRCode(clsSeqFunction, bReset) ucrNudRepeatValues.SetRCode(clsRepFunction, bReset) ucrNudInStepsOf.SetRCode(clsSeqFunction, bReset) + ucrNudNumberOfDecimalPlaces.SetRCode(clsSeqFunction, bReset) + ucrNudNumberOfDecimalPlaces.SetRCode(clsRepFunction, bReset) End Sub @@ -134,7 +136,9 @@ Public Class dlgRegularSequence ucrBase.OKEnabled(False) End If Else - ucrBase.OKEnabled(False) + If ucrNudTo.Value < ucrNudFrom.Value Then + ucrBase.OKEnabled(False) + End If End If End Sub @@ -227,7 +231,7 @@ Public Class dlgRegularSequence SetInStepsOfParameter() End Sub - Private Sub ucrNewColumnName_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrNewColumnName.ControlContentsChanged, ucrNudTo.ControlContentsChanged, ucrNudFrom.ControlContentsChanged, ucrNudInStepsOf.ControlContentsChanged, ucrNudRepeatValues.ControlContentsChanged, ucrPnlSequenceType.ControlContentsChanged + Private Sub ucrNewColumnName_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrNewColumnName.ControlContentsChanged, ucrNudTo.ControlContentsChanged, ucrNudFrom.ControlContentsChanged, ucrNudInStepsOf.ControlContentsChanged, ucrNudRepeatValues.ControlContentsChanged, ucrPnlSequenceType.ControlContentsChanged, ucrSelectDataFrameRegularSequence.ControlContentsChanged TestOKEnabled() End Sub @@ -244,7 +248,7 @@ Public Class dlgRegularSequence ucrNudInStepsOf.Increment = 10 ^ -(ucrNudNumberOfDecimalPlaces.Value) End Sub - Private Sub txtGetPreview_TextChanged(sender As Object, e As EventArgs) Handles txtGetPreview.TextChanged + Private Sub txtGetPreview_TextChanged(sender As Object, e As EventArgs) Handles txtGetPreview.TextChanged, rdoDates.TextChanged, rdoNumeric.TextChanged TestOKEnabled() End Sub End Class \ No newline at end of file From e9d3ea8e34bb423d9a7e9f39e0bdec9a514bdb75 Mon Sep 17 00:00:00 2001 From: Alex Sananka Date: Tue, 28 Mar 2017 18:58:12 +0300 Subject: [PATCH 11/34] fixing reseting and minor edits --- instat/dlgRegularSequence.vb | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/instat/dlgRegularSequence.vb b/instat/dlgRegularSequence.vb index 380233cc3a6..7d7e8eaf252 100644 --- a/instat/dlgRegularSequence.vb +++ b/instat/dlgRegularSequence.vb @@ -87,6 +87,7 @@ Public Class dlgRegularSequence ucrNewColumnName.SetSaveTypeAsColumn() ucrNewColumnName.SetLabelText("New Column Name:") + 'TODO complete dates option rdoDates.Enabled = False dtpSelectorB.Visible = False @@ -96,6 +97,7 @@ Public Class dlgRegularSequence 'chkDefineAsFactor.Visible = False End Sub + Private Sub SetDefaults() clsRepFunction = New RFunction clsSeqFunction = New RFunction @@ -110,8 +112,7 @@ Public Class dlgRegularSequence clsRepFunction.AddParameter("x", clsRFunctionParameter:=clsSeqFunction) clsRepFunction.AddParameter("each", 1) clsRepFunction.AddParameter("length.out", ucrSelectDataFrameRegularSequence.iDataFrameLength) - - clsSeqFunction.SetAssignTo(ucrNewColumnName.GetText, strTempDataframe:=ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text, strTempColumn:=ucrNewColumnName.GetText) + clsSeqFunction.SetAssignTo(ucrNewColumnName.GetText, strTempDataframe:=ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text, strTempColumn:=ucrNewColumnName.GetText, bAssignToIsPrefix:=True) ucrBase.clsRsyntax.SetBaseRFunction(clsSeqFunction) End Sub @@ -156,13 +157,13 @@ Public Class dlgRegularSequence End If End Sub - Private Sub SetBaseFunction() + Private Sub setbasefunction() If ucrNudRepeatValues.Value > 1 Then ucrBase.clsRsyntax.SetBaseRFunction(clsRepFunction) - Else + ElseIf ucrNudRepeatValues.Value = 1 Then ucrBase.clsRsyntax.SetBaseRFunction(clsSeqFunction) End If - CheckSequenceLength() + End Sub 'Private Sub dtpSelectorA_ValueChanged(sender As Object, e As EventArgs) Handles dtpSelectorA.ValueChanged @@ -226,19 +227,22 @@ Public Class dlgRegularSequence End Sub - Private Sub ucrNudRepeatValues_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrNudRepeatValues.ControlValueChanged - SetBaseFunction() - SetInStepsOfParameter() + Private Sub ucrNudRepeatValues_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrNudRepeatValues.ControlValueChanged, ucrNudFrom.ControlValueChanged, ucrNudTo.ControlValueChanged, ucrNudInStepsOf.ControlValueChanged + CheckSequenceLength() + ' SetBaseFunction() + 'SetInStepsOfParameter() End Sub Private Sub ucrNewColumnName_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrNewColumnName.ControlContentsChanged, ucrNudTo.ControlContentsChanged, ucrNudFrom.ControlContentsChanged, ucrNudInStepsOf.ControlContentsChanged, ucrNudRepeatValues.ControlContentsChanged, ucrPnlSequenceType.ControlContentsChanged, ucrSelectDataFrameRegularSequence.ControlContentsChanged TestOKEnabled() End Sub - Private Sub ucrNudFrom_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrNudFrom.ControlValueChanged, ucrNudInStepsOf.ControlValueChanged, ucrNudTo.ControlValueChanged, ucrPnlSequenceType.ControlValueChanged + Private Sub ucrNudFrom_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrNudInStepsOf.ControlValueChanged, ucrPnlSequenceType.ControlValueChanged + 'SetBaseFunction() SetInStepsOfParameter() End Sub + Private Sub ucrNudNumberOfDecimalPlaces_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrNudNumberOfDecimalPlaces.ControlContentsChanged ucrNudFrom.DecimalPlaces = ucrNudNumberOfDecimalPlaces.Value ucrNudTo.DecimalPlaces = ucrNudNumberOfDecimalPlaces.Value @@ -248,7 +252,7 @@ Public Class dlgRegularSequence ucrNudInStepsOf.Increment = 10 ^ -(ucrNudNumberOfDecimalPlaces.Value) End Sub - Private Sub txtGetPreview_TextChanged(sender As Object, e As EventArgs) Handles txtGetPreview.TextChanged, rdoDates.TextChanged, rdoNumeric.TextChanged + Private Sub txtGetPreview_TextChanged(sender As Object, e As EventArgs) Handles txtGetPreview.TextChanged TestOKEnabled() End Sub End Class \ No newline at end of file From caf29d32e2f72435c27501e59485073b8b2da652 Mon Sep 17 00:00:00 2001 From: Alex Sananka Date: Tue, 28 Mar 2017 19:21:52 +0300 Subject: [PATCH 12/34] More edits --- instat/dlgRegularSequence.vb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/instat/dlgRegularSequence.vb b/instat/dlgRegularSequence.vb index 7d7e8eaf252..3e4967afe43 100644 --- a/instat/dlgRegularSequence.vb +++ b/instat/dlgRegularSequence.vb @@ -221,7 +221,10 @@ Public Class dlgRegularSequence Private Sub ucrSelectDataFrameRegularSequence_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectDataFrameRegularSequence.ControlValueChanged If ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text <> "" Then - ucrNudTo.Value = frmMain.clsRLink.GetDataFrameLength(ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text) + Try + ucrNudTo.Value = frmMain.clsRLink.GetDataFrameLength(ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text) + Catch ex As Exception + End Try End If CheckSequenceLength() End Sub From 73e7c8b5ab0e3847338cdce3db73c3581517fc26 Mon Sep 17 00:00:00 2001 From: Alex Sananka Date: Thu, 30 Mar 2017 22:30:28 +0300 Subject: [PATCH 13/34] Changing controls and more edits --- instat/dlgRegularSequence.designer.vb | 129 ++++++++++---------------- instat/dlgRegularSequence.vb | 93 ++++++++----------- 2 files changed, 86 insertions(+), 136 deletions(-) diff --git a/instat/dlgRegularSequence.designer.vb b/instat/dlgRegularSequence.designer.vb index f815add972c..b23112bd4d0 100644 --- a/instat/dlgRegularSequence.designer.vb +++ b/instat/dlgRegularSequence.designer.vb @@ -23,12 +23,9 @@ Partial Class dlgRegularSequence Private Sub InitializeComponent() Me.grpSequenceDefinition = New System.Windows.Forms.GroupBox() - Me.ucrNudNumberOfDecimalPlaces = New instat.ucrNud() - Me.ucrNudRepeatValues = New instat.ucrNud() - Me.ucrNudInStepsOf = New instat.ucrNud() - Me.ucrNudTo = New instat.ucrNud() - Me.ucrNudFrom = New instat.ucrNud() - Me.lblNumberDecimalPlaces = New System.Windows.Forms.Label() + Me.ucrInputInStepsof = New instat.ucrInputTextBox() + Me.ucrInputTo = New instat.ucrInputTextBox() + Me.ucrInputFrom = New instat.ucrInputTextBox() Me.ucrDataFrameLengthForRegularSequence = New instat.ucrDataFrameLength() Me.dtpSelectorB = New System.Windows.Forms.DateTimePicker() Me.dtpSelectorA = New System.Windows.Forms.DateTimePicker() @@ -49,18 +46,17 @@ Partial Class dlgRegularSequence Me.ucrNewColumnName = New instat.ucrSave() Me.ucrSelectDataFrameRegularSequence = New instat.ucrDataFrame() Me.ucrBase = New instat.ucrButtons() + Me.ucrNudRepeatValues = New instat.ucrNud() Me.grpSequenceDefinition.SuspendLayout() Me.grpSequenceType.SuspendLayout() Me.SuspendLayout() ' 'grpSequenceDefinition ' - Me.grpSequenceDefinition.Controls.Add(Me.ucrNudNumberOfDecimalPlaces) Me.grpSequenceDefinition.Controls.Add(Me.ucrNudRepeatValues) - Me.grpSequenceDefinition.Controls.Add(Me.ucrNudInStepsOf) - Me.grpSequenceDefinition.Controls.Add(Me.ucrNudTo) - Me.grpSequenceDefinition.Controls.Add(Me.ucrNudFrom) - Me.grpSequenceDefinition.Controls.Add(Me.lblNumberDecimalPlaces) + Me.grpSequenceDefinition.Controls.Add(Me.ucrInputInStepsof) + Me.grpSequenceDefinition.Controls.Add(Me.ucrInputTo) + Me.grpSequenceDefinition.Controls.Add(Me.ucrInputFrom) Me.grpSequenceDefinition.Controls.Add(Me.ucrDataFrameLengthForRegularSequence) Me.grpSequenceDefinition.Controls.Add(Me.dtpSelectorB) Me.grpSequenceDefinition.Controls.Add(Me.dtpSelectorA) @@ -81,74 +77,35 @@ Partial Class dlgRegularSequence Me.grpSequenceDefinition.Text = "Sequence Definition" Me.grpSequenceDefinition.UseCompatibleTextRendering = True ' - 'ucrNudNumberOfDecimalPlaces + 'ucrInputInStepsof ' - Me.ucrNudNumberOfDecimalPlaces.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudNumberOfDecimalPlaces.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudNumberOfDecimalPlaces.Location = New System.Drawing.Point(143, 178) - Me.ucrNudNumberOfDecimalPlaces.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudNumberOfDecimalPlaces.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudNumberOfDecimalPlaces.Name = "ucrNudNumberOfDecimalPlaces" - Me.ucrNudNumberOfDecimalPlaces.Size = New System.Drawing.Size(50, 20) - Me.ucrNudNumberOfDecimalPlaces.TabIndex = 13 - Me.ucrNudNumberOfDecimalPlaces.Value = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrInputInStepsof.AddQuotesIfUnrecognised = True + Me.ucrInputInStepsof.IsMultiline = False + Me.ucrInputInStepsof.IsReadOnly = False + Me.ucrInputInStepsof.Location = New System.Drawing.Point(99, 75) + Me.ucrInputInStepsof.Name = "ucrInputInStepsof" + Me.ucrInputInStepsof.Size = New System.Drawing.Size(50, 20) + Me.ucrInputInStepsof.TabIndex = 19 ' - 'ucrNudRepeatValues + 'ucrInputTo ' - Me.ucrNudRepeatValues.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudRepeatValues.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudRepeatValues.Location = New System.Drawing.Point(99, 103) - Me.ucrNudRepeatValues.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudRepeatValues.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudRepeatValues.Name = "ucrNudRepeatValues" - Me.ucrNudRepeatValues.Size = New System.Drawing.Size(50, 20) - Me.ucrNudRepeatValues.TabIndex = 7 - Me.ucrNudRepeatValues.Value = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrInputTo.AddQuotesIfUnrecognised = True + Me.ucrInputTo.IsMultiline = False + Me.ucrInputTo.IsReadOnly = False + Me.ucrInputTo.Location = New System.Drawing.Point(99, 50) + Me.ucrInputTo.Name = "ucrInputTo" + Me.ucrInputTo.Size = New System.Drawing.Size(50, 20) + Me.ucrInputTo.TabIndex = 18 + ' + 'ucrInputFrom ' - 'ucrNudInStepsOf - ' - Me.ucrNudInStepsOf.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudInStepsOf.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudInStepsOf.Location = New System.Drawing.Point(99, 77) - Me.ucrNudInStepsOf.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudInStepsOf.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudInStepsOf.Name = "ucrNudInStepsOf" - Me.ucrNudInStepsOf.Size = New System.Drawing.Size(50, 20) - Me.ucrNudInStepsOf.TabIndex = 5 - Me.ucrNudInStepsOf.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrNudTo - ' - Me.ucrNudTo.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudTo.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudTo.Location = New System.Drawing.Point(99, 51) - Me.ucrNudTo.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudTo.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudTo.Name = "ucrNudTo" - Me.ucrNudTo.Size = New System.Drawing.Size(50, 20) - Me.ucrNudTo.TabIndex = 3 - Me.ucrNudTo.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrNudFrom - ' - Me.ucrNudFrom.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudFrom.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudFrom.Location = New System.Drawing.Point(99, 25) - Me.ucrNudFrom.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudFrom.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudFrom.Name = "ucrNudFrom" - Me.ucrNudFrom.Size = New System.Drawing.Size(50, 20) - Me.ucrNudFrom.TabIndex = 1 - Me.ucrNudFrom.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'lblNumberDecimalPlaces - ' - Me.lblNumberDecimalPlaces.AutoSize = True - Me.lblNumberDecimalPlaces.Location = New System.Drawing.Point(10, 180) - Me.lblNumberDecimalPlaces.Name = "lblNumberDecimalPlaces" - Me.lblNumberDecimalPlaces.Size = New System.Drawing.Size(135, 13) - Me.lblNumberDecimalPlaces.TabIndex = 12 - Me.lblNumberDecimalPlaces.Text = "Number of Decimal Places:" + Me.ucrInputFrom.AddQuotesIfUnrecognised = True + Me.ucrInputFrom.IsMultiline = False + Me.ucrInputFrom.IsReadOnly = False + Me.ucrInputFrom.Location = New System.Drawing.Point(99, 25) + Me.ucrInputFrom.Name = "ucrInputFrom" + Me.ucrInputFrom.Size = New System.Drawing.Size(50, 20) + Me.ucrInputFrom.TabIndex = 8 ' 'ucrDataFrameLengthForRegularSequence ' @@ -344,6 +301,18 @@ Partial Class dlgRegularSequence Me.ucrBase.Size = New System.Drawing.Size(410, 52) Me.ucrBase.TabIndex = 7 ' + 'ucrNudRepeatValues + ' + Me.ucrNudRepeatValues.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudRepeatValues.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudRepeatValues.Location = New System.Drawing.Point(99, 100) + Me.ucrNudRepeatValues.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudRepeatValues.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudRepeatValues.Name = "ucrNudRepeatValues" + Me.ucrNudRepeatValues.Size = New System.Drawing.Size(50, 20) + Me.ucrNudRepeatValues.TabIndex = 21 + Me.ucrNudRepeatValues.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' 'dlgRegularSequence ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -389,15 +358,13 @@ Partial Class dlgRegularSequence Friend WithEvents txtGetPreview As RichTextBox Friend WithEvents ucrDataFrameLengthForRegularSequence As ucrDataFrameLength Friend WithEvents txtMessage As TextBox - Friend WithEvents ucrNudRepeatValues As ucrNud - Friend WithEvents ucrNudInStepsOf As ucrNud - Friend WithEvents ucrNudTo As ucrNud - Friend WithEvents ucrNudFrom As ucrNud - Friend WithEvents lblNumberDecimalPlaces As Label Friend WithEvents ucrNewColumnName As ucrSave Friend WithEvents grpSequenceType As GroupBox Friend WithEvents rdoNumeric As RadioButton Friend WithEvents rdoDates As RadioButton Friend WithEvents ucrPnlSequenceType As UcrPanel - Friend WithEvents ucrNudNumberOfDecimalPlaces As ucrNud + Friend WithEvents ucrInputInStepsof As ucrInputTextBox + Friend WithEvents ucrInputTo As ucrInputTextBox + Friend WithEvents ucrInputFrom As ucrInputTextBox + Friend WithEvents ucrNudRepeatValues As ucrNud End Class diff --git a/instat/dlgRegularSequence.vb b/instat/dlgRegularSequence.vb index 3e4967afe43..4e084af1968 100644 --- a/instat/dlgRegularSequence.vb +++ b/instat/dlgRegularSequence.vb @@ -38,12 +38,11 @@ Public Class dlgRegularSequence Private Sub SetRCodeForControls(bReset As Boolean) ucrNewColumnName.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrPnlSequenceType.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - ucrNudFrom.SetRCode(clsSeqFunction, bReset) - ucrNudTo.SetRCode(clsSeqFunction, bReset) + ucrInputFrom.SetRCode(clsSeqFunction, bReset) + ucrInputTo.SetRCode(clsSeqFunction, bReset) ucrNudRepeatValues.SetRCode(clsRepFunction, bReset) - ucrNudInStepsOf.SetRCode(clsSeqFunction, bReset) - ucrNudNumberOfDecimalPlaces.SetRCode(clsSeqFunction, bReset) - ucrNudNumberOfDecimalPlaces.SetRCode(clsRepFunction, bReset) + ucrInputInStepsof.SetRCode(clsSeqFunction, bReset) + End Sub @@ -53,27 +52,23 @@ Public Class dlgRegularSequence ucrPnlSequenceType.AddRadioButton(rdoNumeric) ucrPnlSequenceType.AddRadioButton(rdoDates) - ucrNudFrom.SetParameter(New RParameter("from", 0)) - ucrNudTo.SetParameter(New RParameter("to", 1)) + ucrInputFrom.SetParameter(New RParameter("from", 0)) + ucrInputFrom.SetValidationTypeAsNumeric() + ucrInputTo.SetParameter(New RParameter("to", 1)) + ucrInputTo.SetValidationTypeAsNumeric() ucrNudRepeatValues.SetParameter(New RParameter("each", 1)) - ucrNudInStepsOf.SetParameter(New RParameter("by", 2)) - ucrNudInStepsOf.Minimum = 1 - ucrNudInStepsOf.SetRDefault(1) - ucrNudInStepsOf.Maximum = Integer.MaxValue - ucrNudFrom.Minimum = 1 - ucrNudFrom.Maximum = Integer.MaxValue - ucrNudTo.Minimum = 1 - ucrNudRepeatValues.Maximum = Integer.MaxValue - ucrDataFrameLengthForRegularSequence.SetDataFrameSelector(ucrSelectDataFrameRegularSequence) - - ucrPnlSequenceType.AddToLinkedControls(ucrNudFrom, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, objNewDefaultState:=1) - ucrNudFrom.SetLinkedDisplayControl(lblFrom) - ucrPnlSequenceType.AddToLinkedControls(ucrNudTo, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, objNewDefaultState:=ucrSelectDataFrameRegularSequence.iDataFrameLength) - ucrNudTo.SetLinkedDisplayControl(lblTo) - ucrPnlSequenceType.AddToLinkedControls(ucrNudInStepsOf, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, objNewDefaultState:=1) + ucrInputInStepsof.SetParameter(New RParameter("by", 2)) + ucrInputInStepsof.SetValidationTypeAsNumeric() + ucrDataFrameLengthForRegularSequence.SetDataFrameSelector(ucrSelectDataFrameRegularSequence) + + ucrPnlSequenceType.AddToLinkedControls(ucrInputFrom, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, objNewDefaultState:=1) + ucrInputFrom.SetLinkedDisplayControl(lblFrom) + ucrPnlSequenceType.AddToLinkedControls(ucrInputTo, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, objNewDefaultState:=ucrSelectDataFrameRegularSequence.iDataFrameLength) + ucrInputTo.SetLinkedDisplayControl(lblTo) + ucrPnlSequenceType.AddToLinkedControls(ucrInputInStepsof, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, objNewDefaultState:=1) ucrNudRepeatValues.SetLinkedDisplayControl(lblRepeatValues) ucrPnlSequenceType.AddToLinkedControls(ucrNudRepeatValues, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, objNewDefaultState:=1) - ucrNudInStepsOf.SetLinkedDisplayControl(lblSteps) + ucrInputInStepsof.SetLinkedDisplayControl(lblSteps) 'ucrPnlSequenceType.AddToLinkedControls(dtpSelectorA, {rdoDates}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) 'ucrPnlSequenceType.AddToLinkedControls(dtpSelectorB, {rdoDates}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) @@ -92,8 +87,8 @@ Public Class dlgRegularSequence rdoDates.Enabled = False dtpSelectorB.Visible = False dtpSelectorA.Visible = False - 'ucrNudFrom.Visible = False - ' ucrNudTo.Visible = False + 'ucrInputFrom.Visible = False + ' ucrInputTo.Visible = False 'chkDefineAsFactor.Visible = False End Sub @@ -126,7 +121,7 @@ Public Class dlgRegularSequence Private Sub TestOKEnabled() If ucrNewColumnName.IsComplete Then If rdoNumeric.Checked Then - If ucrNudFrom.GetText <> "" AndAlso ucrNudTo.GetText <> "" AndAlso ucrNudInStepsOf.GetText <> "" AndAlso ucrNudRepeatValues.GetText <> "" AndAlso ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text <> "" AndAlso txtGetPreview.Text <> "" Then + If ucrInputFrom.GetText <> "" AndAlso ucrInputTo.GetText <> "" AndAlso ucrInputInStepsof.GetText <> "" AndAlso ucrNudRepeatValues.GetText <> "" AndAlso ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text <> "" Then ucrBase.OKEnabled(True) Else ucrBase.OKEnabled(False) @@ -137,7 +132,7 @@ Public Class dlgRegularSequence ucrBase.OKEnabled(False) End If Else - If ucrNudTo.Value < ucrNudFrom.Value Then + If ucrInputTo.GetText < ucrInputFrom.GetText Then ucrBase.OKEnabled(False) End If End If @@ -145,22 +140,22 @@ Public Class dlgRegularSequence Private Sub SetInStepsOfParameter() If rdoNumeric.Checked Then - If ucrNudInStepsOf.GetText <> "" Then - If (ucrNudInStepsOf.Value = 1 AndAlso frmMain.clsInstatOptions.bIncludeRDefaultParameters) OrElse ucrNudInStepsOf.Value <> 1 Then - If ucrNudTo.Value >= ucrNudFrom.Value Then - clsSeqFunction.AddParameter("by", ucrNudInStepsOf.Value) + If ucrInputInStepsof.GetText <> "" Then + If (ucrInputInStepsof.GetText = 1 AndAlso frmMain.clsInstatOptions.bIncludeRDefaultParameters) OrElse ucrInputInStepsof.GetText <> 1 Then + If ucrInputTo.GetText >= ucrInputFrom.GetText Then + clsSeqFunction.AddParameter("by", ucrInputInStepsof.GetText) Else - clsSeqFunction.AddParameter("by", -ucrNudInStepsOf.Value) + clsSeqFunction.AddParameter("by", -ucrInputInStepsof.GetText) End If End If End If End If End Sub - Private Sub setbasefunction() - If ucrNudRepeatValues.Value > 1 Then + Private Sub SetBaseFunction() + If Convert.ToInt32(ucrNudRepeatValues.GetText) > 1 Then ucrBase.clsRsyntax.SetBaseRFunction(clsRepFunction) - ElseIf ucrNudRepeatValues.Value = 1 Then + Else ucrBase.clsRsyntax.SetBaseRFunction(clsSeqFunction) End If @@ -201,13 +196,13 @@ Public Class dlgRegularSequence bIsAssigned = False vecSequence = frmMain.clsRLink.RunInternalScriptGetValue(strRCommand, bSilent:=True).AsNumeric If iLength < ucrSelectDataFrameRegularSequence.iDataFrameLength Then - txtMessage.Text = "Sequence has been extended by repeating to match the length of the dataframe." + txtMessage.Text = "Sequence has been extended by repeating to match the length of the data frame." ElseIf iLength > ucrSelectDataFrameRegularSequence.iDataFrameLength Then - txtMessage.Text = "Sequence has been truncated to match the length of the dataframe." + txtMessage.Text = "Sequence has been truncated to match the length of the data frame." End If Else clsRepFunction.RemoveParameterByName("length.out") - txtMessage.Text = "Sequence matches the length of the dataframe." + txtMessage.Text = "Sequence matches the length of the data frame." End If txtGetPreview.Text = "" txtGetPreview.Text = String.Join(", ", vecSequence.AsCharacter()) @@ -222,7 +217,7 @@ Public Class dlgRegularSequence Private Sub ucrSelectDataFrameRegularSequence_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectDataFrameRegularSequence.ControlValueChanged If ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text <> "" Then Try - ucrNudTo.Value = frmMain.clsRLink.GetDataFrameLength(ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text) + ' ucrInputTo.Value = frmMain.clsRLink.GetDataFrameLength(ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text) Catch ex As Exception End Try End If @@ -230,32 +225,20 @@ Public Class dlgRegularSequence End Sub - Private Sub ucrNudRepeatValues_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrNudRepeatValues.ControlValueChanged, ucrNudFrom.ControlValueChanged, ucrNudTo.ControlValueChanged, ucrNudInStepsOf.ControlValueChanged + Private Sub ucrNudRepeatValues_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrInputFrom.ControlValueChanged, ucrInputTo.ControlValueChanged, ucrInputInStepsof.ControlValueChanged CheckSequenceLength() - ' SetBaseFunction() + 'SetBaseFunction() 'SetInStepsOfParameter() End Sub - Private Sub ucrNewColumnName_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrNewColumnName.ControlContentsChanged, ucrNudTo.ControlContentsChanged, ucrNudFrom.ControlContentsChanged, ucrNudInStepsOf.ControlContentsChanged, ucrNudRepeatValues.ControlContentsChanged, ucrPnlSequenceType.ControlContentsChanged, ucrSelectDataFrameRegularSequence.ControlContentsChanged + Private Sub ucrNewColumnName_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrNewColumnName.ControlContentsChanged, ucrPnlSequenceType.ControlContentsChanged, ucrSelectDataFrameRegularSequence.ControlContentsChanged TestOKEnabled() End Sub - Private Sub ucrNudFrom_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrNudInStepsOf.ControlValueChanged, ucrPnlSequenceType.ControlValueChanged + Private Sub ucrInputFrom_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputInStepsof.ControlValueChanged, ucrPnlSequenceType.ControlValueChanged 'SetBaseFunction() SetInStepsOfParameter() End Sub - Private Sub ucrNudNumberOfDecimalPlaces_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrNudNumberOfDecimalPlaces.ControlContentsChanged - ucrNudFrom.DecimalPlaces = ucrNudNumberOfDecimalPlaces.Value - ucrNudTo.DecimalPlaces = ucrNudNumberOfDecimalPlaces.Value - ucrNudInStepsOf.DecimalPlaces = ucrNudNumberOfDecimalPlaces.Value - ucrNudFrom.Increment = 10 ^ -(ucrNudNumberOfDecimalPlaces.Value) - ucrNudTo.Increment = 10 ^ -(ucrNudNumberOfDecimalPlaces.Value) - ucrNudInStepsOf.Increment = 10 ^ -(ucrNudNumberOfDecimalPlaces.Value) - End Sub - - Private Sub txtGetPreview_TextChanged(sender As Object, e As EventArgs) Handles txtGetPreview.TextChanged - TestOKEnabled() - End Sub End Class \ No newline at end of file From 836232a1277efecf9c2f5f55386f0c9a19756559 Mon Sep 17 00:00:00 2001 From: Alex Sananka Date: Fri, 31 Mar 2017 16:54:32 +0300 Subject: [PATCH 14/34] More edits,resetting controls --- instat/dlgRegularSequence.vb | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/instat/dlgRegularSequence.vb b/instat/dlgRegularSequence.vb index 4e084af1968..52b0666d464 100644 --- a/instat/dlgRegularSequence.vb +++ b/instat/dlgRegularSequence.vb @@ -14,6 +14,7 @@ ' You should have received a copy of the GNU General Public License k ' along with this program. If not, see . +Imports instat Imports instat.Translations Imports RDotNet @@ -41,9 +42,9 @@ Public Class dlgRegularSequence ucrInputFrom.SetRCode(clsSeqFunction, bReset) ucrInputTo.SetRCode(clsSeqFunction, bReset) ucrNudRepeatValues.SetRCode(clsRepFunction, bReset) + ucrNudRepeatValues.SetRCode(clsSeqFunction, bReset) ucrInputInStepsof.SetRCode(clsSeqFunction, bReset) - End Sub Private Sub InitialiseDialog() @@ -53,13 +54,17 @@ Public Class dlgRegularSequence ucrPnlSequenceType.AddRadioButton(rdoDates) ucrInputFrom.SetParameter(New RParameter("from", 0)) + ucrInputFrom.AddQuotesIfUnrecognised = False ucrInputFrom.SetValidationTypeAsNumeric() ucrInputTo.SetParameter(New RParameter("to", 1)) + ucrInputTo.AddQuotesIfUnrecognised = False ucrInputTo.SetValidationTypeAsNumeric() ucrNudRepeatValues.SetParameter(New RParameter("each", 1)) + ucrNudRepeatValues.Minimum = 1 ucrInputInStepsof.SetParameter(New RParameter("by", 2)) + ucrInputInStepsof.AddQuotesIfUnrecognised = False ucrInputInStepsof.SetValidationTypeAsNumeric() - ucrDataFrameLengthForRegularSequence.SetDataFrameSelector(ucrSelectDataFrameRegularSequence) + ucrDataFrameLengthForRegularSequence.SetDataFrameSelector(ucrSelectDataFrameRegularSequence) ucrPnlSequenceType.AddToLinkedControls(ucrInputFrom, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, objNewDefaultState:=1) ucrInputFrom.SetLinkedDisplayControl(lblFrom) @@ -82,17 +87,15 @@ Public Class dlgRegularSequence ucrNewColumnName.SetSaveTypeAsColumn() ucrNewColumnName.SetLabelText("New Column Name:") - 'TODO complete dates option rdoDates.Enabled = False dtpSelectorB.Visible = False dtpSelectorA.Visible = False + chkDefineAsFactor.Visible = False 'ucrInputFrom.Visible = False ' ucrInputTo.Visible = False - 'chkDefineAsFactor.Visible = False End Sub - Private Sub SetDefaults() clsRepFunction = New RFunction clsSeqFunction = New RFunction @@ -107,7 +110,7 @@ Public Class dlgRegularSequence clsRepFunction.AddParameter("x", clsRFunctionParameter:=clsSeqFunction) clsRepFunction.AddParameter("each", 1) clsRepFunction.AddParameter("length.out", ucrSelectDataFrameRegularSequence.iDataFrameLength) - clsSeqFunction.SetAssignTo(ucrNewColumnName.GetText, strTempDataframe:=ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text, strTempColumn:=ucrNewColumnName.GetText, bAssignToIsPrefix:=True) + clsSeqFunction.SetAssignTo(ucrNewColumnName.GetText, strTempDataframe:=ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text, strTempColumn:=ucrNewColumnName.GetText) ucrBase.clsRsyntax.SetBaseRFunction(clsSeqFunction) End Sub @@ -121,7 +124,7 @@ Public Class dlgRegularSequence Private Sub TestOKEnabled() If ucrNewColumnName.IsComplete Then If rdoNumeric.Checked Then - If ucrInputFrom.GetText <> "" AndAlso ucrInputTo.GetText <> "" AndAlso ucrInputInStepsof.GetText <> "" AndAlso ucrNudRepeatValues.GetText <> "" AndAlso ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text <> "" Then + If ucrInputFrom.GetText <> "" AndAlso ucrInputTo.GetText <> "" AndAlso ucrInputInStepsof.GetText <> "" AndAlso ucrNudRepeatValues.GetText <> "" AndAlso ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text <> "" AndAlso txtGetPreview.Text <> "" Then ucrBase.OKEnabled(True) Else ucrBase.OKEnabled(False) @@ -153,7 +156,7 @@ Public Class dlgRegularSequence End Sub Private Sub SetBaseFunction() - If Convert.ToInt32(ucrNudRepeatValues.GetText) > 1 Then + If ucrNudRepeatValues.Value > 1 Then ucrBase.clsRsyntax.SetBaseRFunction(clsRepFunction) Else ucrBase.clsRsyntax.SetBaseRFunction(clsSeqFunction) @@ -217,28 +220,33 @@ Public Class dlgRegularSequence Private Sub ucrSelectDataFrameRegularSequence_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectDataFrameRegularSequence.ControlValueChanged If ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text <> "" Then Try - ' ucrInputTo.Value = frmMain.clsRLink.GetDataFrameLength(ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text) + ucrInputTo.txtInput.Text = frmMain.clsRLink.GetDataFrameLength(ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text) Catch ex As Exception End Try End If CheckSequenceLength() End Sub + Private Sub ucrNudRepeatValues_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrNudRepeatValues.ControlContentsChanged + SetBaseFunction() + CheckSequenceLength() + End Sub - Private Sub ucrNudRepeatValues_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrInputFrom.ControlValueChanged, ucrInputTo.ControlValueChanged, ucrInputInStepsof.ControlValueChanged + Private Sub ucrInputFrom_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrInputFrom.ControlContentsChanged, ucrInputTo.ControlContentsChanged, ucrInputInStepsof.ControlContentsChanged CheckSequenceLength() - 'SetBaseFunction() 'SetInStepsOfParameter() End Sub - Private Sub ucrNewColumnName_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrNewColumnName.ControlContentsChanged, ucrPnlSequenceType.ControlContentsChanged, ucrSelectDataFrameRegularSequence.ControlContentsChanged + Private Sub ucrNewColumnName_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrNewColumnName.ControlContentsChanged, ucrInputTo.ControlContentsChanged, ucrInputFrom.ControlContentsChanged, ucrInputInStepsof.ControlContentsChanged, ucrNudRepeatValues.ControlContentsChanged, ucrPnlSequenceType.ControlContentsChanged, ucrSelectDataFrameRegularSequence.ControlContentsChanged TestOKEnabled() End Sub - Private Sub ucrInputFrom_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputInStepsof.ControlValueChanged, ucrPnlSequenceType.ControlValueChanged + Private Sub ucrInputFrom_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputInStepsof.ControlContentsChanged, ucrPnlSequenceType.ControlContentsChanged 'SetBaseFunction() SetInStepsOfParameter() End Sub - + Private Sub txtGetPreview_TextChanged(sender As Object, e As EventArgs) Handles txtGetPreview.TextChanged + TestOKEnabled() + End Sub End Class \ No newline at end of file From 78b739ba28eb369306daeeaa13deee568b7ca3fa Mon Sep 17 00:00:00 2001 From: Alex Sananka Date: Mon, 3 Apr 2017 10:01:07 +0300 Subject: [PATCH 15/34] fixing SetAssignTo --- instat/dlgRegularSequence.vb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/instat/dlgRegularSequence.vb b/instat/dlgRegularSequence.vb index 52b0666d464..a9ecb4f01e5 100644 --- a/instat/dlgRegularSequence.vb +++ b/instat/dlgRegularSequence.vb @@ -110,7 +110,8 @@ Public Class dlgRegularSequence clsRepFunction.AddParameter("x", clsRFunctionParameter:=clsSeqFunction) clsRepFunction.AddParameter("each", 1) clsRepFunction.AddParameter("length.out", ucrSelectDataFrameRegularSequence.iDataFrameLength) - clsSeqFunction.SetAssignTo(ucrNewColumnName.GetText, strTempDataframe:=ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text, strTempColumn:=ucrNewColumnName.GetText) + 'clsSeqFunction.SetAssignTo(ucrNewColumnName.GetText, strTempDataframe:=ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text, strTempColumn:=ucrNewColumnName.GetText) + ucrBase.clsRsyntax.SetAssignTo(strAssignToName:=ucrNewColumnName.GetText, strTempDataframe:=ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text, strTempColumn:=ucrNewColumnName.GetText) ucrBase.clsRsyntax.SetBaseRFunction(clsSeqFunction) End Sub @@ -198,6 +199,7 @@ Public Class dlgRegularSequence strRCommand = ucrBase.clsRsyntax.clsBaseFunction.ToScript() bIsAssigned = False vecSequence = frmMain.clsRLink.RunInternalScriptGetValue(strRCommand, bSilent:=True).AsNumeric + ucrBase.clsRsyntax.SetAssignTo(strAssignToName:=ucrNewColumnName.GetText, strTempDataframe:=ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text, strTempColumn:=ucrNewColumnName.GetText) If iLength < ucrSelectDataFrameRegularSequence.iDataFrameLength Then txtMessage.Text = "Sequence has been extended by repeating to match the length of the data frame." ElseIf iLength > ucrSelectDataFrameRegularSequence.iDataFrameLength Then From 987ae223b9729e2b88c2fac43058aec40a307068 Mon Sep 17 00:00:00 2001 From: Alex Sananka Date: Mon, 3 Apr 2017 14:40:11 +0300 Subject: [PATCH 16/34] Tab order and some designer changes. --- instat/dlgRegularSequence.designer.vb | 34 +++++++++++++-------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/instat/dlgRegularSequence.designer.vb b/instat/dlgRegularSequence.designer.vb index b23112bd4d0..14ecf9b909d 100644 --- a/instat/dlgRegularSequence.designer.vb +++ b/instat/dlgRegularSequence.designer.vb @@ -23,6 +23,7 @@ Partial Class dlgRegularSequence Private Sub InitializeComponent() Me.grpSequenceDefinition = New System.Windows.Forms.GroupBox() + Me.ucrNudRepeatValues = New instat.ucrNud() Me.ucrInputInStepsof = New instat.ucrInputTextBox() Me.ucrInputTo = New instat.ucrInputTextBox() Me.ucrInputFrom = New instat.ucrInputTextBox() @@ -46,7 +47,6 @@ Partial Class dlgRegularSequence Me.ucrNewColumnName = New instat.ucrSave() Me.ucrSelectDataFrameRegularSequence = New instat.ucrDataFrame() Me.ucrBase = New instat.ucrButtons() - Me.ucrNudRepeatValues = New instat.ucrNud() Me.grpSequenceDefinition.SuspendLayout() Me.grpSequenceType.SuspendLayout() Me.SuspendLayout() @@ -77,6 +77,18 @@ Partial Class dlgRegularSequence Me.grpSequenceDefinition.Text = "Sequence Definition" Me.grpSequenceDefinition.UseCompatibleTextRendering = True ' + 'ucrNudRepeatValues + ' + Me.ucrNudRepeatValues.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudRepeatValues.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudRepeatValues.Location = New System.Drawing.Point(99, 100) + Me.ucrNudRepeatValues.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudRepeatValues.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudRepeatValues.Name = "ucrNudRepeatValues" + Me.ucrNudRepeatValues.Size = New System.Drawing.Size(50, 20) + Me.ucrNudRepeatValues.TabIndex = 7 + Me.ucrNudRepeatValues.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' 'ucrInputInStepsof ' Me.ucrInputInStepsof.AddQuotesIfUnrecognised = True @@ -85,7 +97,7 @@ Partial Class dlgRegularSequence Me.ucrInputInStepsof.Location = New System.Drawing.Point(99, 75) Me.ucrInputInStepsof.Name = "ucrInputInStepsof" Me.ucrInputInStepsof.Size = New System.Drawing.Size(50, 20) - Me.ucrInputInStepsof.TabIndex = 19 + Me.ucrInputInStepsof.TabIndex = 5 ' 'ucrInputTo ' @@ -95,7 +107,7 @@ Partial Class dlgRegularSequence Me.ucrInputTo.Location = New System.Drawing.Point(99, 50) Me.ucrInputTo.Name = "ucrInputTo" Me.ucrInputTo.Size = New System.Drawing.Size(50, 20) - Me.ucrInputTo.TabIndex = 18 + Me.ucrInputTo.TabIndex = 3 ' 'ucrInputFrom ' @@ -105,7 +117,7 @@ Partial Class dlgRegularSequence Me.ucrInputFrom.Location = New System.Drawing.Point(99, 25) Me.ucrInputFrom.Name = "ucrInputFrom" Me.ucrInputFrom.Size = New System.Drawing.Size(50, 20) - Me.ucrInputFrom.TabIndex = 8 + Me.ucrInputFrom.TabIndex = 1 ' 'ucrDataFrameLengthForRegularSequence ' @@ -155,7 +167,7 @@ Partial Class dlgRegularSequence 'lblTimes1 ' Me.lblTimes1.AutoSize = True - Me.lblTimes1.Location = New System.Drawing.Point(155, 105) + Me.lblTimes1.Location = New System.Drawing.Point(155, 102) Me.lblTimes1.Name = "lblTimes1" Me.lblTimes1.Size = New System.Drawing.Size(41, 13) Me.lblTimes1.TabIndex = 8 @@ -301,18 +313,6 @@ Partial Class dlgRegularSequence Me.ucrBase.Size = New System.Drawing.Size(410, 52) Me.ucrBase.TabIndex = 7 ' - 'ucrNudRepeatValues - ' - Me.ucrNudRepeatValues.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudRepeatValues.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudRepeatValues.Location = New System.Drawing.Point(99, 100) - Me.ucrNudRepeatValues.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudRepeatValues.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudRepeatValues.Name = "ucrNudRepeatValues" - Me.ucrNudRepeatValues.Size = New System.Drawing.Size(50, 20) - Me.ucrNudRepeatValues.TabIndex = 21 - Me.ucrNudRepeatValues.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' 'dlgRegularSequence ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) From 00a6f4fa0bd13e2fb8582816e0b47a3ba40d1a7e Mon Sep 17 00:00:00 2001 From: Alex Sananka Date: Tue, 4 Apr 2017 12:06:59 +0300 Subject: [PATCH 17/34] More edits and fixing some designer changes --- instat/dlgRegularSequence.designer.vb | 76 +++++++++++++-------------- instat/dlgRegularSequence.vb | 44 ++++------------ 2 files changed, 49 insertions(+), 71 deletions(-) diff --git a/instat/dlgRegularSequence.designer.vb b/instat/dlgRegularSequence.designer.vb index 14ecf9b909d..4b34ac8c676 100644 --- a/instat/dlgRegularSequence.designer.vb +++ b/instat/dlgRegularSequence.designer.vb @@ -24,7 +24,7 @@ Partial Class dlgRegularSequence Private Sub InitializeComponent() Me.grpSequenceDefinition = New System.Windows.Forms.GroupBox() Me.ucrNudRepeatValues = New instat.ucrNud() - Me.ucrInputInStepsof = New instat.ucrInputTextBox() + Me.ucrInputInStepsOf = New instat.ucrInputTextBox() Me.ucrInputTo = New instat.ucrInputTextBox() Me.ucrInputFrom = New instat.ucrInputTextBox() Me.ucrDataFrameLengthForRegularSequence = New instat.ucrDataFrameLength() @@ -34,7 +34,7 @@ Partial Class dlgRegularSequence Me.chkDefineAsFactor = New System.Windows.Forms.CheckBox() Me.lblTimes1 = New System.Windows.Forms.Label() Me.lblRepeatValues = New System.Windows.Forms.Label() - Me.lblSteps = New System.Windows.Forms.Label() + Me.lblInStepsOf = New System.Windows.Forms.Label() Me.lblTo = New System.Windows.Forms.Label() Me.lblFrom = New System.Windows.Forms.Label() Me.lblPreview = New System.Windows.Forms.Label() @@ -54,7 +54,7 @@ Partial Class dlgRegularSequence 'grpSequenceDefinition ' Me.grpSequenceDefinition.Controls.Add(Me.ucrNudRepeatValues) - Me.grpSequenceDefinition.Controls.Add(Me.ucrInputInStepsof) + Me.grpSequenceDefinition.Controls.Add(Me.ucrInputInStepsOf) Me.grpSequenceDefinition.Controls.Add(Me.ucrInputTo) Me.grpSequenceDefinition.Controls.Add(Me.ucrInputFrom) Me.grpSequenceDefinition.Controls.Add(Me.ucrDataFrameLengthForRegularSequence) @@ -64,11 +64,11 @@ Partial Class dlgRegularSequence Me.grpSequenceDefinition.Controls.Add(Me.chkDefineAsFactor) Me.grpSequenceDefinition.Controls.Add(Me.lblTimes1) Me.grpSequenceDefinition.Controls.Add(Me.lblRepeatValues) - Me.grpSequenceDefinition.Controls.Add(Me.lblSteps) + Me.grpSequenceDefinition.Controls.Add(Me.lblInStepsOf) Me.grpSequenceDefinition.Controls.Add(Me.lblTo) Me.grpSequenceDefinition.Controls.Add(Me.lblFrom) Me.grpSequenceDefinition.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.grpSequenceDefinition.Location = New System.Drawing.Point(10, 111) + Me.grpSequenceDefinition.Location = New System.Drawing.Point(10, 113) Me.grpSequenceDefinition.Name = "grpSequenceDefinition" Me.grpSequenceDefinition.Size = New System.Drawing.Size(205, 204) Me.grpSequenceDefinition.TabIndex = 4 @@ -81,23 +81,23 @@ Partial Class dlgRegularSequence ' Me.ucrNudRepeatValues.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudRepeatValues.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudRepeatValues.Location = New System.Drawing.Point(99, 100) + Me.ucrNudRepeatValues.Location = New System.Drawing.Point(99, 102) Me.ucrNudRepeatValues.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudRepeatValues.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudRepeatValues.Name = "ucrNudRepeatValues" - Me.ucrNudRepeatValues.Size = New System.Drawing.Size(50, 20) + Me.ucrNudRepeatValues.Size = New System.Drawing.Size(50, 23) Me.ucrNudRepeatValues.TabIndex = 7 Me.ucrNudRepeatValues.Value = New Decimal(New Integer() {0, 0, 0, 0}) ' - 'ucrInputInStepsof + 'ucrInputInStepsOf ' - Me.ucrInputInStepsof.AddQuotesIfUnrecognised = True - Me.ucrInputInStepsof.IsMultiline = False - Me.ucrInputInStepsof.IsReadOnly = False - Me.ucrInputInStepsof.Location = New System.Drawing.Point(99, 75) - Me.ucrInputInStepsof.Name = "ucrInputInStepsof" - Me.ucrInputInStepsof.Size = New System.Drawing.Size(50, 20) - Me.ucrInputInStepsof.TabIndex = 5 + Me.ucrInputInStepsOf.AddQuotesIfUnrecognised = True + Me.ucrInputInStepsOf.IsMultiline = False + Me.ucrInputInStepsOf.IsReadOnly = False + Me.ucrInputInStepsOf.Location = New System.Drawing.Point(99, 76) + Me.ucrInputInStepsOf.Name = "ucrInputInStepsOf" + Me.ucrInputInStepsOf.Size = New System.Drawing.Size(50, 23) + Me.ucrInputInStepsOf.TabIndex = 5 ' 'ucrInputTo ' @@ -106,7 +106,7 @@ Partial Class dlgRegularSequence Me.ucrInputTo.IsReadOnly = False Me.ucrInputTo.Location = New System.Drawing.Point(99, 50) Me.ucrInputTo.Name = "ucrInputTo" - Me.ucrInputTo.Size = New System.Drawing.Size(50, 20) + Me.ucrInputTo.Size = New System.Drawing.Size(50, 23) Me.ucrInputTo.TabIndex = 3 ' 'ucrInputFrom @@ -114,14 +114,14 @@ Partial Class dlgRegularSequence Me.ucrInputFrom.AddQuotesIfUnrecognised = True Me.ucrInputFrom.IsMultiline = False Me.ucrInputFrom.IsReadOnly = False - Me.ucrInputFrom.Location = New System.Drawing.Point(99, 25) + Me.ucrInputFrom.Location = New System.Drawing.Point(99, 24) Me.ucrInputFrom.Name = "ucrInputFrom" - Me.ucrInputFrom.Size = New System.Drawing.Size(50, 20) + Me.ucrInputFrom.Size = New System.Drawing.Size(50, 23) Me.ucrInputFrom.TabIndex = 1 ' 'ucrDataFrameLengthForRegularSequence ' - Me.ucrDataFrameLengthForRegularSequence.Location = New System.Drawing.Point(98, 130) + Me.ucrDataFrameLengthForRegularSequence.Location = New System.Drawing.Point(98, 128) Me.ucrDataFrameLengthForRegularSequence.Name = "ucrDataFrameLengthForRegularSequence" Me.ucrDataFrameLengthForRegularSequence.Size = New System.Drawing.Size(51, 23) Me.ucrDataFrameLengthForRegularSequence.TabIndex = 10 @@ -129,7 +129,7 @@ Partial Class dlgRegularSequence ' 'dtpSelectorB ' - Me.dtpSelectorB.Location = New System.Drawing.Point(98, 51) + Me.dtpSelectorB.Location = New System.Drawing.Point(98, 49) Me.dtpSelectorB.Name = "dtpSelectorB" Me.dtpSelectorB.Size = New System.Drawing.Size(87, 20) Me.dtpSelectorB.TabIndex = 5 @@ -144,7 +144,7 @@ Partial Class dlgRegularSequence 'lblLength ' Me.lblLength.AutoSize = True - Me.lblLength.Location = New System.Drawing.Point(10, 133) + Me.lblLength.Location = New System.Drawing.Point(10, 132) Me.lblLength.Name = "lblLength" Me.lblLength.Size = New System.Drawing.Size(43, 13) Me.lblLength.TabIndex = 9 @@ -177,40 +177,40 @@ Partial Class dlgRegularSequence 'lblRepeatValues ' Me.lblRepeatValues.AutoSize = True - Me.lblRepeatValues.Location = New System.Drawing.Point(10, 105) + Me.lblRepeatValues.Location = New System.Drawing.Point(10, 106) Me.lblRepeatValues.Name = "lblRepeatValues" Me.lblRepeatValues.Size = New System.Drawing.Size(80, 13) Me.lblRepeatValues.TabIndex = 6 Me.lblRepeatValues.Tag = "Repeat_values" Me.lblRepeatValues.Text = "Repeat Values:" ' - 'lblSteps + 'lblInStepsOf ' - Me.lblSteps.AutoSize = True - Me.lblSteps.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.lblSteps.Location = New System.Drawing.Point(10, 81) - Me.lblSteps.Name = "lblSteps" - Me.lblSteps.Size = New System.Drawing.Size(61, 13) - Me.lblSteps.TabIndex = 4 - Me.lblSteps.Tag = "In_steps_of" - Me.lblSteps.Text = "In Steps of:" + Me.lblInStepsOf.AutoSize = True + Me.lblInStepsOf.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.lblInStepsOf.Location = New System.Drawing.Point(10, 80) + Me.lblInStepsOf.Name = "lblInStepsOf" + Me.lblInStepsOf.Size = New System.Drawing.Size(63, 13) + Me.lblInStepsOf.TabIndex = 4 + Me.lblInStepsOf.Tag = "In_steps_Of" + Me.lblInStepsOf.Text = "In Steps Of:" ' 'lblTo ' Me.lblTo.AutoSize = True Me.lblTo.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.lblTo.Location = New System.Drawing.Point(10, 51) + Me.lblTo.Location = New System.Drawing.Point(10, 54) Me.lblTo.Name = "lblTo" Me.lblTo.Size = New System.Drawing.Size(23, 13) Me.lblTo.TabIndex = 2 - Me.lblTo.Tag = "To" + Me.lblTo.Tag = "" Me.lblTo.Text = "To:" ' 'lblFrom ' Me.lblFrom.AutoSize = True Me.lblFrom.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.lblFrom.Location = New System.Drawing.Point(10, 24) + Me.lblFrom.Location = New System.Drawing.Point(10, 28) Me.lblFrom.Name = "lblFrom" Me.lblFrom.Size = New System.Drawing.Size(33, 13) Me.lblFrom.TabIndex = 0 @@ -252,7 +252,7 @@ Partial Class dlgRegularSequence Me.grpSequenceType.Controls.Add(Me.ucrPnlSequenceType) Me.grpSequenceType.Location = New System.Drawing.Point(10, 60) Me.grpSequenceType.Name = "grpSequenceType" - Me.grpSequenceType.Size = New System.Drawing.Size(199, 52) + Me.grpSequenceType.Size = New System.Drawing.Size(205, 52) Me.grpSequenceType.TabIndex = 1 Me.grpSequenceType.TabStop = False Me.grpSequenceType.Text = "Sequence Type" @@ -292,7 +292,7 @@ Partial Class dlgRegularSequence ' 'ucrNewColumnName ' - Me.ucrNewColumnName.Location = New System.Drawing.Point(11, 321) + Me.ucrNewColumnName.Location = New System.Drawing.Point(10, 321) Me.ucrNewColumnName.Name = "ucrNewColumnName" Me.ucrNewColumnName.Size = New System.Drawing.Size(294, 24) Me.ucrNewColumnName.TabIndex = 6 @@ -343,7 +343,7 @@ Partial Class dlgRegularSequence End Sub Friend WithEvents grpSequenceDefinition As GroupBox - Friend WithEvents lblSteps As Label + Friend WithEvents lblInStepsOf As Label Friend WithEvents lblTo As Label Friend WithEvents lblFrom As Label Friend WithEvents ucrBase As ucrButtons @@ -363,7 +363,7 @@ Partial Class dlgRegularSequence Friend WithEvents rdoNumeric As RadioButton Friend WithEvents rdoDates As RadioButton Friend WithEvents ucrPnlSequenceType As UcrPanel - Friend WithEvents ucrInputInStepsof As ucrInputTextBox + Friend WithEvents ucrInputInStepsOf As ucrInputTextBox Friend WithEvents ucrInputTo As ucrInputTextBox Friend WithEvents ucrInputFrom As ucrInputTextBox Friend WithEvents ucrNudRepeatValues As ucrNud diff --git a/instat/dlgRegularSequence.vb b/instat/dlgRegularSequence.vb index a9ecb4f01e5..a067942cd37 100644 --- a/instat/dlgRegularSequence.vb +++ b/instat/dlgRegularSequence.vb @@ -14,7 +14,6 @@ ' You should have received a copy of the GNU General Public License k ' along with this program. If not, see . -Imports instat Imports instat.Translations Imports RDotNet @@ -43,7 +42,7 @@ Public Class dlgRegularSequence ucrInputTo.SetRCode(clsSeqFunction, bReset) ucrNudRepeatValues.SetRCode(clsRepFunction, bReset) ucrNudRepeatValues.SetRCode(clsSeqFunction, bReset) - ucrInputInStepsof.SetRCode(clsSeqFunction, bReset) + ucrInputInStepsOf.SetRCode(clsSeqFunction, bReset) End Sub @@ -61,19 +60,19 @@ Public Class dlgRegularSequence ucrInputTo.SetValidationTypeAsNumeric() ucrNudRepeatValues.SetParameter(New RParameter("each", 1)) ucrNudRepeatValues.Minimum = 1 - ucrInputInStepsof.SetParameter(New RParameter("by", 2)) - ucrInputInStepsof.AddQuotesIfUnrecognised = False - ucrInputInStepsof.SetValidationTypeAsNumeric() + ucrInputInStepsOf.SetParameter(New RParameter("by", 2)) + ucrInputInStepsOf.AddQuotesIfUnrecognised = False + ucrInputInStepsOf.SetValidationTypeAsNumeric() ucrDataFrameLengthForRegularSequence.SetDataFrameSelector(ucrSelectDataFrameRegularSequence) ucrPnlSequenceType.AddToLinkedControls(ucrInputFrom, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, objNewDefaultState:=1) ucrInputFrom.SetLinkedDisplayControl(lblFrom) ucrPnlSequenceType.AddToLinkedControls(ucrInputTo, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, objNewDefaultState:=ucrSelectDataFrameRegularSequence.iDataFrameLength) ucrInputTo.SetLinkedDisplayControl(lblTo) - ucrPnlSequenceType.AddToLinkedControls(ucrInputInStepsof, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, objNewDefaultState:=1) + ucrPnlSequenceType.AddToLinkedControls(ucrInputInStepsOf, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, objNewDefaultState:=1) ucrNudRepeatValues.SetLinkedDisplayControl(lblRepeatValues) ucrPnlSequenceType.AddToLinkedControls(ucrNudRepeatValues, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, objNewDefaultState:=1) - ucrInputInStepsof.SetLinkedDisplayControl(lblSteps) + ucrInputInStepsOf.SetLinkedDisplayControl(lblInStepsOf) 'ucrPnlSequenceType.AddToLinkedControls(dtpSelectorA, {rdoDates}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) 'ucrPnlSequenceType.AddToLinkedControls(dtpSelectorB, {rdoDates}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) @@ -125,7 +124,7 @@ Public Class dlgRegularSequence Private Sub TestOKEnabled() If ucrNewColumnName.IsComplete Then If rdoNumeric.Checked Then - If ucrInputFrom.GetText <> "" AndAlso ucrInputTo.GetText <> "" AndAlso ucrInputInStepsof.GetText <> "" AndAlso ucrNudRepeatValues.GetText <> "" AndAlso ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text <> "" AndAlso txtGetPreview.Text <> "" Then + If ucrInputFrom.GetText <> "" AndAlso ucrInputTo.GetText <> "" AndAlso ucrInputInStepsOf.GetText <> "" AndAlso ucrNudRepeatValues.GetText <> "" AndAlso ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text <> "" AndAlso txtGetPreview.Text <> "" Then ucrBase.OKEnabled(True) Else ucrBase.OKEnabled(False) @@ -135,27 +134,11 @@ Public Class dlgRegularSequence Else ucrBase.OKEnabled(False) End If - Else - If ucrInputTo.GetText < ucrInputFrom.GetText Then - ucrBase.OKEnabled(False) - End If - End If - End Sub - Private Sub SetInStepsOfParameter() - If rdoNumeric.Checked Then - If ucrInputInStepsof.GetText <> "" Then - If (ucrInputInStepsof.GetText = 1 AndAlso frmMain.clsInstatOptions.bIncludeRDefaultParameters) OrElse ucrInputInStepsof.GetText <> 1 Then - If ucrInputTo.GetText >= ucrInputFrom.GetText Then - clsSeqFunction.AddParameter("by", ucrInputInStepsof.GetText) - Else - clsSeqFunction.AddParameter("by", -ucrInputInStepsof.GetText) - End If - End If - End If End If End Sub + Private Sub SetBaseFunction() If ucrNudRepeatValues.Value > 1 Then ucrBase.clsRsyntax.SetBaseRFunction(clsRepFunction) @@ -234,18 +217,13 @@ Public Class dlgRegularSequence CheckSequenceLength() End Sub - Private Sub ucrInputFrom_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrInputFrom.ControlContentsChanged, ucrInputTo.ControlContentsChanged, ucrInputInStepsof.ControlContentsChanged + Private Sub ucrInputFrom_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrInputFrom.ControlContentsChanged, ucrInputTo.ControlContentsChanged, ucrInputInStepsOf.ControlContentsChanged CheckSequenceLength() - 'SetInStepsOfParameter() - End Sub - Private Sub ucrNewColumnName_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrNewColumnName.ControlContentsChanged, ucrInputTo.ControlContentsChanged, ucrInputFrom.ControlContentsChanged, ucrInputInStepsof.ControlContentsChanged, ucrNudRepeatValues.ControlContentsChanged, ucrPnlSequenceType.ControlContentsChanged, ucrSelectDataFrameRegularSequence.ControlContentsChanged - TestOKEnabled() End Sub - Private Sub ucrInputFrom_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputInStepsof.ControlContentsChanged, ucrPnlSequenceType.ControlContentsChanged - 'SetBaseFunction() - SetInStepsOfParameter() + Private Sub ucrNewColumnName_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrNewColumnName.ControlContentsChanged, ucrInputTo.ControlContentsChanged, ucrInputFrom.ControlContentsChanged, ucrInputInStepsOf.ControlContentsChanged, ucrNudRepeatValues.ControlContentsChanged, ucrPnlSequenceType.ControlContentsChanged, ucrSelectDataFrameRegularSequence.ControlContentsChanged + TestOKEnabled() End Sub Private Sub txtGetPreview_TextChanged(sender As Object, e As EventArgs) Handles txtGetPreview.TextChanged From 3809d13cadfe2f9364f1fe6b21a1142804cb392e Mon Sep 17 00:00:00 2001 From: Alex Sananka Date: Tue, 4 Apr 2017 15:20:23 +0300 Subject: [PATCH 18/34] Layout changes and minor edits --- instat/dlgRegularSequence.designer.vb | 4 ++-- instat/dlgRegularSequence.vb | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/instat/dlgRegularSequence.designer.vb b/instat/dlgRegularSequence.designer.vb index 4b34ac8c676..b3d65d496a6 100644 --- a/instat/dlgRegularSequence.designer.vb +++ b/instat/dlgRegularSequence.designer.vb @@ -129,14 +129,14 @@ Partial Class dlgRegularSequence ' 'dtpSelectorB ' - Me.dtpSelectorB.Location = New System.Drawing.Point(98, 49) + Me.dtpSelectorB.Location = New System.Drawing.Point(99, 49) Me.dtpSelectorB.Name = "dtpSelectorB" Me.dtpSelectorB.Size = New System.Drawing.Size(87, 20) Me.dtpSelectorB.TabIndex = 5 ' 'dtpSelectorA ' - Me.dtpSelectorA.Location = New System.Drawing.Point(98, 24) + Me.dtpSelectorA.Location = New System.Drawing.Point(99, 24) Me.dtpSelectorA.Name = "dtpSelectorA" Me.dtpSelectorA.Size = New System.Drawing.Size(87, 20) Me.dtpSelectorA.TabIndex = 2 diff --git a/instat/dlgRegularSequence.vb b/instat/dlgRegularSequence.vb index a067942cd37..22bb0cd5316 100644 --- a/instat/dlgRegularSequence.vb +++ b/instat/dlgRegularSequence.vb @@ -16,7 +16,6 @@ Imports instat.Translations Imports RDotNet - Public Class dlgRegularSequence Dim bIsExtended As Boolean = False Public bFirstLoad As Boolean = True @@ -59,7 +58,7 @@ Public Class dlgRegularSequence ucrInputTo.AddQuotesIfUnrecognised = False ucrInputTo.SetValidationTypeAsNumeric() ucrNudRepeatValues.SetParameter(New RParameter("each", 1)) - ucrNudRepeatValues.Minimum = 1 + ucrNudRepeatValues.SetMinMax(1, Integer.MaxValue) ucrInputInStepsOf.SetParameter(New RParameter("by", 2)) ucrInputInStepsOf.AddQuotesIfUnrecognised = False ucrInputInStepsOf.SetValidationTypeAsNumeric() @@ -138,7 +137,6 @@ Public Class dlgRegularSequence End If End Sub - Private Sub SetBaseFunction() If ucrNudRepeatValues.Value > 1 Then ucrBase.clsRsyntax.SetBaseRFunction(clsRepFunction) @@ -219,7 +217,6 @@ Public Class dlgRegularSequence Private Sub ucrInputFrom_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrInputFrom.ControlContentsChanged, ucrInputTo.ControlContentsChanged, ucrInputInStepsOf.ControlContentsChanged CheckSequenceLength() - End Sub Private Sub ucrNewColumnName_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrNewColumnName.ControlContentsChanged, ucrInputTo.ControlContentsChanged, ucrInputFrom.ControlContentsChanged, ucrInputInStepsOf.ControlContentsChanged, ucrNudRepeatValues.ControlContentsChanged, ucrPnlSequenceType.ControlContentsChanged, ucrSelectDataFrameRegularSequence.ControlContentsChanged From 53283a6c3b61178e9595c61d8ccc9596c20d9176 Mon Sep 17 00:00:00 2001 From: Alex Sananka Date: Tue, 4 Apr 2017 19:19:44 +0300 Subject: [PATCH 19/34] minor edit --- instat/dlgRegularSequence.designer.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/dlgRegularSequence.designer.vb b/instat/dlgRegularSequence.designer.vb index b3d65d496a6..bbcbbff2786 100644 --- a/instat/dlgRegularSequence.designer.vb +++ b/instat/dlgRegularSequence.designer.vb @@ -129,7 +129,7 @@ Partial Class dlgRegularSequence ' 'dtpSelectorB ' - Me.dtpSelectorB.Location = New System.Drawing.Point(99, 49) + Me.dtpSelectorB.Location = New System.Drawing.Point(99, 50) Me.dtpSelectorB.Name = "dtpSelectorB" Me.dtpSelectorB.Size = New System.Drawing.Size(87, 20) Me.dtpSelectorB.TabIndex = 5 From 188b082e3334edefa038eace3b1a86e01dfbde90 Mon Sep 17 00:00:00 2001 From: Alex Sananka Date: Wed, 5 Apr 2017 12:28:56 +0300 Subject: [PATCH 20/34] Edits --- instat/dlgRegularSequence.vb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/instat/dlgRegularSequence.vb b/instat/dlgRegularSequence.vb index 22bb0cd5316..98e4e257efd 100644 --- a/instat/dlgRegularSequence.vb +++ b/instat/dlgRegularSequence.vb @@ -137,6 +137,20 @@ Public Class dlgRegularSequence End If End Sub + Private Sub SetInStepsOfParameter() + If rdoNumeric.Checked Then + If ucrInputInStepsOf.GetText <> "" Then + If (ucrInputInStepsOf.GetText = 1 AndAlso frmMain.clsInstatOptions.bIncludeRDefaultParameters) OrElse ucrInputInStepsOf.GetText <> 1 Then + If ucrInputTo.GetText >= ucrInputFrom.GetText Then + clsSeqFunction.AddParameter("by", ucrInputInStepsOf.GetText) + Else + clsSeqFunction.AddParameter("by", "-" & ucrInputInStepsOf.GetText) + End If + End If + End If + End If + End Sub + Private Sub SetBaseFunction() If ucrNudRepeatValues.Value > 1 Then ucrBase.clsRsyntax.SetBaseRFunction(clsRepFunction) @@ -223,6 +237,10 @@ Public Class dlgRegularSequence TestOKEnabled() End Sub + Private Sub ucrInputFrom_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputInStepsOf.ControlContentsChanged, ucrPnlSequenceType.ControlContentsChanged + SetInStepsOfParameter() + End Sub + Private Sub txtGetPreview_TextChanged(sender As Object, e As EventArgs) Handles txtGetPreview.TextChanged TestOKEnabled() End Sub From 49d2efce3e6258893981f040bc60be9ce24c9dec Mon Sep 17 00:00:00 2001 From: Alex Sananka Date: Wed, 5 Apr 2017 13:26:04 +0300 Subject: [PATCH 21/34] Setting Validation type and setting minimum for ucrinputInstepsOf --- instat/dlgRegularSequence.vb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/instat/dlgRegularSequence.vb b/instat/dlgRegularSequence.vb index 98e4e257efd..6ceffc2493d 100644 --- a/instat/dlgRegularSequence.vb +++ b/instat/dlgRegularSequence.vb @@ -18,6 +18,7 @@ Imports instat.Translations Imports RDotNet Public Class dlgRegularSequence Dim bIsExtended As Boolean = False + Protected bMinimumIncluded, bMaximumIncluded As Boolean Public bFirstLoad As Boolean = True Private bReset As Boolean = True Private clsSeqFunction, clsRepFunction As New RFunction @@ -61,7 +62,7 @@ Public Class dlgRegularSequence ucrNudRepeatValues.SetMinMax(1, Integer.MaxValue) ucrInputInStepsOf.SetParameter(New RParameter("by", 2)) ucrInputInStepsOf.AddQuotesIfUnrecognised = False - ucrInputInStepsOf.SetValidationTypeAsNumeric() + ucrInputInStepsOf.SetValidationTypeAsNumeric(dcmMin:=0) ucrDataFrameLengthForRegularSequence.SetDataFrameSelector(ucrSelectDataFrameRegularSequence) ucrPnlSequenceType.AddToLinkedControls(ucrInputFrom, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, objNewDefaultState:=1) From 27246273c3ff5eaa41b32aeb7272e4afa5bee746 Mon Sep 17 00:00:00 2001 From: Alex Sananka Date: Wed, 5 Apr 2017 16:38:43 +0300 Subject: [PATCH 22/34] adding code and some minor changes in designer. --- instat/dlgRegularSequence.designer.vb | 137 +++++++++++++------------- instat/dlgRegularSequence.vb | 7 +- 2 files changed, 71 insertions(+), 73 deletions(-) diff --git a/instat/dlgRegularSequence.designer.vb b/instat/dlgRegularSequence.designer.vb index bbcbbff2786..21b0b4cc940 100644 --- a/instat/dlgRegularSequence.designer.vb +++ b/instat/dlgRegularSequence.designer.vb @@ -23,15 +23,9 @@ Partial Class dlgRegularSequence Private Sub InitializeComponent() Me.grpSequenceDefinition = New System.Windows.Forms.GroupBox() - Me.ucrNudRepeatValues = New instat.ucrNud() - Me.ucrInputInStepsOf = New instat.ucrInputTextBox() - Me.ucrInputTo = New instat.ucrInputTextBox() - Me.ucrInputFrom = New instat.ucrInputTextBox() - Me.ucrDataFrameLengthForRegularSequence = New instat.ucrDataFrameLength() Me.dtpSelectorB = New System.Windows.Forms.DateTimePicker() Me.dtpSelectorA = New System.Windows.Forms.DateTimePicker() Me.lblLength = New System.Windows.Forms.Label() - Me.chkDefineAsFactor = New System.Windows.Forms.CheckBox() Me.lblTimes1 = New System.Windows.Forms.Label() Me.lblRepeatValues = New System.Windows.Forms.Label() Me.lblInStepsOf = New System.Windows.Forms.Label() @@ -45,6 +39,12 @@ Partial Class dlgRegularSequence Me.rdoDates = New System.Windows.Forms.RadioButton() Me.ucrPnlSequenceType = New instat.UcrPanel() Me.ucrNewColumnName = New instat.ucrSave() + Me.ucrChkDefineAsFactor = New instat.ucrCheck() + Me.ucrNudRepeatValues = New instat.ucrNud() + Me.ucrInputInStepsOf = New instat.ucrInputTextBox() + Me.ucrInputTo = New instat.ucrInputTextBox() + Me.ucrInputFrom = New instat.ucrInputTextBox() + Me.ucrDataFrameLengthForRegularSequence = New instat.ucrDataFrameLength() Me.ucrSelectDataFrameRegularSequence = New instat.ucrDataFrame() Me.ucrBase = New instat.ucrButtons() Me.grpSequenceDefinition.SuspendLayout() @@ -53,6 +53,7 @@ Partial Class dlgRegularSequence ' 'grpSequenceDefinition ' + Me.grpSequenceDefinition.Controls.Add(Me.ucrChkDefineAsFactor) Me.grpSequenceDefinition.Controls.Add(Me.ucrNudRepeatValues) Me.grpSequenceDefinition.Controls.Add(Me.ucrInputInStepsOf) Me.grpSequenceDefinition.Controls.Add(Me.ucrInputTo) @@ -61,7 +62,6 @@ Partial Class dlgRegularSequence Me.grpSequenceDefinition.Controls.Add(Me.dtpSelectorB) Me.grpSequenceDefinition.Controls.Add(Me.dtpSelectorA) Me.grpSequenceDefinition.Controls.Add(Me.lblLength) - Me.grpSequenceDefinition.Controls.Add(Me.chkDefineAsFactor) Me.grpSequenceDefinition.Controls.Add(Me.lblTimes1) Me.grpSequenceDefinition.Controls.Add(Me.lblRepeatValues) Me.grpSequenceDefinition.Controls.Add(Me.lblInStepsOf) @@ -77,56 +77,6 @@ Partial Class dlgRegularSequence Me.grpSequenceDefinition.Text = "Sequence Definition" Me.grpSequenceDefinition.UseCompatibleTextRendering = True ' - 'ucrNudRepeatValues - ' - Me.ucrNudRepeatValues.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudRepeatValues.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudRepeatValues.Location = New System.Drawing.Point(99, 102) - Me.ucrNudRepeatValues.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudRepeatValues.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudRepeatValues.Name = "ucrNudRepeatValues" - Me.ucrNudRepeatValues.Size = New System.Drawing.Size(50, 23) - Me.ucrNudRepeatValues.TabIndex = 7 - Me.ucrNudRepeatValues.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrInputInStepsOf - ' - Me.ucrInputInStepsOf.AddQuotesIfUnrecognised = True - Me.ucrInputInStepsOf.IsMultiline = False - Me.ucrInputInStepsOf.IsReadOnly = False - Me.ucrInputInStepsOf.Location = New System.Drawing.Point(99, 76) - Me.ucrInputInStepsOf.Name = "ucrInputInStepsOf" - Me.ucrInputInStepsOf.Size = New System.Drawing.Size(50, 23) - Me.ucrInputInStepsOf.TabIndex = 5 - ' - 'ucrInputTo - ' - Me.ucrInputTo.AddQuotesIfUnrecognised = True - Me.ucrInputTo.IsMultiline = False - Me.ucrInputTo.IsReadOnly = False - Me.ucrInputTo.Location = New System.Drawing.Point(99, 50) - Me.ucrInputTo.Name = "ucrInputTo" - Me.ucrInputTo.Size = New System.Drawing.Size(50, 23) - Me.ucrInputTo.TabIndex = 3 - ' - 'ucrInputFrom - ' - Me.ucrInputFrom.AddQuotesIfUnrecognised = True - Me.ucrInputFrom.IsMultiline = False - Me.ucrInputFrom.IsReadOnly = False - Me.ucrInputFrom.Location = New System.Drawing.Point(99, 24) - Me.ucrInputFrom.Name = "ucrInputFrom" - Me.ucrInputFrom.Size = New System.Drawing.Size(50, 23) - Me.ucrInputFrom.TabIndex = 1 - ' - 'ucrDataFrameLengthForRegularSequence - ' - Me.ucrDataFrameLengthForRegularSequence.Location = New System.Drawing.Point(98, 128) - Me.ucrDataFrameLengthForRegularSequence.Name = "ucrDataFrameLengthForRegularSequence" - Me.ucrDataFrameLengthForRegularSequence.Size = New System.Drawing.Size(51, 23) - Me.ucrDataFrameLengthForRegularSequence.TabIndex = 10 - Me.ucrDataFrameLengthForRegularSequence.ucrDataFrameSelector = Nothing - ' 'dtpSelectorB ' Me.dtpSelectorB.Location = New System.Drawing.Point(99, 50) @@ -151,19 +101,6 @@ Partial Class dlgRegularSequence Me.lblLength.Tag = "Length" Me.lblLength.Text = "Length:" ' - 'chkDefineAsFactor - ' - Me.chkDefineAsFactor.AutoSize = True - Me.chkDefineAsFactor.Checked = True - Me.chkDefineAsFactor.CheckState = System.Windows.Forms.CheckState.Checked - Me.chkDefineAsFactor.Location = New System.Drawing.Point(10, 159) - Me.chkDefineAsFactor.Name = "chkDefineAsFactor" - Me.chkDefineAsFactor.Size = New System.Drawing.Size(104, 17) - Me.chkDefineAsFactor.TabIndex = 11 - Me.chkDefineAsFactor.Tag = "Define_as_factor" - Me.chkDefineAsFactor.Text = "Define as Factor" - Me.chkDefineAsFactor.UseVisualStyleBackColor = True - ' 'lblTimes1 ' Me.lblTimes1.AutoSize = True @@ -297,6 +234,64 @@ Partial Class dlgRegularSequence Me.ucrNewColumnName.Size = New System.Drawing.Size(294, 24) Me.ucrNewColumnName.TabIndex = 6 ' + 'ucrChkDefineAsFactor + ' + Me.ucrChkDefineAsFactor.Checked = False + Me.ucrChkDefineAsFactor.Location = New System.Drawing.Point(10, 159) + Me.ucrChkDefineAsFactor.Name = "ucrChkDefineAsFactor" + Me.ucrChkDefineAsFactor.Size = New System.Drawing.Size(176, 20) + Me.ucrChkDefineAsFactor.TabIndex = 8 + ' + 'ucrNudRepeatValues + ' + Me.ucrNudRepeatValues.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudRepeatValues.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudRepeatValues.Location = New System.Drawing.Point(99, 102) + Me.ucrNudRepeatValues.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudRepeatValues.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudRepeatValues.Name = "ucrNudRepeatValues" + Me.ucrNudRepeatValues.Size = New System.Drawing.Size(50, 23) + Me.ucrNudRepeatValues.TabIndex = 7 + Me.ucrNudRepeatValues.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrInputInStepsOf + ' + Me.ucrInputInStepsOf.AddQuotesIfUnrecognised = True + Me.ucrInputInStepsOf.IsMultiline = False + Me.ucrInputInStepsOf.IsReadOnly = False + Me.ucrInputInStepsOf.Location = New System.Drawing.Point(99, 76) + Me.ucrInputInStepsOf.Name = "ucrInputInStepsOf" + Me.ucrInputInStepsOf.Size = New System.Drawing.Size(50, 23) + Me.ucrInputInStepsOf.TabIndex = 5 + ' + 'ucrInputTo + ' + Me.ucrInputTo.AddQuotesIfUnrecognised = True + Me.ucrInputTo.IsMultiline = False + Me.ucrInputTo.IsReadOnly = False + Me.ucrInputTo.Location = New System.Drawing.Point(99, 50) + Me.ucrInputTo.Name = "ucrInputTo" + Me.ucrInputTo.Size = New System.Drawing.Size(50, 23) + Me.ucrInputTo.TabIndex = 3 + ' + 'ucrInputFrom + ' + Me.ucrInputFrom.AddQuotesIfUnrecognised = True + Me.ucrInputFrom.IsMultiline = False + Me.ucrInputFrom.IsReadOnly = False + Me.ucrInputFrom.Location = New System.Drawing.Point(99, 24) + Me.ucrInputFrom.Name = "ucrInputFrom" + Me.ucrInputFrom.Size = New System.Drawing.Size(50, 23) + Me.ucrInputFrom.TabIndex = 1 + ' + 'ucrDataFrameLengthForRegularSequence + ' + Me.ucrDataFrameLengthForRegularSequence.Location = New System.Drawing.Point(98, 128) + Me.ucrDataFrameLengthForRegularSequence.Name = "ucrDataFrameLengthForRegularSequence" + Me.ucrDataFrameLengthForRegularSequence.Size = New System.Drawing.Size(51, 23) + Me.ucrDataFrameLengthForRegularSequence.TabIndex = 10 + Me.ucrDataFrameLengthForRegularSequence.ucrDataFrameSelector = Nothing + ' 'ucrSelectDataFrameRegularSequence ' Me.ucrSelectDataFrameRegularSequence.bUseCurrentFilter = True @@ -352,7 +347,6 @@ Partial Class dlgRegularSequence Friend WithEvents lblLength As Label Friend WithEvents lblTimes1 As Label Friend WithEvents lblRepeatValues As Label - Friend WithEvents chkDefineAsFactor As CheckBox Friend WithEvents dtpSelectorA As DateTimePicker Friend WithEvents dtpSelectorB As DateTimePicker Friend WithEvents txtGetPreview As RichTextBox @@ -367,4 +361,5 @@ Partial Class dlgRegularSequence Friend WithEvents ucrInputTo As ucrInputTextBox Friend WithEvents ucrInputFrom As ucrInputTextBox Friend WithEvents ucrNudRepeatValues As ucrNud + Friend WithEvents ucrChkDefineAsFactor As ucrCheck End Class diff --git a/instat/dlgRegularSequence.vb b/instat/dlgRegularSequence.vb index 6ceffc2493d..32420deed1c 100644 --- a/instat/dlgRegularSequence.vb +++ b/instat/dlgRegularSequence.vb @@ -18,7 +18,6 @@ Imports instat.Translations Imports RDotNet Public Class dlgRegularSequence Dim bIsExtended As Boolean = False - Protected bMinimumIncluded, bMaximumIncluded As Boolean Public bFirstLoad As Boolean = True Private bReset As Boolean = True Private clsSeqFunction, clsRepFunction As New RFunction @@ -90,11 +89,15 @@ Public Class dlgRegularSequence rdoDates.Enabled = False dtpSelectorB.Visible = False dtpSelectorA.Visible = False - chkDefineAsFactor.Visible = False + ucrChkDefineAsFactor.SetText("Define As Factor") 'ucrInputFrom.Visible = False ' ucrInputTo.Visible = False End Sub + Private Sub ucrChkDefineAsFactor_Load(sender As Object, e As EventArgs) Handles ucrChkDefineAsFactor.Load + ucrChkDefineAsFactor.Enabled = False + End Sub + Private Sub SetDefaults() clsRepFunction = New RFunction clsSeqFunction = New RFunction From 0c6a31986297a5d8e0a5741db3cdc35e6355c440 Mon Sep 17 00:00:00 2001 From: John Lunalo Date: Thu, 13 Apr 2017 09:45:09 +0300 Subject: [PATCH 23/34] alex changes --- instat/dlgRegularSequence.vb | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/instat/dlgRegularSequence.vb b/instat/dlgRegularSequence.vb index 32420deed1c..94263e95524 100644 --- a/instat/dlgRegularSequence.vb +++ b/instat/dlgRegularSequence.vb @@ -14,6 +14,7 @@ ' You should have received a copy of the GNU General Public License k ' along with this program. If not, see . +Imports instat Imports instat.Translations Imports RDotNet Public Class dlgRegularSequence @@ -21,6 +22,7 @@ Public Class dlgRegularSequence Public bFirstLoad As Boolean = True Private bReset As Boolean = True Private clsSeqFunction, clsRepFunction As New RFunction + Private bUpdate As Boolean = False Private Sub dlgRegularSequence_Load(sender As Object, e As EventArgs) Handles MyBase.Load autoTranslate(Me) If bFirstLoad Then @@ -41,7 +43,9 @@ Public Class dlgRegularSequence ucrInputTo.SetRCode(clsSeqFunction, bReset) ucrNudRepeatValues.SetRCode(clsRepFunction, bReset) ucrNudRepeatValues.SetRCode(clsSeqFunction, bReset) + bUpdate = True ucrInputInStepsOf.SetRCode(clsSeqFunction, bReset) + bUpdate = False End Sub @@ -61,7 +65,7 @@ Public Class dlgRegularSequence ucrNudRepeatValues.SetMinMax(1, Integer.MaxValue) ucrInputInStepsOf.SetParameter(New RParameter("by", 2)) ucrInputInStepsOf.AddQuotesIfUnrecognised = False - ucrInputInStepsOf.SetValidationTypeAsNumeric(dcmMin:=0) + ucrInputInStepsOf.SetValidationTypeAsNumeric() ucrDataFrameLengthForRegularSequence.SetDataFrameSelector(ucrSelectDataFrameRegularSequence) ucrPnlSequenceType.AddToLinkedControls(ucrInputFrom, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, objNewDefaultState:=1) @@ -86,7 +90,6 @@ Public Class dlgRegularSequence ucrNewColumnName.SetLabelText("New Column Name:") 'TODO complete dates option - rdoDates.Enabled = False dtpSelectorB.Visible = False dtpSelectorA.Visible = False ucrChkDefineAsFactor.SetText("Define As Factor") @@ -103,6 +106,7 @@ Public Class dlgRegularSequence clsSeqFunction = New RFunction ucrSelectDataFrameRegularSequence.Reset() ucrNewColumnName.Reset() + rdoNumeric.Checked = True clsSeqFunction.SetRCommand("seq") clsSeqFunction.AddParameter("from", 1) clsSeqFunction.AddParameter("to", ucrSelectDataFrameRegularSequence.iDataFrameLength) @@ -142,17 +146,14 @@ Public Class dlgRegularSequence End Sub Private Sub SetInStepsOfParameter() - If rdoNumeric.Checked Then - If ucrInputInStepsOf.GetText <> "" Then - If (ucrInputInStepsOf.GetText = 1 AndAlso frmMain.clsInstatOptions.bIncludeRDefaultParameters) OrElse ucrInputInStepsOf.GetText <> 1 Then - If ucrInputTo.GetText >= ucrInputFrom.GetText Then - clsSeqFunction.AddParameter("by", ucrInputInStepsOf.GetText) - Else - clsSeqFunction.AddParameter("by", "-" & ucrInputInStepsOf.GetText) - End If - End If + If Not ucrInputTo.IsEmpty AndAlso Not ucrInputFrom.IsEmpty Then + If Convert.ToDecimal(ucrInputTo.GetText) >= Convert.ToDecimal(ucrInputFrom.GetText) Then + clsSeqFunction.AddParameter("by", ucrInputInStepsOf.GetText) + Else + clsSeqFunction.AddParameter("by", "-" & ucrInputInStepsOf.GetText) End If End If + CheckSequenceLength() End Sub Private Sub SetBaseFunction() @@ -233,18 +234,14 @@ Public Class dlgRegularSequence CheckSequenceLength() End Sub - Private Sub ucrInputFrom_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrInputFrom.ControlContentsChanged, ucrInputTo.ControlContentsChanged, ucrInputInStepsOf.ControlContentsChanged - CheckSequenceLength() + Private Sub ucrInputFrom_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrInputFrom.ControlValueChanged, ucrInputTo.ControlValueChanged, ucrInputInStepsOf.ControlValueChanged + SetInStepsOfParameter() End Sub Private Sub ucrNewColumnName_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrNewColumnName.ControlContentsChanged, ucrInputTo.ControlContentsChanged, ucrInputFrom.ControlContentsChanged, ucrInputInStepsOf.ControlContentsChanged, ucrNudRepeatValues.ControlContentsChanged, ucrPnlSequenceType.ControlContentsChanged, ucrSelectDataFrameRegularSequence.ControlContentsChanged TestOKEnabled() End Sub - Private Sub ucrInputFrom_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputInStepsOf.ControlContentsChanged, ucrPnlSequenceType.ControlContentsChanged - SetInStepsOfParameter() - End Sub - Private Sub txtGetPreview_TextChanged(sender As Object, e As EventArgs) Handles txtGetPreview.TextChanged TestOKEnabled() End Sub From cc51cf987ae163af2cb9cf1783b3d94a89eebb1e Mon Sep 17 00:00:00 2001 From: John Lunalo Date: Thu, 13 Apr 2017 10:54:43 +0300 Subject: [PATCH 24/34] Fixing reset --- instat/dlgRegularSequence.vb | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/instat/dlgRegularSequence.vb b/instat/dlgRegularSequence.vb index 94263e95524..415d3e00544 100644 --- a/instat/dlgRegularSequence.vb +++ b/instat/dlgRegularSequence.vb @@ -22,7 +22,7 @@ Public Class dlgRegularSequence Public bFirstLoad As Boolean = True Private bReset As Boolean = True Private clsSeqFunction, clsRepFunction As New RFunction - Private bUpdate As Boolean = False + Private bUpdateBy As Boolean = False Private Sub dlgRegularSequence_Load(sender As Object, e As EventArgs) Handles MyBase.Load autoTranslate(Me) If bFirstLoad Then @@ -37,15 +37,15 @@ Public Class dlgRegularSequence End Sub Private Sub SetRCodeForControls(bReset As Boolean) + bUpdateBy = False ucrNewColumnName.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - ucrPnlSequenceType.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - ucrInputFrom.SetRCode(clsSeqFunction, bReset) - ucrInputTo.SetRCode(clsSeqFunction, bReset) - ucrNudRepeatValues.SetRCode(clsRepFunction, bReset) - ucrNudRepeatValues.SetRCode(clsSeqFunction, bReset) - bUpdate = True - ucrInputInStepsOf.SetRCode(clsSeqFunction, bReset) - bUpdate = False + ucrPnlSequenceType.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + ucrInputFrom.SetRCode(clsSeqFunction, bReset) + ucrInputTo.SetRCode(clsSeqFunction, bReset) + ucrNudRepeatValues.SetRCode(clsRepFunction, bReset) + ucrNudRepeatValues.SetRCode(clsSeqFunction, bReset) + ucrInputInStepsOf.SetRCode(clsSeqFunction, bReset) + bUpdateBy = True End Sub @@ -235,7 +235,9 @@ Public Class dlgRegularSequence End Sub Private Sub ucrInputFrom_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrInputFrom.ControlValueChanged, ucrInputTo.ControlValueChanged, ucrInputInStepsOf.ControlValueChanged - SetInStepsOfParameter() + If bUpdateBy Then + SetInStepsOfParameter() + End If End Sub Private Sub ucrNewColumnName_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrNewColumnName.ControlContentsChanged, ucrInputTo.ControlContentsChanged, ucrInputFrom.ControlContentsChanged, ucrInputInStepsOf.ControlContentsChanged, ucrNudRepeatValues.ControlContentsChanged, ucrPnlSequenceType.ControlContentsChanged, ucrSelectDataFrameRegularSequence.ControlContentsChanged From f86ace5a0c24c7e2d8476b9d1716f47d2c6b18f3 Mon Sep 17 00:00:00 2001 From: Alex Sananka Date: Thu, 13 Apr 2017 11:31:46 +0300 Subject: [PATCH 25/34] disabling button --- instat/dlgRegularSequence.vb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/instat/dlgRegularSequence.vb b/instat/dlgRegularSequence.vb index 415d3e00544..2e95715db6b 100644 --- a/instat/dlgRegularSequence.vb +++ b/instat/dlgRegularSequence.vb @@ -65,7 +65,7 @@ Public Class dlgRegularSequence ucrNudRepeatValues.SetMinMax(1, Integer.MaxValue) ucrInputInStepsOf.SetParameter(New RParameter("by", 2)) ucrInputInStepsOf.AddQuotesIfUnrecognised = False - ucrInputInStepsOf.SetValidationTypeAsNumeric() + ucrInputInStepsOf.SetValidationTypeAsNumeric(dcmMin:=0) ucrDataFrameLengthForRegularSequence.SetDataFrameSelector(ucrSelectDataFrameRegularSequence) ucrPnlSequenceType.AddToLinkedControls(ucrInputFrom, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, objNewDefaultState:=1) @@ -95,6 +95,7 @@ Public Class dlgRegularSequence ucrChkDefineAsFactor.SetText("Define As Factor") 'ucrInputFrom.Visible = False ' ucrInputTo.Visible = False + CheckSequenceLength() End Sub Private Sub ucrChkDefineAsFactor_Load(sender As Object, e As EventArgs) Handles ucrChkDefineAsFactor.Load @@ -107,6 +108,7 @@ Public Class dlgRegularSequence ucrSelectDataFrameRegularSequence.Reset() ucrNewColumnName.Reset() rdoNumeric.Checked = True + rdoDates.Enabled = False clsSeqFunction.SetRCommand("seq") clsSeqFunction.AddParameter("from", 1) clsSeqFunction.AddParameter("to", ucrSelectDataFrameRegularSequence.iDataFrameLength) From 43db2514fd01a5921e8acd40c6ce48601fa1b240 Mon Sep 17 00:00:00 2001 From: Alex Sananka Date: Thu, 13 Apr 2017 11:41:00 +0300 Subject: [PATCH 26/34] fixing reseting preview box --- instat/dlgRegularSequence.vb | 1 + 1 file changed, 1 insertion(+) diff --git a/instat/dlgRegularSequence.vb b/instat/dlgRegularSequence.vb index 2e95715db6b..48815b84f71 100644 --- a/instat/dlgRegularSequence.vb +++ b/instat/dlgRegularSequence.vb @@ -121,6 +121,7 @@ Public Class dlgRegularSequence 'clsSeqFunction.SetAssignTo(ucrNewColumnName.GetText, strTempDataframe:=ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text, strTempColumn:=ucrNewColumnName.GetText) ucrBase.clsRsyntax.SetAssignTo(strAssignToName:=ucrNewColumnName.GetText, strTempDataframe:=ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text, strTempColumn:=ucrNewColumnName.GetText) ucrBase.clsRsyntax.SetBaseRFunction(clsSeqFunction) + CheckSequenceLength() End Sub From 2cccfdecd44b7f77d6da31002047b1cb0ff4aa2d Mon Sep 17 00:00:00 2001 From: Alex Sananka Date: Thu, 13 Apr 2017 11:51:14 +0300 Subject: [PATCH 27/34] deleting unnecessary line --- instat/dlgRegularSequence.vb | 1 - 1 file changed, 1 deletion(-) diff --git a/instat/dlgRegularSequence.vb b/instat/dlgRegularSequence.vb index 48815b84f71..5bcd0976536 100644 --- a/instat/dlgRegularSequence.vb +++ b/instat/dlgRegularSequence.vb @@ -14,7 +14,6 @@ ' You should have received a copy of the GNU General Public License k ' along with this program. If not, see . -Imports instat Imports instat.Translations Imports RDotNet Public Class dlgRegularSequence From 31f18de4cdfa4a2c05b35b2fd76d57e7d454ebcc Mon Sep 17 00:00:00 2001 From: Alex Sananka Date: Thu, 13 Apr 2017 14:13:55 +0300 Subject: [PATCH 28/34] fixing bug,removing misplaced parameter --- instat/dlgRegularSequence.vb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/instat/dlgRegularSequence.vb b/instat/dlgRegularSequence.vb index 5bcd0976536..7f61be6d761 100644 --- a/instat/dlgRegularSequence.vb +++ b/instat/dlgRegularSequence.vb @@ -42,8 +42,7 @@ Public Class dlgRegularSequence ucrInputFrom.SetRCode(clsSeqFunction, bReset) ucrInputTo.SetRCode(clsSeqFunction, bReset) ucrNudRepeatValues.SetRCode(clsRepFunction, bReset) - ucrNudRepeatValues.SetRCode(clsSeqFunction, bReset) - ucrInputInStepsOf.SetRCode(clsSeqFunction, bReset) + ucrInputInStepsOf.SetRCode(clsSeqFunction, bReset) bUpdateBy = True End Sub @@ -119,7 +118,7 @@ Public Class dlgRegularSequence clsRepFunction.AddParameter("length.out", ucrSelectDataFrameRegularSequence.iDataFrameLength) 'clsSeqFunction.SetAssignTo(ucrNewColumnName.GetText, strTempDataframe:=ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text, strTempColumn:=ucrNewColumnName.GetText) ucrBase.clsRsyntax.SetAssignTo(strAssignToName:=ucrNewColumnName.GetText, strTempDataframe:=ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text, strTempColumn:=ucrNewColumnName.GetText) - ucrBase.clsRsyntax.SetBaseRFunction(clsSeqFunction) + ucrBase.clsRsyntax.SetBaseRFunction(clsRepFunction) CheckSequenceLength() End Sub From 378c720a73d9699abbef1c7d8fb4f8712b955db9 Mon Sep 17 00:00:00 2001 From: Lily Date: Thu, 13 Apr 2017 13:04:15 +0100 Subject: [PATCH 29/34] layout changed --- instat/dlgRegularSequence.designer.vb | 164 +++++++++++++------------- instat/dlgRegularSequence.vb | 36 +++--- 2 files changed, 101 insertions(+), 99 deletions(-) diff --git a/instat/dlgRegularSequence.designer.vb b/instat/dlgRegularSequence.designer.vb index 21b0b4cc940..0a18ef76423 100644 --- a/instat/dlgRegularSequence.designer.vb +++ b/instat/dlgRegularSequence.designer.vb @@ -23,6 +23,12 @@ Partial Class dlgRegularSequence Private Sub InitializeComponent() Me.grpSequenceDefinition = New System.Windows.Forms.GroupBox() + Me.ucrChkDefineAsFactor = New instat.ucrCheck() + Me.ucrNudRepeatValues = New instat.ucrNud() + Me.ucrInputInStepsOf = New instat.ucrInputTextBox() + Me.ucrInputTo = New instat.ucrInputTextBox() + Me.ucrInputFrom = New instat.ucrInputTextBox() + Me.ucrDataFrameLengthForRegularSequence = New instat.ucrDataFrameLength() Me.dtpSelectorB = New System.Windows.Forms.DateTimePicker() Me.dtpSelectorA = New System.Windows.Forms.DateTimePicker() Me.lblLength = New System.Windows.Forms.Label() @@ -39,12 +45,6 @@ Partial Class dlgRegularSequence Me.rdoDates = New System.Windows.Forms.RadioButton() Me.ucrPnlSequenceType = New instat.UcrPanel() Me.ucrNewColumnName = New instat.ucrSave() - Me.ucrChkDefineAsFactor = New instat.ucrCheck() - Me.ucrNudRepeatValues = New instat.ucrNud() - Me.ucrInputInStepsOf = New instat.ucrInputTextBox() - Me.ucrInputTo = New instat.ucrInputTextBox() - Me.ucrInputFrom = New instat.ucrInputTextBox() - Me.ucrDataFrameLengthForRegularSequence = New instat.ucrDataFrameLength() Me.ucrSelectDataFrameRegularSequence = New instat.ucrDataFrame() Me.ucrBase = New instat.ucrButtons() Me.grpSequenceDefinition.SuspendLayout() @@ -70,13 +70,71 @@ Partial Class dlgRegularSequence Me.grpSequenceDefinition.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.grpSequenceDefinition.Location = New System.Drawing.Point(10, 113) Me.grpSequenceDefinition.Name = "grpSequenceDefinition" - Me.grpSequenceDefinition.Size = New System.Drawing.Size(205, 204) - Me.grpSequenceDefinition.TabIndex = 4 + Me.grpSequenceDefinition.Size = New System.Drawing.Size(205, 184) + Me.grpSequenceDefinition.TabIndex = 2 Me.grpSequenceDefinition.TabStop = False Me.grpSequenceDefinition.Tag = "Sequence_definition" Me.grpSequenceDefinition.Text = "Sequence Definition" Me.grpSequenceDefinition.UseCompatibleTextRendering = True ' + 'ucrChkDefineAsFactor + ' + Me.ucrChkDefineAsFactor.Checked = False + Me.ucrChkDefineAsFactor.Location = New System.Drawing.Point(10, 158) + Me.ucrChkDefineAsFactor.Name = "ucrChkDefineAsFactor" + Me.ucrChkDefineAsFactor.Size = New System.Drawing.Size(176, 20) + Me.ucrChkDefineAsFactor.TabIndex = 13 + ' + 'ucrNudRepeatValues + ' + Me.ucrNudRepeatValues.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudRepeatValues.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudRepeatValues.Location = New System.Drawing.Point(99, 102) + Me.ucrNudRepeatValues.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudRepeatValues.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudRepeatValues.Name = "ucrNudRepeatValues" + Me.ucrNudRepeatValues.Size = New System.Drawing.Size(50, 23) + Me.ucrNudRepeatValues.TabIndex = 9 + Me.ucrNudRepeatValues.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrInputInStepsOf + ' + Me.ucrInputInStepsOf.AddQuotesIfUnrecognised = True + Me.ucrInputInStepsOf.IsMultiline = False + Me.ucrInputInStepsOf.IsReadOnly = False + Me.ucrInputInStepsOf.Location = New System.Drawing.Point(99, 76) + Me.ucrInputInStepsOf.Name = "ucrInputInStepsOf" + Me.ucrInputInStepsOf.Size = New System.Drawing.Size(50, 23) + Me.ucrInputInStepsOf.TabIndex = 7 + ' + 'ucrInputTo + ' + Me.ucrInputTo.AddQuotesIfUnrecognised = True + Me.ucrInputTo.IsMultiline = False + Me.ucrInputTo.IsReadOnly = False + Me.ucrInputTo.Location = New System.Drawing.Point(99, 50) + Me.ucrInputTo.Name = "ucrInputTo" + Me.ucrInputTo.Size = New System.Drawing.Size(50, 23) + Me.ucrInputTo.TabIndex = 4 + ' + 'ucrInputFrom + ' + Me.ucrInputFrom.AddQuotesIfUnrecognised = True + Me.ucrInputFrom.IsMultiline = False + Me.ucrInputFrom.IsReadOnly = False + Me.ucrInputFrom.Location = New System.Drawing.Point(99, 24) + Me.ucrInputFrom.Name = "ucrInputFrom" + Me.ucrInputFrom.Size = New System.Drawing.Size(50, 23) + Me.ucrInputFrom.TabIndex = 1 + ' + 'ucrDataFrameLengthForRegularSequence + ' + Me.ucrDataFrameLengthForRegularSequence.Location = New System.Drawing.Point(98, 128) + Me.ucrDataFrameLengthForRegularSequence.Name = "ucrDataFrameLengthForRegularSequence" + Me.ucrDataFrameLengthForRegularSequence.Size = New System.Drawing.Size(51, 23) + Me.ucrDataFrameLengthForRegularSequence.TabIndex = 12 + Me.ucrDataFrameLengthForRegularSequence.ucrDataFrameSelector = Nothing + ' 'dtpSelectorB ' Me.dtpSelectorB.Location = New System.Drawing.Point(99, 50) @@ -97,17 +155,17 @@ Partial Class dlgRegularSequence Me.lblLength.Location = New System.Drawing.Point(10, 132) Me.lblLength.Name = "lblLength" Me.lblLength.Size = New System.Drawing.Size(43, 13) - Me.lblLength.TabIndex = 9 + Me.lblLength.TabIndex = 11 Me.lblLength.Tag = "Length" Me.lblLength.Text = "Length:" ' 'lblTimes1 ' Me.lblTimes1.AutoSize = True - Me.lblTimes1.Location = New System.Drawing.Point(155, 102) + Me.lblTimes1.Location = New System.Drawing.Point(152, 106) Me.lblTimes1.Name = "lblTimes1" Me.lblTimes1.Size = New System.Drawing.Size(41, 13) - Me.lblTimes1.TabIndex = 8 + Me.lblTimes1.TabIndex = 10 Me.lblTimes1.Tag = "Times" Me.lblTimes1.Text = "Time(s)" ' @@ -117,7 +175,7 @@ Partial Class dlgRegularSequence Me.lblRepeatValues.Location = New System.Drawing.Point(10, 106) Me.lblRepeatValues.Name = "lblRepeatValues" Me.lblRepeatValues.Size = New System.Drawing.Size(80, 13) - Me.lblRepeatValues.TabIndex = 6 + Me.lblRepeatValues.TabIndex = 8 Me.lblRepeatValues.Tag = "Repeat_values" Me.lblRepeatValues.Text = "Repeat Values:" ' @@ -128,7 +186,7 @@ Partial Class dlgRegularSequence Me.lblInStepsOf.Location = New System.Drawing.Point(10, 80) Me.lblInStepsOf.Name = "lblInStepsOf" Me.lblInStepsOf.Size = New System.Drawing.Size(63, 13) - Me.lblInStepsOf.TabIndex = 4 + Me.lblInStepsOf.TabIndex = 6 Me.lblInStepsOf.Tag = "In_steps_Of" Me.lblInStepsOf.Text = "In Steps Of:" ' @@ -139,7 +197,7 @@ Partial Class dlgRegularSequence Me.lblTo.Location = New System.Drawing.Point(10, 54) Me.lblTo.Name = "lblTo" Me.lblTo.Size = New System.Drawing.Size(23, 13) - Me.lblTo.TabIndex = 2 + Me.lblTo.TabIndex = 3 Me.lblTo.Tag = "" Me.lblTo.Text = "To:" ' @@ -157,25 +215,25 @@ Partial Class dlgRegularSequence 'lblPreview ' Me.lblPreview.AutoSize = True - Me.lblPreview.Location = New System.Drawing.Point(239, 45) + Me.lblPreview.Location = New System.Drawing.Point(221, 50) Me.lblPreview.Name = "lblPreview" Me.lblPreview.Size = New System.Drawing.Size(100, 13) - Me.lblPreview.TabIndex = 2 + Me.lblPreview.TabIndex = 3 Me.lblPreview.Tag = "Preview" Me.lblPreview.Text = "Sequence Preview:" ' 'txtGetPreview ' - Me.txtGetPreview.Location = New System.Drawing.Point(239, 60) + Me.txtGetPreview.Location = New System.Drawing.Point(221, 65) Me.txtGetPreview.Name = "txtGetPreview" Me.txtGetPreview.Size = New System.Drawing.Size(171, 172) - Me.txtGetPreview.TabIndex = 3 + Me.txtGetPreview.TabIndex = 4 Me.txtGetPreview.Text = "" ' 'txtMessage ' Me.txtMessage.Enabled = False - Me.txtMessage.Location = New System.Drawing.Point(239, 234) + Me.txtMessage.Location = New System.Drawing.Point(221, 239) Me.txtMessage.Multiline = True Me.txtMessage.Name = "txtMessage" Me.txtMessage.ReadOnly = True @@ -202,7 +260,7 @@ Partial Class dlgRegularSequence Me.rdoNumeric.Location = New System.Drawing.Point(10, 19) Me.rdoNumeric.Name = "rdoNumeric" Me.rdoNumeric.Size = New System.Drawing.Size(70, 18) - Me.rdoNumeric.TabIndex = 0 + Me.rdoNumeric.TabIndex = 1 Me.rdoNumeric.Tag = "Numeric" Me.rdoNumeric.Text = "Numeric" Me.rdoNumeric.UseVisualStyleBackColor = True @@ -215,7 +273,7 @@ Partial Class dlgRegularSequence Me.rdoDates.Location = New System.Drawing.Point(93, 20) Me.rdoDates.Name = "rdoDates" Me.rdoDates.Size = New System.Drawing.Size(59, 18) - Me.rdoDates.TabIndex = 1 + Me.rdoDates.TabIndex = 2 Me.rdoDates.Tag = "Dates" Me.rdoDates.Text = "Dates" Me.rdoDates.UseVisualStyleBackColor = True @@ -229,69 +287,11 @@ Partial Class dlgRegularSequence ' 'ucrNewColumnName ' - Me.ucrNewColumnName.Location = New System.Drawing.Point(10, 321) + Me.ucrNewColumnName.Location = New System.Drawing.Point(10, 304) Me.ucrNewColumnName.Name = "ucrNewColumnName" Me.ucrNewColumnName.Size = New System.Drawing.Size(294, 24) Me.ucrNewColumnName.TabIndex = 6 ' - 'ucrChkDefineAsFactor - ' - Me.ucrChkDefineAsFactor.Checked = False - Me.ucrChkDefineAsFactor.Location = New System.Drawing.Point(10, 159) - Me.ucrChkDefineAsFactor.Name = "ucrChkDefineAsFactor" - Me.ucrChkDefineAsFactor.Size = New System.Drawing.Size(176, 20) - Me.ucrChkDefineAsFactor.TabIndex = 8 - ' - 'ucrNudRepeatValues - ' - Me.ucrNudRepeatValues.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudRepeatValues.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudRepeatValues.Location = New System.Drawing.Point(99, 102) - Me.ucrNudRepeatValues.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudRepeatValues.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudRepeatValues.Name = "ucrNudRepeatValues" - Me.ucrNudRepeatValues.Size = New System.Drawing.Size(50, 23) - Me.ucrNudRepeatValues.TabIndex = 7 - Me.ucrNudRepeatValues.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrInputInStepsOf - ' - Me.ucrInputInStepsOf.AddQuotesIfUnrecognised = True - Me.ucrInputInStepsOf.IsMultiline = False - Me.ucrInputInStepsOf.IsReadOnly = False - Me.ucrInputInStepsOf.Location = New System.Drawing.Point(99, 76) - Me.ucrInputInStepsOf.Name = "ucrInputInStepsOf" - Me.ucrInputInStepsOf.Size = New System.Drawing.Size(50, 23) - Me.ucrInputInStepsOf.TabIndex = 5 - ' - 'ucrInputTo - ' - Me.ucrInputTo.AddQuotesIfUnrecognised = True - Me.ucrInputTo.IsMultiline = False - Me.ucrInputTo.IsReadOnly = False - Me.ucrInputTo.Location = New System.Drawing.Point(99, 50) - Me.ucrInputTo.Name = "ucrInputTo" - Me.ucrInputTo.Size = New System.Drawing.Size(50, 23) - Me.ucrInputTo.TabIndex = 3 - ' - 'ucrInputFrom - ' - Me.ucrInputFrom.AddQuotesIfUnrecognised = True - Me.ucrInputFrom.IsMultiline = False - Me.ucrInputFrom.IsReadOnly = False - Me.ucrInputFrom.Location = New System.Drawing.Point(99, 24) - Me.ucrInputFrom.Name = "ucrInputFrom" - Me.ucrInputFrom.Size = New System.Drawing.Size(50, 23) - Me.ucrInputFrom.TabIndex = 1 - ' - 'ucrDataFrameLengthForRegularSequence - ' - Me.ucrDataFrameLengthForRegularSequence.Location = New System.Drawing.Point(98, 128) - Me.ucrDataFrameLengthForRegularSequence.Name = "ucrDataFrameLengthForRegularSequence" - Me.ucrDataFrameLengthForRegularSequence.Size = New System.Drawing.Size(51, 23) - Me.ucrDataFrameLengthForRegularSequence.TabIndex = 10 - Me.ucrDataFrameLengthForRegularSequence.ucrDataFrameSelector = Nothing - ' 'ucrSelectDataFrameRegularSequence ' Me.ucrSelectDataFrameRegularSequence.bUseCurrentFilter = True @@ -303,7 +303,7 @@ Partial Class dlgRegularSequence ' 'ucrBase ' - Me.ucrBase.Location = New System.Drawing.Point(10, 348) + Me.ucrBase.Location = New System.Drawing.Point(10, 330) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(410, 52) Me.ucrBase.TabIndex = 7 @@ -312,7 +312,7 @@ Partial Class dlgRegularSequence ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(419, 412) + Me.ClientSize = New System.Drawing.Size(418, 387) Me.Controls.Add(Me.grpSequenceType) Me.Controls.Add(Me.ucrNewColumnName) Me.Controls.Add(Me.txtMessage) diff --git a/instat/dlgRegularSequence.vb b/instat/dlgRegularSequence.vb index 7f61be6d761..db413f0bbf4 100644 --- a/instat/dlgRegularSequence.vb +++ b/instat/dlgRegularSequence.vb @@ -44,43 +44,45 @@ Public Class dlgRegularSequence ucrNudRepeatValues.SetRCode(clsRepFunction, bReset) ucrInputInStepsOf.SetRCode(clsSeqFunction, bReset) bUpdateBy = True - End Sub Private Sub InitialiseDialog() ucrBase.iHelpTopicID = 30 - ucrPnlSequenceType.AddRadioButton(rdoNumeric) - ucrPnlSequenceType.AddRadioButton(rdoDates) - ucrInputFrom.SetParameter(New RParameter("from", 0)) ucrInputFrom.AddQuotesIfUnrecognised = False ucrInputFrom.SetValidationTypeAsNumeric() + ucrInputTo.SetParameter(New RParameter("to", 1)) ucrInputTo.AddQuotesIfUnrecognised = False ucrInputTo.SetValidationTypeAsNumeric() + ucrNudRepeatValues.SetParameter(New RParameter("each", 1)) ucrNudRepeatValues.SetMinMax(1, Integer.MaxValue) + ucrInputInStepsOf.SetParameter(New RParameter("by", 2)) ucrInputInStepsOf.AddQuotesIfUnrecognised = False ucrInputInStepsOf.SetValidationTypeAsNumeric(dcmMin:=0) + ucrDataFrameLengthForRegularSequence.SetDataFrameSelector(ucrSelectDataFrameRegularSequence) + ucrPnlSequenceType.AddRadioButton(rdoNumeric) + ucrPnlSequenceType.AddRadioButton(rdoDates) + ucrPnlSequenceType.bAllowNonConditionValues = True + ucrPnlSequenceType.AddFunctionNamesCondition(rdoNumeric, "seq") + ucrPnlSequenceType.AddFunctionNamesCondition(rdoDates, "as.date") + ucrPnlSequenceType.AddToLinkedControls(ucrInputFrom, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, objNewDefaultState:=1) ucrInputFrom.SetLinkedDisplayControl(lblFrom) ucrPnlSequenceType.AddToLinkedControls(ucrInputTo, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, objNewDefaultState:=ucrSelectDataFrameRegularSequence.iDataFrameLength) ucrInputTo.SetLinkedDisplayControl(lblTo) ucrPnlSequenceType.AddToLinkedControls(ucrInputInStepsOf, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, objNewDefaultState:=1) - ucrNudRepeatValues.SetLinkedDisplayControl(lblRepeatValues) - ucrPnlSequenceType.AddToLinkedControls(ucrNudRepeatValues, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, objNewDefaultState:=1) ucrInputInStepsOf.SetLinkedDisplayControl(lblInStepsOf) + ucrPnlSequenceType.AddToLinkedControls(ucrNudRepeatValues, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, objNewDefaultState:=1) + ucrNudRepeatValues.SetLinkedDisplayControl(lblRepeatValues) 'ucrPnlSequenceType.AddToLinkedControls(dtpSelectorA, {rdoDates}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) 'ucrPnlSequenceType.AddToLinkedControls(dtpSelectorB, {rdoDates}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - ucrPnlSequenceType.bAllowNonConditionValues = True - ucrPnlSequenceType.AddFunctionNamesCondition(rdoNumeric, "seq") - ucrPnlSequenceType.AddFunctionNamesCondition(rdoDates, "as.date") - ucrNewColumnName.SetPrefix("Regular") ucrNewColumnName.SetDataFrameSelector(ucrSelectDataFrameRegularSequence) ucrNewColumnName.SetIsComboBox() @@ -94,10 +96,10 @@ Public Class dlgRegularSequence 'ucrInputFrom.Visible = False ' ucrInputTo.Visible = False CheckSequenceLength() - End Sub - Private Sub ucrChkDefineAsFactor_Load(sender As Object, e As EventArgs) Handles ucrChkDefineAsFactor.Load + 'Temporarily disabled ucrChkDefineAsFactor.Enabled = False + rdoDates.Enabled = False End Sub Private Sub SetDefaults() @@ -105,8 +107,9 @@ Public Class dlgRegularSequence clsSeqFunction = New RFunction ucrSelectDataFrameRegularSequence.Reset() ucrNewColumnName.Reset() + rdoNumeric.Checked = True - rdoDates.Enabled = False + clsSeqFunction.SetRCommand("seq") clsSeqFunction.AddParameter("from", 1) clsSeqFunction.AddParameter("to", ucrSelectDataFrameRegularSequence.iDataFrameLength) @@ -120,7 +123,6 @@ Public Class dlgRegularSequence ucrBase.clsRsyntax.SetAssignTo(strAssignToName:=ucrNewColumnName.GetText, strTempDataframe:=ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text, strTempColumn:=ucrNewColumnName.GetText) ucrBase.clsRsyntax.SetBaseRFunction(clsRepFunction) CheckSequenceLength() - End Sub Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset @@ -142,7 +144,6 @@ Public Class dlgRegularSequence Else ucrBase.OKEnabled(False) End If - End If End Sub @@ -216,7 +217,7 @@ Public Class dlgRegularSequence ucrBase.clsRsyntax.clsBaseFunction.bToBeAssigned = bToBeAssigned Catch ex As Exception txtGetPreview.Text = "" - txtMessage.Text = "No preview avaiable" + txtMessage.Text = "No preview available." End Try End Sub @@ -233,6 +234,7 @@ Public Class dlgRegularSequence Private Sub ucrNudRepeatValues_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrNudRepeatValues.ControlContentsChanged SetBaseFunction() CheckSequenceLength() + TestOKEnabled() End Sub Private Sub ucrInputFrom_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrInputFrom.ControlValueChanged, ucrInputTo.ControlValueChanged, ucrInputInStepsOf.ControlValueChanged @@ -241,7 +243,7 @@ Public Class dlgRegularSequence End If End Sub - Private Sub ucrNewColumnName_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrNewColumnName.ControlContentsChanged, ucrInputTo.ControlContentsChanged, ucrInputFrom.ControlContentsChanged, ucrInputInStepsOf.ControlContentsChanged, ucrNudRepeatValues.ControlContentsChanged, ucrPnlSequenceType.ControlContentsChanged, ucrSelectDataFrameRegularSequence.ControlContentsChanged + Private Sub ucrNewColumnName_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrNewColumnName.ControlContentsChanged, ucrInputTo.ControlContentsChanged, ucrInputFrom.ControlContentsChanged, ucrInputInStepsOf.ControlContentsChanged, ucrPnlSequenceType.ControlContentsChanged, ucrSelectDataFrameRegularSequence.ControlContentsChanged TestOKEnabled() End Sub From 712bd7b1944be12de63f748e6b968781cc92dc2a Mon Sep 17 00:00:00 2001 From: Alex Sananka Date: Thu, 13 Apr 2017 18:22:47 +0300 Subject: [PATCH 30/34] rdoNumeric checked(not manually) --- instat/dlgRegularSequence.vb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/instat/dlgRegularSequence.vb b/instat/dlgRegularSequence.vb index db413f0bbf4..3dcb29f65a2 100644 --- a/instat/dlgRegularSequence.vb +++ b/instat/dlgRegularSequence.vb @@ -69,8 +69,8 @@ Public Class dlgRegularSequence ucrPnlSequenceType.AddRadioButton(rdoNumeric) ucrPnlSequenceType.AddRadioButton(rdoDates) ucrPnlSequenceType.bAllowNonConditionValues = True - ucrPnlSequenceType.AddFunctionNamesCondition(rdoNumeric, "seq") - ucrPnlSequenceType.AddFunctionNamesCondition(rdoDates, "as.date") + ucrPnlSequenceType.AddFunctionNamesCondition(rdoNumeric, {"seq", "rep"}) + 'ucrPnlSequenceType.AddFunctionNamesCondition(rdoDates, "as.date") ucrPnlSequenceType.AddToLinkedControls(ucrInputFrom, {rdoNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, objNewDefaultState:=1) ucrInputFrom.SetLinkedDisplayControl(lblFrom) @@ -108,8 +108,6 @@ Public Class dlgRegularSequence ucrSelectDataFrameRegularSequence.Reset() ucrNewColumnName.Reset() - rdoNumeric.Checked = True - clsSeqFunction.SetRCommand("seq") clsSeqFunction.AddParameter("from", 1) clsSeqFunction.AddParameter("to", ucrSelectDataFrameRegularSequence.iDataFrameLength) From 4ea2b4084b7c96d7e6fa0d2890c0287780936e51 Mon Sep 17 00:00:00 2001 From: Alex Sananka Date: Thu, 13 Apr 2017 20:02:37 +0300 Subject: [PATCH 31/34] removing bAllowNonConditionValue --- instat/dlgRegularSequence.vb | 1 - 1 file changed, 1 deletion(-) diff --git a/instat/dlgRegularSequence.vb b/instat/dlgRegularSequence.vb index 3dcb29f65a2..2e827c47256 100644 --- a/instat/dlgRegularSequence.vb +++ b/instat/dlgRegularSequence.vb @@ -68,7 +68,6 @@ Public Class dlgRegularSequence ucrPnlSequenceType.AddRadioButton(rdoNumeric) ucrPnlSequenceType.AddRadioButton(rdoDates) - ucrPnlSequenceType.bAllowNonConditionValues = True ucrPnlSequenceType.AddFunctionNamesCondition(rdoNumeric, {"seq", "rep"}) 'ucrPnlSequenceType.AddFunctionNamesCondition(rdoDates, "as.date") From c256b36dec64eba374b1cee8a405278f5e384d4d Mon Sep 17 00:00:00 2001 From: Lily Date: Tue, 18 Apr 2017 09:50:54 +0100 Subject: [PATCH 32/34] Parameter Positions --- instat/dlgRegularSequence.vb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/instat/dlgRegularSequence.vb b/instat/dlgRegularSequence.vb index 2e827c47256..36e8543e7ec 100644 --- a/instat/dlgRegularSequence.vb +++ b/instat/dlgRegularSequence.vb @@ -57,13 +57,13 @@ Public Class dlgRegularSequence ucrInputTo.AddQuotesIfUnrecognised = False ucrInputTo.SetValidationTypeAsNumeric() - ucrNudRepeatValues.SetParameter(New RParameter("each", 1)) - ucrNudRepeatValues.SetMinMax(1, Integer.MaxValue) - ucrInputInStepsOf.SetParameter(New RParameter("by", 2)) ucrInputInStepsOf.AddQuotesIfUnrecognised = False ucrInputInStepsOf.SetValidationTypeAsNumeric(dcmMin:=0) + ucrNudRepeatValues.SetParameter(New RParameter("each", 4)) + ucrNudRepeatValues.SetMinMax(1, Integer.MaxValue) + ucrDataFrameLengthForRegularSequence.SetDataFrameSelector(ucrSelectDataFrameRegularSequence) ucrPnlSequenceType.AddRadioButton(rdoNumeric) @@ -115,7 +115,7 @@ Public Class dlgRegularSequence clsRepFunction.SetRCommand("rep") clsRepFunction.AddParameter("x", clsRFunctionParameter:=clsSeqFunction) clsRepFunction.AddParameter("each", 1) - clsRepFunction.AddParameter("length.out", ucrSelectDataFrameRegularSequence.iDataFrameLength) + clsRepFunction.AddParameter("length.out", ucrSelectDataFrameRegularSequence.iDataFrameLength, iPosition:=3) 'clsSeqFunction.SetAssignTo(ucrNewColumnName.GetText, strTempDataframe:=ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text, strTempColumn:=ucrNewColumnName.GetText) ucrBase.clsRsyntax.SetAssignTo(strAssignToName:=ucrNewColumnName.GetText, strTempDataframe:=ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text, strTempColumn:=ucrNewColumnName.GetText) ucrBase.clsRsyntax.SetBaseRFunction(clsRepFunction) @@ -194,7 +194,7 @@ Public Class dlgRegularSequence If iLength <> ucrSelectDataFrameRegularSequence.iDataFrameLength Then ucrBase.clsRsyntax.SetBaseRFunction(clsRepFunction) clsSeqFunction.RemoveAssignTo() - clsRepFunction.AddParameter("length.out", ucrSelectDataFrameRegularSequence.iDataFrameLength) + clsRepFunction.AddParameter("length.out", ucrSelectDataFrameRegularSequence.iDataFrameLength, iPosition:=3) strRCommand = ucrBase.clsRsyntax.clsBaseFunction.ToScript() bIsAssigned = False vecSequence = frmMain.clsRLink.RunInternalScriptGetValue(strRCommand, bSilent:=True).AsNumeric From 4d43cd5f1b3e105813edf5d53df65ab3f52a5a02 Mon Sep 17 00:00:00 2001 From: Lily Date: Tue, 18 Apr 2017 09:53:51 +0100 Subject: [PATCH 33/34] Parameter position --- instat/dlgRegularSequence.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/dlgRegularSequence.vb b/instat/dlgRegularSequence.vb index 36e8543e7ec..904a145456b 100644 --- a/instat/dlgRegularSequence.vb +++ b/instat/dlgRegularSequence.vb @@ -61,7 +61,7 @@ Public Class dlgRegularSequence ucrInputInStepsOf.AddQuotesIfUnrecognised = False ucrInputInStepsOf.SetValidationTypeAsNumeric(dcmMin:=0) - ucrNudRepeatValues.SetParameter(New RParameter("each", 4)) + ucrNudRepeatValues.SetParameter(New RParameter("each", 1)) ucrNudRepeatValues.SetMinMax(1, Integer.MaxValue) ucrDataFrameLengthForRegularSequence.SetDataFrameSelector(ucrSelectDataFrameRegularSequence) From 289e3709a2abb4b0bbecf5967a3efae74fd90959 Mon Sep 17 00:00:00 2001 From: Alex Sananka Date: Wed, 19 Apr 2017 10:25:39 +0300 Subject: [PATCH 34/34] Removing preview window from Test OK --- instat/dlgRegularSequence.vb | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/instat/dlgRegularSequence.vb b/instat/dlgRegularSequence.vb index 2e827c47256..2af5f4ca188 100644 --- a/instat/dlgRegularSequence.vb +++ b/instat/dlgRegularSequence.vb @@ -38,10 +38,10 @@ Public Class dlgRegularSequence Private Sub SetRCodeForControls(bReset As Boolean) bUpdateBy = False ucrNewColumnName.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - ucrPnlSequenceType.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - ucrInputFrom.SetRCode(clsSeqFunction, bReset) - ucrInputTo.SetRCode(clsSeqFunction, bReset) - ucrNudRepeatValues.SetRCode(clsRepFunction, bReset) + ucrPnlSequenceType.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + ucrInputFrom.SetRCode(clsSeqFunction, bReset) + ucrInputTo.SetRCode(clsSeqFunction, bReset) + ucrNudRepeatValues.SetRCode(clsRepFunction, bReset) ucrInputInStepsOf.SetRCode(clsSeqFunction, bReset) bUpdateBy = True End Sub @@ -131,7 +131,7 @@ Public Class dlgRegularSequence Private Sub TestOKEnabled() If ucrNewColumnName.IsComplete Then If rdoNumeric.Checked Then - If ucrInputFrom.GetText <> "" AndAlso ucrInputTo.GetText <> "" AndAlso ucrInputInStepsOf.GetText <> "" AndAlso ucrNudRepeatValues.GetText <> "" AndAlso ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text <> "" AndAlso txtGetPreview.Text <> "" Then + If ucrInputFrom.GetText <> "" AndAlso ucrInputTo.GetText <> "" AndAlso ucrInputInStepsOf.GetText <> "" AndAlso ucrNudRepeatValues.GetText <> "" AndAlso ucrSelectDataFrameRegularSequence.cboAvailableDataFrames.Text <> "" Then ucrBase.OKEnabled(True) Else ucrBase.OKEnabled(False) @@ -243,8 +243,4 @@ Public Class dlgRegularSequence Private Sub ucrNewColumnName_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrNewColumnName.ControlContentsChanged, ucrInputTo.ControlContentsChanged, ucrInputFrom.ControlContentsChanged, ucrInputInStepsOf.ControlContentsChanged, ucrPnlSequenceType.ControlContentsChanged, ucrSelectDataFrameRegularSequence.ControlContentsChanged TestOKEnabled() End Sub - - Private Sub txtGetPreview_TextChanged(sender As Object, e As EventArgs) Handles txtGetPreview.TextChanged - TestOKEnabled() - End Sub End Class \ No newline at end of file