From fa6e5db23e4e73af5fed51bc53b58be68d73ebe3 Mon Sep 17 00:00:00 2001 From: steven ndung'u Date: Fri, 11 Nov 2016 11:13:05 +0300 Subject: [PATCH 1/3] Edits to make the dialog appear as it was before beta release. --- instat/dlgMakeDate.vb | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/instat/dlgMakeDate.vb b/instat/dlgMakeDate.vb index 3e45317e08a..cef58a428d7 100644 --- a/instat/dlgMakeDate.vb +++ b/instat/dlgMakeDate.vb @@ -82,22 +82,12 @@ Public Class dlgMakeDate chkTwoDigitYearTwo.Checked = False lblCutOffThree.Visible = False lblCutOffTwo.Visible = False - 'Disabling the check boxes, Input,... which are yet to be Implemented. - 'To be return to how it was prev... - 'chkTwoDigitYearThree.Enabled = False - 'chkTwoDigitYearTwo.Enabled = False - nudCutOffThree.Visible = True - nudCutOffTwo.Visible = True - nudCutOffThree.Enabled = False - nudCutOffTwo.Enabled = False + chkTwoDigitYearThree.Visible = True + chkTwoDigitYearTwo.Visible = True + nudCutOffThree.Visible = False + nudCutOffTwo.Visible = False chkMore.Checked = False - 'chkMore.Enabled = False - lblCutOffTwo.Visible = True - lblCutOffThree.Visible = True - lblCutOffThree.Enabled = False - lblCutOffTwo.Enabled = False - ucrInputComboBoxMonthTwo.Enabled = False - grpFormatField.Visible = False + chkMore.Visible = True End Sub @@ -177,8 +167,6 @@ Public Class dlgMakeDate Else ucrBase.clsRsyntax.RemoveParameter("origin") End If - 'to be removed later - grpFormatField.Enabled = False TestOKEnabled() End Sub From 34ed006965c8e882b579ef08d71ef7c1ad2ed432 Mon Sep 17 00:00:00 2001 From: Stephen Kogo Date: Mon, 14 Nov 2016 16:28:39 +0300 Subject: [PATCH 2/3] Fixing message box for summaries subdialogue and adapting the dialogues. Fixes #2266 --- instat/dlgColumnStats.vb | 7 +++++-- instat/dlgDescribeOneVariable.vb | 13 +++++++++++- instat/dlgDescribeTwoVariable.vb | 35 +++++++++++++++++--------------- instat/sdgSummaries.Designer.vb | 16 +++++++-------- instat/sdgSummaries.vb | 10 +++++++-- 5 files changed, 52 insertions(+), 29 deletions(-) diff --git a/instat/dlgColumnStats.vb b/instat/dlgColumnStats.vb index 26cd43f81d0..a6d929018db 100644 --- a/instat/dlgColumnStats.vb +++ b/instat/dlgColumnStats.vb @@ -30,8 +30,8 @@ Public Class dlgColumnStats TestOKEnabled() End Sub - Private Sub TestOKEnabled() - If (Not ucrReceiverSelectedVariables.IsEmpty()) Then + Public Sub TestOKEnabled() + If (Not ucrReceiverSelectedVariables.IsEmpty() AndAlso Not sdgSummaries.strSummariesParameter = "c()") Then ucrBase.OKEnabled(True) Else ucrBase.OKEnabled(False) @@ -50,6 +50,7 @@ Public Class dlgColumnStats ucrSelectorForColumnStatistics.Reset() ucrReceiverSelectedVariables.SetMeAsReceiver() sdgSummaries.SetDefaults() + TestOKEnabled() End Sub Private Sub InitialiseDialog() @@ -134,6 +135,8 @@ Public Class dlgColumnStats Private Sub cmdSummaries_Click(sender As Object, e As EventArgs) Handles cmdSummaries.Click sdgSummaries.ShowDialog() + sdgSummaries.TestSummaries() + TestOKEnabled() End Sub Private Sub chkExcludeMissing_CheckedChanged(sender As Object, e As EventArgs) Handles chkOmitMissing.CheckedChanged diff --git a/instat/dlgDescribeOneVariable.vb b/instat/dlgDescribeOneVariable.vb index dce55827a85..d850d2066c1 100644 --- a/instat/dlgDescribeOneVariable.vb +++ b/instat/dlgDescribeOneVariable.vb @@ -31,11 +31,21 @@ Public Class dlgDescribeOneVariable Private Sub cmdSummaries_click(sender As Object, e As EventArgs) Handles cmdSummaries.Click sdgSummaries.ShowDialog() + sdgSummaries.TestSummaries() + TestOKEnabled() End Sub Public Sub TestOKEnabled() If Not ucrReceiverDescribeOneVar.IsEmpty() Then - ucrBaseDescribeOneVar.OKEnabled(True) + If chkCustomise.Checked Then + If sdgSummaries.strSummariesParameter = "c()" Then + ucrBaseDescribeOneVar.OKEnabled(False) + Else + ucrBaseDescribeOneVar.OKEnabled(True) + End If + Else + ucrBaseDescribeOneVar.OKEnabled(True) + End If Else ucrBaseDescribeOneVar.OKEnabled(False) End If @@ -114,6 +124,7 @@ Public Class dlgDescribeOneVariable Private Sub chkCustomise_CheckedChanged(sender As Object, e As EventArgs) Handles chkCustomise.CheckedChanged ChooseFunction() + TestOKEnabled() End Sub Private Sub StoreResultsParamenter() diff --git a/instat/dlgDescribeTwoVariable.vb b/instat/dlgDescribeTwoVariable.vb index 2ec7273318d..8e2c48ee24c 100644 --- a/instat/dlgDescribeTwoVariable.vb +++ b/instat/dlgDescribeTwoVariable.vb @@ -32,14 +32,17 @@ Public Class dlgDescribeTwoVariable autoTranslate(Me) End Sub - Private Sub cmdDisplayOptions_Click(sender As Object, e As EventArgs) Handles cmdDisplayOptions.Click - sdgDescribeDisplay.GrpBoxEnable() - sdgDescribeDisplay.ShowDialog() - End Sub - Public Sub TestOKEnabled() If ((Not ucrReceiverFirstVar.IsEmpty()) And (Not ucrReceiverSecondVar.IsEmpty())) Then - ucrBaseDescribeTwoVar.OKEnabled(True) + If ((strVarType = "numeric" OrElse strVarType = "integer") AndAlso (strSecondVarType = "factor")) Then + If sdgSummaries.strSummariesParameter = "c()" Then + ucrBaseDescribeTwoVar.OKEnabled(False) + Else + ucrBaseDescribeTwoVar.OKEnabled(True) + End If + Else + ucrBaseDescribeTwoVar.OKEnabled(True) + End If Else ucrBaseDescribeTwoVar.OKEnabled(False) End If @@ -64,8 +67,9 @@ Public Class dlgDescribeTwoVariable sdgDescribeDisplay.SetFreqDispOptions(clsRFreqTables) sdgSummaries.SetDefaults() sdgDescribeDisplay.SetDefaults() + ucrReceiverFirstVar.SetMeAsReceiver() ucrSelectorDescribeTwoVar.Reset() - ucrReceiverFirstVar.Focus() + ucrSelectorDescribeTwoVar.Focus() StoreResultsParamenter() OutputOption() TestOKEnabled() @@ -91,6 +95,13 @@ Public Class dlgDescribeTwoVariable Private Sub cmdSummaries_click(sender As Object, e As EventArgs) Handles cmdSummaries.Click sdgSummaries.ShowDialog() + sdgSummaries.TestSummaries() + TestOKEnabled() + End Sub + + Private Sub cmdDisplayOptions_Click(sender As Object, e As EventArgs) Handles cmdDisplayOptions.Click + sdgDescribeDisplay.GrpBoxEnable() + sdgDescribeDisplay.ShowDialog() End Sub Private Sub Correlation() @@ -153,14 +164,6 @@ Public Class dlgDescribeTwoVariable clsRAnova.AddParameter("data_name", Chr(34) & ucrSelectorDescribeTwoVar.ucrAvailableDataFrames.cboAvailableDataFrames.SelectedItem & Chr(34)) End Sub - Private Sub uucrReceiverSecondVar_SelectionChanged(sender As Object, e As EventArgs) Handles ucrReceiverSecondVar.SelectionChanged - - End Sub - - Private Sub ucrReceiverFirstVar_SelectionChanged(sender As Object, e As EventArgs) Handles ucrReceiverFirstVar.SelectionChanged - - End Sub - Private Sub ucrReceiverFirstVar_SelectionChanged() Handles ucrReceiverFirstVar.SelectionChanged If Not ucrReceiverFirstVar.IsEmpty Then clsRCustomSummary.AddParameter("columns_to_summarise", ucrReceiverFirstVar.GetVariableNames()) @@ -171,7 +174,7 @@ Public Class dlgDescribeTwoVariable TestOKEnabled() End Sub - Private Sub uucrReceiverSecondVar_SelectionChanged() Handles ucrReceiverSecondVar.SelectionChanged + Private Sub ucrReceiverSecondVar_SelectionChanged() Handles ucrReceiverSecondVar.SelectionChanged If Not ucrReceiverSecondVar.IsEmpty Then clsRCustomSummary.AddParameter("factors", ucrReceiverSecondVar.GetVariableNames) Else diff --git a/instat/sdgSummaries.Designer.vb b/instat/sdgSummaries.Designer.vb index 833716f958c..c0cca77acf6 100644 --- a/instat/sdgSummaries.Designer.vb +++ b/instat/sdgSummaries.Designer.vb @@ -38,7 +38,7 @@ Partial Class sdgSummaries Me.chkStdDev = New System.Windows.Forms.CheckBox() Me.chkQuartiles = New System.Windows.Forms.CheckBox() Me.chkMedian = New System.Windows.Forms.CheckBox() - Me.UcrButtonsSubdialogue1 = New instat.ucrButtonsSubdialogue() + Me.ucrButtonsSummaries = New instat.ucrButtonsSubdialogue() Me.grpCommon.SuspendLayout() Me.grpNotOrderedFactor.SuspendLayout() Me.grpNumeric.SuspendLayout() @@ -232,12 +232,12 @@ Partial Class sdgSummaries Me.chkMedian.Text = "Median" Me.chkMedian.UseVisualStyleBackColor = True ' - 'UcrButtonsSubdialogue1 + 'ucrButtonsSummaries ' - Me.UcrButtonsSubdialogue1.Location = New System.Drawing.Point(62, 236) - Me.UcrButtonsSubdialogue1.Name = "UcrButtonsSubdialogue1" - Me.UcrButtonsSubdialogue1.Size = New System.Drawing.Size(142, 30) - Me.UcrButtonsSubdialogue1.TabIndex = 3 + Me.ucrButtonsSummaries.Location = New System.Drawing.Point(62, 236) + Me.ucrButtonsSummaries.Name = "ucrButtonsSummaries" + Me.ucrButtonsSummaries.Size = New System.Drawing.Size(142, 30) + Me.ucrButtonsSummaries.TabIndex = 3 ' 'sdgSummaries ' @@ -247,7 +247,7 @@ Partial Class sdgSummaries Me.Controls.Add(Me.grpNumeric) Me.Controls.Add(Me.grpCommon) Me.Controls.Add(Me.grpNotOrderedFactor) - Me.Controls.Add(Me.UcrButtonsSubdialogue1) + Me.Controls.Add(Me.ucrButtonsSummaries) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.MaximizeBox = False Me.MinimizeBox = False @@ -265,7 +265,7 @@ Partial Class sdgSummaries End Sub - Friend WithEvents UcrButtonsSubdialogue1 As ucrButtonsSubdialogue + Friend WithEvents ucrButtonsSummaries As ucrButtonsSubdialogue Friend WithEvents chkNonMissing As CheckBox Friend WithEvents chkNMissing As CheckBox Friend WithEvents chkNTotal As CheckBox diff --git a/instat/sdgSummaries.vb b/instat/sdgSummaries.vb index 10cd4022065..2fbca9682bb 100644 --- a/instat/sdgSummaries.vb +++ b/instat/sdgSummaries.vb @@ -17,6 +17,7 @@ Imports instat.Translations Public Class sdgSummaries Public clsRSummaries As New RFunction Public bFirstLoad As Boolean = True + Public strSummariesParameter Private Sub sdgDescribe_Load(sender As Object, e As EventArgs) Handles MyBase.Load autoTranslate(Me) If bFirstLoad Then @@ -55,7 +56,6 @@ Public Class sdgSummaries Public Sub SummariesParameters() Dim lstCheckboxes As New List(Of CheckBox) Dim chkSummary As CheckBox - Dim strSummariesParameter As String = "" Dim i As Integer = 0 If lstCheckboxes.Count = 0 Then lstCheckboxes.AddRange({chkNTotal, chkNonMissing, chkNMissing, chkMean, chkMinimum, chkMode, chkMaximum, chkMedian, chkStdDev, chkRange, chkSum, chkQuartiles}) @@ -75,7 +75,6 @@ Public Class sdgSummaries If i > 0 Then clsRSummaries.AddParameter("summaries", strSummariesParameter) Else - MsgBox("At least one summary should be selected") clsRSummaries.RemoveParameterByName("summaries") End If End Sub @@ -87,4 +86,11 @@ Public Class sdgSummaries Private Sub grpsummaries_CheckedChanged(sender As Object, e As EventArgs) Handles chkNTotal.CheckedChanged, chkNonMissing.CheckedChanged, chkNMissing.CheckedChanged, chkMode.CheckedChanged, chkMean.CheckedChanged, chkRange.CheckedChanged, chkStdDev.CheckedChanged, chkMedian.CheckedChanged, chkSum.CheckedChanged, chkQuartiles.CheckedChanged, chkVariance.CheckedChanged, chkMaximum.CheckedChanged, chkMinimum.CheckedChanged SummariesParameters() End Sub + + Public Sub TestSummaries() + SummariesParameters() + If strSummariesParameter = "c()" Then + MsgBox("OK will be disabled until you check atleast one summary.") + End If + End Sub End Class \ No newline at end of file From dc4d05128746e6eeaf7de2c04d00d62f302fbf01 Mon Sep 17 00:00:00 2001 From: Stephen Kogo Date: Mon, 14 Nov 2016 19:05:22 +0300 Subject: [PATCH 3/3] Edits --- instat/dlgDescribeOneVariable.vb | 14 +++----------- instat/dlgDescribeTwoVariable.vb | 10 +++------- instat/sdgSummaries.vb | 2 +- 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/instat/dlgDescribeOneVariable.vb b/instat/dlgDescribeOneVariable.vb index d850d2066c1..97d5fe7a12c 100644 --- a/instat/dlgDescribeOneVariable.vb +++ b/instat/dlgDescribeOneVariable.vb @@ -36,18 +36,10 @@ Public Class dlgDescribeOneVariable End Sub Public Sub TestOKEnabled() - If Not ucrReceiverDescribeOneVar.IsEmpty() Then - If chkCustomise.Checked Then - If sdgSummaries.strSummariesParameter = "c()" Then - ucrBaseDescribeOneVar.OKEnabled(False) - Else - ucrBaseDescribeOneVar.OKEnabled(True) - End If - Else - ucrBaseDescribeOneVar.OKEnabled(True) - End If - Else + If ucrReceiverDescribeOneVar.IsEmpty() OrElse (chkCustomise.Checked AndAlso sdgSummaries.strSummariesParameter = "c()") Then ucrBaseDescribeOneVar.OKEnabled(False) + Else + ucrBaseDescribeOneVar.OKEnabled(True) End If End Sub diff --git a/instat/dlgDescribeTwoVariable.vb b/instat/dlgDescribeTwoVariable.vb index 8e2c48ee24c..9ae21ba6f27 100644 --- a/instat/dlgDescribeTwoVariable.vb +++ b/instat/dlgDescribeTwoVariable.vb @@ -33,13 +33,9 @@ Public Class dlgDescribeTwoVariable End Sub Public Sub TestOKEnabled() - If ((Not ucrReceiverFirstVar.IsEmpty()) And (Not ucrReceiverSecondVar.IsEmpty())) Then - If ((strVarType = "numeric" OrElse strVarType = "integer") AndAlso (strSecondVarType = "factor")) Then - If sdgSummaries.strSummariesParameter = "c()" Then - ucrBaseDescribeTwoVar.OKEnabled(False) - Else - ucrBaseDescribeTwoVar.OKEnabled(True) - End If + If ((Not ucrReceiverFirstVar.IsEmpty()) AndAlso (Not ucrReceiverSecondVar.IsEmpty())) Then + If ((strVarType = "numeric" OrElse strVarType = "integer") AndAlso (strSecondVarType = "factor")) AndAlso sdgSummaries.strSummariesParameter = "c()" Then + ucrBaseDescribeTwoVar.OKEnabled(False) Else ucrBaseDescribeTwoVar.OKEnabled(True) End If diff --git a/instat/sdgSummaries.vb b/instat/sdgSummaries.vb index 2fbca9682bb..0796e17883b 100644 --- a/instat/sdgSummaries.vb +++ b/instat/sdgSummaries.vb @@ -90,7 +90,7 @@ Public Class sdgSummaries Public Sub TestSummaries() SummariesParameters() If strSummariesParameter = "c()" Then - MsgBox("OK will be disabled until you check atleast one summary.") + MsgBox("OK will be disabled until you check at least one summary.") End If End Sub End Class \ No newline at end of file