Skip to content

Commit

Permalink
Merge pull request #58 from africanmathsinitiative/master
Browse files Browse the repository at this point in the history
Updating Master
  • Loading branch information
Muthenya authored May 10, 2018
2 parents 20f7301 + a41daf7 commit aa00193
Show file tree
Hide file tree
Showing 9 changed files with 948 additions and 404 deletions.
29 changes: 17 additions & 12 deletions instat/clsRecentFiles.vb
Original file line number Diff line number Diff line change
Expand Up @@ -147,24 +147,29 @@ Public Class clsRecentFiles
AddHandler clsItem.Click, AddressOf mnuFile_Click
'insert into the dropdownitems
mnuTbShowLast10.DropDownItems.Insert(mnuTbShowLast10.DropDownItems.Count - 1, clsItem)
Next

'displays items (_in reverse order) for recent files
For iCounter As Integer = strListMRU.Count - 1 To 0 Step -1
Dim sPath As String = strListMRU(iCounter)
Next

'displays items (_in reverse order) for recent files
Dim strPath As String
Dim strFileName As String
For iCounter As Integer = strListMRU.Count - 1 To 0 Step -1
strPath = strListMRU(iCounter)
strFileName = Path.GetFileName(strPath)
' create new ToolStripItem, displaying the name of the file...
Dim clsItem As New ToolStripMenuItem(Path.GetFileName(sPath))
Dim clsItemIcon As New ToolStripMenuItem(Path.GetFileName(sPath))
' set the tag - identifies the ToolStripItem as an MRU item and
' contains the full path so it can be opened later...
clsItem.Tag = "MRU:" & sPath
clsItemIcon.Tag = "MRU:" & sPath
Dim clsItem As New ToolStripMenuItem(strFileName)
Dim clsItemIcon As New ToolStripMenuItem(strFileName)
clsItem.ToolTipText = strPath
clsItemIcon.ToolTipText = strPath
' set the tag - identifies the ToolStripItem as an MRU item and
' contains the full path so it can be opened later...
clsItem.Tag = "MRU:" & strPath
clsItemIcon.Tag = "MRU:" & strPath
' hook into the click event handler so we can open the file later...
AddHandler clsItem.Click, AddressOf mnuFileMRU_Click
AddHandler clsItemIcon.Click, AddressOf mnuFileMRU_Click
' insert into DropDownItems list...
mnuFile.DropDownItems.Insert(mnuFile.DropDownItems.Count - 1, clsItem)
mnuFileIcon.DropDownItems.Insert(mnuFileIcon.DropDownItems.Count, clsItemIcon)
mnuFileIcon.DropDownItems.Insert(mnuFileIcon.DropDownItems.Count, clsItemIcon)
Next

' show separator
Expand Down
36 changes: 33 additions & 3 deletions instat/dlgBoxPlot.vb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
' You should have received a copy of the GNU General Public License
' along with this program. If not, see <http://www.gnu.org/licenses/>.


Imports instat.Translations
Public Class dlgBoxplot
Private clsRggplotFunction As New RFunction
Expand Down Expand Up @@ -50,7 +49,9 @@ Public Class dlgBoxplot
bReset = False
autoTranslate(Me)
TestOkEnabled()

SetOptionsButtonstext()

End Sub

Private Sub InitialiseDialog()
Expand Down Expand Up @@ -116,7 +117,6 @@ Public Class dlgBoxplot
ucrSaveBoxplot.SetDataFrameSelector(ucrSelectorBoxPlot.ucrAvailableDataFrames)
ucrSaveBoxplot.SetAssignToIfUncheckedValue("last_graph")


'this control exists but diabled for now
ucrChkSwapParameters.SetText("swap Parameters")
'ucrSecondFactorReceiver.AddToLinkedControls(ucrChkSwapParameters, {ucrSecondFactorReceiver.IsEmpty = False}, bNewLinkedHideIfParameterMissing:=True)
Expand Down Expand Up @@ -153,7 +153,8 @@ Public Class dlgBoxplot

clsRgeomPlotFunction.SetPackageName("ggplot2")
clsRgeomPlotFunction.SetRCommand("geom_boxplot")
clsRgeomPlotFunction.AddParameter("varwidth", "FALSE")
clsRgeomPlotFunction.AddParameter("varwidth", "FALSE", iPosition:=0)
clsRgeomPlotFunction.AddParameter("outlier.colour", Chr(34) & "red" & Chr(34), iPosition:=1)

'clsLocalRaesFunction.SetPackageName("ggplot2")
'clsLocalRaesFunction.SetRCommand("aes")
Expand Down Expand Up @@ -257,16 +258,32 @@ Public Class dlgBoxplot
'Sets geom function, fill and colour aesthetics and ucrsave prefix
If rdoBoxplot.Checked Then
clsRgeomPlotFunction.SetRCommand("geom_boxplot")
clsRgeomPlotFunction.AddParameter("outlier.colour", Chr(34) & "red" & Chr(34), iPosition:=1)
clsRgeomPlotFunction.RemoveParameterByName("Height")
clsRgeomPlotFunction.RemoveParameterByName("width")
ucrSaveBoxplot.SetPrefix("boxplot")
ucrSecondFactorReceiver.ChangeParameterName("fill")

