Skip to content

Commit

Permalink
Merge pull request #273 from africanmathsinitiative/master
Browse files Browse the repository at this point in the history
update
  • Loading branch information
shadrackkibet authored Jun 25, 2018
2 parents 26c5808 + d0f9efb commit 2b3eedb
Show file tree
Hide file tree
Showing 36 changed files with 4,699 additions and 2,126 deletions.
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,4 @@ ModelManifest.xml
/instat/static/InstatObject/R/.RData
/instat/static/InstatObject/R/examples_R6.R
/instat/static/InstatObject/R/.Rhistory
/instat/static/InstatObject/R/examples.R

# Resource files
*fr-FR.resx
*fr-FR.xlf
/instat/static/InstatObject/R/examples.R
6 changes: 3 additions & 3 deletions docs/Download.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@
<div class="col-lg-8 col-lg-offset-2 text-center">
<h2 class="section-heading">Download R-Instat</h2>
<hr class="light">
<p>If this is your first time downloading R-Instat, we recommend you <a href="https://goo.gl/YoA6h9" style="color:blue;" target="_blank">download the Complete Installer</a>. The Complete Installer is the same version of R-Instat as the Basic Installer but also includes an up to date version of R and the .NET Framework, which are required to run R-Instat.</p>
<p>If this is your first time downloading R-Instat, we recommend you <a href="https://goo.gl/Fu5Lkz" style="color:blue;" target="_blank">download the Complete Installer</a>. The Complete Installer is the same version of R-Instat as the Basic Installer but also includes an up to date version of R and the .NET Framework, which are required to run R-Instat.</p>
<p>If you do not know if you have the latest version of R, download the Complete Installer. The Basic Installer does not include R or the .NET Framework.</p>
<p>R-Instat is currently a Windows only application. However, it can be accessed on Mac or Linux through use of a Virtual Windows Machine</p>
<p><a href="https://goo.gl/YoA6h9" style="color:blue;" target="_blank">R-Instat 0.4.18 Complete Installer (.exe 529MB)</a></p>
<p><a href="https://goo.gl/8GFWB7" style="color:blue;" target="_blank">R-Instat 0.4.18 Basic Installer (.msi 387MB)</a></p>
<p><a href="https://goo.gl/Fu5Lkz" style="color:blue;" target="_blank">R-Instat 0.4.19 Complete Installer (.exe 551MB)</a></p>
<p><a href="https://goo.gl/FomJ7C" style="color:blue;" target="_blank">R-Instat 0.4.19 Basic Installer (.msi 408MB)</a></p>

<h2 class="section-heading">Installation & Documentation</h2>
<hr class="light">
Expand Down
13 changes: 8 additions & 5 deletions instat/Translations.vb
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@ Public Class Translations
Return My.Resources.ResourceManager.GetObject(tag)
End Function

Public Shared Sub translateEach(controls As Control.ControlCollection, ctrParent As Control, Optional res As ComponentModel.ComponentResourceManager = Nothing)
Public Shared Sub translateEach(controls As Control.ControlCollection, ctrParent As Control, Optional res As ComponentModel.ComponentResourceManager = Nothing, Optional CultureInfo As Globalization.CultureInfo = Nothing)
Dim mnuTmp As MenuStrip
Dim pntLocation As Point

If res Is Nothing Then
res = New ComponentModel.ComponentResourceManager(ctrParent.GetType)
End If
If CultureInfo Is Nothing Then
CultureInfo = Threading.Thread.CurrentThread.CurrentUICulture
End If
For Each aControl As Control In controls
'Checkbox text is set in the dialog so shouldn't be translated
'Input controls use Text property for display value so shouldn't be translated
Expand All @@ -35,11 +38,11 @@ Public Class Translations
mnuTmp = DirectCast(aControl, MenuStrip)
translateMenu(mnuTmp.Items, ctrParent)
ElseIf TypeOf aControl Is UserControl OrElse TypeOf aControl Is Panel OrElse TypeOf aControl Is GroupBox OrElse TypeOf aControl Is TabControl OrElse TypeOf aControl Is SplitContainer OrElse TypeOf aControl Is TreeView Then
translateEach(aControl.Controls, aControl, res)
translateEach(aControl.Controls, aControl, res, CultureInfo)
End If
If aControl.Name <> "" Then
pntLocation = aControl.Location
res.ApplyResources(aControl, aControl.Name, Threading.Thread.CurrentThread.CurrentUICulture)
res.ApplyResources(aControl, aControl.Name, CultureInfo)
aControl.Location = pntLocation
End If
End If
Expand Down Expand Up @@ -76,7 +79,7 @@ Public Class Translations
'Next formControl
End Sub

Public Shared Sub autoTranslate(ctrParent As Control)
Public Shared Sub autoTranslate(ctrParent As Control, Optional CultureInfo As Globalization.CultureInfo = Nothing)
'Dim translatedString As String

'' Attempt to translate the form's title if it has a tag
Expand All @@ -87,7 +90,7 @@ Public Class Translations
' End If
'End If
' Translate all controls in object
translateEach(ctrParent.Controls, ctrParent, New ComponentModel.ComponentResourceManager(ctrParent.GetType()))
translateEach(ctrParent.Controls, ctrParent, New ComponentModel.ComponentResourceManager(ctrParent.GetType()), CultureInfo)
End Sub

