Skip to content

Commit

Permalink
Merge pull request #167 from africanmathsinitiative/master
Browse files Browse the repository at this point in the history
fetching latest copy
  • Loading branch information
maxwellfundi authored Oct 31, 2016
2 parents 82e7bdc + b982cb7 commit ed3fc66
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 22 deletions.
16 changes: 14 additions & 2 deletions instat/dlgPopulationPyramids.Designer.vb

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

85 changes: 80 additions & 5 deletions instat/dlgPopulationPyramids.vb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@
' You should have received a copy of the GNU General Public License k
' along with this program. If not, see <http://www.gnu.org/licenses/>.
Imports instat.Translations
Public Class dlgPopulationPyramids
Public Class dlgPopulationPyramids
Private clsRggplotFunction As New RFunction
Private clsRgeom_bar As New RFunction
Private clsRgeom_bar2 As New RFunction
Private clsRaesFunction As New RFunction
Private clsRgeom_CoordFlip As New RFunction
Private bFirstLoad As Boolean = True
Private Sub dlgPopulationPyramids_Load(sender As Object, e As EventArgs) Handles MyBase.Load
If bFirstLoad Then
Expand All @@ -31,21 +36,91 @@ Public Class dlgPopulationPyramids

Private Sub InitialiseDialog()
ucrBase.iHelpTopicID = 455

ucrBase.clsRsyntax.SetOperation("+")
clsRggplotFunction.SetRCommand("ggplot")
clsRaesFunction.SetRCommand("aes")
clsRggplotFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesFunction)
ucrBase.clsRsyntax.SetOperatorParameter(True, clsRFunc:=clsRggplotFunction)
clsRgeom_bar.SetRCommand("geom_bar")
clsRgeom_bar.AddParameter("stat", Chr(34) & "identity" & Chr(34))
ucrBase.clsRsyntax.SetOperatorParameter(False, clsRFunc:=clsRgeom_bar)

clsRgeom_bar2.SetRCommand("geom_bar")
clsRgeom_bar2.AddParameter("stat", Chr(34) & "identity" & Chr(34))
ucrBase.clsRsyntax.AddOperatorParameter("geom_bar", clsRFunc:=clsRgeom_bar)

clsRgeom_CoordFlip.SetRCommand("coord_flip")
ucrBase.clsRsyntax.AddOperatorParameter("coord_flip", "coord_flip")

ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False

ucrXVariableReceiver.Selector = ucrPopulationPyramidselector
ucrYVariableReceiver.Selector = ucrPopulationPyramidselector
ucrSecondFactorReceiver.Selector = ucrPopulationPyramidselector

End Sub

Private Sub SetDefaults()

Private Sub SetDefaults()
ucrPopulationPyramidselector.Reset()
ucrXVariableReceiver.SetMeAsReceiver()
TestOkEnabled()
End Sub

Private Sub ReopenDialog()

End Sub
Private Sub TestOkEnabled()
If (ucrXVariableReceiver.IsEmpty AndAlso ucrYVariableReceiver.IsEmpty) Then
ucrBase.OKEnabled(False)
Else
ucrBase.OKEnabled(True)
End If

End Sub

Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset
SetDefaults()
End Sub
End Sub

Private Sub ucrPopulationPyramidselector_DataFrameChanged() Handles ucrPopulationPyramidselector.DataFrameChanged
clsRggplotFunction.AddParameter("data", clsRFunctionParameter:=ucrPopulationPyramidselector.ucrAvailableDataFrames.clsCurrDataFrame)
End Sub
Private Sub ucrXVariableReceiver_SelectionChanged(sender As Object, e As EventArgs) Handles ucrXVariableReceiver.SelectionChanged
If Not ucrXVariableReceiver.IsEmpty Then
clsRaesFunction.AddParameter("x", ucrXVariableReceiver.GetVariableNames(False))
Else
clsRaesFunction.RemoveParameterByName("x")
End If
TestOkEnabled()
End Sub

Private Sub ucrYVariableReceiver_SelectionChanged(sender As Object, e As EventArgs) Handles ucrYVariableReceiver.SelectionChanged
If Not ucrYVariableReceiver.IsEmpty Then
clsRaesFunction.AddParameter("y", ucrYVariableReceiver.GetVariableNames(False))
Else
clsRaesFunction.RemoveParameterByName("y")
End If
TestOkEnabled()
End Sub

