Skip to content

Commit

Permalink
Merge pull request #31 from africanmathsinitiative/master
Browse files Browse the repository at this point in the history
updating master
  • Loading branch information
shadrackkibet authored May 6, 2017
2 parents 830e594 + 3ac59a3 commit 25c89a0
Show file tree
Hide file tree
Showing 8 changed files with 436 additions and 114 deletions.
127 changes: 124 additions & 3 deletions instat/dlgExportRWorkspace.Designer.vb

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

68 changes: 64 additions & 4 deletions instat/dlgExportRWorkspace.vb
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,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 System.IO
Imports instat.Translations
Public Class dlgExportRWorkspace
Private bFirstLoad As Boolean = True
Private bReset As Boolean = True
Private clsDefaultFunction As New RFunction
Private Sub dlgExportRWorkspace_Load(sender As Object, e As EventArgs) Handles MyBase.Load
autoTranslate(Me)
If bFirstLoad Then
Expand All @@ -32,20 +33,79 @@ Public Class dlgExportRWorkspace
TestOkEnabled()
End Sub

Private Sub SetRCodeForControls(bReset As Boolean)
Private Sub InitialiseDialog()
ucrInputExportFile.IsReadOnly = True
ucrSelectorForDataFrames.SetItemType("dataframe")

End Sub
ucrReceiverMultiple.SetParameter(New RParameter("data_names", 0))
ucrReceiverMultiple.SetParameterIsString()
ucrReceiverMultiple.Selector = ucrSelectorForDataFrames

Private Sub InitialiseDialog()
ucrInputExportFile.SetParameter(New RParameter("file", 1))

ucrChkMetadata.SetParameter(New RParameter("include_metadata", 2))
ucrChkMetadata.SetText("Metadata")
ucrChkMetadata.SetValuesCheckedAndUnchecked("TRUE", "FALSE")
ucrChkMetadata.SetRDefault("FALSE")

ucrChkGraphs.SetParameter(New RParameter("include_graphs", 3))
ucrChkGraphs.SetText("Graphs")
ucrChkGraphs.SetValuesCheckedAndUnchecked("TRUE", "FALSE")
ucrChkGraphs.SetRDefault("FALSE")

ucrChkModels.SetParameter(New RParameter("include_models", 4))
ucrChkModels.SetText("Models")
ucrChkModels.SetValuesCheckedAndUnchecked("TRUE", "FALSE")
ucrChkModels.SetRDefault("FALSE")
End Sub

Private Sub SetDefaults()
clsDefaultFunction = New RFunction

ucrInputExportFile.SetName("")
ucrSelectorForDataFrames.Reset()
ucrReceiverMultiple.SetMeAsReceiver()

clsDefaultFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$export_workspace")
ucrBase.clsRsyntax.SetBaseRFunction(clsDefaultFunction)
End Sub

Private Sub SetRCodeForControls(bReset As Boolean)
SetRCode(Me, ucrBase.clsRsyntax.clsBaseFunction, bReset)
End Sub

Private Sub TestOkEnabled()
If Not ucrInputExportFile.IsEmpty AndAlso Not ucrReceiverMultiple.IsEmpty Then
ucrBase.OKEnabled(True)
Else
ucrBase.OKEnabled(False)
End If
End Sub

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

Private Sub cmdBrowse_Click(sender As Object, e As EventArgs) Handles cmdBrowse.Click
Dim dlgSave As New SaveFileDialog

dlgSave.Title = "Export file dialog"
dlgSave.InitialDirectory = frmMain.clsInstatOptions.strWorkingDirectory
dlgSave.Filter = "Saved r objects (*.RData)|*.RData"
If dlgSave.ShowDialog = DialogResult.OK Then
If dlgSave.FileName <> "" Then
ucrInputExportFile.SetName(Path.GetFullPath(dlgSave.FileName).ToString.Replace("\", "/"))
End If
End If
End Sub

Private Sub ucrInputExportFile_Click(sender As Object, e As EventArgs) Handles ucrInputExportFile.Click
cmdBrowse_Click(sender, e)
End Sub

Private Sub ucrInputExportFile_ControlContentsChanged(ucrchangedControl As ucrCore) Handles ucrInputExportFile.ControlContentsChanged, ucrReceiverMultiple.ControlContentsChanged
TestOkEnabled()
End Sub
End Class
Loading

0 comments on commit 25c89a0

Please sign in to comment.