SetOptionsButtonText()

ElseIf rdoJitter.Checked Then
clsRgeomPlotFunction.SetRCommand("geom_jitter")
clsRgeomPlotFunction.RemoveParameterByName("outlier.colour")
clsRgeomPlotFunction.AddParameter("Height", 0.2, iPosition:=1)
clsRgeomPlotFunction.AddParameter("width", 0.0, iPosition:=2)
ucrSaveBoxplot.SetPrefix("jitter")
ucrSecondFactorReceiver.ChangeParameterName("colour")

SetOptionsButtonText()

Else
clsRgeomPlotFunction.SetRCommand("geom_violin")
clsRgeomPlotFunction.RemoveParameterByName("outlier.colour")
clsRgeomPlotFunction.RemoveParameterByName("Height")
clsRgeomPlotFunction.RemoveParameterByName("width")
ucrSaveBoxplot.SetPrefix("violin")
ucrSecondFactorReceiver.ChangeParameterName("fill")

End If
SetOptionsButtonstext()
End Sub
Expand All @@ -278,9 +295,22 @@ Public Class dlgBoxplot
cmdBoxPlotOptions.Text = "Jitter Options"
Else
cmdBoxPlotOptions.Text = "Violin Options"

SetOptionsButtonText()

End If
End Sub


Private Sub SetOptionsButtonText()
If rdoBoxplot.Checked Then
cmdBoxPlotOptions.Text = "Boxplot Options"
ElseIf rdoJitter.Checked Then
cmdBoxPlotOptions.Text = "Jitter Options"
Else
cmdBoxPlotOptions.Text = "Violin Options"
End If
End Sub
Private Sub TempOptionsDisabledInMultipleVariablesCase()
If ucrVariablesAsFactorForBoxplot.bSingleVariable Then
cmdBoxPlotOptions.Enabled = True
Expand Down
1 change: 1 addition & 0 deletions instat/dlgClimaticSummary.vb
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ Public Class dlgClimaticSummary
clsDayFilterCalc.AddParameter("calculated_from", clsRFunctionParameter:=clsDayFilterCalcFromConvert, iPosition:=2)

clsFromAndToConditionOperator.SetOperation("&")
clsFromAndToConditionOperator.bBrackets = False
clsFromAndToConditionOperator.AddParameter("from", clsROperatorParameter:=clsFromConditionOperator, iPosition:=0)
clsFromConditionOperator.SetOperation(">=") ' doy = DOYreceiver in position 0. This is always the case
clsFromConditionOperator.AddParameter("from", 1, iPosition:=1)
Expand Down
26 changes: 24 additions & 2 deletions instat/dlgHistogram.vb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ Public Class dlgHistogram

Private Sub dlgHistogram_Load(sender As Object, e As EventArgs) Handles MyBase.Load
If bFirstLoad Then
'setdefaults
InitialiseDialog()
bFirstLoad = False
End If
Expand All @@ -49,7 +48,8 @@ Public Class dlgHistogram
bReset = False
autoTranslate(Me)
TestOkEnabled()
SetOptionsButtonstext()

SetOptionsButtonstext()
End Sub

Private Sub InitialiseDialog()
Expand Down Expand Up @@ -183,19 +183,26 @@ Public Class dlgHistogram
If rdoHistogram.Checked Then
clsRgeomPlotFunction.SetRCommand("geom_histogram")
ucrFactorReceiver.ChangeParameterName("fill")


If Not ucrSaveHist.bUserTyped Then
ucrSaveHist.SetPrefix("histogram")
End If
ElseIf rdoDensity.Checked Then
clsRgeomPlotFunction.SetRCommand("geom_density")
ucrFactorReceiver.ChangeParameterName("colour")

SetOptionsButtonText()

If Not ucrSaveHist.bUserTyped Then
ucrSaveHist.SetPrefix("density")
End If
ElseIf rdoFrequencyPolygon.Checked Then
clsRgeomPlotFunction.SetRCommand("geom_freqpoly")
ucrFactorReceiver.ChangeParameterName("colour")



If Not ucrSaveHist.bUserTyped Then
ucrSaveHist.SetPrefix("frequency_polygon")
End If
Expand All @@ -218,6 +225,21 @@ Public Class dlgHistogram
End If
End Sub

Private Sub SetOptionsButtonText()
If rdoHistogram.Checked Then
cmdHistogramOptions.Text = "Histogram Options"
cmdHistogramOptions.Size = New Size(120, 25)
ElseIf rdoDensity.Checked Then
cmdHistogramOptions.Size = New Size(120, 25)
cmdHistogramOptions.Text = "Density Options"

ElseIf rdoFrequencyPolygon.Checked Then
cmdHistogramOptions.Size = New Size(160, 25)
cmdHistogramOptions.Text = "Frequency Polygon Options"
End If
End Sub


Private Sub TempOptionsDisabledInMultipleVariablesCase()
If ucrVariablesAsFactorforHist.bSingleVariable Then
cmdHistogramOptions.Enabled = True
Expand Down
127 changes: 117 additions & 10 deletions instat/sdgOpenNetCDF.Designer.vb

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

Loading

0 comments on commit aa00193

Please sign in to comment.