Skip to content

Commit

Permalink
Merge pull request #30 from africanmathsinitiative/master
Browse files Browse the repository at this point in the history
update
  • Loading branch information
FrancoisJRenaud authored Nov 16, 2016
2 parents ac2f5db + efd3c7d commit 9338d6c
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 49 deletions.
7 changes: 5 additions & 2 deletions instat/dlgColumnStats.vb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -50,6 +50,7 @@ Public Class dlgColumnStats
ucrSelectorForColumnStatistics.Reset()
ucrReceiverSelectedVariables.SetMeAsReceiver()
sdgSummaries.SetDefaults()
TestOKEnabled()
End Sub

Private Sub InitialiseDialog()
Expand Down Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions instat/dlgDescribeOneVariable.vb
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ 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)
Else
If ucrReceiverDescribeOneVar.IsEmpty() OrElse (chkCustomise.Checked AndAlso sdgSummaries.strSummariesParameter = "c()") Then
ucrBaseDescribeOneVar.OKEnabled(False)
Else
ucrBaseDescribeOneVar.OKEnabled(True)
End If
End Sub

Expand Down Expand Up @@ -114,6 +116,7 @@ Public Class dlgDescribeOneVariable

Private Sub chkCustomise_CheckedChanged(sender As Object, e As EventArgs) Handles chkCustomise.CheckedChanged
ChooseFunction()
TestOKEnabled()
End Sub

Private Sub StoreResultsParamenter()
Expand Down
33 changes: 16 additions & 17 deletions instat/dlgDescribeTwoVariable.vb
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,13 @@ 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 ((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
Else
ucrBaseDescribeTwoVar.OKEnabled(False)
End If
Expand All @@ -64,8 +63,9 @@ Public Class dlgDescribeTwoVariable
sdgDescribeDisplay.SetFreqDispOptions(clsRFreqTables)
sdgSummaries.SetDefaults()
sdgDescribeDisplay.SetDefaults()
ucrReceiverFirstVar.SetMeAsReceiver()
ucrSelectorDescribeTwoVar.Reset()
ucrReceiverFirstVar.Focus()
ucrSelectorDescribeTwoVar.Focus()
StoreResultsParamenter()
OutputOption()
TestOKEnabled()
Expand All @@ -91,6 +91,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()
Expand Down Expand Up @@ -153,14 +160,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())
Expand All @@ -171,7 +170,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
Expand Down
22 changes: 5 additions & 17 deletions instat/dlgMakeDate.vb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -177,8 +167,6 @@ Public Class dlgMakeDate
Else
ucrBase.clsRsyntax.RemoveParameter("origin")
End If
'to be removed later
grpFormatField.Enabled = False
TestOKEnabled()
End Sub

Expand Down
16 changes: 8 additions & 8 deletions instat/sdgSummaries.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions instat/sdgSummaries.vb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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})
Expand All @@ -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
Expand All @@ -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 at least one summary.")
End If
End Sub
End Class

0 comments on commit 9338d6c

Please sign in to comment.