diff --git a/instat/dlgGeneralForGraphics.Designer.vb b/instat/dlgGeneralForGraphics.Designer.vb index a4bba9e7399..6cdc6909633 100644 --- a/instat/dlgGeneralForGraphics.Designer.vb +++ b/instat/dlgGeneralForGraphics.Designer.vb @@ -25,6 +25,7 @@ Partial Class dlgGeneralForGraphics Me.ucrAdditionalLayers = New instat.ucrAdditionalLayers() Me.ucrSaveGraph = New instat.ucrSaveGraph() Me.ucrBase = New instat.ucrButtons() + Me.cmdOptions = New System.Windows.Forms.Button() Me.SuspendLayout() ' 'ucrAdditionalLayers @@ -48,11 +49,22 @@ Partial Class dlgGeneralForGraphics Me.ucrBase.Size = New System.Drawing.Size(410, 53) Me.ucrBase.TabIndex = 0 ' + 'cmdOptions + ' + Me.cmdOptions.Location = New System.Drawing.Point(267, 45) + Me.cmdOptions.Name = "cmdOptions" + Me.cmdOptions.Size = New System.Drawing.Size(120, 25) + Me.cmdOptions.TabIndex = 9 + Me.cmdOptions.Tag = "Options" + Me.cmdOptions.Text = "Plot Options" + Me.cmdOptions.UseVisualStyleBackColor = True + ' 'dlgGeneralForGraphics ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(422, 303) + Me.Controls.Add(Me.cmdOptions) Me.Controls.Add(Me.ucrAdditionalLayers) Me.Controls.Add(Me.ucrSaveGraph) Me.Controls.Add(Me.ucrBase) @@ -70,4 +82,5 @@ Partial Class dlgGeneralForGraphics Friend WithEvents ucrBase As ucrButtons Friend WithEvents ucrSaveGraph As ucrSaveGraph Friend WithEvents ucrAdditionalLayers As ucrAdditionalLayers + Friend WithEvents cmdOptions As Button End Class diff --git a/instat/dlgGeneralForGraphics.vb b/instat/dlgGeneralForGraphics.vb index fc53228b617..3a063fa3974 100644 --- a/instat/dlgGeneralForGraphics.vb +++ b/instat/dlgGeneralForGraphics.vb @@ -43,7 +43,7 @@ Public Class dlgGeneralForGraphics clsRggplotFunction.SetRCommand("ggplot") clsGgplotAesFunction.SetRCommand("aes") ucrBase.clsRsyntax.SetOperatorParameter(True, clsRFunc:=clsRggplotFunction) - 'True for "we are setting the first parameter, on the left of +. + 'True for "we are setting the first parameter, on the left of +". ucrBase.iHelpTopicID = 356 ucrSaveGraph.SetDataFrameSelector(sdgLayerOptions.ucrGeomWithAes.UcrSelector.ucrAvailableDataFrames) @@ -70,6 +70,8 @@ Public Class dlgGeneralForGraphics If ucrBase.clsRsyntax.clsBaseOperator IsNot Nothing Then ucrBase.clsRsyntax.clsBaseOperator.RemoveAllAdditionalParameters() End If + sdgPlots.Reset() + 'Warning/to be discussed: sdgPlots doesn't work like sdgLayerOptions. Information actually stays on the dialogue, as it cannot be editted on the general for graphics (yet) I think that sdgPlots should work like LayerOptions and be filled in at load, thanks to a setup function and setsettings sub. TestOKEnabled() End Sub @@ -168,4 +170,20 @@ Public Class dlgGeneralForGraphics ucrBase.clsRsyntax.SetAssignTo("last_graph", strTempDataframe:=sdgLayerOptions.ucrGeomWithAes.UcrSelector.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") End If End Sub + + Private Sub SetupPlotOptions() 'Warning to be discussed: I m hoping to have a Setup function in sdgPlots itself... ? + sdgPlots.SetRSyntax(ucrBase.clsRsyntax) + sdgPlots.SetGgplotFunction(clsRggplotFunction) + End Sub + Private Sub cmdOptions_Click(sender As Object, e As EventArgs) Handles cmdOptions.Click + sdgPlots.DisableLayersTab() + SetupPlotOptions() + sdgPlots.ShowDialog() + sdgPlots.EnableLayersTab() + End Sub + + Private Sub ucrAdditionalLayers_NumberOfLayersChanged() Handles ucrAdditionalLayers.NumberOfLayersChanged + 'When the number of Layers in the lstLayers on ucrAdditionalLayers need to check if OK is enabled on dlgGeneralForGraphics. + TestOKEnabled() + End Sub End Class \ No newline at end of file diff --git a/instat/dlgSplitText.Designer.vb b/instat/dlgSplitText.Designer.vb index f4d9a9a89b0..f6c03b4d328 100644 --- a/instat/dlgSplitText.Designer.vb +++ b/instat/dlgSplitText.Designer.vb @@ -40,7 +40,7 @@ Partial Class dlgSplitText Me.lblSelectedFactor.Location = New System.Drawing.Point(271, 37) Me.lblSelectedFactor.Name = "lblSelectedFactor" Me.lblSelectedFactor.Size = New System.Drawing.Size(140, 23) - Me.lblSelectedFactor.TabIndex = 7 + Me.lblSelectedFactor.TabIndex = 1 Me.lblSelectedFactor.Tag = "Selected_Factor" Me.lblSelectedFactor.Text = "Selected Factor:" ' @@ -49,7 +49,7 @@ Partial Class dlgSplitText Me.lblSplitBy.Location = New System.Drawing.Point(271, 81) Me.lblSplitBy.Name = "lblSplitBy" Me.lblSplitBy.Size = New System.Drawing.Size(140, 23) - Me.lblSplitBy.TabIndex = 6 + Me.lblSplitBy.TabIndex = 3 Me.lblSplitBy.Tag = "" Me.lblSplitBy.Text = "Split by:" ' @@ -58,7 +58,7 @@ Partial Class dlgSplitText Me.lblNewColumnNames.Location = New System.Drawing.Point(10, 203) Me.lblNewColumnNames.Name = "lblNewColumnNames" Me.lblNewColumnNames.Size = New System.Drawing.Size(161, 23) - Me.lblNewColumnNames.TabIndex = 5 + Me.lblNewColumnNames.TabIndex = 7 Me.lblNewColumnNames.Tag = "" Me.lblNewColumnNames.Text = "Prefix for New Columns:" ' @@ -67,7 +67,7 @@ Partial Class dlgSplitText Me.lblNumberofPiecesToReturn.Location = New System.Drawing.Point(269, 131) Me.lblNumberofPiecesToReturn.Name = "lblNumberofPiecesToReturn" Me.lblNumberofPiecesToReturn.Size = New System.Drawing.Size(149, 23) - Me.lblNumberofPiecesToReturn.TabIndex = 4 + Me.lblNumberofPiecesToReturn.TabIndex = 5 Me.lblNumberofPiecesToReturn.Tag = "Number_of_Pieces_to_Return" Me.lblNumberofPiecesToReturn.Text = "Number of Pieces to Return:" ' @@ -77,7 +77,7 @@ Partial Class dlgSplitText Me.nudN.Minimum = New Decimal(New Integer() {1, 0, 0, 0}) Me.nudN.Name = "nudN" Me.nudN.Size = New System.Drawing.Size(37, 20) - Me.nudN.TabIndex = 3 + Me.nudN.TabIndex = 6 Me.nudN.Value = New Decimal(New Integer() {1, 0, 0, 0}) ' 'ucrInputPattern @@ -86,7 +86,7 @@ Partial Class dlgSplitText Me.ucrInputPattern.Location = New System.Drawing.Point(272, 96) Me.ucrInputPattern.Name = "ucrInputPattern" Me.ucrInputPattern.Size = New System.Drawing.Size(137, 21) - Me.ucrInputPattern.TabIndex = 0 + Me.ucrInputPattern.TabIndex = 4 ' 'ucrReceiverSplitTextColumn ' @@ -95,7 +95,7 @@ Partial Class dlgSplitText Me.ucrReceiverSplitTextColumn.Name = "ucrReceiverSplitTextColumn" Me.ucrReceiverSplitTextColumn.Selector = Nothing Me.ucrReceiverSplitTextColumn.Size = New System.Drawing.Size(137, 20) - Me.ucrReceiverSplitTextColumn.TabIndex = 1 + Me.ucrReceiverSplitTextColumn.TabIndex = 2 ' 'ucrInputColumnsIntoText ' @@ -103,7 +103,7 @@ Partial Class dlgSplitText Me.ucrInputColumnsIntoText.Location = New System.Drawing.Point(131, 200) Me.ucrInputColumnsIntoText.Name = "ucrInputColumnsIntoText" Me.ucrInputColumnsIntoText.Size = New System.Drawing.Size(137, 21) - Me.ucrInputColumnsIntoText.TabIndex = 2 + Me.ucrInputColumnsIntoText.TabIndex = 8 ' 'ucrSelectorSplitTextColumn ' @@ -113,7 +113,7 @@ Partial Class dlgSplitText Me.ucrSelectorSplitTextColumn.Margin = New System.Windows.Forms.Padding(0) Me.ucrSelectorSplitTextColumn.Name = "ucrSelectorSplitTextColumn" Me.ucrSelectorSplitTextColumn.Size = New System.Drawing.Size(210, 180) - Me.ucrSelectorSplitTextColumn.TabIndex = 8 + Me.ucrSelectorSplitTextColumn.TabIndex = 0 ' 'ucrBase ' diff --git a/instat/dlgSplitText.vb b/instat/dlgSplitText.vb index 6b61da09534..ea4b7d951db 100644 --- a/instat/dlgSplitText.vb +++ b/instat/dlgSplitText.vb @@ -33,7 +33,7 @@ Public Class dlgSplitText End Sub Private Sub TestOKEnabled() - If Not ucrReceiverSplitTextColumn.IsEmpty() AndAlso nudN.Text <> "" Then + If Not ucrReceiverSplitTextColumn.IsEmpty() AndAlso nudN.Text <> "" AndAlso Not ucrInputPattern.IsEmpty AndAlso Not ucrInputColumnsIntoText.IsEmpty Then ucrBase.OKEnabled(True) Else ucrBase.OKEnabled(False) @@ -59,7 +59,6 @@ Public Class dlgSplitText Private Sub SetDefaults() ucrSelectorSplitTextColumn.Reset() ucrSelectorSplitTextColumn.Focus() - ucrInputColumnsIntoText.Reset() ucrInputColumnsIntoText.SetName("SplitText") ucrInputPattern.ResetText() nudN.Value = 2 @@ -72,6 +71,7 @@ Public Class dlgSplitText Private Sub cboInputPattern_Namechanged() Handles ucrInputPattern.NameChanged PatternParameter() + TestOKEnabled() End Sub Private Sub PatternParameter() @@ -80,17 +80,18 @@ Public Class dlgSplitText ucrBase.clsRsyntax.AddParameter("pattern", Chr(34) & " " & Chr(34)) Case "" If frmMain.clsInstatOptions.bIncludeRDefaultParameters Then - ucrBase.clsRsyntax.AddParameter("pattern", Chr(34) & "" & Chr(34)) + ucrBase.clsRsyntax.AddParameter("pattern", "fixed (" & Chr(34) & "" & Chr(34) & ")") Else ucrBase.clsRsyntax.RemoveParameter("pattern") End If Case Else - ucrBase.clsRsyntax.AddParameter("pattern", Chr(34) & ucrInputPattern.GetText() & Chr(34)) + ucrBase.clsRsyntax.AddParameter("pattern", "fixed (" & Chr(34) & ucrInputPattern.GetText() & Chr(34) & ")") End Select End Sub Private Sub ucrInputColumnIntText_NameChanged() Handles ucrInputColumnsIntoText.NameChanged ucrBase.clsRsyntax.SetAssignTo(strAssignToName:=ucrInputColumnsIntoText.GetText, strTempDataframe:=ucrSelectorSplitTextColumn.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempColumn:=ucrInputColumnsIntoText.GetText, bAssignToIsPrefix:=True) + TestOKEnabled() End Sub Private Sub ucrReceiverSplitTextColumn_SelectionChanged(sender As Object, e As EventArgs) Handles ucrReceiverSplitTextColumn.SelectionChanged diff --git a/instat/sdgPlots.vb b/instat/sdgPlots.vb index 2dbec6dab43..a876aa8a990 100644 --- a/instat/sdgPlots.vb +++ b/instat/sdgPlots.vb @@ -23,7 +23,7 @@ Public Class sdgPlots Public clsRsyntax As New RSyntax 'This clsRSyntax is linked with the ucrBase.clsRSyntax from the dlg calling sdgPLotOptions... Public clsRggplotFunction As New RFunction - Public clsAesFunction As New RFunction + Public clsAesFunction As New RFunction 'Warning: I m not sure this field is useful... Will all be revised when changing links though... Public clsRFacetFunction As New RFunction Public clsXLabFunction As New RFunction Public clsYLabFunction As New RFunction @@ -46,6 +46,13 @@ Public Class sdgPlots autoTranslate(Me) End Sub + Public Sub DisableLayersTab() + tabLayers.Enabled = False + End Sub + + Public Sub EnableLayersTab() + tabLayers.Enabled = True + End Sub Public Sub SetDefaults() TitleDefaults() @@ -80,10 +87,12 @@ Public Class sdgPlots InitialiseTabs() CreateThemes() FacetsReceiversSetup() - 'The following three setup the ucrAdditionalLayers on the sdgPlots. Shares the global ggplot function and aesthetics, as well as the whole PLots RSyntax. - ucrPlotsAdditionalLayers.SetGGplotFunction(clsRggplotFunction) + 'The following sets up the clsGgplotAesFunction in ucrAdditionalLayers. Not sure this should happen in the initialise dialog... Not sure of the objective either... It is never linked to the main dlg anyway... ucrPlotsAdditionalLayers.SetAesFunction(clsAesFunction) + 'The following two setup the ucrAdditionalLayers on the sdgPlots. Shares the global ggplot function, as well as the whole PLots RSyntax. + ucrPlotsAdditionalLayers.SetGGplotFunction(clsRggplotFunction) ucrPlotsAdditionalLayers.SetRSyntax(clsRsyntax) + 'Set's the X Axis tab to X mode and the YAxis tab to Y mode (each tab contains a generic ucrAxis with internal X or Y boolean setting). 'Also carry the RSyntax through to these ucr's . ucrXAxis.SetXorY(True) @@ -346,7 +355,9 @@ Public Class sdgPlots 'Question to be discussed/Task: This is the kind of subs that could go into a SetupPlotOptions procedure... also only called in two specific plots and not in the others ... Why ? (to be explored) Public Sub SetGgplotFunction(clsGgplotFunc As RFunction) + 'When the link for clsRggplotFunction has been changed, the ucrAdditionalLayers GgplotFunction needs to be updated. clsRggplotFunction = clsGgplotFunc + ucrPlotsAdditionalLayers.SetGGplotFunction(clsRggplotFunction) End Sub Public Sub SetDataFrame(strNewDataFrame As String) @@ -355,7 +366,9 @@ Public Class sdgPlots End Sub Public Sub SetRSyntax(clsRSyntaxIn As RSyntax) + 'When the link for RSyntax has been changed, the ucrAdditionalLayers RSyntax needs to be updated. clsRsyntax = clsRSyntaxIn + ucrPlotsAdditionalLayers.SetRSyntax(clsRsyntax) End Sub @@ -422,4 +435,6 @@ Public Class sdgPlots End Sub + 'Warning/Task to be discussed: need to disable ok on dlg's when layers are not complete on subdialogues + warning message... + 'Warning: actually this will be very hard to implement until the global aes, set from the main layer are properly communicated to plots. Global aes might fill in missing mandatory aes... End Class \ No newline at end of file diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index f366b8ece37..c1fc22afc1b 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -1118,6 +1118,8 @@ data_object$set("public", "get_data_type", function(col_name = "") { type = "logical" } else if(is.Date(private$data[[col_name]])){ + # #TODO + #we can add options for other forms of dates serch as POSIXct, POSIXlt, Date, chron, yearmon, yearqtr, zoo, zooreg, timeDate, xts, its, ti, jul, timeSeries, and fts objects. type = "Date" } else if(is.numeric(private$data[[col_name]])) { @@ -1652,14 +1654,49 @@ data_object$set("public","make_date_yeardoy", function(year, doy, year_format = } ) -data_object$set("public","set_contrasts_of_factor", function(col_name, new_contrasts) { +data_object$set("public","set_contrasts_of_factor", function(col_name, new_contrasts, defined_contr_matrix) { if(!col_name %in% names(self$get_data_frame())) stop(col_name, " not found in the data") if(!is.factor(self$get_columns_from_data(col_name))) stop(factor, " is not a factor column.") - #checks needed on contrasts before assigning - - if(!(new_contrasts %in% c("contr.treatment","contr.helmert","contr.poly","contr.sum"))){ + factor_col <- self$get_columns_from_data(col_name) + contr_col <- nlevels(factor_col) - 1 + contr_row <- nlevels(factor_col) + if(new_contrasts == "user_defined") { + if(any(is.na(defined_contr_matrix)) ||!is.numeric(defined_contr_matrix) ||nrow(defined_contr_matrix) != contr_row || ncol(defined_contr_matrix) != contr_col) stop(paste0("The contrast matrix should have ", contr_col, " column(s) and ", contr_row, " row(s) ")) + } + #checks needed on contrasts before assigning + if(!(new_contrasts %in% c("contr.treatment", "contr.helmert", "contr.poly", "contr.sum", "user_defined"))) { stop(new_contrasts, " is not a valid contrast name") + } + else if(!is.character(new_contrasts)) { + stop("New column name must be of type: character") + } + contrasts(private$data[[col_name]]) <- new_contrasts + } +) +data_object$set("public","split_date", function(data_name, col_name = "", week = FALSE, month = FALSE, year = FALSE, day = FALSE) { + col_data <- self$get_columns_from_data(col_name, use_current_filter = FALSE) + if(!is.Date(col_data)) stop("This column must be a date or time!") + if(week) { + week <- week(col_data) + col_name <- next_default_item(prefix = "week", existing_names = self$get_column_names(), include_index = FALSE) + self$add_columns_to_data(col_name = col_name, col_data = week) + } + if(month) { + month <- month(col_data) + col_name <- next_default_item(prefix = "month", existing_names = self$get_column_names(), include_index = FALSE) + self$add_columns_to_data(col_name = col_name, col_data = month) + } + if(year) { + year <- year(col_data) + col_name <- next_default_item(prefix = "year", existing_names = self$get_column_names(), include_index = FALSE) + self$add_columns_to_data(col_name = col_name, col_data = year) + } + if(day) { + day <- day(col_data) + col_name <- next_default_item(prefix = "day", existing_names = self$get_column_names(), include_index = FALSE) + self$add_columns_to_data(col_name = col_name, col_data = day) + } + #TO Do + #Implement option for the day of the year } - contrasts(private$data[[col_name]]) <- new_contrasts -} ) \ No newline at end of file diff --git a/instat/static/InstatObject/R/instat_object_R6.R b/instat/static/InstatObject/R/instat_object_R6.R index 446b50f8af8..4dc175b1cf6 100644 --- a/instat/static/InstatObject/R/instat_object_R6.R +++ b/instat/static/InstatObject/R/instat_object_R6.R @@ -987,8 +987,8 @@ instat_object$set("public","make_date_yeardoy", function(data_name, year, doy, y } ) -instat_object$set("public","set_contrasts_of_factor", function(data_name, col_name, new_contrasts) { - self$get_data_objects(data_name)$set_contrasts_of_factor(col_name = col_name, new_contrasts = new_contrasts) +instat_object$set("public","set_contrasts_of_factor", function(data_name, col_name, new_contrasts, defined_contr_matrix) { + self$get_data_objects(data_name)$set_contrasts_of_factor(col_name = col_name, new_contrasts = new_contrasts, defined_contr_matrix = defined_contr_matrix) } ) @@ -1030,4 +1030,9 @@ instat_object$set("public","create_factor_data_frame", function(data_name, facto self$add_link(from_data_frame = data_name, to_data_frame = factor_data_frame_name, link_pairs = factor, type = keyed_link_label) } } +) + +instat_object$set("public","split_date", function(data_name, col_name = "", year = FALSE, month = FALSE, day = FALSE, week = FALSE) { + self$get_data_objects(data_name)$split_date(col_name = col_name , week = week, month = month, day = day, year = year) +} ) \ No newline at end of file diff --git a/instat/ucrAdditionalLayers.vb b/instat/ucrAdditionalLayers.vb index 855903ef8d5..08dc51aed9c 100644 --- a/instat/ucrAdditionalLayers.vb +++ b/instat/ucrAdditionalLayers.vb @@ -28,7 +28,7 @@ Public Class ucrAdditionalLayers Public bSetGlobalIsDefault As Boolean 'Deciding if the first layer needs to be used for global aesthetics. 'Question to be discussed: What is this variable about again ? it is linked with sdgPlots.bAdditionalLayersSetGlobal in sdgPLots.bLayersDefaultIsGolobal. - + Public Event NumberOfLayersChanged() 'This event is raised when the number of Layers in the lstLayers on ucrAdditionalLayers has been changed, then handled by testOkEnabled On GeneralForGraphics. Public Sub New() ' This call is required by the designer. @@ -114,8 +114,10 @@ Public Class ucrAdditionalLayers End If clsRSyntax.SetOperatorParameter(False, strParameterName:=strLayerName, clsRFunc:=sdgLayerOptions.clsGeomFunction.Clone()) + 'Note: as the GeomFunction on sdgLayerOptions will be edited for different layers, it cannot be linked like clsGgplotFunction would, it needs to be cloned. - dlgGeneralForGraphics.TestOKEnabled() + 'When the number of Layers in the lstLayers on ucrAdditionalLayers need to check if OK is enabled on dlgGeneralForGraphics. + RaiseEvent NumberOfLayersChanged() End Sub Private Sub cmdDelete_Click(sender As Object, e As EventArgs) Handles cmdDelete.Click @@ -123,6 +125,9 @@ Public Class ucrAdditionalLayers clsRSyntax.RemoveOperatorParameter(lstLayers.SelectedItems(0).Text) lstLayerComplete.RemoveAt(lstLayers.SelectedIndices(0)) lstLayers.Items.Remove(lstLayers.SelectedItems(0)) + + 'When the number of Layers in the lstLayers on ucrAdditionalLayers need to check if OK is enabled on dlgGeneralForGraphics. + RaiseEvent NumberOfLayersChanged() End If End Sub @@ -131,7 +136,7 @@ Public Class ucrAdditionalLayers Dim clsLocalAes As RFunction Dim bIgnoreGlobalAes As Boolean 'bIgnoreGlobalAes is used in Setup(Layer) to determine whether the chkIgnoreGlobalAes should be ticked in the sdgLayerOptions. It's value is determined below. The following RParameter will be used in this procedure. - Dim clsTempRParameter As RParameter + 'The selected geom is found as the RFunction of the appropriate RParameter of RSyntax. The name of that Parameter is the name of the selected item in the lstLayers. That one is fetched using .SelectedItems(0) as there can only be one selected item at a time when the edit button is clicked. clsSelectedGeom = clsRSyntax.GetParameter(lstLayers.SelectedItems(0).Text).clsArgumentFunction If clsSelectedGeom.GetParameter("mapping") IsNot Nothing Then @@ -141,14 +146,16 @@ Public Class ucrAdditionalLayers End If 'Before we set-up the Layer in sdgLayerOptions, we determine the value of bIgnoreGlobalAes. We can detect if chkIgnoreGlobalAes was ticked last time the Layer was editted by looking at the "inherit.aes" parameter of the layer parameters. - clsTempRParameter = clsSelectedGeom.GetParameter("inherit.aes") - If (clsTempRParameter IsNot Nothing) AndAlso (clsTempRParameter.strArgumentValue = "False") Then + If (clsSelectedGeom.GetParameter("inherit.aes") IsNot Nothing) AndAlso (clsSelectedGeom.GetParameter("inherit.aes").strArgumentValue = "FALSE") Then bIgnoreGlobalAes = True - Else bIgnoreGlobalAes = False + Else + bIgnoreGlobalAes = False End If - sdgLayerOptions.SetupLayer(clsTempGgPlot:=dlgGeneralForGraphics.clsRggplotFunction, clsTempGeomFunc:=clsSelectedGeom, clsTempAesFunc:=dlgGeneralForGraphics.clsGgplotAesFunction, bFixAes:=False, bFixGeom:=True, strDataframe:=strGlobalDataFrame, bApplyAesGlobally:=False, bIgnoreGlobalAes:=bIgnoreGlobalAes, clsTempLocalAes:=clsLocalAes) - 'It has been chosen to fix the value of bApplyAesGlobally to False as when a Layer is editted, the choice to apply the Aes globally should be reconsidered no matter what it has been during last edit. + 'Warning: sdgLayerOptions should not be setup using dlgGeneralForGraphics' fields !! These fields should be given through to the ucrAdditionalLayers (which should have all these) + sdgLayerOptions.SetupLayer(clsTempGgPlot:=clsRggplotFunction, clsTempGeomFunc:=clsSelectedGeom, clsTempAesFunc:=clsGgplotAesFunction, bFixAes:=False, bFixGeom:=True, strDataframe:=strGlobalDataFrame, bApplyAesGlobally:=False, bIgnoreGlobalAes:=bIgnoreGlobalAes, clsTempLocalAes:=clsLocalAes) + 'It has been chosen to fix the value of bApplyAesGlobally to False as when a Layer is editted, the choice to apply the Aes globally should be reconsidered no matter what it has been during last edit. + ParentForm.SendToBack() 'Otherwise sdgLayerOptions appears behind sdgPLotOptions sdgLayerOptions.ShowDialog() AddLayers(lstLayers.SelectedItems(0)) End Sub