Skip to content

Commit

Permalink
Merge pull request #5 from africanmathsinitiative/master
Browse files Browse the repository at this point in the history
updating my repo
  • Loading branch information
nyagishira committed Feb 29, 2016
2 parents 9081d02 + 80972d7 commit 802967a
Show file tree
Hide file tree
Showing 33 changed files with 1,848 additions and 445 deletions.
4 changes: 4 additions & 0 deletions instat/dlgBoxPlot.vb
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,8 @@ Public Class dlgBoxplot
Private Sub ucrSecondFactorReceiver_Enter(sender As Object, e As EventArgs) Handles ucrSecondFactorReceiver.Enter
ucrSecondFactorReceiver.SetMeAsReceiver()
End Sub

Private Sub cmdBoxPlotOptions_Click(sender As Object, e As EventArgs) Handles cmdBoxPlotOptions.Click
sdgBoxPlot.ShowDialog()
End Sub
End Class
4 changes: 4 additions & 0 deletions instat/dlgDotPlot.vb
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,8 @@ Public Class dlgDotPlot
Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset
SetDefaults()
End Sub

Private Sub cmdDotPlotOptions_Click(sender As Object, e As EventArgs) Handles cmdDotPlotOptions.Click
sdgDotPlot.ShowDialog()
End Sub
End Class
35 changes: 17 additions & 18 deletions instat/dlgRecode.Designer.vb

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

84 changes: 65 additions & 19 deletions instat/dlgRecode.vb
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,70 @@

Imports instat.Translations
Public Class dlgRecode
Private Sub dlgRecode_Load(sender As Object, e As EventArgs) Handles MyBase.Load
ucrReceiverRecode.Selector = ucrSelectorDataFrameAddRemove
ucrReceiverRecode.SetMeAsReceiver()
ucrMultipleNumericBreakPoints.bIsNumericInput = True
chkAddLabels.Checked = False
ucrMultipleLabels.Visible = False
Public bFirstLoad As Boolean = True
Private Sub dlgRecode_Load(sender As Object, e As EventArgs) Handles MyBase.Load
autoTranslate(Me)
ucrBase.iHelpTopicID = 37
ucrBase.clsRsyntax.SetFunction("cut")
ucrBase.clsRsyntax.AddParameter("include.lowest", "TRUE")
ucrSelectorNewColumnName.SetDataFrameSelector(ucrSelectorDataFrameAddRemove.ucrAvailableDataFrames)
ucrSelectorNewColumnName.SetPrefix("Recode")
ucrBase.clsRsyntax.SetAssignTo(strAssignToName:=ucrSelectorNewColumnName.cboColumnName.Text, strTempDataframe:=ucrSelectorDataFrameAddRemove.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempColumn:=ucrSelectorNewColumnName.cboColumnName.Text)

If bFirstLoad Then
SetDefaults()
bFirstLoad = False
Else
ReopenDialog()
End If
'Checks if Ok can be enabled.
TestOKEnabled()
End Sub

Private Sub SetDefaults()

ucrMultipleNumericRecode.bIsNumericInput = True
chkAddLabels.Checked = False
ucrMultipleLabels.Visible = False
rdoRight.Checked = True

ucrReceiverRecode.ResetText()
End Sub
Private Sub ucrReceiverRecode_Leave(sender As Object, e As EventArgs) Handles ucrReceiverRecode.Leave
ucrBase.clsRsyntax.AddParameter("x", clsRFunctionParameter:=ucrReceiverRecode.GetVariables())

Private Sub ReopenDialog()

End Sub

Private Sub TestOKEnabled()
If ucrReceiverRecode.IsEmpty() = False And ucrMultipleNumericRecode.txtNumericItems.Text <> " " Then
ucrBase.OKEnabled(True)
Else
ucrBase.OKEnabled(False)
End If
End Sub

Private Sub ucrMultipleNumeric_Leave(sender As Object, e As EventArgs) Handles ucrMultipleNumericBreakPoints.Leave
If ucrMultipleNumericBreakPoints.clsNumericList.clsParameters.Count = 1 Then
If ucrMultipleNumericBreakPoints.txtNumericItems.Text < 2 Then
Private Sub ucrReceiverRecode_SelectionChanged() Handles ucrReceiverRecode.SelectionChanged
If Not ucrReceiverRecode.IsEmpty Then
ucrBase.clsRsyntax.AddParameter("x", ucrReceiverRecode.GetVariableNames(False))
Else
ucrBase.clsRsyntax.RemoveParameter("x")
End If
TestOKEnabled()
End Sub

