Skip to content

Commit

Permalink
Merge pull request #427 from Patowhiz/Widedatasets
Browse files Browse the repository at this point in the history
updated branch with changes from the master
  • Loading branch information
conlooptechnologies authored Sep 6, 2023
2 parents 0fddb86 + b4e1e72 commit 6ebef7a
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 40 deletions.
1 change: 0 additions & 1 deletion instat/dlgDeleteDataFrames.vb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ Public Class dlgDeleteDataFrames
End Sub

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

Expand Down
1 change: 1 addition & 0 deletions instat/dlgFromLibrary.vb
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ Public Class dlgFromLibrary
Dim strPackageName As String = ucrInputPackages.cboInput.SelectedItem
Dim strTopic As String = lstCollection.SelectedItems(0).Text
If strPackageName <> "" AndAlso strTopic <> "" Then
Dim frmMaximiseOutput As New frmMaximiseOutput
frmMaximiseOutput.Show(strFileName:=clsFileUrlUtilities.GetHelpFileURL(strPackageName:=strPackageName, strTopic:=strTopic), bReplace:=False)
End If
End Sub
Expand Down
1 change: 1 addition & 0 deletions instat/dlgHelpVignettes.vb
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ Public Class dlgHelpVignettes
If strPackageName <> "" Then
Dim strURL = clsFileUrlUtilities.GetHelpFileURL(strPackageName:=strPackageName, strTopic:=strTopic,
bVignette:=rdoVignettes.Checked)
Dim frmMaximiseOutput As New frmMaximiseOutput
frmMaximiseOutput.Show(strFileName:=strURL, bReplace:=False)
End If
End Sub
Expand Down
1 change: 0 additions & 1 deletion instat/dlgThreeVariablePivotTable.vb
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@ Public Class dlgThreeVariablePivotTable

ucrReceiverAdditionalRowFactor.SetIncludedDataTypes({"numeric", "Date", "logical"})
ucrReceiverAdditionalRowFactor.bAutoFill = False
ucrChkNumericVariable.Checked = False
Case PivotMode.Climatic
Dim strMonthCol As String
Dim strDataFrame As String
Expand Down
2 changes: 1 addition & 1 deletion instat/dlgTransposeColumns.vb
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Public Class dlgTransposeColumns
ClearSelector()
If Not ucrReceiverColumnsToTranspose.IsEmpty Then
'-------------------------
'todo. this cod block below requires more refactoring.
'todo. this code block below requires more refactoring.
'it should use the selector functions for adding items instead of accessing the selector controls
Dim arrItems As String() = ucrReceiverColumnsToTranspose.GetVariableNamesList(False)
If arrItems.Count > 1 Then
Expand Down
10 changes: 5 additions & 5 deletions instat/ucrColumnMetadata.vb
Original file line number Diff line number Diff line change
Expand Up @@ -174,19 +174,19 @@ Public Class ucrColumnMetadata
Dim clsDeleteLabelsFunction As New RFunction