' translateMenu and translateSubMenu should not be neccessary if we can improve translateEach to accept any iterable
Expand Down
13 changes: 13 additions & 0 deletions instat/clsInstatOptions.vb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Imports RDotNet
Public bIncludeCommentDefault As Nullable(Of Boolean) 'sets the default for comments on the dialog
Public bShowProcurementMenu As Nullable(Of Boolean)
Public bShowClimaticMenu As Nullable(Of Boolean)
Public bShowOptionsByContextMenu As Nullable(Of Boolean)
Public iDigits As Nullable(Of Integer)
Public bShowSignifStars As Nullable(Of Boolean)
Public bChangeDataFrame As Nullable(Of Boolean)
Expand All @@ -53,6 +54,7 @@ Imports RDotNet
bIncludeCommentDefault = clsInstatOptionsDefaults.DEFAULTbIncludeCommentDefault
bShowClimaticMenu = clsInstatOptionsDefaults.DEFAULTbShowClimaticMenu
bShowProcurementMenu = clsInstatOptionsDefaults.DEFAULTbShowProcurementMenu
bShowOptionsByContextMenu = clsInstatOptionsDefaults.DEFAULTbShowOptionsByContextMenu
fntOutput = clsInstatOptionsDefaults.DEFAULTfntOutput
clrOutput = clsInstatOptionsDefaults.DEFAULTclrOutput
fntComment = clsInstatOptionsDefaults.DEFAULTfntComment
Expand Down Expand Up @@ -179,6 +181,12 @@ Imports RDotNet
SetIncludeCommentByDefault(clsInstatOptionsDefaults.DEFAULTbIncludeCommentDefault)
End If

If bShowOptionsByContextMenu.HasValue Then
SetShowOptionsByContextMenu(bShowOptionsByContextMenu)
Else
SetShowOptionsByContextMenu(clsInstatOptionsDefaults.DEFAULTbShowOptionsByContextMenu)
End If

If bShowProcurementMenu.HasValue Then
SetShowProcurementMenu(bShowProcurementMenu)
Else
Expand Down Expand Up @@ -380,6 +388,11 @@ Imports RDotNet
frmMain.SetShowClimaticMenu(bNewShowClimaticMenu)
End Sub

Public Sub SetShowOptionsByContextMenu(bNewShowOptionsByContextMenu As Boolean)
bShowOptionsByContextMenu = bNewShowOptionsByContextMenu
frmMain.SetShowOptionsByContextMenu(bNewShowOptionsByContextMenu)
End Sub

Public Sub SetIncludeRDefaultParameters(bNewInclude As Boolean)
bIncludeRDefaultParameters = bNewInclude
End Sub
Expand Down
1 change: 1 addition & 0 deletions instat/clsInstatOptionsDefaults.vb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Public Class clsInstatOptionsDefaults
Public Shared ReadOnly DEFAULTbIncludeCommentDefault As Boolean = True
Public Shared ReadOnly DEFAULTbShowProcurementMenu As Boolean = True
Public Shared ReadOnly DEFAULTbShowClimaticMenu As Boolean = True
Public Shared ReadOnly DEFAULTbShowOptionsByContextMenu As Boolean = True
Public Shared ReadOnly DEFAULTfntOutput As Font = New Font(FontFamily.GenericMonospace, 11, FontStyle.Regular)
Public Shared ReadOnly DEFAULTclrOutput As Color = Color.Blue
Public Shared ReadOnly DEFAULTfntComment As Font = New Font(FontFamily.GenericSansSerif, 11, FontStyle.Regular)
Expand Down
9 changes: 8 additions & 1 deletion instat/clsROperator.vb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Public Class ROperator
Public bForceIncludeOperation As Boolean = False
Public strOperation As String
Public bBrackets As Boolean = True
' This could be replaced by bBrackets once tested
Public bAllBrackets As Boolean = False
Public bSpaceAroundOperation As Boolean = True

Public Sub New(Optional strOp As String = "", Optional bBracketsTemp As Boolean = True)
Expand Down Expand Up @@ -64,7 +66,11 @@ Public Class ROperator
For Each clsParam In clsParameters.GetRange(1, clsParameters.Count - 1)
'If bIncludeOperation Then
strTemp = strTemp & strAdjustedOperation
strTemp = strTemp & clsParam.ToScript(strScript)
If bAllBrackets AndAlso (clsParam.bIsFunction OrElse clsParam.bIsOperator) Then
strTemp = strTemp & "(" & clsParam.ToScript(strScript) & ")"
Else
strTemp = strTemp & clsParam.ToScript(strScript)
End If
Next
If bToScriptAsRString Then
'TODO should also check assignment of parameters
Expand Down Expand Up @@ -145,6 +151,7 @@ Public Class ROperator
clsTempROperator.bForceIncludeOperation = bForceIncludeOperation
clsTempROperator.strOperation = strOperation
clsTempROperator.bBrackets = bBrackets
clsTempROperator.bAllBrackets = bAllBrackets
clsTempROperator.bSpaceAroundOperation = bSpaceAroundOperation

Return clsTempROperator
Expand Down
Loading

0 comments on commit 2b3eedb

Please sign in to comment.