diff --git a/instat/ImportFromDatabases.Designer.vb b/instat/ImportFromDatabases.Designer.vb new file mode 100644 index 00000000000..8eae82e563a --- /dev/null +++ b/instat/ImportFromDatabases.Designer.vb @@ -0,0 +1,52 @@ + _ +Partial Class dlgImportFromDatabases + 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.ucrBase = New instat.ucrButtons() + Me.SuspendLayout() + ' + 'ucrBase + ' + Me.ucrBase.Location = New System.Drawing.Point(10, 326) + Me.ucrBase.Name = "ucrBase" + Me.ucrBase.Size = New System.Drawing.Size(399, 52) + Me.ucrBase.TabIndex = 0 + ' + 'dlgImportFromDatabases + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(428, 390) + Me.Controls.Add(Me.ucrBase) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "dlgImportFromDatabases" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "Import From Databases" + Me.ResumeLayout(False) + + End Sub + + Friend WithEvents ucrBase As ucrButtons +End Class diff --git a/instat/ImportFromDatabases.resx b/instat/ImportFromDatabases.resx new file mode 100644 index 00000000000..29dcb1b3a35 --- /dev/null +++ b/instat/ImportFromDatabases.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/ImportFromDatabases.vb b/instat/ImportFromDatabases.vb new file mode 100644 index 00000000000..27c73935fac --- /dev/null +++ b/instat/ImportFromDatabases.vb @@ -0,0 +1,56 @@ +' Instat-R +' Copyright (C) 2015 +' +' This program is free software: you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation, either version 3 of the License, or +' (at your option) any later version. +' +' This program is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. +' +' You should have received a copy of the GNU General Public License k +' along with this program. If not, see . +Imports instat.Translations +Public Class dlgImportFromDatabases + Private bFirstLoad As Boolean = True + Private bReset As Boolean = True + + Private Sub dlgImportFromCSPRO_Load(sender As Object, e As EventArgs) Handles MyBase.Load + If bFirstLoad Then + initialiseDialog() + bFirstLoad = False + If bReset Then + SetDefaults() + End If + SetRcodeForControls(bReset) + bReset = False + TestOkEnabled() + autoTranslate(Me) + End If + End Sub + + Private Sub TestOkEnabled() + + End Sub + + Private Sub SetRcodeForControls(bReset As Boolean) + + End Sub + + Private Sub SetDefaults() + + End Sub + + Private Sub initialiseDialog() + + End Sub + + Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset + SetDefaults() + SetRcodeForControls(True) + TestOkEnabled() + End Sub +End Class \ No newline at end of file diff --git a/instat/dlgCombineforGraphics.Designer.vb b/instat/dlgCombineforGraphics.Designer.vb index b2875eaebff..c327ec9599e 100644 --- a/instat/dlgCombineforGraphics.Designer.vb +++ b/instat/dlgCombineforGraphics.Designer.vb @@ -1,94 +1,96 @@ - _ -Partial Class dlgCombineforGraphics - 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.ucrBase = New instat.ucrButtons() - Me.ucrCombineGraphSelector = New instat.ucrSelectorByDataFrameAddRemove() - Me.ucrCombineGraphReceiver = New instat.ucrReceiverMultiple() - Me.Label1 = New System.Windows.Forms.Label() + +Partial Class dlgCombineforGraphics + 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.lblGraphsToCombine = New System.Windows.Forms.Label() Me.cmdOptions = New System.Windows.Forms.Button() - Me.ucrSaveCombinedGraph = New instat.ucrSaveGraph() + Me.ucrSave = New instat.ucrSave() + Me.ucrCombineGraphReceiver = New instat.ucrReceiverMultiple() + Me.ucrCombineGraphSelector = New instat.ucrSelectorByDataFrameAddRemove() + Me.ucrBase = New instat.ucrButtons() Me.SuspendLayout() ' - 'ucrBase + 'lblGraphsToCombine ' - Me.ucrBase.Location = New System.Drawing.Point(10, 254) - Me.ucrBase.Name = "ucrBase" - Me.ucrBase.Size = New System.Drawing.Size(410, 53) - Me.ucrBase.TabIndex = 5 + Me.lblGraphsToCombine.AutoSize = True + Me.lblGraphsToCombine.Location = New System.Drawing.Point(255, 45) + Me.lblGraphsToCombine.Name = "lblGraphsToCombine" + Me.lblGraphsToCombine.Size = New System.Drawing.Size(104, 13) + Me.lblGraphsToCombine.TabIndex = 1 + Me.lblGraphsToCombine.Text = "Graphs To Combine:" ' - 'ucrCombineGraphSelector + 'cmdOptions ' - Me.ucrCombineGraphSelector.bShowHiddenColumns = False - Me.ucrCombineGraphSelector.bUseCurrentFilter = True - Me.ucrCombineGraphSelector.Location = New System.Drawing.Point(10, 10) - Me.ucrCombineGraphSelector.Margin = New System.Windows.Forms.Padding(0) - Me.ucrCombineGraphSelector.Name = "ucrCombineGraphSelector" - Me.ucrCombineGraphSelector.Size = New System.Drawing.Size(210, 195) - Me.ucrCombineGraphSelector.TabIndex = 0 + Me.cmdOptions.Enabled = False + Me.cmdOptions.Location = New System.Drawing.Point(10, 199) + Me.cmdOptions.Name = "cmdOptions" + Me.cmdOptions.Size = New System.Drawing.Size(75, 23) + Me.cmdOptions.TabIndex = 3 + Me.cmdOptions.Text = "Options" + Me.cmdOptions.UseVisualStyleBackColor = True + ' + 'ucrSave + ' + Me.ucrSave.Location = New System.Drawing.Point(10, 228) + Me.ucrSave.Name = "ucrSave" + Me.ucrSave.Size = New System.Drawing.Size(276, 24) + Me.ucrSave.TabIndex = 4 ' 'ucrCombineGraphReceiver ' - Me.ucrCombineGraphReceiver.Location = New System.Drawing.Point(252, 60) + Me.ucrCombineGraphReceiver.frmParent = Me + Me.ucrCombineGraphReceiver.Location = New System.Drawing.Point(255, 60) Me.ucrCombineGraphReceiver.Margin = New System.Windows.Forms.Padding(0) Me.ucrCombineGraphReceiver.Name = "ucrCombineGraphReceiver" Me.ucrCombineGraphReceiver.Selector = Nothing Me.ucrCombineGraphReceiver.Size = New System.Drawing.Size(120, 130) Me.ucrCombineGraphReceiver.TabIndex = 2 ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(252, 43) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(104, 13) - Me.Label1.TabIndex = 1 - Me.Label1.Text = "Graphs To Combine:" - ' - 'cmdOptions + 'ucrCombineGraphSelector ' - Me.cmdOptions.Location = New System.Drawing.Point(10, 199) - Me.cmdOptions.Name = "cmdOptions" - Me.cmdOptions.Size = New System.Drawing.Size(75, 23) - Me.cmdOptions.TabIndex = 3 - Me.cmdOptions.Text = "Options" - Me.cmdOptions.UseVisualStyleBackColor = True + Me.ucrCombineGraphSelector.bShowHiddenColumns = False + Me.ucrCombineGraphSelector.bUseCurrentFilter = True + Me.ucrCombineGraphSelector.Location = New System.Drawing.Point(10, 10) + Me.ucrCombineGraphSelector.Margin = New System.Windows.Forms.Padding(0) + Me.ucrCombineGraphSelector.Name = "ucrCombineGraphSelector" + Me.ucrCombineGraphSelector.Size = New System.Drawing.Size(210, 195) + Me.ucrCombineGraphSelector.TabIndex = 0 ' - 'ucrSaveCombinedGraph + 'ucrBase ' - Me.ucrSaveCombinedGraph.Location = New System.Drawing.Point(10, 228) - Me.ucrSaveCombinedGraph.Name = "ucrSaveCombinedGraph" - Me.ucrSaveCombinedGraph.Size = New System.Drawing.Size(265, 20) - Me.ucrSaveCombinedGraph.TabIndex = 4 + Me.ucrBase.Location = New System.Drawing.Point(10, 258) + Me.ucrBase.Name = "ucrBase" + Me.ucrBase.Size = New System.Drawing.Size(410, 53) + Me.ucrBase.TabIndex = 5 ' 'dlgCombineforGraphics ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(420, 312) - Me.Controls.Add(Me.ucrSaveCombinedGraph) + Me.Controls.Add(Me.ucrSave) Me.Controls.Add(Me.cmdOptions) - Me.Controls.Add(Me.Label1) + Me.Controls.Add(Me.lblGraphsToCombine) Me.Controls.Add(Me.ucrCombineGraphReceiver) Me.Controls.Add(Me.ucrCombineGraphSelector) Me.Controls.Add(Me.ucrBase) @@ -102,12 +104,12 @@ Partial Class dlgCombineforGraphics Me.ResumeLayout(False) Me.PerformLayout() - End Sub - + End Sub + Friend WithEvents ucrBase As ucrButtons Friend WithEvents ucrCombineGraphSelector As ucrSelectorByDataFrameAddRemove Friend WithEvents ucrCombineGraphReceiver As ucrReceiverMultiple - Friend WithEvents Label1 As Label + Friend WithEvents lblGraphsToCombine As Label Friend WithEvents cmdOptions As Button - Friend WithEvents ucrSaveCombinedGraph As ucrSaveGraph -End Class + Friend WithEvents ucrSave As ucrSave +End Class \ No newline at end of file diff --git a/instat/dlgCombineforGraphics.vb b/instat/dlgCombineforGraphics.vb index 2fe4ea829da..e98610702a8 100644 --- a/instat/dlgCombineforGraphics.vb +++ b/instat/dlgCombineforGraphics.vb @@ -1,89 +1,98 @@ -' Instat-R -' Copyright (C) 2015 -' -' This program is free software: you can redistribute it and/or modify -' it under the terms of the GNU General Public License as published by -' the Free Software Foundation, either version 3 of the License, or -' (at your option) any later version. -' -' This program is distributed in the hope that it will be useful, -' but WITHOUT ANY WARRANTY; without even the implied warranty of -' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -' GNU General Public License for more details. -' -' You should have received a copy of the GNU General Public License k -' along with this program. If not, see . -Imports instat.Translations -Public Class dlgCombineforGraphics - Private bFirstLoad As Boolean = True - Private Sub dlgCombineforGraphics_Load(sender As Object, e As EventArgs) Handles MyBase.Load - If bFirstLoad Then - InitialiseDialog() - SetDefaults() - bFirstLoad = False - Else - ReopenDialog() - - End If - autoTranslate(Me) - TestOkEnabled() - End Sub - - Private Sub InitialiseDialog() - ucrBase.iHelpTopicID = 431 - ucrCombineGraphReceiver.Selector = ucrCombineGraphSelector +' Instat-R +' Copyright (C) 2015 +' +' This program is free software: you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation, either version 3 of the License, or +' (at your option) any later version. +' +' This program is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. +' +' You should have received a copy of the GNU General Public License k +' along with this program. If not, see . +Imports instat.Translations +Public Class dlgCombineforGraphics + Private bFirstLoad As Boolean = True + Private bReset As Boolean = True + Private bResetSubDialog As Boolean = False + Private clsDefaultRFunction As New RFunction + Private Sub dlgCombineforGraphics_Load(sender As Object, e As EventArgs) Handles MyBase.Load + If bFirstLoad Then + InitialiseDialog() + bFirstLoad = False + + End If + + If bReset Then + SetDefaults() + End If + SetRCodeForControls(bReset) + bReset = False + autoTranslate(Me) + TestOkEnabled() + End Sub + + Private Sub SetRCodeForControls(bReset As Boolean) + SetRCode(Me, ucrBase.clsRsyntax.clsBaseFunction, bReset) + End Sub + + Private Sub InitialiseDialog() + ucrBase.iHelpTopicID = 431 + ucrBase.clsRsyntax.iCallType = 3 + ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False + + + ucrCombineGraphReceiver.Selector = ucrCombineGraphSelector ucrCombineGraphSelector.SetItemType("graph") - ucrSaveCombinedGraph.SetDataFrameSelector(ucrCombineGraphSelector.ucrAvailableDataFrames) - sdgCombineGraphOptions.SetRSyntax(ucrBase.clsRsyntax) - ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False - ucrBase.clsRsyntax.SetFunction("gridExtra::grid.arrange") ucrCombineGraphReceiver.strSelectorHeading = "Graphs" - ucrBase.clsRsyntax.iCallType = 3 - End Sub - - Private Sub SetDefaults() - ucrCombineGraphReceiver.SetMeAsReceiver() - ucrCombineGraphSelector.Reset() - ucrSaveCombinedGraph.chkSaveGraph.Checked = False - sdgCombineGraphOptions.SetDefaults() - ucrSaveCombinedGraph.strPrefix = "CombineGraph" - TestOkEnabled() - End Sub - - Private Sub ReopenDialog() - - End Sub - Private Sub TestOkEnabled() - If ucrCombineGraphReceiver.lstSelectedVariables.Items.Count > 1 Then + + ucrCombineGraphReceiver.SetParameter(New RParameter("grobs", 0)) + ucrCombineGraphReceiver.SetParameterIsRFunction() + + ucrSave.SetPrefix("Combined_Graph") + ucrSave.SetDataFrameSelector(ucrCombineGraphSelector.ucrAvailableDataFrames) + ucrSave.SetSaveTypeAsGraph() + ucrSave.SetCheckBoxText("Save Graph") + ucrSave.SetIsComboBox() + ucrSave.SetAssignToIfUncheckedValue("last_graph") + + End Sub + + Private Sub SetDefaults() + ucrCombineGraphReceiver.SetMeAsReceiver() + ucrCombineGraphSelector.Reset() + ucrSave.Reset() + + clsDefaultRFunction = New RFunction + clsDefaultRFunction.SetRCommand("grid.arrange") + clsDefaultRFunction.SetAssignTo("last_graph", strTempDataframe:=ucrCombineGraphSelector.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") + ucrBase.clsRsyntax.SetBaseRFunction(clsDefaultRFunction) + bResetSubDialog = True + End Sub + + Private Sub TestOkEnabled() + If ucrCombineGraphReceiver.lstSelectedVariables.Items.Count > 1 AndAlso ucrSave.IsComplete Then ucrBase.OKEnabled(True) Else ucrBase.OKEnabled(False) End If - End Sub - - Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset - SetDefaults() + End Sub + Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset + SetDefaults() + SetRCodeForControls(True) + TestOkEnabled() End Sub - Private Sub ucrCombineGraphReceiver_SelectionChanged() Handles ucrCombineGraphReceiver.SelectionChanged - If Not ucrCombineGraphReceiver.IsEmpty Then - ucrBase.clsRsyntax.AddParameter("grobs", clsRFunctionParameter:=ucrCombineGraphReceiver.GetVariables()) - sdgCombineGraphOptions.SetDefaultRowAndColumns() - Else - ucrBase.clsRsyntax.RemoveParameter("grobs") - End If + Private Sub AllControls_ControlContentsChanged() Handles ucrCombineGraphReceiver.ControlContentsChanged, ucrSave.ControlContentsChanged TestOkEnabled() End Sub Private Sub cmdLayout_Click(sender As Object, e As EventArgs) Handles cmdOptions.Click + 'this SetRFunction is still empty in subdialog but will be fixed soon. + sdgCombineGraphOptions.SetRFunction(ucrBase.clsRsyntax.clsBaseFunction, bResetSubDialog) + bResetSubDialog = False sdgCombineGraphOptions.ShowDialog() End Sub - - Private Sub ucrSaveCombinedGraph_Load() Handles ucrSaveCombinedGraph.GraphNameChanged, ucrSaveCombinedGraph.SaveGraphCheckedChanged - If ucrSaveCombinedGraph.bSaveGraph Then - ucrBase.clsRsyntax.SetAssignTo(ucrSaveCombinedGraph.strGraphName, strTempDataframe:=ucrCombineGraphSelector.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:=ucrSaveCombinedGraph.strGraphName) - Else - ucrBase.clsRsyntax.SetAssignTo("last_graph", strTempDataframe:=ucrCombineGraphSelector.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") - End If - TestOkEnabled() - End Sub End Class \ No newline at end of file diff --git a/instat/dlgDefineCorruptionOutputs.Designer.vb b/instat/dlgDefineCorruptionOutputs.Designer.vb index 466c759467a..b037403e2a3 100644 --- a/instat/dlgDefineCorruptionOutputs.Designer.vb +++ b/instat/dlgDefineCorruptionOutputs.Designer.vb @@ -30,7 +30,7 @@ Partial Class dlgDefineCorruptionOutputs ' 'ucrBase ' - Me.ucrBase.Location = New System.Drawing.Point(10, 216) + Me.ucrBase.Location = New System.Drawing.Point(10, 199) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(410, 52) Me.ucrBase.TabIndex = 3 @@ -58,7 +58,7 @@ Partial Class dlgDefineCorruptionOutputs 'lblCorruptionOutputs ' Me.lblCorruptionOutputs.AutoSize = True - Me.lblCorruptionOutputs.Location = New System.Drawing.Point(268, 45) + Me.lblCorruptionOutputs.Location = New System.Drawing.Point(271, 45) Me.lblCorruptionOutputs.Name = "lblCorruptionOutputs" Me.lblCorruptionOutputs.Size = New System.Drawing.Size(98, 13) Me.lblCorruptionOutputs.TabIndex = 1 @@ -68,7 +68,7 @@ Partial Class dlgDefineCorruptionOutputs ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(430, 274) + Me.ClientSize = New System.Drawing.Size(422, 260) Me.Controls.Add(Me.lblCorruptionOutputs) Me.Controls.Add(Me.ucrBase) Me.Controls.Add(Me.ucrReceiverCorruptionOutputs) diff --git a/instat/dlgDefineCorruptionOutputs.vb b/instat/dlgDefineCorruptionOutputs.vb index ecceac13eba..9ec8d8c8f6e 100644 --- a/instat/dlgDefineCorruptionOutputs.vb +++ b/instat/dlgDefineCorruptionOutputs.vb @@ -37,15 +37,6 @@ Public Class dlgDefineCorruptionOutputs End If SetRCodeForControls(bReset) bReset = False - - End Sub - - Private Sub SetDefaults() - 'Reset - ucrSelectorCorruptionOutputs.Reset() - clsCorruptionOutputs = New RFunction - clsCorruptionOutputs.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$define_corruption_outputs") - ucrBase.clsRsyntax.SetBaseRFunction(clsCorruptionOutputs) End Sub Private Sub InitialiseDialog() @@ -59,6 +50,17 @@ Public Class dlgDefineCorruptionOutputs 'ucrreceiver ucrReceiverCorruptionOutputs.SetParameter(New RParameter("output_columns", 1)) ucrReceiverCorruptionOutputs.SetParameterIsString() + ucrReceiverCorruptionOutputs.Selector = ucrSelectorCorruptionOutputs + ucrReceiverCorruptionOutputs.SetMeAsReceiver() + End Sub + + Private Sub SetDefaults() + 'Reset + ucrSelectorCorruptionOutputs.Reset() + + clsCorruptionOutputs = New RFunction + clsCorruptionOutputs.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$define_corruption_outputs") + ucrBase.clsRsyntax.SetBaseRFunction(clsCorruptionOutputs) End Sub Public Sub SetCurrentColumn(strColumn As String, strDataFrame As String) diff --git a/instat/dlgDefineRedFlags.vb b/instat/dlgDefineRedFlags.vb index e5f954458a9..9570cd5a8db 100644 --- a/instat/dlgDefineRedFlags.vb +++ b/instat/dlgDefineRedFlags.vb @@ -22,6 +22,7 @@ Public Class dlgDefineRedFlags Dim strSelectedColumn As String = "" Dim strSelectedDataFrame As String = "" Private clsRedFlag As New RFunction + Private Sub dlgDefineRedFlags_Load(sender As Object, e As EventArgs) Handles MyBase.Load autoTranslate(Me) If bFirstLoad Then @@ -39,9 +40,10 @@ Public Class dlgDefineRedFlags End Sub Private Sub SetDefaults() - 'Reset - ucrSelectorDefineRedFlag.Reset() clsRedFlag = New RFunction + + ucrSelectorDefineRedFlag.Reset() + clsRedFlag.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$define_red_flags") ucrBase.clsRsyntax.SetBaseRFunction(clsRedFlag) End Sub @@ -49,12 +51,17 @@ Public Class dlgDefineRedFlags Private Sub InitialiseDialog() 'helpID ' ucrBase.iHelpTopicID = + 'selector ucrSelectorDefineRedFlag.SetParameter(New RParameter("data_name", 0)) ucrSelectorDefineRedFlag.SetParameterIsString() + 'ucrreceiver ucrReceiverRedFlag.SetParameter(New RParameter("red_flags", 1)) ucrReceiverRedFlag.SetParameterIsString() + + ucrReceiverRedFlag.Selector = ucrSelectorDefineRedFlag + ucrReceiverRedFlag.SetMeAsReceiver() End Sub Public Sub SetCurrentColumn(strColumn As String, strDataFrame As String) diff --git a/instat/dlgDrySpells.Designer.vb b/instat/dlgDrySpells.Designer.vb new file mode 100644 index 00000000000..ec47d283a0e --- /dev/null +++ b/instat/dlgDrySpells.Designer.vb @@ -0,0 +1,29 @@ + _ +Partial Class dlgDrySpells + 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() + components = New System.ComponentModel.Container + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Text = "dlgDrySpells" + End Sub +End Class diff --git a/instat/dlgDrySpells.vb b/instat/dlgDrySpells.vb new file mode 100644 index 00000000000..02afe13db4d --- /dev/null +++ b/instat/dlgDrySpells.vb @@ -0,0 +1,3 @@ +Public Class dlgDrySpells + +End Class \ No newline at end of file diff --git a/instat/dlgDummyVariables.Designer.vb b/instat/dlgDummyVariables.Designer.vb index ec090229c8e..a820655e972 100644 --- a/instat/dlgDummyVariables.Designer.vb +++ b/instat/dlgDummyVariables.Designer.vb @@ -22,42 +22,101 @@ Partial Class dlgDummyVariables 'Do not modify it using the code editor. Private Sub InitializeComponent() - Me.grpLevelOmitted = New System.Windows.Forms.GroupBox() - Me.rdoLevelNumber = New System.Windows.Forms.RadioButton() - Me.rdoLast = New System.Windows.Forms.RadioButton() - Me.rdoFirst = New System.Windows.Forms.RadioButton() - Me.rdoNone = New System.Windows.Forms.RadioButton() - Me.chkXvariable = New System.Windows.Forms.CheckBox() Me.lblSelected = New System.Windows.Forms.Label() Me.lblVariate = New System.Windows.Forms.Label() Me.ucrSelectorDummyVariable = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrVariateReceiver = New instat.ucrReceiverSingle() Me.ucrReceiverFactor = New instat.ucrReceiverSingle() Me.ucrBase = New instat.ucrButtons() + Me.grpLevelOmitted = New System.Windows.Forms.GroupBox() + Me.rdoLevelNumber = New System.Windows.Forms.RadioButton() + Me.rdoLast = New System.Windows.Forms.RadioButton() + Me.rdoFirst = New System.Windows.Forms.RadioButton() + Me.rdoNone = New System.Windows.Forms.RadioButton() + Me.ucrPnlLevelOmitted = New instat.UcrPanel() + Me.ucrChkWithXVariable = New instat.ucrCheck() Me.grpLevelOmitted.SuspendLayout() Me.SuspendLayout() ' + 'lblSelected + ' + Me.lblSelected.AutoSize = True + Me.lblSelected.Location = New System.Drawing.Point(258, 39) + Me.lblSelected.Name = "lblSelected" + Me.lblSelected.Size = New System.Drawing.Size(90, 13) + Me.lblSelected.TabIndex = 1 + Me.lblSelected.Tag = "Selected" + Me.lblSelected.Text = "Selected Column:" + ' + 'lblVariate + ' + Me.lblVariate.AutoSize = True + Me.lblVariate.Location = New System.Drawing.Point(252, 252) + Me.lblVariate.Name = "lblVariate" + Me.lblVariate.Size = New System.Drawing.Size(43, 13) + Me.lblVariate.TabIndex = 5 + Me.lblVariate.Tag = "Variate" + Me.lblVariate.Text = "Variate:" + ' + 'ucrSelectorDummyVariable + ' + Me.ucrSelectorDummyVariable.bShowHiddenColumns = False + Me.ucrSelectorDummyVariable.bUseCurrentFilter = True + Me.ucrSelectorDummyVariable.Location = New System.Drawing.Point(10, 10) + Me.ucrSelectorDummyVariable.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectorDummyVariable.Name = "ucrSelectorDummyVariable" + Me.ucrSelectorDummyVariable.Size = New System.Drawing.Size(210, 180) + Me.ucrSelectorDummyVariable.TabIndex = 0 + ' + 'ucrVariateReceiver + ' + Me.ucrVariateReceiver.frmParent = Me + Me.ucrVariateReceiver.Location = New System.Drawing.Point(298, 248) + Me.ucrVariateReceiver.Margin = New System.Windows.Forms.Padding(0) + Me.ucrVariateReceiver.Name = "ucrVariateReceiver" + Me.ucrVariateReceiver.Selector = Nothing + Me.ucrVariateReceiver.Size = New System.Drawing.Size(101, 20) + Me.ucrVariateReceiver.TabIndex = 6 + ' + 'ucrReceiverFactor + ' + Me.ucrReceiverFactor.frmParent = Me + Me.ucrReceiverFactor.Location = New System.Drawing.Point(258, 56) + Me.ucrReceiverFactor.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverFactor.Name = "ucrReceiverFactor" + Me.ucrReceiverFactor.Selector = Nothing + Me.ucrReceiverFactor.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverFactor.TabIndex = 2 + ' + 'ucrBase + ' + Me.ucrBase.Location = New System.Drawing.Point(10, 279) + Me.ucrBase.Name = "ucrBase" + Me.ucrBase.Size = New System.Drawing.Size(410, 52) + Me.ucrBase.TabIndex = 9 + ' 'grpLevelOmitted ' Me.grpLevelOmitted.Controls.Add(Me.rdoLevelNumber) Me.grpLevelOmitted.Controls.Add(Me.rdoLast) Me.grpLevelOmitted.Controls.Add(Me.rdoFirst) Me.grpLevelOmitted.Controls.Add(Me.rdoNone) - Me.grpLevelOmitted.Location = New System.Drawing.Point(255, 72) + Me.grpLevelOmitted.Controls.Add(Me.ucrPnlLevelOmitted) + Me.grpLevelOmitted.Location = New System.Drawing.Point(258, 86) Me.grpLevelOmitted.Name = "grpLevelOmitted" - Me.grpLevelOmitted.Size = New System.Drawing.Size(106, 112) - Me.grpLevelOmitted.TabIndex = 3 + Me.grpLevelOmitted.Size = New System.Drawing.Size(102, 151) + Me.grpLevelOmitted.TabIndex = 14 Me.grpLevelOmitted.TabStop = False - Me.grpLevelOmitted.Tag = "Level_Omitted" + Me.grpLevelOmitted.Tag = "Level Omitted" Me.grpLevelOmitted.Text = "Level Omitted" ' 'rdoLevelNumber ' Me.rdoLevelNumber.AutoSize = True - Me.rdoLevelNumber.Location = New System.Drawing.Point(6, 88) + Me.rdoLevelNumber.Location = New System.Drawing.Point(22, 114) Me.rdoLevelNumber.Name = "rdoLevelNumber" Me.rdoLevelNumber.Size = New System.Drawing.Size(51, 17) - Me.rdoLevelNumber.TabIndex = 3 + Me.rdoLevelNumber.TabIndex = 7 Me.rdoLevelNumber.TabStop = True Me.rdoLevelNumber.Tag = "Level" Me.rdoLevelNumber.Text = "Level" @@ -66,10 +125,10 @@ Partial Class dlgDummyVariables 'rdoLast ' Me.rdoLast.AutoSize = True - Me.rdoLast.Location = New System.Drawing.Point(6, 65) + Me.rdoLast.Location = New System.Drawing.Point(22, 85) Me.rdoLast.Name = "rdoLast" Me.rdoLast.Size = New System.Drawing.Size(45, 17) - Me.rdoLast.TabIndex = 2 + Me.rdoLast.TabIndex = 6 Me.rdoLast.TabStop = True Me.rdoLast.Tag = "Last" Me.rdoLast.Text = "Last" @@ -78,10 +137,10 @@ Partial Class dlgDummyVariables 'rdoFirst ' Me.rdoFirst.AutoSize = True - Me.rdoFirst.Location = New System.Drawing.Point(6, 42) + Me.rdoFirst.Location = New System.Drawing.Point(22, 56) Me.rdoFirst.Name = "rdoFirst" Me.rdoFirst.Size = New System.Drawing.Size(44, 17) - Me.rdoFirst.TabIndex = 1 + Me.rdoFirst.TabIndex = 5 Me.rdoFirst.TabStop = True Me.rdoFirst.Tag = "First" Me.rdoFirst.Text = "First" @@ -90,93 +149,42 @@ Partial Class dlgDummyVariables 'rdoNone ' Me.rdoNone.AutoSize = True - Me.rdoNone.Location = New System.Drawing.Point(6, 19) + Me.rdoNone.Location = New System.Drawing.Point(22, 27) Me.rdoNone.Name = "rdoNone" Me.rdoNone.Size = New System.Drawing.Size(51, 17) - Me.rdoNone.TabIndex = 0 + Me.rdoNone.TabIndex = 4 Me.rdoNone.TabStop = True Me.rdoNone.Tag = "None" Me.rdoNone.Text = "None" Me.rdoNone.UseVisualStyleBackColor = True ' - 'chkXvariable + 'ucrPnlLevelOmitted ' - Me.chkXvariable.AutoSize = True - Me.chkXvariable.Location = New System.Drawing.Point(10, 209) - Me.chkXvariable.Name = "chkXvariable" - Me.chkXvariable.Size = New System.Drawing.Size(114, 17) - Me.chkXvariable.TabIndex = 4 - Me.chkXvariable.Tag = "Withan_X_Variable" - Me.chkXvariable.Text = "With an X Variable" - Me.chkXvariable.UseVisualStyleBackColor = True + Me.ucrPnlLevelOmitted.Location = New System.Drawing.Point(6, 16) + Me.ucrPnlLevelOmitted.Name = "ucrPnlLevelOmitted" + Me.ucrPnlLevelOmitted.Size = New System.Drawing.Size(85, 129) + Me.ucrPnlLevelOmitted.TabIndex = 0 ' - 'lblSelected + 'ucrChkWithXVariable ' - Me.lblSelected.AutoSize = True - Me.lblSelected.Location = New System.Drawing.Point(255, 25) - Me.lblSelected.Name = "lblSelected" - Me.lblSelected.Size = New System.Drawing.Size(49, 13) - Me.lblSelected.TabIndex = 1 - Me.lblSelected.Tag = "Selected" - Me.lblSelected.Text = "Selected" - ' - 'lblVariate - ' - Me.lblVariate.AutoSize = True - Me.lblVariate.Location = New System.Drawing.Point(133, 210) - Me.lblVariate.Name = "lblVariate" - Me.lblVariate.Size = New System.Drawing.Size(40, 13) - Me.lblVariate.TabIndex = 5 - Me.lblVariate.Tag = "Variate" - Me.lblVariate.Text = "Variate" - ' - 'ucrSelectorDummyVariable - ' - Me.ucrSelectorDummyVariable.bShowHiddenColumns = False - Me.ucrSelectorDummyVariable.bUseCurrentFilter = False - Me.ucrSelectorDummyVariable.Location = New System.Drawing.Point(10, 10) - Me.ucrSelectorDummyVariable.Margin = New System.Windows.Forms.Padding(0) - Me.ucrSelectorDummyVariable.Name = "ucrSelectorDummyVariable" - Me.ucrSelectorDummyVariable.Size = New System.Drawing.Size(210, 180) - Me.ucrSelectorDummyVariable.TabIndex = 0 - ' - 'ucrVariateReceiver - ' - Me.ucrVariateReceiver.Location = New System.Drawing.Point(179, 203) - Me.ucrVariateReceiver.Margin = New System.Windows.Forms.Padding(0) - Me.ucrVariateReceiver.Name = "ucrVariateReceiver" - Me.ucrVariateReceiver.Selector = Nothing - Me.ucrVariateReceiver.Size = New System.Drawing.Size(120, 20) - Me.ucrVariateReceiver.TabIndex = 6 - ' - 'ucrReceiverFactor - ' - Me.ucrReceiverFactor.Location = New System.Drawing.Point(255, 42) - Me.ucrReceiverFactor.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverFactor.Name = "ucrReceiverFactor" - Me.ucrReceiverFactor.Selector = Nothing - Me.ucrReceiverFactor.Size = New System.Drawing.Size(120, 20) - Me.ucrReceiverFactor.TabIndex = 2 - ' - 'ucrBase - ' - Me.ucrBase.Location = New System.Drawing.Point(10, 268) - Me.ucrBase.Name = "ucrBase" - Me.ucrBase.Size = New System.Drawing.Size(410, 52) - Me.ucrBase.TabIndex = 9 + Me.ucrChkWithXVariable.Checked = False + Me.ucrChkWithXVariable.Location = New System.Drawing.Point(12, 248) + Me.ucrChkWithXVariable.Name = "ucrChkWithXVariable" + Me.ucrChkWithXVariable.Size = New System.Drawing.Size(128, 20) + Me.ucrChkWithXVariable.TabIndex = 15 ' 'dlgDummyVariables ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(419, 332) + Me.ClientSize = New System.Drawing.Size(415, 340) + Me.Controls.Add(Me.ucrChkWithXVariable) + Me.Controls.Add(Me.grpLevelOmitted) Me.Controls.Add(Me.ucrSelectorDummyVariable) Me.Controls.Add(Me.ucrVariateReceiver) Me.Controls.Add(Me.lblVariate) Me.Controls.Add(Me.ucrReceiverFactor) Me.Controls.Add(Me.lblSelected) - Me.Controls.Add(Me.chkXvariable) - Me.Controls.Add(Me.grpLevelOmitted) Me.Controls.Add(Me.ucrBase) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.MaximizeBox = False @@ -194,15 +202,16 @@ Partial Class dlgDummyVariables End Sub Friend WithEvents ucrBase As ucrButtons - Friend WithEvents grpLevelOmitted As GroupBox - Friend WithEvents rdoLevelNumber As RadioButton - Friend WithEvents rdoLast As RadioButton - Friend WithEvents rdoFirst As RadioButton - Friend WithEvents rdoNone As RadioButton - Friend WithEvents chkXvariable As CheckBox Friend WithEvents lblSelected As Label Friend WithEvents ucrReceiverFactor As ucrReceiverSingle Friend WithEvents ucrSelectorDummyVariable As ucrSelectorByDataFrameAddRemove Friend WithEvents lblVariate As Label Friend WithEvents ucrVariateReceiver As ucrReceiverSingle + Friend WithEvents grpLevelOmitted As GroupBox + Friend WithEvents rdoLevelNumber As RadioButton + Friend WithEvents rdoLast As RadioButton + Friend WithEvents rdoFirst As RadioButton + Friend WithEvents rdoNone As RadioButton + Friend WithEvents ucrPnlLevelOmitted As UcrPanel + Friend WithEvents ucrChkWithXVariable As ucrCheck End Class diff --git a/instat/dlgDummyVariables.vb b/instat/dlgDummyVariables.vb index c6e035692e9..a5af98902d0 100644 --- a/instat/dlgDummyVariables.vb +++ b/instat/dlgDummyVariables.vb @@ -14,87 +14,104 @@ ' ' 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 dlgDummyVariables - Private bFirstLoad As Boolean = True - Private Sub dlgIndicatorVariable_Load(sender As Object, e As EventArgs) Handles MyBase.Load - If bFirstLoad Then - InitialiseDialog() - SetDefaults() - bFirstLoad = False - Else - ReopenDialog() - - End If - autoTranslate(Me) - End Sub - - Private Sub TestOkEnabled() - If Not ucrReceiverFactor.IsEmpty Then - ucrBase.OKEnabled(True) - Else - ucrBase.OKEnabled(False) - End If - End Sub - - Private Sub SetDefaults() - ucrSelectorDummyVariable.Focus() - ucrSelectorDummyVariable.Reset() - ucrReceiverFactor.Selector = ucrSelectorDummyVariable - ucrReceiverFactor.SetMeAsReceiver() - chkXvariable.Checked = False + Private bFirstLoad As Boolean = True + Private bReset As Boolean = True + Private clsDummy As New RFunction + Private Sub dlgIndicatorVariable_Load(sender As Object, e As EventArgs) Handles MyBase.Load + autoTranslate(Me) + If bFirstLoad Then + InitialiseDialog() + bFirstLoad = False + End If + If bReset Then + SetDefaults() + End If + SetRCodeForControls(bReset) + bReset = False TestOkEnabled() - chkXvariable.Enabled = False - End Sub - - Public Sub InitialiseDialog() + End Sub - 'ucrInputColumns.SetItemsTypeAsColumns() - 'ucrInputColumns.SetDefaultTypeAsColumn() - 'ucrInputColumns.SetPrefix("dummy") - 'ucrInputColumns.SetDataFrameSelector(ucrSelectorDummyVariable.ucrAvailableDataFrames) + Private Sub SetDefaults() + 'reset + ucrSelectorDummyVariable.Reset() + 'set default function + clsDummy.SetRCommand("dummy") + ucrBase.clsRsyntax.SetBaseRFunction(clsDummy) + ucrBase.clsRsyntax.SetAssignTo(strAssignToName:="dummy_vars", strTempDataframe:=ucrSelectorDummyVariable.ucrAvailableDataFrames.cboAvailableDataFrames.Text, bAssignToColumnWithoutNames:=True) + End Sub + Public Sub InitialiseDialog() ucrBase.iHelpTopicID = 41 + 'Set Receiver ucrReceiverFactor.Selector = ucrSelectorDummyVariable ucrVariateReceiver.Selector = ucrSelectorDummyVariable ucrReceiverFactor.SetMeAsReceiver() - - ucrReceiverFactor.SetIncludedDataTypes({"factor"}) - - chkXvariable.Checked = False - ucrVariateReceiver.Visible = False - lblVariate.Visible = False - grpLevelOmitted.Enabled = False - - ucrBase.clsRsyntax.SetFunction("dummy") - ucrBase.clsRsyntax.SetAssignTo(strAssignToName:="dummy_vars", strTempDataframe:=ucrSelectorDummyVariable.ucrAvailableDataFrames.cboAvailableDataFrames.Text, bAssignToColumnWithoutNames:=True) - End Sub - - Private Sub ReopenDialog() - + ucrReceiverFactor.SetIncludedDataTypes({"factor"}) + ucrReceiverFactor.SetParameter(New RParameter("x", 0)) + ucrReceiverFactor.SetParameterIsRFunction() + + 'Set RadioBattons : Parameters yet to be set up + 'ucrPnlLevelOmitted.SetParameter(New RParameter("")) + 'ucrPnlLevelOmitted.AddRadioButton(rdoNone, "") + 'ucrPnlLevelOmitted.AddRadioButton(rdoFirst, "") + 'ucrPnlLevelOmitted.AddRadioButton(rdoLast, "") + 'ucrPnlLevelOmitted.AddRadioButton(rdoLevelNumber, "") + ucrPnlLevelOmitted.bAllowNonConditionValues = True + 'currently disabled sice the functions and parameters are yet to be set + ucrChkWithXVariable.Enabled = False + lblVariate.Enabled = False + ucrVariateReceiver.Enabled = False + ucrChkWithXVariable.SetText("With X Variable") + ' ucrChkWithXVariable.SetParameter(New RParameter("")) + grpLevelOmitted.Enabled = False + + 'Note: This was not implemented (Additions of ucrInputColumns were added for appending new columns with prefix "dummy" ): Just added if incase it was to be added otherwise it can be deleted + + 'ucrSaveDummy.SetPrefix("dummy") + 'ucrSaveDummy.SetSaveTypeAsColumn() + 'ucrSaveDummy.SetDataFrameSelector(ucrSelectorDummyVariable.ucrAvailableDataFrames) + 'ucrSaveDummy.SetCheckBoxText("Save Dummy:") + 'ucrSaveDummy.SetIsComboBox() + + ' ucrChkWithXVariable.AddToLinkedControls(ucrVariateReceiver, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedDisabledIfParameterMissing:=True) + 'ucrVariateReceiver.SetLinkedDisplayControl(lblVariate) End Sub - Private Sub chkXvariable_CheckedChanged(sender As Object, e As EventArgs) Handles chkXvariable.CheckedChanged - If chkXvariable.Checked Then - ucrVariateReceiver.Visible = True - lblVariate.Visible = True - ucrVariateReceiver.SetMeAsReceiver() + Private Sub TestOkEnabled() + If Not ucrReceiverFactor.IsEmpty AndAlso ((ucrChkWithXVariable.Checked AndAlso Not ucrVariateReceiver.IsEmpty) OrElse Not ucrChkWithXVariable.Checked) Then + ucrBase.OKEnabled(True) Else - ucrVariateReceiver.Visible = False - lblVariate.Visible = False - ucrReceiverFactor.SetMeAsReceiver() + ucrBase.OKEnabled(False) End If - End Sub - - Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset - SetDefaults() End Sub - Private Sub ucrReceiverFactor_Selectionchanged(sender As Object, e As EventArgs) Handles ucrReceiverFactor.SelectionChanged - ucrBase.clsRsyntax.AddParameter("x", clsRFunctionParameter:=ucrReceiverFactor.GetVariables) - TestOkEnabled() + + Private Sub SetRCodeForControls(bReset As Boolean) + SetRCode(Me, ucrBase.clsRsyntax.clsBaseFunction, bReset) End Sub - Private Sub ucrSelectorDummyVariable_DataFrameChanged() Handles ucrSelectorDummyVariable.DataFrameChanged - ucrBase.clsRsyntax.SetAssignTo(strAssignToName:="dummy_vars", strTempDataframe:=ucrSelectorDummyVariable.ucrAvailableDataFrames.cboAvailableDataFrames.Text, bAssignToColumnWithoutNames:=True) + 'Private Sub SetMeAsReceiver() + ' If ucrChkWithXVariable.Checked Then + ' ucrVariateReceiver.SetMeAsReceiver() + ' Else + ' ucrReceiverFactor.SetMeAsReceiver() + ' End If + 'End Sub + + 'Private Sub ucrChkWithXVariable_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkWithXVariable.ControlValueChanged + ' VariateVisible() + ' SetReceiver() + 'End Sub + + Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset + SetDefaults() + SetRCodeForControls(True) + TestOkEnabled() + End Sub + + Private Sub Controls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverFactor.ControlContentsChanged, ucrChkWithXVariable.ControlContentsChanged, ucrVariateReceiver.ControlContentsChanged + TestOkEnabled() End Sub End Class \ No newline at end of file diff --git a/instat/dlgFitCorruptionModel.vb b/instat/dlgFitCorruptionModel.vb index 8b677b1b72d..fc3fbac65e4 100644 --- a/instat/dlgFitCorruptionModel.vb +++ b/instat/dlgFitCorruptionModel.vb @@ -38,31 +38,31 @@ Public Class dlgFitCorruptionModel End If SetRCodeForControls(bReset) bReset = False - End Sub Private Sub InitialiseDialog() + ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False + 'helpID ' ucrBase.iHelpTopicID = ucrInputModelPreview.IsReadOnly = True - clsModel.SetOperation("~") - clsModel1.SetOperation("+") - clsModel.AddParameter(clsROperatorParameter:=clsModel1) - clsModel1.bBrackets = False - clsCorruptionModel.AddParameter("family", clsRFunctionParameter:=clsBinomialModel) clsBinomialModel.SetRCommand("binomial") clsBinomialModel.AddParameter("link", Chr(34) & "logit" & Chr(34)) + clsModel.SetOperation("~") + clsModel.AddParameter("input", clsROperatorParameter:=clsModel1, iPosition:=1) + 'Selector ucrSelectorFitModel.SetParameter(New RParameter("data", 0)) - ucrSelectorFitModel.SetParameterIsString() + ucrSelectorFitModel.SetParameterIsrfunction() 'Receivers ucrReceiverOutput.SetParameter(New RParameter("y", 1)) - ucrReceiverOutput.SetParameterIsRFunction() ' i think isRfunction here + ucrReceiverOutput.SetParameterIsRFunction() ucrReceiverOutput.Selector = ucrSelectorFitModel ucrReceiverOutput.SetIncludedDataTypes({"integer", "numeric", "logical"}) + ucrReceiverOutput.AddIncludedMetadataProperty("Is_Corruption_Output", {"TRUE"}) ucrReceiverControlVariables.SetParameter(New RParameter("x", 2)) ucrReceiverControlVariables.SetParameterIsString() @@ -83,6 +83,7 @@ Public Class dlgFitCorruptionModel Private Sub SetDefaults() clsCorruptionModel = New RFunction + ucrReceiverOutput.SetMeAsReceiver() 'Reset ucrSelectorFitModel.Reset() @@ -95,6 +96,7 @@ Public Class dlgFitCorruptionModel ucrBase.clsRsyntax.SetBaseRFunction(clsCorruptionModel) bResetSubdialog = True ChangeBaseFunction() + LoadSubdialog() End Sub Private Sub SetCurrentColumn(strColumn As String, strDataFrame As String) @@ -106,22 +108,21 @@ Public Class dlgFitCorruptionModel Private Sub SetDefaultColumn() ucrSelectorFitModel.ucrAvailableDataFrames.cboAvailableDataFrames.SelectedItem = strSelectedDataFrame ucrReceiverControlVariables.Add(strSelectedColumn, strSelectedDataFrame) + ucrReceiverIndicators.Add(strSelectedColumn, strSelectedDataFrame) bUseSelectedColumn = False End Sub Private Sub SetRCodeForControls(bReset As Boolean) - SetRCode(Me, ucrBase.clsRsyntax.clsBaseFunction, bReset) - ' ucrReceiverOutput.SetRCode(clsModel, bReset) - ' ucrReceiverIndicators.SetRCode(clsModel1, bReset) - ' ucrReceiverOutput.SetRCode(clsModel1, bReset) + 'ucrReceiverOutput.SetRCode(clsModel, bReset) + 'ucrReceiverControlVariables.SetRCode(clsModel1, bReset) + 'ucrReceiverIndicators.SetRCode(clsModel1, bReset) + ucrSelectorFitModel.SetRCode(clsCorruptionModel, bReset) + ucrSaveCorruptionModel.SetRCode(clsCorruptionModel, bReset) End Sub Private Sub TestOKEnabled() - If Not ucrReceiverOutput.IsEmpty AndAlso Not ucrReceiverIndicators.IsEmpty AndAlso Not ucrReceiverControlVariables.IsEmpty AndAlso ucrSaveCorruptionModel.IsComplete Then + If Not ucrReceiverOutput.IsEmpty AndAlso (Not ucrReceiverIndicators.IsEmpty OrElse Not ucrReceiverControlVariables.IsEmpty) AndAlso ucrSaveCorruptionModel.IsComplete Then ucrBase.OKEnabled(True) - ucrBase.clsRsyntax.RemoveParameter("formula") - ucrBase.clsRsyntax.clsBaseFunction.AddParameter("formula", clsROperatorParameter:=clsModel) - ucrInputModelPreview.SetName(clsModel.ToScript) Else ucrBase.OKEnabled(False) End If @@ -129,21 +130,31 @@ Public Class dlgFitCorruptionModel Private Sub ChangeBaseFunction() If ucrReceiverOutput.strCurrDataType = "numeric" OrElse ucrReceiverOutput.strCurrDataType = "integer" Then - ucrBase.clsRsyntax.SetFunction("lm") + clsCorruptionModel.SetRCommand("lm") + clsCorruptionModel.RemoveParameterByName("family") Else - ucrBase.clsRsyntax.SetFunction("glm") + clsCorruptionModel.SetRCommand("glm") + clsCorruptionModel.AddParameter("family", clsRFunctionParameter:=clsBinomialModel) End If End Sub Private Sub SetFormula() - If Not ucrReceiverOutput.IsEmpty AndAlso Not ucrReceiverIndicators.IsEmpty AndAlso Not ucrReceiverControlVariables.IsEmpty Then - ucrBase.clsRsyntax.RemoveParameter("formula") - clsModel.AddParameter(iPosition:=0, clsRFunctionParameter:=ucrReceiverOutput.GetVariables()) - clsModel.AddParameter(iPosition:=1, clsROperatorParameter:=clsModel1) - clsModel1.AddParameter(iPosition:=0, strParameterValue:=ucrReceiverControlVariables.GetVariableNames(False)) - clsModel1.AddParameter(iPosition:=1, strParameterValue:=ucrReceiverIndicators.GetVariableNames(False)) - ' not sure about the right hand side of the formula - ucrBase.clsRsyntax.clsBaseFunction.AddParameter("formula", clsROperatorParameter:=clsModel) + Dim i As Integer = 0 + If Not ucrReceiverOutput.IsEmpty AndAlso (Not ucrReceiverIndicators.IsEmpty OrElse Not ucrReceiverControlVariables.IsEmpty) Then + clsCorruptionModel.AddParameter("formula", clsROperatorParameter:=clsModel) + + clsModel.AddParameter("output", ucrReceiverOutput.GetVariableNames(False), iPosition:=0) + + clsModel1.SetOperation("+") + clsModel1.ClearParameters() + For Each strControlVar As String In ucrReceiverControlVariables.GetVariableNamesAsList + clsModel1.AddParameter(i, strControlVar, iPosition:=i) + i = i + 1 + Next + For Each strIndicatorVar As String In ucrReceiverIndicators.GetVariableNamesAsList + clsModel1.AddParameter(i, strIndicatorVar, iPosition:=i) + i = i + 1 + Next ucrInputModelPreview.SetName(clsModel.ToScript) End If End Sub @@ -159,13 +170,27 @@ Public Class dlgFitCorruptionModel End Sub Private Sub cmdDisplayOptions_Click(sender As Object, e As EventArgs) Handles cmdDisplayOptions.Click - ' sdgSimpleRegOptions.SetRFunction(ucrBase.clsRsyntax.clsBaseFunction, bResetSubdialog) - bResetSubdialog = False - sdgSimpleRegOptions.Show() + 'sdgSimpleRegOptions.SetRFunction(ucrBase.clsRsyntax.clsBaseFunction, bResetSubdialog) + 'bResetSubdialog = False + sdgSimpleRegOptions.ShowDialog() + End Sub + + Private Sub LoadSubdialog() + sdgSimpleRegOptions.SetRModelFunction(clsCorruptionModel) + sdgSimpleRegOptions.SetRDataFrame(ucrSelectorFitModel.ucrAvailableDataFrames) + sdgSimpleRegOptions.SetRYVariable(ucrReceiverOutput) + sdgSimpleRegOptions.SetDefaults() + sdgSimpleRegOptions.chkDisplayCLimits.Enabled = True + sdgSimpleRegOptions.lblDisplayCLevel.Enabled = True + sdgSimpleRegOptions.nudDisplayCLevel.Enabled = True End Sub Private Sub ucrReceiverOutput_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverOutput.ControlValueChanged, ucrReceiverControlVariables.ControlValueChanged, ucrReceiverIndicators.ControlValueChanged ChangeBaseFunction() SetFormula() End Sub + + Private Sub ucrBase_ClickOk(sender As Object, e As EventArgs) Handles ucrBase.ClickOk + sdgSimpleRegOptions.RegOptions() + End Sub End Class \ No newline at end of file diff --git a/instat/dlgImportFromCSPRO.Designer.vb b/instat/dlgImportFromCSPRO.Designer.vb new file mode 100644 index 00000000000..2d70b131ccb --- /dev/null +++ b/instat/dlgImportFromCSPRO.Designer.vb @@ -0,0 +1,52 @@ + _ +Partial Class dlgImportFromCSPRO + 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.ucrBase = New instat.ucrButtons() + Me.SuspendLayout() + ' + 'ucrBase + ' + Me.ucrBase.Location = New System.Drawing.Point(10, 326) + Me.ucrBase.Name = "ucrBase" + Me.ucrBase.Size = New System.Drawing.Size(410, 52) + Me.ucrBase.TabIndex = 0 + ' + 'dlgImportFromCSPRO + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(423, 377) + Me.Controls.Add(Me.ucrBase) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "dlgImportFromCSPRO" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "Import From CSPRO" + Me.ResumeLayout(False) + + End Sub + + Friend WithEvents ucrBase As ucrButtons +End Class diff --git a/instat/dlgImportFromCSPRO.resx b/instat/dlgImportFromCSPRO.resx new file mode 100644 index 00000000000..29dcb1b3a35 --- /dev/null +++ b/instat/dlgImportFromCSPRO.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/dlgImportFromCSPRO.vb b/instat/dlgImportFromCSPRO.vb new file mode 100644 index 00000000000..cba99ad9ec5 --- /dev/null +++ b/instat/dlgImportFromCSPRO.vb @@ -0,0 +1,58 @@ +' Instat-R +' Copyright (C) 2015 +' +' This program is free software: you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation, either version 3 of the License, or +' (at your option) any later version. +' +' This program is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. +' +' You should have received a copy of the GNU General Public License k +' along with this program. If not, see . +Imports instat.Translations + +Public Class dlgImportFromCSPRO + Private bFirstLoad As Boolean = True + Private bReset As Boolean = True + + Private Sub dlgImportFromCSPRO_Load(sender As Object, e As EventArgs) Handles MyBase.Load + If bFirstLoad Then + InitialiseDialog() + bFirstLoad = False + End If + + If bReset Then + SetDefaults() + End If + SetRCodeForControls(bReset) + bReset = False + autoTranslate(Me) + TestOkEnabled() + End Sub + + Private Sub SetRCodeForControls(bReset As Boolean) + + End Sub + + Private Sub TestOkEnabled() + + End Sub + + Private Sub InitialiseDialog() + + End Sub + + Private Sub SetDefaults() + + End Sub + + Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset + SetDefaults() + SetRCodeForControls(True) + TestOkEnabled() + End Sub +End Class diff --git a/instat/dlgInventoryPlot.designer.vb b/instat/dlgInventoryPlot.designer.vb index ede3afb98d5..4240d2f6ba3 100644 --- a/instat/dlgInventoryPlot.designer.vb +++ b/instat/dlgInventoryPlot.designer.vb @@ -22,200 +22,187 @@ Partial Class dlgInventoryPlot 'Do not modify it using the code editor. Private Sub InitializeComponent() - Me.lblYear = New System.Windows.Forms.Label() Me.lblDayOfyear = New System.Windows.Forms.Label() - Me.lblColourBand = New System.Windows.Forms.Label() - Me.lblDoY = New System.Windows.Forms.Label() Me.cmdOptions = New System.Windows.Forms.Button() - Me.lblThreshold = New System.Windows.Forms.Label() - Me.lblFacet = New System.Windows.Forms.Label() + Me.lblDate = New System.Windows.Forms.Label() + Me.lblStation = New System.Windows.Forms.Label() + Me.cmdInventoryPlotOptions = New System.Windows.Forms.Button() + Me.lblElement = New System.Windows.Forms.Label() + Me.ucrReceiverDate = New instat.ucrReceiverSingle() + Me.ucrInputTitle = New instat.ucrInputTextBox() + Me.ucrChkTitle = New instat.ucrCheck() + Me.ucrReceiverElements = New instat.ucrReceiverMultiple() + Me.ucrChkShowNonMissing = New instat.ucrCheck() Me.ucrSaveGraph = New instat.ucrSave() Me.ucrChkFlipCoordinates = New instat.ucrCheck() - Me.ucrChkAddRecodetoData = New instat.ucrCheck() - Me.ucrNudThreashold = New instat.ucrNud() - Me.ucrFacetsReceiver = New instat.ucrReceiverSingle() - Me.ucrColourReceiver = New instat.ucrReceiverSingle() - Me.ucrDayOfYearReceiver = New instat.ucrReceiverSingle() - Me.ucrYearReceiver = New instat.ucrReceiverSingle() + Me.ucrReceiverStation = New instat.ucrReceiverSingle() Me.ucrInventoryPlotSelector = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrBase = New instat.ucrButtons() Me.SuspendLayout() ' - 'lblYear - ' - Me.lblYear.AutoSize = True - Me.lblYear.Location = New System.Drawing.Point(289, 10) - Me.lblYear.Name = "lblYear" - Me.lblYear.Size = New System.Drawing.Size(29, 13) - Me.lblYear.TabIndex = 16 - Me.lblYear.Text = "Year" - ' 'lblDayOfyear ' Me.lblDayOfyear.AutoSize = True - Me.lblDayOfyear.Location = New System.Drawing.Point(289, 90) + Me.lblDayOfyear.Location = New System.Drawing.Point(289, 88) Me.lblDayOfyear.Name = "lblDayOfyear" Me.lblDayOfyear.Size = New System.Drawing.Size(0, 13) - Me.lblDayOfyear.TabIndex = 19 - ' - 'lblColourBand - ' - Me.lblColourBand.AutoSize = True - Me.lblColourBand.Location = New System.Drawing.Point(289, 113) - Me.lblColourBand.Name = "lblColourBand" - Me.lblColourBand.Size = New System.Drawing.Size(29, 13) - Me.lblColourBand.TabIndex = 20 - Me.lblColourBand.Text = "Rain" - ' - 'lblDoY - ' - Me.lblDoY.AutoSize = True - Me.lblDoY.Location = New System.Drawing.Point(289, 59) - Me.lblDoY.Name = "lblDoY" - Me.lblDoY.Size = New System.Drawing.Size(81, 13) - Me.lblDoY.TabIndex = 22 - Me.lblDoY.Text = "Day of the Year" + Me.lblDayOfyear.TabIndex = 15 ' 'cmdOptions ' Me.cmdOptions.Enabled = False - Me.cmdOptions.Location = New System.Drawing.Point(12, 204) + Me.cmdOptions.Location = New System.Drawing.Point(10, 205) Me.cmdOptions.Name = "cmdOptions" - Me.cmdOptions.Size = New System.Drawing.Size(75, 23) - Me.cmdOptions.TabIndex = 23 + Me.cmdOptions.Size = New System.Drawing.Size(119, 23) + Me.cmdOptions.TabIndex = 7 Me.cmdOptions.Text = "Options" Me.cmdOptions.UseVisualStyleBackColor = True ' - 'lblThreshold - ' - Me.lblThreshold.AutoSize = True - Me.lblThreshold.Location = New System.Drawing.Point(292, 165) - Me.lblThreshold.Name = "lblThreshold" - Me.lblThreshold.Size = New System.Drawing.Size(54, 13) - Me.lblThreshold.TabIndex = 27 - Me.lblThreshold.Text = "Threshold" - ' - 'lblFacet - ' - Me.lblFacet.AutoSize = True - Me.lblFacet.Location = New System.Drawing.Point(295, 189) - Me.lblFacet.Name = "lblFacet" - Me.lblFacet.Size = New System.Drawing.Size(49, 13) - Me.lblFacet.TabIndex = 29 - Me.lblFacet.Text = "Facet By" + 'lblDate + ' + Me.lblDate.AutoSize = True + Me.lblDate.Location = New System.Drawing.Point(260, 45) + Me.lblDate.Name = "lblDate" + Me.lblDate.Size = New System.Drawing.Size(33, 13) + Me.lblDate.TabIndex = 1 + Me.lblDate.Text = "Date:" + ' + 'lblStation + ' + Me.lblStation.AutoSize = True + Me.lblStation.Location = New System.Drawing.Point(261, 204) + Me.lblStation.Name = "lblStation" + Me.lblStation.Size = New System.Drawing.Size(88, 13) + Me.lblStation.TabIndex = 5 + Me.lblStation.Text = "Station(Optional):" + ' + 'cmdInventoryPlotOptions + ' + Me.cmdInventoryPlotOptions.Enabled = False + Me.cmdInventoryPlotOptions.Location = New System.Drawing.Point(10, 238) + Me.cmdInventoryPlotOptions.Name = "cmdInventoryPlotOptions" + Me.cmdInventoryPlotOptions.Size = New System.Drawing.Size(119, 23) + Me.cmdInventoryPlotOptions.TabIndex = 8 + Me.cmdInventoryPlotOptions.Text = "Inventory Plot Options" + Me.cmdInventoryPlotOptions.UseVisualStyleBackColor = True + ' + 'lblElement + ' + Me.lblElement.AutoSize = True + Me.lblElement.Location = New System.Drawing.Point(260, 86) + Me.lblElement.Name = "lblElement" + Me.lblElement.Size = New System.Drawing.Size(59, 13) + Me.lblElement.TabIndex = 3 + Me.lblElement.Text = "Element(s):" + ' + 'ucrReceiverDate + ' + Me.ucrReceiverDate.frmParent = Me + Me.ucrReceiverDate.Location = New System.Drawing.Point(263, 60) + Me.ucrReceiverDate.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverDate.Name = "ucrReceiverDate" + Me.ucrReceiverDate.Selector = Nothing + Me.ucrReceiverDate.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverDate.TabIndex = 2 + ' + 'ucrInputTitle + ' + Me.ucrInputTitle.AddQuotesIfUnrecognised = True + Me.ucrInputTitle.IsMultiline = False + Me.ucrInputTitle.IsReadOnly = False + Me.ucrInputTitle.Location = New System.Drawing.Point(119, 295) + Me.ucrInputTitle.Name = "ucrInputTitle" + Me.ucrInputTitle.Size = New System.Drawing.Size(259, 21) + Me.ucrInputTitle.TabIndex = 12 + ' + 'ucrChkTitle + ' + Me.ucrChkTitle.Checked = False + Me.ucrChkTitle.Location = New System.Drawing.Point(10, 297) + Me.ucrChkTitle.Name = "ucrChkTitle" + Me.ucrChkTitle.Size = New System.Drawing.Size(100, 20) + Me.ucrChkTitle.TabIndex = 11 + ' + 'ucrReceiverElements + ' + Me.ucrReceiverElements.frmParent = Me + Me.ucrReceiverElements.Location = New System.Drawing.Point(263, 101) + Me.ucrReceiverElements.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverElements.Name = "ucrReceiverElements" + Me.ucrReceiverElements.Selector = Nothing + Me.ucrReceiverElements.Size = New System.Drawing.Size(120, 100) + Me.ucrReceiverElements.TabIndex = 4 + ' + 'ucrChkShowNonMissing + ' + Me.ucrChkShowNonMissing.Checked = False + Me.ucrChkShowNonMissing.Location = New System.Drawing.Point(263, 270) + Me.ucrChkShowNonMissing.Name = "ucrChkShowNonMissing" + Me.ucrChkShowNonMissing.Size = New System.Drawing.Size(151, 20) + Me.ucrChkShowNonMissing.TabIndex = 10 + Me.ucrChkShowNonMissing.Visible = False ' 'ucrSaveGraph ' - Me.ucrSaveGraph.Location = New System.Drawing.Point(12, 253) + Me.ucrSaveGraph.Location = New System.Drawing.Point(10, 322) Me.ucrSaveGraph.Name = "ucrSaveGraph" - Me.ucrSaveGraph.Size = New System.Drawing.Size(277, 24) - Me.ucrSaveGraph.TabIndex = 33 + Me.ucrSaveGraph.Size = New System.Drawing.Size(283, 24) + Me.ucrSaveGraph.TabIndex = 13 ' 'ucrChkFlipCoordinates ' Me.ucrChkFlipCoordinates.Checked = False - Me.ucrChkFlipCoordinates.Location = New System.Drawing.Point(292, 263) + Me.ucrChkFlipCoordinates.Location = New System.Drawing.Point(263, 244) Me.ucrChkFlipCoordinates.Name = "ucrChkFlipCoordinates" - Me.ucrChkFlipCoordinates.Size = New System.Drawing.Size(100, 20) - Me.ucrChkFlipCoordinates.TabIndex = 32 - ' - 'ucrChkAddRecodetoData - ' - Me.ucrChkAddRecodetoData.Checked = False - Me.ucrChkAddRecodetoData.Location = New System.Drawing.Point(292, 237) - Me.ucrChkAddRecodetoData.Name = "ucrChkAddRecodetoData" - Me.ucrChkAddRecodetoData.Size = New System.Drawing.Size(100, 20) - Me.ucrChkAddRecodetoData.TabIndex = 31 - ' - 'ucrNudThreashold - ' - Me.ucrNudThreashold.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudThreashold.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudThreashold.Location = New System.Drawing.Point(362, 165) - Me.ucrNudThreashold.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudThreashold.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudThreashold.Name = "ucrNudThreashold" - Me.ucrNudThreashold.Size = New System.Drawing.Size(50, 20) - Me.ucrNudThreashold.TabIndex = 30 - Me.ucrNudThreashold.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrFacetsReceiver - ' - Me.ucrFacetsReceiver.frmParent = Me - Me.ucrFacetsReceiver.Location = New System.Drawing.Point(292, 204) - Me.ucrFacetsReceiver.Margin = New System.Windows.Forms.Padding(0) - Me.ucrFacetsReceiver.Name = "ucrFacetsReceiver" - Me.ucrFacetsReceiver.Selector = Nothing - Me.ucrFacetsReceiver.Size = New System.Drawing.Size(120, 20) - Me.ucrFacetsReceiver.TabIndex = 28 - ' - 'ucrColourReceiver - ' - Me.ucrColourReceiver.frmParent = Me - Me.ucrColourReceiver.Location = New System.Drawing.Point(292, 135) - Me.ucrColourReceiver.Margin = New System.Windows.Forms.Padding(0) - Me.ucrColourReceiver.Name = "ucrColourReceiver" - Me.ucrColourReceiver.Selector = Nothing - Me.ucrColourReceiver.Size = New System.Drawing.Size(120, 20) - Me.ucrColourReceiver.TabIndex = 18 - ' - 'ucrDayOfYearReceiver - ' - Me.ucrDayOfYearReceiver.frmParent = Me - Me.ucrDayOfYearReceiver.Location = New System.Drawing.Point(292, 82) - Me.ucrDayOfYearReceiver.Margin = New System.Windows.Forms.Padding(0) - Me.ucrDayOfYearReceiver.Name = "ucrDayOfYearReceiver" - Me.ucrDayOfYearReceiver.Selector = Nothing - Me.ucrDayOfYearReceiver.Size = New System.Drawing.Size(120, 20) - Me.ucrDayOfYearReceiver.TabIndex = 17 - ' - 'ucrYearReceiver - ' - Me.ucrYearReceiver.frmParent = Me - Me.ucrYearReceiver.Location = New System.Drawing.Point(292, 32) - Me.ucrYearReceiver.Margin = New System.Windows.Forms.Padding(0) - Me.ucrYearReceiver.Name = "ucrYearReceiver" - Me.ucrYearReceiver.Selector = Nothing - Me.ucrYearReceiver.Size = New System.Drawing.Size(120, 20) - Me.ucrYearReceiver.TabIndex = 15 + Me.ucrChkFlipCoordinates.Size = New System.Drawing.Size(151, 20) + Me.ucrChkFlipCoordinates.TabIndex = 9 + ' + 'ucrReceiverStation + ' + Me.ucrReceiverStation.frmParent = Me + Me.ucrReceiverStation.Location = New System.Drawing.Point(263, 219) + Me.ucrReceiverStation.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverStation.Name = "ucrReceiverStation" + Me.ucrReceiverStation.Selector = Nothing + Me.ucrReceiverStation.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverStation.TabIndex = 6 ' 'ucrInventoryPlotSelector ' Me.ucrInventoryPlotSelector.bShowHiddenColumns = False Me.ucrInventoryPlotSelector.bUseCurrentFilter = True - Me.ucrInventoryPlotSelector.Location = New System.Drawing.Point(9, 9) + Me.ucrInventoryPlotSelector.Location = New System.Drawing.Point(10, 10) Me.ucrInventoryPlotSelector.Margin = New System.Windows.Forms.Padding(0) Me.ucrInventoryPlotSelector.Name = "ucrInventoryPlotSelector" Me.ucrInventoryPlotSelector.Size = New System.Drawing.Size(210, 180) - Me.ucrInventoryPlotSelector.TabIndex = 13 + Me.ucrInventoryPlotSelector.TabIndex = 0 ' 'ucrBase ' - Me.ucrBase.Location = New System.Drawing.Point(9, 283) + Me.ucrBase.Location = New System.Drawing.Point(10, 352) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(410, 53) - Me.ucrBase.TabIndex = 12 + Me.ucrBase.TabIndex = 14 ' 'dlgInventoryPlot ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(431, 337) + Me.ClientSize = New System.Drawing.Size(417, 413) + Me.Controls.Add(Me.lblElement) + Me.Controls.Add(Me.ucrReceiverDate) + Me.Controls.Add(Me.ucrInputTitle) + Me.Controls.Add(Me.ucrChkTitle) + Me.Controls.Add(Me.cmdInventoryPlotOptions) + Me.Controls.Add(Me.lblDate) + Me.Controls.Add(Me.ucrReceiverElements) + Me.Controls.Add(Me.ucrChkShowNonMissing) Me.Controls.Add(Me.ucrSaveGraph) Me.Controls.Add(Me.ucrChkFlipCoordinates) - Me.Controls.Add(Me.ucrChkAddRecodetoData) - Me.Controls.Add(Me.ucrNudThreashold) - Me.Controls.Add(Me.lblFacet) - Me.Controls.Add(Me.ucrFacetsReceiver) - Me.Controls.Add(Me.lblThreshold) Me.Controls.Add(Me.cmdOptions) - Me.Controls.Add(Me.lblDoY) - Me.Controls.Add(Me.lblColourBand) Me.Controls.Add(Me.lblDayOfyear) - Me.Controls.Add(Me.ucrColourReceiver) - Me.Controls.Add(Me.ucrDayOfYearReceiver) - Me.Controls.Add(Me.lblYear) - Me.Controls.Add(Me.ucrYearReceiver) + Me.Controls.Add(Me.lblStation) + Me.Controls.Add(Me.ucrReceiverStation) Me.Controls.Add(Me.ucrInventoryPlotSelector) Me.Controls.Add(Me.ucrBase) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow @@ -231,19 +218,18 @@ Partial Class dlgInventoryPlot End Sub Friend WithEvents ucrBase As ucrButtons Friend WithEvents ucrInventoryPlotSelector As ucrSelectorByDataFrameAddRemove - Friend WithEvents ucrYearReceiver As ucrReceiverSingle - Friend WithEvents lblYear As Label - Friend WithEvents ucrDayOfYearReceiver As ucrReceiverSingle - Friend WithEvents ucrColourReceiver As ucrReceiverSingle Friend WithEvents lblDayOfyear As Label - Friend WithEvents lblColourBand As Label - Friend WithEvents lblDoY As Label Friend WithEvents cmdOptions As Button - Friend WithEvents lblThreshold As Label - Friend WithEvents ucrFacetsReceiver As ucrReceiverSingle - Friend WithEvents lblFacet As Label Friend WithEvents ucrChkFlipCoordinates As ucrCheck - Friend WithEvents ucrChkAddRecodetoData As ucrCheck - Friend WithEvents ucrNudThreashold As ucrNud Friend WithEvents ucrSaveGraph As ucrSave + Friend WithEvents ucrChkShowNonMissing As ucrCheck + Friend WithEvents lblDate As Label + Friend WithEvents ucrReceiverElements As ucrReceiverMultiple + Friend WithEvents lblStation As Label + Friend WithEvents ucrReceiverStation As ucrReceiverSingle + Friend WithEvents cmdInventoryPlotOptions As Button + Friend WithEvents ucrInputTitle As ucrInputTextBox + Friend WithEvents ucrChkTitle As ucrCheck + Friend WithEvents ucrReceiverDate As ucrReceiverSingle + Friend WithEvents lblElement As Label End Class diff --git a/instat/dlgInventoryPlot.vb b/instat/dlgInventoryPlot.vb index fc019893331..7678893c5c4 100644 --- a/instat/dlgInventoryPlot.vb +++ b/instat/dlgInventoryPlot.vb @@ -16,6 +16,7 @@ Imports instat.Translations Public Class dlgInventoryPlot + Private bFirstLoad As Boolean = True Private bReset As Boolean = True @@ -37,43 +38,38 @@ Public Class dlgInventoryPlot ucrBase.iHelpTopicID = 359 ucrBase.clsRsyntax.iCallType = 3 - ucrYearReceiver.Selector = ucrInventoryPlotSelector - ucrColourReceiver.Selector = ucrInventoryPlotSelector - ucrDayOfYearReceiver.Selector = ucrInventoryPlotSelector - ucrFacetsReceiver.Selector = ucrInventoryPlotSelector - - ucrYearReceiver.Selector = ucrInventoryPlotSelector - ucrYearReceiver.SetMeAsReceiver() - ucrYearReceiver.SetParameter(New RParameter("year")) - ucrYearReceiver.SetParameterIsString() + ucrChkTitle.AddToLinkedControls(ucrInputTitle, objValues:={True}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True) - ucrColourReceiver.Selector = ucrInventoryPlotSelector - ucrColourReceiver.SetIncludedDataTypes({"numeric"}) - ucrColourReceiver.SetParameter(New RParameter("col_name")) - ucrColourReceiver.SetParameterIsString() + ucrReceiverElements.Selector = ucrInventoryPlotSelector + ucrReceiverElements.SetIncludedDataTypes({"numeric"}) + ucrReceiverElements.SetParameter(New RParameter("elements_col", 2)) + ucrReceiverElements.SetParameterIsString() - ucrDayOfYearReceiver.Selector = ucrInventoryPlotSelector - ucrDayOfYearReceiver.SetIncludedDataTypes({"numeric"}) - ucrDayOfYearReceiver.SetParameter(New RParameter("doy")) - ucrDayOfYearReceiver.SetParameterIsString() + ucrReceiverStation.Selector = ucrInventoryPlotSelector + ucrReceiverStation.SetIncludedDataTypes({"factor"}) + ucrReceiverStation.SetParameter(New RParameter("station_col", 3)) + ucrReceiverDate.SetClimaticType("station") + ucrReceiverStation.SetParameterIsString() - ucrFacetsReceiver.Selector = ucrInventoryPlotSelector - ucrFacetsReceiver.SetParameter(New RParameter("facets")) - ucrFacetsReceiver.SetParameterIsString() + ucrReceiverDate.Selector = ucrInventoryPlotSelector + ucrReceiverDate.SetParameter(New RParameter("date_col", 1)) + ucrReceiverDate.SetClimaticType("date") + ucrReceiverDate.bAutoFill = True + ucrReceiverDate.SetParameterIsString() ucrInventoryPlotSelector.SetParameter(New RParameter("data_name", 0)) ucrInventoryPlotSelector.SetParameterIsString() - ucrChkAddRecodetoData.SetText("Add Recode to Data") - ucrChkAddRecodetoData.SetParameter(New RParameter("add_to_data")) - ucrChkAddRecodetoData.SetValuesCheckedAndUnchecked("TRUE", "FALSE") - ucrChkAddRecodetoData.SetRDefault("FALSE") - ucrChkFlipCoordinates.SetText("Flip Coordinates") + ucrChkFlipCoordinates.SetParameter(New RParameter("coord_flip", 4)) + ucrChkFlipCoordinates.SetValuesCheckedAndUnchecked("TRUE", "FALSE") + + ucrChkTitle.SetText("Title") + ucrInputTitle.SetParameter(New RParameter("graph_title", 5)) - ucrChkAddRecodetoData.SetParameter(New RParameter("coord_flip")) - ucrChkAddRecodetoData.SetValuesCheckedAndUnchecked("TRUE", "FALSE") - ucrChkAddRecodetoData.SetRDefault("FALSE") + ucrChkShowNonMissing.SetText("Show Non Missing") + ucrChkShowNonMissing.SetParameter(New RParameter("")) + ucrChkShowNonMissing.SetValuesCheckedAndUnchecked("TRUE", "FALSE") ucrSaveGraph.SetPrefix("Inventory") ucrSaveGraph.SetSaveTypeAsGraph() @@ -81,16 +77,10 @@ Public Class dlgInventoryPlot ucrSaveGraph.SetCheckBoxText("Save Graph") ucrSaveGraph.SetIsComboBox() ucrSaveGraph.SetAssignToIfUncheckedValue("last_graph") - - ucrNudThreashold.SetParameter(New RParameter("threshold")) - ucrNudThreashold.Minimum = 0.85 - ucrNudThreashold.Increment = 0.01 - ucrNudThreashold.DecimalPlaces = 2 - ucrNudThreashold.SetRDefault("0.85") End Sub Private Sub TestOkEnabled() - If (Not ucrYearReceiver.IsEmpty AndAlso Not ucrDayOfYearReceiver.IsEmpty AndAlso Not ucrColourReceiver.IsEmpty) AndAlso ucrSaveGraph.IsComplete() Then + If (Not ucrReceiverDate.IsEmpty AndAlso Not ucrReceiverElements.IsEmpty AndAlso ucrSaveGraph.IsComplete) AndAlso (ucrChkTitle.Checked AndAlso Not ucrInputTitle.IsEmpty OrElse ucrChkTitle.Checked = False) Then ucrBase.OKEnabled(True) Else ucrBase.OKEnabled(False) @@ -99,15 +89,17 @@ Public Class dlgInventoryPlot Private Sub SetDefaults() Dim clsDefaultRFunction As New RFunction - ucrInventoryPlotSelector.Reset() ucrSaveGraph.Reset() - ucrYearReceiver.SetMeAsReceiver() + ucrReceiverDate.SetMeAsReceiver() + ucrChkTitle.Checked = False + ucrInputTitle.SetName("") clsDefaultRFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$make_inventory_plot") - clsDefaultRFunction.AddParameter("threshold", "0.85") + clsDefaultRFunction.AddParameter("coord_flip", Chr(34) & "FALSE" & Chr(34)) clsDefaultRFunction.SetAssignTo("last_graph", strTempDataframe:=ucrInventoryPlotSelector.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") - ucrBase.clsRsyntax.SetBaseRFunction(clsDefaultRFunction.Clone()) + ucrBase.clsRsyntax.SetBaseRFunction(clsDefaultRFunction) + TestOkEnabled() End Sub @@ -124,9 +116,10 @@ Public Class dlgInventoryPlot Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset SetDefaults() SetRCodeForControls(True) + TestOkEnabled() End Sub - Private Sub AllControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrYearReceiver.ControlContentsChanged, ucrColourReceiver.ControlContentsChanged, ucrDayOfYearReceiver.ControlContentsChanged, ucrSaveGraph.ControlContentsChanged + Private Sub AllControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrSaveGraph.ControlContentsChanged, ucrReceiverElements.ControlContentsChanged, ucrChkTitle.ControlContentsChanged, ucrInputTitle.ControlContentsChanged, ucrReceiverDate.ControlContentsChanged TestOkEnabled() End Sub End Class \ No newline at end of file diff --git a/instat/dlgNewSummaryTables.Designer.vb b/instat/dlgNewSummaryTables.Designer.vb new file mode 100644 index 00000000000..c8c710da4a0 --- /dev/null +++ b/instat/dlgNewSummaryTables.Designer.vb @@ -0,0 +1,247 @@ + _ +Partial Class dlgNewSummaryTables + 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.lblFactors = New System.Windows.Forms.Label() + Me.lblSummaryColumns = New System.Windows.Forms.Label() + Me.GroupBox1 = New System.Windows.Forms.GroupBox() + Me.lblDecimals = New System.Windows.Forms.Label() + Me.lblColumnFactors = New System.Windows.Forms.Label() + Me.cmdSummaries = New System.Windows.Forms.Button() + Me.ucrNudDecimals = New instat.ucrNud() + Me.ucrNudColumnFactors = New instat.ucrNud() + Me.ucrchkCheckDisplayMargins = New instat.ucrCheck() + Me.ucrchkCheckSummaries = New instat.ucrCheck() + Me.ucrBase = New instat.ucrButtons() + Me.ucrReceiverNumeric = New instat.ucrReceiverMultiple() + Me.ucrReceiverFactor = New instat.ucrReceiverMultiple() + Me.ucrSingleReceiver = New instat.ucrReceiverSingle() + Me.ucrchkCheckWeight = New instat.ucrCheck() + Me.ucrFactorsSelector = New instat.ucrSelectorByDataFrameAddRemove() + Me.GroupBox1.SuspendLayout() + Me.SuspendLayout() + ' + 'lblFactors + ' + Me.lblFactors.AutoSize = True + Me.lblFactors.Location = New System.Drawing.Point(265, 45) + Me.lblFactors.Name = "lblFactors" + Me.lblFactors.Size = New System.Drawing.Size(45, 13) + Me.lblFactors.TabIndex = 1 + Me.lblFactors.Tag = "Factors:" + Me.lblFactors.Text = "Factors:" + ' + 'lblSummaryColumns + ' + Me.lblSummaryColumns.AutoSize = True + Me.lblSummaryColumns.Location = New System.Drawing.Point(266, 170) + Me.lblSummaryColumns.Name = "lblSummaryColumns" + Me.lblSummaryColumns.Size = New System.Drawing.Size(96, 13) + Me.lblSummaryColumns.TabIndex = 3 + Me.lblSummaryColumns.Tag = "Summary_Columns" + Me.lblSummaryColumns.Text = "Summary Columns:" + ' + 'GroupBox1 + ' + Me.GroupBox1.Controls.Add(Me.ucrNudDecimals) + Me.GroupBox1.Controls.Add(Me.lblDecimals) + Me.GroupBox1.Controls.Add(Me.ucrNudColumnFactors) + Me.GroupBox1.Controls.Add(Me.lblColumnFactors) + Me.GroupBox1.Controls.Add(Me.ucrchkCheckDisplayMargins) + Me.GroupBox1.Location = New System.Drawing.Point(10, 257) + Me.GroupBox1.Name = "GroupBox1" + Me.GroupBox1.Size = New System.Drawing.Size(159, 101) + Me.GroupBox1.TabIndex = 8 + Me.GroupBox1.TabStop = False + Me.GroupBox1.Text = "Layout:" + ' + 'lblDecimals + ' + Me.lblDecimals.AutoSize = True + Me.lblDecimals.Location = New System.Drawing.Point(5, 65) + Me.lblDecimals.Name = "lblDecimals" + Me.lblDecimals.Size = New System.Drawing.Size(53, 13) + Me.lblDecimals.TabIndex = 3 + Me.lblDecimals.Tag = "Decimals" + Me.lblDecimals.Text = "Decimals:" + ' + 'lblColumnFactors + ' + Me.lblColumnFactors.AutoSize = True + Me.lblColumnFactors.Location = New System.Drawing.Point(5, 42) + Me.lblColumnFactors.Name = "lblColumnFactors" + Me.lblColumnFactors.Size = New System.Drawing.Size(83, 13) + Me.lblColumnFactors.TabIndex = 1 + Me.lblColumnFactors.Tag = "Column_Factors" + Me.lblColumnFactors.Text = "Column Factors:" + ' + 'cmdSummaries + ' + Me.cmdSummaries.Location = New System.Drawing.Point(309, 288) + Me.cmdSummaries.Name = "cmdSummaries" + Me.cmdSummaries.Size = New System.Drawing.Size(75, 23) + Me.cmdSummaries.TabIndex = 9 + Me.cmdSummaries.Text = "Summaries" + Me.cmdSummaries.UseVisualStyleBackColor = True + ' + 'ucrNudDecimals + ' + Me.ucrNudDecimals.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudDecimals.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudDecimals.Location = New System.Drawing.Point(90, 65) + Me.ucrNudDecimals.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudDecimals.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudDecimals.Name = "ucrNudDecimals" + Me.ucrNudDecimals.Size = New System.Drawing.Size(50, 20) + Me.ucrNudDecimals.TabIndex = 4 + Me.ucrNudDecimals.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrNudColumnFactors + ' + Me.ucrNudColumnFactors.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudColumnFactors.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudColumnFactors.Location = New System.Drawing.Point(90, 40) + Me.ucrNudColumnFactors.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudColumnFactors.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudColumnFactors.Name = "ucrNudColumnFactors" + Me.ucrNudColumnFactors.Size = New System.Drawing.Size(50, 20) + Me.ucrNudColumnFactors.TabIndex = 2 + Me.ucrNudColumnFactors.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrchkCheckDisplayMargins + ' + Me.ucrchkCheckDisplayMargins.Checked = False + Me.ucrchkCheckDisplayMargins.Location = New System.Drawing.Point(5, 19) + Me.ucrchkCheckDisplayMargins.Name = "ucrchkCheckDisplayMargins" + Me.ucrchkCheckDisplayMargins.Size = New System.Drawing.Size(104, 20) + Me.ucrchkCheckDisplayMargins.TabIndex = 0 + ' + 'ucrchkCheckSummaries + ' + Me.ucrchkCheckSummaries.Checked = False + Me.ucrchkCheckSummaries.Location = New System.Drawing.Point(10, 229) + Me.ucrchkCheckSummaries.Name = "ucrchkCheckSummaries" + Me.ucrchkCheckSummaries.Size = New System.Drawing.Size(242, 20) + Me.ucrchkCheckSummaries.TabIndex = 7 + ' + 'ucrBase + ' + Me.ucrBase.Location = New System.Drawing.Point(10, 364) + Me.ucrBase.Name = "ucrBase" + Me.ucrBase.Size = New System.Drawing.Size(435, 52) + Me.ucrBase.TabIndex = 10 + ' + 'ucrReceiverNumeric + ' + Me.ucrReceiverNumeric.frmParent = Me + Me.ucrReceiverNumeric.Location = New System.Drawing.Point(264, 185) + Me.ucrReceiverNumeric.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverNumeric.Name = "ucrReceiverNumeric" + Me.ucrReceiverNumeric.Selector = Nothing + Me.ucrReceiverNumeric.Size = New System.Drawing.Size(120, 100) + Me.ucrReceiverNumeric.TabIndex = 4 + ' + 'ucrReceiverFactor + ' + Me.ucrReceiverFactor.frmParent = Me + Me.ucrReceiverFactor.Location = New System.Drawing.Point(264, 60) + Me.ucrReceiverFactor.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverFactor.Name = "ucrReceiverFactor" + Me.ucrReceiverFactor.Selector = Nothing + Me.ucrReceiverFactor.Size = New System.Drawing.Size(120, 100) + Me.ucrReceiverFactor.TabIndex = 2 + ' + 'ucrSingleReceiver + ' + Me.ucrSingleReceiver.frmParent = Me + Me.ucrSingleReceiver.Location = New System.Drawing.Point(96, 204) + Me.ucrSingleReceiver.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSingleReceiver.Name = "ucrSingleReceiver" + Me.ucrSingleReceiver.Selector = Nothing + Me.ucrSingleReceiver.Size = New System.Drawing.Size(120, 20) + Me.ucrSingleReceiver.TabIndex = 6 + ' + 'ucrchkCheckWeight + ' + Me.ucrchkCheckWeight.Checked = False + Me.ucrchkCheckWeight.Location = New System.Drawing.Point(10, 204) + Me.ucrchkCheckWeight.Name = "ucrchkCheckWeight" + Me.ucrchkCheckWeight.Size = New System.Drawing.Size(84, 20) + Me.ucrchkCheckWeight.TabIndex = 5 + ' + 'ucrFactorsSelector + ' + Me.ucrFactorsSelector.bShowHiddenColumns = False + Me.ucrFactorsSelector.bUseCurrentFilter = True + Me.ucrFactorsSelector.Location = New System.Drawing.Point(10, 10) + Me.ucrFactorsSelector.Margin = New System.Windows.Forms.Padding(0) + Me.ucrFactorsSelector.Name = "ucrFactorsSelector" + Me.ucrFactorsSelector.Size = New System.Drawing.Size(210, 182) + Me.ucrFactorsSelector.TabIndex = 0 + ' + 'dlgNewSummaryTables + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(409, 428) + Me.Controls.Add(Me.cmdSummaries) + Me.Controls.Add(Me.GroupBox1) + Me.Controls.Add(Me.ucrchkCheckSummaries) + Me.Controls.Add(Me.ucrBase) + Me.Controls.Add(Me.ucrReceiverNumeric) + Me.Controls.Add(Me.lblSummaryColumns) + Me.Controls.Add(Me.ucrReceiverFactor) + Me.Controls.Add(Me.ucrSingleReceiver) + Me.Controls.Add(Me.ucrchkCheckWeight) + Me.Controls.Add(Me.lblFactors) + Me.Controls.Add(Me.ucrFactorsSelector) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "dlgNewSummaryTables" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "New Summary Tables" + Me.GroupBox1.ResumeLayout(False) + Me.GroupBox1.PerformLayout() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents ucrFactorsSelector As ucrSelectorByDataFrameAddRemove + Friend WithEvents lblFactors As Label + Friend WithEvents ucrchkCheckWeight As ucrCheck + Friend WithEvents ucrSingleReceiver As ucrReceiverSingle + Friend WithEvents ucrReceiverFactor As ucrReceiverMultiple + Friend WithEvents ucrReceiverNumeric As ucrReceiverMultiple + Friend WithEvents lblSummaryColumns As Label + Friend WithEvents ucrBase As ucrButtons + Friend WithEvents ucrchkCheckSummaries As ucrCheck + Friend WithEvents cmdSummaries As Button + Friend WithEvents GroupBox1 As GroupBox + Friend WithEvents ucrNudDecimals As ucrNud + Friend WithEvents lblDecimals As Label + Friend WithEvents ucrNudColumnFactors As ucrNud + Friend WithEvents lblColumnFactors As Label + Friend WithEvents ucrchkCheckDisplayMargins As ucrCheck +End Class diff --git a/instat/dlgNewSummaryTables.resx b/instat/dlgNewSummaryTables.resx new file mode 100644 index 00000000000..29dcb1b3a35 --- /dev/null +++ b/instat/dlgNewSummaryTables.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/dlgNewSummaryTables.vb b/instat/dlgNewSummaryTables.vb new file mode 100644 index 00000000000..1b4ce9a00ab --- /dev/null +++ b/instat/dlgNewSummaryTables.vb @@ -0,0 +1,90 @@ +' Instat-R +' Copyright (C) 2015 +' +' This program is free software: you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation, either version 3 of the License, or +' (at your option) any later version. +' +' This program is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. +' +' You should have received a copy of the GNU General Public License k +' along with this program. If not, see . + +Imports instat.Translations +Public Class dlgNewSummaryTables + Private bFirstload As Boolean = True + Private bReset As Boolean = True + Private Sub dlgNewSummaryTables_Load(sender As Object, e As EventArgs) Handles MyBase.Load + autoTranslate(Me) + If bFirstload Then + InitialiseDialog() + bFirstload = False + End If + If bReset Then + SetDefaults() + End If + bReset = False + TestOKEnabled() + End Sub + + Public Sub SetRCodeForControls(bReset As Boolean) + + End Sub + + Private Sub SetDefaults() + ucrReceiverFactor.SetMeAsReceiver() + ucrFactorsSelector.Reset() + TestOKEnabled() + End Sub + + Private Sub InitialiseDialog() + ucrReceiverFactor.Selector = ucrFactorsSelector + ucrReceiverNumeric.Selector = ucrFactorsSelector + ucrSingleReceiver.Selector = ucrFactorsSelector + ucrReceiverFactor.SetDataType("factor") + ucrReceiverNumeric.SetDataType("numeric") + ucrchkCheckWeight.SetText("Weights") + ucrchkCheckSummaries.SetText("Treat Summary Columns as a Further Factor") + ucrchkCheckDisplayMargins.SetText("Display Margins") + ucrchkCheckWeight.AddToLinkedControls(ucrSingleReceiver, {True}, bNewLinkedHideIfParameterMissing:=True) + End Sub + + Private Sub EnableCheckSummaries() + If ucrReceiverNumeric.lstSelectedVariables.Items.Count > 1 Then + ucrchkCheckSummaries.Enabled = True + Else + ucrchkCheckSummaries.Enabled = False + End If + End Sub + + Private Sub TestOKEnabled() + If (Not ucrReceiverFactor.IsEmpty OrElse Not ucrReceiverNumeric.IsEmpty) AndAlso ucrNudColumnFactors.GetText <> "" AndAlso ucrNudDecimals.GetText <> "" AndAlso (Not ucrchkCheckWeight.Checked OrElse (ucrchkCheckWeight.Checked AndAlso Not ucrSingleReceiver.IsEmpty)) Then + ucrBase.OKEnabled(True) + Else + ucrBase.OKEnabled(False) + End If + End Sub + + Private Sub cmdSummaries_Click(sender As Object, e As EventArgs) + sdgSummaries.ShowDialog() + End Sub + + Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset + SetDefaults() + SetRCodeForControls(True) + TestOKEnabled() + End Sub + + Private Sub ucrReceiverNumeric_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverNumeric.ControlValueChanged + EnableCheckSummaries() + End Sub + + Private Sub ucrReceiverFactor_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverFactor.ControlContentsChanged, ucrchkCheckWeight.ControlContentsChanged, ucrSingleReceiver.ControlContentsChanged, ucrNudColumnFactors.ControlContentsChanged, ucrNudDecimals.ControlContentsChanged, ucrReceiverNumeric.ControlContentsChanged + TestOKEnabled() + End Sub + +End Class \ No newline at end of file diff --git a/instat/dlgOneWayFrequencies.Designer.vb b/instat/dlgOneWayFrequencies.Designer.vb new file mode 100644 index 00000000000..b645363876a --- /dev/null +++ b/instat/dlgOneWayFrequencies.Designer.vb @@ -0,0 +1,224 @@ + _ +Partial Class dlgOneWayFrequencies + 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.grpSort = New System.Windows.Forms.GroupBox() + Me.rdoDescending = New System.Windows.Forms.RadioButton() + Me.rdoAscending = New System.Windows.Forms.RadioButton() + Me.rdoNone = New System.Windows.Forms.RadioButton() + Me.ucrPnlSort = New instat.UcrPanel() + Me.cmdOptions = New System.Windows.Forms.Button() + Me.lblSelectedVariable = New System.Windows.Forms.Label() + Me.ucrChkFlip = New instat.ucrCheck() + Me.ucrChkGraph = New instat.ucrCheck() + Me.ucrChkTable = New instat.ucrCheck() + Me.ucrBase = New instat.ucrButtons() + Me.ucrSaveGraph = New instat.ucrSave() + Me.ucrReceiverOneWayFreq = New instat.ucrReceiverSingle() + Me.ucrSelectorOneWayFreq = New instat.ucrSelectorByDataFrameAddRemove() + Me.ucrChkweights = New instat.ucrCheck() + Me.grpSort.SuspendLayout() + Me.SuspendLayout() + ' + 'grpSort + ' + Me.grpSort.Controls.Add(Me.rdoDescending) + Me.grpSort.Controls.Add(Me.rdoAscending) + Me.grpSort.Controls.Add(Me.rdoNone) + Me.grpSort.Controls.Add(Me.ucrPnlSort) + Me.grpSort.Location = New System.Drawing.Point(267, 114) + Me.grpSort.Name = "grpSort" + Me.grpSort.Size = New System.Drawing.Size(123, 91) + Me.grpSort.TabIndex = 14 + Me.grpSort.TabStop = False + Me.grpSort.Text = "Sort" + ' + 'rdoDescending + ' + Me.rdoDescending.AutoSize = True + Me.rdoDescending.Location = New System.Drawing.Point(10, 65) + Me.rdoDescending.Name = "rdoDescending" + Me.rdoDescending.Size = New System.Drawing.Size(82, 17) + Me.rdoDescending.TabIndex = 3 + Me.rdoDescending.TabStop = True + Me.rdoDescending.Text = "Descending" + Me.rdoDescending.UseVisualStyleBackColor = True + ' + 'rdoAscending + ' + Me.rdoAscending.AutoSize = True + Me.rdoAscending.Location = New System.Drawing.Point(10, 43) + Me.rdoAscending.Name = "rdoAscending" + Me.rdoAscending.Size = New System.Drawing.Size(75, 17) + Me.rdoAscending.TabIndex = 2 + Me.rdoAscending.TabStop = True + Me.rdoAscending.Text = "Ascending" + Me.rdoAscending.UseVisualStyleBackColor = True + ' + 'rdoNone + ' + Me.rdoNone.AutoSize = True + Me.rdoNone.Location = New System.Drawing.Point(10, 21) + Me.rdoNone.Name = "rdoNone" + Me.rdoNone.Size = New System.Drawing.Size(51, 17) + Me.rdoNone.TabIndex = 1 + Me.rdoNone.TabStop = True + Me.rdoNone.Text = "None" + Me.rdoNone.UseVisualStyleBackColor = True + ' + 'ucrPnlSort + ' + Me.ucrPnlSort.Location = New System.Drawing.Point(3, 16) + Me.ucrPnlSort.Name = "ucrPnlSort" + Me.ucrPnlSort.Size = New System.Drawing.Size(114, 69) + Me.ucrPnlSort.TabIndex = 0 + ' + 'cmdOptions + ' + Me.cmdOptions.Location = New System.Drawing.Point(280, 216) + Me.cmdOptions.Name = "cmdOptions" + Me.cmdOptions.Size = New System.Drawing.Size(69, 23) + Me.cmdOptions.TabIndex = 15 + Me.cmdOptions.Text = " Options" + Me.cmdOptions.UseVisualStyleBackColor = True + ' + 'lblSelectedVariable + ' + Me.lblSelectedVariable.AutoSize = True + Me.lblSelectedVariable.Location = New System.Drawing.Point(267, 61) + Me.lblSelectedVariable.Name = "lblSelectedVariable" + Me.lblSelectedVariable.Size = New System.Drawing.Size(93, 13) + Me.lblSelectedVariable.TabIndex = 16 + Me.lblSelectedVariable.Text = "Selected Variable:" + ' + 'ucrChkFlip + ' + Me.ucrChkFlip.Checked = False + Me.ucrChkFlip.Location = New System.Drawing.Point(10, 202) + Me.ucrChkFlip.Name = "ucrChkFlip" + Me.ucrChkFlip.Size = New System.Drawing.Size(145, 20) + Me.ucrChkFlip.TabIndex = 17 + ' + 'ucrChkGraph + ' + Me.ucrChkGraph.Checked = False + Me.ucrChkGraph.Location = New System.Drawing.Point(9, 252) + Me.ucrChkGraph.Name = "ucrChkGraph" + Me.ucrChkGraph.Size = New System.Drawing.Size(145, 20) + Me.ucrChkGraph.TabIndex = 12 + ' + 'ucrChkTable + ' + Me.ucrChkTable.Checked = False + Me.ucrChkTable.Location = New System.Drawing.Point(10, 227) + Me.ucrChkTable.Name = "ucrChkTable" + Me.ucrChkTable.Size = New System.Drawing.Size(145, 20) + Me.ucrChkTable.TabIndex = 10 + ' + 'ucrBase + ' + Me.ucrBase.Location = New System.Drawing.Point(9, 302) + Me.ucrBase.Name = "ucrBase" + Me.ucrBase.Size = New System.Drawing.Size(410, 52) + Me.ucrBase.TabIndex = 6 + ' + 'ucrSaveGraph + ' + Me.ucrSaveGraph.Location = New System.Drawing.Point(9, 277) + Me.ucrSaveGraph.Name = "ucrSaveGraph" + Me.ucrSaveGraph.Size = New System.Drawing.Size(294, 24) + Me.ucrSaveGraph.TabIndex = 5 + ' + 'ucrReceiverOneWayFreq + ' + Me.ucrReceiverOneWayFreq.frmParent = Me + Me.ucrReceiverOneWayFreq.Location = New System.Drawing.Point(270, 77) + Me.ucrReceiverOneWayFreq.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverOneWayFreq.Name = "ucrReceiverOneWayFreq" + Me.ucrReceiverOneWayFreq.Selector = Nothing + Me.ucrReceiverOneWayFreq.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverOneWayFreq.TabIndex = 1 + ' + 'ucrSelectorOneWayFreq + ' + Me.ucrSelectorOneWayFreq.bShowHiddenColumns = False + Me.ucrSelectorOneWayFreq.bUseCurrentFilter = True + Me.ucrSelectorOneWayFreq.Location = New System.Drawing.Point(10, 10) + Me.ucrSelectorOneWayFreq.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectorOneWayFreq.Name = "ucrSelectorOneWayFreq" + Me.ucrSelectorOneWayFreq.Size = New System.Drawing.Size(210, 180) + Me.ucrSelectorOneWayFreq.TabIndex = 0 + ' + 'ucrChkweights + ' + Me.ucrChkweights.Checked = False + Me.ucrChkweights.Location = New System.Drawing.Point(270, 27) + Me.ucrChkweights.Name = "ucrChkweights" + Me.ucrChkweights.Size = New System.Drawing.Size(145, 20) + Me.ucrChkweights.TabIndex = 18 + ' + 'dlgOneWayFrequencies + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(427, 361) + Me.Controls.Add(Me.ucrChkweights) + Me.Controls.Add(Me.ucrChkFlip) + Me.Controls.Add(Me.lblSelectedVariable) + Me.Controls.Add(Me.cmdOptions) + Me.Controls.Add(Me.grpSort) + Me.Controls.Add(Me.ucrChkGraph) + Me.Controls.Add(Me.ucrChkTable) + Me.Controls.Add(Me.ucrBase) + Me.Controls.Add(Me.ucrSaveGraph) + Me.Controls.Add(Me.ucrReceiverOneWayFreq) + Me.Controls.Add(Me.ucrSelectorOneWayFreq) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "dlgOneWayFrequencies" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "One Way Frequencies" + Me.grpSort.ResumeLayout(False) + Me.grpSort.PerformLayout() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents ucrSelectorOneWayFreq As ucrSelectorByDataFrameAddRemove + Friend WithEvents ucrReceiverOneWayFreq As ucrReceiverSingle + Friend WithEvents ucrSaveGraph As ucrSave + Friend WithEvents ucrBase As ucrButtons + Friend WithEvents ucrChkGraph As ucrCheck + Friend WithEvents ucrChkTable As ucrCheck + Friend WithEvents grpSort As GroupBox + Friend WithEvents rdoDescending As RadioButton + Friend WithEvents rdoAscending As RadioButton + Friend WithEvents rdoNone As RadioButton + Friend WithEvents ucrPnlSort As UcrPanel + Friend WithEvents cmdOptions As Button + Friend WithEvents lblSelectedVariable As Label + Friend WithEvents ucrChkFlip As ucrCheck + Friend WithEvents ucrChkweights As ucrCheck +End Class diff --git a/instat/dlgOneWayFrequencies.resx b/instat/dlgOneWayFrequencies.resx new file mode 100644 index 00000000000..29dcb1b3a35 --- /dev/null +++ b/instat/dlgOneWayFrequencies.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/dlgOneWayFrequencies.vb b/instat/dlgOneWayFrequencies.vb new file mode 100644 index 00000000000..66c6b0ad8ef --- /dev/null +++ b/instat/dlgOneWayFrequencies.vb @@ -0,0 +1,136 @@ +' Instat-R +' Copyright (C) 2015 +' +' This program is free software: you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation, either version 3 of the License, or +' (at your option) any later version. +' +' This program is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. +' +' You should have received a copy of the GNU General Public License k +' along with this program. If not, see . + +Imports instat.Translations + +Public Class dlgOneWayFrequencies + Private bFirstLoad As Boolean = True + Private bReset As Boolean = True + Private bResetSubdialog As Boolean = False + Private clsSjtFreq As New RFunction + Private clsSjpFrq As New RFunction + Private Sub dlgOneWayFrequencies_Load(sender As Object, e As EventArgs) Handles MyBase.Load + autoTranslate(Me) + If bFirstLoad Then + InitialiseDialog() + bFirstLoad = False + End If + If bReset Then + SetDefaults() + End If + SetRCodeForControls(bReset) + bReset = False + End Sub + + Public Sub SetRCodeForControls(bReset As Boolean) + ucrReceiverOneWayFreq.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + ucrPnlSort.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + ucrChkTable.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + ucrChkGraph.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + + End Sub + + Private Sub InitialiseDialog() + 'HelpID + ' ucrBase.iHelpTopicID = + ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False + ucrBase.clsRsyntax.iCallType = 3 + + ucrReceiverOneWayFreq.Selector = ucrSelectorOneWayFreq + ucrReceiverOneWayFreq.SetMeAsReceiver() + ucrReceiverOneWayFreq.SetParameter(New RParameter("data", 1)) + ucrReceiverOneWayFreq.SetParameterIsRFunction() + + + ucrPnlSort.SetParameter(New RParameter("sort.frq")) + ucrPnlSort.AddRadioButton(rdoNone, Chr(34) & "none" & Chr(34)) + ucrPnlSort.AddRadioButton(rdoAscending, Chr(34) & "asc" & Chr(34)) + ucrPnlSort.AddRadioButton(rdoDescending, Chr(34) & "desc" & Chr(34)) + ucrPnlSort.SetRDefault(Chr(34) & "none" & Chr(34)) + + + ucrChkTable.SetText("Table") + ucrChkweights.SetText("Weights") + ucrChkGraph.SetText("Graph") + ' ucrChkGraph.SetParameter(New RParameter("type")) + + ucrChkFlip.SetText("Flip Coordinates") + ucrChkFlip.SetParameter(New RParameter("coord.flip"), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") + ucrChkFlip.SetRDefault("FALSE") + + ucrSaveGraph.SetPrefix("one_way_freq") + ucrSaveGraph.SetSaveTypeAsGraph() + ucrSaveGraph.SetDataFrameSelector(ucrSelectorOneWayFreq.ucrAvailableDataFrames) + ucrSaveGraph.SetCheckBoxText("Save Graph") + ucrSaveGraph.SetIsComboBox() + End Sub + + Private Sub SetDefaults() + clsSjtFreq = New RFunction + clsSjpFrq = New RFunction + ucrSelectorOneWayFreq.Reset() + ucrSaveGraph.Reset() + ucrReceiverOneWayFreq.SetParameter(New RParameter("data", 1)) + ucrReceiverOneWayFreq.SetParameterIsRFunction() + clsSjtFreq.SetRCommand("sjPlot::sjt.frq") + clsSjtFreq.AddParameter("data", clsRFunctionParameter:=ucrReceiverOneWayFreq.GetVariables) + clsSjtFreq.AddParameter("sort.frq", Chr(34) & "none" & Chr(34)) + clsSjtFreq.AddParameter("use.viewer", "FALSE") + clsSjpFrq.SetRCommand("sjPlot::sjp.frq") + clsSjpFrq.AddParameter("var.cnt", clsRFunctionParameter:=ucrReceiverOneWayFreq.GetVariables) + + ucrBase.clsRsyntax.SetBaseRFunction(clsSjtFreq) + End Sub + + Private Sub TestOkEnabled() + If Not ucrReceiverOneWayFreq.IsEmpty() AndAlso ucrSaveGraph.IsComplete() Then + ucrBase.OKEnabled(True) + Else + ucrBase.OKEnabled(False) + End If + End Sub + + Private Sub ChangeBaseFunction() + If ucrChkTable.Checked Then + ucrReceiverOneWayFreq.SetParameter(New RParameter("data", 1)) + ucrReceiverOneWayFreq.SetParameterIsRFunction() + ucrBase.clsRsyntax.SetBaseRFunction(clsSjtFreq) + Else + ucrReceiverOneWayFreq.SetParameter(New RParameter("var.cnt", 1)) + ucrReceiverOneWayFreq.SetParameterIsRFunction() + ucrBase.clsRsyntax.SetBaseRFunction(clsSjpFrq) + End If + SetRCodeForControls(False) + End Sub + + Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset + SetDefaults() + SetRCodeForControls(True) + TestOkEnabled() + End Sub + + Private Sub AllControls_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverOneWayFreq.ControlValueChanged, ucrChkTable.ControlValueChanged, ucrChkGraph.ControlValueChanged, ucrPnlSort.ControlValueChanged + If ucrChkweights.Checked Then + ucrReceiverOneWayFreq.SetDataType("numeric") + End If + ChangeBaseFunction() + End Sub + + Private Sub Controls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverOneWayFreq.ControlContentsChanged, ucrSaveGraph.ControlContentsChanged + TestOkEnabled() + End Sub + +End Class \ No newline at end of file diff --git a/instat/dlgOpenNetCDF.Designer.vb b/instat/dlgOpenNetCDF.Designer.vb new file mode 100644 index 00000000000..9ed2013c62a --- /dev/null +++ b/instat/dlgOpenNetCDF.Designer.vb @@ -0,0 +1,52 @@ + _ +Partial Class dlgOpenNetCDF + 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.ucrBase = New instat.ucrButtons() + Me.SuspendLayout() + ' + 'ucrBase + ' + Me.ucrBase.Location = New System.Drawing.Point(12, 288) + Me.ucrBase.Name = "ucrBase" + Me.ucrBase.Size = New System.Drawing.Size(347, 53) + Me.ucrBase.TabIndex = 1 + ' + 'dlgOpenNetCDF + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(371, 353) + Me.Controls.Add(Me.ucrBase) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "dlgOpenNetCDF" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "Open NetCDF" + Me.ResumeLayout(False) + + End Sub + + Friend WithEvents ucrBase As ucrButtons +End Class diff --git a/instat/dlgOpenNetCDF.resx b/instat/dlgOpenNetCDF.resx new file mode 100644 index 00000000000..29dcb1b3a35 --- /dev/null +++ b/instat/dlgOpenNetCDF.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/dlgOpenNetCDF.vb b/instat/dlgOpenNetCDF.vb new file mode 100644 index 00000000000..9a1e15648ab --- /dev/null +++ b/instat/dlgOpenNetCDF.vb @@ -0,0 +1,49 @@ +' Instat-R +' Copyright (C) 2015 +' +' This program is free software: you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation, either version 3 of the License, or +' (at your option) any later version. +' +' This program is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. +' +' You should have received a copy of the GNU General Public License k +' along with this program. If not, see . +Imports instat.Translations +Public Class dlgOpenNetCDF + Private bFirstLoad As Boolean = True + Private bReset As Boolean = True + Private Sub dlgOpenNetCDF_Load(sender As Object, e As EventArgs) Handles MyBase.Load + autoTranslate(Me) + If bFirstLoad Then + InitialiseDialog() + bFirstLoad = False + End If + + If bReset Then + SetDefaults() + End If + SetRCodeForControls(bReset) + bReset = False + TestOkEnabled() + End Sub + + Private Sub SetRCodeForControls(bReset As Boolean) + + End Sub + + Private Sub SetDefaults() + + End Sub + + Private Sub InitialiseDialog() + + End Sub + Private Sub TestOkEnabled() + + End Sub +End Class \ No newline at end of file diff --git a/instat/dlgRandomSubsets.Designer.vb b/instat/dlgRandomSubsets.Designer.vb index aea8348ab2d..8dc1d99a20c 100644 --- a/instat/dlgRandomSubsets.Designer.vb +++ b/instat/dlgRandomSubsets.Designer.vb @@ -25,25 +25,21 @@ Partial Class dlgRandomSubsets Me.lblSelected = New System.Windows.Forms.Label() Me.lblSampleSize = New System.Windows.Forms.Label() Me.lblNumberOfColumns = New System.Windows.Forms.Label() - Me.nudSampleSize = New System.Windows.Forms.NumericUpDown() - Me.nudNumberOfColumns = New System.Windows.Forms.NumericUpDown() - Me.chkWithReplacement = New System.Windows.Forms.CheckBox() - Me.lblNewDataFrameName = New System.Windows.Forms.Label() - Me.nudSetSeed = New System.Windows.Forms.NumericUpDown() - Me.chkSetSeed = New System.Windows.Forms.CheckBox() - Me.ucrNewDataFrameName = New instat.ucrInputTextBox() + Me.ucrBase = New instat.ucrButtons() + Me.ucrNewDataframe = New instat.ucrSave() + Me.ucrChkWithReplacement = New instat.ucrCheck() + Me.ucrChkSetSeed = New instat.ucrCheck() + Me.ucrNudSetSeed = New instat.ucrNud() + Me.ucrNudNumberOfColumns = New instat.ucrNud() + Me.ucrNudSampleSize = New instat.ucrNud() Me.ucrReceiverSelected = New instat.ucrReceiverSingle() Me.ucrSelectorRandomSubsets = New instat.ucrSelectorByDataFrameAddRemove() - Me.ucrBase = New instat.ucrButtons() - CType(Me.nudSampleSize, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.nudNumberOfColumns, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.nudSetSeed, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'lblSelected ' Me.lblSelected.AutoSize = True - Me.lblSelected.Location = New System.Drawing.Point(258, 27) + Me.lblSelected.Location = New System.Drawing.Point(258, 43) Me.lblSelected.Name = "lblSelected" Me.lblSelected.Size = New System.Drawing.Size(93, 13) Me.lblSelected.TabIndex = 1 @@ -53,87 +49,93 @@ Partial Class dlgRandomSubsets 'lblSampleSize ' Me.lblSampleSize.AutoSize = True - Me.lblSampleSize.Location = New System.Drawing.Point(258, 71) + Me.lblSampleSize.Location = New System.Drawing.Point(254, 91) Me.lblSampleSize.Name = "lblSampleSize" Me.lblSampleSize.Size = New System.Drawing.Size(68, 13) - Me.lblSampleSize.TabIndex = 6 + Me.lblSampleSize.TabIndex = 3 Me.lblSampleSize.Tag = "Sample_Size:" Me.lblSampleSize.Text = "Sample Size:" ' 'lblNumberOfColumns ' Me.lblNumberOfColumns.AutoSize = True - Me.lblNumberOfColumns.Location = New System.Drawing.Point(258, 96) + Me.lblNumberOfColumns.Location = New System.Drawing.Point(254, 121) Me.lblNumberOfColumns.Name = "lblNumberOfColumns" Me.lblNumberOfColumns.Size = New System.Drawing.Size(102, 13) - Me.lblNumberOfColumns.TabIndex = 8 + Me.lblNumberOfColumns.TabIndex = 5 Me.lblNumberOfColumns.Tag = "Number_of_Columns:" Me.lblNumberOfColumns.Text = "Number of Columns:" ' - 'nudSampleSize - ' - Me.nudSampleSize.Location = New System.Drawing.Point(363, 68) - Me.nudSampleSize.Name = "nudSampleSize" - Me.nudSampleSize.Size = New System.Drawing.Size(53, 20) - Me.nudSampleSize.TabIndex = 11 - ' - 'nudNumberOfColumns - ' - Me.nudNumberOfColumns.Location = New System.Drawing.Point(363, 94) - Me.nudNumberOfColumns.Name = "nudNumberOfColumns" - Me.nudNumberOfColumns.Size = New System.Drawing.Size(53, 20) - Me.nudNumberOfColumns.TabIndex = 12 - ' - 'chkWithReplacement - ' - Me.chkWithReplacement.AutoSize = True - Me.chkWithReplacement.Location = New System.Drawing.Point(257, 146) - Me.chkWithReplacement.Name = "chkWithReplacement" - Me.chkWithReplacement.Size = New System.Drawing.Size(114, 17) - Me.chkWithReplacement.TabIndex = 13 - Me.chkWithReplacement.Tag = "With_Replacement" - Me.chkWithReplacement.Text = "With Replacement" - Me.chkWithReplacement.UseVisualStyleBackColor = True - ' - 'lblNewDataFrameName - ' - Me.lblNewDataFrameName.AutoSize = True - Me.lblNewDataFrameName.Location = New System.Drawing.Point(10, 203) - Me.lblNewDataFrameName.Name = "lblNewDataFrameName" - Me.lblNewDataFrameName.Size = New System.Drawing.Size(121, 13) - Me.lblNewDataFrameName.TabIndex = 15 - Me.lblNewDataFrameName.Tag = "New_Data_Frame_Name:" - Me.lblNewDataFrameName.Text = "New Data Frame Name:" - ' - 'nudSetSeed - ' - Me.nudSetSeed.Location = New System.Drawing.Point(363, 120) - Me.nudSetSeed.Name = "nudSetSeed" - Me.nudSetSeed.Size = New System.Drawing.Size(53, 20) - Me.nudSetSeed.TabIndex = 16 - ' - 'chkSetSeed - ' - Me.chkSetSeed.AutoSize = True - Me.chkSetSeed.Location = New System.Drawing.Point(257, 121) - Me.chkSetSeed.Name = "chkSetSeed" - Me.chkSetSeed.Size = New System.Drawing.Size(51, 17) - Me.chkSetSeed.TabIndex = 17 - Me.chkSetSeed.Tag = "Seed" - Me.chkSetSeed.Text = "Seed" - Me.chkSetSeed.UseVisualStyleBackColor = True - ' - 'ucrNewDataFrameName + 'ucrBase ' - Me.ucrNewDataFrameName.IsReadOnly = False - Me.ucrNewDataFrameName.Location = New System.Drawing.Point(131, 200) - Me.ucrNewDataFrameName.Name = "ucrNewDataFrameName" - Me.ucrNewDataFrameName.Size = New System.Drawing.Size(145, 21) - Me.ucrNewDataFrameName.TabIndex = 18 + Me.ucrBase.Location = New System.Drawing.Point(10, 237) + Me.ucrBase.Name = "ucrBase" + Me.ucrBase.Size = New System.Drawing.Size(410, 52) + Me.ucrBase.TabIndex = 11 + ' + 'ucrNewDataframe + ' + Me.ucrNewDataframe.Location = New System.Drawing.Point(10, 209) + Me.ucrNewDataframe.Name = "ucrNewDataframe" + Me.ucrNewDataframe.Size = New System.Drawing.Size(285, 24) + Me.ucrNewDataframe.TabIndex = 10 + ' + 'ucrChkWithReplacement + ' + Me.ucrChkWithReplacement.Checked = False + Me.ucrChkWithReplacement.Location = New System.Drawing.Point(257, 178) + Me.ucrChkWithReplacement.Name = "ucrChkWithReplacement" + Me.ucrChkWithReplacement.Size = New System.Drawing.Size(171, 20) + Me.ucrChkWithReplacement.TabIndex = 9 + ' + 'ucrChkSetSeed + ' + Me.ucrChkSetSeed.Checked = False + Me.ucrChkSetSeed.Location = New System.Drawing.Point(257, 149) + Me.ucrChkSetSeed.Name = "ucrChkSetSeed" + Me.ucrChkSetSeed.Size = New System.Drawing.Size(100, 20) + Me.ucrChkSetSeed.TabIndex = 7 + ' + 'ucrNudSetSeed + ' + Me.ucrNudSetSeed.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudSetSeed.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudSetSeed.Location = New System.Drawing.Point(363, 149) + Me.ucrNudSetSeed.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudSetSeed.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudSetSeed.Name = "ucrNudSetSeed" + Me.ucrNudSetSeed.Size = New System.Drawing.Size(50, 20) + Me.ucrNudSetSeed.TabIndex = 8 + Me.ucrNudSetSeed.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrNudNumberOfColumns + ' + Me.ucrNudNumberOfColumns.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudNumberOfColumns.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudNumberOfColumns.Location = New System.Drawing.Point(363, 118) + Me.ucrNudNumberOfColumns.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudNumberOfColumns.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudNumberOfColumns.Name = "ucrNudNumberOfColumns" + Me.ucrNudNumberOfColumns.Size = New System.Drawing.Size(50, 20) + Me.ucrNudNumberOfColumns.TabIndex = 6 + Me.ucrNudNumberOfColumns.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrNudSampleSize + ' + Me.ucrNudSampleSize.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudSampleSize.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudSampleSize.Location = New System.Drawing.Point(363, 88) + Me.ucrNudSampleSize.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudSampleSize.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudSampleSize.Name = "ucrNudSampleSize" + Me.ucrNudSampleSize.Size = New System.Drawing.Size(50, 20) + Me.ucrNudSampleSize.TabIndex = 4 + Me.ucrNudSampleSize.Value = New Decimal(New Integer() {0, 0, 0, 0}) ' 'ucrReceiverSelected ' - Me.ucrReceiverSelected.Location = New System.Drawing.Point(257, 41) + Me.ucrReceiverSelected.frmParent = Me + Me.ucrReceiverSelected.Location = New System.Drawing.Point(257, 60) Me.ucrReceiverSelected.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverSelected.Name = "ucrReceiverSelected" Me.ucrReceiverSelected.Selector = Nothing @@ -150,25 +152,17 @@ Partial Class dlgRandomSubsets Me.ucrSelectorRandomSubsets.Size = New System.Drawing.Size(210, 180) Me.ucrSelectorRandomSubsets.TabIndex = 0 ' - 'ucrBase - ' - Me.ucrBase.Location = New System.Drawing.Point(10, 227) - Me.ucrBase.Name = "ucrBase" - Me.ucrBase.Size = New System.Drawing.Size(410, 52) - Me.ucrBase.TabIndex = 10 - ' 'dlgRandomSubsets ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(425, 282) - Me.Controls.Add(Me.ucrNewDataFrameName) - Me.Controls.Add(Me.chkSetSeed) - Me.Controls.Add(Me.nudSetSeed) - Me.Controls.Add(Me.lblNewDataFrameName) - Me.Controls.Add(Me.chkWithReplacement) - Me.Controls.Add(Me.nudNumberOfColumns) - Me.Controls.Add(Me.nudSampleSize) + Me.ClientSize = New System.Drawing.Size(430, 294) + Me.Controls.Add(Me.ucrChkSetSeed) + Me.Controls.Add(Me.ucrChkWithReplacement) + Me.Controls.Add(Me.ucrNudSetSeed) + Me.Controls.Add(Me.ucrNudNumberOfColumns) + Me.Controls.Add(Me.ucrNudSampleSize) + Me.Controls.Add(Me.ucrNewDataframe) Me.Controls.Add(Me.lblNumberOfColumns) Me.Controls.Add(Me.lblSampleSize) Me.Controls.Add(Me.lblSelected) @@ -182,9 +176,6 @@ Partial Class dlgRandomSubsets Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Tag = "Random_Subsets" Me.Text = "Random Subsets" - CType(Me.nudSampleSize, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.nudNumberOfColumns, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.nudSetSeed, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() @@ -196,11 +187,11 @@ Partial Class dlgRandomSubsets Friend WithEvents lblSelected As Label Friend WithEvents lblSampleSize As Label Friend WithEvents lblNumberOfColumns As Label - Friend WithEvents nudSampleSize As NumericUpDown - Friend WithEvents nudNumberOfColumns As NumericUpDown - Friend WithEvents chkWithReplacement As CheckBox - Friend WithEvents lblNewDataFrameName As Label Friend WithEvents nudSetSeed As NumericUpDown - Friend WithEvents chkSetSeed As CheckBox - Friend WithEvents ucrNewDataFrameName As ucrInputTextBox + Friend WithEvents ucrNewDataframe As ucrSave + Friend WithEvents ucrNudSampleSize As ucrNud + Friend WithEvents ucrNudNumberOfColumns As ucrNud + Friend WithEvents ucrChkWithReplacement As ucrCheck + Friend WithEvents ucrNudSetSeed As ucrNud + Friend WithEvents ucrChkSetSeed As ucrCheck End Class diff --git a/instat/dlgRandomSubsets.resx b/instat/dlgRandomSubsets.resx index 1af7de150c9..29dcb1b3a35 100644 --- a/instat/dlgRandomSubsets.resx +++ b/instat/dlgRandomSubsets.resx @@ -1,120 +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 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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/dlgRandomSubsets.vb b/instat/dlgRandomSubsets.vb index 36c0f2a455d..33f6c1099e3 100644 --- a/instat/dlgRandomSubsets.vb +++ b/instat/dlgRandomSubsets.vb @@ -1,159 +1,174 @@ -'Instat-R -'Copyright (C) 2015 -'This program is free software: you can redistribute it and/or modify -'it under the terms of the GNU General Public License as published by -'the Free Software Foundation, either version 3 of the License, or -'(at your option) any later version. -'This program is distributed in the hope that it will be useful, -'but WITHOUT ANY WARRANTY; without even the implied warranty of -'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -'GNU General Public License for more details. -'You should have received a copy of the GNU General Public License k -'along with this program. If not, see . - -Imports instat.Translations -Public Class dlgRandomSubsets - Public bFirstLoad As Boolean = True 'checks if dialog loads for first time - Private clsSetSeed As New RFunction - Private clsSampleFunc As New RFunction - Private clsReplicateFunc As New RFunction - Private clsDataFrameFunc As New RFunction - - - Private Sub dlgRandomSubsets_Load(sender As Object, e As EventArgs) Handles MyBase.Load - If bFirstLoad Then - InitialiseDialog() - SetDefaults() - bFirstLoad = False - Else - ReOpenDialog() - End If - autoTranslate(Me) - - End Sub - 'this contains things that initialise the dialog and run once +'Instat-R +'Copyright (C) 2015 +'This program is free software: you can redistribute it and/or modify +'it under the terms of the GNU General Public License as published by +'the Free Software Foundation, either version 3 of the License, or +'(at your option) any later version. +'This program is distributed in the hope that it will be useful, +'but WITHOUT ANY WARRANTY; without even the implied warranty of +'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'GNU General Public License for more details. +'You should have received a copy of the GNU General Public License k +'along with this program. If not, see . + +Imports instat.Translations +Public Class dlgRandomSubsets + Public bFirstLoad As Boolean = True + Private bReset As Boolean = True + Private clsDataFrame, clsSetSeed, clsSample, clsReplicate As New RFunction + + Private Sub dlgRandomSubsets_Load(sender As Object, e As EventArgs) Handles MyBase.Load + autoTranslate(Me) + If bFirstLoad Then + InitialiseDialog() + bFirstLoad = False + End If + If bReset Then + SetDefaults() + End If + SetRCodeForControls(bReset) + bReset = False + End Sub + Private Sub InitialiseDialog() + ucrBase.iHelpTopicID = 65 - ucrBase.clsRsyntax.SetBaseRFunction(clsDataFrameFunc) - clsDataFrameFunc.AddParameter("X", clsRFunctionParameter:=clsReplicateFunc) - clsDataFrameFunc.SetRCommand("data.frame") - clsReplicateFunc.SetRCommand("replicate") - ucrReceiverSelected.SetIncludedDataTypes({"numeric"}) - ucrReceiverSelected.Selector = ucrSelectorRandomSubsets + 'ucrReceiver + ucrReceiverSelected.Selector = ucrSelectorRandomSubsets ucrReceiverSelected.SetMeAsReceiver() - clsSetSeed.SetRCommand("set.seed") - clsReplicateFunc.AddParameter("expr", clsRFunctionParameter:=clsSampleFunc) - clsSampleFunc.SetRCommand("sample") - ucrBase.iHelpTopicID = 65 + ucrReceiverSelected.SetIncludedDataTypes({"numeric"}) + ucrReceiverSelected.SetParameter(New RParameter("x", 2)) + ucrReceiverSelected.SetParameterIsRFunction() + + ucrChkSetSeed.AddFunctionNamesCondition(False, "set.seed") + 'Set seed + ucrNudSetSeed.SetParameter(New RParameter("seed", 0)) + ucrNudSetSeed.SetMinMax(1, Integer.MaxValue) + ucrChkSetSeed.SetText("Seed") + + ucrNudSampleSize.SetParameter(New RParameter("size", 2)) + + 'Replace checkbox + ucrChkWithReplacement.SetParameter(New RParameter("replace", 1)) + ucrChkWithReplacement.SetText("With Replacement") + ucrChkWithReplacement.SetValuesCheckedAndUnchecked("TRUE", "FALSE") + ucrChkWithReplacement.SetRDefault("FALSE") + + 'Number of columns + ucrNudNumberOfColumns.SetParameter(New RParameter("n", 2)) + ucrNudNumberOfColumns.SetMinMax(1, Integer.MaxValue) + + 'Linking checkox and nud + ucrChkSetSeed.AddToLinkedControls(ucrLinked:=ucrNudSetSeed, objValues:={True}, bNewLinkedHideIfParameterMissing:=True) + + 'ucrNewDataframe + ucrNewDataframe.SetIsTextBox() + ucrNewDataframe.SetSaveTypeAsDataFrame() + ucrNewDataframe.SetDataFrameSelector(ucrSelectorRandomSubsets.ucrAvailableDataFrames) + ucrNewDataframe.SetLabelText("New Data Frame Name:") + + End Sub - End Sub - - 'checks when to enable ok button - Private Sub TestOkEnabled() - If ucrReceiverSelected.IsEmpty Then - ucrBase.OKEnabled(False) - Else - ucrBase.OKEnabled(True) - End If - End Sub - - 'set defaults for the dialog Private Sub SetDefaults() + 'reset + ucrSelectorRandomSubsets.Reset() + ucrNewDataframe.Reset() + NewDefaultName() + ReplaceParameters() - ucrSelectorRandomSubsets.Reset() - ucrSelectorRandomSubsets.Focus() - ucrReceiverSelected.Selector = ucrSelectorRandomSubsets - ucrReceiverSelected.SetMeAsReceiver() - chkWithReplacement.Checked = False - chkSetSeed.Checked = False - nudNumberOfColumns.Value = 1 - nudNumberOfColumns.Minimum = 1 - nudNumberOfColumns.Maximum = Integer.MaxValue - ReplaceParameters() - nudSampleSize.Value = ucrSelectorRandomSubsets.ucrAvailableDataFrames.iDataFrameLength - nudSetSeed.Value = 1 - nudSetSeed.Minimum = Integer.MinValue - nudSetSeed.Maximum = Integer.MaxValue - nudSetSeed.Visible = False - If ucrSelectorRandomSubsets.ucrAvailableDataFrames.cboAvailableDataFrames.Text <> "" Then - ucrNewDataFrameName.SetName(ucrSelectorRandomSubsets.ucrAvailableDataFrames.cboAvailableDataFrames.Text & "_random") - End If + 'sample function + clsSample = New RFunction + clsSample.SetRCommand("sample") + ucrNudSampleSize.SetMinMax(1, ucrSelectorRandomSubsets.ucrAvailableDataFrames.iDataFrameLength) + clsSample.AddParameter("size", ucrSelectorRandomSubsets.ucrAvailableDataFrames.iDataFrameLength) + + 'setseed fuction + clsSetSeed = New RFunction + clsSetSeed.SetRCommand("set.seed") + clsSetSeed.AddParameter("seed", 1) + + 'replicate func setting + clsReplicate = New RFunction + clsReplicate.SetRCommand("replicate") + clsReplicate.AddParameter("n", 1) + clsReplicate.AddParameter("expr", clsRFunctionParameter:=clsSample) + + 'setting the main fuction + clsDataFrame = New RFunction + clsDataFrame.SetRCommand("data.frame") + clsDataFrame.AddParameter("X", clsRFunctionParameter:=clsReplicate) + clsDataFrame.SetAssignTo(ucrNewDataframe.GetText(), strTempDataframe:=ucrNewDataframe.GetText()) + ucrBase.clsRsyntax.SetBaseRFunction(clsDataFrame) - TestOkEnabled() - End Sub - 'set what happens when dialog is reopened - Private Sub ReOpenDialog() - If ucrSelectorRandomSubsets.ucrAvailableDataFrames.cboAvailableDataFrames.Text <> "" Then - ucrNewDataFrameName.SetName(ucrSelectorRandomSubsets.ucrAvailableDataFrames.cboAvailableDataFrames.Text & "_random") - End If End Sub - Private Sub ucrNewDataFrameName_NameChanged() Handles ucrNewDataFrameName.NameChanged - If Not ucrNewDataFrameName.IsEmpty Then - ucrBase.clsRsyntax.SetAssignTo(ucrNewDataFrameName.GetText(), strTempDataframe:=ucrNewDataFrameName.GetText()) + + Private Sub TestOKEnabled() + If (Not ucrReceiverSelected.IsEmpty AndAlso ucrNudNumberOfColumns.GetText() <> "" AndAlso ucrNudSampleSize.GetText() <> "" AndAlso ucrNewDataframe.IsComplete) Then + If ucrChkSetSeed.Checked Then + If ucrNudSetSeed.GetText <> "" Then + ucrBase.OKEnabled(True) + Else + ucrBase.OKEnabled(False) + End If + Else + ucrBase.OKEnabled(True) + End If Else - ucrBase.clsRsyntax.RemoveAssignTo() + ucrBase.OKEnabled(False) End If - TestOkEnabled() + + End Sub + 'updating rcode of the controls + Public Sub SetRCodeForControls(bReset As Boolean) + ucrReceiverSelected.SetRCode(clsSample, bReset) + ucrChkWithReplacement.SetRCode(clsSample, bReset) + ucrNudNumberOfColumns.SetRCode(clsReplicate, bReset) + ucrNewDataframe.SetRCode(clsDataFrame, bReset) + ucrNudSampleSize.SetRCode(clsSample, bReset) + ucrChkSetSeed.SetRCode(clsSetSeed, bReset) + ucrNudSetSeed.SetRCode(clsSetSeed, bReset) End Sub + Private Sub ucrBase_BeforeClickOk(sender As Object, e As EventArgs) Handles ucrBase.BeforeClickOk - If chkSetSeed.Checked Then + If ucrChkSetSeed.Checked Then frmMain.clsRLink.RunScript(clsSetSeed.ToScript(), strComment:="dlgRandomSubset: Setting the seed for random number generator") End If - TestOkEnabled() - End Sub - Private Sub ucrReceiverSelected_SelectionChanged(sender As Object, e As EventArgs) Handles ucrReceiverSelected.SelectionChanged - If Not ucrReceiverSelected.IsEmpty Then - clsSampleFunc.AddParameter("x", clsRFunctionParameter:=ucrReceiverSelected.GetVariables()) - Else - clsSampleFunc.RemoveParameterByName("x") - End If - TestOkEnabled() End Sub - Private Sub SetSeedParameters() - If chkSetSeed.Checked Then - nudSetSeed.Visible = True - If nudSetSeed.Text <> "" Then - clsSetSeed.AddParameter("seed", nudSetSeed.Value) - Else - clsSetSeed.RemoveParameterByName("seed") - End If - Else - nudSetSeed.Visible = False - clsSetSeed.RemoveParameterByName("seed") + + Private Sub NewDefaultName() + If ucrSelectorRandomSubsets.ucrAvailableDataFrames.cboAvailableDataFrames.Text <> "" AndAlso (Not ucrNewDataframe.bUserTyped) Then + ucrNewDataframe.SetName(ucrSelectorRandomSubsets.ucrAvailableDataFrames.cboAvailableDataFrames.Text & "_random") End If End Sub + + Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset + SetDefaults() + SetRCodeForControls(True) + TestOKEnabled() + End Sub + Private Sub ReplaceParameters() - If chkWithReplacement.Checked Then - clsSampleFunc.AddParameter("replace", "TRUE") - nudSampleSize.Minimum = 1 - nudSampleSize.Maximum = Integer.MaxValue + If ucrChkWithReplacement.Checked Then + ucrNudSampleSize.SetMinMax(1, Integer.MaxValue) Else - clsSampleFunc.AddParameter("replace", "FALSE") - nudSampleSize.Minimum = 1 - nudSampleSize.Maximum = ucrSelectorRandomSubsets.ucrAvailableDataFrames.iDataFrameLength + ucrNudSampleSize.SetMinMax(1, ucrSelectorRandomSubsets.ucrAvailableDataFrames.iDataFrameLength) End If End Sub - Private Sub chkSeed_CheckedChanged(sender As Object, e As EventArgs) Handles chkSetSeed.CheckedChanged - SetSeedParameters() - End Sub - Private Sub nudSeed_TextChanged(sender As Object, e As EventArgs) Handles nudSetSeed.TextChanged - SetSeedParameters() - End Sub - Private Sub nudNumberOfColumns_TextChanged(sender As Object, e As EventArgs) Handles nudNumberOfColumns.TextChanged - clsReplicateFunc.AddParameter("n", nudNumberOfColumns.Value) - End Sub - Private Sub nudSampleSize_TextChanged(sender As Object, e As EventArgs) Handles nudSampleSize.TextChanged - clsSampleFunc.AddParameter("size", nudSampleSize.Value) + Private Sub CoreControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverSelected.ControlContentsChanged, ucrNudNumberOfColumns.ControlContentsChanged, ucrNudSampleSize.ControlContentsChanged, ucrNudSetSeed.ControlContentsChanged, ucrNewDataframe.ControlContentsChanged, ucrChkSetSeed.ControlContentsChanged + TestOKEnabled() End Sub - Private Sub chkWithReplacement_CheckedChanged(sender As Object, e As EventArgs) Handles chkWithReplacement.CheckedChanged + + Private Sub ucrSelectorRandomSubsets_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectorRandomSubsets.ControlValueChanged + NewDefaultName() ReplaceParameters() + If ucrSelectorRandomSubsets.ucrAvailableDataFrames.cboAvailableDataFrames.Text <> "" Then + ucrNudSampleSize.Value = frmMain.clsRLink.GetDataFrameLength(ucrSelectorRandomSubsets.ucrAvailableDataFrames.cboAvailableDataFrames.Text) + End If End Sub - 'this is what happens when Reset button is clicked - Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset - SetDefaults() + Private Sub ucrChkWithReplacement_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkWithReplacement.ControlValueChanged + ReplaceParameters() End Sub - End Class \ No newline at end of file diff --git a/instat/dlgRatingScales.Designer.vb b/instat/dlgRatingScales.Designer.vb new file mode 100644 index 00000000000..0c76f4d8c78 --- /dev/null +++ b/instat/dlgRatingScales.Designer.vb @@ -0,0 +1,41 @@ + _ +Partial Class dlgRatingScales + 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() + ' + 'dlgRatingScales + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(284, 261) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "dlgRatingScales" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "dlgRatingScales" + Me.ResumeLayout(False) + + End Sub +End Class diff --git a/instat/dlgRatingScales.resx b/instat/dlgRatingScales.resx new file mode 100644 index 00000000000..29dcb1b3a35 --- /dev/null +++ b/instat/dlgRatingScales.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/dlgRatingScales.vb b/instat/dlgRatingScales.vb new file mode 100644 index 00000000000..e85be50edf1 --- /dev/null +++ b/instat/dlgRatingScales.vb @@ -0,0 +1,3 @@ +Public Class dlgRatingScales + +End Class \ No newline at end of file diff --git a/instat/dlgReoderDescriptives.Designer.vb b/instat/dlgReoderDescriptives.Designer.vb index b9098e67c72..c12914124b6 100644 --- a/instat/dlgReoderDescriptives.Designer.vb +++ b/instat/dlgReoderDescriptives.Designer.vb @@ -25,7 +25,7 @@ Partial Class dlgReoderDescriptives Me.ucrBase = New instat.ucrButtons() Me.lblObjectsToReoder = New System.Windows.Forms.Label() Me.ucrReorderObjects = New instat.ucrReorder() - Me.ucrDataFrameReoder = New instat.ucrDataFrame() + Me.ucrDataFrameReorder = New instat.ucrDataFrame() Me.SuspendLayout() ' 'ucrBase @@ -33,44 +33,44 @@ Partial Class dlgReoderDescriptives Me.ucrBase.Location = New System.Drawing.Point(12, 176) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(410, 53) - Me.ucrBase.TabIndex = 0 + Me.ucrBase.TabIndex = 3 ' 'lblObjectsToReoder ' Me.lblObjectsToReoder.AutoSize = True - Me.lblObjectsToReoder.Location = New System.Drawing.Point(187, 15) + Me.lblObjectsToReoder.Location = New System.Drawing.Point(213, 18) Me.lblObjectsToReoder.Name = "lblObjectsToReoder" - Me.lblObjectsToReoder.Size = New System.Drawing.Size(93, 13) - Me.lblObjectsToReoder.TabIndex = 2 + Me.lblObjectsToReoder.Size = New System.Drawing.Size(99, 13) + Me.lblObjectsToReoder.TabIndex = 1 Me.lblObjectsToReoder.Tag = "Objects_to_Reorder" - Me.lblObjectsToReoder.Text = "Objects to Reoder" + Me.lblObjectsToReoder.Text = "Objects to Reorder:" ' 'ucrReorderObjects ' - Me.ucrReorderObjects.Location = New System.Drawing.Point(190, 31) + Me.ucrReorderObjects.Location = New System.Drawing.Point(208, 31) Me.ucrReorderObjects.Name = "ucrReorderObjects" Me.ucrReorderObjects.Size = New System.Drawing.Size(154, 139) - Me.ucrReorderObjects.TabIndex = 3 + Me.ucrReorderObjects.TabIndex = 2 Me.ucrReorderObjects.ucrDataFrameList = Nothing Me.ucrReorderObjects.ucrReceiver = Nothing ' - 'ucrDataFrameReoder + 'ucrDataFrameReorder ' - Me.ucrDataFrameReoder.bUseCurrentFilter = True - Me.ucrDataFrameReoder.Location = New System.Drawing.Point(13, 13) - Me.ucrDataFrameReoder.Margin = New System.Windows.Forms.Padding(0) - Me.ucrDataFrameReoder.Name = "ucrDataFrameReoder" - Me.ucrDataFrameReoder.Size = New System.Drawing.Size(120, 40) - Me.ucrDataFrameReoder.TabIndex = 1 + Me.ucrDataFrameReorder.bUseCurrentFilter = True + Me.ucrDataFrameReorder.Location = New System.Drawing.Point(10, 10) + Me.ucrDataFrameReorder.Margin = New System.Windows.Forms.Padding(0) + Me.ucrDataFrameReorder.Name = "ucrDataFrameReorder" + Me.ucrDataFrameReorder.Size = New System.Drawing.Size(120, 40) + Me.ucrDataFrameReorder.TabIndex = 0 ' 'dlgReoderDescriptives ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(428, 242) + Me.ClientSize = New System.Drawing.Size(422, 235) Me.Controls.Add(Me.ucrReorderObjects) Me.Controls.Add(Me.lblObjectsToReoder) - Me.Controls.Add(Me.ucrDataFrameReoder) + Me.Controls.Add(Me.ucrDataFrameReorder) Me.Controls.Add(Me.ucrBase) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.MaximizeBox = False @@ -87,5 +87,5 @@ Partial Class dlgReoderDescriptives Friend WithEvents ucrBase As ucrButtons Friend WithEvents lblObjectsToReoder As Label Friend WithEvents ucrReorderObjects As ucrReorder - Friend WithEvents ucrDataFrameReoder As ucrDataFrame + Friend WithEvents ucrDataFrameReorder As ucrDataFrame End Class diff --git a/instat/dlgReoderDescriptives.vb b/instat/dlgReoderDescriptives.vb index 36794cdfa34..ad826346916 100644 --- a/instat/dlgReoderDescriptives.vb +++ b/instat/dlgReoderDescriptives.vb @@ -13,31 +13,40 @@ ' ' You should have received a copy of the GNU General Public License k ' along with this program. If not, see . +Imports instat Imports instat.Translations Public Class dlgReoderDescriptives Public bFirstLoad As Boolean = True + Public bReset As Boolean = True + Private Sub dlgReoderDescriptives_Load(sender As Object, e As EventArgs) Handles MyBase.Load - autoTranslate(Me) If bFirstLoad Then InitialiseDialog() - SetDefaults() bFirstLoad = False - Else - ReopenDialog() End If - 'Checks if Ok can be enabled. - TestOKEnabled() + If bReset Then + SetDefaults() + End If + SetRCodeforControls(bReset) + bReset = False + autoTranslate(Me) End Sub + Private Sub InitialiseDialog() - ucrBase.clsRsyntax.SetFunction(frmMain.clsRLink.strInstatDataObject & "$reorder_objects") - ucrReorderObjects.setDataType("object") - ucrReorderObjects.setDataframes(ucrDataFrameReoder) ucrBase.iHelpTopicID = 351 - End Sub - Private Sub ReopenDialog() + ' ucrSelector DataFrame + ucrDataFrameReorder.SetParameter(New RParameter("data_name", 0)) + ucrDataFrameReorder.SetParameterIsString() + + ' ucrReorderObjects + ucrReorderObjects.SetParameter(New RParameter("new_order", 1)) + + ucrReorderObjects.setDataType("object") + ucrReorderObjects.setDataframes(ucrDataFrameReorder) End Sub + Private Sub TestOKEnabled() If Not ucrReorderObjects.isEmpty Then ucrBase.OKEnabled(True) @@ -45,25 +54,26 @@ Public Class dlgReoderDescriptives ucrBase.OKEnabled(False) End If End Sub + Private Sub SetDefaults() - ucrDataFrameReoder.Reset() + Dim clsDefaultFunction As New RFunction + ucrDataFrameReorder.Reset() + + clsDefaultFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$reorder_objects") + ucrBase.clsRsyntax.SetBaseRFunction(clsDefaultFunction.Clone()) End Sub Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset SetDefaults() + SetRCodeforControls(True) TestOKEnabled() End Sub - Private Sub ucrReorderObjects_OrderChanged() Handles ucrReorderObjects.OrderChanged - If Not ucrReorderObjects.isEmpty Then - ucrBase.clsRsyntax.AddParameter("new_order", ucrReorderObjects.GetVariableNames) - Else - ucrBase.clsRsyntax.RemoveParameter("new_order") - End If - TestOKEnabled() + Private Sub SetRCodeforControls(bReset As Boolean) + SetRCode(Me, ucrBase.clsRsyntax.clsBaseFunction, bReset) End Sub - Private Sub ucrDataFrameReoder_DataFrameChanged() Handles ucrDataFrameReoder.DataFrameChanged - ucrBase.clsRsyntax.AddParameter("data_name", Chr(34) & ucrDataFrameReoder.cboAvailableDataFrames.SelectedItem & Chr(34)) + Private Sub ucrReorderObjects_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReorderObjects.ControlContentsChanged + TestOKEnabled() End Sub End Class \ No newline at end of file diff --git a/instat/dlgTwoWayFrequencies.Designer.vb b/instat/dlgTwoWayFrequencies.Designer.vb new file mode 100644 index 00000000000..7443fe2bce1 --- /dev/null +++ b/instat/dlgTwoWayFrequencies.Designer.vb @@ -0,0 +1,41 @@ + _ +Partial Class dlgTwoWayFrequencies + 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() + ' + 'dlgTwoWayFrequencies + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(284, 261) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "dlgTwoWayFrequencies" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "dlgTwoWayFrequencies" + Me.ResumeLayout(False) + + End Sub +End Class diff --git a/instat/dlgTwoWayFrequencies.resx b/instat/dlgTwoWayFrequencies.resx new file mode 100644 index 00000000000..29dcb1b3a35 --- /dev/null +++ b/instat/dlgTwoWayFrequencies.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/dlgTwoWayFrequencies.vb b/instat/dlgTwoWayFrequencies.vb new file mode 100644 index 00000000000..061f3b792c0 --- /dev/null +++ b/instat/dlgTwoWayFrequencies.vb @@ -0,0 +1,3 @@ +Public Class dlgTwoWayFrequencies + +End Class \ No newline at end of file diff --git a/instat/dlgWindrose.Designer.vb b/instat/dlgWindrose.Designer.vb index e9a5140b73b..af636a45a38 100644 --- a/instat/dlgWindrose.Designer.vb +++ b/instat/dlgWindrose.Designer.vb @@ -24,11 +24,13 @@ Partial Class dlgWindrose Private Sub InitializeComponent() Me.lblXVariable = New System.Windows.Forms.Label() Me.lblYVariable = New System.Windows.Forms.Label() - Me.lblFactor = New System.Windows.Forms.Label() - Me.ucrFillReceiver = New instat.ucrReceiverSingle() + Me.lblFacet = New System.Windows.Forms.Label() + Me.lblNoOfColumns = New System.Windows.Forms.Label() + Me.ucrReceiverFacet = New instat.ucrReceiverSingle() + Me.ucrSaveGraph = New instat.ucrSave() + Me.ucrNudNoOfColumns = New instat.ucrNud() Me.ucrReceiverWindDirection = New instat.ucrReceiverSingle() Me.ucrReceiverWindSpeed = New instat.ucrReceiverSingle() - Me.ucrSaveWindRose = New instat.ucrSaveGraph() Me.ucrWindRoseSelector = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrBase = New instat.ucrButtons() Me.SuspendLayout() @@ -36,7 +38,7 @@ Partial Class dlgWindrose 'lblXVariable ' Me.lblXVariable.AutoSize = True - Me.lblXVariable.Location = New System.Drawing.Point(256, 40) + Me.lblXVariable.Location = New System.Drawing.Point(260, 45) Me.lblXVariable.Name = "lblXVariable" Me.lblXVariable.Size = New System.Drawing.Size(69, 13) Me.lblXVariable.TabIndex = 1 @@ -45,37 +47,63 @@ Partial Class dlgWindrose 'lblYVariable ' Me.lblYVariable.AutoSize = True - Me.lblYVariable.Location = New System.Drawing.Point(257, 91) + Me.lblYVariable.Location = New System.Drawing.Point(260, 93) Me.lblYVariable.Name = "lblYVariable" Me.lblYVariable.Size = New System.Drawing.Size(80, 13) Me.lblYVariable.TabIndex = 3 Me.lblYVariable.Text = "Wind Direction:" ' - 'lblFactor - ' - Me.lblFactor.AutoSize = True - Me.lblFactor.Enabled = False - Me.lblFactor.Location = New System.Drawing.Point(258, 142) - Me.lblFactor.Name = "lblFactor" - Me.lblFactor.Size = New System.Drawing.Size(40, 13) - Me.lblFactor.TabIndex = 5 - Me.lblFactor.Text = "Factor:" - ' - 'ucrFillReceiver - ' - Me.ucrFillReceiver.Enabled = False - Me.ucrFillReceiver.frmParent = Me - Me.ucrFillReceiver.Location = New System.Drawing.Point(255, 157) - Me.ucrFillReceiver.Margin = New System.Windows.Forms.Padding(0) - Me.ucrFillReceiver.Name = "ucrFillReceiver" - Me.ucrFillReceiver.Selector = Nothing - Me.ucrFillReceiver.Size = New System.Drawing.Size(120, 20) - Me.ucrFillReceiver.TabIndex = 6 + 'lblFacet + ' + Me.lblFacet.AutoSize = True + Me.lblFacet.Location = New System.Drawing.Point(260, 140) + Me.lblFacet.Name = "lblFacet" + Me.lblFacet.Size = New System.Drawing.Size(37, 13) + Me.lblFacet.TabIndex = 5 + Me.lblFacet.Text = "Facet:" + ' + 'lblNoOfColumns + ' + Me.lblNoOfColumns.AutoSize = True + Me.lblNoOfColumns.Location = New System.Drawing.Point(260, 194) + Me.lblNoOfColumns.Name = "lblNoOfColumns" + Me.lblNoOfColumns.Size = New System.Drawing.Size(79, 13) + Me.lblNoOfColumns.TabIndex = 7 + Me.lblNoOfColumns.Text = "No of Columns:" + ' + 'ucrReceiverFacet + ' + Me.ucrReceiverFacet.frmParent = Me + Me.ucrReceiverFacet.Location = New System.Drawing.Point(260, 155) + Me.ucrReceiverFacet.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverFacet.Name = "ucrReceiverFacet" + Me.ucrReceiverFacet.Selector = Nothing + Me.ucrReceiverFacet.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverFacet.TabIndex = 6 + ' + 'ucrSaveGraph + ' + Me.ucrSaveGraph.Location = New System.Drawing.Point(10, 218) + Me.ucrSaveGraph.Name = "ucrSaveGraph" + Me.ucrSaveGraph.Size = New System.Drawing.Size(251, 24) + Me.ucrSaveGraph.TabIndex = 9 + ' + 'ucrNudNoOfColumns + ' + Me.ucrNudNoOfColumns.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudNoOfColumns.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudNoOfColumns.Location = New System.Drawing.Point(345, 191) + Me.ucrNudNoOfColumns.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudNoOfColumns.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudNoOfColumns.Name = "ucrNudNoOfColumns" + Me.ucrNudNoOfColumns.Size = New System.Drawing.Size(35, 20) + Me.ucrNudNoOfColumns.TabIndex = 8 + Me.ucrNudNoOfColumns.Value = New Decimal(New Integer() {0, 0, 0, 0}) ' 'ucrReceiverWindDirection ' Me.ucrReceiverWindDirection.frmParent = Me - Me.ucrReceiverWindDirection.Location = New System.Drawing.Point(255, 106) + Me.ucrReceiverWindDirection.Location = New System.Drawing.Point(260, 108) Me.ucrReceiverWindDirection.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverWindDirection.Name = "ucrReceiverWindDirection" Me.ucrReceiverWindDirection.Selector = Nothing @@ -85,20 +113,13 @@ Partial Class dlgWindrose 'ucrReceiverWindSpeed ' Me.ucrReceiverWindSpeed.frmParent = Me - Me.ucrReceiverWindSpeed.Location = New System.Drawing.Point(255, 55) + Me.ucrReceiverWindSpeed.Location = New System.Drawing.Point(260, 60) Me.ucrReceiverWindSpeed.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverWindSpeed.Name = "ucrReceiverWindSpeed" Me.ucrReceiverWindSpeed.Selector = Nothing Me.ucrReceiverWindSpeed.Size = New System.Drawing.Size(120, 20) Me.ucrReceiverWindSpeed.TabIndex = 2 ' - 'ucrSaveWindRose - ' - Me.ucrSaveWindRose.Location = New System.Drawing.Point(10, 200) - Me.ucrSaveWindRose.Name = "ucrSaveWindRose" - Me.ucrSaveWindRose.Size = New System.Drawing.Size(265, 20) - Me.ucrSaveWindRose.TabIndex = 7 - ' 'ucrWindRoseSelector ' Me.ucrWindRoseSelector.bShowHiddenColumns = False @@ -111,23 +132,25 @@ Partial Class dlgWindrose ' 'ucrBase ' - Me.ucrBase.Location = New System.Drawing.Point(10, 226) + Me.ucrBase.Location = New System.Drawing.Point(10, 248) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(410, 52) - Me.ucrBase.TabIndex = 8 + Me.ucrBase.TabIndex = 10 ' 'dlgWindrose ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(419, 287) - Me.Controls.Add(Me.ucrFillReceiver) + Me.ClientSize = New System.Drawing.Size(419, 307) + Me.Controls.Add(Me.ucrReceiverFacet) + Me.Controls.Add(Me.ucrSaveGraph) + Me.Controls.Add(Me.lblNoOfColumns) + Me.Controls.Add(Me.ucrNudNoOfColumns) Me.Controls.Add(Me.ucrReceiverWindDirection) Me.Controls.Add(Me.ucrReceiverWindSpeed) - Me.Controls.Add(Me.lblFactor) + Me.Controls.Add(Me.lblFacet) Me.Controls.Add(Me.lblYVariable) Me.Controls.Add(Me.lblXVariable) - Me.Controls.Add(Me.ucrSaveWindRose) Me.Controls.Add(Me.ucrWindRoseSelector) Me.Controls.Add(Me.ucrBase) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow @@ -143,11 +166,13 @@ Partial Class dlgWindrose Friend WithEvents ucrBase As ucrButtons Friend WithEvents ucrWindRoseSelector As ucrSelectorByDataFrameAddRemove - Friend WithEvents ucrSaveWindRose As ucrSaveGraph Friend WithEvents lblXVariable As Label Friend WithEvents ucrReceiverWindSpeed As ucrReceiverSingle Friend WithEvents lblYVariable As Label Friend WithEvents ucrReceiverWindDirection As ucrReceiverSingle - Friend WithEvents lblFactor As Label - Friend WithEvents ucrFillReceiver As ucrReceiverSingle + Friend WithEvents lblFacet As Label + Friend WithEvents lblNoOfColumns As Label + Friend WithEvents ucrNudNoOfColumns As ucrNud + Friend WithEvents ucrSaveGraph As ucrSave + Friend WithEvents ucrReceiverFacet As ucrReceiverSingle End Class diff --git a/instat/dlgWindrose.vb b/instat/dlgWindrose.vb index b09e378ce50..6ff3a7d063c 100644 --- a/instat/dlgWindrose.vb +++ b/instat/dlgWindrose.vb @@ -14,63 +14,80 @@ ' ' You should have received a copy of the GNU General Public License k ' along with this program. If not, see . +Imports RDotNet Imports instat.Translations Public Class dlgWindrose - Private clsRggplotFunction As New RFunction - Private clsRgeom_barFunction As New RFunction - Private clsRaesFunction As New RFunction - Private clsCoordPolarFunction As New RFunction Private bFirstLoad As Boolean = True + Private bReset As Boolean = True + Private clsDefaultRFunction As New RFunction + Private clsFactorColumn As New RFunction + Private clsLevelofFactor As New RFunction + Private Sub dlgWindrose_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstLoad Then InitialiseDialog() - SetDefaults() bFirstLoad = False - Else - ReopenDialog() - End If + If bReset Then + SetDefaults() + End If + SetRCodeForControls(bReset) + bReset = False autoTranslate(Me) TestOkEnabled() End Sub - + Private Sub SetRCodeForControls(bReset As Boolean) + SetRCode(Me, ucrBase.clsRsyntax.clsBaseFunction, bReset) + End Sub Private Sub InitialiseDialog() + ucrBase.clsRsyntax.iCallType = 3 ucrBase.iHelpTopicID = 452 - ucrBase.clsRsyntax.SetOperation("+") - clsRggplotFunction.SetRCommand("ggplot") - clsRgeom_barFunction.SetRCommand("geom_bar") - clsCoordPolarFunction.SetRCommand("coord_polar") - clsRaesFunction.SetRCommand("aes") - clsRggplotFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesFunction) - ucrBase.clsRsyntax.SetOperatorParameter(True, clsRFunc:=clsRggplotFunction) - ucrBase.clsRsyntax.SetOperatorParameter(False, clsRFunc:=clsRgeom_barFunction) - clsRgeom_barFunction.AddParameter("stat", Chr(34) & "identity" & Chr(34)) - clsRgeom_barFunction.AddParameter("width", "1") - ucrBase.clsRsyntax.AddOperatorParameter("coord_polar", clsRFunc:=clsCoordPolarFunction) ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False + ucrNudNoOfColumns.Visible = False ucrReceiverWindSpeed.Selector = ucrWindRoseSelector + ucrReceiverWindSpeed.SetParameter(New RParameter("speed", 0)) + ucrReceiverWindSpeed.SetIncludedDataTypes({"numeric"}) + ucrReceiverWindSpeed.SetParameterIsRFunction() + ucrReceiverWindDirection.Selector = ucrWindRoseSelector - ucrFillReceiver.Selector = ucrWindRoseSelector + ucrReceiverWindDirection.SetParameter(New RParameter("direction", 1)) + ucrReceiverWindDirection.SetIncludedDataTypes({"numeric"}) + ucrReceiverWindDirection.SetParameterIsRFunction() - ucrSaveWindRose.SetDataFrameSelector(ucrWindRoseSelector.ucrAvailableDataFrames) - ucrBase.clsRsyntax.iCallType = 3 + ucrReceiverFacet.Selector = ucrWindRoseSelector + ucrReceiverFacet.SetIncludedDataTypes({"factor"}) + ucrReceiverFacet.SetParameter(New RParameter("facet", 2)) + ucrReceiverFacet.SetParameterIsRFunction() + + ucrNudNoOfColumns.SetParameter(New RParameter("n_col", 3)) + ucrNudNoOfColumns.SetLinkedDisplayControl(lblNoOfColumns) + ucrNudNoOfColumns.SetRDefault(1) + ucrNudNoOfColumns.Minimum = 1 + + ucrSaveGraph.SetPrefix("Windrose") + ucrSaveGraph.SetDataFrameSelector(ucrWindRoseSelector.ucrAvailableDataFrames) + ucrSaveGraph.SetSaveTypeAsGraph() + ucrSaveGraph.SetIsComboBox() + ucrSaveGraph.SetCheckBoxText("Save Graph") + ucrSaveGraph.SetAssignToIfUncheckedValue("last_graph") End Sub Private Sub SetDefaults() - ucrSaveWindRose.strPrefix = "Windrose" + clsDefaultRFunction = New RFunction + ucrWindRoseSelector.Reset() + ucrSaveGraph.Reset() ucrReceiverWindSpeed.SetMeAsReceiver() - TestOkEnabled() - ucrSaveWindRose.chkSaveGraph.Checked = False - End Sub - - Private Sub ReopenDialog() + clsDefaultRFunction.SetRCommand("windrose") + clsDefaultRFunction.AddParameter("n_col", 1) + clsDefaultRFunction.SetAssignTo("last_graph", strTempDataframe:=ucrWindRoseSelector.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") + ucrBase.clsRsyntax.SetBaseRFunction(clsDefaultRFunction) End Sub Private Sub TestOkEnabled() - If Not ucrReceiverWindSpeed.IsEmpty AndAlso Not ucrReceiverWindDirection.IsEmpty AndAlso ((ucrSaveWindRose.chkSaveGraph.Checked AndAlso Not ucrSaveWindRose.ucrInputGraphName.IsEmpty) OrElse Not ucrSaveWindRose.chkSaveGraph.Checked) Then + If Not ucrReceiverWindSpeed.IsEmpty AndAlso Not ucrReceiverWindDirection.IsEmpty AndAlso ucrSaveGraph.IsComplete AndAlso ((Not ucrReceiverFacet.IsEmpty AndAlso ucrNudNoOfColumns.GetText <> "") OrElse ucrReceiverFacet.IsEmpty) Then ucrBase.OKEnabled(True) Else ucrBase.OKEnabled(False) @@ -79,42 +96,36 @@ Public Class dlgWindrose Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset SetDefaults() - End Sub - Private Sub ucrReceiverWindSpeed_SelectionChanged(sender As Object, e As EventArgs) Handles ucrReceiverWindSpeed.SelectionChanged - If Not ucrReceiverWindSpeed.IsEmpty Then - clsRaesFunction.AddParameter("x", ucrReceiverWindSpeed.GetVariableNames(False)) - Else - clsRaesFunction.RemoveParameterByName("x") - End If + SetRCodeForControls(True) TestOkEnabled() End Sub - Private Sub ucrReceiverWindDirection_SelectionChanged(sender As Object, e As EventArgs) Handles ucrReceiverWindDirection.SelectionChanged - If Not ucrReceiverWindDirection.IsEmpty Then - clsRaesFunction.AddParameter("y", ucrReceiverWindDirection.GetVariableNames(False)) + Private Sub ucrReceiverFacet_Load() Handles ucrReceiverFacet.ControlValueChanged + GetMaxValue() + If ucrReceiverFacet.IsEmpty Then + ucrNudNoOfColumns.Visible = False Else - clsRaesFunction.RemoveParameterByName("y") + ucrNudNoOfColumns.Visible = True End If - TestOkEnabled() End Sub - Private Sub ucrFillReceiver_SelectionChanged(sender As Object, e As EventArgs) Handles ucrFillReceiver.SelectionChanged - If Not ucrFillReceiver.IsEmpty Then - clsRaesFunction.AddParameter("fill", ucrFillReceiver.GetVariableNames(False)) - Else - clsRaesFunction.RemoveParameterByName("fill") - End If + Private Sub ucrReceiverWindSpeed_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverWindSpeed.ControlContentsChanged, ucrReceiverWindDirection.ControlContentsChanged, ucrNudNoOfColumns.ControlContentsChanged, ucrReceiverFacet.ControlContentsChanged, ucrSaveGraph.ControlContentsChanged + TestOkEnabled() End Sub - Private Sub ucrWindRoseSelector_DataFrameChanged() Handles ucrWindRoseSelector.DataFrameChanged - clsRggplotFunction.AddParameter("data", clsRFunctionParameter:=ucrWindRoseSelector.ucrAvailableDataFrames.clsCurrDataFrame) + Private Sub GetMaxValue() + Dim iColMax As Integer + + clsLevelofFactor.SetRCommand("nlevels") + clsFactorColumn.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_columns_from_data") + clsFactorColumn.AddParameter("col_name", ucrReceiverFacet.GetVariableNames()) + clsLevelofFactor.AddParameter("x", clsRFunctionParameter:=clsFactorColumn) + + iColMax = frmMain.clsRLink.RunInternalScriptGetValue(clsLevelofFactor.ToScript).AsNumeric(0) + ucrNudNoOfColumns.Maximum = iColMax End Sub - Private Sub ucrSaveWindRose_GraphNameChanged() Handles ucrSaveWindRose.GraphNameChanged, ucrSaveWindRose.SaveGraphCheckedChanged - If ucrSaveWindRose.bSaveGraph Then - ucrBase.clsRsyntax.SetAssignTo(ucrSaveWindRose.strGraphName, strTempDataframe:=ucrWindRoseSelector.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:=ucrSaveWindRose.strGraphName) - Else - ucrBase.clsRsyntax.SetAssignTo("last_graph", strTempDataframe:=ucrWindRoseSelector.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") - End If - TestOkEnabled() + + Private Sub ucrWindRoseSelector_DataFrameChanged() Handles ucrWindRoseSelector.ControlValueChanged + clsFactorColumn.AddParameter("data_name", Chr(34) & ucrWindRoseSelector.ucrAvailableDataFrames.cboAvailableDataFrames.SelectedItem & Chr(34)) End Sub End Class \ No newline at end of file diff --git a/instat/frmMain.Designer.vb b/instat/frmMain.Designer.vb index 6f8a90b2389..890c2349234 100644 --- a/instat/frmMain.Designer.vb +++ b/instat/frmMain.Designer.vb @@ -27,10 +27,13 @@ Partial Class frmMain Me.mnuDescribeOneVariable = New System.Windows.Forms.ToolStripMenuItem() Me.mnuDescribeOneVariableSummarise = New System.Windows.Forms.ToolStripMenuItem() Me.mnuDescribeOneVariableGraph = New System.Windows.Forms.ToolStripMenuItem() + Me.ToolStripSeparator33 = New System.Windows.Forms.ToolStripSeparator() + Me.mnuDescribeOneVariableFrequencies = New System.Windows.Forms.ToolStripMenuItem() Me.mnuDescribeTwoVariables = New System.Windows.Forms.ToolStripMenuItem() Me.mnuDescribeTwoVariablesSummarise = New System.Windows.Forms.ToolStripMenuItem() - Me.mnuDescribeTwoVariablesTabulate = New System.Windows.Forms.ToolStripMenuItem() Me.mnuDescribeTwoVariablesGraph = New System.Windows.Forms.ToolStripMenuItem() + Me.ToolStripSeparator34 = New System.Windows.Forms.ToolStripSeparator() + Me.mnuDescribeTwoVariablesFrequencies = New System.Windows.Forms.ToolStripMenuItem() Me.mnuDescribeSpecific = New System.Windows.Forms.ToolStripMenuItem() Me.mnuDescribeSpecificFrequency = New System.Windows.Forms.ToolStripMenuItem() Me.mnuDescribeSpecificSummary = New System.Windows.Forms.ToolStripMenuItem() @@ -44,6 +47,7 @@ Partial Class frmMain Me.mnuDescribeSpecificRugPlot = New System.Windows.Forms.ToolStripMenuItem() Me.mnuDescribeSpecificBarChart = New System.Windows.Forms.ToolStripMenuItem() Me.mnuDescribeSpecificBarChartFromSummary = New System.Windows.Forms.ToolStripMenuItem() + Me.SummaryToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.mnuDescribeGeneral = New System.Windows.Forms.ToolStripMenuItem() Me.mnuDescribeGeneralColumnSummaries = New System.Windows.Forms.ToolStripMenuItem() Me.DescribeGeneralTabulation = New System.Windows.Forms.ToolStripMenuItem() @@ -152,6 +156,7 @@ Partial Class frmMain Me.mnuClimatic = New System.Windows.Forms.ToolStripMenuItem() Me.mnuClimaticFile = New System.Windows.Forms.ToolStripMenuItem() Me.mnuClimaticFileOpensst = New System.Windows.Forms.ToolStripMenuItem() + Me.OpenNetCDFToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.mnuClimateFileClimSoft = New System.Windows.Forms.ToolStripMenuItem() Me.mnuClimaticFileCliData = New System.Windows.Forms.ToolStripMenuItem() Me.ToolStripSeparator15 = New System.Windows.Forms.ToolStripSeparator() @@ -299,6 +304,8 @@ Partial Class frmMain Me.mnuFileOpenFromFile = New System.Windows.Forms.ToolStripMenuItem() Me.mnuFileOpenFromLibrary = New System.Windows.Forms.ToolStripMenuItem() Me.mnuImportFromODK = New System.Windows.Forms.ToolStripMenuItem() + Me.ImportFromCSPROToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.ImportFromToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.ToolStripSeparator27 = New System.Windows.Forms.ToolStripSeparator() Me.mnuFileConvert = New System.Windows.Forms.ToolStripMenuItem() Me.tlSeparatorFile = New System.Windows.Forms.ToolStripSeparator() @@ -424,6 +431,7 @@ Partial Class frmMain Me.DefineContractValueCategoriesToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.mnuCorruptionDescribe = New System.Windows.Forms.ToolStripMenuItem() Me.AaToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.DefineOutputsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.mnuCorruptionModel = New System.Windows.Forms.ToolStripMenuItem() Me.AaToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem() Me.DefineRedFlagsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() @@ -447,13 +455,13 @@ Partial Class frmMain ' 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, 19) + Me.mnuDescribe.Size = New System.Drawing.Size(64, 20) Me.mnuDescribe.Tag = "Describe" Me.mnuDescribe.Text = "Describe" ' 'mnuDescribeOneVariable ' - Me.mnuDescribeOneVariable.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuDescribeOneVariableSummarise, Me.mnuDescribeOneVariableGraph}) + Me.mnuDescribeOneVariable.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuDescribeOneVariableSummarise, Me.mnuDescribeOneVariableGraph, Me.ToolStripSeparator33, Me.mnuDescribeOneVariableFrequencies}) Me.mnuDescribeOneVariable.Name = "mnuDescribeOneVariable" Me.mnuDescribeOneVariable.Size = New System.Drawing.Size(172, 22) Me.mnuDescribeOneVariable.Tag = "One_Variable" @@ -473,9 +481,20 @@ Partial Class frmMain Me.mnuDescribeOneVariableGraph.Tag = "Graph..." Me.mnuDescribeOneVariableGraph.Text = "Graph..." ' + 'ToolStripSeparator33 + ' + Me.ToolStripSeparator33.Name = "ToolStripSeparator33" + Me.ToolStripSeparator33.Size = New System.Drawing.Size(139, 6) + ' + 'mnuDescribeOneVariableFrequencies + ' + Me.mnuDescribeOneVariableFrequencies.Name = "mnuDescribeOneVariableFrequencies" + Me.mnuDescribeOneVariableFrequencies.Size = New System.Drawing.Size(142, 22) + Me.mnuDescribeOneVariableFrequencies.Text = "Frequencies" + ' 'mnuDescribeTwoVariables ' - Me.mnuDescribeTwoVariables.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuDescribeTwoVariablesSummarise, Me.mnuDescribeTwoVariablesTabulate, Me.mnuDescribeTwoVariablesGraph}) + Me.mnuDescribeTwoVariables.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuDescribeTwoVariablesSummarise, Me.mnuDescribeTwoVariablesGraph, Me.ToolStripSeparator34, Me.mnuDescribeTwoVariablesFrequencies}) Me.mnuDescribeTwoVariables.Name = "mnuDescribeTwoVariables" Me.mnuDescribeTwoVariables.Size = New System.Drawing.Size(172, 22) Me.mnuDescribeTwoVariables.Tag = "Two_Variables" @@ -483,29 +502,34 @@ Partial Class frmMain ' 'mnuDescribeTwoVariablesSummarise ' + Me.mnuDescribeTwoVariablesSummarise.DoubleClickEnabled = True Me.mnuDescribeTwoVariablesSummarise.Name = "mnuDescribeTwoVariablesSummarise" - Me.mnuDescribeTwoVariablesSummarise.Size = New System.Drawing.Size(142, 22) + Me.mnuDescribeTwoVariablesSummarise.Size = New System.Drawing.Size(146, 22) Me.mnuDescribeTwoVariablesSummarise.Tag = "Summarise..." Me.mnuDescribeTwoVariablesSummarise.Text = "Summarise..." ' - 'mnuDescribeTwoVariablesTabulate - ' - Me.mnuDescribeTwoVariablesTabulate.Enabled = False - Me.mnuDescribeTwoVariablesTabulate.Name = "mnuDescribeTwoVariablesTabulate" - Me.mnuDescribeTwoVariablesTabulate.Size = New System.Drawing.Size(142, 22) - Me.mnuDescribeTwoVariablesTabulate.Tag = "Tabulate..." - Me.mnuDescribeTwoVariablesTabulate.Text = "Tabulate..." - ' 'mnuDescribeTwoVariablesGraph ' Me.mnuDescribeTwoVariablesGraph.Name = "mnuDescribeTwoVariablesGraph" - Me.mnuDescribeTwoVariablesGraph.Size = New System.Drawing.Size(142, 22) + Me.mnuDescribeTwoVariablesGraph.Size = New System.Drawing.Size(146, 22) Me.mnuDescribeTwoVariablesGraph.Tag = "Graph..." Me.mnuDescribeTwoVariablesGraph.Text = "Graph..." ' + 'ToolStripSeparator34 + ' + Me.ToolStripSeparator34.Name = "ToolStripSeparator34" + Me.ToolStripSeparator34.Size = New System.Drawing.Size(143, 6) + ' + 'mnuDescribeTwoVariablesFrequencies + ' + Me.mnuDescribeTwoVariablesFrequencies.DoubleClickEnabled = True + Me.mnuDescribeTwoVariablesFrequencies.Name = "mnuDescribeTwoVariablesFrequencies" + Me.mnuDescribeTwoVariablesFrequencies.Size = New System.Drawing.Size(146, 22) + Me.mnuDescribeTwoVariablesFrequencies.Text = "Frequencies..." + ' 'mnuDescribeSpecific ' - Me.mnuDescribeSpecific.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuDescribeSpecificFrequency, Me.mnuDescribeSpecificSummary, Me.mnuDescribeSpecificMultipleResponse, Me.ToolStripSeparator26, Me.mnuDescribeSpecificScatterPlot, Me.mnuDescribeSpecificLinePlot, Me.mnuDescribeSpecificHistogram, Me.mnuDescribeSpecificBoxplot, Me.mnuDescribeSpecificDotPlot, Me.mnuDescribeSpecificRugPlot, Me.mnuDescribeSpecificBarChart, Me.mnuDescribeSpecificBarChartFromSummary}) + Me.mnuDescribeSpecific.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuDescribeSpecificFrequency, Me.mnuDescribeSpecificSummary, Me.mnuDescribeSpecificMultipleResponse, Me.ToolStripSeparator26, Me.mnuDescribeSpecificScatterPlot, Me.mnuDescribeSpecificLinePlot, Me.mnuDescribeSpecificHistogram, Me.mnuDescribeSpecificBoxplot, Me.mnuDescribeSpecificDotPlot, Me.mnuDescribeSpecificRugPlot, Me.mnuDescribeSpecificBarChart, Me.mnuDescribeSpecificBarChartFromSummary, Me.SummaryToolStripMenuItem}) Me.mnuDescribeSpecific.Name = "mnuDescribeSpecific" Me.mnuDescribeSpecific.Size = New System.Drawing.Size(172, 22) Me.mnuDescribeSpecific.Tag = "Table_Dialogs" @@ -521,7 +545,6 @@ Partial Class frmMain ' 'mnuDescribeSpecificSummary ' - Me.mnuDescribeSpecificSummary.Enabled = False Me.mnuDescribeSpecificSummary.Name = "mnuDescribeSpecificSummary" Me.mnuDescribeSpecificSummary.Size = New System.Drawing.Size(217, 22) Me.mnuDescribeSpecificSummary.Tag = "Summary..." @@ -595,6 +618,12 @@ Partial Class frmMain Me.mnuDescribeSpecificBarChartFromSummary.Tag = "Bar_Chart_From_Summary..." Me.mnuDescribeSpecificBarChartFromSummary.Text = "Bar Chart From Summary..." ' + 'SummaryToolStripMenuItem + ' + Me.SummaryToolStripMenuItem.Name = "SummaryToolStripMenuItem" + Me.SummaryToolStripMenuItem.Size = New System.Drawing.Size(217, 22) + Me.SummaryToolStripMenuItem.Text = "Summary..." + ' 'mnuDescribeGeneral ' Me.mnuDescribeGeneral.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuDescribeGeneralColumnSummaries, Me.DescribeGeneralTabulation, Me.DescribeGeneralGraphics}) @@ -720,7 +749,7 @@ Partial Class frmMain ' Me.mnuModel.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuModelProbabilityDistributions, Me.ToolStripSeparator3, Me.mnuModelOneVariable, Me.mnuModelTwoVariables, Me.mnuModelThreeVariables, Me.mnuModelFourVariables, Me.mnuModelGeneral, Me.ToolStripSeparator4, Me.mnuModelOtherOneVariable, Me.mnuModelOtherTwoVariables, Me.mnuModelOtherThreeVariables, Me.mnuModelOtherGeneral}) Me.mnuModel.Name = "mnuModel" - Me.mnuModel.Size = New System.Drawing.Size(53, 19) + Me.mnuModel.Size = New System.Drawing.Size(53, 20) Me.mnuModel.Tag = "Model" Me.mnuModel.Text = "Model" ' @@ -975,21 +1004,21 @@ Partial Class frmMain Me.mnuModelOtherTwoVariablesSummaryData.Enabled = False Me.mnuModelOtherTwoVariablesSummaryData.Name = "mnuModelOtherTwoVariablesSummaryData" Me.mnuModelOtherTwoVariablesSummaryData.Size = New System.Drawing.Size(266, 22) - Me.mnuModelOtherTwoVariablesSummaryData.Tag = "Summary_Data" + Me.mnuModelOtherTwoVariablesSummaryData.Tag = "Summary_Data..." Me.mnuModelOtherTwoVariablesSummaryData.Text = "Summary Data..." ' 'mnuModelOtherTwoVariablesSimpleRegression ' Me.mnuModelOtherTwoVariablesSimpleRegression.Name = "mnuModelOtherTwoVariablesSimpleRegression" Me.mnuModelOtherTwoVariablesSimpleRegression.Size = New System.Drawing.Size(266, 22) - Me.mnuModelOtherTwoVariablesSimpleRegression.Tag = "Simple_Regression" + Me.mnuModelOtherTwoVariablesSimpleRegression.Tag = "Simple_Regression..." Me.mnuModelOtherTwoVariablesSimpleRegression.Text = "Simple Regression..." ' 'mnuModelOtherTwoVariablesOneWayANOVA ' Me.mnuModelOtherTwoVariablesOneWayANOVA.Name = "mnuModelOtherTwoVariablesOneWayANOVA" Me.mnuModelOtherTwoVariablesOneWayANOVA.Size = New System.Drawing.Size(266, 22) - Me.mnuModelOtherTwoVariablesOneWayANOVA.Tag = "One_Way_ANOVA" + Me.mnuModelOtherTwoVariablesOneWayANOVA.Tag = "One_Way_ANOVA..." Me.mnuModelOtherTwoVariablesOneWayANOVA.Text = "One Way ANOVA..." ' 'mnuModelOtherTwoVariablesNonParametricTwoSamples @@ -997,7 +1026,7 @@ Partial Class frmMain Me.mnuModelOtherTwoVariablesNonParametricTwoSamples.Enabled = False Me.mnuModelOtherTwoVariablesNonParametricTwoSamples.Name = "mnuModelOtherTwoVariablesNonParametricTwoSamples" Me.mnuModelOtherTwoVariablesNonParametricTwoSamples.Size = New System.Drawing.Size(266, 22) - Me.mnuModelOtherTwoVariablesNonParametricTwoSamples.Tag = "Non_Parameteric_Two_Samples" + Me.mnuModelOtherTwoVariablesNonParametricTwoSamples.Tag = "Non_Parameteric_Two_Samples..." Me.mnuModelOtherTwoVariablesNonParametricTwoSamples.Text = "Non Parametric Two Samples..." ' 'mnuModelOtherTwoVariablesNonParametricOneWayANOVA @@ -1021,7 +1050,7 @@ Partial Class frmMain Me.mnuModelOtherThreeVariablesSimpleWithGroups.Enabled = False Me.mnuModelOtherThreeVariablesSimpleWithGroups.Name = "mnuModelOtherThreeVariablesSimpleWithGroups" Me.mnuModelOtherThreeVariablesSimpleWithGroups.Size = New System.Drawing.Size(260, 22) - Me.mnuModelOtherThreeVariablesSimpleWithGroups.Tag = "Simple_with_groups" + Me.mnuModelOtherThreeVariablesSimpleWithGroups.Tag = "Simple_with_groups..." Me.mnuModelOtherThreeVariablesSimpleWithGroups.Text = "Simple With Groups..." ' 'mnuModelOtherThreeVariablesNonParametricTwoWayANOVA @@ -1060,7 +1089,7 @@ Partial Class frmMain Me.mnuModelOtherGeneralRegression.Enabled = False Me.mnuModelOtherGeneralRegression.Name = "mnuModelOtherGeneralRegression" Me.mnuModelOtherGeneralRegression.Size = New System.Drawing.Size(166, 22) - Me.mnuModelOtherGeneralRegression.Tag = "Regression" + Me.mnuModelOtherGeneralRegression.Tag = "Regression..." Me.mnuModelOtherGeneralRegression.Text = "Regression..." ' 'mnuModelOtherGeneralLogLinear @@ -1150,7 +1179,7 @@ Partial Class frmMain ' Me.mnuView.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuViewDataView, Me.mnuViewOutputWindow, Me.mnuViewLog, Me.mnuViewScriptWindow, Me.mnuViewColumnMetadata, Me.mnuViewDataFrameMetadata, Me.ToolStripSeparator22, Me.mnuViewCascade, Me.mnuViewTileVertically, Me.mnuViewTileHorizontally}) Me.mnuView.Name = "mnuView" - Me.mnuView.Size = New System.Drawing.Size(44, 19) + Me.mnuView.Size = New System.Drawing.Size(44, 20) Me.mnuView.Tag = "View" Me.mnuView.Text = "View" ' @@ -1222,7 +1251,7 @@ Partial Class frmMain ' Me.mnuHelp.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuHelpHelpIntroduction, Me.mnuHelpHistFAQ, Me.mnuHelpSpreadsheet, Me.mnuHelpGetingStarted, Me.ToolStripSeparator28, Me.mnuHelpMenus, Me.mnuHelpR, Me.mnuHelpRPackagesCommands, Me.mnuHelpDataset, Me.ToolStripSeparator29, Me.mnuHelpGuide, Me.mnuHelpAboutRInstat, Me.mnuHelpLicence}) Me.mnuHelp.Name = "mnuHelp" - Me.mnuHelp.Size = New System.Drawing.Size(44, 19) + Me.mnuHelp.Size = New System.Drawing.Size(44, 20) Me.mnuHelp.Tag = "Help" Me.mnuHelp.Text = "Help" ' @@ -1334,13 +1363,13 @@ Partial Class frmMain ' Me.mnuClimatic.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuClimaticFile, Me.ToolStripSeparator18, Me.mnuCliDefineClimaticData, Me.mnuClimaticPrepare, Me.mnuClimaticQualityControl, Me.ToolStripSeparator30, Me.mnuClimdex, Me.mnuClimaticDescribe, Me.mnuClimaticPICSA, Me.ToolStripSeparator16, Me.mnuClimaticModels, Me.mnuClimaticExamine, Me.mnuClimaticProcess, Me.ToolStripSeparator23, Me.mnuClimaticSCF, Me.mnuClimaticEvaporation, Me.mnuClimaticCrop, Me.mnuClimaticHeatSum, Me.mnuClimateMethods}) Me.mnuClimatic.Name = "mnuClimatic" - Me.mnuClimatic.Size = New System.Drawing.Size(63, 19) + Me.mnuClimatic.Size = New System.Drawing.Size(63, 20) Me.mnuClimatic.Tag = "Climatic" Me.mnuClimatic.Text = "Climatic" ' 'mnuClimaticFile ' - Me.mnuClimaticFile.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuClimaticFileOpensst, Me.mnuClimateFileClimSoft, Me.mnuClimaticFileCliData, Me.ToolStripSeparator15, Me.mnuClimaticFileExportToCPT}) + Me.mnuClimaticFile.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuClimaticFileOpensst, Me.OpenNetCDFToolStripMenuItem, Me.mnuClimateFileClimSoft, Me.mnuClimaticFileCliData, Me.ToolStripSeparator15, Me.mnuClimaticFileExportToCPT}) Me.mnuClimaticFile.Name = "mnuClimaticFile" Me.mnuClimaticFile.Size = New System.Drawing.Size(191, 22) Me.mnuClimaticFile.Text = "File" @@ -1348,30 +1377,36 @@ Partial Class frmMain 'mnuClimaticFileOpensst ' Me.mnuClimaticFileOpensst.Name = "mnuClimaticFileOpensst" - Me.mnuClimaticFileOpensst.Size = New System.Drawing.Size(155, 22) + Me.mnuClimaticFileOpensst.Size = New System.Drawing.Size(156, 22) Me.mnuClimaticFileOpensst.Text = "Open SST..." ' + 'OpenNetCDFToolStripMenuItem + ' + Me.OpenNetCDFToolStripMenuItem.Name = "OpenNetCDFToolStripMenuItem" + Me.OpenNetCDFToolStripMenuItem.Size = New System.Drawing.Size(156, 22) + Me.OpenNetCDFToolStripMenuItem.Text = "Open NetCDF..." + ' 'mnuClimateFileClimSoft ' Me.mnuClimateFileClimSoft.Name = "mnuClimateFileClimSoft" - Me.mnuClimateFileClimSoft.Size = New System.Drawing.Size(155, 22) + Me.mnuClimateFileClimSoft.Size = New System.Drawing.Size(156, 22) Me.mnuClimateFileClimSoft.Text = "ClimSoft..." ' 'mnuClimaticFileCliData ' Me.mnuClimaticFileCliData.Name = "mnuClimaticFileCliData" - Me.mnuClimaticFileCliData.Size = New System.Drawing.Size(155, 22) + Me.mnuClimaticFileCliData.Size = New System.Drawing.Size(156, 22) Me.mnuClimaticFileCliData.Text = "CliData..." ' 'ToolStripSeparator15 ' Me.ToolStripSeparator15.Name = "ToolStripSeparator15" - Me.ToolStripSeparator15.Size = New System.Drawing.Size(152, 6) + Me.ToolStripSeparator15.Size = New System.Drawing.Size(153, 6) ' 'mnuClimaticFileExportToCPT ' Me.mnuClimaticFileExportToCPT.Name = "mnuClimaticFileExportToCPT" - Me.mnuClimaticFileExportToCPT.Size = New System.Drawing.Size(155, 22) + Me.mnuClimaticFileExportToCPT.Size = New System.Drawing.Size(156, 22) Me.mnuClimaticFileExportToCPT.Tag = "Export_to_CPT" Me.mnuClimaticFileExportToCPT.Text = "Export to CPT..." ' @@ -1465,10 +1500,9 @@ Partial Class frmMain ' 'mnuClimaticPrepareEventsSpells ' - Me.mnuClimaticPrepareEventsSpells.Enabled = False Me.mnuClimaticPrepareEventsSpells.Name = "mnuClimaticPrepareEventsSpells" Me.mnuClimaticPrepareEventsSpells.Size = New System.Drawing.Size(172, 22) - Me.mnuClimaticPrepareEventsSpells.Text = "Spells..." + Me.mnuClimaticPrepareEventsSpells.Text = "Dry Spells..." ' 'Extremes ' @@ -1478,7 +1512,6 @@ Partial Class frmMain ' 'mnuClimaticPrepareEventsWaterBalance ' - Me.mnuClimaticPrepareEventsWaterBalance.Enabled = False Me.mnuClimaticPrepareEventsWaterBalance.Name = "mnuClimaticPrepareEventsWaterBalance" Me.mnuClimaticPrepareEventsWaterBalance.Size = New System.Drawing.Size(172, 22) Me.mnuClimaticPrepareEventsWaterBalance.Text = "Water Balance..." @@ -2148,7 +2181,7 @@ Partial Class frmMain ' Me.mnuEdit.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuEditFind, Me.mnuEditFindNext, Me.mnuEditReplace, Me.mnuEditCut, Me.mnuEditCopy, Me.mnuEditCopySpecial, Me.mnuEditPaste, Me.mnuEditSelectAll}) Me.mnuEdit.Name = "mnuEdit" - Me.mnuEdit.Size = New System.Drawing.Size(39, 19) + Me.mnuEdit.Size = New System.Drawing.Size(39, 20) Me.mnuEdit.Tag = "Edit" Me.mnuEdit.Text = "Edit" ' @@ -2222,11 +2255,10 @@ Partial Class frmMain 'stsStrip ' Me.stsStrip.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.tstatus}) - Me.stsStrip.Location = New System.Drawing.Point(0, 851) + Me.stsStrip.Location = New System.Drawing.Point(0, 285) Me.stsStrip.Name = "stsStrip" - Me.stsStrip.Padding = New System.Windows.Forms.Padding(3, 0, 37, 0) Me.stsStrip.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional - Me.stsStrip.Size = New System.Drawing.Size(1596, 22) + Me.stsStrip.Size = New System.Drawing.Size(508, 22) Me.stsStrip.TabIndex = 8 Me.stsStrip.Text = "Status" ' @@ -2240,11 +2272,10 @@ Partial Class frmMain ' Me.Tool_strip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden Me.Tool_strip.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuTbNew, Me.mnuTbOpen, Me.mnuTbSave, Me.mnuTbPrint, Me.toolStripSeparator, Me.mnuTbCut, Me.mnuTbCopy, Me.mnuTbPaste, Me.mnuTbDelete, Me.separator1, Me.EditLastDialogueToolStrip, Me.mnuTbShowLast10, Me.separator2, Me.mnuTbHelp}) - Me.Tool_strip.Location = New System.Drawing.Point(0, 29) + Me.Tool_strip.Location = New System.Drawing.Point(0, 24) Me.Tool_strip.Name = "Tool_strip" - Me.Tool_strip.Padding = New System.Windows.Forms.Padding(0, 0, 3, 0) Me.Tool_strip.RenderMode = System.Windows.Forms.ToolStripRenderMode.System - Me.Tool_strip.Size = New System.Drawing.Size(1596, 25) + Me.Tool_strip.Size = New System.Drawing.Size(508, 25) Me.Tool_strip.TabIndex = 7 Me.Tool_strip.Text = "Tool" ' @@ -2386,18 +2417,17 @@ Partial Class frmMain Me.mnuBar.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow Me.mnuBar.Location = New System.Drawing.Point(0, 0) Me.mnuBar.Name = "mnuBar" - Me.mnuBar.Padding = New System.Windows.Forms.Padding(16, 5, 0, 5) Me.mnuBar.RenderMode = System.Windows.Forms.ToolStripRenderMode.System Me.mnuBar.ShowItemToolTips = True - Me.mnuBar.Size = New System.Drawing.Size(1596, 29) + Me.mnuBar.Size = New System.Drawing.Size(508, 24) Me.mnuBar.TabIndex = 6 Me.mnuBar.Text = "Menu_strip" ' 'mnuFile ' - Me.mnuFile.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuFileNewDataFrame, Me.mnuFileOpenFromFile, Me.mnuFileOpenFromLibrary, Me.mnuImportFromODK, Me.ToolStripSeparator27, Me.mnuFileConvert, Me.tlSeparatorFile, Me.mnuFileSave, Me.mnuFileSaveAs, Me.mnuExport, Me.mnuFilePrint, Me.mnuFilePrintPreview, Me.tlSeparatorFile3, Me.mnuFileCloseData, Me.ToolStripSeparator8, Me.mnuFIleExit}) + Me.mnuFile.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuFileNewDataFrame, Me.mnuFileOpenFromFile, Me.mnuFileOpenFromLibrary, Me.mnuImportFromODK, Me.ImportFromCSPROToolStripMenuItem, Me.ImportFromToolStripMenuItem, Me.ToolStripSeparator27, Me.mnuFileConvert, Me.tlSeparatorFile, Me.mnuFileSave, Me.mnuFileSaveAs, Me.mnuExport, Me.mnuFilePrint, Me.mnuFilePrintPreview, Me.tlSeparatorFile3, Me.mnuFileCloseData, Me.ToolStripSeparator8, Me.mnuFIleExit}) Me.mnuFile.Name = "mnuFile" - Me.mnuFile.Size = New System.Drawing.Size(37, 19) + Me.mnuFile.Size = New System.Drawing.Size(37, 20) Me.mnuFile.Tag = "File" Me.mnuFile.Text = "File" ' @@ -2430,6 +2460,18 @@ Partial Class frmMain Me.mnuImportFromODK.Size = New System.Drawing.Size(204, 22) Me.mnuImportFromODK.Text = "Import from ODK..." ' + 'ImportFromCSPROToolStripMenuItem + ' + Me.ImportFromCSPROToolStripMenuItem.Name = "ImportFromCSPROToolStripMenuItem" + Me.ImportFromCSPROToolStripMenuItem.Size = New System.Drawing.Size(204, 22) + Me.ImportFromCSPROToolStripMenuItem.Text = "Import from CSPRO..." + ' + 'ImportFromToolStripMenuItem + ' + Me.ImportFromToolStripMenuItem.Name = "ImportFromToolStripMenuItem" + Me.ImportFromToolStripMenuItem.Size = New System.Drawing.Size(204, 22) + Me.ImportFromToolStripMenuItem.Text = "Import from Databases..." + ' 'ToolStripSeparator27 ' Me.ToolStripSeparator27.Name = "ToolStripSeparator27" @@ -2468,7 +2510,7 @@ Partial Class frmMain ' Me.mnuPrepare.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuPrepareDataFrame, Me.mnuPrepareCheckData, Me.ToolStripSeparator6, Me.mnuPrepareColumnCalculate, Me.mnuPrepareColumnGenerate, Me.mnuPrepareColumnFactor, Me.mnuPrepareColumnText, Me.mnuPrepareColumnDate, Me.mnuPrepareColumnReshape, Me.ToolStripSeparator7, Me.mnuPrepareKeysAndLinks, Me.mnuPrepareDataObject, Me.mnuPrepareRObjects}) Me.mnuPrepare.Name = "mnuPrepare" - Me.mnuPrepare.Size = New System.Drawing.Size(59, 19) + Me.mnuPrepare.Size = New System.Drawing.Size(59, 20) Me.mnuPrepare.Tag = "Prepare" Me.mnuPrepare.Text = "Prepare" ' @@ -3188,9 +3230,9 @@ Partial Class frmMain ' 'mnuCorruption ' - Me.mnuCorruption.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuCorruptionFile, Me.mnuCorruptionDefineCorruptionData, Me.mnuCorruptionPrepare, Me.mnuCorruptionDescribe, Me.mnuCorruptionModel, Me.DefineRedFlagsToolStripMenuItem, Me.CalculateCRIToolStripMenuItem, Me.TestsAndChecksToolStripMenuItem}) + Me.mnuCorruption.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuCorruptionFile, Me.mnuCorruptionDefineCorruptionData, Me.mnuCorruptionPrepare, Me.mnuCorruptionDescribe, Me.DefineOutputsToolStripMenuItem, Me.mnuCorruptionModel, Me.DefineRedFlagsToolStripMenuItem, Me.CalculateCRIToolStripMenuItem, Me.TestsAndChecksToolStripMenuItem}) Me.mnuCorruption.Name = "mnuCorruption" - Me.mnuCorruption.Size = New System.Drawing.Size(77, 19) + Me.mnuCorruption.Size = New System.Drawing.Size(77, 20) Me.mnuCorruption.Text = "Corruption" ' 'mnuCorruptionFile @@ -3222,7 +3264,7 @@ Partial Class frmMain ' Me.MergeAdditionalDataToolStripMenuItem.Name = "MergeAdditionalDataToolStripMenuItem" Me.MergeAdditionalDataToolStripMenuItem.Size = New System.Drawing.Size(262, 22) - Me.MergeAdditionalDataToolStripMenuItem.Text = "Merge additional data..." + Me.MergeAdditionalDataToolStripMenuItem.Text = "Merge Additional Data..." ' 'FilterToolStripMenuItem ' @@ -3264,9 +3306,15 @@ Partial Class frmMain 'AaToolStripMenuItem ' Me.AaToolStripMenuItem.Name = "AaToolStripMenuItem" - Me.AaToolStripMenuItem.Size = New System.Drawing.Size(86, 22) + Me.AaToolStripMenuItem.Size = New System.Drawing.Size(152, 22) Me.AaToolStripMenuItem.Text = "aa" ' + 'DefineOutputsToolStripMenuItem + ' + Me.DefineOutputsToolStripMenuItem.Name = "DefineOutputsToolStripMenuItem" + Me.DefineOutputsToolStripMenuItem.Size = New System.Drawing.Size(205, 22) + Me.DefineOutputsToolStripMenuItem.Text = "Define Outputs..." + ' 'mnuCorruptionModel ' Me.mnuCorruptionModel.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.AaToolStripMenuItem1}) @@ -3277,8 +3325,8 @@ Partial Class frmMain 'AaToolStripMenuItem1 ' Me.AaToolStripMenuItem1.Name = "AaToolStripMenuItem1" - Me.AaToolStripMenuItem1.Size = New System.Drawing.Size(86, 22) - Me.AaToolStripMenuItem1.Text = "aa" + Me.AaToolStripMenuItem1.Size = New System.Drawing.Size(152, 22) + Me.AaToolStripMenuItem1.Text = "Fit Model..." ' 'DefineRedFlagsToolStripMenuItem ' @@ -3296,13 +3344,13 @@ Partial Class frmMain ' Me.TestsAndChecksToolStripMenuItem.Name = "TestsAndChecksToolStripMenuItem" Me.TestsAndChecksToolStripMenuItem.Size = New System.Drawing.Size(205, 22) - Me.TestsAndChecksToolStripMenuItem.Text = "Tests and checks..." + Me.TestsAndChecksToolStripMenuItem.Text = "Tests and Checks..." ' 'mnuTools ' 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(47, 19) + Me.mnuTools.Size = New System.Drawing.Size(47, 20) Me.mnuTools.Text = "Tools" ' 'mnuToolsRunRCode @@ -3366,16 +3414,15 @@ Partial Class frmMain ' 'frmMain ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(16.0!, 31.0!) + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(1596, 873) + Me.ClientSize = New System.Drawing.Size(508, 307) Me.Controls.Add(Me.stsStrip) Me.Controls.Add(Me.Tool_strip) Me.Controls.Add(Me.mnuBar) Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) Me.IsMdiContainer = True Me.MainMenuStrip = Me.mnuBar - Me.Margin = New System.Windows.Forms.Padding(8, 7, 8, 7) Me.Name = "frmMain" Me.Text = "R-Instat" Me.WindowState = System.Windows.Forms.FormWindowState.Maximized @@ -3804,4 +3851,14 @@ Partial Class frmMain Friend WithEvents AaToolStripMenuItem1 As ToolStripMenuItem Friend WithEvents CalculateCRIToolStripMenuItem As ToolStripMenuItem Friend WithEvents TestsAndChecksToolStripMenuItem As ToolStripMenuItem + Friend WithEvents ToolStripSeparator33 As ToolStripSeparator + Friend WithEvents mnuDescribeOneVariableFrequencies As ToolStripMenuItem + Friend WithEvents SummaryToolStripMenuItem As ToolStripMenuItem + Friend WithEvents ToolStripSeparator34 As ToolStripSeparator + Friend WithEvents ToolStripMenuItem1 As ToolStripMenuItem + Friend WithEvents mnuDescribeTwoVariablesFrequencies As ToolStripMenuItem + Friend WithEvents ImportFromCSPROToolStripMenuItem As ToolStripMenuItem + Friend WithEvents ImportFromToolStripMenuItem As ToolStripMenuItem + Friend WithEvents OpenNetCDFToolStripMenuItem As ToolStripMenuItem + Friend WithEvents DefineOutputsToolStripMenuItem As ToolStripMenuItem End Class diff --git a/instat/frmMain.vb b/instat/frmMain.vb index 5b3cd5f7b6a..9836ed7cc40 100644 --- a/instat/frmMain.vb +++ b/instat/frmMain.vb @@ -1032,15 +1032,12 @@ Public Class frmMain End Sub Private Sub mnuCorruptionOrganise_Click(sender As Object, e As EventArgs) Handles mnuCorruptionPrepare.Click - dlgCorruptionOrganise.ShowDialog() End Sub Private Sub mnuCorruptionDescribe_Click(sender As Object, e As EventArgs) Handles mnuCorruptionDescribe.Click - dlgCorruptionDescribe.ShowDialog() End Sub Private Sub mnuCorruptionModel_Click(sender As Object, e As EventArgs) Handles mnuCorruptionModel.Click - dlgCorruptionModel.ShowDialog() End Sub Private Sub GeneralSummariesToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles mnuPrepareColumnReshapeGeneralSummaries.Click @@ -1166,6 +1163,43 @@ Public Class frmMain dlgRestrict.ShowDialog() End Sub + Private Sub AaToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles AaToolStripMenuItem1.Click + dlgFitCorruptionModel.ShowDialog() + End Sub + + Private Sub DefineRedFlagsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles DefineRedFlagsToolStripMenuItem.Click + dlgDefineRedFlags.ShowDialog() + End Sub + + Private Sub mnuDescribeTwoVariablesTabulate_Click(sender As Object, e As EventArgs) + + End Sub + + Private Sub mnuDescribeTwoVariablesFrequencies_Click(sender As Object, e As EventArgs) Handles mnuDescribeTwoVariablesFrequencies.Click + dlgTwoWayFrequencies.ShowDialog() + End Sub + + Private Sub SummaryToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SummaryToolStripMenuItem.Click + dlgNewSummaryTables.ShowDialog() + End Sub + + Private Sub ImportFromCSPROToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ImportFromCSPROToolStripMenuItem.Click + dlgImportFromCSPRO.ShowDialog() + End Sub + + Private Sub ImportFromToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ImportFromToolStripMenuItem.Click + dlgImportFromDatabases.ShowDialog() + End Sub + + Private Sub OpenNetCDFToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles OpenNetCDFToolStripMenuItem.Click + dlgOpenNetCDF.ShowDialog() + End Sub + + Private Sub DefineOutputsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles DefineOutputsToolStripMenuItem.Click + dlgDefineCorruptionOutputs.ShowDialog() + End Sub + + 'Private Sub TESTToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles TESTToolStripMenuItem.Click ' 'TEST temporary ' 'TESTING TO BE ERASED !!!!!!! diff --git a/instat/instat.vbproj b/instat/instat.vbproj index 2c8d9eb0b6b..687a7d21bbf 100644 --- a/instat/instat.vbproj +++ b/instat/instat.vbproj @@ -257,6 +257,12 @@ Form + + dlgDrySpells.vb + + + Form + dlgEnter.vb @@ -293,6 +299,12 @@ Form + + dlgImportFromCSPRO.vb + + + Form + dlgImportFromODK.vb @@ -329,6 +341,12 @@ Form + + dlgNewSummaryTables.vb + + + Form + dlgOneVarCompareModels.vb @@ -353,6 +371,12 @@ Form + + dlgOpenNetCDF.vb + + + Form + dlgOpenSST.vb @@ -383,6 +407,12 @@ Form + + dlgRatingScales.vb + + + Form + dlgRugPlot.vb @@ -419,6 +449,12 @@ Form + + dlgTwoWayFrequencies.vb + + + Form + DlgUseDate.vb @@ -449,6 +485,12 @@ Form + + ImportFromDatabases.vb + + + Form + sdgAddLink.vb @@ -2389,6 +2431,9 @@ dlgHideShowColumns.vb + + dlgImportFromCSPRO.vb + dlgImportFromODK.vb @@ -2446,6 +2491,9 @@ dlgNewMarkovChains.vb + + dlgNewSummaryTables.vb + dlgOneVarCompareModels.vb @@ -2473,6 +2521,9 @@ dlgOneWayANOVA.vb + + dlgOpenNetCDF.vb + dlgOpenSST.vb @@ -2539,6 +2590,9 @@ dlgRandomSubsets.vb + + dlgRatingScales.vb + dlgRecodeNumeric.vb @@ -2737,6 +2791,9 @@ dlgTwoVariableUseModel.vb + + dlgTwoWayFrequencies.vb + dlgUnusedLevels.vb @@ -2824,6 +2881,9 @@ dlgRecodeFactor.vb + + ImportFromDatabases.vb + sdgAddLink.vb diff --git a/instat/sdgCombineGraphOptions.Designer.vb b/instat/sdgCombineGraphOptions.Designer.vb index 4ded7135b95..a2f91574a07 100644 --- a/instat/sdgCombineGraphOptions.Designer.vb +++ b/instat/sdgCombineGraphOptions.Designer.vb @@ -1,9 +1,9 @@ - _ + Partial Class sdgCombineGraphOptions 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,33 +20,31 @@ Partial Class sdgCombineGraphOptions '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.tbcLayout = New System.Windows.Forms.TabControl() Me.tbpLayout = New System.Windows.Forms.TabPage() Me.txtLayoutMessage = New System.Windows.Forms.TextBox() - Me.chkSpecifyOrder = New System.Windows.Forms.CheckBox() Me.grdLayout = New unvell.ReoGrid.ReoGridControl() Me.lblSelectedgrpahs = New System.Windows.Forms.Label() Me.lstGraphs = New System.Windows.Forms.ListBox() Me.lblNumberofColumns = New System.Windows.Forms.Label() Me.lblNumberofRows = New System.Windows.Forms.Label() - Me.nudColumns = New System.Windows.Forms.NumericUpDown() - Me.nudRows = New System.Windows.Forms.NumericUpDown() Me.tbpLabels = New System.Windows.Forms.TabPage() - Me.ucrInputLeft = New instat.ucrInputTextBox() - Me.ucrInputRight = New instat.ucrInputTextBox() - Me.ucrInputBottom = New instat.ucrInputTextBox() - Me.ucrInputTop = New instat.ucrInputTextBox() Me.lblLeft = New System.Windows.Forms.Label() Me.LblRight = New System.Windows.Forms.Label() Me.lblBottom = New System.Windows.Forms.Label() Me.lblTop = New System.Windows.Forms.Label() Me.ucrsdgLayoutBase = New instat.ucrButtonsSubdialogue() + Me.ucrChkSpecifyOrder = New instat.ucrCheck() + Me.ucrNudColumns = New instat.ucrNud() + Me.ucrNudRows = New instat.ucrNud() + Me.ucrInputLeft = New instat.ucrInputTextBox() + Me.ucrInputRight = New instat.ucrInputTextBox() + Me.ucrInputBottom = New instat.ucrInputTextBox() + Me.ucrInputTop = New instat.ucrInputTextBox() Me.tbcLayout.SuspendLayout() Me.tbpLayout.SuspendLayout() - CType(Me.nudColumns, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.nudRows, System.ComponentModel.ISupportInitialize).BeginInit() Me.tbpLabels.SuspendLayout() Me.SuspendLayout() ' @@ -62,15 +60,15 @@ Partial Class sdgCombineGraphOptions ' 'tbpLayout ' + Me.tbpLayout.Controls.Add(Me.ucrChkSpecifyOrder) + Me.tbpLayout.Controls.Add(Me.ucrNudColumns) + Me.tbpLayout.Controls.Add(Me.ucrNudRows) Me.tbpLayout.Controls.Add(Me.txtLayoutMessage) - Me.tbpLayout.Controls.Add(Me.chkSpecifyOrder) Me.tbpLayout.Controls.Add(Me.grdLayout) Me.tbpLayout.Controls.Add(Me.lblSelectedgrpahs) Me.tbpLayout.Controls.Add(Me.lstGraphs) Me.tbpLayout.Controls.Add(Me.lblNumberofColumns) Me.tbpLayout.Controls.Add(Me.lblNumberofRows) - Me.tbpLayout.Controls.Add(Me.nudColumns) - Me.tbpLayout.Controls.Add(Me.nudRows) Me.tbpLayout.Location = New System.Drawing.Point(4, 22) Me.tbpLayout.Name = "tbpLayout" Me.tbpLayout.Padding = New System.Windows.Forms.Padding(3) @@ -87,16 +85,6 @@ Partial Class sdgCombineGraphOptions Me.txtLayoutMessage.Size = New System.Drawing.Size(342, 20) Me.txtLayoutMessage.TabIndex = 6 ' - 'chkSpecifyOrder - ' - Me.chkSpecifyOrder.AutoSize = True - Me.chkSpecifyOrder.Location = New System.Drawing.Point(13, 151) - Me.chkSpecifyOrder.Name = "chkSpecifyOrder" - Me.chkSpecifyOrder.Size = New System.Drawing.Size(88, 17) - Me.chkSpecifyOrder.TabIndex = 4 - Me.chkSpecifyOrder.Text = "Specify order" - Me.chkSpecifyOrder.UseVisualStyleBackColor = True - ' 'grdLayout ' Me.grdLayout.BackColor = System.Drawing.Color.White @@ -149,22 +137,6 @@ Partial Class sdgCombineGraphOptions Me.lblNumberofRows.TabIndex = 1 Me.lblNumberofRows.Text = "Number of Rows:" ' - 'nudColumns - ' - Me.nudColumns.Location = New System.Drawing.Point(111, 47) - Me.nudColumns.Name = "nudColumns" - Me.nudColumns.Size = New System.Drawing.Size(42, 20) - Me.nudColumns.TabIndex = 1 - Me.nudColumns.Value = New Decimal(New Integer() {2, 0, 0, 0}) - ' - 'nudRows - ' - Me.nudRows.Location = New System.Drawing.Point(111, 20) - Me.nudRows.Name = "nudRows" - Me.nudRows.Size = New System.Drawing.Size(42, 20) - Me.nudRows.TabIndex = 0 - Me.nudRows.Value = New Decimal(New Integer() {2, 0, 0, 0}) - ' 'tbpLabels ' Me.tbpLabels.Controls.Add(Me.ucrInputLeft) @@ -183,38 +155,6 @@ Partial Class sdgCombineGraphOptions Me.tbpLabels.Text = "Labels" Me.tbpLabels.UseVisualStyleBackColor = True ' - 'ucrInputLeft - ' - Me.ucrInputLeft.IsReadOnly = False - Me.ucrInputLeft.Location = New System.Drawing.Point(60, 100) - Me.ucrInputLeft.Name = "ucrInputLeft" - Me.ucrInputLeft.Size = New System.Drawing.Size(137, 21) - Me.ucrInputLeft.TabIndex = 7 - ' - 'ucrInputRight - ' - Me.ucrInputRight.IsReadOnly = False - Me.ucrInputRight.Location = New System.Drawing.Point(60, 70) - Me.ucrInputRight.Name = "ucrInputRight" - Me.ucrInputRight.Size = New System.Drawing.Size(137, 21) - Me.ucrInputRight.TabIndex = 5 - ' - 'ucrInputBottom - ' - Me.ucrInputBottom.IsReadOnly = False - Me.ucrInputBottom.Location = New System.Drawing.Point(60, 42) - Me.ucrInputBottom.Name = "ucrInputBottom" - Me.ucrInputBottom.Size = New System.Drawing.Size(137, 21) - Me.ucrInputBottom.TabIndex = 3 - ' - 'ucrInputTop - ' - Me.ucrInputTop.IsReadOnly = False - Me.ucrInputTop.Location = New System.Drawing.Point(60, 15) - Me.ucrInputTop.Name = "ucrInputTop" - Me.ucrInputTop.Size = New System.Drawing.Size(137, 21) - Me.ucrInputTop.TabIndex = 1 - ' 'lblLeft ' Me.lblLeft.AutoSize = True @@ -258,6 +198,74 @@ Partial Class sdgCombineGraphOptions Me.ucrsdgLayoutBase.Size = New System.Drawing.Size(142, 30) Me.ucrsdgLayoutBase.TabIndex = 3 ' + 'ucrChkSpecifyOrder + ' + Me.ucrChkSpecifyOrder.Checked = False + Me.ucrChkSpecifyOrder.Location = New System.Drawing.Point(11, 148) + Me.ucrChkSpecifyOrder.Name = "ucrChkSpecifyOrder" + Me.ucrChkSpecifyOrder.Size = New System.Drawing.Size(100, 20) + Me.ucrChkSpecifyOrder.TabIndex = 8 + ' + 'ucrNudColumns + ' + Me.ucrNudColumns.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudColumns.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudColumns.Location = New System.Drawing.Point(111, 47) + Me.ucrNudColumns.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudColumns.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudColumns.Name = "ucrNudColumns" + Me.ucrNudColumns.Size = New System.Drawing.Size(50, 20) + Me.ucrNudColumns.TabIndex = 7 + Me.ucrNudColumns.Value = New Decimal(New Integer() {2, 0, 0, 0}) + ' + 'ucrNudRows + ' + Me.ucrNudRows.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudRows.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudRows.Location = New System.Drawing.Point(111, 20) + Me.ucrNudRows.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudRows.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudRows.Name = "ucrNudRows" + Me.ucrNudRows.Size = New System.Drawing.Size(50, 20) + Me.ucrNudRows.TabIndex = 7 + Me.ucrNudRows.Value = New Decimal(New Integer() {2, 0, 0, 0}) + ' + 'ucrInputLeft + ' + Me.ucrInputLeft.IsMultiline = False + Me.ucrInputLeft.IsReadOnly = False + Me.ucrInputLeft.Location = New System.Drawing.Point(60, 100) + Me.ucrInputLeft.Name = "ucrInputLeft" + Me.ucrInputLeft.Size = New System.Drawing.Size(137, 21) + Me.ucrInputLeft.TabIndex = 7 + ' + 'ucrInputRight + ' + Me.ucrInputRight.IsMultiline = False + Me.ucrInputRight.IsReadOnly = False + Me.ucrInputRight.Location = New System.Drawing.Point(60, 70) + Me.ucrInputRight.Name = "ucrInputRight" + Me.ucrInputRight.Size = New System.Drawing.Size(137, 21) + Me.ucrInputRight.TabIndex = 5 + ' + 'ucrInputBottom + ' + Me.ucrInputBottom.IsMultiline = False + Me.ucrInputBottom.IsReadOnly = False + Me.ucrInputBottom.Location = New System.Drawing.Point(60, 42) + Me.ucrInputBottom.Name = "ucrInputBottom" + Me.ucrInputBottom.Size = New System.Drawing.Size(137, 21) + Me.ucrInputBottom.TabIndex = 3 + ' + 'ucrInputTop + ' + Me.ucrInputTop.IsMultiline = False + Me.ucrInputTop.IsReadOnly = False + Me.ucrInputTop.Location = New System.Drawing.Point(60, 15) + Me.ucrInputTop.Name = "ucrInputTop" + Me.ucrInputTop.Size = New System.Drawing.Size(137, 21) + Me.ucrInputTop.TabIndex = 1 + ' 'sdgCombineGraphOptions ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -274,8 +282,6 @@ Partial Class sdgCombineGraphOptions Me.tbcLayout.ResumeLayout(False) Me.tbpLayout.ResumeLayout(False) Me.tbpLayout.PerformLayout() - CType(Me.nudColumns, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.nudRows, System.ComponentModel.ISupportInitialize).EndInit() Me.tbpLabels.ResumeLayout(False) Me.tbpLabels.PerformLayout() Me.ResumeLayout(False) @@ -286,8 +292,6 @@ Partial Class sdgCombineGraphOptions Friend WithEvents tbpLayout As TabPage Friend WithEvents lblNumberofColumns As Label Friend WithEvents lblNumberofRows As Label - Friend WithEvents nudColumns As NumericUpDown - Friend WithEvents nudRows As NumericUpDown Friend WithEvents tbpLabels As TabPage Friend WithEvents ucrInputLeft As ucrInputTextBox Friend WithEvents ucrInputRight As ucrInputTextBox @@ -300,7 +304,9 @@ Partial Class sdgCombineGraphOptions Friend WithEvents ucrsdgLayoutBase As ucrButtonsSubdialogue Friend WithEvents lstGraphs As ListBox Friend WithEvents lblSelectedgrpahs As Label - Friend WithEvents chkSpecifyOrder As CheckBox Friend WithEvents grdLayout As unvell.ReoGrid.ReoGridControl Friend WithEvents txtLayoutMessage As TextBox -End Class + Friend WithEvents ucrNudColumns As ucrNud + Friend WithEvents ucrNudRows As ucrNud + Friend WithEvents ucrChkSpecifyOrder As ucrCheck +End Class \ No newline at end of file diff --git a/instat/sdgCombineGraphOptions.vb b/instat/sdgCombineGraphOptions.vb index cd7cbf01346..da4bd80e54f 100644 --- a/instat/sdgCombineGraphOptions.vb +++ b/instat/sdgCombineGraphOptions.vb @@ -17,6 +17,9 @@ Imports unvell.ReoGrid.Events Public Class sdgCombineGraphOptions Private bFirstLoad As Boolean = True + Private bInitialiseControls As Boolean = False + Public clsCombineGraph As New RFunction + Public clsRsyntax As New RSyntax Public WithEvents grdCurrSheet As Worksheet Public clsMatrixFunction As New RFunction @@ -31,92 +34,43 @@ Public Class sdgCombineGraphOptions grdLayout.SetSettings(WorkbookSettings.View_ShowHorScroll, False) grdLayout.SheetTabNewButtonVisible = False grdCurrSheet = grdLayout.CurrentWorksheet - nudRows.Minimum = 1 - nudRows.Minimum = 1 + ucrNudRows.Minimum = 1 + ucrNudColumns.Minimum = 1 grdCurrSheet.SetSettings(WorksheetSettings.Edit_DragSelectionToMoveCells, False) End Sub Private Sub sdgLayout_Load(sender As Object, e As EventArgs) Handles MyBase.Load - If bFirstLoad Then - InitialiseDialog() - SetDefaults() - bFirstLoad = False - End If Me.BringToFront() LoadGraphs() - End Sub - - Public Sub SetDefaults() - ucrInputLeft.ResetText() - ucrInputRight.ResetText() - ucrInputTop.ResetText() - ucrInputBottom.ResetText() SetDefaultRowAndColumns() - chkSpecifyOrder.Checked = False - grdLayout.Visible = False - End Sub - - Private Sub InitialiseDialog() - grdCurrSheet.Rows = nudRows.Value - grdCurrSheet.Columns = nudColumns.Value - End Sub - - Public Sub SetRSyntax(clsNewRSyntax As RSyntax) - clsRsyntax = clsNewRSyntax End Sub - Private Sub ucrInputTop_NameChanged() Handles ucrInputTop.NameChanged - If Not ucrInputTop.IsEmpty Then - clsRsyntax.AddParameter("top", Chr(34) & ucrInputTop.GetText & Chr(34)) - Else - clsRsyntax.RemoveParameter("top") - End If - End Sub - - Private Sub ucrInputBottom_NameChanged() Handles ucrInputBottom.NameChanged - If Not ucrInputBottom.IsEmpty Then - clsRsyntax.AddParameter("bottom", Chr(34) & ucrInputBottom.GetText & Chr(34)) - Else - clsRsyntax.RemoveParameter("bottom") - End If - End Sub + Private Sub InitialiseControls() + grdCurrSheet.Rows = ucrNudRows.Value + grdCurrSheet.Columns = ucrNudColumns.Value - Private Sub ucrInputRight_NameChanged() Handles ucrInputRight.NameChanged - If Not ucrInputRight.IsEmpty Then - clsRsyntax.AddParameter("right", Chr(34) & ucrInputRight.GetText & Chr(34)) - Else - clsRsyntax.RemoveParameter("right") - End If - End Sub + ucrNudColumns.SetParameter(New RParameter("ncol")) + ucrNudRows.SetParameter(New RParameter("nrow")) - Private Sub ucrInputLeft_NameChanged() Handles ucrInputLeft.NameChanged - If Not ucrInputLeft.IsEmpty Then - clsRsyntax.AddParameter("left", Chr(34) & ucrInputLeft.GetText & Chr(34)) - Else - clsRsyntax.RemoveParameter("left") - End If + ucrInputBottom.SetParameter(New RParameter("bottom")) + ucrInputLeft.SetParameter(New RParameter("left")) + ucrInputRight.SetParameter(New RParameter("right")) + ucrInputTop.SetParameter(New RParameter("top")) + ucrChkSpecifyOrder.SetText("Specify Order") + ucrChkSpecifyOrder.AddToLinkedControls({ucrInputTop, ucrInputRight}, objValues:={True}) + bInitialiseControls = True End Sub - Private Sub nudRows_TextChanged(sender As Object, e As EventArgs) Handles nudRows.TextChanged - If nudRows.Text <> "" Then - clsRsyntax.AddParameter("nrow", nudRows.Value) - Else - clsRsyntax.RemoveParameter("nrow") - End If + Private Sub nucrNudRows_ControlContentsChanged() Handles ucrNudRows.ControlContentsChanged If grdCurrSheet IsNot Nothing Then - grdCurrSheet.Rows = nudRows.Value + grdCurrSheet.Rows = ucrNudRows.Value End If End Sub - Private Sub nudColumns_TextChanged(sender As Object, e As EventArgs) Handles nudColumns.TextChanged - If nudColumns.Text <> "" Then - clsRsyntax.AddParameter("ncol", nudColumns.Value) - Else - clsRsyntax.RemoveParameter("ncol") - End If + Private Sub ucrNudColumns_ControlContentsChanged() Handles ucrNudColumns.ControlContentsChanged If grdCurrSheet IsNot Nothing Then - grdCurrSheet.Columns = nudColumns.Value + grdCurrSheet.Columns = ucrNudColumns.Value End If End Sub @@ -124,8 +78,8 @@ Public Class sdgCombineGraphOptions Dim NoOfgraphs As Integer If dlgCombineforGraphics.ucrCombineGraphReceiver.lstSelectedVariables.Items.Count > 0 Then NoOfgraphs = dlgCombineforGraphics.ucrCombineGraphReceiver.lstSelectedVariables.Items.Count - nudRows.Value = Math.Ceiling(Math.Sqrt(NoOfgraphs)) - nudColumns.Value = Math.Ceiling(NoOfgraphs / (Math.Ceiling(Math.Sqrt(NoOfgraphs)))) + ucrNudRows.Value = Math.Ceiling(Math.Sqrt(NoOfgraphs)) + ucrNudColumns.Value = Math.Ceiling(NoOfgraphs / (Math.Ceiling(Math.Sqrt(NoOfgraphs)))) End If End Sub @@ -177,7 +131,7 @@ Public Class sdgCombineGraphOptions End If strMatrix = "c" & "(" & strMatrix & ")" clsMatrixFunction.AddParameter("data", strMatrix) - clsRsyntax.AddParameter("layout_matrix", clsRFunctionParameter:=clsMatrixFunction) + clsCombineGraph.AddParameter("layout_matrix", clsRFunctionParameter:=clsMatrixFunction) If lstNumbers.Distinct.Count = lstGraphs.Items.Count Then txtLayoutMessage.Text = "Ok: Layout contains all graphs" Else @@ -185,8 +139,8 @@ Public Class sdgCombineGraphOptions End If End Sub - Private Sub chkSpecifyOrder_CheckedChanged(sender As Object, e As EventArgs) Handles chkSpecifyOrder.CheckedChanged - If chkSpecifyOrder.Checked = True Then + Private Sub chkSpecifyOrder_CheckedChanged() Handles ucrChkSpecifyOrder.ControlValueChanged + If ucrChkSpecifyOrder.Checked = True Then grdLayout.Visible = True 'SetMatrixFunction() SwitchNcolToMatrixFunc() @@ -199,16 +153,16 @@ Public Class sdgCombineGraphOptions Public Sub SwitchNcolToMatrixFunc() clsRsyntax.RemoveParameter("ncol") clsRsyntax.RemoveParameter("nrow") - clsMatrixFunction.AddParameter("ncol", nudColumns.Value) - clsMatrixFunction.AddParameter("nrow", nudRows.Value) + clsMatrixFunction.AddParameter("ncol", ucrNudColumns.Value) + clsMatrixFunction.AddParameter("nrow", ucrNudRows.Value) End Sub Public Sub RemoveNcolFromMatrixfunc() clsMatrixFunction.RemoveParameterByName("ncol") clsMatrixFunction.RemoveParameterByName("nrow") clsRsyntax.RemoveParameter("layout_matrix") - clsRsyntax.AddParameter("nrow", nudRows.Value) - clsRsyntax.AddParameter("ncol", nudColumns.Value) + clsRsyntax.AddParameter("nrow", ucrNudRows.Value) + clsRsyntax.AddParameter("ncol", ucrNudColumns.Value) End Sub Private Sub grdLayout_Leave(sender As Object, e As EventArgs) Handles grdLayout.Leave @@ -217,5 +171,12 @@ Public Class sdgCombineGraphOptions SetMatrixFunction() End If End Sub -End Class + Public Sub SetRFunction(clsNewRFunction As RFunction, Optional bReset As Boolean = False) + If Not bInitialiseControls Then + InitialiseControls() + End If + clsCombineGraph = clsNewRFunction + SetRCode(Me, clsCombineGraph, bReset) + End Sub +End Class diff --git a/instat/sdgSummaries.Designer.vb b/instat/sdgSummaries.Designer.vb index 77272d3b766..fb4aa3c8c2c 100644 --- a/instat/sdgSummaries.Designer.vb +++ b/instat/sdgSummaries.Designer.vb @@ -25,20 +25,20 @@ Partial Class sdgSummaries Me.grpCommon = New System.Windows.Forms.GroupBox() Me.grpNotOrderedFactor = New System.Windows.Forms.GroupBox() Me.grpNumeric = New System.Windows.Forms.GroupBox() - Me.ucrButtonsSummaries = New instat.ucrButtonsSubdialogue() - Me.ucrChkNonMissing = New instat.ucrCheck() - Me.ucrChkNMissing = New instat.ucrCheck() - Me.ucrChkMode = New instat.ucrCheck() - Me.ucrChkNTotal = New instat.ucrCheck() - Me.ucrChkMinimum = New instat.ucrCheck() - Me.ucrChkMaximum = New instat.ucrCheck() - Me.ucrChkMean = New instat.ucrCheck() + Me.ucrChkQuartiles = New instat.ucrCheck() + Me.ucrChkVariance = New instat.ucrCheck() + Me.ucrChkMedian = New instat.ucrCheck() Me.ucrChkStdDev = New instat.ucrCheck() Me.ucrChkRange = New instat.ucrCheck() Me.ucrChkSum = New instat.ucrCheck() - Me.ucrChkMedian = New instat.ucrCheck() - Me.ucrChkVariance = New instat.ucrCheck() - Me.ucrChkQuartiles = New instat.ucrCheck() + Me.ucrChkMean = New instat.ucrCheck() + Me.ucrChkNTotal = New instat.ucrCheck() + Me.ucrChkMode = New instat.ucrCheck() + Me.ucrChkNMissing = New instat.ucrCheck() + Me.ucrChkNonMissing = New instat.ucrCheck() + Me.ucrChkMaximum = New instat.ucrCheck() + Me.ucrChkMinimum = New instat.ucrCheck() + Me.ucrButtonsSummaries = New instat.ucrButtonsSubdialogue() Me.grpCommon.SuspendLayout() Me.grpNotOrderedFactor.SuspendLayout() Me.grpNumeric.SuspendLayout() @@ -52,7 +52,7 @@ Partial Class sdgSummaries Me.grpCommon.Controls.Add(Me.ucrChkNonMissing) Me.grpCommon.Location = New System.Drawing.Point(12, 8) Me.grpCommon.Name = "grpCommon" - Me.grpCommon.Size = New System.Drawing.Size(244, 57) + Me.grpCommon.Size = New System.Drawing.Size(244, 65) Me.grpCommon.TabIndex = 0 Me.grpCommon.TabStop = False Me.grpCommon.Tag = "Common" @@ -62,7 +62,7 @@ Partial Class sdgSummaries ' Me.grpNotOrderedFactor.Controls.Add(Me.ucrChkMaximum) Me.grpNotOrderedFactor.Controls.Add(Me.ucrChkMinimum) - Me.grpNotOrderedFactor.Location = New System.Drawing.Point(13, 72) + Me.grpNotOrderedFactor.Location = New System.Drawing.Point(13, 75) Me.grpNotOrderedFactor.Name = "grpNotOrderedFactor" Me.grpNotOrderedFactor.Size = New System.Drawing.Size(243, 46) Me.grpNotOrderedFactor.TabIndex = 1 @@ -87,116 +87,116 @@ Partial Class sdgSummaries Me.grpNumeric.Tag = "Numeric" Me.grpNumeric.Text = "Numeric" ' - 'ucrButtonsSummaries - ' - Me.ucrButtonsSummaries.Location = New System.Drawing.Point(62, 236) - Me.ucrButtonsSummaries.Name = "ucrButtonsSummaries" - Me.ucrButtonsSummaries.Size = New System.Drawing.Size(142, 30) - Me.ucrButtonsSummaries.TabIndex = 3 - ' - 'ucrChkNonMissing + 'ucrChkQuartiles ' - Me.ucrChkNonMissing.Checked = False - Me.ucrChkNonMissing.Location = New System.Drawing.Point(13, 17) - Me.ucrChkNonMissing.Name = "ucrChkNonMissing" - Me.ucrChkNonMissing.Size = New System.Drawing.Size(100, 20) - Me.ucrChkNonMissing.TabIndex = 4 + Me.ucrChkQuartiles.Checked = False + Me.ucrChkQuartiles.Location = New System.Drawing.Point(137, 40) + Me.ucrChkQuartiles.Name = "ucrChkQuartiles" + Me.ucrChkQuartiles.Size = New System.Drawing.Size(100, 20) + Me.ucrChkQuartiles.TabIndex = 3 ' - 'ucrChkNMissing + 'ucrChkVariance ' - Me.ucrChkNMissing.Checked = False - Me.ucrChkNMissing.Location = New System.Drawing.Point(13, 38) - Me.ucrChkNMissing.Name = "ucrChkNMissing" - Me.ucrChkNMissing.Size = New System.Drawing.Size(100, 20) - Me.ucrChkNMissing.TabIndex = 5 + Me.ucrChkVariance.Checked = False + Me.ucrChkVariance.Location = New System.Drawing.Point(137, 61) + Me.ucrChkVariance.Name = "ucrChkVariance" + Me.ucrChkVariance.Size = New System.Drawing.Size(100, 20) + Me.ucrChkVariance.TabIndex = 5 ' - 'ucrChkMode + 'ucrChkMedian ' - Me.ucrChkMode.Checked = False - Me.ucrChkMode.Location = New System.Drawing.Point(151, 38) - Me.ucrChkMode.Name = "ucrChkMode" - Me.ucrChkMode.Size = New System.Drawing.Size(100, 20) - Me.ucrChkMode.TabIndex = 6 + Me.ucrChkMedian.Checked = False + Me.ucrChkMedian.Location = New System.Drawing.Point(137, 19) + Me.ucrChkMedian.Name = "ucrChkMedian" + Me.ucrChkMedian.Size = New System.Drawing.Size(100, 20) + Me.ucrChkMedian.TabIndex = 1 ' - 'ucrChkNTotal + 'ucrChkStdDev ' - Me.ucrChkNTotal.Checked = False - Me.ucrChkNTotal.Location = New System.Drawing.Point(151, 17) - Me.ucrChkNTotal.Name = "ucrChkNTotal" - Me.ucrChkNTotal.Size = New System.Drawing.Size(100, 20) - Me.ucrChkNTotal.TabIndex = 7 + Me.ucrChkStdDev.Checked = False + Me.ucrChkStdDev.Location = New System.Drawing.Point(8, 82) + Me.ucrChkStdDev.Name = "ucrChkStdDev" + Me.ucrChkStdDev.Size = New System.Drawing.Size(122, 20) + Me.ucrChkStdDev.TabIndex = 6 ' - 'ucrChkMinimum + 'ucrChkRange ' - Me.ucrChkMinimum.Checked = False - Me.ucrChkMinimum.Location = New System.Drawing.Point(6, 19) - Me.ucrChkMinimum.Name = "ucrChkMinimum" - Me.ucrChkMinimum.Size = New System.Drawing.Size(100, 20) - Me.ucrChkMinimum.TabIndex = 8 + Me.ucrChkRange.Checked = False + Me.ucrChkRange.Location = New System.Drawing.Point(8, 61) + Me.ucrChkRange.Name = "ucrChkRange" + Me.ucrChkRange.Size = New System.Drawing.Size(100, 20) + Me.ucrChkRange.TabIndex = 4 ' - 'ucrChkMaximum + 'ucrChkSum ' - Me.ucrChkMaximum.Checked = False - Me.ucrChkMaximum.Location = New System.Drawing.Point(137, 20) - Me.ucrChkMaximum.Name = "ucrChkMaximum" - Me.ucrChkMaximum.Size = New System.Drawing.Size(100, 20) - Me.ucrChkMaximum.TabIndex = 9 + Me.ucrChkSum.Checked = False + Me.ucrChkSum.Location = New System.Drawing.Point(8, 19) + Me.ucrChkSum.Name = "ucrChkSum" + Me.ucrChkSum.Size = New System.Drawing.Size(100, 20) + Me.ucrChkSum.TabIndex = 0 ' 'ucrChkMean ' Me.ucrChkMean.Checked = False - Me.ucrChkMean.Location = New System.Drawing.Point(12, 40) + Me.ucrChkMean.Location = New System.Drawing.Point(8, 40) Me.ucrChkMean.Name = "ucrChkMean" Me.ucrChkMean.Size = New System.Drawing.Size(100, 20) - Me.ucrChkMean.TabIndex = 10 + Me.ucrChkMean.TabIndex = 2 ' - 'ucrChkStdDev + 'ucrChkNTotal ' - Me.ucrChkStdDev.Checked = False - Me.ucrChkStdDev.Location = New System.Drawing.Point(12, 84) - Me.ucrChkStdDev.Name = "ucrChkStdDev" - Me.ucrChkStdDev.Size = New System.Drawing.Size(100, 20) - Me.ucrChkStdDev.TabIndex = 11 + Me.ucrChkNTotal.Checked = False + Me.ucrChkNTotal.Location = New System.Drawing.Point(137, 16) + Me.ucrChkNTotal.Name = "ucrChkNTotal" + Me.ucrChkNTotal.Size = New System.Drawing.Size(100, 20) + Me.ucrChkNTotal.TabIndex = 1 ' - 'ucrChkRange + 'ucrChkMode ' - Me.ucrChkRange.Checked = False - Me.ucrChkRange.Location = New System.Drawing.Point(12, 58) - Me.ucrChkRange.Name = "ucrChkRange" - Me.ucrChkRange.Size = New System.Drawing.Size(100, 20) - Me.ucrChkRange.TabIndex = 12 + Me.ucrChkMode.Checked = False + Me.ucrChkMode.Location = New System.Drawing.Point(137, 38) + Me.ucrChkMode.Name = "ucrChkMode" + Me.ucrChkMode.Size = New System.Drawing.Size(100, 20) + Me.ucrChkMode.TabIndex = 3 ' - 'ucrChkSum + 'ucrChkNMissing ' - Me.ucrChkSum.Checked = False - Me.ucrChkSum.Location = New System.Drawing.Point(12, 19) - Me.ucrChkSum.Name = "ucrChkSum" - Me.ucrChkSum.Size = New System.Drawing.Size(100, 20) - Me.ucrChkSum.TabIndex = 13 + Me.ucrChkNMissing.Checked = False + Me.ucrChkNMissing.Location = New System.Drawing.Point(8, 38) + Me.ucrChkNMissing.Name = "ucrChkNMissing" + Me.ucrChkNMissing.Size = New System.Drawing.Size(100, 20) + Me.ucrChkNMissing.TabIndex = 2 ' - 'ucrChkMedian + 'ucrChkNonMissing ' - Me.ucrChkMedian.Checked = False - Me.ucrChkMedian.Location = New System.Drawing.Point(150, 14) - Me.ucrChkMedian.Name = "ucrChkMedian" - Me.ucrChkMedian.Size = New System.Drawing.Size(100, 20) - Me.ucrChkMedian.TabIndex = 14 + Me.ucrChkNonMissing.Checked = False + Me.ucrChkNonMissing.Location = New System.Drawing.Point(8, 16) + Me.ucrChkNonMissing.Name = "ucrChkNonMissing" + Me.ucrChkNonMissing.Size = New System.Drawing.Size(100, 20) + Me.ucrChkNonMissing.TabIndex = 0 ' - 'ucrChkVariance + 'ucrChkMaximum ' - Me.ucrChkVariance.Checked = False - Me.ucrChkVariance.Location = New System.Drawing.Point(150, 61) - Me.ucrChkVariance.Name = "ucrChkVariance" - Me.ucrChkVariance.Size = New System.Drawing.Size(100, 20) - Me.ucrChkVariance.TabIndex = 15 + Me.ucrChkMaximum.Checked = False + Me.ucrChkMaximum.Location = New System.Drawing.Point(137, 19) + Me.ucrChkMaximum.Name = "ucrChkMaximum" + Me.ucrChkMaximum.Size = New System.Drawing.Size(100, 20) + Me.ucrChkMaximum.TabIndex = 1 ' - 'ucrChkQuartiles + 'ucrChkMinimum ' - Me.ucrChkQuartiles.Checked = False - Me.ucrChkQuartiles.Location = New System.Drawing.Point(150, 35) - Me.ucrChkQuartiles.Name = "ucrChkQuartiles" - Me.ucrChkQuartiles.Size = New System.Drawing.Size(100, 20) - Me.ucrChkQuartiles.TabIndex = 16 + Me.ucrChkMinimum.Checked = False + Me.ucrChkMinimum.Location = New System.Drawing.Point(8, 19) + Me.ucrChkMinimum.Name = "ucrChkMinimum" + Me.ucrChkMinimum.Size = New System.Drawing.Size(100, 20) + Me.ucrChkMinimum.TabIndex = 0 + ' + 'ucrButtonsSummaries + ' + Me.ucrButtonsSummaries.Location = New System.Drawing.Point(62, 236) + Me.ucrButtonsSummaries.Name = "ucrButtonsSummaries" + Me.ucrButtonsSummaries.Size = New System.Drawing.Size(142, 30) + Me.ucrButtonsSummaries.TabIndex = 3 ' 'sdgSummaries ' diff --git a/instat/sdgSummaries.vb b/instat/sdgSummaries.vb index 4ba70008a0d..1ba442069ee 100644 --- a/instat/sdgSummaries.vb +++ b/instat/sdgSummaries.vb @@ -48,6 +48,7 @@ Public Class sdgSummaries ucrChkMaximum.SetText("Maximum") ucrChkMaximum.SetParameter(New RParameter("summary_max"), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) + 'ucrChkMedian.Enabled = False ucrChkMedian.SetText("Median") ucrChkMedian.SetParameter(New RParameter("summary_median"), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) @@ -61,13 +62,13 @@ Public Class sdgSummaries ucrChkSum.SetParameter(New RParameter("summary_sum"), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) ucrChkVariance.SetText("Variance") - ucrChkVariance.SetParameter(New RParameter("summary_variance"), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) + ucrChkVariance.SetParameter(New RParameter("summary_var"), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) ucrChkQuartiles.SetText("Quartiles") ucrChkQuartiles.SetParameter(New RParameter("summary_quartiles"), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) lstCheckboxes = New List(Of ucrCheck) - lstCheckboxes.AddRange({ucrChkNTotal, ucrChkNonMissing, ucrChkNMissing, ucrChkMean, ucrChkMinimum, ucrChkMode, ucrChkMaximum, ucrChkMedian, ucrChkStdDev, ucrChkRange, ucrChkSum, ucrChkQuartiles}) + lstCheckboxes.AddRange({ucrChkNTotal, ucrChkNonMissing, ucrChkNMissing, ucrChkMean, ucrChkMinimum, ucrChkMode, ucrChkMaximum, ucrChkMedian, ucrChkStdDev, ucrChkVariance, ucrChkRange, ucrChkSum, ucrChkQuartiles}) For Each ctrTemp As ucrCheck In lstCheckboxes ctrTemp.clsParameter.SetArgumentValue(Chr(34) & ctrTemp.clsParameter.strArgumentName & Chr(34)) ctrTemp.clsParameter.bIncludeArgumentName = False diff --git a/instat/static/InstatObject/R/Backend_Components/summary_functions.R b/instat/static/InstatObject/R/Backend_Components/summary_functions.R index 78398338693..1268d5232e4 100644 --- a/instat/static/InstatObject/R/Backend_Components/summary_functions.R +++ b/instat/static/InstatObject/R/Backend_Components/summary_functions.R @@ -97,9 +97,10 @@ instat_object$set("public", "summary", function(data_name, columns_to_summarise, calculated_from = list() calculated_from[[1]] <- list(data_name = data_name, columns = columns_to_summarise) #TODO Change this to store sub_calculations for each column - alltypes_collection = c(count_non_missing_label, count_missing_label, count_label, mode_label) - numeric_collection = c(count_non_missing_label, count_missing_label, count_label, mode_label, min_label, max_label, mean_label, sd_label, range_label, median_label, sum_label) - factor_collection = c(count_non_missing_label, count_missing_label, count_label, mode_label) #maximum and minimum labels should be added when we distinguish ordered factors + alltypes_collection <- c(count_non_missing_label, count_missing_label, count_label, mode_label) + numeric_collection <- c(count_non_missing_label, count_missing_label, count_label, mode_label, min_label, max_label, mean_label, sd_label, range_label, median_label, sum_label, var_label) + factor_collection <- c(count_non_missing_label, count_missing_label, count_label, mode_label) #maximum and minimum labels should be added when we distinguish ordered factors + ordered_factor_collection <- c(count_non_missing_label, count_missing_label, count_label, mode_label, min_label, max_label) i = 1 for(col_new in columns_to_summarise){ col_data_type = self$get_variables_metadata(data_name = data_name, column = col_new, property = data_type_label) @@ -109,6 +110,9 @@ instat_object$set("public", "summary", function(data_name, columns_to_summarise, else if(col_data_type == "factor"){ column_summaries = intersect(summaries, factor_collection) } + else if(col_data_type == paste0(c("ordered","factor"), collapse = ",")){ + column_summaries = intersect(summaries, ordered_factor_collection) + } else if(col_data_type == "character"){ column_summaries = intersect(summaries, alltypes_collection) } @@ -235,15 +239,16 @@ count_label="summary_count" count_missing_label="summary_count_missing" count_non_missing_label="summary_count_non_missing" sd_label = "summary_sd" +var_label = "summary_var" median_label = "summary_median" range_label = "summary_range" min_label="summary_min" max_label="summary_max" mean_label="summary_mean" - +#quartiles need to be added as a summary # list of all summary function names -all_summaries=c(sum_label, mode_label, count_label, count_missing_label, count_non_missing_label, sd_label, median_label, range_label, min_label, max_label, mean_label) +all_summaries=c(sum_label, mode_label, count_label, count_missing_label, count_non_missing_label, sd_label, var_label, median_label, range_label, min_label, max_label, mean_label) summary_mode <- function(x,...) { ux <- unique(x) out <- ux[which.max(tabulate(match(x, ux)))] @@ -277,6 +282,10 @@ summary_sd <- function(x, na.rm = FALSE,...) { return(sd(x,na.rm = na.rm)) } +summary_var <- function(x, na.rm = FALSE,...) { + return(var(x,na.rm = na.rm)) +} + summary_max <- function (x, na.rm = FALSE,...) { #TODO This prevents warning and -Inf being retured. Is this desirable? if( length(x)==0 || (na.rm && length(x[!is.na(x)])==0) ) return(NA) diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index 66b99441ec1..973c1825b31 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -126,10 +126,11 @@ data_object$set("public", "set_data", function(new_data, messages=TRUE, check_na ) data_object$set("public", "set_meta", function(new_meta) { + meta_data_copy <- new_meta self$clear_metadata() - if(!is.list(new_meta)) stop("new_meta must be of type: list") - for(name in names(new_meta)) { - self$append_to_metadata(name, new_meta[[name]]) + if(!is.list(meta_data_copy)) stop("new_meta must be of type: list") + for(name in names(meta_data_copy)) { + self$append_to_metadata(name, meta_data_copy[[name]]) } self$metadata_changed <- TRUE self$append_to_changes(list(Set_property, "meta data")) @@ -1430,7 +1431,7 @@ data_object$set("public", "data_clone", function(include_objects = TRUE, include else new_filters <- list() if(include_calculations) new_calculations <- lapply(private$calculations, function(x) x$data_clone()) else new_calculations <- list() - + ret <- data_object$new(data = private$data, data_name = self$get_metadata(data_name_label), filters = new_filters, objects = new_objects, calculations = new_calculations, keys = private$keys, keep_attributes = include_metadata) if(include_logs) ret$set_changes(private$changes) else ret$set_changes(list()) @@ -1787,7 +1788,7 @@ data_object$set("public","set_contrasts_of_factor", function(col_name, new_contr } ) #This method gets a date column and extracts part of the information such as year, month, week, weekday etc(depending on which parameters are set) and creates their respective new column(s) -data_object$set("public","split_date", function(data_name, col_name = "", week = FALSE, month_val = FALSE, month_abbr = FALSE, month_name = FALSE, weekday_val = FALSE, weekday_abbr = FALSE, weekday_name = FALSE, year = FALSE, day = FALSE, day_in_month = FALSE, day_in_year = FALSE, leap_year = FALSE, day_in_year_366 = FALSE, dekade = FALSE, pentad = FALSE) { +data_object$set("public","split_date", function(col_name = "", week = FALSE, month_val = FALSE, month_abbr = FALSE, month_name = FALSE, weekday_val = FALSE, weekday_abbr = FALSE, weekday_name = FALSE, year = FALSE, day = FALSE, day_in_month = FALSE, day_in_year = FALSE, leap_year = FALSE, day_in_year_366 = FALSE, dekade = FALSE, pentad = FALSE) { col_data <- self$get_columns_from_data(col_name, use_current_filter = FALSE) if(!is.Date(col_data)) stop("This column must be a date or time!") if(day) { @@ -1935,26 +1936,65 @@ data_object$set("public","set_climatic_types", function(types) { ) #Method for creating inventory plot -data_object$set("public","make_inventory_plot", function(year, doy, col_name, add_to_data = FALSE, coord_flip = FALSE, threshold, facets) { - curr_data <- self$get_data_frame() - col_data <- self$get_columns_from_data(col_name) - if(!is.numeric(col_data)) stop("The rainfall column should be numeric") - recode <- ifelse(is.na(col_data), "missing", ifelse(col_data>threshold, "rain", "dry")) - recode <- as.factor(recode) - new_col <- next_default_item(prefix = "recode", existing_names = self$get_column_names(), include_index = FALSE) - curr_data[[new_col]] <- recode - if(add_to_data) { - self$add_columns_to_data(col_name = new_col, col_data = recode) +data_object$set("public","make_inventory_plot", function(date_col, station_col = c(), elements_cols, add_to_data = FALSE, coord_flip = FALSE, graph_title = "Inventory plot") { + if(!self$get_metadata(is_climatic_label))stop("Define data as climatic.") + if(!is.Date(self$get_columns_from_data(date_col))) stop(paste(date_col, " must be of type date/time."))#this will not work!!! + if(missing(date_col)||missing(elements_cols))stop("Date and elements columns must be specified.") + if(!all(elements_cols %in% self$get_column_names())) { + stop("Not all elements columns found in the data") } - - g <- ggplot(data = curr_data, mapping = aes_(x = as.name(year), y = as.name(doy), colour = as.name(new_col), group = as.name(year))) + geom_point() + xlab(year) + ylab(col_name) + labs(color="Recode") - if(!missing(facets)) { - g <- g + facet_wrap(as.name(facets)) + #add year and doy columns if missing in data + if(is.null(self$get_climatic_column_name(year_label))){ + self$split_date(col_name = date_col, year = TRUE) + self$set_climatic_types(types = c(year = "year")) #calling year column by name is just a temporary fix. + } + if(is.null(self$get_climatic_column_name(doy_label))){ + self$split_date(col_name = date_col, day_in_year = TRUE) + self$set_climatic_types(types = c(doy = "day_in_year")) + } + year_col_name = self$get_climatic_column_name(year_label) + doy_col_name = self$get_climatic_column_name(doy_label) + + curr_data <- self$get_data_frame() + #ggplot fails to get column names hence the need to rename + colnames(curr_data)[colnames(curr_data) == year_col_name] <- "year_column" + colnames(curr_data)[colnames(curr_data) == doy_col_name] <- "doy_column" + if(length(elements_cols)!=1){ + if(!is.null(station_col)){ + col_data <- self$get_data_frame(stack_data = TRUE, measure.vars = elements_cols, id.vars=c(date_col, station_col, year_col_name, doy_col_name)) + } + else{ + col_data <- self$get_data_frame(stack_data = TRUE, measure.vars = elements_cols, id.vars=c(date_col, year_col_name, doy_col_name)) + } + colnames(col_data)[colnames(col_data) == year_col_name] <- "year_column" + colnames(col_data)[colnames(col_data) == doy_col_name] <- "doy_column" + recode <- ifelse(is.na(col_data$value), "missing", "present") + recode <- as.factor(recode) + new_col <- next_default_item(prefix = "recode", existing_names = names(col_data), include_index = FALSE) + col_data[[new_col]] <- recode + g <- ggplot(data = col_data, mapping = aes(x = year_column, y = doy_column , colour = recode, group = year_column)) + geom_point() + xlab("Year") + ylab("DOY") + labs(color="Recode") + if(!is.null(station_col)){ + g <- g + facet_wrap(as.formula(paste0(as.name(station_col),"~ variable"))) + } + else{ + g <- g + facet_wrap(~variable) + } + } + else{ + col_data <- self$get_columns_from_data(elements_cols) + recode <- ifelse(is.na(col_data),"missing", "present") + recode <- as.factor(recode) + new_col <- next_default_item(prefix = "recode", existing_names = self$get_column_names(), include_index = FALSE) + curr_data[[new_col]] <- recode + g <- ggplot(data = curr_data, mapping = aes(x = year_column, y = doy_column , colour = recode, group = year_column)) + geom_point() + xlab("Year") + ylab("DOY") + labs(color="Recode") + if(!is.null(station_col)){ + g <- g + facet_wrap(as.name(station_col)) + } } if(coord_flip) { g <- g + coord_flip() } - return(g) + return(g+ggtitle(graph_title) + theme(plot.title = element_text(hjust = 0.5))) } ) @@ -2130,16 +2170,15 @@ all_calculated_corruption_column_types <- c(corruption_award_year_label, corruption_ctry_iso2_label="iso2" corruption_ctry_iso3_label="iso3" -corruption_ctry_wb_ppp_label="wb_ppp" corruption_ctry_ss_2009_label="ss_2009" corruption_ctry_ss_2011_label="ss_2011" corruption_ctry_ss_2013_label="ss_2013" corruption_ctry_ss_2015_label="ss_2015" corruption_ctry_small_state_label="small_state" -all_primary_corruption_country_level_column_types <- c(corruption_ctry_iso2_label, +all_primary_corruption_country_level_column_types <- c(corruption_country_label, + corruption_ctry_iso2_label, corruption_ctry_iso3_label, - corruption_ctry_wb_ppp_label, corruption_ctry_ss_2009_label, corruption_ctry_ss_2011_label, corruption_ctry_ss_2013_label, @@ -2153,7 +2192,7 @@ corruption_output_label = "Is_Corruption_Output" corruption_red_flag_label = "Is_Corruption_Red_Flag" # Data frame metadata for corruption dataframes -corruption_data_label = "Corruption_Data" +corruption_data_label = "Is_Corruption_Data" corruption_contract_level_label = "Contract Level" corruption_country_level_label = "Country Level" @@ -2182,14 +2221,14 @@ data_object$set("public","define_red_flags", function(red_flags = c()) { if(!self$is_metadata(corruption_data_label)) { stop("Cannot define corruption red flags when data frame is not defined as corruption data.") } - self$append_to_variables_metadata(output_columns, corruption_red_flag_label, TRUE) - other_cols <- self$get_column_names()[!self$get_column_names() %in% output_columns] + self$append_to_variables_metadata(red_flags, corruption_red_flag_label, TRUE) + other_cols <- self$get_column_names()[!self$get_column_names() %in% red_flags] self$append_to_variables_metadata(other_cols, corruption_red_flag_label, FALSE) } ) instat_object$set("public","define_as_corruption", function(data_name, primary_types = c(), calculated_types = c(), country_data_name, country_types, auto_generate = TRUE) { - self$append_to_dataframe_metadata(data_name, corruption_data_label, corruption_contract_level_label) + self$append_to_dataframe_metadata(data_name, corruption_data_label, TRUE) self$get_data_objects(data_name)$set_corruption_types(primary_types, calculated_types, auto_generate) if(!missing(country_data_name)) { self$define_as_corruption_country_level_data(data_name = country_data_name, contract_level_data_name = data_name, types = country_types, auto_generate = auto_generate) @@ -2198,24 +2237,24 @@ instat_object$set("public","define_as_corruption", function(data_name, primary_t ) instat_object$set("public","define_as_corruption_country_level_data", function(data_name, contract_level_data_name, types = c(), auto_generate = TRUE) { - self$append_to_dataframe_metadata(data_name, corruption_data_label, corruption_country_level_label) + #self$append_to_dataframe_metadata(data_name, corruption_data_label, corruption_country_level_label) self$get_data_objects(data_name)$define_as_corruption_country_level_data(types, auto_generate) - contract_level_country_name <- self$get_corruption_column_name(data_name, corruption_country_label) - country_level_country_name <- self$get_corruption_column_name(contract_level_data_name, corruption_country_label) + contract_level_country_name <- self$get_corruption_column_name(contract_level_data_name, corruption_country_label) + country_level_country_name <- self$get_corruption_column_name(data_name, corruption_country_label) if(contract_level_country_name == "" || country_level_country_name == "") stop("country column must be defined in the contract level data and country level data.") link_pairs <- country_level_country_name names(link_pairs) <- contract_level_country_name - self$add_link(from_data_name = contract_level_data_name, to_data_frame = data_name, link_pairs = link_pairs, type = keyed_link_label) + self$add_link(from_data_frame = contract_level_data_name, to_data_frame = data_name, link_pairs = link_pairs, type = keyed_link_label) } ) -data_object$set("public","define_as_corruption_country_level_data", function(contract_level_data_name, types = c(), auto_generate = TRUE) { - invisible(sapply(names(primary_types), function(x) self$append_to_variables_metadata(primary_types[[x]], corruption_type_label, x))) +data_object$set("public","define_as_corruption_country_level_data", function(types = c(), auto_generate = TRUE) { + invisible(sapply(names(types), function(x) self$append_to_variables_metadata(types[[x]], corruption_type_label, x))) } ) data_object$set("public","is_corruption_type_present", function(type) { - return(self$is_metadata(corruption_data_label) && !is.na(self$get_metadata(corruption_data_label)) && self$is_variables_metadata(corruption_type_label) && (type %in% self$get_variables_metadata(property = corruption_type_label))) + return(self$is_metadata(corruption_data_label) && !is.na(self$get_metadata(corruption_data_label)) && self$get_metadata(corruption_data_label) && self$is_variables_metadata(corruption_type_label) && (type %in% self$get_variables_metadata(property = corruption_type_label))) } ) @@ -2746,4 +2785,17 @@ data_object$set("public","standard_country_names", function(country_columns = c( } } } +) + +data_object$set("public", "get_climatic_column_name", function(col_name) { + if(!self$get_metadata(is_climatic_label))stop("Define data as climatic.") + if(col_name %in% self$get_variables_metadata()$Climatic_Type){ + new_data = subset(self$get_variables_metadata(), Climatic_Type==col_name, select = Name) + return(as.character(new_data)) + } + else{ + warning(paste(col_name, " column cannot be found in the data.")) + return() + } +} ) \ No newline at end of file diff --git a/instat/static/InstatObject/R/instat_object_R6.R b/instat/static/InstatObject/R/instat_object_R6.R index 872aaf45857..43fc4813e98 100644 --- a/instat/static/InstatObject/R/instat_object_R6.R +++ b/instat/static/InstatObject/R/instat_object_R6.R @@ -1074,8 +1074,8 @@ instat_object$set("public", "import_SST", function(dataset, data_from = 5, data_ } ) -instat_object$set("public","make_inventory_plot", function(data_name,col_name = "", year , doy, add_to_data = FALSE, coord_flip = FALSE, threshold, facets) { - self$get_data_objects(data_name)$make_inventory_plot(col_name = col_name , year = year, doy =doy,add_to_data = add_to_data, coord_flip = coord_flip, threshold = threshold, facets = facets) +instat_object$set("public","make_inventory_plot", function(data_name, date_col, station_col = c(), elements_cols, add_to_data = FALSE, coord_flip = FALSE, graph_title = "Inventory plot") { + self$get_data_objects(data_name)$make_inventory_plot(date_col = date_col , station_col = station_col, elements_cols =elements_cols, add_to_data = add_to_data, coord_flip = coord_flip, graph_title = graph_title) } ) @@ -1183,9 +1183,7 @@ instat_object$set("public", "is_metadata", function(data_name, str) { ) instat_object$set("public", "get_climatic_column_name", function(data_name, col_name) { - new_data = subset(InstatDataObject$get_variables_metadata(data_name), Climatic_Type==col_name, select = Name) - if(!nrow(new_data==1))stop(paste(col_name, " column cannot be found in the data.")) - return(as.character(new_data)) + self$get_data_objects(data_name)$get_climatic_column_name(col_name = col_name) } ) @@ -1197,7 +1195,7 @@ instat_object$set("public", "merge_data", function(data_name, new_data, by = NUL instat_object$set("public", "get_corruption_data_names", function() { corruption_names <- c() for(curr_name in self$get_data_names()) { - if(self$get_data_objects(curr_name)$is_metadata(is_corruption_label) && self$get_data_objects(curr_name)$get_metadata(is_corruption_label)) { + if(self$get_data_objects(curr_name)$is_metadata(corruption_data_label) && self$get_data_objects(curr_name)$get_metadata(corruption_data_label)) { corruption_names <- c(corruption_names, curr_name) } }