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

Small improvements to the Prepare > Check Data > Duplicates dialog #7354

Merged
Show file tree
Hide file tree
Changes from 5 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
4 changes: 2 additions & 2 deletions instat/dlgDuplicates.Designer.vb

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

24 changes: 13 additions & 11 deletions instat/dlgDuplicates.vb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Public Class dlgDuplicateRows
ucrPnlDuplicates.AddRadioButton(rdoDuplicatesOnly)
ucrPnlDuplicates.AddRadioButton(rdoIndexNumberOfDuplicates)

ucrPnlDuplicates.AddToLinkedControls(ucrInputComboType, {rdoIndexNumberOfDuplicates}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True)
ucrPnlDuplicates.AddToLinkedControls(ucrInputComboType, {rdoIndexNumberOfDuplicates}, bNewLinkedHideIfParameterMissing:=True)
ucrInputComboType.SetLinkedDisplayControl(lblType)

ucrPnlDuplicates.AddFunctionNamesCondition(rdoAllDuplicateCases, "duplicated2")
Expand Down Expand Up @@ -114,9 +114,8 @@ Public Class dlgDuplicateRows
ucrInputConditions.SetDropDownStyleAsNonEditable()

ucrInputComboType.SetParameter(New RParameter("type"))
dctType.Add("Count", Chr(34) & "count" & Chr(34))
dctType.Add("Index", Chr(34) & "index" & Chr(34))
ucrInputComboType.SetRDefault(Chr(34) & "count" & Chr(34))
dctType.Add("Count", Chr(34) & "count" & Chr(34))
ucrInputComboType.SetDropDownStyleAsNonEditable()
ucrInputComboType.SetItems(dctType)

Expand Down Expand Up @@ -156,6 +155,7 @@ Public Class dlgDuplicateRows
clsStreakFunction.AddParameter("ignore", "NULL")

clsDupCountIndex.SetRCommand("duplicated_count_index")
clsDupCountIndex.AddParameter("type", Chr(34) & "index" & Chr(34))

clsGetColumnsFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_columns_from_data")

Expand All @@ -166,7 +166,7 @@ Public Class dlgDuplicateRows
clsSubsetCol.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_columns_from_data")
ucrBase.clsRsyntax.ClearCodes()
ucrBase.clsRsyntax.SetAssignTo(strAssignToName:=ucrNewColumnName.GetText, strTempDataframe:=ucrSelectorDuplicateswithVariables.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempColumn:=ucrNewColumnName.GetText)
ucrBase.clsRsyntax.SetBaseRFunction(clsDuplicated2)
ucrBase.clsRsyntax.SetBaseRFunction(clsDuplicated)
ucrBase.clsRsyntax.AddToAfterCodes(clsSummaryFunction, iPosition:=0)
End Sub

Expand Down Expand Up @@ -251,17 +251,15 @@ Public Class dlgDuplicateRows
End Sub

Private Sub SetDataFrameOrColumns()
If rdoDataFrame.Checked Then
ucrSelectorDuplicateswithVariables.SetVariablesVisible(False)
ucrSelectorDuplicateswithVariables.SetParameterIsrfunction()
If rdoSelectedVariables.Checked Then
ucrReceiverForSelectedVariables.SetMeAsReceiver()
ucrReceiverForSelectedVariables.SetParameterIsRFunction()
ucrSelectorDuplicateswithVariables.SetVariablesVisible(True)
ElseIf rdoDataFrame.Checked Then
' note that we have to run this here because the parameter x is used for both functions and all four radio buttons
clsDuplicated.AddParameter("x", clsRFunctionParameter:=ucrSelectorDuplicateswithVariables.ucrAvailableDataFrames.clsCurrDataFrame, iPosition:=0)
clsDuplicated2.AddParameter("x", clsRFunctionParameter:=ucrSelectorDuplicateswithVariables.ucrAvailableDataFrames.clsCurrDataFrame, iPosition:=0)
clsDupCountIndex.AddParameter("x", clsRFunctionParameter:=ucrSelectorDuplicateswithVariables.ucrAvailableDataFrames.clsCurrDataFrame, iPosition:=0)
ElseIf rdoSelectedVariables.Checked Then
ucrReceiverForSelectedVariables.SetMeAsReceiver()
ucrReceiverForSelectedVariables.SetParameterIsRFunction()
ucrSelectorDuplicateswithVariables.SetVariablesVisible(True)
ElseIf rdoSuccessiveValues.Checked Then
ucrReceiverForSuccessiveValues.SetMeAsReceiver()
ucrSelectorDuplicateswithVariables.SetParameterIsString()
Expand All @@ -287,6 +285,10 @@ Public Class dlgDuplicateRows
SetBaseFunction()
End Sub

Private Sub rdoSelectedVariables_CheckedChanged(sender As Object, e As EventArgs) Handles rdoSelectedVariables.CheckedChanged

End Sub

lloyddewit marked this conversation as resolved.
Show resolved Hide resolved
Private Sub AddDataFrameForGetColumnsFunction()
clsGetColumnsFunction.AddParameter(strParameterName:="data_name", strParameterValue:=Chr(34) & ucrSelectorDuplicateswithVariables.ucrAvailableDataFrames.cboAvailableDataFrames.SelectedItem & Chr(34), iPosition:=0)
End Sub
Expand Down
Binary file modified instat/translations/rInstatTranslations.db
Binary file not shown.