diff --git a/instat/UcrGeomListWithAes.designer.vb b/instat/UcrGeomListWithAes.designer.vb index db0411539ab..6e87923f666 100644 --- a/instat/UcrGeomListWithAes.designer.vb +++ b/instat/UcrGeomListWithAes.designer.vb @@ -28,26 +28,27 @@ Partial Class UcrGeomListWithParameters Me.ucrReceiverParam5 = New instat.ucrReceiverSingle() Me.grpAesList = New System.Windows.Forms.GroupBox() Me.lblGgParam6 = New System.Windows.Forms.Label() + Me.lblGgParam9 = New System.Windows.Forms.Label() + Me.lblGgParam8 = New System.Windows.Forms.Label() Me.lblGgParam7 = New System.Windows.Forms.Label() Me.lblGgParam5 = New System.Windows.Forms.Label() Me.lblGgParam4 = New System.Windows.Forms.Label() Me.lblGgParam3 = New System.Windows.Forms.Label() Me.lblGgParam2 = New System.Windows.Forms.Label() Me.lblGgParam1 = New System.Windows.Forms.Label() + Me.ucrReceiverParam9 = New instat.ucrReceiverSingle() + Me.ucrReceiverParam8 = New instat.ucrReceiverSingle() Me.ucrReceiverParam7 = New instat.ucrReceiverSingle() Me.ucrReceiverParam6 = New instat.ucrReceiverSingle() - Me.ucrReceiverParam8 = New instat.ucrReceiverSingle() - Me.lblGgParam8 = New System.Windows.Forms.Label() - Me.ucrReceiverParam9 = New instat.ucrReceiverSingle() - Me.lblGgParam9 = New System.Windows.Forms.Label() Me.grpAesList.SuspendLayout() Me.SuspendLayout() ' 'UcrSelector ' Me.UcrSelector.Location = New System.Drawing.Point(7, 69) + Me.UcrSelector.Margin = New System.Windows.Forms.Padding(0) Me.UcrSelector.Name = "UcrSelector" - Me.UcrSelector.Size = New System.Drawing.Size(242, 179) + Me.UcrSelector.Size = New System.Drawing.Size(232, 192) Me.UcrSelector.TabIndex = 5 ' 'lblAesList @@ -61,6 +62,7 @@ Partial Class UcrGeomListWithParameters 'ucrReceiverParam1 ' Me.ucrReceiverParam1.Location = New System.Drawing.Point(98, 25) + Me.ucrReceiverParam1.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverParam1.Name = "ucrReceiverParam1" Me.ucrReceiverParam1.Selector = Nothing Me.ucrReceiverParam1.Size = New System.Drawing.Size(106, 26) @@ -69,6 +71,7 @@ Partial Class UcrGeomListWithParameters 'ucrReceiverParam2 ' Me.ucrReceiverParam2.Location = New System.Drawing.Point(98, 53) + Me.ucrReceiverParam2.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverParam2.Name = "ucrReceiverParam2" Me.ucrReceiverParam2.Selector = Nothing Me.ucrReceiverParam2.Size = New System.Drawing.Size(106, 26) @@ -77,6 +80,7 @@ Partial Class UcrGeomListWithParameters 'ucrReceiverParam3 ' Me.ucrReceiverParam3.Location = New System.Drawing.Point(98, 81) + Me.ucrReceiverParam3.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverParam3.Name = "ucrReceiverParam3" Me.ucrReceiverParam3.Selector = Nothing Me.ucrReceiverParam3.Size = New System.Drawing.Size(106, 26) @@ -85,6 +89,7 @@ Partial Class UcrGeomListWithParameters 'ucrReceiverParam4 ' Me.ucrReceiverParam4.Location = New System.Drawing.Point(98, 109) + Me.ucrReceiverParam4.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverParam4.Name = "ucrReceiverParam4" Me.ucrReceiverParam4.Selector = Nothing Me.ucrReceiverParam4.Size = New System.Drawing.Size(106, 26) @@ -93,6 +98,7 @@ Partial Class UcrGeomListWithParameters 'ucrReceiverParam5 ' Me.ucrReceiverParam5.Location = New System.Drawing.Point(98, 137) + Me.ucrReceiverParam5.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverParam5.Name = "ucrReceiverParam5" Me.ucrReceiverParam5.Selector = Nothing Me.ucrReceiverParam5.Size = New System.Drawing.Size(106, 26) @@ -134,6 +140,24 @@ Partial Class UcrGeomListWithParameters Me.lblGgParam6.TabIndex = 10 Me.lblGgParam6.Text = "label" ' + 'lblGgParam9 + ' + Me.lblGgParam9.AutoSize = True + Me.lblGgParam9.Location = New System.Drawing.Point(7, 241) + Me.lblGgParam9.Name = "lblGgParam9" + Me.lblGgParam9.Size = New System.Drawing.Size(39, 13) + Me.lblGgParam9.TabIndex = 10 + Me.lblGgParam9.Text = "Label2" + ' + 'lblGgParam8 + ' + Me.lblGgParam8.AutoSize = True + Me.lblGgParam8.Location = New System.Drawing.Point(6, 216) + Me.lblGgParam8.Name = "lblGgParam8" + Me.lblGgParam8.Size = New System.Drawing.Size(39, 13) + Me.lblGgParam8.TabIndex = 10 + Me.lblGgParam8.Text = "Label2" + ' 'lblGgParam7 ' Me.lblGgParam7.AutoSize = True @@ -188,9 +212,28 @@ Partial Class UcrGeomListWithParameters Me.lblGgParam1.TabIndex = 9 Me.lblGgParam1.Text = "Label1" ' + 'ucrReceiverParam9 + ' + Me.ucrReceiverParam9.Location = New System.Drawing.Point(98, 241) + Me.ucrReceiverParam9.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverParam9.Name = "ucrReceiverParam9" + Me.ucrReceiverParam9.Selector = Nothing + Me.ucrReceiverParam9.Size = New System.Drawing.Size(106, 26) + Me.ucrReceiverParam9.TabIndex = 8 + ' + 'ucrReceiverParam8 + ' + Me.ucrReceiverParam8.Location = New System.Drawing.Point(97, 216) + Me.ucrReceiverParam8.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverParam8.Name = "ucrReceiverParam8" + Me.ucrReceiverParam8.Selector = Nothing + Me.ucrReceiverParam8.Size = New System.Drawing.Size(106, 26) + Me.ucrReceiverParam8.TabIndex = 8 + ' 'ucrReceiverParam7 ' Me.ucrReceiverParam7.Location = New System.Drawing.Point(98, 193) + Me.ucrReceiverParam7.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverParam7.Name = "ucrReceiverParam7" Me.ucrReceiverParam7.Selector = Nothing Me.ucrReceiverParam7.Size = New System.Drawing.Size(106, 26) @@ -199,45 +242,12 @@ Partial Class UcrGeomListWithParameters 'ucrReceiverParam6 ' Me.ucrReceiverParam6.Location = New System.Drawing.Point(98, 165) + Me.ucrReceiverParam6.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverParam6.Name = "ucrReceiverParam6" Me.ucrReceiverParam6.Selector = Nothing Me.ucrReceiverParam6.Size = New System.Drawing.Size(106, 26) Me.ucrReceiverParam6.TabIndex = 8 ' - 'ucrReceiverParam8 - ' - Me.ucrReceiverParam8.Location = New System.Drawing.Point(97, 216) - Me.ucrReceiverParam8.Name = "ucrReceiverParam8" - Me.ucrReceiverParam8.Selector = Nothing - Me.ucrReceiverParam8.Size = New System.Drawing.Size(106, 26) - Me.ucrReceiverParam8.TabIndex = 8 - ' - 'lblGgParam8 - ' - Me.lblGgParam8.AutoSize = True - Me.lblGgParam8.Location = New System.Drawing.Point(6, 216) - Me.lblGgParam8.Name = "lblGgParam8" - Me.lblGgParam8.Size = New System.Drawing.Size(39, 13) - Me.lblGgParam8.TabIndex = 10 - Me.lblGgParam8.Text = "Label2" - ' - 'ucrReceiverParam9 - ' - Me.ucrReceiverParam9.Location = New System.Drawing.Point(98, 241) - Me.ucrReceiverParam9.Name = "ucrReceiverParam9" - Me.ucrReceiverParam9.Selector = Nothing - Me.ucrReceiverParam9.Size = New System.Drawing.Size(106, 26) - Me.ucrReceiverParam9.TabIndex = 8 - ' - 'lblGgParam9 - ' - Me.lblGgParam9.AutoSize = True - Me.lblGgParam9.Location = New System.Drawing.Point(7, 241) - Me.lblGgParam9.Name = "lblGgParam9" - Me.lblGgParam9.Size = New System.Drawing.Size(39, 13) - Me.lblGgParam9.TabIndex = 10 - Me.lblGgParam9.Text = "Label2" - ' 'UcrGeomListWithParameters ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) diff --git a/instat/UcrGeomListWithAes.vb b/instat/UcrGeomListWithAes.vb index 1b08e82c1fa..c5c6856531e 100644 --- a/instat/UcrGeomListWithAes.vb +++ b/instat/UcrGeomListWithAes.vb @@ -198,6 +198,21 @@ Public Class UcrGeomListWithParameters clsRaesFunction.RemoveParameterByName(lstCurrArguments(6)) End If End Sub + Private Sub ucrReceiverParam8_SelectionChanged(sender As Object, e As EventArgs) Handles ucrReceiverParam8.SelectionChanged, ucrReceiverParam9.SelectionChanged, ucrReceiverParam8.SelectionChanged + If Not ucrReceiverParam8.IsEmpty Then + clsRaesFunction.AddParameter(lstCurrArguments(7), ucrReceiverParam8.GetVariableNames(False)) + Else + clsRaesFunction.RemoveParameterByName(lstCurrArguments(7)) + End If + End Sub + + Private Sub ucrReceiverParam9_SelectionChanged(sender As Object, e As EventArgs) Handles ucrReceiverParam9.SelectionChanged, ucrReceiverParam9.SelectionChanged, ucrReceiverParam8.SelectionChanged + If Not ucrReceiverParam9.IsEmpty Then + clsRaesFunction.AddParameter(lstCurrArguments(8), ucrReceiverParam9.GetVariableNames(False)) + Else + clsRaesFunction.RemoveParameterByName(lstCurrArguments(8)) + End If + End Sub Private Sub UcrSelector_DataFrameChanged() Handles UcrSelector.DataFrameChanged clsGeomFunction.AddParameter("data", clsRFunctionParameter:=UcrSelector.ucrAvailableDataFrames.clsCurrDataFrame) diff --git a/instat/clsRLink.vb b/instat/clsRLink.vb index 07bbefd94e0..ae59b014d16 100644 --- a/instat/clsRLink.vb +++ b/instat/clsRLink.vb @@ -317,33 +317,34 @@ Public Class RLink bInstatObjectExists = True End Sub - Public Sub FillListView(lstView As ListView, Optional lstIncludedDataTypes As List(Of String) = Nothing, Optional lstExcludedDataTypes As List(Of String) = Nothing, Optional strDataFrameName As String = "", Optional strHeading As String = "Variables") + Public Sub FillListView(lstView As ListView, Optional lstIncludedDataTypes As List(Of String) = Nothing, Optional lstExcludedDataTypes As List(Of String) = Nothing, Optional strDataFrameName As String = "", Optional strHeading As String = "Variables", Optional bIncludeHiddenColumns As Boolean = False) Dim vecColumns As GenericVector Dim chrCurrColumns As CharacterVector Dim i As Integer Dim grps As New ListViewGroup + Dim clsGetColumns As New RFunction + If bInstatObjectExists Then + clsGetColumns.SetRCommand(strInstatDataObject & "$get_column_names") + clsGetColumns.AddParameter("as_list", "TRUE") + If bIncludeHiddenColumns Then + clsGetColumns.AddParameter("include_hidden", "TRUE") + Else + clsGetColumns.AddParameter("include_hidden", "FALSE") + End If lstView.Clear() lstView.Groups.Clear() lstView.Columns.Add(strHeading) - If strDataFrameName = "" Then - If lstIncludedDataTypes IsNot Nothing Then - vecColumns = clsEngine.Evaluate(strInstatDataObject & "$get_column_names(include_type = " & GetListAsRString(lstIncludedDataTypes) & ", as_list = TRUE)").AsList - ElseIf lstExcludedDataTypes IsNot Nothing Then - vecColumns = clsEngine.Evaluate(strInstatDataObject & "$get_column_names(exclude_type = " & GetListAsRString(lstExcludedDataTypes) & ", as_list = TRUE)").AsList - Else - vecColumns = clsEngine.Evaluate(strInstatDataObject & "$get_column_names(as_list = TRUE)").AsList - End If - Else - If lstIncludedDataTypes IsNot Nothing Then - vecColumns = clsEngine.Evaluate(strInstatDataObject & "$get_column_names(data_name = " & Chr(34) & strDataFrameName & Chr(34) & ", include_type = " & GetListAsRString(lstIncludedDataTypes) & ", as_list = TRUE)").AsList - ElseIf lstExcludedDataTypes IsNot Nothing Then - vecColumns = clsEngine.Evaluate(strInstatDataObject & "$get_column_names(data_name = " & Chr(34) & strDataFrameName & Chr(34) & ", exclude_type = " & GetListAsRString(lstExcludedDataTypes) & ", as_list = TRUE)").AsList - Else - vecColumns = clsEngine.Evaluate(strInstatDataObject & "$get_column_names(data_name = " & Chr(34) & strDataFrameName & Chr(34) & ", as_list = TRUE)").AsList - End If + If lstIncludedDataTypes.Count > 0 Then + clsGetColumns.AddParameter("include_type", GetListAsRString(lstIncludedDataTypes)) + ElseIf lstExcludedDataTypes.Count > 0 Then + clsGetColumns.AddParameter("exclude_type", GetListAsRString(lstExcludedDataTypes)) + End If + If strDataFrameName <> "" Then + clsGetColumns.AddParameter("data_name", Chr(34) & strDataFrameName & Chr(34)) End If + vecColumns = RunInternalScriptGetValue(clsGetColumns.ToScript()).AsList For i = 0 To vecColumns.Count - 1 If vecColumns.Count > 1 Then diff --git a/instat/dlgGeneralForGraphics.Designer.vb b/instat/dlgGeneralForGraphics.Designer.vb index 487057fb448..eb5fb623f73 100644 --- a/instat/dlgGeneralForGraphics.Designer.vb +++ b/instat/dlgGeneralForGraphics.Designer.vb @@ -23,29 +23,83 @@ Partial Class dlgGeneralForGraphics _ Private Sub InitializeComponent() Me.ucrBase = New instat.ucrButtons() - Me.ucrGeomListWithParameters1 = New instat.UcrGeomListWithParameters() + Me.lstLayers = New System.Windows.Forms.ListView() + Me.lblLayers = New System.Windows.Forms.Label() + Me.cmdAdd = New System.Windows.Forms.Button() + Me.cmdEdit = New System.Windows.Forms.Button() + Me.cmdDelete = New System.Windows.Forms.Button() + Me.ucrSaveGraph = New instat.ucrSaveGraph() Me.SuspendLayout() ' 'ucrBase ' - Me.ucrBase.Location = New System.Drawing.Point(1, 286) + Me.ucrBase.Location = New System.Drawing.Point(12, 248) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(410, 53) Me.ucrBase.TabIndex = 0 ' - 'ucrGeomListWithParameters1 + 'lstLayers ' - Me.ucrGeomListWithParameters1.Location = New System.Drawing.Point(0, -3) - Me.ucrGeomListWithParameters1.Name = "ucrGeomListWithParameters1" - Me.ucrGeomListWithParameters1.Size = New System.Drawing.Size(467, 286) - Me.ucrGeomListWithParameters1.TabIndex = 1 + Me.lstLayers.Location = New System.Drawing.Point(12, 39) + Me.lstLayers.Name = "lstLayers" + Me.lstLayers.Size = New System.Drawing.Size(98, 149) + Me.lstLayers.TabIndex = 1 + Me.lstLayers.UseCompatibleStateImageBehavior = False + ' + 'lblLayers + ' + Me.lblLayers.AutoSize = True + Me.lblLayers.Location = New System.Drawing.Point(13, 13) + Me.lblLayers.Name = "lblLayers" + Me.lblLayers.Size = New System.Drawing.Size(38, 13) + Me.lblLayers.TabIndex = 2 + Me.lblLayers.Text = "Layers" + ' + 'cmdAdd + ' + Me.cmdAdd.Location = New System.Drawing.Point(143, 39) + Me.cmdAdd.Name = "cmdAdd" + Me.cmdAdd.Size = New System.Drawing.Size(75, 23) + Me.cmdAdd.TabIndex = 3 + Me.cmdAdd.Text = "Add" + Me.cmdAdd.UseVisualStyleBackColor = True + ' + 'cmdEdit + ' + Me.cmdEdit.Location = New System.Drawing.Point(143, 68) + Me.cmdEdit.Name = "cmdEdit" + Me.cmdEdit.Size = New System.Drawing.Size(75, 23) + Me.cmdEdit.TabIndex = 3 + Me.cmdEdit.Text = "Edit" + Me.cmdEdit.UseVisualStyleBackColor = True + ' + 'cmdDelete + ' + Me.cmdDelete.Location = New System.Drawing.Point(143, 97) + Me.cmdDelete.Name = "cmdDelete" + Me.cmdDelete.Size = New System.Drawing.Size(75, 23) + Me.cmdDelete.TabIndex = 3 + Me.cmdDelete.Text = "Delete" + Me.cmdDelete.UseVisualStyleBackColor = True + ' + 'ucrSaveGraph + ' + Me.ucrSaveGraph.Location = New System.Drawing.Point(12, 212) + Me.ucrSaveGraph.Name = "ucrSaveGraph" + Me.ucrSaveGraph.Size = New System.Drawing.Size(265, 20) + Me.ucrSaveGraph.TabIndex = 4 ' 'dlgGeneralForGraphics ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(467, 338) - Me.Controls.Add(Me.ucrGeomListWithParameters1) + Me.ClientSize = New System.Drawing.Size(422, 303) + Me.Controls.Add(Me.ucrSaveGraph) + Me.Controls.Add(Me.cmdDelete) + Me.Controls.Add(Me.cmdEdit) + Me.Controls.Add(Me.cmdAdd) + Me.Controls.Add(Me.lblLayers) + Me.Controls.Add(Me.lstLayers) Me.Controls.Add(Me.ucrBase) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.Name = "dlgGeneralForGraphics" @@ -53,9 +107,15 @@ Partial Class dlgGeneralForGraphics Me.Tag = "General " Me.Text = "General " Me.ResumeLayout(False) + Me.PerformLayout() End Sub - Friend WithEvents ucrBase As ucrButtons - Friend WithEvents ucrGeomListWithParameters1 As UcrGeomListWithParameters + Friend WithEvents ucrBase As ucrButtons + Friend WithEvents lstLayers As ListView + Friend WithEvents lblLayers As Label + Friend WithEvents cmdAdd As Button + Friend WithEvents cmdEdit As Button + Friend WithEvents cmdDelete As Button + Friend WithEvents ucrSaveGraph As ucrSaveGraph End Class diff --git a/instat/dlgGeneralForGraphics.vb b/instat/dlgGeneralForGraphics.vb index 3bf2c7762a1..a0bdeb3e2ad 100644 --- a/instat/dlgGeneralForGraphics.vb +++ b/instat/dlgGeneralForGraphics.vb @@ -36,29 +36,27 @@ Public Class dlgGeneralForGraphics 'setting the base ggplot functions ucrBase.clsRsyntax.SetOperation("+") clsRggplotFunction.SetRCommand("ggplot") - 'this sets the geoms andthe command to be used - ucrGeomListWithParameters1.SetGeoms() ucrBase.clsRsyntax.SetOperatorParameter(True, clsRFunc:=clsRggplotFunction) - ucrBase.clsRsyntax.SetOperatorParameter(False, clsRFunc:=ucrGeomListWithParameters1.clsGeomFunction) - End Sub + End Sub Private Sub SetDefaults() - ucrGeomListWithParameters1.UcrSelector.Reset() + cmdDelete.Enabled = False + cmdEdit.Enabled = False TestOkEnabled() End Sub Private Sub ReopenDialog() End Sub - Public Sub TestOkEnabled() - If Not ucrGeomListWithParameters1.ucrReceiverParam1.IsEmpty Then - ucrBase.OKEnabled(True) - Else - ucrBase.OKEnabled(False) - End If + Public Sub TestOkEnabled() + End Sub Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset SetDefaults() End Sub + + Private Sub cmdAdd_Click(sender As Object, e As EventArgs) Handles cmdAdd.Click + sdgLayers.ShowDialog() + End Sub End Class \ No newline at end of file diff --git a/instat/sdgDataOptions.Designer.vb b/instat/sdgDataOptions.Designer.vb index 60ac9afdf4b..ab6c215b809 100644 --- a/instat/sdgDataOptions.Designer.vb +++ b/instat/sdgDataOptions.Designer.vb @@ -23,31 +23,87 @@ Partial Class sdgDataOptions _ Private Sub InitializeComponent() Me.ucrSubDialogueBase = New instat.ucrButtonsSubdialogue() + Me.tbcDataOptions = New System.Windows.Forms.TabControl() + Me.tbFilter = New System.Windows.Forms.TabPage() + Me.tbColumns = New System.Windows.Forms.TabPage() + Me.chkShowHiddenColumns = New System.Windows.Forms.CheckBox() + Me.tbcDataOptions.SuspendLayout() + Me.tbColumns.SuspendLayout() Me.SuspendLayout() ' 'ucrSubDialogueBase ' - Me.ucrSubDialogueBase.Location = New System.Drawing.Point(12, 219) + Me.ucrSubDialogueBase.Location = New System.Drawing.Point(60, 227) Me.ucrSubDialogueBase.Name = "ucrSubDialogueBase" Me.ucrSubDialogueBase.Size = New System.Drawing.Size(142, 30) Me.ucrSubDialogueBase.TabIndex = 0 ' + 'tbcDataOptions + ' + Me.tbcDataOptions.Controls.Add(Me.tbFilter) + Me.tbcDataOptions.Controls.Add(Me.tbColumns) + Me.tbcDataOptions.Location = New System.Drawing.Point(0, 0) + Me.tbcDataOptions.Name = "tbcDataOptions" + Me.tbcDataOptions.SelectedIndex = 0 + Me.tbcDataOptions.Size = New System.Drawing.Size(273, 221) + Me.tbcDataOptions.TabIndex = 1 + ' + 'tbFilter + ' + Me.tbFilter.Location = New System.Drawing.Point(4, 22) + Me.tbFilter.Name = "tbFilter" + Me.tbFilter.Padding = New System.Windows.Forms.Padding(3) + Me.tbFilter.Size = New System.Drawing.Size(265, 195) + Me.tbFilter.TabIndex = 0 + Me.tbFilter.Tag = "Filter" + Me.tbFilter.Text = "Filter" + Me.tbFilter.UseVisualStyleBackColor = True + ' + 'tbColumns + ' + Me.tbColumns.Controls.Add(Me.chkShowHiddenColumns) + Me.tbColumns.Location = New System.Drawing.Point(4, 22) + Me.tbColumns.Name = "tbColumns" + Me.tbColumns.Padding = New System.Windows.Forms.Padding(3) + Me.tbColumns.Size = New System.Drawing.Size(265, 195) + Me.tbColumns.TabIndex = 1 + Me.tbColumns.Tag = "Columns" + Me.tbColumns.Text = "Columns" + Me.tbColumns.UseVisualStyleBackColor = True + ' + 'chkShowHiddenColumns + ' + Me.chkShowHiddenColumns.AutoSize = True + Me.chkShowHiddenColumns.Location = New System.Drawing.Point(6, 39) + Me.chkShowHiddenColumns.Name = "chkShowHiddenColumns" + Me.chkShowHiddenColumns.Size = New System.Drawing.Size(186, 17) + Me.chkShowHiddenColumns.TabIndex = 0 + Me.chkShowHiddenColumns.Tag = "Show_Hidden_Columns_in_Selector" + Me.chkShowHiddenColumns.Text = "Show Hidden Columns in Selector" + Me.chkShowHiddenColumns.UseVisualStyleBackColor = True + ' 'sdgDataOptions ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(274, 261) + Me.Controls.Add(Me.tbcDataOptions) Me.Controls.Add(Me.ucrSubDialogueBase) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.Name = "sdgDataOptions" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Tag = "Data_Options" Me.Text = "Data Options" + Me.tbcDataOptions.ResumeLayout(False) + Me.tbColumns.ResumeLayout(False) + Me.tbColumns.PerformLayout() Me.ResumeLayout(False) End Sub Friend WithEvents ucrSubDialogueBase As ucrButtonsSubdialogue - - + Friend WithEvents tbcDataOptions As TabControl + Friend WithEvents tbFilter As TabPage + Friend WithEvents tbColumns As TabPage + Friend WithEvents chkShowHiddenColumns As CheckBox End Class diff --git a/instat/sdgDataOptions.vb b/instat/sdgDataOptions.vb index 6114425b1f7..81fb796ed76 100644 --- a/instat/sdgDataOptions.vb +++ b/instat/sdgDataOptions.vb @@ -1,22 +1,40 @@ - -' Instat-R -' Copyright (C) 2015 -' -' This program is free software: you can redistribute it and/or modify -' it under the terms of the GNU General Public License as published by -' the Free Software Foundation, either version 3 of the License, or -' (at your option) any later version. -' -' This program is distributed in the hope that it will be useful, -' but WITHOUT ANY WARRANTY; without even the implied warranty of -' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -' GNU General Public License for more details. -' -' You should have received a copy of the GNU General Public License k -' along with this program. If not, see . +' Instat-R +' Copyright (C) 2015 +' +' This program is free software: you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation, either version 3 of the License, or +' (at your option) any later version. +' +' This program is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. +' +' You should have received a copy of the GNU General Public License k +' along with this program. If not, see . Imports instat.Translations Public Class sdgDataOptions + Public bFirstLoad As Boolean = True + Private Sub sdgDataOptions_Load(sender As Object, e As EventArgs) Handles MyBase.Load autoTranslate(Me) + If bFirstLoad Then + InitialiseDialog() + SetDefaults() + bFirstLoad = False + End If End Sub + + Private Sub InitialiseDialog() + + End Sub + + Private Sub SetDefaults() + chkShowHiddenColumns.Checked = False + End Sub + + Public Function ShowHiddenColumns() As Boolean + Return chkShowHiddenColumns.Checked + End Function End Class \ No newline at end of file diff --git a/instat/sdgLayers.Designer.vb b/instat/sdgLayers.Designer.vb index e8dd64b3f69..7f943d22c97 100644 --- a/instat/sdgLayers.Designer.vb +++ b/instat/sdgLayers.Designer.vb @@ -22,29 +22,80 @@ Partial Class sdgLayers 'Do not modify it using the code editor. _ Private Sub InitializeComponent() + Me.tbcLayers = New System.Windows.Forms.TabControl() + Me.tbpAesthetics = New System.Windows.Forms.TabPage() + Me.tbpGeomParameters = New System.Windows.Forms.TabPage() Me.ucrSdgLayerBase = New instat.ucrButtonsSubdialogue() + Me.ucrGeomWithAes = New instat.UcrGeomListWithParameters() + Me.tbcLayers.SuspendLayout() + Me.tbpAesthetics.SuspendLayout() Me.SuspendLayout() ' + 'tbcLayers + ' + Me.tbcLayers.Controls.Add(Me.tbpAesthetics) + Me.tbcLayers.Controls.Add(Me.tbpGeomParameters) + Me.tbcLayers.Location = New System.Drawing.Point(13, 13) + Me.tbcLayers.Name = "tbcLayers" + Me.tbcLayers.SelectedIndex = 0 + Me.tbcLayers.Size = New System.Drawing.Size(482, 335) + Me.tbcLayers.TabIndex = 1 + ' + 'tbpAesthetics + ' + Me.tbpAesthetics.Controls.Add(Me.ucrGeomWithAes) + Me.tbpAesthetics.Location = New System.Drawing.Point(4, 22) + Me.tbpAesthetics.Name = "tbpAesthetics" + Me.tbpAesthetics.Padding = New System.Windows.Forms.Padding(3) + Me.tbpAesthetics.Size = New System.Drawing.Size(474, 309) + Me.tbpAesthetics.TabIndex = 0 + Me.tbpAesthetics.Text = "Aesthetics" + Me.tbpAesthetics.UseVisualStyleBackColor = True + ' + 'tbpGeomParameters + ' + Me.tbpGeomParameters.Location = New System.Drawing.Point(4, 22) + Me.tbpGeomParameters.Name = "tbpGeomParameters" + Me.tbpGeomParameters.Padding = New System.Windows.Forms.Padding(3) + Me.tbpGeomParameters.Size = New System.Drawing.Size(474, 358) + Me.tbpGeomParameters.TabIndex = 1 + Me.tbpGeomParameters.Text = "Geom Parameters" + Me.tbpGeomParameters.UseVisualStyleBackColor = True + ' 'ucrSdgLayerBase ' - Me.ucrSdgLayerBase.Location = New System.Drawing.Point(64, 251) + Me.ucrSdgLayerBase.Location = New System.Drawing.Point(148, 354) Me.ucrSdgLayerBase.Name = "ucrSdgLayerBase" Me.ucrSdgLayerBase.Size = New System.Drawing.Size(142, 30) Me.ucrSdgLayerBase.TabIndex = 0 ' + 'ucrGeomWithAes + ' + Me.ucrGeomWithAes.Location = New System.Drawing.Point(6, 6) + Me.ucrGeomWithAes.Name = "ucrGeomWithAes" + Me.ucrGeomWithAes.Size = New System.Drawing.Size(467, 286) + Me.ucrGeomWithAes.TabIndex = 0 + ' 'sdgLayers ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(318, 293) + Me.ClientSize = New System.Drawing.Size(507, 385) + Me.Controls.Add(Me.tbcLayers) Me.Controls.Add(Me.ucrSdgLayerBase) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.Name = "sdgLayers" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Layers" + Me.tbcLayers.ResumeLayout(False) + Me.tbpAesthetics.ResumeLayout(False) Me.ResumeLayout(False) End Sub Friend WithEvents ucrSdgLayerBase As ucrButtonsSubdialogue + Friend WithEvents tbcLayers As TabControl + Friend WithEvents tbpAesthetics As TabPage + Friend WithEvents tbpGeomParameters As TabPage + Friend WithEvents ucrGeomWithAes As UcrGeomListWithParameters End Class diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index da9044476e4..c98c1155e8e 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -441,7 +441,7 @@ data_object$set("public", "add_defaults_meta", function() { ) data_object$set("public", "add_defaults_variables_metadata", function() { - sapply(self$get_column_names(), function(col_name) self$append_to_variables_metadata(col_names, is_hidden_label, FALSE)) + sapply(self$get_column_names(), function(col_name) self$append_to_variables_metadata(col_name, is_hidden_label, FALSE)) } ) @@ -739,7 +739,7 @@ data_object$set("public", "get_column_count", function(col_name, new_level_names } ) -data_object$set("public", "get_column_names", function(as_list = FALSE, include_type = c(), exclude_type = c()) { +data_object$set("public", "get_column_names", function(as_list = FALSE, include_type = c(), exclude_type = c(), include_hidden = TRUE) { types = c("factor", "integer", "numeric", "logical", "character") if(!length(include_type) == 0) { if(!all(include_type %in% types)) stop(paste("include_type can only contain", paste(types, collapse = ", "))) @@ -754,6 +754,11 @@ data_object$set("public", "get_column_names", function(as_list = FALSE, include_ } else out = names(private$data) + if(!include_hidden) { + hidden = sapply(out, function(col_name) self$get_variables_metadata(property = is_hidden_label, column = col_name)) + out = out[!hidden] + } + if(as_list) { lst = list() lst[[self$get_metadata(data_name_label)]] <- out diff --git a/instat/static/InstatObject/R/instat_object_R6.R b/instat/static/InstatObject/R/instat_object_R6.R index ef32a255cb3..a4b191b331f 100644 --- a/instat/static/InstatObject/R/instat_object_R6.R +++ b/instat/static/InstatObject/R/instat_object_R6.R @@ -248,15 +248,15 @@ instat_object$set("public", "get_data_frame", function(data_name, convert_to_cha } ) -instat_object$set("public", "get_variables_metadata", function(data_name, data_type = "all", convert_to_character = FALSE, property) { +instat_object$set("public", "get_variables_metadata", function(data_name, data_type = "all", convert_to_character = FALSE, property, column) { if(missing(data_name)) { retlist <- list() for (curr_obj in private$.data_objects) { - retlist[[curr_obj$get_metadata(data_name_label)]] = curr_obj$get_variables_metadata(data_type = data_type, convert_to_character = convert_to_character, property = property) + retlist[[curr_obj$get_metadata(data_name_label)]] = curr_obj$get_variables_metadata(data_type = data_type, convert_to_character = convert_to_character, property = property, column = column) } return(retlist) } - else return(self$get_data_objects(data_name)$get_variables_metadata(data_type = data_type, convert_to_character = convert_to_character, property = property)) + else return(self$get_data_objects(data_name)$get_variables_metadata(data_type = data_type, convert_to_character = convert_to_character, property = property, column = column)) } ) @@ -466,12 +466,12 @@ instat_object$set("public", "get_next_default_column_name", function(data_name, } ) -instat_object$set("public", "get_column_names", function(data_name, as_list = FALSE, include_type = c(), exclude_type = c()) { +instat_object$set("public", "get_column_names", function(data_name, as_list = FALSE, include_type = c(), exclude_type = c(), include_hidden = TRUE) { if(missing(data_name)) { - return(lapply(self$get_data_objects(), function(x) x$get_column_names(include_type = include_type, exclude_type = exclude_type))) + return(lapply(self$get_data_objects(), function(x) x$get_column_names(include_type = include_type, exclude_type = exclude_type, include_hidden = include_hidden))) } else { - return(self$get_data_objects(data_name)$get_column_names(as_list, include_type, exclude_type)) + return(self$get_data_objects(data_name)$get_column_names(as_list, include_type, exclude_type, include_hidden = include_hidden)) } } ) diff --git a/instat/ucrDataFrame.vb b/instat/ucrDataFrame.vb index abc511ed8a9..b27ba09f920 100644 --- a/instat/ucrDataFrame.vb +++ b/instat/ucrDataFrame.vb @@ -32,8 +32,8 @@ Public Class ucrDataFrame Public Sub Reset() If frmMain.strDefaultDataFrame <> "" Then - cboAvailableDataFrames.SelectedIndex = cboAvailableDataFrames.Items.IndexOf(frmMain.strDefaultDataFrame) - Else + cboAvailableDataFrames.SelectedIndex = cboAvailableDataFrames.Items.IndexOf(frmMain.strDefaultDataFrame) + ElseIf frmMain.strCurrentDataFrame <> "" Then cboAvailableDataFrames.SelectedIndex = cboAvailableDataFrames.Items.IndexOf(frmMain.strCurrentDataFrame) End If SetDataFrameProperties() diff --git a/instat/ucrSelector.vb b/instat/ucrSelector.vb index 3af38fddf2a..1d92b3d682c 100644 --- a/instat/ucrSelector.vb +++ b/instat/ucrSelector.vb @@ -23,6 +23,7 @@ Public Class ucrSelector Public Event VariablesInReceiversChanged() Public lstVariablesInReceivers As List(Of String) Public bFirstLoad As Boolean = True + Public strCurrentDataFrame As String = "" Private Sub ucrSelection_load(sender As Object, e As EventArgs) Handles MyBase.Load LoadList() @@ -46,11 +47,7 @@ Public Class ucrSelector Public Overridable Sub LoadList() If CurrentReceiver IsNot Nothing Then - If CurrentReceiver.lstIncludedDataTypes.Count > 0 Then - frmMain.clsRLink.FillListView(lstAvailableVariable, lstIncludedDataTypes:=CurrentReceiver.lstIncludedDataTypes, strHeading:=CurrentReceiver.strSelectorHeading) - ElseIf CurrentReceiver.lstExcludedDataTypes.Count > 0 Then - frmMain.clsRLink.FillListView(lstAvailableVariable, lstExcludedDataTypes:=CurrentReceiver.lstExcludedDataTypes, strHeading:=CurrentReceiver.strSelectorHeading) - End If + frmMain.clsRLink.FillListView(lstAvailableVariable, lstIncludedDataTypes:=CurrentReceiver.lstIncludedDataTypes, strHeading:=CurrentReceiver.strSelectorHeading, lstExcludedDataTypes:=CurrentReceiver.lstExcludedDataTypes, bIncludeHiddenColumns:=sdgDataOptions.ShowHiddenColumns(), strDataFrameName:=strCurrentDataFrame) End If End Sub @@ -101,10 +98,16 @@ Public Class ucrSelector ' Next ' Add() 'End Sub - Public Sub ShowOptionsDialog() - 'code for dislaying dialog goes here - sdgRestrict.ShowDialog() + + Public Sub ShowDataOptionsDialog() + sdgDataOptions.ShowDialog() + SetDataOptionsSettings() End Sub + + Public Overridable Sub SetDataOptionsSettings() + LoadList() + End Sub + Private Sub lstAvailableVariable_DoubleClick(sender As Object, e As EventArgs) Handles lstAvailableVariable.DoubleClick Add() End Sub diff --git a/instat/ucrSelectorAddRemove.designer.vb b/instat/ucrSelectorAddRemove.designer.vb index 959e54913a8..59ff03b525a 100644 --- a/instat/ucrSelectorAddRemove.designer.vb +++ b/instat/ucrSelectorAddRemove.designer.vb @@ -34,7 +34,7 @@ Partial Class ucrSelectorAddRemove 'btnAdd ' Me.btnAdd.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.btnAdd.Location = New System.Drawing.Point(173, 33) + Me.btnAdd.Location = New System.Drawing.Point(173, 49) Me.btnAdd.Name = "btnAdd" Me.btnAdd.Size = New System.Drawing.Size(75, 23) Me.btnAdd.TabIndex = 83 @@ -45,12 +45,12 @@ Partial Class ucrSelectorAddRemove 'cmdOptions ' Me.cmdOptions.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.cmdOptions.Location = New System.Drawing.Point(173, 72) + Me.cmdOptions.Location = New System.Drawing.Point(173, 153) Me.cmdOptions.Name = "cmdOptions" - Me.cmdOptions.Size = New System.Drawing.Size(75, 23) + Me.cmdOptions.Size = New System.Drawing.Size(75, 34) Me.cmdOptions.TabIndex = 84 - Me.cmdOptions.Tag = "Options" - Me.cmdOptions.Text = "Options" + Me.cmdOptions.Tag = "Data_Options" + Me.cmdOptions.Text = "Data Options" Me.cmdOptions.UseVisualStyleBackColor = True ' 'ucrSelectorAddRemove diff --git a/instat/ucrSelectorAddRemove.vb b/instat/ucrSelectorAddRemove.vb index a250f79c564..58c3f0ae14a 100644 --- a/instat/ucrSelectorAddRemove.vb +++ b/instat/ucrSelectorAddRemove.vb @@ -7,7 +7,7 @@ Public Class ucrSelectorAddRemove Private Sub cmdOptions_Click(sender As Object, e As EventArgs) Handles cmdOptions.Click 'call - ShowOptionsDialog() + ShowDataOptionsDialog() End Sub Private Sub ucrSelectorAddRemove_Load(sender As Object, e As EventArgs) Handles MyBase.Load diff --git a/instat/ucrSelectorByDataFrame.vb b/instat/ucrSelectorByDataFrame.vb index dcbc5d9c3f7..7b86cc0c0b2 100644 --- a/instat/ucrSelectorByDataFrame.vb +++ b/instat/ucrSelectorByDataFrame.vb @@ -23,6 +23,7 @@ Public Class ucrSelectorByDataFrame Public Event DataFrameChanged() Private Sub ucrAvailableDataFrames_DataFrameChanged(sender As Object, e As EventArgs, strPrevDataFrame As String) Handles ucrAvailableDataFrames.DataFrameChanged + strCurrentDataFrame = ucrAvailableDataFrames.cboAvailableDataFrames.Text LoadList() If strPrevDataFrame <> ucrAvailableDataFrames.cboAvailableDataFrames.Text Then RaiseEvent DataFrameChanged() @@ -30,20 +31,6 @@ Public Class ucrSelectorByDataFrame End If End Sub - Public Overrides Sub LoadList() - - If ucrAvailableDataFrames.cboAvailableDataFrames.Text <> "" Then - If CurrentReceiver IsNot Nothing Then - If CurrentReceiver.lstIncludedDataTypes.Count > 0 Then - frmMain.clsRLink.FillListView(lstAvailableVariable, lstIncludedDataTypes:=CurrentReceiver.lstIncludedDataTypes, strDataFrameName:=ucrAvailableDataFrames.cboAvailableDataFrames.Text, strHeading:=CurrentReceiver.strSelectorHeading) - ElseIf CurrentReceiver.lstExcludedDataTypes.Count > 0 Then - frmMain.clsRLink.FillListView(lstAvailableVariable, lstExcludedDataTypes:=CurrentReceiver.lstExcludedDataTypes, strDataFrameName:=ucrAvailableDataFrames.cboAvailableDataFrames.Text, strHeading:=CurrentReceiver.strSelectorHeading) - Else - frmMain.clsRLink.FillListView(lstAvailableVariable, strDataFrameName:=ucrAvailableDataFrames.cboAvailableDataFrames.Text, strHeading:=CurrentReceiver.strSelectorHeading) - End If - End If - End If - End Sub Public Overrides Sub Reset() ucrAvailableDataFrames.Reset() MyBase.Reset() diff --git a/instat/ucrSelectorByDataFrameAddRemove.Designer.vb b/instat/ucrSelectorByDataFrameAddRemove.Designer.vb index beecece88dc..9ca11f84747 100644 --- a/instat/ucrSelectorByDataFrameAddRemove.Designer.vb +++ b/instat/ucrSelectorByDataFrameAddRemove.Designer.vb @@ -32,7 +32,6 @@ Partial Class ucrSelectorByDataFrameAddRemove ' 'lstAvailableVariable ' - Me.lstAvailableVariable.Margin = New System.Windows.Forms.Padding(0) Me.lstAvailableVariable.TabIndex = 2 ' 'btnAdd @@ -61,7 +60,6 @@ Partial Class ucrSelectorByDataFrameAddRemove Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.Controls.Add(Me.btnDataOptions) Me.Controls.Add(Me.btnAdd) - Me.Margin = New System.Windows.Forms.Padding(0) Me.Name = "ucrSelectorByDataFrameAddRemove" Me.Size = New System.Drawing.Size(210, 180) Me.Controls.SetChildIndex(Me.ucrAvailableDataFrames, 0) diff --git a/instat/ucrSelectorByDataFrameAddRemove.vb b/instat/ucrSelectorByDataFrameAddRemove.vb index a346636d8c5..df008916992 100644 --- a/instat/ucrSelectorByDataFrameAddRemove.vb +++ b/instat/ucrSelectorByDataFrameAddRemove.vb @@ -2,4 +2,8 @@ Private Sub btnAdd_Click(sender As Object, e As EventArgs) Handles btnAdd.Click Add() End Sub + + Private Sub btnDataOptions_Click(sender As Object, e As EventArgs) Handles btnDataOptions.Click + ShowDataOptionsDialog() + End Sub End Class