Private Sub ucrMultipleNumericRecode_Leave(sender As Object, e As EventArgs) Handles ucrMultipleNumericRecode.Leave

If ucrMultipleNumericRecode.clsNumericList.clsParameters.Count = 1 Then
If ucrMultipleNumericRecode.txtNumericItems.Text < 2 Then
MsgBox("If break points is a single number, it specify a number of intervals > 1.", vbOKOnly, "Validation Error")
End If


Else
ValidateBreakPointLabelCount(True)
End If
ucrBase.clsRsyntax.AddParameter("breaks", clsRFunctionParameter:=ucrMultipleNumericBreakPoints.clsNumericList)
ucrBase.clsRsyntax.AddParameter("breaks", clsRFunctionParameter:=ucrMultipleNumericRecode.clsNumericList)
TestOKEnabled()
End Sub

Private Sub ucrMultipleLabels_Leave(sender As Object, e As EventArgs) Handles ucrMultipleLabels.Leave
Expand All @@ -60,12 +97,12 @@ Public Class dlgRecode
End Sub

Private Sub ValidateBreakPointLabelCount(bBreakPointFocused As Boolean)
If ucrMultipleNumericBreakPoints.clsNumericList.clsParameters.Count > 1 Then
If ucrMultipleNumericBreakPoints.txtNumericItems.Text <> "" And ucrMultipleLabels.txtNumericItems.Text <> "" Then
If ucrMultipleLabels.clsNumericList.clsParameters.Count <> ucrMultipleNumericBreakPoints.clsNumericList.clsParameters.Count - 1 Then
If ucrMultipleNumericRecode.clsNumericList.clsParameters.Count > 1 Then
If ucrMultipleNumericRecode.txtNumericItems.Text <> "" And ucrMultipleLabels.txtNumericItems.Text <> "" Then
If ucrMultipleLabels.clsNumericList.clsParameters.Count <> ucrMultipleNumericRecode.clsNumericList.clsParameters.Count - 1 Then
MsgBox("There must be one less label than the number of break points.", vbOKOnly, "Validation Error")
If bBreakPointFocused Then
ucrMultipleNumericBreakPoints.Focus()
ucrMultipleNumericRecode.Focus()
Else
ucrMultipleLabels.Focus()
End If
Expand All @@ -86,10 +123,19 @@ Public Class dlgRecode
End Sub

Private Sub grpClosedOn_CheckedChanged(sender As Object, e As EventArgs) Handles rdoLeft.CheckedChanged, rdoRight.CheckedChanged
If rdoLeft.Checked Then
ucrBase.clsRsyntax.AddParameter("right", "FALSE")
setClosedOn()

End Sub

Private Sub SetClosedOn()
If rdoRight.Checked Then
If frmMain.clsInstatOptions.bIncludeRDefaultParameters Then
ucrBase.clsRsyntax.AddParameter("right", "TRUE")
Else
ucrBase.clsRsyntax.RemoveParameter("right")
End If
Else
ucrBase.clsRsyntax.AddParameter("right", "TRUE")
ucrBase.clsRsyntax.AddParameter("right", "FALSE")
End If
End Sub

