From 2e64c454fea3d9bf26c1ef95453703e380789e2e Mon Sep 17 00:00:00 2001 From: EstherNjeri <74548350+EstherNjeriLiberatta@users.noreply.github.com> Date: Mon, 27 Jun 2022 12:33:05 +0300 Subject: [PATCH 1/6] Updated Boxplot Plot Options to new system. --- instat/dlgBoxPlot.designer.vb | 157 +++++++++++++++++++++------------- instat/dlgBoxPlot.resx | 3 + instat/dlgBoxPlot.vb | 99 +++++++++++++-------- 3 files changed, 164 insertions(+), 95 deletions(-) diff --git a/instat/dlgBoxPlot.designer.vb b/instat/dlgBoxPlot.designer.vb index 500ec39f8af..db08338c635 100644 --- a/instat/dlgBoxPlot.designer.vb +++ b/instat/dlgBoxPlot.designer.vb @@ -38,17 +38,23 @@ Partial Class dlgBoxplot 'Do not modify it using the code editor. Private Sub InitializeComponent() - Me.cmdOptions = New System.Windows.Forms.Button() + Me.components = New System.ComponentModel.Container() Me.lblByFactors = New System.Windows.Forms.Label() Me.lblBySecondFactor = New System.Windows.Forms.Label() - Me.cmdBoxPlotOptions = New System.Windows.Forms.Button() Me.rdoBoxplotTufte = New System.Windows.Forms.RadioButton() Me.rdoJitter = New System.Windows.Forms.RadioButton() Me.rdoViolin = New System.Windows.Forms.RadioButton() Me.lblJitter = New System.Windows.Forms.Label() Me.lblTransparency = New System.Windows.Forms.Label() - Me.ucrChkTufte = New instat.ucrCheck() + Me.contextMenuStripOptions = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.toolStripMenuItemPlotOptions = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItemBoxOptions = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItemJitterOptions = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItemTufteOptions = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItemViolinOptions = New System.Windows.Forms.ToolStripMenuItem() Me.ucrInputSummaries = New instat.ucrInputComboBox() + Me.cmdOptions = New instat.ucrSplitButton() + Me.ucrChkTufte = New instat.ucrCheck() Me.ucrChkGrouptoConnect = New instat.ucrCheck() Me.ucrNudTransparency = New instat.ucrNud() Me.ucrNudJitter = New instat.ucrNud() @@ -63,19 +69,9 @@ Partial Class dlgBoxplot Me.ucrByFactorsReceiver = New instat.ucrReceiverSingle() Me.ucrBase = New instat.ucrButtons() Me.ucrPnlPlots = New instat.UcrPanel() + Me.contextMenuStripOptions.SuspendLayout() Me.SuspendLayout() ' - 'cmdOptions - ' - Me.cmdOptions.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdOptions.Location = New System.Drawing.Point(10, 268) - Me.cmdOptions.Name = "cmdOptions" - Me.cmdOptions.Size = New System.Drawing.Size(149, 25) - Me.cmdOptions.TabIndex = 11 - Me.cmdOptions.Tag = "Options" - Me.cmdOptions.Text = "Plot Options" - Me.cmdOptions.UseVisualStyleBackColor = True - ' 'lblByFactors ' Me.lblByFactors.AutoSize = True @@ -98,17 +94,6 @@ Partial Class dlgBoxplot Me.lblBySecondFactor.Tag = "By_Second_Factor:" Me.lblBySecondFactor.Text = "Second Factor (Optional):" ' - 'cmdBoxPlotOptions - ' - Me.cmdBoxPlotOptions.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdBoxPlotOptions.Location = New System.Drawing.Point(10, 237) - Me.cmdBoxPlotOptions.Name = "cmdBoxPlotOptions" - Me.cmdBoxPlotOptions.Size = New System.Drawing.Size(149, 25) - Me.cmdBoxPlotOptions.TabIndex = 10 - Me.cmdBoxPlotOptions.Tag = "Boxplot_Options" - Me.cmdBoxPlotOptions.Text = "Box Options" - Me.cmdBoxPlotOptions.UseVisualStyleBackColor = True - ' 'rdoBoxplotTufte ' Me.rdoBoxplotTufte.Appearance = System.Windows.Forms.Appearance.Button @@ -164,7 +149,7 @@ Partial Class dlgBoxplot ' Me.lblJitter.AutoSize = True Me.lblJitter.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblJitter.Location = New System.Drawing.Point(157, 353) + Me.lblJitter.Location = New System.Drawing.Point(128, 360) Me.lblJitter.Name = "lblJitter" Me.lblJitter.Size = New System.Drawing.Size(32, 13) Me.lblJitter.TabIndex = 18 @@ -175,21 +160,48 @@ Partial Class dlgBoxplot ' Me.lblTransparency.AutoSize = True Me.lblTransparency.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblTransparency.Location = New System.Drawing.Point(251, 352) + Me.lblTransparency.Location = New System.Drawing.Point(223, 359) Me.lblTransparency.Name = "lblTransparency" Me.lblTransparency.Size = New System.Drawing.Size(75, 13) Me.lblTransparency.TabIndex = 20 Me.lblTransparency.Tag = "By_Factor:" Me.lblTransparency.Text = "Transparency:" ' - 'ucrChkTufte + 'contextMenuStripOptions ' - Me.ucrChkTufte.AutoSize = True - Me.ucrChkTufte.Checked = False - Me.ucrChkTufte.Location = New System.Drawing.Point(275, 313) - Me.ucrChkTufte.Name = "ucrChkTufte" - Me.ucrChkTufte.Size = New System.Drawing.Size(145, 23) - Me.ucrChkTufte.TabIndex = 24 + Me.contextMenuStripOptions.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.toolStripMenuItemPlotOptions, Me.toolStripMenuItemBoxOptions, Me.toolStripMenuItemJitterOptions, Me.toolStripMenuItemTufteOptions, Me.toolStripMenuItemViolinOptions}) + Me.contextMenuStripOptions.Name = "contextMenuStripOk" + Me.contextMenuStripOptions.Size = New System.Drawing.Size(150, 114) + ' + 'toolStripMenuItemPlotOptions + ' + Me.toolStripMenuItemPlotOptions.Name = "toolStripMenuItemPlotOptions" + Me.toolStripMenuItemPlotOptions.Size = New System.Drawing.Size(149, 22) + Me.toolStripMenuItemPlotOptions.Text = "Plot Options" + ' + 'toolStripMenuItemBoxOptions + ' + Me.toolStripMenuItemBoxOptions.Name = "toolStripMenuItemBoxOptions" + Me.toolStripMenuItemBoxOptions.Size = New System.Drawing.Size(149, 22) + Me.toolStripMenuItemBoxOptions.Text = "Box Options" + ' + 'toolStripMenuItemJitterOptions + ' + Me.toolStripMenuItemJitterOptions.Name = "toolStripMenuItemJitterOptions" + Me.toolStripMenuItemJitterOptions.Size = New System.Drawing.Size(149, 22) + Me.toolStripMenuItemJitterOptions.Text = "Jitter Options" + ' + 'toolStripMenuItemTufteOptions + ' + Me.toolStripMenuItemTufteOptions.Name = "toolStripMenuItemTufteOptions" + Me.toolStripMenuItemTufteOptions.Size = New System.Drawing.Size(149, 22) + Me.toolStripMenuItemTufteOptions.Text = "Tufte Options" + ' + 'toolStripMenuItemViolinOptions + ' + Me.toolStripMenuItemViolinOptions.Name = "toolStripMenuItemViolinOptions" + Me.toolStripMenuItemViolinOptions.Size = New System.Drawing.Size(149, 22) + Me.toolStripMenuItemViolinOptions.Text = "Violin Options" ' 'ucrInputSummaries ' @@ -197,16 +209,38 @@ Partial Class dlgBoxplot Me.ucrInputSummaries.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrInputSummaries.GetSetSelectedIndex = -1 Me.ucrInputSummaries.IsReadOnly = False - Me.ucrInputSummaries.Location = New System.Drawing.Point(160, 375) + Me.ucrInputSummaries.Location = New System.Drawing.Point(130, 327) Me.ucrInputSummaries.Name = "ucrInputSummaries" - Me.ucrInputSummaries.Size = New System.Drawing.Size(137, 21) - Me.ucrInputSummaries.TabIndex = 22 + Me.ucrInputSummaries.Size = New System.Drawing.Size(81, 21) + Me.ucrInputSummaries.TabIndex = 16 + ' + 'cmdOptions + ' + Me.cmdOptions.AutoSize = True + Me.cmdOptions.ContextMenuStrip = Me.contextMenuStripOptions + Me.cmdOptions.Location = New System.Drawing.Point(10, 238) + Me.cmdOptions.Name = "cmdOptions" + Me.cmdOptions.Size = New System.Drawing.Size(115, 23) + Me.cmdOptions.SplitMenuStrip = Me.contextMenuStripOptions + Me.cmdOptions.TabIndex = 12 + Me.cmdOptions.Tag = "Plot Options" + Me.cmdOptions.Text = "Plot Options" + Me.cmdOptions.UseVisualStyleBackColor = True + ' + 'ucrChkTufte + ' + Me.ucrChkTufte.AutoSize = True + Me.ucrChkTufte.Checked = False + Me.ucrChkTufte.Location = New System.Drawing.Point(275, 313) + Me.ucrChkTufte.Name = "ucrChkTufte" + Me.ucrChkTufte.Size = New System.Drawing.Size(145, 23) + Me.ucrChkTufte.TabIndex = 11 ' 'ucrChkGrouptoConnect ' Me.ucrChkGrouptoConnect.AutoSize = True Me.ucrChkGrouptoConnect.Checked = False - Me.ucrChkGrouptoConnect.Location = New System.Drawing.Point(10, 375) + Me.ucrChkGrouptoConnect.Location = New System.Drawing.Point(10, 328) Me.ucrChkGrouptoConnect.Name = "ucrChkGrouptoConnect" Me.ucrChkGrouptoConnect.Size = New System.Drawing.Size(144, 23) Me.ucrChkGrouptoConnect.TabIndex = 15 @@ -216,7 +250,7 @@ Partial Class dlgBoxplot Me.ucrNudTransparency.AutoSize = True Me.ucrNudTransparency.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudTransparency.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudTransparency.Location = New System.Drawing.Point(332, 349) + Me.ucrNudTransparency.Location = New System.Drawing.Point(301, 356) Me.ucrNudTransparency.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudTransparency.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudTransparency.Name = "ucrNudTransparency" @@ -229,7 +263,7 @@ Partial Class dlgBoxplot Me.ucrNudJitter.AutoSize = True Me.ucrNudJitter.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudJitter.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudJitter.Location = New System.Drawing.Point(195, 349) + Me.ucrNudJitter.Location = New System.Drawing.Point(164, 356) Me.ucrNudJitter.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudJitter.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudJitter.Name = "ucrNudJitter" @@ -241,10 +275,10 @@ Partial Class dlgBoxplot ' Me.ucrChkAddPoints.AutoSize = True Me.ucrChkAddPoints.Checked = False - Me.ucrChkAddPoints.Location = New System.Drawing.Point(10, 349) + Me.ucrChkAddPoints.Location = New System.Drawing.Point(10, 356) Me.ucrChkAddPoints.Name = "ucrChkAddPoints" - Me.ucrChkAddPoints.Size = New System.Drawing.Size(149, 23) - Me.ucrChkAddPoints.TabIndex = 14 + Me.ucrChkAddPoints.Size = New System.Drawing.Size(115, 23) + Me.ucrChkAddPoints.TabIndex = 17 ' 'ucrChkSwapParameters ' @@ -254,34 +288,34 @@ Partial Class dlgBoxplot Me.ucrChkSwapParameters.Location = New System.Drawing.Point(275, 290) Me.ucrChkSwapParameters.Name = "ucrChkSwapParameters" Me.ucrChkSwapParameters.Size = New System.Drawing.Size(145, 23) - Me.ucrChkSwapParameters.TabIndex = 17 + Me.ucrChkSwapParameters.TabIndex = 10 ' 'ucrSaveBoxplot ' Me.ucrSaveBoxplot.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrSaveBoxplot.Location = New System.Drawing.Point(10, 401) + Me.ucrSaveBoxplot.Location = New System.Drawing.Point(10, 384) Me.ucrSaveBoxplot.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.ucrSaveBoxplot.Name = "ucrSaveBoxplot" Me.ucrSaveBoxplot.Size = New System.Drawing.Size(328, 24) - Me.ucrSaveBoxplot.TabIndex = 16 + Me.ucrSaveBoxplot.TabIndex = 22 ' 'ucrChkHorizontalBoxplot ' Me.ucrChkHorizontalBoxplot.AutoSize = True Me.ucrChkHorizontalBoxplot.Checked = False - Me.ucrChkHorizontalBoxplot.Location = New System.Drawing.Point(10, 324) + Me.ucrChkHorizontalBoxplot.Location = New System.Drawing.Point(10, 300) Me.ucrChkHorizontalBoxplot.Name = "ucrChkHorizontalBoxplot" Me.ucrChkHorizontalBoxplot.Size = New System.Drawing.Size(238, 23) - Me.ucrChkHorizontalBoxplot.TabIndex = 13 + Me.ucrChkHorizontalBoxplot.TabIndex = 14 ' 'ucrChkVarWidth ' Me.ucrChkVarWidth.AutoSize = True Me.ucrChkVarWidth.Checked = False - Me.ucrChkVarWidth.Location = New System.Drawing.Point(10, 299) + Me.ucrChkVarWidth.Location = New System.Drawing.Point(10, 272) Me.ucrChkVarWidth.Name = "ucrChkVarWidth" Me.ucrChkVarWidth.Size = New System.Drawing.Size(238, 23) - Me.ucrChkVarWidth.TabIndex = 12 + Me.ucrChkVarWidth.TabIndex = 13 ' 'ucrVariablesAsFactorForBoxplot ' @@ -338,9 +372,9 @@ Partial Class dlgBoxplot ' Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(10, 430) + Me.ucrBase.Location = New System.Drawing.Point(10, 412) Me.ucrBase.Name = "ucrBase" - Me.ucrBase.Size = New System.Drawing.Size(405, 52) + Me.ucrBase.Size = New System.Drawing.Size(408, 52) Me.ucrBase.TabIndex = 23 ' 'ucrPnlPlots @@ -356,9 +390,10 @@ Partial Class dlgBoxplot Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True - Me.ClientSize = New System.Drawing.Size(425, 484) - Me.Controls.Add(Me.ucrChkTufte) + Me.ClientSize = New System.Drawing.Size(425, 466) Me.Controls.Add(Me.ucrInputSummaries) + Me.Controls.Add(Me.cmdOptions) + Me.Controls.Add(Me.ucrChkTufte) Me.Controls.Add(Me.ucrChkGrouptoConnect) Me.Controls.Add(Me.ucrNudTransparency) Me.Controls.Add(Me.lblTransparency) @@ -378,10 +413,8 @@ Partial Class dlgBoxplot Me.Controls.Add(Me.lblBySecondFactor) Me.Controls.Add(Me.lblByFactors) Me.Controls.Add(Me.ucrByFactorsReceiver) - Me.Controls.Add(Me.cmdOptions) Me.Controls.Add(Me.ucrBase) Me.Controls.Add(Me.ucrPnlPlots) - Me.Controls.Add(Me.cmdBoxPlotOptions) Me.Cursor = System.Windows.Forms.Cursors.Default Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.MaximizeBox = False @@ -391,18 +424,17 @@ Partial Class dlgBoxplot Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Tag = "Boxplot" Me.Text = "Boxplot Options" + Me.contextMenuStripOptions.ResumeLayout(False) Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents ucrBase As ucrButtons - Friend WithEvents cmdOptions As Button Friend WithEvents ucrByFactorsReceiver As ucrReceiverSingle Friend WithEvents lblByFactors As Label Friend WithEvents ucrSelectorBoxPlot As ucrSelectorByDataFrameAddRemove Friend WithEvents ucrSecondFactorReceiver As ucrReceiverSingle Friend WithEvents lblBySecondFactor As Label - Friend WithEvents cmdBoxPlotOptions As Button Friend WithEvents ucrVariablesAsFactorForBoxplot As ucrVariablesAsFactor Friend WithEvents rdoBoxplotTufte As RadioButton Friend WithEvents rdoJitter As RadioButton @@ -417,7 +449,14 @@ Partial Class dlgBoxplot Friend WithEvents ucrNudJitter As ucrNud Friend WithEvents lblJitter As Label Friend WithEvents ucrChkAddPoints As ucrCheck - Friend WithEvents ucrInputSummaries As ucrInputComboBox Friend WithEvents ucrChkGrouptoConnect As ucrCheck Friend WithEvents ucrChkTufte As ucrCheck + Friend WithEvents cmdOptions As ucrSplitButton + Friend WithEvents contextMenuStripOptions As ContextMenuStrip + Friend WithEvents toolStripMenuItemPlotOptions As ToolStripMenuItem + Friend WithEvents toolStripMenuItemBoxOptions As ToolStripMenuItem + Friend WithEvents toolStripMenuItemJitterOptions As ToolStripMenuItem + Friend WithEvents toolStripMenuItemViolinOptions As ToolStripMenuItem + Friend WithEvents toolStripMenuItemTufteOptions As ToolStripMenuItem + Friend WithEvents ucrInputSummaries As ucrInputComboBox End Class diff --git a/instat/dlgBoxPlot.resx b/instat/dlgBoxPlot.resx index 29dcb1b3a35..4f920f19046 100644 --- a/instat/dlgBoxPlot.resx +++ b/instat/dlgBoxPlot.resx @@ -117,4 +117,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + \ No newline at end of file diff --git a/instat/dlgBoxPlot.vb b/instat/dlgBoxPlot.vb index 4f4381649ce..797848abde0 100644 --- a/instat/dlgBoxPlot.vb +++ b/instat/dlgBoxPlot.vb @@ -73,6 +73,7 @@ Public Class dlgBoxplot bReset = False autoTranslate(Me) TestOkEnabled() + DialogueSize() End Sub Private Sub InitialiseDialog() @@ -182,6 +183,7 @@ Public Class dlgBoxplot ucrChkGrouptoConnect.AddParameterPresentCondition(False, strStatSummaryParameterName, False) 'this control exists but diabled for now ucrChkSwapParameters.SetText("swap Parameters") + DialogueSize() End Sub Private Sub SetDefaults() @@ -277,7 +279,6 @@ Public Class dlgBoxplot dctThemeFunctions = New Dictionary(Of String, RFunction)(GgplotDefaults.dctThemeFunctions) clsBaseOperator.SetAssignTo("last_graph", strTempDataframe:=ucrSelectorBoxPlot.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) - TempOptionsDisabledInMultipleVariablesCase() TestOkEnabled() End Sub @@ -317,21 +318,7 @@ Public Class dlgBoxplot TestOkEnabled() End Sub - Private Sub cmdOptions_Click(sender As Object, e As EventArgs) Handles cmdOptions.Click - sdgPlots.SetRCode(clsBaseOperator, clsNewThemeFunction:=clsThemeFunction, dctNewThemeFunctions:=dctThemeFunctions, clsNewGlobalAesFunction:=clsRaesFunction, clsNewXScalecontinuousFunction:=clsXScaleContinuousFunction, - clsNewYScalecontinuousFunction:=clsYScaleContinuousFunction, clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, - clsNewFacetFunction:=clsRFacetFunction, clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, clsNewXScaleDateFunction:=clsXScaleDateFunction, - clsNewScaleFillViridisFunction:=clsScaleFillViridisFunction, clsNewScaleColourViridisFunction:=clsScaleColourViridisFunction, clsNewYScaleDateFunction:=clsYScaleDateFunction, bNewEnableDiscrete:=False, - clsNewAnnotateFunction:=clsAnnotateFunction, ucrNewBaseSelector:=ucrSelectorBoxPlot, strMainDialogGeomParameterNames:=strGeomParameterNames, bReset:=bResetSubdialog) - sdgPlots.ShowDialog() - bResetSubdialog = False - - 'this syncs the coordflip in sdgplots and this main dlg - ucrChkHorizontalBoxplot.SetRCode(clsBaseOperator, bReset) - - End Sub - - Private Sub cmdBoxPlotOptions_Click(sender As Object, e As EventArgs) Handles cmdBoxPlotOptions.Click + Private Sub BoxPlotOptions() 'SetupLayer sends the components storing the plot info (clsRgeom_boxplotFunction, clsRggplotFunction, ...) of dlgBoxPlot through to sdgLayerOptions where these will be edited. sdgLayerOptions.SetupLayer(clsNewGgPlot:=clsRggplotFunction, clsNewGeomFunc:=clsCurrGeomFunc, clsNewGlobalAesFunc:=clsRaesFunction, clsNewLocalAes:=clsLocalRaesFunction, bFixGeom:=True, ucrNewBaseSelector:=ucrSelectorBoxPlot, bApplyAesGlobally:=True, bReset:=bResetBoxLayerSubdialog) sdgLayerOptions.ShowDialog() @@ -373,25 +360,21 @@ Public Class dlgBoxplot clsStatSummary.AddParameter("size", 1.5, iPosition:=3) If rdoBoxplotTufte.Checked Then If ucrChkTufte.Checked Then - cmdBoxPlotOptions.Text = "Tufte Box Options" ucrSaveBoxplot.SetPrefix("tufte_boxplot") clsCurrGeomFunc = clsTufteBoxplotFunc clsStatSummary.AddParameter("size", 0.7, iPosition:=3) ucrSecondFactorReceiver.ChangeParameterName("colour") Else - cmdBoxPlotOptions.Text = "Box Options" ucrSaveBoxplot.SetPrefix("box_plot") ucrSecondFactorReceiver.ChangeParameterName("fill") clsCurrGeomFunc = clsBoxplotFunc End If ElseIf rdoJitter.Checked Then - cmdBoxPlotOptions.Text = "Jitter Options" ucrSaveBoxplot.SetPrefix("jitter") ucrSecondFactorReceiver.ChangeParameterName("colour") clsCurrGeomFunc = clsJitterplotFunc Else - cmdBoxPlotOptions.Text = "Violin Options" ucrSaveBoxplot.SetPrefix("violin") ucrSecondFactorReceiver.ChangeParameterName("fill") clsCurrGeomFunc = clsViolinplotFunc @@ -403,36 +386,80 @@ Public Class dlgBoxplot autoTranslate(Me) End Sub - Private Sub TempOptionsDisabledInMultipleVariablesCase() - If ucrVariablesAsFactorForBoxplot.bSingleVariable Then - cmdBoxPlotOptions.Enabled = True - cmdOptions.Enabled = True + Private Sub ucrPnlPlots_ControlValueChanged() Handles ucrPnlPlots.ControlValueChanged, ucrChkTufte.ControlContentsChanged + SetGeomPrefixFillColourAes() + DialogueSize() + End Sub + + Private Sub ucrChkGrouptoConnect_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkGrouptoConnect.ControlValueChanged + If ucrChkGrouptoConnect.Checked Then + clsBaseOperator.AddParameter(strStatSummaryParameterName, clsRFunctionParameter:=clsStatSummary, iPosition:=4) Else - cmdBoxPlotOptions.Enabled = False - cmdOptions.Enabled = False + clsBaseOperator.RemoveParameterByName(strStatSummaryParameterName) End If End Sub - Private Sub ucrVariablesAsFactorForBoxplot_ControlContentsChanged() Handles ucrVariablesAsFactorForBoxplot.ControlContentsChanged - TempOptionsDisabledInMultipleVariablesCase() + Private Sub cmdOptions_Click_1(sender As Object, e As EventArgs) Handles cmdOptions.Click + sdgPlots.SetRCode(clsBaseOperator, clsNewThemeFunction:=clsThemeFunction, dctNewThemeFunctions:=dctThemeFunctions, clsNewGlobalAesFunction:=clsRaesFunction, clsNewXScalecontinuousFunction:=clsXScaleContinuousFunction, + clsNewYScalecontinuousFunction:=clsYScaleContinuousFunction, clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, + clsNewFacetFunction:=clsRFacetFunction, clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, clsNewXScaleDateFunction:=clsXScaleDateFunction, + clsNewScaleFillViridisFunction:=clsScaleFillViridisFunction, clsNewScaleColourViridisFunction:=clsScaleColourViridisFunction, clsNewYScaleDateFunction:=clsYScaleDateFunction, bNewEnableDiscrete:=False, + clsNewAnnotateFunction:=clsAnnotateFunction, ucrNewBaseSelector:=ucrSelectorBoxPlot, strMainDialogGeomParameterNames:=strGeomParameterNames, bReset:=bResetSubdialog) + sdgPlots.ShowDialog() + bResetSubdialog = False + + 'this syncs the coordflip in sdgplots and this main dlg + ucrChkHorizontalBoxplot.SetRCode(clsBaseOperator, bReset) End Sub - Private Sub ucrPnlPlots_ControlValueChanged() Handles ucrPnlPlots.ControlValueChanged, ucrChkTufte.ControlContentsChanged - SetGeomPrefixFillColourAes() + Private Sub toolStripMenuItemBoxOptions_Click(sender As Object, e As EventArgs) Handles toolStripMenuItemBoxOptions.Click + BoxPlotOptions() End Sub - Private Sub ucrSaveBoxplot_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrSaveBoxplot.ControlContentsChanged, ucrVariablesAsFactorForBoxplot.ControlContentsChanged - TestOkEnabled() + Private Sub toolStripMenuItemTufteOptions_Click(sender As Object, e As EventArgs) Handles toolStripMenuItemTufteOptions.Click + BoxPlotOptions() End Sub - Private Sub ucrChkGrouptoConnect_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkGrouptoConnect.ControlValueChanged - If ucrChkGrouptoConnect.Checked Then - clsBaseOperator.AddParameter(strStatSummaryParameterName, clsRFunctionParameter:=clsStatSummary, iPosition:=4) + Private Sub toolStripMenuItemJitterOptions_Click(sender As Object, e As EventArgs) Handles toolStripMenuItemJitterOptions.Click + BoxPlotOptions() + End Sub + + Private Sub toolStripMenuItemViolinOptions_Click(sender As Object, e As EventArgs) Handles toolStripMenuItemViolinOptions.Click + BoxPlotOptions() + End Sub + + Private Sub toolStripMenuItemPlotOptions_Click(sender As Object, e As EventArgs) Handles toolStripMenuItemPlotOptions.Click + sdgPlots.SetRCode(clsBaseOperator, clsNewThemeFunction:=clsThemeFunction, dctNewThemeFunctions:=dctThemeFunctions, clsNewGlobalAesFunction:=clsRaesFunction, clsNewXScalecontinuousFunction:=clsXScaleContinuousFunction, + clsNewYScalecontinuousFunction:=clsYScaleContinuousFunction, clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, + clsNewFacetFunction:=clsRFacetFunction, clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, clsNewXScaleDateFunction:=clsXScaleDateFunction, + clsNewScaleFillViridisFunction:=clsScaleFillViridisFunction, clsNewScaleColourViridisFunction:=clsScaleColourViridisFunction, clsNewYScaleDateFunction:=clsYScaleDateFunction, bNewEnableDiscrete:=False, + clsNewAnnotateFunction:=clsAnnotateFunction, ucrNewBaseSelector:=ucrSelectorBoxPlot, strMainDialogGeomParameterNames:=strGeomParameterNames, bReset:=bResetSubdialog) + sdgPlots.ShowDialog() + bResetSubdialog = False + + 'this syncs the coordflip in sdgplots and this main dlg + ucrChkHorizontalBoxplot.SetRCode(clsBaseOperator, bReset) + End Sub + Private Sub DialogueSize() + If rdoBoxplotTufte.Checked Then + Me.Size = New Size(441, 505) + Me.ucrSaveBoxplot.Location = New Point(10, 384) + Me.ucrBase.Location = New Point(10, 413) + ElseIf rdoViolin.Checked Then + Me.Size = New Size(441, 505) + Me.ucrSaveBoxplot.Location = New Point(10, 384) + Me.ucrBase.Location = New Point(10, 413) Else - clsBaseOperator.RemoveParameterByName(strStatSummaryParameterName) + Me.Size = New Size(441, 479) + Me.ucrSaveBoxplot.Location = New Point(10, 356) + Me.ucrBase.Location = New Point(10, 384) End If End Sub + Private Sub ucrSaveBoxplot_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrSaveBoxplot.ControlContentsChanged, ucrVariablesAsFactorForBoxplot.ControlContentsChanged + TestOkEnabled() + End Sub + 'this code is commented out but will work once we get the feature of linking controls with the contents of a receiver 'Private Sub SwapFactors() ' If ucrChkSwapParameters.Checked Then From fe6e4535b1ad71bf8250f390f79180a6db41ce60 Mon Sep 17 00:00:00 2001 From: EstherNjeri <74548350+EstherNjeriLiberatta@users.noreply.github.com> Date: Wed, 13 Jul 2022 17:08:48 +0300 Subject: [PATCH 2/6] Minor design changes --- instat/dlgBoxPlot.designer.vb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/instat/dlgBoxPlot.designer.vb b/instat/dlgBoxPlot.designer.vb index db08338c635..b413ef15e1b 100644 --- a/instat/dlgBoxPlot.designer.vb +++ b/instat/dlgBoxPlot.designer.vb @@ -76,7 +76,7 @@ Partial Class dlgBoxplot ' Me.lblByFactors.AutoSize = True Me.lblByFactors.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblByFactors.Location = New System.Drawing.Point(272, 207) + Me.lblByFactors.Location = New System.Drawing.Point(272, 205) Me.lblByFactors.Name = "lblByFactors" Me.lblByFactors.Size = New System.Drawing.Size(88, 13) Me.lblByFactors.TabIndex = 6 @@ -218,9 +218,9 @@ Partial Class dlgBoxplot ' Me.cmdOptions.AutoSize = True Me.cmdOptions.ContextMenuStrip = Me.contextMenuStripOptions - Me.cmdOptions.Location = New System.Drawing.Point(10, 238) + Me.cmdOptions.Location = New System.Drawing.Point(10, 236) Me.cmdOptions.Name = "cmdOptions" - Me.cmdOptions.Size = New System.Drawing.Size(115, 23) + Me.cmdOptions.Size = New System.Drawing.Size(148, 25) Me.cmdOptions.SplitMenuStrip = Me.contextMenuStripOptions Me.cmdOptions.TabIndex = 12 Me.cmdOptions.Tag = "Plot Options" From 8a3de23622bbd11e8f9eeac2bb0e64fd472830e5 Mon Sep 17 00:00:00 2001 From: EstherNjeri <74548350+EstherNjeriLiberatta@users.noreply.github.com> Date: Wed, 13 Jul 2022 17:10:41 +0300 Subject: [PATCH 3/6] Minor code changes --- instat/dlgBoxPlot.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/dlgBoxPlot.vb b/instat/dlgBoxPlot.vb index 797848abde0..f70b041ee18 100644 --- a/instat/dlgBoxPlot.vb +++ b/instat/dlgBoxPlot.vb @@ -399,7 +399,7 @@ Public Class dlgBoxplot End If End Sub - Private Sub cmdOptions_Click_1(sender As Object, e As EventArgs) Handles cmdOptions.Click + Private Sub cmdOptions_Click(sender As Object, e As EventArgs) Handles cmdOptions.Click sdgPlots.SetRCode(clsBaseOperator, clsNewThemeFunction:=clsThemeFunction, dctNewThemeFunctions:=dctThemeFunctions, clsNewGlobalAesFunction:=clsRaesFunction, clsNewXScalecontinuousFunction:=clsXScaleContinuousFunction, clsNewYScalecontinuousFunction:=clsYScaleContinuousFunction, clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, clsNewFacetFunction:=clsRFacetFunction, clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, clsNewXScaleDateFunction:=clsXScaleDateFunction, From 7091f729f518af132ca481eb3d65c456ce2b37d3 Mon Sep 17 00:00:00 2001 From: EstherNjeri <74548350+EstherNjeriLiberatta@users.noreply.github.com> Date: Tue, 19 Jul 2022 16:19:05 +0300 Subject: [PATCH 4/6] Minor code amendments --- instat/dlgBoxPlot.vb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/instat/dlgBoxPlot.vb b/instat/dlgBoxPlot.vb index f70b041ee18..f9fb04874a7 100644 --- a/instat/dlgBoxPlot.vb +++ b/instat/dlgBoxPlot.vb @@ -364,20 +364,32 @@ Public Class dlgBoxplot clsCurrGeomFunc = clsTufteBoxplotFunc clsStatSummary.AddParameter("size", 0.7, iPosition:=3) ucrSecondFactorReceiver.ChangeParameterName("colour") + toolStripMenuItemTufteOptions.Enabled = True Else ucrSaveBoxplot.SetPrefix("box_plot") ucrSecondFactorReceiver.ChangeParameterName("fill") clsCurrGeomFunc = clsBoxplotFunc + toolStripMenuItemTufteOptions.Enabled = False End If - + toolStripMenuItemJitterOptions.Enabled = False + toolStripMenuItemViolinOptions.Enabled = False + toolStripMenuItemBoxOptions.Enabled = True ElseIf rdoJitter.Checked Then ucrSaveBoxplot.SetPrefix("jitter") ucrSecondFactorReceiver.ChangeParameterName("colour") clsCurrGeomFunc = clsJitterplotFunc + toolStripMenuItemJitterOptions.Enabled = True + toolStripMenuItemViolinOptions.Enabled = False + toolStripMenuItemBoxOptions.Enabled = False + toolStripMenuItemTufteOptions.Enabled = False Else ucrSaveBoxplot.SetPrefix("violin") ucrSecondFactorReceiver.ChangeParameterName("fill") clsCurrGeomFunc = clsViolinplotFunc + toolStripMenuItemJitterOptions.Enabled = False + toolStripMenuItemViolinOptions.Enabled = True + toolStripMenuItemBoxOptions.Enabled = False + toolStripMenuItemTufteOptions.Enabled = False End If 'TODO Am not sure why the geomfunc parameter which carries clsCurrGeomFunc(current geom function) 'does Not Update() properly when readio buttons are changed From 58d92c8ca8e23574d6310e2c8ceb1620e0ed9e0a Mon Sep 17 00:00:00 2001 From: EstherNjeri <74548350+EstherNjeriLiberatta@users.noreply.github.com> Date: Mon, 1 Aug 2022 16:21:21 +0300 Subject: [PATCH 5/6] Minor code changes --- instat/dlgBoxPlot.vb | 285 +++++++++++++++++++++++++++---------------- 1 file changed, 182 insertions(+), 103 deletions(-) diff --git a/instat/dlgBoxPlot.vb b/instat/dlgBoxPlot.vb index f9fb04874a7..355ddbb4d56 100644 --- a/instat/dlgBoxPlot.vb +++ b/instat/dlgBoxPlot.vb @@ -44,11 +44,11 @@ Public Class dlgBoxplot Private bResetBoxLayerSubdialog As Boolean = True 'Adding new function s - Private clsBoxplotFunc As New RFunction - Private clsTufteBoxplotFunc As New RFunction - Private clsJitterplotFunc As New RFunction - Private clsViolinplotFunc As New RFunction - Private clsCurrGeomFunc As New RFunction + Private clsBoxplotFunction As New RFunction + Private clsTufteBoxplotFunction As New RFunction + Private clsJitterplotFunction As New RFunction + Private clsViolinplotFunction As New RFunction + Private clsCurrGeomFunction As New RFunction ' Jitter function that can be added to the boxplot/violin base layer Private clsAddedJitterFunc As New RFunction Private clsXScaleDateFunction As New RFunction @@ -195,10 +195,10 @@ Public Class dlgBoxplot clsStatSummary = New RFunction 'Setting up new functions - clsBoxplotFunc = New RFunction - clsTufteBoxplotFunc = New RFunction - clsJitterplotFunc = New RFunction - clsViolinplotFunc = New RFunction + clsBoxplotFunction = New RFunction + clsTufteBoxplotFunction = New RFunction + clsJitterplotFunction = New RFunction + clsViolinplotFunction = New RFunction clsAddedJitterFunc.Clear() @@ -212,27 +212,27 @@ Public Class dlgBoxplot bResetBoxLayerSubdialog = True 'Setting current geom as boxplot - clsCurrGeomFunc.SetPackageName("ggplot2") - clsCurrGeomFunc = clsBoxplotFunc + clsCurrGeomFunction.SetPackageName("ggplot2") + clsCurrGeomFunction = clsBoxplotFunction - clsBoxplotFunc.SetPackageName("ggplot2") - clsBoxplotFunc.SetRCommand("geom_boxplot") - clsBoxplotFunc.AddParameter("varwidth", "FALSE", iPosition:=0) - clsBoxplotFunc.AddParameter("outlier.colour", Chr(34) & "red" & Chr(34), iPosition:=1) + clsBoxplotFunction.SetPackageName("ggplot2") + clsBoxplotFunction.SetRCommand("geom_boxplot") + clsBoxplotFunction.AddParameter("varwidth", "FALSE", iPosition:=0) + clsBoxplotFunction.AddParameter("outlier.colour", Chr(34) & "red" & Chr(34), iPosition:=1) - clsTufteBoxplotFunc.SetPackageName("ggthemes") - clsTufteBoxplotFunc.SetRCommand("geom_tufteboxplot") - clsTufteBoxplotFunc.AddParameter("stat", Chr(34) & "boxplot" & Chr(34), iPosition:=0) - clsTufteBoxplotFunc.AddParameter("median.type", Chr(34) & "line" & Chr(34), iPosition:=1) - clsTufteBoxplotFunc.AddParameter("coef ", "1.5", iPosition:=14) + clsTufteBoxplotFunction.SetPackageName("ggthemes") + clsTufteBoxplotFunction.SetRCommand("geom_tufteboxplot") + clsTufteBoxplotFunction.AddParameter("stat", Chr(34) & "boxplot" & Chr(34), iPosition:=0) + clsTufteBoxplotFunction.AddParameter("median.type", Chr(34) & "line" & Chr(34), iPosition:=1) + clsTufteBoxplotFunction.AddParameter("coef ", "1.5", iPosition:=14) - clsViolinplotFunc.SetPackageName("ggplot2") - clsViolinplotFunc.SetRCommand("geom_violin") + clsViolinplotFunction.SetPackageName("ggplot2") + clsViolinplotFunction.SetRCommand("geom_violin") - clsJitterplotFunc.SetPackageName("ggplot2") - clsJitterplotFunc.SetRCommand("geom_jitter") - clsJitterplotFunc.AddParameter("height", 0, iPosition:=1) - clsJitterplotFunc.AddParameter("width", 0.2, iPosition:=2) + clsJitterplotFunction.SetPackageName("ggplot2") + clsJitterplotFunction.SetRCommand("geom_jitter") + clsJitterplotFunction.AddParameter("height", 0, iPosition:=1) + clsJitterplotFunction.AddParameter("width", 0.2, iPosition:=2) clsAddedJitterFunc.SetPackageName("ggplot2") clsAddedJitterFunc.SetRCommand("geom_jitter") @@ -242,7 +242,7 @@ Public Class dlgBoxplot 'Setting operation and adding parameters to baseoperator clsBaseOperator.SetOperation("+") clsBaseOperator.AddParameter("ggplot", clsRFunctionParameter:=clsRggplotFunction, iPosition:=0) - clsBaseOperator.AddParameter(strFirstParameterName, clsRFunctionParameter:=clsBoxplotFunc, iPosition:=2) + clsBaseOperator.AddParameter(strFirstParameterName, clsRFunctionParameter:=clsBoxplotFunction, iPosition:=2) clsRggplotFunction.SetPackageName("ggplot2") clsRggplotFunction.SetRCommand("ggplot") @@ -287,7 +287,7 @@ Public Class dlgBoxplot ucrSelectorBoxPlot.SetRCode(clsRggplotFunction, bReset) ucrChkHorizontalBoxplot.SetRCode(clsBaseOperator, bReset) - ucrChkVarWidth.SetRCode(clsBoxplotFunc, bReset) + ucrChkVarWidth.SetRCode(clsBoxplotFunction, bReset) 'passes in +cordflip ucrChkHorizontalBoxplot.SetRCode(clsBaseOperator, bReset) ucrVariablesAsFactorForBoxplot.SetRCode(clsRaesFunction, bReset) @@ -299,9 +299,9 @@ Public Class dlgBoxplot ucrNudTransparency.SetRCode(clsAddedJitterFunc, bReset) ucrInputSummaries.SetRCode(clsStatSummary, bReset) ucrChkGrouptoConnect.SetRCode(clsBaseOperator, bReset) - ucrPnlPlots.SetRCode(clsCurrGeomFunc, bReset) + ucrPnlPlots.SetRCode(clsCurrGeomFunction, bReset) - ucrChkTufte.SetRCode(clsCurrGeomFunc, bReset) + ucrChkTufte.SetRCode(clsCurrGeomFunction, bReset) End Sub Private Sub TestOkEnabled() @@ -318,89 +318,40 @@ Public Class dlgBoxplot TestOkEnabled() End Sub - Private Sub BoxPlotOptions() - 'SetupLayer sends the components storing the plot info (clsRgeom_boxplotFunction, clsRggplotFunction, ...) of dlgBoxPlot through to sdgLayerOptions where these will be edited. - sdgLayerOptions.SetupLayer(clsNewGgPlot:=clsRggplotFunction, clsNewGeomFunc:=clsCurrGeomFunc, clsNewGlobalAesFunc:=clsRaesFunction, clsNewLocalAes:=clsLocalRaesFunction, bFixGeom:=True, ucrNewBaseSelector:=ucrSelectorBoxPlot, bApplyAesGlobally:=True, bReset:=bResetBoxLayerSubdialog) - sdgLayerOptions.ShowDialog() - bResetBoxLayerSubdialog = False - 'Coming from the sdgLayerOptions, clsRgeom_boxplot and others has been modified. One then needs to display these modifications on the dlgBoxPlot. - If clsCurrGeomFunc.GetParameter("varwidth") IsNot Nothing Then - If clsCurrGeomFunc.GetParameter("varwidth").strArgumentValue = "TRUE" Then - ' chkVarwidth.Checked = True - 'Observe that changing the check of the chkVarwidth here doesn't trigger the checkchanged event. - End If - Else - 'chkVarwidth.Checked = False - End If - - 'The aesthetics parameters on the main dialog are repopulated as required. - For Each clsParam In clsRaesFunction.clsParameters - If clsParam.strArgumentName = "x" Then - If clsParam.strArgumentValue = Chr(34) & Chr(34) Then - ucrByFactorsReceiver.Clear() - Else - ucrByFactorsReceiver.Add(clsParam.strArgumentValue) - End If - 'In the y case, the vlue stored in the clsReasFunction in the multiplevariables case is "value", however that one shouldn't be written in the multiple variables receiver (otherwise it would stack all variables and the stack ("value") itself!). - 'Warning: what if someone used the name value for one of it's variables independently from the multiple variables method ? Here if the receiver is actually in single mode, the variable "value" will still be given back, which throws the problem back to the creation of "value" in the multiple receiver case. - ElseIf clsParam.strArgumentName = "y" AndAlso (clsParam.strArgumentValue <> "value" OrElse ucrVariablesAsFactorForBoxplot.bSingleVariable) Then - ucrVariablesAsFactorForBoxplot.Add(clsParam.strArgumentValue) - ElseIf clsParam.strArgumentName = "fill" Then - ucrSecondFactorReceiver.Add(clsParam.strArgumentValue) - End If - Next - - 'Question to be discussed: After running through the sdgLayerOptions, the clsCurrDataFrame parameters seem to have been cleared, such that in the multiple variable case, clsCurrDataFrame needs to be repopulated with "stack", "measure.vars" and "id.vars" parameters. Actually, even when repopulated, they are still not appearing in the script. ?? - 'This resets the factor receiver and causes it to be cleared of the correct variable. We don't want this. - 'ucrVariablesAsFactorForBoxplot.SetReceiverStatus() - End Sub - Private Sub SetGeomPrefixFillColourAes() 'Sets geom function, fill and colour aesthetics, ucrsave prefix and stat summary parameters clsStatSummary.AddParameter("size", 1.5, iPosition:=3) If rdoBoxplotTufte.Checked Then If ucrChkTufte.Checked Then ucrSaveBoxplot.SetPrefix("tufte_boxplot") - clsCurrGeomFunc = clsTufteBoxplotFunc + clsCurrGeomFunction = clsTufteBoxplotFunction clsStatSummary.AddParameter("size", 0.7, iPosition:=3) ucrSecondFactorReceiver.ChangeParameterName("colour") - toolStripMenuItemTufteOptions.Enabled = True Else ucrSaveBoxplot.SetPrefix("box_plot") ucrSecondFactorReceiver.ChangeParameterName("fill") - clsCurrGeomFunc = clsBoxplotFunc - toolStripMenuItemTufteOptions.Enabled = False + clsCurrGeomFunction = clsBoxplotFunction End If - toolStripMenuItemJitterOptions.Enabled = False - toolStripMenuItemViolinOptions.Enabled = False - toolStripMenuItemBoxOptions.Enabled = True ElseIf rdoJitter.Checked Then ucrSaveBoxplot.SetPrefix("jitter") ucrSecondFactorReceiver.ChangeParameterName("colour") - clsCurrGeomFunc = clsJitterplotFunc - toolStripMenuItemJitterOptions.Enabled = True - toolStripMenuItemViolinOptions.Enabled = False - toolStripMenuItemBoxOptions.Enabled = False - toolStripMenuItemTufteOptions.Enabled = False + clsCurrGeomFunction = clsJitterplotFunction Else ucrSaveBoxplot.SetPrefix("violin") ucrSecondFactorReceiver.ChangeParameterName("fill") - clsCurrGeomFunc = clsViolinplotFunc - toolStripMenuItemJitterOptions.Enabled = False - toolStripMenuItemViolinOptions.Enabled = True - toolStripMenuItemBoxOptions.Enabled = False - toolStripMenuItemTufteOptions.Enabled = False + clsCurrGeomFunction = clsViolinplotFunction End If - 'TODO Am not sure why the geomfunc parameter which carries clsCurrGeomFunc(current geom function) + 'TODO Am not sure why the geomfunc parameter which carries clsCurrGeomFunction(current geom function) 'does Not Update() properly when readio buttons are changed 'hence i have to force it to update properly after this if statement - clsBaseOperator.AddParameter(strFirstParameterName, clsRFunctionParameter:=clsCurrGeomFunc, iPosition:=2) + clsBaseOperator.AddParameter(strFirstParameterName, clsRFunctionParameter:=clsCurrGeomFunction, iPosition:=2) autoTranslate(Me) End Sub - Private Sub ucrPnlPlots_ControlValueChanged() Handles ucrPnlPlots.ControlValueChanged, ucrChkTufte.ControlContentsChanged + Private Sub ucrPnlPlots_ControlValueChanged() Handles ucrPnlPlots.ControlValueChanged, ucrChkTufte.ControlContentsChanged, ucrChkAddPoints.ControlValueChanged SetGeomPrefixFillColourAes() DialogueSize() + EnableDisableBoxplotOptions() End Sub Private Sub ucrChkGrouptoConnect_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkGrouptoConnect.ControlValueChanged @@ -411,7 +362,7 @@ Public Class dlgBoxplot End If End Sub - Private Sub cmdOptions_Click(sender As Object, e As EventArgs) Handles cmdOptions.Click + Private Sub cmdOptions_Click(sender As Object, e As EventArgs) Handles cmdOptions.Click, toolStripMenuItemPlotOptions.Click sdgPlots.SetRCode(clsBaseOperator, clsNewThemeFunction:=clsThemeFunction, dctNewThemeFunctions:=dctThemeFunctions, clsNewGlobalAesFunction:=clsRaesFunction, clsNewXScalecontinuousFunction:=clsXScaleContinuousFunction, clsNewYScalecontinuousFunction:=clsYScaleContinuousFunction, clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, clsNewFacetFunction:=clsRFacetFunction, clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, clsNewXScaleDateFunction:=clsXScaleDateFunction, @@ -425,33 +376,153 @@ Public Class dlgBoxplot End Sub Private Sub toolStripMenuItemBoxOptions_Click(sender As Object, e As EventArgs) Handles toolStripMenuItemBoxOptions.Click - BoxPlotOptions() + 'SetupLayer sends the components storing the plot info (clsRgeom_boxplotFunction, clsRggplotFunction, ...) of dlgBoxPlot through to sdgLayerOptions where these will be edited. + sdgLayerOptions.SetupLayer(clsNewGgPlot:=clsRggplotFunction, clsNewGeomFunc:=clsBoxplotFunction, clsNewGlobalAesFunc:=clsRaesFunction, clsNewLocalAes:=clsLocalRaesFunction, bFixGeom:=True, ucrNewBaseSelector:=ucrSelectorBoxPlot, bApplyAesGlobally:=True, bReset:=bResetBoxLayerSubdialog) + sdgLayerOptions.ShowDialog() + bResetBoxLayerSubdialog = False + 'Coming from the sdgLayerOptions, clsRgeom_boxplot and others has been modified. One then needs to display these modifications on the dlgBoxPlot. + If clsCurrGeomFunction.GetParameter("varwidth") IsNot Nothing Then + If clsCurrGeomFunction.GetParameter("varwidth").strArgumentValue = "TRUE" Then + ' chkVarwidth.Checked = True + 'Observe that changing the check of the chkVarwidth here doesn't trigger the checkchanged event. + End If + Else + 'chkVarwidth.Checked = False + End If + + 'The aesthetics parameters on the main dialog are repopulated as required. + For Each clsParam In clsRaesFunction.clsParameters + If clsParam.strArgumentName = "x" Then + If clsParam.strArgumentValue = Chr(34) & Chr(34) Then + ucrByFactorsReceiver.Clear() + Else + ucrByFactorsReceiver.Add(clsParam.strArgumentValue) + End If + 'In the y case, the vlue stored in the clsReasFunction in the multiplevariables case is "value", however that one shouldn't be written in the multiple variables receiver (otherwise it would stack all variables and the stack ("value") itself!). + 'Warning: what if someone used the name value for one of it's variables independently from the multiple variables method ? Here if the receiver is actually in single mode, the variable "value" will still be given back, which throws the problem back to the creation of "value" in the multiple receiver case. + ElseIf clsParam.strArgumentName = "y" AndAlso (clsParam.strArgumentValue <> "value" OrElse ucrVariablesAsFactorForBoxplot.bSingleVariable) Then + ucrVariablesAsFactorForBoxplot.Add(clsParam.strArgumentValue) + ElseIf clsParam.strArgumentName = "fill" Then + ucrSecondFactorReceiver.Add(clsParam.strArgumentValue) + End If + Next + + 'Question to be discussed: After running through the sdgLayerOptions, the clsCurrDataFrame parameters seem to have been cleared, such that in the multiple variable case, clsCurrDataFrame needs to be repopulated with "stack", "measure.vars" and "id.vars" parameters. Actually, even when repopulated, they are still not appearing in the script. ?? + 'This resets the factor receiver and causes it to be cleared of the correct variable. We don't want this. + 'ucrVariablesAsFactorForBoxplot.SetReceiverStatus() End Sub Private Sub toolStripMenuItemTufteOptions_Click(sender As Object, e As EventArgs) Handles toolStripMenuItemTufteOptions.Click - BoxPlotOptions() + 'SetupLayer sends the components storing the plot info (clsRgeom_boxplotFunction, clsRggplotFunction, ...) of dlgBoxPlot through to sdgLayerOptions where these will be edited. + sdgLayerOptions.SetupLayer(clsNewGgPlot:=clsRggplotFunction, clsNewGeomFunc:=clsTufteBoxplotFunction, clsNewGlobalAesFunc:=clsRaesFunction, clsNewLocalAes:=clsLocalRaesFunction, bFixGeom:=True, ucrNewBaseSelector:=ucrSelectorBoxPlot, bApplyAesGlobally:=True, bReset:=bResetBoxLayerSubdialog) + sdgLayerOptions.ShowDialog() + bResetBoxLayerSubdialog = False + 'Coming from the sdgLayerOptions, clsRgeom_boxplot and others has been modified. One then needs to display these modifications on the dlgBoxPlot. + If clsCurrGeomFunction.GetParameter("varwidth") IsNot Nothing Then + If clsCurrGeomFunction.GetParameter("varwidth").strArgumentValue = "TRUE" Then + ' chkVarwidth.Checked = True + 'Observe that changing the check of the chkVarwidth here doesn't trigger the checkchanged event. + End If + Else + 'chkVarwidth.Checked = False + End If + + 'The aesthetics parameters on the main dialog are repopulated as required. + For Each clsParam In clsRaesFunction.clsParameters + If clsParam.strArgumentName = "x" Then + If clsParam.strArgumentValue = Chr(34) & Chr(34) Then + ucrByFactorsReceiver.Clear() + Else + ucrByFactorsReceiver.Add(clsParam.strArgumentValue) + End If + 'In the y case, the vlue stored in the clsReasFunction in the multiplevariables case is "value", however that one shouldn't be written in the multiple variables receiver (otherwise it would stack all variables and the stack ("value") itself!). + 'Warning: what if someone used the name value for one of it's variables independently from the multiple variables method ? Here if the receiver is actually in single mode, the variable "value" will still be given back, which throws the problem back to the creation of "value" in the multiple receiver case. + ElseIf clsParam.strArgumentName = "y" AndAlso (clsParam.strArgumentValue <> "value" OrElse ucrVariablesAsFactorForBoxplot.bSingleVariable) Then + ucrVariablesAsFactorForBoxplot.Add(clsParam.strArgumentValue) + ElseIf clsParam.strArgumentName = "fill" Then + ucrSecondFactorReceiver.Add(clsParam.strArgumentValue) + End If + Next + + 'Question to be discussed: After running through the sdgLayerOptions, the clsCurrDataFrame parameters seem to have been cleared, such that in the multiple variable case, clsCurrDataFrame needs to be repopulated with "stack", "measure.vars" and "id.vars" parameters. Actually, even when repopulated, they are still not appearing in the script. ?? + 'This resets the factor receiver and causes it to be cleared of the correct variable. We don't want this. + 'ucrVariablesAsFactorForBoxplot.SetReceiverStatus() End Sub Private Sub toolStripMenuItemJitterOptions_Click(sender As Object, e As EventArgs) Handles toolStripMenuItemJitterOptions.Click - BoxPlotOptions() + 'SetupLayer sends the components storing the plot info (clsRgeom_boxplotFunction, clsRggplotFunction, ...) of dlgBoxPlot through to sdgLayerOptions where these will be edited. + sdgLayerOptions.SetupLayer(clsNewGgPlot:=clsRggplotFunction, clsNewGeomFunc:=clsJitterplotFunction, clsNewGlobalAesFunc:=clsRaesFunction, clsNewLocalAes:=clsLocalRaesFunction, bFixGeom:=True, ucrNewBaseSelector:=ucrSelectorBoxPlot, bApplyAesGlobally:=True, bReset:=bResetBoxLayerSubdialog) + sdgLayerOptions.ShowDialog() + bResetBoxLayerSubdialog = False + 'Coming from the sdgLayerOptions, clsRgeom_boxplot and others has been modified. One then needs to display these modifications on the dlgBoxPlot. + If clsCurrGeomFunction.GetParameter("varwidth") IsNot Nothing Then + If clsCurrGeomFunction.GetParameter("varwidth").strArgumentValue = "TRUE" Then + ' chkVarwidth.Checked = True + 'Observe that changing the check of the chkVarwidth here doesn't trigger the checkchanged event. + End If + Else + 'chkVarwidth.Checked = False + End If + + 'The aesthetics parameters on the main dialog are repopulated as required. + For Each clsParam In clsRaesFunction.clsParameters + If clsParam.strArgumentName = "x" Then + If clsParam.strArgumentValue = Chr(34) & Chr(34) Then + ucrByFactorsReceiver.Clear() + Else + ucrByFactorsReceiver.Add(clsParam.strArgumentValue) + End If + 'In the y case, the vlue stored in the clsReasFunction in the multiplevariables case is "value", however that one shouldn't be written in the multiple variables receiver (otherwise it would stack all variables and the stack ("value") itself!). + 'Warning: what if someone used the name value for one of it's variables independently from the multiple variables method ? Here if the receiver is actually in single mode, the variable "value" will still be given back, which throws the problem back to the creation of "value" in the multiple receiver case. + ElseIf clsParam.strArgumentName = "y" AndAlso (clsParam.strArgumentValue <> "value" OrElse ucrVariablesAsFactorForBoxplot.bSingleVariable) Then + ucrVariablesAsFactorForBoxplot.Add(clsParam.strArgumentValue) + ElseIf clsParam.strArgumentName = "fill" Then + ucrSecondFactorReceiver.Add(clsParam.strArgumentValue) + End If + Next + + 'Question to be discussed: After running through the sdgLayerOptions, the clsCurrDataFrame parameters seem to have been cleared, such that in the multiple variable case, clsCurrDataFrame needs to be repopulated with "stack", "measure.vars" and "id.vars" parameters. Actually, even when repopulated, they are still not appearing in the script. ?? + 'This resets the factor receiver and causes it to be cleared of the correct variable. We don't want this. + 'ucrVariablesAsFactorForBoxplot.SetReceiverStatus() End Sub Private Sub toolStripMenuItemViolinOptions_Click(sender As Object, e As EventArgs) Handles toolStripMenuItemViolinOptions.Click - BoxPlotOptions() - End Sub + 'SetupLayer sends the components storing the plot info (clsRgeom_boxplotFunction, clsRggplotFunction, ...) of dlgBoxPlot through to sdgLayerOptions where these will be edited. + sdgLayerOptions.SetupLayer(clsNewGgPlot:=clsRggplotFunction, clsNewGeomFunc:=clsViolinplotFunction, clsNewGlobalAesFunc:=clsRaesFunction, clsNewLocalAes:=clsLocalRaesFunction, bFixGeom:=True, ucrNewBaseSelector:=ucrSelectorBoxPlot, bApplyAesGlobally:=True, bReset:=bResetBoxLayerSubdialog) + sdgLayerOptions.ShowDialog() + bResetBoxLayerSubdialog = False + 'Coming from the sdgLayerOptions, clsRgeom_boxplot and others has been modified. One then needs to display these modifications on the dlgBoxPlot. + If clsCurrGeomFunction.GetParameter("varwidth") IsNot Nothing Then + If clsCurrGeomFunction.GetParameter("varwidth").strArgumentValue = "TRUE" Then + ' chkVarwidth.Checked = True + 'Observe that changing the check of the chkVarwidth here doesn't trigger the checkchanged event. + End If + Else + 'chkVarwidth.Checked = False + End If - Private Sub toolStripMenuItemPlotOptions_Click(sender As Object, e As EventArgs) Handles toolStripMenuItemPlotOptions.Click - sdgPlots.SetRCode(clsBaseOperator, clsNewThemeFunction:=clsThemeFunction, dctNewThemeFunctions:=dctThemeFunctions, clsNewGlobalAesFunction:=clsRaesFunction, clsNewXScalecontinuousFunction:=clsXScaleContinuousFunction, - clsNewYScalecontinuousFunction:=clsYScaleContinuousFunction, clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, - clsNewFacetFunction:=clsRFacetFunction, clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, clsNewXScaleDateFunction:=clsXScaleDateFunction, - clsNewScaleFillViridisFunction:=clsScaleFillViridisFunction, clsNewScaleColourViridisFunction:=clsScaleColourViridisFunction, clsNewYScaleDateFunction:=clsYScaleDateFunction, bNewEnableDiscrete:=False, - clsNewAnnotateFunction:=clsAnnotateFunction, ucrNewBaseSelector:=ucrSelectorBoxPlot, strMainDialogGeomParameterNames:=strGeomParameterNames, bReset:=bResetSubdialog) - sdgPlots.ShowDialog() - bResetSubdialog = False + 'The aesthetics parameters on the main dialog are repopulated as required. + For Each clsParam In clsRaesFunction.clsParameters + If clsParam.strArgumentName = "x" Then + If clsParam.strArgumentValue = Chr(34) & Chr(34) Then + ucrByFactorsReceiver.Clear() + Else + ucrByFactorsReceiver.Add(clsParam.strArgumentValue) + End If + 'In the y case, the vlue stored in the clsReasFunction in the multiplevariables case is "value", however that one shouldn't be written in the multiple variables receiver (otherwise it would stack all variables and the stack ("value") itself!). + 'Warning: what if someone used the name value for one of it's variables independently from the multiple variables method ? Here if the receiver is actually in single mode, the variable "value" will still be given back, which throws the problem back to the creation of "value" in the multiple receiver case. + ElseIf clsParam.strArgumentName = "y" AndAlso (clsParam.strArgumentValue <> "value" OrElse ucrVariablesAsFactorForBoxplot.bSingleVariable) Then + ucrVariablesAsFactorForBoxplot.Add(clsParam.strArgumentValue) + ElseIf clsParam.strArgumentName = "fill" Then + ucrSecondFactorReceiver.Add(clsParam.strArgumentValue) + End If + Next - 'this syncs the coordflip in sdgplots and this main dlg - ucrChkHorizontalBoxplot.SetRCode(clsBaseOperator, bReset) + 'Question to be discussed: After running through the sdgLayerOptions, the clsCurrDataFrame parameters seem to have been cleared, such that in the multiple variable case, clsCurrDataFrame needs to be repopulated with "stack", "measure.vars" and "id.vars" parameters. Actually, even when repopulated, they are still not appearing in the script. ?? + 'This resets the factor receiver and causes it to be cleared of the correct variable. We don't want this. + 'ucrVariablesAsFactorForBoxplot.SetReceiverStatus() End Sub + Private Sub DialogueSize() If rdoBoxplotTufte.Checked Then Me.Size = New Size(441, 505) @@ -472,6 +543,14 @@ Public Class dlgBoxplot TestOkEnabled() End Sub + Private Sub EnableDisableBoxplotOptions() + toolStripMenuItemJitterOptions.Enabled = rdoJitter.Checked OrElse ((rdoBoxplotTufte.Checked _ + OrElse rdoViolin.Checked) AndAlso ucrChkAddPoints.Checked) + toolStripMenuItemViolinOptions.Enabled = rdoViolin.Checked + toolStripMenuItemBoxOptions.Enabled = rdoBoxplotTufte.Checked + toolStripMenuItemTufteOptions.Enabled = (rdoBoxplotTufte.Checked AndAlso ucrChkTufte.Checked) + End Sub + 'this code is commented out but will work once we get the feature of linking controls with the contents of a receiver 'Private Sub SwapFactors() ' If ucrChkSwapParameters.Checked Then From 16720743e4b32c5b4239cf72ad8ab40432f6c25f Mon Sep 17 00:00:00 2001 From: EstherNjeri <74548350+EstherNjeriLiberatta@users.noreply.github.com> Date: Fri, 9 Sep 2022 13:23:56 +0300 Subject: [PATCH 6/6] Minor code changes --- instat/dlgBoxPlot.vb | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/instat/dlgBoxPlot.vb b/instat/dlgBoxPlot.vb index 355ddbb4d56..62cca2515bc 100644 --- a/instat/dlgBoxPlot.vb +++ b/instat/dlgBoxPlot.vb @@ -377,17 +377,15 @@ Public Class dlgBoxplot Private Sub toolStripMenuItemBoxOptions_Click(sender As Object, e As EventArgs) Handles toolStripMenuItemBoxOptions.Click 'SetupLayer sends the components storing the plot info (clsRgeom_boxplotFunction, clsRggplotFunction, ...) of dlgBoxPlot through to sdgLayerOptions where these will be edited. - sdgLayerOptions.SetupLayer(clsNewGgPlot:=clsRggplotFunction, clsNewGeomFunc:=clsBoxplotFunction, clsNewGlobalAesFunc:=clsRaesFunction, clsNewLocalAes:=clsLocalRaesFunction, bFixGeom:=True, ucrNewBaseSelector:=ucrSelectorBoxPlot, bApplyAesGlobally:=True, bReset:=bResetBoxLayerSubdialog) + sdgLayerOptions.SetupLayer(clsNewGgPlot:=clsRggplotFunction, clsNewGeomFunc:=clsBoxplotFunction, clsNewGlobalAesFunc:=clsRaesFunction, clsNewLocalAes:=clsLocalRaesFunction, + bFixGeom:=True, ucrNewBaseSelector:=ucrSelectorBoxPlot, bApplyAesGlobally:=True, bReset:=bResetBoxLayerSubdialog) sdgLayerOptions.ShowDialog() bResetBoxLayerSubdialog = False 'Coming from the sdgLayerOptions, clsRgeom_boxplot and others has been modified. One then needs to display these modifications on the dlgBoxPlot. If clsCurrGeomFunction.GetParameter("varwidth") IsNot Nothing Then If clsCurrGeomFunction.GetParameter("varwidth").strArgumentValue = "TRUE" Then - ' chkVarwidth.Checked = True - 'Observe that changing the check of the chkVarwidth here doesn't trigger the checkchanged event. End If Else - 'chkVarwidth.Checked = False End If 'The aesthetics parameters on the main dialog are repopulated as required. @@ -414,17 +412,16 @@ Public Class dlgBoxplot Private Sub toolStripMenuItemTufteOptions_Click(sender As Object, e As EventArgs) Handles toolStripMenuItemTufteOptions.Click 'SetupLayer sends the components storing the plot info (clsRgeom_boxplotFunction, clsRggplotFunction, ...) of dlgBoxPlot through to sdgLayerOptions where these will be edited. - sdgLayerOptions.SetupLayer(clsNewGgPlot:=clsRggplotFunction, clsNewGeomFunc:=clsTufteBoxplotFunction, clsNewGlobalAesFunc:=clsRaesFunction, clsNewLocalAes:=clsLocalRaesFunction, bFixGeom:=True, ucrNewBaseSelector:=ucrSelectorBoxPlot, bApplyAesGlobally:=True, bReset:=bResetBoxLayerSubdialog) + sdgLayerOptions.SetupLayer(clsNewGgPlot:=clsRggplotFunction, clsNewGeomFunc:=clsTufteBoxplotFunction, clsNewGlobalAesFunc:=clsRaesFunction, + clsNewLocalAes:=clsLocalRaesFunction, bFixGeom:=True, ucrNewBaseSelector:=ucrSelectorBoxPlot, bApplyAesGlobally:=True, + bReset:=bResetBoxLayerSubdialog) sdgLayerOptions.ShowDialog() bResetBoxLayerSubdialog = False 'Coming from the sdgLayerOptions, clsRgeom_boxplot and others has been modified. One then needs to display these modifications on the dlgBoxPlot. If clsCurrGeomFunction.GetParameter("varwidth") IsNot Nothing Then If clsCurrGeomFunction.GetParameter("varwidth").strArgumentValue = "TRUE" Then - ' chkVarwidth.Checked = True - 'Observe that changing the check of the chkVarwidth here doesn't trigger the checkchanged event. End If Else - 'chkVarwidth.Checked = False End If 'The aesthetics parameters on the main dialog are repopulated as required. @@ -451,17 +448,15 @@ Public Class dlgBoxplot Private Sub toolStripMenuItemJitterOptions_Click(sender As Object, e As EventArgs) Handles toolStripMenuItemJitterOptions.Click 'SetupLayer sends the components storing the plot info (clsRgeom_boxplotFunction, clsRggplotFunction, ...) of dlgBoxPlot through to sdgLayerOptions where these will be edited. - sdgLayerOptions.SetupLayer(clsNewGgPlot:=clsRggplotFunction, clsNewGeomFunc:=clsJitterplotFunction, clsNewGlobalAesFunc:=clsRaesFunction, clsNewLocalAes:=clsLocalRaesFunction, bFixGeom:=True, ucrNewBaseSelector:=ucrSelectorBoxPlot, bApplyAesGlobally:=True, bReset:=bResetBoxLayerSubdialog) + sdgLayerOptions.SetupLayer(clsNewGgPlot:=clsRggplotFunction, clsNewGeomFunc:=clsJitterplotFunction, clsNewGlobalAesFunc:=clsRaesFunction, + clsNewLocalAes:=clsLocalRaesFunction, bFixGeom:=True, ucrNewBaseSelector:=ucrSelectorBoxPlot, bApplyAesGlobally:=True, bReset:=bResetBoxLayerSubdialog) sdgLayerOptions.ShowDialog() bResetBoxLayerSubdialog = False 'Coming from the sdgLayerOptions, clsRgeom_boxplot and others has been modified. One then needs to display these modifications on the dlgBoxPlot. If clsCurrGeomFunction.GetParameter("varwidth") IsNot Nothing Then If clsCurrGeomFunction.GetParameter("varwidth").strArgumentValue = "TRUE" Then - ' chkVarwidth.Checked = True - 'Observe that changing the check of the chkVarwidth here doesn't trigger the checkchanged event. End If Else - 'chkVarwidth.Checked = False End If 'The aesthetics parameters on the main dialog are repopulated as required. @@ -488,17 +483,16 @@ Public Class dlgBoxplot Private Sub toolStripMenuItemViolinOptions_Click(sender As Object, e As EventArgs) Handles toolStripMenuItemViolinOptions.Click 'SetupLayer sends the components storing the plot info (clsRgeom_boxplotFunction, clsRggplotFunction, ...) of dlgBoxPlot through to sdgLayerOptions where these will be edited. - sdgLayerOptions.SetupLayer(clsNewGgPlot:=clsRggplotFunction, clsNewGeomFunc:=clsViolinplotFunction, clsNewGlobalAesFunc:=clsRaesFunction, clsNewLocalAes:=clsLocalRaesFunction, bFixGeom:=True, ucrNewBaseSelector:=ucrSelectorBoxPlot, bApplyAesGlobally:=True, bReset:=bResetBoxLayerSubdialog) + sdgLayerOptions.SetupLayer(clsNewGgPlot:=clsRggplotFunction, clsNewGeomFunc:=clsViolinplotFunction, clsNewGlobalAesFunc:=clsRaesFunction, + clsNewLocalAes:=clsLocalRaesFunction, bFixGeom:=True, ucrNewBaseSelector:=ucrSelectorBoxPlot, bApplyAesGlobally:=True, + bReset:=bResetBoxLayerSubdialog) sdgLayerOptions.ShowDialog() bResetBoxLayerSubdialog = False 'Coming from the sdgLayerOptions, clsRgeom_boxplot and others has been modified. One then needs to display these modifications on the dlgBoxPlot. If clsCurrGeomFunction.GetParameter("varwidth") IsNot Nothing Then If clsCurrGeomFunction.GetParameter("varwidth").strArgumentValue = "TRUE" Then - ' chkVarwidth.Checked = True - 'Observe that changing the check of the chkVarwidth here doesn't trigger the checkchanged event. End If Else - 'chkVarwidth.Checked = False End If 'The aesthetics parameters on the main dialog are repopulated as required.