From 5e2acd07645c690e06fcb9bff604ab2901ed8359 Mon Sep 17 00:00:00 2001 From: Antoine Ntalumeso Date: Tue, 8 Jun 2021 12:08:25 +0200 Subject: [PATCH 1/9] Fixes presentation issue --- instat/dlgBarAndPieChart.Designer.vb | 2 ++ instat/dlgBarAndPieChart.vb | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/instat/dlgBarAndPieChart.Designer.vb b/instat/dlgBarAndPieChart.Designer.vb index 0c9bd164f82..833368547b2 100644 --- a/instat/dlgBarAndPieChart.Designer.vb +++ b/instat/dlgBarAndPieChart.Designer.vb @@ -144,6 +144,7 @@ Partial Class dlgBarAndPieChart 'ucrInputYValue ' Me.ucrInputYValue.AddQuotesIfUnrecognised = True + Me.ucrInputYValue.GetSetSelectedIndex = -1 Me.ucrInputYValue.IsReadOnly = False resources.ApplyResources(Me.ucrInputYValue, "ucrInputYValue") Me.ucrInputYValue.Name = "ucrInputYValue" @@ -160,6 +161,7 @@ Partial Class dlgBarAndPieChart 'ucrInputBarChartPosition ' Me.ucrInputBarChartPosition.AddQuotesIfUnrecognised = True + Me.ucrInputBarChartPosition.GetSetSelectedIndex = -1 Me.ucrInputBarChartPosition.IsReadOnly = False resources.ApplyResources(Me.ucrInputBarChartPosition, "ucrInputBarChartPosition") Me.ucrInputBarChartPosition.Name = "ucrInputBarChartPosition" diff --git a/instat/dlgBarAndPieChart.vb b/instat/dlgBarAndPieChart.vb index 42aff1719c7..5f42001d249 100644 --- a/instat/dlgBarAndPieChart.vb +++ b/instat/dlgBarAndPieChart.vb @@ -56,8 +56,8 @@ Public Class dlgBarAndPieChart bReset = False ChangeLabel() - autoTranslate(Me) TestOkEnabled() + autoTranslate(Me) End Sub Private Sub InitialiseDialog() @@ -337,12 +337,11 @@ Public Class dlgBarAndPieChart SetDialogOptions() ChangeLabel() setColumnChartOption() - TestOkEnabled() - autoTranslate(Me) End Sub Private Sub setColumnChartOption() If ucrInputYValue.GetValue = "Variable" Then + lblPosition.Visible = False ucrReceiverY.SetVisible(True) ucrReceiverY.SetMeAsReceiver() ucrReceiverY.AddOrRemoveParameter(True) @@ -350,6 +349,7 @@ Public Class dlgBarAndPieChart ucrReceiverY.SetVisible(False) ucrReceiverFirst.SetMeAsReceiver() ucrReceiverY.AddOrRemoveParameter(False) + lblPosition.Visible = rdoBarChart.Checked End If End Sub From 7ffce036314d857ff1fda0ff0703187e406f4bce Mon Sep 17 00:00:00 2001 From: Antoine Ntalumeso Date: Tue, 8 Jun 2021 21:45:25 +0200 Subject: [PATCH 2/9] Fixes bug on combo to remember state in reopen --- instat/dlgBarAndPieChart.Designer.vb | 40 +++++++-------- instat/dlgBarAndPieChart.resx | 77 +++++++++++++--------------- instat/dlgBarAndPieChart.vb | 41 +++++++++------ 3 files changed, 83 insertions(+), 75 deletions(-) diff --git a/instat/dlgBarAndPieChart.Designer.vb b/instat/dlgBarAndPieChart.Designer.vb index 833368547b2..f2706bbab8d 100644 --- a/instat/dlgBarAndPieChart.Designer.vb +++ b/instat/dlgBarAndPieChart.Designer.vb @@ -50,9 +50,9 @@ Partial Class dlgBarAndPieChart Me.lblYvariable = New System.Windows.Forms.Label() Me.cmdColumnChartOptions = New System.Windows.Forms.Button() Me.lblYValue = New System.Windows.Forms.Label() - Me.ucrInputYValue = New instat.ucrInputComboBox() + Me.ucrInputBarChartPositions = New instat.ucrInputComboBox() + Me.ucrInputYValues = New instat.ucrInputComboBox() Me.ucrReceiverY = New instat.ucrReceiverSingle() - Me.ucrInputBarChartPosition = New instat.ucrInputComboBox() Me.ucrSaveBar = New instat.ucrSave() Me.ucrChkFlipCoordinates = New instat.ucrCheck() Me.ucrReceiverByFactor = New instat.ucrReceiverSingle() @@ -141,13 +141,21 @@ Partial Class dlgBarAndPieChart resources.ApplyResources(Me.lblYValue, "lblYValue") Me.lblYValue.Name = "lblYValue" ' - 'ucrInputYValue + 'ucrInputBarChartPositions ' - Me.ucrInputYValue.AddQuotesIfUnrecognised = True - Me.ucrInputYValue.GetSetSelectedIndex = -1 - Me.ucrInputYValue.IsReadOnly = False - resources.ApplyResources(Me.ucrInputYValue, "ucrInputYValue") - Me.ucrInputYValue.Name = "ucrInputYValue" + Me.ucrInputBarChartPositions.AddQuotesIfUnrecognised = True + Me.ucrInputBarChartPositions.GetSetSelectedIndex = -1 + Me.ucrInputBarChartPositions.IsReadOnly = False + resources.ApplyResources(Me.ucrInputBarChartPositions, "ucrInputBarChartPositions") + Me.ucrInputBarChartPositions.Name = "ucrInputBarChartPositions" + ' + 'ucrInputYValues + ' + Me.ucrInputYValues.AddQuotesIfUnrecognised = True + Me.ucrInputYValues.GetSetSelectedIndex = -1 + Me.ucrInputYValues.IsReadOnly = False + resources.ApplyResources(Me.ucrInputYValues, "ucrInputYValues") + Me.ucrInputYValues.Name = "ucrInputYValues" ' 'ucrReceiverY ' @@ -158,14 +166,6 @@ Partial Class dlgBarAndPieChart Me.ucrReceiverY.strNcFilePath = "" Me.ucrReceiverY.ucrSelector = Nothing ' - 'ucrInputBarChartPosition - ' - Me.ucrInputBarChartPosition.AddQuotesIfUnrecognised = True - Me.ucrInputBarChartPosition.GetSetSelectedIndex = -1 - Me.ucrInputBarChartPosition.IsReadOnly = False - resources.ApplyResources(Me.ucrInputBarChartPosition, "ucrInputBarChartPosition") - Me.ucrInputBarChartPosition.Name = "ucrInputBarChartPosition" - ' 'ucrSaveBar ' resources.ApplyResources(Me.ucrSaveBar, "ucrSaveBar") @@ -217,13 +217,13 @@ Partial Class dlgBarAndPieChart ' resources.ApplyResources(Me, "$this") Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.Controls.Add(Me.ucrInputYValue) + Me.Controls.Add(Me.ucrInputBarChartPositions) + Me.Controls.Add(Me.ucrInputYValues) Me.Controls.Add(Me.lblYValue) Me.Controls.Add(Me.cmdColumnChartOptions) Me.Controls.Add(Me.lblYvariable) Me.Controls.Add(Me.ucrReceiverY) Me.Controls.Add(Me.lblPosition) - Me.Controls.Add(Me.ucrInputBarChartPosition) Me.Controls.Add(Me.ucrSaveBar) Me.Controls.Add(Me.ucrChkFlipCoordinates) Me.Controls.Add(Me.rdoBarChart) @@ -262,11 +262,11 @@ Partial Class dlgBarAndPieChart Friend WithEvents rdoPieChart As RadioButton Friend WithEvents ucrPnlOptions As UcrPanel Friend WithEvents cmdBarChartOptions As Button - Friend WithEvents ucrInputBarChartPosition As ucrInputComboBox Friend WithEvents lblPosition As Label Friend WithEvents lblYvariable As Label Friend WithEvents ucrReceiverY As ucrReceiverSingle Friend WithEvents cmdColumnChartOptions As Button - Friend WithEvents ucrInputYValue As ucrInputComboBox Friend WithEvents lblYValue As Label + Friend WithEvents ucrInputYValues As ucrInputComboBox + Friend WithEvents ucrInputBarChartPositions As ucrInputComboBox End Class \ No newline at end of file diff --git a/instat/dlgBarAndPieChart.resx b/instat/dlgBarAndPieChart.resx index 0f51d997429..0744a3e2520 100644 --- a/instat/dlgBarAndPieChart.resx +++ b/instat/dlgBarAndPieChart.resx @@ -361,7 +361,7 @@ $this - 5 + 6 True @@ -391,7 +391,7 @@ $this - 3 + 4 NoControl @@ -418,7 +418,7 @@ $this - 2 + 3 True @@ -448,28 +448,49 @@ $this - 1 + 2 + + + 255, 192 + + + 92, 21 + + + 35 + + + ucrInputBarChartPositions + + + instat.ucrInputComboBox, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 0 - + 255, 142 - + 107, 21 - - 20 + + 34 - - ucrInputYValue + + ucrInputYValues - + instat.ucrInputComboBox, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - + $this - - 0 + + 1 True @@ -480,30 +501,6 @@ 415, 411 - - 255, 190 - - - 21, 17, 21, 17 - - - 92, 21 - - - 10 - - - ucrInputBarChartPosition - - - instat.ucrInputComboBox, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 6 - 9, 328 @@ -676,7 +673,7 @@ System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - 255, 190 + 255, 192 0, 0, 0, 0 @@ -697,6 +694,6 @@ $this - 4 + 5 \ No newline at end of file diff --git a/instat/dlgBarAndPieChart.vb b/instat/dlgBarAndPieChart.vb index 5f42001d249..76d537a46c0 100644 --- a/instat/dlgBarAndPieChart.vb +++ b/instat/dlgBarAndPieChart.vb @@ -77,8 +77,8 @@ Public Class dlgBarAndPieChart ucrPnlOptions.AddParameterPresentCondition(rdoBarChart, "coordpolar", False) ucrPnlOptions.AddToLinkedControls({ucrChkFlipCoordinates}, {rdoBarChart}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - ucrPnlOptions.AddToLinkedControls(ucrInputBarChartPosition, {rdoBarChart}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - ucrInputBarChartPosition.SetLinkedDisplayControl(lblPosition) + ucrPnlOptions.AddToLinkedControls(ucrInputBarChartPositions, {rdoBarChart}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrInputBarChartPositions.SetLinkedDisplayControl(lblPosition) ucrPnlOptions.AddToLinkedControls({ucrReceiverByFactor}, {rdoBarChart}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrReceiverByFactor.SetLinkedDisplayControl(lblByFactor) @@ -126,23 +126,24 @@ Public Class dlgBarAndPieChart ucrChkFlipCoordinates.SetText("Flip Coordinates") ucrChkFlipCoordinates.SetParameter(clsCoordFlipParam, bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) - ucrInputYValue.SetParameter(New RParameter("stat", 0)) + + ucrInputYValues.SetParameter(New RParameter("stat", 0)) dctStatOptions.Add("Count", Chr(34) & "count" & Chr(34)) dctStatOptions.Add("Variable", Chr(34) & "identity" & Chr(34)) - ucrInputYValue.SetItems(dctStatOptions) - ucrInputYValue.SetDropDownStyleAsNonEditable() - ucrInputYValue.SetRDefault(Chr(34) & "count" & Chr(34)) + ucrInputYValues.SetItems(dctStatOptions) + ucrInputYValues.SetDropDownStyleAsNonEditable() + ucrInputYValues.SetRDefault(Chr(34) & "count" & Chr(34)) - ucrInputBarChartPosition.SetParameter(New RParameter("position", 0)) + ucrInputBarChartPositions.SetParameter(New RParameter("position", 0)) dctPositionPairs.Add("Stack", Chr(34) & "stack" & Chr(34)) dctPositionPairs.Add("Dodge", Chr(34) & "dodge" & Chr(34)) dctPositionPairs.Add("Identity", Chr(34) & "identity" & Chr(34)) dctPositionPairs.Add("Jitter", Chr(34) & "jitter" & Chr(34)) dctPositionPairs.Add("Fill", Chr(34) & "fill" & Chr(34)) dctPositionPairs.Add("Stack in reverse", "position_stack(reverse = TRUE)") - ucrInputBarChartPosition.SetItems(dctPositionPairs) - ucrInputBarChartPosition.SetDropDownStyleAsNonEditable() - ucrInputBarChartPosition.SetRDefault(Chr(34) & "stack" & Chr(34)) + ucrInputBarChartPositions.SetItems(dctPositionPairs) + ucrInputBarChartPositions.SetDropDownStyleAsNonEditable() + ucrInputBarChartPositions.SetRDefault(Chr(34) & "stack" & Chr(34)) End Sub @@ -214,8 +215,8 @@ Public Class dlgBarAndPieChart ucrBarChartSelector.SetRCode(clsRggplotFunction, bReset) ucrPnlOptions.SetRCode(clsBaseOperator, bReset) ucrChkFlipCoordinates.SetRCode(clsBaseOperator, bReset) - ucrInputBarChartPosition.SetRCode(clsRgeomBarFunction, bReset) - ucrInputYValue.SetRCode(clsRgeomBarFunction, bReset) + ucrInputBarChartPositions.SetRCode(clsRgeomBarFunction, bReset) + ucrInputYValues.SetRCode(clsRgeomBarFunction, bReset) End Sub Private Sub TestOkEnabled() @@ -270,7 +271,7 @@ Public Class dlgBarAndPieChart ucrReceiverByFactor.Clear() End If 'Allows for sync with the layer parameters - ucrInputBarChartPosition.SetRCode(clsRgeomBarFunction, bReset) + ucrInputBarChartPositions.SetRCode(clsRgeomBarFunction, bReset) TestOkEnabled() End Sub @@ -340,8 +341,9 @@ Public Class dlgBarAndPieChart End Sub Private Sub setColumnChartOption() - If ucrInputYValue.GetValue = "Variable" Then + If ucrInputYValues.GetValue = "Variable" Then lblPosition.Visible = False + ucrInputBarChartPositions.Visible = False ucrReceiverY.SetVisible(True) ucrReceiverY.SetMeAsReceiver() ucrReceiverY.AddOrRemoveParameter(True) @@ -350,10 +352,11 @@ Public Class dlgBarAndPieChart ucrReceiverFirst.SetMeAsReceiver() ucrReceiverY.AddOrRemoveParameter(False) lblPosition.Visible = rdoBarChart.Checked + ucrInputBarChartPositions.Visible = rdoBarChart.Checked End If End Sub - Private Sub ucrInputYValue_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputYValue.ControlValueChanged + Private Sub ucrInputYValues_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputYValues.ControlValueChanged setColumnChartOption() TestOkEnabled() End Sub @@ -361,4 +364,12 @@ Public Class dlgBarAndPieChart Private Sub CoreControls_ContentsChanged() Handles ucrReceiverFirst.ControlContentsChanged, ucrReceiverY.ControlContentsChanged, ucrSaveBar.ControlContentsChanged TestOkEnabled() End Sub + + Private Sub CoreControls_ContentsChanged(ucrChangedControl As ucrCore) Handles ucrSaveBar.ControlContentsChanged, ucrReceiverY.ControlContentsChanged, ucrReceiverFirst.ControlContentsChanged + + End Sub + + Private Sub ucrPnlOptions_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlOptions.ControlValueChanged + + End Sub End Class From 7ccbdaef3514594ff931c42e4670f3831ae9f938 Mon Sep 17 00:00:00 2001 From: Antoine Ntalumeso Date: Wed, 9 Jun 2021 21:54:43 +0200 Subject: [PATCH 3/9] Improved the design and implemented the new controls in the dialog --- instat/dlgBarAndPieChart.Designer.vb | 114 ++++------- instat/dlgBarAndPieChart.resx | 292 +++++++++------------------ instat/dlgBarAndPieChart.vb | 168 +++++---------- 3 files changed, 188 insertions(+), 386 deletions(-) diff --git a/instat/dlgBarAndPieChart.Designer.vb b/instat/dlgBarAndPieChart.Designer.vb index f2706bbab8d..0b56b23b322 100644 --- a/instat/dlgBarAndPieChart.Designer.vb +++ b/instat/dlgBarAndPieChart.Designer.vb @@ -39,35 +39,25 @@ Partial Class dlgBarAndPieChart Private Sub InitializeComponent() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(dlgBarAndPieChart)) - Me.lblVariable = New System.Windows.Forms.Label() Me.lblByFactor = New System.Windows.Forms.Label() Me.cmdOptions = New System.Windows.Forms.Button() Me.cmdPieChartOptions = New System.Windows.Forms.Button() Me.rdoPieChart = New System.Windows.Forms.RadioButton() - Me.rdoBarChart = New System.Windows.Forms.RadioButton() + Me.rdoValue = New System.Windows.Forms.RadioButton() Me.cmdBarChartOptions = New System.Windows.Forms.Button() Me.lblPosition = New System.Windows.Forms.Label() - Me.lblYvariable = New System.Windows.Forms.Label() Me.cmdColumnChartOptions = New System.Windows.Forms.Button() - Me.lblYValue = New System.Windows.Forms.Label() Me.ucrInputBarChartPositions = New instat.ucrInputComboBox() - Me.ucrInputYValues = New instat.ucrInputComboBox() - Me.ucrReceiverY = New instat.ucrReceiverSingle() Me.ucrSaveBar = New instat.ucrSave() Me.ucrChkFlipCoordinates = New instat.ucrCheck() Me.ucrReceiverByFactor = New instat.ucrReceiverSingle() - Me.ucrReceiverFirst = New instat.ucrReceiverSingle() Me.ucrBarChartSelector = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrBase = New instat.ucrButtons() Me.ucrPnlOptions = New instat.UcrPanel() + Me.rdoFrequency = New System.Windows.Forms.RadioButton() + Me.ucrVariablesAsFactorForBarChart = New instat.ucrVariablesAsFactor() Me.SuspendLayout() ' - 'lblVariable - ' - resources.ApplyResources(Me.lblVariable, "lblVariable") - Me.lblVariable.Name = "lblVariable" - Me.lblVariable.Tag = "Variable:" - ' 'lblByFactor ' resources.ApplyResources(Me.lblByFactor, "lblByFactor") @@ -100,17 +90,17 @@ Partial Class dlgBarAndPieChart Me.rdoPieChart.Tag = "Pie_Chart" Me.rdoPieChart.UseVisualStyleBackColor = False ' - 'rdoBarChart + 'rdoValue ' - resources.ApplyResources(Me.rdoBarChart, "rdoBarChart") - Me.rdoBarChart.BackColor = System.Drawing.SystemColors.Control - Me.rdoBarChart.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoBarChart.FlatAppearance.BorderSize = 2 - Me.rdoBarChart.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoBarChart.Name = "rdoBarChart" - Me.rdoBarChart.TabStop = True - Me.rdoBarChart.Tag = "Bar_Chart" - Me.rdoBarChart.UseVisualStyleBackColor = False + resources.ApplyResources(Me.rdoValue, "rdoValue") + Me.rdoValue.BackColor = System.Drawing.SystemColors.Control + Me.rdoValue.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoValue.FlatAppearance.BorderSize = 2 + Me.rdoValue.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoValue.Name = "rdoValue" + Me.rdoValue.TabStop = True + Me.rdoValue.Tag = "Value" + Me.rdoValue.UseVisualStyleBackColor = False ' 'cmdBarChartOptions ' @@ -124,11 +114,6 @@ Partial Class dlgBarAndPieChart resources.ApplyResources(Me.lblPosition, "lblPosition") Me.lblPosition.Name = "lblPosition" ' - 'lblYvariable - ' - resources.ApplyResources(Me.lblYvariable, "lblYvariable") - Me.lblYvariable.Name = "lblYvariable" - ' 'cmdColumnChartOptions ' resources.ApplyResources(Me.cmdColumnChartOptions, "cmdColumnChartOptions") @@ -136,11 +121,6 @@ Partial Class dlgBarAndPieChart Me.cmdColumnChartOptions.Tag = "Column_Chart_Options" Me.cmdColumnChartOptions.UseVisualStyleBackColor = True ' - 'lblYValue - ' - resources.ApplyResources(Me.lblYValue, "lblYValue") - Me.lblYValue.Name = "lblYValue" - ' 'ucrInputBarChartPositions ' Me.ucrInputBarChartPositions.AddQuotesIfUnrecognised = True @@ -149,23 +129,6 @@ Partial Class dlgBarAndPieChart resources.ApplyResources(Me.ucrInputBarChartPositions, "ucrInputBarChartPositions") Me.ucrInputBarChartPositions.Name = "ucrInputBarChartPositions" ' - 'ucrInputYValues - ' - Me.ucrInputYValues.AddQuotesIfUnrecognised = True - Me.ucrInputYValues.GetSetSelectedIndex = -1 - Me.ucrInputYValues.IsReadOnly = False - resources.ApplyResources(Me.ucrInputYValues, "ucrInputYValues") - Me.ucrInputYValues.Name = "ucrInputYValues" - ' - 'ucrReceiverY - ' - Me.ucrReceiverY.frmParent = Me - resources.ApplyResources(Me.ucrReceiverY, "ucrReceiverY") - Me.ucrReceiverY.Name = "ucrReceiverY" - Me.ucrReceiverY.Selector = Nothing - Me.ucrReceiverY.strNcFilePath = "" - Me.ucrReceiverY.ucrSelector = Nothing - ' 'ucrSaveBar ' resources.ApplyResources(Me.ucrSaveBar, "ucrSaveBar") @@ -186,15 +149,6 @@ Partial Class dlgBarAndPieChart Me.ucrReceiverByFactor.strNcFilePath = "" Me.ucrReceiverByFactor.ucrSelector = Nothing ' - 'ucrReceiverFirst - ' - Me.ucrReceiverFirst.frmParent = Me - resources.ApplyResources(Me.ucrReceiverFirst, "ucrReceiverFirst") - Me.ucrReceiverFirst.Name = "ucrReceiverFirst" - Me.ucrReceiverFirst.Selector = Nothing - Me.ucrReceiverFirst.strNcFilePath = "" - Me.ucrReceiverFirst.ucrSelector = Nothing - ' 'ucrBarChartSelector ' Me.ucrBarChartSelector.bDropUnusedFilterLevels = False @@ -213,26 +167,44 @@ Partial Class dlgBarAndPieChart resources.ApplyResources(Me.ucrPnlOptions, "ucrPnlOptions") Me.ucrPnlOptions.Name = "ucrPnlOptions" ' + 'rdoFrequency + ' + resources.ApplyResources(Me.rdoFrequency, "rdoFrequency") + Me.rdoFrequency.BackColor = System.Drawing.SystemColors.Control + Me.rdoFrequency.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoFrequency.FlatAppearance.BorderSize = 2 + Me.rdoFrequency.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoFrequency.Name = "rdoFrequency" + Me.rdoFrequency.TabStop = True + Me.rdoFrequency.Tag = "Frequency" + Me.rdoFrequency.UseVisualStyleBackColor = False + ' + 'ucrVariablesAsFactorForBarChart + ' + Me.ucrVariablesAsFactorForBarChart.frmParent = Me + resources.ApplyResources(Me.ucrVariablesAsFactorForBarChart, "ucrVariablesAsFactorForBarChart") + Me.ucrVariablesAsFactorForBarChart.Name = "ucrVariablesAsFactorForBarChart" + Me.ucrVariablesAsFactorForBarChart.Selector = Nothing + Me.ucrVariablesAsFactorForBarChart.strNcFilePath = "" + Me.ucrVariablesAsFactorForBarChart.ucrSelector = Nothing + Me.ucrVariablesAsFactorForBarChart.ucrVariableSelector = Nothing + ' 'dlgBarAndPieChart ' resources.ApplyResources(Me, "$this") Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.ucrVariablesAsFactorForBarChart) + Me.Controls.Add(Me.rdoFrequency) Me.Controls.Add(Me.ucrInputBarChartPositions) - Me.Controls.Add(Me.ucrInputYValues) - Me.Controls.Add(Me.lblYValue) Me.Controls.Add(Me.cmdColumnChartOptions) - Me.Controls.Add(Me.lblYvariable) - Me.Controls.Add(Me.ucrReceiverY) Me.Controls.Add(Me.lblPosition) Me.Controls.Add(Me.ucrSaveBar) Me.Controls.Add(Me.ucrChkFlipCoordinates) - Me.Controls.Add(Me.rdoBarChart) + Me.Controls.Add(Me.rdoValue) Me.Controls.Add(Me.rdoPieChart) Me.Controls.Add(Me.cmdOptions) Me.Controls.Add(Me.lblByFactor) - Me.Controls.Add(Me.lblVariable) Me.Controls.Add(Me.ucrReceiverByFactor) - Me.Controls.Add(Me.ucrReceiverFirst) Me.Controls.Add(Me.ucrBarChartSelector) Me.Controls.Add(Me.ucrBase) Me.Controls.Add(Me.cmdBarChartOptions) @@ -250,23 +222,19 @@ Partial Class dlgBarAndPieChart Friend WithEvents ucrBase As ucrButtons Friend WithEvents ucrBarChartSelector As ucrSelectorByDataFrameAddRemove - Friend WithEvents ucrReceiverFirst As ucrReceiverSingle Friend WithEvents ucrReceiverByFactor As ucrReceiverSingle - Friend WithEvents lblVariable As Label Friend WithEvents lblByFactor As Label Friend WithEvents cmdOptions As Button Friend WithEvents cmdPieChartOptions As Button Friend WithEvents ucrSaveBar As ucrSave Friend WithEvents ucrChkFlipCoordinates As ucrCheck - Friend WithEvents rdoBarChart As RadioButton + Friend WithEvents rdoValue As RadioButton Friend WithEvents rdoPieChart As RadioButton Friend WithEvents ucrPnlOptions As UcrPanel Friend WithEvents cmdBarChartOptions As Button Friend WithEvents lblPosition As Label - Friend WithEvents lblYvariable As Label - Friend WithEvents ucrReceiverY As ucrReceiverSingle Friend WithEvents cmdColumnChartOptions As Button - Friend WithEvents lblYValue As Label - Friend WithEvents ucrInputYValues As ucrInputComboBox Friend WithEvents ucrInputBarChartPositions As ucrInputComboBox + Friend WithEvents rdoFrequency As RadioButton + Friend WithEvents ucrVariablesAsFactorForBarChart As ucrVariablesAsFactor End Class \ No newline at end of file diff --git a/instat/dlgBarAndPieChart.resx b/instat/dlgBarAndPieChart.resx index 0744a3e2520..c5a934f9c4c 100644 --- a/instat/dlgBarAndPieChart.resx +++ b/instat/dlgBarAndPieChart.resx @@ -118,52 +118,22 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - True - - - - NoControl - - - - 252, 76 - - - 58, 13 - - - 5 - - - X Variable: - - - lblVariable - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 13 - True + NoControl + - 252, 226 + 252, 221 103, 13 - 7 + 6 By Factor (Optional): @@ -178,7 +148,7 @@ $this - 12 + 10 NoControl @@ -190,7 +160,7 @@ 121, 25 - 13 + 11 Plot Options @@ -205,7 +175,7 @@ $this - 11 + 9 NoControl @@ -232,11 +202,14 @@ $this - 19 + 15 Button + + False + Flat @@ -244,13 +217,13 @@ NoControl - 206, 12 + 264, 12 110, 28 - 2 + 3 Pie Chart @@ -268,43 +241,43 @@ $this - 10 + 8 - + Button - + Flat - + NoControl - - 98, 12 + + 156, 12 - + 110, 28 - - 1 + + 2 - - Bar Chart + + Value - + MiddleCenter - - rdoBarChart + + rdoValue - + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - - 9 + + 7 NoControl @@ -331,7 +304,7 @@ $this - 18 + 14 True @@ -340,7 +313,7 @@ NoControl - 252, 176 + 252, 265 47, 13 @@ -361,36 +334,6 @@ $this - 6 - - - True - - - NoControl - - - 252, 176 - - - 58, 13 - - - 9 - - - Y Variable: - - - lblYvariable - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - 4 @@ -403,7 +346,7 @@ 121, 25 - 12 + 10 Column Chart Options @@ -420,44 +363,59 @@ 3 - - True + + Button - + + Flat + + NoControl - - 252, 126 + + 48, 12 - - 47, 13 + + 110, 28 - - 19 + + 1 + + + Frequency - - Y Value: + + MiddleCenter - - lblYValue + + rdoFrequency - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - - 2 + + 1 + + + True + + + 6, 13 + + + 415, 411 - 255, 192 + 252, 281 92, 21 - 35 + 9 ucrInputBarChartPositions @@ -469,37 +427,7 @@ $this - 0 - - - 255, 142 - - - 107, 21 - - - 34 - - - ucrInputYValues - - - instat.ucrInputComboBox, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 1 - - - True - - - 6, 13 - - - 415, 411 + 2 9, 328 @@ -511,7 +439,7 @@ 255, 24 - 15 + 13 ucrSaveBar @@ -523,7 +451,7 @@ $this - 7 + 5 9, 302 @@ -532,7 +460,7 @@ 166, 20 - 14 + 12 ucrChkFlipCoordinates @@ -544,10 +472,10 @@ $this - 8 + 6 - 255, 239 + 252, 236 0, 0, 0, 0 @@ -556,7 +484,7 @@ 120, 20 - 8 + 7 ucrReceiverByFactor @@ -568,31 +496,7 @@ $this - 14 - - - 255, 89 - - - 0, 0, 0, 0 - - - 120, 20 - - - 6 - - - ucrReceiverFirst - - - instat.ucrReceiverSingle, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 15 + 11 10, 41 @@ -616,7 +520,7 @@ $this - 16 + 12 9, 358 @@ -625,7 +529,7 @@ 410, 52 - 16 + 14 ucrBase @@ -637,10 +541,10 @@ $this - 17 + 13 - 66, 6 + 47, 6 330, 36 @@ -658,7 +562,10 @@ $this - 20 + 16 + + + NoControl CenterScreen @@ -672,28 +579,25 @@ System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 255, 192 - - - 0, 0, 0, 0 + + 252, 62 - - 120, 21 + + 125, 136 - - 11 + + 5 - - ucrReceiverY + + ucrVariablesAsFactorForBarChart - - instat.ucrReceiverSingle, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + instat.ucrVariablesAsFactor, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - + $this - - 5 + + 0 \ No newline at end of file diff --git a/instat/dlgBarAndPieChart.vb b/instat/dlgBarAndPieChart.vb index 76d537a46c0..226037b17a9 100644 --- a/instat/dlgBarAndPieChart.vb +++ b/instat/dlgBarAndPieChart.vb @@ -55,7 +55,6 @@ Public Class dlgBarAndPieChart SetRCodeForControls(bReset) bReset = False - ChangeLabel() TestOkEnabled() autoTranslate(Me) End Sub @@ -71,26 +70,30 @@ Public Class dlgBarAndPieChart ucrBase.clsRsyntax.iCallType = 3 ucrBase.iHelpTopicID = 438 - ucrPnlOptions.AddRadioButton(rdoBarChart) + ucrPnlOptions.AddRadioButton(rdoFrequency) + ucrPnlOptions.AddRadioButton(rdoValue) ucrPnlOptions.AddRadioButton(rdoPieChart) - ucrPnlOptions.AddParameterPresentCondition(rdoPieChart, "coordpolar") - ucrPnlOptions.AddParameterPresentCondition(rdoBarChart, "coordpolar", False) + ucrPnlOptions.AddFunctionNamesCondition(rdoFrequency, "coordpolar") + ucrPnlOptions.AddFunctionNamesCondition(rdoValue, "coordpolar") + ucrPnlOptions.AddFunctionNamesCondition(rdoPieChart, "coordpolar") - ucrPnlOptions.AddToLinkedControls({ucrChkFlipCoordinates}, {rdoBarChart}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - ucrPnlOptions.AddToLinkedControls(ucrInputBarChartPositions, {rdoBarChart}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - ucrInputBarChartPositions.SetLinkedDisplayControl(lblPosition) - ucrPnlOptions.AddToLinkedControls({ucrReceiverByFactor}, {rdoBarChart}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlOptions.AddToLinkedControls({ucrChkFlipCoordinates}, {rdoFrequency, rdoValue}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlOptions.AddToLinkedControls(ucrInputBarChartPositions, {rdoFrequency, rdoValue}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlOptions.AddToLinkedControls({ucrReceiverByFactor}, {rdoFrequency, rdoValue}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrReceiverByFactor.SetLinkedDisplayControl(lblByFactor) + ucrInputBarChartPositions.SetLinkedDisplayControl(lblPosition) ucrBarChartSelector.SetParameter(New RParameter("data", 0)) ucrBarChartSelector.SetParameterIsrfunction() - ucrReceiverFirst.Selector = ucrBarChartSelector - ucrReceiverFirst.strSelectorHeading = "Variables" - ucrReceiverFirst.SetParameter(New RParameter("x", 0)) - ucrReceiverFirst.bWithQuotes = False - ucrReceiverFirst.SetParameterIsString() - ucrReceiverFirst.SetLinkedDisplayControl(lblVariable) + ucrVariablesAsFactorForBarChart.SetParameter(New RParameter("y", 1)) + ucrVariablesAsFactorForBarChart.SetParameterIsString() + ucrVariablesAsFactorForBarChart.bWithQuotes = False + ucrVariablesAsFactorForBarChart.Selector = ucrBarChartSelector + ucrVariablesAsFactorForBarChart.SetFactorReceiver(ucrReceiverByFactor) + ucrVariablesAsFactorForBarChart.strSelectorHeading = "Variables" + ucrVariablesAsFactorForBarChart.SetValuesToIgnore({Chr(34) & Chr(34)}) + ucrVariablesAsFactorForBarChart.bAddParameterIfEmpty = True ucrReceiverByFactor.Selector = ucrBarChartSelector ucrReceiverByFactor.SetIncludedDataTypes({"factor"}) @@ -99,13 +102,6 @@ Public Class dlgBarAndPieChart ucrReceiverByFactor.bWithQuotes = False ucrReceiverByFactor.SetParameterIsString() - ucrReceiverY.Selector = ucrBarChartSelector - ucrReceiverY.strSelectorHeading = "Y Variable" - ucrReceiverY.SetParameter(New RParameter("y", 1)) - ucrReceiverY.bWithQuotes = False - ucrReceiverY.SetParameterIsString() - ucrReceiverY.SetLinkedDisplayControl(lblYvariable) - ucrSaveBar.SetIsComboBox() ucrSaveBar.SetCheckBoxText("Save Graph") ucrSaveBar.SetDataFrameSelector(ucrBarChartSelector.ucrAvailableDataFrames) @@ -127,13 +123,6 @@ Public Class dlgBarAndPieChart ucrChkFlipCoordinates.SetParameter(clsCoordFlipParam, bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) - ucrInputYValues.SetParameter(New RParameter("stat", 0)) - dctStatOptions.Add("Count", Chr(34) & "count" & Chr(34)) - dctStatOptions.Add("Variable", Chr(34) & "identity" & Chr(34)) - ucrInputYValues.SetItems(dctStatOptions) - ucrInputYValues.SetDropDownStyleAsNonEditable() - ucrInputYValues.SetRDefault(Chr(34) & "count" & Chr(34)) - ucrInputBarChartPositions.SetParameter(New RParameter("position", 0)) dctPositionPairs.Add("Stack", Chr(34) & "stack" & Chr(34)) dctPositionPairs.Add("Dodge", Chr(34) & "dodge" & Chr(34)) @@ -156,7 +145,7 @@ Public Class dlgBarAndPieChart ucrBarChartSelector.Reset() ucrBarChartSelector.SetGgplotFunction(clsBaseOperator) - ucrReceiverFirst.SetMeAsReceiver() + ucrVariablesAsFactorForBarChart.SetMeAsReceiver() ucrSaveBar.Reset() bResetSubdialog = True bResetBarLayerSubdialog = True @@ -206,32 +195,19 @@ Public Class dlgBarAndPieChart End Sub Private Sub SetRCodeForControls(bReset As Boolean) - ucrReceiverFirst.SetRCode(clsBarAesFunction, bReset) - ucrReceiverFirst.AddAdditionalCodeParameterPair(clsPieAesFunction, New RParameter("fill", 0), iAdditionalPairNo:=1) - ucrReceiverY.SetRCode(clsBarAesFunction, bReset) - ucrReceiverY.AddAdditionalCodeParameterPair(clsPieAesFunction, New RParameter("y", 1), iAdditionalPairNo:=1) + ucrVariablesAsFactorForBarChart.SetRCode(clsBarAesFunction, bReset) ucrReceiverByFactor.SetRCode(clsBarAesFunction, bReset) ucrSaveBar.SetRCode(clsBaseOperator, bReset) ucrBarChartSelector.SetRCode(clsRggplotFunction, bReset) - ucrPnlOptions.SetRCode(clsBaseOperator, bReset) ucrChkFlipCoordinates.SetRCode(clsBaseOperator, bReset) ucrInputBarChartPositions.SetRCode(clsRgeomBarFunction, bReset) - ucrInputYValues.SetRCode(clsRgeomBarFunction, bReset) End Sub Private Sub TestOkEnabled() - If rdoBarChart.Checked Then - If Not ucrReceiverFirst.IsEmpty AndAlso Not (ucrReceiverY.IsEmpty AndAlso ucrReceiverY.Visible) AndAlso ucrSaveBar.IsComplete Then - ucrBase.OKEnabled(True) - Else - ucrBase.OKEnabled(False) - End If - ElseIf rdoPieChart.Checked Then - If ucrReceiverFirst.IsEmpty OrElse Not ucrSaveBar.IsComplete Then - ucrBase.OKEnabled(False) - Else - ucrBase.OKEnabled(True) - End If + If (Not ucrSaveBar.IsComplete) OrElse (ucrVariablesAsFactorForBarChart.IsEmpty) Then + ucrBase.OKEnabled(False) + Else + ucrBase.OKEnabled(True) End If End Sub @@ -242,7 +218,7 @@ Public Class dlgBarAndPieChart End Sub Private Sub cmdOptions_Click(sender As Object, e As EventArgs) Handles cmdOptions.Click - If rdoBarChart.Checked Then + If rdoValue.Checked Or rdoFrequency.Checked Then sdgPlots.SetRCode(clsNewOperator:=clsBaseOperator, clsNewGlobalAesFunction:=clsBarAesFunction, clsNewYScalecontinuousFunction:=clsYScalecontinuousFunction, clsNewThemeFunction:=clsThemeFuction, dctNewThemeFunctions:=dctThemeFunctions, clsNewXScalecontinuousFunction:=clsXScalecontinuousFunction, clsNewXLabsTitleFunction:=clsXlabFunction, clsNewScaleFillViridisFunction:=clsScaleFillViridisFunction, clsNewScaleColourViridisFunction:=clsScaleColourViridisFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, clsNewFacetFunction:=clsRFacetFunction, ucrNewBaseSelector:=ucrBarChartSelector, clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, clsNewXScaleDateFunction:=clsXScaleDateFunction, clsNewYScaleDateFunction:=clsYScaleDateFunction, bReset:=bResetSubdialog, bNewEnableDiscrete:=False) Else sdgPlots.SetRCode(clsNewOperator:=clsBaseOperator, clsNewGlobalAesFunction:=clsPieAesFunction, clsNewYScalecontinuousFunction:=clsYScalecontinuousFunction, clsNewThemeFunction:=clsThemeFuction, dctNewThemeFunctions:=dctThemeFunctions, clsNewXScalecontinuousFunction:=clsXScalecontinuousFunction, clsNewXLabsTitleFunction:=clsXlabFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, clsNewScaleFillViridisFunction:=clsScaleFillViridisFunction, clsNewScaleColourViridisFunction:=clsScaleColourViridisFunction, clsNewFacetFunction:=clsRFacetFunction, ucrNewBaseSelector:=ucrBarChartSelector, clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, clsNewXScaleDateFunction:=clsXScaleDateFunction, clsNewYScaleDateFunction:=clsYScaleDateFunction, bReset:=bResetSubdialog) @@ -260,11 +236,19 @@ Public Class dlgBarAndPieChart sdgLayerOptions.SetupLayer(clsNewGgPlot:=clsRggplotFunction, clsNewGeomFunc:=clsRgeomBarFunction, clsNewGlobalAesFunc:=clsBarAesFunction, clsNewLocalAes:=clsLocalRaesFunction, bFixGeom:=True, ucrNewBaseSelector:=ucrBarChartSelector, bApplyAesGlobally:=True, bReset:=bResetBarLayerSubdialog) sdgLayerOptions.ShowDialog() bResetBarLayerSubdialog = False - If clsBarAesFunction.ContainsParameter("x") Then - ucrReceiverFirst.Add(clsBarAesFunction.GetParameter("x").strArgumentValue) - Else - ucrReceiverFirst.Clear() - End If + For Each clsParam In clsBarAesFunction.clsParameters + If clsParam.strArgumentName = "y" AndAlso (clsParam.strArgumentValue <> "value" OrElse ucrVariablesAsFactorForBarChart.bSingleVariable) Then + If clsParam.strArgumentValue = (Chr(34) & Chr(34)) Then + ucrVariablesAsFactorForBarChart.Clear() + Else ucrVariablesAsFactorForBarChart.Add(clsParam.strArgumentValue) + End If + ElseIf clsParam.strArgumentName = "x" AndAlso (clsParam.strArgumentValue <> "value" OrElse ucrVariablesAsFactorForBarChart.bSingleVariable) Then + If clsParam.strArgumentValue = (Chr(34) & Chr(34)) Then + ucrVariablesAsFactorForBarChart.Clear() + Else ucrVariablesAsFactorForBarChart.Add(clsParam.strArgumentValue) + End If + End If + Next If clsBarAesFunction.ContainsParameter("fill") Then ucrReceiverByFactor.Add(clsBarAesFunction.GetParameter("fill").strArgumentValue) Else @@ -279,20 +263,11 @@ Public Class dlgBarAndPieChart sdgLayerOptions.SetupLayer(clsNewGgPlot:=clsRggplotFunction, clsNewGeomFunc:=clsRgeomBarFunction, clsNewGlobalAesFunc:=clsPieAesFunction, clsNewLocalAes:=clsLocalRaesFunction, bFixGeom:=True, ucrNewBaseSelector:=ucrBarChartSelector, bApplyAesGlobally:=True, bReset:=bResetBarLayerSubdialog) sdgLayerOptions.ShowDialog() bResetBarLayerSubdialog = False - 'temp fix - should instead be setting R code of the receivers here - If Not clsPieAesFunction.ContainsParameter("x") Then - clsPieAesFunction.AddParameter("x", Chr(34) & Chr(34)) - End If - If clsPieAesFunction.ContainsParameter("fill") Then - ucrReceiverFirst.Add(clsPieAesFunction.GetParameter("fill").strArgumentValue) - Else - ucrReceiverFirst.Clear() - End If TestOkEnabled() End Sub Private Sub SetDialogOptions() - If rdoBarChart.Checked Then + If rdoValue.Checked Or rdoFrequency.Checked Then clsRggplotFunction.AddParameter("mapping", clsRFunctionParameter:=clsBarAesFunction, iPosition:=1) cmdPieChartOptions.Visible = False cmdBarChartOptions.Visible = True @@ -306,70 +281,25 @@ Public Class dlgBarAndPieChart If Not ucrSaveBar.bUserTyped Then ucrSaveBar.SetPrefix("bar") End If - ucrReceiverFirst.RemoveIncludedMetadataProperty("class") - ucrReceiverFirst.strSelectorHeading = "Variables" - ElseIf rdoPieChart.Checked Then - clsRggplotFunction.AddParameter("mapping", clsRFunctionParameter:=clsPieAesFunction, iPosition:=1) - clsRgeomBarFunction.AddParameter("width", "1") - clsBaseOperator.AddParameter(clsRCoordPolarParam) - clsBaseOperator.RemoveParameterByName("geom_col") - ucrReceiverFirst.SetMeAsReceiver() - cmdPieChartOptions.Visible = True - cmdBarChartOptions.Visible = False - cmdColumnChartOptions.Visible = False - If Not ucrSaveBar.bUserTyped Then - ucrSaveBar.SetPrefix("pie") - End If - ucrReceiverFirst.SetIncludedDataTypes({"factor"}) - ucrReceiverFirst.strSelectorHeading = "Factors" - If Not {"factor", "logical"}.Contains(ucrReceiverFirst.strCurrDataType) Then - ucrReceiverFirst.Clear() - End If + ucrVariablesAsFactorForBarChart.RemoveIncludedMetadataProperty("class") + ucrVariablesAsFactorForBarChart.strSelectorHeading = "Variables" End If End Sub - Private Sub ChangeLabel() - lblVariable.Text = If(rdoBarChart.Checked, "X Variable", "Variable") - lblYValue.Text = If(rdoBarChart.Checked, "Y Value", "Value") - lblYvariable.Text = If(rdoBarChart.Checked, "Y Variable", "Value from") - End Sub - - Private Sub ucrPnlOptions_ControlValueChanged() Handles ucrPnlOptions.ControlValueChanged - SetDialogOptions() - ChangeLabel() - setColumnChartOption() - End Sub - - Private Sub setColumnChartOption() - If ucrInputYValues.GetValue = "Variable" Then - lblPosition.Visible = False - ucrInputBarChartPositions.Visible = False - ucrReceiverY.SetVisible(True) - ucrReceiverY.SetMeAsReceiver() - ucrReceiverY.AddOrRemoveParameter(True) - Else - ucrReceiverY.SetVisible(False) - ucrReceiverFirst.SetMeAsReceiver() - ucrReceiverY.AddOrRemoveParameter(False) - lblPosition.Visible = rdoBarChart.Checked - ucrInputBarChartPositions.Visible = rdoBarChart.Checked + Private Sub ChangeParameterName() + If rdoValue.Checked Then + ucrVariablesAsFactorForBarChart.ChangeParameterName("x") + ElseIf rdoFrequency.Checked Then + ucrVariablesAsFactorForBarChart.ChangeParameterName("y") End If End Sub - - Private Sub ucrInputYValues_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputYValues.ControlValueChanged - setColumnChartOption() - TestOkEnabled() + Private Sub ucrPnlOptions_ControlValueChanged() Handles ucrPnlOptions.ControlValueChanged, ucrVariablesAsFactorForBarChart.ControlValueChanged + SetDialogOptions() + ChangeParameterName() End Sub - Private Sub CoreControls_ContentsChanged() Handles ucrReceiverFirst.ControlContentsChanged, ucrReceiverY.ControlContentsChanged, ucrSaveBar.ControlContentsChanged + Private Sub CoreControls_ContentsChanged() Handles ucrVariablesAsFactorForBarChart.ControlContentsChanged, ucrSaveBar.ControlContentsChanged TestOkEnabled() End Sub - Private Sub CoreControls_ContentsChanged(ucrChangedControl As ucrCore) Handles ucrSaveBar.ControlContentsChanged, ucrReceiverY.ControlContentsChanged, ucrReceiverFirst.ControlContentsChanged - - End Sub - - Private Sub ucrPnlOptions_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlOptions.ControlValueChanged - - End Sub End Class From 658fb38f57263972afd0b4788a79208b56072dae Mon Sep 17 00:00:00 2001 From: Antoine Ntalumeso Date: Thu, 10 Jun 2021 09:48:22 +0200 Subject: [PATCH 4/9] Added X variable reciver --- instat/dlgBarAndPieChart.Designer.vb | 20 +++ instat/dlgBarAndPieChart.resx | 233 ++++++++++++++++----------- instat/dlgBarAndPieChart.vb | 39 +++-- 3 files changed, 191 insertions(+), 101 deletions(-) diff --git a/instat/dlgBarAndPieChart.Designer.vb b/instat/dlgBarAndPieChart.Designer.vb index 0b56b23b322..e09a47561ae 100644 --- a/instat/dlgBarAndPieChart.Designer.vb +++ b/instat/dlgBarAndPieChart.Designer.vb @@ -56,6 +56,8 @@ Partial Class dlgBarAndPieChart Me.ucrPnlOptions = New instat.UcrPanel() Me.rdoFrequency = New System.Windows.Forms.RadioButton() Me.ucrVariablesAsFactorForBarChart = New instat.ucrVariablesAsFactor() + Me.lblXvariable = New System.Windows.Forms.Label() + Me.ucrReceiverX = New instat.ucrReceiverSingle() Me.SuspendLayout() ' 'lblByFactor @@ -189,10 +191,26 @@ Partial Class dlgBarAndPieChart Me.ucrVariablesAsFactorForBarChart.ucrSelector = Nothing Me.ucrVariablesAsFactorForBarChart.ucrVariableSelector = Nothing ' + 'lblXvariable + ' + resources.ApplyResources(Me.lblXvariable, "lblXvariable") + Me.lblXvariable.Name = "lblXvariable" + ' + 'ucrReceiverX + ' + Me.ucrReceiverX.frmParent = Me + resources.ApplyResources(Me.ucrReceiverX, "ucrReceiverX") + Me.ucrReceiverX.Name = "ucrReceiverX" + Me.ucrReceiverX.Selector = Nothing + Me.ucrReceiverX.strNcFilePath = "" + Me.ucrReceiverX.ucrSelector = Nothing + ' 'dlgBarAndPieChart ' resources.ApplyResources(Me, "$this") Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.lblXvariable) + Me.Controls.Add(Me.ucrReceiverX) Me.Controls.Add(Me.ucrVariablesAsFactorForBarChart) Me.Controls.Add(Me.rdoFrequency) Me.Controls.Add(Me.ucrInputBarChartPositions) @@ -237,4 +255,6 @@ Partial Class dlgBarAndPieChart Friend WithEvents ucrInputBarChartPositions As ucrInputComboBox Friend WithEvents rdoFrequency As RadioButton Friend WithEvents ucrVariablesAsFactorForBarChart As ucrVariablesAsFactor + Friend WithEvents lblXvariable As Label + Friend WithEvents ucrReceiverX As ucrReceiverSingle End Class \ No newline at end of file diff --git a/instat/dlgBarAndPieChart.resx b/instat/dlgBarAndPieChart.resx index c5a934f9c4c..03bb472989e 100644 --- a/instat/dlgBarAndPieChart.resx +++ b/instat/dlgBarAndPieChart.resx @@ -127,7 +127,7 @@ - 252, 221 + 252, 255 103, 13 @@ -148,7 +148,7 @@ $this - 10 + 12 NoControl @@ -175,7 +175,7 @@ $this - 9 + 11 NoControl @@ -202,7 +202,7 @@ $this - 15 + 17 Button @@ -241,7 +241,7 @@ $this - 8 + 10 Button @@ -277,7 +277,7 @@ $this - 7 + 9 NoControl @@ -304,7 +304,7 @@ $this - 14 + 16 True @@ -313,7 +313,7 @@ NoControl - 252, 265 + 252, 297 47, 13 @@ -334,7 +334,7 @@ $this - 4 + 6 NoControl @@ -361,55 +361,10 @@ $this - 3 - - - Button - - - Flat - - - NoControl - - - 48, 12 - - - 110, 28 - - - 1 - - - Frequency - - - MiddleCenter - - - rdoFrequency - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 1 - - - True - - - 6, 13 - - - 415, 411 + 5 - 252, 281 + 252, 313 92, 21 @@ -427,7 +382,7 @@ $this - 2 + 4 9, 328 @@ -451,7 +406,7 @@ $this - 5 + 7 9, 302 @@ -472,31 +427,127 @@ $this - 6 + 8 - - 252, 236 + + True + + + 6, 13 - + + 415, 411 + + + True + + + NoControl + + + 252, 212 + + + 58, 13 + + + 15 + + + X Variable: + + + lblXvariable + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + 255, 226 + + 0, 0, 0, 0 - - 120, 20 + + 120, 21 - - 7 + + 16 - - ucrReceiverByFactor + + ucrReceiverX - + instat.ucrReceiverSingle, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - + $this - - 11 + + 1 + + + 252, 62 + + + 125, 136 + + + 5 + + + ucrVariablesAsFactorForBarChart + + + instat.ucrVariablesAsFactor, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 2 + + + Button + + + Flat + + + NoControl + + + 48, 12 + + + 110, 28 + + + 1 + + + Frequency + + + MiddleCenter + + + rdoFrequency + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 10, 41 @@ -520,7 +571,7 @@ $this - 12 + 14 9, 358 @@ -541,7 +592,7 @@ $this - 13 + 15 47, 6 @@ -562,10 +613,7 @@ $this - 16 - - - NoControl + 18 CenterScreen @@ -579,25 +627,28 @@ System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 252, 62 + + 252, 270 - - 125, 136 + + 0, 0, 0, 0 - - 5 + + 120, 20 - - ucrVariablesAsFactorForBarChart + + 7 - - instat.ucrVariablesAsFactor, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + ucrReceiverByFactor - + + instat.ucrReceiverSingle, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + $this - - 0 + + 13 \ No newline at end of file diff --git a/instat/dlgBarAndPieChart.vb b/instat/dlgBarAndPieChart.vb index 226037b17a9..e6371d1058f 100644 --- a/instat/dlgBarAndPieChart.vb +++ b/instat/dlgBarAndPieChart.vb @@ -77,16 +77,16 @@ Public Class dlgBarAndPieChart ucrPnlOptions.AddFunctionNamesCondition(rdoValue, "coordpolar") ucrPnlOptions.AddFunctionNamesCondition(rdoPieChart, "coordpolar") - ucrPnlOptions.AddToLinkedControls({ucrChkFlipCoordinates}, {rdoFrequency, rdoValue}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - ucrPnlOptions.AddToLinkedControls(ucrInputBarChartPositions, {rdoFrequency, rdoValue}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - ucrPnlOptions.AddToLinkedControls({ucrReceiverByFactor}, {rdoFrequency, rdoValue}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlOptions.AddToLinkedControls({ucrChkFlipCoordinates, ucrInputBarChartPositions, ucrReceiverByFactor}, {rdoFrequency, rdoValue}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlOptions.AddToLinkedControls(ucrReceiverX, {rdoValue}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrReceiverByFactor.SetLinkedDisplayControl(lblByFactor) + ucrReceiverX.SetLinkedDisplayControl(lblXvariable) ucrInputBarChartPositions.SetLinkedDisplayControl(lblPosition) ucrBarChartSelector.SetParameter(New RParameter("data", 0)) ucrBarChartSelector.SetParameterIsrfunction() - ucrVariablesAsFactorForBarChart.SetParameter(New RParameter("y", 1)) + ucrVariablesAsFactorForBarChart.SetParameter(New RParameter("x", 0)) ucrVariablesAsFactorForBarChart.SetParameterIsString() ucrVariablesAsFactorForBarChart.bWithQuotes = False ucrVariablesAsFactorForBarChart.Selector = ucrBarChartSelector @@ -95,6 +95,12 @@ Public Class dlgBarAndPieChart ucrVariablesAsFactorForBarChart.SetValuesToIgnore({Chr(34) & Chr(34)}) ucrVariablesAsFactorForBarChart.bAddParameterIfEmpty = True + ucrReceiverX.Selector = ucrBarChartSelector + ucrReceiverX.strSelectorHeading = "X Variable" + 'ucrReceiverX.SetParameter(New RParameter("x", 0)) + ucrReceiverX.bWithQuotes = False + ucrReceiverX.SetParameterIsString() + ucrReceiverByFactor.Selector = ucrBarChartSelector ucrReceiverByFactor.SetIncludedDataTypes({"factor"}) ucrReceiverByFactor.strSelectorHeading = "Factors" @@ -196,6 +202,7 @@ Public Class dlgBarAndPieChart Private Sub SetRCodeForControls(bReset As Boolean) ucrVariablesAsFactorForBarChart.SetRCode(clsBarAesFunction, bReset) + ucrReceiverX.SetRCode(clsBarAesFunction, bReset) ucrReceiverByFactor.SetRCode(clsBarAesFunction, bReset) ucrSaveBar.SetRCode(clsBaseOperator, bReset) ucrBarChartSelector.SetRCode(clsRggplotFunction, bReset) @@ -204,10 +211,18 @@ Public Class dlgBarAndPieChart End Sub Private Sub TestOkEnabled() - If (Not ucrSaveBar.IsComplete) OrElse (ucrVariablesAsFactorForBarChart.IsEmpty) Then - ucrBase.OKEnabled(False) - Else - ucrBase.OKEnabled(True) + If rdoFrequency.Checked Then + If Not ucrSaveBar.IsComplete OrElse ucrVariablesAsFactorForBarChart.IsEmpty Then + ucrBase.OKEnabled(False) + Else + ucrBase.OKEnabled(True) + End If + ElseIf rdoValue.Checked Then + If Not ucrSaveBar.IsComplete OrElse ucrVariablesAsFactorForBarChart.IsEmpty OrElse ucrReceiverX.IsEmpty Then + ucrBase.OKEnabled(False) + Else + ucrBase.OKEnabled(True) + End If End If End Sub @@ -288,9 +303,10 @@ Public Class dlgBarAndPieChart Private Sub ChangeParameterName() If rdoValue.Checked Then - ucrVariablesAsFactorForBarChart.ChangeParameterName("x") - ElseIf rdoFrequency.Checked Then ucrVariablesAsFactorForBarChart.ChangeParameterName("y") + ucrReceiverX.Add(clsBarAesFunction.GetParameter("x").strArgumentValue) + ElseIf rdoFrequency.Checked Then + ucrVariablesAsFactorForBarChart.ChangeParameterName("x") End If End Sub Private Sub ucrPnlOptions_ControlValueChanged() Handles ucrPnlOptions.ControlValueChanged, ucrVariablesAsFactorForBarChart.ControlValueChanged @@ -302,4 +318,7 @@ Public Class dlgBarAndPieChart TestOkEnabled() End Sub + Private Sub CoreControls_ContentsChanged(ucrChangedControl As ucrCore) Handles ucrVariablesAsFactorForBarChart.ControlContentsChanged, ucrSaveBar.ControlContentsChanged + + End Sub End Class From ed3c97e727174c88b88c8f6590a42eddff49d4a4 Mon Sep 17 00:00:00 2001 From: Antoine Ntalumeso Date: Thu, 10 Jun 2021 11:09:28 +0200 Subject: [PATCH 5/9] Improved the codes --- instat/dlgBarAndPieChart.resx | 22 +++++++++++----------- instat/dlgBarAndPieChart.vb | 26 +++++++++++++------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/instat/dlgBarAndPieChart.resx b/instat/dlgBarAndPieChart.resx index 03bb472989e..626a0d01613 100644 --- a/instat/dlgBarAndPieChart.resx +++ b/instat/dlgBarAndPieChart.resx @@ -133,7 +133,7 @@ 103, 13 - 6 + 8 By Factor (Optional): @@ -160,7 +160,7 @@ 121, 25 - 11 + 13 Plot Options @@ -319,7 +319,7 @@ 47, 13 - 8 + 10 Position: @@ -346,7 +346,7 @@ 121, 25 - 10 + 12 Column Chart Options @@ -370,7 +370,7 @@ 92, 21 - 9 + 11 ucrInputBarChartPositions @@ -394,7 +394,7 @@ 255, 24 - 13 + 15 ucrSaveBar @@ -415,7 +415,7 @@ 166, 20 - 12 + 14 ucrChkFlipCoordinates @@ -451,7 +451,7 @@ 58, 13 - 15 + 6 X Variable: @@ -478,7 +478,7 @@ 120, 21 - 16 + 7 ucrReceiverX @@ -580,7 +580,7 @@ 410, 52 - 14 + 16 ucrBase @@ -637,7 +637,7 @@ 120, 20 - 7 + 9 ucrReceiverByFactor diff --git a/instat/dlgBarAndPieChart.vb b/instat/dlgBarAndPieChart.vb index e6371d1058f..4cfdbe3b24b 100644 --- a/instat/dlgBarAndPieChart.vb +++ b/instat/dlgBarAndPieChart.vb @@ -86,9 +86,9 @@ Public Class dlgBarAndPieChart ucrBarChartSelector.SetParameter(New RParameter("data", 0)) ucrBarChartSelector.SetParameterIsrfunction() - ucrVariablesAsFactorForBarChart.SetParameter(New RParameter("x", 0)) + 'ucrVariablesAsFactorForBarChart.SetParameter(New RParameter("x", 0)) ucrVariablesAsFactorForBarChart.SetParameterIsString() - ucrVariablesAsFactorForBarChart.bWithQuotes = False + 'ucrVariablesAsFactorForBarChart.bWithQuotes = False ucrVariablesAsFactorForBarChart.Selector = ucrBarChartSelector ucrVariablesAsFactorForBarChart.SetFactorReceiver(ucrReceiverByFactor) ucrVariablesAsFactorForBarChart.strSelectorHeading = "Variables" @@ -98,7 +98,7 @@ Public Class dlgBarAndPieChart ucrReceiverX.Selector = ucrBarChartSelector ucrReceiverX.strSelectorHeading = "X Variable" 'ucrReceiverX.SetParameter(New RParameter("x", 0)) - ucrReceiverX.bWithQuotes = False + 'ucrReceiverX.bWithQuotes = False ucrReceiverX.SetParameterIsString() ucrReceiverByFactor.Selector = ucrBarChartSelector @@ -302,23 +302,23 @@ Public Class dlgBarAndPieChart End Sub Private Sub ChangeParameterName() + clsBarAesFunction.RemoveParameterByName("x") + clsBarAesFunction.RemoveParameterByName("y") If rdoValue.Checked Then - ucrVariablesAsFactorForBarChart.ChangeParameterName("y") - ucrReceiverX.Add(clsBarAesFunction.GetParameter("x").strArgumentValue) - ElseIf rdoFrequency.Checked Then - ucrVariablesAsFactorForBarChart.ChangeParameterName("x") + 'ucrVariablesAsFactorForBarChart.ChangeParameterName("y") + clsBarAesFunction.AddParameter("x", ucrReceiverX.GetVariableNames(False), iPosition:=1) + clsBarAesFunction.AddParameter("y", ucrVariablesAsFactorForBarChart.GetVariableNames(False), iPosition:=2) + ElseIf rdoFrequency.Checked Then + 'ucrVariablesAsFactorForBarChart.ChangeParameterName("x") + clsBarAesFunction.AddParameter("x", ucrVariablesAsFactorForBarChart.GetVariableNames(False), iPosition:=1) End If End Sub - Private Sub ucrPnlOptions_ControlValueChanged() Handles ucrPnlOptions.ControlValueChanged, ucrVariablesAsFactorForBarChart.ControlValueChanged + Private Sub ucrPnlOptions_ControlValueChanged() Handles ucrPnlOptions.ControlValueChanged, ucrVariablesAsFactorForBarChart.ControlValueChanged, ucrReceiverX.ControlValueChanged SetDialogOptions() ChangeParameterName() End Sub - Private Sub CoreControls_ContentsChanged() Handles ucrVariablesAsFactorForBarChart.ControlContentsChanged, ucrSaveBar.ControlContentsChanged + Private Sub CoreControls_ContentsChanged() Handles ucrVariablesAsFactorForBarChart.ControlContentsChanged, ucrSaveBar.ControlContentsChanged, ucrReceiverX.ControlContentsChanged TestOkEnabled() End Sub - - Private Sub CoreControls_ContentsChanged(ucrChangedControl As ucrCore) Handles ucrVariablesAsFactorForBarChart.ControlContentsChanged, ucrSaveBar.ControlContentsChanged - - End Sub End Class From bb412a7b75d26bf1166e5e70404589ab867ddbbc Mon Sep 17 00:00:00 2001 From: Antoine Ntalumeso Date: Thu, 10 Jun 2021 13:01:25 +0200 Subject: [PATCH 6/9] Added stat parameter for frequency and value option --- instat/dlgBarAndPieChart.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instat/dlgBarAndPieChart.vb b/instat/dlgBarAndPieChart.vb index 4cfdbe3b24b..1f66b112e1a 100644 --- a/instat/dlgBarAndPieChart.vb +++ b/instat/dlgBarAndPieChart.vb @@ -305,12 +305,12 @@ Public Class dlgBarAndPieChart clsBarAesFunction.RemoveParameterByName("x") clsBarAesFunction.RemoveParameterByName("y") If rdoValue.Checked Then - 'ucrVariablesAsFactorForBarChart.ChangeParameterName("y") clsBarAesFunction.AddParameter("x", ucrReceiverX.GetVariableNames(False), iPosition:=1) clsBarAesFunction.AddParameter("y", ucrVariablesAsFactorForBarChart.GetVariableNames(False), iPosition:=2) + clsRgeomBarFunction.AddParameter("stat", Chr(34) & "identity" & Chr(34), iPosition:=1) ElseIf rdoFrequency.Checked Then - 'ucrVariablesAsFactorForBarChart.ChangeParameterName("x") clsBarAesFunction.AddParameter("x", ucrVariablesAsFactorForBarChart.GetVariableNames(False), iPosition:=1) + clsRgeomBarFunction.AddParameter("stat", Chr(34) & "count" & Chr(34), iPosition:=1) End If End Sub Private Sub ucrPnlOptions_ControlValueChanged() Handles ucrPnlOptions.ControlValueChanged, ucrVariablesAsFactorForBarChart.ControlValueChanged, ucrReceiverX.ControlValueChanged From 524d66c8031f109f1b6fd80607635d911a973489 Mon Sep 17 00:00:00 2001 From: Antoine Ntalumeso Date: Thu, 10 Jun 2021 13:06:36 +0200 Subject: [PATCH 7/9] Removed commented code --- instat/dlgBarAndPieChart.vb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/instat/dlgBarAndPieChart.vb b/instat/dlgBarAndPieChart.vb index 1f66b112e1a..8c5851b2877 100644 --- a/instat/dlgBarAndPieChart.vb +++ b/instat/dlgBarAndPieChart.vb @@ -86,9 +86,7 @@ Public Class dlgBarAndPieChart ucrBarChartSelector.SetParameter(New RParameter("data", 0)) ucrBarChartSelector.SetParameterIsrfunction() - 'ucrVariablesAsFactorForBarChart.SetParameter(New RParameter("x", 0)) ucrVariablesAsFactorForBarChart.SetParameterIsString() - 'ucrVariablesAsFactorForBarChart.bWithQuotes = False ucrVariablesAsFactorForBarChart.Selector = ucrBarChartSelector ucrVariablesAsFactorForBarChart.SetFactorReceiver(ucrReceiverByFactor) ucrVariablesAsFactorForBarChart.strSelectorHeading = "Variables" @@ -97,8 +95,6 @@ Public Class dlgBarAndPieChart ucrReceiverX.Selector = ucrBarChartSelector ucrReceiverX.strSelectorHeading = "X Variable" - 'ucrReceiverX.SetParameter(New RParameter("x", 0)) - 'ucrReceiverX.bWithQuotes = False ucrReceiverX.SetParameterIsString() ucrReceiverByFactor.Selector = ucrBarChartSelector From 301f771f52e5926b01af72c523d96c10ca097661 Mon Sep 17 00:00:00 2001 From: Antoine Ntalumeso Date: Sat, 12 Jun 2021 10:56:05 +0200 Subject: [PATCH 8/9] Small design fix --- instat/dlgBarAndPieChart.resx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instat/dlgBarAndPieChart.resx b/instat/dlgBarAndPieChart.resx index 626a0d01613..c087f77da4b 100644 --- a/instat/dlgBarAndPieChart.resx +++ b/instat/dlgBarAndPieChart.resx @@ -367,7 +367,7 @@ 252, 313 - 92, 21 + 120, 21 11 @@ -469,7 +469,7 @@ 0 - 255, 226 + 252, 226 0, 0, 0, 0 From 65a3d33b0f7a9191e44aeec0804667e90e1c0a38 Mon Sep 17 00:00:00 2001 From: Antoine Ntalumeso Date: Mon, 14 Jun 2021 11:06:37 +0200 Subject: [PATCH 9/9] small code change --- instat/dlgBarAndPieChart.vb | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/instat/dlgBarAndPieChart.vb b/instat/dlgBarAndPieChart.vb index 8c5851b2877..a2fab5c985d 100644 --- a/instat/dlgBarAndPieChart.vb +++ b/instat/dlgBarAndPieChart.vb @@ -247,19 +247,11 @@ Public Class dlgBarAndPieChart sdgLayerOptions.SetupLayer(clsNewGgPlot:=clsRggplotFunction, clsNewGeomFunc:=clsRgeomBarFunction, clsNewGlobalAesFunc:=clsBarAesFunction, clsNewLocalAes:=clsLocalRaesFunction, bFixGeom:=True, ucrNewBaseSelector:=ucrBarChartSelector, bApplyAesGlobally:=True, bReset:=bResetBarLayerSubdialog) sdgLayerOptions.ShowDialog() bResetBarLayerSubdialog = False - For Each clsParam In clsBarAesFunction.clsParameters - If clsParam.strArgumentName = "y" AndAlso (clsParam.strArgumentValue <> "value" OrElse ucrVariablesAsFactorForBarChart.bSingleVariable) Then - If clsParam.strArgumentValue = (Chr(34) & Chr(34)) Then - ucrVariablesAsFactorForBarChart.Clear() - Else ucrVariablesAsFactorForBarChart.Add(clsParam.strArgumentValue) - End If - ElseIf clsParam.strArgumentName = "x" AndAlso (clsParam.strArgumentValue <> "value" OrElse ucrVariablesAsFactorForBarChart.bSingleVariable) Then - If clsParam.strArgumentValue = (Chr(34) & Chr(34)) Then - ucrVariablesAsFactorForBarChart.Clear() - Else ucrVariablesAsFactorForBarChart.Add(clsParam.strArgumentValue) - End If - End If - Next + If clsBarAesFunction.ContainsParameter("x") Then + ucrVariablesAsFactorForBarChart.Add(clsBarAesFunction.GetParameter("x").strArgumentValue) + Else + ucrVariablesAsFactorForBarChart.Clear() + End If If clsBarAesFunction.ContainsParameter("fill") Then ucrReceiverByFactor.Add(clsBarAesFunction.GetParameter("fill").strArgumentValue) Else