Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to the button controls and the Rsyntax #63

Merged
merged 1 commit into from
Nov 4, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion instat/MultilingualResources/instat.fr-FR.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,9 @@
<target state="needs-review-translation">122, 95</target>
</trans-unit>
<trans-unit id="$this.TrayHeight" translate="yes" extype="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" extradata="metadata" xml:space="preserve">
<source>25</source>
<source>40</source>
<target state="needs-review-translation">25</target>
<note from="MultilingualUpdate" annotates="source" priority="2">Please verify the translation’s accuracy as the source string was updated after it was translated.</note>
</trans-unit>
</group>
</body>
Expand Down
3 changes: 2 additions & 1 deletion instat/MultilingualResources/instat.sw-KE.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -885,8 +885,9 @@
<target state="needs-review-translation">122, 95</target>
</trans-unit>
<trans-unit id="$this.TrayHeight" translate="yes" extype="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" extradata="metadata" xml:space="preserve">
<source>25</source>
<source>40</source>
<target state="needs-review-translation">25</target>
<note from="MultilingualUpdate" annotates="source" priority="2">Please verify the translation’s accuracy as the source string was updated after it was translated.</note>
</trans-unit>
</group>
</body>
Expand Down
3 changes: 0 additions & 3 deletions instat/dlgBoxPlot.designer.vb

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

1 change: 1 addition & 0 deletions instat/dlgBoxPlot.vb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
Next
strScript = strScript & ")])"
frmMain.clsRInterface.RunScript(strScript)
Me.Hide()
End If

End Sub
Expand Down
6 changes: 3 additions & 3 deletions instat/dlgRegularSequence.designer.vb

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

50 changes: 29 additions & 21 deletions instat/dlgRegularSequence.vb
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,14 @@
' along with this program. If not, see <http://www.gnu.org/licenses/>.
Public Class dlgRegularSequence
Public clsRSyntax As New RSyntax
Public lstOfStrings As New List(Of String)
Private Sub dlgRegularSequence_Load(sender As Object, e As EventArgs) Handles MyBase.Load
grpSequence2.Hide()
grpRepeatSingle.Hide()
End Sub

Private Sub UcrButtons1_ClickOk(sender As Object, e As EventArgs) Handles UcrButtons1.ClickOk
Dim lstOfStrings
If rdSequence.Checked = True Then
lstOfStrings = New List(Of String)({txtFrom.Text, txtTo.Text, txtSteps.Text})
clsRSyntax.manage(lstOfStrings, "regular")
ElseIf rdSIngleValue.Checked = True
lstOfStrings = New List(Of String)({txtValue.Text, txtRepeatTimes.Text})
clsRSyntax.manage(lstOfStrings, "repeated")
ElseIf rdDates.Checked = True
lstOfStrings = New List(Of Object)({datePicker1.Value, datePicker2.Value, cboBy.SelectedItem.ToString()})
clsRSyntax.manage(lstOfStrings, "date")
End If
UcrButtons1.clsRsyntax.GetScript()
End Sub

Private Sub rdSIngleValue_Click(sender As Object, e As EventArgs) Handles rdSIngleValue.Click
Expand All @@ -52,17 +43,34 @@ Public Class dlgRegularSequence
grpSequence.Visible = True
End Sub

'Private Sub txtColName_Validating(sender As Object, e As EventArgs) Handles txtColName.Validating
' If txtColName.Text = String.Empty Then
' 'UcrButtons1.Enabled = False
' errorProvider.SetError(txtColName, "Please Enter the name for the column")
' End If
'End Sub
'Private Sub txtColName_Validated(sender As Object, e As EventArgs) Handles txtColName.Validated
' UcrButtons1.Enabled = True
'End Sub
Private Sub UcrButtons1_Load(sender As Object, e As EventArgs)
UcrButtons1.clsRsyntax.SetFunction("seq")
End Sub

Private Sub txtFrom_Validating(sender As Object, e As EventArgs) Handles txtFrom.Validating
If IsNumeric(txtFrom.Text) Then
UcrButtons1.clsRsyntax.AddParameter("from", txtFrom.Text)
Else
MsgBox("Please Enter a number!", vbCritical, "Message for Instat+")
txtFrom.Focus()
End If
End Sub

Private Sub UcrButtons1_Load(sender As Object, e As EventArgs) Handles UcrButtons1.Load
Private Sub txtTo_Validating(sender As Object, e As EventArgs) Handles txtTo.Validating
If IsNumeric(txtTo.Text) Then
UcrButtons1.clsRsyntax.AddParameter("to", txtFrom.Text)
Else
MsgBox("Please Enter a number!", vbCritical, "Message for Instat+")
txtTo.Focus()
End If
End Sub

