Skip to content

Commit

Permalink
Merge pull request #37 from africanmathsinitiative/master
Browse files Browse the repository at this point in the history
Updating from Master.
  • Loading branch information
EstherNjeriLiberatta authored Feb 15, 2022
2 parents 59d2a2e + 39b9eb6 commit 4d9d53c
Show file tree
Hide file tree
Showing 32 changed files with 2,653 additions and 232 deletions.
6 changes: 3 additions & 3 deletions docs/Download.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@
<div class="row">
<div class="col-lg-8 col-lg-offset-2 text-center">
<h2 class="section-heading">Download R-Instat</h2>
<p><strong>In response to the recent <a href=https://r4stats.com/articles/software-reviews/r-instat/ style="color:blue;" target="_blank">review of R-Instat</a> by Bob Muenchen we are preparing to release a new version of R-Instat, version 0.7.4, on Monday 31 January 2022, which will include some new features and initial improvements from the review. Come back then to download this version, or continue with the current version below.</strong></p>
<p><strong>In response to the recent <a href=https://r4stats.com/articles/software-reviews/r-instat/ style="color:blue;" target="_blank">review of R-Instat</a> by Bob Muenchen we have released a new version of R-Instat, version 0.7.4, which includes some new features and initial improvements from the review. Many thanks to Bob for reviewing R-Instat.</strong></p>
<hr class="light">
<p><a href=https://bit.ly/r-instat_0731_Installer_32bit style="color:blue;" target="_blank">R-Instat 0.7.3.1 Installer 32 Bit (.exe 732MB)</a></p>
<p><a href=https://downloads.r-instat.org/R-Instat_0.7.4_Installer_32.exe style="color:blue;" target="_blank">R-Instat 0.7.4 Installer 32 Bit (.exe 734MB)</a></p>
<p>If you know that you have a 64 bit computer, we suggest you download the 64 Bit version</p>
<a href=https://bit.ly/r-instat_0731_Installer_64bit style="color:blue;" target="_blank">R-Instat 0.7.3.1 Installer 64 Bit (.exe 732MB)</a>
<a href=https://downloads.r-instat.org/R-Instat_0.7.4_Installer_64.exe style="color:blue;" target="_blank">R-Instat 0.7.4 Installer 64 Bit (.exe 736MB)</a>
<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>

<h2 class="section-heading">Installation & Documentation</h2>
Expand Down
10 changes: 10 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-CBSCG5MSRM"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-CBSCG5MSRM');
</script>

</head>

Expand Down
27 changes: 12 additions & 15 deletions installer/Installer_Generation_Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ To generate the installer for R-Instat with R bundled inside and all the R packa
1. Update your master branch with the latest changes for the installation. Pull this to your local repo.