Private Sub ucrSecondFactorReceiver_SelectionChanged(sender As Object, e As EventArgs) Handles ucrSecondFactorReceiver.SelectionChanged
If Not ucrSecondFactorReceiver.IsEmpty Then
clsRaesFunction.AddParameter("fill", ucrSecondFactorReceiver.GetVariableNames(False))
Else
clsRaesFunction.RemoveParameterByName("fill")
End If
End Sub

Private Sub ucrSavePopulationPyramid_ContentsChanged() Handles ucrSavePopulationPyramid.ContentsChanged
TestOkEnabled()
End Sub

Private Sub ucrSavePopulationPyramid_GraphNameChanged() Handles ucrSavePopulationPyramid.GraphNameChanged, ucrSavePopulationPyramid.SaveGraphCheckedChanged
If ucrSavePopulationPyramid.bSaveGraph Then
ucrBase.clsRsyntax.SetAssignTo(ucrSavePopulationPyramid.strGraphName, strTempDataframe:=ucrPopulationPyramidselector.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:=ucrSavePopulationPyramid.strGraphName)
Else
ucrBase.clsRsyntax.SetAssignTo("last_graph", strTempDataframe:=ucrPopulationPyramidselector.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph")
End If
TestOkEnabled()
End Sub
End Class

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

2 changes: 1 addition & 1 deletion instat/dlgTablePlus.vb → instat/dlgShowModel.vb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
' You should have received a copy of the GNU General Public License k
' along with this program. If not, see <http://www.gnu.org/licenses/>.
Imports instat.Translations
Public Class dlgTablePlus
Public Class dlgShowModel
Public bFirstLoad As Boolean = True
Private Sub dlgTablePlus_Load(sender As Object, e As EventArgs) Handles MyBase.Load
autoTranslate(Me)
Expand Down
6 changes: 5 additions & 1 deletion instat/frmMain.vb
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,7 @@ Public Class frmMain
End Sub

Private Sub TablesPlusToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles mnuModelProbabilityDistributionsShowModel.Click
dlgTablePlus.ShowDialog()
dlgShowModel.ShowDialog()
End Sub

Private Sub mnuDescribeUseGraph_Click(sender As Object, e As EventArgs) Handles mnuDescribeUseGraph.Click
Expand Down Expand Up @@ -1237,4 +1237,8 @@ Public Class frmMain
Private Sub mnuFileSaveAsDataAs_Click(sender As Object, e As EventArgs) Handles mnuFileSaveAsDataAs.Click
dlgSaveAs.ShowDialog()
End Sub

Private Sub mnuModelProbabilityDistributionsCompareModels_Click(sender As Object, e As EventArgs) Handles mnuModelProbabilityDistributionsCompareModels.Click
dlgCompareModels.ShowDialog()
End Sub
End Class
18 changes: 9 additions & 9 deletions instat/instat.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,10 @@
<Compile Include="dlgRugPlot.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="dlgTablePlus.Designer.vb">
<DependentUpon>dlgTablePlus.vb</DependentUpon>
<Compile Include="dlgShowModel.Designer.vb">
<DependentUpon>dlgShowModel.vb</DependentUpon>
</Compile>
<Compile Include="dlgTablePlus.vb">
<Compile Include="dlgShowModel.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="dlgTwoVariabletabulate.Designer.vb">
Expand Down Expand Up @@ -2622,14 +2622,14 @@
<EmbeddedResource Include="dlgSummaryBarOrPieChart.sw-KE.resx">
<DependentUpon>dlgSummaryBarOrPieChart.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="dlgTablePlus.fr-FR.resx">
<DependentUpon>dlgTablePlus.vb</DependentUpon>
<EmbeddedResource Include="dlgShowModel.fr-FR.resx">
<DependentUpon>dlgShowModel.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="dlgTablePlus.resx">
<DependentUpon>dlgTablePlus.vb</DependentUpon>
<EmbeddedResource Include="dlgShowModel.resx">
<DependentUpon>dlgShowModel.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="dlgTablePlus.sw-KE.resx">
<DependentUpon>dlgTablePlus.vb</DependentUpon>
<EmbeddedResource Include="dlgShowModel.sw-KE.resx">
<DependentUpon>dlgShowModel.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="dlgThemes.fr-FR.resx">
<DependentUpon>dlgThemes.vb</DependentUpon>
Expand Down

0 comments on commit ed3fc66

Please sign in to comment.