From 4d1cc9aecec781e5572ffc6c9ca0c969375d2f5c Mon Sep 17 00:00:00 2001 From: steven ndung'u Date: Tue, 3 Jan 2017 12:31:06 +0300 Subject: [PATCH 01/27] Adding right clicks on the grid --- instat/frmEditor.Designer.vb | 720 ++++++++++++++++++----------------- instat/frmEditor.vb | 38 +- 2 files changed, 397 insertions(+), 361 deletions(-) diff --git a/instat/frmEditor.Designer.vb b/instat/frmEditor.Designer.vb index ced60acc75b..bcc0e31eea6 100644 --- a/instat/frmEditor.Designer.vb +++ b/instat/frmEditor.Designer.vb @@ -22,353 +22,374 @@ Partial Class frmEditor 'Do not modify it using the code editor. Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container() - Me.grdData = New unvell.ReoGrid.ReoGridControl() - Me.columnContextMenuStrip = New System.Windows.Forms.ContextMenuStrip(Me.components) - Me.mnuColumnRename = New System.Windows.Forms.ToolStripMenuItem() - Me.mnuInsertColsBefore = New System.Windows.Forms.ToolStripMenuItem() - Me.mnuInsertColsAfter = New System.Windows.Forms.ToolStripMenuItem() - Me.mnuDeleteCol = New System.Windows.Forms.ToolStripMenuItem() - Me.toolStripMenuItem2 = New System.Windows.Forms.ToolStripSeparator() - Me.mnuConvertToFactor = New System.Windows.Forms.ToolStripMenuItem() - Me.mnuConvertText = New System.Windows.Forms.ToolStripMenuItem() - Me.mnuConvertVariate = New System.Windows.Forms.ToolStripMenuItem() - Me.mnuConvert = New System.Windows.Forms.ToolStripMenuItem() - Me.ToolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator() - Me.mnuHideColumns = New System.Windows.Forms.ToolStripMenuItem() - Me.mnuUnhideColumns = New System.Windows.Forms.ToolStripMenuItem() - Me.mnuUnhideAllColumns = New System.Windows.Forms.ToolStripMenuItem() - Me.toolStripMenuItem21 = New System.Windows.Forms.ToolStripSeparator() - Me.FreezeToHereToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.UnfreezeToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.ToolStripSeparator3 = New System.Windows.Forms.ToolStripSeparator() - Me.SortToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.columnFilterToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.clearColumnFilterToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.cellContextMenuStrip = New System.Windows.Forms.ContextMenuStrip(Me.components) - Me.cutRangeToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.copyRangeToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.pasteRangeToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.rowContextMenuStrip = New System.Windows.Forms.ContextMenuStrip(Me.components) - Me.mnuInsertRowsBefore = New System.Windows.Forms.ToolStripMenuItem() - Me.mnuInsertRowsAfter = New System.Windows.Forms.ToolStripMenuItem() - Me.mnuDeleteRows = New System.Windows.Forms.ToolStripMenuItem() - Me.ToolStripSeparator2 = New System.Windows.Forms.ToolStripSeparator() - Me.mnuFilter = New System.Windows.Forms.ToolStripMenuItem() - Me.mnuRemoveCurrentFilter = New System.Windows.Forms.ToolStripMenuItem() - Me.statusColumnMenu = New System.Windows.Forms.ContextMenuStrip(Me.components) - Me.insertSheet = New System.Windows.Forms.ToolStripMenuItem() - Me.deleteSheet = New System.Windows.Forms.ToolStripMenuItem() - Me.renameSheet = New System.Windows.Forms.ToolStripMenuItem() - Me.reorderSheet = New System.Windows.Forms.ToolStripMenuItem() - Me.CopySheet = New System.Windows.Forms.ToolStripMenuItem() - Me.HideSheet = New System.Windows.Forms.ToolStripMenuItem() - Me.unhideSheet = New System.Windows.Forms.ToolStripMenuItem() - Me.ViewSheet = New System.Windows.Forms.ToolStripMenuItem() - Me.lblNoData = New System.Windows.Forms.Label() - Me.columnContextMenuStrip.SuspendLayout() - Me.cellContextMenuStrip.SuspendLayout() - Me.rowContextMenuStrip.SuspendLayout() - Me.statusColumnMenu.SuspendLayout() - Me.SuspendLayout() - ' - 'grdData - ' - Me.grdData.BackColor = System.Drawing.Color.White - Me.grdData.ColumnHeaderContextMenuStrip = Me.columnContextMenuStrip - Me.grdData.ContextMenuStrip = Me.cellContextMenuStrip - Me.grdData.Dock = System.Windows.Forms.DockStyle.Fill - Me.grdData.LeadHeaderContextMenuStrip = Nothing - Me.grdData.Location = New System.Drawing.Point(0, 0) - Me.grdData.Name = "grdData" - Me.grdData.RowHeaderContextMenuStrip = Me.rowContextMenuStrip - Me.grdData.Script = Nothing - Me.grdData.SheetTabContextMenuStrip = Me.statusColumnMenu - Me.grdData.SheetTabNewButtonVisible = False - Me.grdData.SheetTabVisible = True - Me.grdData.SheetTabWidth = 200 - Me.grdData.Size = New System.Drawing.Size(410, 261) - Me.grdData.TabIndex = 0 - ' - 'columnContextMenuStrip - ' - Me.columnContextMenuStrip.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuColumnRename, Me.mnuInsertColsBefore, Me.mnuInsertColsAfter, Me.mnuDeleteCol, Me.toolStripMenuItem2, Me.mnuConvertToFactor, Me.mnuConvertText, Me.mnuConvertVariate, Me.mnuConvert, Me.ToolStripSeparator1, Me.mnuHideColumns, Me.mnuUnhideColumns, Me.mnuUnhideAllColumns, Me.toolStripMenuItem21, Me.FreezeToHereToolStripMenuItem, Me.UnfreezeToolStripMenuItem, Me.ToolStripSeparator3, Me.SortToolStripMenuItem, Me.columnFilterToolStripMenuItem, Me.clearColumnFilterToolStripMenuItem}) - Me.columnContextMenuStrip.Name = "columnContextMenuStrip" - Me.columnContextMenuStrip.Size = New System.Drawing.Size(200, 380) - ' - 'mnuColumnRename - ' - Me.mnuColumnRename.Name = "mnuColumnRename" - Me.mnuColumnRename.Size = New System.Drawing.Size(199, 22) - Me.mnuColumnRename.Text = "Rename Column..." - ' - 'mnuInsertColsBefore - ' - Me.mnuInsertColsBefore.Name = "mnuInsertColsBefore" - Me.mnuInsertColsBefore.Size = New System.Drawing.Size(199, 22) - Me.mnuInsertColsBefore.Text = "Insert Column(s) Before" - ' - 'mnuInsertColsAfter - ' - Me.mnuInsertColsAfter.Name = "mnuInsertColsAfter" - Me.mnuInsertColsAfter.Size = New System.Drawing.Size(199, 22) - Me.mnuInsertColsAfter.Text = "Insert Column(s) After" - ' - 'mnuDeleteCol - ' - Me.mnuDeleteCol.Name = "mnuDeleteCol" - Me.mnuDeleteCol.Size = New System.Drawing.Size(199, 22) - Me.mnuDeleteCol.Text = "Delete Column(s)" - ' - 'toolStripMenuItem2 - ' - Me.toolStripMenuItem2.Name = "toolStripMenuItem2" - Me.toolStripMenuItem2.Size = New System.Drawing.Size(196, 6) - ' - 'mnuConvertToFactor - ' - Me.mnuConvertToFactor.Name = "mnuConvertToFactor" - Me.mnuConvertToFactor.Size = New System.Drawing.Size(199, 22) - Me.mnuConvertToFactor.Text = "Convert to Factor" - ' - 'mnuConvertText - ' - Me.mnuConvertText.Name = "mnuConvertText" - Me.mnuConvertText.Size = New System.Drawing.Size(199, 22) - Me.mnuConvertText.Text = "Convert to Character" - ' - 'mnuConvertVariate - ' - Me.mnuConvertVariate.Name = "mnuConvertVariate" - Me.mnuConvertVariate.Size = New System.Drawing.Size(199, 22) - Me.mnuConvertVariate.Text = "Convert to Numeric" - ' - 'mnuConvert - ' - Me.mnuConvert.Name = "mnuConvert" - Me.mnuConvert.Size = New System.Drawing.Size(199, 22) - Me.mnuConvert.Text = "Convert..." - ' - 'ToolStripSeparator1 - ' - Me.ToolStripSeparator1.Name = "ToolStripSeparator1" - Me.ToolStripSeparator1.Size = New System.Drawing.Size(196, 6) - ' - 'mnuHideColumns - ' - Me.mnuHideColumns.Name = "mnuHideColumns" - Me.mnuHideColumns.Size = New System.Drawing.Size(199, 22) - Me.mnuHideColumns.Text = "Hide" - ' - 'mnuUnhideColumns - ' - Me.mnuUnhideColumns.Name = "mnuUnhideColumns" - Me.mnuUnhideColumns.Size = New System.Drawing.Size(199, 22) - Me.mnuUnhideColumns.Text = "Unhide..." - ' - 'mnuUnhideAllColumns - ' - Me.mnuUnhideAllColumns.Name = "mnuUnhideAllColumns" - Me.mnuUnhideAllColumns.Size = New System.Drawing.Size(199, 22) - Me.mnuUnhideAllColumns.Tag = "Unhide_All" - Me.mnuUnhideAllColumns.Text = "Unhide All" - ' - 'toolStripMenuItem21 - ' - Me.toolStripMenuItem21.Name = "toolStripMenuItem21" - Me.toolStripMenuItem21.Size = New System.Drawing.Size(196, 6) - ' - 'FreezeToHereToolStripMenuItem - ' - Me.FreezeToHereToolStripMenuItem.Name = "FreezeToHereToolStripMenuItem" - Me.FreezeToHereToolStripMenuItem.Size = New System.Drawing.Size(199, 22) - Me.FreezeToHereToolStripMenuItem.Text = "Freeze to Here" - ' - 'UnfreezeToolStripMenuItem - ' - Me.UnfreezeToolStripMenuItem.Name = "UnfreezeToolStripMenuItem" - Me.UnfreezeToolStripMenuItem.Size = New System.Drawing.Size(199, 22) - Me.UnfreezeToolStripMenuItem.Text = "Unfreeze" - ' - 'ToolStripSeparator3 - ' - Me.ToolStripSeparator3.Name = "ToolStripSeparator3" - Me.ToolStripSeparator3.Size = New System.Drawing.Size(196, 6) - ' - 'SortToolStripMenuItem - ' - Me.SortToolStripMenuItem.Name = "SortToolStripMenuItem" - Me.SortToolStripMenuItem.Size = New System.Drawing.Size(199, 22) - Me.SortToolStripMenuItem.Text = "Sort..." - ' - 'columnFilterToolStripMenuItem - ' - Me.columnFilterToolStripMenuItem.Name = "columnFilterToolStripMenuItem" - Me.columnFilterToolStripMenuItem.Size = New System.Drawing.Size(199, 22) - Me.columnFilterToolStripMenuItem.Text = "Filter..." - ' - 'clearColumnFilterToolStripMenuItem - ' - Me.clearColumnFilterToolStripMenuItem.Name = "clearColumnFilterToolStripMenuItem" - Me.clearColumnFilterToolStripMenuItem.Size = New System.Drawing.Size(199, 22) - Me.clearColumnFilterToolStripMenuItem.Text = "Remove Current Filter" - ' - 'cellContextMenuStrip - ' - Me.cellContextMenuStrip.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.cutRangeToolStripMenuItem, Me.copyRangeToolStripMenuItem, Me.pasteRangeToolStripMenuItem}) - Me.cellContextMenuStrip.Name = "cellContextMenuStrip" - Me.cellContextMenuStrip.Size = New System.Drawing.Size(103, 70) - ' - 'cutRangeToolStripMenuItem - ' - Me.cutRangeToolStripMenuItem.Enabled = False - Me.cutRangeToolStripMenuItem.Name = "cutRangeToolStripMenuItem" - Me.cutRangeToolStripMenuItem.Size = New System.Drawing.Size(102, 22) - Me.cutRangeToolStripMenuItem.Text = "Cut" - ' - 'copyRangeToolStripMenuItem - ' - Me.copyRangeToolStripMenuItem.Name = "copyRangeToolStripMenuItem" - Me.copyRangeToolStripMenuItem.Size = New System.Drawing.Size(102, 22) - Me.copyRangeToolStripMenuItem.Text = "Copy" - ' - 'pasteRangeToolStripMenuItem - ' - Me.pasteRangeToolStripMenuItem.Enabled = False - Me.pasteRangeToolStripMenuItem.Name = "pasteRangeToolStripMenuItem" - Me.pasteRangeToolStripMenuItem.Size = New System.Drawing.Size(102, 22) - Me.pasteRangeToolStripMenuItem.Text = "Paste" - ' - 'rowContextMenuStrip - ' - Me.rowContextMenuStrip.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuInsertRowsBefore, Me.mnuInsertRowsAfter, Me.mnuDeleteRows, Me.ToolStripSeparator2, Me.mnuFilter, Me.mnuRemoveCurrentFilter}) - Me.rowContextMenuStrip.Name = "columnContextMenuStrip" - Me.rowContextMenuStrip.Size = New System.Drawing.Size(190, 120) - ' - 'mnuInsertRowsBefore - ' - Me.mnuInsertRowsBefore.Name = "mnuInsertRowsBefore" - Me.mnuInsertRowsBefore.Size = New System.Drawing.Size(189, 22) - Me.mnuInsertRowsBefore.Text = "Insert Row(s) Before" - ' - 'mnuInsertRowsAfter - ' - Me.mnuInsertRowsAfter.Name = "mnuInsertRowsAfter" - Me.mnuInsertRowsAfter.Size = New System.Drawing.Size(189, 22) - Me.mnuInsertRowsAfter.Text = "Insert Row(s) After" - ' - 'mnuDeleteRows - ' - Me.mnuDeleteRows.Name = "mnuDeleteRows" - Me.mnuDeleteRows.Size = New System.Drawing.Size(189, 22) - Me.mnuDeleteRows.Text = "Delete Row(s)" - ' - 'ToolStripSeparator2 - ' - Me.ToolStripSeparator2.Name = "ToolStripSeparator2" - Me.ToolStripSeparator2.Size = New System.Drawing.Size(186, 6) - ' - 'mnuFilter - ' - Me.mnuFilter.Name = "mnuFilter" - Me.mnuFilter.Size = New System.Drawing.Size(189, 22) - Me.mnuFilter.Tag = "Filter..." - Me.mnuFilter.Text = "Filter..." - ' - 'mnuRemoveCurrentFilter - ' - Me.mnuRemoveCurrentFilter.Name = "mnuRemoveCurrentFilter" - Me.mnuRemoveCurrentFilter.Size = New System.Drawing.Size(189, 22) - Me.mnuRemoveCurrentFilter.Tag = "Remove_Current_Filter" - Me.mnuRemoveCurrentFilter.Text = "Remove Current Filter" - ' - 'statusColumnMenu - ' - Me.statusColumnMenu.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.insertSheet, Me.deleteSheet, Me.renameSheet, Me.reorderSheet, Me.CopySheet, Me.HideSheet, Me.unhideSheet, Me.ViewSheet}) - Me.statusColumnMenu.Name = "statusColumnMenu" - Me.statusColumnMenu.Size = New System.Drawing.Size(163, 202) - ' - 'insertSheet - ' - Me.insertSheet.Name = "insertSheet" - Me.insertSheet.Size = New System.Drawing.Size(162, 22) - Me.insertSheet.Text = "Insert..." - ' - 'deleteSheet - ' - Me.deleteSheet.Name = "deleteSheet" - Me.deleteSheet.Size = New System.Drawing.Size(162, 22) - Me.deleteSheet.Text = "Delete" - ' - 'renameSheet - ' - Me.renameSheet.Name = "renameSheet" - Me.renameSheet.Size = New System.Drawing.Size(162, 22) - Me.renameSheet.Text = "Rename..." - ' - 'reorderSheet - ' - Me.reorderSheet.Enabled = False - Me.reorderSheet.Name = "reorderSheet" - Me.reorderSheet.Size = New System.Drawing.Size(162, 22) - Me.reorderSheet.Text = "Reorder..." - ' - 'CopySheet - ' - Me.CopySheet.Enabled = False - Me.CopySheet.Name = "CopySheet" - Me.CopySheet.Size = New System.Drawing.Size(162, 22) - Me.CopySheet.Text = "Copy..." - ' - 'HideSheet - ' - Me.HideSheet.Enabled = False - Me.HideSheet.Name = "HideSheet" - Me.HideSheet.Size = New System.Drawing.Size(162, 22) - Me.HideSheet.Text = "Hide" - ' - 'unhideSheet - ' - Me.unhideSheet.Enabled = False - Me.unhideSheet.Name = "unhideSheet" - Me.unhideSheet.Size = New System.Drawing.Size(162, 22) - Me.unhideSheet.Text = "Unhide" - ' - 'ViewSheet - ' - Me.ViewSheet.Name = "ViewSheet" - Me.ViewSheet.Size = New System.Drawing.Size(162, 22) - Me.ViewSheet.Text = "View Data Frame" - ' - 'lblNoData - ' - Me.lblNoData.AutoSize = True - Me.lblNoData.Font = New System.Drawing.Font("Microsoft Sans Serif", 20.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.lblNoData.Location = New System.Drawing.Point(122, 105) - Me.lblNoData.Name = "lblNoData" - Me.lblNoData.Size = New System.Drawing.Size(211, 31) - Me.lblNoData.TabIndex = 1 - Me.lblNoData.Tag = "no_data_loaded" - Me.lblNoData.Text = "No Data Loaded" - ' - 'frmEditor - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(410, 261) - Me.Controls.Add(Me.grdData) - Me.Controls.Add(Me.lblNoData) - Me.Name = "frmEditor" - Me.ShowIcon = False - Me.Tag = "Data_View" - Me.Text = "Data View" - Me.columnContextMenuStrip.ResumeLayout(False) - Me.cellContextMenuStrip.ResumeLayout(False) - Me.rowContextMenuStrip.ResumeLayout(False) - Me.statusColumnMenu.ResumeLayout(False) - Me.ResumeLayout(False) - Me.PerformLayout() - + Me.components = New System.ComponentModel.Container() + Me.grdData = New unvell.ReoGrid.ReoGridControl() + Me.columnContextMenuStrip = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.mnuColumnRename = New System.Windows.Forms.ToolStripMenuItem() + Me.mnuInsertColsBefore = New System.Windows.Forms.ToolStripMenuItem() + Me.mnuInsertColsAfter = New System.Windows.Forms.ToolStripMenuItem() + Me.mnuDeleteCol = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItem2 = New System.Windows.Forms.ToolStripSeparator() + Me.mnuConvertToFactor = New System.Windows.Forms.ToolStripMenuItem() + Me.mnuConvertText = New System.Windows.Forms.ToolStripMenuItem() + Me.mnuConvertVariate = New System.Windows.Forms.ToolStripMenuItem() + Me.mnuConvert = New System.Windows.Forms.ToolStripMenuItem() + Me.ToolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator() + Me.mnuHideColumns = New System.Windows.Forms.ToolStripMenuItem() + Me.mnuUnhideColumns = New System.Windows.Forms.ToolStripMenuItem() + Me.mnuUnhideAllColumns = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItem21 = New System.Windows.Forms.ToolStripSeparator() + Me.FreezeToHereToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.UnfreezeToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.ToolStripSeparator3 = New System.Windows.Forms.ToolStripSeparator() + Me.SortToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.columnFilterToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.clearColumnFilterToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.cellContextMenuStrip = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.cutRangeToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.copyRangeToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.pasteRangeToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.rowContextMenuStrip = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.mnuInsertRowsBefore = New System.Windows.Forms.ToolStripMenuItem() + Me.mnuInsertRowsAfter = New System.Windows.Forms.ToolStripMenuItem() + Me.mnuDeleteRows = New System.Windows.Forms.ToolStripMenuItem() + Me.ToolStripSeparator2 = New System.Windows.Forms.ToolStripSeparator() + Me.mnuFilter = New System.Windows.Forms.ToolStripMenuItem() + Me.mnuRemoveCurrentFilter = New System.Windows.Forms.ToolStripMenuItem() + Me.statusColumnMenu = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.insertSheet = New System.Windows.Forms.ToolStripMenuItem() + Me.deleteSheet = New System.Windows.Forms.ToolStripMenuItem() + Me.renameSheet = New System.Windows.Forms.ToolStripMenuItem() + Me.reorderSheet = New System.Windows.Forms.ToolStripMenuItem() + Me.CopySheet = New System.Windows.Forms.ToolStripMenuItem() + Me.HideSheet = New System.Windows.Forms.ToolStripMenuItem() + Me.unhideSheet = New System.Windows.Forms.ToolStripMenuItem() + Me.ViewSheet = New System.Windows.Forms.ToolStripMenuItem() + Me.lblNoData = New System.Windows.Forms.Label() + Me.mnuConvertToDate = New System.Windows.Forms.ToolStripMenuItem() + Me.mnuCovertToOrderedFactors = New System.Windows.Forms.ToolStripMenuItem() + Me.mnuDuplicateColumn = New System.Windows.Forms.ToolStripMenuItem() + Me.columnContextMenuStrip.SuspendLayout() + Me.cellContextMenuStrip.SuspendLayout() + Me.rowContextMenuStrip.SuspendLayout() + Me.statusColumnMenu.SuspendLayout() + Me.SuspendLayout() + ' + 'grdData + ' + Me.grdData.BackColor = System.Drawing.Color.White + Me.grdData.ColumnHeaderContextMenuStrip = Me.columnContextMenuStrip + Me.grdData.ContextMenuStrip = Me.cellContextMenuStrip + Me.grdData.Dock = System.Windows.Forms.DockStyle.Fill + Me.grdData.LeadHeaderContextMenuStrip = Nothing + Me.grdData.Location = New System.Drawing.Point(0, 0) + Me.grdData.Name = "grdData" + Me.grdData.RowHeaderContextMenuStrip = Me.rowContextMenuStrip + Me.grdData.Script = Nothing + Me.grdData.SheetTabContextMenuStrip = Me.statusColumnMenu + Me.grdData.SheetTabNewButtonVisible = False + Me.grdData.SheetTabVisible = True + Me.grdData.SheetTabWidth = 200 + Me.grdData.Size = New System.Drawing.Size(410, 261) + Me.grdData.TabIndex = 0 + ' + 'columnContextMenuStrip + ' + Me.columnContextMenuStrip.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuColumnRename, Me.mnuInsertColsBefore, Me.mnuInsertColsAfter, Me.mnuDeleteCol, Me.mnuDuplicateColumn, Me.toolStripMenuItem2, Me.mnuConvertToFactor, Me.mnuConvertText, Me.mnuConvertVariate, Me.mnuConvertToDate, Me.mnuCovertToOrderedFactors, Me.mnuConvert, Me.ToolStripSeparator1, Me.mnuHideColumns, Me.mnuUnhideColumns, Me.mnuUnhideAllColumns, Me.toolStripMenuItem21, Me.FreezeToHereToolStripMenuItem, Me.UnfreezeToolStripMenuItem, Me.ToolStripSeparator3, Me.SortToolStripMenuItem, Me.columnFilterToolStripMenuItem, Me.clearColumnFilterToolStripMenuItem}) + Me.columnContextMenuStrip.Name = "columnContextMenuStrip" + Me.columnContextMenuStrip.Size = New System.Drawing.Size(213, 468) + ' + 'mnuColumnRename + ' + Me.mnuColumnRename.Name = "mnuColumnRename" + Me.mnuColumnRename.Size = New System.Drawing.Size(212, 22) + Me.mnuColumnRename.Text = "Rename Column..." + ' + 'mnuInsertColsBefore + ' + Me.mnuInsertColsBefore.Name = "mnuInsertColsBefore" + Me.mnuInsertColsBefore.Size = New System.Drawing.Size(212, 22) + Me.mnuInsertColsBefore.Text = "Insert Column(s) Before" + ' + 'mnuInsertColsAfter + ' + Me.mnuInsertColsAfter.Name = "mnuInsertColsAfter" + Me.mnuInsertColsAfter.Size = New System.Drawing.Size(212, 22) + Me.mnuInsertColsAfter.Text = "Insert Column(s) After" + ' + 'mnuDeleteCol + ' + Me.mnuDeleteCol.Name = "mnuDeleteCol" + Me.mnuDeleteCol.Size = New System.Drawing.Size(212, 22) + Me.mnuDeleteCol.Text = "Delete Column(s)" + ' + 'toolStripMenuItem2 + ' + Me.toolStripMenuItem2.Name = "toolStripMenuItem2" + Me.toolStripMenuItem2.Size = New System.Drawing.Size(209, 6) + ' + 'mnuConvertToFactor + ' + Me.mnuConvertToFactor.Name = "mnuConvertToFactor" + Me.mnuConvertToFactor.Size = New System.Drawing.Size(212, 22) + Me.mnuConvertToFactor.Text = "Convert to Factor" + ' + 'mnuConvertText + ' + Me.mnuConvertText.Name = "mnuConvertText" + Me.mnuConvertText.Size = New System.Drawing.Size(212, 22) + Me.mnuConvertText.Text = "Convert to Character" + ' + 'mnuConvertVariate + ' + Me.mnuConvertVariate.Name = "mnuConvertVariate" + Me.mnuConvertVariate.Size = New System.Drawing.Size(212, 22) + Me.mnuConvertVariate.Text = "Convert to Numeric" + ' + 'mnuConvert + ' + Me.mnuConvert.Name = "mnuConvert" + Me.mnuConvert.Size = New System.Drawing.Size(212, 22) + Me.mnuConvert.Text = "Convert..." + ' + 'ToolStripSeparator1 + ' + Me.ToolStripSeparator1.Name = "ToolStripSeparator1" + Me.ToolStripSeparator1.Size = New System.Drawing.Size(209, 6) + ' + 'mnuHideColumns + ' + Me.mnuHideColumns.Name = "mnuHideColumns" + Me.mnuHideColumns.Size = New System.Drawing.Size(212, 22) + Me.mnuHideColumns.Text = "Hide" + ' + 'mnuUnhideColumns + ' + Me.mnuUnhideColumns.Name = "mnuUnhideColumns" + Me.mnuUnhideColumns.Size = New System.Drawing.Size(212, 22) + Me.mnuUnhideColumns.Text = "Unhide..." + ' + 'mnuUnhideAllColumns + ' + Me.mnuUnhideAllColumns.Name = "mnuUnhideAllColumns" + Me.mnuUnhideAllColumns.Size = New System.Drawing.Size(212, 22) + Me.mnuUnhideAllColumns.Tag = "Unhide_All" + Me.mnuUnhideAllColumns.Text = "Unhide All" + ' + 'toolStripMenuItem21 + ' + Me.toolStripMenuItem21.Name = "toolStripMenuItem21" + Me.toolStripMenuItem21.Size = New System.Drawing.Size(209, 6) + ' + 'FreezeToHereToolStripMenuItem + ' + Me.FreezeToHereToolStripMenuItem.Name = "FreezeToHereToolStripMenuItem" + Me.FreezeToHereToolStripMenuItem.Size = New System.Drawing.Size(212, 22) + Me.FreezeToHereToolStripMenuItem.Text = "Freeze to Here" + ' + 'UnfreezeToolStripMenuItem + ' + Me.UnfreezeToolStripMenuItem.Name = "UnfreezeToolStripMenuItem" + Me.UnfreezeToolStripMenuItem.Size = New System.Drawing.Size(212, 22) + Me.UnfreezeToolStripMenuItem.Text = "Unfreeze" + ' + 'ToolStripSeparator3 + ' + Me.ToolStripSeparator3.Name = "ToolStripSeparator3" + Me.ToolStripSeparator3.Size = New System.Drawing.Size(209, 6) + ' + 'SortToolStripMenuItem + ' + Me.SortToolStripMenuItem.Name = "SortToolStripMenuItem" + Me.SortToolStripMenuItem.Size = New System.Drawing.Size(212, 22) + Me.SortToolStripMenuItem.Text = "Sort..." + ' + 'columnFilterToolStripMenuItem + ' + Me.columnFilterToolStripMenuItem.Name = "columnFilterToolStripMenuItem" + Me.columnFilterToolStripMenuItem.Size = New System.Drawing.Size(212, 22) + Me.columnFilterToolStripMenuItem.Text = "Filter..." + ' + 'clearColumnFilterToolStripMenuItem + ' + Me.clearColumnFilterToolStripMenuItem.Name = "clearColumnFilterToolStripMenuItem" + Me.clearColumnFilterToolStripMenuItem.Size = New System.Drawing.Size(212, 22) + Me.clearColumnFilterToolStripMenuItem.Text = "Remove Current Filter" + ' + 'cellContextMenuStrip + ' + Me.cellContextMenuStrip.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.cutRangeToolStripMenuItem, Me.copyRangeToolStripMenuItem, Me.pasteRangeToolStripMenuItem}) + Me.cellContextMenuStrip.Name = "cellContextMenuStrip" + Me.cellContextMenuStrip.Size = New System.Drawing.Size(103, 70) + ' + 'cutRangeToolStripMenuItem + ' + Me.cutRangeToolStripMenuItem.Enabled = False + Me.cutRangeToolStripMenuItem.Name = "cutRangeToolStripMenuItem" + Me.cutRangeToolStripMenuItem.Size = New System.Drawing.Size(102, 22) + Me.cutRangeToolStripMenuItem.Text = "Cut" + ' + 'copyRangeToolStripMenuItem + ' + Me.copyRangeToolStripMenuItem.Name = "copyRangeToolStripMenuItem" + Me.copyRangeToolStripMenuItem.Size = New System.Drawing.Size(102, 22) + Me.copyRangeToolStripMenuItem.Text = "Copy" + ' + 'pasteRangeToolStripMenuItem + ' + Me.pasteRangeToolStripMenuItem.Enabled = False + Me.pasteRangeToolStripMenuItem.Name = "pasteRangeToolStripMenuItem" + Me.pasteRangeToolStripMenuItem.Size = New System.Drawing.Size(102, 22) + Me.pasteRangeToolStripMenuItem.Text = "Paste" + ' + 'rowContextMenuStrip + ' + Me.rowContextMenuStrip.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuInsertRowsBefore, Me.mnuInsertRowsAfter, Me.mnuDeleteRows, Me.ToolStripSeparator2, Me.mnuFilter, Me.mnuRemoveCurrentFilter}) + Me.rowContextMenuStrip.Name = "columnContextMenuStrip" + Me.rowContextMenuStrip.Size = New System.Drawing.Size(190, 120) + ' + 'mnuInsertRowsBefore + ' + Me.mnuInsertRowsBefore.Name = "mnuInsertRowsBefore" + Me.mnuInsertRowsBefore.Size = New System.Drawing.Size(189, 22) + Me.mnuInsertRowsBefore.Text = "Insert Row(s) Before" + ' + 'mnuInsertRowsAfter + ' + Me.mnuInsertRowsAfter.Name = "mnuInsertRowsAfter" + Me.mnuInsertRowsAfter.Size = New System.Drawing.Size(189, 22) + Me.mnuInsertRowsAfter.Text = "Insert Row(s) After" + ' + 'mnuDeleteRows + ' + Me.mnuDeleteRows.Name = "mnuDeleteRows" + Me.mnuDeleteRows.Size = New System.Drawing.Size(189, 22) + Me.mnuDeleteRows.Text = "Delete Row(s)" + ' + 'ToolStripSeparator2 + ' + Me.ToolStripSeparator2.Name = "ToolStripSeparator2" + Me.ToolStripSeparator2.Size = New System.Drawing.Size(186, 6) + ' + 'mnuFilter + ' + Me.mnuFilter.Name = "mnuFilter" + Me.mnuFilter.Size = New System.Drawing.Size(189, 22) + Me.mnuFilter.Tag = "Filter..." + Me.mnuFilter.Text = "Filter..." + ' + 'mnuRemoveCurrentFilter + ' + Me.mnuRemoveCurrentFilter.Name = "mnuRemoveCurrentFilter" + Me.mnuRemoveCurrentFilter.Size = New System.Drawing.Size(189, 22) + Me.mnuRemoveCurrentFilter.Tag = "Remove_Current_Filter" + Me.mnuRemoveCurrentFilter.Text = "Remove Current Filter" + ' + 'statusColumnMenu + ' + Me.statusColumnMenu.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.insertSheet, Me.deleteSheet, Me.renameSheet, Me.reorderSheet, Me.CopySheet, Me.HideSheet, Me.unhideSheet, Me.ViewSheet}) + Me.statusColumnMenu.Name = "statusColumnMenu" + Me.statusColumnMenu.Size = New System.Drawing.Size(163, 180) + ' + 'insertSheet + ' + Me.insertSheet.Name = "insertSheet" + Me.insertSheet.Size = New System.Drawing.Size(162, 22) + Me.insertSheet.Text = "Insert..." + ' + 'deleteSheet + ' + Me.deleteSheet.Name = "deleteSheet" + Me.deleteSheet.Size = New System.Drawing.Size(162, 22) + Me.deleteSheet.Text = "Delete" + ' + 'renameSheet + ' + Me.renameSheet.Name = "renameSheet" + Me.renameSheet.Size = New System.Drawing.Size(162, 22) + Me.renameSheet.Text = "Rename..." + ' + 'reorderSheet + ' + Me.reorderSheet.Enabled = False + Me.reorderSheet.Name = "reorderSheet" + Me.reorderSheet.Size = New System.Drawing.Size(162, 22) + Me.reorderSheet.Text = "Reorder..." + ' + 'CopySheet + ' + Me.CopySheet.Enabled = False + Me.CopySheet.Name = "CopySheet" + Me.CopySheet.Size = New System.Drawing.Size(162, 22) + Me.CopySheet.Text = "Copy..." + ' + 'HideSheet + ' + Me.HideSheet.Enabled = False + Me.HideSheet.Name = "HideSheet" + Me.HideSheet.Size = New System.Drawing.Size(162, 22) + Me.HideSheet.Text = "Hide" + ' + 'unhideSheet + ' + Me.unhideSheet.Enabled = False + Me.unhideSheet.Name = "unhideSheet" + Me.unhideSheet.Size = New System.Drawing.Size(162, 22) + Me.unhideSheet.Text = "Unhide" + ' + 'ViewSheet + ' + Me.ViewSheet.Name = "ViewSheet" + Me.ViewSheet.Size = New System.Drawing.Size(162, 22) + Me.ViewSheet.Text = "View Data Frame" + ' + 'lblNoData + ' + Me.lblNoData.AutoSize = True + Me.lblNoData.Font = New System.Drawing.Font("Microsoft Sans Serif", 20.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.lblNoData.Location = New System.Drawing.Point(122, 105) + Me.lblNoData.Name = "lblNoData" + Me.lblNoData.Size = New System.Drawing.Size(211, 31) + Me.lblNoData.TabIndex = 1 + Me.lblNoData.Tag = "no_data_loaded" + Me.lblNoData.Text = "No Data Loaded" + ' + 'mnuConvertToDate + ' + Me.mnuConvertToDate.Name = "mnuConvertToDate" + Me.mnuConvertToDate.Size = New System.Drawing.Size(212, 22) + Me.mnuConvertToDate.Text = "Convert to Date" + ' + 'mnuCovertToOrderedFactors + ' + Me.mnuCovertToOrderedFactors.Name = "mnuCovertToOrderedFactors" + Me.mnuCovertToOrderedFactors.Size = New System.Drawing.Size(212, 22) + Me.mnuCovertToOrderedFactors.Text = "Convert to Ordered Factor" + ' + 'mnuDuplicateColumn + ' + Me.mnuDuplicateColumn.Name = "mnuDuplicateColumn" + Me.mnuDuplicateColumn.Size = New System.Drawing.Size(212, 22) + Me.mnuDuplicateColumn.Text = "Duplicate Column" + ' + 'frmEditor + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(410, 261) + Me.Controls.Add(Me.grdData) + Me.Controls.Add(Me.lblNoData) + Me.Name = "frmEditor" + Me.ShowIcon = False + Me.Tag = "Data_View" + Me.Text = "Data View" + Me.columnContextMenuStrip.ResumeLayout(False) + Me.cellContextMenuStrip.ResumeLayout(False) + Me.rowContextMenuStrip.ResumeLayout(False) + Me.statusColumnMenu.ResumeLayout(False) + Me.ResumeLayout(False) + Me.PerformLayout() + End Sub Public WithEvents grdData As unvell.ReoGrid.ReoGridControl @@ -413,5 +434,8 @@ Partial Class frmEditor Friend WithEvents UnfreezeToolStripMenuItem As ToolStripMenuItem Friend WithEvents ToolStripSeparator3 As ToolStripSeparator Friend WithEvents mnuConvert As ToolStripMenuItem - Friend WithEvents ViewSheet As ToolStripMenuItem + Friend WithEvents ViewSheet As ToolStripMenuItem + Friend WithEvents mnuConvertToDate As ToolStripMenuItem + Friend WithEvents mnuCovertToOrderedFactors As ToolStripMenuItem + Friend WithEvents mnuDuplicateColumn As ToolStripMenuItem End Class diff --git a/instat/frmEditor.vb b/instat/frmEditor.vb index f5b250591ad..125935df45f 100644 --- a/instat/frmEditor.vb +++ b/instat/frmEditor.vb @@ -384,19 +384,19 @@ Public Class frmEditor Else MsgBox("Invalid value: " & strNewValue & vbNewLine & "This column is: integer. Values must be integer.", MsgBoxStyle.Exclamation, "Invalid Value") End If - 'Currently removed as this is the class for a blank column - 'Case "logical" - ' 'Should we accept 'true'/'false'/'True' etc. as logical values? - ' If e.NewData = "TRUE" OrElse e.NewData = "FALSE" Then - ' clsReplaceValue.AddParameter("new_value", e.NewData) - ' bValid = True - ' Else - ' MsgBox("Invalid value: " & e.NewData.ToString() & vbNewLine & "This column is: logical. Values must be logical (either TRUE or FALSE).", MsgBoxStyle.Exclamation, "Invalid Value") - ' e.EndReason = unvell.ReoGrid.EndEditReason.Cancel - ' End If - 'Case "character" - 'clsReplaceValue.AddParameter("new_value", Chr(34) & e.NewData & Chr(34)) - 'bValid = True + 'Currently removed as this is the class for a blank column + 'Case "logical" + ' 'Should we accept 'true'/'false'/'True' etc. as logical values? + ' If e.NewData = "TRUE" OrElse e.NewData = "FALSE" Then + ' clsReplaceValue.AddParameter("new_value", e.NewData) + ' bValid = True + ' Else + ' MsgBox("Invalid value: " & e.NewData.ToString() & vbNewLine & "This column is: logical. Values must be logical (either TRUE or FALSE).", MsgBoxStyle.Exclamation, "Invalid Value") + ' e.EndReason = unvell.ReoGrid.EndEditReason.Cancel + ' End If + 'Case "character" + 'clsReplaceValue.AddParameter("new_value", Chr(34) & e.NewData & Chr(34)) + 'bValid = True Case Else If Double.TryParse(strNewValue, dblValue) OrElse strNewValue = "TRUE" OrElse strNewValue = "FALSE" Then clsReplaceValue.AddParameter("new_value", strNewValue) @@ -632,4 +632,16 @@ Public Class frmEditor clsViewDataFrame.AddParameter("title", Chr(34) & grdCurrSheet.Name & Chr(34)) frmMain.clsRLink.RunScript(clsViewDataFrame.ToScript, strComment:="Right Click Menu: View R Data Frame") End Sub + + Private Sub mnuConvertDate_Click(sender As Object, e As EventArgs) Handles mnuConvertToDate.Click + dlgMakeDate.ShowDialog() + End Sub + + Private Sub mnuCovertToOrderedFactors_Click(sender As Object, e As EventArgs) Handles mnuCovertToOrderedFactors.Click + dlgConvertColumns.ShowDialog() + End Sub + + Private Sub mnuDuplicateColumn_Click(sender As Object, e As EventArgs) Handles mnuDuplicateColumn.Click + + End Sub End Class From 07a7baaa29d4a71df779f916d58847400c09fcdc Mon Sep 17 00:00:00 2001 From: Lily Date: Tue, 3 Jan 2017 11:54:19 +0000 Subject: [PATCH 02/27] General Summaries update --- instat/dlgCalculationsSummary.Designer.vb | 75 ++++++- instat/dlgCalculationsSummary.vb | 7 +- instat/sdgCalculationsSummmary.Designer.vb | 219 ++++++++++++++++++++- instat/sdgCalculationsSummmary.vb | 122 ++++++++++++ 4 files changed, 418 insertions(+), 5 deletions(-) diff --git a/instat/dlgCalculationsSummary.Designer.vb b/instat/dlgCalculationsSummary.Designer.vb index ff3b930c347..af3f58352db 100644 --- a/instat/dlgCalculationsSummary.Designer.vb +++ b/instat/dlgCalculationsSummary.Designer.vb @@ -22,9 +22,69 @@ Partial Class dlgCalculationsSummary 'Do not modify it using the code editor. Private Sub InitializeComponent() + Me.cmdDelete = New System.Windows.Forms.Button() + Me.cmdEdit = New System.Windows.Forms.Button() + Me.cmdAdd = New System.Windows.Forms.Button() + Me.lblCalculations = New System.Windows.Forms.Label() + Me.lstLayers = New System.Windows.Forms.ListView() + Me.cmdDuplicate = New System.Windows.Forms.Button() Me.ucrBase = New instat.ucrButtons() Me.SuspendLayout() ' + 'cmdDelete + ' + Me.cmdDelete.Location = New System.Drawing.Point(143, 114) + Me.cmdDelete.Name = "cmdDelete" + Me.cmdDelete.Size = New System.Drawing.Size(75, 23) + Me.cmdDelete.TabIndex = 11 + Me.cmdDelete.Text = "Delete" + Me.cmdDelete.UseVisualStyleBackColor = True + ' + 'cmdEdit + ' + Me.cmdEdit.Location = New System.Drawing.Point(143, 85) + Me.cmdEdit.Name = "cmdEdit" + Me.cmdEdit.Size = New System.Drawing.Size(75, 23) + Me.cmdEdit.TabIndex = 12 + Me.cmdEdit.Text = "Edit" + Me.cmdEdit.UseVisualStyleBackColor = True + ' + 'cmdAdd + ' + Me.cmdAdd.Location = New System.Drawing.Point(143, 56) + Me.cmdAdd.Name = "cmdAdd" + Me.cmdAdd.Size = New System.Drawing.Size(75, 23) + Me.cmdAdd.TabIndex = 13 + Me.cmdAdd.Text = "Add" + Me.cmdAdd.UseVisualStyleBackColor = True + ' + 'lblCalculations + ' + Me.lblCalculations.AutoSize = True + Me.lblCalculations.Location = New System.Drawing.Point(13, 21) + Me.lblCalculations.Name = "lblCalculations" + Me.lblCalculations.Size = New System.Drawing.Size(67, 13) + Me.lblCalculations.TabIndex = 10 + Me.lblCalculations.Text = "Calculations:" + ' + 'lstLayers + ' + Me.lstLayers.Location = New System.Drawing.Point(12, 36) + Me.lstLayers.Name = "lstLayers" + Me.lstLayers.Size = New System.Drawing.Size(125, 149) + Me.lstLayers.TabIndex = 9 + Me.lstLayers.UseCompatibleStateImageBehavior = False + Me.lstLayers.View = System.Windows.Forms.View.List + ' + 'cmdDuplicate + ' + Me.cmdDuplicate.Location = New System.Drawing.Point(143, 143) + Me.cmdDuplicate.Name = "cmdDuplicate" + Me.cmdDuplicate.Size = New System.Drawing.Size(75, 23) + Me.cmdDuplicate.TabIndex = 14 + Me.cmdDuplicate.Text = "Duplicate" + Me.cmdDuplicate.UseVisualStyleBackColor = True + ' 'ucrBase ' Me.ucrBase.Location = New System.Drawing.Point(12, 228) @@ -37,16 +97,29 @@ Partial Class dlgCalculationsSummary Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(420, 284) + Me.Controls.Add(Me.cmdDuplicate) + Me.Controls.Add(Me.cmdDelete) + Me.Controls.Add(Me.cmdEdit) + Me.Controls.Add(Me.cmdAdd) + Me.Controls.Add(Me.lblCalculations) + Me.Controls.Add(Me.lstLayers) Me.Controls.Add(Me.ucrBase) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.MaximizeBox = False Me.MinimizeBox = False Me.Name = "dlgCalculationsSummary" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen - Me.Text = "Calculations/Summary" + Me.Text = "General Summaries" Me.ResumeLayout(False) + Me.PerformLayout() End Sub Friend WithEvents ucrBase As ucrButtons + Friend WithEvents cmdDelete As Button + Friend WithEvents cmdEdit As Button + Friend WithEvents cmdAdd As Button + Friend WithEvents lblCalculations As Label + Friend WithEvents lstLayers As ListView + Friend WithEvents cmdDuplicate As Button End Class diff --git a/instat/dlgCalculationsSummary.vb b/instat/dlgCalculationsSummary.vb index 6b2c2c87892..437f4de7800 100644 --- a/instat/dlgCalculationsSummary.vb +++ b/instat/dlgCalculationsSummary.vb @@ -36,10 +36,15 @@ Public Class dlgCalculationsSummary End Sub Private Sub SetDefaults() - + cmdEdit.Enabled = False + cmdDuplicate.Enabled = False End Sub Private Sub InitialiseDialog() End Sub + + Private Sub cmdAdd_Click(sender As Object, e As EventArgs) Handles cmdAdd.Click + sdgCalculationsSummmary.ShowDialog() + End Sub End Class \ No newline at end of file diff --git a/instat/sdgCalculationsSummmary.Designer.vb b/instat/sdgCalculationsSummmary.Designer.vb index 0722f4b3e55..8a95d2342f0 100644 --- a/instat/sdgCalculationsSummmary.Designer.vb +++ b/instat/sdgCalculationsSummmary.Designer.vb @@ -22,31 +22,244 @@ Partial Class sdgCalculationsSummmary 'Do not modify it using the code editor. _ Private Sub InitializeComponent() + Me.tbSummaryCalcs = New System.Windows.Forms.TabControl() + Me.tbMain = New System.Windows.Forms.TabPage() + Me.ucrReceiverBy = New instat.ucrReceiverSingle() + Me.lblFactor = New System.Windows.Forms.Label() + Me.ucrSelectorBy = New instat.ucrSelectorByDataFrameAddRemove() + Me.ucrColumnName = New instat.ucrInputComboBox() + Me.ucrCalculationName = New instat.ucrInputComboBox() + Me.lblColumnName = New System.Windows.Forms.Label() + Me.lblCalcName = New System.Windows.Forms.Label() + Me.rdoSaveCalcAndResult = New System.Windows.Forms.RadioButton() + Me.rdoSaveCalculation = New System.Windows.Forms.RadioButton() + Me.rdoDoNotSave = New System.Windows.Forms.RadioButton() + Me.lblType = New System.Windows.Forms.Label() + Me.ucrType = New instat.ucrInputComboBox() + Me.tbManipulations = New System.Windows.Forms.TabPage() + Me.tbSubCalcs = New System.Windows.Forms.TabPage() Me.ucrBaseSummmaryCalcSubdialog = New instat.ucrButtonsSubdialogue() + Me.ucrCalcSummary = New instat.ucrCalculator() + Me.tbSummaryCalcs.SuspendLayout() + Me.tbMain.SuspendLayout() Me.SuspendLayout() ' + 'tbSummaryCalcs + ' + Me.tbSummaryCalcs.Controls.Add(Me.tbMain) + Me.tbSummaryCalcs.Controls.Add(Me.tbManipulations) + Me.tbSummaryCalcs.Controls.Add(Me.tbSubCalcs) + Me.tbSummaryCalcs.Location = New System.Drawing.Point(0, 0) + Me.tbSummaryCalcs.Name = "tbSummaryCalcs" + Me.tbSummaryCalcs.SelectedIndex = 0 + Me.tbSummaryCalcs.Size = New System.Drawing.Size(745, 446) + Me.tbSummaryCalcs.TabIndex = 1 + ' + 'tbMain + ' + Me.tbMain.Controls.Add(Me.ucrReceiverBy) + Me.tbMain.Controls.Add(Me.lblFactor) + Me.tbMain.Controls.Add(Me.ucrSelectorBy) + Me.tbMain.Controls.Add(Me.ucrCalcSummary) + Me.tbMain.Controls.Add(Me.ucrColumnName) + Me.tbMain.Controls.Add(Me.ucrCalculationName) + Me.tbMain.Controls.Add(Me.lblColumnName) + Me.tbMain.Controls.Add(Me.lblCalcName) + Me.tbMain.Controls.Add(Me.rdoSaveCalcAndResult) + Me.tbMain.Controls.Add(Me.rdoSaveCalculation) + Me.tbMain.Controls.Add(Me.rdoDoNotSave) + Me.tbMain.Controls.Add(Me.lblType) + Me.tbMain.Controls.Add(Me.ucrType) + Me.tbMain.Location = New System.Drawing.Point(4, 22) + Me.tbMain.Name = "tbMain" + Me.tbMain.Padding = New System.Windows.Forms.Padding(3) + Me.tbMain.Size = New System.Drawing.Size(737, 420) + Me.tbMain.TabIndex = 0 + Me.tbMain.Text = "Main" + Me.tbMain.UseVisualStyleBackColor = True + ' + 'ucrReceiverBy + ' + Me.ucrReceiverBy.Location = New System.Drawing.Point(235, 141) + Me.ucrReceiverBy.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverBy.Name = "ucrReceiverBy" + Me.ucrReceiverBy.Selector = Nothing + Me.ucrReceiverBy.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverBy.TabIndex = 16 + ' + 'lblFactor + ' + Me.lblFactor.AutoSize = True + Me.lblFactor.Location = New System.Drawing.Point(236, 126) + Me.lblFactor.Name = "lblFactor" + Me.lblFactor.Size = New System.Drawing.Size(40, 13) + Me.lblFactor.TabIndex = 15 + Me.lblFactor.Text = "Factor:" + ' + 'ucrSelectorBy + ' + Me.ucrSelectorBy.bShowHiddenColumns = False + Me.ucrSelectorBy.bUseCurrentFilter = True + Me.ucrSelectorBy.Location = New System.Drawing.Point(8, 114) + Me.ucrSelectorBy.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectorBy.Name = "ucrSelectorBy" + Me.ucrSelectorBy.Size = New System.Drawing.Size(210, 180) + Me.ucrSelectorBy.TabIndex = 14 + ' + 'ucrColumnName + ' + Me.ucrColumnName.IsReadOnly = False + Me.ucrColumnName.Location = New System.Drawing.Point(109, 365) + Me.ucrColumnName.Name = "ucrColumnName" + Me.ucrColumnName.Size = New System.Drawing.Size(137, 21) + Me.ucrColumnName.TabIndex = 13 + ' + 'ucrCalculationName + ' + Me.ucrCalculationName.IsReadOnly = False + Me.ucrCalculationName.Location = New System.Drawing.Point(109, 342) + Me.ucrCalculationName.Name = "ucrCalculationName" + Me.ucrCalculationName.Size = New System.Drawing.Size(137, 21) + Me.ucrCalculationName.TabIndex = 12 + ' + 'lblColumnName + ' + Me.lblColumnName.AutoSize = True + Me.lblColumnName.Location = New System.Drawing.Point(9, 369) + Me.lblColumnName.Name = "lblColumnName" + Me.lblColumnName.Size = New System.Drawing.Size(76, 13) + Me.lblColumnName.TabIndex = 10 + Me.lblColumnName.Text = "Column Name:" + ' + 'lblCalcName + ' + Me.lblCalcName.AutoSize = True + Me.lblCalcName.Location = New System.Drawing.Point(9, 346) + Me.lblCalcName.Name = "lblCalcName" + Me.lblCalcName.Size = New System.Drawing.Size(93, 13) + Me.lblCalcName.TabIndex = 9 + Me.lblCalcName.Text = "Calculation Name:" + ' + 'rdoSaveCalcAndResult + ' + Me.rdoSaveCalcAndResult.AutoSize = True + Me.rdoSaveCalcAndResult.Location = New System.Drawing.Point(259, 392) + Me.rdoSaveCalcAndResult.Name = "rdoSaveCalcAndResult" + Me.rdoSaveCalcAndResult.Size = New System.Drawing.Size(159, 17) + Me.rdoSaveCalcAndResult.TabIndex = 8 + Me.rdoSaveCalcAndResult.TabStop = True + Me.rdoSaveCalcAndResult.Text = "Save Calculation and Result" + Me.rdoSaveCalcAndResult.UseVisualStyleBackColor = True + ' + 'rdoSaveCalculation + ' + Me.rdoSaveCalculation.AutoSize = True + Me.rdoSaveCalculation.Location = New System.Drawing.Point(136, 392) + Me.rdoSaveCalculation.Name = "rdoSaveCalculation" + Me.rdoSaveCalculation.Size = New System.Drawing.Size(105, 17) + Me.rdoSaveCalculation.TabIndex = 7 + Me.rdoSaveCalculation.TabStop = True + Me.rdoSaveCalculation.Text = "Save Calculation" + Me.rdoSaveCalculation.UseVisualStyleBackColor = True + ' + 'rdoDoNotSave + ' + Me.rdoDoNotSave.AutoSize = True + Me.rdoDoNotSave.Location = New System.Drawing.Point(12, 392) + Me.rdoDoNotSave.Name = "rdoDoNotSave" + Me.rdoDoNotSave.Size = New System.Drawing.Size(87, 17) + Me.rdoDoNotSave.TabIndex = 6 + Me.rdoDoNotSave.TabStop = True + Me.rdoDoNotSave.Text = "Do Not Save" + Me.rdoDoNotSave.UseVisualStyleBackColor = True + ' + 'lblType + ' + Me.lblType.AutoSize = True + Me.lblType.Location = New System.Drawing.Point(9, 12) + Me.lblType.Name = "lblType" + Me.lblType.Size = New System.Drawing.Size(34, 13) + Me.lblType.TabIndex = 4 + Me.lblType.Text = "Type:" + ' + 'ucrType + ' + Me.ucrType.IsReadOnly = False + Me.ucrType.Location = New System.Drawing.Point(8, 27) + Me.ucrType.Name = "ucrType" + Me.ucrType.Size = New System.Drawing.Size(120, 21) + Me.ucrType.TabIndex = 3 + ' + 'tbManipulations + ' + Me.tbManipulations.Location = New System.Drawing.Point(4, 22) + Me.tbManipulations.Name = "tbManipulations" + Me.tbManipulations.Padding = New System.Windows.Forms.Padding(3) + Me.tbManipulations.Size = New System.Drawing.Size(747, 526) + Me.tbManipulations.TabIndex = 1 + Me.tbManipulations.Text = "Manipulations" + Me.tbManipulations.UseVisualStyleBackColor = True + ' + 'tbSubCalcs + ' + Me.tbSubCalcs.Location = New System.Drawing.Point(4, 22) + Me.tbSubCalcs.Name = "tbSubCalcs" + Me.tbSubCalcs.Padding = New System.Windows.Forms.Padding(3) + Me.tbSubCalcs.Size = New System.Drawing.Size(747, 526) + Me.tbSubCalcs.TabIndex = 2 + Me.tbSubCalcs.Text = "Sub-Calculations" + Me.tbSubCalcs.UseVisualStyleBackColor = True + ' 'ucrBaseSummmaryCalcSubdialog ' - Me.ucrBaseSummmaryCalcSubdialog.Location = New System.Drawing.Point(13, 219) + Me.ucrBaseSummmaryCalcSubdialog.Location = New System.Drawing.Point(303, 452) Me.ucrBaseSummmaryCalcSubdialog.Name = "ucrBaseSummmaryCalcSubdialog" Me.ucrBaseSummmaryCalcSubdialog.Size = New System.Drawing.Size(142, 30) Me.ucrBaseSummmaryCalcSubdialog.TabIndex = 0 ' + 'ucrCalcSummary + ' + Me.ucrCalcSummary.Location = New System.Drawing.Point(8, 50) + Me.ucrCalcSummary.Name = "ucrCalcSummary" + Me.ucrCalcSummary.Size = New System.Drawing.Size(499, 282) + Me.ucrCalcSummary.TabIndex = 17 + ' 'sdgCalculationsSummmary ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(358, 261) + Me.ClientSize = New System.Drawing.Size(757, 491) + Me.Controls.Add(Me.tbSummaryCalcs) Me.Controls.Add(Me.ucrBaseSummmaryCalcSubdialog) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.MaximizeBox = False Me.MinimizeBox = False Me.Name = "sdgCalculationsSummmary" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent - Me.Text = "Summary/Calculations" + Me.Text = "General Summaries" + Me.tbSummaryCalcs.ResumeLayout(False) + Me.tbMain.ResumeLayout(False) + Me.tbMain.PerformLayout() Me.ResumeLayout(False) End Sub Friend WithEvents ucrBaseSummmaryCalcSubdialog As ucrButtonsSubdialogue + Friend WithEvents tbSummaryCalcs As TabControl + Friend WithEvents tbMain As TabPage + Friend WithEvents lblColumnName As Label + Friend WithEvents lblCalcName As Label + Friend WithEvents rdoSaveCalcAndResult As RadioButton + Friend WithEvents rdoSaveCalculation As RadioButton + Friend WithEvents rdoDoNotSave As RadioButton + Friend WithEvents lblType As Label + Friend WithEvents ucrType As ucrInputComboBox + Friend WithEvents tbManipulations As TabPage + Friend WithEvents tbSubCalcs As TabPage + Friend WithEvents ucrColumnName As ucrInputComboBox + Friend WithEvents ucrCalculationName As ucrInputComboBox + Friend WithEvents ucrReceiverBy As ucrReceiverSingle + Friend WithEvents lblFactor As Label + Friend WithEvents ucrSelectorBy As ucrSelectorByDataFrameAddRemove + Friend WithEvents ucrCalcSummary As ucrCalculator End Class diff --git a/instat/sdgCalculationsSummmary.vb b/instat/sdgCalculationsSummmary.vb index 7b1cf4377da..6f6387f4872 100644 --- a/instat/sdgCalculationsSummmary.vb +++ b/instat/sdgCalculationsSummmary.vb @@ -13,8 +13,130 @@ ' ' 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 sdgCalculationsSummmary + Public bFirstLoad As Boolean = True + Public clsRType, clsRFilter, clsRCalculation As New RSyntax + Dim lstType As New List(Of KeyValuePair(Of String, String)) Private Sub sdgCalculationsSummmary_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() + ' Set Items in ucrType + ucrType.SetItems({"calculation", "summary", "by", "filter"}) ' and combine + ucrReceiverBy.Selector = ucrSelectorBy + ucrReceiverBy.SetMeAsReceiver() + ucrReceiverBy.SetDataType("factor") + End Sub + + Private Sub SetDefaults() + ucrSelectorBy.Reset() + ucrSelectorBy.Focus() + ucrType.SetName("calculation") + DisplayOptions() + End Sub + + Private Sub DisplayOptions() + If ucrType.GetText = "calculation" OrElse ucrType.GetText = "summary" Then + ucrSelectorBy.Visible = False + ucrReceiverBy.Visible = False + lblFactor.Visible = False + ucrCalcSummary.Visible = True + lblColumnName.Visible = True + ucrColumnName.Visible = True + rdoSaveCalcAndResult.Visible = True + ElseIf ucrType.GetText = "by" Then + lblColumnName.Visible = False + ucrColumnName.Visible = False + ucrSelectorBy.Visible = True + ucrReceiverBy.Visible = True + lblFactor.Visible = True + rdoSaveCalcAndResult.Visible = False + ucrCalcSummary.Visible = False + If rdoSaveCalcAndResult.Checked Then + rdoDoNotSave.Checked = True + End If + ElseIf ucrType.GetText = "filter" Then + ucrSelectorBy.Visible = False + ucrReceiverBy.Visible = False + lblFactor.Visible = False + lblColumnName.Visible = False + ucrColumnName.Visible = False + rdoDoNotSave.Checked = True + rdoSaveCalcAndResult.Visible = False + ucrCalcSummary.Visible = False + If rdoSaveCalcAndResult.Checked Then + rdoDoNotSave.Checked = True + End If + Else + ' combine options + End If + End Sub + + Private Sub ucrType_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ucrType.TextChanged + DisplayOptions() + End Sub + + Private Sub RunType() + If ucrType.GetText = "calculation" Then + TypeCalculate() + ElseIf ucrType.GetText = "summary" Then + + ElseIf ucrType.GetText = "by" Then + TypeBy() + ElseIf ucrType.GetText = "filter" Then + TypeFilter() + Else + ' combine options + End If + End Sub + + Private Sub TypeBy() + clsRType.AddParameter("type", Chr(34) & "by" & Chr(34)) + clsRType.AddParameter("calculated_from", "list(" & ucrSelectorBy.ucrAvailableDataFrames.cboAvailableDataFrames.Text & "=" & ucrReceiverBy.GetVariableNames() & ")") + ' I believe that the variable names automatically have chr(34) around them + + ' not sure about calculation name - this is what is displayed in the item box in the dlg. + + If rdoSaveCalculation.Checked Then + clsRType.AddParameter("save", "1") + Else + clsRType.AddParameter("save", "0") + End If + + End Sub + + Private Sub TypeFilter() + clsRFilter.AddParameter("type", Chr(34) & "filter" & Chr(34)) + clsRFilter.AddParameter("calculated_from", ) + + If rdoSaveCalculation.Checked Then + clsRFilter.AddParameter("save", "1") + Else + clsRFilter.AddParameter("save", "0") + End If + End Sub + + Private Sub TypeCalculate() + clsRCalculation.AddParameter("type", Chr(34) & "calculation" & Chr(34)) + clsRCalculation.AddParameter("result_name", Chr(34) & ucrCalculationName.ToString & Chr(34)) + + If rdoSaveCalculation.Checked Then + clsRCalculation.AddParameter("save", "1") + ElseIf rdoSaveCalcAndResult.Checked Then + clsRCalculation.AddParameter("save", "2") + Else + clsRCalculation.AddParameter("save", "0") + End If + End Sub + Private Sub rdoSaveOptions_CheckedChanged(sender As Object, e As EventArgs) Handles rdoDoNotSave.CheckedChanged, rdoSaveCalculation.CheckedChanged, rdoSaveCalcAndResult.CheckedChanged + RunType() End Sub End Class \ No newline at end of file From 7d4a2cc48a9ea20a861e2cace209b07aea7909ba Mon Sep 17 00:00:00 2001 From: Lily Date: Tue, 3 Jan 2017 12:33:54 +0000 Subject: [PATCH 03/27] dlgGeneralSummariesUpdate --- instat/dlgCalculationsSummary.Designer.vb | 4 +- instat/sdgCalculationsSummmary.Designer.vb | 266 ++++++++++++++++----- instat/sdgCalculationsSummmary.vb | 36 ++- 3 files changed, 243 insertions(+), 63 deletions(-) diff --git a/instat/dlgCalculationsSummary.Designer.vb b/instat/dlgCalculationsSummary.Designer.vb index af3f58352db..95a9bcf15b6 100644 --- a/instat/dlgCalculationsSummary.Designer.vb +++ b/instat/dlgCalculationsSummary.Designer.vb @@ -87,7 +87,7 @@ Partial Class dlgCalculationsSummary ' 'ucrBase ' - Me.ucrBase.Location = New System.Drawing.Point(12, 228) + Me.ucrBase.Location = New System.Drawing.Point(12, 191) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(410, 52) Me.ucrBase.TabIndex = 0 @@ -96,7 +96,7 @@ Partial Class dlgCalculationsSummary ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(420, 284) + Me.ClientSize = New System.Drawing.Size(420, 247) Me.Controls.Add(Me.cmdDuplicate) Me.Controls.Add(Me.cmdDelete) Me.Controls.Add(Me.cmdEdit) diff --git a/instat/sdgCalculationsSummmary.Designer.vb b/instat/sdgCalculationsSummmary.Designer.vb index 8a95d2342f0..658a066d84a 100644 --- a/instat/sdgCalculationsSummmary.Designer.vb +++ b/instat/sdgCalculationsSummmary.Designer.vb @@ -24,24 +24,38 @@ Partial Class sdgCalculationsSummmary Private Sub InitializeComponent() Me.tbSummaryCalcs = New System.Windows.Forms.TabControl() Me.tbMain = New System.Windows.Forms.TabPage() - Me.ucrReceiverBy = New instat.ucrReceiverSingle() Me.lblFactor = New System.Windows.Forms.Label() - Me.ucrSelectorBy = New instat.ucrSelectorByDataFrameAddRemove() - Me.ucrColumnName = New instat.ucrInputComboBox() - Me.ucrCalculationName = New instat.ucrInputComboBox() Me.lblColumnName = New System.Windows.Forms.Label() Me.lblCalcName = New System.Windows.Forms.Label() Me.rdoSaveCalcAndResult = New System.Windows.Forms.RadioButton() Me.rdoSaveCalculation = New System.Windows.Forms.RadioButton() Me.rdoDoNotSave = New System.Windows.Forms.RadioButton() Me.lblType = New System.Windows.Forms.Label() - Me.ucrType = New instat.ucrInputComboBox() Me.tbManipulations = New System.Windows.Forms.TabPage() Me.tbSubCalcs = New System.Windows.Forms.TabPage() - Me.ucrBaseSummmaryCalcSubdialog = New instat.ucrButtonsSubdialogue() + Me.ucrReceiverBy = New instat.ucrReceiverSingle() Me.ucrCalcSummary = New instat.ucrCalculator() + Me.ucrColumnName = New instat.ucrInputComboBox() + Me.ucrCalculationName = New instat.ucrInputComboBox() + Me.ucrType = New instat.ucrInputComboBox() + Me.ucrSelectorBy = New instat.ucrSelectorByDataFrameAddRemove() + Me.ucrBaseSummmaryCalcSubdialog = New instat.ucrButtonsSubdialogue() + Me.cmdManipDuplicate = New System.Windows.Forms.Button() + Me.cmdManipDelete = New System.Windows.Forms.Button() + Me.cmdManipEdit = New System.Windows.Forms.Button() + Me.cmdManipAdd = New System.Windows.Forms.Button() + Me.lblManipulations = New System.Windows.Forms.Label() + Me.ListView1 = New System.Windows.Forms.ListView() + Me.UcrReorder1 = New instat.ucrReorder() + Me.cmdSubDuplicate = New System.Windows.Forms.Button() + Me.cmdSubDelete = New System.Windows.Forms.Button() + Me.lblSubCalcs = New System.Windows.Forms.Label() + Me.cmdSubEdit = New System.Windows.Forms.Button() + Me.cmdSubAdd = New System.Windows.Forms.Button() Me.tbSummaryCalcs.SuspendLayout() Me.tbMain.SuspendLayout() + Me.tbManipulations.SuspendLayout() + Me.tbSubCalcs.SuspendLayout() Me.SuspendLayout() ' 'tbSummaryCalcs @@ -59,7 +73,6 @@ Partial Class sdgCalculationsSummmary ' Me.tbMain.Controls.Add(Me.ucrReceiverBy) Me.tbMain.Controls.Add(Me.lblFactor) - Me.tbMain.Controls.Add(Me.ucrSelectorBy) Me.tbMain.Controls.Add(Me.ucrCalcSummary) Me.tbMain.Controls.Add(Me.ucrColumnName) Me.tbMain.Controls.Add(Me.ucrCalculationName) @@ -70,6 +83,7 @@ Partial Class sdgCalculationsSummmary Me.tbMain.Controls.Add(Me.rdoDoNotSave) Me.tbMain.Controls.Add(Me.lblType) Me.tbMain.Controls.Add(Me.ucrType) + Me.tbMain.Controls.Add(Me.ucrSelectorBy) Me.tbMain.Location = New System.Drawing.Point(4, 22) Me.tbMain.Name = "tbMain" Me.tbMain.Padding = New System.Windows.Forms.Padding(3) @@ -78,15 +92,6 @@ Partial Class sdgCalculationsSummmary Me.tbMain.Text = "Main" Me.tbMain.UseVisualStyleBackColor = True ' - 'ucrReceiverBy - ' - Me.ucrReceiverBy.Location = New System.Drawing.Point(235, 141) - Me.ucrReceiverBy.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverBy.Name = "ucrReceiverBy" - Me.ucrReceiverBy.Selector = Nothing - Me.ucrReceiverBy.Size = New System.Drawing.Size(120, 20) - Me.ucrReceiverBy.TabIndex = 16 - ' 'lblFactor ' Me.lblFactor.AutoSize = True @@ -96,32 +101,6 @@ Partial Class sdgCalculationsSummmary Me.lblFactor.TabIndex = 15 Me.lblFactor.Text = "Factor:" ' - 'ucrSelectorBy - ' - Me.ucrSelectorBy.bShowHiddenColumns = False - Me.ucrSelectorBy.bUseCurrentFilter = True - Me.ucrSelectorBy.Location = New System.Drawing.Point(8, 114) - Me.ucrSelectorBy.Margin = New System.Windows.Forms.Padding(0) - Me.ucrSelectorBy.Name = "ucrSelectorBy" - Me.ucrSelectorBy.Size = New System.Drawing.Size(210, 180) - Me.ucrSelectorBy.TabIndex = 14 - ' - 'ucrColumnName - ' - Me.ucrColumnName.IsReadOnly = False - Me.ucrColumnName.Location = New System.Drawing.Point(109, 365) - Me.ucrColumnName.Name = "ucrColumnName" - Me.ucrColumnName.Size = New System.Drawing.Size(137, 21) - Me.ucrColumnName.TabIndex = 13 - ' - 'ucrCalculationName - ' - Me.ucrCalculationName.IsReadOnly = False - Me.ucrCalculationName.Location = New System.Drawing.Point(109, 342) - Me.ucrCalculationName.Name = "ucrCalculationName" - Me.ucrCalculationName.Size = New System.Drawing.Size(137, 21) - Me.ucrCalculationName.TabIndex = 12 - ' 'lblColumnName ' Me.lblColumnName.AutoSize = True @@ -182,48 +161,203 @@ Partial Class sdgCalculationsSummmary Me.lblType.TabIndex = 4 Me.lblType.Text = "Type:" ' - 'ucrType - ' - Me.ucrType.IsReadOnly = False - Me.ucrType.Location = New System.Drawing.Point(8, 27) - Me.ucrType.Name = "ucrType" - Me.ucrType.Size = New System.Drawing.Size(120, 21) - Me.ucrType.TabIndex = 3 - ' 'tbManipulations ' + Me.tbManipulations.Controls.Add(Me.UcrReorder1) + Me.tbManipulations.Controls.Add(Me.cmdManipDuplicate) + Me.tbManipulations.Controls.Add(Me.cmdManipDelete) + Me.tbManipulations.Controls.Add(Me.lblManipulations) + Me.tbManipulations.Controls.Add(Me.cmdManipEdit) + Me.tbManipulations.Controls.Add(Me.cmdManipAdd) Me.tbManipulations.Location = New System.Drawing.Point(4, 22) Me.tbManipulations.Name = "tbManipulations" Me.tbManipulations.Padding = New System.Windows.Forms.Padding(3) - Me.tbManipulations.Size = New System.Drawing.Size(747, 526) + Me.tbManipulations.Size = New System.Drawing.Size(737, 420) Me.tbManipulations.TabIndex = 1 Me.tbManipulations.Text = "Manipulations" Me.tbManipulations.UseVisualStyleBackColor = True ' 'tbSubCalcs ' + Me.tbSubCalcs.Controls.Add(Me.ListView1) + Me.tbSubCalcs.Controls.Add(Me.cmdSubDuplicate) + Me.tbSubCalcs.Controls.Add(Me.cmdSubDelete) + Me.tbSubCalcs.Controls.Add(Me.cmdSubAdd) + Me.tbSubCalcs.Controls.Add(Me.lblSubCalcs) + Me.tbSubCalcs.Controls.Add(Me.cmdSubEdit) Me.tbSubCalcs.Location = New System.Drawing.Point(4, 22) Me.tbSubCalcs.Name = "tbSubCalcs" Me.tbSubCalcs.Padding = New System.Windows.Forms.Padding(3) - Me.tbSubCalcs.Size = New System.Drawing.Size(747, 526) + Me.tbSubCalcs.Size = New System.Drawing.Size(737, 420) Me.tbSubCalcs.TabIndex = 2 Me.tbSubCalcs.Text = "Sub-Calculations" Me.tbSubCalcs.UseVisualStyleBackColor = True ' - 'ucrBaseSummmaryCalcSubdialog + 'ucrReceiverBy ' - Me.ucrBaseSummmaryCalcSubdialog.Location = New System.Drawing.Point(303, 452) - Me.ucrBaseSummmaryCalcSubdialog.Name = "ucrBaseSummmaryCalcSubdialog" - Me.ucrBaseSummmaryCalcSubdialog.Size = New System.Drawing.Size(142, 30) - Me.ucrBaseSummmaryCalcSubdialog.TabIndex = 0 + Me.ucrReceiverBy.Location = New System.Drawing.Point(235, 141) + Me.ucrReceiverBy.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverBy.Name = "ucrReceiverBy" + Me.ucrReceiverBy.Selector = Nothing + Me.ucrReceiverBy.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverBy.TabIndex = 16 ' 'ucrCalcSummary ' Me.ucrCalcSummary.Location = New System.Drawing.Point(8, 50) Me.ucrCalcSummary.Name = "ucrCalcSummary" - Me.ucrCalcSummary.Size = New System.Drawing.Size(499, 282) + Me.ucrCalcSummary.Size = New System.Drawing.Size(622, 282) Me.ucrCalcSummary.TabIndex = 17 ' + 'ucrColumnName + ' + Me.ucrColumnName.IsReadOnly = False + Me.ucrColumnName.Location = New System.Drawing.Point(109, 365) + Me.ucrColumnName.Name = "ucrColumnName" + Me.ucrColumnName.Size = New System.Drawing.Size(137, 21) + Me.ucrColumnName.TabIndex = 13 + ' + 'ucrCalculationName + ' + Me.ucrCalculationName.IsReadOnly = False + Me.ucrCalculationName.Location = New System.Drawing.Point(109, 342) + Me.ucrCalculationName.Name = "ucrCalculationName" + Me.ucrCalculationName.Size = New System.Drawing.Size(137, 21) + Me.ucrCalculationName.TabIndex = 12 + ' + 'ucrType + ' + Me.ucrType.IsReadOnly = False + Me.ucrType.Location = New System.Drawing.Point(8, 28) + Me.ucrType.Name = "ucrType" + Me.ucrType.Size = New System.Drawing.Size(120, 21) + Me.ucrType.TabIndex = 3 + ' + 'ucrSelectorBy + ' + Me.ucrSelectorBy.bShowHiddenColumns = False + Me.ucrSelectorBy.bUseCurrentFilter = True + Me.ucrSelectorBy.Location = New System.Drawing.Point(8, 114) + Me.ucrSelectorBy.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectorBy.Name = "ucrSelectorBy" + Me.ucrSelectorBy.Size = New System.Drawing.Size(210, 180) + Me.ucrSelectorBy.TabIndex = 14 + ' + 'ucrBaseSummmaryCalcSubdialog + ' + Me.ucrBaseSummmaryCalcSubdialog.Location = New System.Drawing.Point(303, 452) + Me.ucrBaseSummmaryCalcSubdialog.Name = "ucrBaseSummmaryCalcSubdialog" + Me.ucrBaseSummmaryCalcSubdialog.Size = New System.Drawing.Size(142, 30) + Me.ucrBaseSummmaryCalcSubdialog.TabIndex = 0 + ' + 'cmdManipDuplicate + ' + Me.cmdManipDuplicate.Location = New System.Drawing.Point(166, 132) + Me.cmdManipDuplicate.Name = "cmdManipDuplicate" + Me.cmdManipDuplicate.Size = New System.Drawing.Size(75, 23) + Me.cmdManipDuplicate.TabIndex = 20 + Me.cmdManipDuplicate.Text = "Duplicate" + Me.cmdManipDuplicate.UseVisualStyleBackColor = True + ' + 'cmdManipDelete + ' + Me.cmdManipDelete.Location = New System.Drawing.Point(166, 103) + Me.cmdManipDelete.Name = "cmdManipDelete" + Me.cmdManipDelete.Size = New System.Drawing.Size(75, 23) + Me.cmdManipDelete.TabIndex = 17 + Me.cmdManipDelete.Text = "Delete" + Me.cmdManipDelete.UseVisualStyleBackColor = True + ' + 'cmdManipEdit + ' + Me.cmdManipEdit.Location = New System.Drawing.Point(166, 74) + Me.cmdManipEdit.Name = "cmdManipEdit" + Me.cmdManipEdit.Size = New System.Drawing.Size(75, 23) + Me.cmdManipEdit.TabIndex = 18 + Me.cmdManipEdit.Text = "Edit" + Me.cmdManipEdit.UseVisualStyleBackColor = True + ' + 'cmdManipAdd + ' + Me.cmdManipAdd.Location = New System.Drawing.Point(166, 45) + Me.cmdManipAdd.Name = "cmdManipAdd" + Me.cmdManipAdd.Size = New System.Drawing.Size(75, 23) + Me.cmdManipAdd.TabIndex = 19 + Me.cmdManipAdd.Text = "Add" + Me.cmdManipAdd.UseVisualStyleBackColor = True + ' + 'lblManipulations + ' + Me.lblManipulations.AutoSize = True + Me.lblManipulations.Location = New System.Drawing.Point(9, 17) + Me.lblManipulations.Name = "lblManipulations" + Me.lblManipulations.Size = New System.Drawing.Size(75, 13) + Me.lblManipulations.TabIndex = 16 + Me.lblManipulations.Text = "Manipulations:" + ' + 'ListView1 + ' + Me.ListView1.Location = New System.Drawing.Point(9, 33) + Me.ListView1.Name = "ListView1" + Me.ListView1.Size = New System.Drawing.Size(121, 133) + Me.ListView1.TabIndex = 21 + Me.ListView1.UseCompatibleStateImageBehavior = False + Me.ListView1.View = System.Windows.Forms.View.List + ' + 'UcrReorder1 + ' + Me.UcrReorder1.Location = New System.Drawing.Point(6, 30) + Me.UcrReorder1.Name = "UcrReorder1" + Me.UcrReorder1.Size = New System.Drawing.Size(154, 139) + Me.UcrReorder1.TabIndex = 21 + Me.UcrReorder1.ucrDataFrameList = Nothing + Me.UcrReorder1.ucrReceiver = Nothing + ' + 'cmdSubDuplicate + ' + Me.cmdSubDuplicate.Location = New System.Drawing.Point(166, 132) + Me.cmdSubDuplicate.Name = "cmdSubDuplicate" + Me.cmdSubDuplicate.Size = New System.Drawing.Size(75, 23) + Me.cmdSubDuplicate.TabIndex = 26 + Me.cmdSubDuplicate.Text = "Duplicate" + Me.cmdSubDuplicate.UseVisualStyleBackColor = True + ' + 'cmdSubDelete + ' + Me.cmdSubDelete.Location = New System.Drawing.Point(166, 103) + Me.cmdSubDelete.Name = "cmdSubDelete" + Me.cmdSubDelete.Size = New System.Drawing.Size(75, 23) + Me.cmdSubDelete.TabIndex = 23 + Me.cmdSubDelete.Text = "Delete" + Me.cmdSubDelete.UseVisualStyleBackColor = True + ' + 'lblSubCalcs + ' + Me.lblSubCalcs.AutoSize = True + Me.lblSubCalcs.Location = New System.Drawing.Point(9, 17) + Me.lblSubCalcs.Name = "lblSubCalcs" + Me.lblSubCalcs.Size = New System.Drawing.Size(89, 13) + Me.lblSubCalcs.TabIndex = 22 + Me.lblSubCalcs.Text = "Sub-Calculations:" + ' + 'cmdSubEdit + ' + Me.cmdSubEdit.Location = New System.Drawing.Point(166, 74) + Me.cmdSubEdit.Name = "cmdSubEdit" + Me.cmdSubEdit.Size = New System.Drawing.Size(75, 23) + Me.cmdSubEdit.TabIndex = 24 + Me.cmdSubEdit.Text = "Edit" + Me.cmdSubEdit.UseVisualStyleBackColor = True + ' + 'cmdSubAdd + ' + Me.cmdSubAdd.Location = New System.Drawing.Point(166, 45) + Me.cmdSubAdd.Name = "cmdSubAdd" + Me.cmdSubAdd.Size = New System.Drawing.Size(75, 23) + Me.cmdSubAdd.TabIndex = 25 + Me.cmdSubAdd.Text = "Add" + Me.cmdSubAdd.UseVisualStyleBackColor = True + ' 'sdgCalculationsSummmary ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -240,6 +374,10 @@ Partial Class sdgCalculationsSummmary Me.tbSummaryCalcs.ResumeLayout(False) Me.tbMain.ResumeLayout(False) Me.tbMain.PerformLayout() + Me.tbManipulations.ResumeLayout(False) + Me.tbManipulations.PerformLayout() + Me.tbSubCalcs.ResumeLayout(False) + Me.tbSubCalcs.PerformLayout() Me.ResumeLayout(False) End Sub @@ -262,4 +400,16 @@ Partial Class sdgCalculationsSummmary Friend WithEvents lblFactor As Label Friend WithEvents ucrSelectorBy As ucrSelectorByDataFrameAddRemove Friend WithEvents ucrCalcSummary As ucrCalculator + Friend WithEvents cmdManipDuplicate As Button + Friend WithEvents cmdManipDelete As Button + Friend WithEvents lblManipulations As Label + Friend WithEvents cmdManipEdit As Button + Friend WithEvents cmdManipAdd As Button + Friend WithEvents ListView1 As ListView + Friend WithEvents UcrReorder1 As ucrReorder + Friend WithEvents cmdSubDuplicate As Button + Friend WithEvents cmdSubDelete As Button + Friend WithEvents cmdSubAdd As Button + Friend WithEvents lblSubCalcs As Label + Friend WithEvents cmdSubEdit As Button End Class diff --git a/instat/sdgCalculationsSummmary.vb b/instat/sdgCalculationsSummmary.vb index 6f6387f4872..70a78d4faea 100644 --- a/instat/sdgCalculationsSummmary.vb +++ b/instat/sdgCalculationsSummmary.vb @@ -16,7 +16,7 @@ Imports instat.Translations Public Class sdgCalculationsSummmary Public bFirstLoad As Boolean = True - Public clsRType, clsRFilter, clsRCalculation As New RSyntax + Public clsRType, clsRFilter, clsRCalculation, clsRSummary As New RSyntax Dim lstType As New List(Of KeyValuePair(Of String, String)) Private Sub sdgCalculationsSummmary_Load(sender As Object, e As EventArgs) Handles MyBase.Load autoTranslate(Me) @@ -40,6 +40,7 @@ Public Class sdgCalculationsSummmary ucrSelectorBy.Focus() ucrType.SetName("calculation") DisplayOptions() + rdoDoNotSave.Checked = True End Sub Private Sub DisplayOptions() @@ -68,7 +69,6 @@ Public Class sdgCalculationsSummmary lblFactor.Visible = False lblColumnName.Visible = False ucrColumnName.Visible = False - rdoDoNotSave.Checked = True rdoSaveCalcAndResult.Visible = False ucrCalcSummary.Visible = False If rdoSaveCalcAndResult.Checked Then @@ -87,7 +87,7 @@ Public Class sdgCalculationsSummmary If ucrType.GetText = "calculation" Then TypeCalculate() ElseIf ucrType.GetText = "summary" Then - + TypeSummary() ElseIf ucrType.GetText = "by" Then TypeBy() ElseIf ucrType.GetText = "filter" Then @@ -126,6 +126,8 @@ Public Class sdgCalculationsSummmary Private Sub TypeCalculate() clsRCalculation.AddParameter("type", Chr(34) & "calculation" & Chr(34)) clsRCalculation.AddParameter("result_name", Chr(34) & ucrCalculationName.ToString & Chr(34)) + clsRCalculation.AddParameter("calculated_from", "list(" & ucrCalcSummary.ucrSelectorForCalculations.ucrAvailableDataFrames.cboAvailableDataFrames.Text & "=" & ucrCalcSummary.ucrReceiverForCalculation.GetVariableNames() & ")") + clsRCalculation.AddParameter("function_exp", Chr(34) & ucrCalcSummary.ucrReceiverForCalculation.ToString() & Chr(34)) If rdoSaveCalculation.Checked Then clsRCalculation.AddParameter("save", "1") @@ -136,7 +138,35 @@ Public Class sdgCalculationsSummmary End If End Sub + Private Sub TypeSummary() + clsRSummary.AddParameter("type", Chr(34) & "summary" & Chr(34)) + clsRSummary.AddParameter("result_name", Chr(34) & ucrCalculationName.ToString & Chr(34)) + clsRSummary.AddParameter("calculated_from", "list(" & ucrCalcSummary.ucrSelectorForCalculations.ucrAvailableDataFrames.cboAvailableDataFrames.Text & "=" & ucrCalcSummary.ucrReceiverForCalculation.GetVariableNames() & ")") + clsRSummary.AddParameter("function_exp", Chr(34) & ucrCalcSummary.ucrReceiverForCalculation.ToString() & Chr(34)) + + If rdoSaveCalculation.Checked Then + clsRSummary.AddParameter("save", "1") + ElseIf rdoSaveCalcAndResult.Checked Then + clsRSummary.AddParameter("save", "2") + Else + clsRSummary.AddParameter("save", "0") + End If + End Sub + Private Sub rdoSaveOptions_CheckedChanged(sender As Object, e As EventArgs) Handles rdoDoNotSave.CheckedChanged, rdoSaveCalculation.CheckedChanged, rdoSaveCalcAndResult.CheckedChanged RunType() End Sub + + ' Looking at Manipulations Tab + Private Sub cmdManipAdd_Click(sender As Object, e As EventArgs) Handles cmdManipAdd.Click + + End Sub + ' We want to have that this opens a dialog which only shows filter and by as options in type + + ' Sub Calculations Tab + Private Sub cmdSubAdd_Click(sender As Object, e As EventArgs) Handles cmdSubAdd.Click + + End Sub + ' We want to have that this opens a dialog which only shows calculations and summary (and combine) as options in type + End Class \ No newline at end of file From 213a4d92e4c28599b5049fa1cf6df7cca51a8eea Mon Sep 17 00:00:00 2001 From: Lunalo Date: Tue, 3 Jan 2017 16:39:09 +0300 Subject: [PATCH 04/27] Implementing duplicateColumns --- instat/dlgDuplicateColumns.Designer.vb | 88 ++++++++++++++++---------- instat/dlgDuplicateColumns.vb | 57 ++++++++++------- 2 files changed, 90 insertions(+), 55 deletions(-) diff --git a/instat/dlgDuplicateColumns.Designer.vb b/instat/dlgDuplicateColumns.Designer.vb index 903e278fd7f..301bf67a03f 100644 --- a/instat/dlgDuplicateColumns.Designer.vb +++ b/instat/dlgDuplicateColumns.Designer.vb @@ -22,72 +22,94 @@ Partial Class dlgDuplicateColumns 'Do not modify it using the code editor. Private Sub InitializeComponent() - Me.ucrSelectColumnstoCopy = New instat.ucrSelectorByDataFrame() Me.lblColumns = New System.Windows.Forms.Label() + Me.lblNewColumnName = New System.Windows.Forms.Label() + Me.ucrInputColumnName = New instat.ucrInputComboBox() + Me.ucrReceiverForCopyColumns = New instat.ucrReceiverSingle() + Me.ucrSelectorForDuplicateColumn = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrBase = New instat.ucrButtons() - Me.ucrReceiveColumns = New instat.ucrReceiverMultiple() Me.SuspendLayout() ' - 'ucrSelectColumnstoCopy - ' - Me.ucrSelectColumnstoCopy.bShowHiddenColumns = False - Me.ucrSelectColumnstoCopy.bUseCurrentFilter = True - Me.ucrSelectColumnstoCopy.Location = New System.Drawing.Point(3, 1) - Me.ucrSelectColumnstoCopy.Margin = New System.Windows.Forms.Padding(0) - Me.ucrSelectColumnstoCopy.Name = "ucrSelectColumnstoCopy" - Me.ucrSelectColumnstoCopy.Size = New System.Drawing.Size(147, 177) - Me.ucrSelectColumnstoCopy.TabIndex = 8 - ' 'lblColumns ' Me.lblColumns.AutoSize = True - Me.lblColumns.Location = New System.Drawing.Point(290, 58) + Me.lblColumns.Location = New System.Drawing.Point(226, 13) Me.lblColumns.Name = "lblColumns" - Me.lblColumns.Size = New System.Drawing.Size(109, 13) + Me.lblColumns.Size = New System.Drawing.Size(104, 13) Me.lblColumns.TabIndex = 7 - Me.lblColumns.Text = "Columns to be copied" + Me.lblColumns.Text = "Column to be copied" + ' + 'lblNewColumnName + ' + Me.lblNewColumnName.AutoSize = True + Me.lblNewColumnName.Location = New System.Drawing.Point(12, 221) + Me.lblNewColumnName.Name = "lblNewColumnName" + Me.lblNewColumnName.Size = New System.Drawing.Size(98, 13) + Me.lblNewColumnName.TabIndex = 11 + Me.lblNewColumnName.Text = "New Column Name" + ' + 'ucrInputColumnName + ' + Me.ucrInputColumnName.IsReadOnly = False + Me.ucrInputColumnName.Location = New System.Drawing.Point(149, 213) + Me.ucrInputColumnName.Name = "ucrInputColumnName" + Me.ucrInputColumnName.Size = New System.Drawing.Size(200, 21) + Me.ucrInputColumnName.TabIndex = 10 + ' + 'ucrReceiverForCopyColumns + ' + Me.ucrReceiverForCopyColumns.Location = New System.Drawing.Point(229, 30) + Me.ucrReceiverForCopyColumns.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverForCopyColumns.Name = "ucrReceiverForCopyColumns" + Me.ucrReceiverForCopyColumns.Selector = Nothing + Me.ucrReceiverForCopyColumns.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverForCopyColumns.TabIndex = 9 + ' + 'ucrSelectorForDuplicateColumn + ' + Me.ucrSelectorForDuplicateColumn.bShowHiddenColumns = False + Me.ucrSelectorForDuplicateColumn.bUseCurrentFilter = True + Me.ucrSelectorForDuplicateColumn.Location = New System.Drawing.Point(13, 13) + Me.ucrSelectorForDuplicateColumn.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectorForDuplicateColumn.Name = "ucrSelectorForDuplicateColumn" + Me.ucrSelectorForDuplicateColumn.Size = New System.Drawing.Size(210, 180) + Me.ucrSelectorForDuplicateColumn.TabIndex = 8 ' 'ucrBase ' Me.ucrBase.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.ucrBase.Location = New System.Drawing.Point(3, 182) + Me.ucrBase.Location = New System.Drawing.Point(12, 244) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(403, 53) Me.ucrBase.TabIndex = 6 ' - 'ucrReceiveColumns - ' - Me.ucrReceiveColumns.Location = New System.Drawing.Point(285, 74) - Me.ucrReceiveColumns.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiveColumns.Name = "ucrReceiveColumns" - Me.ucrReceiveColumns.Selector = Nothing - Me.ucrReceiveColumns.Size = New System.Drawing.Size(121, 104) - Me.ucrReceiveColumns.TabIndex = 5 - ' 'dlgDuplicateColumns ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(413, 234) - Me.Controls.Add(Me.ucrSelectColumnstoCopy) + Me.ClientSize = New System.Drawing.Size(413, 309) + Me.Controls.Add(Me.lblNewColumnName) + Me.Controls.Add(Me.ucrInputColumnName) + Me.Controls.Add(Me.ucrReceiverForCopyColumns) + Me.Controls.Add(Me.ucrSelectorForDuplicateColumn) Me.Controls.Add(Me.lblColumns) Me.Controls.Add(Me.ucrBase) - Me.Controls.Add(Me.ucrReceiveColumns) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.MaximizeBox = False Me.MinimizeBox = False Me.Name = "dlgDuplicateColumns" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen - Me.Tag = "Duplicate_copy_paste_columns" - Me.Text = "Duplicate (copy/paste) columns" + Me.Tag = "" + Me.Text = "Duplicate Column" Me.ResumeLayout(False) Me.PerformLayout() End Sub - - Friend WithEvents ucrSelectColumnstoCopy As ucrSelectorByDataFrame Friend WithEvents lblColumns As Label - Friend WithEvents ucrReceiveColumns As ucrReceiverMultiple Friend WithEvents ucrBase As ucrButtons + Friend WithEvents ucrSelectorForDuplicateColumn As ucrSelectorByDataFrameAddRemove + Friend WithEvents ucrReceiverForCopyColumns As ucrReceiverSingle + Friend WithEvents ucrInputColumnName As ucrInputComboBox + Friend WithEvents lblNewColumnName As Label End Class diff --git a/instat/dlgDuplicateColumns.vb b/instat/dlgDuplicateColumns.vb index d4030a4ded7..840a72d2aaa 100644 --- a/instat/dlgDuplicateColumns.vb +++ b/instat/dlgDuplicateColumns.vb @@ -21,44 +21,57 @@ Public Class dlgDuplicateColumns autoTranslate(Me) If bFirstLoad Then initialiseDialog() + SetDefaults() bFirstLoad = False End If 'checks OkEnabled TestOKEnabled() End Sub + Private Sub SetDefaults() + ucrSelectorForDuplicateColumn.Reset() + ucrInputColumnName.Reset() + ucrInputColumnName.SetPrefix("OldColumnName") + End Sub Private Sub initialiseDialog() 'sets the function - ucrBase.clsRsyntax.SetFunction(frmMain.clsRLink.strInstatDataObject & "$copy_columns") - ucrReceiveColumns.Selector = ucrSelectColumnstoCopy - ucrReceiveColumns.SetMeAsReceiver() - 'ucrBase.iHelpTopicID = + ucrBase.clsRsyntax.SetFunction(frmMain.clsRLink.strInstatDataObject & "$add_columns_to_data") + ucrReceiverForCopyColumns.Selector = ucrSelectorForDuplicateColumn + ucrReceiverForCopyColumns.SetMeAsReceiver() End Sub - Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset - ucrSelectColumnstoCopy.Reset() + Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset TestOKEnabled() End Sub Private Sub TestOKEnabled() - If ucrReceiveColumns.IsEmpty() = False Then + If Not ucrReceiverForCopyColumns.IsEmpty AndAlso Not ucrInputColumnName.IsEmpty Then ucrBase.OKEnabled(True) Else ucrBase.OKEnabled(False) End If - End Sub - - Private Sub ucrReceiveColumns_SelectionChanged() Handles ucrReceiveColumns.SelectionChanged - If Not ucrReceiveColumns.IsEmpty Then - ucrBase.clsRsyntax.AddParameter("col_names", ucrReceiveColumns.GetVariableNames()) - Else - ucrBase.clsRsyntax.RemoveParameter("col_names") - End If - 'Test ok enabled - TestOKEnabled() - End Sub - - Private Sub ucrSelectColumnstoCopy_DataFrameChanged() Handles ucrSelectColumnstoCopy.DataFrameChanged - ucrBase.clsRsyntax.AddParameter("data_name", Chr(34) & ucrSelectColumnstoCopy.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34)) - End Sub + End Sub + + Private Sub ucrReceiverForCopyColumns_SelectionChanged(sender As Object, e As EventArgs) Handles ucrReceiverForCopyColumns.SelectionChanged + ucrInputColumnName.SetName(ucrReceiverForCopyColumns.GetVariableNames) + If Not ucrReceiverForCopyColumns.IsEmpty Then + ucrBase.clsRsyntax.AddParameter("col_data", clsRFunctionParameter:=ucrReceiverForCopyColumns.GetVariables) + Else + ucrBase.clsRsyntax.RemoveParameter("col_data") + End If + TestOKEnabled() + End Sub + + Private Sub ucrSelectorForDuplicateColumn_DataFrameChanged() Handles ucrSelectorForDuplicateColumn.DataFrameChanged + ucrBase.clsRsyntax.AddParameter("data_name", Chr(34) & ucrSelectorForDuplicateColumn.ucrAvailableDataFrames.cboAvailableDataFrames.SelectedItem & Chr(34)) + End Sub + + Private Sub ucrInputColumnName_NameChanged() Handles ucrInputColumnName.NameChanged + If Not ucrInputColumnName.IsEmpty Then + ucrBase.clsRsyntax.AddParameter("col_name", Chr(34) & ucrInputColumnName.GetText & Chr(34)) + Else + ucrBase.clsRsyntax.RemoveParameter("col_name") + End If + TestOKEnabled() + End Sub End Class \ No newline at end of file From caea5b221d7561bd8b278081467d9c74303af504 Mon Sep 17 00:00:00 2001 From: Lily Date: Tue, 3 Jan 2017 14:07:28 +0000 Subject: [PATCH 05/27] General Summaries --- instat/sdgCalculationsSummmary.Designer.vb | 216 ++++++++++----------- instat/sdgCalculationsSummmary.vb | 64 +++--- 2 files changed, 130 insertions(+), 150 deletions(-) diff --git a/instat/sdgCalculationsSummmary.Designer.vb b/instat/sdgCalculationsSummmary.Designer.vb index 658a066d84a..ceae24500da 100644 --- a/instat/sdgCalculationsSummmary.Designer.vb +++ b/instat/sdgCalculationsSummmary.Designer.vb @@ -1,9 +1,9 @@ - _ + Partial Class sdgCalculationsSummmary Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. - _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then @@ -20,38 +20,38 @@ Partial Class sdgCalculationsSummmary 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. - _ + Private Sub InitializeComponent() Me.tbSummaryCalcs = New System.Windows.Forms.TabControl() Me.tbMain = New System.Windows.Forms.TabPage() + Me.ucrReceiverBy = New instat.ucrReceiverSingle() Me.lblFactor = New System.Windows.Forms.Label() + Me.ucrColumnName = New instat.ucrInputComboBox() + Me.ucrCalculationName = New instat.ucrInputComboBox() Me.lblColumnName = New System.Windows.Forms.Label() Me.lblCalcName = New System.Windows.Forms.Label() Me.rdoSaveCalcAndResult = New System.Windows.Forms.RadioButton() Me.rdoSaveCalculation = New System.Windows.Forms.RadioButton() Me.rdoDoNotSave = New System.Windows.Forms.RadioButton() Me.lblType = New System.Windows.Forms.Label() - Me.tbManipulations = New System.Windows.Forms.TabPage() - Me.tbSubCalcs = New System.Windows.Forms.TabPage() - Me.ucrReceiverBy = New instat.ucrReceiverSingle() - Me.ucrCalcSummary = New instat.ucrCalculator() - Me.ucrColumnName = New instat.ucrInputComboBox() - Me.ucrCalculationName = New instat.ucrInputComboBox() Me.ucrType = New instat.ucrInputComboBox() Me.ucrSelectorBy = New instat.ucrSelectorByDataFrameAddRemove() - Me.ucrBaseSummmaryCalcSubdialog = New instat.ucrButtonsSubdialogue() + Me.tbManipulations = New System.Windows.Forms.TabPage() + Me.UcrReorder1 = New instat.ucrReorder() Me.cmdManipDuplicate = New System.Windows.Forms.Button() Me.cmdManipDelete = New System.Windows.Forms.Button() + Me.lblManipulations = New System.Windows.Forms.Label() Me.cmdManipEdit = New System.Windows.Forms.Button() Me.cmdManipAdd = New System.Windows.Forms.Button() - Me.lblManipulations = New System.Windows.Forms.Label() + Me.tbSubCalcs = New System.Windows.Forms.TabPage() Me.ListView1 = New System.Windows.Forms.ListView() - Me.UcrReorder1 = New instat.ucrReorder() Me.cmdSubDuplicate = New System.Windows.Forms.Button() Me.cmdSubDelete = New System.Windows.Forms.Button() + Me.cmdSubAdd = New System.Windows.Forms.Button() Me.lblSubCalcs = New System.Windows.Forms.Label() Me.cmdSubEdit = New System.Windows.Forms.Button() - Me.cmdSubAdd = New System.Windows.Forms.Button() + Me.ucrBaseSummmaryCalcSubdialog = New instat.ucrButtonsSubdialogue() + Me.ucrCalcSummary = New instat.ucrCalculator() Me.tbSummaryCalcs.SuspendLayout() Me.tbMain.SuspendLayout() Me.tbManipulations.SuspendLayout() @@ -66,7 +66,7 @@ Partial Class sdgCalculationsSummmary Me.tbSummaryCalcs.Location = New System.Drawing.Point(0, 0) Me.tbSummaryCalcs.Name = "tbSummaryCalcs" Me.tbSummaryCalcs.SelectedIndex = 0 - Me.tbSummaryCalcs.Size = New System.Drawing.Size(745, 446) + Me.tbSummaryCalcs.Size = New System.Drawing.Size(643, 446) Me.tbSummaryCalcs.TabIndex = 1 ' 'tbMain @@ -87,11 +87,20 @@ Partial Class sdgCalculationsSummmary Me.tbMain.Location = New System.Drawing.Point(4, 22) Me.tbMain.Name = "tbMain" Me.tbMain.Padding = New System.Windows.Forms.Padding(3) - Me.tbMain.Size = New System.Drawing.Size(737, 420) + Me.tbMain.Size = New System.Drawing.Size(635, 420) Me.tbMain.TabIndex = 0 Me.tbMain.Text = "Main" Me.tbMain.UseVisualStyleBackColor = True ' + 'ucrReceiverBy + ' + Me.ucrReceiverBy.Location = New System.Drawing.Point(235, 141) + Me.ucrReceiverBy.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverBy.Name = "ucrReceiverBy" + Me.ucrReceiverBy.Selector = Nothing + Me.ucrReceiverBy.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverBy.TabIndex = 16 + ' 'lblFactor ' Me.lblFactor.AutoSize = True @@ -101,6 +110,22 @@ Partial Class sdgCalculationsSummmary Me.lblFactor.TabIndex = 15 Me.lblFactor.Text = "Factor:" ' + 'ucrColumnName + ' + Me.ucrColumnName.IsReadOnly = False + Me.ucrColumnName.Location = New System.Drawing.Point(109, 365) + Me.ucrColumnName.Name = "ucrColumnName" + Me.ucrColumnName.Size = New System.Drawing.Size(137, 21) + Me.ucrColumnName.TabIndex = 13 + ' + 'ucrCalculationName + ' + Me.ucrCalculationName.IsReadOnly = False + Me.ucrCalculationName.Location = New System.Drawing.Point(109, 342) + Me.ucrCalculationName.Name = "ucrCalculationName" + Me.ucrCalculationName.Size = New System.Drawing.Size(137, 21) + Me.ucrCalculationName.TabIndex = 12 + ' 'lblColumnName ' Me.lblColumnName.AutoSize = True @@ -161,70 +186,6 @@ Partial Class sdgCalculationsSummmary Me.lblType.TabIndex = 4 Me.lblType.Text = "Type:" ' - 'tbManipulations - ' - Me.tbManipulations.Controls.Add(Me.UcrReorder1) - Me.tbManipulations.Controls.Add(Me.cmdManipDuplicate) - Me.tbManipulations.Controls.Add(Me.cmdManipDelete) - Me.tbManipulations.Controls.Add(Me.lblManipulations) - Me.tbManipulations.Controls.Add(Me.cmdManipEdit) - Me.tbManipulations.Controls.Add(Me.cmdManipAdd) - Me.tbManipulations.Location = New System.Drawing.Point(4, 22) - Me.tbManipulations.Name = "tbManipulations" - Me.tbManipulations.Padding = New System.Windows.Forms.Padding(3) - Me.tbManipulations.Size = New System.Drawing.Size(737, 420) - Me.tbManipulations.TabIndex = 1 - Me.tbManipulations.Text = "Manipulations" - Me.tbManipulations.UseVisualStyleBackColor = True - ' - 'tbSubCalcs - ' - Me.tbSubCalcs.Controls.Add(Me.ListView1) - Me.tbSubCalcs.Controls.Add(Me.cmdSubDuplicate) - Me.tbSubCalcs.Controls.Add(Me.cmdSubDelete) - Me.tbSubCalcs.Controls.Add(Me.cmdSubAdd) - Me.tbSubCalcs.Controls.Add(Me.lblSubCalcs) - Me.tbSubCalcs.Controls.Add(Me.cmdSubEdit) - Me.tbSubCalcs.Location = New System.Drawing.Point(4, 22) - Me.tbSubCalcs.Name = "tbSubCalcs" - Me.tbSubCalcs.Padding = New System.Windows.Forms.Padding(3) - Me.tbSubCalcs.Size = New System.Drawing.Size(737, 420) - Me.tbSubCalcs.TabIndex = 2 - Me.tbSubCalcs.Text = "Sub-Calculations" - Me.tbSubCalcs.UseVisualStyleBackColor = True - ' - 'ucrReceiverBy - ' - Me.ucrReceiverBy.Location = New System.Drawing.Point(235, 141) - Me.ucrReceiverBy.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverBy.Name = "ucrReceiverBy" - Me.ucrReceiverBy.Selector = Nothing - Me.ucrReceiverBy.Size = New System.Drawing.Size(120, 20) - Me.ucrReceiverBy.TabIndex = 16 - ' - 'ucrCalcSummary - ' - Me.ucrCalcSummary.Location = New System.Drawing.Point(8, 50) - Me.ucrCalcSummary.Name = "ucrCalcSummary" - Me.ucrCalcSummary.Size = New System.Drawing.Size(622, 282) - Me.ucrCalcSummary.TabIndex = 17 - ' - 'ucrColumnName - ' - Me.ucrColumnName.IsReadOnly = False - Me.ucrColumnName.Location = New System.Drawing.Point(109, 365) - Me.ucrColumnName.Name = "ucrColumnName" - Me.ucrColumnName.Size = New System.Drawing.Size(137, 21) - Me.ucrColumnName.TabIndex = 13 - ' - 'ucrCalculationName - ' - Me.ucrCalculationName.IsReadOnly = False - Me.ucrCalculationName.Location = New System.Drawing.Point(109, 342) - Me.ucrCalculationName.Name = "ucrCalculationName" - Me.ucrCalculationName.Size = New System.Drawing.Size(137, 21) - Me.ucrCalculationName.TabIndex = 12 - ' 'ucrType ' Me.ucrType.IsReadOnly = False @@ -243,12 +204,30 @@ Partial Class sdgCalculationsSummmary Me.ucrSelectorBy.Size = New System.Drawing.Size(210, 180) Me.ucrSelectorBy.TabIndex = 14 ' - 'ucrBaseSummmaryCalcSubdialog + 'tbManipulations ' - Me.ucrBaseSummmaryCalcSubdialog.Location = New System.Drawing.Point(303, 452) - Me.ucrBaseSummmaryCalcSubdialog.Name = "ucrBaseSummmaryCalcSubdialog" - Me.ucrBaseSummmaryCalcSubdialog.Size = New System.Drawing.Size(142, 30) - Me.ucrBaseSummmaryCalcSubdialog.TabIndex = 0 + Me.tbManipulations.Controls.Add(Me.UcrReorder1) + Me.tbManipulations.Controls.Add(Me.cmdManipDuplicate) + Me.tbManipulations.Controls.Add(Me.cmdManipDelete) + Me.tbManipulations.Controls.Add(Me.lblManipulations) + Me.tbManipulations.Controls.Add(Me.cmdManipEdit) + Me.tbManipulations.Controls.Add(Me.cmdManipAdd) + Me.tbManipulations.Location = New System.Drawing.Point(4, 22) + Me.tbManipulations.Name = "tbManipulations" + Me.tbManipulations.Padding = New System.Windows.Forms.Padding(3) + Me.tbManipulations.Size = New System.Drawing.Size(737, 420) + Me.tbManipulations.TabIndex = 1 + Me.tbManipulations.Text = "Manipulations" + Me.tbManipulations.UseVisualStyleBackColor = True + ' + 'UcrReorder1 + ' + Me.UcrReorder1.Location = New System.Drawing.Point(6, 30) + Me.UcrReorder1.Name = "UcrReorder1" + Me.UcrReorder1.Size = New System.Drawing.Size(154, 139) + Me.UcrReorder1.TabIndex = 21 + Me.UcrReorder1.ucrDataFrameList = Nothing + Me.UcrReorder1.ucrReceiver = Nothing ' 'cmdManipDuplicate ' @@ -268,6 +247,15 @@ Partial Class sdgCalculationsSummmary Me.cmdManipDelete.Text = "Delete" Me.cmdManipDelete.UseVisualStyleBackColor = True ' + 'lblManipulations + ' + Me.lblManipulations.AutoSize = True + Me.lblManipulations.Location = New System.Drawing.Point(9, 17) + Me.lblManipulations.Name = "lblManipulations" + Me.lblManipulations.Size = New System.Drawing.Size(75, 13) + Me.lblManipulations.TabIndex = 16 + Me.lblManipulations.Text = "Manipulations:" + ' 'cmdManipEdit ' Me.cmdManipEdit.Location = New System.Drawing.Point(166, 74) @@ -286,14 +274,21 @@ Partial Class sdgCalculationsSummmary Me.cmdManipAdd.Text = "Add" Me.cmdManipAdd.UseVisualStyleBackColor = True ' - 'lblManipulations + 'tbSubCalcs ' - Me.lblManipulations.AutoSize = True - Me.lblManipulations.Location = New System.Drawing.Point(9, 17) - Me.lblManipulations.Name = "lblManipulations" - Me.lblManipulations.Size = New System.Drawing.Size(75, 13) - Me.lblManipulations.TabIndex = 16 - Me.lblManipulations.Text = "Manipulations:" + Me.tbSubCalcs.Controls.Add(Me.ListView1) + Me.tbSubCalcs.Controls.Add(Me.cmdSubDuplicate) + Me.tbSubCalcs.Controls.Add(Me.cmdSubDelete) + Me.tbSubCalcs.Controls.Add(Me.cmdSubAdd) + Me.tbSubCalcs.Controls.Add(Me.lblSubCalcs) + Me.tbSubCalcs.Controls.Add(Me.cmdSubEdit) + Me.tbSubCalcs.Location = New System.Drawing.Point(4, 22) + Me.tbSubCalcs.Name = "tbSubCalcs" + Me.tbSubCalcs.Padding = New System.Windows.Forms.Padding(3) + Me.tbSubCalcs.Size = New System.Drawing.Size(737, 420) + Me.tbSubCalcs.TabIndex = 2 + Me.tbSubCalcs.Text = "Sub-Calculations" + Me.tbSubCalcs.UseVisualStyleBackColor = True ' 'ListView1 ' @@ -304,15 +299,6 @@ Partial Class sdgCalculationsSummmary Me.ListView1.UseCompatibleStateImageBehavior = False Me.ListView1.View = System.Windows.Forms.View.List ' - 'UcrReorder1 - ' - Me.UcrReorder1.Location = New System.Drawing.Point(6, 30) - Me.UcrReorder1.Name = "UcrReorder1" - Me.UcrReorder1.Size = New System.Drawing.Size(154, 139) - Me.UcrReorder1.TabIndex = 21 - Me.UcrReorder1.ucrDataFrameList = Nothing - Me.UcrReorder1.ucrReceiver = Nothing - ' 'cmdSubDuplicate ' Me.cmdSubDuplicate.Location = New System.Drawing.Point(166, 132) @@ -331,6 +317,15 @@ Partial Class sdgCalculationsSummmary Me.cmdSubDelete.Text = "Delete" Me.cmdSubDelete.UseVisualStyleBackColor = True ' + 'cmdSubAdd + ' + Me.cmdSubAdd.Location = New System.Drawing.Point(166, 45) + Me.cmdSubAdd.Name = "cmdSubAdd" + Me.cmdSubAdd.Size = New System.Drawing.Size(75, 23) + Me.cmdSubAdd.TabIndex = 25 + Me.cmdSubAdd.Text = "Add" + Me.cmdSubAdd.UseVisualStyleBackColor = True + ' 'lblSubCalcs ' Me.lblSubCalcs.AutoSize = True @@ -349,20 +344,25 @@ Partial Class sdgCalculationsSummmary Me.cmdSubEdit.Text = "Edit" Me.cmdSubEdit.UseVisualStyleBackColor = True ' - 'cmdSubAdd + 'ucrBaseSummmaryCalcSubdialog ' - Me.cmdSubAdd.Location = New System.Drawing.Point(166, 45) - Me.cmdSubAdd.Name = "cmdSubAdd" - Me.cmdSubAdd.Size = New System.Drawing.Size(75, 23) - Me.cmdSubAdd.TabIndex = 25 - Me.cmdSubAdd.Text = "Add" - Me.cmdSubAdd.UseVisualStyleBackColor = True + Me.ucrBaseSummmaryCalcSubdialog.Location = New System.Drawing.Point(239, 452) + Me.ucrBaseSummmaryCalcSubdialog.Name = "ucrBaseSummmaryCalcSubdialog" + Me.ucrBaseSummmaryCalcSubdialog.Size = New System.Drawing.Size(142, 30) + Me.ucrBaseSummmaryCalcSubdialog.TabIndex = 0 + ' + 'ucrCalcSummary + ' + Me.ucrCalcSummary.Location = New System.Drawing.Point(8, 50) + Me.ucrCalcSummary.Name = "ucrCalcSummary" + Me.ucrCalcSummary.Size = New System.Drawing.Size(623, 282) + Me.ucrCalcSummary.TabIndex = 17 ' 'sdgCalculationsSummmary ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(757, 491) + Me.ClientSize = New System.Drawing.Size(644, 491) Me.Controls.Add(Me.tbSummaryCalcs) Me.Controls.Add(Me.ucrBaseSummmaryCalcSubdialog) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow diff --git a/instat/sdgCalculationsSummmary.vb b/instat/sdgCalculationsSummmary.vb index 70a78d4faea..f5fac81568a 100644 --- a/instat/sdgCalculationsSummmary.vb +++ b/instat/sdgCalculationsSummmary.vb @@ -16,7 +16,7 @@ Imports instat.Translations Public Class sdgCalculationsSummmary Public bFirstLoad As Boolean = True - Public clsRType, clsRFilter, clsRCalculation, clsRSummary As New RSyntax + Public clsRFunction As New RFunction Dim lstType As New List(Of KeyValuePair(Of String, String)) Private Sub sdgCalculationsSummmary_Load(sender As Object, e As EventArgs) Handles MyBase.Load autoTranslate(Me) @@ -33,6 +33,15 @@ Public Class sdgCalculationsSummmary ucrReceiverBy.Selector = ucrSelectorBy ucrReceiverBy.SetMeAsReceiver() ucrReceiverBy.SetDataType("factor") + + lstType.Add(New KeyValuePair(Of String, String)("Calculation", Chr(34) & "calculation" & Chr(34))) + lstType.Add(New KeyValuePair(Of String, String)("Summary", Chr(34) & "summary" & Chr(34))) + lstType.Add(New KeyValuePair(Of String, String)("By", Chr(34) & "by" & Chr(34))) + lstType.Add(New KeyValuePair(Of String, String)("Filter", Chr(34) & "filter" & Chr(34))) + ' lstType.Add(New KeyValuePair(Of String, String)("Combine", Chr(34) & "combination" & Chr(34))) + ucrType.SetItems(lstType) + ucrType.SetParameterName("type") + End Sub Private Sub SetDefaults() @@ -98,65 +107,36 @@ Public Class sdgCalculationsSummmary End Sub Private Sub TypeBy() - clsRType.AddParameter("type", Chr(34) & "by" & Chr(34)) - clsRType.AddParameter("calculated_from", "list(" & ucrSelectorBy.ucrAvailableDataFrames.cboAvailableDataFrames.Text & "=" & ucrReceiverBy.GetVariableNames() & ")") + ' clsRType.AddParameter("calculated_from", "list(" & ucrSelectorBy.ucrAvailableDataFrames.cboAvailableDataFrames.Text & "=" & ucrReceiverBy.GetVariableNames() & ")") ' I believe that the variable names automatically have chr(34) around them - ' not sure about calculation name - this is what is displayed in the item box in the dlg. - - If rdoSaveCalculation.Checked Then - clsRType.AddParameter("save", "1") - Else - clsRType.AddParameter("save", "0") - End If - End Sub Private Sub TypeFilter() - clsRFilter.AddParameter("type", Chr(34) & "filter" & Chr(34)) - clsRFilter.AddParameter("calculated_from", ) - - If rdoSaveCalculation.Checked Then - clsRFilter.AddParameter("save", "1") - Else - clsRFilter.AddParameter("save", "0") - End If End Sub Private Sub TypeCalculate() - clsRCalculation.AddParameter("type", Chr(34) & "calculation" & Chr(34)) - clsRCalculation.AddParameter("result_name", Chr(34) & ucrCalculationName.ToString & Chr(34)) - clsRCalculation.AddParameter("calculated_from", "list(" & ucrCalcSummary.ucrSelectorForCalculations.ucrAvailableDataFrames.cboAvailableDataFrames.Text & "=" & ucrCalcSummary.ucrReceiverForCalculation.GetVariableNames() & ")") - clsRCalculation.AddParameter("function_exp", Chr(34) & ucrCalcSummary.ucrReceiverForCalculation.ToString() & Chr(34)) - - If rdoSaveCalculation.Checked Then - clsRCalculation.AddParameter("save", "1") - ElseIf rdoSaveCalcAndResult.Checked Then - clsRCalculation.AddParameter("save", "2") - Else - clsRCalculation.AddParameter("save", "0") - End If + ' clsRCalculation.AddParameter("result_name", Chr(34) & ucrCalculationName.ToString & Chr(34)) + ' clsRCalculation.AddParameter("calculated_from", "list(" & ucrCalcSummary.ucrSelectorForCalculations.ucrAvailableDataFrames.cboAvailableDataFrames.Text & "=" & ucrCalcSummary.ucrReceiverForCalculation.GetVariableNames() & ")") + ' clsRCalculation.AddParameter("function_exp", Chr(34) & ucrCalcSummary.ucrReceiverForCalculation.ToString() & Chr(34)) End Sub Private Sub TypeSummary() - clsRSummary.AddParameter("type", Chr(34) & "summary" & Chr(34)) - clsRSummary.AddParameter("result_name", Chr(34) & ucrCalculationName.ToString & Chr(34)) - clsRSummary.AddParameter("calculated_from", "list(" & ucrCalcSummary.ucrSelectorForCalculations.ucrAvailableDataFrames.cboAvailableDataFrames.Text & "=" & ucrCalcSummary.ucrReceiverForCalculation.GetVariableNames() & ")") - clsRSummary.AddParameter("function_exp", Chr(34) & ucrCalcSummary.ucrReceiverForCalculation.ToString() & Chr(34)) + ' clsRSummary.AddParameter("result_name", Chr(34) & ucrCalculationName.ToString & Chr(34)) + ' clsRSummary.AddParameter("calculated_from", "list(" & ucrCalcSummary.ucrSelectorForCalculations.ucrAvailableDataFrames.cboAvailableDataFrames.Text & "=" & ucrCalcSummary.ucrReceiverForCalculation.GetVariableNames() & ")") + ' clsRSummary.AddParameter("function_exp", Chr(34) & ucrCalcSummary.ucrReceiverForCalculation.ToString() & Chr(34)) + End Sub + Private Sub rdoSaveOptions_CheckedChanged(sender As Object, e As EventArgs) Handles rdoDoNotSave.CheckedChanged, rdoSaveCalculation.CheckedChanged, rdoSaveCalcAndResult.CheckedChanged If rdoSaveCalculation.Checked Then - clsRSummary.AddParameter("save", "1") + clsRFunction.AddParameter("save", "1") ElseIf rdoSaveCalcAndResult.Checked Then - clsRSummary.AddParameter("save", "2") + clsRFunction.AddParameter("save", "2") Else - clsRSummary.AddParameter("save", "0") + clsRFunction.AddParameter("save", "0") End If End Sub - Private Sub rdoSaveOptions_CheckedChanged(sender As Object, e As EventArgs) Handles rdoDoNotSave.CheckedChanged, rdoSaveCalculation.CheckedChanged, rdoSaveCalcAndResult.CheckedChanged - RunType() - End Sub - ' Looking at Manipulations Tab Private Sub cmdManipAdd_Click(sender As Object, e As EventArgs) Handles cmdManipAdd.Click From 8aff11b6b94edfc6363bea59d02d4415dbca94b0 Mon Sep 17 00:00:00 2001 From: Lily Date: Tue, 3 Jan 2017 14:15:49 +0000 Subject: [PATCH 06/27] --- instat/sdgCalculationsSummmary.vb | 1 + 1 file changed, 1 insertion(+) diff --git a/instat/sdgCalculationsSummmary.vb b/instat/sdgCalculationsSummmary.vb index f5fac81568a..cd4d71c9f16 100644 --- a/instat/sdgCalculationsSummmary.vb +++ b/instat/sdgCalculationsSummmary.vb @@ -42,6 +42,7 @@ Public Class sdgCalculationsSummmary ucrType.SetItems(lstType) ucrType.SetParameterName("type") + clsRFunction.SetAssignTo(ucrCalculationName.ToString()) End Sub Private Sub SetDefaults() From e4ad66a58fb0f334b72dd272b2c5b5499e4e4026 Mon Sep 17 00:00:00 2001 From: Lunalo Date: Tue, 3 Jan 2017 17:39:38 +0300 Subject: [PATCH 07/27] Edits on dlgDuplicateColumns --- instat/dlgDuplicateColumns.vb | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/instat/dlgDuplicateColumns.vb b/instat/dlgDuplicateColumns.vb index 840a72d2aaa..8bbd3d87a2e 100644 --- a/instat/dlgDuplicateColumns.vb +++ b/instat/dlgDuplicateColumns.vb @@ -31,7 +31,6 @@ Public Class dlgDuplicateColumns Private Sub SetDefaults() ucrSelectorForDuplicateColumn.Reset() ucrInputColumnName.Reset() - ucrInputColumnName.SetPrefix("OldColumnName") End Sub Private Sub initialiseDialog() 'sets the function @@ -52,8 +51,20 @@ Public Class dlgDuplicateColumns End If End Sub + Private Sub SetDefaultName() + Dim laschar As String = ucrReceiverForCopyColumns.GetVariableNames(False) + If Not IsNumeric(laschar.Substring(laschar.Length - 1)) Then + ucrInputColumnName.SetName(Chr(34) & laschar & 1 & Chr(34)) + + Else + Dim laschar1 As String = laschar.Remove(laschar.Substring(laschar.Length - 1)) + ucrInputColumnName.SetName(Chr(34) & laschar1 & Convert.ToInt32(laschar.Substring(laschar.Length - 1)) + 1 & Chr(34)) + End If + End Sub + Private Sub ucrReceiverForCopyColumns_SelectionChanged(sender As Object, e As EventArgs) Handles ucrReceiverForCopyColumns.SelectionChanged - ucrInputColumnName.SetName(ucrReceiverForCopyColumns.GetVariableNames) + SetDefaultName() + If Not ucrReceiverForCopyColumns.IsEmpty Then ucrBase.clsRsyntax.AddParameter("col_data", clsRFunctionParameter:=ucrReceiverForCopyColumns.GetVariables) Else @@ -68,7 +79,7 @@ Public Class dlgDuplicateColumns Private Sub ucrInputColumnName_NameChanged() Handles ucrInputColumnName.NameChanged If Not ucrInputColumnName.IsEmpty Then - ucrBase.clsRsyntax.AddParameter("col_name", Chr(34) & ucrInputColumnName.GetText & Chr(34)) + ucrBase.clsRsyntax.AddParameter("col_name", ucrInputColumnName.GetText) Else ucrBase.clsRsyntax.RemoveParameter("col_name") End If From 09d6c6c0de31da2ffa1d97faa1146658656bb22a Mon Sep 17 00:00:00 2001 From: steven ndung'u Date: Tue, 3 Jan 2017 18:02:15 +0300 Subject: [PATCH 08/27] Adding right clicks --- instat/frmEditor.vb | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/instat/frmEditor.vb b/instat/frmEditor.vb index 125935df45f..5952a8d770e 100644 --- a/instat/frmEditor.vb +++ b/instat/frmEditor.vb @@ -37,6 +37,9 @@ Public Class frmEditor Private clsUnfreezeColumns As New RFunction Private clsViewDataFrame As New RFunction Private clsGetDataFrame As New RFunction + Private clsDate As New RFunction + Private clsConvertOrderedFactor As New RFunction + Private clsDuplicate As New RFunction Public lstColumnNames As New List(Of KeyValuePair(Of String, String())) Private Sub frmEditor_Load(sender As Object, e As EventArgs) Handles MyBase.Load @@ -77,7 +80,10 @@ Public Class frmEditor clsFreezeColumns.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$freeze_columns") clsUnfreezeColumns.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$unfreeze_columns") clsGetDataFrame.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_data_frame") + clsConvertOrderedFactor.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$convert_column_to_type") + clsDuplicate.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$add_columns_to_data") clsViewDataFrame.SetRCommand("View") + clsDate.SetRCommand("as.Date") UpdateRFunctionDataFrameParameters() End Sub @@ -542,6 +548,9 @@ Public Class frmEditor clsFreezeColumns.AddParameter("data_name", Chr(34) & grdCurrSheet.Name & Chr(34)) clsUnfreezeColumns.AddParameter("data_name", Chr(34) & grdCurrSheet.Name & Chr(34)) clsGetDataFrame.AddParameter("data_name", Chr(34) & grdCurrSheet.Name & Chr(34)) + clsConvertOrderedFactor.AddParameter("data_name", Chr(34) & grdCurrSheet.Name & Chr(34)) + clsDuplicate.AddParameter("data_name", Chr(34) & grdCurrSheet.Name & Chr(34)) + End If End Sub @@ -634,14 +643,19 @@ Public Class frmEditor End Sub Private Sub mnuConvertDate_Click(sender As Object, e As EventArgs) Handles mnuConvertToDate.Click - dlgMakeDate.ShowDialog() + clsDate.AddParameter("x", SelectedColumns()) + frmMain.clsRLink.RunScript(clsDate.ToScript, strComment:="Right Click Menu: Convert to Date") End Sub Private Sub mnuCovertToOrderedFactors_Click(sender As Object, e As EventArgs) Handles mnuCovertToOrderedFactors.Click - dlgConvertColumns.ShowDialog() + clsConvertOrderedFactor.AddParameter("col_names", ) + clsConvertOrderedFactor.AddParameter("to_type", Chr(34) & "ordered_factor" & Chr(34)) + frmMain.clsRLink.RunScript(clsConvertOrderedFactor.ToScript, strComment:="Right Click Menu: Convert to Ordered Factor") End Sub Private Sub mnuDuplicateColumn_Click(sender As Object, e As EventArgs) Handles mnuDuplicateColumn.Click - + clsDuplicate.AddParameter("col_data", SelectedColumns()) + clsDuplicate.AddParameter("col_name") + frmMain.clsRLink.RunScript(clsDuplicate.ToScript, strComment:="Right Click Menu: Duplicate column(s)") End Sub End Class From 27a9e49273dec9af42a74d1f8e68b1a9558e5d89 Mon Sep 17 00:00:00 2001 From: steven ndung'u Date: Tue, 3 Jan 2017 20:59:20 +0300 Subject: [PATCH 09/27] Minor changes --- instat/frmEditor.vb | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/instat/frmEditor.vb b/instat/frmEditor.vb index 5952a8d770e..002296b174c 100644 --- a/instat/frmEditor.vb +++ b/instat/frmEditor.vb @@ -37,9 +37,7 @@ Public Class frmEditor Private clsUnfreezeColumns As New RFunction Private clsViewDataFrame As New RFunction Private clsGetDataFrame As New RFunction - Private clsDate As New RFunction Private clsConvertOrderedFactor As New RFunction - Private clsDuplicate As New RFunction Public lstColumnNames As New List(Of KeyValuePair(Of String, String())) Private Sub frmEditor_Load(sender As Object, e As EventArgs) Handles MyBase.Load @@ -81,9 +79,7 @@ Public Class frmEditor clsUnfreezeColumns.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$unfreeze_columns") clsGetDataFrame.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_data_frame") clsConvertOrderedFactor.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$convert_column_to_type") - clsDuplicate.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$add_columns_to_data") clsViewDataFrame.SetRCommand("View") - clsDate.SetRCommand("as.Date") UpdateRFunctionDataFrameParameters() End Sub @@ -549,8 +545,6 @@ Public Class frmEditor clsUnfreezeColumns.AddParameter("data_name", Chr(34) & grdCurrSheet.Name & Chr(34)) clsGetDataFrame.AddParameter("data_name", Chr(34) & grdCurrSheet.Name & Chr(34)) clsConvertOrderedFactor.AddParameter("data_name", Chr(34) & grdCurrSheet.Name & Chr(34)) - clsDuplicate.AddParameter("data_name", Chr(34) & grdCurrSheet.Name & Chr(34)) - End If End Sub @@ -643,19 +637,16 @@ Public Class frmEditor End Sub Private Sub mnuConvertDate_Click(sender As Object, e As EventArgs) Handles mnuConvertToDate.Click - clsDate.AddParameter("x", SelectedColumns()) - frmMain.clsRLink.RunScript(clsDate.ToScript, strComment:="Right Click Menu: Convert to Date") + dlgMakeDate.ShowDialog() End Sub Private Sub mnuCovertToOrderedFactors_Click(sender As Object, e As EventArgs) Handles mnuCovertToOrderedFactors.Click - clsConvertOrderedFactor.AddParameter("col_names", ) + clsConvertOrderedFactor.AddParameter("col_names", SelectedColumns()) clsConvertOrderedFactor.AddParameter("to_type", Chr(34) & "ordered_factor" & Chr(34)) frmMain.clsRLink.RunScript(clsConvertOrderedFactor.ToScript, strComment:="Right Click Menu: Convert to Ordered Factor") End Sub Private Sub mnuDuplicateColumn_Click(sender As Object, e As EventArgs) Handles mnuDuplicateColumn.Click - clsDuplicate.AddParameter("col_data", SelectedColumns()) - clsDuplicate.AddParameter("col_name") - frmMain.clsRLink.RunScript(clsDuplicate.ToScript, strComment:="Right Click Menu: Duplicate column(s)") + dlgDuplicateColumns.ShowDialog() End Sub End Class From 86e70424d83456cefec9a3913ab7075b2037c410 Mon Sep 17 00:00:00 2001 From: maxwell fundi Date: Wed, 4 Jan 2017 08:02:59 +0300 Subject: [PATCH 10/27] Adding icall types for graphs --- instat/dlgBarAndPieChart.vb | 1 + instat/dlgBoxPlot.vb | 2 +- instat/dlgCombineforGraphics.vb | 1 + instat/dlgCumulativeDistribution.vb | 1 + instat/dlgDotPlot.vb | 1 + instat/dlgGeneralForGraphics.vb | 1 + instat/dlgHistogram.vb | 1 + instat/dlgOneVariableGraph.vb | 1 + instat/dlgPlot.vb | 2 +- instat/dlgPopulationPyramids.vb | 1 + instat/dlgRugPlot.vb | 1 + instat/dlgScatterPlot.vb | 1 + instat/dlgSummaryBarOrPieChart.vb | 1 + instat/dlgUseGraph.vb | 2 ++ instat/dlgWindrose.vb | 1 + 15 files changed, 16 insertions(+), 2 deletions(-) diff --git a/instat/dlgBarAndPieChart.vb b/instat/dlgBarAndPieChart.vb index d07cda7f162..fc961cc6b05 100644 --- a/instat/dlgBarAndPieChart.vb +++ b/instat/dlgBarAndPieChart.vb @@ -68,6 +68,7 @@ Public Class dlgBarAndPieChart ucrSaveBar.SetDataFrameSelector(ucrBarChartSelector.ucrAvailableDataFrames) ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False ucrSaveBar.strPrefix = "Bar" + ucrBase.clsRsyntax.iCallType = 3 End Sub Private Sub ReopenDialog() diff --git a/instat/dlgBoxPlot.vb b/instat/dlgBoxPlot.vb index d517c707747..a26ff77b083 100644 --- a/instat/dlgBoxPlot.vb +++ b/instat/dlgBoxPlot.vb @@ -89,7 +89,7 @@ Public Class dlgBoxplot ucrSaveBoxplot.SetDataFrameSelector(ucrSelectorBoxPlot.ucrAvailableDataFrames) - + ucrBase.clsRsyntax.iCallType = 3 End Sub Private Sub TestOkEnabled() diff --git a/instat/dlgCombineforGraphics.vb b/instat/dlgCombineforGraphics.vb index 817520f5e11..2fe4ea829da 100644 --- a/instat/dlgCombineforGraphics.vb +++ b/instat/dlgCombineforGraphics.vb @@ -38,6 +38,7 @@ Public Class dlgCombineforGraphics ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False ucrBase.clsRsyntax.SetFunction("gridExtra::grid.arrange") ucrCombineGraphReceiver.strSelectorHeading = "Graphs" + ucrBase.clsRsyntax.iCallType = 3 End Sub Private Sub SetDefaults() diff --git a/instat/dlgCumulativeDistribution.vb b/instat/dlgCumulativeDistribution.vb index 42f30871b04..507e76d4c94 100644 --- a/instat/dlgCumulativeDistribution.vb +++ b/instat/dlgCumulativeDistribution.vb @@ -54,6 +54,7 @@ Public Class dlgCumulativeDistribution ucrSaveCumDist.SetDataFrameSelector(ucrCumDistSelector.ucrAvailableDataFrames) ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False + ucrBase.clsRsyntax.iCallType = 3 End Sub Private Sub SetDefaults() diff --git a/instat/dlgDotPlot.vb b/instat/dlgDotPlot.vb index b7f6b1be430..68e96c7435b 100644 --- a/instat/dlgDotPlot.vb +++ b/instat/dlgDotPlot.vb @@ -61,6 +61,7 @@ Public Class dlgDotPlot ucrSaveDotPlot.SetDataFrameSelector(ucrDotPlotSelector.ucrAvailableDataFrames) ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False + ucrBase.clsRsyntax.iCallType = 3 End Sub diff --git a/instat/dlgGeneralForGraphics.vb b/instat/dlgGeneralForGraphics.vb index 5562f390d4a..492e1179f17 100644 --- a/instat/dlgGeneralForGraphics.vb +++ b/instat/dlgGeneralForGraphics.vb @@ -52,6 +52,7 @@ Public Class dlgGeneralForGraphics ucrAdditionalLayers.SetGGplotFunction(clsRggplotFunction) ucrAdditionalLayers.SetAesFunction(clsGgplotAesFunction) ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False + ucrBase.clsRsyntax.iCallType = 3 'By default, we want to put in the script the output of our Base R-command (in this case the ...+...+...) even when it has been assigned to some object (in which case we want the name of that object in the script so that it's called when the script is run). 'For example, when a graph is saved, it is assigned to it's place in an R-instat object. If we had set bExcludeAssignedFunctionOutput to True, then we would never print the graph when running the script. diff --git a/instat/dlgHistogram.vb b/instat/dlgHistogram.vb index c4f62149bd8..d756dffa0c4 100644 --- a/instat/dlgHistogram.vb +++ b/instat/dlgHistogram.vb @@ -57,6 +57,7 @@ Public Class dlgHistogram ucrSaveHist.SetDataFrameSelector(ucrHistogramSelector.ucrAvailableDataFrames) ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False + ucrBase.clsRsyntax.iCallType = 3 End Sub Private Sub ucrHistogramSelector_DataFrameChanged() Handles ucrHistogramSelector.DataFrameChanged diff --git a/instat/dlgOneVariableGraph.vb b/instat/dlgOneVariableGraph.vb index 8257417a6ee..3eb3496b53e 100644 --- a/instat/dlgOneVariableGraph.vb +++ b/instat/dlgOneVariableGraph.vb @@ -79,6 +79,7 @@ Public Class dlgOneVariableGraph ucrOneVarGraphSave.strPrefix = "OneVariableGraph" ucrOneVarGraphSave.SetDataFrameSelector(ucrSelectorOneVarGraph.ucrAvailableDataFrames) ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False + ucrBase.clsRsyntax.iCallType = 3 End Sub Private Sub ReopenDialog() diff --git a/instat/dlgPlot.vb b/instat/dlgPlot.vb index eeddda98d35..0e29809255e 100644 --- a/instat/dlgPlot.vb +++ b/instat/dlgPlot.vb @@ -64,7 +64,7 @@ Public Class dlgPlot ucrSaveLinePlot.SetDataFrameSelector(ucrLinePlotSelector.ucrAvailableDataFrames) ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False - + ucrBase.clsRsyntax.iCallType = 3 End Sub Private Sub SetDefaults() diff --git a/instat/dlgPopulationPyramids.vb b/instat/dlgPopulationPyramids.vb index d34b808c8c3..ad067828c8f 100644 --- a/instat/dlgPopulationPyramids.vb +++ b/instat/dlgPopulationPyramids.vb @@ -57,6 +57,7 @@ Public Class dlgPopulationPyramids ucrXVariableReceiver.Selector = ucrPopulationPyramidselector ucrYVariableReceiver.Selector = ucrPopulationPyramidselector ucrSecondFactorReceiver.Selector = ucrPopulationPyramidselector + ucrBase.clsRsyntax.iCallType = 3 End Sub diff --git a/instat/dlgRugPlot.vb b/instat/dlgRugPlot.vb index 98f9ac5524e..172436c8cef 100644 --- a/instat/dlgRugPlot.vb +++ b/instat/dlgRugPlot.vb @@ -89,6 +89,7 @@ Public Class dlgRugPlot ucrSaveRugPlot.SetDataFrameSelector(ucrRugPlotSelector.ucrAvailableDataFrames) ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False + ucrBase.clsRsyntax.iCallType = 3 End Sub Private Sub SetDefaults() diff --git a/instat/dlgScatterPlot.vb b/instat/dlgScatterPlot.vb index 20bb7337c4c..49e41d8a303 100644 --- a/instat/dlgScatterPlot.vb +++ b/instat/dlgScatterPlot.vb @@ -57,6 +57,7 @@ Public Class dlgScatterPlot ucrSaveScatterPlot.SetDataFrameSelector(ucrSelectorForScatter.ucrAvailableDataFrames) ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False + ucrBase.clsRsyntax.iCallType = 3 End Sub Private Sub SetDefaults() diff --git a/instat/dlgSummaryBarOrPieChart.vb b/instat/dlgSummaryBarOrPieChart.vb index 0a1289c505f..fa124820f29 100644 --- a/instat/dlgSummaryBarOrPieChart.vb +++ b/instat/dlgSummaryBarOrPieChart.vb @@ -63,6 +63,7 @@ Public Class dlgSummaryBarOrPieChart ucrSaveSummaryBar.ucrInputGraphName.SetItemsTypeAsGraphs() ucrSaveSummaryBar.ucrInputGraphName.SetDefaultTypeAsGraph() ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False + ucrBase.clsRsyntax.iCallType = 3 End Sub diff --git a/instat/dlgUseGraph.vb b/instat/dlgUseGraph.vb index 5c27c88fc06..4fb472478ba 100644 --- a/instat/dlgUseGraph.vb +++ b/instat/dlgUseGraph.vb @@ -48,6 +48,8 @@ Public Class dlgUseGraph ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False sdgPlots.SetRSyntax(ucrBase.clsRsyntax) ucrGraphReceiver.strSelectorHeading = "Graphs" + + ucrBase.clsRsyntax.iCallType = 3 End Sub Private Sub ReOpenDialog() diff --git a/instat/dlgWindrose.vb b/instat/dlgWindrose.vb index f443c18774c..129147c309d 100644 --- a/instat/dlgWindrose.vb +++ b/instat/dlgWindrose.vb @@ -54,6 +54,7 @@ Public Class dlgWindrose ucrFillReceiver.Selector = ucrWindRoseSelector ucrSaveWindRose.SetDataFrameSelector(ucrWindRoseSelector.ucrAvailableDataFrames) + ucrBase.clsRsyntax.iCallType = 3 End Sub Private Sub SetDefaults() From c9920b1f8505286993a148410d525e6abb8f00bb Mon Sep 17 00:00:00 2001 From: Lunalo Date: Wed, 4 Jan 2017 10:16:25 +0300 Subject: [PATCH 11/27] Editing dlgDuplicate Column --- instat/dlgDuplicateColumns.vb | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/instat/dlgDuplicateColumns.vb b/instat/dlgDuplicateColumns.vb index 8bbd3d87a2e..de17b4ba8e4 100644 --- a/instat/dlgDuplicateColumns.vb +++ b/instat/dlgDuplicateColumns.vb @@ -31,12 +31,18 @@ Public Class dlgDuplicateColumns Private Sub SetDefaults() ucrSelectorForDuplicateColumn.Reset() ucrInputColumnName.Reset() + ucrInputColumnName.SetPrefix(ucrReceiverForCopyColumns.GetVariableNames(False)) End Sub Private Sub initialiseDialog() 'sets the function ucrBase.clsRsyntax.SetFunction(frmMain.clsRLink.strInstatDataObject & "$add_columns_to_data") ucrReceiverForCopyColumns.Selector = ucrSelectorForDuplicateColumn ucrReceiverForCopyColumns.SetMeAsReceiver() + ucrInputColumnName.SetItemsTypeAsColumns() + ucrInputColumnName.SetDefaultTypeAsColumn() + ucrReceiverForCopyColumns.bUseFilteredData = False + ucrInputColumnName.SetDataFrameSelector(ucrSelectorForDuplicateColumn.ucrAvailableDataFrames) + ucrInputColumnName.SetValidationTypeAsRVariable() End Sub Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset @@ -51,20 +57,8 @@ Public Class dlgDuplicateColumns End If End Sub - Private Sub SetDefaultName() - Dim laschar As String = ucrReceiverForCopyColumns.GetVariableNames(False) - If Not IsNumeric(laschar.Substring(laschar.Length - 1)) Then - ucrInputColumnName.SetName(Chr(34) & laschar & 1 & Chr(34)) - - Else - Dim laschar1 As String = laschar.Remove(laschar.Substring(laschar.Length - 1)) - ucrInputColumnName.SetName(Chr(34) & laschar1 & Convert.ToInt32(laschar.Substring(laschar.Length - 1)) + 1 & Chr(34)) - End If - End Sub - Private Sub ucrReceiverForCopyColumns_SelectionChanged(sender As Object, e As EventArgs) Handles ucrReceiverForCopyColumns.SelectionChanged - SetDefaultName() - + ucrInputColumnName.SetPrefix(ucrReceiverForCopyColumns.GetVariableNames(False)) If Not ucrReceiverForCopyColumns.IsEmpty Then ucrBase.clsRsyntax.AddParameter("col_data", clsRFunctionParameter:=ucrReceiverForCopyColumns.GetVariables) Else @@ -79,7 +73,7 @@ Public Class dlgDuplicateColumns Private Sub ucrInputColumnName_NameChanged() Handles ucrInputColumnName.NameChanged If Not ucrInputColumnName.IsEmpty Then - ucrBase.clsRsyntax.AddParameter("col_name", ucrInputColumnName.GetText) + ucrBase.clsRsyntax.AddParameter("col_name", Chr(34) & ucrInputColumnName.GetText & Chr(34)) Else ucrBase.clsRsyntax.RemoveParameter("col_name") End If From 0ebf59ce0909cbd7dc29dbdf0f7d4e56083d8877 Mon Sep 17 00:00:00 2001 From: Lunalo Date: Wed, 4 Jan 2017 10:29:34 +0300 Subject: [PATCH 12/27] Edits on Duplicate Columns --- instat/dlgDuplicateColumns.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/dlgDuplicateColumns.vb b/instat/dlgDuplicateColumns.vb index de17b4ba8e4..51ef3845331 100644 --- a/instat/dlgDuplicateColumns.vb +++ b/instat/dlgDuplicateColumns.vb @@ -31,7 +31,6 @@ Public Class dlgDuplicateColumns Private Sub SetDefaults() ucrSelectorForDuplicateColumn.Reset() ucrInputColumnName.Reset() - ucrInputColumnName.SetPrefix(ucrReceiverForCopyColumns.GetVariableNames(False)) End Sub Private Sub initialiseDialog() 'sets the function @@ -46,6 +45,7 @@ Public Class dlgDuplicateColumns End Sub Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset + SetDefaults() TestOKEnabled() End Sub From c4d9665bb33e64c485a3179361ada043a65affb6 Mon Sep 17 00:00:00 2001 From: Lunalo Date: Wed, 4 Jan 2017 11:19:44 +0300 Subject: [PATCH 13/27] Adding rightClick for add all --- instat/ucrSelector.designer.vb | 136 +++++++++++++++++---------------- instat/ucrSelector.vb | 30 ++++++-- 2 files changed, 94 insertions(+), 72 deletions(-) diff --git a/instat/ucrSelector.designer.vb b/instat/ucrSelector.designer.vb index 6f8d7fb19d8..e7791e9c18f 100644 --- a/instat/ucrSelector.designer.vb +++ b/instat/ucrSelector.designer.vb @@ -22,73 +22,81 @@ Partial Class ucrSelector 'Do not modify it using the code editor. Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container() - Me.lstAvailableVariable = New System.Windows.Forms.ListView() - Me.SelectionMenuStrip = New System.Windows.Forms.ContextMenuStrip(Me.components) - Me.AddSelectedToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.SelectAllToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.ClearSelectionToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.SelectionMenuStrip.SuspendLayout() - Me.SuspendLayout() - ' - 'lstAvailableVariable - ' - Me.lstAvailableVariable.Activation = System.Windows.Forms.ItemActivation.TwoClick - Me.lstAvailableVariable.ContextMenuStrip = Me.SelectionMenuStrip - Me.lstAvailableVariable.Dock = System.Windows.Forms.DockStyle.Fill - Me.lstAvailableVariable.FullRowSelect = True - Me.lstAvailableVariable.GridLines = True - Me.lstAvailableVariable.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable - Me.lstAvailableVariable.HideSelection = False - Me.lstAvailableVariable.Location = New System.Drawing.Point(0, 0) - Me.lstAvailableVariable.Name = "lstAvailableVariable" - Me.lstAvailableVariable.Size = New System.Drawing.Size(120, 130) - Me.lstAvailableVariable.TabIndex = 83 - Me.lstAvailableVariable.UseCompatibleStateImageBehavior = False - Me.lstAvailableVariable.View = System.Windows.Forms.View.Details - ' - 'SelectionMenuStrip - ' - Me.SelectionMenuStrip.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.AddSelectedToolStripMenuItem, Me.SelectAllToolStripMenuItem, Me.ClearSelectionToolStripMenuItem}) - Me.SelectionMenuStrip.Name = "SelectionMenuStrip" - Me.SelectionMenuStrip.Size = New System.Drawing.Size(153, 70) - ' - 'AddSelectedToolStripMenuItem - ' - Me.AddSelectedToolStripMenuItem.Name = "AddSelectedToolStripMenuItem" - Me.AddSelectedToolStripMenuItem.Size = New System.Drawing.Size(152, 22) - Me.AddSelectedToolStripMenuItem.Tag = "Add_selected" - Me.AddSelectedToolStripMenuItem.Text = "Add Selected" - ' - 'SelectAllToolStripMenuItem - ' - Me.SelectAllToolStripMenuItem.Name = "SelectAllToolStripMenuItem" - Me.SelectAllToolStripMenuItem.Size = New System.Drawing.Size(152, 22) - Me.SelectAllToolStripMenuItem.Tag = "Select_All" - Me.SelectAllToolStripMenuItem.Text = "Select All" - ' - 'ClearSelectionToolStripMenuItem - ' - Me.ClearSelectionToolStripMenuItem.Name = "ClearSelectionToolStripMenuItem" - Me.ClearSelectionToolStripMenuItem.Size = New System.Drawing.Size(152, 22) - Me.ClearSelectionToolStripMenuItem.Tag = "Clear_Selection" - Me.ClearSelectionToolStripMenuItem.Text = "Clear Selection" - ' - 'ucrSelector - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.Controls.Add(Me.lstAvailableVariable) - Me.Margin = New System.Windows.Forms.Padding(0) - Me.Name = "ucrSelector" - Me.Size = New System.Drawing.Size(120, 130) - Me.SelectionMenuStrip.ResumeLayout(False) - Me.ResumeLayout(False) - + Me.components = New System.ComponentModel.Container() + Me.lstAvailableVariable = New System.Windows.Forms.ListView() + Me.SelectionMenuStrip = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.AddSelectedToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.SelectAllToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.ClearSelectionToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.AddAllToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.SelectionMenuStrip.SuspendLayout() + Me.SuspendLayout() + ' + 'lstAvailableVariable + ' + Me.lstAvailableVariable.Activation = System.Windows.Forms.ItemActivation.TwoClick + Me.lstAvailableVariable.ContextMenuStrip = Me.SelectionMenuStrip + Me.lstAvailableVariable.Dock = System.Windows.Forms.DockStyle.Fill + Me.lstAvailableVariable.FullRowSelect = True + Me.lstAvailableVariable.GridLines = True + Me.lstAvailableVariable.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable + Me.lstAvailableVariable.HideSelection = False + Me.lstAvailableVariable.Location = New System.Drawing.Point(0, 0) + Me.lstAvailableVariable.Name = "lstAvailableVariable" + Me.lstAvailableVariable.Size = New System.Drawing.Size(120, 130) + Me.lstAvailableVariable.TabIndex = 83 + Me.lstAvailableVariable.UseCompatibleStateImageBehavior = False + Me.lstAvailableVariable.View = System.Windows.Forms.View.Details + ' + 'SelectionMenuStrip + ' + Me.SelectionMenuStrip.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.AddSelectedToolStripMenuItem, Me.SelectAllToolStripMenuItem, Me.ClearSelectionToolStripMenuItem, Me.AddAllToolStripMenuItem}) + Me.SelectionMenuStrip.Name = "SelectionMenuStrip" + Me.SelectionMenuStrip.Size = New System.Drawing.Size(153, 114) + ' + 'AddSelectedToolStripMenuItem + ' + Me.AddSelectedToolStripMenuItem.Name = "AddSelectedToolStripMenuItem" + Me.AddSelectedToolStripMenuItem.Size = New System.Drawing.Size(152, 22) + Me.AddSelectedToolStripMenuItem.Tag = "Add_selected" + Me.AddSelectedToolStripMenuItem.Text = "Add Selected" + ' + 'SelectAllToolStripMenuItem + ' + Me.SelectAllToolStripMenuItem.Name = "SelectAllToolStripMenuItem" + Me.SelectAllToolStripMenuItem.Size = New System.Drawing.Size(152, 22) + Me.SelectAllToolStripMenuItem.Tag = "Select_All" + Me.SelectAllToolStripMenuItem.Text = "Select All" + ' + 'ClearSelectionToolStripMenuItem + ' + Me.ClearSelectionToolStripMenuItem.Name = "ClearSelectionToolStripMenuItem" + Me.ClearSelectionToolStripMenuItem.Size = New System.Drawing.Size(152, 22) + Me.ClearSelectionToolStripMenuItem.Tag = "Clear_Selection" + Me.ClearSelectionToolStripMenuItem.Text = "Clear Selection" + ' + 'AddAllToolStripMenuItem + ' + Me.AddAllToolStripMenuItem.Name = "AddAllToolStripMenuItem" + Me.AddAllToolStripMenuItem.Size = New System.Drawing.Size(152, 22) + Me.AddAllToolStripMenuItem.Text = "Add All" + ' + 'ucrSelector + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.lstAvailableVariable) + Me.Margin = New System.Windows.Forms.Padding(0) + Me.Name = "ucrSelector" + Me.Size = New System.Drawing.Size(120, 130) + Me.SelectionMenuStrip.ResumeLayout(False) + Me.ResumeLayout(False) + End Sub Protected Friend WithEvents lstAvailableVariable As ListView Friend WithEvents SelectionMenuStrip As ContextMenuStrip Friend WithEvents AddSelectedToolStripMenuItem As ToolStripMenuItem Friend WithEvents SelectAllToolStripMenuItem As ToolStripMenuItem - Friend WithEvents ClearSelectionToolStripMenuItem As ToolStripMenuItem + Friend WithEvents ClearSelectionToolStripMenuItem As ToolStripMenuItem + Friend WithEvents AddAllToolStripMenuItem As ToolStripMenuItem End Class diff --git a/instat/ucrSelector.vb b/instat/ucrSelector.vb index 81b5e299018..6885a817329 100644 --- a/instat/ucrSelector.vb +++ b/instat/ucrSelector.vb @@ -110,6 +110,13 @@ Public Class ucrSelector End If End Sub + Public Sub AddAll() + If CurrentReceiver IsNot Nothing AndAlso (lstAvailableVariable.SelectedItems.Count > 0) Then + Add() + CurrentReceiver.Focus() + End If + End Sub + Public Sub Add() If CurrentReceiver IsNot Nothing AndAlso (lstAvailableVariable.SelectedItems.Count > 0) Then CurrentReceiver.AddSelected() @@ -168,14 +175,7 @@ Public Class ucrSelector End Sub Private Sub SelectAllToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SelectAllToolStripMenuItem.Click - Dim lviTemp As ListViewItem - - lstAvailableVariable.BeginUpdate() - For Each lviTemp In lstAvailableVariable.Items - lviTemp.Selected = True - Next - lstAvailableVariable.EndUpdate() - + SelectAll() End Sub Public Sub AddToVariablesList(strVariable As String) @@ -295,4 +295,18 @@ Public Class ucrSelector Next Return False End Function + + Private Sub AddAllToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AddAllToolStripMenuItem.Click + SelectAll() + AddAll() + End Sub + + Private Sub SelectAll() + Dim lviTemp As ListViewItem + lstAvailableVariable.BeginUpdate() + For Each lviTemp In lstAvailableVariable.Items + lviTemp.Selected = True + Next + lstAvailableVariable.EndUpdate() + End Sub End Class \ No newline at end of file From b143d261cb5d93ff121d90e0f3fb8098b6724765 Mon Sep 17 00:00:00 2001 From: maxwell fundi Date: Wed, 4 Jan 2017 11:52:13 +0300 Subject: [PATCH 14/27] Adding frmGraphDisplay --- instat/frmGraphDisplay.Designer.vb | 38 +++++++++ instat/frmGraphDisplay.resx | 120 +++++++++++++++++++++++++++++ instat/frmGraphDisplay.vb | 5 ++ instat/frmMain.vb | 1 + instat/instat.vbproj | 9 +++ 5 files changed, 173 insertions(+) create mode 100644 instat/frmGraphDisplay.Designer.vb create mode 100644 instat/frmGraphDisplay.resx create mode 100644 instat/frmGraphDisplay.vb diff --git a/instat/frmGraphDisplay.Designer.vb b/instat/frmGraphDisplay.Designer.vb new file mode 100644 index 00000000000..3989f72315f --- /dev/null +++ b/instat/frmGraphDisplay.Designer.vb @@ -0,0 +1,38 @@ + +Partial Class frmGraphDisplay + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + + Private Sub InitializeComponent() + Me.SuspendLayout() + ' + 'frmGraphDisplay + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(483, 412) + Me.Name = "frmGraphDisplay" + Me.ShowIcon = False + Me.Text = "Graph Display" + Me.ResumeLayout(False) + + End Sub +End Class diff --git a/instat/frmGraphDisplay.resx b/instat/frmGraphDisplay.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/instat/frmGraphDisplay.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/instat/frmGraphDisplay.vb b/instat/frmGraphDisplay.vb new file mode 100644 index 00000000000..c2114ba9831 --- /dev/null +++ b/instat/frmGraphDisplay.vb @@ -0,0 +1,5 @@ +Public Class frmGraphDisplay + Private Sub frmGraphDisplay_Load(sender As Object, e As EventArgs) Handles MyBase.Load + + End Sub +End Class \ No newline at end of file diff --git a/instat/frmMain.vb b/instat/frmMain.vb index df32c36afaf..46edc416d27 100644 --- a/instat/frmMain.vb +++ b/instat/frmMain.vb @@ -58,6 +58,7 @@ Public Class frmMain frmScript.MdiParent = Me frmVariables.MdiParent = Me frmMetaData.MdiParent = Me + frmGraphDisplay.MdiParent = Me strStaticPath = Path.GetFullPath("static") strHelpFilePath = "Help\R-Instat.chm" strAppDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "RInstat\") diff --git a/instat/instat.vbproj b/instat/instat.vbproj index bce2566591d..b2ba362ac41 100644 --- a/instat/instat.vbproj +++ b/instat/instat.vbproj @@ -298,6 +298,12 @@ Form + + frmGraphDisplay.vb + + + Form + frmOutputWindow.vb @@ -2862,6 +2868,9 @@ dlgColumnStructures.vb + + frmGraphDisplay.vb + frmOutputWindow.vb From 13aad07d6c7f0bb56f26c5dbd656263f3597789c Mon Sep 17 00:00:00 2001 From: Danny Parsons Date: Wed, 4 Jan 2017 11:22:53 +0000 Subject: [PATCH 15/27] fixed bug in define filter --- instat/ucrFilter.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/ucrFilter.vb b/instat/ucrFilter.vb index 2286e5db892..82d7668938d 100644 --- a/instat/ucrFilter.vb +++ b/instat/ucrFilter.vb @@ -133,7 +133,7 @@ Public Class ucrFilter clsConditionsList.AddParameter("C" & clsConditionsList.clsParameters.Count, clsRFunctionParameter:=(clsCurrentConditionList)) lviCondition = New ListViewItem({ucrFilterByReceiver.GetVariableNames(), clsCurrentConditionView.strOperation & " " & strCondition}) lstFilters.Items.Add(lviCondition) - If clsFilterView.clsParameters(0).clsArgumentCodeStructure Is Nothing Then + If clsFilterView.clsParameters.Count = 0 Then clsFilterView.AddParameter(iPosition:=0, clsROperatorParameter:=(clsCurrentConditionView)) Else clsFilterView.AddParameter(strParameterName:="Condition" & clsFilterView.clsParameters.Count - 1, clsROperatorParameter:=(clsCurrentConditionView)) From 53e0407208371466f181dd72d1cbc32117bc50dc Mon Sep 17 00:00:00 2001 From: Lunalo Date: Wed, 4 Jan 2017 14:33:06 +0300 Subject: [PATCH 16/27] Edits on Duplicate Column --- instat/dlgDuplicateColumns.vb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/instat/dlgDuplicateColumns.vb b/instat/dlgDuplicateColumns.vb index 51ef3845331..6cf436b232e 100644 --- a/instat/dlgDuplicateColumns.vb +++ b/instat/dlgDuplicateColumns.vb @@ -58,12 +58,14 @@ Public Class dlgDuplicateColumns End Sub Private Sub ucrReceiverForCopyColumns_SelectionChanged(sender As Object, e As EventArgs) Handles ucrReceiverForCopyColumns.SelectionChanged - ucrInputColumnName.SetPrefix(ucrReceiverForCopyColumns.GetVariableNames(False)) If Not ucrReceiverForCopyColumns.IsEmpty Then ucrBase.clsRsyntax.AddParameter("col_data", clsRFunctionParameter:=ucrReceiverForCopyColumns.GetVariables) Else ucrBase.clsRsyntax.RemoveParameter("col_data") End If + If ucrInputColumnName.IsEmpty Then + ucrInputColumnName.SetPrefix(ucrReceiverForCopyColumns.GetVariableNames(False)) + End If TestOKEnabled() End Sub @@ -72,11 +74,15 @@ Public Class dlgDuplicateColumns End Sub Private Sub ucrInputColumnName_NameChanged() Handles ucrInputColumnName.NameChanged + ColName() + TestOKEnabled() + End Sub + + Private Sub ColName() If Not ucrInputColumnName.IsEmpty Then ucrBase.clsRsyntax.AddParameter("col_name", Chr(34) & ucrInputColumnName.GetText & Chr(34)) Else ucrBase.clsRsyntax.RemoveParameter("col_name") End If - TestOKEnabled() End Sub End Class \ No newline at end of file From 6610329e41d53eae24fbedf476f64b9a0eae2092 Mon Sep 17 00:00:00 2001 From: Lunalo Date: Wed, 4 Jan 2017 14:47:06 +0300 Subject: [PATCH 17/27] Fixing for bUserTyped --- instat/dlgDuplicateColumns.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/dlgDuplicateColumns.vb b/instat/dlgDuplicateColumns.vb index 6cf436b232e..a46d46d21e1 100644 --- a/instat/dlgDuplicateColumns.vb +++ b/instat/dlgDuplicateColumns.vb @@ -63,7 +63,7 @@ Public Class dlgDuplicateColumns Else ucrBase.clsRsyntax.RemoveParameter("col_data") End If - If ucrInputColumnName.IsEmpty Then + If Not ucrInputColumnName.bUserTyped Then ucrInputColumnName.SetPrefix(ucrReceiverForCopyColumns.GetVariableNames(False)) End If TestOKEnabled() From 81fe1f9493e9a445e3e75e3ba57ee5ee619c6e3b Mon Sep 17 00:00:00 2001 From: Lunalo Date: Wed, 4 Jan 2017 15:07:43 +0300 Subject: [PATCH 18/27] Rearranging code for ucrSelector --- instat/ucrSelector.vb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/instat/ucrSelector.vb b/instat/ucrSelector.vb index 6885a817329..b580f0dc424 100644 --- a/instat/ucrSelector.vb +++ b/instat/ucrSelector.vb @@ -112,8 +112,8 @@ Public Class ucrSelector Public Sub AddAll() If CurrentReceiver IsNot Nothing AndAlso (lstAvailableVariable.SelectedItems.Count > 0) Then + SelectAll() Add() - CurrentReceiver.Focus() End If End Sub @@ -297,7 +297,6 @@ Public Class ucrSelector End Function Private Sub AddAllToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AddAllToolStripMenuItem.Click - SelectAll() AddAll() End Sub From aebcdf2da72978a69feee2e745142d0a55f35db1 Mon Sep 17 00:00:00 2001 From: Danny Parsons Date: Wed, 4 Jan 2017 12:18:17 +0000 Subject: [PATCH 19/27] fixed bug with deleting sheets not refreshing --- instat/frmEditor.vb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/instat/frmEditor.vb b/instat/frmEditor.vb index f5b250591ad..af6c6db9230 100644 --- a/instat/frmEditor.vb +++ b/instat/frmEditor.vb @@ -301,6 +301,9 @@ Public Class frmEditor Private Sub grdData_WorksheetRemoved(sender As Object, e As WorksheetRemovedEventArgs) Handles grdData.WorksheetRemoved If grdData.Worksheets.Count < 1 Then grdData.Hide() + ElseIf grdCurrSheet.Equals(e.Worksheet) Then + UpdateCurrentWorksheet() + grdData.Refresh() End If End Sub @@ -310,6 +313,10 @@ Public Class frmEditor End Sub Private Sub grdData_CurrentWorksheetChanged(sender As Object, e As EventArgs) Handles grdData.CurrentWorksheetChanged, Me.Load, grdData.WorksheetInserted + UpdateCurrentWorksheet() + End Sub + + Private Sub UpdateCurrentWorksheet() grdCurrSheet = grdData.CurrentWorksheet frmMain.strCurrentDataFrame = grdCurrSheet.Name frmMain.tstatus.Text = grdCurrSheet.Name From 5dfec92cbf850d8c543dec6d35c59a2fe0bb3fcd Mon Sep 17 00:00:00 2001 From: Lunalo Date: Wed, 4 Jan 2017 15:25:03 +0300 Subject: [PATCH 20/27] Renaming InitialiseDialog sub --- instat/dlgDuplicateColumns.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instat/dlgDuplicateColumns.vb b/instat/dlgDuplicateColumns.vb index a46d46d21e1..38c2481d2ed 100644 --- a/instat/dlgDuplicateColumns.vb +++ b/instat/dlgDuplicateColumns.vb @@ -20,7 +20,7 @@ Public Class dlgDuplicateColumns Private Sub dlgCopySheet_Load(sender As Object, e As EventArgs) Handles Me.Load autoTranslate(Me) If bFirstLoad Then - initialiseDialog() + InitialiseDialog() SetDefaults() bFirstLoad = False End If @@ -32,7 +32,7 @@ Public Class dlgDuplicateColumns ucrSelectorForDuplicateColumn.Reset() ucrInputColumnName.Reset() End Sub - Private Sub initialiseDialog() + Private Sub InitialiseDialog() 'sets the function ucrBase.clsRsyntax.SetFunction(frmMain.clsRLink.strInstatDataObject & "$add_columns_to_data") ucrReceiverForCopyColumns.Selector = ucrSelectorForDuplicateColumn From be9c6083c9462b65f077e1b218a10df4f5bba3ab Mon Sep 17 00:00:00 2001 From: Danny Parsons Date: Wed, 4 Jan 2017 12:58:14 +0000 Subject: [PATCH 21/27] fixed default for numeric columns in one var graph --- instat/dlgOneVariableGraph.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/dlgOneVariableGraph.vb b/instat/dlgOneVariableGraph.vb index 3eb3496b53e..5e10c908ff9 100644 --- a/instat/dlgOneVariableGraph.vb +++ b/instat/dlgOneVariableGraph.vb @@ -57,7 +57,7 @@ Public Class dlgOneVariableGraph Private Sub InitialiseDialog() 'Define the default RFunction clsDefaultRFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$graph_one_variable") - clsDefaultRFunction.AddParameter("numeric", Chr(34) & "violin_jitter" & Chr(34)) + clsDefaultRFunction.AddParameter("numeric", Chr(34) & "geom_boxplot" & Chr(34)) clsDefaultRFunction.AddParameter("categorical", Chr(34) & "geom_bar" & Chr(34)) 'This currently has no effect on controls as there is no radio button user control yet clsDefaultRFunction.AddParameter("output", Chr(34) & "facets" & Chr(34)) From 2f1813e2f9dabb1655628263f9f73f0d59e8064c Mon Sep 17 00:00:00 2001 From: Danny Parsons Date: Wed, 4 Jan 2017 13:11:38 +0000 Subject: [PATCH 22/27] adding code to calculations dialog --- instat/dlgCalculationsSummary.vb | 5 +- instat/sdgCalculationsSummmary.vb | 80 +++++++++++-------------------- 2 files changed, 30 insertions(+), 55 deletions(-) diff --git a/instat/dlgCalculationsSummary.vb b/instat/dlgCalculationsSummary.vb index 437f4de7800..6b9d7cf4d7e 100644 --- a/instat/dlgCalculationsSummary.vb +++ b/instat/dlgCalculationsSummary.vb @@ -36,12 +36,11 @@ Public Class dlgCalculationsSummary End Sub Private Sub SetDefaults() - cmdEdit.Enabled = False - cmdDuplicate.Enabled = False End Sub Private Sub InitialiseDialog() - + cmdEdit.Enabled = False + cmdDuplicate.Enabled = False End Sub Private Sub cmdAdd_Click(sender As Object, e As EventArgs) Handles cmdAdd.Click diff --git a/instat/sdgCalculationsSummmary.vb b/instat/sdgCalculationsSummmary.vb index cd4d71c9f16..c1bf9995ba0 100644 --- a/instat/sdgCalculationsSummmary.vb +++ b/instat/sdgCalculationsSummmary.vb @@ -16,8 +16,9 @@ Imports instat.Translations Public Class sdgCalculationsSummmary Public bFirstLoad As Boolean = True - Public clsRFunction As New RFunction + Private clsCalculationFunction As New RFunction Dim lstType As New List(Of KeyValuePair(Of String, String)) + Private Sub sdgCalculationsSummmary_Load(sender As Object, e As EventArgs) Handles MyBase.Load autoTranslate(Me) If bFirstLoad Then @@ -29,20 +30,22 @@ Public Class sdgCalculationsSummmary Private Sub InitialiseDialog() ' Set Items in ucrType + ucrType.SetItems({"calculation", "summary", "by", "filter"}) ' and combine ucrReceiverBy.Selector = ucrSelectorBy ucrReceiverBy.SetMeAsReceiver() ucrReceiverBy.SetDataType("factor") - lstType.Add(New KeyValuePair(Of String, String)("Calculation", Chr(34) & "calculation" & Chr(34))) - lstType.Add(New KeyValuePair(Of String, String)("Summary", Chr(34) & "summary" & Chr(34))) - lstType.Add(New KeyValuePair(Of String, String)("By", Chr(34) & "by" & Chr(34))) - lstType.Add(New KeyValuePair(Of String, String)("Filter", Chr(34) & "filter" & Chr(34))) - ' lstType.Add(New KeyValuePair(Of String, String)("Combine", Chr(34) & "combination" & Chr(34))) - ucrType.SetItems(lstType) - ucrType.SetParameterName("type") + ' This is the new way of using this control. Not needed yet + 'lstType.Add(New KeyValuePair(Of String, String)("Calculation", Chr(34) & "calculation" & Chr(34))) + 'lstType.Add(New KeyValuePair(Of String, String)("Summary", Chr(34) & "summary" & Chr(34))) + 'lstType.Add(New KeyValuePair(Of String, String)("By", Chr(34) & "by" & Chr(34))) + 'lstType.Add(New KeyValuePair(Of String, String)("Filter", Chr(34) & "filter" & Chr(34))) + 'lstType.Add(New KeyValuePair(Of String, String)("Combine", Chr(34) & "combination" & Chr(34))) + 'ucrType.SetItems(lstType) + 'ucrType.SetParameterName("type") - clsRFunction.SetAssignTo(ucrCalculationName.ToString()) + clsCalculationFunction.SetAssignTo(ucrCalculationName.ToString()) End Sub Private Sub SetDefaults() @@ -53,6 +56,10 @@ Public Class sdgCalculationsSummmary rdoDoNotSave.Checked = True End Sub + Public Sub SetCalculationFunction(clsNewCalcFunction As RFunction) + clsCalculationFunction = clsNewCalcFunction + End Sub + Private Sub DisplayOptions() If ucrType.GetText = "calculation" OrElse ucrType.GetText = "summary" Then ucrSelectorBy.Visible = False @@ -89,52 +96,13 @@ Public Class sdgCalculationsSummmary End If End Sub - Private Sub ucrType_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ucrType.TextChanged - DisplayOptions() - End Sub - - Private Sub RunType() - If ucrType.GetText = "calculation" Then - TypeCalculate() - ElseIf ucrType.GetText = "summary" Then - TypeSummary() - ElseIf ucrType.GetText = "by" Then - TypeBy() - ElseIf ucrType.GetText = "filter" Then - TypeFilter() - Else - ' combine options - End If - End Sub - - Private Sub TypeBy() - ' clsRType.AddParameter("calculated_from", "list(" & ucrSelectorBy.ucrAvailableDataFrames.cboAvailableDataFrames.Text & "=" & ucrReceiverBy.GetVariableNames() & ")") - ' I believe that the variable names automatically have chr(34) around them - ' not sure about calculation name - this is what is displayed in the item box in the dlg. - End Sub - - Private Sub TypeFilter() - End Sub - - Private Sub TypeCalculate() - ' clsRCalculation.AddParameter("result_name", Chr(34) & ucrCalculationName.ToString & Chr(34)) - ' clsRCalculation.AddParameter("calculated_from", "list(" & ucrCalcSummary.ucrSelectorForCalculations.ucrAvailableDataFrames.cboAvailableDataFrames.Text & "=" & ucrCalcSummary.ucrReceiverForCalculation.GetVariableNames() & ")") - ' clsRCalculation.AddParameter("function_exp", Chr(34) & ucrCalcSummary.ucrReceiverForCalculation.ToString() & Chr(34)) - End Sub - - Private Sub TypeSummary() - ' clsRSummary.AddParameter("result_name", Chr(34) & ucrCalculationName.ToString & Chr(34)) - ' clsRSummary.AddParameter("calculated_from", "list(" & ucrCalcSummary.ucrSelectorForCalculations.ucrAvailableDataFrames.cboAvailableDataFrames.Text & "=" & ucrCalcSummary.ucrReceiverForCalculation.GetVariableNames() & ")") - ' clsRSummary.AddParameter("function_exp", Chr(34) & ucrCalcSummary.ucrReceiverForCalculation.ToString() & Chr(34)) - End Sub - Private Sub rdoSaveOptions_CheckedChanged(sender As Object, e As EventArgs) Handles rdoDoNotSave.CheckedChanged, rdoSaveCalculation.CheckedChanged, rdoSaveCalcAndResult.CheckedChanged If rdoSaveCalculation.Checked Then - clsRFunction.AddParameter("save", "1") + clsCalculationFunction.AddParameter("save", "1") ElseIf rdoSaveCalcAndResult.Checked Then - clsRFunction.AddParameter("save", "2") + clsCalculationFunction.AddParameter("save", "2") Else - clsRFunction.AddParameter("save", "0") + clsCalculationFunction.AddParameter("save", "0") End If End Sub @@ -145,9 +113,17 @@ Public Class sdgCalculationsSummmary ' We want to have that this opens a dialog which only shows filter and by as options in type ' Sub Calculations Tab + ' We want to have that this opens a dialog which only shows calculations and summary (and combine) as options in type Private Sub cmdSubAdd_Click(sender As Object, e As EventArgs) Handles cmdSubAdd.Click End Sub - ' We want to have that this opens a dialog which only shows calculations and summary (and combine) as options in type + Private Sub ucrType_NameChanged() Handles ucrType.NameChanged + DisplayOptions() + If ucrType.IsEmpty Then + clsCalculationFunction.RemoveParameterByName("type") + Else + clsCalculationFunction.AddParameter("type", Chr(34) & ucrType.GetText() & Chr(34)) + End If + End Sub End Class \ No newline at end of file From c34aef81fb4902ba5a01d3af535b9bb474cc814c Mon Sep 17 00:00:00 2001 From: Lunalo Date: Wed, 4 Jan 2017 16:16:31 +0300 Subject: [PATCH 23/27] Implementing keyboard shortcut for highlighting text in the selector --- instat/ucrSelector.vb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/instat/ucrSelector.vb b/instat/ucrSelector.vb index b580f0dc424..08eb78cdabb 100644 --- a/instat/ucrSelector.vb +++ b/instat/ucrSelector.vb @@ -160,6 +160,10 @@ Public Class ucrSelector If e.KeyChar = vbCr Then Add() End If + If Keys.ControlKey AndAlso Keys.A Then + SelectAll() + End If + End Sub Private Sub ucrSelector_ResetAll() Handles Me.ResetAll From bf15963d8cd441471cf38ee24b2ab02b456e2324 Mon Sep 17 00:00:00 2001 From: Danny Parsons Date: Wed, 4 Jan 2017 14:12:23 +0000 Subject: [PATCH 24/27] basic code on dialogs --- instat/dlgCalculationsSummary.vb | 25 ++++++++++++++++- instat/sdgCalculationsSummmary.vb | 45 +++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 1 deletion(-) diff --git a/instat/dlgCalculationsSummary.vb b/instat/dlgCalculationsSummary.vb index 6b9d7cf4d7e..2902209127c 100644 --- a/instat/dlgCalculationsSummary.vb +++ b/instat/dlgCalculationsSummary.vb @@ -15,6 +15,8 @@ ' along with this program. If not, see . Public Class dlgCalculationsSummary Public bFirstLoad As Boolean = True + Private lstCalculations As New List(Of KeyValuePair(Of String, RFunction)) + Private Sub dlgCalculationsSummary_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstLoad Then SetDefaults() @@ -32,7 +34,11 @@ Public Class dlgCalculationsSummary End Sub Private Sub TestOKEnabled() - + If lstLayers.Items.Count > 0 Then + ucrBase.OKEnabled(True) + Else + ucrBase.OKEnabled(False) + End If End Sub Private Sub SetDefaults() @@ -44,6 +50,23 @@ Public Class dlgCalculationsSummary End Sub Private Sub cmdAdd_Click(sender As Object, e As EventArgs) Handles cmdAdd.Click + Dim clsCalcFunction As New RFunction + + clsCalcFunction.SetRCommand("instat_calculation$new") + sdgCalculationsSummmary.SetCalculationFunction(clsCalcFunction) sdgCalculationsSummmary.ShowDialog() + If clsCalcFunction.clsParameters.FindIndex(Function(x) x.strArgumentName = "name") Then + lstLayers.Items.Add(clsCalcFunction.clsParameters.Find(Function(x) x.strArgumentName = "name").strArgumentValue) + Else + lstLayers.Items.Add("calc" & lstLayers.Items.Count + 1) + End If + lstCalculations.Add(New KeyValuePair(Of String, RFunction)(lstLayers.Items(lstLayers.Items.Count - 1).Text, clsCalcFunction.Clone())) + TestOKEnabled() + End Sub + + Private Sub ucrBase_ClickOk(sender As Object, e As EventArgs) Handles ucrBase.ClickOk + For i = 0 To lstCalculations.Count + frmMain.clsRLink.RunScript(lstCalculations(i).Value.ToScript()) + Next End Sub End Class \ No newline at end of file diff --git a/instat/sdgCalculationsSummmary.vb b/instat/sdgCalculationsSummmary.vb index c1bf9995ba0..652d7dc18f7 100644 --- a/instat/sdgCalculationsSummmary.vb +++ b/instat/sdgCalculationsSummmary.vb @@ -17,6 +17,7 @@ Imports instat.Translations Public Class sdgCalculationsSummmary Public bFirstLoad As Boolean = True Private clsCalculationFunction As New RFunction + Private clsCalcFromList As New RFunction Dim lstType As New List(Of KeyValuePair(Of String, String)) Private Sub sdgCalculationsSummmary_Load(sender As Object, e As EventArgs) Handles MyBase.Load @@ -36,6 +37,7 @@ Public Class sdgCalculationsSummmary ucrReceiverBy.SetMeAsReceiver() ucrReceiverBy.SetDataType("factor") + clsCalcFromList.SetRCommand("list") ' This is the new way of using this control. Not needed yet 'lstType.Add(New KeyValuePair(Of String, String)("Calculation", Chr(34) & "calculation" & Chr(34))) 'lstType.Add(New KeyValuePair(Of String, String)("Summary", Chr(34) & "summary" & Chr(34))) @@ -126,4 +128,47 @@ Public Class sdgCalculationsSummmary clsCalculationFunction.AddParameter("type", Chr(34) & ucrType.GetText() & Chr(34)) End If End Sub + + Private Sub ucrCalcSummary_SelectionChanged() Handles ucrCalcSummary.SelectionChanged + Dim strCalcFromList As String + Dim strColumn As String + + If Not ucrCalcSummary.ucrReceiverForCalculation.IsEmpty Then + clsCalculationFunction.AddParameter("function_exp", ucrCalcSummary.ucrReceiverForCalculation.GetText()) + Else + clsCalculationFunction.RemoveParameterByName("function_exp") + End If + + 'Need to do this instead of with RFunctions because the calculated_from list can have multiple items with the same label + If ucrCalcSummary.ucrSelectorForCalculations.lstVariablesInReceivers.Count > 0 Then + strCalcFromList = "list(" + For i = 0 To ucrCalcSummary.ucrSelectorForCalculations.lstVariablesInReceivers.Count - 1 + strColumn = ucrCalcSummary.ucrSelectorForCalculations.lstVariablesInReceivers(i) + If i > 0 Then + strCalcFromList = ", " & strCalcFromList + End If + strCalcFromList = strCalcFromList & ucrCalcSummary.ucrSelectorForCalculations.ucrAvailableDataFrames.cboAvailableDataFrames.Text & " = " & strColumn + Next + strCalcFromList = strCalcFromList & ")" + clsCalcFromList.AddParameter("calculated_from", strCalcFromList) + Else + clsCalcFromList.RemoveParameterByName("calculated_from") + End If + End Sub + + Private Sub ucrCalculationName_NameChanged() Handles ucrCalculationName.NameChanged + If ucrCalculationName.IsEmpty Then + clsCalculationFunction.RemoveParameterByName("name") + Else + clsCalculationFunction.AddParameter("name", ucrCalculationName.GetText()) + End If + End Sub + + Private Sub ucrColumnName_NameChanged() Handles ucrColumnName.NameChanged + If ucrColumnName.IsEmpty Then + clsCalculationFunction.RemoveParameterByName("result_name") + Else + clsCalculationFunction.AddParameter("result_name", ucrColumnName.GetText()) + End If + End Sub End Class \ No newline at end of file From 1ceda6472467bae81b8898c239b7629eb97011cf Mon Sep 17 00:00:00 2001 From: Danny Parsons Date: Wed, 4 Jan 2017 15:59:03 +0000 Subject: [PATCH 25/27] initial working on general summary dialog, and fixed bugs in calculator user control --- instat/dlgCalculationsSummary.vb | 44 +++++++++++-- instat/dlgCalculator.vb | 5 +- instat/sdgCalculationsSummmary.Designer.vb | 2 +- instat/sdgCalculationsSummmary.vb | 66 ++++++++++++------- .../R/Backend_Components/calculations.R | 7 ++ instat/ucrCalculator.vb | 14 ++++ 6 files changed, 104 insertions(+), 34 deletions(-) diff --git a/instat/dlgCalculationsSummary.vb b/instat/dlgCalculationsSummary.vb index 2902209127c..18bde0c8d67 100644 --- a/instat/dlgCalculationsSummary.vb +++ b/instat/dlgCalculationsSummary.vb @@ -16,17 +16,19 @@ Public Class dlgCalculationsSummary Public bFirstLoad As Boolean = True Private lstCalculations As New List(Of KeyValuePair(Of String, RFunction)) + Private clsApplyCalculation As New RFunction Private Sub dlgCalculationsSummary_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstLoad Then - SetDefaults() InitialiseDialog() + SetDefaults() bFirstLoad = False Else ReopenDialog() End If 'Checks if Ok can be enabled. TestOKEnabled() + SetEnabledStatusButtons() End Sub Private Sub ReopenDialog() @@ -47,6 +49,9 @@ Public Class dlgCalculationsSummary Private Sub InitialiseDialog() cmdEdit.Enabled = False cmdDuplicate.Enabled = False + clsApplyCalculation.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$run_instat_calculation") + 'TODO Shoudl be option on the dialog/sub dialog + clsApplyCalculation.AddParameter("display", "TRUE") End Sub Private Sub cmdAdd_Click(sender As Object, e As EventArgs) Handles cmdAdd.Click @@ -55,7 +60,7 @@ Public Class dlgCalculationsSummary clsCalcFunction.SetRCommand("instat_calculation$new") sdgCalculationsSummmary.SetCalculationFunction(clsCalcFunction) sdgCalculationsSummmary.ShowDialog() - If clsCalcFunction.clsParameters.FindIndex(Function(x) x.strArgumentName = "name") Then + If clsCalcFunction.clsParameters.FindIndex(Function(x) x.strArgumentName = "name") <> -1 Then lstLayers.Items.Add(clsCalcFunction.clsParameters.Find(Function(x) x.strArgumentName = "name").strArgumentValue) Else lstLayers.Items.Add("calc" & lstLayers.Items.Count + 1) @@ -65,8 +70,39 @@ Public Class dlgCalculationsSummary End Sub Private Sub ucrBase_ClickOk(sender As Object, e As EventArgs) Handles ucrBase.ClickOk - For i = 0 To lstCalculations.Count - frmMain.clsRLink.RunScript(lstCalculations(i).Value.ToScript()) + Dim strScript As String + Dim strComment As String = "" + Dim strTemp As String = "" + + For i = 0 To lstCalculations.Count - 1 + strScript = "" + If i = 0 Then + strComment = ucrBase.strComment + Else + strComment = "" + End If + clsApplyCalculation.AddParameter("calc", clsRFunctionParameter:=lstCalculations(i).Value.Clone()) + strTemp = clsApplyCalculation.ToScript(strScript) + frmMain.clsRLink.RunScript(strScript & strTemp, iCallType:=2) + Next + End Sub + + Private Sub cmdDelete_Click(sender As Object, e As EventArgs) Handles cmdDelete.Click + For Each iTemp As Integer In lstLayers.SelectedIndices + lstLayers.Items.RemoveAt(iTemp) + lstCalculations.RemoveAt(iTemp) Next End Sub + + Private Sub lstLayers_SelectedIndexChanged(sender As Object, e As EventArgs) Handles lstLayers.SelectedIndexChanged + SetEnabledStatusButtons() + End Sub + + Private Sub SetEnabledStatusButtons() + If lstLayers.SelectedItems.Count > 0 Then + cmdDelete.Enabled = True + Else + cmdDelete.Enabled = False + End If + End Sub End Class \ No newline at end of file diff --git a/instat/dlgCalculator.vb b/instat/dlgCalculator.vb index bad803dee78..0b9217116e5 100644 --- a/instat/dlgCalculator.vb +++ b/instat/dlgCalculator.vb @@ -52,7 +52,7 @@ Public Class dlgCalculator ucrCalc.ucrSaveResultInto.SetPrefix("Calc") ucrCalc.ucrSaveResultInto.Reset() ucrCalc.ucrInputCalOptions.Reset() - ucrCalc.ucrReceiverForCalculation.Clear() + ucrCalc.ucrSelectorForCalculations.Reset() ucrCalc.ucrInputCalOptions.SetName("Basic") ucrCalc.chkShowArguments.Checked = False ucrCalc.chkSaveResultInto.Checked = True @@ -69,7 +69,6 @@ Public Class dlgCalculator Private Sub InitialiseDialog() ucrBase.iHelpTopicID = 14 - ucrCalc.ucrReceiverForCalculation.Selector = ucrCalc.ucrSelectorForCalculations ucrCalc.ucrReceiverForCalculation.SetMeAsReceiver() clsAttach.SetRCommand("attach") clsDetach.SetRCommand("detach") @@ -81,9 +80,7 @@ Public Class dlgCalculator ucrCalc.ucrSaveResultInto.SetDefaultTypeAsColumn() ucrCalc.ucrSaveResultInto.SetDataFrameSelector(ucrCalc.ucrSelectorForCalculations.ucrAvailableDataFrames) ucrCalc.ucrSelectorForCalculations.Reset() - ucrCalc.ucrInputCalOptions.SetItems({"Basic", "Maths", "Logical and Symbols", "Statistics", "Strings (Character Columns)", "Probability", "Dates", "Rows"}) ' "Rows" is a temp. name ucrCalc.ucrSaveResultInto.SetValidationTypeAsRVariable() - End Sub Private Sub ucrCalc_SaveNameChanged() Handles ucrCalc.SaveNameChanged diff --git a/instat/sdgCalculationsSummmary.Designer.vb b/instat/sdgCalculationsSummmary.Designer.vb index ceae24500da..4ddbd13f1dd 100644 --- a/instat/sdgCalculationsSummmary.Designer.vb +++ b/instat/sdgCalculationsSummmary.Designer.vb @@ -73,7 +73,6 @@ Partial Class sdgCalculationsSummmary ' Me.tbMain.Controls.Add(Me.ucrReceiverBy) Me.tbMain.Controls.Add(Me.lblFactor) - Me.tbMain.Controls.Add(Me.ucrCalcSummary) Me.tbMain.Controls.Add(Me.ucrColumnName) Me.tbMain.Controls.Add(Me.ucrCalculationName) Me.tbMain.Controls.Add(Me.lblColumnName) @@ -84,6 +83,7 @@ Partial Class sdgCalculationsSummmary Me.tbMain.Controls.Add(Me.lblType) Me.tbMain.Controls.Add(Me.ucrType) Me.tbMain.Controls.Add(Me.ucrSelectorBy) + Me.tbMain.Controls.Add(Me.ucrCalcSummary) Me.tbMain.Location = New System.Drawing.Point(4, 22) Me.tbMain.Name = "tbMain" Me.tbMain.Padding = New System.Windows.Forms.Padding(3) diff --git a/instat/sdgCalculationsSummmary.vb b/instat/sdgCalculationsSummmary.vb index 652d7dc18f7..88828d9d9b7 100644 --- a/instat/sdgCalculationsSummmary.vb +++ b/instat/sdgCalculationsSummmary.vb @@ -17,7 +17,6 @@ Imports instat.Translations Public Class sdgCalculationsSummmary Public bFirstLoad As Boolean = True Private clsCalculationFunction As New RFunction - Private clsCalcFromList As New RFunction Dim lstType As New List(Of KeyValuePair(Of String, String)) Private Sub sdgCalculationsSummmary_Load(sender As Object, e As EventArgs) Handles MyBase.Load @@ -26,6 +25,9 @@ Public Class sdgCalculationsSummmary InitialiseDialog() SetDefaults() bFirstLoad = False + Else + 'temporary solution to subdialog linking issues + SetDefaults() End If End Sub @@ -37,7 +39,6 @@ Public Class sdgCalculationsSummmary ucrReceiverBy.SetMeAsReceiver() ucrReceiverBy.SetDataType("factor") - clsCalcFromList.SetRCommand("list") ' This is the new way of using this control. Not needed yet 'lstType.Add(New KeyValuePair(Of String, String)("Calculation", Chr(34) & "calculation" & Chr(34))) 'lstType.Add(New KeyValuePair(Of String, String)("Summary", Chr(34) & "summary" & Chr(34))) @@ -47,15 +48,24 @@ Public Class sdgCalculationsSummmary 'ucrType.SetItems(lstType) 'ucrType.SetParameterName("type") - clsCalculationFunction.SetAssignTo(ucrCalculationName.ToString()) + ucrCalcSummary.ucrReceiverForCalculation.SetMeAsReceiver() + ucrCalcSummary.chkSaveResultInto.Visible = False + ucrCalcSummary.ucrSaveResultInto.Visible = False End Sub Private Sub SetDefaults() ucrSelectorBy.Reset() ucrSelectorBy.Focus() + ucrType.SetName("calculation") - DisplayOptions() + SetType() + rdoDoNotSave.Checked = True + SetSaveOption() + + ucrCalcSummary.ucrSelectorForCalculations.Reset() + ucrCalculationName.SetName("") + ucrColumnName.SetName("") End Sub Public Sub SetCalculationFunction(clsNewCalcFunction As RFunction) @@ -68,31 +78,21 @@ Public Class sdgCalculationsSummmary ucrReceiverBy.Visible = False lblFactor.Visible = False ucrCalcSummary.Visible = True - lblColumnName.Visible = True - ucrColumnName.Visible = True - rdoSaveCalcAndResult.Visible = True + If ucrType.GetText = "calculation" Then + ucrCalcSummary.ucrInputCalOptions.SetName("Basic") + Else + ucrCalcSummary.ucrInputCalOptions.SetName("Statistics") + End If ElseIf ucrType.GetText = "by" Then - lblColumnName.Visible = False - ucrColumnName.Visible = False ucrSelectorBy.Visible = True ucrReceiverBy.Visible = True lblFactor.Visible = True - rdoSaveCalcAndResult.Visible = False ucrCalcSummary.Visible = False - If rdoSaveCalcAndResult.Checked Then - rdoDoNotSave.Checked = True - End If ElseIf ucrType.GetText = "filter" Then ucrSelectorBy.Visible = False ucrReceiverBy.Visible = False lblFactor.Visible = False - lblColumnName.Visible = False - ucrColumnName.Visible = False - rdoSaveCalcAndResult.Visible = False ucrCalcSummary.Visible = False - If rdoSaveCalcAndResult.Checked Then - rdoDoNotSave.Checked = True - End If Else ' combine options End If @@ -108,6 +108,16 @@ Public Class sdgCalculationsSummmary End If End Sub + Private Sub SetSaveOption() + If rdoSaveCalculation.Checked Then + clsCalculationFunction.AddParameter("save", "1") + ElseIf rdoSaveCalcAndResult.Checked Then + clsCalculationFunction.AddParameter("save", "2") + Else + clsCalculationFunction.AddParameter("save", "0") + End If + End Sub + ' Looking at Manipulations Tab Private Sub cmdManipAdd_Click(sender As Object, e As EventArgs) Handles cmdManipAdd.Click @@ -121,6 +131,10 @@ Public Class sdgCalculationsSummmary End Sub Private Sub ucrType_NameChanged() Handles ucrType.NameChanged + SetType() + End Sub + + Private Sub SetType() DisplayOptions() If ucrType.IsEmpty Then clsCalculationFunction.RemoveParameterByName("type") @@ -134,7 +148,7 @@ Public Class sdgCalculationsSummmary Dim strColumn As String If Not ucrCalcSummary.ucrReceiverForCalculation.IsEmpty Then - clsCalculationFunction.AddParameter("function_exp", ucrCalcSummary.ucrReceiverForCalculation.GetText()) + clsCalculationFunction.AddParameter("function_exp", Chr(34) & ucrCalcSummary.ucrReceiverForCalculation.GetText() & Chr(34)) Else clsCalculationFunction.RemoveParameterByName("function_exp") End If @@ -147,20 +161,22 @@ Public Class sdgCalculationsSummmary If i > 0 Then strCalcFromList = ", " & strCalcFromList End If - strCalcFromList = strCalcFromList & ucrCalcSummary.ucrSelectorForCalculations.ucrAvailableDataFrames.cboAvailableDataFrames.Text & " = " & strColumn + strCalcFromList = strCalcFromList & ucrCalcSummary.ucrSelectorForCalculations.ucrAvailableDataFrames.cboAvailableDataFrames.Text & " = " & Chr(34) & strColumn & Chr(34) Next strCalcFromList = strCalcFromList & ")" - clsCalcFromList.AddParameter("calculated_from", strCalcFromList) + clsCalculationFunction.AddParameter("calculated_from", strCalcFromList) Else - clsCalcFromList.RemoveParameterByName("calculated_from") + clsCalculationFunction.RemoveParameterByName("calculated_from") End If End Sub Private Sub ucrCalculationName_NameChanged() Handles ucrCalculationName.NameChanged If ucrCalculationName.IsEmpty Then clsCalculationFunction.RemoveParameterByName("name") + clsCalculationFunction.RemoveAssignTo() Else - clsCalculationFunction.AddParameter("name", ucrCalculationName.GetText()) + clsCalculationFunction.AddParameter("name", Chr(34) & ucrCalculationName.GetText() & Chr(34)) + clsCalculationFunction.SetAssignTo(ucrCalculationName.GetText()) End If End Sub @@ -168,7 +184,7 @@ Public Class sdgCalculationsSummmary If ucrColumnName.IsEmpty Then clsCalculationFunction.RemoveParameterByName("result_name") Else - clsCalculationFunction.AddParameter("result_name", ucrColumnName.GetText()) + clsCalculationFunction.AddParameter("result_name", Chr(34) & ucrColumnName.GetText() & Chr(34)) End If End Sub End Class \ No newline at end of file diff --git a/instat/static/InstatObject/R/Backend_Components/calculations.R b/instat/static/InstatObject/R/Backend_Components/calculations.R index 66beddcee99..743fa698e4a 100644 --- a/instat/static/InstatObject/R/Backend_Components/calculations.R +++ b/instat/static/InstatObject/R/Backend_Components/calculations.R @@ -455,6 +455,13 @@ instat_object$set("public", "apply_instat_calculation", function(calc, curr_data } ) +# Call this to run a calculation and display the data +instat_object$set("public", "run_instat_calculation", function(calc, display = TRUE) { + out <- self$apply_instat_calculation(calc) + if(display) return(out$data) +} +) + # given a set of columns in one data frame, this will return named list with corresponding columns in second data frame, where a link exists # TODO: Needs to update to not just look at direct links instat_object$set("public", "get_corresponding_link_columns", function(first_data_frame_name, first_data_frame_columns, second_data_frame_name) { diff --git a/instat/ucrCalculator.vb b/instat/ucrCalculator.vb index 60d9ebf6062..5496896b9a3 100644 --- a/instat/ucrCalculator.vb +++ b/instat/ucrCalculator.vb @@ -21,6 +21,20 @@ Public Class ucrCalculator Public Event DataFrameChanged() Public Event SaveResultsCheckedChanged() Public Event TryCommadClick() + Public bFirstLoad As Boolean = True + + Private Sub ucrCalculator_Load(sender As Object, e As EventArgs) Handles Me.Load + If bFirstLoad Then + InitialiseControl() + bFirstLoad = False + End If + End Sub + + Public Sub InitialiseControl() + ucrInputCalOptions.SetItems({"Basic", "Maths", "Logical and Symbols", "Statistics", "Strings (Character Columns)", "Probability", "Dates", "Rows"}) ' "Rows" is a temp. name + ucrReceiverForCalculation.Selector = ucrSelectorForCalculations + End Sub + Public Sub SetCalculationHistory() ucrReceiverForCalculation.AddtoCombobox(ucrReceiverForCalculation.GetText) End Sub From e8b598062a524815579d388a6931357f55d7703a Mon Sep 17 00:00:00 2001 From: Lunalo Date: Thu, 5 Jan 2017 09:55:19 +0300 Subject: [PATCH 26/27] Adding condition for selector not being empty --- instat/ucrSelector.vb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/instat/ucrSelector.vb b/instat/ucrSelector.vb index 08eb78cdabb..c0932c3644d 100644 --- a/instat/ucrSelector.vb +++ b/instat/ucrSelector.vb @@ -160,10 +160,11 @@ Public Class ucrSelector If e.KeyChar = vbCr Then Add() End If - If Keys.ControlKey AndAlso Keys.A Then - SelectAll() + If lstAvailableVariable.SelectedItems.Count > 0 Then + If Keys.ControlKey AndAlso Keys.A Then + SelectAll() + End If End If - End Sub Private Sub ucrSelector_ResetAll() Handles Me.ResetAll From f5654a56dbe60738158e6b1f8cdbff7054ebf16f Mon Sep 17 00:00:00 2001 From: Lunalo Date: Thu, 5 Jan 2017 11:18:14 +0300 Subject: [PATCH 27/27] Removing TEST menu --- instat/frmMain.Designer.vb | 46 ++++++++++++++++---------------------- instat/frmMain.vb | 18 +++++++-------- 2 files changed, 28 insertions(+), 36 deletions(-) diff --git a/instat/frmMain.Designer.vb b/instat/frmMain.Designer.vb index d117ed3a496..4d4104553b3 100644 --- a/instat/frmMain.Designer.vb +++ b/instat/frmMain.Designer.vb @@ -417,7 +417,6 @@ Partial Class frmMain Me.mnuToolsSaveCurrentOptions = New System.Windows.Forms.ToolStripMenuItem() Me.mnuToolsLoadOptions = New System.Windows.Forms.ToolStripMenuItem() Me.mnuToolsOptions = New System.Windows.Forms.ToolStripMenuItem() - Me.TESTToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.stsStrip.SuspendLayout() Me.Tool_strip.SuspendLayout() Me.mnuBar.SuspendLayout() @@ -425,7 +424,7 @@ Partial Class frmMain ' 'mnuDescribe ' - Me.mnuDescribe.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuDescribeOneVariable, Me.mnuDescribeTwoVariables, Me.mnuDescribeSpecific, Me.mnuDescribeGeneral, Me.ToolStripSeparator9, Me.mnuDescribeMultivariate, Me.mnuDescribeMoreGraphs, Me.ToolStripSeparator13, Me.mnuDescribeUseGraph, Me.mnuDescribeCombineGraph, Me.mnuDescribeThemes, Me.TESTToolStripMenuItem}) + Me.mnuDescribe.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuDescribeOneVariable, Me.mnuDescribeTwoVariables, Me.mnuDescribeSpecific, Me.mnuDescribeGeneral, Me.ToolStripSeparator9, Me.mnuDescribeMultivariate, Me.mnuDescribeMoreGraphs, Me.ToolStripSeparator13, Me.mnuDescribeUseGraph, Me.mnuDescribeCombineGraph, Me.mnuDescribeThemes}) Me.mnuDescribe.Name = "mnuDescribe" Me.mnuDescribe.Size = New System.Drawing.Size(64, 20) Me.mnuDescribe.Tag = "Describe" @@ -442,14 +441,14 @@ Partial Class frmMain 'mnuDescribeOneVariableSummarise ' Me.mnuDescribeOneVariableSummarise.Name = "mnuDescribeOneVariableSummarise" - Me.mnuDescribeOneVariableSummarise.Size = New System.Drawing.Size(142, 22) + Me.mnuDescribeOneVariableSummarise.Size = New System.Drawing.Size(152, 22) Me.mnuDescribeOneVariableSummarise.Tag = "Summarise..." Me.mnuDescribeOneVariableSummarise.Text = "Summarise..." ' 'mnuDescribeOneVariableGraph ' Me.mnuDescribeOneVariableGraph.Name = "mnuDescribeOneVariableGraph" - Me.mnuDescribeOneVariableGraph.Size = New System.Drawing.Size(142, 22) + Me.mnuDescribeOneVariableGraph.Size = New System.Drawing.Size(152, 22) Me.mnuDescribeOneVariableGraph.Tag = "Graph..." Me.mnuDescribeOneVariableGraph.Text = "Graph..." ' @@ -946,7 +945,7 @@ Partial Class frmMain ' Me.mnuModelOtherTwoVariablesTwoSamples.Enabled = False Me.mnuModelOtherTwoVariablesTwoSamples.Name = "mnuModelOtherTwoVariablesTwoSamples" - Me.mnuModelOtherTwoVariablesTwoSamples.Size = New System.Drawing.Size(267, 22) + Me.mnuModelOtherTwoVariablesTwoSamples.Size = New System.Drawing.Size(266, 22) Me.mnuModelOtherTwoVariablesTwoSamples.Tag = "Two_Samples..." Me.mnuModelOtherTwoVariablesTwoSamples.Text = "Two Samples..." ' @@ -954,21 +953,21 @@ Partial Class frmMain ' Me.mnuModelOtherTwoVariablesSummaryData.Enabled = False Me.mnuModelOtherTwoVariablesSummaryData.Name = "mnuModelOtherTwoVariablesSummaryData" - Me.mnuModelOtherTwoVariablesSummaryData.Size = New System.Drawing.Size(267, 22) + Me.mnuModelOtherTwoVariablesSummaryData.Size = New System.Drawing.Size(266, 22) Me.mnuModelOtherTwoVariablesSummaryData.Tag = "Summary_Data" Me.mnuModelOtherTwoVariablesSummaryData.Text = "Summary Data..." ' 'mnuModelOtherTwoVariablesSimpleRegression ' Me.mnuModelOtherTwoVariablesSimpleRegression.Name = "mnuModelOtherTwoVariablesSimpleRegression" - Me.mnuModelOtherTwoVariablesSimpleRegression.Size = New System.Drawing.Size(267, 22) + Me.mnuModelOtherTwoVariablesSimpleRegression.Size = New System.Drawing.Size(266, 22) Me.mnuModelOtherTwoVariablesSimpleRegression.Tag = "Simple_Regression" Me.mnuModelOtherTwoVariablesSimpleRegression.Text = "Simple Regression..." ' 'mnuModelOtherTwoVariablesOneWayANOVA ' Me.mnuModelOtherTwoVariablesOneWayANOVA.Name = "mnuModelOtherTwoVariablesOneWayANOVA" - Me.mnuModelOtherTwoVariablesOneWayANOVA.Size = New System.Drawing.Size(267, 22) + Me.mnuModelOtherTwoVariablesOneWayANOVA.Size = New System.Drawing.Size(266, 22) Me.mnuModelOtherTwoVariablesOneWayANOVA.Tag = "One_Way_ANOVA" Me.mnuModelOtherTwoVariablesOneWayANOVA.Text = "One Way ANOVA..." ' @@ -976,14 +975,14 @@ Partial Class frmMain ' Me.mnuModelOtherTwoVariablesNonParametricTwoSamples.Enabled = False Me.mnuModelOtherTwoVariablesNonParametricTwoSamples.Name = "mnuModelOtherTwoVariablesNonParametricTwoSamples" - Me.mnuModelOtherTwoVariablesNonParametricTwoSamples.Size = New System.Drawing.Size(267, 22) + Me.mnuModelOtherTwoVariablesNonParametricTwoSamples.Size = New System.Drawing.Size(266, 22) Me.mnuModelOtherTwoVariablesNonParametricTwoSamples.Tag = "Non_Parameteric_Two_Samples" Me.mnuModelOtherTwoVariablesNonParametricTwoSamples.Text = "Non Parametric Two Samples..." ' 'mnuModelOtherTwoVariablesNonParametricOneWayANOVA ' Me.mnuModelOtherTwoVariablesNonParametricOneWayANOVA.Name = "mnuModelOtherTwoVariablesNonParametricOneWayANOVA" - Me.mnuModelOtherTwoVariablesNonParametricOneWayANOVA.Size = New System.Drawing.Size(267, 22) + Me.mnuModelOtherTwoVariablesNonParametricOneWayANOVA.Size = New System.Drawing.Size(266, 22) Me.mnuModelOtherTwoVariablesNonParametricOneWayANOVA.Tag = "Non_Parameteric_One_Way_ANOVA..." Me.mnuModelOtherTwoVariablesNonParametricOneWayANOVA.Text = "Non Parameteric One Way ANOVA..." ' @@ -1000,21 +999,21 @@ Partial Class frmMain ' Me.mnuModelOtherThreeVariablesSimpleWithGroups.Enabled = False Me.mnuModelOtherThreeVariablesSimpleWithGroups.Name = "mnuModelOtherThreeVariablesSimpleWithGroups" - Me.mnuModelOtherThreeVariablesSimpleWithGroups.Size = New System.Drawing.Size(262, 22) + Me.mnuModelOtherThreeVariablesSimpleWithGroups.Size = New System.Drawing.Size(260, 22) Me.mnuModelOtherThreeVariablesSimpleWithGroups.Tag = "Simple_with_groups" Me.mnuModelOtherThreeVariablesSimpleWithGroups.Text = "Simple With Groups..." ' 'mnuModelOtherThreeVariablesNonParametricTwoWayANOVA ' Me.mnuModelOtherThreeVariablesNonParametricTwoWayANOVA.Name = "mnuModelOtherThreeVariablesNonParametricTwoWayANOVA" - Me.mnuModelOtherThreeVariablesNonParametricTwoWayANOVA.Size = New System.Drawing.Size(262, 22) + Me.mnuModelOtherThreeVariablesNonParametricTwoWayANOVA.Size = New System.Drawing.Size(260, 22) Me.mnuModelOtherThreeVariablesNonParametricTwoWayANOVA.Tag = "Non_Parametric_Two_Way_ANOVA..." Me.mnuModelOtherThreeVariablesNonParametricTwoWayANOVA.Text = "Non Parametric Two Way ANOVA..." ' 'mnuModelOtherThreeVariablesChisquareTest ' Me.mnuModelOtherThreeVariablesChisquareTest.Name = "mnuModelOtherThreeVariablesChisquareTest" - Me.mnuModelOtherThreeVariablesChisquareTest.Size = New System.Drawing.Size(262, 22) + Me.mnuModelOtherThreeVariablesChisquareTest.Size = New System.Drawing.Size(260, 22) Me.mnuModelOtherThreeVariablesChisquareTest.Tag = "Chi-square_Test" Me.mnuModelOtherThreeVariablesChisquareTest.Text = "Chi-square Test..." ' @@ -1031,7 +1030,7 @@ Partial Class frmMain ' Me.mnuModelOtherGeneralANOVAGeneral.Enabled = False Me.mnuModelOtherGeneralANOVAGeneral.Name = "mnuModelOtherGeneralANOVAGeneral" - Me.mnuModelOtherGeneralANOVAGeneral.Size = New System.Drawing.Size(167, 22) + Me.mnuModelOtherGeneralANOVAGeneral.Size = New System.Drawing.Size(166, 22) Me.mnuModelOtherGeneralANOVAGeneral.Tag = "ANOVA_General..." Me.mnuModelOtherGeneralANOVAGeneral.Text = "ANOVA General..." ' @@ -1039,7 +1038,7 @@ Partial Class frmMain ' Me.mnuModelOtherGeneralRegression.Enabled = False Me.mnuModelOtherGeneralRegression.Name = "mnuModelOtherGeneralRegression" - Me.mnuModelOtherGeneralRegression.Size = New System.Drawing.Size(167, 22) + Me.mnuModelOtherGeneralRegression.Size = New System.Drawing.Size(166, 22) Me.mnuModelOtherGeneralRegression.Tag = "Regression" Me.mnuModelOtherGeneralRegression.Text = "Regression..." ' @@ -1047,7 +1046,7 @@ Partial Class frmMain ' Me.mnuModelOtherGeneralLogLinear.Enabled = False Me.mnuModelOtherGeneralLogLinear.Name = "mnuModelOtherGeneralLogLinear" - Me.mnuModelOtherGeneralLogLinear.Size = New System.Drawing.Size(167, 22) + Me.mnuModelOtherGeneralLogLinear.Size = New System.Drawing.Size(166, 22) Me.mnuModelOtherGeneralLogLinear.Tag = "Log_Linear" Me.mnuModelOtherGeneralLogLinear.Text = "Log Linear..." ' @@ -1627,19 +1626,19 @@ Partial Class frmMain 'mnuClimaticPICSARainfall ' Me.mnuClimaticPICSARainfall.Name = "mnuClimaticPICSARainfall" - Me.mnuClimaticPICSARainfall.Size = New System.Drawing.Size(151, 22) + Me.mnuClimaticPICSARainfall.Size = New System.Drawing.Size(150, 22) Me.mnuClimaticPICSARainfall.Text = "Rainfall..." ' 'mnuClimaticPICSATemperature ' Me.mnuClimaticPICSATemperature.Name = "mnuClimaticPICSATemperature" - Me.mnuClimaticPICSATemperature.Size = New System.Drawing.Size(151, 22) + Me.mnuClimaticPICSATemperature.Size = New System.Drawing.Size(150, 22) Me.mnuClimaticPICSATemperature.Text = "Temperature..." ' 'mnuClimaticPICSACrops ' Me.mnuClimaticPICSACrops.Name = "mnuClimaticPICSACrops" - Me.mnuClimaticPICSACrops.Size = New System.Drawing.Size(151, 22) + Me.mnuClimaticPICSACrops.Size = New System.Drawing.Size(150, 22) Me.mnuClimaticPICSACrops.Text = "Crops..." ' 'mnuClimaticSCF @@ -3162,7 +3161,7 @@ Partial Class frmMain ' Me.mnuTools.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuToolsRunRCode, Me.mnuToolsRestartR, Me.mnuToolsCheckForUpdates, Me.mnuToolsClearOutputWindow, Me.ToolStripSeparator5, Me.mnuToolsSaveCurrentOptions, Me.mnuToolsLoadOptions, Me.mnuToolsOptions}) Me.mnuTools.Name = "mnuTools" - Me.mnuTools.Size = New System.Drawing.Size(48, 20) + Me.mnuTools.Size = New System.Drawing.Size(47, 20) Me.mnuTools.Text = "Tools" ' 'mnuToolsRunRCode @@ -3224,12 +3223,6 @@ Partial Class frmMain Me.mnuToolsOptions.Tag = "Options..." Me.mnuToolsOptions.Text = "Options..." ' - 'TESTToolStripMenuItem - ' - Me.TESTToolStripMenuItem.Name = "TESTToolStripMenuItem" - Me.TESTToolStripMenuItem.Size = New System.Drawing.Size(172, 22) - Me.TESTToolStripMenuItem.Text = "TEST" - ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -3648,5 +3641,4 @@ Partial Class frmMain Friend WithEvents mnuClimaticSCFSupportPrincipalComponents As ToolStripMenuItem Friend WithEvents mnuClimaticSCFSupportCanonicalCorrelations As ToolStripMenuItem Friend WithEvents mnuClimaticOrganiseUnstackDailyData As ToolStripMenuItem - Friend WithEvents TESTToolStripMenuItem As ToolStripMenuItem End Class diff --git a/instat/frmMain.vb b/instat/frmMain.vb index 46edc416d27..75dd16469dc 100644 --- a/instat/frmMain.vb +++ b/instat/frmMain.vb @@ -1311,13 +1311,13 @@ Public Class frmMain DlgDefineClimaticData.ShowDialog() End Sub - Private Sub TESTToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles TESTToolStripMenuItem.Click - 'TEST temporary - 'TESTING TO BE ERASED !!!!!!! - Dim clsTestStargizer As New RFunction - clsTestStargizer.SetRCommand("stargazer::stargazer") - clsTestStargizer.AddParameter("None", "attitude", bIncludeArgumentName:=False) - clsTestStargizer.AddParameter("type", Chr(34) & "html" & Chr(34)) - clsRLink.RunScript(clsTestStargizer.ToScript(), True, "Helloooooooo Stargizer power", True) - End Sub + 'Private Sub TESTToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles TESTToolStripMenuItem.Click + ' 'TEST temporary + ' 'TESTING TO BE ERASED !!!!!!! + ' Dim clsTestStargizer As New RFunction + ' clsTestStargizer.SetRCommand("stargazer::stargazer") + ' clsTestStargizer.AddParameter("None", "attitude", bIncludeArgumentName:=False) + ' clsTestStargizer.AddParameter("type", Chr(34) & "html" & Chr(34)) + ' clsRLink.RunScript(clsTestStargizer.ToScript(), True, "Helloooooooo Stargizer power", True) + 'End Sub End Class \ No newline at end of file