## 2. Update frmMain Title Bar
1. Open `frmMain.resx` in a text editor mode
2. Add the version number for the new version of R-Instat to `$this.Text` i.e.
```
<data name="$this.Text" xml:space="preserve">
<value>R-Instat 0.7.3</value>
</data>
1. Open `frmMain.Designer` in a text editor mode
2. Add the version number for the new version of R-Instat to `Me.Text` i.e.
```vb
Me.Text = "R-Instat x.y.z"
```
3. Do **not** commit this change to the repo or your local repo. The text in the development version should remain as `R-Instat`.

Expand All @@ -34,7 +32,7 @@ You will have to repeat this step for generating 32 bit and 64 bit binaries.

1. Download the R-Instat Library datasets from https://github.com/africanmathsinitiative/R-Instat-Data
2. Copy the contents of the `data` folder into `static/Library` in the Release folders for the 64 and 32 bit versions.
3. The `Library` folder should have the same subfolders and the `data` folder on GitHub https://github.com/africanmathsinitiative/R-Instat-Data/tree/main/data
3. The `Library` folder should have the same subfolders as the `data` folder on GitHub https://github.com/africanmathsinitiative/R-Instat-Data/tree/main/data

## 6. Generate Bundled R Install

Expand Down Expand Up @@ -75,7 +73,7 @@ if (length(.libPaths()) == 2) .libPaths(.libPaths()[2])
14. Install the `mmtable2` package from CRAN if it was in `packs` list. Run `devtools::install_github("ianmoran11/mmtable2")`. If prompted about updating other packages, choose "None". Confirm that it installed `packageVersion("mmtable2")`.
15. Close cmd.

## 8. Check R-Instat runs with package messages or errors.
## 8. Check R-Instat runs without package messages or errors.

1. Run `instat.exe` from the top level e.g. `C:\Users\[your name]\source\repos\R-Instat\instat\bin\x64\Release`
2. Confirm the version number in the title bar is correct and that there are no warnings/errors on opening.
Expand All @@ -89,8 +87,8 @@ if (length(.libPaths()) == 2) .libPaths(.libPaths()[2])
4. From the file menu choose open
5. Then navigate to the inno_install_script_32bit.iss script (or 64 bit version) in the same folder as this readme.
6. Change the AppId. Delete the current AppId between `{` and `}`. Leave one `{` remaining and place the cursor after it. From the top menu choose Tools > Generate GUID. Use the same AppId for the 64 and 32 bit versions so only do this once and copy from the other script the second time.
6. Update the version numbers in 4 places.
7. Change `OnlyBelowVersions` to +.1 from the new version.
6. Update the version numbers in the script. There are 4 places to do this.
7. Change `OnlyBelowVersions` to +0.1 from the new version.
8. From the top menu choose Build > Compile.
9. The installer will be in installer/Output folder

Expand All @@ -115,8 +113,7 @@ Successfully signed: C:\Users\Danny\Downloads\R-Instat_0.7.3_Installer_32.exe
2. Modify the notes as necessary.
3. Publish the (pre)-release.

## 12. Upload the installer to the website
1. Upload the installer to the central storage location (currently https://drive.google.com/drive/folders/1h5bjyRj1eEIQmWlMiactO6t2YHTs9DQb?usp=sharing)
2. Get the public link to the files
3. Create a bit.ly short link for the installer in the format https://bit.ly/r-instat_072_installer_64bit
4. Update the R-Instat website to link to the short link
## 12. Upload the installers to the website
1. Upload the installers to the central storage location (currently https://console.cloud.google.com/storage/browser/r-instat-downloads;tab=objects?forceOnBucketsSortingFiltering=false&project=glossy-attic-237012&prefix=&forceOnObjectsSortingFiltering=false)
2. Get the link to the files e.g. https://downloads.r-instat.org/R-Instat_0.7.3.1_Installer_32.exe
3. Update the R-Instat website download page to the new version and new links
12 changes: 6 additions & 6 deletions installer/inno_install_script_32bit.iss
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{176720C6-F30C-4691-A688-CAF108E41AE2}
AppId={{979E51D8-9BC4-418F-8D4D-9B44FEA869A6}
AppName=R-Instat
#define AppVerName "0.7.3.1"
#define AppVerName "0.7.4"
AppVersion={#AppVerName}
AppPublisher=African Maths Initiative
AppPublisherURL=http://r-instat.org/
Expand All @@ -23,18 +23,18 @@ SolidCompression=yes

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}";
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; OnlyBelowVersion: 0,7.4
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; OnlyBelowVersion: 0,7.5

[Files]
Source: "..\instat\bin\Release\instat.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\instat\bin\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\R-Instat 0.7.3.1"; Filename: "{app}\instat.exe"
Name: "{group}\R-Instat 0.7.4"; Filename: "{app}\instat.exe"
Name: "{group}\{cm:UninstallProgram,R-Instat}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\R-Instat 0.7.3.1"; Filename: "{app}\instat.exe"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\R-Instat 0.7.3.1"; Filename: "{app}\instat.exe"; Tasks: quicklaunchicon
Name: "{commondesktop}\R-Instat 0.7.4"; Filename: "{app}\instat.exe"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\R-Instat 0.7.4"; Filename: "{app}\instat.exe"; Tasks: quicklaunchicon

[Run]
Filename: "{app}\instat.exe"; Description: "{cm:LaunchProgram,R-Instat}"; Flags: nowait postinstall skipifsilent
10 changes: 5 additions & 5 deletions installer/inno_install_script_64bit.iss
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{176720C6-F30C-4691-A688-CAF108E41AE2}
AppId={{979E51D8-9BC4-418F-8D4D-9B44FEA869A6}
AppName=R-Instat
#define AppVerName "0.7.3.1"
#define AppVerName "0.7.4"
AppVersion={#AppVerName}
AppPublisher=African Maths Initiative
AppPublisherURL=http://r-instat.org/
Expand All @@ -32,10 +32,10 @@ Source: "..\instat\bin\x64\Release\*"; DestDir: "{app}"; Flags: ignoreversion re
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\R-Instat 0.7.3.1"; Filename: "{app}\instat.exe"
Name: "{group}\R-Instat 0.7.4"; Filename: "{app}\instat.exe"
Name: "{group}\{cm:UninstallProgram,R-Instat}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\R-Instat 0.7.3.1"; Filename: "{app}\instat.exe"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\R-Instat 0.7.3.1"; Filename: "{app}\instat.exe"; Tasks: quicklaunchicon
Name: "{commondesktop}\R-Instat 0.7.4"; Filename: "{app}\instat.exe"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\R-Instat 0.7.4"; Filename: "{app}\instat.exe"; Tasks: quicklaunchicon

[Run]
Filename: "{app}\instat.exe"; Description: "{cm:LaunchProgram,R-Instat}"; Flags: nowait postinstall skipifsilent
22 changes: 11 additions & 11 deletions instat/Model/DataFrame/clsDataFramePage.vb
Original file line number Diff line number Diff line change
Expand Up @@ -191,19 +191,19 @@ Public Class clsDataFramePage
End Function

Private Function GetDataFrameFromRCommand() As DataFrame
Dim clsRFunction As New RFunction
Dim clsGetDataFrameRFunction As New RFunction
Dim expTemp As SymbolicExpression
_hasChanged = True
clsRFunction.SetRCommand(_clsRLink.strInstatDataObject & "$get_data_frame")
clsRFunction.AddParameter("convert_to_character", "TRUE")
clsRFunction.AddParameter("include_hidden_columns", "FALSE")
clsRFunction.AddParameter("use_current_filter", "TRUE")
clsRFunction.AddParameter("max_cols", iColumnIncrements)
clsRFunction.AddParameter("max_rows", intRowIncrements)
clsRFunction.AddParameter("start_row", _iRowStart)
clsRFunction.AddParameter("start_col", _iColumnStart)
clsRFunction.AddParameter("data_name", Chr(34) & _strDataFrameName & Chr(34))
expTemp = _clsRLink.RunInternalScriptGetValue(clsRFunction.ToScript(), bSilent:=True)
clsGetDataFrameRFunction.SetRCommand(_clsRLink.strInstatDataObject & "$get_data_frame")
clsGetDataFrameRFunction.AddParameter("convert_to_character", "TRUE")
clsGetDataFrameRFunction.AddParameter("use_current_filter", "TRUE")
clsGetDataFrameRFunction.AddParameter("use_column_selection", "TRUE")
clsGetDataFrameRFunction.AddParameter("max_cols", iColumnIncrements)
clsGetDataFrameRFunction.AddParameter("max_rows", intRowIncrements)
clsGetDataFrameRFunction.AddParameter("start_row", _iRowStart)
clsGetDataFrameRFunction.AddParameter("start_col", _iColumnStart)
clsGetDataFrameRFunction.AddParameter("data_name", Chr(34) & _strDataFrameName & Chr(34))
expTemp = _clsRLink.RunInternalScriptGetValue(clsGetDataFrameRFunction.ToScript(), bSilent:=True)
If expTemp IsNot Nothing AndAlso expTemp.Type <> Internals.SymbolicExpressionType.Null Then
Return expTemp.AsDataFrame
Else
Expand Down
2 changes: 1 addition & 1 deletion instat/My Project/Application.Designer.vb

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

2 changes: 1 addition & 1 deletion instat/My Project/Application.myapp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<MySubMain>true</MySubMain>
<MainForm>frmMain</MainForm>
<SingleInstance>true</SingleInstance>
<SingleInstance>false</SingleInstance>
<ShutdownMode>0</ShutdownMode>
<EnableVisualStyles>true</EnableVisualStyles>
<AuthenticationMode>0</AuthenticationMode>
Expand Down
37 changes: 31 additions & 6 deletions instat/UserControl/ucrOutputPage.vb
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Public Class ucrOutputPage
End Sub

''' <summary>
''' Copies selected elenments to clipboard
''' Copies selected elements to clipboard
''' </summary>
Public Sub CopySelectedElementsToClipboard()
If CopyOneImageOnly() Then
Expand All @@ -138,11 +138,7 @@ Public Class ucrOutputPage
For Each element In SelectedElements
AddElementToRichTextBox(element, richText)
Next
Dim dto As New DataObject()
dto.SetText(richText.Rtf, TextDataFormat.Rtf)
dto.SetText(richText.Text, TextDataFormat.UnicodeText)
Clipboard.Clear()
Clipboard.SetDataObject(dto)
CopySelectedTextToClipBoard(richText, richText.Rtf)
End Sub

''' <summary>
Expand Down Expand Up @@ -198,6 +194,7 @@ Public Class ucrOutputPage
panel.Controls.Add(richTextBox)
panel.Controls.SetChildIndex(richTextBox, 0)
SetRichTextBoxHeight(richTextBox)
AddHandler richTextBox.KeyUp, AddressOf richTextBox_CopySelectedText
End Sub

Private Function CopyOneImageOnly() As Boolean
Expand Down Expand Up @@ -258,6 +255,7 @@ Public Class ucrOutputPage
panel.Controls.Add(richTextBox)
panel.Controls.SetChildIndex(richTextBox, 0)
SetRichTextBoxHeight(richTextBox)
AddHandler richTextBox.KeyUp, AddressOf richTextBox_CopySelectedText
End Sub

Private Sub AddNewImageOutput(outputElement As clsOutputElement)
Expand All @@ -283,6 +281,33 @@ Public Class ucrOutputPage
RaiseEvent RefreshContextButtons()
End Sub

Private Sub richTextBox_CopySelectedText(sender As Object, e As KeyEventArgs)
If e.KeyData = Keys.Control + Keys.C Then
Try
Dim richText As RichTextBox = CType(sender, RichTextBox)
Dim richSelectedText As New RichTextBox
richSelectedText.AppendText(richText.SelectedText)
CopySelectedTextToClipBoard(richSelectedText, richText.SelectedRtf)
Catch ex As Exception
MsgBox(ex.Message)
End Try
End If
End Sub

Private Sub CopySelectedTextToClipBoard(richText As RichTextBox, richTextFormat As String)
Dim strClip As String = String.Empty
Dim dto As New DataObject()

For Each Line As String In richText.Lines
strClip &= Line & Environment.NewLine
Next

dto.SetText(richTextFormat, TextDataFormat.Rtf)
dto.SetText(strClip, TextDataFormat.UnicodeText)
Clipboard.Clear()
Clipboard.SetDataObject(dto)
End Sub

Private Sub Panel_Resize(sender As Object, e As EventArgs)
Dim panel As Panel = CType(sender, Panel)
For Each control In panel.Controls
Expand Down
1 change: 1 addition & 0 deletions instat/UserControls/DataGrid/ReoGrid/ucrReoGrid.vb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Public MustInherit Class ucrReoGrid
fillWorkSheet.SelectionForwardDirection = unvell.ReoGrid.SelectionForwardDirection.Down
fillWorkSheet.SetSettings(unvell.ReoGrid.WorksheetSettings.Edit_DragSelectionToMoveCells, False)
fillWorkSheet.SetSettings(unvell.ReoGrid.WorksheetSettings.Edit_DragSelectionToFillSerial, False)
fillWorkSheet.SetSettings(unvell.ReoGrid.WorksheetSettings.View_AllowCellTextOverflow, False)
AttachEventsToWorksheet(fillWorkSheet)
Return New clsWorksheetAdapter(fillWorkSheet)
End Function
Expand Down
2 changes: 1 addition & 1 deletion instat/clsRSyntax.vb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Public Class RSyntax
''' <summary> The R functions/operators/commands that should be run before the base R code. </summary>
Public lstBeforeCodes As New List(Of RCodeStructure)

''' <summary> TThe R functions/operators/commands that should be run before the base R code. </summary>
''' <summary> The R functions/operators/commands that should be run after the base R code. </summary>
Public lstAfterCodes As New List(Of RCodeStructure)


Expand Down
13 changes: 8 additions & 5 deletions instat/clsRecentFiles.vb
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,12 @@ Public Class clsRecentFiles
'read file contents
Dim arrStrPaths() As String = File.ReadAllLines(strRecentFilesPath)
For Each strPath As String In arrStrPaths
If Not String.IsNullOrEmpty(strPath) Then
lstRecentOpenedFiles.Add(strPath.Replace("\", "/"))
If String.IsNullOrEmpty(strPath) Then
Continue For
End If
Dim strNewPath As String = strPath.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)
If Not lstRecentOpenedFiles.Contains(strNewPath) Then
lstRecentOpenedFiles.Add(strNewPath)
End If
Next
'display the recently opened files if there are any items to display in the file
Expand Down Expand Up @@ -106,10 +110,10 @@ Public Class clsRecentFiles
''' </summary>
''' <param name="strFilePath">file path to add to menu items</param>
Public Sub addToMenu(strFilePath As String)
'remove file if it exists(helps with making sure displayed file names are rearranged)
strFilePath = strFilePath.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)
'remove file if already in lists(helps with making sure displayed file names are rearranged)
lstRecentOpenedFiles.Remove(strFilePath)
'add to recent opened files list..
strFilePath = strFilePath.Replace("\", "/")
lstRecentOpenedFiles.Add(strFilePath)
'make sure there are only ever 30 items...
'todo. add this to the general options on the number of recently files to show
Expand Down Expand Up @@ -187,7 +191,6 @@ Public Class clsRecentFiles
End If

Dim strFilePathTmp As String = strFilePath.Replace("MRU:", "")
strFilePathTmp = strFilePathTmp.Replace("\", "/")
If File.Exists(strFilePathTmp) Then
dlgImportDataset.strFileToOpenOn = strFilePathTmp
dlgImportDataset.ShowDialog()
Expand Down
Loading

0 comments on commit 4d9d53c

Please sign in to comment.