Private Sub txtSteps_Validating(sender As Object, e As EventArgs) Handles txtSteps.Validating
If IsNumeric(txtSteps.Text) Then
UcrButtons1.clsRsyntax.AddParameter("by", txtFrom.Text)
Else
MsgBox("Please Enter a number!", vbCritical, "Message for Instat+")
txtSteps.Focus()
End If
End Sub
End Class
1 change: 1 addition & 0 deletions instat/dlgStartofRains.vb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Public Class dlgStartofRains
Private Sub dlgStartofRains_Load(sender As Object, e As EventArgs) Handles Me.Load
UpdateVisible()
autoTranslate(Me)

End Sub

Private Sub UpdateVisible()
Expand Down
2 changes: 1 addition & 1 deletion instat/frmMain.resx
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,6 @@
<value>122, 95</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>25</value>
<value>40</value>
</metadata>
</root>
2 changes: 1 addition & 1 deletion instat/rLink.vb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Public Class RInterface
If bReturnOutput Then
'strCapturedScript = "capture.output(" & strScript & ")"
'txtOutput.Text = txtOutput.Text & String.Join(vbCrLf, clsEngine.Evaluate(strCapturedScript).AsCharacter) & vbCrLf
txtOutput.Text = txtOutput.Text & vbCrLf & "> " & String.Join(vbCrLf, clsEngine.Evaluate(strScript).AsCharacter) & vbCrLf
txtOutput.Text = txtOutput.Text & "> " & String.Join(",", clsEngine.Evaluate(strScript).AsCharacter) & vbCrLf
Else
clsEngine.Evaluate(strScript)
End If
Expand Down
38 changes: 11 additions & 27 deletions instat/rSyntax.vb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
' Instat-R
' Instat+R
' Copyright (C) 2015
'
' This program is free software: you can redistribute it and/or modify
Expand All @@ -14,39 +14,23 @@
' 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/>.


Public Class RSyntax
Dim strScript As String
Public Sub manage(lstOfString As Object, type As String)
Select Case type
Case "regular"
strScript = "capture.output(seq(from = " & Convert.ToInt32(lstOfString(0)) & ", to = " & Convert.ToInt32(lstOfString(1)) & ", by = " & Convert.ToInt32(lstOfString(2)) & "))"
frmMain.clsRInterface.RunScript(strScript)
Case "repeated"
strScript = "capture.output(seq(from = " & Convert.ToInt32(lstOfString(0)) & ", to = " & Convert.ToInt32(lstOfString(0)) & ", length.out = " & Convert.ToInt32(lstOfString(1)) & "))"
frmMain.clsRInterface.RunScript(strScript)
Case "date"
strScript = "capture.output(seq(from = as.Date('" & Format(lstOfString(0), "yyyy/MM/dd") & "'), to = as.Date('" & Format(lstOfString(1), "yyyy/MM/dd") & "'), by = '" & lstOfString(2) & "'))"
frmMain.clsRInterface.RunScript(strScript)
End Select

Public Sub SetFunction(strFunctionName As String)
strScript = strFunctionName
End Sub

Public Sub graphics(strString As String, submenu As String)



Public Sub AddParameter(strParameterName As String, strParameterValue As String)
strScript = strParameterName & "=" & strParameterValue
End Sub

Public Sub statistcs(strString As String, submenu As String)



Public Sub RemoveParameter(strParameterName As String, strParameterValue As String)
strScript = strParameterName & "=" & strParameterValue
End Sub

Public Sub climatic(strString As String, submenu As String)



End Sub
Public Function GetScript() As String
Return MsgBox("Empty")
End Function

End Class
16 changes: 14 additions & 2 deletions instat/ucrButtons.Designer.vb

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

27 changes: 18 additions & 9 deletions instat/ucrButtons.vb
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@



Public Class ucrButtons
Public clsRsyntax As New RSyntax

Private Sub cmdCancel_Click(sender As Object, e As EventArgs) Handles cmdCancel.Click
'Gets the current active window
Dim ActiveWindow As Form = Form.ActiveForm
ActiveWindow.Close()
Me.ParentForm.Hide()
End Sub

Private Sub cmdReset_Click(sender As Object, e As EventArgs) Handles cmdReset.Click

EmptyTxt()
End Sub

Public Event ClickOk(sender As Object, e As EventArgs)
Public Event ClickReset(sender As Object, e As EventArgs)

Private Sub cmdOk_Click(sender As Object, e As EventArgs) Handles cmdOk.Click
RaiseEvent ClickOk(sender, e)
End Sub

Private Sub ucrButtons_Load(sender As Object, e As EventArgs) Handles MyBase.Load

Public Sub EmptyTxt()
Dim Ctrl As Control
For Each Ctrl In Me.ParentForm.Controls
If TypeOf Ctrl Is TextBox Then Ctrl.Text = ""
If TypeOf Ctrl Is GroupBox Then
Dim Ctrl1 As Control
For Each Ctrl1 In Ctrl.Controls
If TypeOf Ctrl1 Is TextBox Then
Ctrl1.Text = ""
End If
Next
End If
Next
End Sub
End Class