diff --git a/instat/dlgOneVariableGraph.Designer.vb b/instat/dlgOneVariableGraph.Designer.vb index e0b96612fda..91724afd907 100644 --- a/instat/dlgOneVariableGraph.Designer.vb +++ b/instat/dlgOneVariableGraph.Designer.vb @@ -25,15 +25,15 @@ Partial Class dlgOneVariableGraph Me.lblSelectedVariables = New System.Windows.Forms.Label() Me.cmdGraphOptions = New System.Windows.Forms.Button() Me.grpOutput = New System.Windows.Forms.GroupBox() + Me.rdoSingleGraphs = New System.Windows.Forms.RadioButton() + Me.rdoCombine = New System.Windows.Forms.RadioButton() + Me.rdoFacets = New System.Windows.Forms.RadioButton() + Me.ucrPnlOutput = New instat.UcrPanel() Me.ucrChkFlip = New instat.ucrCheck() - Me.ucrOneVarGraphSave = New instat.ucrSaveGraph() Me.ucrBase = New instat.ucrButtons() Me.ucrReceiverOneVarGraph = New instat.ucrReceiverMultiple() Me.ucrSelectorOneVarGraph = New instat.ucrSelectorByDataFrameAddRemove() - Me.ucrPnlOutput = New instat.UcrPanel() - Me.rdoFacets = New System.Windows.Forms.RadioButton() - Me.rdoCombine = New System.Windows.Forms.RadioButton() - Me.rdoSingleGraphs = New System.Windows.Forms.RadioButton() + Me.ucrSaveGraph = New instat.ucrSave() Me.grpOutput.SuspendLayout() Me.SuspendLayout() ' @@ -68,21 +68,54 @@ Partial Class dlgOneVariableGraph Me.grpOutput.TabStop = False Me.grpOutput.Text = "Output" ' + 'rdoSingleGraphs + ' + Me.rdoSingleGraphs.AutoSize = True + Me.rdoSingleGraphs.Location = New System.Drawing.Point(10, 65) + Me.rdoSingleGraphs.Name = "rdoSingleGraphs" + Me.rdoSingleGraphs.Size = New System.Drawing.Size(91, 17) + Me.rdoSingleGraphs.TabIndex = 3 + Me.rdoSingleGraphs.TabStop = True + Me.rdoSingleGraphs.Text = "Single Graphs" + Me.rdoSingleGraphs.UseVisualStyleBackColor = True + ' + 'rdoCombine + ' + Me.rdoCombine.AutoSize = True + Me.rdoCombine.Location = New System.Drawing.Point(10, 43) + Me.rdoCombine.Name = "rdoCombine" + Me.rdoCombine.Size = New System.Drawing.Size(104, 17) + Me.rdoCombine.TabIndex = 2 + Me.rdoCombine.TabStop = True + Me.rdoCombine.Text = "Combined Graph" + Me.rdoCombine.UseVisualStyleBackColor = True + ' + 'rdoFacets + ' + Me.rdoFacets.AutoSize = True + Me.rdoFacets.Location = New System.Drawing.Point(10, 21) + Me.rdoFacets.Name = "rdoFacets" + Me.rdoFacets.Size = New System.Drawing.Size(57, 17) + Me.rdoFacets.TabIndex = 1 + Me.rdoFacets.TabStop = True + Me.rdoFacets.Text = "Facets" + Me.rdoFacets.UseVisualStyleBackColor = True + ' + 'ucrPnlOutput + ' + Me.ucrPnlOutput.Location = New System.Drawing.Point(3, 16) + Me.ucrPnlOutput.Name = "ucrPnlOutput" + Me.ucrPnlOutput.Size = New System.Drawing.Size(114, 69) + Me.ucrPnlOutput.TabIndex = 0 + ' 'ucrChkFlip ' Me.ucrChkFlip.Checked = False - Me.ucrChkFlip.Location = New System.Drawing.Point(243, 257) + Me.ucrChkFlip.Location = New System.Drawing.Point(10, 231) Me.ucrChkFlip.Name = "ucrChkFlip" Me.ucrChkFlip.Size = New System.Drawing.Size(145, 20) Me.ucrChkFlip.TabIndex = 9 ' - 'ucrOneVarGraphSave - ' - Me.ucrOneVarGraphSave.Location = New System.Drawing.Point(10, 257) - Me.ucrOneVarGraphSave.Name = "ucrOneVarGraphSave" - Me.ucrOneVarGraphSave.Size = New System.Drawing.Size(265, 20) - Me.ucrOneVarGraphSave.TabIndex = 8 - ' 'ucrBase ' Me.ucrBase.Location = New System.Drawing.Point(10, 283) @@ -110,54 +143,21 @@ Partial Class dlgOneVariableGraph Me.ucrSelectorOneVarGraph.Size = New System.Drawing.Size(210, 180) Me.ucrSelectorOneVarGraph.TabIndex = 0 ' - 'ucrPnlOutput - ' - Me.ucrPnlOutput.Location = New System.Drawing.Point(3, 16) - Me.ucrPnlOutput.Name = "ucrPnlOutput" - Me.ucrPnlOutput.Size = New System.Drawing.Size(114, 69) - Me.ucrPnlOutput.TabIndex = 0 - ' - 'rdoFacets - ' - Me.rdoFacets.AutoSize = True - Me.rdoFacets.Location = New System.Drawing.Point(10, 21) - Me.rdoFacets.Name = "rdoFacets" - Me.rdoFacets.Size = New System.Drawing.Size(57, 17) - Me.rdoFacets.TabIndex = 1 - Me.rdoFacets.TabStop = True - Me.rdoFacets.Text = "Facets" - Me.rdoFacets.UseVisualStyleBackColor = True - ' - 'rdoCombine - ' - Me.rdoCombine.AutoSize = True - Me.rdoCombine.Location = New System.Drawing.Point(10, 43) - Me.rdoCombine.Name = "rdoCombine" - Me.rdoCombine.Size = New System.Drawing.Size(104, 17) - Me.rdoCombine.TabIndex = 2 - Me.rdoCombine.TabStop = True - Me.rdoCombine.Text = "Combined Graph" - Me.rdoCombine.UseVisualStyleBackColor = True - ' - 'rdoSingleGraphs + 'ucrSaveGraph ' - Me.rdoSingleGraphs.AutoSize = True - Me.rdoSingleGraphs.Location = New System.Drawing.Point(10, 65) - Me.rdoSingleGraphs.Name = "rdoSingleGraphs" - Me.rdoSingleGraphs.Size = New System.Drawing.Size(91, 17) - Me.rdoSingleGraphs.TabIndex = 3 - Me.rdoSingleGraphs.TabStop = True - Me.rdoSingleGraphs.Text = "Single Graphs" - Me.rdoSingleGraphs.UseVisualStyleBackColor = True + Me.ucrSaveGraph.Location = New System.Drawing.Point(10, 257) + Me.ucrSaveGraph.Name = "ucrSaveGraph" + Me.ucrSaveGraph.Size = New System.Drawing.Size(294, 24) + Me.ucrSaveGraph.TabIndex = 4 ' 'dlgOneVariableGraph ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(418, 337) + Me.Controls.Add(Me.ucrSaveGraph) Me.Controls.Add(Me.grpOutput) Me.Controls.Add(Me.ucrChkFlip) - Me.Controls.Add(Me.ucrOneVarGraphSave) Me.Controls.Add(Me.cmdGraphOptions) Me.Controls.Add(Me.ucrBase) Me.Controls.Add(Me.lblSelectedVariables) @@ -181,11 +181,11 @@ Partial Class dlgOneVariableGraph Friend WithEvents lblSelectedVariables As Label Friend WithEvents ucrBase As ucrButtons Friend WithEvents cmdGraphOptions As Button - Friend WithEvents ucrOneVarGraphSave As ucrSaveGraph Friend WithEvents ucrChkFlip As ucrCheck Friend WithEvents grpOutput As GroupBox Friend WithEvents rdoSingleGraphs As RadioButton Friend WithEvents rdoCombine As RadioButton Friend WithEvents rdoFacets As RadioButton Friend WithEvents ucrPnlOutput As UcrPanel + Friend WithEvents ucrSaveGraph As ucrSave End Class diff --git a/instat/dlgOneVariableGraph.vb b/instat/dlgOneVariableGraph.vb index 0c9530b181a..d15308c84fa 100644 --- a/instat/dlgOneVariableGraph.vb +++ b/instat/dlgOneVariableGraph.vb @@ -38,15 +38,16 @@ Public Class dlgOneVariableGraph ucrBase.clsRsyntax.SetBaseRFunction(clsDefaultRFunction.Clone()) ucrSelectorOneVarGraph.Reset() - ucrOneVarGraphSave.Reset() - ucrOneVarGraphSave.strPrefix = "OneVariableGraph" - SetRCode(Me, ucrBase.clsRsyntax.clsBaseFunction, True) bResetSubdialog = True TestOkEnabled() End Sub Private Sub InitialiseDialog() + ucrBase.iHelpTopicID = 412 + ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False + ucrBase.clsRsyntax.iCallType = 3 + ucrPnlOutput.SetParameter(New RParameter("output")) ucrPnlOutput.AddRadioButton(rdoFacets, Chr(34) & "facets" & Chr(34)) ucrPnlOutput.AddRadioButton(rdoCombine, Chr(34) & "combine" & Chr(34)) @@ -65,11 +66,12 @@ Public Class dlgOneVariableGraph ucrChkFlip.SetValuesCheckedAndUnchecked("TRUE", "FALSE") ucrChkFlip.SetDefault("FALSE") - ucrBase.iHelpTopicID = 412 - ucrOneVarGraphSave.strPrefix = "OneVariableGraph" - ucrOneVarGraphSave.SetDataFrameSelector(ucrSelectorOneVarGraph.ucrAvailableDataFrames) - ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False - ucrBase.clsRsyntax.iCallType = 3 + ucrSaveGraph.SetPrefix("OneVariableGraph") + ucrSaveGraph.SetSaveType("graph") + ucrSaveGraph.SetDataFrameSelector(ucrSelectorOneVarGraph.ucrAvailableDataFrames) + ucrSaveGraph.SetCheckBoxText("Save Graph") + ucrSaveGraph.SetIsComboBox(True) + ucrSaveGraph.SetAssignToIfUncheckedValue("last_graph") 'Define the default RFunction clsDefaultRFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$graph_one_variable") @@ -77,6 +79,7 @@ Public Class dlgOneVariableGraph clsDefaultRFunction.AddParameter("categorical", Chr(34) & "geom_bar" & Chr(34)) clsDefaultRFunction.AddParameter("output", Chr(34) & "facets" & Chr(34)) clsDefaultRFunction.AddParameter(ucrSelectorOneVarGraph.GetParameter(), 0) + clsDefaultRFunction.SetAssignTo("last_graph", strTempDataframe:=ucrSelectorOneVarGraph.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") End Sub Private Sub ReopenDialog() @@ -84,12 +87,10 @@ Public Class dlgOneVariableGraph End Sub Private Sub TestOkEnabled() - 'Question: What should TestOK do in the new implementation? Still check controls or check the code? - 'this test when to enable okay button. Should be enabled only when the receiver is not empty or when the save graph is schecked and the save graph is not empty - If ucrReceiverOneVarGraph.IsEmpty() OrElse (ucrOneVarGraphSave.chkSaveGraph.Checked AndAlso ucrOneVarGraphSave.ucrInputGraphName.IsEmpty) Then - ucrBase.OKEnabled(False) - Else + If Not ucrReceiverOneVarGraph.IsEmpty() AndAlso ucrSaveGraph.IsComplete() Then ucrBase.OKEnabled(True) + Else + ucrBase.OKEnabled(False) End If End Sub @@ -98,16 +99,6 @@ Public Class dlgOneVariableGraph TestOkEnabled() End Sub - Private Sub ucrOneVarGraphSave_GraphNameChanged() Handles ucrOneVarGraphSave.GraphNameChanged, ucrOneVarGraphSave.SaveGraphCheckedChanged - 'this sub saves graphs - If ucrOneVarGraphSave.bSaveGraph Then - ucrBase.clsRsyntax.SetAssignTo(ucrOneVarGraphSave.strGraphName, strTempDataframe:=ucrSelectorOneVarGraph.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:=ucrOneVarGraphSave.strGraphName) - Else - ucrBase.clsRsyntax.SetAssignTo("last_graph", strTempDataframe:=ucrSelectorOneVarGraph.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") - End If - TestOkEnabled() - End Sub - Private Sub cmdGraph_Click(sender As Object, e As EventArgs) Handles cmdGraphOptions.Click ' Link the base function to the sub dialog sdgOneVarGraph.SetRFunction(ucrBase.clsRsyntax.clsBaseFunction, bResetSubdialog) @@ -127,15 +118,10 @@ Public Class dlgOneVariableGraph End If End Sub - Private Sub ucrOneVarGraphSave_ContentsChanged() Handles ucrOneVarGraphSave.ContentsChanged - TestOkEnabled() - End Sub - - Private Sub AllControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrSelectorOneVarGraph.ControlContentsChanged, ucrChkFlip.ControlContentsChanged, ucrReceiverOneVarGraph.ControlContentsChanged, ucrSelectorOneVarGraph.ControlContentsChanged + Private Sub Controls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrSelectorOneVarGraph.ControlContentsChanged, ucrReceiverOneVarGraph.ControlContentsChanged, ucrSelectorOneVarGraph.ControlContentsChanged, ucrSaveGraph.ControlContentsChanged TestOkEnabled() End Sub - 'When any of the ucrCore controls have been changed we update the R Code to match the contents Private Sub AllControls_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverOneVarGraph.ControlValueChanged CheckDataType() End Sub diff --git a/instat/sdgOneVarGraph.vb b/instat/sdgOneVarGraph.vb index 7056929fe29..dba42a65173 100644 --- a/instat/sdgOneVarGraph.vb +++ b/instat/sdgOneVarGraph.vb @@ -51,12 +51,12 @@ Public Class sdgOneVarGraph lstCategoricalPairs.Add(New KeyValuePair(Of String, String)("Dot Plot", Chr(34) & "geom_dotplot" & Chr(34))) ucrInputCategorical.SetItems(lstCategoricalPairs) - SetParameter({ucrChkSpecifyLayout, ucrNudNumberofColumns}, New RParameter("ncol")) ucrChkSpecifyLayout.SetText("Specify Layout") ucrChkSpecifyLayout.bChangeParameterValue = False ucrChkSpecifyLayout.AddToLinkedControls(ucrLinked:=ucrNudNumberofColumns, objValues:={True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrNudNumberofColumns.SetMinMax(1, 10) + ucrNudNumberofColumns.bAddRemoveParameter = False ucrNudNumberofColumns.SetLabel(lblNumberofColumns) ucrChkFreeScaleAxisforFacets.SetText("Free Scale Axis for Facets") diff --git a/instat/ucrSave.Designer.vb b/instat/ucrSave.Designer.vb index 9f509dc079e..05895d1c1f5 100644 --- a/instat/ucrSave.Designer.vb +++ b/instat/ucrSave.Designer.vb @@ -25,6 +25,7 @@ Partial Class ucrSave Me.ucrChkSave = New instat.ucrCheck() Me.lblSaveText = New System.Windows.Forms.Label() Me.ucrInputComboSave = New instat.ucrInputComboBox() + Me.ucrInputTextSave = New instat.ucrInputTextBox() Me.SuspendLayout() ' 'ucrChkSave @@ -48,20 +49,31 @@ Partial Class ucrSave ' Me.ucrInputComboSave.Dock = System.Windows.Forms.DockStyle.Right Me.ucrInputComboSave.IsReadOnly = False - Me.ucrInputComboSave.Location = New System.Drawing.Point(128, 0) + Me.ucrInputComboSave.Location = New System.Drawing.Point(250, 0) Me.ucrInputComboSave.Name = "ucrInputComboSave" Me.ucrInputComboSave.Size = New System.Drawing.Size(173, 24) Me.ucrInputComboSave.TabIndex = 2 ' + 'ucrInputTextSave + ' + Me.ucrInputTextSave.Dock = System.Windows.Forms.DockStyle.Right + Me.ucrInputTextSave.IsMultiline = False + Me.ucrInputTextSave.IsReadOnly = False + Me.ucrInputTextSave.Location = New System.Drawing.Point(77, 0) + Me.ucrInputTextSave.Name = "ucrInputTextSave" + Me.ucrInputTextSave.Size = New System.Drawing.Size(173, 24) + Me.ucrInputTextSave.TabIndex = 3 + ' 'ucrSave ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.ucrInputTextSave) Me.Controls.Add(Me.ucrInputComboSave) Me.Controls.Add(Me.lblSaveText) Me.Controls.Add(Me.ucrChkSave) Me.Name = "ucrSave" - Me.Size = New System.Drawing.Size(301, 24) + Me.Size = New System.Drawing.Size(423, 24) Me.ResumeLayout(False) Me.PerformLayout() @@ -70,4 +82,5 @@ Partial Class ucrSave Friend WithEvents ucrChkSave As ucrCheck Friend WithEvents lblSaveText As Label Friend WithEvents ucrInputComboSave As ucrInputComboBox + Friend WithEvents ucrInputTextSave As ucrInputTextBox End Class diff --git a/instat/ucrSave.vb b/instat/ucrSave.vb index f71bc356cde..fe320fe779b 100644 --- a/instat/ucrSave.vb +++ b/instat/ucrSave.vb @@ -1,3 +1,244 @@ -Public Class ucrSave +Imports instat -End Class +Public Class ucrSave + Public bFirstLoad As Boolean = True + Private bShowCheckBox As Boolean + Private bShowLabel As Boolean + Private strSaveType As String + Private strPrefix As String + Private bIsComboBox As Boolean = True + Private bHideIfUnchecked As Boolean = True + Private ucrDataFrameSelector As ucrDataFrame + Private bAssignToIsPrefix As Boolean = False + Private bAssignToColumnWithoutNames As Boolean = False + Private bInsertColumnBefore As Boolean = False + Private strAssignToIfUnchecked As String = "" + + Private Sub ucrSaveGraph_Load(sender As Object, e As EventArgs) Handles MyBase.Load + If bFirstLoad Then + SetDefaults() + bFirstLoad = False + End If + End Sub + + Private Sub InitialiseControl() + ucrInputComboSave.SetValidationTypeAsRVariable() + ucrInputTextSave.SetValidationTypeAsRVariable() + End Sub + + Private Sub SetDefaults() + strSaveType = "column" + SetSaveType(strSaveType) + bShowCheckBox = True + bShowLabel = False + bIsComboBox = True + LabelOrCheckboxSettings() + SetIsComboBox(bIsComboBox) + UpdateRCode() + End Sub + + Public Sub SetLabelText(strText As String) + lblSaveText.Text = strText + bShowLabel = True + bShowCheckBox = False + LabelOrCheckboxSettings() + End Sub + + Public Sub SetCheckBoxText(strText As String) + ucrChkSave.chkCheck.Text = strText + bShowLabel = False + bShowCheckBox = True + LabelOrCheckboxSettings() + End Sub + + Public Sub SetIsComboBox(bIsCombo As Boolean) + bIsComboBox = bIsCombo + If bShowCheckBox Then + CheckedChanged() + Else + ucrInputComboSave.Visible = bIsCombo + ucrInputTextSave.Visible = Not bIsCombo + End If + End Sub + + Public Sub SetPrefix(strNewPrefix As String) + strPrefix = strNewPrefix + ucrInputComboSave.SetPrefix(strPrefix) + ucrInputTextSave.SetPrefix(strPrefix) + End Sub + + Public Sub SetAssignToIfUncheckedValue(strTemp As String) + strAssignToIfUnchecked = strTemp + UpdateRCode() + End Sub + + Public Sub SetAssignToBooleans(Optional bTempAssignToIsPrefix As Boolean = False, Optional bTempAssignToColumnWithoutNames As Boolean = False, Optional bTempInsertColumnBefore As Boolean = False) + bAssignToIsPrefix = bTempAssignToIsPrefix + bAssignToColumnWithoutNames = bTempAssignToColumnWithoutNames + bInsertColumnBefore = bTempInsertColumnBefore + UpdateRCode() + End Sub + + Private Sub LabelOrCheckboxSettings() + If bShowLabel Then + ucrInputComboSave.Enabled = True + ucrInputTextSave.Enabled = True + lblSaveText.Visible = True + ucrChkSave.Visible = False + ElseIf bShowCheckBox Then + lblSaveText.Visible = False + ucrChkSave.Visible = True + CheckedChanged() + Else + ucrInputComboSave.Enabled = True + ucrInputTextSave.Enabled = True + lblSaveText.Visible = False + ucrChkSave.Visible = False + End If + End Sub + + Public Sub SetSaveType(strType As String) + strSaveType = strType + Select Case strSaveType + Case "column" + ucrInputComboSave.SetDefaultTypeAsColumn() + ucrInputComboSave.SetItemsTypeAsColumns() + ucrInputTextSave.SetDefaultTypeAsColumn() + Case "dataframe" + ucrInputComboSave.SetDefaultTypeAsDataFrame() + ucrInputComboSave.SetItemsTypeAsDataFrames() + ucrInputTextSave.SetDefaultTypeAsDataFrame() + Case "graph" + ucrInputComboSave.SetDefaultTypeAsGraph() + ucrInputComboSave.SetItemsTypeAsGraphs() + ucrInputTextSave.SetDefaultTypeAsGraph() + Case "model" + ucrInputComboSave.SetDefaultTypeAsModel() + ucrInputComboSave.SetItemsTypeAsModels() + ucrInputTextSave.SetDefaultTypeAsModel() + Case Else + MsgBox("Developer error: unrecognised save type: " & strType) + End Select + End Sub + + Public Sub Reset() + SetDefaults() + End Sub + + Public Sub SetDataFrameSelector(ucrNewDataFrameSelector As ucrDataFrame) + ucrDataFrameSelector = ucrNewDataFrameSelector + ucrInputComboSave.SetDataFrameSelector(ucrNewDataFrameSelector) + ucrInputTextSave.SetDataFrameSelector(ucrNewDataFrameSelector) + End Sub + + Private Sub ucrChkSave_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkSave.ControlValueChanged + If bShowCheckBox Then + CheckedChanged() + End If + OnControlValueChanged() + End Sub + + Private Sub CheckedChanged() + ucrInputTextSave.Enabled = ucrChkSave.Checked + ucrInputComboSave.Enabled = ucrChkSave.Checked + ucrInputTextSave.Visible = False + ucrInputComboSave.Visible = False + If bHideIfUnchecked Then + If bIsComboBox Then + ucrInputComboSave.Visible = ucrChkSave.Checked + Else + ucrInputTextSave.Visible = ucrChkSave.Checked + End If + Else + ucrInputComboSave.Visible = bIsComboBox + ucrInputTextSave.Visible = Not bIsComboBox + End If + End Sub + + Private Sub ucrInputControls_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputComboSave.ControlValueChanged, ucrInputTextSave.ControlValueChanged + OnControlValueChanged() + End Sub + + Public Overrides Sub UpdateRCode() + Dim strSaveName As String + Dim strDataName As String = "" + Dim bAddAssignTo As Boolean = True + + MyBase.UpdateRCode() + + If clsRCode IsNot Nothing Then + strSaveName = GetText() + If ucrDataFrameSelector IsNot Nothing Then + strDataName = ucrDataFrameSelector.cboAvailableDataFrames.Text + End If + If GetText() <> "" Then + strSaveName = GetText() + ElseIf strAssignToIfUnchecked <> "" Then + strSaveName = strAssignToIfUnchecked + End If + If bShowCheckBox Then + bAddAssignTo = bAddAssignTo AndAlso strSaveName <> "" + End If + If bAddAssignTo Then + Select Case strSaveType + Case "column" + clsRCode.SetAssignTo(strTemp:=strSaveName, strTempDataframe:=strDataName, strTempColumn:=strSaveName, bAssignToIsPrefix:=bAssignToIsPrefix, bAssignToColumnWithoutNames:=bAssignToColumnWithoutNames, bInsertColumnBefore:=bInsertColumnBefore) + Case "dataframe" + clsRCode.SetAssignTo(strTemp:=strSaveName, strTempDataframe:=strDataName, bAssignToIsPrefix:=bAssignToIsPrefix) + Case "graph" + clsRCode.SetAssignTo(strTemp:=strSaveName, strTempDataframe:=strDataName, strTempGraph:=strSaveName, bAssignToIsPrefix:=bAssignToIsPrefix) + Case "model" + clsRCode.SetAssignTo(strTemp:=strSaveName, strTempDataframe:=strDataName, strTempModel:=strSaveName, bAssignToIsPrefix:=bAssignToIsPrefix) + End Select + Else + clsRCode.RemoveAssignTo() + End If + End If + End Sub + + Private Sub ucrInputControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrInputComboSave.ControlContentsChanged, ucrInputTextSave.ControlContentsChanged + OnControlContentsChanged() + End Sub + + Public Overrides Sub UpdateControl(Optional bReset As Boolean = False) + MyBase.UpdateControl(bReset) + If clsRCode IsNot Nothing Then + If clsRCode.bToBeAssigned OrElse clsRCode.bIsAssigned Then + If bIsComboBox Then + ucrInputComboSave.SetName(clsRCode.strAssignTo) + ucrInputTextSave.SetName("") + Else + ucrInputTextSave.SetName(clsRCode.strAssignTo) + ucrInputComboSave.SetName("") + End If + Else + ucrInputComboSave.SetName("") + ucrInputTextSave.SetName("") + End If + If bShowCheckBox Then + If GetText() = strAssignToIfUnchecked Then + ucrChkSave.Checked = False + Else + ucrChkSave.Checked = (clsRCode.bToBeAssigned OrElse clsRCode.bIsAssigned) + End If + End If + UpdateLinkedControls() + End If + End Sub + + Public Function IsComplete() As Boolean + If bShowCheckBox Then + Return ((ucrChkSave.Checked AndAlso GetText() <> "") OrElse Not ucrChkSave.Checked) + Else + Return GetText() <> "" + End If + End Function + + Public Function GetText() As String + If bIsComboBox Then + Return ucrInputComboSave.GetText() + Else + Return ucrInputTextSave.GetText() + End If + End Function +End Class \ No newline at end of file