Skip to content

Commit

Permalink
Merge pull request #70 from africanmathsinitiative/master
Browse files Browse the repository at this point in the history
Updating master
  • Loading branch information
berylwaswa authored Jan 8, 2024
2 parents a6625e7 + ddf6cf8 commit d19e700
Show file tree
Hide file tree
Showing 14 changed files with 947 additions and 556 deletions.
22 changes: 8 additions & 14 deletions instat/dlgAddLink.vb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ Public Class dlgAddLink
If bFirstLoad Then
InitialiseDialog()
bFirstLoad = False
Else
ReopenDialog()
End If
If bReset Then
SetDefaults()
Expand Down Expand Up @@ -68,8 +66,6 @@ Public Class dlgAddLink
ucrDataSelectorTo.Reset()
ucrSaveLink.Reset()

UpdateKeys()

clsAddLink.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$add_link")
clsAddLink.AddParameter("type", Chr(34) & "keyed_link" & Chr(34), iPosition:=3)

Expand All @@ -95,11 +91,7 @@ Public Class dlgAddLink
TestOKEnabled()
End Sub

Private Sub ReopenDialog()
UpdateKeys() ' currently I may open the dialog, then realise I haven't set my keys, make my key, reopen this dlg and my key doesn't show up until I reset it.
End Sub

Public Sub UpdateKeys()
Private Sub UpdateKeys()
Dim clsColumnNames As New RFunction
Dim lstKeys As GenericVector
Dim chrKeyColumns As CharacterVector
Expand All @@ -108,17 +100,19 @@ Public Class dlgAddLink
Dim bCanAutoLink As Boolean
Dim strColumnNames As String()
Dim clsGetKeys As New RFunction
Dim strDataFrameTo As String = ucrDataSelectorTo.cboAvailableDataFrames.Text
Dim strDataFrameFrom As String = ucrDataSelectorFrom.cboAvailableDataFrames.Text

If ucrDataSelectorTo.cboAvailableDataFrames.Text <> "" Then
If Not String.IsNullOrEmpty(strDataFrameFrom) AndAlso Not String.IsNullOrEmpty(strDataFrameTo) Then
lvwLinkViewBox.Items.Clear()

lblKeys.Text = ucrDataSelectorTo.cboAvailableDataFrames.SelectedItem & GetTranslation(" Keys:")
lblKeys.Text = strDataFrameTo & GetTranslation(" Keys:")
clsGetKeys.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_keys")
clsGetKeys.AddParameter("data_name", Chr(34) & ucrDataSelectorTo.cboAvailableDataFrames.SelectedItem & Chr(34))
clsGetKeys.AddParameter("data_name", Chr(34) & strDataFrameTo & Chr(34))
lstKeys = frmMain.clsRLink.RunInternalScriptGetValue(clsGetKeys.ToScript).AsList

clsColumnNames.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_column_names")
clsColumnNames.AddParameter("data_name", Chr(34) & ucrDataSelectorFrom.cboAvailableDataFrames.SelectedItem & Chr(34))
clsColumnNames.AddParameter("data_name", Chr(34) & strDataFrameFrom & Chr(34))
strColumnNames = frmMain.clsRLink.RunInternalScriptGetValue(clsColumnNames.ToScript).AsCharacter().ToArray

For i = 0 To lstKeys.Count - 1
Expand Down Expand Up @@ -169,7 +163,7 @@ Public Class dlgAddLink
End If
End Function

Private Sub ucrDataSelectorTo_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrDataSelectorTo.ControlValueChanged
Private Sub ucrDataSelectorTo_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrDataSelectorTo.ControlValueChanged, ucrDataSelectorFrom.ControlValueChanged
UpdateKeys()
End Sub

Expand Down
132 changes: 66 additions & 66 deletions instat/dlgAutoSaveRecovery.Designer.vb

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

Loading

0 comments on commit d19e700

Please sign in to comment.