Skip to content

Commit

Permalink
added function option
Browse files Browse the repository at this point in the history
  • Loading branch information
N-thony committed Oct 25, 2023
1 parent 352c654 commit aa39b4c
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 15 deletions.
85 changes: 72 additions & 13 deletions instat/dlgScript.Designer.vb

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

24 changes: 22 additions & 2 deletions instat/dlgScript.vb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ Public Class dlgScript
ucrPnlGetData.AddRadioButton(rdoGetColumn)
ucrPnlGetData.AddRadioButton(rdoGetObject)

ucrPnlExample.AddRadioButton(rdoData)
ucrPnlExample.AddRadioButton(rdoFunction)

ucrPnlExample.AddToLinkedControls(ucrInputFunction, {rdoFunction}, bNewLinkedHideIfParameterMissing:=True)

'todo. this combobox can be a custom package control in future. Its also needed in dlgHelpVignettes
ucrComboGetPackage.SetParameter(New RParameter("package", 0))
ucrComboGetPackage.SetItems(GetPackages(), bAddConditions:=True)
Expand Down Expand Up @@ -147,6 +152,7 @@ Public Class dlgScript

'get controls reset
rdoGetDataFrame.Checked = True
rdoData.Checked = True
ucrComboGetPackage.Reset()
ucrComboGetPackages.Reset()
ucrDataFrameGet.Reset()
Expand Down Expand Up @@ -274,9 +280,13 @@ Public Class dlgScript
End Function

Private Sub lstCollection_SelectedIndexChanged(sender As Object, e As EventArgs) Handles lstCollection.SelectedIndexChanged
Dim strTopic = lstCollection.SelectedItems(0).SubItems(0).Text
GetExample(strTopic)
End Sub

Private Sub GetExample(strTopic As String)
Try
If lstCollection.SelectedItems.Count > 0 AndAlso TabControl1.SelectedTab Is TabPage6 Then
Dim strTopic = lstCollection.SelectedItems(0).SubItems(0).Text
If Not String.IsNullOrEmpty(strTopic) Then
clsLibraryExpFunction.AddParameter("topic", Chr(34) & strTopic & Chr(34), iPosition:=0)
If clsLibraryExpFunction IsNot Nothing Then
Dim strExampe = frmMain.clsRLink.RunInternalScriptGetValue(clsLibraryExpFunction.ToScript(), bSilent:=True).AsCharacter(0)
Expand Down Expand Up @@ -379,6 +389,16 @@ Public Class dlgScript
SetPreviewScript(clsImportNewDataFrame, strData)
End Sub

Private Sub ucrPnlExample_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlExample.ControlContentsChanged, ucrInputFunction.ControlContentsChanged
If rdoData.Checked Then
lstCollection.Visible = True
Else
lstCollection.Visible = False
Dim strTopic = ucrInputFunction.GetText
GetExample(strTopic)
End If
End Sub

Private Sub ucrComboGetPackages_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrComboGetPackages.ControlValueChanged
If strSelectedPackage <> ucrComboGetPackages.GetText() Then
strSelectedPackage = ucrComboGetPackages.GetText()
Expand Down

0 comments on commit aa39b4c

Please sign in to comment.