Skip to content

Commit

Permalink
Merge pull request IDEMSInternational#9278 from Fidel365/namedialog
Browse files Browse the repository at this point in the history
Corrections to the rename dialog
  • Loading branch information
N-thony authored Nov 28, 2024
2 parents 0d1280d + 2afce42 commit fb25373
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions instat/dlgName.vb
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Public Class dlgName
ucrPnlOptions.AddToLinkedControls({ucrPnlCase, ucrPnlSelectData}, {rdoRenameWith}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True)
ucrPnlCase.AddToLinkedControls(ucrInputCase, {rdoMakeCleanNames}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="Snake")
ucrPnlCase.AddToLinkedControls(ucrNudAbbreviate, {rdoAbbreviate}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="8")
ucrPnlCase.AddToLinkedControls(ucrInputReplace, {rdoReplace}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True)
ucrPnlCase.AddToLinkedControls(ucrInputReplace, {rdoReplace}, bNewLinkedHideIfParameterMissing:=True)
ucrPnlCase.AddToLinkedControls(ucrInputBy, {rdoReplace}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="")
ucrPnlCase.AddToLinkedControls(ucrInputEdit, {rdoReplace}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="Starts With")
ucrPnlSelectData.AddToLinkedControls(ucrReceiverColumns, {rdoSelectedColumn}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True)
Expand Down Expand Up @@ -660,21 +660,23 @@ Public Class dlgName

Private Sub RemovePattern()
If rdoWholeDataFrame.Checked Then
If rdoReplace.Checked Then
If rdoRenameWith.Checked AndAlso rdoReplace.Checked Then
clsDefaultRFunction.AddParameter("type", Chr(34) & "rename_with" & Chr(34), iPosition:=1)
clsDefaultRFunction.AddParameter(".fn", "stringr::str_replace", iPosition:=2)
clsDefaultRFunction.AddParameter("pattern", Chr(34) & ucrInputReplace.GetText() & Chr(34), iPosition:=4)
clsDefaultRFunction.RemoveParameterByName("label")
clsDefaultRFunction.AddParameter("replacement", Chr(34) & ucrInputBy.GetText() & Chr(34), iPosition:=5)
If ucrInputEdit.GetText = "Starts With" Then
clsDefaultRFunction.AddParameter(".cols", clsRFunctionParameter:=clsStartwithFunction, iPosition:=3)
ElseIf ucrInputEdit.GetText = "Ends With" Then
clsDefaultRFunction.AddParameter(".cols", clsRFunctionParameter:=clsEndswithFunction, iPosition:=3)
ElseIf ucrInputEdit.GetText = "Matches" Then
clsDefaultRFunction.AddParameter(".cols", clsRFunctionParameter:=clsMatchesFunction, iPosition:=3)
ElseIf ucrInputEdit.GetText = "Contains" Then
clsDefaultRFunction.AddParameter(".cols", clsRFunctionParameter:=clsContainsFunction, iPosition:=3)
End If

Select Case ucrInputEdit.GetText
Case "Starts With"
clsDefaultRFunction.AddParameter(".cols", clsRFunctionParameter:=clsStartwithFunction, iPosition:=3)
Case "Ends With"
clsDefaultRFunction.AddParameter(".cols", clsRFunctionParameter:=clsEndswithFunction, iPosition:=3)
Case "Matches"
clsDefaultRFunction.AddParameter(".cols", clsRFunctionParameter:=clsMatchesFunction, iPosition:=3)
Case "Contains"
clsDefaultRFunction.AddParameter(".cols", clsRFunctionParameter:=clsContainsFunction, iPosition:=3)
End Select
Else
clsDefaultRFunction.RemoveParameterByName("pattern")
clsDefaultRFunction.RemoveParameterByName("replacement")
Expand Down

0 comments on commit fb25373

Please sign in to comment.