If strColumnName = strLabelsLabel Then
If MsgBox("This will delete the selected label(s) And Replace Then With (NA)." &
If MsgBox("This will delete the selected label(s) and replace them with (NA)." &
Environment.NewLine & "Continue?",
MessageBoxButtons.YesNo, "Delete Labels") = DialogResult.Yes Then

clsDeleteLabelsFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$append_to_variables_metadata")
clsDeleteLabelsFunction.AddParameter("data_name", Chr(34) & _grid.CurrentWorksheet.Name & Chr(34), iPosition:=0)
clsDeleteLabelsFunction.AddParameter("col_names", frmMain.clsRLink.GetListAsRString(_grid.GetSelectedColumns), iPosition:=1)
clsDeleteLabelsFunction.AddParameter("Property", Chr(34) & "labels" & Chr(34), iPosition:=2)
clsDeleteLabelsFunction.AddParameter("property", Chr(34) & "labels" & Chr(34), iPosition:=2)
clsDeleteLabelsFunction.AddParameter("new_val", Chr(34) & Chr(34), iPosition:=3)
frmMain.clsRLink.RunScript(clsDeleteLabelsFunction.ToScript())
End If
Else
MsgBox("Deleting cells Is currently disabled. This feature will be included In future versions." & Environment.NewLine &
MsgBox("Deleting cells is currently disabled. This feature will be included in future versions." & Environment.NewLine &
"To remove a cell's value, replace the value with NA.", MsgBoxStyle.Information, "Cannot delete cells.")
End If
End Sub
Expand Down Expand Up @@ -350,7 +350,7 @@ Public Class ucrColumnMetadata
Return selectedDataframeColumns
End Function

Private Function IsOnlyOneDataframeColumnSeleted() As Boolean
Private Function IsOnlyOneDataframeColumnSelected() As Boolean
Return _grid.GetSelectedRows().Count = 1
End Function

Expand Down Expand Up @@ -413,7 +413,7 @@ Public Class ucrColumnMetadata
End Sub

Private Sub columnContextMenuStrip_Opening(sender As Object, e As CancelEventArgs) Handles columnContextMenuStrip.Opening
If IsOnlyOneDataframeColumnSeleted() Then
If IsOnlyOneDataframeColumnSelected() Then
mnuLevelsLabels.Enabled = IsFirstSelectedDataFrameColumnAFactor()
mnuDeleteCol.Text = GetTranslation("Delete Column")
mnuInsertColsBefore.Text = GetTranslation("Insert 1 Column Before")
Expand Down
2 changes: 1 addition & 1 deletion instat/ucrReceiver.vb
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Public Class ucrReceiver
Return New RFunction
End Function

Public Overridable Function GetVariableNames(Optional bWithQuotes As Boolean = True, Optional strQuotes As String = Chr(34)) As String
Public Overridable Function GetVariableNames(Optional bWithQuotes As Boolean = True) As String
Return ""
End Function

Expand Down
8 changes: 2 additions & 6 deletions instat/ucrReceiverExpression.vb
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,8 @@ Public Class ucrReceiverExpression
OnSelectionChanged()
End Sub

Public Overrides Function GetVariableNames(Optional bWithQuotes As Boolean = True, Optional strQuotes As String = Chr(34)) As String
If bWithQuotes Then
Return Chr(34) & cboExpression.Text & Chr(34)
Else
Return cboExpression.Text
End If
Public Overrides Function GetVariableNames(Optional bWithQuotes As Boolean = True) As String
Return If(bWithQuotes, Chr(34) & cboExpression.Text & Chr(34), cboExpression.Text)
End Function

Private Sub cboExpression_GotFocus(sender As Object, e As EventArgs) Handles cboExpression.GotFocus
Expand Down
2 changes: 1 addition & 1 deletion instat/ucrReceiverMultiple.vb
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ Public Class ucrReceiverMultiple
Return lstColumnFunctions
End Function

Public Overrides Function GetVariableNames(Optional bWithQuotes As Boolean = True, Optional strQuotes As String = Chr(34)) As String
Public Overrides Function GetVariableNames(Optional bWithQuotes As Boolean = True) As String
Dim strTempBuilder As New Text.StringBuilder
Dim strQuoteHolder As String = If(bWithQuotes, Chr(34), "")

Expand Down
10 changes: 7 additions & 3 deletions instat/ucrReceiverSingle.vb
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,16 @@ Public Class ucrReceiverSingle
End If
End Function

Public Overrides Function GetVariableNames(Optional bWithQuotes As Boolean = True, Optional strQuotes As String = Chr(34)) As String
Return If(bWithQuotes, strQuotes & txtReceiverSingle.Text & strQuotes, txtReceiverSingle.Text)
Public Overrides Function GetVariableNames(Optional bWithQuotes As Boolean = True) As String
Return If(bWithQuotes, Chr(34) & txtReceiverSingle.Text & Chr(34), txtReceiverSingle.Text)
End Function

Public Overrides Function GetVariableNameslist(Optional bWithQuotes As Boolean = True, Optional strQuotes As String = Chr(34)) As String()
Return {GetVariableNames(bWithQuotes:=bWithQuotes, strQuotes:=strQuotes)}
If bWithQuotes Then
Return {strQuotes & txtReceiverSingle.Text & strQuotes}
Else
Return {txtReceiverSingle.Text}
End If
End Function

Public Function GetDataName() As String
Expand Down
20 changes: 0 additions & 20 deletions instat/ucrSelector.vb
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ Public Class ucrSelector

Public Overridable Sub Reset()
RaiseEvent ResetReceivers()
'lstVariablesInReceivers.Clear()
LoadList()
End Sub

Expand Down Expand Up @@ -317,26 +316,7 @@ Public Class ucrSelector
ucrLinkedSelector = ucrNewLinkedSelector
End Sub

'Public lstVariablesInReceivers As List(Of Tuple(Of String, String))
'Public Sub AddToVariablesList(strVariable As String, Optional strDataFrame As String = "")
' If strDataFrame = "" OrElse strDataFrame = strCurrentDataFrame Then
' lstVariablesInReceivers.Add(New Tuple(Of String, String)(strVariable, strDataFrame))
' If ucrLinkedSelector IsNot Nothing Then
' ucrLinkedSelector.AddToVariablesList(strVariable, strCurrentDataFrame)
' End If
' End If
'End Sub

'Public Sub RemoveFromVariablesList(strVariable As String, Optional strDataFrame As String = "")
' For i As Integer = lstVariablesInReceivers.Count - 1 To 0 Step -1
' If lstVariablesInReceivers(i).Item1 = strVariable AndAlso (strDataFrame = "" OrElse lstVariablesInReceivers(i).Item2 = strDataFrame) Then
' lstVariablesInReceivers.RemoveAt(i)
' End If
' Next
' If ucrLinkedSelector IsNot Nothing Then
' ucrLinkedSelector.RemoveFromVariablesList(strVariable, strCurrentDataFrame)
' End If
'End Sub

Public Sub AddIncludedMetadataProperty(strProperty As String, strInclude As String())
Dim iIncludeIndex As Integer
Expand Down
2 changes: 1 addition & 1 deletion instat/ucrVariablesAsFactor.vb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Public Class ucrVariablesAsFactor
OnSelectionChanged()
End Sub

Public Overrides Function GetVariableNames(Optional bWithQuotes As Boolean = True, Optional strQuotes As String = Chr(34)) As String
Public Overrides Function GetVariableNames(Optional bWithQuotes As Boolean = True) As String
'This sub provides the name of the variable that should be used by external components that want to access the "content" of this receiver. If it is in single mode, this is simply providing the name of the variable in use.
'However in multiple mode, a New variable will be created using the "stack" And "measure.vars" explained in SetReceiverStatus.
Dim strVariables As String = ""
Expand Down

0 comments on commit 6ebef7a

Please sign in to comment.