Expand Down
79 changes: 79 additions & 0 deletions instat/instat.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -298,18 +298,36 @@
<Compile Include="dlgSummaryBarOrPieChart.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="ucrInputComboBox.Designer.vb">
<DependentUpon>ucrInputComboBox.vb</DependentUpon>
</Compile>
<Compile Include="ucrInputComboBox.vb">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="sdgBarChart.Designer.vb">
<DependentUpon>sdgBarChart.vb</DependentUpon>
</Compile>
<Compile Include="sdgBarChart.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="sdgBoxPlot.Designer.vb">
<DependentUpon>sdgBoxPlot.vb</DependentUpon>
</Compile>
<Compile Include="sdgBoxPlot.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="sdgCorrPlot.Designer.vb">
<DependentUpon>sdgCorrPlot.vb</DependentUpon>
</Compile>
<Compile Include="sdgCorrPlot.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="sdgDotPlot.Designer.vb">
<DependentUpon>sdgDotPlot.vb</DependentUpon>
</Compile>
<Compile Include="sdgDotPlot.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="sdgHistogramOptions.Designer.vb">
<DependentUpon>sdgHistogramOptions.vb</DependentUpon>
</Compile>
Expand Down Expand Up @@ -1158,6 +1176,18 @@
<Compile Include="ucrFactor.vb">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="ucrInput.Designer.vb">
<DependentUpon>ucrInput.vb</DependentUpon>
</Compile>
<Compile Include="ucrInput.vb">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="ucrInputTextBox.Designer.vb">
<DependentUpon>ucrInputTextBox.vb</DependentUpon>
</Compile>
<Compile Include="ucrInputTextBox.vb">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="ucrMultipleInput.Designer.vb">
<DependentUpon>ucrMultipleInput.vb</DependentUpon>
</Compile>
Expand Down Expand Up @@ -1469,6 +1499,15 @@
<EmbeddedResource Include="sdgBarChart.sw-KE.resx">
<DependentUpon>sdgBarChart.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="sdgBoxPlot.fr-FR.resx">
<DependentUpon>sdgBoxPlot.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="sdgBoxPlot.resx">
<DependentUpon>sdgBoxPlot.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="sdgBoxPlot.sw-KE.resx">
<DependentUpon>sdgBoxPlot.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="sdgCorrPlot.fr-FR.resx">
<DependentUpon>sdgCorrPlot.vb</DependentUpon>
</EmbeddedResource>
Expand All @@ -1478,6 +1517,15 @@
<EmbeddedResource Include="sdgCorrPlot.sw-KE.resx">
<DependentUpon>sdgCorrPlot.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="sdgDotPlot.fr-FR.resx">
<DependentUpon>sdgDotPlot.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="sdgDotPlot.resx">
<DependentUpon>sdgDotPlot.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="sdgDotPlot.sw-KE.resx">
<DependentUpon>sdgDotPlot.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="sdgHistogramOptions.fr-FR.resx">
<DependentUpon>sdgHistogramOptions.vb</DependentUpon>
</EmbeddedResource>
Expand Down Expand Up @@ -2209,12 +2257,14 @@
</EmbeddedResource>
<EmbeddedResource Include="dlgRegressionSimple.fr-FR.resx">
<DependentUpon>dlgRegressionSimple.vb</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="dlgRegressionSimple.resx">
<DependentUpon>dlgRegressionSimple.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="dlgRegressionSimple.sw-KE.resx">
<DependentUpon>dlgRegressionSimple.vb</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="dlgRegularSequence.fr-FR.resx">
<DependentUpon>dlgRegularSequence.vb</DependentUpon>
Expand Down Expand Up @@ -2525,6 +2575,7 @@
</EmbeddedResource>
<EmbeddedResource Include="frmEditor.sw-KE.resx">
<DependentUpon>frmEditor.vb</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="dlgFileNew.fr-FR.resx">
<DependentUpon>dlgFileNew.vb</DependentUpon>
Expand Down Expand Up @@ -2678,6 +2729,33 @@
<EmbeddedResource Include="ucrFactor.sw-KE.resx">
<DependentUpon>ucrFactor.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ucrInput.fr-FR.resx">
<DependentUpon>ucrInput.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ucrInput.resx">
<DependentUpon>ucrInput.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ucrInput.sw-KE.resx">
<DependentUpon>ucrInput.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ucrInputComboBox.fr-FR.resx">
<DependentUpon>ucrInputComboBox.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ucrInputComboBox.resx">
<DependentUpon>ucrInputComboBox.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ucrInputComboBox.sw-KE.resx">
<DependentUpon>ucrInputComboBox.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ucrInputTextBox.fr-FR.resx">
<DependentUpon>ucrInputTextBox.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ucrInputTextBox.resx">
<DependentUpon>ucrInputTextBox.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ucrInputTextBox.sw-KE.resx">
<DependentUpon>ucrInputTextBox.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ucrMultipleInput.fr-FR.resx">
<DependentUpon>ucrMultipleInput.vb</DependentUpon>
</EmbeddedResource>
Expand Down Expand Up @@ -2807,6 +2885,7 @@
<Content Include="lib\unvell.ReoGrid.XML">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="lib\unvell.ReoScript.dll" />
<Content Include="static\ClimateObject\R\ClimateMethods\Models\readme_model.txt" />
<Content Include="static\ClimateObject\R\R_front_ends\readme_front.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down
Loading

0 comments on commit 802967a

Please sign in to comment.