diff --git a/instat/dlgCompareColumns.Designer.vb b/instat/dlgCompareColumns.Designer.vb index 7423005b525..f08a0ad4f50 100644 --- a/instat/dlgCompareColumns.Designer.vb +++ b/instat/dlgCompareColumns.Designer.vb @@ -26,11 +26,6 @@ Partial Class dlgCompareColumns Me.lblFirstColumn = New System.Windows.Forms.Label() Me.lblSecondColumn = New System.Windows.Forms.Label() Me.grpComparisions = New System.Windows.Forms.GroupBox() - Me.ucrChkAllValues = New instat.ucrCheck() - Me.ucrChkUnion = New instat.ucrCheck() - Me.ucrChkIntersection = New instat.ucrCheck() - Me.ucrChkSecondNotFirst = New instat.ucrCheck() - Me.ucrChkFirstNotSecond = New instat.ucrCheck() Me.lblTolerance = New System.Windows.Forms.Label() Me.rdoByValue = New System.Windows.Forms.RadioButton() Me.rdoByRow = New System.Windows.Forms.RadioButton() @@ -38,6 +33,11 @@ Partial Class dlgCompareColumns Me.ucrPnlOptions = New instat.UcrPanel() Me.ucrSaveLogical = New instat.ucrSave() Me.ucrChkSort = New instat.ucrCheck() + Me.ucrChkAllValues = New instat.ucrCheck() + Me.ucrChkUnion = New instat.ucrCheck() + Me.ucrChkIntersection = New instat.ucrCheck() + Me.ucrChkSecondNotFirst = New instat.ucrCheck() + Me.ucrChkFirstNotSecond = New instat.ucrCheck() Me.ucrBase = New instat.ucrButtons() Me.ucrReceiverSecond = New instat.ucrReceiverSingle() Me.ucrReceiverFirst = New instat.ucrReceiverSingle() @@ -67,36 +67,6 @@ Partial Class dlgCompareColumns Me.grpComparisions.Name = "grpComparisions" Me.grpComparisions.TabStop = False ' - 'ucrChkAllValues - ' - Me.ucrChkAllValues.Checked = False - resources.ApplyResources(Me.ucrChkAllValues, "ucrChkAllValues") - Me.ucrChkAllValues.Name = "ucrChkAllValues" - ' - 'ucrChkUnion - ' - Me.ucrChkUnion.Checked = False - resources.ApplyResources(Me.ucrChkUnion, "ucrChkUnion") - Me.ucrChkUnion.Name = "ucrChkUnion" - ' - 'ucrChkIntersection - ' - Me.ucrChkIntersection.Checked = False - resources.ApplyResources(Me.ucrChkIntersection, "ucrChkIntersection") - Me.ucrChkIntersection.Name = "ucrChkIntersection" - ' - 'ucrChkSecondNotFirst - ' - Me.ucrChkSecondNotFirst.Checked = False - resources.ApplyResources(Me.ucrChkSecondNotFirst, "ucrChkSecondNotFirst") - Me.ucrChkSecondNotFirst.Name = "ucrChkSecondNotFirst" - ' - 'ucrChkFirstNotSecond - ' - Me.ucrChkFirstNotSecond.Checked = False - resources.ApplyResources(Me.ucrChkFirstNotSecond, "ucrChkFirstNotSecond") - Me.ucrChkFirstNotSecond.Name = "ucrChkFirstNotSecond" - ' 'lblTolerance ' resources.ApplyResources(Me.lblTolerance, "lblTolerance") @@ -148,6 +118,36 @@ Partial Class dlgCompareColumns resources.ApplyResources(Me.ucrChkSort, "ucrChkSort") Me.ucrChkSort.Name = "ucrChkSort" ' + 'ucrChkAllValues + ' + Me.ucrChkAllValues.Checked = False + resources.ApplyResources(Me.ucrChkAllValues, "ucrChkAllValues") + Me.ucrChkAllValues.Name = "ucrChkAllValues" + ' + 'ucrChkUnion + ' + Me.ucrChkUnion.Checked = False + resources.ApplyResources(Me.ucrChkUnion, "ucrChkUnion") + Me.ucrChkUnion.Name = "ucrChkUnion" + ' + 'ucrChkIntersection + ' + Me.ucrChkIntersection.Checked = False + resources.ApplyResources(Me.ucrChkIntersection, "ucrChkIntersection") + Me.ucrChkIntersection.Name = "ucrChkIntersection" + ' + 'ucrChkSecondNotFirst + ' + Me.ucrChkSecondNotFirst.Checked = False + resources.ApplyResources(Me.ucrChkSecondNotFirst, "ucrChkSecondNotFirst") + Me.ucrChkSecondNotFirst.Name = "ucrChkSecondNotFirst" + ' + 'ucrChkFirstNotSecond + ' + Me.ucrChkFirstNotSecond.Checked = False + resources.ApplyResources(Me.ucrChkFirstNotSecond, "ucrChkFirstNotSecond") + Me.ucrChkFirstNotSecond.Name = "ucrChkFirstNotSecond" + ' 'ucrBase ' resources.ApplyResources(Me.ucrBase, "ucrBase") @@ -189,6 +189,7 @@ Partial Class dlgCompareColumns ' resources.ApplyResources(Me, "$this") Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.grpComparisions) Me.Controls.Add(Me.lblTolerance) Me.Controls.Add(Me.ucrInputTolerance) Me.Controls.Add(Me.rdoByValue) @@ -196,7 +197,6 @@ Partial Class dlgCompareColumns Me.Controls.Add(Me.ucrPnlOptions) Me.Controls.Add(Me.ucrSaveLogical) Me.Controls.Add(Me.ucrChkSort) - Me.Controls.Add(Me.grpComparisions) Me.Controls.Add(Me.ucrBase) Me.Controls.Add(Me.lblSecondColumn) Me.Controls.Add(Me.lblFirstColumn) diff --git a/instat/dlgCompareColumns.resx b/instat/dlgCompareColumns.resx index ceb6fb5bcb6..8801a4a5cd9 100644 --- a/instat/dlgCompareColumns.resx +++ b/instat/dlgCompareColumns.resx @@ -286,7 +286,7 @@ 0 - 11, 104 + 11, 98 210, 20 @@ -307,7 +307,7 @@ 1 - 11, 78 + 11, 74 210, 20 @@ -328,7 +328,7 @@ 2 - 11, 52 + 11, 50 210, 20 @@ -369,6 +369,33 @@ 4 + + + 10, 270 + + + 271, 154 + + + 7 + + + Comparisons to Display: + + + grpComparisions + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True @@ -397,7 +424,7 @@ $this - 0 + 1 Button @@ -409,7 +436,7 @@ NoControl - 180, 13 + 215, 13 96, 28 @@ -433,7 +460,7 @@ $this - 2 + 3 Button @@ -445,7 +472,7 @@ NoControl - 84, 13 + 117, 13 98, 28 @@ -469,7 +496,7 @@ $this - 3 + 4 328, 197 @@ -490,10 +517,10 @@ $this - 1 + 2 - 67, 8 + 101, 8 5, 5, 5, 5 @@ -514,7 +541,7 @@ $this - 4 + 5 11, 426 @@ -523,7 +550,11 @@ 4, 5, 4, 5 + + 341, 24 + 280, 22 + 8 @@ -538,7 +569,7 @@ $this - 5 + 6 270, 242 @@ -559,7 +590,7 @@ $this - 6 + 7 11, 456 diff --git a/instat/dlgCompareColumns.vb b/instat/dlgCompareColumns.vb index b2828d8a917..b14616587ad 100644 --- a/instat/dlgCompareColumns.vb +++ b/instat/dlgCompareColumns.vb @@ -20,13 +20,17 @@ Public Class dlgCompareColumns Private bFirstLoad As Boolean = True Private bReset As Boolean = True - Private bRcodeSet As Boolean = False - Private clsCompareColumns, clsIfElseCompareFunction, clsAbsoluteFunction As New RFunction - Private clsAsCharacterFunctionOne, clsAsCharacterFunctionTwo, clsSummaryFunction As New RFunction + Private iDialogHeight As Integer + Private iBaseMaxY + Private clsCompareColumnsFunction, clsAbsoluteFunction As New RFunction + Private clsFirstAsCharacterFunction, clsSecondAsCharacterFunction, clsSummaryFunction As New RFunction Private clsYinXOperator, clsIsEqualToOperator, clsSubtractOperator, clsLessorEqualToOperator As New ROperator + Private clsDummyOperator As ROperator Private Sub dlgCompareColumns_Load(sender As Object, e As EventArgs) Handles Me.Load If bFirstLoad Then + iDialogHeight = Me.Height + iBaseMaxY = ucrBase.Location.Y InitialiseDialog() bFirstLoad = False End If @@ -47,10 +51,8 @@ Public Class dlgCompareColumns ucrPnlOptions.AddRadioButton(rdoByRow) ucrPnlOptions.AddRadioButton(rdoByValue) - ucrPnlOptions.AddFunctionNamesCondition(rdoByRow, "ifelse") - ucrPnlOptions.AddFunctionNamesCondition(rdoByValue, {"%in%", "compare_columns"}) - - ucrPnlOptions.AddToLinkedControls({ucrChkSort, ucrChkUnique}, {rdoByValue}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlOptions.AddToLinkedControls({ucrChkUnique, ucrChkSort, ucrChkFirstNotSecond}, {rdoByValue}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrChkFirstNotSecond.SetLinkedDisplayControl(grpComparisions) ucrReceiverFirst.SetParameter(New RParameter("x", 0)) ucrReceiverFirst.Selector = ucrSelectorCompareColumns @@ -71,10 +73,10 @@ Public Class dlgCompareColumns dctTolerance.Add("0.005", "0.005") dctTolerance.Add("0.0000000001", "0.0000000001") ucrInputTolerance.SetItems(dctTolerance) - ucrInputTolerance.bAllowNonConditionValues = True ucrInputTolerance.SetValidationTypeAsNumeric() ucrInputTolerance.AddQuotesIfUnrecognised = False ucrInputTolerance.SetLinkedDisplayControl(lblTolerance) + ucrInputTolerance.bAllowNonConditionValues = True ucrChkUnique.SetParameter(New RParameter("use_unique", 2), bNewChangeParameterValue:=True) ucrChkUnique.SetText("Use unique values for comparison") @@ -108,6 +110,9 @@ Public Class dlgCompareColumns ucrSaveLogical.SetSaveTypeAsColumn() ucrSaveLogical.SetDataFrameSelector(ucrSelectorCompareColumns.ucrAvailableDataFrames) ucrSaveLogical.SetIsComboBox() + + ucrSaveLogical.SetLabelText("New Column Name:") + ucrSaveLogical.SetLabelText("Save result for second column:") ucrSaveLogical.setLinkedReceiver(ucrReceiverSecond) @@ -115,33 +120,31 @@ Public Class dlgCompareColumns End Sub Private Sub SetDefaults() - clsCompareColumns = New RFunction - clsIfElseCompareFunction = New RFunction + clsCompareColumnsFunction = New RFunction clsAbsoluteFunction = New RFunction - clsAsCharacterFunctionOne = New RFunction - clsAsCharacterFunctionTwo = New RFunction + clsFirstAsCharacterFunction = New RFunction + clsSecondAsCharacterFunction = New RFunction clsSummaryFunction = New RFunction clsYinXOperator = New ROperator clsIsEqualToOperator = New ROperator clsSubtractOperator = New ROperator clsLessorEqualToOperator = New ROperator + clsDummyOperator = New ROperator ucrBase.clsRsyntax.ClearCodes() - ucrInputTolerance.SetText("0") + rdoByRow.Checked = True ucrSelectorCompareColumns.Reset() ucrReceiverFirst.SetMeAsReceiver() ucrSaveLogical.Reset() - clsCompareColumns.SetRCommand("compare_columns") + clsCompareColumnsFunction.SetRCommand("compare_columns") clsYinXOperator.SetOperation("%in%") - clsAsCharacterFunctionOne.SetRCommand("as.character") - clsAsCharacterFunctionTwo.SetRCommand("as.character") + clsFirstAsCharacterFunction.SetRCommand("as.character") + clsSecondAsCharacterFunction.SetRCommand("as.character") clsIsEqualToOperator.SetOperation("==") - clsIsEqualToOperator.AddParameter("first", clsRFunctionParameter:=clsAsCharacterFunctionOne, iPosition:=0) - clsIsEqualToOperator.AddParameter("second", clsRFunctionParameter:=clsAsCharacterFunctionTwo, iPosition:=1) clsSubtractOperator.SetOperation("-") @@ -149,68 +152,56 @@ Public Class dlgCompareColumns clsAbsoluteFunction.AddParameter("x", clsROperatorParameter:=clsSubtractOperator, iPosition:=0) clsLessorEqualToOperator.SetOperation("<=") - clsLessorEqualToOperator.AddParameter("first", clsRFunctionParameter:=clsAbsoluteFunction, iPosition:=0) - clsLessorEqualToOperator.AddParameter("tol", "0", iPosition:=1) - - clsIfElseCompareFunction.SetRCommand("ifelse") - clsIfElseCompareFunction.AddParameter("test", clsROperatorParameter:=clsIsEqualToOperator, iPosition:=0) - clsIfElseCompareFunction.AddParameter("yes", "TRUE", iPosition:=1) - clsIfElseCompareFunction.AddParameter("no", "FALSE", iPosition:=2) + clsLessorEqualToOperator.AddParameter("tol", 0, iPosition:=1) clsSummaryFunction.SetRCommand("summary") - clsSummaryFunction.AddParameter("x", clsRFunctionParameter:=clsIfElseCompareFunction, bIncludeArgumentName:=False, iPosition:=1) clsSummaryFunction.iCallType = 2 - ucrBase.clsRsyntax.SetBaseRFunction(clsIfElseCompareFunction) + ucrBase.clsRsyntax.SetBaseROperator(clsDummyOperator) End Sub Private Sub SetRCodeForControls(bReset As Boolean) - bRcodeSet = False ucrReceiverFirst.AddAdditionalCodeParameterPair(clsYinXOperator, New RParameter("right", iNewPosition:=1), iAdditionalPairNo:=1) - ucrReceiverFirst.AddAdditionalCodeParameterPair(clsAsCharacterFunctionOne, New RParameter("first", bNewIncludeArgumentName:=False, iNewPosition:=0), iAdditionalPairNo:=2) + ucrReceiverFirst.AddAdditionalCodeParameterPair(clsFirstAsCharacterFunction, New RParameter("first", bNewIncludeArgumentName:=False, iNewPosition:=0), iAdditionalPairNo:=2) ucrReceiverFirst.AddAdditionalCodeParameterPair(clsSubtractOperator, New RParameter("first", bNewIncludeArgumentName:=False, iNewPosition:=0), iAdditionalPairNo:=3) ucrReceiverSecond.AddAdditionalCodeParameterPair(clsYinXOperator, New RParameter("left", iNewPosition:=0), iAdditionalPairNo:=1) - ucrReceiverSecond.AddAdditionalCodeParameterPair(clsAsCharacterFunctionTwo, New RParameter("second", bNewIncludeArgumentName:=False, iNewPosition:=1), iAdditionalPairNo:=2) + ucrReceiverSecond.AddAdditionalCodeParameterPair(clsSecondAsCharacterFunction, New RParameter("second", bNewIncludeArgumentName:=False, iNewPosition:=1), iAdditionalPairNo:=2) ucrReceiverSecond.AddAdditionalCodeParameterPair(clsSubtractOperator, New RParameter("second", bNewIncludeArgumentName:=False, iNewPosition:=1), iAdditionalPairNo:=3) - ucrPnlOptions.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - - ucrReceiverFirst.SetRCode(clsCompareColumns, bReset) - ucrReceiverSecond.SetRCode(clsCompareColumns, bReset) - ucrChkUnique.SetRCode(clsCompareColumns, bReset) - ucrChkSort.SetRCode(clsCompareColumns, bReset) - ucrChkFirstNotSecond.SetRCode(clsCompareColumns, bReset) - ucrChkSecondNotFirst.SetRCode(clsCompareColumns, bReset) - ucrChkIntersection.SetRCode(clsCompareColumns, bReset) - ucrChkUnion.SetRCode(clsCompareColumns, bReset) - ucrChkAllValues.SetRCode(clsCompareColumns, bReset) + ucrReceiverFirst.SetRCode(clsCompareColumnsFunction, bReset) + ucrReceiverSecond.SetRCode(clsCompareColumnsFunction, bReset) + ucrChkUnique.SetRCode(clsCompareColumnsFunction, bReset) + ucrChkSort.SetRCode(clsCompareColumnsFunction, bReset) + ucrChkFirstNotSecond.SetRCode(clsCompareColumnsFunction, bReset) + ucrChkSecondNotFirst.SetRCode(clsCompareColumnsFunction, bReset) + ucrChkIntersection.SetRCode(clsCompareColumnsFunction, bReset) + ucrChkUnion.SetRCode(clsCompareColumnsFunction, bReset) + ucrChkAllValues.SetRCode(clsCompareColumnsFunction, bReset) ucrInputTolerance.SetRCode(clsLessorEqualToOperator, bReset) - ucrSaveLogical.SetRCode(clsIfElseCompareFunction, bReset) - ucrSaveLogical.AddAdditionalRCode(clsYinXOperator, iAdditionalPairNo:=1) - bRcodeSet = True + ucrSaveLogical.AddAdditionalRCode(clsLessorEqualToOperator, iAdditionalPairNo:=1) + ucrSaveLogical.AddAdditionalRCode(clsYinXOperator, iAdditionalPairNo:=2) + ucrSaveLogical.SetRCode(clsIsEqualToOperator, bReset) End Sub + Private Sub TestOkEnabled() - If Not ucrReceiverFirst.IsEmpty AndAlso Not ucrReceiverSecond.IsEmpty AndAlso ucrSaveLogical.IsComplete() Then - If rdoByRow.Checked Then - If {"integer", "numeric"}.Contains(ucrReceiverFirst.strCurrDataType) AndAlso {"integer", "numeric"}.Contains(ucrReceiverSecond.strCurrDataType) Then - ucrBase.OKEnabled(True) - ElseIf ucrReceiverFirst.strCurrDataType = "Date" AndAlso ucrReceiverSecond.strCurrDataType = "Date" Then - ucrBase.OKEnabled(True) - ElseIf {"factor", "character"}.Contains(ucrReceiverFirst.strCurrDataType) AndAlso {"factor", "character"}.Contains(ucrReceiverSecond.strCurrDataType) Then - ucrBase.OKEnabled(True) - ElseIf ucrReceiverFirst.strCurrDataType = "logical" AndAlso ucrReceiverSecond.strCurrDataType = "logical" Then - ucrBase.OKEnabled(True) - Else - ucrBase.OKEnabled(False) - End If - Else + If ucrReceiverFirst.IsEmpty OrElse ucrReceiverSecond.IsEmpty OrElse Not ucrSaveLogical.IsComplete() Then + ucrBase.OKEnabled(False) + Else + If ({"integer", "numeric"}.Contains(ucrReceiverFirst.strCurrDataType) AndAlso + {"integer", "numeric"}.Contains(ucrReceiverSecond.strCurrDataType)) OrElse + (ucrReceiverFirst.strCurrDataType = "Date" AndAlso + ucrReceiverSecond.strCurrDataType = "Date") OrElse + ({"factor", "character"}.Contains(ucrReceiverFirst.strCurrDataType) AndAlso + {"factor", "character"}.Contains(ucrReceiverSecond.strCurrDataType)) OrElse + (ucrReceiverFirst.strCurrDataType = "logical" AndAlso + ucrReceiverSecond.strCurrDataType = "logical") Then ucrBase.OKEnabled(True) + Else + ucrBase.OKEnabled(False) End If - Else - ucrBase.OKEnabled(False) End If End Sub @@ -226,54 +217,69 @@ Public Class dlgCompareColumns Private Sub ucrPnlOptions_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlOptions.ControlValueChanged If rdoByValue.Checked Then - grpComparisions.Visible = True - ucrBase.clsRsyntax.SetBaseRFunction(clsCompareColumns) + ucrInputTolerance.Visible = False + ucrBase.clsRsyntax.SetBaseRFunction(clsCompareColumnsFunction) ucrBase.clsRsyntax.RemoveFromAfterCodes(clsSummaryFunction) ucrBase.clsRsyntax.AddToAfterCodes(clsYinXOperator, iPosition:=1) - Else - grpComparisions.Visible = False - ucrBase.clsRsyntax.SetBaseRFunction(clsIfElseCompareFunction) + Me.Size = New System.Drawing.Size(Me.Width, iDialogHeight) + ucrBase.Location = New Point(ucrBase.Location.X, iBaseMaxY) + ucrSaveLogical.Location = New Point(ucrSaveLogical.Location.X, iBaseMaxY / 1.07) + ElseIf rdoByRow.Checked Then + ucrBase.clsRsyntax.SetBaseROperator(clsDummyOperator) ucrBase.clsRsyntax.RemoveFromAfterCodes(clsYinXOperator) ucrBase.clsRsyntax.AddToAfterCodes(clsSummaryFunction, iPosition:=1) + Me.Size = New System.Drawing.Size(Me.Width, iDialogHeight * 0.68) + ucrBase.Location = New Point(ucrBase.Location.X, iBaseMaxY / 1.62) + ucrSaveLogical.Location = New Point(ucrSaveLogical.Location.X, iBaseMaxY / 1.8) End If CheckDatatype() End Sub Private Sub CheckDatatype() - If bRcodeSet Then - If rdoByRow.Checked Then - If {"integer", "numeric"}.Contains(ucrReceiverFirst.strCurrDataType) AndAlso {"integer", "numeric"}.Contains(ucrReceiverSecond.strCurrDataType) Then + If ucrReceiverSecond.IsEmpty OrElse ucrReceiverFirst.IsEmpty Then + TestOkEnabled() + Exit Sub + Else + If {"integer", "numeric"}.Contains(ucrReceiverFirst.strCurrDataType) AndAlso {"integer", "numeric"}.Contains(ucrReceiverSecond.strCurrDataType) Then + If rdoByRow.Checked Then ucrInputTolerance.Visible = True - clsIfElseCompareFunction.AddParameter("test", clsROperatorParameter:=clsLessorEqualToOperator, iPosition:=0) - ElseIf ucrReceiverFirst.strCurrDataType = "date" AndAlso ucrReceiverSecond.strCurrDataType = "date" Then + clsLessorEqualToOperator.AddParameter("first", clsRFunctionParameter:=clsAbsoluteFunction, iPosition:=0) + clsLessorEqualToOperator.AddParameter("tol", "0", iPosition:=1) + clsSummaryFunction.AddParameter("object", clsROperatorParameter:=clsLessorEqualToOperator, iPosition:=1) + clsDummyOperator = clsLessorEqualToOperator + End If + ElseIf {"Date", "date"}.Contains(ucrReceiverFirst.strCurrDataType) AndAlso {"Date", "date"}.Contains(ucrReceiverSecond.strCurrDataType) Then + If rdoByRow.Checked Then ucrInputTolerance.Visible = True - clsIfElseCompareFunction.AddParameter("test", clsROperatorParameter:=clsLessorEqualToOperator, iPosition:=0) - ElseIf {"factor", "character"}.Contains(ucrReceiverFirst.strCurrDataType) AndAlso {"factor", "character"}.Contains(ucrReceiverSecond.strCurrDataType) Then - ucrInputTolerance.Visible = False - clsIfElseCompareFunction.AddParameter("test", clsROperatorParameter:=clsIsEqualToOperator, iPosition:=0) - ElseIf ucrReceiverFirst.strCurrDataType = "logical" AndAlso ucrReceiverSecond.strCurrDataType = "logical" Then + clsLessorEqualToOperator.AddParameter("first", clsRFunctionParameter:=clsAbsoluteFunction, iPosition:=0) + clsLessorEqualToOperator.AddParameter("tol", "0", iPosition:=1) + clsSummaryFunction.AddParameter("object", clsROperatorParameter:=clsLessorEqualToOperator, iPosition:=1) + clsDummyOperator = clsLessorEqualToOperator + End If + ElseIf {"factor", "character"}.Contains(ucrReceiverFirst.strCurrDataType) AndAlso {"factor", "character"}.Contains(ucrReceiverSecond.strCurrDataType) Then + If rdoByRow.Checked Then ucrInputTolerance.Visible = False - clsIfElseCompareFunction.AddParameter("test", clsROperatorParameter:=clsIsEqualToOperator, iPosition:=0) - Else - MsgBox("Receivers must have the same data type, OK will not be enabled") + clsIsEqualToOperator.AddParameter("first", clsRFunctionParameter:=clsFirstAsCharacterFunction, iPosition:=0) + clsIsEqualToOperator.AddParameter("second", clsRFunctionParameter:=clsSecondAsCharacterFunction, iPosition:=1) + clsSummaryFunction.AddParameter("object", clsROperatorParameter:=clsIsEqualToOperator, iPosition:=1) + clsDummyOperator = clsIsEqualToOperator + End If + ElseIf ucrReceiverFirst.strCurrDataType = "logical" AndAlso ucrReceiverSecond.strCurrDataType = "logical" Then + If rdoByRow.Checked Then ucrInputTolerance.Visible = False + clsIsEqualToOperator.AddParameter("first", clsRFunctionParameter:=clsFirstAsCharacterFunction, iPosition:=0) + clsIsEqualToOperator.AddParameter("second", clsRFunctionParameter:=clsSecondAsCharacterFunction, iPosition:=1) + clsSummaryFunction.AddParameter("object", clsROperatorParameter:=clsIsEqualToOperator, iPosition:=1) + clsDummyOperator = clsIsEqualToOperator End If Else - ucrInputTolerance.Visible = False + MsgBox("Receivers must have the same data type, OK will not be enabled") End If End If TestOkEnabled() End Sub - Private Sub ucrReceiverFirst_ValueChanged(sender As Object, e As EventArgs) Handles ucrReceiverFirst.ValueChanged - If Not ucrReceiverSecond.IsEmpty Then - CheckDatatype() - End If - End Sub - - Private Sub ucrReceiverSecond_ValueChanged(sender As Object, e As EventArgs) Handles ucrReceiverSecond.ValueChanged - If Not ucrReceiverFirst.IsEmpty Then - CheckDatatype() - End If + Private Sub ucrReceiverFirst_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverFirst.ControlValueChanged, ucrReceiverSecond.ControlValueChanged + CheckDatatype() End Sub -End Class \ No newline at end of file +End Class