From 7da7b2b2ec8c7dc9f27afe25c9cd01b732bb215f Mon Sep 17 00:00:00 2001 From: steven ndung'u Date: Mon, 30 Jan 2017 10:57:05 +0300 Subject: [PATCH 01/66] Dlg View and Remove Keys --- instat/dlgViewAndRemoveKeys.Designer.vb | 27 ++++++++++----------- instat/dlgViewAndRemoveKeys.vb | 32 +++++++++++++++++++------ 2 files changed, 38 insertions(+), 21 deletions(-) diff --git a/instat/dlgViewAndRemoveKeys.Designer.vb b/instat/dlgViewAndRemoveKeys.Designer.vb index 6bb50068b75..bd00c52396d 100644 --- a/instat/dlgViewAndRemoveKeys.Designer.vb +++ b/instat/dlgViewAndRemoveKeys.Designer.vb @@ -1,9 +1,9 @@ - _ + Partial Class dlgViewAndRemoveKeys 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,13 +20,13 @@ Partial Class dlgViewAndRemoveKeys '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.ucrSelectorKeys = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrReceiverSelectedKey = New instat.ucrReceiverSingle() Me.lblSelectedKey = New System.Windows.Forms.Label() - Me.chkRemoveKey = New System.Windows.Forms.CheckBox() + Me.ucrRemoveKey = New instat.ucrCheck() Me.SuspendLayout() ' 'ucrBase @@ -48,6 +48,7 @@ Partial Class dlgViewAndRemoveKeys ' 'ucrReceiverSelectedKey ' + Me.ucrReceiverSelectedKey.frmParent = Me Me.ucrReceiverSelectedKey.Location = New System.Drawing.Point(223, 26) Me.ucrReceiverSelectedKey.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverSelectedKey.Name = "ucrReceiverSelectedKey" @@ -64,22 +65,20 @@ Partial Class dlgViewAndRemoveKeys Me.lblSelectedKey.TabIndex = 3 Me.lblSelectedKey.Text = "Selected Key:" ' - 'chkRemoveKey + 'ucrRemoveKey ' - Me.chkRemoveKey.AutoSize = True - Me.chkRemoveKey.Location = New System.Drawing.Point(227, 50) - Me.chkRemoveKey.Name = "chkRemoveKey" - Me.chkRemoveKey.Size = New System.Drawing.Size(87, 17) - Me.chkRemoveKey.TabIndex = 4 - Me.chkRemoveKey.Text = "Remove Key" - Me.chkRemoveKey.UseVisualStyleBackColor = True + Me.ucrRemoveKey.Checked = False + Me.ucrRemoveKey.Location = New System.Drawing.Point(223, 49) + Me.ucrRemoveKey.Name = "ucrRemoveKey" + Me.ucrRemoveKey.Size = New System.Drawing.Size(145, 20) + Me.ucrRemoveKey.TabIndex = 10 ' 'dlgViewAndRemoveKeys ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(423, 256) - Me.Controls.Add(Me.chkRemoveKey) + Me.Controls.Add(Me.ucrRemoveKey) Me.Controls.Add(Me.lblSelectedKey) Me.Controls.Add(Me.ucrReceiverSelectedKey) Me.Controls.Add(Me.ucrSelectorKeys) @@ -99,5 +98,5 @@ Partial Class dlgViewAndRemoveKeys Friend WithEvents ucrSelectorKeys As ucrSelectorByDataFrameAddRemove Friend WithEvents ucrReceiverSelectedKey As ucrReceiverSingle Friend WithEvents lblSelectedKey As Label - Friend WithEvents chkRemoveKey As CheckBox + Friend WithEvents ucrRemoveKey As ucrCheck End Class diff --git a/instat/dlgViewAndRemoveKeys.vb b/instat/dlgViewAndRemoveKeys.vb index 9d4b90c2be7..4c3d9e4cb4e 100644 --- a/instat/dlgViewAndRemoveKeys.vb +++ b/instat/dlgViewAndRemoveKeys.vb @@ -17,7 +17,8 @@ Imports instat.Translations Public Class dlgViewAndRemoveKeys Public bFirstLoad As Boolean = True - Private Sub dlgViewAndRemoveKeys_Load(sender As Object, e As EventArgs) Handles MyBase.Load + Private clsDefaultFunction As New RFunction + Private Sub dlgViewAndRemoveKeys_Load(sender As Object, e As EventArgs) Handles Me.Load autoTranslate(Me) If bFirstLoad Then InitialiseDialog() @@ -28,13 +29,26 @@ Public Class dlgViewAndRemoveKeys End Sub Private Sub InitialiseDialog() - ucrSelectorKeys = ucrReceiverSelectedKey.Selector - ucrReceiverSelectedKey.SetMeAsReceiver() + ucrBase.iHelpTopicID = 505 + + 'Setting Receiver + ucrReceiverSelectedKey.Selector = ucrSelectorKeys + ucrReceiverSelectedKey.SetMeAsReceiver() + ucrReceiverSelectedKey.SetItemType("key") + ucrReceiverSelectedKey.SetParameter(New RParameter("key_name", 1)) + ucrReceiverSelectedKey.SetParameterIsString() + + ucrSelectorKeys.SetParameter(New RParameter("data_name", 0)) + ucrSelectorKeys.SetParameterIsString() + + ucrRemoveKey.SetText("Remove Key") + clsDefaultFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$remove_key") + End Sub Private Sub TestOKEnabled() - If ucrReceiverSelectedKey.IsEmpty Then + If Not ucrReceiverSelectedKey.IsEmpty AndAlso ucrRemoveKey.Checked Then ucrBase.OKEnabled(True) Else ucrBase.OKEnabled(False) @@ -42,15 +56,19 @@ Public Class dlgViewAndRemoveKeys End Sub Private Sub SetDefaults() - chkRemoveKey.Checked = False + ' Set default RFunction as the base function + ucrRemoveKey.Checked = False + ucrSelectorKeys.Reset() + ucrBase.clsRsyntax.SetBaseRFunction(clsDefaultFunction.Clone()) + SetRCode(Me, ucrBase.clsRsyntax.clsBaseFunction, True) + TestOKEnabled() End Sub - Private Sub ucrReceiverSelectedKey_SelectionChanged(sender As Object, e As EventArgs) Handles ucrReceiverSelectedKey.SelectionChanged + Private Sub Controls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrSelectorKeys.ControlContentsChanged, ucrReceiverSelectedKey.ControlContentsChanged, ucrRemoveKey.ControlContentsChanged TestOKEnabled() End Sub Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset SetDefaults() - TestOKEnabled() End Sub End Class \ No newline at end of file From 15698b41d3b41ff43cf3fdffd1c551b463c196c4 Mon Sep 17 00:00:00 2001 From: steven ndung'u Date: Mon, 30 Jan 2017 10:57:41 +0300 Subject: [PATCH 02/66] Order of tabs --- instat/dlgViewAndRemoveKeys.Designer.vb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/instat/dlgViewAndRemoveKeys.Designer.vb b/instat/dlgViewAndRemoveKeys.Designer.vb index bd00c52396d..732e0971317 100644 --- a/instat/dlgViewAndRemoveKeys.Designer.vb +++ b/instat/dlgViewAndRemoveKeys.Designer.vb @@ -34,7 +34,7 @@ Partial Class dlgViewAndRemoveKeys Me.ucrBase.Location = New System.Drawing.Point(12, 196) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(410, 52) - Me.ucrBase.TabIndex = 0 + Me.ucrBase.TabIndex = 4 ' 'ucrSelectorKeys ' @@ -44,7 +44,7 @@ Partial Class dlgViewAndRemoveKeys Me.ucrSelectorKeys.Margin = New System.Windows.Forms.Padding(0) Me.ucrSelectorKeys.Name = "ucrSelectorKeys" Me.ucrSelectorKeys.Size = New System.Drawing.Size(210, 180) - Me.ucrSelectorKeys.TabIndex = 1 + Me.ucrSelectorKeys.TabIndex = 0 ' 'ucrReceiverSelectedKey ' @@ -62,7 +62,7 @@ Partial Class dlgViewAndRemoveKeys Me.lblSelectedKey.Location = New System.Drawing.Point(220, 13) Me.lblSelectedKey.Name = "lblSelectedKey" Me.lblSelectedKey.Size = New System.Drawing.Size(73, 13) - Me.lblSelectedKey.TabIndex = 3 + Me.lblSelectedKey.TabIndex = 1 Me.lblSelectedKey.Text = "Selected Key:" ' 'ucrRemoveKey @@ -71,7 +71,7 @@ Partial Class dlgViewAndRemoveKeys Me.ucrRemoveKey.Location = New System.Drawing.Point(223, 49) Me.ucrRemoveKey.Name = "ucrRemoveKey" Me.ucrRemoveKey.Size = New System.Drawing.Size(145, 20) - Me.ucrRemoveKey.TabIndex = 10 + Me.ucrRemoveKey.TabIndex = 3 ' 'dlgViewAndRemoveKeys ' From 4a44d1142ab3fa8d82be90b0752412112d72a97b Mon Sep 17 00:00:00 2001 From: Lunalo Date: Wed, 1 Feb 2017 10:42:00 +0300 Subject: [PATCH 03/66] Reimplementing Save as dialog --- instat/dlgSaveAs.Designer.vb | 1 + instat/dlgSaveAs.vb | 52 +++++++++++++++++++++++------------- 2 files changed, 34 insertions(+), 19 deletions(-) diff --git a/instat/dlgSaveAs.Designer.vb b/instat/dlgSaveAs.Designer.vb index 180a841c060..cefd96d596a 100644 --- a/instat/dlgSaveAs.Designer.vb +++ b/instat/dlgSaveAs.Designer.vb @@ -56,6 +56,7 @@ Partial Class dlgSaveAs ' 'ucrInputFilePath ' + Me.ucrInputFilePath.IsMultiline = False Me.ucrInputFilePath.IsReadOnly = False Me.ucrInputFilePath.Location = New System.Drawing.Point(91, 12) Me.ucrInputFilePath.Name = "ucrInputFilePath" diff --git a/instat/dlgSaveAs.vb b/instat/dlgSaveAs.vb index 9a9d031a897..7eb9d3ccad0 100644 --- a/instat/dlgSaveAs.vb +++ b/instat/dlgSaveAs.vb @@ -18,7 +18,9 @@ Imports System.IO Imports instat.Translations Public Class dlgSaveAs - Dim bFirstLoad As Boolean = True + Public bFirstLoad As Boolean = True + Private bReset As Boolean = True + Private clsSaveAS As New RFunction Private Sub dlgSaveAs_Load(sender As Object, e As EventArgs) Handles Me.Load autoTranslate(Me) @@ -33,13 +35,20 @@ Public Class dlgSaveAs Private Sub InitialiseDialog() ucrBase.iHelpTopicID = 332 ucrInputFilePath.IsReadOnly = True - ucrBase.clsRsyntax.SetFunction("saveRDS") - ucrBase.clsRsyntax.AddParameter("object", frmMain.clsRLink.strInstatDataObject) + ucrInputFilePath.SetName("") txtConfirm.Text = "Click Ok to confirm the save" + ucrInputFilePath.SetParameter(New RParameter("file", 0)) + txtConfirm.Show() End Sub + Private Sub SetRCodeForControls(bReset As Boolean) + SetRCode(Me, ucrBase.clsRsyntax.clsBaseFunction, bReset) + End Sub Private Sub SetDefaults() - ucrInputFilePath.SetName("") + clsSaveAS.SetRCommand("saveRDS") + frmMain.strSaveFilePath = ucrInputFilePath.GetText() + ' clsSaveAS.AddParameter("object", frmMain.clsRLink.strInstatDataObject) + ucrBase.clsRsyntax.SetBaseRFunction(clsSaveAS.Clone()) End Sub Private Sub TestOKEnabled() @@ -50,12 +59,12 @@ Public Class dlgSaveAs End If End Sub - Private Sub ucrBase_ClickOk(sender As Object, e As EventArgs) Handles ucrBase.ClickOk - 'adds the saved file to the recent paths - 'Disabled until implemented correctly - 'frmMain.clsRecentItems.addToMenu(ucrInputFilePath.GetText()) - frmMain.strSaveFilePath = ucrInputFilePath.GetText() - End Sub + 'Private Sub ucrBase_ClickOk(sender As Object, e As EventArgs) Handles ucrBase.ClickOk + ' 'adds the saved file to the recent paths + ' 'Disabled until implemented correctly + ' 'frmMain.clsRecentItems.addToMenu(ucrInputFilePath.GetText()) + + 'End Sub Private Sub cmdEditorSave_Click(sender As Object, e As EventArgs) Handles cmdChooseFile.Click SelectFileToSave() @@ -79,22 +88,27 @@ Public Class dlgSaveAs Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset SetDefaults() + SetRCodeForControls(True) TestOKEnabled() End Sub - Private Sub ucrInputFilePath_NameChanged() Handles ucrInputFilePath.NameChanged - If Not ucrInputFilePath.IsEmpty() Then - ucrBase.clsRsyntax.AddParameter("file", Chr(34) & ucrInputFilePath.GetText() & Chr(34)) - txtConfirm.Show() - Else - ucrBase.clsRsyntax.RemoveParameter("file") - txtConfirm.Hide() - End If - End Sub + 'Private Sub ucrInputFilePath_NameChanged() Handles ucrInputFilePath.NameChanged + ' If Not ucrInputFilePath.IsEmpty() Then + ' ucrBase.clsRsyntax.AddParameter("file", Chr(34) & ucrInputFilePath.GetText() & Chr(34)) + + ' Else + ' ucrBase.clsRsyntax.RemoveParameter("file") + ' txtConfirm.Hide() + ' End If + 'End Sub Private Sub ucrInputFilePath_Click(sender As Object, e As EventArgs) Handles ucrInputFilePath.Click If ucrInputFilePath.IsEmpty() Then SelectFileToSave() End If End Sub + + Private Sub ucrInputFilePath_ControContenetsChanged(ucrchangedControl As ucrCore) Handles ucrInputFilePath.ControlContentsChanged + TestOKEnabled() + End Sub End Class From a37cc57a1130a5fb2323db7fb64123f93a0dc52e Mon Sep 17 00:00:00 2001 From: Lunalo Date: Wed, 1 Feb 2017 10:57:37 +0300 Subject: [PATCH 04/66] More edits --- instat/dlgSaveAs.vb | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/instat/dlgSaveAs.vb b/instat/dlgSaveAs.vb index 7eb9d3ccad0..9a03a2a8c1a 100644 --- a/instat/dlgSaveAs.vb +++ b/instat/dlgSaveAs.vb @@ -35,37 +35,32 @@ Public Class dlgSaveAs Private Sub InitialiseDialog() ucrBase.iHelpTopicID = 332 ucrInputFilePath.IsReadOnly = True - ucrInputFilePath.SetName("") txtConfirm.Text = "Click Ok to confirm the save" + ucrInputFilePath.SetName("") ucrInputFilePath.SetParameter(New RParameter("file", 0)) - txtConfirm.Show() End Sub Private Sub SetRCodeForControls(bReset As Boolean) SetRCode(Me, ucrBase.clsRsyntax.clsBaseFunction, bReset) End Sub + Private Sub SetDefaults() clsSaveAS.SetRCommand("saveRDS") frmMain.strSaveFilePath = ucrInputFilePath.GetText() - ' clsSaveAS.AddParameter("object", frmMain.clsRLink.strInstatDataObject) + clsSaveAS.AddParameter("object", frmMain.clsRLink.strInstatDataObject) ucrBase.clsRsyntax.SetBaseRFunction(clsSaveAS.Clone()) End Sub Private Sub TestOKEnabled() If Not ucrInputFilePath.IsEmpty() Then + txtConfirm.Show() ucrBase.OKEnabled(True) Else ucrBase.OKEnabled(False) + txtConfirm.Hide() End If End Sub - 'Private Sub ucrBase_ClickOk(sender As Object, e As EventArgs) Handles ucrBase.ClickOk - ' 'adds the saved file to the recent paths - ' 'Disabled until implemented correctly - ' 'frmMain.clsRecentItems.addToMenu(ucrInputFilePath.GetText()) - - 'End Sub - Private Sub cmdEditorSave_Click(sender As Object, e As EventArgs) Handles cmdChooseFile.Click SelectFileToSave() End Sub @@ -92,16 +87,6 @@ Public Class dlgSaveAs TestOKEnabled() End Sub - 'Private Sub ucrInputFilePath_NameChanged() Handles ucrInputFilePath.NameChanged - ' If Not ucrInputFilePath.IsEmpty() Then - ' ucrBase.clsRsyntax.AddParameter("file", Chr(34) & ucrInputFilePath.GetText() & Chr(34)) - - ' Else - ' ucrBase.clsRsyntax.RemoveParameter("file") - ' txtConfirm.Hide() - ' End If - 'End Sub - Private Sub ucrInputFilePath_Click(sender As Object, e As EventArgs) Handles ucrInputFilePath.Click If ucrInputFilePath.IsEmpty() Then SelectFileToSave() From a9731509eb4d6cf74d63ff07e5ec374b9a756a3e Mon Sep 17 00:00:00 2001 From: Lunalo Date: Wed, 1 Feb 2017 12:07:34 +0300 Subject: [PATCH 05/66] Minor edits --- instat/dlgSaveAs.vb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/instat/dlgSaveAs.vb b/instat/dlgSaveAs.vb index 9a03a2a8c1a..97087a18b8a 100644 --- a/instat/dlgSaveAs.vb +++ b/instat/dlgSaveAs.vb @@ -35,8 +35,8 @@ Public Class dlgSaveAs Private Sub InitialiseDialog() ucrBase.iHelpTopicID = 332 ucrInputFilePath.IsReadOnly = True + SelectFileToSave() txtConfirm.Text = "Click Ok to confirm the save" - ucrInputFilePath.SetName("") ucrInputFilePath.SetParameter(New RParameter("file", 0)) End Sub @@ -45,10 +45,12 @@ Public Class dlgSaveAs End Sub Private Sub SetDefaults() + ucrInputFilePath.ResetText() clsSaveAS.SetRCommand("saveRDS") frmMain.strSaveFilePath = ucrInputFilePath.GetText() clsSaveAS.AddParameter("object", frmMain.clsRLink.strInstatDataObject) ucrBase.clsRsyntax.SetBaseRFunction(clsSaveAS.Clone()) + TestOKEnabled() End Sub Private Sub TestOKEnabled() @@ -84,7 +86,6 @@ Public Class dlgSaveAs Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset SetDefaults() SetRCodeForControls(True) - TestOKEnabled() End Sub Private Sub ucrInputFilePath_Click(sender As Object, e As EventArgs) Handles ucrInputFilePath.Click From ea6b4eda8c2476508140918bc03fbed3dade54ed Mon Sep 17 00:00:00 2001 From: Lunalo Date: Wed, 1 Feb 2017 15:46:00 +0300 Subject: [PATCH 06/66] Minor Edits --- instat/dlgSaveAs.vb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/instat/dlgSaveAs.vb b/instat/dlgSaveAs.vb index 97087a18b8a..9dbb87e0c9c 100644 --- a/instat/dlgSaveAs.vb +++ b/instat/dlgSaveAs.vb @@ -16,7 +16,6 @@ Imports System.IO Imports instat.Translations - Public Class dlgSaveAs Public bFirstLoad As Boolean = True Private bReset As Boolean = True @@ -35,7 +34,6 @@ Public Class dlgSaveAs Private Sub InitialiseDialog() ucrBase.iHelpTopicID = 332 ucrInputFilePath.IsReadOnly = True - SelectFileToSave() txtConfirm.Text = "Click Ok to confirm the save" ucrInputFilePath.SetParameter(New RParameter("file", 0)) End Sub @@ -50,6 +48,7 @@ Public Class dlgSaveAs frmMain.strSaveFilePath = ucrInputFilePath.GetText() clsSaveAS.AddParameter("object", frmMain.clsRLink.strInstatDataObject) ucrBase.clsRsyntax.SetBaseRFunction(clsSaveAS.Clone()) + SetRCodeForControls(True) TestOKEnabled() End Sub From 0b84943d78a490cc815c5ed21f8234bce0177816 Mon Sep 17 00:00:00 2001 From: Lunalo Date: Thu, 2 Feb 2017 09:56:09 +0300 Subject: [PATCH 07/66] Minor changes of the structure --- instat/dlgSaveAs.vb | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/instat/dlgSaveAs.vb b/instat/dlgSaveAs.vb index 9dbb87e0c9c..20a693cb16a 100644 --- a/instat/dlgSaveAs.vb +++ b/instat/dlgSaveAs.vb @@ -19,16 +19,19 @@ Imports instat.Translations Public Class dlgSaveAs Public bFirstLoad As Boolean = True Private bReset As Boolean = True - Private clsSaveAS As New RFunction + Private clsDefaultFunction As New RFunction Private Sub dlgSaveAs_Load(sender As Object, e As EventArgs) Handles Me.Load - autoTranslate(Me) If bFirstLoad Then InitialiseDialog() - SetDefaults() bFirstLoad = False End If - TestOKEnabled() + If bReset Then + SetDefaults() + End If + SetRCodeForControls(bReset) + bReset = False + autoTranslate(Me) End Sub Private Sub InitialiseDialog() @@ -40,16 +43,15 @@ Public Class dlgSaveAs Private Sub SetRCodeForControls(bReset As Boolean) SetRCode(Me, ucrBase.clsRsyntax.clsBaseFunction, bReset) + TestOKEnabled() End Sub Private Sub SetDefaults() ucrInputFilePath.ResetText() - clsSaveAS.SetRCommand("saveRDS") + clsDefaultFunction.SetRCommand("saveRDS") frmMain.strSaveFilePath = ucrInputFilePath.GetText() - clsSaveAS.AddParameter("object", frmMain.clsRLink.strInstatDataObject) - ucrBase.clsRsyntax.SetBaseRFunction(clsSaveAS.Clone()) - SetRCodeForControls(True) - TestOKEnabled() + clsDefaultFunction.AddParameter("object", frmMain.clsRLink.strInstatDataObject) + ucrBase.clsRsyntax.SetBaseRFunction(clsDefaultFunction.Clone()) End Sub Private Sub TestOKEnabled() From 27684e3e2356ec35d96b18c9e1983ec7b59eb157 Mon Sep 17 00:00:00 2001 From: steven ndung'u Date: Thu, 2 Feb 2017 13:38:04 +0300 Subject: [PATCH 08/66] Adding the new changes. --- instat/dlgViewAndRemoveKeys.vb | 38 ++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/instat/dlgViewAndRemoveKeys.vb b/instat/dlgViewAndRemoveKeys.vb index 4c3d9e4cb4e..f9976474ff5 100644 --- a/instat/dlgViewAndRemoveKeys.vb +++ b/instat/dlgViewAndRemoveKeys.vb @@ -17,15 +17,34 @@ Imports instat.Translations Public Class dlgViewAndRemoveKeys Public bFirstLoad As Boolean = True - Private clsDefaultFunction As New RFunction + Private bReset As Boolean = True Private Sub dlgViewAndRemoveKeys_Load(sender As Object, e As EventArgs) Handles Me.Load autoTranslate(Me) If bFirstLoad Then InitialiseDialog() - SetDefaults() bFirstLoad = False End If - TestOKEnabled() + If bReset Then + SetDefaults() + End If + SetRCodeForControls(bReset) + bReset = False + End Sub + + Private Sub SetDefaults() + Dim clsDefaultFunction As New RFunction + + ucrRemoveKey.Checked = False + ucrSelectorKeys.Reset() + + ' Set default RFunction as the base function + clsDefaultFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$remove_key") + + ucrBase.clsRsyntax.SetBaseRFunction(clsDefaultFunction.Clone()) + End Sub + + Public Sub SetRCodeForControls(bReset As Boolean) + SetRCode(Me, ucrBase.clsRsyntax.clsBaseFunction, bReset) End Sub Private Sub InitialiseDialog() @@ -43,7 +62,7 @@ Public Class dlgViewAndRemoveKeys ucrSelectorKeys.SetParameterIsString() ucrRemoveKey.SetText("Remove Key") - clsDefaultFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$remove_key") + End Sub @@ -55,20 +74,13 @@ Public Class dlgViewAndRemoveKeys End If End Sub - Private Sub SetDefaults() - ' Set default RFunction as the base function - ucrRemoveKey.Checked = False - ucrSelectorKeys.Reset() - ucrBase.clsRsyntax.SetBaseRFunction(clsDefaultFunction.Clone()) - SetRCode(Me, ucrBase.clsRsyntax.clsBaseFunction, True) - TestOKEnabled() - End Sub - Private Sub Controls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrSelectorKeys.ControlContentsChanged, ucrReceiverSelectedKey.ControlContentsChanged, ucrRemoveKey.ControlContentsChanged TestOKEnabled() 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 From 746ad0f9b96baf299d56d0b7a3becccefca87d08 Mon Sep 17 00:00:00 2001 From: Lunalo Date: Fri, 3 Feb 2017 10:10:04 +0300 Subject: [PATCH 09/66] Minor changes --- instat/dlgSaveAs.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instat/dlgSaveAs.vb b/instat/dlgSaveAs.vb index 20a693cb16a..e37fa9eb2be 100644 --- a/instat/dlgSaveAs.vb +++ b/instat/dlgSaveAs.vb @@ -19,7 +19,6 @@ Imports instat.Translations Public Class dlgSaveAs Public bFirstLoad As Boolean = True Private bReset As Boolean = True - Private clsDefaultFunction As New RFunction Private Sub dlgSaveAs_Load(sender As Object, e As EventArgs) Handles Me.Load If bFirstLoad Then @@ -47,7 +46,8 @@ Public Class dlgSaveAs End Sub Private Sub SetDefaults() - ucrInputFilePath.ResetText() + Dim clsDefaultFunction As New RFunction + ucrInputFilePath.Reset() clsDefaultFunction.SetRCommand("saveRDS") frmMain.strSaveFilePath = ucrInputFilePath.GetText() clsDefaultFunction.AddParameter("object", frmMain.clsRLink.strInstatDataObject) From 0ffbeeff5d21579afd00571b12a4b5d74ecf4e04 Mon Sep 17 00:00:00 2001 From: steven ndung'u Date: Sat, 4 Feb 2017 21:18:11 +0300 Subject: [PATCH 10/66] Corrections suggested made --- instat/dlgViewAndRemoveKeys.Designer.vb | 12 +++++++++--- instat/dlgViewAndRemoveKeys.vb | 6 ++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/instat/dlgViewAndRemoveKeys.Designer.vb b/instat/dlgViewAndRemoveKeys.Designer.vb index 732e0971317..0381cd8c536 100644 --- a/instat/dlgViewAndRemoveKeys.Designer.vb +++ b/instat/dlgViewAndRemoveKeys.Designer.vb @@ -38,6 +38,8 @@ Partial Class dlgViewAndRemoveKeys ' 'ucrSelectorKeys ' + Me.ucrSelectorKeys.bAddRemoveParameter = True + Me.ucrSelectorKeys.bChangeParameterValue = True Me.ucrSelectorKeys.bShowHiddenColumns = False Me.ucrSelectorKeys.bUseCurrentFilter = True Me.ucrSelectorKeys.Location = New System.Drawing.Point(13, 13) @@ -48,8 +50,10 @@ Partial Class dlgViewAndRemoveKeys ' 'ucrReceiverSelectedKey ' + Me.ucrReceiverSelectedKey.bAddRemoveParameter = True + Me.ucrReceiverSelectedKey.bChangeParameterValue = True Me.ucrReceiverSelectedKey.frmParent = Me - Me.ucrReceiverSelectedKey.Location = New System.Drawing.Point(223, 26) + Me.ucrReceiverSelectedKey.Location = New System.Drawing.Point(269, 56) Me.ucrReceiverSelectedKey.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverSelectedKey.Name = "ucrReceiverSelectedKey" Me.ucrReceiverSelectedKey.Selector = Nothing @@ -59,7 +63,7 @@ Partial Class dlgViewAndRemoveKeys 'lblSelectedKey ' Me.lblSelectedKey.AutoSize = True - Me.lblSelectedKey.Location = New System.Drawing.Point(220, 13) + Me.lblSelectedKey.Location = New System.Drawing.Point(272, 37) Me.lblSelectedKey.Name = "lblSelectedKey" Me.lblSelectedKey.Size = New System.Drawing.Size(73, 13) Me.lblSelectedKey.TabIndex = 1 @@ -67,8 +71,10 @@ Partial Class dlgViewAndRemoveKeys ' 'ucrRemoveKey ' + Me.ucrRemoveKey.bAddRemoveParameter = True + Me.ucrRemoveKey.bChangeParameterValue = True Me.ucrRemoveKey.Checked = False - Me.ucrRemoveKey.Location = New System.Drawing.Point(223, 49) + Me.ucrRemoveKey.Location = New System.Drawing.Point(269, 84) Me.ucrRemoveKey.Name = "ucrRemoveKey" Me.ucrRemoveKey.Size = New System.Drawing.Size(145, 20) Me.ucrRemoveKey.TabIndex = 3 diff --git a/instat/dlgViewAndRemoveKeys.vb b/instat/dlgViewAndRemoveKeys.vb index f9976474ff5..8b061dd668a 100644 --- a/instat/dlgViewAndRemoveKeys.vb +++ b/instat/dlgViewAndRemoveKeys.vb @@ -23,6 +23,8 @@ Public Class dlgViewAndRemoveKeys If bFirstLoad Then InitialiseDialog() bFirstLoad = False + Else + ReopenDialog() End If If bReset Then SetDefaults() @@ -31,6 +33,10 @@ Public Class dlgViewAndRemoveKeys bReset = False End Sub + Private Sub ReopenDialog() + ucrSelectorKeys.Reset() + End Sub + Private Sub SetDefaults() Dim clsDefaultFunction As New RFunction From d82f84d1a8f33fccdc06cf9f40c3ea798cb9d51b Mon Sep 17 00:00:00 2001 From: steven ndung'u Date: Sun, 5 Feb 2017 16:39:14 +0300 Subject: [PATCH 11/66] edit --- instat/dlgViewAndRemoveKeys.vb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/instat/dlgViewAndRemoveKeys.vb b/instat/dlgViewAndRemoveKeys.vb index 8b061dd668a..43b54afb7e4 100644 --- a/instat/dlgViewAndRemoveKeys.vb +++ b/instat/dlgViewAndRemoveKeys.vb @@ -40,7 +40,7 @@ Public Class dlgViewAndRemoveKeys Private Sub SetDefaults() Dim clsDefaultFunction As New RFunction - ucrRemoveKey.Checked = False + ucrSelectorKeys.Reset() ' Set default RFunction as the base function @@ -56,6 +56,7 @@ Public Class dlgViewAndRemoveKeys Private Sub InitialiseDialog() ucrBase.iHelpTopicID = 505 + ucrRemoveKey.Checked = False 'Setting Receiver ucrReceiverSelectedKey.Selector = ucrSelectorKeys From bc26bb8171d6dca9072a897ea0223b00f40ea058 Mon Sep 17 00:00:00 2001 From: John Lunalo Date: Thu, 16 Feb 2017 10:03:26 +0300 Subject: [PATCH 12/66] Resetting --- instat/dlgSaveAs.vb | 1 + 1 file changed, 1 insertion(+) diff --git a/instat/dlgSaveAs.vb b/instat/dlgSaveAs.vb index e37fa9eb2be..1f0c57c665f 100644 --- a/instat/dlgSaveAs.vb +++ b/instat/dlgSaveAs.vb @@ -48,6 +48,7 @@ Public Class dlgSaveAs Private Sub SetDefaults() Dim clsDefaultFunction As New RFunction ucrInputFilePath.Reset() + ucrInputFilePath.SetName("") clsDefaultFunction.SetRCommand("saveRDS") frmMain.strSaveFilePath = ucrInputFilePath.GetText() clsDefaultFunction.AddParameter("object", frmMain.clsRLink.strInstatDataObject) From 1e4f935295843c91affa2fc27c96e64225374d8e Mon Sep 17 00:00:00 2001 From: John Lunalo Date: Thu, 16 Feb 2017 14:10:28 +0300 Subject: [PATCH 13/66] Removing lines --- instat/dlgSaveAs.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/dlgSaveAs.vb b/instat/dlgSaveAs.vb index 1f0c57c665f..61db958491a 100644 --- a/instat/dlgSaveAs.vb +++ b/instat/dlgSaveAs.vb @@ -15,6 +15,7 @@ ' along with this program. If not, see . Imports System.IO +Imports instat Imports instat.Translations Public Class dlgSaveAs Public bFirstLoad As Boolean = True @@ -50,7 +51,6 @@ Public Class dlgSaveAs ucrInputFilePath.Reset() ucrInputFilePath.SetName("") clsDefaultFunction.SetRCommand("saveRDS") - frmMain.strSaveFilePath = ucrInputFilePath.GetText() clsDefaultFunction.AddParameter("object", frmMain.clsRLink.strInstatDataObject) ucrBase.clsRsyntax.SetBaseRFunction(clsDefaultFunction.Clone()) End Sub From ed2b1903a838651f51a35993622177095d6994b1 Mon Sep 17 00:00:00 2001 From: John Lunalo Date: Thu, 16 Feb 2017 15:48:59 +0300 Subject: [PATCH 14/66] Setting the valur of string in clickOk event --- instat/dlgSaveAs.vb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/instat/dlgSaveAs.vb b/instat/dlgSaveAs.vb index 61db958491a..84f4bc4cdb8 100644 --- a/instat/dlgSaveAs.vb +++ b/instat/dlgSaveAs.vb @@ -18,7 +18,7 @@ Imports System.IO Imports instat Imports instat.Translations Public Class dlgSaveAs - Public bFirstLoad As Boolean = True + Private bFirstLoad As Boolean = True Private bReset As Boolean = True Private Sub dlgSaveAs_Load(sender As Object, e As EventArgs) Handles Me.Load @@ -99,4 +99,9 @@ Public Class dlgSaveAs Private Sub ucrInputFilePath_ControContenetsChanged(ucrchangedControl As ucrCore) Handles ucrInputFilePath.ControlContentsChanged TestOKEnabled() End Sub + + Private Sub ucrBase_ClickOk(sender As Object, e As EventArgs) Handles ucrBase.ClickOk + frmMain.strSaveFilePath = ucrInputFilePath.GetText() + End Sub + End Class From 645e88e0b14a52ca7eca3aa46f32e483d4e92952 Mon Sep 17 00:00:00 2001 From: Alex Sananka Date: Mon, 20 Feb 2017 12:23:11 +0300 Subject: [PATCH 15/66] Edits --- instat/dlgRenameMetadata.vb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/instat/dlgRenameMetadata.vb b/instat/dlgRenameMetadata.vb index 2ab88f7d02d..9161a04cc56 100644 --- a/instat/dlgRenameMetadata.vb +++ b/instat/dlgRenameMetadata.vb @@ -13,16 +13,14 @@ ' Imports instat.Translations Public Class dlgRenameMetadata - Public bFirstLoad As Boolean = True + private bFirstLoad As Boolean = True Private Sub dlgRenameMetadata_Load(sender As Object, e As EventArgs) Handles MyBase.Load autoTranslate(Me) If bFirstLoad Then - setDefaults() InitialiseDialog() bFirstLoad = False - Else - ReopenDialog() End If + setDefaults() TestOKEnabled() End Sub From 07ab6091e8120030c51f8222f94519e4c1b64519 Mon Sep 17 00:00:00 2001 From: Alex Sananka Date: Mon, 20 Feb 2017 12:26:31 +0300 Subject: [PATCH 16/66] More edits --- instat/dlgRenameMetadata.vb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/instat/dlgRenameMetadata.vb b/instat/dlgRenameMetadata.vb index 9161a04cc56..a075b4f91fb 100644 --- a/instat/dlgRenameMetadata.vb +++ b/instat/dlgRenameMetadata.vb @@ -13,14 +13,16 @@ ' Imports instat.Translations Public Class dlgRenameMetadata - private bFirstLoad As Boolean = True + Private bFirstLoad As Boolean = True Private Sub dlgRenameMetadata_Load(sender As Object, e As EventArgs) Handles MyBase.Load autoTranslate(Me) If bFirstLoad Then + setDefaults() InitialiseDialog() bFirstLoad = False + Else + ReopenDialog() End If - setDefaults() TestOKEnabled() End Sub From dd86d12006904db9c656700f3b244b3c4d45d328 Mon Sep 17 00:00:00 2001 From: steven ndung'u Date: Mon, 20 Feb 2017 18:33:16 +0300 Subject: [PATCH 17/66] minor change --- instat/dlgViewAndRemoveKeys.Designer.vb | 28 ++++++++++--------------- instat/dlgViewAndRemoveKeys.vb | 14 ++++++------- 2 files changed, 17 insertions(+), 25 deletions(-) diff --git a/instat/dlgViewAndRemoveKeys.Designer.vb b/instat/dlgViewAndRemoveKeys.Designer.vb index 0381cd8c536..f6bb07354a9 100644 --- a/instat/dlgViewAndRemoveKeys.Designer.vb +++ b/instat/dlgViewAndRemoveKeys.Designer.vb @@ -26,7 +26,7 @@ Partial Class dlgViewAndRemoveKeys Me.ucrSelectorKeys = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrReceiverSelectedKey = New instat.ucrReceiverSingle() Me.lblSelectedKey = New System.Windows.Forms.Label() - Me.ucrRemoveKey = New instat.ucrCheck() + Me.ucrChkRemoveKey = New instat.ucrCheck() Me.SuspendLayout() ' 'ucrBase @@ -38,8 +38,6 @@ Partial Class dlgViewAndRemoveKeys ' 'ucrSelectorKeys ' - Me.ucrSelectorKeys.bAddRemoveParameter = True - Me.ucrSelectorKeys.bChangeParameterValue = True Me.ucrSelectorKeys.bShowHiddenColumns = False Me.ucrSelectorKeys.bUseCurrentFilter = True Me.ucrSelectorKeys.Location = New System.Drawing.Point(13, 13) @@ -50,8 +48,6 @@ Partial Class dlgViewAndRemoveKeys ' 'ucrReceiverSelectedKey ' - Me.ucrReceiverSelectedKey.bAddRemoveParameter = True - Me.ucrReceiverSelectedKey.bChangeParameterValue = True Me.ucrReceiverSelectedKey.frmParent = Me Me.ucrReceiverSelectedKey.Location = New System.Drawing.Point(269, 56) Me.ucrReceiverSelectedKey.Margin = New System.Windows.Forms.Padding(0) @@ -63,28 +59,26 @@ Partial Class dlgViewAndRemoveKeys 'lblSelectedKey ' Me.lblSelectedKey.AutoSize = True - Me.lblSelectedKey.Location = New System.Drawing.Point(272, 37) + Me.lblSelectedKey.Location = New System.Drawing.Point(266, 41) Me.lblSelectedKey.Name = "lblSelectedKey" Me.lblSelectedKey.Size = New System.Drawing.Size(73, 13) Me.lblSelectedKey.TabIndex = 1 Me.lblSelectedKey.Text = "Selected Key:" ' - 'ucrRemoveKey + 'ucrChkRemoveKey ' - Me.ucrRemoveKey.bAddRemoveParameter = True - Me.ucrRemoveKey.bChangeParameterValue = True - Me.ucrRemoveKey.Checked = False - Me.ucrRemoveKey.Location = New System.Drawing.Point(269, 84) - Me.ucrRemoveKey.Name = "ucrRemoveKey" - Me.ucrRemoveKey.Size = New System.Drawing.Size(145, 20) - Me.ucrRemoveKey.TabIndex = 3 + Me.ucrChkRemoveKey.Checked = False + Me.ucrChkRemoveKey.Location = New System.Drawing.Point(269, 79) + Me.ucrChkRemoveKey.Name = "ucrChkRemoveKey" + Me.ucrChkRemoveKey.Size = New System.Drawing.Size(145, 20) + Me.ucrChkRemoveKey.TabIndex = 3 ' 'dlgViewAndRemoveKeys ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(423, 256) - Me.Controls.Add(Me.ucrRemoveKey) + Me.ClientSize = New System.Drawing.Size(423, 253) + Me.Controls.Add(Me.ucrChkRemoveKey) Me.Controls.Add(Me.lblSelectedKey) Me.Controls.Add(Me.ucrReceiverSelectedKey) Me.Controls.Add(Me.ucrSelectorKeys) @@ -104,5 +98,5 @@ Partial Class dlgViewAndRemoveKeys Friend WithEvents ucrSelectorKeys As ucrSelectorByDataFrameAddRemove Friend WithEvents ucrReceiverSelectedKey As ucrReceiverSingle Friend WithEvents lblSelectedKey As Label - Friend WithEvents ucrRemoveKey As ucrCheck + Friend WithEvents ucrChkRemoveKey As ucrCheck End Class diff --git a/instat/dlgViewAndRemoveKeys.vb b/instat/dlgViewAndRemoveKeys.vb index 43b54afb7e4..3bbb2ffe424 100644 --- a/instat/dlgViewAndRemoveKeys.vb +++ b/instat/dlgViewAndRemoveKeys.vb @@ -39,9 +39,9 @@ Public Class dlgViewAndRemoveKeys Private Sub SetDefaults() Dim clsDefaultFunction As New RFunction - - + 'reset ucrSelectorKeys.Reset() + ucrChkRemoveKey.Checked = False ' Set default RFunction as the base function clsDefaultFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$remove_key") @@ -56,7 +56,7 @@ Public Class dlgViewAndRemoveKeys Private Sub InitialiseDialog() ucrBase.iHelpTopicID = 505 - ucrRemoveKey.Checked = False + ucrChkRemoveKey.Checked = False 'Setting Receiver ucrReceiverSelectedKey.Selector = ucrSelectorKeys @@ -68,20 +68,18 @@ Public Class dlgViewAndRemoveKeys ucrSelectorKeys.SetParameter(New RParameter("data_name", 0)) ucrSelectorKeys.SetParameterIsString() - ucrRemoveKey.SetText("Remove Key") - - + ucrChkRemoveKey.SetText("Remove Key") End Sub Private Sub TestOKEnabled() - If Not ucrReceiverSelectedKey.IsEmpty AndAlso ucrRemoveKey.Checked Then + If Not ucrReceiverSelectedKey.IsEmpty AndAlso ucrChkRemoveKey.Checked Then ucrBase.OKEnabled(True) Else ucrBase.OKEnabled(False) End If End Sub - Private Sub Controls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrSelectorKeys.ControlContentsChanged, ucrReceiverSelectedKey.ControlContentsChanged, ucrRemoveKey.ControlContentsChanged + Private Sub Controls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverSelectedKey.ControlContentsChanged, ucrChkRemoveKey.ControlContentsChanged TestOKEnabled() End Sub From 85848f85d237e41c1f51bb179a8cb2b24b1a8fda Mon Sep 17 00:00:00 2001 From: steven ndung'u Date: Tue, 21 Feb 2017 14:30:18 +0300 Subject: [PATCH 18/66] ed --- instat/dlgViewAndRemoveKeys.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instat/dlgViewAndRemoveKeys.vb b/instat/dlgViewAndRemoveKeys.vb index 3bbb2ffe424..0c59eaeb80b 100644 --- a/instat/dlgViewAndRemoveKeys.vb +++ b/instat/dlgViewAndRemoveKeys.vb @@ -41,11 +41,10 @@ Public Class dlgViewAndRemoveKeys Dim clsDefaultFunction As New RFunction 'reset ucrSelectorKeys.Reset() - ucrChkRemoveKey.Checked = False + ' ucrChkRemoveKey.Checked = False ' Set default RFunction as the base function clsDefaultFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$remove_key") - ucrBase.clsRsyntax.SetBaseRFunction(clsDefaultFunction.Clone()) End Sub @@ -69,6 +68,7 @@ Public Class dlgViewAndRemoveKeys ucrSelectorKeys.SetParameterIsString() ucrChkRemoveKey.SetText("Remove Key") + End Sub Private Sub TestOKEnabled() From 31cdb70e60367dfb4a5b02ce8a6eee28cea823e2 Mon Sep 17 00:00:00 2001 From: steven ndung'u Date: Wed, 22 Feb 2017 16:27:40 +0300 Subject: [PATCH 19/66] changes on the dialogue --- instat/dlgViewAndRemoveKeys.Designer.vb | 58 ++++++++++++------------- instat/dlgViewAndRemoveKeys.vb | 41 ++++++++++++----- 2 files changed, 60 insertions(+), 39 deletions(-) diff --git a/instat/dlgViewAndRemoveKeys.Designer.vb b/instat/dlgViewAndRemoveKeys.Designer.vb index f6bb07354a9..cd53de03eb0 100644 --- a/instat/dlgViewAndRemoveKeys.Designer.vb +++ b/instat/dlgViewAndRemoveKeys.Designer.vb @@ -22,29 +22,29 @@ Partial Class dlgViewAndRemoveKeys 'Do not modify it using the code editor. Private Sub InitializeComponent() - Me.ucrBase = New instat.ucrButtons() - Me.ucrSelectorKeys = New instat.ucrSelectorByDataFrameAddRemove() - Me.ucrReceiverSelectedKey = New instat.ucrReceiverSingle() Me.lblSelectedKey = New System.Windows.Forms.Label() Me.ucrChkRemoveKey = New instat.ucrCheck() + Me.ucrReceiverSelectedKey = New instat.ucrReceiverSingle() + Me.ucrSelectorKeys = New instat.ucrSelectorByDataFrameAddRemove() + Me.ucrBase = New instat.ucrButtons() Me.SuspendLayout() ' - 'ucrBase + 'lblSelectedKey ' - Me.ucrBase.Location = New System.Drawing.Point(12, 196) - Me.ucrBase.Name = "ucrBase" - Me.ucrBase.Size = New System.Drawing.Size(410, 52) - Me.ucrBase.TabIndex = 4 + Me.lblSelectedKey.AutoSize = True + Me.lblSelectedKey.Location = New System.Drawing.Point(266, 41) + Me.lblSelectedKey.Name = "lblSelectedKey" + Me.lblSelectedKey.Size = New System.Drawing.Size(73, 13) + Me.lblSelectedKey.TabIndex = 1 + Me.lblSelectedKey.Text = "Selected Key:" ' - 'ucrSelectorKeys + 'ucrChkRemoveKey ' - Me.ucrSelectorKeys.bShowHiddenColumns = False - Me.ucrSelectorKeys.bUseCurrentFilter = True - Me.ucrSelectorKeys.Location = New System.Drawing.Point(13, 13) - Me.ucrSelectorKeys.Margin = New System.Windows.Forms.Padding(0) - Me.ucrSelectorKeys.Name = "ucrSelectorKeys" - Me.ucrSelectorKeys.Size = New System.Drawing.Size(210, 180) - Me.ucrSelectorKeys.TabIndex = 0 + Me.ucrChkRemoveKey.Checked = False + Me.ucrChkRemoveKey.Location = New System.Drawing.Point(269, 82) + Me.ucrChkRemoveKey.Name = "ucrChkRemoveKey" + Me.ucrChkRemoveKey.Size = New System.Drawing.Size(145, 20) + Me.ucrChkRemoveKey.TabIndex = 4 ' 'ucrReceiverSelectedKey ' @@ -56,22 +56,22 @@ Partial Class dlgViewAndRemoveKeys Me.ucrReceiverSelectedKey.Size = New System.Drawing.Size(120, 20) Me.ucrReceiverSelectedKey.TabIndex = 2 ' - 'lblSelectedKey + 'ucrSelectorKeys ' - Me.lblSelectedKey.AutoSize = True - Me.lblSelectedKey.Location = New System.Drawing.Point(266, 41) - Me.lblSelectedKey.Name = "lblSelectedKey" - Me.lblSelectedKey.Size = New System.Drawing.Size(73, 13) - Me.lblSelectedKey.TabIndex = 1 - Me.lblSelectedKey.Text = "Selected Key:" + Me.ucrSelectorKeys.bShowHiddenColumns = False + Me.ucrSelectorKeys.bUseCurrentFilter = True + Me.ucrSelectorKeys.Location = New System.Drawing.Point(13, 13) + Me.ucrSelectorKeys.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectorKeys.Name = "ucrSelectorKeys" + Me.ucrSelectorKeys.Size = New System.Drawing.Size(210, 180) + Me.ucrSelectorKeys.TabIndex = 0 ' - 'ucrChkRemoveKey + 'ucrBase ' - Me.ucrChkRemoveKey.Checked = False - Me.ucrChkRemoveKey.Location = New System.Drawing.Point(269, 79) - Me.ucrChkRemoveKey.Name = "ucrChkRemoveKey" - Me.ucrChkRemoveKey.Size = New System.Drawing.Size(145, 20) - Me.ucrChkRemoveKey.TabIndex = 3 + Me.ucrBase.Location = New System.Drawing.Point(12, 196) + Me.ucrBase.Name = "ucrBase" + Me.ucrBase.Size = New System.Drawing.Size(410, 52) + Me.ucrBase.TabIndex = 4 ' 'dlgViewAndRemoveKeys ' diff --git a/instat/dlgViewAndRemoveKeys.vb b/instat/dlgViewAndRemoveKeys.vb index 0c59eaeb80b..845c558c411 100644 --- a/instat/dlgViewAndRemoveKeys.vb +++ b/instat/dlgViewAndRemoveKeys.vb @@ -14,10 +14,13 @@ ' 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 dlgViewAndRemoveKeys - Public bFirstLoad As Boolean = True + Private bFirstLoad As Boolean = True Private bReset As Boolean = True + Private clsGetKey As New RFunction + Private clsRemoveKey As New RFunction Private Sub dlgViewAndRemoveKeys_Load(sender As Object, e As EventArgs) Handles Me.Load autoTranslate(Me) If bFirstLoad Then @@ -33,29 +36,32 @@ Public Class dlgViewAndRemoveKeys bReset = False End Sub - Private Sub ReopenDialog() + Private Sub ReopenDialog() 'Temporary fixes remove key error on reopen of the dialog ucrSelectorKeys.Reset() End Sub Private Sub SetDefaults() - Dim clsDefaultFunction As New RFunction 'reset ucrSelectorKeys.Reset() - ' ucrChkRemoveKey.Checked = False + clsGetKey = New RFunction + clsRemoveKey = New RFunction ' Set default RFunction as the base function - clsDefaultFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$remove_key") - ucrBase.clsRsyntax.SetBaseRFunction(clsDefaultFunction.Clone()) + clsGetKey.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_keys") + clsRemoveKey.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$remove_key") + ucrBase.clsRsyntax.SetBaseRFunction(clsGetKey) + End Sub - Public Sub SetRCodeForControls(bReset As Boolean) + Private Sub SetRCodeForControls(bReset As Boolean) SetRCode(Me, ucrBase.clsRsyntax.clsBaseFunction, bReset) + ucrChkRemoveKey.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) End Sub Private Sub InitialiseDialog() ucrBase.iHelpTopicID = 505 - ucrChkRemoveKey.Checked = False + ucrBase.clsRsyntax.iCallType = 2 'Setting Receiver ucrReceiverSelectedKey.Selector = ucrSelectorKeys @@ -67,19 +73,21 @@ Public Class dlgViewAndRemoveKeys ucrSelectorKeys.SetParameter(New RParameter("data_name", 0)) ucrSelectorKeys.SetParameterIsString() + ucrChkRemoveKey.AddFunctionNamesCondition(True, frmMain.clsRLink.strInstatDataObject & "$remove_key") + ucrChkRemoveKey.AddFunctionNamesCondition(False, frmMain.clsRLink.strInstatDataObject & "$get_keys") ucrChkRemoveKey.SetText("Remove Key") End Sub Private Sub TestOKEnabled() - If Not ucrReceiverSelectedKey.IsEmpty AndAlso ucrChkRemoveKey.Checked Then + If Not ucrReceiverSelectedKey.IsEmpty Then ucrBase.OKEnabled(True) Else ucrBase.OKEnabled(False) End If End Sub - Private Sub Controls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverSelectedKey.ControlContentsChanged, ucrChkRemoveKey.ControlContentsChanged + Private Sub Controls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverSelectedKey.ControlContentsChanged TestOKEnabled() End Sub @@ -88,4 +96,17 @@ Public Class dlgViewAndRemoveKeys SetRCodeForControls(True) TestOKEnabled() End Sub + + Private Sub ChangeBaseFunc() + If ucrChkRemoveKey.Checked Then + ucrBase.clsRsyntax.SetBaseRFunction(clsRemoveKey) + Else + ucrBase.clsRsyntax.SetBaseRFunction(clsGetKey) + End If + SetRCodeForControls(False) + End Sub + + Private Sub ucrChkRemoveKey_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkRemoveKey.ControlValueChanged + ChangeBaseFunc() + End Sub End Class \ No newline at end of file From d0cc7ec68ba3a37350364623cc33b9a4019fd868 Mon Sep 17 00:00:00 2001 From: steven ndung'u Date: Thu, 23 Feb 2017 17:03:28 +0300 Subject: [PATCH 20/66] receiver location adjustment --- instat/dlgViewAndRemoveKeys.Designer.vb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/instat/dlgViewAndRemoveKeys.Designer.vb b/instat/dlgViewAndRemoveKeys.Designer.vb index cd53de03eb0..8d21e687788 100644 --- a/instat/dlgViewAndRemoveKeys.Designer.vb +++ b/instat/dlgViewAndRemoveKeys.Designer.vb @@ -32,7 +32,7 @@ Partial Class dlgViewAndRemoveKeys 'lblSelectedKey ' Me.lblSelectedKey.AutoSize = True - Me.lblSelectedKey.Location = New System.Drawing.Point(266, 41) + Me.lblSelectedKey.Location = New System.Drawing.Point(266, 46) Me.lblSelectedKey.Name = "lblSelectedKey" Me.lblSelectedKey.Size = New System.Drawing.Size(73, 13) Me.lblSelectedKey.TabIndex = 1 @@ -41,7 +41,7 @@ Partial Class dlgViewAndRemoveKeys 'ucrChkRemoveKey ' Me.ucrChkRemoveKey.Checked = False - Me.ucrChkRemoveKey.Location = New System.Drawing.Point(269, 82) + Me.ucrChkRemoveKey.Location = New System.Drawing.Point(269, 83) Me.ucrChkRemoveKey.Name = "ucrChkRemoveKey" Me.ucrChkRemoveKey.Size = New System.Drawing.Size(145, 20) Me.ucrChkRemoveKey.TabIndex = 4 @@ -49,7 +49,7 @@ Partial Class dlgViewAndRemoveKeys 'ucrReceiverSelectedKey ' Me.ucrReceiverSelectedKey.frmParent = Me - Me.ucrReceiverSelectedKey.Location = New System.Drawing.Point(269, 56) + Me.ucrReceiverSelectedKey.Location = New System.Drawing.Point(269, 60) Me.ucrReceiverSelectedKey.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverSelectedKey.Name = "ucrReceiverSelectedKey" Me.ucrReceiverSelectedKey.Selector = Nothing @@ -60,7 +60,7 @@ Partial Class dlgViewAndRemoveKeys ' Me.ucrSelectorKeys.bShowHiddenColumns = False Me.ucrSelectorKeys.bUseCurrentFilter = True - Me.ucrSelectorKeys.Location = New System.Drawing.Point(13, 13) + Me.ucrSelectorKeys.Location = New System.Drawing.Point(10, 10) Me.ucrSelectorKeys.Margin = New System.Windows.Forms.Padding(0) Me.ucrSelectorKeys.Name = "ucrSelectorKeys" Me.ucrSelectorKeys.Size = New System.Drawing.Size(210, 180) @@ -68,7 +68,7 @@ Partial Class dlgViewAndRemoveKeys ' 'ucrBase ' - Me.ucrBase.Location = New System.Drawing.Point(12, 196) + Me.ucrBase.Location = New System.Drawing.Point(10, 203) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(410, 52) Me.ucrBase.TabIndex = 4 @@ -77,7 +77,7 @@ Partial Class dlgViewAndRemoveKeys ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(423, 253) + Me.ClientSize = New System.Drawing.Size(423, 260) Me.Controls.Add(Me.ucrChkRemoveKey) Me.Controls.Add(Me.lblSelectedKey) Me.Controls.Add(Me.ucrReceiverSelectedKey) From a735ce6b40b750bff82a620367a523d11441b519 Mon Sep 17 00:00:00 2001 From: steven ndung'u Date: Thu, 23 Feb 2017 17:06:10 +0300 Subject: [PATCH 21/66] tidying code --- instat/dlgViewAndRemoveKeys.vb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/instat/dlgViewAndRemoveKeys.vb b/instat/dlgViewAndRemoveKeys.vb index 845c558c411..c45b204c1e2 100644 --- a/instat/dlgViewAndRemoveKeys.vb +++ b/instat/dlgViewAndRemoveKeys.vb @@ -14,7 +14,6 @@ ' 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 dlgViewAndRemoveKeys Private bFirstLoad As Boolean = True @@ -97,7 +96,7 @@ Public Class dlgViewAndRemoveKeys TestOKEnabled() End Sub - Private Sub ChangeBaseFunc() + Private Sub ucrChkRemoveKey_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkRemoveKey.ControlValueChanged If ucrChkRemoveKey.Checked Then ucrBase.clsRsyntax.SetBaseRFunction(clsRemoveKey) Else @@ -105,8 +104,4 @@ Public Class dlgViewAndRemoveKeys End If SetRCodeForControls(False) End Sub - - Private Sub ucrChkRemoveKey_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkRemoveKey.ControlValueChanged - ChangeBaseFunc() - End Sub End Class \ No newline at end of file From d113abbb0c193285d48b19079cd23cc103c5cec5 Mon Sep 17 00:00:00 2001 From: steven ndung'u Date: Wed, 1 Mar 2017 17:10:50 +0300 Subject: [PATCH 22/66] deleting a line of code --- instat/dlgViewAndRemoveKeys.vb | 1 - 1 file changed, 1 deletion(-) diff --git a/instat/dlgViewAndRemoveKeys.vb b/instat/dlgViewAndRemoveKeys.vb index c45b204c1e2..ecfbb9e6d48 100644 --- a/instat/dlgViewAndRemoveKeys.vb +++ b/instat/dlgViewAndRemoveKeys.vb @@ -54,7 +54,6 @@ Public Class dlgViewAndRemoveKeys Private Sub SetRCodeForControls(bReset As Boolean) SetRCode(Me, ucrBase.clsRsyntax.clsBaseFunction, bReset) - ucrChkRemoveKey.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) End Sub Private Sub InitialiseDialog() From bc14bf2dc00522c2898e52f7812b39ca64cab81a Mon Sep 17 00:00:00 2001 From: maxwell fundi Date: Thu, 2 Mar 2017 10:04:41 +0300 Subject: [PATCH 23/66] Initial RugPlot updating --- instat/dlgRugPlot.Designer.vb | 28 +++-- instat/dlgRugPlot.vb | 153 +++++++++++------------- instat/ucrVariablesAsFactor.Designer.vb | 2 +- 3 files changed, 86 insertions(+), 97 deletions(-) diff --git a/instat/dlgRugPlot.Designer.vb b/instat/dlgRugPlot.Designer.vb index c42df8a65e4..8ab304ca633 100644 --- a/instat/dlgRugPlot.Designer.vb +++ b/instat/dlgRugPlot.Designer.vb @@ -22,7 +22,6 @@ Partial Class dlgRugPlot 'Do not modify it using the code editor. Private Sub InitializeComponent() - Me.ucrSaveRugPlot = New instat.ucrSaveGraph() Me.cmdOptions = New System.Windows.Forms.Button() Me.cmdRugPlotOptions = New System.Windows.Forms.Button() Me.ucrRugPlotSelector = New instat.ucrSelectorByDataFrameAddRemove() @@ -32,15 +31,9 @@ Partial Class dlgRugPlot Me.lblFactorOptional = New System.Windows.Forms.Label() Me.ucrReceiverX = New instat.ucrReceiverSingle() Me.lblXVariable = New System.Windows.Forms.Label() + Me.ucrSaveGraph = New instat.ucrSave() Me.SuspendLayout() ' - 'ucrSaveRugPlot - ' - Me.ucrSaveRugPlot.Location = New System.Drawing.Point(10, 264) - Me.ucrSaveRugPlot.Name = "ucrSaveRugPlot" - Me.ucrSaveRugPlot.Size = New System.Drawing.Size(265, 20) - Me.ucrSaveRugPlot.TabIndex = 18 - ' 'cmdOptions ' Me.cmdOptions.Location = New System.Drawing.Point(10, 233) @@ -73,9 +66,9 @@ Partial Class dlgRugPlot ' 'ucrBase ' - Me.ucrBase.Location = New System.Drawing.Point(10, 290) + Me.ucrBase.Location = New System.Drawing.Point(10, 308) Me.ucrBase.Name = "ucrBase" - Me.ucrBase.Size = New System.Drawing.Size(410, 52) + Me.ucrBase.Size = New System.Drawing.Size(410, 58) Me.ucrBase.TabIndex = 17 ' 'ucrVariablesAsFactorForRugPlot @@ -88,6 +81,7 @@ Partial Class dlgRugPlot ' 'ucrFactorOptionalReceiver ' + Me.ucrFactorOptionalReceiver.frmParent = Me Me.ucrFactorOptionalReceiver.Location = New System.Drawing.Point(273, 238) Me.ucrFactorOptionalReceiver.Margin = New System.Windows.Forms.Padding(0) Me.ucrFactorOptionalReceiver.Name = "ucrFactorOptionalReceiver" @@ -107,6 +101,7 @@ Partial Class dlgRugPlot ' 'ucrReceiverX ' + Me.ucrReceiverX.frmParent = Me Me.ucrReceiverX.Location = New System.Drawing.Point(273, 197) Me.ucrReceiverX.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverX.Name = "ucrReceiverX" @@ -124,17 +119,24 @@ Partial Class dlgRugPlot Me.lblXVariable.Tag = "X_Variable:" Me.lblXVariable.Text = "X Variable:" ' + 'ucrSaveGraph + ' + Me.ucrSaveGraph.Location = New System.Drawing.Point(13, 278) + Me.ucrSaveGraph.Name = "ucrSaveGraph" + Me.ucrSaveGraph.Size = New System.Drawing.Size(258, 24) + Me.ucrSaveGraph.TabIndex = 24 + ' 'dlgRugPlot ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(419, 349) + Me.ClientSize = New System.Drawing.Size(433, 364) + Me.Controls.Add(Me.ucrSaveGraph) Me.Controls.Add(Me.ucrVariablesAsFactorForRugPlot) Me.Controls.Add(Me.ucrFactorOptionalReceiver) Me.Controls.Add(Me.lblFactorOptional) Me.Controls.Add(Me.ucrReceiverX) Me.Controls.Add(Me.lblXVariable) - Me.Controls.Add(Me.ucrSaveRugPlot) Me.Controls.Add(Me.cmdOptions) Me.Controls.Add(Me.cmdRugPlotOptions) Me.Controls.Add(Me.ucrRugPlotSelector) @@ -149,7 +151,6 @@ Partial Class dlgRugPlot Me.PerformLayout() End Sub - Friend WithEvents ucrSaveRugPlot As ucrSaveGraph Friend WithEvents cmdOptions As Button Friend WithEvents cmdRugPlotOptions As Button Friend WithEvents ucrRugPlotSelector As ucrSelectorByDataFrameAddRemove @@ -159,4 +160,5 @@ Partial Class dlgRugPlot Friend WithEvents lblFactorOptional As Label Friend WithEvents ucrReceiverX As ucrReceiverSingle Friend WithEvents lblXVariable As Label + Friend WithEvents ucrSaveGraph As ucrSave End Class diff --git a/instat/dlgRugPlot.vb b/instat/dlgRugPlot.vb index 172436c8cef..f42e9b9c390 100644 --- a/instat/dlgRugPlot.vb +++ b/instat/dlgRugPlot.vb @@ -16,136 +16,123 @@ ' along with this program. If not, see . Imports instat.Translations Public Class dlgRugPlot - Private clsRggplotFunction As New RFunction + Private clsDefaultFunction As New RFunction Private clsRgeom_RugPlotFunction As New RFunction Private clsRaesFunction As New RFunction Private bFirstLoad As Boolean = True + Private bReset As Boolean = True Private Sub dlgRugPlot_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstLoad Then InitialiseDialog() - SetDefaults() bFirstLoad = False End If - autoTranslate(Me) - 'TestOkEnabled() - 'this is already done in SetDefaults ! - End Sub - Private Sub ucrRugPlotSelector_DataFrameChanged() Handles ucrRugPlotSelector.DataFrameChanged - clsRggplotFunction.AddParameter("data", clsRFunctionParameter:=ucrRugPlotSelector.ucrAvailableDataFrames.clsCurrDataFrame) - End Sub - - Private Sub ucrReceiverX_SelectionChanged(sender As Object, e As EventArgs) Handles ucrReceiverX.SelectionChanged - - If Not ucrReceiverX.IsEmpty Then - clsRaesFunction.AddParameter("x", ucrReceiverX.GetVariableNames(False)) - Else - clsRaesFunction.RemoveParameterByName("x") + If bReset Then + SetDefaults() End If + + SetRCodeForControls(bReset) + bReset = False + autoTranslate(Me) TestOkEnabled() End Sub - Private Sub ucrFactorOptionalReceiver_SelectionChanged(sender As Object, e As EventArgs) Handles ucrFactorOptionalReceiver.SelectionChanged - If Not ucrFactorOptionalReceiver.IsEmpty Then - clsRaesFunction.AddParameter("colour", ucrFactorOptionalReceiver.GetVariableNames(False)) - Else - clsRaesFunction.RemoveParameterByName("colour") - End If + Private Sub SetRCodeForControls(bReset As Boolean) + ucrSaveGraph.SetRCode(clsDefaultFunction, bReset) + ucrRugPlotSelector.SetRCode(clsDefaultFunction, bReset) + + ucrReceiverX.SetRCode(clsRaesFunction, bReset) + ucrFactorOptionalReceiver.SetRCode(clsRaesFunction, bReset) + ucrVariablesAsFactorForRugPlot.SetRCode(clsRaesFunction, bReset) + End Sub Private Sub TestOkEnabled() - 'tests when okay Is enable - If (ucrReceiverX.IsEmpty() AndAlso ucrVariablesAsFactorForRugPlot.IsEmpty) OrElse (ucrSaveRugPlot.chkSaveGraph.Checked AndAlso ucrSaveRugPlot.ucrInputGraphName.IsEmpty) Then - ucrBase.OKEnabled(False) - Else - ucrBase.OKEnabled(True) - End If + ''tests when okay Is enable + 'If (ucrReceiverX.IsEmpty() AndAlso ucrVariablesAsFactorForRugPlot.IsEmpty) OrElse Not ucrSaveGraph.IsComplete Then + ' ucrBase.OKEnabled(False) + 'Else + ' ucrBase.OKEnabled(True) + 'End If End Sub Private Sub InitialiseDialog() - ucrBase.clsRsyntax.SetOperation("+") - clsRggplotFunction.SetRCommand("ggplot") - clsRaesFunction.SetRCommand("aes") - clsRggplotFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesFunction) - ucrBase.clsRsyntax.SetOperatorParameter(True, clsRFunc:=clsRggplotFunction) + ucrBase.iHelpTopicID = 476 + ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False + ucrBase.clsRsyntax.iCallType = 3 - clsRgeom_RugPlotFunction.SetRCommand("geom_rug") - ucrBase.clsRsyntax.SetOperatorParameter(False, clsRFunc:=clsRgeom_RugPlotFunction) + ucrRugPlotSelector.SetParameter(New RParameter("data", 0)) ucrVariablesAsFactorForRugPlot.SetFactorReceiver(ucrFactorOptionalReceiver) ucrVariablesAsFactorForRugPlot.SetSelector(ucrRugPlotSelector) ucrVariablesAsFactorForRugPlot.SetIncludedDataType({"factor", "numeric"}) + ucrVariablesAsFactorForRugPlot.SetParameter(New RParameter("y")) ucrReceiverX.Selector = ucrRugPlotSelector ucrReceiverX.SetIncludedDataTypes({"factor", "numeric"}) - ucrFactorOptionalReceiver.Selector = ucrRugPlotSelector - ucrFactorOptionalReceiver.SetIncludedDataTypes({"factor", "numeric"}) - - sdgPlots.SetRSyntax(ucrBase.clsRsyntax) - 'should the sdgLayerOptions be linked here as well ? Apparently yes ? - ucrBase.iHelpTopicID = 476 + ucrReceiverX.SetParameter(New RParameter("x")) - ucrSaveRugPlot.SetDataFrameSelector(ucrRugPlotSelector.ucrAvailableDataFrames) - ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False - ucrBase.clsRsyntax.iCallType = 3 - + ucrFactorOptionalReceiver.Selector = ucrRugPlotSelector + ucrFactorOptionalReceiver.SetIncludedDataTypes({"factor", "numeric"}) + ucrFactorOptionalReceiver.SetParameter(New RParameter("colour")) + + ucrSaveGraph.SetPrefix("Rug") + ucrSaveGraph.SetSaveTypeAsGraph() + ucrSaveGraph.SetIsComboBox() + ucrSaveGraph.SetCheckBoxText("Save graph") + ucrSaveGraph.SetDataFrameSelector(ucrRugPlotSelector.ucrAvailableDataFrames) + ucrSaveGraph.SetAssignToIfUncheckedValue("last_graph") End Sub Private Sub SetDefaults() - clsRaesFunction.ClearParameters() - clsRgeom_RugPlotFunction.ClearParameters() + clsDefaultFunction = New RFunction + clsRaesFunction = New RFunction + clsRgeom_RugPlotFunction = New RFunction + ucrRugPlotSelector.Reset() - ucrRugPlotSelector.Focus() + ucrSaveGraph.Reset() ucrVariablesAsFactorForRugPlot.ResetControl() - ucrSaveRugPlot.strPrefix = "Rug" - sdgPlots.Reset() - TestOkEnabled() + + ucrBase.clsRsyntax.SetOperation("+") + clsDefaultFunction.SetRCommand("ggplot") + clsRaesFunction.SetRCommand("aes") + clsDefaultFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesFunction) + ucrBase.clsRsyntax.SetOperatorParameter(True, clsRFunc:=clsDefaultFunction) + + + ucrBase.clsRsyntax.SetOperatorParameter(False, clsRFunc:=clsRgeom_RugPlotFunction) + ucrBase.clsRsyntax.SetBaseRFunction(clsDefaultFunction) + End Sub Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset SetDefaults() + SetRCodeForControls(True) + TestOkEnabled() End Sub Private Sub cmdOptions_Click(sender As Object, e As EventArgs) Handles cmdOptions.Click sdgPlots.SetDataFrame(strNewDataFrame:=ucrRugPlotSelector.ucrAvailableDataFrames.cboAvailableDataFrames.Text) sdgPlots.ShowDialog() End Sub + Private Sub cmdRugPlotOptions_Click(sender As Object, e As EventArgs) Handles cmdRugPlotOptions.Click - Private Sub ucrVariablesAsFactor_SelectionChanged() Handles ucrVariablesAsFactorForRugPlot.SelectionChanged - If Not ucrVariablesAsFactorForRugPlot.IsEmpty Then - clsRaesFunction.AddParameter("y", ucrVariablesAsFactorForRugPlot.GetVariableNames(False)) - Else - clsRaesFunction.RemoveParameterByName("y") - End If - TestOkEnabled() - End Sub - Private Sub cmdRugPlotOptions_Click(sender As Object, e As EventArgs) Handles cmdRugPlotOptions.Click - sdgLayerOptions.SetupLayer(clsTempGgPlot:=clsRggplotFunction, clsTempGeomFunc:=clsRgeom_RugPlotFunction, clsTempAesFunc:=clsRaesFunction, bFixAes:=True, bFixGeom:=True, strDataframe:=ucrRugPlotSelector.ucrAvailableDataFrames.cboAvailableDataFrames.Text, bApplyAesGlobally:=True, bIgnoreGlobalAes:=False) - sdgLayerOptions.ShowDialog() - - For Each clsParam In clsRaesFunction.clsParameters - If clsParam.strArgumentName = "y" AndAlso (clsParam.strArgumentValue <> "value" OrElse ucrVariablesAsFactorForRugPlot.bSingleVariable) Then - ucrVariablesAsFactorForRugPlot.Add(clsParam.strArgumentValue) - ElseIf clsParam.strArgumentName = "x" Then - ucrReceiverX.Add(clsParam.strArgumentValue) - ElseIf clsParam.strArgumentName = "colour" Then - ucrFactorOptionalReceiver.Add(clsParam.strArgumentValue) - End If - Next - End Sub + ''''''' i wonder if all this will be needed for the new system - Private Sub ucrSaveScatterPlot_GraphNameChanged() Handles ucrSaveRugPlot.GraphNameChanged, ucrSaveRugPlot.SaveGraphCheckedChanged - If ucrSaveRugPlot.bSaveGraph Then - ucrBase.clsRsyntax.SetAssignTo(ucrSaveRugPlot.strGraphName, strTempDataframe:=ucrRugPlotSelector.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:=ucrSaveRugPlot.strGraphName) - Else - ucrBase.clsRsyntax.SetAssignTo("last_graph", strTempDataframe:=ucrRugPlotSelector.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") - End If - TestOkEnabled() - End Sub + 'sdgLayerOptions.SetupLayer(clsTempGgPlot:=clsRDefaultggplotFunction, clsTempGeomFunc:=clsRgeom_RugPlotFunction, clsTempAesFunc:=clsRaesFunction, bFixAes:=True, bFixGeom:=True, strDataframe:=ucrRugPlotSelector.ucrAvailableDataFrames.cboAvailableDataFrames.Text, bApplyAesGlobally:=True, bIgnoreGlobalAes:=False) + 'sdgLayerOptions.ShowDialog() - Private Sub ucrSaveRugPlot_ContentsChanged() Handles ucrSaveRugPlot.ContentsChanged - TestOkEnabled() + 'For Each clsParam In clsRaesFunction.clsParameters + ' If clsParam.strArgumentName = "y" AndAlso (clsParam.strArgumentValue <> "value" OrElse ucrVariablesAsFactorForRugPlot.bSingleVariable) Then + ' ucrVariablesAsFactorForRugPlot.Add(clsParam.strArgumentValue) + ' ElseIf clsParam.strArgumentName = "x" Then + ' ucrReceiverX.Add(clsParam.strArgumentValue) + ' ElseIf clsParam.strArgumentName = "colour" Then + ' ucrFactorOptionalReceiver.Add(clsParam.strArgumentValue) + ' End If + 'Next End Sub + End Class \ No newline at end of file diff --git a/instat/ucrVariablesAsFactor.Designer.vb b/instat/ucrVariablesAsFactor.Designer.vb index 7fddda82684..05556c41a89 100644 --- a/instat/ucrVariablesAsFactor.Designer.vb +++ b/instat/ucrVariablesAsFactor.Designer.vb @@ -1,6 +1,6 @@  _ Partial Class ucrVariablesAsFactor - Inherits System.Windows.Forms.UserControl + Inherits ucrCore 'UserControl overrides dispose to clean up the component list. _ From 89c6c7eed419958f7828db887b0156a0b76776b5 Mon Sep 17 00:00:00 2001 From: Alex Sananka Date: Fri, 3 Mar 2017 11:30:03 +0300 Subject: [PATCH 24/66] Permute Column New Implementation. --- instat/dlgPermuteColumn.vb | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/instat/dlgPermuteColumn.vb b/instat/dlgPermuteColumn.vb index 01a4d8ac47d..dfb324a1557 100644 --- a/instat/dlgPermuteColumn.vb +++ b/instat/dlgPermuteColumn.vb @@ -16,7 +16,7 @@ Imports instat.Translations Public Class dlgPermuteColumn - Private clsSetSampleFunc, clsSetSeedFunc, clsOverallFunction As New RFunction + Private clsSetSampleFunction, clsSetSeedFunction, clsOverallFunction As New RFunction Private bFirstLoad As Boolean = True Private bReset As Boolean = True @@ -36,28 +36,27 @@ Public Class dlgPermuteColumn Public Sub SetRCodeForControls(bReset As Boolean) ucrNudNumberofColumns.SetRCode(clsOverallFunction, bReset) - ucrReceiverPermuteRows.SetRCode(clsSetSampleFunc, bReset) - ucrNudSetSeed.SetRCode(clsSetSeedFunc, bReset) - ucrChkSetSeed.SetRCode(clsSetSeedFunc, bReset) + ucrReceiverPermuteRows.SetRCode(clsSetSampleFunction, bReset) + ucrNudSetSeed.SetRCode(clsSetSeedFunction, bReset) + ucrChkSetSeed.SetRCode(clsSetSeedFunction, bReset) ucrSavePermute.SetRCode(clsOverallFunction, bReset) End Sub Public Sub SetDefaults() - Dim clsDefaultFunction, clsDefaultSample, clsDefaultSetSeed As New RFunction + clsSetSeedFunction = New RFunction + clsSetSampleFunction = New RFunction + clsOverallFunction = New RFunction ucrPermuteRowsSelector.Reset() ucrSavePermute.Reset() SetNewColumName() - clsDefaultSample.SetRCommand("sample") - clsDefaultSample.AddParameter("replace", "FALSE") - clsDefaultSample.AddParameter("size", ucrPermuteRowsSelector.ucrAvailableDataFrames.iDataFrameLength) - clsDefaultSetSeed.SetRCommand("set.seed") - clsDefaultSetSeed.AddParameter("seed", 5) - clsDefaultFunction.SetRCommand("replicate") - ucrChkSetSeed.Checked = False - clsSetSeedFunc = clsDefaultSetSeed.Clone - clsSetSampleFunc = clsDefaultSample.Clone - clsOverallFunction = clsDefaultFunction.Clone - clsOverallFunction.AddParameter("expr", clsRFunctionParameter:=clsSetSampleFunc) + clsSetSampleFunction.SetRCommand("sample") + clsSetSampleFunction.AddParameter("replace", "FALSE") + clsSetSampleFunction.AddParameter("size", ucrPermuteRowsSelector.ucrAvailableDataFrames.iDataFrameLength) + clsSetSeedFunction.SetRCommand("set.seed") + clsSetSeedFunction.AddParameter("seed", 5) + clsOverallFunction.SetRCommand("replicate") + + clsOverallFunction.AddParameter("expr", clsRFunctionParameter:=clsSetSampleFunction) clsOverallFunction.AddParameter("n", 1) ucrBase.clsRsyntax.SetBaseRFunction(clsOverallFunction) ucrBase.clsRsyntax.SetAssignTo(strAssignToName:=ucrSavePermute.GetText, strTempDataframe:=ucrPermuteRowsSelector.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempColumn:=ucrSavePermute.GetText, bAssignToIsPrefix:=True) @@ -68,12 +67,12 @@ Public Class dlgPermuteColumn ucrBase.iHelpTopicID = 66 ucrReceiverPermuteRows.Selector = ucrPermuteRowsSelector ucrReceiverPermuteRows.SetMeAsReceiver() + ucrChkSetSeed.AddFunctionNamesCondition(False, "set.seed") ucrPermuteRowsSelector.ucrAvailableDataFrames.SetParameter(New RParameter("size", 1)) ucrPermuteRowsSelector.SetParameterIsrfunction() ucrReceiverPermuteRows.bUseFilteredData = False ucrReceiverPermuteRows.SetParameter(New RParameter("x", 0)) ucrReceiverPermuteRows.SetParameterIsRFunction() - ucrNudNumberofColumns.SetParameter(New RParameter("n", 1)) ucrNudNumberofColumns.Maximum = Integer.MaxValue ucrNudNumberofColumns.Minimum = 1 @@ -82,7 +81,6 @@ Public Class dlgPermuteColumn ucrChkSetSeed.SetText("Set Seed") ucrNudSetSeed.SetParameter(New RParameter("seed", 0)) ucrNudSetSeed.Maximum = Integer.MaxValue - ucrSavePermute.SetSaveTypeAsColumn() ucrSavePermute.SetDataFrameSelector(ucrPermuteRowsSelector.ucrAvailableDataFrames) ucrSavePermute.SetIsComboBox() @@ -109,7 +107,7 @@ Public Class dlgPermuteColumn Private Sub ucrBase_BeforeClickOk(sender As Object, e As EventArgs) Handles ucrBase.BeforeClickOk If ucrChkSetSeed.Checked Then - frmMain.clsRLink.RunScript(clsSetSeedFunc.ToScript, strComment:="dlgPermuteColumn:Setting the seed for the random generator") + frmMain.clsRLink.RunScript(clsSetSeedFunction.ToScript, strComment:="dlgPermuteColumn:Setting the seed for the random generator") End If End Sub @@ -131,7 +129,7 @@ Public Class dlgPermuteColumn End Sub Private Sub DataFrameLength() - clsSetSampleFunc.AddParameter("size", ucrPermuteRowsSelector.ucrAvailableDataFrames.iDataFrameLength) + clsSetSampleFunction.AddParameter("size", ucrPermuteRowsSelector.ucrAvailableDataFrames.iDataFrameLength) End Sub Private Sub ucrPermuteRowsSelector_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPermuteRowsSelector.ControlValueChanged From 62cc943e2a1ab18e54677f7fe6c4ab775495c800 Mon Sep 17 00:00:00 2001 From: maxwell fundi Date: Sat, 4 Mar 2017 08:35:47 +0300 Subject: [PATCH 25/66] Messy edits --- instat/dlgRugPlot.vb | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/instat/dlgRugPlot.vb b/instat/dlgRugPlot.vb index f42e9b9c390..1b3957f5005 100644 --- a/instat/dlgRugPlot.vb +++ b/instat/dlgRugPlot.vb @@ -63,20 +63,24 @@ Public Class dlgRugPlot ucrBase.clsRsyntax.iCallType = 3 ucrRugPlotSelector.SetParameter(New RParameter("data", 0)) + ucrRugPlotSelector.SetParameterIsrfunction() ucrVariablesAsFactorForRugPlot.SetFactorReceiver(ucrFactorOptionalReceiver) ucrVariablesAsFactorForRugPlot.SetSelector(ucrRugPlotSelector) ucrVariablesAsFactorForRugPlot.SetIncludedDataType({"factor", "numeric"}) ucrVariablesAsFactorForRugPlot.SetParameter(New RParameter("y")) + ' ucrVariablesAsFactorForRugPlot.SetParameterIsRFunction() ucrReceiverX.Selector = ucrRugPlotSelector ucrReceiverX.SetIncludedDataTypes({"factor", "numeric"}) ucrReceiverX.SetParameter(New RParameter("x")) + ucrReceiverX.SetParameterIsRFunction() ucrFactorOptionalReceiver.Selector = ucrRugPlotSelector ucrFactorOptionalReceiver.SetIncludedDataTypes({"factor", "numeric"}) ucrFactorOptionalReceiver.SetParameter(New RParameter("colour")) + ucrFactorOptionalReceiver.SetParameterIsRFunction() ucrSaveGraph.SetPrefix("Rug") ucrSaveGraph.SetSaveTypeAsGraph() @@ -84,6 +88,7 @@ Public Class dlgRugPlot ucrSaveGraph.SetCheckBoxText("Save graph") ucrSaveGraph.SetDataFrameSelector(ucrRugPlotSelector.ucrAvailableDataFrames) ucrSaveGraph.SetAssignToIfUncheckedValue("last_graph") + End Sub Private Sub SetDefaults() clsDefaultFunction = New RFunction @@ -93,17 +98,16 @@ Public Class dlgRugPlot ucrRugPlotSelector.Reset() ucrSaveGraph.Reset() ucrVariablesAsFactorForRugPlot.ResetControl() - ucrBase.clsRsyntax.SetOperation("+") clsDefaultFunction.SetRCommand("ggplot") + clsRgeom_RugPlotFunction.SetRCommand("geom_rug") clsRaesFunction.SetRCommand("aes") clsDefaultFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesFunction) - ucrBase.clsRsyntax.SetOperatorParameter(True, clsRFunc:=clsDefaultFunction) - - + ' clsGeomOp.AddParameter(iPosition:=5, clsRFunctionParameter:=clsRgeom_RugPlotFunction) ucrBase.clsRsyntax.SetOperatorParameter(False, clsRFunc:=clsRgeom_RugPlotFunction) - ucrBase.clsRsyntax.SetBaseRFunction(clsDefaultFunction) + clsDefaultFunction.SetAssignTo("last_graph", strTempDataframe:=ucrRugPlotSelector.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") + ucrBase.clsRsyntax.SetBaseRFunction(clsDefaultFunction) End Sub Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset @@ -118,7 +122,6 @@ Public Class dlgRugPlot End Sub Private Sub cmdRugPlotOptions_Click(sender As Object, e As EventArgs) Handles cmdRugPlotOptions.Click - ''''''' i wonder if all this will be needed for the new system 'sdgLayerOptions.SetupLayer(clsTempGgPlot:=clsRDefaultggplotFunction, clsTempGeomFunc:=clsRgeom_RugPlotFunction, clsTempAesFunc:=clsRaesFunction, bFixAes:=True, bFixGeom:=True, strDataframe:=ucrRugPlotSelector.ucrAvailableDataFrames.cboAvailableDataFrames.Text, bApplyAesGlobally:=True, bIgnoreGlobalAes:=False) From 139141a45182e12d06597c91f47ded75a08bbc57 Mon Sep 17 00:00:00 2001 From: steven ndung'u Date: Mon, 20 Mar 2017 15:07:36 +0300 Subject: [PATCH 26/66] amendments on design --- instat/dlgOneWayFrequencies.Designer.vb | 64 ++++++++++--------------- instat/dlgOneWayFrequencies.vb | 39 ++++++++------- 2 files changed, 47 insertions(+), 56 deletions(-) diff --git a/instat/dlgOneWayFrequencies.Designer.vb b/instat/dlgOneWayFrequencies.Designer.vb index 0903832ec20..e733a43fa19 100644 --- a/instat/dlgOneWayFrequencies.Designer.vb +++ b/instat/dlgOneWayFrequencies.Designer.vb @@ -29,15 +29,14 @@ Partial Class dlgOneWayFrequencies Me.ucrPnlSort = New instat.UcrPanel() Me.cmdOptions = New System.Windows.Forms.Button() Me.lblSelectedVariable = New System.Windows.Forms.Label() - Me.rdoGraph = New System.Windows.Forms.RadioButton() - Me.rdoTable = New System.Windows.Forms.RadioButton() Me.ucrReceiverWeights = New instat.ucrReceiverSingle() - Me.ucrPnlFreqDisplay = New instat.UcrPanel() Me.ucrChkWeights = New instat.ucrCheck() Me.ucrChkFlip = New instat.ucrCheck() Me.ucrBase = New instat.ucrButtons() Me.ucrReceiverOneWayFreq = New instat.ucrReceiverSingle() Me.ucrSelectorOneWayFreq = New instat.ucrSelectorByDataFrameAddRemove() + Me.ucrChkGraph = New instat.ucrCheck() + Me.ucrChkTable = New instat.ucrCheck() Me.grpSort.SuspendLayout() Me.SuspendLayout() ' @@ -112,28 +111,6 @@ Partial Class dlgOneWayFrequencies Me.lblSelectedVariable.TabIndex = 1 Me.lblSelectedVariable.Text = "Selected Variable:" ' - 'rdoGraph - ' - Me.rdoGraph.AutoSize = True - Me.rdoGraph.Location = New System.Drawing.Point(10, 279) - Me.rdoGraph.Name = "rdoGraph" - Me.rdoGraph.Size = New System.Drawing.Size(54, 17) - Me.rdoGraph.TabIndex = 9 - Me.rdoGraph.TabStop = True - Me.rdoGraph.Text = "Graph" - Me.rdoGraph.UseVisualStyleBackColor = True - ' - 'rdoTable - ' - Me.rdoTable.AutoSize = True - Me.rdoTable.Location = New System.Drawing.Point(10, 257) - Me.rdoTable.Name = "rdoTable" - Me.rdoTable.Size = New System.Drawing.Size(52, 17) - Me.rdoTable.TabIndex = 8 - Me.rdoTable.TabStop = True - Me.rdoTable.Text = "Table" - Me.rdoTable.UseVisualStyleBackColor = True - ' 'ucrReceiverWeights ' Me.ucrReceiverWeights.frmParent = Me @@ -144,13 +121,6 @@ Partial Class dlgOneWayFrequencies Me.ucrReceiverWeights.Size = New System.Drawing.Size(120, 20) Me.ucrReceiverWeights.TabIndex = 5 ' - 'ucrPnlFreqDisplay - ' - Me.ucrPnlFreqDisplay.Location = New System.Drawing.Point(2, 252) - Me.ucrPnlFreqDisplay.Name = "ucrPnlFreqDisplay" - Me.ucrPnlFreqDisplay.Size = New System.Drawing.Size(91, 49) - Me.ucrPnlFreqDisplay.TabIndex = 4 - ' 'ucrChkWeights ' Me.ucrChkWeights.Checked = False @@ -162,14 +132,14 @@ Partial Class dlgOneWayFrequencies 'ucrChkFlip ' Me.ucrChkFlip.Checked = False - Me.ucrChkFlip.Location = New System.Drawing.Point(10, 231) + Me.ucrChkFlip.Location = New System.Drawing.Point(10, 227) Me.ucrChkFlip.Name = "ucrChkFlip" Me.ucrChkFlip.Size = New System.Drawing.Size(145, 20) Me.ucrChkFlip.TabIndex = 7 ' 'ucrBase ' - Me.ucrBase.Location = New System.Drawing.Point(10, 302) + Me.ucrBase.Location = New System.Drawing.Point(10, 299) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(410, 52) Me.ucrBase.TabIndex = 11 @@ -194,15 +164,30 @@ Partial Class dlgOneWayFrequencies Me.ucrSelectorOneWayFreq.Size = New System.Drawing.Size(210, 180) Me.ucrSelectorOneWayFreq.TabIndex = 0 ' + 'ucrChkGraph + ' + Me.ucrChkGraph.Checked = False + Me.ucrChkGraph.Location = New System.Drawing.Point(10, 271) + 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, 249) + Me.ucrChkTable.Name = "ucrChkTable" + Me.ucrChkTable.Size = New System.Drawing.Size(145, 20) + Me.ucrChkTable.TabIndex = 13 + ' '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, 360) - Me.Controls.Add(Me.rdoGraph) + Me.Controls.Add(Me.ucrChkTable) + Me.Controls.Add(Me.ucrChkGraph) Me.Controls.Add(Me.ucrReceiverWeights) - Me.Controls.Add(Me.rdoTable) - Me.Controls.Add(Me.ucrPnlFreqDisplay) Me.Controls.Add(Me.ucrChkWeights) Me.Controls.Add(Me.ucrChkFlip) Me.Controls.Add(Me.lblSelectedVariable) @@ -237,7 +222,6 @@ Partial Class dlgOneWayFrequencies Friend WithEvents ucrChkFlip As ucrCheck Friend WithEvents ucrReceiverWeights As ucrReceiverSingle Friend WithEvents ucrChkWeights As ucrCheck - Friend WithEvents rdoGraph As RadioButton - Friend WithEvents rdoTable As RadioButton - Friend WithEvents ucrPnlFreqDisplay As UcrPanel + Friend WithEvents ucrChkTable As ucrCheck + Friend WithEvents ucrChkGraph As ucrCheck End Class diff --git a/instat/dlgOneWayFrequencies.vb b/instat/dlgOneWayFrequencies.vb index a55c810fd05..47d6eeee5f2 100644 --- a/instat/dlgOneWayFrequencies.vb +++ b/instat/dlgOneWayFrequencies.vb @@ -33,12 +33,14 @@ Public Class dlgOneWayFrequencies End If SetRCodeForControls(bReset) bReset = False + TestOkEnabled() End Sub Public Sub SetRCodeForControls(bReset As Boolean) ucrReceiverOneWayFreq.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrReceiverWeights.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - ucrPnlFreqDisplay.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + ucrChkGraph.SetRCode(clsSjpFrq, bReset) + ucrChkTable.SetRCode(clsSjtFreq, bReset) ucrChkWeights.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrPnlSort.SetRCode(clsSjtFreq, bReset) @@ -66,23 +68,22 @@ Public Class dlgOneWayFrequencies ucrPnlSort.AddRadioButton(rdoDescending, Chr(34) & "desc" & Chr(34)) ucrPnlSort.SetRDefault(Chr(34) & "none" & Chr(34)) - ucrPnlFreqDisplay.AddRadioButton(rdoTable) - ucrPnlFreqDisplay.AddRadioButton(rdoGraph) - - ucrPnlFreqDisplay.AddFunctionNamesCondition(rdoTable, "sjPlot::sjt.frq") - ucrPnlFreqDisplay.AddFunctionNamesCondition(rdoGraph, "sjPlot::sjp.frq") - ucrChkWeights.SetText("Weights") ucrChkWeights.SetParameter(ucrReceiverWeights.GetParameter(), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) ucrChkWeights.AddToLinkedControls(ucrReceiverWeights, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - ucrPnlFreqDisplay.AddToLinkedControls(ucrPnlSort, {rdoTable}, bNewLinkedDisabledIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True) - ucrPnlFreqDisplay.AddToLinkedControls(ucrChkFlip, {rdoGraph}, bNewLinkedDisabledIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True) + ucrChkTable.AddToLinkedControls(ucrPnlSort, {True}, bNewLinkedDisabledIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True) + ucrChkGraph.AddToLinkedControls(ucrChkFlip, {True}, bNewLinkedDisabledIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True) ucrChkFlip.SetText("Flip Coordinates") ucrChkFlip.SetParameter(New RParameter("coord.flip", 1)) ucrChkFlip.SetValuesCheckedAndUnchecked("TRUE", "FALSE") ucrChkFlip.SetRDefault("FALSE") + + ucrChkGraph.SetText("Graph") + ucrChkTable.SetText("Table") + ucrChkTable.AddFunctionNamesCondition(True, "sjPlot::sjt.frq") + ucrChkGraph.AddFunctionNamesCondition(True, "sjPlot::sjp.frq") End Sub Private Sub SetDefaults() @@ -100,7 +101,7 @@ Public Class dlgOneWayFrequencies Private Sub TestOkEnabled() If Not ucrReceiverOneWayFreq.IsEmpty() Then - If Not ucrChkWeights.Checked Then + If (Not ucrChkWeights.Checked) Then ucrBase.OKEnabled(True) Else If Not ucrReceiverWeights.IsEmpty Then @@ -109,25 +110,31 @@ Public Class dlgOneWayFrequencies ucrBase.OKEnabled(False) End If End If + Else + ucrBase.OKEnabled(False) End If End Sub Public Sub ICallType() - If rdoTable.Checked Then + If ucrChkTable.Checked Then ucrBase.clsRsyntax.bHTMLOutput = True ucrBase.clsRsyntax.iCallType = 0 - ElseIf rdoGraph.Checked - ucrBase.clsRsyntax.bHTMLOutput = False + ElseIf ucrChkGraph.Checked + ' ucrBase.clsRsyntax.bHTMLOutput = False ucrBase.clsRsyntax.iCallType = 3 End If End Sub Private Sub ChangeBaseFunction() - If rdoTable.Checked Then + If ucrChkTable.Checked Then ucrReceiverOneWayFreq.SetParameter(New RParameter("data", 1)) ucrReceiverOneWayFreq.SetParameterIsRFunction() ucrBase.clsRsyntax.SetBaseRFunction(clsSjtFreq) - ElseIf rdoGraph.Checked Then + ElseIf ucrChkGraph.Checked Then + ucrReceiverOneWayFreq.SetParameter(New RParameter("var.cnt", 1)) + ucrReceiverOneWayFreq.SetParameterIsRFunction() + ucrBase.clsRsyntax.SetBaseRFunction(clsSjpFrq) + Else ucrReceiverOneWayFreq.SetParameter(New RParameter("var.cnt", 1)) ucrReceiverOneWayFreq.SetParameterIsRFunction() ucrBase.clsRsyntax.SetBaseRFunction(clsSjpFrq) @@ -149,7 +156,7 @@ Public Class dlgOneWayFrequencies End If End Sub - Private Sub AllControls_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlFreqDisplay.ControlValueChanged + Private Sub AllControls_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkTable.ControlValueChanged, ucrChkGraph.ControlValueChanged ChangeBaseFunction() ICallType() End Sub From c1efa6627d109d65391dc6f55b6d82124738d582 Mon Sep 17 00:00:00 2001 From: maxwell fundi Date: Thu, 23 Mar 2017 16:27:47 +0300 Subject: [PATCH 27/66] Additions to rugplot --- instat/dlgRugPlot.vb | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/instat/dlgRugPlot.vb b/instat/dlgRugPlot.vb index 1b3957f5005..c0a61eea78b 100644 --- a/instat/dlgRugPlot.vb +++ b/instat/dlgRugPlot.vb @@ -21,6 +21,7 @@ Public Class dlgRugPlot Private clsRaesFunction As New RFunction Private bFirstLoad As Boolean = True Private bReset As Boolean = True + Private bResetSubdialog As Boolean = False Private Sub dlgRugPlot_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstLoad Then @@ -39,7 +40,8 @@ Public Class dlgRugPlot End Sub Private Sub SetRCodeForControls(bReset As Boolean) - ucrSaveGraph.SetRCode(clsDefaultFunction, bReset) + + ucrSaveGraph.SetRCode(ucrBase.clsRsyntax.clsBaseOperator, bReset) ucrRugPlotSelector.SetRCode(clsDefaultFunction, bReset) ucrReceiverX.SetRCode(clsRaesFunction, bReset) @@ -91,23 +93,37 @@ Public Class dlgRugPlot End Sub Private Sub SetDefaults() - clsDefaultFunction = New RFunction clsRaesFunction = New RFunction + clsDefaultFunction = New RFunction clsRgeom_RugPlotFunction = New RFunction - ucrRugPlotSelector.Reset() ucrSaveGraph.Reset() + ucrRugPlotSelector.Reset() ucrVariablesAsFactorForRugPlot.ResetControl() - ucrBase.clsRsyntax.SetOperation("+") + + clsRaesFunction.ClearParameters() + clsRgeom_RugPlotFunction.ClearParameters() + clsDefaultFunction.SetRCommand("ggplot") - clsRgeom_RugPlotFunction.SetRCommand("geom_rug") + clsDefaultFunction.AddParameter("data", clsRFunctionParameter:=ucrRugPlotSelector.ucrAvailableDataFrames.clsCurrDataFrame) + clsRaesFunction.SetRCommand("aes") + clsDefaultFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesFunction) - ' clsGeomOp.AddParameter(iPosition:=5, clsRFunctionParameter:=clsRgeom_RugPlotFunction) - ucrBase.clsRsyntax.SetOperatorParameter(False, clsRFunc:=clsRgeom_RugPlotFunction) - clsDefaultFunction.SetAssignTo("last_graph", strTempDataframe:=ucrRugPlotSelector.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") + clsRgeom_RugPlotFunction.SetRCommand("geom_rug") + ucrBase.clsRsyntax.SetBaseRFunction(clsDefaultFunction) + + ucrBase.clsRsyntax.SetOperation("+") + ucrBase.clsRsyntax.SetOperatorParameter(0, clsRFunc:=clsDefaultFunction) + ucrBase.clsRsyntax.SetOperatorParameter(1, clsRFunc:=clsRgeom_RugPlotFunction) + + ucrBase.clsRsyntax.SetAssignTo("last_graph", strTempDataframe:=ucrRugPlotSelector.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") + ucrBase.clsRsyntax.SetBaseROperator(ucrBase.clsRsyntax.clsBaseOperator) + + bResetSubdialog = True + End Sub Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset @@ -137,5 +153,4 @@ Public Class dlgRugPlot ' End If 'Next End Sub - -End Class \ No newline at end of file +End Class From 599d0f0f23353cfcd1fb43eb9474af49f042a457 Mon Sep 17 00:00:00 2001 From: John Lunalo Date: Thu, 23 Mar 2017 17:15:32 +0300 Subject: [PATCH 28/66] Fixing text of the dialog Title --- instat/dlgSaveAs.Designer.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instat/dlgSaveAs.Designer.vb b/instat/dlgSaveAs.Designer.vb index cefd96d596a..a661c40d395 100644 --- a/instat/dlgSaveAs.Designer.vb +++ b/instat/dlgSaveAs.Designer.vb @@ -86,8 +86,8 @@ Partial Class dlgSaveAs Me.MinimizeBox = False Me.Name = "dlgSaveAs" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen - Me.Tag = "Save_As" - Me.Text = "Save As" + Me.Tag = "Save_Data_As" + Me.Text = "Save Data As" Me.ResumeLayout(False) Me.PerformLayout() From 724041684060fccf3e94743ed37a04b194cefb7d Mon Sep 17 00:00:00 2001 From: steven ndung'u Date: Tue, 28 Mar 2017 10:39:30 +0300 Subject: [PATCH 29/66] enhancement on onewayfreq dialog --- instat/dlgOneWayFrequencies.Designer.vb | 14 +++++++++++-- instat/dlgOneWayFrequencies.vb | 27 +++++++++++++++++-------- 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/instat/dlgOneWayFrequencies.Designer.vb b/instat/dlgOneWayFrequencies.Designer.vb index e733a43fa19..65ee8a3958c 100644 --- a/instat/dlgOneWayFrequencies.Designer.vb +++ b/instat/dlgOneWayFrequencies.Designer.vb @@ -37,6 +37,7 @@ Partial Class dlgOneWayFrequencies Me.ucrSelectorOneWayFreq = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrChkGraph = New instat.ucrCheck() Me.ucrChkTable = New instat.ucrCheck() + Me.ucrSaveGraph = New instat.ucrSave() Me.grpSort.SuspendLayout() Me.SuspendLayout() ' @@ -139,7 +140,7 @@ Partial Class dlgOneWayFrequencies ' 'ucrBase ' - Me.ucrBase.Location = New System.Drawing.Point(10, 299) + Me.ucrBase.Location = New System.Drawing.Point(10, 324) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(410, 52) Me.ucrBase.TabIndex = 11 @@ -180,11 +181,19 @@ Partial Class dlgOneWayFrequencies Me.ucrChkTable.Size = New System.Drawing.Size(145, 20) Me.ucrChkTable.TabIndex = 13 ' + 'ucrSaveGraph + ' + Me.ucrSaveGraph.Location = New System.Drawing.Point(10, 297) + Me.ucrSaveGraph.Name = "ucrSaveGraph" + Me.ucrSaveGraph.Size = New System.Drawing.Size(294, 24) + Me.ucrSaveGraph.TabIndex = 14 + ' '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, 360) + Me.ClientSize = New System.Drawing.Size(427, 381) + Me.Controls.Add(Me.ucrSaveGraph) Me.Controls.Add(Me.ucrChkTable) Me.Controls.Add(Me.ucrChkGraph) Me.Controls.Add(Me.ucrReceiverWeights) @@ -224,4 +233,5 @@ Partial Class dlgOneWayFrequencies Friend WithEvents ucrChkWeights As ucrCheck Friend WithEvents ucrChkTable As ucrCheck Friend WithEvents ucrChkGraph As ucrCheck + Friend WithEvents ucrSaveGraph As ucrSave End Class diff --git a/instat/dlgOneWayFrequencies.vb b/instat/dlgOneWayFrequencies.vb index 47d6eeee5f2..999511f307a 100644 --- a/instat/dlgOneWayFrequencies.vb +++ b/instat/dlgOneWayFrequencies.vb @@ -43,7 +43,7 @@ Public Class dlgOneWayFrequencies ucrChkTable.SetRCode(clsSjtFreq, bReset) ucrChkWeights.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - ucrPnlSort.SetRCode(clsSjtFreq, bReset) + ucrPnlSort.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrChkFlip.SetRCode(clsSjpFrq, bReset) End Sub @@ -72,7 +72,10 @@ Public Class dlgOneWayFrequencies ucrChkWeights.SetParameter(ucrReceiverWeights.GetParameter(), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) ucrChkWeights.AddToLinkedControls(ucrReceiverWeights, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - ucrChkTable.AddToLinkedControls(ucrPnlSort, {True}, bNewLinkedDisabledIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True) + ucrChkGraph.SetText("Graph") + ucrChkTable.SetText("Table") + ucrChkTable.AddFunctionNamesCondition(True, "sjPlot::sjt.frq") + 'ucrChkGraph.AddFunctionNamesCondition(True, "sjPlot::sjp.frq") ucrChkGraph.AddToLinkedControls(ucrChkFlip, {True}, bNewLinkedDisabledIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True) ucrChkFlip.SetText("Flip Coordinates") @@ -80,10 +83,12 @@ Public Class dlgOneWayFrequencies ucrChkFlip.SetValuesCheckedAndUnchecked("TRUE", "FALSE") ucrChkFlip.SetRDefault("FALSE") - ucrChkGraph.SetText("Graph") - ucrChkTable.SetText("Table") - ucrChkTable.AddFunctionNamesCondition(True, "sjPlot::sjt.frq") - ucrChkGraph.AddFunctionNamesCondition(True, "sjPlot::sjp.frq") + ucrSaveGraph.SetPrefix("one_way_freq") + ucrSaveGraph.SetSaveTypeAsGraph() + ucrSaveGraph.SetDataFrameSelector(ucrSelectorOneWayFreq.ucrAvailableDataFrames) + ucrSaveGraph.SetCheckBoxText("Save Graph") + ucrSaveGraph.SetIsComboBox() + End Sub Private Sub SetDefaults() @@ -95,7 +100,9 @@ Public Class dlgOneWayFrequencies clsSjtFreq.SetRCommand("sjPlot::sjt.frq") clsSjtFreq.AddParameter("sort.frq", Chr(34) & "none" & Chr(34)) clsSjpFrq.SetRCommand("sjPlot::sjp.frq") - clsSjpFrq.AddParameter("coord.flip", "FALSE") + ' clsSjpFrq.AddParameter("coord.flip", "FALSE") + clsSjpFrq.AddParameter("sort.frq", Chr(34) & "none" & Chr(34)) + clsSjpFrq.SetAssignTo("onevar_graph", strTempDataframe:=ucrSelectorOneWayFreq.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="onevar_graph") ucrBase.clsRsyntax.SetBaseRFunction(clsSjtFreq) End Sub @@ -117,11 +124,13 @@ Public Class dlgOneWayFrequencies Public Sub ICallType() If ucrChkTable.Checked Then - ucrBase.clsRsyntax.bHTMLOutput = True + ' ucrBase.clsRsyntax.bHTMLOutput = True ucrBase.clsRsyntax.iCallType = 0 ElseIf ucrChkGraph.Checked ' ucrBase.clsRsyntax.bHTMLOutput = False ucrBase.clsRsyntax.iCallType = 3 + Else 'temporary fix to ensure graphs are displayed in the output window before a wrapper for displaying both tables and graphs at the same time on the output window is implemented + ucrBase.clsRsyntax.iCallType = 3 End If End Sub @@ -134,10 +143,12 @@ Public Class dlgOneWayFrequencies ucrReceiverOneWayFreq.SetParameter(New RParameter("var.cnt", 1)) ucrReceiverOneWayFreq.SetParameterIsRFunction() ucrBase.clsRsyntax.SetBaseRFunction(clsSjpFrq) + ucrSaveGraph.SetAssignToIfUncheckedValue("onevar_graph") Else ucrReceiverOneWayFreq.SetParameter(New RParameter("var.cnt", 1)) ucrReceiverOneWayFreq.SetParameterIsRFunction() ucrBase.clsRsyntax.SetBaseRFunction(clsSjpFrq) + ucrSaveGraph.SetAssignToIfUncheckedValue("onevar_graph") End If SetRCodeForControls(False) End Sub From ecb3fbc0c1d1326a46815b3a7b19b05de713c521 Mon Sep 17 00:00:00 2001 From: steven ndung'u Date: Thu, 30 Mar 2017 17:23:28 +0300 Subject: [PATCH 30/66] Adding subdialogue --- instat/dlgOneWayFrequencies.Designer.vb | 34 ++- instat/dlgOneWayFrequencies.vb | 52 +++- instat/sdgOneWayFrequencies.Designer.vb | 354 +++++++++++++++++++++++- instat/sdgOneWayFrequencies.vb | 144 +++++++++- 4 files changed, 556 insertions(+), 28 deletions(-) diff --git a/instat/dlgOneWayFrequencies.Designer.vb b/instat/dlgOneWayFrequencies.Designer.vb index 65ee8a3958c..60b119727ce 100644 --- a/instat/dlgOneWayFrequencies.Designer.vb +++ b/instat/dlgOneWayFrequencies.Designer.vb @@ -37,7 +37,8 @@ Partial Class dlgOneWayFrequencies Me.ucrSelectorOneWayFreq = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrChkGraph = New instat.ucrCheck() Me.ucrChkTable = New instat.ucrCheck() - Me.ucrSaveGraph = New instat.ucrSave() + Me.ucrNudGroups = New instat.ucrNud() + Me.ucrChkGroupData = New instat.ucrCheck() Me.grpSort.SuspendLayout() Me.SuspendLayout() ' @@ -133,7 +134,7 @@ Partial Class dlgOneWayFrequencies 'ucrChkFlip ' Me.ucrChkFlip.Checked = False - Me.ucrChkFlip.Location = New System.Drawing.Point(10, 227) + Me.ucrChkFlip.Location = New System.Drawing.Point(10, 297) Me.ucrChkFlip.Name = "ucrChkFlip" Me.ucrChkFlip.Size = New System.Drawing.Size(145, 20) Me.ucrChkFlip.TabIndex = 7 @@ -181,19 +182,33 @@ Partial Class dlgOneWayFrequencies Me.ucrChkTable.Size = New System.Drawing.Size(145, 20) Me.ucrChkTable.TabIndex = 13 ' - 'ucrSaveGraph + 'ucrNudGroups ' - Me.ucrSaveGraph.Location = New System.Drawing.Point(10, 297) - Me.ucrSaveGraph.Name = "ucrSaveGraph" - Me.ucrSaveGraph.Size = New System.Drawing.Size(294, 24) - Me.ucrSaveGraph.TabIndex = 14 + Me.ucrNudGroups.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudGroups.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudGroups.Location = New System.Drawing.Point(132, 228) + Me.ucrNudGroups.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudGroups.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudGroups.Name = "ucrNudGroups" + Me.ucrNudGroups.Size = New System.Drawing.Size(50, 20) + Me.ucrNudGroups.TabIndex = 48 + Me.ucrNudGroups.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrChkGroupData + ' + Me.ucrChkGroupData.Checked = False + Me.ucrChkGroupData.Location = New System.Drawing.Point(10, 228) + Me.ucrChkGroupData.Name = "ucrChkGroupData" + Me.ucrChkGroupData.Size = New System.Drawing.Size(145, 20) + Me.ucrChkGroupData.TabIndex = 47 ' '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, 381) - Me.Controls.Add(Me.ucrSaveGraph) + Me.Controls.Add(Me.ucrNudGroups) + Me.Controls.Add(Me.ucrChkGroupData) Me.Controls.Add(Me.ucrChkTable) Me.Controls.Add(Me.ucrChkGraph) Me.Controls.Add(Me.ucrReceiverWeights) @@ -233,5 +248,6 @@ Partial Class dlgOneWayFrequencies Friend WithEvents ucrChkWeights As ucrCheck Friend WithEvents ucrChkTable As ucrCheck Friend WithEvents ucrChkGraph As ucrCheck - Friend WithEvents ucrSaveGraph As ucrSave + Friend WithEvents ucrNudGroups As ucrNud + Friend WithEvents ucrChkGroupData As ucrCheck End Class diff --git a/instat/dlgOneWayFrequencies.vb b/instat/dlgOneWayFrequencies.vb index 999511f307a..543cb5db6ba 100644 --- a/instat/dlgOneWayFrequencies.vb +++ b/instat/dlgOneWayFrequencies.vb @@ -45,13 +45,16 @@ Public Class dlgOneWayFrequencies ucrChkWeights.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrPnlSort.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrChkFlip.SetRCode(clsSjpFrq, bReset) + + ucrNudGroups.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + End Sub Private Sub InitialiseDialog() 'HelpID ' ucrBase.iHelpTopicID = - cmdOptions.Enabled = False + cmdOptions.Enabled = True ucrReceiverOneWayFreq.Selector = ucrSelectorOneWayFreq ucrReceiverOneWayFreq.SetMeAsReceiver() ucrReceiverOneWayFreq.SetParameter(New RParameter("data", 1)) @@ -74,21 +77,21 @@ Public Class dlgOneWayFrequencies ucrChkGraph.SetText("Graph") ucrChkTable.SetText("Table") - ucrChkTable.AddFunctionNamesCondition(True, "sjPlot::sjt.frq") - 'ucrChkGraph.AddFunctionNamesCondition(True, "sjPlot::sjp.frq") + ucrChkTable.AddFunctionNamesCondition(True, "sjt.frq") + 'ucrChkGraph.AddFunctionNamesCondition(True, "sjp.frq") ucrChkGraph.AddToLinkedControls(ucrChkFlip, {True}, bNewLinkedDisabledIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True) + ucrChkGroupData.SetText("Group Data") + ucrNudGroups.SetMinMax(2, 100) + ucrNudGroups.Increment = 5 + ucrNudGroups.SetParameter(New RParameter("auto.group")) + ucrChkGroupData.AddToLinkedControls(ucrNudGroups, {True}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True) + ucrChkGroupData.SetParameter(ucrNudGroups.GetParameter, bNewAddRemoveParameter:=False, bNewChangeParameterValue:=True) + ucrChkFlip.SetText("Flip Coordinates") ucrChkFlip.SetParameter(New RParameter("coord.flip", 1)) ucrChkFlip.SetValuesCheckedAndUnchecked("TRUE", "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() @@ -97,13 +100,25 @@ Public Class dlgOneWayFrequencies ucrSelectorOneWayFreq.Reset() ucrReceiverOneWayFreq.SetParameter(New RParameter("data", 1)) ucrReceiverOneWayFreq.SetParameterIsRFunction() - clsSjtFreq.SetRCommand("sjPlot::sjt.frq") + clsSjtFreq.SetRCommand("sjt.frq") clsSjtFreq.AddParameter("sort.frq", Chr(34) & "none" & Chr(34)) - clsSjpFrq.SetRCommand("sjPlot::sjp.frq") - ' clsSjpFrq.AddParameter("coord.flip", "FALSE") + clsSjtFreq.AddParameter("show.summary", "FALSE") + clsSjtFreq.AddParameter("auto.group", 10) + clsSjtFreq.AddParameter("digits", 0) + + clsSjpFrq.SetRCommand("sjp.frq") clsSjpFrq.AddParameter("sort.frq", Chr(34) & "none" & Chr(34)) + clsSjpFrq.AddParameter("type", Chr(34) & "bar" & Chr(34)) + clsSjpFrq.AddParameter("vjust", Chr(34) & "left" & Chr(34)) + clsSjpFrq.AddParameter("hjust", Chr(34) & "left" & Chr(34)) + clsSjpFrq.AddParameter("show.prc", "TRUE") + clsSjpFrq.AddParameter("show.n", "FALSE") + + clsSjpFrq.AddParameter("auto.group", 10) clsSjpFrq.SetAssignTo("onevar_graph", strTempDataframe:=ucrSelectorOneWayFreq.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="onevar_graph") ucrBase.clsRsyntax.SetBaseRFunction(clsSjtFreq) + bResetSubdialog = True + End Sub Private Sub TestOkEnabled() @@ -143,12 +158,12 @@ Public Class dlgOneWayFrequencies ucrReceiverOneWayFreq.SetParameter(New RParameter("var.cnt", 1)) ucrReceiverOneWayFreq.SetParameterIsRFunction() ucrBase.clsRsyntax.SetBaseRFunction(clsSjpFrq) - ucrSaveGraph.SetAssignToIfUncheckedValue("onevar_graph") + Else ucrReceiverOneWayFreq.SetParameter(New RParameter("var.cnt", 1)) ucrReceiverOneWayFreq.SetParameterIsRFunction() ucrBase.clsRsyntax.SetBaseRFunction(clsSjpFrq) - ucrSaveGraph.SetAssignToIfUncheckedValue("onevar_graph") + End If SetRCodeForControls(False) End Sub @@ -176,4 +191,11 @@ Public Class dlgOneWayFrequencies TestOkEnabled() End Sub + Private Sub cmdOptions_Click(sender As Object, e As EventArgs) Handles cmdOptions.Click + ' Link the base function to the sub dialog + sdgOneWayFrequencies.SetRFunction(clsSjtFreq, clsSjpFrq, bResetSubdialog) + bResetSubdialog = False + sdgOneWayFrequencies.ShowDialog() + TestOkEnabled() + End Sub End Class \ No newline at end of file diff --git a/instat/sdgOneWayFrequencies.Designer.vb b/instat/sdgOneWayFrequencies.Designer.vb index ab454c70d63..5835dabcb09 100644 --- a/instat/sdgOneWayFrequencies.Designer.vb +++ b/instat/sdgOneWayFrequencies.Designer.vb @@ -22,12 +22,323 @@ Partial Class sdgOneWayFrequencies 'Do not modify it using the code editor. Private Sub InitializeComponent() + Me.tbOneWayFrequencies = New System.Windows.Forms.TabControl() + Me.tbTable = New System.Windows.Forms.TabPage() + Me.grpTableOptions = New System.Windows.Forms.GroupBox() + Me.tbGraph = New System.Windows.Forms.TabPage() + Me.grpGraphOptions = New System.Windows.Forms.GroupBox() + Me.grpGraphType = New System.Windows.Forms.GroupBox() + Me.rdoLine = New System.Windows.Forms.RadioButton() + Me.rdoDot = New System.Windows.Forms.RadioButton() + Me.rdoBar = New System.Windows.Forms.RadioButton() + Me.ucrNudDecimalPlaces = New instat.ucrNud() + Me.ucrChkDecimalPlaces = New instat.ucrCheck() + Me.ucrChkOmitZero = New instat.ucrCheck() + Me.ucrChkHighlightedRows = New instat.ucrCheck() + Me.ucrChkMedian = New instat.ucrCheck() + Me.ucrChkShowSummary = New instat.ucrCheck() + Me.ucrSaveGraph = New instat.ucrSave() + Me.ucrInputGraphTitle = New instat.ucrInputTextBox() + Me.ucrInputColour = New instat.ucrInputComboBox() + Me.ucrInputHorizontalLabels = New instat.ucrInputComboBox() + Me.ucrInputVerticalLabels = New instat.ucrInputComboBox() + Me.ucrChkColour = New instat.ucrCheck() + Me.ucrChkGraphTitle = New instat.ucrCheck() + Me.ucrChkHorizontalLabelPosition = New instat.ucrCheck() + Me.ucrChkShowMissing = New instat.ucrCheck() + Me.ucrChkShowPercentage = New instat.ucrCheck() + Me.ucrChkShowCount = New instat.ucrCheck() + Me.ucrChkVerticalLabelPosition = New instat.ucrCheck() + Me.ucrPnlGraphType = New instat.UcrPanel() Me.ucrBaseSubDialogue = New instat.ucrButtonsSubdialogue() + Me.tbOneWayFrequencies.SuspendLayout() + Me.tbTable.SuspendLayout() + Me.grpTableOptions.SuspendLayout() + Me.tbGraph.SuspendLayout() + Me.grpGraphOptions.SuspendLayout() + Me.grpGraphType.SuspendLayout() Me.SuspendLayout() ' + 'tbOneWayFrequencies + ' + Me.tbOneWayFrequencies.Controls.Add(Me.tbTable) + Me.tbOneWayFrequencies.Controls.Add(Me.tbGraph) + Me.tbOneWayFrequencies.Location = New System.Drawing.Point(12, 12) + Me.tbOneWayFrequencies.Name = "tbOneWayFrequencies" + Me.tbOneWayFrequencies.SelectedIndex = 0 + Me.tbOneWayFrequencies.Size = New System.Drawing.Size(402, 320) + Me.tbOneWayFrequencies.TabIndex = 1 + ' + 'tbTable + ' + Me.tbTable.Controls.Add(Me.grpTableOptions) + Me.tbTable.Location = New System.Drawing.Point(4, 22) + Me.tbTable.Name = "tbTable" + Me.tbTable.Padding = New System.Windows.Forms.Padding(3) + Me.tbTable.Size = New System.Drawing.Size(394, 294) + Me.tbTable.TabIndex = 0 + Me.tbTable.Text = "Table" + Me.tbTable.UseVisualStyleBackColor = True + ' + 'grpTableOptions + ' + Me.grpTableOptions.Controls.Add(Me.ucrNudDecimalPlaces) + Me.grpTableOptions.Controls.Add(Me.ucrChkDecimalPlaces) + Me.grpTableOptions.Controls.Add(Me.ucrChkOmitZero) + Me.grpTableOptions.Controls.Add(Me.ucrChkHighlightedRows) + Me.grpTableOptions.Controls.Add(Me.ucrChkMedian) + Me.grpTableOptions.Controls.Add(Me.ucrChkShowSummary) + Me.grpTableOptions.Location = New System.Drawing.Point(17, 6) + Me.grpTableOptions.Name = "grpTableOptions" + Me.grpTableOptions.Size = New System.Drawing.Size(345, 151) + Me.grpTableOptions.TabIndex = 21 + Me.grpTableOptions.TabStop = False + Me.grpTableOptions.Text = "More Options" + ' + 'tbGraph + ' + Me.tbGraph.Controls.Add(Me.ucrSaveGraph) + Me.tbGraph.Controls.Add(Me.grpGraphOptions) + Me.tbGraph.Controls.Add(Me.grpGraphType) + Me.tbGraph.Location = New System.Drawing.Point(4, 22) + Me.tbGraph.Name = "tbGraph" + Me.tbGraph.Padding = New System.Windows.Forms.Padding(3) + Me.tbGraph.Size = New System.Drawing.Size(394, 294) + Me.tbGraph.TabIndex = 1 + Me.tbGraph.Text = "Graph" + Me.tbGraph.UseVisualStyleBackColor = True + ' + 'grpGraphOptions + ' + Me.grpGraphOptions.Controls.Add(Me.ucrInputGraphTitle) + Me.grpGraphOptions.Controls.Add(Me.ucrInputColour) + Me.grpGraphOptions.Controls.Add(Me.ucrInputHorizontalLabels) + Me.grpGraphOptions.Controls.Add(Me.ucrInputVerticalLabels) + Me.grpGraphOptions.Controls.Add(Me.ucrChkColour) + Me.grpGraphOptions.Controls.Add(Me.ucrChkGraphTitle) + Me.grpGraphOptions.Controls.Add(Me.ucrChkHorizontalLabelPosition) + Me.grpGraphOptions.Controls.Add(Me.ucrChkShowMissing) + Me.grpGraphOptions.Controls.Add(Me.ucrChkShowPercentage) + Me.grpGraphOptions.Controls.Add(Me.ucrChkShowCount) + Me.grpGraphOptions.Controls.Add(Me.ucrChkVerticalLabelPosition) + Me.grpGraphOptions.Location = New System.Drawing.Point(6, 59) + Me.grpGraphOptions.Name = "grpGraphOptions" + Me.grpGraphOptions.Size = New System.Drawing.Size(381, 196) + Me.grpGraphOptions.TabIndex = 37 + Me.grpGraphOptions.TabStop = False + Me.grpGraphOptions.Text = "Graph Options" + ' + 'grpGraphType + ' + Me.grpGraphType.Controls.Add(Me.rdoLine) + Me.grpGraphType.Controls.Add(Me.rdoDot) + Me.grpGraphType.Controls.Add(Me.rdoBar) + Me.grpGraphType.Controls.Add(Me.ucrPnlGraphType) + Me.grpGraphType.Location = New System.Drawing.Point(6, 6) + Me.grpGraphType.Name = "grpGraphType" + Me.grpGraphType.Size = New System.Drawing.Size(381, 48) + Me.grpGraphType.TabIndex = 33 + Me.grpGraphType.TabStop = False + Me.grpGraphType.Text = "Type of Graph" + ' + 'rdoLine + ' + Me.rdoLine.AutoSize = True + Me.rdoLine.Location = New System.Drawing.Point(275, 19) + Me.rdoLine.Name = "rdoLine" + Me.rdoLine.Size = New System.Drawing.Size(77, 17) + Me.rdoLine.TabIndex = 7 + Me.rdoLine.TabStop = True + Me.rdoLine.Text = "Line Graph" + Me.rdoLine.UseVisualStyleBackColor = True + ' + 'rdoDot + ' + Me.rdoDot.AutoSize = True + Me.rdoDot.Location = New System.Drawing.Point(134, 19) + Me.rdoDot.Name = "rdoDot" + Me.rdoDot.Size = New System.Drawing.Size(74, 17) + Me.rdoDot.TabIndex = 6 + Me.rdoDot.TabStop = True + Me.rdoDot.Text = "Dot Graph" + Me.rdoDot.UseVisualStyleBackColor = True + ' + 'rdoBar + ' + Me.rdoBar.AutoSize = True + Me.rdoBar.Location = New System.Drawing.Point(15, 19) + Me.rdoBar.Name = "rdoBar" + Me.rdoBar.Size = New System.Drawing.Size(73, 17) + Me.rdoBar.TabIndex = 5 + Me.rdoBar.TabStop = True + Me.rdoBar.Text = "Bar Graph" + Me.rdoBar.UseVisualStyleBackColor = True + ' + 'ucrNudDecimalPlaces + ' + Me.ucrNudDecimalPlaces.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudDecimalPlaces.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudDecimalPlaces.Location = New System.Drawing.Point(173, 90) + Me.ucrNudDecimalPlaces.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudDecimalPlaces.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudDecimalPlaces.Name = "ucrNudDecimalPlaces" + Me.ucrNudDecimalPlaces.Size = New System.Drawing.Size(50, 20) + Me.ucrNudDecimalPlaces.TabIndex = 50 + Me.ucrNudDecimalPlaces.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrChkDecimalPlaces + ' + Me.ucrChkDecimalPlaces.Checked = False + Me.ucrChkDecimalPlaces.Location = New System.Drawing.Point(8, 90) + Me.ucrChkDecimalPlaces.Name = "ucrChkDecimalPlaces" + Me.ucrChkDecimalPlaces.Size = New System.Drawing.Size(145, 20) + Me.ucrChkDecimalPlaces.TabIndex = 49 + ' + 'ucrChkOmitZero + ' + Me.ucrChkOmitZero.Checked = False + Me.ucrChkOmitZero.Location = New System.Drawing.Point(8, 114) + Me.ucrChkOmitZero.Name = "ucrChkOmitZero" + Me.ucrChkOmitZero.Size = New System.Drawing.Size(262, 20) + Me.ucrChkOmitZero.TabIndex = 23 + ' + 'ucrChkHighlightedRows + ' + Me.ucrChkHighlightedRows.Checked = False + Me.ucrChkHighlightedRows.Location = New System.Drawing.Point(8, 42) + Me.ucrChkHighlightedRows.Name = "ucrChkHighlightedRows" + Me.ucrChkHighlightedRows.Size = New System.Drawing.Size(145, 20) + Me.ucrChkHighlightedRows.TabIndex = 22 + ' + 'ucrChkMedian + ' + Me.ucrChkMedian.Checked = False + Me.ucrChkMedian.Location = New System.Drawing.Point(8, 66) + Me.ucrChkMedian.Name = "ucrChkMedian" + Me.ucrChkMedian.Size = New System.Drawing.Size(145, 20) + Me.ucrChkMedian.TabIndex = 21 + ' + 'ucrChkShowSummary + ' + Me.ucrChkShowSummary.Checked = False + Me.ucrChkShowSummary.Location = New System.Drawing.Point(8, 18) + Me.ucrChkShowSummary.Name = "ucrChkShowSummary" + Me.ucrChkShowSummary.Size = New System.Drawing.Size(145, 20) + Me.ucrChkShowSummary.TabIndex = 19 + ' + 'ucrSaveGraph + ' + Me.ucrSaveGraph.Location = New System.Drawing.Point(12, 261) + Me.ucrSaveGraph.Name = "ucrSaveGraph" + Me.ucrSaveGraph.Size = New System.Drawing.Size(294, 24) + Me.ucrSaveGraph.TabIndex = 39 + ' + 'ucrInputGraphTitle + ' + Me.ucrInputGraphTitle.AddQuotesIfUnrecognised = True + Me.ucrInputGraphTitle.IsMultiline = False + Me.ucrInputGraphTitle.IsReadOnly = False + Me.ucrInputGraphTitle.Location = New System.Drawing.Point(187, 162) + Me.ucrInputGraphTitle.Name = "ucrInputGraphTitle" + Me.ucrInputGraphTitle.Size = New System.Drawing.Size(137, 21) + Me.ucrInputGraphTitle.TabIndex = 54 + ' + 'ucrInputColour + ' + Me.ucrInputColour.AddQuotesIfUnrecognised = True + Me.ucrInputColour.IsReadOnly = False + Me.ucrInputColour.Location = New System.Drawing.Point(187, 139) + Me.ucrInputColour.Margin = New System.Windows.Forms.Padding(21, 17, 21, 17) + Me.ucrInputColour.Name = "ucrInputColour" + Me.ucrInputColour.Size = New System.Drawing.Size(137, 21) + Me.ucrInputColour.TabIndex = 53 + ' + 'ucrInputHorizontalLabels + ' + Me.ucrInputHorizontalLabels.AddQuotesIfUnrecognised = True + Me.ucrInputHorizontalLabels.IsReadOnly = False + Me.ucrInputHorizontalLabels.Location = New System.Drawing.Point(187, 115) + Me.ucrInputHorizontalLabels.Margin = New System.Windows.Forms.Padding(21, 17, 21, 17) + Me.ucrInputHorizontalLabels.Name = "ucrInputHorizontalLabels" + Me.ucrInputHorizontalLabels.Size = New System.Drawing.Size(137, 21) + Me.ucrInputHorizontalLabels.TabIndex = 51 + ' + 'ucrInputVerticalLabels + ' + Me.ucrInputVerticalLabels.AddQuotesIfUnrecognised = True + Me.ucrInputVerticalLabels.IsReadOnly = False + Me.ucrInputVerticalLabels.Location = New System.Drawing.Point(187, 91) + Me.ucrInputVerticalLabels.Margin = New System.Windows.Forms.Padding(21, 17, 21, 17) + Me.ucrInputVerticalLabels.Name = "ucrInputVerticalLabels" + Me.ucrInputVerticalLabels.Size = New System.Drawing.Size(137, 21) + Me.ucrInputVerticalLabels.TabIndex = 50 + ' + 'ucrChkColour + ' + Me.ucrChkColour.Checked = False + Me.ucrChkColour.Location = New System.Drawing.Point(6, 139) + Me.ucrChkColour.Name = "ucrChkColour" + Me.ucrChkColour.Size = New System.Drawing.Size(170, 20) + Me.ucrChkColour.TabIndex = 49 + ' + 'ucrChkGraphTitle + ' + Me.ucrChkGraphTitle.Checked = False + Me.ucrChkGraphTitle.Location = New System.Drawing.Point(6, 163) + Me.ucrChkGraphTitle.Name = "ucrChkGraphTitle" + Me.ucrChkGraphTitle.Size = New System.Drawing.Size(170, 20) + Me.ucrChkGraphTitle.TabIndex = 48 + ' + 'ucrChkHorizontalLabelPosition + ' + Me.ucrChkHorizontalLabelPosition.Checked = False + Me.ucrChkHorizontalLabelPosition.Location = New System.Drawing.Point(6, 115) + Me.ucrChkHorizontalLabelPosition.Name = "ucrChkHorizontalLabelPosition" + Me.ucrChkHorizontalLabelPosition.Size = New System.Drawing.Size(179, 20) + Me.ucrChkHorizontalLabelPosition.TabIndex = 47 + ' + 'ucrChkShowMissing + ' + Me.ucrChkShowMissing.Checked = False + Me.ucrChkShowMissing.Location = New System.Drawing.Point(6, 67) + Me.ucrChkShowMissing.Name = "ucrChkShowMissing" + Me.ucrChkShowMissing.Size = New System.Drawing.Size(145, 20) + Me.ucrChkShowMissing.TabIndex = 28 + ' + 'ucrChkShowPercentage + ' + Me.ucrChkShowPercentage.Checked = False + Me.ucrChkShowPercentage.Location = New System.Drawing.Point(6, 19) + Me.ucrChkShowPercentage.Name = "ucrChkShowPercentage" + Me.ucrChkShowPercentage.Size = New System.Drawing.Size(145, 20) + Me.ucrChkShowPercentage.TabIndex = 20 + ' + 'ucrChkShowCount + ' + Me.ucrChkShowCount.Checked = False + Me.ucrChkShowCount.Location = New System.Drawing.Point(6, 43) + Me.ucrChkShowCount.Name = "ucrChkShowCount" + Me.ucrChkShowCount.Size = New System.Drawing.Size(145, 20) + Me.ucrChkShowCount.TabIndex = 18 + ' + 'ucrChkVerticalLabelPosition + ' + Me.ucrChkVerticalLabelPosition.Checked = False + Me.ucrChkVerticalLabelPosition.Location = New System.Drawing.Point(6, 91) + Me.ucrChkVerticalLabelPosition.Name = "ucrChkVerticalLabelPosition" + Me.ucrChkVerticalLabelPosition.Size = New System.Drawing.Size(170, 20) + Me.ucrChkVerticalLabelPosition.TabIndex = 38 + ' + 'ucrPnlGraphType + ' + Me.ucrPnlGraphType.Location = New System.Drawing.Point(6, 7) + Me.ucrPnlGraphType.Name = "ucrPnlGraphType" + Me.ucrPnlGraphType.Size = New System.Drawing.Size(369, 44) + Me.ucrPnlGraphType.TabIndex = 4 + ' 'ucrBaseSubDialogue ' - Me.ucrBaseSubDialogue.Location = New System.Drawing.Point(50, 219) + Me.ucrBaseSubDialogue.Location = New System.Drawing.Point(134, 338) Me.ucrBaseSubDialogue.Name = "ucrBaseSubDialogue" Me.ucrBaseSubDialogue.Size = New System.Drawing.Size(142, 30) Me.ucrBaseSubDialogue.TabIndex = 0 @@ -36,16 +347,53 @@ Partial Class sdgOneWayFrequencies ' 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.ClientSize = New System.Drawing.Size(421, 375) + Me.Controls.Add(Me.tbOneWayFrequencies) Me.Controls.Add(Me.ucrBaseSubDialogue) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.MaximizeBox = False Me.MinimizeBox = False Me.Name = "sdgOneWayFrequencies" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen - Me.Text = "One Way Frequencies" + Me.Text = "One Way Frequencies Options" + Me.tbOneWayFrequencies.ResumeLayout(False) + Me.tbTable.ResumeLayout(False) + Me.grpTableOptions.ResumeLayout(False) + Me.tbGraph.ResumeLayout(False) + Me.grpGraphOptions.ResumeLayout(False) + Me.grpGraphType.ResumeLayout(False) + Me.grpGraphType.PerformLayout() Me.ResumeLayout(False) End Sub Friend WithEvents ucrBaseSubDialogue As ucrButtonsSubdialogue + Friend WithEvents tbOneWayFrequencies As TabControl + Friend WithEvents tbTable As TabPage + Friend WithEvents grpTableOptions As GroupBox + Friend WithEvents ucrChkHighlightedRows As ucrCheck + Friend WithEvents ucrChkMedian As ucrCheck + Friend WithEvents ucrChkShowSummary As ucrCheck + Friend WithEvents tbGraph As TabPage + Friend WithEvents grpGraphOptions As GroupBox + Friend WithEvents ucrChkShowMissing As ucrCheck + Friend WithEvents ucrChkShowPercentage As ucrCheck + Friend WithEvents ucrChkShowCount As ucrCheck + Friend WithEvents ucrChkVerticalLabelPosition As ucrCheck + Friend WithEvents ucrChkColour As ucrCheck + Friend WithEvents ucrChkGraphTitle As ucrCheck + Friend WithEvents ucrChkHorizontalLabelPosition As ucrCheck + Friend WithEvents ucrInputHorizontalLabels As ucrInputComboBox + Friend WithEvents ucrInputVerticalLabels As ucrInputComboBox + Friend WithEvents ucrInputColour As ucrInputComboBox + Friend WithEvents ucrInputGraphTitle As ucrInputTextBox + Friend WithEvents ucrChkOmitZero As ucrCheck + Friend WithEvents ucrNudDecimalPlaces As ucrNud + Friend WithEvents ucrChkDecimalPlaces As ucrCheck + Friend WithEvents grpGraphType As GroupBox + Friend WithEvents ucrPnlGraphType As UcrPanel + Friend WithEvents rdoLine As RadioButton + Friend WithEvents rdoDot As RadioButton + Friend WithEvents rdoBar As RadioButton + Friend WithEvents ucrSaveGraph As ucrSave End Class diff --git a/instat/sdgOneWayFrequencies.vb b/instat/sdgOneWayFrequencies.vb index b99e676dfd4..6e49a34ff35 100644 --- a/instat/sdgOneWayFrequencies.vb +++ b/instat/sdgOneWayFrequencies.vb @@ -1,3 +1,145 @@ -Public Class sdgOneWayFrequencies +' 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 +Imports instat.Translations +Public Class sdgOneWayFrequencies + Public bControlsInitialised As Boolean = False + Public clsOneWayTableFreq, clsOneWayGraphFreq As New RFunction + Private Sub sdgOneWayFrequencies_Load(sender As Object, e As EventArgs) Handles MyBase.Load + autoTranslate(Me) + End Sub + Public Sub InitialiseControls() + Dim dctVerticalPositionLabel As New Dictionary(Of String, String) + Dim dctHorizontalPositionLabel As New Dictionary(Of String, String) + + ucrInputHorizontalLabels.SetParameter(New RParameter("hjust")) + dctHorizontalPositionLabel.Add("Left", Chr(34) & "left" & Chr(34)) + dctHorizontalPositionLabel.Add("Center", Chr(34) & "center" & Chr(34)) + dctHorizontalPositionLabel.Add("Right", Chr(34) & "right" & Chr(34)) + dctHorizontalPositionLabel.Add("Bottom", Chr(34) & "bottom" & Chr(34)) + dctHorizontalPositionLabel.Add("Top", Chr(34) & "top" & Chr(34)) + dctHorizontalPositionLabel.Add("Inward", Chr(34) & "inward" & Chr(34)) + dctHorizontalPositionLabel.Add("Outward", Chr(34) & "outward" & Chr(34)) + ucrInputHorizontalLabels.SetItems(dctHorizontalPositionLabel) + + ucrInputVerticalLabels.SetParameter(New RParameter("vjust")) + dctVerticalPositionLabel.Add("Left", Chr(34) & "left" & Chr(34)) + dctVerticalPositionLabel.Add("Center", Chr(34) & "center" & Chr(34)) + dctVerticalPositionLabel.Add("Right", Chr(34) & "right" & Chr(34)) + dctVerticalPositionLabel.Add("Bottom", Chr(34) & "bottom" & Chr(34)) + dctVerticalPositionLabel.Add("Top", Chr(34) & "top" & Chr(34)) + dctVerticalPositionLabel.Add("Inward", Chr(34) & "inward" & Chr(34)) + dctVerticalPositionLabel.Add("Outward", Chr(34) & "outward" & Chr(34)) + ucrInputVerticalLabels.SetItems(dctVerticalPositionLabel) + + ucrChkMedian.SetText("Emphasise Median") + ucrChkMedian.SetParameter(New RParameter("emph.md"), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") + ucrChkMedian.SetRDefault("FALSE") + + 'Set to unchecked on default(Default is TRUE) + ucrChkShowSummary.SetText("Show Summary") + ucrChkShowSummary.SetParameter(New RParameter("show.summary"), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") + + 'Default is auto + ucrChkOmitZero.SetText("Omit Zero Counts from Table") + ucrChkOmitZero.SetParameter(New RParameter("skip.zero"), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") + + + ucrChkDecimalPlaces.SetText("Decimal places for percentages") + ucrNudDecimalPlaces.SetParameter(New RParameter("digits")) + ucrChkDecimalPlaces.AddToLinkedControls(ucrNudDecimalPlaces, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrChkDecimalPlaces.SetParameter(ucrNudDecimalPlaces.GetParameter, bNewAddRemoveParameter:=True, bNewChangeParameterValue:=True) + ucrNudDecimalPlaces.SetMinMax(0, 4) + + ucrChkHighlightedRows.SetText("Alternate Rows Coloured") + ucrChkHighlightedRows.SetParameter(New RParameter("altr.row.col"), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") + ucrChkHighlightedRows.SetRDefault("FALSE") + + ucrChkShowCount.SetText("Show Count") + ucrChkShowCount.SetParameter(New RParameter("show.n"), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") + ucrChkShowCount.SetRDefault("FALSE") + + ucrChkShowPercentage.SetText("Show Percentage") + ucrChkShowPercentage.SetParameter(New RParameter("show.prc"), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") + + ucrChkVerticalLabelPosition.SetText("Vertical Label Positions") + ' ucrChkVerticalLabelPosition.SetParameter(ucrInputVerticalLabels.GetParameter, bNewAddRemoveParameter:=True, bNewChangeParameterValue:=True) + ucrChkVerticalLabelPosition.AddToLinkedControls(ucrInputVerticalLabels, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + + ucrChkHorizontalLabelPosition.SetText("Horizontal Label Positions") + ' ucrChkHorizontalLabelPosition.SetParameter(ucrInputHorizontalLabels.GetParameter, bNewAddRemoveParameter:=True, bNewChangeParameterValue:=True) + ucrChkHorizontalLabelPosition.AddToLinkedControls(ucrInputHorizontalLabels, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + + 'not implemented + ucrChkColour.Enabled = False + ucrInputColour.Enabled = False + ucrInputColour.bAllowNonConditionValues = False + ucrChkColour.bAllowNonConditionValues = False + 'ucrChkColour.SetText("Colour") + 'ucrChkColour.AddToLinkedControls(ucrInputColour, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + + ucrChkGraphTitle.SetText("Title") + ucrInputGraphTitle.SetParameter(New RParameter("title")) + ' ucrChkGraphTitle.SetParameter(ucrInputGraphTitle.GetParameter(), bNewAddRemoveParameter:=True, bNewChangeParameterValue:=True) + ucrChkGraphTitle.AddToLinkedControls(ucrInputGraphTitle, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + + ucrChkShowMissing.SetText("Show Missing") + ucrChkShowMissing.SetParameter(New RParameter("show.na"), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") + ucrChkShowMissing.SetRDefault("FALSE") + + ucrPnlGraphType.SetParameter(New RParameter("type")) + ucrPnlGraphType.AddRadioButton(rdoBar, Chr(34) & "bar" & Chr(34)) + ucrPnlGraphType.AddRadioButton(rdoLine, Chr(34) & "line" & Chr(34)) + ucrPnlGraphType.AddRadioButton(rdoDot, Chr(34) & "dot" & Chr(34)) + ucrPnlGraphType.SetRDefault(Chr(34) & "bar" & Chr(34)) + + ucrSaveGraph.SetPrefix("one_way_freq") + ucrSaveGraph.SetSaveTypeAsGraph() + ucrSaveGraph.SetDataFrameSelector(dlgOneWayFrequencies.ucrSelectorOneWayFreq.ucrAvailableDataFrames) + ucrSaveGraph.SetCheckBoxText("Save Graph") + ucrSaveGraph.SetIsComboBox() + ucrSaveGraph.SetAssignToIfUncheckedValue("last_graph") + bControlsInitialised = True + End Sub + + Public Sub SetRFunction(clsNewSjtFreq As RFunction, clsNewSjpFrq As RFunction, Optional bReset As Boolean = False) + If Not bControlsInitialised Then + InitialiseControls() + End If + clsOneWayTableFreq = clsNewSjtFreq + clsOneWayGraphFreq = clsNewSjpFrq + + ucrChkMedian.SetRCode(clsOneWayTableFreq, bReset) + ucrChkShowSummary.SetRCode(clsOneWayTableFreq, bReset) + ucrChkHighlightedRows.SetRCode(clsOneWayTableFreq, bReset) + ucrNudDecimalPlaces.SetRCode(clsOneWayTableFreq, bReset) + ucrChkOmitZero.SetRCode(clsOneWayTableFreq, bReset) + ucrChkShowCount.SetRCode(clsOneWayGraphFreq, bReset) + ucrChkShowPercentage.SetRCode(clsOneWayGraphFreq, bReset) + ucrChkShowMissing.SetRCode(clsOneWayGraphFreq, bReset) + ucrChkVerticalLabelPosition.SetRCode(clsOneWayGraphFreq, bReset) + ucrChkHorizontalLabelPosition.SetRCode(clsOneWayGraphFreq, bReset) + 'ucrChkColour.SetRCode(clsOneWayGraphFreq, bReset) + ucrChkGraphTitle.SetRCode(clsOneWayGraphFreq, bReset) + ucrPnlGraphType.SetRCode(clsOneWayGraphFreq, bReset) + ucrInputVerticalLabels.SetRCode(clsOneWayGraphFreq, bReset) + ucrInputHorizontalLabels.SetRCode(clsOneWayGraphFreq, bReset) + ucrInputColour.SetRCode(clsOneWayGraphFreq, bReset) + ucrChkGraphTitle.SetRCode(clsOneWayGraphFreq, bReset) + ucrSaveGraph.SetRCode(clsOneWayGraphFreq, bReset) + End Sub End Class \ No newline at end of file From a1a68d28a138c615f5f89b731027889a5b6ef455 Mon Sep 17 00:00:00 2001 From: steven ndung'u Date: Fri, 31 Mar 2017 15:06:08 +0300 Subject: [PATCH 31/66] More edits on one way frequencies --- instat/dlgOneWayFrequencies.Designer.vb | 2 +- instat/dlgOneWayFrequencies.vb | 41 +++--- instat/sdgOneWayFrequencies.Designer.vb | 158 +++++++++++------------- instat/sdgOneWayFrequencies.vb | 33 +---- 4 files changed, 100 insertions(+), 134 deletions(-) diff --git a/instat/dlgOneWayFrequencies.Designer.vb b/instat/dlgOneWayFrequencies.Designer.vb index 60b119727ce..e094a356f64 100644 --- a/instat/dlgOneWayFrequencies.Designer.vb +++ b/instat/dlgOneWayFrequencies.Designer.vb @@ -186,7 +186,7 @@ Partial Class dlgOneWayFrequencies ' Me.ucrNudGroups.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudGroups.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudGroups.Location = New System.Drawing.Point(132, 228) + Me.ucrNudGroups.Location = New System.Drawing.Point(130, 228) Me.ucrNudGroups.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudGroups.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudGroups.Name = "ucrNudGroups" diff --git a/instat/dlgOneWayFrequencies.vb b/instat/dlgOneWayFrequencies.vb index 543cb5db6ba..9448917db8e 100644 --- a/instat/dlgOneWayFrequencies.vb +++ b/instat/dlgOneWayFrequencies.vb @@ -39,14 +39,15 @@ Public Class dlgOneWayFrequencies Public Sub SetRCodeForControls(bReset As Boolean) ucrReceiverOneWayFreq.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrReceiverWeights.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - ucrChkGraph.SetRCode(clsSjpFrq, bReset) - ucrChkTable.SetRCode(clsSjtFreq, bReset) + ucrChkGraph.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + ucrChkTable.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrChkWeights.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrPnlSort.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrChkFlip.SetRCode(clsSjpFrq, bReset) ucrNudGroups.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + ucrChkGroupData.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) End Sub @@ -84,9 +85,10 @@ Public Class dlgOneWayFrequencies ucrChkGroupData.SetText("Group Data") ucrNudGroups.SetMinMax(2, 100) ucrNudGroups.Increment = 5 + ucrNudGroups.SetParameter(New RParameter("auto.group")) - ucrChkGroupData.AddToLinkedControls(ucrNudGroups, {True}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True) - ucrChkGroupData.SetParameter(ucrNudGroups.GetParameter, bNewAddRemoveParameter:=False, bNewChangeParameterValue:=True) + ucrChkGroupData.SetParameter(ucrNudGroups.GetParameter(), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) + ucrChkGroupData.AddToLinkedControls(ucrNudGroups, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=10) ucrChkFlip.SetText("Flip Coordinates") ucrChkFlip.SetParameter(New RParameter("coord.flip", 1)) @@ -98,24 +100,30 @@ Public Class dlgOneWayFrequencies clsSjtFreq = New RFunction clsSjpFrq = New RFunction ucrSelectorOneWayFreq.Reset() + sdgOneWayFrequencies.ucrSaveGraph.Reset() + sdgOneWayFrequencies.ucrInputGraphTitle.SetName("") + sdgOneWayFrequencies.ucrInputHorizontalLabels.Reset() + sdgOneWayFrequencies.ucrInputVerticalLabels.Reset() ucrReceiverOneWayFreq.SetParameter(New RParameter("data", 1)) ucrReceiverOneWayFreq.SetParameterIsRFunction() clsSjtFreq.SetRCommand("sjt.frq") clsSjtFreq.AddParameter("sort.frq", Chr(34) & "none" & Chr(34)) + 'parameter added to have the default to False (R default is TRUE) clsSjtFreq.AddParameter("show.summary", "FALSE") - clsSjtFreq.AddParameter("auto.group", 10) + clsSjtFreq.AddParameter("skip.zero", "FALSE") + 'defining the digit default value clsSjtFreq.AddParameter("digits", 0) clsSjpFrq.SetRCommand("sjp.frq") clsSjpFrq.AddParameter("sort.frq", Chr(34) & "none" & Chr(34)) clsSjpFrq.AddParameter("type", Chr(34) & "bar" & Chr(34)) - clsSjpFrq.AddParameter("vjust", Chr(34) & "left" & Chr(34)) - clsSjpFrq.AddParameter("hjust", Chr(34) & "left" & Chr(34)) + clsSjpFrq.AddParameter("vjust", Chr(34) & "bottom" & Chr(34)) + clsSjpFrq.AddParameter("hjust", Chr(34) & "center" & Chr(34)) + 'parameter added to have the check box checked on default clsSjpFrq.AddParameter("show.prc", "TRUE") + 'parameter added to have the default to False (R default is TRUE) clsSjpFrq.AddParameter("show.n", "FALSE") - - clsSjpFrq.AddParameter("auto.group", 10) - clsSjpFrq.SetAssignTo("onevar_graph", strTempDataframe:=ucrSelectorOneWayFreq.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="onevar_graph") + clsSjpFrq.SetAssignTo("last_graph", strTempDataframe:=ucrSelectorOneWayFreq.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") ucrBase.clsRsyntax.SetBaseRFunction(clsSjtFreq) bResetSubdialog = True @@ -141,10 +149,12 @@ Public Class dlgOneWayFrequencies If ucrChkTable.Checked Then ' ucrBase.clsRsyntax.bHTMLOutput = True ucrBase.clsRsyntax.iCallType = 0 - ElseIf ucrChkGraph.Checked + End If + If ucrChkGraph.Checked Then ' ucrBase.clsRsyntax.bHTMLOutput = False ucrBase.clsRsyntax.iCallType = 3 - Else 'temporary fix to ensure graphs are displayed in the output window before a wrapper for displaying both tables and graphs at the same time on the output window is implemented + End If + If Not (ucrChkGraph.Checked AndAlso ucrChkTable.Checked) Then 'temporary fix to ensure graphs are displayed in the output window before a wrapper for displaying both tables and graphs at the same time on the output window is implemented ucrBase.clsRsyntax.iCallType = 3 End If End Sub @@ -154,16 +164,17 @@ Public Class dlgOneWayFrequencies ucrReceiverOneWayFreq.SetParameter(New RParameter("data", 1)) ucrReceiverOneWayFreq.SetParameterIsRFunction() ucrBase.clsRsyntax.SetBaseRFunction(clsSjtFreq) - ElseIf ucrChkGraph.Checked Then + End If + If ucrChkGraph.Checked Then ucrReceiverOneWayFreq.SetParameter(New RParameter("var.cnt", 1)) ucrReceiverOneWayFreq.SetParameterIsRFunction() ucrBase.clsRsyntax.SetBaseRFunction(clsSjpFrq) + End If - Else + If ucrChkGraph.Checked = False AndAlso ucrChkTable.Checked = False Then ucrReceiverOneWayFreq.SetParameter(New RParameter("var.cnt", 1)) ucrReceiverOneWayFreq.SetParameterIsRFunction() ucrBase.clsRsyntax.SetBaseRFunction(clsSjpFrq) - End If SetRCodeForControls(False) End Sub diff --git a/instat/sdgOneWayFrequencies.Designer.vb b/instat/sdgOneWayFrequencies.Designer.vb index 5835dabcb09..eea06cabc71 100644 --- a/instat/sdgOneWayFrequencies.Designer.vb +++ b/instat/sdgOneWayFrequencies.Designer.vb @@ -25,30 +25,28 @@ Partial Class sdgOneWayFrequencies Me.tbOneWayFrequencies = New System.Windows.Forms.TabControl() Me.tbTable = New System.Windows.Forms.TabPage() Me.grpTableOptions = New System.Windows.Forms.GroupBox() + Me.Label1 = New System.Windows.Forms.Label() Me.tbGraph = New System.Windows.Forms.TabPage() Me.grpGraphOptions = New System.Windows.Forms.GroupBox() + Me.lblTitle = New System.Windows.Forms.Label() + Me.lblHjust = New System.Windows.Forms.Label() + Me.lblVjust = New System.Windows.Forms.Label() Me.grpGraphType = New System.Windows.Forms.GroupBox() Me.rdoLine = New System.Windows.Forms.RadioButton() Me.rdoDot = New System.Windows.Forms.RadioButton() Me.rdoBar = New System.Windows.Forms.RadioButton() Me.ucrNudDecimalPlaces = New instat.ucrNud() - Me.ucrChkDecimalPlaces = New instat.ucrCheck() Me.ucrChkOmitZero = New instat.ucrCheck() Me.ucrChkHighlightedRows = New instat.ucrCheck() Me.ucrChkMedian = New instat.ucrCheck() Me.ucrChkShowSummary = New instat.ucrCheck() Me.ucrSaveGraph = New instat.ucrSave() Me.ucrInputGraphTitle = New instat.ucrInputTextBox() - Me.ucrInputColour = New instat.ucrInputComboBox() Me.ucrInputHorizontalLabels = New instat.ucrInputComboBox() Me.ucrInputVerticalLabels = New instat.ucrInputComboBox() - Me.ucrChkColour = New instat.ucrCheck() - Me.ucrChkGraphTitle = New instat.ucrCheck() - Me.ucrChkHorizontalLabelPosition = New instat.ucrCheck() Me.ucrChkShowMissing = New instat.ucrCheck() Me.ucrChkShowPercentage = New instat.ucrCheck() Me.ucrChkShowCount = New instat.ucrCheck() - Me.ucrChkVerticalLabelPosition = New instat.ucrCheck() Me.ucrPnlGraphType = New instat.UcrPanel() Me.ucrBaseSubDialogue = New instat.ucrButtonsSubdialogue() Me.tbOneWayFrequencies.SuspendLayout() @@ -66,7 +64,7 @@ Partial Class sdgOneWayFrequencies Me.tbOneWayFrequencies.Location = New System.Drawing.Point(12, 12) Me.tbOneWayFrequencies.Name = "tbOneWayFrequencies" Me.tbOneWayFrequencies.SelectedIndex = 0 - Me.tbOneWayFrequencies.Size = New System.Drawing.Size(402, 320) + Me.tbOneWayFrequencies.Size = New System.Drawing.Size(352, 308) Me.tbOneWayFrequencies.TabIndex = 1 ' 'tbTable @@ -75,15 +73,15 @@ Partial Class sdgOneWayFrequencies Me.tbTable.Location = New System.Drawing.Point(4, 22) Me.tbTable.Name = "tbTable" Me.tbTable.Padding = New System.Windows.Forms.Padding(3) - Me.tbTable.Size = New System.Drawing.Size(394, 294) + Me.tbTable.Size = New System.Drawing.Size(344, 282) Me.tbTable.TabIndex = 0 Me.tbTable.Text = "Table" Me.tbTable.UseVisualStyleBackColor = True ' 'grpTableOptions ' + Me.grpTableOptions.Controls.Add(Me.Label1) Me.grpTableOptions.Controls.Add(Me.ucrNudDecimalPlaces) - Me.grpTableOptions.Controls.Add(Me.ucrChkDecimalPlaces) Me.grpTableOptions.Controls.Add(Me.ucrChkOmitZero) Me.grpTableOptions.Controls.Add(Me.ucrChkHighlightedRows) Me.grpTableOptions.Controls.Add(Me.ucrChkMedian) @@ -95,6 +93,15 @@ Partial Class sdgOneWayFrequencies Me.grpTableOptions.TabStop = False Me.grpTableOptions.Text = "More Options" ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(8, 115) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(159, 13) + Me.Label1.TabIndex = 56 + Me.Label1.Text = "Decimal places for percentages:" + ' 'tbGraph ' Me.tbGraph.Controls.Add(Me.ucrSaveGraph) @@ -103,31 +110,56 @@ Partial Class sdgOneWayFrequencies Me.tbGraph.Location = New System.Drawing.Point(4, 22) Me.tbGraph.Name = "tbGraph" Me.tbGraph.Padding = New System.Windows.Forms.Padding(3) - Me.tbGraph.Size = New System.Drawing.Size(394, 294) + Me.tbGraph.Size = New System.Drawing.Size(344, 282) Me.tbGraph.TabIndex = 1 Me.tbGraph.Text = "Graph" Me.tbGraph.UseVisualStyleBackColor = True ' 'grpGraphOptions ' + Me.grpGraphOptions.Controls.Add(Me.lblTitle) + Me.grpGraphOptions.Controls.Add(Me.lblHjust) + Me.grpGraphOptions.Controls.Add(Me.lblVjust) Me.grpGraphOptions.Controls.Add(Me.ucrInputGraphTitle) - Me.grpGraphOptions.Controls.Add(Me.ucrInputColour) Me.grpGraphOptions.Controls.Add(Me.ucrInputHorizontalLabels) Me.grpGraphOptions.Controls.Add(Me.ucrInputVerticalLabels) - Me.grpGraphOptions.Controls.Add(Me.ucrChkColour) - Me.grpGraphOptions.Controls.Add(Me.ucrChkGraphTitle) - Me.grpGraphOptions.Controls.Add(Me.ucrChkHorizontalLabelPosition) Me.grpGraphOptions.Controls.Add(Me.ucrChkShowMissing) Me.grpGraphOptions.Controls.Add(Me.ucrChkShowPercentage) Me.grpGraphOptions.Controls.Add(Me.ucrChkShowCount) - Me.grpGraphOptions.Controls.Add(Me.ucrChkVerticalLabelPosition) Me.grpGraphOptions.Location = New System.Drawing.Point(6, 59) Me.grpGraphOptions.Name = "grpGraphOptions" - Me.grpGraphOptions.Size = New System.Drawing.Size(381, 196) + Me.grpGraphOptions.Size = New System.Drawing.Size(329, 184) Me.grpGraphOptions.TabIndex = 37 Me.grpGraphOptions.TabStop = False Me.grpGraphOptions.Text = "Graph Options" ' + 'lblTitle + ' + Me.lblTitle.AutoSize = True + Me.lblTitle.Location = New System.Drawing.Point(13, 154) + Me.lblTitle.Name = "lblTitle" + Me.lblTitle.Size = New System.Drawing.Size(62, 13) + Me.lblTitle.TabIndex = 58 + Me.lblTitle.Text = "Graph Title:" + ' + 'lblHjust + ' + Me.lblHjust.AutoSize = True + Me.lblHjust.Location = New System.Drawing.Point(13, 131) + Me.lblHjust.Name = "lblHjust" + Me.lblHjust.Size = New System.Drawing.Size(126, 13) + Me.lblHjust.TabIndex = 57 + Me.lblHjust.Text = "Horizontal Label Position:" + ' + 'lblVjust + ' + Me.lblVjust.AutoSize = True + Me.lblVjust.Location = New System.Drawing.Point(13, 103) + Me.lblVjust.Name = "lblVjust" + Me.lblVjust.Size = New System.Drawing.Size(114, 13) + Me.lblVjust.TabIndex = 55 + Me.lblVjust.Text = "Vertical Label Position:" + ' 'grpGraphType ' Me.grpGraphType.Controls.Add(Me.rdoLine) @@ -136,7 +168,7 @@ Partial Class sdgOneWayFrequencies Me.grpGraphType.Controls.Add(Me.ucrPnlGraphType) Me.grpGraphType.Location = New System.Drawing.Point(6, 6) Me.grpGraphType.Name = "grpGraphType" - Me.grpGraphType.Size = New System.Drawing.Size(381, 48) + Me.grpGraphType.Size = New System.Drawing.Size(327, 48) Me.grpGraphType.TabIndex = 33 Me.grpGraphType.TabStop = False Me.grpGraphType.Text = "Type of Graph" @@ -144,7 +176,7 @@ Partial Class sdgOneWayFrequencies 'rdoLine ' Me.rdoLine.AutoSize = True - Me.rdoLine.Location = New System.Drawing.Point(275, 19) + Me.rdoLine.Location = New System.Drawing.Point(242, 19) Me.rdoLine.Name = "rdoLine" Me.rdoLine.Size = New System.Drawing.Size(77, 17) Me.rdoLine.TabIndex = 7 @@ -155,7 +187,7 @@ Partial Class sdgOneWayFrequencies 'rdoDot ' Me.rdoDot.AutoSize = True - Me.rdoDot.Location = New System.Drawing.Point(134, 19) + Me.rdoDot.Location = New System.Drawing.Point(118, 19) Me.rdoDot.Name = "rdoDot" Me.rdoDot.Size = New System.Drawing.Size(74, 17) Me.rdoDot.TabIndex = 6 @@ -166,7 +198,7 @@ Partial Class sdgOneWayFrequencies 'rdoBar ' Me.rdoBar.AutoSize = True - Me.rdoBar.Location = New System.Drawing.Point(15, 19) + Me.rdoBar.Location = New System.Drawing.Point(6, 19) Me.rdoBar.Name = "rdoBar" Me.rdoBar.Size = New System.Drawing.Size(73, 17) Me.rdoBar.TabIndex = 5 @@ -178,7 +210,7 @@ Partial Class sdgOneWayFrequencies ' Me.ucrNudDecimalPlaces.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudDecimalPlaces.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudDecimalPlaces.Location = New System.Drawing.Point(173, 90) + Me.ucrNudDecimalPlaces.Location = New System.Drawing.Point(179, 114) Me.ucrNudDecimalPlaces.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudDecimalPlaces.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudDecimalPlaces.Name = "ucrNudDecimalPlaces" @@ -186,18 +218,10 @@ Partial Class sdgOneWayFrequencies Me.ucrNudDecimalPlaces.TabIndex = 50 Me.ucrNudDecimalPlaces.Value = New Decimal(New Integer() {0, 0, 0, 0}) ' - 'ucrChkDecimalPlaces - ' - Me.ucrChkDecimalPlaces.Checked = False - Me.ucrChkDecimalPlaces.Location = New System.Drawing.Point(8, 90) - Me.ucrChkDecimalPlaces.Name = "ucrChkDecimalPlaces" - Me.ucrChkDecimalPlaces.Size = New System.Drawing.Size(145, 20) - Me.ucrChkDecimalPlaces.TabIndex = 49 - ' 'ucrChkOmitZero ' Me.ucrChkOmitZero.Checked = False - Me.ucrChkOmitZero.Location = New System.Drawing.Point(8, 114) + Me.ucrChkOmitZero.Location = New System.Drawing.Point(8, 88) Me.ucrChkOmitZero.Name = "ucrChkOmitZero" Me.ucrChkOmitZero.Size = New System.Drawing.Size(262, 20) Me.ucrChkOmitZero.TabIndex = 23 @@ -228,7 +252,7 @@ Partial Class sdgOneWayFrequencies ' 'ucrSaveGraph ' - Me.ucrSaveGraph.Location = New System.Drawing.Point(12, 261) + Me.ucrSaveGraph.Location = New System.Drawing.Point(19, 252) Me.ucrSaveGraph.Name = "ucrSaveGraph" Me.ucrSaveGraph.Size = New System.Drawing.Size(294, 24) Me.ucrSaveGraph.TabIndex = 39 @@ -238,26 +262,16 @@ Partial Class sdgOneWayFrequencies Me.ucrInputGraphTitle.AddQuotesIfUnrecognised = True Me.ucrInputGraphTitle.IsMultiline = False Me.ucrInputGraphTitle.IsReadOnly = False - Me.ucrInputGraphTitle.Location = New System.Drawing.Point(187, 162) + Me.ucrInputGraphTitle.Location = New System.Drawing.Point(165, 155) Me.ucrInputGraphTitle.Name = "ucrInputGraphTitle" Me.ucrInputGraphTitle.Size = New System.Drawing.Size(137, 21) Me.ucrInputGraphTitle.TabIndex = 54 ' - 'ucrInputColour - ' - Me.ucrInputColour.AddQuotesIfUnrecognised = True - Me.ucrInputColour.IsReadOnly = False - Me.ucrInputColour.Location = New System.Drawing.Point(187, 139) - Me.ucrInputColour.Margin = New System.Windows.Forms.Padding(21, 17, 21, 17) - Me.ucrInputColour.Name = "ucrInputColour" - Me.ucrInputColour.Size = New System.Drawing.Size(137, 21) - Me.ucrInputColour.TabIndex = 53 - ' 'ucrInputHorizontalLabels ' Me.ucrInputHorizontalLabels.AddQuotesIfUnrecognised = True Me.ucrInputHorizontalLabels.IsReadOnly = False - Me.ucrInputHorizontalLabels.Location = New System.Drawing.Point(187, 115) + Me.ucrInputHorizontalLabels.Location = New System.Drawing.Point(165, 125) Me.ucrInputHorizontalLabels.Margin = New System.Windows.Forms.Padding(21, 17, 21, 17) Me.ucrInputHorizontalLabels.Name = "ucrInputHorizontalLabels" Me.ucrInputHorizontalLabels.Size = New System.Drawing.Size(137, 21) @@ -267,40 +281,16 @@ Partial Class sdgOneWayFrequencies ' Me.ucrInputVerticalLabels.AddQuotesIfUnrecognised = True Me.ucrInputVerticalLabels.IsReadOnly = False - Me.ucrInputVerticalLabels.Location = New System.Drawing.Point(187, 91) + Me.ucrInputVerticalLabels.Location = New System.Drawing.Point(165, 99) Me.ucrInputVerticalLabels.Margin = New System.Windows.Forms.Padding(21, 17, 21, 17) Me.ucrInputVerticalLabels.Name = "ucrInputVerticalLabels" Me.ucrInputVerticalLabels.Size = New System.Drawing.Size(137, 21) Me.ucrInputVerticalLabels.TabIndex = 50 ' - 'ucrChkColour - ' - Me.ucrChkColour.Checked = False - Me.ucrChkColour.Location = New System.Drawing.Point(6, 139) - Me.ucrChkColour.Name = "ucrChkColour" - Me.ucrChkColour.Size = New System.Drawing.Size(170, 20) - Me.ucrChkColour.TabIndex = 49 - ' - 'ucrChkGraphTitle - ' - Me.ucrChkGraphTitle.Checked = False - Me.ucrChkGraphTitle.Location = New System.Drawing.Point(6, 163) - Me.ucrChkGraphTitle.Name = "ucrChkGraphTitle" - Me.ucrChkGraphTitle.Size = New System.Drawing.Size(170, 20) - Me.ucrChkGraphTitle.TabIndex = 48 - ' - 'ucrChkHorizontalLabelPosition - ' - Me.ucrChkHorizontalLabelPosition.Checked = False - Me.ucrChkHorizontalLabelPosition.Location = New System.Drawing.Point(6, 115) - Me.ucrChkHorizontalLabelPosition.Name = "ucrChkHorizontalLabelPosition" - Me.ucrChkHorizontalLabelPosition.Size = New System.Drawing.Size(179, 20) - Me.ucrChkHorizontalLabelPosition.TabIndex = 47 - ' 'ucrChkShowMissing ' Me.ucrChkShowMissing.Checked = False - Me.ucrChkShowMissing.Location = New System.Drawing.Point(6, 67) + Me.ucrChkShowMissing.Location = New System.Drawing.Point(13, 75) Me.ucrChkShowMissing.Name = "ucrChkShowMissing" Me.ucrChkShowMissing.Size = New System.Drawing.Size(145, 20) Me.ucrChkShowMissing.TabIndex = 28 @@ -308,7 +298,7 @@ Partial Class sdgOneWayFrequencies 'ucrChkShowPercentage ' Me.ucrChkShowPercentage.Checked = False - Me.ucrChkShowPercentage.Location = New System.Drawing.Point(6, 19) + Me.ucrChkShowPercentage.Location = New System.Drawing.Point(13, 19) Me.ucrChkShowPercentage.Name = "ucrChkShowPercentage" Me.ucrChkShowPercentage.Size = New System.Drawing.Size(145, 20) Me.ucrChkShowPercentage.TabIndex = 20 @@ -316,29 +306,21 @@ Partial Class sdgOneWayFrequencies 'ucrChkShowCount ' Me.ucrChkShowCount.Checked = False - Me.ucrChkShowCount.Location = New System.Drawing.Point(6, 43) + Me.ucrChkShowCount.Location = New System.Drawing.Point(13, 47) Me.ucrChkShowCount.Name = "ucrChkShowCount" Me.ucrChkShowCount.Size = New System.Drawing.Size(145, 20) Me.ucrChkShowCount.TabIndex = 18 ' - 'ucrChkVerticalLabelPosition - ' - Me.ucrChkVerticalLabelPosition.Checked = False - Me.ucrChkVerticalLabelPosition.Location = New System.Drawing.Point(6, 91) - Me.ucrChkVerticalLabelPosition.Name = "ucrChkVerticalLabelPosition" - Me.ucrChkVerticalLabelPosition.Size = New System.Drawing.Size(170, 20) - Me.ucrChkVerticalLabelPosition.TabIndex = 38 - ' 'ucrPnlGraphType ' Me.ucrPnlGraphType.Location = New System.Drawing.Point(6, 7) Me.ucrPnlGraphType.Name = "ucrPnlGraphType" - Me.ucrPnlGraphType.Size = New System.Drawing.Size(369, 44) + Me.ucrPnlGraphType.Size = New System.Drawing.Size(323, 44) Me.ucrPnlGraphType.TabIndex = 4 ' 'ucrBaseSubDialogue ' - Me.ucrBaseSubDialogue.Location = New System.Drawing.Point(134, 338) + Me.ucrBaseSubDialogue.Location = New System.Drawing.Point(93, 325) Me.ucrBaseSubDialogue.Name = "ucrBaseSubDialogue" Me.ucrBaseSubDialogue.Size = New System.Drawing.Size(142, 30) Me.ucrBaseSubDialogue.TabIndex = 0 @@ -347,7 +329,7 @@ Partial Class sdgOneWayFrequencies ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(421, 375) + Me.ClientSize = New System.Drawing.Size(376, 368) Me.Controls.Add(Me.tbOneWayFrequencies) Me.Controls.Add(Me.ucrBaseSubDialogue) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow @@ -359,8 +341,10 @@ Partial Class sdgOneWayFrequencies Me.tbOneWayFrequencies.ResumeLayout(False) Me.tbTable.ResumeLayout(False) Me.grpTableOptions.ResumeLayout(False) + Me.grpTableOptions.PerformLayout() Me.tbGraph.ResumeLayout(False) Me.grpGraphOptions.ResumeLayout(False) + Me.grpGraphOptions.PerformLayout() Me.grpGraphType.ResumeLayout(False) Me.grpGraphType.PerformLayout() Me.ResumeLayout(False) @@ -379,21 +363,19 @@ Partial Class sdgOneWayFrequencies Friend WithEvents ucrChkShowMissing As ucrCheck Friend WithEvents ucrChkShowPercentage As ucrCheck Friend WithEvents ucrChkShowCount As ucrCheck - Friend WithEvents ucrChkVerticalLabelPosition As ucrCheck - Friend WithEvents ucrChkColour As ucrCheck - Friend WithEvents ucrChkGraphTitle As ucrCheck - Friend WithEvents ucrChkHorizontalLabelPosition As ucrCheck Friend WithEvents ucrInputHorizontalLabels As ucrInputComboBox Friend WithEvents ucrInputVerticalLabels As ucrInputComboBox - Friend WithEvents ucrInputColour As ucrInputComboBox Friend WithEvents ucrInputGraphTitle As ucrInputTextBox Friend WithEvents ucrChkOmitZero As ucrCheck Friend WithEvents ucrNudDecimalPlaces As ucrNud - Friend WithEvents ucrChkDecimalPlaces As ucrCheck Friend WithEvents grpGraphType As GroupBox Friend WithEvents ucrPnlGraphType As UcrPanel Friend WithEvents rdoLine As RadioButton Friend WithEvents rdoDot As RadioButton Friend WithEvents rdoBar As RadioButton Friend WithEvents ucrSaveGraph As ucrSave + Friend WithEvents lblTitle As Label + Friend WithEvents lblHjust As Label + Friend WithEvents lblVjust As Label + Friend WithEvents Label1 As Label End Class diff --git a/instat/sdgOneWayFrequencies.vb b/instat/sdgOneWayFrequencies.vb index 6e49a34ff35..9dbb3528f8a 100644 --- a/instat/sdgOneWayFrequencies.vb +++ b/instat/sdgOneWayFrequencies.vb @@ -35,6 +35,7 @@ Public Class sdgOneWayFrequencies dctHorizontalPositionLabel.Add("Inward", Chr(34) & "inward" & Chr(34)) dctHorizontalPositionLabel.Add("Outward", Chr(34) & "outward" & Chr(34)) ucrInputHorizontalLabels.SetItems(dctHorizontalPositionLabel) + ucrInputHorizontalLabels.SetRDefault(Chr(34) & "center" & Chr(34)) ucrInputVerticalLabels.SetParameter(New RParameter("vjust")) dctVerticalPositionLabel.Add("Left", Chr(34) & "left" & Chr(34)) @@ -45,12 +46,12 @@ Public Class sdgOneWayFrequencies dctVerticalPositionLabel.Add("Inward", Chr(34) & "inward" & Chr(34)) dctVerticalPositionLabel.Add("Outward", Chr(34) & "outward" & Chr(34)) ucrInputVerticalLabels.SetItems(dctVerticalPositionLabel) + ucrInputVerticalLabels.SetRDefault(Chr(34) & "bottom" & Chr(34)) ucrChkMedian.SetText("Emphasise Median") ucrChkMedian.SetParameter(New RParameter("emph.md"), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") ucrChkMedian.SetRDefault("FALSE") - 'Set to unchecked on default(Default is TRUE) ucrChkShowSummary.SetText("Show Summary") ucrChkShowSummary.SetParameter(New RParameter("show.summary"), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") @@ -58,11 +59,7 @@ Public Class sdgOneWayFrequencies ucrChkOmitZero.SetText("Omit Zero Counts from Table") ucrChkOmitZero.SetParameter(New RParameter("skip.zero"), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") - - ucrChkDecimalPlaces.SetText("Decimal places for percentages") ucrNudDecimalPlaces.SetParameter(New RParameter("digits")) - ucrChkDecimalPlaces.AddToLinkedControls(ucrNudDecimalPlaces, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - ucrChkDecimalPlaces.SetParameter(ucrNudDecimalPlaces.GetParameter, bNewAddRemoveParameter:=True, bNewChangeParameterValue:=True) ucrNudDecimalPlaces.SetMinMax(0, 4) ucrChkHighlightedRows.SetText("Alternate Rows Coloured") @@ -76,26 +73,7 @@ Public Class sdgOneWayFrequencies ucrChkShowPercentage.SetText("Show Percentage") ucrChkShowPercentage.SetParameter(New RParameter("show.prc"), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") - ucrChkVerticalLabelPosition.SetText("Vertical Label Positions") - ' ucrChkVerticalLabelPosition.SetParameter(ucrInputVerticalLabels.GetParameter, bNewAddRemoveParameter:=True, bNewChangeParameterValue:=True) - ucrChkVerticalLabelPosition.AddToLinkedControls(ucrInputVerticalLabels, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - - ucrChkHorizontalLabelPosition.SetText("Horizontal Label Positions") - ' ucrChkHorizontalLabelPosition.SetParameter(ucrInputHorizontalLabels.GetParameter, bNewAddRemoveParameter:=True, bNewChangeParameterValue:=True) - ucrChkHorizontalLabelPosition.AddToLinkedControls(ucrInputHorizontalLabels, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - - 'not implemented - ucrChkColour.Enabled = False - ucrInputColour.Enabled = False - ucrInputColour.bAllowNonConditionValues = False - ucrChkColour.bAllowNonConditionValues = False - 'ucrChkColour.SetText("Colour") - 'ucrChkColour.AddToLinkedControls(ucrInputColour, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - - ucrChkGraphTitle.SetText("Title") ucrInputGraphTitle.SetParameter(New RParameter("title")) - ' ucrChkGraphTitle.SetParameter(ucrInputGraphTitle.GetParameter(), bNewAddRemoveParameter:=True, bNewChangeParameterValue:=True) - ucrChkGraphTitle.AddToLinkedControls(ucrInputGraphTitle, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrChkShowMissing.SetText("Show Missing") ucrChkShowMissing.SetParameter(New RParameter("show.na"), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") @@ -131,15 +109,10 @@ Public Class sdgOneWayFrequencies ucrChkShowCount.SetRCode(clsOneWayGraphFreq, bReset) ucrChkShowPercentage.SetRCode(clsOneWayGraphFreq, bReset) ucrChkShowMissing.SetRCode(clsOneWayGraphFreq, bReset) - ucrChkVerticalLabelPosition.SetRCode(clsOneWayGraphFreq, bReset) - ucrChkHorizontalLabelPosition.SetRCode(clsOneWayGraphFreq, bReset) - 'ucrChkColour.SetRCode(clsOneWayGraphFreq, bReset) - ucrChkGraphTitle.SetRCode(clsOneWayGraphFreq, bReset) ucrPnlGraphType.SetRCode(clsOneWayGraphFreq, bReset) ucrInputVerticalLabels.SetRCode(clsOneWayGraphFreq, bReset) ucrInputHorizontalLabels.SetRCode(clsOneWayGraphFreq, bReset) - ucrInputColour.SetRCode(clsOneWayGraphFreq, bReset) - ucrChkGraphTitle.SetRCode(clsOneWayGraphFreq, bReset) + ucrInputGraphTitle.SetRCode(clsOneWayGraphFreq, bReset) ucrSaveGraph.SetRCode(clsOneWayGraphFreq, bReset) End Sub End Class \ No newline at end of file From dec906730d4b498cc8785c9fdef584c044f481be Mon Sep 17 00:00:00 2001 From: steven ndung'u Date: Fri, 31 Mar 2017 15:13:43 +0300 Subject: [PATCH 32/66] sdg resource file --- instat/sdgOneWayFrequencies.resx | 120 +++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 instat/sdgOneWayFrequencies.resx diff --git a/instat/sdgOneWayFrequencies.resx b/instat/sdgOneWayFrequencies.resx new file mode 100644 index 00000000000..29dcb1b3a35 --- /dev/null +++ b/instat/sdgOneWayFrequencies.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 From 87ade65b4fbe9197a2134aac3c556c328c743546 Mon Sep 17 00:00:00 2001 From: Lily Date: Fri, 31 Mar 2017 13:49:27 +0100 Subject: [PATCH 33/66] Bug fix + layout + tab order --- instat/dlgDescribeOneVariable.Designer.vb | 26 +++++++++++------------ instat/dlgDescribeOneVariable.vb | 5 +---- instat/sdgSummaries.Designer.vb | 6 +++--- instat/sdgSummaries.vb | 1 - 4 files changed, 17 insertions(+), 21 deletions(-) diff --git a/instat/dlgDescribeOneVariable.Designer.vb b/instat/dlgDescribeOneVariable.Designer.vb index 2f892977d5c..8cb78083751 100644 --- a/instat/dlgDescribeOneVariable.Designer.vb +++ b/instat/dlgDescribeOneVariable.Designer.vb @@ -34,17 +34,17 @@ Partial Class dlgDescribeOneVariable ' 'cmdSummaries ' - Me.cmdSummaries.Location = New System.Drawing.Point(306, 175) + Me.cmdSummaries.Location = New System.Drawing.Point(305, 189) Me.cmdSummaries.Name = "cmdSummaries" - Me.cmdSummaries.Size = New System.Drawing.Size(75, 23) - Me.cmdSummaries.TabIndex = 6 + Me.cmdSummaries.Size = New System.Drawing.Size(76, 23) + Me.cmdSummaries.TabIndex = 4 Me.cmdSummaries.Tag = "Summaries" Me.cmdSummaries.Text = "Summaries..." Me.cmdSummaries.UseVisualStyleBackColor = True ' 'lblSelectedVariable ' - Me.lblSelectedVariable.Location = New System.Drawing.Point(262, 27) + Me.lblSelectedVariable.Location = New System.Drawing.Point(261, 45) Me.lblSelectedVariable.Name = "lblSelectedVariable" Me.lblSelectedVariable.Size = New System.Drawing.Size(124, 14) Me.lblSelectedVariable.TabIndex = 1 @@ -53,7 +53,7 @@ Partial Class dlgDescribeOneVariable ' 'ucrBaseDescribeOneVar ' - Me.ucrBaseDescribeOneVar.Location = New System.Drawing.Point(10, 229) + Me.ucrBaseDescribeOneVar.Location = New System.Drawing.Point(10, 252) Me.ucrBaseDescribeOneVar.Name = "ucrBaseDescribeOneVar" Me.ucrBaseDescribeOneVar.Size = New System.Drawing.Size(410, 52) Me.ucrBaseDescribeOneVar.TabIndex = 7 @@ -61,7 +61,7 @@ Partial Class dlgDescribeOneVariable 'ucrReceiverDescribeOneVar ' Me.ucrReceiverDescribeOneVar.frmParent = Me - Me.ucrReceiverDescribeOneVar.Location = New System.Drawing.Point(261, 42) + Me.ucrReceiverDescribeOneVar.Location = New System.Drawing.Point(261, 60) Me.ucrReceiverDescribeOneVar.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverDescribeOneVar.Name = "ucrReceiverDescribeOneVar" Me.ucrReceiverDescribeOneVar.Selector = Nothing @@ -81,32 +81,32 @@ Partial Class dlgDescribeOneVariable 'ucrChkOmitMissing ' Me.ucrChkOmitMissing.Checked = False - Me.ucrChkOmitMissing.Location = New System.Drawing.Point(172, 203) + Me.ucrChkOmitMissing.Location = New System.Drawing.Point(10, 200) Me.ucrChkOmitMissing.Name = "ucrChkOmitMissing" Me.ucrChkOmitMissing.Size = New System.Drawing.Size(100, 20) - Me.ucrChkOmitMissing.TabIndex = 8 + Me.ucrChkOmitMissing.TabIndex = 5 ' 'ucrChkSaveResult ' Me.ucrChkSaveResult.Checked = False - Me.ucrChkSaveResult.Location = New System.Drawing.Point(12, 203) + Me.ucrChkSaveResult.Location = New System.Drawing.Point(10, 226) Me.ucrChkSaveResult.Name = "ucrChkSaveResult" Me.ucrChkSaveResult.Size = New System.Drawing.Size(100, 20) - Me.ucrChkSaveResult.TabIndex = 9 + Me.ucrChkSaveResult.TabIndex = 6 ' 'ucrChkCustomise ' Me.ucrChkCustomise.Checked = False - Me.ucrChkCustomise.Location = New System.Drawing.Point(281, 149) + Me.ucrChkCustomise.Location = New System.Drawing.Point(261, 163) Me.ucrChkCustomise.Name = "ucrChkCustomise" Me.ucrChkCustomise.Size = New System.Drawing.Size(100, 20) - Me.ucrChkCustomise.TabIndex = 10 + Me.ucrChkCustomise.TabIndex = 3 ' 'dlgDescribeOneVariable ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(420, 290) + Me.ClientSize = New System.Drawing.Size(416, 310) Me.Controls.Add(Me.ucrChkCustomise) Me.Controls.Add(Me.ucrChkSaveResult) Me.Controls.Add(Me.ucrChkOmitMissing) diff --git a/instat/dlgDescribeOneVariable.vb b/instat/dlgDescribeOneVariable.vb index 8a26b0f14bd..e76c03598e3 100644 --- a/instat/dlgDescribeOneVariable.vb +++ b/instat/dlgDescribeOneVariable.vb @@ -13,7 +13,6 @@ ' ' 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 dlgDescribeOneVariable @@ -29,7 +28,6 @@ Public Class dlgDescribeOneVariable InitialiseDialog() bFirstLoad = False End If - If bReset Then SetDefaults() End If @@ -100,6 +98,7 @@ Public Class dlgDescribeOneVariable ucrChkCustomise.AddFunctionNamesCondition(False, "summary") ucrChkSaveResult.SetText("Save Result") 'this is disabled in the initial implementation + ucrChkSaveResult.Enabled = False 'ucrChkSaveResult.SetParameter(New RParameter("store_results")) 'ucrChkSaveResult.SetValuesCheckedAndUnchecked("TRUE", "FALSE") 'ucrChkSaveResult.SetRDefault("FALSE") @@ -128,13 +127,11 @@ Public Class dlgDescribeOneVariable ucrReceiverDescribeOneVar.SetParameterIsString() 'For the checkbox we just change the parameter name, because we want to keep the same value in the control for the new function. 'Changing the parameter name should be used very cautiously. Normally it is safer to set a new parameter. - ucrChkOmitMissing.ChangeParameterName("drop") cmdSummaries.Enabled = True Else ucrBaseDescribeOneVar.clsRsyntax.SetBaseRFunction(clsSummaryFunction) ucrReceiverDescribeOneVar.SetParameter(New RParameter("object", 0)) ucrReceiverDescribeOneVar.SetParameterIsRFunction() - ucrChkOmitMissing.ChangeParameterName("na.rm") cmdSummaries.Enabled = False End If 'We need to update the base function to include the diff --git a/instat/sdgSummaries.Designer.vb b/instat/sdgSummaries.Designer.vb index fb4aa3c8c2c..f365247a174 100644 --- a/instat/sdgSummaries.Designer.vb +++ b/instat/sdgSummaries.Designer.vb @@ -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, 65) + Me.grpCommon.Size = New System.Drawing.Size(243, 65) Me.grpCommon.TabIndex = 0 Me.grpCommon.TabStop = False Me.grpCommon.Tag = "Common" @@ -193,7 +193,7 @@ Partial Class sdgSummaries ' 'ucrButtonsSummaries ' - Me.ucrButtonsSummaries.Location = New System.Drawing.Point(62, 236) + Me.ucrButtonsSummaries.Location = New System.Drawing.Point(61, 236) Me.ucrButtonsSummaries.Name = "ucrButtonsSummaries" Me.ucrButtonsSummaries.Size = New System.Drawing.Size(142, 30) Me.ucrButtonsSummaries.TabIndex = 3 @@ -202,7 +202,7 @@ Partial Class sdgSummaries ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(270, 266) + Me.ClientSize = New System.Drawing.Size(264, 266) Me.Controls.Add(Me.grpNumeric) Me.Controls.Add(Me.grpCommon) Me.Controls.Add(Me.grpNotOrderedFactor) diff --git a/instat/sdgSummaries.vb b/instat/sdgSummaries.vb index 5114be4c13e..d5d21afba64 100644 --- a/instat/sdgSummaries.vb +++ b/instat/sdgSummaries.vb @@ -13,7 +13,6 @@ ' ' 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 sdgSummaries Public clsListFunction As New RFunction From 21bdef8ad7d3d2bfe744f0d52798ba1f0f877c2d Mon Sep 17 00:00:00 2001 From: Lily Date: Fri, 31 Mar 2017 15:00:19 +0100 Subject: [PATCH 34/66] Changed label name --- instat/dlgDescribeOneVariable.Designer.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/dlgDescribeOneVariable.Designer.vb b/instat/dlgDescribeOneVariable.Designer.vb index 8cb78083751..2fe7145467b 100644 --- a/instat/dlgDescribeOneVariable.Designer.vb +++ b/instat/dlgDescribeOneVariable.Designer.vb @@ -49,7 +49,7 @@ Partial Class dlgDescribeOneVariable Me.lblSelectedVariable.Size = New System.Drawing.Size(124, 14) Me.lblSelectedVariable.TabIndex = 1 Me.lblSelectedVariable.Tag = "Selected_Variable" - Me.lblSelectedVariable.Text = "Selected Variable(s):" + Me.lblSelectedVariable.Text = "Variable(s) to Describe:" ' 'ucrBaseDescribeOneVar ' From ab3d04d39ef0b18082eee77b584015bf26e2304b Mon Sep 17 00:00:00 2001 From: maxwell fundi Date: Mon, 3 Apr 2017 09:39:36 +0300 Subject: [PATCH 35/66] Adding code for SetParameterIsRFunction in ucrVariablesAsFactor --- instat/ucrVariablesAsFactor.vb | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/instat/ucrVariablesAsFactor.vb b/instat/ucrVariablesAsFactor.vb index c1ca8c07bfa..d7ab7778d69 100644 --- a/instat/ucrVariablesAsFactor.vb +++ b/instat/ucrVariablesAsFactor.vb @@ -4,6 +4,7 @@ Public ucrFactorReceiver As ucrReceiverSingle 'The ucrVariablesAsFactor has an associated ucrFactorReceiver, set on the dialog it is living in. In multiple mode, the ucrVariablesAsFactor can receive multiple variables that are then stacked in one and distinguished using a factor variable called "variable". The associated factor receiver will then be set in StackedFactorMode and fix it's content to this "variable" factor. Public WithEvents ucrVariableSelector As ucrSelectorByDataFrame + Public bForceAsDataFrame As Boolean = True Public Sub New() ' This call is required by the designer. @@ -144,12 +145,13 @@ If Not bSingleVariable Then SetMeasureVars() End If - RaiseEvent SelectionChanged() + UpdateParameter() End Sub Private Sub ucrSingleVariable_SelectionChanged(sender As Object, e As EventArgs) Handles ucrSingleVariable.SelectionChanged RaiseEvent SelectionChanged() + UpdateParameter() End Sub Public Function IsEmpty() As Boolean @@ -194,7 +196,7 @@ ucrVariableSelector.ucrAvailableDataFrames.clsCurrDataFrame.AddParameter("id.vars", GetIDVarNamesFromSelector()) End If ucrMultipleVariables.SetMeAsReceiver() - End If + End If End Sub Private Sub ucrVariableSelector_VariablesInReceiversChanged() Handles ucrVariableSelector.VariablesInReceiversChanged @@ -269,4 +271,15 @@ End If End If End Sub + + Public Sub SetParameterIsRFunction() + UpdateParameter() + End Sub + Public Sub UpdateParameter() + If clsParameter Is Nothing Then + clsParameter = New RParameter + End If + 'we dont need parameter as string + clsParameter.SetArgument(GetVariables(bForceAsDataFrame = True)) + End Sub End Class \ No newline at end of file From 5d7f45cb6970d51cbda063480b446a57c8e03b74 Mon Sep 17 00:00:00 2001 From: steven ndung'u Date: Mon, 3 Apr 2017 12:48:27 +0300 Subject: [PATCH 36/66] More edits --- instat/dlgOneWayFrequencies.vb | 24 ++- instat/sdgOneWayFrequencies.Designer.vb | 240 +++++++++++++----------- instat/sdgOneWayFrequencies.vb | 8 + 3 files changed, 154 insertions(+), 118 deletions(-) diff --git a/instat/dlgOneWayFrequencies.vb b/instat/dlgOneWayFrequencies.vb index 9448917db8e..bce6aa01a09 100644 --- a/instat/dlgOneWayFrequencies.vb +++ b/instat/dlgOneWayFrequencies.vb @@ -37,17 +37,25 @@ Public Class dlgOneWayFrequencies End Sub Public Sub SetRCodeForControls(bReset As Boolean) - ucrReceiverOneWayFreq.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - ucrReceiverWeights.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + ucrReceiverOneWayFreq.SetRCode(clsSjpFrq, bReset) + ucrReceiverOneWayFreq.SetRCode(clsSjtFreq, bReset) + ucrReceiverWeights.SetRCode(clsSjpFrq, bReset) + ucrReceiverWeights.SetRCode(clsSjtFreq, bReset) + ucrChkGraph.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + ucrChkTable.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - ucrChkWeights.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - ucrPnlSort.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + ucrChkWeights.SetRCode(clsSjpFrq, bReset) + ucrChkWeights.SetRCode(clsSjtFreq, bReset) + ucrPnlSort.SetRCode(clsSjpFrq, bReset) + ucrPnlSort.SetRCode(clsSjtFreq, bReset) ucrChkFlip.SetRCode(clsSjpFrq, bReset) - ucrNudGroups.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - ucrChkGroupData.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + ucrNudGroups.SetRCode(clsSjpFrq, bReset) + ucrNudGroups.SetRCode(clsSjtFreq, bReset) + ucrChkGroupData.SetRCode(clsSjpFrq, bReset) + ucrChkGroupData.SetRCode(clsSjtFreq, bReset) End Sub @@ -119,14 +127,10 @@ Public Class dlgOneWayFrequencies clsSjpFrq.AddParameter("type", Chr(34) & "bar" & Chr(34)) clsSjpFrq.AddParameter("vjust", Chr(34) & "bottom" & Chr(34)) clsSjpFrq.AddParameter("hjust", Chr(34) & "center" & Chr(34)) - 'parameter added to have the check box checked on default clsSjpFrq.AddParameter("show.prc", "TRUE") - 'parameter added to have the default to False (R default is TRUE) - clsSjpFrq.AddParameter("show.n", "FALSE") clsSjpFrq.SetAssignTo("last_graph", strTempDataframe:=ucrSelectorOneWayFreq.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") ucrBase.clsRsyntax.SetBaseRFunction(clsSjtFreq) bResetSubdialog = True - End Sub Private Sub TestOkEnabled() diff --git a/instat/sdgOneWayFrequencies.Designer.vb b/instat/sdgOneWayFrequencies.Designer.vb index eea06cabc71..76acc0f3507 100644 --- a/instat/sdgOneWayFrequencies.Designer.vb +++ b/instat/sdgOneWayFrequencies.Designer.vb @@ -25,28 +25,30 @@ Partial Class sdgOneWayFrequencies Me.tbOneWayFrequencies = New System.Windows.Forms.TabControl() Me.tbTable = New System.Windows.Forms.TabPage() Me.grpTableOptions = New System.Windows.Forms.GroupBox() + Me.ucrChkCountName = New instat.ucrCheck() + Me.ucrInputCountsName = New instat.ucrInputTextBox() Me.Label1 = New System.Windows.Forms.Label() - Me.tbGraph = New System.Windows.Forms.TabPage() - Me.grpGraphOptions = New System.Windows.Forms.GroupBox() - Me.lblTitle = New System.Windows.Forms.Label() - Me.lblHjust = New System.Windows.Forms.Label() - Me.lblVjust = New System.Windows.Forms.Label() - Me.grpGraphType = New System.Windows.Forms.GroupBox() - Me.rdoLine = New System.Windows.Forms.RadioButton() - Me.rdoDot = New System.Windows.Forms.RadioButton() - Me.rdoBar = New System.Windows.Forms.RadioButton() Me.ucrNudDecimalPlaces = New instat.ucrNud() Me.ucrChkOmitZero = New instat.ucrCheck() Me.ucrChkHighlightedRows = New instat.ucrCheck() Me.ucrChkMedian = New instat.ucrCheck() Me.ucrChkShowSummary = New instat.ucrCheck() + Me.tbGraph = New System.Windows.Forms.TabPage() Me.ucrSaveGraph = New instat.ucrSave() + Me.grpGraphOptions = New System.Windows.Forms.GroupBox() + Me.lblTitle = New System.Windows.Forms.Label() + Me.lblHjust = New System.Windows.Forms.Label() + Me.lblVjust = New System.Windows.Forms.Label() Me.ucrInputGraphTitle = New instat.ucrInputTextBox() Me.ucrInputHorizontalLabels = New instat.ucrInputComboBox() Me.ucrInputVerticalLabels = New instat.ucrInputComboBox() Me.ucrChkShowMissing = New instat.ucrCheck() Me.ucrChkShowPercentage = New instat.ucrCheck() Me.ucrChkShowCount = New instat.ucrCheck() + Me.grpGraphType = New System.Windows.Forms.GroupBox() + Me.rdoLine = New System.Windows.Forms.RadioButton() + Me.rdoDot = New System.Windows.Forms.RadioButton() + Me.rdoBar = New System.Windows.Forms.RadioButton() Me.ucrPnlGraphType = New instat.UcrPanel() Me.ucrBaseSubDialogue = New instat.ucrButtonsSubdialogue() Me.tbOneWayFrequencies.SuspendLayout() @@ -80,6 +82,8 @@ Partial Class sdgOneWayFrequencies ' 'grpTableOptions ' + Me.grpTableOptions.Controls.Add(Me.ucrChkCountName) + Me.grpTableOptions.Controls.Add(Me.ucrInputCountsName) Me.grpTableOptions.Controls.Add(Me.Label1) Me.grpTableOptions.Controls.Add(Me.ucrNudDecimalPlaces) Me.grpTableOptions.Controls.Add(Me.ucrChkOmitZero) @@ -88,20 +92,82 @@ Partial Class sdgOneWayFrequencies Me.grpTableOptions.Controls.Add(Me.ucrChkShowSummary) Me.grpTableOptions.Location = New System.Drawing.Point(17, 6) Me.grpTableOptions.Name = "grpTableOptions" - Me.grpTableOptions.Size = New System.Drawing.Size(345, 151) + Me.grpTableOptions.Size = New System.Drawing.Size(345, 172) Me.grpTableOptions.TabIndex = 21 Me.grpTableOptions.TabStop = False Me.grpTableOptions.Text = "More Options" ' + 'ucrChkCountName + ' + Me.ucrChkCountName.Checked = False + Me.ucrChkCountName.Location = New System.Drawing.Point(8, 114) + Me.ucrChkCountName.Name = "ucrChkCountName" + Me.ucrChkCountName.Size = New System.Drawing.Size(103, 20) + Me.ucrChkCountName.TabIndex = 60 + ' + 'ucrInputCountsName + ' + Me.ucrInputCountsName.AddQuotesIfUnrecognised = True + Me.ucrInputCountsName.IsMultiline = False + Me.ucrInputCountsName.IsReadOnly = False + Me.ucrInputCountsName.Location = New System.Drawing.Point(117, 113) + Me.ucrInputCountsName.Name = "ucrInputCountsName" + Me.ucrInputCountsName.Size = New System.Drawing.Size(137, 21) + Me.ucrInputCountsName.TabIndex = 59 + ' 'Label1 ' Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(8, 115) + Me.Label1.Location = New System.Drawing.Point(5, 137) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(159, 13) Me.Label1.TabIndex = 56 Me.Label1.Text = "Decimal places for percentages:" ' + 'ucrNudDecimalPlaces + ' + Me.ucrNudDecimalPlaces.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudDecimalPlaces.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudDecimalPlaces.Location = New System.Drawing.Point(171, 137) + Me.ucrNudDecimalPlaces.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudDecimalPlaces.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudDecimalPlaces.Name = "ucrNudDecimalPlaces" + Me.ucrNudDecimalPlaces.Size = New System.Drawing.Size(50, 20) + Me.ucrNudDecimalPlaces.TabIndex = 50 + Me.ucrNudDecimalPlaces.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrChkOmitZero + ' + Me.ucrChkOmitZero.Checked = False + Me.ucrChkOmitZero.Location = New System.Drawing.Point(8, 90) + Me.ucrChkOmitZero.Name = "ucrChkOmitZero" + Me.ucrChkOmitZero.Size = New System.Drawing.Size(262, 20) + Me.ucrChkOmitZero.TabIndex = 23 + ' + 'ucrChkHighlightedRows + ' + Me.ucrChkHighlightedRows.Checked = False + Me.ucrChkHighlightedRows.Location = New System.Drawing.Point(8, 42) + Me.ucrChkHighlightedRows.Name = "ucrChkHighlightedRows" + Me.ucrChkHighlightedRows.Size = New System.Drawing.Size(145, 20) + Me.ucrChkHighlightedRows.TabIndex = 22 + ' + 'ucrChkMedian + ' + Me.ucrChkMedian.Checked = False + Me.ucrChkMedian.Location = New System.Drawing.Point(8, 66) + Me.ucrChkMedian.Name = "ucrChkMedian" + Me.ucrChkMedian.Size = New System.Drawing.Size(145, 20) + Me.ucrChkMedian.TabIndex = 21 + ' + 'ucrChkShowSummary + ' + Me.ucrChkShowSummary.Checked = False + Me.ucrChkShowSummary.Location = New System.Drawing.Point(8, 18) + Me.ucrChkShowSummary.Name = "ucrChkShowSummary" + Me.ucrChkShowSummary.Size = New System.Drawing.Size(145, 20) + Me.ucrChkShowSummary.TabIndex = 19 + ' 'tbGraph ' Me.tbGraph.Controls.Add(Me.ucrSaveGraph) @@ -115,6 +181,13 @@ Partial Class sdgOneWayFrequencies Me.tbGraph.Text = "Graph" Me.tbGraph.UseVisualStyleBackColor = True ' + 'ucrSaveGraph + ' + Me.ucrSaveGraph.Location = New System.Drawing.Point(19, 252) + Me.ucrSaveGraph.Name = "ucrSaveGraph" + Me.ucrSaveGraph.Size = New System.Drawing.Size(294, 24) + Me.ucrSaveGraph.TabIndex = 39 + ' 'grpGraphOptions ' Me.grpGraphOptions.Controls.Add(Me.lblTitle) @@ -160,103 +233,6 @@ Partial Class sdgOneWayFrequencies Me.lblVjust.TabIndex = 55 Me.lblVjust.Text = "Vertical Label Position:" ' - 'grpGraphType - ' - Me.grpGraphType.Controls.Add(Me.rdoLine) - Me.grpGraphType.Controls.Add(Me.rdoDot) - Me.grpGraphType.Controls.Add(Me.rdoBar) - Me.grpGraphType.Controls.Add(Me.ucrPnlGraphType) - Me.grpGraphType.Location = New System.Drawing.Point(6, 6) - Me.grpGraphType.Name = "grpGraphType" - Me.grpGraphType.Size = New System.Drawing.Size(327, 48) - Me.grpGraphType.TabIndex = 33 - Me.grpGraphType.TabStop = False - Me.grpGraphType.Text = "Type of Graph" - ' - 'rdoLine - ' - Me.rdoLine.AutoSize = True - Me.rdoLine.Location = New System.Drawing.Point(242, 19) - Me.rdoLine.Name = "rdoLine" - Me.rdoLine.Size = New System.Drawing.Size(77, 17) - Me.rdoLine.TabIndex = 7 - Me.rdoLine.TabStop = True - Me.rdoLine.Text = "Line Graph" - Me.rdoLine.UseVisualStyleBackColor = True - ' - 'rdoDot - ' - Me.rdoDot.AutoSize = True - Me.rdoDot.Location = New System.Drawing.Point(118, 19) - Me.rdoDot.Name = "rdoDot" - Me.rdoDot.Size = New System.Drawing.Size(74, 17) - Me.rdoDot.TabIndex = 6 - Me.rdoDot.TabStop = True - Me.rdoDot.Text = "Dot Graph" - Me.rdoDot.UseVisualStyleBackColor = True - ' - 'rdoBar - ' - Me.rdoBar.AutoSize = True - Me.rdoBar.Location = New System.Drawing.Point(6, 19) - Me.rdoBar.Name = "rdoBar" - Me.rdoBar.Size = New System.Drawing.Size(73, 17) - Me.rdoBar.TabIndex = 5 - Me.rdoBar.TabStop = True - Me.rdoBar.Text = "Bar Graph" - Me.rdoBar.UseVisualStyleBackColor = True - ' - 'ucrNudDecimalPlaces - ' - Me.ucrNudDecimalPlaces.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudDecimalPlaces.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudDecimalPlaces.Location = New System.Drawing.Point(179, 114) - Me.ucrNudDecimalPlaces.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudDecimalPlaces.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudDecimalPlaces.Name = "ucrNudDecimalPlaces" - Me.ucrNudDecimalPlaces.Size = New System.Drawing.Size(50, 20) - Me.ucrNudDecimalPlaces.TabIndex = 50 - Me.ucrNudDecimalPlaces.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrChkOmitZero - ' - Me.ucrChkOmitZero.Checked = False - Me.ucrChkOmitZero.Location = New System.Drawing.Point(8, 88) - Me.ucrChkOmitZero.Name = "ucrChkOmitZero" - Me.ucrChkOmitZero.Size = New System.Drawing.Size(262, 20) - Me.ucrChkOmitZero.TabIndex = 23 - ' - 'ucrChkHighlightedRows - ' - Me.ucrChkHighlightedRows.Checked = False - Me.ucrChkHighlightedRows.Location = New System.Drawing.Point(8, 42) - Me.ucrChkHighlightedRows.Name = "ucrChkHighlightedRows" - Me.ucrChkHighlightedRows.Size = New System.Drawing.Size(145, 20) - Me.ucrChkHighlightedRows.TabIndex = 22 - ' - 'ucrChkMedian - ' - Me.ucrChkMedian.Checked = False - Me.ucrChkMedian.Location = New System.Drawing.Point(8, 66) - Me.ucrChkMedian.Name = "ucrChkMedian" - Me.ucrChkMedian.Size = New System.Drawing.Size(145, 20) - Me.ucrChkMedian.TabIndex = 21 - ' - 'ucrChkShowSummary - ' - Me.ucrChkShowSummary.Checked = False - Me.ucrChkShowSummary.Location = New System.Drawing.Point(8, 18) - Me.ucrChkShowSummary.Name = "ucrChkShowSummary" - Me.ucrChkShowSummary.Size = New System.Drawing.Size(145, 20) - Me.ucrChkShowSummary.TabIndex = 19 - ' - 'ucrSaveGraph - ' - Me.ucrSaveGraph.Location = New System.Drawing.Point(19, 252) - Me.ucrSaveGraph.Name = "ucrSaveGraph" - Me.ucrSaveGraph.Size = New System.Drawing.Size(294, 24) - Me.ucrSaveGraph.TabIndex = 39 - ' 'ucrInputGraphTitle ' Me.ucrInputGraphTitle.AddQuotesIfUnrecognised = True @@ -311,6 +287,52 @@ Partial Class sdgOneWayFrequencies Me.ucrChkShowCount.Size = New System.Drawing.Size(145, 20) Me.ucrChkShowCount.TabIndex = 18 ' + 'grpGraphType + ' + Me.grpGraphType.Controls.Add(Me.rdoLine) + Me.grpGraphType.Controls.Add(Me.rdoDot) + Me.grpGraphType.Controls.Add(Me.rdoBar) + Me.grpGraphType.Controls.Add(Me.ucrPnlGraphType) + Me.grpGraphType.Location = New System.Drawing.Point(6, 6) + Me.grpGraphType.Name = "grpGraphType" + Me.grpGraphType.Size = New System.Drawing.Size(327, 48) + Me.grpGraphType.TabIndex = 33 + Me.grpGraphType.TabStop = False + Me.grpGraphType.Text = "Type of Graph" + ' + 'rdoLine + ' + Me.rdoLine.AutoSize = True + Me.rdoLine.Location = New System.Drawing.Point(242, 19) + Me.rdoLine.Name = "rdoLine" + Me.rdoLine.Size = New System.Drawing.Size(77, 17) + Me.rdoLine.TabIndex = 7 + Me.rdoLine.TabStop = True + Me.rdoLine.Text = "Line Graph" + Me.rdoLine.UseVisualStyleBackColor = True + ' + 'rdoDot + ' + Me.rdoDot.AutoSize = True + Me.rdoDot.Location = New System.Drawing.Point(118, 19) + Me.rdoDot.Name = "rdoDot" + Me.rdoDot.Size = New System.Drawing.Size(74, 17) + Me.rdoDot.TabIndex = 6 + Me.rdoDot.TabStop = True + Me.rdoDot.Text = "Dot Graph" + Me.rdoDot.UseVisualStyleBackColor = True + ' + 'rdoBar + ' + Me.rdoBar.AutoSize = True + Me.rdoBar.Location = New System.Drawing.Point(6, 19) + Me.rdoBar.Name = "rdoBar" + Me.rdoBar.Size = New System.Drawing.Size(73, 17) + Me.rdoBar.TabIndex = 5 + Me.rdoBar.TabStop = True + Me.rdoBar.Text = "Bar Graph" + Me.rdoBar.UseVisualStyleBackColor = True + ' 'ucrPnlGraphType ' Me.ucrPnlGraphType.Location = New System.Drawing.Point(6, 7) @@ -378,4 +400,6 @@ Partial Class sdgOneWayFrequencies Friend WithEvents lblHjust As Label Friend WithEvents lblVjust As Label Friend WithEvents Label1 As Label + Friend WithEvents ucrInputCountsName As ucrInputTextBox + Friend WithEvents ucrChkCountName As ucrCheck End Class diff --git a/instat/sdgOneWayFrequencies.vb b/instat/sdgOneWayFrequencies.vb index 9dbb3528f8a..e6e3b148e3f 100644 --- a/instat/sdgOneWayFrequencies.vb +++ b/instat/sdgOneWayFrequencies.vb @@ -85,6 +85,12 @@ Public Class sdgOneWayFrequencies ucrPnlGraphType.AddRadioButton(rdoDot, Chr(34) & "dot" & Chr(34)) ucrPnlGraphType.SetRDefault(Chr(34) & "bar" & Chr(34)) + ucrInputCountsName.SetParameter(New RParameter("string.cnt")) + ucrInputCountsName.SetRDefault(Chr(34) & "N" & Chr(34)) + ucrChkCountName.SetText("Count Name") + ucrChkCountName.SetParameter(ucrInputCountsName.GetParameter(), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) + ucrChkCountName.AddToLinkedControls(ucrInputCountsName, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrSaveGraph.SetPrefix("one_way_freq") ucrSaveGraph.SetSaveTypeAsGraph() ucrSaveGraph.SetDataFrameSelector(dlgOneWayFrequencies.ucrSelectorOneWayFreq.ucrAvailableDataFrames) @@ -106,6 +112,8 @@ Public Class sdgOneWayFrequencies ucrChkHighlightedRows.SetRCode(clsOneWayTableFreq, bReset) ucrNudDecimalPlaces.SetRCode(clsOneWayTableFreq, bReset) ucrChkOmitZero.SetRCode(clsOneWayTableFreq, bReset) + ucrInputCountsName.SetRCode(clsOneWayTableFreq, bReset) + ucrChkCountName.SetRCode(clsOneWayTableFreq, bReset) ucrChkShowCount.SetRCode(clsOneWayGraphFreq, bReset) ucrChkShowPercentage.SetRCode(clsOneWayGraphFreq, bReset) ucrChkShowMissing.SetRCode(clsOneWayGraphFreq, bReset) From eea9b13caf8ff06b40102144b43471f2fd84cd89 Mon Sep 17 00:00:00 2001 From: steven ndung'u Date: Mon, 3 Apr 2017 12:59:33 +0300 Subject: [PATCH 37/66] alignment --- instat/dlgOneWayFrequencies.Designer.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instat/dlgOneWayFrequencies.Designer.vb b/instat/dlgOneWayFrequencies.Designer.vb index e094a356f64..fb2afcf7d2d 100644 --- a/instat/dlgOneWayFrequencies.Designer.vb +++ b/instat/dlgOneWayFrequencies.Designer.vb @@ -169,7 +169,7 @@ Partial Class dlgOneWayFrequencies 'ucrChkGraph ' Me.ucrChkGraph.Checked = False - Me.ucrChkGraph.Location = New System.Drawing.Point(10, 271) + Me.ucrChkGraph.Location = New System.Drawing.Point(10, 274) Me.ucrChkGraph.Name = "ucrChkGraph" Me.ucrChkGraph.Size = New System.Drawing.Size(145, 20) Me.ucrChkGraph.TabIndex = 12 @@ -177,7 +177,7 @@ Partial Class dlgOneWayFrequencies 'ucrChkTable ' Me.ucrChkTable.Checked = False - Me.ucrChkTable.Location = New System.Drawing.Point(10, 249) + Me.ucrChkTable.Location = New System.Drawing.Point(10, 251) Me.ucrChkTable.Name = "ucrChkTable" Me.ucrChkTable.Size = New System.Drawing.Size(145, 20) Me.ucrChkTable.TabIndex = 13 From 41d6db9574197bcdab3fc4ca7b88a693d5819fc7 Mon Sep 17 00:00:00 2001 From: steven ndung'u Date: Mon, 3 Apr 2017 14:21:19 +0300 Subject: [PATCH 38/66] Edit --- instat/dlgOneWayFrequencies.vb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/instat/dlgOneWayFrequencies.vb b/instat/dlgOneWayFrequencies.vb index bce6aa01a09..c63af346c92 100644 --- a/instat/dlgOneWayFrequencies.vb +++ b/instat/dlgOneWayFrequencies.vb @@ -37,8 +37,7 @@ Public Class dlgOneWayFrequencies End Sub Public Sub SetRCodeForControls(bReset As Boolean) - ucrReceiverOneWayFreq.SetRCode(clsSjpFrq, bReset) - ucrReceiverOneWayFreq.SetRCode(clsSjtFreq, bReset) + ucrReceiverOneWayFreq.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrReceiverWeights.SetRCode(clsSjpFrq, bReset) ucrReceiverWeights.SetRCode(clsSjtFreq, bReset) From 5cef317ff40fc30b811f3ba2d51d828d1439e39b Mon Sep 17 00:00:00 2001 From: steven ndung'u Date: Mon, 3 Apr 2017 14:30:49 +0300 Subject: [PATCH 39/66] tab order --- instat/dlgOneWayFrequencies.Designer.vb | 12 +- instat/sdgOneWayFrequencies.Designer.vb | 264 ++++++++++++------------ 2 files changed, 138 insertions(+), 138 deletions(-) diff --git a/instat/dlgOneWayFrequencies.Designer.vb b/instat/dlgOneWayFrequencies.Designer.vb index fb2afcf7d2d..2100e09b370 100644 --- a/instat/dlgOneWayFrequencies.Designer.vb +++ b/instat/dlgOneWayFrequencies.Designer.vb @@ -137,14 +137,14 @@ Partial Class dlgOneWayFrequencies Me.ucrChkFlip.Location = New System.Drawing.Point(10, 297) Me.ucrChkFlip.Name = "ucrChkFlip" Me.ucrChkFlip.Size = New System.Drawing.Size(145, 20) - Me.ucrChkFlip.TabIndex = 7 + Me.ucrChkFlip.TabIndex = 11 ' 'ucrBase ' Me.ucrBase.Location = New System.Drawing.Point(10, 324) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(410, 52) - Me.ucrBase.TabIndex = 11 + Me.ucrBase.TabIndex = 12 ' 'ucrReceiverOneWayFreq ' @@ -172,7 +172,7 @@ Partial Class dlgOneWayFrequencies Me.ucrChkGraph.Location = New System.Drawing.Point(10, 274) Me.ucrChkGraph.Name = "ucrChkGraph" Me.ucrChkGraph.Size = New System.Drawing.Size(145, 20) - Me.ucrChkGraph.TabIndex = 12 + Me.ucrChkGraph.TabIndex = 10 ' 'ucrChkTable ' @@ -180,7 +180,7 @@ Partial Class dlgOneWayFrequencies Me.ucrChkTable.Location = New System.Drawing.Point(10, 251) Me.ucrChkTable.Name = "ucrChkTable" Me.ucrChkTable.Size = New System.Drawing.Size(145, 20) - Me.ucrChkTable.TabIndex = 13 + Me.ucrChkTable.TabIndex = 9 ' 'ucrNudGroups ' @@ -191,7 +191,7 @@ Partial Class dlgOneWayFrequencies Me.ucrNudGroups.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudGroups.Name = "ucrNudGroups" Me.ucrNudGroups.Size = New System.Drawing.Size(50, 20) - Me.ucrNudGroups.TabIndex = 48 + Me.ucrNudGroups.TabIndex = 8 Me.ucrNudGroups.Value = New Decimal(New Integer() {0, 0, 0, 0}) ' 'ucrChkGroupData @@ -200,7 +200,7 @@ Partial Class dlgOneWayFrequencies Me.ucrChkGroupData.Location = New System.Drawing.Point(10, 228) Me.ucrChkGroupData.Name = "ucrChkGroupData" Me.ucrChkGroupData.Size = New System.Drawing.Size(145, 20) - Me.ucrChkGroupData.TabIndex = 47 + Me.ucrChkGroupData.TabIndex = 7 ' 'dlgOneWayFrequencies ' diff --git a/instat/sdgOneWayFrequencies.Designer.vb b/instat/sdgOneWayFrequencies.Designer.vb index 76acc0f3507..72d282cd7ec 100644 --- a/instat/sdgOneWayFrequencies.Designer.vb +++ b/instat/sdgOneWayFrequencies.Designer.vb @@ -25,30 +25,30 @@ Partial Class sdgOneWayFrequencies Me.tbOneWayFrequencies = New System.Windows.Forms.TabControl() Me.tbTable = New System.Windows.Forms.TabPage() Me.grpTableOptions = New System.Windows.Forms.GroupBox() + Me.Label1 = New System.Windows.Forms.Label() + Me.tbGraph = New System.Windows.Forms.TabPage() + Me.grpGraphOptions = New System.Windows.Forms.GroupBox() + Me.lblTitle = New System.Windows.Forms.Label() + Me.lblHjust = New System.Windows.Forms.Label() + Me.lblVjust = New System.Windows.Forms.Label() + Me.grpGraphType = New System.Windows.Forms.GroupBox() + Me.rdoLine = New System.Windows.Forms.RadioButton() + Me.rdoDot = New System.Windows.Forms.RadioButton() + Me.rdoBar = New System.Windows.Forms.RadioButton() Me.ucrChkCountName = New instat.ucrCheck() Me.ucrInputCountsName = New instat.ucrInputTextBox() - Me.Label1 = New System.Windows.Forms.Label() Me.ucrNudDecimalPlaces = New instat.ucrNud() Me.ucrChkOmitZero = New instat.ucrCheck() Me.ucrChkHighlightedRows = New instat.ucrCheck() Me.ucrChkMedian = New instat.ucrCheck() Me.ucrChkShowSummary = New instat.ucrCheck() - Me.tbGraph = New System.Windows.Forms.TabPage() Me.ucrSaveGraph = New instat.ucrSave() - Me.grpGraphOptions = New System.Windows.Forms.GroupBox() - Me.lblTitle = New System.Windows.Forms.Label() - Me.lblHjust = New System.Windows.Forms.Label() - Me.lblVjust = New System.Windows.Forms.Label() Me.ucrInputGraphTitle = New instat.ucrInputTextBox() Me.ucrInputHorizontalLabels = New instat.ucrInputComboBox() Me.ucrInputVerticalLabels = New instat.ucrInputComboBox() Me.ucrChkShowMissing = New instat.ucrCheck() Me.ucrChkShowPercentage = New instat.ucrCheck() Me.ucrChkShowCount = New instat.ucrCheck() - Me.grpGraphType = New System.Windows.Forms.GroupBox() - Me.rdoLine = New System.Windows.Forms.RadioButton() - Me.rdoDot = New System.Windows.Forms.RadioButton() - Me.rdoBar = New System.Windows.Forms.RadioButton() Me.ucrPnlGraphType = New instat.UcrPanel() Me.ucrBaseSubDialogue = New instat.ucrButtonsSubdialogue() Me.tbOneWayFrequencies.SuspendLayout() @@ -97,6 +97,119 @@ Partial Class sdgOneWayFrequencies Me.grpTableOptions.TabStop = False Me.grpTableOptions.Text = "More Options" ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(8, 140) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(159, 13) + Me.Label1.TabIndex = 56 + Me.Label1.Text = "Decimal places for percentages:" + ' + 'tbGraph + ' + Me.tbGraph.Controls.Add(Me.ucrSaveGraph) + Me.tbGraph.Controls.Add(Me.grpGraphOptions) + Me.tbGraph.Controls.Add(Me.grpGraphType) + Me.tbGraph.Location = New System.Drawing.Point(4, 22) + Me.tbGraph.Name = "tbGraph" + Me.tbGraph.Padding = New System.Windows.Forms.Padding(3) + Me.tbGraph.Size = New System.Drawing.Size(344, 282) + Me.tbGraph.TabIndex = 1 + Me.tbGraph.Text = "Graph" + Me.tbGraph.UseVisualStyleBackColor = True + ' + 'grpGraphOptions + ' + Me.grpGraphOptions.Controls.Add(Me.lblTitle) + Me.grpGraphOptions.Controls.Add(Me.lblHjust) + Me.grpGraphOptions.Controls.Add(Me.lblVjust) + Me.grpGraphOptions.Controls.Add(Me.ucrInputGraphTitle) + Me.grpGraphOptions.Controls.Add(Me.ucrInputHorizontalLabels) + Me.grpGraphOptions.Controls.Add(Me.ucrInputVerticalLabels) + Me.grpGraphOptions.Controls.Add(Me.ucrChkShowMissing) + Me.grpGraphOptions.Controls.Add(Me.ucrChkShowPercentage) + Me.grpGraphOptions.Controls.Add(Me.ucrChkShowCount) + Me.grpGraphOptions.Location = New System.Drawing.Point(6, 59) + Me.grpGraphOptions.Name = "grpGraphOptions" + Me.grpGraphOptions.Size = New System.Drawing.Size(329, 184) + Me.grpGraphOptions.TabIndex = 37 + Me.grpGraphOptions.TabStop = False + Me.grpGraphOptions.Text = "Graph Options" + ' + 'lblTitle + ' + Me.lblTitle.AutoSize = True + Me.lblTitle.Location = New System.Drawing.Point(12, 152) + Me.lblTitle.Name = "lblTitle" + Me.lblTitle.Size = New System.Drawing.Size(62, 13) + Me.lblTitle.TabIndex = 58 + Me.lblTitle.Text = "Graph Title:" + ' + 'lblHjust + ' + Me.lblHjust.AutoSize = True + Me.lblHjust.Location = New System.Drawing.Point(12, 128) + Me.lblHjust.Name = "lblHjust" + Me.lblHjust.Size = New System.Drawing.Size(126, 13) + Me.lblHjust.TabIndex = 57 + Me.lblHjust.Text = "Horizontal Label Position:" + ' + 'lblVjust + ' + Me.lblVjust.AutoSize = True + Me.lblVjust.Location = New System.Drawing.Point(12, 100) + Me.lblVjust.Name = "lblVjust" + Me.lblVjust.Size = New System.Drawing.Size(114, 13) + Me.lblVjust.TabIndex = 55 + Me.lblVjust.Text = "Vertical Label Position:" + ' + 'grpGraphType + ' + Me.grpGraphType.Controls.Add(Me.rdoLine) + Me.grpGraphType.Controls.Add(Me.rdoDot) + Me.grpGraphType.Controls.Add(Me.rdoBar) + Me.grpGraphType.Controls.Add(Me.ucrPnlGraphType) + Me.grpGraphType.Location = New System.Drawing.Point(6, 6) + Me.grpGraphType.Name = "grpGraphType" + Me.grpGraphType.Size = New System.Drawing.Size(327, 48) + Me.grpGraphType.TabIndex = 33 + Me.grpGraphType.TabStop = False + Me.grpGraphType.Text = "Type of Graph" + ' + 'rdoLine + ' + Me.rdoLine.AutoSize = True + Me.rdoLine.Location = New System.Drawing.Point(242, 19) + Me.rdoLine.Name = "rdoLine" + Me.rdoLine.Size = New System.Drawing.Size(77, 17) + Me.rdoLine.TabIndex = 7 + Me.rdoLine.TabStop = True + Me.rdoLine.Text = "Line Graph" + Me.rdoLine.UseVisualStyleBackColor = True + ' + 'rdoDot + ' + Me.rdoDot.AutoSize = True + Me.rdoDot.Location = New System.Drawing.Point(118, 19) + Me.rdoDot.Name = "rdoDot" + Me.rdoDot.Size = New System.Drawing.Size(74, 17) + Me.rdoDot.TabIndex = 6 + Me.rdoDot.TabStop = True + Me.rdoDot.Text = "Dot Graph" + Me.rdoDot.UseVisualStyleBackColor = True + ' + 'rdoBar + ' + Me.rdoBar.AutoSize = True + Me.rdoBar.Location = New System.Drawing.Point(6, 19) + Me.rdoBar.Name = "rdoBar" + Me.rdoBar.Size = New System.Drawing.Size(73, 17) + Me.rdoBar.TabIndex = 5 + Me.rdoBar.TabStop = True + Me.rdoBar.Text = "Bar Graph" + Me.rdoBar.UseVisualStyleBackColor = True + ' 'ucrChkCountName ' Me.ucrChkCountName.Checked = False @@ -110,25 +223,16 @@ Partial Class sdgOneWayFrequencies Me.ucrInputCountsName.AddQuotesIfUnrecognised = True Me.ucrInputCountsName.IsMultiline = False Me.ucrInputCountsName.IsReadOnly = False - Me.ucrInputCountsName.Location = New System.Drawing.Point(117, 113) + Me.ucrInputCountsName.Location = New System.Drawing.Point(108, 113) Me.ucrInputCountsName.Name = "ucrInputCountsName" Me.ucrInputCountsName.Size = New System.Drawing.Size(137, 21) Me.ucrInputCountsName.TabIndex = 59 ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(5, 137) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(159, 13) - Me.Label1.TabIndex = 56 - Me.Label1.Text = "Decimal places for percentages:" - ' 'ucrNudDecimalPlaces ' Me.ucrNudDecimalPlaces.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudDecimalPlaces.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudDecimalPlaces.Location = New System.Drawing.Point(171, 137) + Me.ucrNudDecimalPlaces.Location = New System.Drawing.Point(171, 139) Me.ucrNudDecimalPlaces.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudDecimalPlaces.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudDecimalPlaces.Name = "ucrNudDecimalPlaces" @@ -168,77 +272,19 @@ Partial Class sdgOneWayFrequencies Me.ucrChkShowSummary.Size = New System.Drawing.Size(145, 20) Me.ucrChkShowSummary.TabIndex = 19 ' - 'tbGraph - ' - Me.tbGraph.Controls.Add(Me.ucrSaveGraph) - Me.tbGraph.Controls.Add(Me.grpGraphOptions) - Me.tbGraph.Controls.Add(Me.grpGraphType) - Me.tbGraph.Location = New System.Drawing.Point(4, 22) - Me.tbGraph.Name = "tbGraph" - Me.tbGraph.Padding = New System.Windows.Forms.Padding(3) - Me.tbGraph.Size = New System.Drawing.Size(344, 282) - Me.tbGraph.TabIndex = 1 - Me.tbGraph.Text = "Graph" - Me.tbGraph.UseVisualStyleBackColor = True - ' 'ucrSaveGraph ' - Me.ucrSaveGraph.Location = New System.Drawing.Point(19, 252) + Me.ucrSaveGraph.Location = New System.Drawing.Point(12, 249) Me.ucrSaveGraph.Name = "ucrSaveGraph" Me.ucrSaveGraph.Size = New System.Drawing.Size(294, 24) Me.ucrSaveGraph.TabIndex = 39 ' - 'grpGraphOptions - ' - Me.grpGraphOptions.Controls.Add(Me.lblTitle) - Me.grpGraphOptions.Controls.Add(Me.lblHjust) - Me.grpGraphOptions.Controls.Add(Me.lblVjust) - Me.grpGraphOptions.Controls.Add(Me.ucrInputGraphTitle) - Me.grpGraphOptions.Controls.Add(Me.ucrInputHorizontalLabels) - Me.grpGraphOptions.Controls.Add(Me.ucrInputVerticalLabels) - Me.grpGraphOptions.Controls.Add(Me.ucrChkShowMissing) - Me.grpGraphOptions.Controls.Add(Me.ucrChkShowPercentage) - Me.grpGraphOptions.Controls.Add(Me.ucrChkShowCount) - Me.grpGraphOptions.Location = New System.Drawing.Point(6, 59) - Me.grpGraphOptions.Name = "grpGraphOptions" - Me.grpGraphOptions.Size = New System.Drawing.Size(329, 184) - Me.grpGraphOptions.TabIndex = 37 - Me.grpGraphOptions.TabStop = False - Me.grpGraphOptions.Text = "Graph Options" - ' - 'lblTitle - ' - Me.lblTitle.AutoSize = True - Me.lblTitle.Location = New System.Drawing.Point(13, 154) - Me.lblTitle.Name = "lblTitle" - Me.lblTitle.Size = New System.Drawing.Size(62, 13) - Me.lblTitle.TabIndex = 58 - Me.lblTitle.Text = "Graph Title:" - ' - 'lblHjust - ' - Me.lblHjust.AutoSize = True - Me.lblHjust.Location = New System.Drawing.Point(13, 131) - Me.lblHjust.Name = "lblHjust" - Me.lblHjust.Size = New System.Drawing.Size(126, 13) - Me.lblHjust.TabIndex = 57 - Me.lblHjust.Text = "Horizontal Label Position:" - ' - 'lblVjust - ' - Me.lblVjust.AutoSize = True - Me.lblVjust.Location = New System.Drawing.Point(13, 103) - Me.lblVjust.Name = "lblVjust" - Me.lblVjust.Size = New System.Drawing.Size(114, 13) - Me.lblVjust.TabIndex = 55 - Me.lblVjust.Text = "Vertical Label Position:" - ' 'ucrInputGraphTitle ' Me.ucrInputGraphTitle.AddQuotesIfUnrecognised = True Me.ucrInputGraphTitle.IsMultiline = False Me.ucrInputGraphTitle.IsReadOnly = False - Me.ucrInputGraphTitle.Location = New System.Drawing.Point(165, 155) + Me.ucrInputGraphTitle.Location = New System.Drawing.Point(141, 152) Me.ucrInputGraphTitle.Name = "ucrInputGraphTitle" Me.ucrInputGraphTitle.Size = New System.Drawing.Size(137, 21) Me.ucrInputGraphTitle.TabIndex = 54 @@ -247,7 +293,7 @@ Partial Class sdgOneWayFrequencies ' Me.ucrInputHorizontalLabels.AddQuotesIfUnrecognised = True Me.ucrInputHorizontalLabels.IsReadOnly = False - Me.ucrInputHorizontalLabels.Location = New System.Drawing.Point(165, 125) + Me.ucrInputHorizontalLabels.Location = New System.Drawing.Point(141, 124) Me.ucrInputHorizontalLabels.Margin = New System.Windows.Forms.Padding(21, 17, 21, 17) Me.ucrInputHorizontalLabels.Name = "ucrInputHorizontalLabels" Me.ucrInputHorizontalLabels.Size = New System.Drawing.Size(137, 21) @@ -257,7 +303,7 @@ Partial Class sdgOneWayFrequencies ' Me.ucrInputVerticalLabels.AddQuotesIfUnrecognised = True Me.ucrInputVerticalLabels.IsReadOnly = False - Me.ucrInputVerticalLabels.Location = New System.Drawing.Point(165, 99) + Me.ucrInputVerticalLabels.Location = New System.Drawing.Point(141, 95) Me.ucrInputVerticalLabels.Margin = New System.Windows.Forms.Padding(21, 17, 21, 17) Me.ucrInputVerticalLabels.Name = "ucrInputVerticalLabels" Me.ucrInputVerticalLabels.Size = New System.Drawing.Size(137, 21) @@ -266,7 +312,7 @@ Partial Class sdgOneWayFrequencies 'ucrChkShowMissing ' Me.ucrChkShowMissing.Checked = False - Me.ucrChkShowMissing.Location = New System.Drawing.Point(13, 75) + Me.ucrChkShowMissing.Location = New System.Drawing.Point(12, 73) Me.ucrChkShowMissing.Name = "ucrChkShowMissing" Me.ucrChkShowMissing.Size = New System.Drawing.Size(145, 20) Me.ucrChkShowMissing.TabIndex = 28 @@ -274,7 +320,7 @@ Partial Class sdgOneWayFrequencies 'ucrChkShowPercentage ' Me.ucrChkShowPercentage.Checked = False - Me.ucrChkShowPercentage.Location = New System.Drawing.Point(13, 19) + Me.ucrChkShowPercentage.Location = New System.Drawing.Point(12, 19) Me.ucrChkShowPercentage.Name = "ucrChkShowPercentage" Me.ucrChkShowPercentage.Size = New System.Drawing.Size(145, 20) Me.ucrChkShowPercentage.TabIndex = 20 @@ -282,57 +328,11 @@ Partial Class sdgOneWayFrequencies 'ucrChkShowCount ' Me.ucrChkShowCount.Checked = False - Me.ucrChkShowCount.Location = New System.Drawing.Point(13, 47) + Me.ucrChkShowCount.Location = New System.Drawing.Point(12, 46) Me.ucrChkShowCount.Name = "ucrChkShowCount" Me.ucrChkShowCount.Size = New System.Drawing.Size(145, 20) Me.ucrChkShowCount.TabIndex = 18 ' - 'grpGraphType - ' - Me.grpGraphType.Controls.Add(Me.rdoLine) - Me.grpGraphType.Controls.Add(Me.rdoDot) - Me.grpGraphType.Controls.Add(Me.rdoBar) - Me.grpGraphType.Controls.Add(Me.ucrPnlGraphType) - Me.grpGraphType.Location = New System.Drawing.Point(6, 6) - Me.grpGraphType.Name = "grpGraphType" - Me.grpGraphType.Size = New System.Drawing.Size(327, 48) - Me.grpGraphType.TabIndex = 33 - Me.grpGraphType.TabStop = False - Me.grpGraphType.Text = "Type of Graph" - ' - 'rdoLine - ' - Me.rdoLine.AutoSize = True - Me.rdoLine.Location = New System.Drawing.Point(242, 19) - Me.rdoLine.Name = "rdoLine" - Me.rdoLine.Size = New System.Drawing.Size(77, 17) - Me.rdoLine.TabIndex = 7 - Me.rdoLine.TabStop = True - Me.rdoLine.Text = "Line Graph" - Me.rdoLine.UseVisualStyleBackColor = True - ' - 'rdoDot - ' - Me.rdoDot.AutoSize = True - Me.rdoDot.Location = New System.Drawing.Point(118, 19) - Me.rdoDot.Name = "rdoDot" - Me.rdoDot.Size = New System.Drawing.Size(74, 17) - Me.rdoDot.TabIndex = 6 - Me.rdoDot.TabStop = True - Me.rdoDot.Text = "Dot Graph" - Me.rdoDot.UseVisualStyleBackColor = True - ' - 'rdoBar - ' - Me.rdoBar.AutoSize = True - Me.rdoBar.Location = New System.Drawing.Point(6, 19) - Me.rdoBar.Name = "rdoBar" - Me.rdoBar.Size = New System.Drawing.Size(73, 17) - Me.rdoBar.TabIndex = 5 - Me.rdoBar.TabStop = True - Me.rdoBar.Text = "Bar Graph" - Me.rdoBar.UseVisualStyleBackColor = True - ' 'ucrPnlGraphType ' Me.ucrPnlGraphType.Location = New System.Drawing.Point(6, 7) From 60fc5671f87ee6274f0de0bc99b6829615bbe0f6 Mon Sep 17 00:00:00 2001 From: steven ndung'u Date: Mon, 3 Apr 2017 14:46:44 +0300 Subject: [PATCH 40/66] changes on d=setrcode --- instat/dlgOneWayFrequencies.Designer.vb | 4 ++-- instat/sdgOneWayFrequencies.Designer.vb | 10 +++++----- instat/sdgOneWayFrequencies.vb | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/instat/dlgOneWayFrequencies.Designer.vb b/instat/dlgOneWayFrequencies.Designer.vb index 2100e09b370..9c05691cdbe 100644 --- a/instat/dlgOneWayFrequencies.Designer.vb +++ b/instat/dlgOneWayFrequencies.Designer.vb @@ -116,7 +116,7 @@ Partial Class dlgOneWayFrequencies 'ucrReceiverWeights ' Me.ucrReceiverWeights.frmParent = Me - Me.ucrReceiverWeights.Location = New System.Drawing.Point(119, 205) + Me.ucrReceiverWeights.Location = New System.Drawing.Point(121, 205) Me.ucrReceiverWeights.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverWeights.Name = "ucrReceiverWeights" Me.ucrReceiverWeights.Selector = Nothing @@ -186,7 +186,7 @@ Partial Class dlgOneWayFrequencies ' Me.ucrNudGroups.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudGroups.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudGroups.Location = New System.Drawing.Point(130, 228) + Me.ucrNudGroups.Location = New System.Drawing.Point(131, 228) Me.ucrNudGroups.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudGroups.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudGroups.Name = "ucrNudGroups" diff --git a/instat/sdgOneWayFrequencies.Designer.vb b/instat/sdgOneWayFrequencies.Designer.vb index 72d282cd7ec..cf884ef2eaa 100644 --- a/instat/sdgOneWayFrequencies.Designer.vb +++ b/instat/sdgOneWayFrequencies.Designer.vb @@ -90,9 +90,9 @@ Partial Class sdgOneWayFrequencies Me.grpTableOptions.Controls.Add(Me.ucrChkHighlightedRows) Me.grpTableOptions.Controls.Add(Me.ucrChkMedian) Me.grpTableOptions.Controls.Add(Me.ucrChkShowSummary) - Me.grpTableOptions.Location = New System.Drawing.Point(17, 6) + Me.grpTableOptions.Location = New System.Drawing.Point(6, 7) Me.grpTableOptions.Name = "grpTableOptions" - Me.grpTableOptions.Size = New System.Drawing.Size(345, 172) + Me.grpTableOptions.Size = New System.Drawing.Size(327, 172) Me.grpTableOptions.TabIndex = 21 Me.grpTableOptions.TabStop = False Me.grpTableOptions.Text = "More Options" @@ -215,7 +215,7 @@ Partial Class sdgOneWayFrequencies Me.ucrChkCountName.Checked = False Me.ucrChkCountName.Location = New System.Drawing.Point(8, 114) Me.ucrChkCountName.Name = "ucrChkCountName" - Me.ucrChkCountName.Size = New System.Drawing.Size(103, 20) + Me.ucrChkCountName.Size = New System.Drawing.Size(94, 20) Me.ucrChkCountName.TabIndex = 60 ' 'ucrInputCountsName @@ -223,7 +223,7 @@ Partial Class sdgOneWayFrequencies Me.ucrInputCountsName.AddQuotesIfUnrecognised = True Me.ucrInputCountsName.IsMultiline = False Me.ucrInputCountsName.IsReadOnly = False - Me.ucrInputCountsName.Location = New System.Drawing.Point(108, 113) + Me.ucrInputCountsName.Location = New System.Drawing.Point(108, 114) Me.ucrInputCountsName.Name = "ucrInputCountsName" Me.ucrInputCountsName.Size = New System.Drawing.Size(137, 21) Me.ucrInputCountsName.TabIndex = 59 @@ -232,7 +232,7 @@ Partial Class sdgOneWayFrequencies ' Me.ucrNudDecimalPlaces.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudDecimalPlaces.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudDecimalPlaces.Location = New System.Drawing.Point(171, 139) + Me.ucrNudDecimalPlaces.Location = New System.Drawing.Point(173, 140) Me.ucrNudDecimalPlaces.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudDecimalPlaces.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudDecimalPlaces.Name = "ucrNudDecimalPlaces" diff --git a/instat/sdgOneWayFrequencies.vb b/instat/sdgOneWayFrequencies.vb index e6e3b148e3f..c06846677b8 100644 --- a/instat/sdgOneWayFrequencies.vb +++ b/instat/sdgOneWayFrequencies.vb @@ -13,7 +13,7 @@ ' ' 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 sdgOneWayFrequencies Public bControlsInitialised As Boolean = False From 3611c9f63b324b6d054f983d3d11a25121ce74cd Mon Sep 17 00:00:00 2001 From: steven ndung'u Date: Tue, 4 Apr 2017 08:32:52 +0300 Subject: [PATCH 41/66] changes --- instat/dlgOneWayFrequencies.Designer.vb | 64 +++++++++++++--------- instat/dlgOneWayFrequencies.vb | 70 +++++++++---------------- 2 files changed, 65 insertions(+), 69 deletions(-) diff --git a/instat/dlgOneWayFrequencies.Designer.vb b/instat/dlgOneWayFrequencies.Designer.vb index 9c05691cdbe..d0d63a91893 100644 --- a/instat/dlgOneWayFrequencies.Designer.vb +++ b/instat/dlgOneWayFrequencies.Designer.vb @@ -35,10 +35,11 @@ Partial Class dlgOneWayFrequencies Me.ucrBase = New instat.ucrButtons() Me.ucrReceiverOneWayFreq = New instat.ucrReceiverSingle() Me.ucrSelectorOneWayFreq = New instat.ucrSelectorByDataFrameAddRemove() - Me.ucrChkGraph = New instat.ucrCheck() - Me.ucrChkTable = New instat.ucrCheck() Me.ucrNudGroups = New instat.ucrNud() Me.ucrChkGroupData = New instat.ucrCheck() + Me.rdoGraph = New System.Windows.Forms.RadioButton() + Me.rdoTable = New System.Windows.Forms.RadioButton() + Me.ucrPnlFrequencies = New instat.UcrPanel() Me.grpSort.SuspendLayout() Me.SuspendLayout() ' @@ -101,7 +102,7 @@ Partial Class dlgOneWayFrequencies Me.cmdOptions.Name = "cmdOptions" Me.cmdOptions.Size = New System.Drawing.Size(69, 23) Me.cmdOptions.TabIndex = 6 - Me.cmdOptions.Text = " Options" + Me.cmdOptions.Text = " Options..." Me.cmdOptions.UseVisualStyleBackColor = True ' 'lblSelectedVariable @@ -134,7 +135,7 @@ Partial Class dlgOneWayFrequencies 'ucrChkFlip ' Me.ucrChkFlip.Checked = False - Me.ucrChkFlip.Location = New System.Drawing.Point(10, 297) + Me.ucrChkFlip.Location = New System.Drawing.Point(10, 299) Me.ucrChkFlip.Name = "ucrChkFlip" Me.ucrChkFlip.Size = New System.Drawing.Size(145, 20) Me.ucrChkFlip.TabIndex = 11 @@ -166,22 +167,6 @@ Partial Class dlgOneWayFrequencies Me.ucrSelectorOneWayFreq.Size = New System.Drawing.Size(210, 180) Me.ucrSelectorOneWayFreq.TabIndex = 0 ' - 'ucrChkGraph - ' - Me.ucrChkGraph.Checked = False - Me.ucrChkGraph.Location = New System.Drawing.Point(10, 274) - Me.ucrChkGraph.Name = "ucrChkGraph" - Me.ucrChkGraph.Size = New System.Drawing.Size(145, 20) - Me.ucrChkGraph.TabIndex = 10 - ' - 'ucrChkTable - ' - Me.ucrChkTable.Checked = False - Me.ucrChkTable.Location = New System.Drawing.Point(10, 251) - Me.ucrChkTable.Name = "ucrChkTable" - Me.ucrChkTable.Size = New System.Drawing.Size(145, 20) - Me.ucrChkTable.TabIndex = 9 - ' 'ucrNudGroups ' Me.ucrNudGroups.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) @@ -202,15 +187,45 @@ Partial Class dlgOneWayFrequencies Me.ucrChkGroupData.Size = New System.Drawing.Size(145, 20) Me.ucrChkGroupData.TabIndex = 7 ' + 'rdoGraph + ' + Me.rdoGraph.AutoSize = True + Me.rdoGraph.Location = New System.Drawing.Point(15, 274) + Me.rdoGraph.Name = "rdoGraph" + Me.rdoGraph.Size = New System.Drawing.Size(54, 17) + Me.rdoGraph.TabIndex = 5 + Me.rdoGraph.TabStop = True + Me.rdoGraph.Text = "Graph" + Me.rdoGraph.UseVisualStyleBackColor = True + ' + 'rdoTable + ' + Me.rdoTable.AutoSize = True + Me.rdoTable.Location = New System.Drawing.Point(15, 252) + Me.rdoTable.Name = "rdoTable" + Me.rdoTable.Size = New System.Drawing.Size(52, 17) + Me.rdoTable.TabIndex = 3 + Me.rdoTable.TabStop = True + Me.rdoTable.Text = "Table" + Me.rdoTable.UseVisualStyleBackColor = True + ' + 'ucrPnlFrequencies + ' + Me.ucrPnlFrequencies.Location = New System.Drawing.Point(8, 248) + Me.ucrPnlFrequencies.Name = "ucrPnlFrequencies" + Me.ucrPnlFrequencies.Size = New System.Drawing.Size(94, 45) + Me.ucrPnlFrequencies.TabIndex = 4 + ' '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, 381) + Me.Controls.Add(Me.rdoGraph) Me.Controls.Add(Me.ucrNudGroups) + Me.Controls.Add(Me.rdoTable) + Me.Controls.Add(Me.ucrPnlFrequencies) Me.Controls.Add(Me.ucrChkGroupData) - Me.Controls.Add(Me.ucrChkTable) - Me.Controls.Add(Me.ucrChkGraph) Me.Controls.Add(Me.ucrReceiverWeights) Me.Controls.Add(Me.ucrChkWeights) Me.Controls.Add(Me.ucrChkFlip) @@ -246,8 +261,9 @@ Partial Class dlgOneWayFrequencies Friend WithEvents ucrChkFlip As ucrCheck Friend WithEvents ucrReceiverWeights As ucrReceiverSingle Friend WithEvents ucrChkWeights As ucrCheck - Friend WithEvents ucrChkTable As ucrCheck - Friend WithEvents ucrChkGraph As ucrCheck Friend WithEvents ucrNudGroups As ucrNud Friend WithEvents ucrChkGroupData As ucrCheck + Friend WithEvents rdoGraph As RadioButton + Friend WithEvents rdoTable As RadioButton + Friend WithEvents ucrPnlFrequencies As UcrPanel End Class diff --git a/instat/dlgOneWayFrequencies.vb b/instat/dlgOneWayFrequencies.vb index c63af346c92..bfd033e68a4 100644 --- a/instat/dlgOneWayFrequencies.vb +++ b/instat/dlgOneWayFrequencies.vb @@ -14,6 +14,7 @@ ' 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 dlgOneWayFrequencies @@ -38,23 +39,15 @@ Public Class dlgOneWayFrequencies Public Sub SetRCodeForControls(bReset As Boolean) ucrReceiverOneWayFreq.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - ucrReceiverWeights.SetRCode(clsSjpFrq, bReset) - ucrReceiverWeights.SetRCode(clsSjtFreq, bReset) - - ucrChkGraph.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - - ucrChkTable.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - - ucrChkWeights.SetRCode(clsSjpFrq, bReset) - ucrChkWeights.SetRCode(clsSjtFreq, bReset) - ucrPnlSort.SetRCode(clsSjpFrq, bReset) - ucrPnlSort.SetRCode(clsSjtFreq, bReset) + ucrReceiverWeights.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + ucrPnlFrequencies.SetRCode(clsSjtFreq, bReset) + ucrPnlFrequencies.SetRCode(clsSjpFrq, bReset) + ucrChkWeights.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + ucrPnlSort.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrChkFlip.SetRCode(clsSjpFrq, bReset) - ucrNudGroups.SetRCode(clsSjpFrq, bReset) - ucrNudGroups.SetRCode(clsSjtFreq, bReset) - ucrChkGroupData.SetRCode(clsSjpFrq, bReset) - ucrChkGroupData.SetRCode(clsSjtFreq, bReset) + ucrChkGroupData.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + ucrNudGroups.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) End Sub @@ -65,8 +58,6 @@ Public Class dlgOneWayFrequencies cmdOptions.Enabled = True ucrReceiverOneWayFreq.Selector = ucrSelectorOneWayFreq ucrReceiverOneWayFreq.SetMeAsReceiver() - ucrReceiverOneWayFreq.SetParameter(New RParameter("data", 1)) - ucrReceiverOneWayFreq.SetParameterIsRFunction() ucrReceiverWeights.Selector = ucrSelectorOneWayFreq ucrReceiverWeights.SetParameter(New RParameter("weight.by", 3)) @@ -83,11 +74,8 @@ Public Class dlgOneWayFrequencies ucrChkWeights.SetParameter(ucrReceiverWeights.GetParameter(), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) ucrChkWeights.AddToLinkedControls(ucrReceiverWeights, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - ucrChkGraph.SetText("Graph") - ucrChkTable.SetText("Table") - ucrChkTable.AddFunctionNamesCondition(True, "sjt.frq") - 'ucrChkGraph.AddFunctionNamesCondition(True, "sjp.frq") - ucrChkGraph.AddToLinkedControls(ucrChkFlip, {True}, bNewLinkedDisabledIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True) + + ucrPnlFrequencies.AddFunctionNamesCondition(rdoTable, "sjt.frq") ucrChkGroupData.SetText("Group Data") ucrNudGroups.SetMinMax(2, 100) @@ -106,6 +94,10 @@ Public Class dlgOneWayFrequencies Private Sub SetDefaults() clsSjtFreq = New RFunction clsSjpFrq = New RFunction + ' ucrPnlFrequencies.AddRadioButton(rdoTable) + ' ucrPnlFrequencies.AddRadioButton(rdoGraph) + ucrPnlFrequencies.AddToLinkedControls(ucrChkFlip, {rdoGraph}, bNewLinkedDisabledIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True) + ucrSelectorOneWayFreq.Reset() sdgOneWayFrequencies.ucrSaveGraph.Reset() sdgOneWayFrequencies.ucrInputGraphTitle.SetName("") @@ -124,8 +116,6 @@ Public Class dlgOneWayFrequencies clsSjpFrq.SetRCommand("sjp.frq") clsSjpFrq.AddParameter("sort.frq", Chr(34) & "none" & Chr(34)) clsSjpFrq.AddParameter("type", Chr(34) & "bar" & Chr(34)) - clsSjpFrq.AddParameter("vjust", Chr(34) & "bottom" & Chr(34)) - clsSjpFrq.AddParameter("hjust", Chr(34) & "center" & Chr(34)) clsSjpFrq.AddParameter("show.prc", "TRUE") clsSjpFrq.SetAssignTo("last_graph", strTempDataframe:=ucrSelectorOneWayFreq.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") ucrBase.clsRsyntax.SetBaseRFunction(clsSjtFreq) @@ -149,32 +139,22 @@ Public Class dlgOneWayFrequencies End Sub Public Sub ICallType() - If ucrChkTable.Checked Then - ' ucrBase.clsRsyntax.bHTMLOutput = True + If rdoTable.Checked Then + 'ucrBase.clsRsyntax.bHTMLOutput = True ucrBase.clsRsyntax.iCallType = 0 - End If - If ucrChkGraph.Checked Then + Else ' ucrBase.clsRsyntax.bHTMLOutput = False ucrBase.clsRsyntax.iCallType = 3 End If - If Not (ucrChkGraph.Checked AndAlso ucrChkTable.Checked) Then 'temporary fix to ensure graphs are displayed in the output window before a wrapper for displaying both tables and graphs at the same time on the output window is implemented - ucrBase.clsRsyntax.iCallType = 3 - End If + End Sub Private Sub ChangeBaseFunction() - If ucrChkTable.Checked Then + If rdoTable.Checked Then ucrReceiverOneWayFreq.SetParameter(New RParameter("data", 1)) ucrReceiverOneWayFreq.SetParameterIsRFunction() ucrBase.clsRsyntax.SetBaseRFunction(clsSjtFreq) - End If - If ucrChkGraph.Checked Then - ucrReceiverOneWayFreq.SetParameter(New RParameter("var.cnt", 1)) - ucrReceiverOneWayFreq.SetParameterIsRFunction() - ucrBase.clsRsyntax.SetBaseRFunction(clsSjpFrq) - End If - - If ucrChkGraph.Checked = False AndAlso ucrChkTable.Checked = False Then + Else ucrReceiverOneWayFreq.SetParameter(New RParameter("var.cnt", 1)) ucrReceiverOneWayFreq.SetParameterIsRFunction() ucrBase.clsRsyntax.SetBaseRFunction(clsSjpFrq) @@ -196,11 +176,6 @@ Public Class dlgOneWayFrequencies End If End Sub - Private Sub AllControls_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkTable.ControlValueChanged, ucrChkGraph.ControlValueChanged - ChangeBaseFunction() - ICallType() - End Sub - Private Sub Controls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverOneWayFreq.ControlContentsChanged, ucrReceiverWeights.ControlContentsChanged, ucrChkWeights.ControlContentsChanged TestOkEnabled() End Sub @@ -212,4 +187,9 @@ Public Class dlgOneWayFrequencies sdgOneWayFrequencies.ShowDialog() TestOkEnabled() End Sub + + Private Sub ucrPnlFrequencies_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlFrequencies.ControlValueChanged + ChangeBaseFunction() + ICallType() + End Sub End Class \ No newline at end of file From 4f057acbd53b03fecbe1bce1d88dc0a47c6afd0c Mon Sep 17 00:00:00 2001 From: steven ndung'u Date: Tue, 4 Apr 2017 08:45:10 +0300 Subject: [PATCH 42/66] Setting the panel --- instat/dlgOneWayFrequencies.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instat/dlgOneWayFrequencies.vb b/instat/dlgOneWayFrequencies.vb index bfd033e68a4..df304618317 100644 --- a/instat/dlgOneWayFrequencies.vb +++ b/instat/dlgOneWayFrequencies.vb @@ -40,8 +40,7 @@ Public Class dlgOneWayFrequencies Public Sub SetRCodeForControls(bReset As Boolean) ucrReceiverOneWayFreq.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrReceiverWeights.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - ucrPnlFrequencies.SetRCode(clsSjtFreq, bReset) - ucrPnlFrequencies.SetRCode(clsSjpFrq, bReset) + ucrPnlFrequencies.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrChkWeights.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrPnlSort.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrChkFlip.SetRCode(clsSjpFrq, bReset) @@ -76,6 +75,7 @@ Public Class dlgOneWayFrequencies ucrPnlFrequencies.AddFunctionNamesCondition(rdoTable, "sjt.frq") + ucrPnlFrequencies.AddFunctionNamesCondition(rdoGraph, "sjp.frq") ucrChkGroupData.SetText("Group Data") ucrNudGroups.SetMinMax(2, 100) From 3f893074e42e1cfde3dd14597e603ae249dbbed0 Mon Sep 17 00:00:00 2001 From: steven ndung'u Date: Tue, 4 Apr 2017 11:02:48 +0300 Subject: [PATCH 43/66] Edits --- instat/dlgOneWayFrequencies.Designer.vb | 124 ++++++++++++------------ instat/dlgOneWayFrequencies.vb | 25 ++--- 2 files changed, 75 insertions(+), 74 deletions(-) diff --git a/instat/dlgOneWayFrequencies.Designer.vb b/instat/dlgOneWayFrequencies.Designer.vb index d0d63a91893..8a676030ce2 100644 --- a/instat/dlgOneWayFrequencies.Designer.vb +++ b/instat/dlgOneWayFrequencies.Designer.vb @@ -26,20 +26,20 @@ Partial Class dlgOneWayFrequencies 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.rdoGraph = New System.Windows.Forms.RadioButton() + Me.rdoTable = New System.Windows.Forms.RadioButton() + Me.ucrNudGroups = New instat.ucrNud() + Me.ucrPnlFrequencies = New instat.UcrPanel() + Me.ucrChkGroupData = New instat.ucrCheck() Me.ucrReceiverWeights = New instat.ucrReceiverSingle() Me.ucrChkWeights = New instat.ucrCheck() Me.ucrChkFlip = New instat.ucrCheck() + Me.ucrPnlSort = New instat.UcrPanel() Me.ucrBase = New instat.ucrButtons() Me.ucrReceiverOneWayFreq = New instat.ucrReceiverSingle() Me.ucrSelectorOneWayFreq = New instat.ucrSelectorByDataFrameAddRemove() - Me.ucrNudGroups = New instat.ucrNud() - Me.ucrChkGroupData = New instat.ucrCheck() - Me.rdoGraph = New System.Windows.Forms.RadioButton() - Me.rdoTable = New System.Windows.Forms.RadioButton() - Me.ucrPnlFrequencies = New instat.UcrPanel() Me.grpSort.SuspendLayout() Me.SuspendLayout() ' @@ -89,13 +89,6 @@ Partial Class dlgOneWayFrequencies 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(321, 203) @@ -114,6 +107,55 @@ Partial Class dlgOneWayFrequencies Me.lblSelectedVariable.TabIndex = 1 Me.lblSelectedVariable.Text = "Selected Variable:" ' + 'rdoGraph + ' + Me.rdoGraph.AutoSize = True + Me.rdoGraph.Location = New System.Drawing.Point(10, 276) + Me.rdoGraph.Name = "rdoGraph" + Me.rdoGraph.Size = New System.Drawing.Size(54, 17) + Me.rdoGraph.TabIndex = 5 + Me.rdoGraph.TabStop = True + Me.rdoGraph.Text = "Graph" + Me.rdoGraph.UseVisualStyleBackColor = True + ' + 'rdoTable + ' + Me.rdoTable.AutoSize = True + Me.rdoTable.Location = New System.Drawing.Point(10, 254) + Me.rdoTable.Name = "rdoTable" + Me.rdoTable.Size = New System.Drawing.Size(52, 17) + Me.rdoTable.TabIndex = 3 + Me.rdoTable.TabStop = True + Me.rdoTable.Text = "Table" + Me.rdoTable.UseVisualStyleBackColor = True + ' + 'ucrNudGroups + ' + Me.ucrNudGroups.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudGroups.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudGroups.Location = New System.Drawing.Point(131, 228) + Me.ucrNudGroups.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudGroups.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudGroups.Name = "ucrNudGroups" + Me.ucrNudGroups.Size = New System.Drawing.Size(50, 20) + Me.ucrNudGroups.TabIndex = 8 + Me.ucrNudGroups.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrPnlFrequencies + ' + Me.ucrPnlFrequencies.Location = New System.Drawing.Point(8, 248) + Me.ucrPnlFrequencies.Name = "ucrPnlFrequencies" + Me.ucrPnlFrequencies.Size = New System.Drawing.Size(94, 45) + Me.ucrPnlFrequencies.TabIndex = 4 + ' + 'ucrChkGroupData + ' + Me.ucrChkGroupData.Checked = False + Me.ucrChkGroupData.Location = New System.Drawing.Point(10, 228) + Me.ucrChkGroupData.Name = "ucrChkGroupData" + Me.ucrChkGroupData.Size = New System.Drawing.Size(145, 20) + Me.ucrChkGroupData.TabIndex = 7 + ' 'ucrReceiverWeights ' Me.ucrReceiverWeights.frmParent = Me @@ -140,6 +182,13 @@ Partial Class dlgOneWayFrequencies Me.ucrChkFlip.Size = New System.Drawing.Size(145, 20) Me.ucrChkFlip.TabIndex = 11 ' + '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 + ' 'ucrBase ' Me.ucrBase.Location = New System.Drawing.Point(10, 324) @@ -167,55 +216,6 @@ Partial Class dlgOneWayFrequencies Me.ucrSelectorOneWayFreq.Size = New System.Drawing.Size(210, 180) Me.ucrSelectorOneWayFreq.TabIndex = 0 ' - 'ucrNudGroups - ' - Me.ucrNudGroups.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudGroups.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudGroups.Location = New System.Drawing.Point(131, 228) - Me.ucrNudGroups.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudGroups.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudGroups.Name = "ucrNudGroups" - Me.ucrNudGroups.Size = New System.Drawing.Size(50, 20) - Me.ucrNudGroups.TabIndex = 8 - Me.ucrNudGroups.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrChkGroupData - ' - Me.ucrChkGroupData.Checked = False - Me.ucrChkGroupData.Location = New System.Drawing.Point(10, 228) - Me.ucrChkGroupData.Name = "ucrChkGroupData" - Me.ucrChkGroupData.Size = New System.Drawing.Size(145, 20) - Me.ucrChkGroupData.TabIndex = 7 - ' - 'rdoGraph - ' - Me.rdoGraph.AutoSize = True - Me.rdoGraph.Location = New System.Drawing.Point(15, 274) - Me.rdoGraph.Name = "rdoGraph" - Me.rdoGraph.Size = New System.Drawing.Size(54, 17) - Me.rdoGraph.TabIndex = 5 - Me.rdoGraph.TabStop = True - Me.rdoGraph.Text = "Graph" - Me.rdoGraph.UseVisualStyleBackColor = True - ' - 'rdoTable - ' - Me.rdoTable.AutoSize = True - Me.rdoTable.Location = New System.Drawing.Point(15, 252) - Me.rdoTable.Name = "rdoTable" - Me.rdoTable.Size = New System.Drawing.Size(52, 17) - Me.rdoTable.TabIndex = 3 - Me.rdoTable.TabStop = True - Me.rdoTable.Text = "Table" - Me.rdoTable.UseVisualStyleBackColor = True - ' - 'ucrPnlFrequencies - ' - Me.ucrPnlFrequencies.Location = New System.Drawing.Point(8, 248) - Me.ucrPnlFrequencies.Name = "ucrPnlFrequencies" - Me.ucrPnlFrequencies.Size = New System.Drawing.Size(94, 45) - Me.ucrPnlFrequencies.TabIndex = 4 - ' 'dlgOneWayFrequencies ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) diff --git a/instat/dlgOneWayFrequencies.vb b/instat/dlgOneWayFrequencies.vb index df304618317..934c537c7e4 100644 --- a/instat/dlgOneWayFrequencies.vb +++ b/instat/dlgOneWayFrequencies.vb @@ -40,7 +40,7 @@ Public Class dlgOneWayFrequencies Public Sub SetRCodeForControls(bReset As Boolean) ucrReceiverOneWayFreq.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrReceiverWeights.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - ucrPnlFrequencies.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + ucrPnlFrequencies.SetRCode(ucrBase.clsRsyntax.clsBaseFunction) ucrChkWeights.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrPnlSort.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrChkFlip.SetRCode(clsSjpFrq, bReset) @@ -73,9 +73,12 @@ Public Class dlgOneWayFrequencies ucrChkWeights.SetParameter(ucrReceiverWeights.GetParameter(), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) ucrChkWeights.AddToLinkedControls(ucrReceiverWeights, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlFrequencies.AddRadioButton(rdoTable) + ucrPnlFrequencies.AddRadioButton(rdoGraph) ucrPnlFrequencies.AddFunctionNamesCondition(rdoTable, "sjt.frq") ucrPnlFrequencies.AddFunctionNamesCondition(rdoGraph, "sjp.frq") + ucrPnlFrequencies.AddToLinkedControls(ucrChkFlip, {rdoGraph}, bNewLinkedDisabledIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True) ucrChkGroupData.SetText("Group Data") ucrNudGroups.SetMinMax(2, 100) @@ -84,7 +87,7 @@ Public Class dlgOneWayFrequencies ucrNudGroups.SetParameter(New RParameter("auto.group")) ucrChkGroupData.SetParameter(ucrNudGroups.GetParameter(), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) ucrChkGroupData.AddToLinkedControls(ucrNudGroups, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=10) - + ucrChkGroupData.AddFunctionNamesCondition(True, {"sjt.frq", "sjp.frq"}) ucrChkFlip.SetText("Flip Coordinates") ucrChkFlip.SetParameter(New RParameter("coord.flip", 1)) ucrChkFlip.SetValuesCheckedAndUnchecked("TRUE", "FALSE") @@ -94,17 +97,11 @@ Public Class dlgOneWayFrequencies Private Sub SetDefaults() clsSjtFreq = New RFunction clsSjpFrq = New RFunction - ' ucrPnlFrequencies.AddRadioButton(rdoTable) - ' ucrPnlFrequencies.AddRadioButton(rdoGraph) - ucrPnlFrequencies.AddToLinkedControls(ucrChkFlip, {rdoGraph}, bNewLinkedDisabledIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True) - ucrSelectorOneWayFreq.Reset() sdgOneWayFrequencies.ucrSaveGraph.Reset() sdgOneWayFrequencies.ucrInputGraphTitle.SetName("") sdgOneWayFrequencies.ucrInputHorizontalLabels.Reset() sdgOneWayFrequencies.ucrInputVerticalLabels.Reset() - ucrReceiverOneWayFreq.SetParameter(New RParameter("data", 1)) - ucrReceiverOneWayFreq.SetParameterIsRFunction() clsSjtFreq.SetRCommand("sjt.frq") clsSjtFreq.AddParameter("sort.frq", Chr(34) & "none" & Chr(34)) 'parameter added to have the default to False (R default is TRUE) @@ -112,7 +109,6 @@ Public Class dlgOneWayFrequencies clsSjtFreq.AddParameter("skip.zero", "FALSE") 'defining the digit default value clsSjtFreq.AddParameter("digits", 0) - clsSjpFrq.SetRCommand("sjp.frq") clsSjpFrq.AddParameter("sort.frq", Chr(34) & "none" & Chr(34)) clsSjpFrq.AddParameter("type", Chr(34) & "bar" & Chr(34)) @@ -124,14 +120,20 @@ Public Class dlgOneWayFrequencies Private Sub TestOkEnabled() If Not ucrReceiverOneWayFreq.IsEmpty() Then - If (Not ucrChkWeights.Checked) Then + If (Not ucrChkWeights.Checked) AndAlso (Not ucrChkGroupData.Checked) Then ucrBase.OKEnabled(True) - Else + ElseIf ucrChkWeights.Checked Then If Not ucrReceiverWeights.IsEmpty Then ucrBase.OKEnabled(True) Else ucrBase.OKEnabled(False) End If + ElseIf ucrChkGroupData.Checked + If ucrNudGroups.GetText <> "" Then + ucrBase.OKEnabled(True) + Else + ucrBase.OKEnabled(False) + End If End If Else ucrBase.OKEnabled(False) @@ -181,7 +183,6 @@ Public Class dlgOneWayFrequencies End Sub Private Sub cmdOptions_Click(sender As Object, e As EventArgs) Handles cmdOptions.Click - ' Link the base function to the sub dialog sdgOneWayFrequencies.SetRFunction(clsSjtFreq, clsSjpFrq, bResetSubdialog) bResetSubdialog = False sdgOneWayFrequencies.ShowDialog() From 2e2212e8c9a4c95cb87762d9c0afa6d55178f3f7 Mon Sep 17 00:00:00 2001 From: steven ndung'u Date: Tue, 4 Apr 2017 11:55:27 +0300 Subject: [PATCH 44/66] Fixing testOK --- instat/dlgOneWayFrequencies.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/dlgOneWayFrequencies.vb b/instat/dlgOneWayFrequencies.vb index 934c537c7e4..48368497259 100644 --- a/instat/dlgOneWayFrequencies.vb +++ b/instat/dlgOneWayFrequencies.vb @@ -178,7 +178,7 @@ Public Class dlgOneWayFrequencies End If End Sub - Private Sub Controls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverOneWayFreq.ControlContentsChanged, ucrReceiverWeights.ControlContentsChanged, ucrChkWeights.ControlContentsChanged + Private Sub Controls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverOneWayFreq.ControlContentsChanged, ucrReceiverWeights.ControlContentsChanged, ucrChkWeights.ControlContentsChanged, ucrNudGroups.ControlValueChanged, ucrChkGroupData.ControlValueChanged TestOkEnabled() End Sub From 6c489fb0f2b4b89f359409a2ada72df947f2501d Mon Sep 17 00:00:00 2001 From: maxwell fundi Date: Tue, 4 Apr 2017 16:31:16 +0300 Subject: [PATCH 45/66] unknown edits here --- instat/dlgRugPlot.vb | 2 +- instat/ucrVariablesAsFactor.vb | 37 +++++++++++++++++++++++++--------- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/instat/dlgRugPlot.vb b/instat/dlgRugPlot.vb index c0a61eea78b..40ca57480d3 100644 --- a/instat/dlgRugPlot.vb +++ b/instat/dlgRugPlot.vb @@ -71,7 +71,7 @@ Public Class dlgRugPlot ucrVariablesAsFactorForRugPlot.SetSelector(ucrRugPlotSelector) ucrVariablesAsFactorForRugPlot.SetIncludedDataType({"factor", "numeric"}) ucrVariablesAsFactorForRugPlot.SetParameter(New RParameter("y")) - ' ucrVariablesAsFactorForRugPlot.SetParameterIsRFunction() + ucrVariablesAsFactorForRugPlot.SetParameterIsRFunction() ucrReceiverX.Selector = ucrRugPlotSelector ucrReceiverX.SetIncludedDataTypes({"factor", "numeric"}) diff --git a/instat/ucrVariablesAsFactor.vb b/instat/ucrVariablesAsFactor.vb index d7ab7778d69..2f3a3374512 100644 --- a/instat/ucrVariablesAsFactor.vb +++ b/instat/ucrVariablesAsFactor.vb @@ -1,10 +1,14 @@ -Public Class ucrVariablesAsFactor +Imports instat + +Public Class ucrVariablesAsFactor Public bSingleVariable As Boolean Public bFirstLoad As Boolean Public ucrFactorReceiver As ucrReceiverSingle 'The ucrVariablesAsFactor has an associated ucrFactorReceiver, set on the dialog it is living in. In multiple mode, the ucrVariablesAsFactor can receive multiple variables that are then stacked in one and distinguished using a factor variable called "variable". The associated factor receiver will then be set in StackedFactorMode and fix it's content to this "variable" factor. Public WithEvents ucrVariableSelector As ucrSelectorByDataFrame Public bForceAsDataFrame As Boolean = True + Private strColumnsParameterNameInRFunction As String = "col_names" + Public WithEvents Selector As ucrSelector Public Sub New() ' This call is required by the designer. @@ -79,7 +83,7 @@ Else strVariablesToStack = Chr(34) & "value" & Chr(34) End If End If - Return strVariablesToStack + Return strVariablesToStack End Function 'Warning: The two following subs seem obsolete. @@ -182,9 +186,10 @@ If ucrFactorReceiver IsNot Nothing Then ucrFactorReceiver.SetStackedFactorMode(False) End If - ucrSingleVariable.SetMeAsReceiver() - Else - ucrSingleVariable.Visible = False + ucrSingleVariable.SetMeAsReceiver() + + Else + ucrSingleVariable.Visible = False ucrMultipleVariables.Visible = True 'TODO need to translate correctly cmdVariables.Text = "Multiple Variables" @@ -257,8 +262,8 @@ SetSingleTypeStatus(True) Else SetReceiverStatus() - cmdVariables.show() - setsingletypestatus(False) + cmdVariables.Show() + SetSingleTypeStatus(False) End If End Sub @@ -273,13 +278,27 @@ End Sub Public Sub SetParameterIsRFunction() - UpdateParameter() + ucrSingleVariable.SetParameterIsRFunction() + ucrMultipleVariables.SetParameterIsRFunction() + End Sub + + Public Sub SetParameterIsString() + ucrSingleVariable.SetParameterIsString() + ucrMultipleVariables.SetParameterIsString() End Sub + Public Sub UpdateParameter() If clsParameter Is Nothing Then clsParameter = New RParameter End If - 'we dont need parameter as string clsParameter.SetArgument(GetVariables(bForceAsDataFrame = True)) End Sub + + Public Overrides Sub SetRCode(clsNewCodeStructure As RCodeStructure, Optional bReset As Boolean = False) + If bSingleVariable Then + ucrSingleVariable.SetRCode(clsNewCodeStructure, bReset) + Else + ucrMultipleVariables.SetRCode(clsNewCodeStructure, bReset) + End If + End Sub End Class \ No newline at end of file From 2dcf349627e122027f4aeb34fa9f3c81d973b476 Mon Sep 17 00:00:00 2001 From: maxwell fundi Date: Wed, 5 Apr 2017 12:06:25 +0300 Subject: [PATCH 46/66] Changes and testing rugplot with ucrVaribales as factor --- instat/dlgRugPlot.vb | 9 ++++++--- instat/ucrVariablesAsFactor.vb | 35 +++++++++++++++++++--------------- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/instat/dlgRugPlot.vb b/instat/dlgRugPlot.vb index 40ca57480d3..8053ef3d438 100644 --- a/instat/dlgRugPlot.vb +++ b/instat/dlgRugPlot.vb @@ -71,18 +71,21 @@ Public Class dlgRugPlot ucrVariablesAsFactorForRugPlot.SetSelector(ucrRugPlotSelector) ucrVariablesAsFactorForRugPlot.SetIncludedDataType({"factor", "numeric"}) ucrVariablesAsFactorForRugPlot.SetParameter(New RParameter("y")) - ucrVariablesAsFactorForRugPlot.SetParameterIsRFunction() + ucrVariablesAsFactorForRugPlot.bWithQuotes = False + ucrVariablesAsFactorForRugPlot.SetParameterIsString() ucrReceiverX.Selector = ucrRugPlotSelector ucrReceiverX.SetIncludedDataTypes({"factor", "numeric"}) ucrReceiverX.SetParameter(New RParameter("x")) - ucrReceiverX.SetParameterIsRFunction() + ucrReceiverX.bWithQuotes = False + ucrReceiverX.SetParameterIsString() ucrFactorOptionalReceiver.Selector = ucrRugPlotSelector ucrFactorOptionalReceiver.SetIncludedDataTypes({"factor", "numeric"}) ucrFactorOptionalReceiver.SetParameter(New RParameter("colour")) - ucrFactorOptionalReceiver.SetParameterIsRFunction() + ucrFactorOptionalReceiver.bWithQuotes = False + ucrFactorOptionalReceiver.SetParameterIsString() ucrSaveGraph.SetPrefix("Rug") ucrSaveGraph.SetSaveTypeAsGraph() diff --git a/instat/ucrVariablesAsFactor.vb b/instat/ucrVariablesAsFactor.vb index 2f3a3374512..03e1a4f6849 100644 --- a/instat/ucrVariablesAsFactor.vb +++ b/instat/ucrVariablesAsFactor.vb @@ -10,6 +10,8 @@ Public Class ucrVariablesAsFactor Private strColumnsParameterNameInRFunction As String = "col_names" Public WithEvents Selector As ucrSelector + Public bWithQuotes As Boolean = True 'TODO this is not implemented correctly yet + Public Sub New() ' This call is required by the designer. InitializeComponent() @@ -149,13 +151,13 @@ Public Class ucrVariablesAsFactor If Not bSingleVariable Then SetMeasureVars() End If - RaiseEvent SelectionChanged() - UpdateParameter() + RaiseEvent SelectionChanged() + End Sub Private Sub ucrSingleVariable_SelectionChanged(sender As Object, e As EventArgs) Handles ucrSingleVariable.SelectionChanged - RaiseEvent SelectionChanged() - UpdateParameter() + RaiseEvent SelectionChanged() + End Sub Public Function IsEmpty() As Boolean @@ -182,14 +184,15 @@ Public Class ucrVariablesAsFactor ucrVariableSelector.ucrAvailableDataFrames.clsCurrDataFrame.RemoveParameterByName("stack_data") ucrVariableSelector.ucrAvailableDataFrames.clsCurrDataFrame.RemoveParameterByName("measure.vars") ucrVariableSelector.ucrAvailableDataFrames.clsCurrDataFrame.RemoveParameterByName("id.vars") - End If - If ucrFactorReceiver IsNot Nothing Then - ucrFactorReceiver.SetStackedFactorMode(False) - End If + End If ucrSingleVariable.SetMeAsReceiver() - + If clsParameter Is Nothing Then + 'Update parameter here + clsParameter = New RParameter + clsParameter.SetArgumentValue(ucrSingleVariable.GetVariableNames()) + End If Else - ucrSingleVariable.Visible = False + ucrSingleVariable.Visible = False ucrMultipleVariables.Visible = True 'TODO need to translate correctly cmdVariables.Text = "Multiple Variables" @@ -200,7 +203,12 @@ Public Class ucrVariablesAsFactor SetMeasureVars() ucrVariableSelector.ucrAvailableDataFrames.clsCurrDataFrame.AddParameter("id.vars", GetIDVarNamesFromSelector()) End If - ucrMultipleVariables.SetMeAsReceiver() + ucrMultipleVariables.SetMeAsReceiver() + If clsParameter Is Nothing Then + 'Update parameter here + clsParameter = New RParameter + clsParameter.SetArgumentValue(ucrMultipleVariables.GetVariableNames()) + End If End If End Sub @@ -288,10 +296,7 @@ Public Class ucrVariablesAsFactor End Sub Public Sub UpdateParameter() - If clsParameter Is Nothing Then - clsParameter = New RParameter - End If - clsParameter.SetArgument(GetVariables(bForceAsDataFrame = True)) + End Sub Public Overrides Sub SetRCode(clsNewCodeStructure As RCodeStructure, Optional bReset As Boolean = False) From 23a50d71c806106f206037443afb6627031c627a Mon Sep 17 00:00:00 2001 From: Danny Parsons Date: Wed, 5 Apr 2017 19:49:55 +0100 Subject: [PATCH 47/66] update to ucrCore for multiple parameters and functions --- instat/UcrPanel.vb | 12 ++-- instat/dlgOneWayFrequencies.vb | 19 +++--- instat/ucrCore.vb | 101 ++++++++++++++++++++++--------- instat/ucrReceiver.vb | 33 +++++----- instat/ucrSelectorByDataFrame.vb | 2 +- 5 files changed, 109 insertions(+), 58 deletions(-) diff --git a/instat/UcrPanel.vb b/instat/UcrPanel.vb index c6643be33c8..09e108ca5a9 100644 --- a/instat/UcrPanel.vb +++ b/instat/UcrPanel.vb @@ -43,15 +43,19 @@ Public Class UcrPanel AddRadioButtonRange({rdoTemp}) If strValue <> "" Then dctRadioButtonValues.Add(rdoTemp, strValue) - AddParameterValuesCondition(rdoTemp, clsParameter.strArgumentName, strValue) + AddParameterValuesCondition(rdoTemp, GetParameter().strArgumentName, strValue) End If End Sub Public Sub RadioButtons_CheckedChanged() + OnControlValueChanged() + End Sub + + Protected Overrides Sub UpdateParameter(clsTempParam As RParameter) Dim strNewValue As String = "" Dim rdoTemp As RadioButton - If bChangeParameterValue AndAlso clsParameter IsNot Nothing Then + If bChangeParameterValue AndAlso clsTempParam IsNot Nothing Then For Each ctrTemp As Control In pnlRadios.Controls If TypeOf ctrTemp Is RadioButton Then rdoTemp = CType(ctrTemp, RadioButton) @@ -64,13 +68,11 @@ Public Class UcrPanel End If Next If strNewValue <> "" Then - clsParameter.SetArgumentValue(strNewValue) + clsTempParam.SetArgumentValue(strNewValue) Else MsgBox("Developer error: No parameter value is associated to the currently checked radio button. Cannot update parameter.") End If End If - UpdateRCode() - OnControlValueChanged() End Sub Protected Overrides Sub SetToValue(objTemp As Object) diff --git a/instat/dlgOneWayFrequencies.vb b/instat/dlgOneWayFrequencies.vb index 48368497259..3758e9f3e62 100644 --- a/instat/dlgOneWayFrequencies.vb +++ b/instat/dlgOneWayFrequencies.vb @@ -23,6 +23,7 @@ Public Class dlgOneWayFrequencies 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 @@ -44,10 +45,8 @@ Public Class dlgOneWayFrequencies ucrChkWeights.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrPnlSort.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrChkFlip.SetRCode(clsSjpFrq, bReset) - ucrChkGroupData.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrNudGroups.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - End Sub Private Sub InitialiseDialog() @@ -57,11 +56,13 @@ Public Class dlgOneWayFrequencies cmdOptions.Enabled = True ucrReceiverOneWayFreq.Selector = ucrSelectorOneWayFreq ucrReceiverOneWayFreq.SetMeAsReceiver() + ucrReceiverOneWayFreq.SetParameterIsRFunction() ucrReceiverWeights.Selector = ucrSelectorOneWayFreq ucrReceiverWeights.SetParameter(New RParameter("weight.by", 3)) ucrReceiverWeights.SetParameterIsRFunction() ucrReceiverWeights.SetDataType("numeric") + ucrReceiverWeights.bUpdateRCodeFromControl = False ucrPnlSort.SetParameter(New RParameter("sort.frq", 2)) ucrPnlSort.AddRadioButton(rdoNone, Chr(34) & "none" & Chr(34)) @@ -88,6 +89,7 @@ Public Class dlgOneWayFrequencies ucrChkGroupData.SetParameter(ucrNudGroups.GetParameter(), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) ucrChkGroupData.AddToLinkedControls(ucrNudGroups, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=10) ucrChkGroupData.AddFunctionNamesCondition(True, {"sjt.frq", "sjp.frq"}) + ucrChkGroupData.bUpdateRCodeFromControl = True ucrChkFlip.SetText("Flip Coordinates") ucrChkFlip.SetParameter(New RParameter("coord.flip", 1)) ucrChkFlip.SetValuesCheckedAndUnchecked("TRUE", "FALSE") @@ -148,20 +150,21 @@ Public Class dlgOneWayFrequencies ' ucrBase.clsRsyntax.bHTMLOutput = False ucrBase.clsRsyntax.iCallType = 3 End If - End Sub Private Sub ChangeBaseFunction() If rdoTable.Checked Then - ucrReceiverOneWayFreq.SetParameter(New RParameter("data", 1)) - ucrReceiverOneWayFreq.SetParameterIsRFunction() + ucrReceiverOneWayFreq.ChangeParameterName("data") ucrBase.clsRsyntax.SetBaseRFunction(clsSjtFreq) Else - ucrReceiverOneWayFreq.SetParameter(New RParameter("var.cnt", 1)) - ucrReceiverOneWayFreq.SetParameterIsRFunction() + ucrReceiverOneWayFreq.ChangeParameterName("var.cnt") ucrBase.clsRsyntax.SetBaseRFunction(clsSjpFrq) End If - SetRCodeForControls(False) + If Not ucrReceiverOneWayFreq.IsEmpty Then + 'TODO needs to be implemented if still needed? + 'ucrReceiverOneWayFreq.SetParameterArgument(ucrReceiverOneWayFreq.GetVariables()) + End If + SetRCodeForControls(bReset) End Sub Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset diff --git a/instat/ucrCore.vb b/instat/ucrCore.vb index 99e9d9a8770..9eb5028facf 100644 --- a/instat/ucrCore.vb +++ b/instat/ucrCore.vb @@ -22,7 +22,11 @@ Public Class ucrCore Protected clsRCode As RCodeStructure 'Parameter that this control manages 'Either by editing its value or adding/removing it from an RCodeStructure - Public clsParameter As RParameter + Private clsParameter As RParameter + + 'Additional pairs of (RCode, RParameter) which this control may also manage + 'There may be duplicate values in here. For example, one parameter being added into multiple functions + Protected lstAdditionalCodeParameterPairs As New List(Of Tuple(Of RCodeStructure, RParameter)) 'Default value of the control 'No specific type since it can be interpreted different by each control type @@ -87,25 +91,32 @@ Public Class ucrCore 'Update the control based on the code in RCodeStructure 'bReset : should the control reset to the default value if the parameter is not present in the code - Public Overridable Sub UpdateControl(Optional bReset As Boolean = False) - If clsRCode IsNot Nothing Then - If clsParameter IsNot Nothing Then - If Not clsRCode.ContainsParameter(clsParameter) Then - If clsRCode.ContainsParameter(clsParameter.strArgumentName) Then - clsParameter = clsRCode.GetParameter(clsParameter.strArgumentName) - ElseIf bReset Then - If objDefaultState Is Nothing Then - SetToRDefault() - 'Exit Sub - End If - Else - End If - End If - Else - End If - Else - clsRCode = New RCodeStructure - End If + Public Overridable Sub UpdateControl(Optional bReset As Boolean = False) + Dim clsTempRCode As RCodeStructure + Dim clsTempRParameter As RParameter + + For Each tplTemp In lstAllCodeParameterPairs + clsTempRCode = tplTemp.Item1 + clsTempRParameter = tplTemp.Item2 + If clsTempRCode IsNot Nothing Then + If clsTempRParameter IsNot Nothing Then + If Not clsTempRCode.ContainsParameter(clsTempRParameter) Then + If clsTempRCode.ContainsParameter(clsTempRParameter.strArgumentName) Then + clsTempRParameter = clsTempRCode.GetParameter(clsTempRParameter.strArgumentName) + ElseIf bReset Then + If objDefaultState Is Nothing Then + SetToRDefault() + 'Exit Sub + End If + Else + End If + End If + Else + End If + Else + clsTempRCode = New RCodeStructure + End If + Next SetControlValue() UpdateLinkedControls(bReset) End Sub @@ -238,6 +249,7 @@ Public Class ucrCore Public Sub OnControlValueChanged() OnControlContentsChanged() + UpdateAllParameters() UpdateRCode() RaiseEvent ControlValueChanged(Me) End Sub @@ -262,14 +274,21 @@ Public Class ucrCore Return False End Function - Public Overridable Sub AddOrRemoveParameter(bAdd As Boolean) - If clsRCode IsNot Nothing AndAlso clsParameter IsNot Nothing Then - If bAdd Then - clsRCode.AddParameter(clsParameter) - Else - clsRCode.RemoveParameter(clsParameter) + Public Overridable Sub AddOrRemoveParameter(bAdd As Boolean) + Dim clsTempRCode As RCodeStructure + Dim clsTempRParameter As RParameter + + For Each tplTemp In lstAllCodeParameterPairs + clsTempRCode = tplTemp.Item1 + clsTempRParameter = tplTemp.Item2 + If clsTempRCode IsNot Nothing AndAlso clsTempRParameter IsNot Nothing Then + If bAdd Then + clsTempRCode.AddParameter(clsTempRParameter) + Else + clsTempRCode.RemoveParameter(clsTempRParameter) + End If End If - End If + Next End Sub Public Sub AddToLinkedControls(lstLinked As ucrCore(), objValues As Object(), Optional bNewLinkedAddRemoveParameter As Boolean = False, Optional bNewLinkedUpdateFunction As Boolean = False, Optional bNewLinkedDisabledIfParameterMissing As Boolean = False, Optional bNewLinkedHideIfParameterMissing As Boolean = False, Optional bNewLinkedChangeToDefaultState As Boolean = False, Optional objNewDefaultState As Object = Nothing) @@ -442,4 +461,32 @@ Public Class ucrCore clsParameter.SetArgumentValue(strNewValue) End If End Sub + + Protected ReadOnly Property lstAllCodeParameterPairs As List(Of Tuple(Of RCodeStructure, RParameter)) + Get + Dim lstTemp As New List(Of Tuple(Of RCodeStructure, RParameter)) + lstTemp.Add(New Tuple(Of RCodeStructure, RParameter)(clsRCode, clsParameter)) + For Each tplTemp As Tuple(Of RCodeStructure, RParameter) In lstAdditionalCodeParameterPairs + lstTemp.Add(tplTemp) + Next + Return lstTemp + End Get + End Property + + Public Sub AddAdditionalCodeParameterPair(clsNewRCode As RCodeStructure, clsNewRParameter As RParameter) + lstAdditionalCodeParameterPairs.Add(New Tuple(Of RCodeStructure, RParameter)(clsNewRCode, clsNewRParameter)) + End Sub + + Protected Sub UpdateAllParameters() + Dim tplTemp As Tuple(Of RCodeStructure, RParameter) + For Each tplTemp In lstAdditionalCodeParameterPairs + UpdateParameter(tplTemp.Item2) + Next + End Sub + + Protected Overridable Sub UpdateParameter(clsTempParam As RParameter) + If GetValueToSet() IsNot Nothing Then + clsTempParam.SetArgumentValue(GetValueToSet().ToString()) + End If + End Sub End Class \ No newline at end of file diff --git a/instat/ucrReceiver.vb b/instat/ucrReceiver.vb index 8796254d952..0f42ab44cdb 100644 --- a/instat/ucrReceiver.vb +++ b/instat/ucrReceiver.vb @@ -324,15 +324,17 @@ Public Class ucrReceiver Protected Overrides Sub SetControlValue() Dim clsTempDataParameter As RParameter Dim lstCurrentVariables As String() = Nothing + Dim clsTempParameter As RParameter - If clsParameter IsNot Nothing Then + clsTempParameter = GetParameter() + If clsTempParameter IsNot Nothing Then If bChangeParameterValue Then - If bParameterIsString AndAlso clsParameter.bIsString Then - lstCurrentVariables = ExtractItemsFromRList(clsParameter.strArgumentValue) - ElseIf bParameterIsRFunction AndAlso clsParameter.bIsFunction Then - clsTempDataParameter = clsParameter.clsArgumentCodeStructure.GetParameter(strColumnsParameterNameInRFunction) + If bParameterIsString AndAlso clsTempParameter.bIsString Then + lstCurrentVariables = ExtractItemsFromRList(clsTempParameter.strArgumentValue) + ElseIf bParameterIsRFunction AndAlso clsTempParameter.bIsFunction Then + clsTempDataParameter = clsTempParameter.clsArgumentCodeStructure.GetParameter(strColumnsParameterNameInRFunction) If clsTempDataParameter IsNot Nothing Then - lstCurrentVariables = ExtractItemsFromRList(clsParameter.clsArgumentCodeStructure.GetParameter(strColumnsParameterNameInRFunction).strArgumentValue) + lstCurrentVariables = ExtractItemsFromRList(clsTempParameter.clsArgumentCodeStructure.GetParameter(strColumnsParameterNameInRFunction).strArgumentValue) End If End If Clear() @@ -349,31 +351,28 @@ Public Class ucrReceiver End If End Sub - Private Sub ucrReceiver_SelectionChanged(sender As Object, e As EventArgs) Handles Me.SelectionChanged - UpdateParameter() - End Sub - - Public Sub UpdateParameter() - If clsParameter Is Nothing Then - clsParameter = New RParameter + Protected Overrides Sub UpdateParameter(clsTempParam As RParameter) + If clsTempParam Is Nothing Then + clsTempParam = New RParameter End If + 'Could need bParameterIsString and bParameterIsRFunction to be properties of RParameter if two functions need string/function If bParameterIsString Then - clsParameter.SetArgumentValue(GetVariableNames(bWithQuotes)) + clsTempParam.SetArgumentValue(GetVariableNames(bWithQuotes)) ElseIf bParameterIsRFunction Then - clsParameter.SetArgument(GetVariables(bForceAsDataFrame)) + clsTempParam.SetArgument(GetVariables(bForceAsDataFrame)) End If End Sub Public Sub SetParameterIsString() bParameterIsString = True bParameterIsRFunction = False - UpdateParameter() + UpdateAllParameters() End Sub Public Sub SetParameterIsRFunction() bParameterIsRFunction = True bParameterIsString = False - UpdateParameter() + UpdateAllParameters() End Sub Public Overrides Function IsRDefault() As Boolean diff --git a/instat/ucrSelectorByDataFrame.vb b/instat/ucrSelectorByDataFrame.vb index b6478cc3360..a352db2d01c 100644 --- a/instat/ucrSelectorByDataFrame.vb +++ b/instat/ucrSelectorByDataFrame.vb @@ -118,7 +118,7 @@ Public Class ucrSelectorByDataFrame Public Overrides Sub AddOrRemoveParameter(bAdd As Boolean) If bHasOwnParameter Then - AddOrRemoveParameter(bAdd) + MyBase.AddOrRemoveParameter(bAdd) Else ucrAvailableDataFrames.AddOrRemoveParameter(bAdd) End If From 96364cbe00c69e8a8a825a7564d965ae7c0e7a3f Mon Sep 17 00:00:00 2001 From: Lily Date: Thu, 6 Apr 2017 15:07:08 +0100 Subject: [PATCH 48/66] Parameter positioning and Set Parameters before Set Text --- instat/sdgSummaries.vb | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/instat/sdgSummaries.vb b/instat/sdgSummaries.vb index d5d21afba64..44aa4aa9288 100644 --- a/instat/sdgSummaries.vb +++ b/instat/sdgSummaries.vb @@ -26,45 +26,45 @@ Public Class sdgSummaries End Sub Public Sub InitialiseControls() + ucrChkNonMissing.SetParameter(New RParameter("summary_count_non_missing", 1), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) ucrChkNonMissing.SetText("N Non Missing") - ucrChkNonMissing.SetParameter(New RParameter("summary_count_non_missing"), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) + ucrChkNMissing.SetParameter(New RParameter("summary_count_missing", 2), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) ucrChkNMissing.SetText("N Missing") - ucrChkNMissing.SetParameter(New RParameter("summary_count_missing"), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) + ucrChkNTotal.SetParameter(New RParameter("summary_count", 3), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) ucrChkNTotal.SetText("N Total") - ucrChkNTotal.SetParameter(New RParameter("summary_count"), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) + ucrChkMean.SetParameter(New RParameter("summary_mean", 4), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) ucrChkMean.SetText("Mean") - ucrChkMean.SetParameter(New RParameter("summary_mean"), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) + ucrChkMinimum.SetParameter(New RParameter("summary_min", 5), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) ucrChkMinimum.SetText("Minimum") - ucrChkMinimum.SetParameter(New RParameter("summary_min"), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) + ucrChkMode.SetParameter(New RParameter("summary_mode", 6), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) ucrChkMode.SetText("Mode") - ucrChkMode.SetParameter(New RParameter("summary_mode"), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) + ucrChkMaximum.SetParameter(New RParameter("summary_max", 7), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) ucrChkMaximum.SetText("Maximum") - ucrChkMaximum.SetParameter(New RParameter("summary_max"), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) + ucrChkMedian.SetParameter(New RParameter("summary_median", 8), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) ucrChkMedian.SetText("Median") - ucrChkMedian.SetParameter(New RParameter("summary_median"), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) + ucrChkStdDev.SetParameter(New RParameter("summary_sd", 9), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) ucrChkStdDev.SetText("Standard Deviation") - ucrChkStdDev.SetParameter(New RParameter("summary_sd"), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) + ucrChkRange.SetParameter(New RParameter("summary_range", 10), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) ucrChkRange.SetText("Range") - ucrChkRange.SetParameter(New RParameter("summary_range"), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) + ucrChkSum.SetParameter(New RParameter("summary_sum", 11), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) ucrChkSum.SetText("Sum") - ucrChkSum.SetParameter(New RParameter("summary_sum"), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) + ucrChkVariance.SetParameter(New RParameter("summary_var", 12), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) ucrChkVariance.SetText("Variance") - ucrChkVariance.SetParameter(New RParameter("summary_var"), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) + ucrChkQuartiles.SetParameter(New RParameter("summary_quartiles", 13), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) ucrChkQuartiles.Enabled = False 'To be enabled once quartiles summary function has is implemented in Instat object 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, ucrChkVariance, ucrChkRange, ucrChkSum, ucrChkQuartiles}) From cc1da68699dd91a39d12e24afc986d759729eb3f Mon Sep 17 00:00:00 2001 From: Danny Parsons Date: Thu, 6 Apr 2017 17:25:04 +0100 Subject: [PATCH 49/66] changed how main parameter and rcode are stored and accessed in core control and updated one way frequencies dialog --- instat/dlgOneWayFrequencies.vb | 17 +++--- instat/dlgOpenNetCDF.vb | 4 +- instat/sdgClimdexIndices.vb | 8 +-- instat/sdgSummaries.vb | 4 +- instat/ucrCheck.vb | 49 +++++++++-------- instat/ucrCore.vb | 90 +++++++++++++++++--------------- instat/ucrDataFrame.vb | 33 ++++++------ instat/ucrInput.vb | 35 +++++++------ instat/ucrInputComboBox.vb | 4 +- instat/ucrNud.vb | 13 +++-- instat/ucrRadio.vb | 75 +++++++++++++------------- instat/ucrReorder.vb | 51 ++++++++++-------- instat/ucrSave.vb | 39 +++++++++----- instat/ucrSelectorByDataFrame.vb | 12 +++-- 14 files changed, 245 insertions(+), 189 deletions(-) diff --git a/instat/dlgOneWayFrequencies.vb b/instat/dlgOneWayFrequencies.vb index 3758e9f3e62..30d6ea6d018 100644 --- a/instat/dlgOneWayFrequencies.vb +++ b/instat/dlgOneWayFrequencies.vb @@ -39,7 +39,7 @@ Public Class dlgOneWayFrequencies End Sub Public Sub SetRCodeForControls(bReset As Boolean) - ucrReceiverOneWayFreq.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + ucrReceiverOneWayFreq.SetRCode(clsSjtFreq, bReset) ucrReceiverWeights.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrPnlFrequencies.SetRCode(ucrBase.clsRsyntax.clsBaseFunction) ucrChkWeights.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) @@ -56,6 +56,7 @@ Public Class dlgOneWayFrequencies cmdOptions.Enabled = True ucrReceiverOneWayFreq.Selector = ucrSelectorOneWayFreq ucrReceiverOneWayFreq.SetMeAsReceiver() + ucrReceiverOneWayFreq.SetParameter(New RParameter("data", 1)) ucrReceiverOneWayFreq.SetParameterIsRFunction() ucrReceiverWeights.Selector = ucrSelectorOneWayFreq @@ -116,6 +117,12 @@ Public Class dlgOneWayFrequencies clsSjpFrq.AddParameter("type", Chr(34) & "bar" & Chr(34)) clsSjpFrq.AddParameter("show.prc", "TRUE") clsSjpFrq.SetAssignTo("last_graph", strTempDataframe:=ucrSelectorOneWayFreq.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") + + ucrReceiverOneWayFreq.AddAdditionalCodeParameterPair(clsSjpFrq, New RParameter("var.cnt", 1)) + ucrReceiverWeights.AddAdditionalCodeParameterPair(clsSjpFrq, New RParameter("weight.by", 3)) + ucrPnlSort.AddAdditionalCodeParameterPair(clsSjpFrq, New RParameter("sort.frq", 2)) + ucrNudGroups.AddAdditionalCodeParameterPair(clsSjpFrq, New RParameter("auto.group")) + ucrBase.clsRsyntax.SetBaseRFunction(clsSjtFreq) bResetSubdialog = True End Sub @@ -154,16 +161,12 @@ Public Class dlgOneWayFrequencies Private Sub ChangeBaseFunction() If rdoTable.Checked Then - ucrReceiverOneWayFreq.ChangeParameterName("data") + 'ucrReceiverOneWayFreq.ChangeParameterName("data") ucrBase.clsRsyntax.SetBaseRFunction(clsSjtFreq) Else - ucrReceiverOneWayFreq.ChangeParameterName("var.cnt") + 'ucrReceiverOneWayFreq.ChangeParameterName("var.cnt") ucrBase.clsRsyntax.SetBaseRFunction(clsSjpFrq) End If - If Not ucrReceiverOneWayFreq.IsEmpty Then - 'TODO needs to be implemented if still needed? - 'ucrReceiverOneWayFreq.SetParameterArgument(ucrReceiverOneWayFreq.GetVariables()) - End If SetRCodeForControls(bReset) End Sub diff --git a/instat/dlgOpenNetCDF.vb b/instat/dlgOpenNetCDF.vb index 96e14d42088..a9d63b99a94 100644 --- a/instat/dlgOpenNetCDF.vb +++ b/instat/dlgOpenNetCDF.vb @@ -76,9 +76,9 @@ Public Class dlgOpenNetCDF ucrInputLocDataName.SetValidationTypeAsRVariable() clsRDatanames.SetRCommand("c") ucrInputDataName.SetParameter(New RParameter("data_df_name", 0)) - ucrInputDataName.clsParameter.bIncludeArgumentName = False + ucrInputDataName.SetParameterIncludeArgumentName(False) ucrInputLocDataName.SetParameter(New RParameter("location_df_name", 1)) - ucrInputLocDataName.clsParameter.bIncludeArgumentName = False + ucrInputLocDataName.SetParameterIncludeArgumentName(False) ucrInputFilePath.SetParameter(New RParameter("filename", 0)) End Sub diff --git a/instat/sdgClimdexIndices.vb b/instat/sdgClimdexIndices.vb index d1d3fb76715..8a4df5a9735 100644 --- a/instat/sdgClimdexIndices.vb +++ b/instat/sdgClimdexIndices.vb @@ -168,12 +168,12 @@ Public Class sdgClimdexIndices ucrNudMothlyMissingDays.SetMinMax(1, 31) ucrNudLowerBase.SetParameter(New RParameter("lower_base", 0)) - ucrNudLowerBase.clsParameter.bIncludeArgumentName = False + ucrNudLowerBase.SetParameterIncludeArgumentName(False) ucrNudLowerBase.SetRDefault(1961) ucrNudLowerBase.SetMinMax(1900, 9999) ucrNudUpperBase.SetParameter(New RParameter("upper_base", 1)) - ucrNudUpperBase.clsParameter.bIncludeArgumentName = False + ucrNudUpperBase.SetParameterIncludeArgumentName(False) ucrNudUpperBase.SetRDefault(1990) ucrNudUpperBase.SetMinMax(1900, 9999) @@ -188,13 +188,13 @@ Public Class sdgClimdexIndices ucrInputTempQtiles.SetParameter(New RParameter("x")) ucrInputTempQtiles.SetValidationTypeAsNumericList() ucrInputTempQtiles.AddQuotesIfUnrecognised = False - ucrInputTempQtiles.clsParameter.bIncludeArgumentName = False + ucrInputTempQtiles.SetParameterIncludeArgumentName(False) ucrInputTempQtiles.SetRDefault("0.1, 0.9") ucrInputPrecQtiles.SetParameter(New RParameter("x")) ucrInputPrecQtiles.SetValidationTypeAsNumericList() ucrInputPrecQtiles.AddQuotesIfUnrecognised = False - ucrInputPrecQtiles.clsParameter.bIncludeArgumentName = False + ucrInputPrecQtiles.SetParameterIncludeArgumentName(False) ucrInputPrecQtiles.SetRDefault("0.95, 0.99") clsNewClimdexInput.AddParameter("temp.qtiles", clsRFunctionParameter:=clsRTempQTiles) diff --git a/instat/sdgSummaries.vb b/instat/sdgSummaries.vb index 5114be4c13e..90395907fa1 100644 --- a/instat/sdgSummaries.vb +++ b/instat/sdgSummaries.vb @@ -70,8 +70,8 @@ Public Class sdgSummaries lstCheckboxes = New List(Of ucrCheck) 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 + ctrTemp.SetParameterValue(Chr(34) & ctrTemp.GetParameter().strArgumentName & Chr(34)) + ctrTemp.SetParameterIncludeArgumentName(False) Next bControlsInitialised = True End Sub diff --git a/instat/ucrCheck.vb b/instat/ucrCheck.vb index 52cbdeb1f19..c68137d610c 100644 --- a/instat/ucrCheck.vb +++ b/instat/ucrCheck.vb @@ -14,6 +14,8 @@ ' You should have received a copy of the GNU General Public License k ' along with this program. If not, see . +Imports instat + Public Class ucrCheck ''Is the checkbox linked to specific parameter values when checked/unchecked 'Private bIsParameterValue As Boolean = True @@ -25,19 +27,19 @@ Public Class ucrCheck Dim clsTempCond As New Condition strValueIfChecked = strNewValueIfChecked - If clsParameter Is Nothing Then + If GetParameter() Is Nothing Then MsgBox("Developer error: Parameter must be set before SetValueIfChecked can be run! Control will not update correctly.") Else - AddParameterValuesCondition(True, clsParameter.strArgumentName, strValueIfChecked) + AddParameterValuesCondition(True, GetParameter().strArgumentName, strValueIfChecked) End If End Sub Public Sub SetValueIfUnchecked(strNewValueIfUnchecked As String) strValueIfUnchecked = strNewValueIfUnchecked - If clsParameter Is Nothing OrElse clsParameter.strArgumentName Is Nothing Then + If GetParameter() Is Nothing OrElse GetParameter().strArgumentName Is Nothing Then MsgBox("Developer error: Parameter must be set with a parameter name before SetValueIfUnchecked can be run! Control will not update correctly.") Else - AddParameterValuesCondition(False, clsParameter.strArgumentName, strValueIfUnchecked) + AddParameterValuesCondition(False, GetParameter().strArgumentName, strValueIfUnchecked) End If End Sub @@ -48,8 +50,8 @@ Public Class ucrCheck If bChangeParameterValue Then SetValuesCheckedAndUnchecked(strNewValueIfChecked, strNewValueIfUnchecked) ElseIf bAddRemoveParameter Then - AddParameterPresentCondition(True, clsParameter.strArgumentName) - AddParameterPresentCondition(False, clsParameter.strArgumentName, False) + AddParameterPresentCondition(True, GetParameter().strArgumentName) + AddParameterPresentCondition(False, GetParameter().strArgumentName, False) End If End Sub @@ -59,15 +61,17 @@ Public Class ucrCheck End Sub Private Sub chkCheck_CheckedChanged(sender As Object, e As EventArgs) Handles chkCheck.CheckedChanged - If bChangeParameterValue AndAlso clsParameter IsNot Nothing Then + OnControlValueChanged() + End Sub + + Protected Overrides Sub UpdateParameter(clsTempParam As RParameter) + If bChangeParameterValue AndAlso clsTempParam IsNot Nothing Then If chkCheck.Checked Then - clsParameter.SetArgumentValue(strValueIfChecked) + clsTempParam.SetArgumentValue(strValueIfChecked) Else - clsParameter.SetArgumentValue(strValueIfUnchecked) + clsTempParam.SetArgumentValue(strValueIfUnchecked) End If End If - UpdateRCode() - OnControlValueChanged() End Sub Public Property Checked As Boolean @@ -96,19 +100,22 @@ Public Class ucrCheck End Function Public Overrides Function GetValueToSet() As Object - If clsParameter IsNot Nothing Then - If clsParameter.bIsString Then + Dim clsMainParameter As RParameter + + clsMainParameter = GetParameter() + If clsMainParameter IsNot Nothing Then + If clsMainParameter.bIsString Then If bChangeParameterValue Then - If clsParameter.strArgumentValue = strValueIfChecked OrElse clsParameter.strArgumentValue = strValueIfUnchecked Then - Return (clsParameter.strArgumentValue = strValueIfChecked) + If clsMainParameter.strArgumentValue = strValueIfChecked OrElse clsMainParameter.strArgumentValue = strValueIfUnchecked Then + Return (clsMainParameter.strArgumentValue = strValueIfChecked) Else - Return clsParameter.strArgumentValue + Return clsMainParameter.strArgumentValue End If ElseIf bAddRemoveParameter Then - Return clsRCode.ContainsParameter(clsParameter) + Return GetRCode().ContainsParameter(clsMainParameter) End If - ElseIf clsParameter.bIsFunction OrElse clsParameter.bIsOperator Then - Return clsParameter.clsArgumentCodeStructure + ElseIf clsMainParameter.bIsFunction OrElse clsMainParameter.bIsOperator Then + Return clsMainParameter.clsArgumentCodeStructure Else Return Nothing End If @@ -143,8 +150,8 @@ Public Class ucrCheck If bChangeParameterValue Then SetValuesCheckedAndUnchecked(strValueIfChecked, strValueIfUnchecked) ElseIf bAddRemoveParameter Then - AddParameterPresentCondition(True, clsParameter.strArgumentName) - AddParameterPresentCondition(False, clsParameter.strArgumentName, False) + AddParameterPresentCondition(True, GetParameter().strArgumentName) + AddParameterPresentCondition(False, GetParameter().strArgumentName, False) End If End If End Sub diff --git a/instat/ucrCore.vb b/instat/ucrCore.vb index 9eb5028facf..ccab0f92107 100644 --- a/instat/ucrCore.vb +++ b/instat/ucrCore.vb @@ -17,16 +17,11 @@ Imports instat Public Class ucrCore - - 'Function or Operator that this control's parameter is added/removed from - Protected clsRCode As RCodeStructure - 'Parameter that this control manages - 'Either by editing its value or adding/removing it from an RCodeStructure - Private clsParameter As RParameter - - 'Additional pairs of (RCode, RParameter) which this control may also manage - 'There may be duplicate values in here. For example, one parameter being added into multiple functions - Protected lstAdditionalCodeParameterPairs As New List(Of Tuple(Of RCodeStructure, RParameter)) + 'These lists are intended to be pairs of (RCode, RParameter) which this control may manage + 'The first item in each list can be accessed through the properties clsRCode and clsRParameter + 'There may be duplicate values in the lists. For example, one parameter being added into multiple functions. + Protected lstAllRCodes As List(Of RCodeStructure) = New List(Of RCodeStructure)({Nothing}) + Protected lstAllRParameters As List(Of RParameter) = New List(Of RParameter)({Nothing}) 'Default value of the control 'No specific type since it can be interpreted different by each control type @@ -95,14 +90,14 @@ Public Class ucrCore Dim clsTempRCode As RCodeStructure Dim clsTempRParameter As RParameter - For Each tplTemp In lstAllCodeParameterPairs - clsTempRCode = tplTemp.Item1 - clsTempRParameter = tplTemp.Item2 + For i As Integer = 0 To lstAllRCodes.Count - 1 + clsTempRCode = lstAllRCodes(i) + clsTempRParameter = lstAllRParameters(i) If clsTempRCode IsNot Nothing Then If clsTempRParameter IsNot Nothing Then If Not clsTempRCode.ContainsParameter(clsTempRParameter) Then If clsTempRCode.ContainsParameter(clsTempRParameter.strArgumentName) Then - clsTempRParameter = clsTempRCode.GetParameter(clsTempRParameter.strArgumentName) + SetParameter(clsTempRCode.GetParameter(clsTempRParameter.strArgumentName), i) ElseIf bReset Then If objDefaultState Is Nothing Then SetToRDefault() @@ -254,8 +249,8 @@ Public Class ucrCore RaiseEvent ControlValueChanged(Me) End Sub - Public Overridable Sub SetParameter(clsNewParameter As RParameter) - clsParameter = clsNewParameter + Public Overridable Sub SetParameter(clsNewParameter As RParameter, Optional iIndex As Integer = 0) + lstAllRParameters(iIndex) = clsNewParameter End Sub Public Overridable Function GetParameterName() As String @@ -275,17 +270,12 @@ Public Class ucrCore End Function Public Overridable Sub AddOrRemoveParameter(bAdd As Boolean) - Dim clsTempRCode As RCodeStructure - Dim clsTempRParameter As RParameter - - For Each tplTemp In lstAllCodeParameterPairs - clsTempRCode = tplTemp.Item1 - clsTempRParameter = tplTemp.Item2 - If clsTempRCode IsNot Nothing AndAlso clsTempRParameter IsNot Nothing Then + For i As Integer = 0 To lstAllRCodes.Count - 1 + If lstAllRCodes(i) IsNot Nothing AndAlso lstAllRParameters(i) IsNot Nothing Then If bAdd Then - clsTempRCode.AddParameter(clsTempRParameter) + lstAllRCodes(i).AddParameter(lstAllRParameters(i)) Else - clsTempRCode.RemoveParameter(clsTempRParameter) + lstAllRCodes(i).RemoveParameter(lstAllRParameters(i)) End If End If Next @@ -345,6 +335,10 @@ Public Class ucrCore Return clsParameter End Function + Public Overridable Function GetRCode() As RFunction + Return clsRCode + End Function + Public Sub SetLinkedDisplayControl(ctrNewControl As Control) ctrLinkedDisaplyControl = ctrNewControl SetLinkedDisplayControlVisibility() @@ -462,25 +456,15 @@ Public Class ucrCore End If End Sub - Protected ReadOnly Property lstAllCodeParameterPairs As List(Of Tuple(Of RCodeStructure, RParameter)) - Get - Dim lstTemp As New List(Of Tuple(Of RCodeStructure, RParameter)) - lstTemp.Add(New Tuple(Of RCodeStructure, RParameter)(clsRCode, clsParameter)) - For Each tplTemp As Tuple(Of RCodeStructure, RParameter) In lstAdditionalCodeParameterPairs - lstTemp.Add(tplTemp) - Next - Return lstTemp - End Get - End Property - Public Sub AddAdditionalCodeParameterPair(clsNewRCode As RCodeStructure, clsNewRParameter As RParameter) - lstAdditionalCodeParameterPairs.Add(New Tuple(Of RCodeStructure, RParameter)(clsNewRCode, clsNewRParameter)) + lstAllRCodes.Add(clsNewRCode) + lstAllRParameters.Add(clsNewRParameter) End Sub - Protected Sub UpdateAllParameters() - Dim tplTemp As Tuple(Of RCodeStructure, RParameter) - For Each tplTemp In lstAdditionalCodeParameterPairs - UpdateParameter(tplTemp.Item2) + 'In general this should not be overrided. Only for controls which use parameters in very different way e.g. ucrSave + Protected Overridable Sub UpdateAllParameters() + For i As Integer = 0 To lstAllRParameters.Count - 1 + UpdateParameter(lstAllRParameters(i)) Next End Sub @@ -489,4 +473,28 @@ Public Class ucrCore clsTempParam.SetArgumentValue(GetValueToSet().ToString()) End If End Sub + + Public Sub SetParameterIncludeArgumentName(bInclude As Boolean) + If clsParameter IsNot Nothing Then + clsParameter.bIncludeArgumentName = bInclude + End If + End Sub + + Private Property clsParameter As RParameter + Get + Return lstAllRParameters(0) + End Get + Set(bNewRParameter As RParameter) + lstAllRParameters(0) = bNewRParameter + End Set + End Property + + Private Property clsRCode As RCodeStructure + Get + Return lstAllRCodes(0) + End Get + Set(bNewRCode As RCodeStructure) + lstAllRCodes(0) = bNewRCode + End Set + End Property End Class \ No newline at end of file diff --git a/instat/ucrDataFrame.vb b/instat/ucrDataFrame.vb index d9ff29f6d28..a344b1e65c9 100644 --- a/instat/ucrDataFrame.vb +++ b/instat/ucrDataFrame.vb @@ -84,7 +84,6 @@ Public Class ucrDataFrame cboAvailableDataFrames.Text = "" End If If strCurrDataFrame <> cboAvailableDataFrames.Text Then - UpdateParameter() RaiseEvent DataFrameChanged(sender, e, strCurrDataFrame) strCurrDataFrame = cboAvailableDataFrames.Text SetDataFrameProperties() @@ -92,16 +91,15 @@ Public Class ucrDataFrame End If End Sub - Public Sub UpdateParameter() - If clsParameter IsNot Nothing Then + Protected Overrides Sub UpdateParameter(clsTempParam As RParameter) + If clsTempParam IsNot Nothing Then If bParameterIsString Then - clsParameter.SetArgumentValue(Chr(34) & cboAvailableDataFrames.Text & Chr(34)) + clsTempParam.SetArgumentValue(Chr(34) & cboAvailableDataFrames.Text & Chr(34)) ElseIf bParameterIsRFunction Then - clsParameter.SetArgument(clsCurrDataFrame) + clsTempParam.SetArgument(clsCurrDataFrame) End If - UpdateRCode() End If - End Sub + End Sub Private Sub SelectedDataFrameChanged(sender As Object, e As EventArgs) End Sub @@ -174,16 +172,19 @@ Public Class ucrDataFrame Public Overrides Sub UpdateControl(Optional bReset As Boolean = False) Dim clsTempDataParameter As RParameter Dim strDataFrameName As String = "" + Dim clsMainParameter As RParameter MyBase.UpdateControl() - If clsParameter IsNot Nothing Then + + clsMainParameter = GetParameter() + If clsMainParameter IsNot Nothing Then If bChangeParameterValue Then - If bParameterIsString AndAlso clsParameter.bIsString Then - strDataFrameName = clsParameter.strArgumentValue - ElseIf bParameterIsRFunction AndAlso clsParameter.bIsFunction Then - clsTempDataParameter = clsParameter.clsArgumentCodeStructure.GetParameter(strDataParameterNameInRFunction) + If bParameterIsString AndAlso clsMainParameter.bIsString Then + strDataFrameName = clsMainParameter.strArgumentValue + ElseIf bParameterIsRFunction AndAlso clsMainParameter.bIsFunction Then + clsTempDataParameter = clsMainParameter.clsArgumentCodeStructure.GetParameter(strDataParameterNameInRFunction) If clsTempDataParameter IsNot Nothing Then - strDataFrameName = clsParameter.clsArgumentCodeStructure.GetParameter(strDataParameterNameInRFunction).strArgumentValue + strDataFrameName = clsMainParameter.clsArgumentCodeStructure.GetParameter(strDataParameterNameInRFunction).strArgumentValue End If End If End If @@ -198,16 +199,16 @@ Public Class ucrDataFrame Public Sub SetParameterIsString() bParameterIsString = True bParameterIsRFunction = False - UpdateParameter() + UpdateAllParameters() End Sub Public Sub SetParameterIsRFunction() bParameterIsRFunction = True bParameterIsString = False - UpdateParameter() + UpdateAllParameters() End Sub Public Overrides Function IsRDefault() As Boolean - Return clsParameter IsNot Nothing AndAlso objRDefault IsNot Nothing AndAlso objRDefault.Equals(cboAvailableDataFrames.Text) + Return GetParameter() IsNot Nothing AndAlso objRDefault IsNot Nothing AndAlso objRDefault.Equals(cboAvailableDataFrames.Text) End Function End Class \ No newline at end of file diff --git a/instat/ucrInput.vb b/instat/ucrInput.vb index 9a6a7c937b4..f7c758e1503 100644 --- a/instat/ucrInput.vb +++ b/instat/ucrInput.vb @@ -58,20 +58,22 @@ Public Class ucrInput Public Sub OnNameChanged() Me.Text = Me.GetText() - If bChangeParameterValue AndAlso clsParameter IsNot Nothing Then + RaiseEvent NameChanged() + OnControlValueChanged() + End Sub + + Protected Overrides Sub UpdateParameter(clsTempParam As RParameter) + If bChangeParameterValue AndAlso clsTempParam IsNot Nothing Then If dctDisplayParameterValues.ContainsKey(GetText()) Then - clsParameter.SetArgumentValue(dctDisplayParameterValues(GetText())) + clsTempParam.SetArgumentValue(dctDisplayParameterValues(GetText())) Else If AddQuotesIfUnrecognised Then - clsParameter.SetArgumentValue(Chr(34) & GetText() & Chr(34)) + clsTempParam.SetArgumentValue(Chr(34) & GetText() & Chr(34)) Else - clsParameter.SetArgumentValue(GetText()) + clsTempParam.SetArgumentValue(GetText()) End If End If End If - UpdateRCode() - RaiseEvent NameChanged() - OnControlValueChanged() End Sub Public Sub OnContentsChanged() @@ -408,19 +410,22 @@ Public Class ucrInput End Sub Public Overrides Function GetValueToSet() As Object - If clsParameter IsNot Nothing Then - If clsParameter.bIsString Then - If dctDisplayParameterValues.ContainsKey(clsParameter.strArgumentValue) Then - Return clsParameter.strArgumentValue + Dim clsMainParameter As RParameter + + clsMainParameter = GetParameter() + If clsMainParameter IsNot Nothing Then + If clsMainParameter.bIsString Then + If dctDisplayParameterValues.ContainsKey(clsMainParameter.strArgumentValue) Then + Return clsMainParameter.strArgumentValue Else If AddQuotesIfUnrecognised Then - Return clsParameter.strArgumentValue.Trim(Chr(34)) + Return clsMainParameter.strArgumentValue.Trim(Chr(34)) Else - Return clsParameter.strArgumentValue + Return clsMainParameter.strArgumentValue End If End If - ElseIf clsParameter.bIsFunction OrElse clsParameter.bIsOperator Then - Return clsParameter.clsArgumentCodeStructure + ElseIf clsMainParameter.bIsFunction OrElse clsMainParameter.bIsOperator Then + Return clsMainParameter.clsArgumentCodeStructure Else Return "" End If diff --git a/instat/ucrInputComboBox.vb b/instat/ucrInputComboBox.vb index 161fa5795de..930560beaab 100644 --- a/instat/ucrInputComboBox.vb +++ b/instat/ucrInputComboBox.vb @@ -134,13 +134,13 @@ Public Class ucrInputComboBox If bClearExisting Then cboInput.Items.Clear() End If - If clsParameter Is Nothing Then + If GetParameter() Is Nothing Then MsgBox("Developer error: Parameter must be set before items can be set. Modify setup for " & Name & " so that the parameter is set first.") End If For Each kvpTemp In dctItemParameterValuePairs cboInput.Items.Add(kvpTemp.Key) dctDisplayParameterValues.Add(kvpTemp.Key, kvpTemp.Value) - AddParameterValuesCondition(kvpTemp.Key, clsParameter.strArgumentName, kvpTemp.Value) + AddParameterValuesCondition(kvpTemp.Key, GetParameter().strArgumentName, kvpTemp.Value) Next AdjustComboBoxWidth(cboInput) End Sub diff --git a/instat/ucrNud.vb b/instat/ucrNud.vb index fb2b674ed0e..3b4ad553b5a 100644 --- a/instat/ucrNud.vb +++ b/instat/ucrNud.vb @@ -14,6 +14,8 @@ ' You should have received a copy of the GNU General Public License k ' along with this program. If not, see . +Imports instat + Public Class ucrNud Public Sub New() @@ -30,14 +32,17 @@ Public Class ucrNud End Sub Private Sub nudUpDown_TextChanged(sender As Object, e As EventArgs) Handles nudUpDown.TextChanged - If bChangeParameterValue AndAlso clsParameter IsNot Nothing Then + OnControlValueChanged() + End Sub + + Protected Overrides Sub UpdateParameter(clsTempParam As RParameter) + If bChangeParameterValue AndAlso clsTempParam IsNot Nothing Then If nudUpDown.Text <> "" Then - clsParameter.SetArgumentValue(nudUpDown.Value) + clsTempParam.SetArgumentValue(nudUpDown.Value) Else - clsParameter.SetArgumentValue("") + clsTempParam.SetArgumentValue("") End If End If - OnControlValueChanged() End Sub Public Property Minimum As Decimal diff --git a/instat/ucrRadio.vb b/instat/ucrRadio.vb index 83953bed26a..3a455075c0f 100644 --- a/instat/ucrRadio.vb +++ b/instat/ucrRadio.vb @@ -19,43 +19,44 @@ Imports instat Public Class ucrRadio Public strValueIfChecked As String = "TRUE" - Public Overrides Sub UpdateControl(Optional bReset As Boolean = False) - MyBase.UpdateControl(bReset) - If clsParameter IsNot Nothing Then - If bChangeParameterValue Then - rdoRadio.Checked = (clsParameter.strArgumentValue = strValueIfChecked) - ElseIf bAddRemoveParameter Then - 'Commented out as not currently needed. Can be included if needed. - 'If bParameterIncludedWhenChecked Then - rdoRadio.Checked = clsRCode.ContainsParameter(clsParameter) - 'Else - 'chkCheck.Checked = Not clsRCodeObject.clsParameters.Contains(clsParameter) - 'End If - End If - Else - If lstValuesAndControl.Count > 0 Then - rdoRadio.Checked = LinkedControlsParametersPresent() - End If - End If - UpdateLinkedControls() - End Sub + 'This control is no longer needed and can be deleted. + 'Public Overrides Sub UpdateControl(Optional bReset As Boolean = False) + ' MyBase.UpdateControl(bReset) + ' If clsParameter IsNot Nothing Then + ' If bChangeParameterValue Then + ' rdoRadio.Checked = (clsParameter.strArgumentValue = strValueIfChecked) + ' ElseIf bAddRemoveParameter Then + ' 'Commented out as not currently needed. Can be included if needed. + ' 'If bParameterIncludedWhenChecked Then + ' rdoRadio.Checked = clsRCode.ContainsParameter(clsParameter) + ' 'Else + ' 'chkCheck.Checked = Not clsRCodeObject.clsParameters.Contains(clsParameter) + ' 'End If + ' End If + ' Else + ' If lstValuesAndControl.Count > 0 Then + ' rdoRadio.Checked = LinkedControlsParametersPresent() + ' End If + ' End If + ' UpdateLinkedControls() + 'End Sub - Private Sub rdoRadio_CheckedChanged(sender As Object, e As EventArgs) Handles rdoRadio.CheckedChanged - If bChangeParameterValue AndAlso clsParameter IsNot Nothing Then - If rdoRadio.Checked Then - clsParameter.strArgumentValue = strValueIfChecked - End If - End If - UpdateRCode() - OnControlValueChanged() - End Sub + 'Private Sub rdoRadio_CheckedChanged(sender As Object, e As EventArgs) Handles rdoRadio.CheckedChanged + ' If bChangeParameterValue AndAlso clsParameter IsNot Nothing Then + ' If rdoRadio.Checked Then + ' clsParameter.strArgumentValue = strValueIfChecked + ' End If + ' End If + ' UpdateRCode() + ' OnControlValueChanged() + 'End Sub - Public Property Checked As Boolean - Get - Return rdoRadio.Checked - End Get - Set(bChecked As Boolean) - rdoRadio.Checked = bChecked - End Set - End Property + 'Public Property Checked As Boolean + ' Get + ' Return rdoRadio.Checked + ' End Get + ' Set(bChecked As Boolean) + ' rdoRadio.Checked = bChecked + ' End Set + 'End Property End Class diff --git a/instat/ucrReorder.vb b/instat/ucrReorder.vb index d3c69c61912..2263156f9eb 100644 --- a/instat/ucrReorder.vb +++ b/instat/ucrReorder.vb @@ -1,19 +1,20 @@ -' Instat-R -' Copyright (C) 2015 -' -' This program is free software: you can redistribute it and/or modify -' it under the terms of the GNU General Public License as published by -' the Free Software Foundation, either version 3 of the License, or -' (at your option) any later version. -' -' This program is distributed in the hope that it will be useful, -' but WITHOUT ANY WARRANTY; without even the implied warranty of -' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -' GNU General Public License for more details. -' -' You should have received a copy of the GNU General Public License k -' along with this program. If not, see . - +' Instat-R +' Copyright (C) 2015 +' +' This program is free software: you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation, either version 3 of the License, or +' (at your option) any later version. +' +' This program is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. +' +' You should have received a copy of the GNU General Public License k +' along with this program. If not, see . + +Imports instat Imports RDotNet Public Class ucrReorder Public Event OrderChanged() @@ -240,9 +241,11 @@ Public Class ucrReorder Protected Overrides Sub SetControlValue() Dim lstCurrentVariables As String() + Dim clsMainParameter As RParameter - If clsParameter IsNot Nothing AndAlso clsParameter.bIsString AndAlso clsParameter.strArgumentValue IsNot Nothing Then - lstCurrentVariables = ExtractItemsFromRList(clsParameter.strArgumentValue) + clsMainParameter = GetParameter() + If clsMainParameter IsNot Nothing AndAlso clsMainParameter.bIsString AndAlso clsMainParameter.strArgumentValue IsNot Nothing Then + lstCurrentVariables = ExtractItemsFromRList(clsMainParameter.strArgumentValue) SetToValue(lstCurrentVariables) End If End Sub @@ -263,10 +266,14 @@ Public Class ucrReorder End Sub Private Sub ucrReorder_OrderChanged() Handles Me.OrderChanged - If clsParameter Is Nothing Then - clsParameter = New RParameter - End If - clsParameter.SetArgumentValue(GetVariableNames(bWithQuotes)) + OnControlValueChanged() End Sub + + Protected Overrides Sub UpdateParameter(clsTempParam As RParameter) + If clsTempParam Is Nothing Then + clsTempParam = New RParameter + End If + clsTempParam.SetArgumentValue(GetVariableNames(bWithQuotes)) + End Sub End Class diff --git a/instat/ucrSave.vb b/instat/ucrSave.vb index 707b8b0d7ee..614e110bf3a 100644 --- a/instat/ucrSave.vb +++ b/instat/ucrSave.vb @@ -223,13 +223,23 @@ Public Class ucrSave UpdateLinkedControls(bReset) End Sub + Protected Overrides Sub UpdateAllParameters() + UpdateAssignTo() + End Sub + + Public Overrides Sub UpdateLinkedControls(Optional bReset As Boolean = False) + MyBase.UpdateLinkedControls(bReset) + End Sub + Private Sub UpdateAssignTo(Optional bRemove As Boolean = False) Dim strSaveName As String Dim strDataName As String = "" + Dim clsMainRCode As RCodeStructure - If clsRCode IsNot Nothing Then + clsMainRCode = GetRCode() + If clsMainRCode IsNot Nothing Then If bRemove Then - clsRCode.RemoveAssignTo() + clsMainRCode.RemoveAssignTo() Else If ucrDataFrameSelector IsNot Nothing Then strDataName = ucrDataFrameSelector.cboAvailableDataFrames.Text @@ -242,16 +252,16 @@ Public Class ucrSave If strSaveName <> "" Then Select Case strSaveType Case "column" - clsRCode.SetAssignTo(strTemp:=strSaveName, strTempDataframe:=strDataName, strTempColumn:=strSaveName, bAssignToIsPrefix:=bAssignToIsPrefix, bAssignToColumnWithoutNames:=bAssignToColumnWithoutNames, bInsertColumnBefore:=bInsertColumnBefore) + clsMainRCode.SetAssignTo(strTemp:=strSaveName, strTempDataframe:=strDataName, strTempColumn:=strSaveName, bAssignToIsPrefix:=bAssignToIsPrefix, bAssignToColumnWithoutNames:=bAssignToColumnWithoutNames, bInsertColumnBefore:=bInsertColumnBefore) Case "dataframe" - clsRCode.SetAssignTo(strTemp:=strSaveName, strTempDataframe:=strSaveName, bAssignToIsPrefix:=bAssignToIsPrefix) + clsMainRCode.SetAssignTo(strTemp:=strSaveName, strTempDataframe:=strSaveName, bAssignToIsPrefix:=bAssignToIsPrefix) Case "graph" - clsRCode.SetAssignTo(strTemp:=strSaveName, strTempDataframe:=strDataName, strTempGraph:=strSaveName, bAssignToIsPrefix:=bAssignToIsPrefix) + clsMainRCode.SetAssignTo(strTemp:=strSaveName, strTempDataframe:=strDataName, strTempGraph:=strSaveName, bAssignToIsPrefix:=bAssignToIsPrefix) Case "model" - clsRCode.SetAssignTo(strTemp:=strSaveName, strTempDataframe:=strDataName, strTempModel:=strSaveName, bAssignToIsPrefix:=bAssignToIsPrefix) + clsMainRCode.SetAssignTo(strTemp:=strSaveName, strTempDataframe:=strDataName, strTempModel:=strSaveName, bAssignToIsPrefix:=bAssignToIsPrefix) End Select Else - clsRCode.RemoveAssignTo() + clsMainRCode.RemoveAssignTo() End If End If End If @@ -262,13 +272,16 @@ Public Class ucrSave End Sub Public Overrides Sub UpdateControl(Optional bReset As Boolean = False) - If clsRCode IsNot Nothing Then - If clsRCode.bToBeAssigned OrElse clsRCode.bIsAssigned Then + Dim clsMainRCode As RCodeStructure + + clsMainRCode = GetRCode() + If clsMainRCode IsNot Nothing Then + If clsMainRCode.bToBeAssigned OrElse clsMainRCode.bIsAssigned Then If bIsComboBox Then - ucrInputComboSave.SetName(clsRCode.strAssignTo) + ucrInputComboSave.SetName(clsMainRCode.strAssignTo) ucrInputTextSave.SetName("") Else - ucrInputTextSave.SetName(clsRCode.strAssignTo) + ucrInputTextSave.SetName(clsMainRCode.strAssignTo) ucrInputComboSave.SetName("") End If Else @@ -279,7 +292,7 @@ Public Class ucrSave If GetText() = strAssignToIfUnchecked Then ucrChkSave.Checked = False Else - ucrChkSave.Checked = (clsRCode.bToBeAssigned OrElse clsRCode.bIsAssigned) + ucrChkSave.Checked = (clsMainRCode.bToBeAssigned OrElse clsMainRCode.bIsAssigned) End If End If UpdateLinkedControls() @@ -321,7 +334,7 @@ Public Class ucrSave End Sub Protected Overrides Function CanUpdate() As Object - Return ((Not clsRCode.bIsAssigned AndAlso Not clsRCode.bToBeAssigned) AndAlso strSaveType <> "") + Return ((Not GetRCode().bIsAssigned AndAlso Not GetRCode().bToBeAssigned) AndAlso strSaveType <> "") End Function Public Overrides Sub AddOrRemoveParameter(bAdd As Boolean) diff --git a/instat/ucrSelectorByDataFrame.vb b/instat/ucrSelectorByDataFrame.vb index a352db2d01c..35e191d6c90 100644 --- a/instat/ucrSelectorByDataFrame.vb +++ b/instat/ucrSelectorByDataFrame.vb @@ -92,11 +92,11 @@ Public Class ucrSelectorByDataFrame ucrAvailableDataFrames.UpdateControl(bReset) End Sub - Public Overrides Sub SetParameter(clsNewParameter As RParameter) + Public Overrides Sub SetParameter(clsNewParameter As RParameter, Optional iIndex As Integer = 0) If bHasOwnParameter Then - MyBase.SetParameter(clsNewParameter) + MyBase.SetParameter(clsNewParameter, iIndex) Else - ucrAvailableDataFrames.SetParameter(clsNewParameter) + ucrAvailableDataFrames.SetParameter(clsNewParameter, iIndex) End If End Sub @@ -136,4 +136,10 @@ Public Class ucrSelectorByDataFrame MyBase.SetRCode(clsNewCodeStructure, bReset) ucrAvailableDataFrames.SetRCode(clsNewCodeStructure, bReset) End Sub + + Protected Overrides Sub UpdateParameter(clsTempParam As RParameter) + If bHasOwnParameter Then + MyBase.UpdateParameter(clsTempParam) + End If + End Sub End Class \ No newline at end of file From 43680a4518be8f76121a190654e87df5e811589f Mon Sep 17 00:00:00 2001 From: Danny Parsons Date: Fri, 7 Apr 2017 14:50:20 +0100 Subject: [PATCH 50/66] updated one way frequencies dialog --- instat/dlgOneWayFrequencies.vb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/instat/dlgOneWayFrequencies.vb b/instat/dlgOneWayFrequencies.vb index 30d6ea6d018..48a91ccbe39 100644 --- a/instat/dlgOneWayFrequencies.vb +++ b/instat/dlgOneWayFrequencies.vb @@ -41,7 +41,7 @@ Public Class dlgOneWayFrequencies Public Sub SetRCodeForControls(bReset As Boolean) ucrReceiverOneWayFreq.SetRCode(clsSjtFreq, bReset) ucrReceiverWeights.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - ucrPnlFrequencies.SetRCode(ucrBase.clsRsyntax.clsBaseFunction) + ucrPnlFrequencies.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrChkWeights.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrPnlSort.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrChkFlip.SetRCode(clsSjpFrq, bReset) @@ -64,6 +64,7 @@ Public Class dlgOneWayFrequencies ucrReceiverWeights.SetParameterIsRFunction() ucrReceiverWeights.SetDataType("numeric") ucrReceiverWeights.bUpdateRCodeFromControl = False + ucrReceiverWeights.bAddRemoveParameter = False ucrPnlSort.SetParameter(New RParameter("sort.frq", 2)) ucrPnlSort.AddRadioButton(rdoNone, Chr(34) & "none" & Chr(34)) @@ -119,9 +120,10 @@ Public Class dlgOneWayFrequencies clsSjpFrq.SetAssignTo("last_graph", strTempDataframe:=ucrSelectorOneWayFreq.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") ucrReceiverOneWayFreq.AddAdditionalCodeParameterPair(clsSjpFrq, New RParameter("var.cnt", 1)) + ucrChkWeights.AddAdditionalCodeParameterPair(clsSjpFrq, New RParameter("weight.by", 3)) ucrReceiverWeights.AddAdditionalCodeParameterPair(clsSjpFrq, New RParameter("weight.by", 3)) - ucrPnlSort.AddAdditionalCodeParameterPair(clsSjpFrq, New RParameter("sort.frq", 2)) - ucrNudGroups.AddAdditionalCodeParameterPair(clsSjpFrq, New RParameter("auto.group")) + ucrPnlSort.AddAdditionalCodeParameterPair(clsSjpFrq, New RParameter("sort.frq", 5)) + ucrNudGroups.AddAdditionalCodeParameterPair(clsSjpFrq, New RParameter("auto.group", 35)) ucrBase.clsRsyntax.SetBaseRFunction(clsSjtFreq) bResetSubdialog = True @@ -167,7 +169,7 @@ Public Class dlgOneWayFrequencies 'ucrReceiverOneWayFreq.ChangeParameterName("var.cnt") ucrBase.clsRsyntax.SetBaseRFunction(clsSjpFrq) End If - SetRCodeForControls(bReset) + 'SetRCodeForControls(bReset) End Sub Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset From 6fa9715d5db4a1b7f01cd5aba221c9f7bcbbe39d Mon Sep 17 00:00:00 2001 From: Danny Parsons Date: Fri, 7 Apr 2017 15:17:36 +0100 Subject: [PATCH 51/66] tidied defaults in one way freqs --- instat/dlgOneWayFrequencies.vb | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/instat/dlgOneWayFrequencies.vb b/instat/dlgOneWayFrequencies.vb index 48a91ccbe39..e014a167d0c 100644 --- a/instat/dlgOneWayFrequencies.vb +++ b/instat/dlgOneWayFrequencies.vb @@ -53,20 +53,16 @@ Public Class dlgOneWayFrequencies 'HelpID ' ucrBase.iHelpTopicID = - cmdOptions.Enabled = True - ucrReceiverOneWayFreq.Selector = ucrSelectorOneWayFreq - ucrReceiverOneWayFreq.SetMeAsReceiver() ucrReceiverOneWayFreq.SetParameter(New RParameter("data", 1)) ucrReceiverOneWayFreq.SetParameterIsRFunction() + ucrReceiverOneWayFreq.Selector = ucrSelectorOneWayFreq ucrReceiverWeights.Selector = ucrSelectorOneWayFreq - ucrReceiverWeights.SetParameter(New RParameter("weight.by", 3)) + ucrReceiverWeights.SetParameter(New RParameter("weight.by", 2)) ucrReceiverWeights.SetParameterIsRFunction() ucrReceiverWeights.SetDataType("numeric") - ucrReceiverWeights.bUpdateRCodeFromControl = False - ucrReceiverWeights.bAddRemoveParameter = False - ucrPnlSort.SetParameter(New RParameter("sort.frq", 2)) + ucrPnlSort.SetParameter(New RParameter("sort.frq", 6)) ucrPnlSort.AddRadioButton(rdoNone, Chr(34) & "none" & Chr(34)) ucrPnlSort.AddRadioButton(rdoAscending, Chr(34) & "asc" & Chr(34)) ucrPnlSort.AddRadioButton(rdoDescending, Chr(34) & "desc" & Chr(34)) @@ -78,22 +74,22 @@ Public Class dlgOneWayFrequencies ucrPnlFrequencies.AddRadioButton(rdoTable) ucrPnlFrequencies.AddRadioButton(rdoGraph) - ucrPnlFrequencies.AddFunctionNamesCondition(rdoTable, "sjt.frq") ucrPnlFrequencies.AddFunctionNamesCondition(rdoGraph, "sjp.frq") ucrPnlFrequencies.AddToLinkedControls(ucrChkFlip, {rdoGraph}, bNewLinkedDisabledIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True) - ucrChkGroupData.SetText("Group Data") + ucrNudGroups.SetParameter(New RParameter("auto.group")) ucrNudGroups.SetMinMax(2, 100) ucrNudGroups.Increment = 5 - ucrNudGroups.SetParameter(New RParameter("auto.group")) ucrChkGroupData.SetParameter(ucrNudGroups.GetParameter(), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) + ucrChkGroupData.SetText("Group Data") ucrChkGroupData.AddToLinkedControls(ucrNudGroups, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=10) ucrChkGroupData.AddFunctionNamesCondition(True, {"sjt.frq", "sjp.frq"}) ucrChkGroupData.bUpdateRCodeFromControl = True - ucrChkFlip.SetText("Flip Coordinates") + ucrChkFlip.SetParameter(New RParameter("coord.flip", 1)) + ucrChkFlip.SetText("Flip Coordinates") ucrChkFlip.SetValuesCheckedAndUnchecked("TRUE", "FALSE") ucrChkFlip.SetRDefault("FALSE") End Sub @@ -101,18 +97,15 @@ Public Class dlgOneWayFrequencies Private Sub SetDefaults() clsSjtFreq = New RFunction clsSjpFrq = New RFunction + ucrSelectorOneWayFreq.Reset() - sdgOneWayFrequencies.ucrSaveGraph.Reset() - sdgOneWayFrequencies.ucrInputGraphTitle.SetName("") - sdgOneWayFrequencies.ucrInputHorizontalLabels.Reset() - sdgOneWayFrequencies.ucrInputVerticalLabels.Reset() + ucrReceiverOneWayFreq.SetMeAsReceiver() + clsSjtFreq.SetRCommand("sjt.frq") - clsSjtFreq.AddParameter("sort.frq", Chr(34) & "none" & Chr(34)) - 'parameter added to have the default to False (R default is TRUE) clsSjtFreq.AddParameter("show.summary", "FALSE") clsSjtFreq.AddParameter("skip.zero", "FALSE") - 'defining the digit default value clsSjtFreq.AddParameter("digits", 0) + clsSjpFrq.SetRCommand("sjp.frq") clsSjpFrq.AddParameter("sort.frq", Chr(34) & "none" & Chr(34)) clsSjpFrq.AddParameter("type", Chr(34) & "bar" & Chr(34)) @@ -121,7 +114,7 @@ Public Class dlgOneWayFrequencies ucrReceiverOneWayFreq.AddAdditionalCodeParameterPair(clsSjpFrq, New RParameter("var.cnt", 1)) ucrChkWeights.AddAdditionalCodeParameterPair(clsSjpFrq, New RParameter("weight.by", 3)) - ucrReceiverWeights.AddAdditionalCodeParameterPair(clsSjpFrq, New RParameter("weight.by", 3)) + ucrReceiverWeights.AddAdditionalCodeParameterPair(clsSjpFrq, ucrChkWeights.GetParameter()) ucrPnlSort.AddAdditionalCodeParameterPair(clsSjpFrq, New RParameter("sort.frq", 5)) ucrNudGroups.AddAdditionalCodeParameterPair(clsSjpFrq, New RParameter("auto.group", 35)) From 7791458ab8ea214f86d1194b144aec279d151585 Mon Sep 17 00:00:00 2001 From: Danny Parsons Date: Fri, 7 Apr 2017 15:45:47 +0100 Subject: [PATCH 52/66] added functionality for multiple functions from one way dialog and added comments and parameter positions to one way sub dialog --- instat/dlgOneWayFrequencies.vb | 29 +++++++++++++---------------- instat/sdgOneWayFrequencies.vb | 32 +++++++++++++++++++++++++------- 2 files changed, 38 insertions(+), 23 deletions(-) diff --git a/instat/dlgOneWayFrequencies.vb b/instat/dlgOneWayFrequencies.vb index e014a167d0c..57c7dffdfcb 100644 --- a/instat/dlgOneWayFrequencies.vb +++ b/instat/dlgOneWayFrequencies.vb @@ -132,7 +132,8 @@ Public Class dlgOneWayFrequencies Else ucrBase.OKEnabled(False) End If - ElseIf ucrChkGroupData.Checked + ElseIf ucrChkGroupData.Checked Then + If ucrNudGroups.GetText <> "" Then ucrBase.OKEnabled(True) Else @@ -144,25 +145,26 @@ Public Class dlgOneWayFrequencies End If End Sub - Public Sub ICallType() + Private Sub ucrBase_BeforeClickOk(sender As Object, e As EventArgs) Handles ucrBase.BeforeClickOk If rdoTable.Checked Then + ucrBase.clsRsyntax.SetBaseRFunction(clsSjtFreq) 'ucrBase.clsRsyntax.bHTMLOutput = True ucrBase.clsRsyntax.iCallType = 0 - Else + ElseIf rdoGraph.Checked Then + ucrBase.clsRsyntax.SetBaseRFunction(clsSjpFrq) ' ucrBase.clsRsyntax.bHTMLOutput = False ucrBase.clsRsyntax.iCallType = 3 End If End Sub - Private Sub ChangeBaseFunction() - If rdoTable.Checked Then - 'ucrReceiverOneWayFreq.ChangeParameterName("data") - ucrBase.clsRsyntax.SetBaseRFunction(clsSjtFreq) - Else - 'ucrReceiverOneWayFreq.ChangeParameterName("var.cnt") - ucrBase.clsRsyntax.SetBaseRFunction(clsSjpFrq) + Private Sub ucrBase_ClickOk(sender As Object, e As EventArgs) Handles ucrBase.ClickOk + Dim strGraph As String + Dim strTempScript As String = "" + + If rdoTable.Checked AndAlso rdoGraph.Checked Then + strGraph = clsSjpFrq.ToScript(strTempScript) + frmMain.clsRLink.RunScript(strTempScript & strGraph, iCallType:=3) End If - 'SetRCodeForControls(bReset) End Sub Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset @@ -189,9 +191,4 @@ Public Class dlgOneWayFrequencies sdgOneWayFrequencies.ShowDialog() TestOkEnabled() End Sub - - Private Sub ucrPnlFrequencies_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlFrequencies.ControlValueChanged - ChangeBaseFunction() - ICallType() - End Sub End Class \ No newline at end of file diff --git a/instat/sdgOneWayFrequencies.vb b/instat/sdgOneWayFrequencies.vb index c06846677b8..b89cdd976d8 100644 --- a/instat/sdgOneWayFrequencies.vb +++ b/instat/sdgOneWayFrequencies.vb @@ -16,8 +16,10 @@ Imports instat.Translations Public Class sdgOneWayFrequencies + Public bControlsInitialised As Boolean = False Public clsOneWayTableFreq, clsOneWayGraphFreq As New RFunction + Private Sub sdgOneWayFrequencies_Load(sender As Object, e As EventArgs) Handles MyBase.Load autoTranslate(Me) End Sub @@ -26,7 +28,7 @@ Public Class sdgOneWayFrequencies Dim dctVerticalPositionLabel As New Dictionary(Of String, String) Dim dctHorizontalPositionLabel As New Dictionary(Of String, String) - ucrInputHorizontalLabels.SetParameter(New RParameter("hjust")) + ucrInputHorizontalLabels.SetParameter(New RParameter("hjust", 38)) dctHorizontalPositionLabel.Add("Left", Chr(34) & "left" & Chr(34)) dctHorizontalPositionLabel.Add("Center", Chr(34) & "center" & Chr(34)) dctHorizontalPositionLabel.Add("Right", Chr(34) & "right" & Chr(34)) @@ -37,7 +39,7 @@ Public Class sdgOneWayFrequencies ucrInputHorizontalLabels.SetItems(dctHorizontalPositionLabel) ucrInputHorizontalLabels.SetRDefault(Chr(34) & "center" & Chr(34)) - ucrInputVerticalLabels.SetParameter(New RParameter("vjust")) + ucrInputVerticalLabels.SetParameter(New RParameter("vjust", 37)) dctVerticalPositionLabel.Add("Left", Chr(34) & "left" & Chr(34)) dctVerticalPositionLabel.Add("Center", Chr(34) & "center" & Chr(34)) dctVerticalPositionLabel.Add("Right", Chr(34) & "right" & Chr(34)) @@ -48,47 +50,61 @@ Public Class sdgOneWayFrequencies ucrInputVerticalLabels.SetItems(dctVerticalPositionLabel) ucrInputVerticalLabels.SetRDefault(Chr(34) & "bottom" & Chr(34)) - ucrChkMedian.SetText("Emphasise Median") + 'TODO Parameter position needed ucrChkMedian.SetParameter(New RParameter("emph.md"), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") ucrChkMedian.SetRDefault("FALSE") + ucrChkMedian.SetText("Emphasise Median") ucrChkShowSummary.SetText("Show Summary") + 'TODO Parameter position needed ucrChkShowSummary.SetParameter(New RParameter("show.summary"), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") 'Default is auto ucrChkOmitZero.SetText("Omit Zero Counts from Table") + 'TODO Parameter position needed + 'skip.zero has three options: "auto", TRUE, FALSE so this could be a combobox instead ucrChkOmitZero.SetParameter(New RParameter("skip.zero"), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") + 'TODO Parameter position needed ucrNudDecimalPlaces.SetParameter(New RParameter("digits")) ucrNudDecimalPlaces.SetMinMax(0, 4) - ucrChkHighlightedRows.SetText("Alternate Rows Coloured") + 'TODO Parameter position needed ucrChkHighlightedRows.SetParameter(New RParameter("altr.row.col"), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") ucrChkHighlightedRows.SetRDefault("FALSE") + ucrChkHighlightedRows.SetText("Alternate Rows Coloured") - ucrChkShowCount.SetText("Show Count") + 'TODO Parameter position needed ucrChkShowCount.SetParameter(New RParameter("show.n"), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") ucrChkShowCount.SetRDefault("FALSE") + ucrChkShowCount.SetText("Show Count") - ucrChkShowPercentage.SetText("Show Percentage") + 'TODO Parameter position needed ucrChkShowPercentage.SetParameter(New RParameter("show.prc"), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") + ucrChkShowPercentage.SetText("Show Percentage") + 'TODO Parameter position needed ucrInputGraphTitle.SetParameter(New RParameter("title")) ucrChkShowMissing.SetText("Show Missing") + 'TODO Parameter position needed ucrChkShowMissing.SetParameter(New RParameter("show.na"), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") ucrChkShowMissing.SetRDefault("FALSE") + 'TODO Parameter position needed ucrPnlGraphType.SetParameter(New RParameter("type")) ucrPnlGraphType.AddRadioButton(rdoBar, Chr(34) & "bar" & Chr(34)) ucrPnlGraphType.AddRadioButton(rdoLine, Chr(34) & "line" & Chr(34)) ucrPnlGraphType.AddRadioButton(rdoDot, Chr(34) & "dot" & Chr(34)) ucrPnlGraphType.SetRDefault(Chr(34) & "bar" & Chr(34)) + 'TODO Parameter position needed ucrInputCountsName.SetParameter(New RParameter("string.cnt")) ucrInputCountsName.SetRDefault(Chr(34) & "N" & Chr(34)) - ucrChkCountName.SetText("Count Name") + + 'TODO Parameter position needed ucrChkCountName.SetParameter(ucrInputCountsName.GetParameter(), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) + ucrChkCountName.SetText("Count Name") ucrChkCountName.AddToLinkedControls(ucrInputCountsName, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrSaveGraph.SetPrefix("one_way_freq") @@ -97,6 +113,7 @@ Public Class sdgOneWayFrequencies ucrSaveGraph.SetCheckBoxText("Save Graph") ucrSaveGraph.SetIsComboBox() ucrSaveGraph.SetAssignToIfUncheckedValue("last_graph") + bControlsInitialised = True End Sub @@ -114,6 +131,7 @@ Public Class sdgOneWayFrequencies ucrChkOmitZero.SetRCode(clsOneWayTableFreq, bReset) ucrInputCountsName.SetRCode(clsOneWayTableFreq, bReset) ucrChkCountName.SetRCode(clsOneWayTableFreq, bReset) + ucrChkShowCount.SetRCode(clsOneWayGraphFreq, bReset) ucrChkShowPercentage.SetRCode(clsOneWayGraphFreq, bReset) ucrChkShowMissing.SetRCode(clsOneWayGraphFreq, bReset) From 774f57c999cb8b691a9500523e1c987478c1f794 Mon Sep 17 00:00:00 2001 From: Danny Parsons Date: Fri, 7 Apr 2017 17:16:40 +0100 Subject: [PATCH 53/66] updated how adding RCode and RParameter pairs is done --- instat/dlgOneWayFrequencies.vb | 34 +++++++++++++++++----------------- instat/ucrCheck.vb | 4 ++-- instat/ucrCore.vb | 16 +++++++++++++--- instat/ucrReceiver.vb | 10 +++++----- 4 files changed, 37 insertions(+), 27 deletions(-) diff --git a/instat/dlgOneWayFrequencies.vb b/instat/dlgOneWayFrequencies.vb index 57c7dffdfcb..a798ba2eeca 100644 --- a/instat/dlgOneWayFrequencies.vb +++ b/instat/dlgOneWayFrequencies.vb @@ -38,17 +38,6 @@ Public Class dlgOneWayFrequencies TestOkEnabled() End Sub - Public Sub SetRCodeForControls(bReset As Boolean) - ucrReceiverOneWayFreq.SetRCode(clsSjtFreq, bReset) - ucrReceiverWeights.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - ucrPnlFrequencies.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - ucrChkWeights.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - ucrPnlSort.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - ucrChkFlip.SetRCode(clsSjpFrq, bReset) - ucrChkGroupData.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - ucrNudGroups.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - End Sub - Private Sub InitialiseDialog() 'HelpID ' ucrBase.iHelpTopicID = @@ -112,16 +101,27 @@ Public Class dlgOneWayFrequencies clsSjpFrq.AddParameter("show.prc", "TRUE") clsSjpFrq.SetAssignTo("last_graph", strTempDataframe:=ucrSelectorOneWayFreq.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") - ucrReceiverOneWayFreq.AddAdditionalCodeParameterPair(clsSjpFrq, New RParameter("var.cnt", 1)) - ucrChkWeights.AddAdditionalCodeParameterPair(clsSjpFrq, New RParameter("weight.by", 3)) - ucrReceiverWeights.AddAdditionalCodeParameterPair(clsSjpFrq, ucrChkWeights.GetParameter()) - ucrPnlSort.AddAdditionalCodeParameterPair(clsSjpFrq, New RParameter("sort.frq", 5)) - ucrNudGroups.AddAdditionalCodeParameterPair(clsSjpFrq, New RParameter("auto.group", 35)) - ucrBase.clsRsyntax.SetBaseRFunction(clsSjtFreq) bResetSubdialog = True End Sub + Public Sub SetRCodeForControls(bReset As Boolean) + ucrReceiverOneWayFreq.AddAdditionalCodeParameterPair(clsSjpFrq, New RParameter("var.cnt", 1), iAdditionalPairNo:=1) + ucrChkWeights.AddAdditionalCodeParameterPair(clsSjpFrq, New RParameter("weight.by", 3), iAdditionalPairNo:=1) + ucrReceiverWeights.AddAdditionalCodeParameterPair(clsSjpFrq, ucrChkWeights.GetParameter(), iAdditionalPairNo:=1) + ucrPnlSort.AddAdditionalCodeParameterPair(clsSjpFrq, New RParameter("sort.frq", 5), iAdditionalPairNo:=1) + ucrNudGroups.AddAdditionalCodeParameterPair(clsSjpFrq, New RParameter("auto.group", 35), iAdditionalPairNo:=1) + + ucrReceiverOneWayFreq.SetRCode(clsSjtFreq, bReset) + ucrReceiverWeights.SetRCode(clsSjtFreq, bReset) + ucrPnlFrequencies.SetRCode(clsSjtFreq, bReset) + ucrChkWeights.SetRCode(clsSjtFreq, bReset) + ucrPnlSort.SetRCode(clsSjtFreq, bReset) + ucrChkFlip.SetRCode(clsSjpFrq, bReset) + ucrChkGroupData.SetRCode(clsSjtFreq, bReset) + ucrNudGroups.SetRCode(clsSjtFreq, bReset) + End Sub + Private Sub TestOkEnabled() If Not ucrReceiverOneWayFreq.IsEmpty() Then If (Not ucrChkWeights.Checked) AndAlso (Not ucrChkGroupData.Checked) Then diff --git a/instat/ucrCheck.vb b/instat/ucrCheck.vb index 57cc5301b2e..14543468d43 100644 --- a/instat/ucrCheck.vb +++ b/instat/ucrCheck.vb @@ -68,11 +68,11 @@ Public Class ucrCheck If bChangeParameterValue AndAlso clsTempParam IsNot Nothing Then If chkCheck.Checked Then If strValueIfChecked <> "" Then - clsParameter.SetArgumentValue(strValueIfChecked) + clsTempParam.SetArgumentValue(strValueIfChecked) End If Else If strValueIfUnchecked <> "" Then - clsParameter.SetArgumentValue(strValueIfUnchecked) + clsTempParam.SetArgumentValue(strValueIfUnchecked) End If End If End If diff --git a/instat/ucrCore.vb b/instat/ucrCore.vb index 58270f5eb36..855ba744043 100644 --- a/instat/ucrCore.vb +++ b/instat/ucrCore.vb @@ -465,9 +465,19 @@ Public Class ucrCore strValuesToIgnore = strValues End Sub - Public Sub AddAdditionalCodeParameterPair(clsNewRCode As RCodeStructure, clsNewRParameter As RParameter) - lstAllRCodes.Add(clsNewRCode) - lstAllRParameters.Add(clsNewRParameter) + Public Sub AddAdditionalCodeParameterPair(clsNewRCode As RCodeStructure, clsNewRParameter As RParameter, Optional iAdditionalPairNo As Integer = -1) + If iAdditionalPairNo = -1 Then + iAdditionalPairNo = lstAllRCodes.Count + End If + If iAdditionalPairNo < lstAllRCodes.Count Then + lstAllRCodes(iAdditionalPairNo) = clsNewRCode + lstAllRParameters(iAdditionalPairNo) = clsNewRParameter + ElseIf iAdditionalPairNo = lstAllRCodes.Count Then + lstAllRCodes.Add(clsNewRCode) + lstAllRParameters.Add(clsNewRParameter) + Else + MsgBox("Developer error: Cannot add additional RCode and RParameter pair because the addional pair number is out of bounds of the current pairs.") + End If End Sub 'In general this should not be overrided. Only for controls which use parameters in very different way e.g. ucrSave diff --git a/instat/ucrReceiver.vb b/instat/ucrReceiver.vb index 61b82e845ad..dca86a185db 100644 --- a/instat/ucrReceiver.vb +++ b/instat/ucrReceiver.vb @@ -329,12 +329,12 @@ Public Class ucrReceiver clsTempParameter = GetParameter() If clsTempParameter IsNot Nothing Then If bChangeParameterValue Then - If bParameterIsString AndAlso clsParameter.bIsString Then - If strValuesToIgnore Is Nothing OrElse (Not strValuesToIgnore.Contains(clsParameter.strArgumentValue)) Then - lstCurrentVariables = ExtractItemsFromRList(clsParameter.strArgumentValue) + If bParameterIsString AndAlso clsTempParameter.bIsString Then + If strValuesToIgnore Is Nothing OrElse (Not strValuesToIgnore.Contains(clsTempParameter.strArgumentValue)) Then + lstCurrentVariables = ExtractItemsFromRList(clsTempParameter.strArgumentValue) End If - ElseIf bParameterIsRFunction AndAlso clsParameter.bIsFunction Then - clsTempDataParameter = clsParameter.clsArgumentCodeStructure.GetParameter(strColumnsParameterNameInRFunction) + ElseIf bParameterIsRFunction AndAlso clsTempParameter.bIsFunction Then + clsTempDataParameter = clsTempParameter.clsArgumentCodeStructure.GetParameter(strColumnsParameterNameInRFunction) If clsTempDataParameter IsNot Nothing Then lstCurrentVariables = ExtractItemsFromRList(clsTempParameter.clsArgumentCodeStructure.GetParameter(strColumnsParameterNameInRFunction).strArgumentValue) End If From 4f376caddd748e660a940556b78cc3519ad6d36a Mon Sep 17 00:00:00 2001 From: John Lunalo Date: Mon, 10 Apr 2017 12:13:44 +0300 Subject: [PATCH 54/66] Removing empty line --- instat/dlgSaveAs.vb | 1 - 1 file changed, 1 deletion(-) diff --git a/instat/dlgSaveAs.vb b/instat/dlgSaveAs.vb index 84f4bc4cdb8..e5b8c16115f 100644 --- a/instat/dlgSaveAs.vb +++ b/instat/dlgSaveAs.vb @@ -15,7 +15,6 @@ ' along with this program. If not, see . Imports System.IO -Imports instat Imports instat.Translations Public Class dlgSaveAs Private bFirstLoad As Boolean = True From 5db975eae2a176d1714437f0ffc3906ce3810fd6 Mon Sep 17 00:00:00 2001 From: Danny Parsons Date: Mon, 10 Apr 2017 11:07:51 +0100 Subject: [PATCH 55/66] implemented package name in RFunction with example on scatter and one variable model --- instat/clsRFunction.vb | 10 +++++++++- instat/clsRSyntax.vb | 11 +++++++++++ instat/dlgOneVarFitModel.vb | 7 +++++-- instat/dlgScatterPlot.vb | 3 +++ 4 files changed, 28 insertions(+), 3 deletions(-) diff --git a/instat/clsRFunction.vb b/instat/clsRFunction.vb index 5e28313af7a..a8f5555a4d6 100644 --- a/instat/clsRFunction.vb +++ b/instat/clsRFunction.vb @@ -18,6 +18,7 @@ Public Class RFunction Inherits RCodeStructure Public strRCommand As String + Private strPackageName As String = "" Public Sub New() OnParametersChanged() @@ -28,6 +29,10 @@ Public Class RFunction bIsAssigned = False End Sub + Public Sub SetPackageName(strName As String) + strPackageName = strName + End Sub + Public Overrides Function ToScript(Optional ByRef strScript As String = "", Optional strTemp As String = "") As String 'Converting the RFunction into a string that when run in R gives the appropriate output Dim i As Integer @@ -35,7 +40,10 @@ Public Class RFunction 'Parameters are sorted in the appropriate order and then the script is built. SortParameters() - strTemp = strRCommand & "(" + If strPackageName <> "" Then + strTemp = strPackageName & "::" + End If + strTemp = strTemp & strRCommand & "(" For i = 0 To clsParameters.Count - 1 If i > 0 Then strTemp = strTemp & ", " diff --git a/instat/clsRSyntax.vb b/instat/clsRSyntax.vb index c43a569a6a1..fec315a2006 100644 --- a/instat/clsRSyntax.vb +++ b/instat/clsRSyntax.vb @@ -46,6 +46,17 @@ Public Class RSyntax bUseCommandString = False End Sub + Public Sub SetPackageName(strName As String) + If clsBaseFunction Is Nothing Then + MsgBox("Developer error: base function must be set before package name is set.") + Else + clsBaseFunction.SetPackageName(strName) + bUseBaseFunction = True + bUseBaseOperator = False + bUseCommandString = False + End If + End Sub + Public Sub SetBaseRFunction(clsFunction As RFunction) clsBaseFunction = clsFunction bUseBaseFunction = True diff --git a/instat/dlgOneVarFitModel.vb b/instat/dlgOneVarFitModel.vb index 6c755e1dd94..73674cb3480 100644 --- a/instat/dlgOneVarFitModel.vb +++ b/instat/dlgOneVarFitModel.vb @@ -194,6 +194,7 @@ Public Class dlgOneVarFitModel Public Sub FitDistFunction() UcrBase.clsRsyntax.SetBaseRFunction(clsROneVarFitModel) + clsROneVarFitModel.SetPackageName("fitdistrplus") clsROneVarFitModel.SetRCommand("fitdist") clsROneVarFitModel.AddParameter("distr", Chr(34) & ucrFamily.clsCurrDistribution.strRName & Chr(34)) SetDataParameter() @@ -210,7 +211,8 @@ Public Class dlgOneVarFitModel End Sub Private Sub SetVarTest() - clsVarTest.SetRCommand("EnvStats::varTest") + clsVarTest.SetPackageName("EnvStats") + clsVarTest.SetRCommand("varTest") UcrBase.clsRsyntax.SetBaseRFunction(clsVarTest) clsRConvert.SetRCommand("as.vector") clsRConvert.AddParameter("x", clsRFunctionParameter:=UcrReceiver.GetVariables()) @@ -241,7 +243,8 @@ Public Class dlgOneVarFitModel End Sub Private Sub SetNonSignTest() - clsRNonSignTest.SetRCommand("signmedian.test:: signmedian.test") + clsRNonSignTest.SetPackageName("signmedian.test") + clsRNonSignTest.SetRCommand("signmedian.test") UcrBase.clsRsyntax.SetBaseRFunction(clsRNonSignTest) clsRNonSignTest.AddParameter("x", clsRFunctionParameter:=UcrReceiver.GetVariables()) clsRNonSignTest.AddParameter("conf.level", nudCI.Value.ToString) diff --git a/instat/dlgScatterPlot.vb b/instat/dlgScatterPlot.vb index 49e41d8a303..d675417fb9c 100644 --- a/instat/dlgScatterPlot.vb +++ b/instat/dlgScatterPlot.vb @@ -36,11 +36,14 @@ Public Class dlgScatterPlot Private Sub InitialiseDialog() ucrBase.clsRsyntax.SetOperation("+") clsRggplotFunction.SetRCommand("ggplot") + clsRggplotFunction.SetPackageName("ggplot2") clsRaesFunction.SetRCommand("aes") + clsRaesFunction.SetPackageName("ggplot2") clsRggplotFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesFunction) ucrBase.clsRsyntax.SetOperatorParameter(True, clsRFunc:=clsRggplotFunction) clsRgeom_scatterplotFunction.SetRCommand("geom_point") + clsRgeom_scatterplotFunction.SetPackageName("ggplot2") ucrBase.clsRsyntax.SetOperatorParameter(False, clsRFunc:=clsRgeom_scatterplotFunction) ucrVariablesAsFactorForScatter.SetFactorReceiver(ucrFactorOptionalReceiver) From e5743a2c3676724b30139a07655bdf573f95f14d Mon Sep 17 00:00:00 2001 From: Lily Date: Mon, 10 Apr 2017 14:04:21 +0100 Subject: [PATCH 56/66] General tidy up - position numbers, layout, etc --- instat/dlgOneWayFrequencies.Designer.vb | 102 ++++---- instat/dlgOneWayFrequencies.vb | 36 ++- instat/dlgOpenNetCDF.Designer.vb | 14 +- instat/instat.vbproj | 3 + instat/sdgOneWayFrequencies.Designer.vb | 316 ++++++++++++------------ instat/sdgOneWayFrequencies.vb | 113 +++++---- 6 files changed, 293 insertions(+), 291 deletions(-) diff --git a/instat/dlgOneWayFrequencies.Designer.vb b/instat/dlgOneWayFrequencies.Designer.vb index 8a676030ce2..06e59300d20 100644 --- a/instat/dlgOneWayFrequencies.Designer.vb +++ b/instat/dlgOneWayFrequencies.Designer.vb @@ -26,6 +26,7 @@ Partial Class dlgOneWayFrequencies 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.rdoGraph = New System.Windows.Forms.RadioButton() @@ -36,7 +37,6 @@ Partial Class dlgOneWayFrequencies Me.ucrReceiverWeights = New instat.ucrReceiverSingle() Me.ucrChkWeights = New instat.ucrCheck() Me.ucrChkFlip = New instat.ucrCheck() - Me.ucrPnlSort = New instat.UcrPanel() Me.ucrBase = New instat.ucrButtons() Me.ucrReceiverOneWayFreq = New instat.ucrReceiverSingle() Me.ucrSelectorOneWayFreq = New instat.ucrSelectorByDataFrameAddRemove() @@ -49,10 +49,10 @@ Partial Class dlgOneWayFrequencies 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(270, 99) + Me.grpSort.Location = New System.Drawing.Point(269, 125) Me.grpSort.Name = "grpSort" - Me.grpSort.Size = New System.Drawing.Size(120, 91) - Me.grpSort.TabIndex = 3 + Me.grpSort.Size = New System.Drawing.Size(120, 95) + Me.grpSort.TabIndex = 6 Me.grpSort.TabStop = False Me.grpSort.Text = "Sort" ' @@ -62,7 +62,7 @@ Partial Class dlgOneWayFrequencies 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 = 2 + Me.rdoDescending.TabIndex = 3 Me.rdoDescending.TabStop = True Me.rdoDescending.Text = "Descending" Me.rdoDescending.UseVisualStyleBackColor = True @@ -73,7 +73,7 @@ Partial Class dlgOneWayFrequencies 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 = 1 + Me.rdoAscending.TabIndex = 2 Me.rdoAscending.TabStop = True Me.rdoAscending.Text = "Ascending" Me.rdoAscending.UseVisualStyleBackColor = True @@ -84,143 +84,151 @@ Partial Class dlgOneWayFrequencies 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 = 0 + 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(321, 203) + Me.cmdOptions.Location = New System.Drawing.Point(320, 238) Me.cmdOptions.Name = "cmdOptions" Me.cmdOptions.Size = New System.Drawing.Size(69, 23) - Me.cmdOptions.TabIndex = 6 + Me.cmdOptions.TabIndex = 12 Me.cmdOptions.Text = " Options..." Me.cmdOptions.UseVisualStyleBackColor = True ' 'lblSelectedVariable ' Me.lblSelectedVariable.AutoSize = True - Me.lblSelectedVariable.Location = New System.Drawing.Point(267, 43) + Me.lblSelectedVariable.Location = New System.Drawing.Point(266, 78) Me.lblSelectedVariable.Name = "lblSelectedVariable" Me.lblSelectedVariable.Size = New System.Drawing.Size(93, 13) - Me.lblSelectedVariable.TabIndex = 1 + Me.lblSelectedVariable.TabIndex = 4 Me.lblSelectedVariable.Text = "Selected Variable:" ' 'rdoGraph ' - Me.rdoGraph.AutoSize = True - Me.rdoGraph.Location = New System.Drawing.Point(10, 276) + Me.rdoGraph.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoGraph.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoGraph.FlatAppearance.BorderSize = 2 + Me.rdoGraph.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoGraph.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoGraph.Location = New System.Drawing.Point(204, 10) Me.rdoGraph.Name = "rdoGraph" - Me.rdoGraph.Size = New System.Drawing.Size(54, 17) - Me.rdoGraph.TabIndex = 5 - Me.rdoGraph.TabStop = True + Me.rdoGraph.Size = New System.Drawing.Size(100, 28) + Me.rdoGraph.TabIndex = 2 Me.rdoGraph.Text = "Graph" + Me.rdoGraph.TextAlign = System.Drawing.ContentAlignment.MiddleCenter Me.rdoGraph.UseVisualStyleBackColor = True ' 'rdoTable ' - Me.rdoTable.AutoSize = True - Me.rdoTable.Location = New System.Drawing.Point(10, 254) + Me.rdoTable.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoTable.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoTable.FlatAppearance.BorderSize = 2 + Me.rdoTable.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoTable.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoTable.Location = New System.Drawing.Point(106, 10) Me.rdoTable.Name = "rdoTable" - Me.rdoTable.Size = New System.Drawing.Size(52, 17) - Me.rdoTable.TabIndex = 3 - Me.rdoTable.TabStop = True + Me.rdoTable.Size = New System.Drawing.Size(100, 28) + Me.rdoTable.TabIndex = 1 Me.rdoTable.Text = "Table" + Me.rdoTable.TextAlign = System.Drawing.ContentAlignment.MiddleCenter Me.rdoTable.UseVisualStyleBackColor = True ' 'ucrNudGroups ' Me.ucrNudGroups.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudGroups.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudGroups.Location = New System.Drawing.Point(131, 228) + Me.ucrNudGroups.Location = New System.Drawing.Point(121, 263) Me.ucrNudGroups.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudGroups.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudGroups.Name = "ucrNudGroups" Me.ucrNudGroups.Size = New System.Drawing.Size(50, 20) - Me.ucrNudGroups.TabIndex = 8 + Me.ucrNudGroups.TabIndex = 10 Me.ucrNudGroups.Value = New Decimal(New Integer() {0, 0, 0, 0}) ' 'ucrPnlFrequencies ' - Me.ucrPnlFrequencies.Location = New System.Drawing.Point(8, 248) + Me.ucrPnlFrequencies.Location = New System.Drawing.Point(98, 7) Me.ucrPnlFrequencies.Name = "ucrPnlFrequencies" - Me.ucrPnlFrequencies.Size = New System.Drawing.Size(94, 45) - Me.ucrPnlFrequencies.TabIndex = 4 + Me.ucrPnlFrequencies.Size = New System.Drawing.Size(222, 45) + Me.ucrPnlFrequencies.TabIndex = 0 ' 'ucrChkGroupData ' Me.ucrChkGroupData.Checked = False - Me.ucrChkGroupData.Location = New System.Drawing.Point(10, 228) + Me.ucrChkGroupData.Location = New System.Drawing.Point(10, 264) Me.ucrChkGroupData.Name = "ucrChkGroupData" Me.ucrChkGroupData.Size = New System.Drawing.Size(145, 20) - Me.ucrChkGroupData.TabIndex = 7 + Me.ucrChkGroupData.TabIndex = 9 ' 'ucrReceiverWeights ' Me.ucrReceiverWeights.frmParent = Me - Me.ucrReceiverWeights.Location = New System.Drawing.Point(121, 205) + Me.ucrReceiverWeights.Location = New System.Drawing.Point(121, 240) Me.ucrReceiverWeights.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverWeights.Name = "ucrReceiverWeights" Me.ucrReceiverWeights.Selector = Nothing Me.ucrReceiverWeights.Size = New System.Drawing.Size(120, 20) - Me.ucrReceiverWeights.TabIndex = 5 + Me.ucrReceiverWeights.TabIndex = 8 ' 'ucrChkWeights ' Me.ucrChkWeights.Checked = False - Me.ucrChkWeights.Location = New System.Drawing.Point(10, 205) + Me.ucrChkWeights.Location = New System.Drawing.Point(10, 240) Me.ucrChkWeights.Name = "ucrChkWeights" Me.ucrChkWeights.Size = New System.Drawing.Size(129, 20) - Me.ucrChkWeights.TabIndex = 4 + Me.ucrChkWeights.TabIndex = 7 ' 'ucrChkFlip ' Me.ucrChkFlip.Checked = False - Me.ucrChkFlip.Location = New System.Drawing.Point(10, 299) + Me.ucrChkFlip.Location = New System.Drawing.Point(10, 288) Me.ucrChkFlip.Name = "ucrChkFlip" Me.ucrChkFlip.Size = New System.Drawing.Size(145, 20) Me.ucrChkFlip.TabIndex = 11 ' - '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 - ' 'ucrBase ' - Me.ucrBase.Location = New System.Drawing.Point(10, 324) + Me.ucrBase.Location = New System.Drawing.Point(10, 312) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(410, 52) - Me.ucrBase.TabIndex = 12 + Me.ucrBase.TabIndex = 13 ' 'ucrReceiverOneWayFreq ' Me.ucrReceiverOneWayFreq.frmParent = Me - Me.ucrReceiverOneWayFreq.Location = New System.Drawing.Point(270, 60) + Me.ucrReceiverOneWayFreq.Location = New System.Drawing.Point(269, 95) 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 = 2 + Me.ucrReceiverOneWayFreq.TabIndex = 5 ' 'ucrSelectorOneWayFreq ' Me.ucrSelectorOneWayFreq.bShowHiddenColumns = False Me.ucrSelectorOneWayFreq.bUseCurrentFilter = True - Me.ucrSelectorOneWayFreq.Location = New System.Drawing.Point(10, 10) + Me.ucrSelectorOneWayFreq.Location = New System.Drawing.Point(10, 45) 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 + Me.ucrSelectorOneWayFreq.TabIndex = 3 ' '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, 381) + Me.ClientSize = New System.Drawing.Size(420, 370) Me.Controls.Add(Me.rdoGraph) Me.Controls.Add(Me.ucrNudGroups) Me.Controls.Add(Me.rdoTable) diff --git a/instat/dlgOneWayFrequencies.vb b/instat/dlgOneWayFrequencies.vb index a798ba2eeca..4758896f789 100644 --- a/instat/dlgOneWayFrequencies.vb +++ b/instat/dlgOneWayFrequencies.vb @@ -14,7 +14,6 @@ ' 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 dlgOneWayFrequencies @@ -42,16 +41,16 @@ Public Class dlgOneWayFrequencies 'HelpID ' ucrBase.iHelpTopicID = - ucrReceiverOneWayFreq.SetParameter(New RParameter("data", 1)) + ucrReceiverOneWayFreq.SetParameter(New RParameter("data", 0)) ucrReceiverOneWayFreq.SetParameterIsRFunction() ucrReceiverOneWayFreq.Selector = ucrSelectorOneWayFreq - ucrReceiverWeights.Selector = ucrSelectorOneWayFreq - ucrReceiverWeights.SetParameter(New RParameter("weight.by", 2)) + ucrReceiverWeights.SetParameter(New RParameter("weight.by", 1)) ucrReceiverWeights.SetParameterIsRFunction() + ucrReceiverWeights.Selector = ucrSelectorOneWayFreq ucrReceiverWeights.SetDataType("numeric") - ucrPnlSort.SetParameter(New RParameter("sort.frq", 6)) + ucrPnlSort.SetParameter(New RParameter("sort.frq", 3)) ucrPnlSort.AddRadioButton(rdoNone, Chr(34) & "none" & Chr(34)) ucrPnlSort.AddRadioButton(rdoAscending, Chr(34) & "asc" & Chr(34)) ucrPnlSort.AddRadioButton(rdoDescending, Chr(34) & "desc" & Chr(34)) @@ -67,7 +66,7 @@ Public Class dlgOneWayFrequencies ucrPnlFrequencies.AddFunctionNamesCondition(rdoGraph, "sjp.frq") ucrPnlFrequencies.AddToLinkedControls(ucrChkFlip, {rdoGraph}, bNewLinkedDisabledIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True) - ucrNudGroups.SetParameter(New RParameter("auto.group")) + ucrNudGroups.SetParameter(New RParameter("auto.group", 9)) ucrNudGroups.SetMinMax(2, 100) ucrNudGroups.Increment = 5 @@ -77,7 +76,7 @@ Public Class dlgOneWayFrequencies ucrChkGroupData.AddFunctionNamesCondition(True, {"sjt.frq", "sjp.frq"}) ucrChkGroupData.bUpdateRCodeFromControl = True - ucrChkFlip.SetParameter(New RParameter("coord.flip", 1)) + ucrChkFlip.SetParameter(New RParameter("coord.flip", 10)) ucrChkFlip.SetText("Flip Coordinates") ucrChkFlip.SetValuesCheckedAndUnchecked("TRUE", "FALSE") ucrChkFlip.SetRDefault("FALSE") @@ -106,11 +105,11 @@ Public Class dlgOneWayFrequencies End Sub Public Sub SetRCodeForControls(bReset As Boolean) - ucrReceiverOneWayFreq.AddAdditionalCodeParameterPair(clsSjpFrq, New RParameter("var.cnt", 1), iAdditionalPairNo:=1) - ucrChkWeights.AddAdditionalCodeParameterPair(clsSjpFrq, New RParameter("weight.by", 3), iAdditionalPairNo:=1) + ucrReceiverOneWayFreq.AddAdditionalCodeParameterPair(clsSjpFrq, New RParameter("var.cnt", 0), iAdditionalPairNo:=1) + ucrChkWeights.AddAdditionalCodeParameterPair(clsSjpFrq, New RParameter("weight.by", 1), iAdditionalPairNo:=1) ucrReceiverWeights.AddAdditionalCodeParameterPair(clsSjpFrq, ucrChkWeights.GetParameter(), iAdditionalPairNo:=1) - ucrPnlSort.AddAdditionalCodeParameterPair(clsSjpFrq, New RParameter("sort.frq", 5), iAdditionalPairNo:=1) - ucrNudGroups.AddAdditionalCodeParameterPair(clsSjpFrq, New RParameter("auto.group", 35), iAdditionalPairNo:=1) + ucrPnlSort.AddAdditionalCodeParameterPair(clsSjpFrq, New RParameter("sort.frq", 3), iAdditionalPairNo:=1) + ucrNudGroups.AddAdditionalCodeParameterPair(clsSjpFrq, New RParameter("auto.group", 9), iAdditionalPairNo:=1) ucrReceiverOneWayFreq.SetRCode(clsSjtFreq, bReset) ucrReceiverWeights.SetRCode(clsSjtFreq, bReset) @@ -123,22 +122,15 @@ Public Class dlgOneWayFrequencies End Sub Private Sub TestOkEnabled() - If Not ucrReceiverOneWayFreq.IsEmpty() Then - If (Not ucrChkWeights.Checked) AndAlso (Not ucrChkGroupData.Checked) Then - ucrBase.OKEnabled(True) - ElseIf ucrChkWeights.Checked Then + If Not ucrReceiverOneWayFreq.IsEmpty() AndAlso ((ucrChkGroupData.Checked AndAlso ucrNudGroups.GetText <> "") OrElse Not ucrChkGroupData.Checked) Then + If ucrChkWeights.Checked Then If Not ucrReceiverWeights.IsEmpty Then ucrBase.OKEnabled(True) Else ucrBase.OKEnabled(False) End If - ElseIf ucrChkGroupData.Checked Then - - If ucrNudGroups.GetText <> "" Then - ucrBase.OKEnabled(True) - Else - ucrBase.OKEnabled(False) - End If + Else + ucrBase.OKEnabled(True) End If Else ucrBase.OKEnabled(False) diff --git a/instat/dlgOpenNetCDF.Designer.vb b/instat/dlgOpenNetCDF.Designer.vb index 4b42fccf2b3..b695f594612 100644 --- a/instat/dlgOpenNetCDF.Designer.vb +++ b/instat/dlgOpenNetCDF.Designer.vb @@ -35,7 +35,7 @@ Partial Class dlgOpenNetCDF 'lblLocDataNamePrefix ' Me.lblLocDataNamePrefix.AutoSize = True - Me.lblLocDataNamePrefix.Location = New System.Drawing.Point(10, 82) + Me.lblLocDataNamePrefix.Location = New System.Drawing.Point(10, 86) Me.lblLocDataNamePrefix.Name = "lblLocDataNamePrefix" Me.lblLocDataNamePrefix.Size = New System.Drawing.Size(134, 13) Me.lblLocDataNamePrefix.TabIndex = 5 @@ -55,7 +55,7 @@ Partial Class dlgOpenNetCDF 'lblFileOpenPath ' Me.lblFileOpenPath.AutoSize = True - Me.lblFileOpenPath.Location = New System.Drawing.Point(10, 18) + Me.lblFileOpenPath.Location = New System.Drawing.Point(10, 24) Me.lblFileOpenPath.Name = "lblFileOpenPath" Me.lblFileOpenPath.Size = New System.Drawing.Size(26, 13) Me.lblFileOpenPath.TabIndex = 0 @@ -64,7 +64,7 @@ Partial Class dlgOpenNetCDF 'lblMainDataName ' Me.lblMainDataName.AutoSize = True - Me.lblMainDataName.Location = New System.Drawing.Point(10, 49) + Me.lblMainDataName.Location = New System.Drawing.Point(10, 55) Me.lblMainDataName.Name = "lblMainDataName" Me.lblMainDataName.Size = New System.Drawing.Size(122, 13) Me.lblMainDataName.TabIndex = 3 @@ -86,7 +86,7 @@ Partial Class dlgOpenNetCDF Me.ucrInputFilePath.AddQuotesIfUnrecognised = True Me.ucrInputFilePath.IsMultiline = False Me.ucrInputFilePath.IsReadOnly = False - Me.ucrInputFilePath.Location = New System.Drawing.Point(52, 18) + Me.ucrInputFilePath.Location = New System.Drawing.Point(52, 20) Me.ucrInputFilePath.Name = "ucrInputFilePath" Me.ucrInputFilePath.Size = New System.Drawing.Size(161, 21) Me.ucrInputFilePath.TabIndex = 1 @@ -96,14 +96,14 @@ Partial Class dlgOpenNetCDF Me.ucrInputDataName.AddQuotesIfUnrecognised = True Me.ucrInputDataName.IsMultiline = False Me.ucrInputDataName.IsReadOnly = False - Me.ucrInputDataName.Location = New System.Drawing.Point(150, 49) + Me.ucrInputDataName.Location = New System.Drawing.Point(150, 51) Me.ucrInputDataName.Name = "ucrInputDataName" Me.ucrInputDataName.Size = New System.Drawing.Size(142, 21) Me.ucrInputDataName.TabIndex = 4 ' 'ucrBase ' - Me.ucrBase.Location = New System.Drawing.Point(10, 116) + Me.ucrBase.Location = New System.Drawing.Point(10, 109) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(410, 53) Me.ucrBase.TabIndex = 7 @@ -112,7 +112,7 @@ Partial Class dlgOpenNetCDF ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(434, 181) + Me.ClientSize = New System.Drawing.Size(420, 171) Me.Controls.Add(Me.ucrInputLocDataName) Me.Controls.Add(Me.lblLocDataNamePrefix) Me.Controls.Add(Me.ucrInputFilePath) diff --git a/instat/instat.vbproj b/instat/instat.vbproj index 444595ad49d..62b14708f5a 100644 --- a/instat/instat.vbproj +++ b/instat/instat.vbproj @@ -3091,6 +3091,9 @@ sdgOneVarUseModFit.vb + + sdgOneWayFrequencies.vb + sdgSummaries.vb diff --git a/instat/sdgOneWayFrequencies.Designer.vb b/instat/sdgOneWayFrequencies.Designer.vb index cf884ef2eaa..845340a6405 100644 --- a/instat/sdgOneWayFrequencies.Designer.vb +++ b/instat/sdgOneWayFrequencies.Designer.vb @@ -25,32 +25,32 @@ Partial Class sdgOneWayFrequencies Me.tbOneWayFrequencies = New System.Windows.Forms.TabControl() Me.tbTable = New System.Windows.Forms.TabPage() Me.grpTableOptions = New System.Windows.Forms.GroupBox() - Me.Label1 = New System.Windows.Forms.Label() - Me.tbGraph = New System.Windows.Forms.TabPage() - Me.grpGraphOptions = New System.Windows.Forms.GroupBox() - Me.lblTitle = New System.Windows.Forms.Label() - Me.lblHjust = New System.Windows.Forms.Label() - Me.lblVjust = New System.Windows.Forms.Label() - Me.grpGraphType = New System.Windows.Forms.GroupBox() - Me.rdoLine = New System.Windows.Forms.RadioButton() - Me.rdoDot = New System.Windows.Forms.RadioButton() - Me.rdoBar = New System.Windows.Forms.RadioButton() Me.ucrChkCountName = New instat.ucrCheck() Me.ucrInputCountsName = New instat.ucrInputTextBox() + Me.Label1 = New System.Windows.Forms.Label() Me.ucrNudDecimalPlaces = New instat.ucrNud() Me.ucrChkOmitZero = New instat.ucrCheck() Me.ucrChkHighlightedRows = New instat.ucrCheck() Me.ucrChkMedian = New instat.ucrCheck() Me.ucrChkShowSummary = New instat.ucrCheck() + Me.tbGraph = New System.Windows.Forms.TabPage() Me.ucrSaveGraph = New instat.ucrSave() + Me.grpGraphOptions = New System.Windows.Forms.GroupBox() + Me.lblTitle = New System.Windows.Forms.Label() + Me.lblHjust = New System.Windows.Forms.Label() + Me.lblVjust = New System.Windows.Forms.Label() Me.ucrInputGraphTitle = New instat.ucrInputTextBox() Me.ucrInputHorizontalLabels = New instat.ucrInputComboBox() Me.ucrInputVerticalLabels = New instat.ucrInputComboBox() Me.ucrChkShowMissing = New instat.ucrCheck() Me.ucrChkShowPercentage = New instat.ucrCheck() Me.ucrChkShowCount = New instat.ucrCheck() + Me.grpGraphType = New System.Windows.Forms.GroupBox() + Me.rdoLine = New System.Windows.Forms.RadioButton() + Me.rdoDot = New System.Windows.Forms.RadioButton() + Me.rdoBar = New System.Windows.Forms.RadioButton() Me.ucrPnlGraphType = New instat.UcrPanel() - Me.ucrBaseSubDialogue = New instat.ucrButtonsSubdialogue() + Me.ucrBaseOneWayFrequencies = New instat.ucrButtonsSubdialogue() Me.tbOneWayFrequencies.SuspendLayout() Me.tbTable.SuspendLayout() Me.grpTableOptions.SuspendLayout() @@ -63,11 +63,11 @@ Partial Class sdgOneWayFrequencies ' Me.tbOneWayFrequencies.Controls.Add(Me.tbTable) Me.tbOneWayFrequencies.Controls.Add(Me.tbGraph) - Me.tbOneWayFrequencies.Location = New System.Drawing.Point(12, 12) + Me.tbOneWayFrequencies.Location = New System.Drawing.Point(7, 4) Me.tbOneWayFrequencies.Name = "tbOneWayFrequencies" Me.tbOneWayFrequencies.SelectedIndex = 0 Me.tbOneWayFrequencies.Size = New System.Drawing.Size(352, 308) - Me.tbOneWayFrequencies.TabIndex = 1 + Me.tbOneWayFrequencies.TabIndex = 0 ' 'tbTable ' @@ -92,19 +92,81 @@ Partial Class sdgOneWayFrequencies Me.grpTableOptions.Controls.Add(Me.ucrChkShowSummary) Me.grpTableOptions.Location = New System.Drawing.Point(6, 7) Me.grpTableOptions.Name = "grpTableOptions" - Me.grpTableOptions.Size = New System.Drawing.Size(327, 172) - Me.grpTableOptions.TabIndex = 21 + Me.grpTableOptions.Size = New System.Drawing.Size(327, 177) + Me.grpTableOptions.TabIndex = 0 Me.grpTableOptions.TabStop = False Me.grpTableOptions.Text = "More Options" ' + 'ucrChkCountName + ' + Me.ucrChkCountName.Checked = False + Me.ucrChkCountName.Location = New System.Drawing.Point(12, 123) + Me.ucrChkCountName.Name = "ucrChkCountName" + Me.ucrChkCountName.Size = New System.Drawing.Size(94, 20) + Me.ucrChkCountName.TabIndex = 4 + ' + 'ucrInputCountsName + ' + Me.ucrInputCountsName.AddQuotesIfUnrecognised = True + Me.ucrInputCountsName.IsMultiline = False + Me.ucrInputCountsName.IsReadOnly = False + Me.ucrInputCountsName.Location = New System.Drawing.Point(112, 122) + Me.ucrInputCountsName.Name = "ucrInputCountsName" + Me.ucrInputCountsName.Size = New System.Drawing.Size(137, 21) + Me.ucrInputCountsName.TabIndex = 5 + ' 'Label1 ' Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(8, 140) + Me.Label1.Location = New System.Drawing.Point(10, 153) Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(159, 13) - Me.Label1.TabIndex = 56 - Me.Label1.Text = "Decimal places for percentages:" + Me.Label1.Size = New System.Drawing.Size(161, 13) + Me.Label1.TabIndex = 6 + Me.Label1.Text = "Decimal Places for Percentages:" + ' + 'ucrNudDecimalPlaces + ' + Me.ucrNudDecimalPlaces.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudDecimalPlaces.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudDecimalPlaces.Location = New System.Drawing.Point(199, 149) + Me.ucrNudDecimalPlaces.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudDecimalPlaces.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudDecimalPlaces.Name = "ucrNudDecimalPlaces" + Me.ucrNudDecimalPlaces.Size = New System.Drawing.Size(50, 20) + Me.ucrNudDecimalPlaces.TabIndex = 7 + Me.ucrNudDecimalPlaces.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrChkOmitZero + ' + Me.ucrChkOmitZero.Checked = False + Me.ucrChkOmitZero.Location = New System.Drawing.Point(12, 96) + Me.ucrChkOmitZero.Name = "ucrChkOmitZero" + Me.ucrChkOmitZero.Size = New System.Drawing.Size(262, 20) + Me.ucrChkOmitZero.TabIndex = 3 + ' + 'ucrChkHighlightedRows + ' + Me.ucrChkHighlightedRows.Checked = False + Me.ucrChkHighlightedRows.Location = New System.Drawing.Point(12, 44) + Me.ucrChkHighlightedRows.Name = "ucrChkHighlightedRows" + Me.ucrChkHighlightedRows.Size = New System.Drawing.Size(145, 20) + Me.ucrChkHighlightedRows.TabIndex = 1 + ' + 'ucrChkMedian + ' + Me.ucrChkMedian.Checked = False + Me.ucrChkMedian.Location = New System.Drawing.Point(12, 70) + Me.ucrChkMedian.Name = "ucrChkMedian" + Me.ucrChkMedian.Size = New System.Drawing.Size(145, 20) + Me.ucrChkMedian.TabIndex = 2 + ' + 'ucrChkShowSummary + ' + Me.ucrChkShowSummary.Checked = False + Me.ucrChkShowSummary.Location = New System.Drawing.Point(12, 18) + Me.ucrChkShowSummary.Name = "ucrChkShowSummary" + Me.ucrChkShowSummary.Size = New System.Drawing.Size(145, 20) + Me.ucrChkShowSummary.TabIndex = 0 ' 'tbGraph ' @@ -119,6 +181,13 @@ Partial Class sdgOneWayFrequencies Me.tbGraph.Text = "Graph" Me.tbGraph.UseVisualStyleBackColor = True ' + 'ucrSaveGraph + ' + Me.ucrSaveGraph.Location = New System.Drawing.Point(12, 249) + Me.ucrSaveGraph.Name = "ucrSaveGraph" + Me.ucrSaveGraph.Size = New System.Drawing.Size(294, 24) + Me.ucrSaveGraph.TabIndex = 2 + ' 'grpGraphOptions ' Me.grpGraphOptions.Controls.Add(Me.lblTitle) @@ -133,171 +202,56 @@ Partial Class sdgOneWayFrequencies Me.grpGraphOptions.Location = New System.Drawing.Point(6, 59) Me.grpGraphOptions.Name = "grpGraphOptions" Me.grpGraphOptions.Size = New System.Drawing.Size(329, 184) - Me.grpGraphOptions.TabIndex = 37 + Me.grpGraphOptions.TabIndex = 1 Me.grpGraphOptions.TabStop = False Me.grpGraphOptions.Text = "Graph Options" ' 'lblTitle ' Me.lblTitle.AutoSize = True - Me.lblTitle.Location = New System.Drawing.Point(12, 152) + Me.lblTitle.Location = New System.Drawing.Point(12, 155) Me.lblTitle.Name = "lblTitle" Me.lblTitle.Size = New System.Drawing.Size(62, 13) - Me.lblTitle.TabIndex = 58 + Me.lblTitle.TabIndex = 7 Me.lblTitle.Text = "Graph Title:" ' 'lblHjust ' Me.lblHjust.AutoSize = True - Me.lblHjust.Location = New System.Drawing.Point(12, 128) + Me.lblHjust.Location = New System.Drawing.Point(12, 127) Me.lblHjust.Name = "lblHjust" Me.lblHjust.Size = New System.Drawing.Size(126, 13) - Me.lblHjust.TabIndex = 57 + Me.lblHjust.TabIndex = 5 Me.lblHjust.Text = "Horizontal Label Position:" ' 'lblVjust ' Me.lblVjust.AutoSize = True - Me.lblVjust.Location = New System.Drawing.Point(12, 100) + Me.lblVjust.Location = New System.Drawing.Point(12, 99) Me.lblVjust.Name = "lblVjust" Me.lblVjust.Size = New System.Drawing.Size(114, 13) - Me.lblVjust.TabIndex = 55 + Me.lblVjust.TabIndex = 3 Me.lblVjust.Text = "Vertical Label Position:" ' - 'grpGraphType - ' - Me.grpGraphType.Controls.Add(Me.rdoLine) - Me.grpGraphType.Controls.Add(Me.rdoDot) - Me.grpGraphType.Controls.Add(Me.rdoBar) - Me.grpGraphType.Controls.Add(Me.ucrPnlGraphType) - Me.grpGraphType.Location = New System.Drawing.Point(6, 6) - Me.grpGraphType.Name = "grpGraphType" - Me.grpGraphType.Size = New System.Drawing.Size(327, 48) - Me.grpGraphType.TabIndex = 33 - Me.grpGraphType.TabStop = False - Me.grpGraphType.Text = "Type of Graph" - ' - 'rdoLine - ' - Me.rdoLine.AutoSize = True - Me.rdoLine.Location = New System.Drawing.Point(242, 19) - Me.rdoLine.Name = "rdoLine" - Me.rdoLine.Size = New System.Drawing.Size(77, 17) - Me.rdoLine.TabIndex = 7 - Me.rdoLine.TabStop = True - Me.rdoLine.Text = "Line Graph" - Me.rdoLine.UseVisualStyleBackColor = True - ' - 'rdoDot - ' - Me.rdoDot.AutoSize = True - Me.rdoDot.Location = New System.Drawing.Point(118, 19) - Me.rdoDot.Name = "rdoDot" - Me.rdoDot.Size = New System.Drawing.Size(74, 17) - Me.rdoDot.TabIndex = 6 - Me.rdoDot.TabStop = True - Me.rdoDot.Text = "Dot Graph" - Me.rdoDot.UseVisualStyleBackColor = True - ' - 'rdoBar - ' - Me.rdoBar.AutoSize = True - Me.rdoBar.Location = New System.Drawing.Point(6, 19) - Me.rdoBar.Name = "rdoBar" - Me.rdoBar.Size = New System.Drawing.Size(73, 17) - Me.rdoBar.TabIndex = 5 - Me.rdoBar.TabStop = True - Me.rdoBar.Text = "Bar Graph" - Me.rdoBar.UseVisualStyleBackColor = True - ' - 'ucrChkCountName - ' - Me.ucrChkCountName.Checked = False - Me.ucrChkCountName.Location = New System.Drawing.Point(8, 114) - Me.ucrChkCountName.Name = "ucrChkCountName" - Me.ucrChkCountName.Size = New System.Drawing.Size(94, 20) - Me.ucrChkCountName.TabIndex = 60 - ' - 'ucrInputCountsName - ' - Me.ucrInputCountsName.AddQuotesIfUnrecognised = True - Me.ucrInputCountsName.IsMultiline = False - Me.ucrInputCountsName.IsReadOnly = False - Me.ucrInputCountsName.Location = New System.Drawing.Point(108, 114) - Me.ucrInputCountsName.Name = "ucrInputCountsName" - Me.ucrInputCountsName.Size = New System.Drawing.Size(137, 21) - Me.ucrInputCountsName.TabIndex = 59 - ' - 'ucrNudDecimalPlaces - ' - Me.ucrNudDecimalPlaces.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudDecimalPlaces.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudDecimalPlaces.Location = New System.Drawing.Point(173, 140) - Me.ucrNudDecimalPlaces.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudDecimalPlaces.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudDecimalPlaces.Name = "ucrNudDecimalPlaces" - Me.ucrNudDecimalPlaces.Size = New System.Drawing.Size(50, 20) - Me.ucrNudDecimalPlaces.TabIndex = 50 - Me.ucrNudDecimalPlaces.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrChkOmitZero - ' - Me.ucrChkOmitZero.Checked = False - Me.ucrChkOmitZero.Location = New System.Drawing.Point(8, 90) - Me.ucrChkOmitZero.Name = "ucrChkOmitZero" - Me.ucrChkOmitZero.Size = New System.Drawing.Size(262, 20) - Me.ucrChkOmitZero.TabIndex = 23 - ' - 'ucrChkHighlightedRows - ' - Me.ucrChkHighlightedRows.Checked = False - Me.ucrChkHighlightedRows.Location = New System.Drawing.Point(8, 42) - Me.ucrChkHighlightedRows.Name = "ucrChkHighlightedRows" - Me.ucrChkHighlightedRows.Size = New System.Drawing.Size(145, 20) - Me.ucrChkHighlightedRows.TabIndex = 22 - ' - 'ucrChkMedian - ' - Me.ucrChkMedian.Checked = False - Me.ucrChkMedian.Location = New System.Drawing.Point(8, 66) - Me.ucrChkMedian.Name = "ucrChkMedian" - Me.ucrChkMedian.Size = New System.Drawing.Size(145, 20) - Me.ucrChkMedian.TabIndex = 21 - ' - 'ucrChkShowSummary - ' - Me.ucrChkShowSummary.Checked = False - Me.ucrChkShowSummary.Location = New System.Drawing.Point(8, 18) - Me.ucrChkShowSummary.Name = "ucrChkShowSummary" - Me.ucrChkShowSummary.Size = New System.Drawing.Size(145, 20) - Me.ucrChkShowSummary.TabIndex = 19 - ' - 'ucrSaveGraph - ' - Me.ucrSaveGraph.Location = New System.Drawing.Point(12, 249) - Me.ucrSaveGraph.Name = "ucrSaveGraph" - Me.ucrSaveGraph.Size = New System.Drawing.Size(294, 24) - Me.ucrSaveGraph.TabIndex = 39 - ' 'ucrInputGraphTitle ' Me.ucrInputGraphTitle.AddQuotesIfUnrecognised = True Me.ucrInputGraphTitle.IsMultiline = False Me.ucrInputGraphTitle.IsReadOnly = False - Me.ucrInputGraphTitle.Location = New System.Drawing.Point(141, 152) + Me.ucrInputGraphTitle.Location = New System.Drawing.Point(141, 151) Me.ucrInputGraphTitle.Name = "ucrInputGraphTitle" Me.ucrInputGraphTitle.Size = New System.Drawing.Size(137, 21) - Me.ucrInputGraphTitle.TabIndex = 54 + Me.ucrInputGraphTitle.TabIndex = 8 ' 'ucrInputHorizontalLabels ' Me.ucrInputHorizontalLabels.AddQuotesIfUnrecognised = True Me.ucrInputHorizontalLabels.IsReadOnly = False - Me.ucrInputHorizontalLabels.Location = New System.Drawing.Point(141, 124) + Me.ucrInputHorizontalLabels.Location = New System.Drawing.Point(141, 123) Me.ucrInputHorizontalLabels.Margin = New System.Windows.Forms.Padding(21, 17, 21, 17) Me.ucrInputHorizontalLabels.Name = "ucrInputHorizontalLabels" Me.ucrInputHorizontalLabels.Size = New System.Drawing.Size(137, 21) - Me.ucrInputHorizontalLabels.TabIndex = 51 + Me.ucrInputHorizontalLabels.TabIndex = 6 ' 'ucrInputVerticalLabels ' @@ -307,7 +261,7 @@ Partial Class sdgOneWayFrequencies Me.ucrInputVerticalLabels.Margin = New System.Windows.Forms.Padding(21, 17, 21, 17) Me.ucrInputVerticalLabels.Name = "ucrInputVerticalLabels" Me.ucrInputVerticalLabels.Size = New System.Drawing.Size(137, 21) - Me.ucrInputVerticalLabels.TabIndex = 50 + Me.ucrInputVerticalLabels.TabIndex = 4 ' 'ucrChkShowMissing ' @@ -315,7 +269,7 @@ Partial Class sdgOneWayFrequencies Me.ucrChkShowMissing.Location = New System.Drawing.Point(12, 73) Me.ucrChkShowMissing.Name = "ucrChkShowMissing" Me.ucrChkShowMissing.Size = New System.Drawing.Size(145, 20) - Me.ucrChkShowMissing.TabIndex = 28 + Me.ucrChkShowMissing.TabIndex = 2 ' 'ucrChkShowPercentage ' @@ -323,7 +277,7 @@ Partial Class sdgOneWayFrequencies Me.ucrChkShowPercentage.Location = New System.Drawing.Point(12, 19) Me.ucrChkShowPercentage.Name = "ucrChkShowPercentage" Me.ucrChkShowPercentage.Size = New System.Drawing.Size(145, 20) - Me.ucrChkShowPercentage.TabIndex = 20 + Me.ucrChkShowPercentage.TabIndex = 0 ' 'ucrChkShowCount ' @@ -331,29 +285,75 @@ Partial Class sdgOneWayFrequencies Me.ucrChkShowCount.Location = New System.Drawing.Point(12, 46) Me.ucrChkShowCount.Name = "ucrChkShowCount" Me.ucrChkShowCount.Size = New System.Drawing.Size(145, 20) - Me.ucrChkShowCount.TabIndex = 18 + Me.ucrChkShowCount.TabIndex = 1 + ' + 'grpGraphType + ' + Me.grpGraphType.Controls.Add(Me.rdoLine) + Me.grpGraphType.Controls.Add(Me.rdoDot) + Me.grpGraphType.Controls.Add(Me.rdoBar) + Me.grpGraphType.Controls.Add(Me.ucrPnlGraphType) + Me.grpGraphType.Location = New System.Drawing.Point(6, 6) + Me.grpGraphType.Name = "grpGraphType" + Me.grpGraphType.Size = New System.Drawing.Size(327, 48) + Me.grpGraphType.TabIndex = 0 + Me.grpGraphType.TabStop = False + Me.grpGraphType.Text = "Type of Graph" + ' + 'rdoLine + ' + Me.rdoLine.AutoSize = True + Me.rdoLine.Location = New System.Drawing.Point(242, 19) + Me.rdoLine.Name = "rdoLine" + Me.rdoLine.Size = New System.Drawing.Size(77, 17) + Me.rdoLine.TabIndex = 3 + Me.rdoLine.TabStop = True + Me.rdoLine.Text = "Line Graph" + Me.rdoLine.UseVisualStyleBackColor = True + ' + 'rdoDot + ' + Me.rdoDot.AutoSize = True + Me.rdoDot.Location = New System.Drawing.Point(118, 19) + Me.rdoDot.Name = "rdoDot" + Me.rdoDot.Size = New System.Drawing.Size(74, 17) + Me.rdoDot.TabIndex = 2 + Me.rdoDot.TabStop = True + Me.rdoDot.Text = "Dot Graph" + Me.rdoDot.UseVisualStyleBackColor = True + ' + 'rdoBar + ' + Me.rdoBar.AutoSize = True + Me.rdoBar.Location = New System.Drawing.Point(6, 19) + Me.rdoBar.Name = "rdoBar" + Me.rdoBar.Size = New System.Drawing.Size(73, 17) + Me.rdoBar.TabIndex = 1 + Me.rdoBar.TabStop = True + Me.rdoBar.Text = "Bar Graph" + Me.rdoBar.UseVisualStyleBackColor = True ' 'ucrPnlGraphType ' Me.ucrPnlGraphType.Location = New System.Drawing.Point(6, 7) Me.ucrPnlGraphType.Name = "ucrPnlGraphType" Me.ucrPnlGraphType.Size = New System.Drawing.Size(323, 44) - Me.ucrPnlGraphType.TabIndex = 4 + Me.ucrPnlGraphType.TabIndex = 0 ' - 'ucrBaseSubDialogue + 'ucrBaseOneWayFrequencies ' - Me.ucrBaseSubDialogue.Location = New System.Drawing.Point(93, 325) - Me.ucrBaseSubDialogue.Name = "ucrBaseSubDialogue" - Me.ucrBaseSubDialogue.Size = New System.Drawing.Size(142, 30) - Me.ucrBaseSubDialogue.TabIndex = 0 + Me.ucrBaseOneWayFrequencies.Location = New System.Drawing.Point(111, 318) + Me.ucrBaseOneWayFrequencies.Name = "ucrBaseOneWayFrequencies" + Me.ucrBaseOneWayFrequencies.Size = New System.Drawing.Size(142, 30) + Me.ucrBaseOneWayFrequencies.TabIndex = 1 ' 'sdgOneWayFrequencies ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(376, 368) + Me.ClientSize = New System.Drawing.Size(365, 350) Me.Controls.Add(Me.tbOneWayFrequencies) - Me.Controls.Add(Me.ucrBaseSubDialogue) + Me.Controls.Add(Me.ucrBaseOneWayFrequencies) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.MaximizeBox = False Me.MinimizeBox = False @@ -373,7 +373,7 @@ Partial Class sdgOneWayFrequencies End Sub - Friend WithEvents ucrBaseSubDialogue As ucrButtonsSubdialogue + Friend WithEvents ucrBaseOneWayFrequencies As ucrButtonsSubdialogue Friend WithEvents tbOneWayFrequencies As TabControl Friend WithEvents tbTable As TabPage Friend WithEvents grpTableOptions As GroupBox diff --git a/instat/sdgOneWayFrequencies.vb b/instat/sdgOneWayFrequencies.vb index b89cdd976d8..2f8b1339fdc 100644 --- a/instat/sdgOneWayFrequencies.vb +++ b/instat/sdgOneWayFrequencies.vb @@ -16,7 +16,6 @@ Imports instat.Translations Public Class sdgOneWayFrequencies - Public bControlsInitialised As Boolean = False Public clsOneWayTableFreq, clsOneWayGraphFreq As New RFunction @@ -28,85 +27,85 @@ Public Class sdgOneWayFrequencies Dim dctVerticalPositionLabel As New Dictionary(Of String, String) Dim dctHorizontalPositionLabel As New Dictionary(Of String, String) - ucrInputHorizontalLabels.SetParameter(New RParameter("hjust", 38)) - dctHorizontalPositionLabel.Add("Left", Chr(34) & "left" & Chr(34)) - dctHorizontalPositionLabel.Add("Center", Chr(34) & "center" & Chr(34)) - dctHorizontalPositionLabel.Add("Right", Chr(34) & "right" & Chr(34)) - dctHorizontalPositionLabel.Add("Bottom", Chr(34) & "bottom" & Chr(34)) - dctHorizontalPositionLabel.Add("Top", Chr(34) & "top" & Chr(34)) - dctHorizontalPositionLabel.Add("Inward", Chr(34) & "inward" & Chr(34)) - dctHorizontalPositionLabel.Add("Outward", Chr(34) & "outward" & Chr(34)) - ucrInputHorizontalLabels.SetItems(dctHorizontalPositionLabel) - ucrInputHorizontalLabels.SetRDefault(Chr(34) & "center" & Chr(34)) + ucrInputGraphTitle.SetParameter(New RParameter("title", 2)) - ucrInputVerticalLabels.SetParameter(New RParameter("vjust", 37)) - dctVerticalPositionLabel.Add("Left", Chr(34) & "left" & Chr(34)) - dctVerticalPositionLabel.Add("Center", Chr(34) & "center" & Chr(34)) - dctVerticalPositionLabel.Add("Right", Chr(34) & "right" & Chr(34)) - dctVerticalPositionLabel.Add("Bottom", Chr(34) & "bottom" & Chr(34)) - dctVerticalPositionLabel.Add("Top", Chr(34) & "top" & Chr(34)) - dctVerticalPositionLabel.Add("Inward", Chr(34) & "inward" & Chr(34)) - dctVerticalPositionLabel.Add("Outward", Chr(34) & "outward" & Chr(34)) - ucrInputVerticalLabels.SetItems(dctVerticalPositionLabel) - ucrInputVerticalLabels.SetRDefault(Chr(34) & "bottom" & Chr(34)) + 'Table Only + ucrChkHighlightedRows.SetParameter(New RParameter("altr.row.col", 4), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") + ucrChkHighlightedRows.SetRDefault("FALSE") + ucrChkHighlightedRows.SetText("Alternate Rows Coloured") - 'TODO Parameter position needed - ucrChkMedian.SetParameter(New RParameter("emph.md"), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") + 'Table Only + ucrInputCountsName.SetParameter(New RParameter("string.cnt", 5)) + ucrInputCountsName.SetRDefault(Chr(34) & "N" & Chr(34)) + ucrChkCountName.SetParameter(ucrInputCountsName.GetParameter(), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) + ucrChkCountName.SetText("Count Name") + ucrChkCountName.AddToLinkedControls(ucrInputCountsName, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + + 'Table Only + ucrChkMedian.SetParameter(New RParameter("emph.md", 6), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") ucrChkMedian.SetRDefault("FALSE") ucrChkMedian.SetText("Emphasise Median") + 'Table Only + ucrChkShowSummary.SetParameter(New RParameter("show.summary", 7), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") ucrChkShowSummary.SetText("Show Summary") - 'TODO Parameter position needed - ucrChkShowSummary.SetParameter(New RParameter("show.summary"), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") + 'Table Only 'Default is auto - ucrChkOmitZero.SetText("Omit Zero Counts from Table") - 'TODO Parameter position needed 'skip.zero has three options: "auto", TRUE, FALSE so this could be a combobox instead - ucrChkOmitZero.SetParameter(New RParameter("skip.zero"), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") + ucrChkOmitZero.SetParameter(New RParameter("skip.zero", 8), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") + ucrChkOmitZero.SetText("Omit Zero Counts from Table") - 'TODO Parameter position needed - ucrNudDecimalPlaces.SetParameter(New RParameter("digits")) + 'Table Only + ucrNudDecimalPlaces.SetParameter(New RParameter("digits", 10)) ucrNudDecimalPlaces.SetMinMax(0, 4) - 'TODO Parameter position needed - ucrChkHighlightedRows.SetParameter(New RParameter("altr.row.col"), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") - ucrChkHighlightedRows.SetRDefault("FALSE") - ucrChkHighlightedRows.SetText("Alternate Rows Coloured") + 'Graph Only + ucrPnlGraphType.SetParameter(New RParameter("type", 4)) + ucrPnlGraphType.AddRadioButton(rdoBar, Chr(34) & "bar" & Chr(34)) + ucrPnlGraphType.AddRadioButton(rdoLine, Chr(34) & "line" & Chr(34)) + ucrPnlGraphType.AddRadioButton(rdoDot, Chr(34) & "dot" & Chr(34)) + ucrPnlGraphType.SetRDefault(Chr(34) & "bar" & Chr(34)) - 'TODO Parameter position needed - ucrChkShowCount.SetParameter(New RParameter("show.n"), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") + 'Graph Only + ucrChkShowCount.SetParameter(New RParameter("show.n", 5), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") ucrChkShowCount.SetRDefault("FALSE") ucrChkShowCount.SetText("Show Count") - 'TODO Parameter position needed - ucrChkShowPercentage.SetParameter(New RParameter("show.prc"), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") + 'Graph Only + ucrChkShowPercentage.SetParameter(New RParameter("show.prc", 6), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") ucrChkShowPercentage.SetText("Show Percentage") - 'TODO Parameter position needed - ucrInputGraphTitle.SetParameter(New RParameter("title")) - + 'Graph Only + ucrChkShowMissing.SetParameter(New RParameter("show.na", 7), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") ucrChkShowMissing.SetText("Show Missing") - 'TODO Parameter position needed - ucrChkShowMissing.SetParameter(New RParameter("show.na"), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") ucrChkShowMissing.SetRDefault("FALSE") - 'TODO Parameter position needed - ucrPnlGraphType.SetParameter(New RParameter("type")) - ucrPnlGraphType.AddRadioButton(rdoBar, Chr(34) & "bar" & Chr(34)) - ucrPnlGraphType.AddRadioButton(rdoLine, Chr(34) & "line" & Chr(34)) - ucrPnlGraphType.AddRadioButton(rdoDot, Chr(34) & "dot" & Chr(34)) - ucrPnlGraphType.SetRDefault(Chr(34) & "bar" & Chr(34)) - - 'TODO Parameter position needed - ucrInputCountsName.SetParameter(New RParameter("string.cnt")) - ucrInputCountsName.SetRDefault(Chr(34) & "N" & Chr(34)) + 'Graph Only + ucrInputHorizontalLabels.SetParameter(New RParameter("hjust", 11)) + dctHorizontalPositionLabel.Add("Left", Chr(34) & "left" & Chr(34)) + dctHorizontalPositionLabel.Add("Center", Chr(34) & "center" & Chr(34)) + dctHorizontalPositionLabel.Add("Right", Chr(34) & "right" & Chr(34)) + dctHorizontalPositionLabel.Add("Bottom", Chr(34) & "bottom" & Chr(34)) + dctHorizontalPositionLabel.Add("Top", Chr(34) & "top" & Chr(34)) + dctHorizontalPositionLabel.Add("Inward", Chr(34) & "inward" & Chr(34)) + dctHorizontalPositionLabel.Add("Outward", Chr(34) & "outward" & Chr(34)) + ucrInputHorizontalLabels.SetItems(dctHorizontalPositionLabel) + ucrInputHorizontalLabels.SetRDefault(Chr(34) & "center" & Chr(34)) - 'TODO Parameter position needed - ucrChkCountName.SetParameter(ucrInputCountsName.GetParameter(), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) - ucrChkCountName.SetText("Count Name") - ucrChkCountName.AddToLinkedControls(ucrInputCountsName, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + 'Graph Only + ucrInputVerticalLabels.SetParameter(New RParameter("vjust", 12)) + dctVerticalPositionLabel.Add("Left", Chr(34) & "left" & Chr(34)) + dctVerticalPositionLabel.Add("Center", Chr(34) & "center" & Chr(34)) + dctVerticalPositionLabel.Add("Right", Chr(34) & "right" & Chr(34)) + dctVerticalPositionLabel.Add("Bottom", Chr(34) & "bottom" & Chr(34)) + dctVerticalPositionLabel.Add("Top", Chr(34) & "top" & Chr(34)) + dctVerticalPositionLabel.Add("Inward", Chr(34) & "inward" & Chr(34)) + dctVerticalPositionLabel.Add("Outward", Chr(34) & "outward" & Chr(34)) + ucrInputVerticalLabels.SetItems(dctVerticalPositionLabel) + ucrInputVerticalLabels.SetRDefault(Chr(34) & "bottom" & Chr(34)) + 'Graph Only ucrSaveGraph.SetPrefix("one_way_freq") ucrSaveGraph.SetSaveTypeAsGraph() ucrSaveGraph.SetDataFrameSelector(dlgOneWayFrequencies.ucrSelectorOneWayFreq.ucrAvailableDataFrames) From c59202b4f27285524ef2fc16553570504a03d7f1 Mon Sep 17 00:00:00 2001 From: Danny Parsons Date: Mon, 10 Apr 2017 14:42:24 +0100 Subject: [PATCH 57/66] fixed resetting issue on one way freq --- instat/dlgOneWayFrequencies.vb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/instat/dlgOneWayFrequencies.vb b/instat/dlgOneWayFrequencies.vb index 4758896f789..2550236238d 100644 --- a/instat/dlgOneWayFrequencies.vb +++ b/instat/dlgOneWayFrequencies.vb @@ -73,8 +73,9 @@ Public Class dlgOneWayFrequencies ucrChkGroupData.SetParameter(ucrNudGroups.GetParameter(), bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True) ucrChkGroupData.SetText("Group Data") ucrChkGroupData.AddToLinkedControls(ucrNudGroups, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=10) - ucrChkGroupData.AddFunctionNamesCondition(True, {"sjt.frq", "sjp.frq"}) - ucrChkGroupData.bUpdateRCodeFromControl = True + ucrChkGroupData.AddParameterPresentCondition(True, "auto.group") + ucrChkGroupData.AddParameterPresentCondition(False, "auto.group", False) + 'ucrChkGroupData.bUpdateRCodeFromControl = True ucrChkFlip.SetParameter(New RParameter("coord.flip", 10)) ucrChkFlip.SetText("Flip Coordinates") @@ -95,9 +96,7 @@ Public Class dlgOneWayFrequencies clsSjtFreq.AddParameter("digits", 0) clsSjpFrq.SetRCommand("sjp.frq") - clsSjpFrq.AddParameter("sort.frq", Chr(34) & "none" & Chr(34)) clsSjpFrq.AddParameter("type", Chr(34) & "bar" & Chr(34)) - clsSjpFrq.AddParameter("show.prc", "TRUE") clsSjpFrq.SetAssignTo("last_graph", strTempDataframe:=ucrSelectorOneWayFreq.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") ucrBase.clsRsyntax.SetBaseRFunction(clsSjtFreq) From 217193078cf83ee0f21a915ef29b321907e6e9f9 Mon Sep 17 00:00:00 2001 From: Danny Parsons Date: Mon, 10 Apr 2017 17:07:34 +0100 Subject: [PATCH 58/66] made ucrVarsAsFact inherit ucrReceiver --- instat/ucrReceiver.vb | 6 +-- instat/ucrVariablesAsFactor.Designer.vb | 2 +- instat/ucrVariablesAsFactor.vb | 59 +++++++------------------ 3 files changed, 20 insertions(+), 47 deletions(-) diff --git a/instat/ucrReceiver.vb b/instat/ucrReceiver.vb index 9523929b582..c2ed292b9b2 100644 --- a/instat/ucrReceiver.vb +++ b/instat/ucrReceiver.vb @@ -106,7 +106,7 @@ Public Class ucrReceiver Return strVarNames End Function - Public Sub SetMeAsReceiver() + Public Overridable Sub SetMeAsReceiver() If Selector IsNot Nothing Then Selector.SetCurrentReceiver(Me) End If @@ -366,13 +366,13 @@ Public Class ucrReceiver End If End Sub - Public Sub SetParameterIsString() + Public Overridable Sub SetParameterIsString() bParameterIsString = True bParameterIsRFunction = False UpdateParameter() End Sub - Public Sub SetParameterIsRFunction() + Public Overridable Sub SetParameterIsRFunction() bParameterIsRFunction = True bParameterIsString = False UpdateParameter() diff --git a/instat/ucrVariablesAsFactor.Designer.vb b/instat/ucrVariablesAsFactor.Designer.vb index 05556c41a89..d057cccc18f 100644 --- a/instat/ucrVariablesAsFactor.Designer.vb +++ b/instat/ucrVariablesAsFactor.Designer.vb @@ -1,6 +1,6 @@  _ Partial Class ucrVariablesAsFactor - Inherits ucrCore + Inherits instat.ucrReceiver 'UserControl overrides dispose to clean up the component list. _ diff --git a/instat/ucrVariablesAsFactor.vb b/instat/ucrVariablesAsFactor.vb index 03e1a4f6849..6adf1c8a56d 100644 --- a/instat/ucrVariablesAsFactor.vb +++ b/instat/ucrVariablesAsFactor.vb @@ -2,15 +2,9 @@ Public Class ucrVariablesAsFactor Public bSingleVariable As Boolean - Public bFirstLoad As Boolean Public ucrFactorReceiver As ucrReceiverSingle 'The ucrVariablesAsFactor has an associated ucrFactorReceiver, set on the dialog it is living in. In multiple mode, the ucrVariablesAsFactor can receive multiple variables that are then stacked in one and distinguished using a factor variable called "variable". The associated factor receiver will then be set in StackedFactorMode and fix it's content to this "variable" factor. Public WithEvents ucrVariableSelector As ucrSelectorByDataFrame - Public bForceAsDataFrame As Boolean = True - Private strColumnsParameterNameInRFunction As String = "col_names" - Public WithEvents Selector As ucrSelector - - Public bWithQuotes As Boolean = True 'TODO this is not implemented correctly yet Public Sub New() ' This call is required by the designer. @@ -20,8 +14,6 @@ Public Class ucrVariablesAsFactor bFirstLoad = True End Sub - Public Event SelectionChanged() - Private Sub ucrVariablesAsFactor_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstLoad Then SetDefaults() @@ -43,25 +35,8 @@ Public Class ucrVariablesAsFactor ucrFactorReceiver = ucrReceiverToSet End Sub - 'Question to be discussed: what are the differences between the following three ? - Public Sub SetDataType(strTemp As String) - ucrSingleVariable.SetDataType(strTemp) - ucrMultipleVariables.SetDataType(strTemp) - End Sub - Public Sub SetIncludedDataType(strInclude As String()) - ucrSingleVariable.SetIncludedDataTypes(strInclude) - ucrMultipleVariables.SetIncludedDataTypes(strInclude) - End Sub - - Public Sub SetExcludedDataTypes(strExclude As String()) - ucrMultipleVariables.SetExcludedDataTypes(strExclude) - ucrSingleVariable.SetExcludedDataTypes(strExclude) - End Sub - - Public Sub SetSelector(ucrSelectorToSet As ucrSelectorByDataFrame) - ucrVariableSelector = ucrSelectorToSet - ucrSingleVariable.Selector = ucrSelectorToSet - ucrMultipleVariables.Selector = ucrSelectorToSet + Public Sub SetSelector(ucrSelectorToSet As ucrSelectorByDataFrame) + Selector = ucrSelectorToSet End Sub @@ -70,10 +45,10 @@ Public Class ucrVariablesAsFactor bSingleVariable = Not bSingleVariable SetReceiverStatus() 'After setting the receiver status, the SelectionChanged event is raised for the dlg's that contain the ucrVariablesAsFactors to adapt to the changes operated locally. For instance in the dlgBoxPlot, the sub UcrVariablesAsFactor1_SelectionChanged() is then called and updates it's aesthetics receivers. - RaiseEvent SelectionChanged() + OnSelectionChanged() End Sub - Public Function GetVariableNames(Optional bWithQuotes As Boolean = True) As String + Public Overrides Function GetVariableNames(Optional bWithQuotes As Boolean = True) As String 'This sub provides the name of the variable that should be used by external components that want to access the "content" of this receiver. If it is in single mode, this is simply providing the name of the variable in use. 'However in multiple mode, a New variable will be created using the "stack" And "measure.vars" explained in SetReceiverStatus. Dim strVariablesToStack As String = "" @@ -97,7 +72,7 @@ Public Class ucrVariablesAsFactor Return strVariablesToStack End Function - Public Function GetVariables(Optional bForceAsDataFrame As Boolean = False) As RFunction + Public Overrides Function GetVariables(Optional bForceAsDataFrame As Boolean = False) As RFunction Dim clsVariables As New RFunction If bSingleVariable Then clsVariables = ucrSingleVariable.GetVariables(bForceAsDataFrame) @@ -151,16 +126,14 @@ Public Class ucrVariablesAsFactor If Not bSingleVariable Then SetMeasureVars() End If - RaiseEvent SelectionChanged() - + OnSelectionChanged() End Sub Private Sub ucrSingleVariable_SelectionChanged(sender As Object, e As EventArgs) Handles ucrSingleVariable.SelectionChanged - RaiseEvent SelectionChanged() - + OnSelectionChanged() End Sub - Public Function IsEmpty() As Boolean + Public Overrides Function IsEmpty() As Boolean If bSingleVariable Then Return ucrSingleVariable.IsEmpty() Else @@ -235,15 +208,15 @@ Public Class ucrVariablesAsFactor SetDefaults() End Sub - Public Sub Add(strVar As String) + Public Overrides Sub Add(strVar As String, Optional strDataFrame As String = "") If bSingleVariable Then - ucrSingleVariable.Add(strVar) + ucrSingleVariable.Add(strVar, strDataFrame) Else - ucrMultipleVariables.Add(strVar) + ucrMultipleVariables.Add(strVar, strDataFrame) End If End Sub - Public Sub Clear() + Public Overrides Sub Clear() If bSingleVariable Then ucrSingleVariable.Clear() Else @@ -275,7 +248,7 @@ Public Class ucrVariablesAsFactor End If End Sub - Public Sub SetMeAsReceiver() + Public Overrides Sub SetMeAsReceiver() If ucrVariableSelector IsNot Nothing Then If bSingleVariable Then ucrSingleVariable.SetMeAsReceiver() @@ -285,17 +258,17 @@ Public Class ucrVariablesAsFactor End If End Sub - Public Sub SetParameterIsRFunction() + Public Overrides Sub SetParameterIsRFunction() ucrSingleVariable.SetParameterIsRFunction() ucrMultipleVariables.SetParameterIsRFunction() End Sub - Public Sub SetParameterIsString() + Public Overrides Sub SetParameterIsString() ucrSingleVariable.SetParameterIsString() ucrMultipleVariables.SetParameterIsString() End Sub - Public Sub UpdateParameter() + Public Overrides Sub UpdateParameter() End Sub From 7229964c1ee03ea06a73a4bcb208bca86c70ada5 Mon Sep 17 00:00:00 2001 From: Danny Parsons Date: Tue, 11 Apr 2017 11:12:32 +0100 Subject: [PATCH 59/66] updated vars as fact receiver and changed selector setting for receiver --- instat/dlgBoxPlot.vb | 4 +- instat/dlgCumulativeDistribution.vb | 4 +- instat/dlgDescribeTwoVarGraph.vb | 2 +- instat/dlgDotPlot.vb | 4 +- instat/dlgHistogram.vb | 4 +- instat/dlgPlot.vb | 4 +- instat/dlgRugPlot.vb | 4 +- instat/dlgScatterPlot.vb | 4 +- instat/ucrReceiver.vb | 19 +++-- instat/ucrReceiverSingle.vb | 2 +- instat/ucrVariablesAsFactor.vb | 121 +++++++++++++++++++--------- 11 files changed, 112 insertions(+), 60 deletions(-) diff --git a/instat/dlgBoxPlot.vb b/instat/dlgBoxPlot.vb index 033e64b5d57..8a242000b78 100644 --- a/instat/dlgBoxPlot.vb +++ b/instat/dlgBoxPlot.vb @@ -83,8 +83,8 @@ Public Class dlgBoxplot sdgPlots.SetGgplotFunction(clsRggplotFunction) ucrVariablesAsFactorForBoxplot.SetFactorReceiver(ucrByFactorsReceiver) - ucrVariablesAsFactorForBoxplot.SetSelector(ucrSelectorBoxPlot) - ucrVariablesAsFactorForBoxplot.SetIncludedDataType({"numeric"}) + ucrVariablesAsFactorForBoxplot.Selector = ucrSelectorBoxPlot + ucrVariablesAsFactorForBoxplot.SetIncludedDataTypes({"numeric"}) ucrSaveBoxplot.SetDataFrameSelector(ucrSelectorBoxPlot.ucrAvailableDataFrames) diff --git a/instat/dlgCumulativeDistribution.vb b/instat/dlgCumulativeDistribution.vb index 43a13411200..c540d37f84e 100644 --- a/instat/dlgCumulativeDistribution.vb +++ b/instat/dlgCumulativeDistribution.vb @@ -48,8 +48,8 @@ Public Class dlgCumulativeDistribution ucrVariablesAsFactorforCumDist.SetFactorReceiver(ucrFactorReceiver) - ucrVariablesAsFactorforCumDist.SetSelector(ucrCumDistSelector) - ucrVariablesAsFactorforCumDist.SetIncludedDataType({"numeric"}) + ucrVariablesAsFactorforCumDist.Selector = ucrCumDistSelector + ucrVariablesAsFactorforCumDist.SetIncludedDataTypes({"numeric"}) ucrSaveCumDist.SetDataFrameSelector(ucrCumDistSelector.ucrAvailableDataFrames) diff --git a/instat/dlgDescribeTwoVarGraph.vb b/instat/dlgDescribeTwoVarGraph.vb index 8d84b6105aa..36df9045ece 100644 --- a/instat/dlgDescribeTwoVarGraph.vb +++ b/instat/dlgDescribeTwoVarGraph.vb @@ -48,7 +48,7 @@ Public Class dlgDescribeTwoVarGraph ucrBase.clsRsyntax.SetOperation("+") clsRGGplotFunction.SetRCommand("ggplot") ucrBase.clsRsyntax.SetOperatorParameter(True, clsRFunc:=clsRGGplotFunction) - ucrReceiverMultipleTwoVar.SetSelector(ucrSelectorTwoVarGraph) + ucrReceiverMultipleTwoVar.Selector = ucrSelectorTwoVarGraph ucrReceiverMultipleTwoVar.SetSingleTypeStatus(True) ucrReceiverMultipleTwoVar.SetMultipleOnlyStatus(True) ucrSecondVariableReceiver.Selector = ucrSelectorTwoVarGraph diff --git a/instat/dlgDotPlot.vb b/instat/dlgDotPlot.vb index 68e96c7435b..d67a4b41896 100644 --- a/instat/dlgDotPlot.vb +++ b/instat/dlgDotPlot.vb @@ -55,8 +55,8 @@ Public Class dlgDotPlot 'The ucrVariablesAsFactorDotPlot could be called the ucrBinAxis in spirit. 'On the next line, the ucrOtherAxisReceiver receiver is used as the aesthetics to factor by when different variables are grouped into a single column in the multiple variables method. ucrVariablesAsFactorDotPlot.SetFactorReceiver(ucrOtherAxisReceiver) 'Could choose the ucrFactorReceiver for this purpose... - ucrVariablesAsFactorDotPlot.SetSelector(ucrDotPlotSelector) - ucrVariablesAsFactorDotPlot.SetIncludedDataType({"numeric", "factor"}) + ucrVariablesAsFactorDotPlot.Selector = ucrDotPlotSelector + ucrVariablesAsFactorDotPlot.SetIncludedDataTypes({"numeric", "factor"}) ucrBase.iHelpTopicID = 437 ucrSaveDotPlot.SetDataFrameSelector(ucrDotPlotSelector.ucrAvailableDataFrames) diff --git a/instat/dlgHistogram.vb b/instat/dlgHistogram.vb index d756dffa0c4..c8eb45269e5 100644 --- a/instat/dlgHistogram.vb +++ b/instat/dlgHistogram.vb @@ -52,8 +52,8 @@ Public Class dlgHistogram ucrVariablesAsFactorforHist.SetFactorReceiver(ucrFactorReceiver) - ucrVariablesAsFactorforHist.SetSelector(ucrHistogramSelector) - ucrVariablesAsFactorforHist.SetIncludedDataType({"numeric"}) + ucrVariablesAsFactorforHist.Selector = ucrHistogramSelector + ucrVariablesAsFactorforHist.SetIncludedDataTypes({"numeric"}) ucrSaveHist.SetDataFrameSelector(ucrHistogramSelector.ucrAvailableDataFrames) ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False diff --git a/instat/dlgPlot.vb b/instat/dlgPlot.vb index 0e29809255e..fe1028dd45b 100644 --- a/instat/dlgPlot.vb +++ b/instat/dlgPlot.vb @@ -59,8 +59,8 @@ Public Class dlgPlot ucrVariablesAsFactorForLinePlot.SetFactorReceiver(ucrFactorOptionalReceiver) - ucrVariablesAsFactorForLinePlot.SetSelector(ucrLinePlotSelector) - ucrVariablesAsFactorForLinePlot.SetIncludedDataType({"numeric", "factor"}) + ucrVariablesAsFactorForLinePlot.Selector = ucrLinePlotSelector + ucrVariablesAsFactorForLinePlot.SetIncludedDataTypes({"numeric", "factor"}) ucrSaveLinePlot.SetDataFrameSelector(ucrLinePlotSelector.ucrAvailableDataFrames) ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False diff --git a/instat/dlgRugPlot.vb b/instat/dlgRugPlot.vb index 8053ef3d438..68617ce9d20 100644 --- a/instat/dlgRugPlot.vb +++ b/instat/dlgRugPlot.vb @@ -68,8 +68,8 @@ Public Class dlgRugPlot ucrRugPlotSelector.SetParameterIsrfunction() ucrVariablesAsFactorForRugPlot.SetFactorReceiver(ucrFactorOptionalReceiver) - ucrVariablesAsFactorForRugPlot.SetSelector(ucrRugPlotSelector) - ucrVariablesAsFactorForRugPlot.SetIncludedDataType({"factor", "numeric"}) + ucrVariablesAsFactorForRugPlot.Selector = ucrRugPlotSelector + ucrVariablesAsFactorForRugPlot.SetIncludedDataTypes({"factor", "numeric"}) ucrVariablesAsFactorForRugPlot.SetParameter(New RParameter("y")) ucrVariablesAsFactorForRugPlot.bWithQuotes = False ucrVariablesAsFactorForRugPlot.SetParameterIsString() diff --git a/instat/dlgScatterPlot.vb b/instat/dlgScatterPlot.vb index d675417fb9c..cfd32fe5a44 100644 --- a/instat/dlgScatterPlot.vb +++ b/instat/dlgScatterPlot.vb @@ -47,8 +47,8 @@ Public Class dlgScatterPlot ucrBase.clsRsyntax.SetOperatorParameter(False, clsRFunc:=clsRgeom_scatterplotFunction) ucrVariablesAsFactorForScatter.SetFactorReceiver(ucrFactorOptionalReceiver) - ucrVariablesAsFactorForScatter.SetSelector(ucrSelectorForScatter) - ucrVariablesAsFactorForScatter.SetIncludedDataType({"factor", "numeric"}) + ucrVariablesAsFactorForScatter.Selector = ucrSelectorForScatter + ucrVariablesAsFactorForScatter.SetIncludedDataTypes({"factor", "numeric"}) ucrReceiverX.Selector = ucrSelectorForScatter ucrReceiverX.SetIncludedDataTypes({"factor", "numeric"}) diff --git a/instat/ucrReceiver.vb b/instat/ucrReceiver.vb index 439f355692d..ffa8fc1d065 100644 --- a/instat/ucrReceiver.vb +++ b/instat/ucrReceiver.vb @@ -17,7 +17,7 @@ Imports instat Imports instat.Translations Public Class ucrReceiver - Public WithEvents Selector As ucrSelector + Public WithEvents ucrSelector As ucrSelector Public lstIncludedMetadataProperties As List(Of KeyValuePair(Of String, String())) Public lstExcludedMetadataProperties As List(Of KeyValuePair(Of String, String())) Public bFirstLoad As Boolean @@ -34,11 +34,11 @@ Public Class ucrReceiver Public bAddParameterIfEmpty As Boolean = False 'If the control is used to set a parameter that is a string i.e. column = "ID" - Private bParameterIsString As Boolean = False + Protected bParameterIsString As Boolean = False 'If the control is used to set a parameter that is an RFunction i.e. x = InstatDataObject$get_columns_from_data() - Private bParameterIsRFunction As Boolean = False + Protected bParameterIsRFunction As Boolean = False 'The name of the data parameter in the get columns instat object method (should always be the same) - Private strColumnsParameterNameInRFunction As String = "col_names" + Protected strColumnsParameterNameInRFunction As String = "col_names" 'Should quotes be used when bParameterIsString = False Public bWithQuotes As Boolean = True @@ -276,7 +276,7 @@ Public Class ucrReceiver End If End Sub - Protected Overridable Sub Selector_ResetAll() Handles Selector.ResetReceivers + Protected Overridable Sub Selector_ResetAll() Handles ucrSelector.ResetReceivers Clear() End Sub @@ -388,4 +388,13 @@ Public Class ucrReceiver Public Sub SetClimaticType(strTemp As String) AddIncludedMetadataProperty("Climatic_Type", {Chr(34) & strTemp & Chr(34)}) End Sub + + Public Overridable Property Selector As ucrSelector + Get + Return ucrSelector + End Get + Set(ucrNewSelector As ucrSelector) + ucrSelector = ucrNewSelector + End Set + End Property End Class \ No newline at end of file diff --git a/instat/ucrReceiverSingle.vb b/instat/ucrReceiverSingle.vb index 86ff1c678f3..5e1d70d2a0a 100644 --- a/instat/ucrReceiverSingle.vb +++ b/instat/ucrReceiverSingle.vb @@ -248,7 +248,7 @@ Public Class ucrReceiverSingle MyBase.UpdateControl(bReset) End Sub - Private Sub Selector_DataFrameChanged() Handles Selector.DataFrameChanged + Private Sub Selector_DataFrameChanged() Handles ucrSelector.DataFrameChanged CheckAutoFill() End Sub diff --git a/instat/ucrVariablesAsFactor.vb b/instat/ucrVariablesAsFactor.vb index 6adf1c8a56d..41de7d8f667 100644 --- a/instat/ucrVariablesAsFactor.vb +++ b/instat/ucrVariablesAsFactor.vb @@ -2,9 +2,10 @@ Public Class ucrVariablesAsFactor Public bSingleVariable As Boolean - Public ucrFactorReceiver As ucrReceiverSingle - 'The ucrVariablesAsFactor has an associated ucrFactorReceiver, set on the dialog it is living in. In multiple mode, the ucrVariablesAsFactor can receive multiple variables that are then stacked in one and distinguished using a factor variable called "variable". The associated factor receiver will then be set in StackedFactorMode and fix it's content to this "variable" factor. + Public ucrFactorReceiver As ucrReceiverSingle Public WithEvents ucrVariableSelector As ucrSelectorByDataFrame + + 'The ucrVariablesAsFactor has an associated ucrFactorReceiver, set on the dialog it is living in. In multiple mode, the ucrVariablesAsFactor can receive multiple variables that are then stacked in one and distinguished using a factor variable called "variable". The associated factor receiver will then be set in StackedFactorMode and fix it's content to this "variable" factor. Public Sub New() ' This call is required by the designer. @@ -35,11 +36,6 @@ Public Class ucrVariablesAsFactor ucrFactorReceiver = ucrReceiverToSet End Sub - Public Sub SetSelector(ucrSelectorToSet As ucrSelectorByDataFrame) - Selector = ucrSelectorToSet - End Sub - - Private Sub cmdVariables_Click(sender As Object, e As EventArgs) Handles cmdVariables.Click 'Switching from single to multiple receiver. bSingleVariable = Not bSingleVariable @@ -52,6 +48,7 @@ Public Class ucrVariablesAsFactor 'This sub provides the name of the variable that should be used by external components that want to access the "content" of this receiver. If it is in single mode, this is simply providing the name of the variable in use. 'However in multiple mode, a New variable will be created using the "stack" And "measure.vars" explained in SetReceiverStatus. Dim strVariablesToStack As String = "" + If bSingleVariable Then strVariablesToStack = ucrSingleVariable.GetVariableNames(bWithQuotes) Else @@ -66,6 +63,7 @@ Public Class ucrVariablesAsFactor 'Warning: The two following subs seem obsolete. Public Function GetStackedVariableNames(Optional bWithQuotes As Boolean = True) As String Dim strVariablesToStack As String = "" + If Not bSingleVariable Then strVariablesToStack = ucrMultipleVariables.GetVariableNames(bWithQuotes) End If @@ -74,21 +72,21 @@ Public Class ucrVariablesAsFactor Public Overrides Function GetVariables(Optional bForceAsDataFrame As Boolean = False) As RFunction Dim clsVariables As New RFunction + If bSingleVariable Then clsVariables = ucrSingleVariable.GetVariables(bForceAsDataFrame) Else - 'TODO fix this case if needed - 'clsVariables = ucrMultipleVariables.GetVariables(bForceAsDataFrame) + clsVariables = ucrMultipleVariables.GetVariables(bForceAsDataFrame) End If Return clsVariables End Function Public Function GetIDVarNamesFromSelector(Optional bWithQuotes As Boolean = True) As String Dim strIDVars As String - Dim arrTemp(ucrVariableSelector.lstVariablesInReceivers.Count - 1) As String + Dim arrTemp(Selector.lstVariablesInReceivers.Count - 1) As String Dim lstVariablesFromSelector As List(Of String) - Array.Copy(ucrVariableSelector.lstVariablesInReceivers.ToArray, arrTemp, arrTemp.Length) + Array.Copy(Selector.lstVariablesInReceivers.ToArray, arrTemp, arrTemp.Length) lstVariablesFromSelector = arrTemp.ToList() For i = 0 To ucrMultipleVariables.lstSelectedVariables.Items.Count - 1 @@ -158,12 +156,10 @@ Public Class ucrVariablesAsFactor ucrVariableSelector.ucrAvailableDataFrames.clsCurrDataFrame.RemoveParameterByName("measure.vars") ucrVariableSelector.ucrAvailableDataFrames.clsCurrDataFrame.RemoveParameterByName("id.vars") End If - ucrSingleVariable.SetMeAsReceiver() - If clsParameter Is Nothing Then - 'Update parameter here - clsParameter = New RParameter - clsParameter.SetArgumentValue(ucrSingleVariable.GetVariableNames()) + If ucrFactorReceiver IsNot Nothing Then + ucrFactorReceiver.SetStackedFactorMode(False) End If + ucrSingleVariable.SetMeAsReceiver() Else ucrSingleVariable.Visible = False ucrMultipleVariables.Visible = True @@ -177,12 +173,8 @@ Public Class ucrVariablesAsFactor ucrVariableSelector.ucrAvailableDataFrames.clsCurrDataFrame.AddParameter("id.vars", GetIDVarNamesFromSelector()) End If ucrMultipleVariables.SetMeAsReceiver() - If clsParameter Is Nothing Then - 'Update parameter here - clsParameter = New RParameter - clsParameter.SetArgumentValue(ucrMultipleVariables.GetVariableNames()) - End If End If + OnControlValueChanged() End Sub Private Sub ucrVariableSelector_VariablesInReceiversChanged() Handles ucrVariableSelector.VariablesInReceiversChanged @@ -249,7 +241,7 @@ Public Class ucrVariablesAsFactor End Sub Public Overrides Sub SetMeAsReceiver() - If ucrVariableSelector IsNot Nothing Then + If Selector IsNot Nothing Then If bSingleVariable Then ucrSingleVariable.SetMeAsReceiver() Else @@ -258,25 +250,76 @@ Public Class ucrVariablesAsFactor End If End Sub - Public Overrides Sub SetParameterIsRFunction() - ucrSingleVariable.SetParameterIsRFunction() - ucrMultipleVariables.SetParameterIsRFunction() - End Sub - - Public Overrides Sub SetParameterIsString() - ucrSingleVariable.SetParameterIsString() - ucrMultipleVariables.SetParameterIsString() - End Sub + Protected Overrides Sub SetControlValue() + Dim clsTempDataParameter As RParameter + Dim lstCurrentVariables As String() = Nothing + Dim lstMeasureVars As String() = Nothing + Dim clsTempParameter As RParameter + Dim clsTempRCode As RCodeStructure + Dim clsMeasureVarsParam As RParameter - Public Overrides Sub UpdateParameter() + clsTempParameter = GetParameter() + clsTempRCode = GetRCode() - End Sub - - Public Overrides Sub SetRCode(clsNewCodeStructure As RCodeStructure, Optional bReset As Boolean = False) - If bSingleVariable Then - ucrSingleVariable.SetRCode(clsNewCodeStructure, bReset) - Else - ucrMultipleVariables.SetRCode(clsNewCodeStructure, bReset) + If clsTempParameter IsNot Nothing Then + If bChangeParameterValue Then + If bParameterIsString AndAlso clsTempParameter.bIsString Then + If strValuesToIgnore Is Nothing OrElse (Not strValuesToIgnore.Contains(clsTempParameter.strArgumentValue)) Then + lstCurrentVariables = ExtractItemsFromRList(clsTempParameter.strArgumentValue) + End If + ElseIf bParameterIsRFunction AndAlso clsTempParameter.bIsFunction Then + clsTempDataParameter = clsTempParameter.clsArgumentCodeStructure.GetParameter(strColumnsParameterNameInRFunction) + If clsTempDataParameter IsNot Nothing Then + lstCurrentVariables = ExtractItemsFromRList(clsTempParameter.clsArgumentCodeStructure.GetParameter(strColumnsParameterNameInRFunction).strArgumentValue) + End If + End If + Clear() + If lstCurrentVariables IsNot Nothing Then + If lstCurrentVariables.Count = 1 Then + If lstCurrentVariables(0) = "value" Then + bSingleVariable = False + If clsTempRCode.ContainsParameter("data") Then + clsMeasureVarsParam = clsTempRCode.GetParameter("data").clsArgumentCodeStructure.GetParameter("measure.vars") + If clsMeasureVarsParam IsNot Nothing Then + lstMeasureVars = ExtractItemsFromRList(clsMeasureVarsParam.strArgumentValue) + End If + If lstMeasureVars IsNot Nothing Then + For Each strTemp As String In lstMeasureVars + 'TODO This only works if the selector is updated before receivers! + ' Needs to change eventually. + If Selector IsNot Nothing AndAlso strTemp <> "" Then + ucrMultipleVariables.Add(strTemp, Selector.strCurrentDataFrame) + End If + Next + End If + End If + Else + bSingleVariable = True + If Selector IsNot Nothing Then + ucrSingleVariable.Add(lstCurrentVariables(0), Selector.strCurrentDataFrame) + End If + End If + Else + MsgBox("Developer error: Only expected one item for ucrVariablesAsFactor parameter. It must be either a single column or 'value' when multiple columns.") + End If + End If + End If End If + SetReceiverStatus() End Sub + + Public Overrides Property Selector As ucrSelector + Get + Return MyBase.Selector + End Get + Set(ucrNewSelector As ucrSelector) + MyBase.Selector = ucrNewSelector + ucrSingleVariable.Selector = ucrNewSelector + ucrMultipleVariables.Selector = ucrNewSelector + ucrVariableSelector = TryCast(ucrNewSelector, ucrSelectorByDataFrame) + If ucrVariableSelector Is Nothing Then + MsgBox("Developer error: ucrVariablesAsFactor must be associated with a ucrSelectorByDataFrame not a base ucrSelector.") + End If + End Set + End Property End Class \ No newline at end of file From b272333ab1f78ff6dc7600cc4f32e9fc1b08ab70 Mon Sep 17 00:00:00 2001 From: Danny Parsons Date: Tue, 11 Apr 2017 13:02:49 +0100 Subject: [PATCH 60/66] converted scatter plot to new system --- instat/dlgBoxPlot.vb | 1 - instat/dlgCumulativeDistribution.vb | 1 - instat/dlgDotPlot.vb | 1 - instat/dlgHistogram.vb | 1 - instat/dlgPlot.vb | 1 - instat/dlgRugPlot.vb | 1 - instat/dlgScatterPlot.vb | 162 ++++++++++++++++------------ instat/ucrVariablesAsFactor.vb | 29 ++--- 8 files changed, 112 insertions(+), 85 deletions(-) diff --git a/instat/dlgBoxPlot.vb b/instat/dlgBoxPlot.vb index 8a242000b78..f4c6c4e194a 100644 --- a/instat/dlgBoxPlot.vb +++ b/instat/dlgBoxPlot.vb @@ -47,7 +47,6 @@ Public Class dlgBoxplot clsRgeom_boxplotFunction.ClearParameters() ucrSelectorBoxPlot.Reset() ucrSelectorBoxPlot.Focus() - ucrVariablesAsFactorForBoxplot.ResetControl() ucrSaveBoxplot.strPrefix = "Boxplot" chkHorizontalBoxplot.Checked = False chkVarwidth.Checked = False diff --git a/instat/dlgCumulativeDistribution.vb b/instat/dlgCumulativeDistribution.vb index c540d37f84e..8398856cef0 100644 --- a/instat/dlgCumulativeDistribution.vb +++ b/instat/dlgCumulativeDistribution.vb @@ -62,7 +62,6 @@ Public Class dlgCumulativeDistribution ucrSaveCumDist.strPrefix = "Graph" ucrCumDistSelector.Reset() ucrCumDistSelector.Focus() - ucrVariablesAsFactorforCumDist.ResetControl() chkCountsOnYAxis.Checked = False chkExceedancePlots.Checked = True chkIncludePoints.Checked = False diff --git a/instat/dlgDotPlot.vb b/instat/dlgDotPlot.vb index d67a4b41896..91640693f45 100644 --- a/instat/dlgDotPlot.vb +++ b/instat/dlgDotPlot.vb @@ -79,7 +79,6 @@ Public Class dlgDotPlot clsRgeom_dotplot.ClearParameters() ucrDotPlotSelector.Reset() ucrSaveDotPlot.strPrefix = "Dotplot" - ucrVariablesAsFactorDotPlot.ResetControl() ucrSaveDotPlot.Reset() sdgPlots.Reset() rdoXBinAxis.Checked = True 'If it was already True, no need to change anything, else it will raise event rdoBinAxis_CheckChanged diff --git a/instat/dlgHistogram.vb b/instat/dlgHistogram.vb index c8eb45269e5..4399ad36495 100644 --- a/instat/dlgHistogram.vb +++ b/instat/dlgHistogram.vb @@ -133,7 +133,6 @@ Public Class dlgHistogram clsRgeom_FPolygon.ClearParameters() clsRgeom_histogramFunction.ClearParameters() ucrHistogramSelector.Reset() - ucrVariablesAsFactorforHist.ResetControl() rdoHistogram.Checked = True cmdHistogramOptions.Visible = True cmdDensityOptions.Visible = False diff --git a/instat/dlgPlot.vb b/instat/dlgPlot.vb index fe1028dd45b..f5c131a3dfe 100644 --- a/instat/dlgPlot.vb +++ b/instat/dlgPlot.vb @@ -75,7 +75,6 @@ Public Class dlgPlot ucrSaveLinePlot.strPrefix = "Line" ucrVariablesAsFactorForLinePlot.SetMeAsReceiver() ucrLinePlotSelector.Reset() - ucrVariablesAsFactorForLinePlot.ResetControl() ucrSaveLinePlot.Reset() sdgPlots.Reset() SetXParameter() diff --git a/instat/dlgRugPlot.vb b/instat/dlgRugPlot.vb index 68617ce9d20..ac339d82444 100644 --- a/instat/dlgRugPlot.vb +++ b/instat/dlgRugPlot.vb @@ -102,7 +102,6 @@ Public Class dlgRugPlot ucrSaveGraph.Reset() ucrRugPlotSelector.Reset() - ucrVariablesAsFactorForRugPlot.ResetControl() clsRaesFunction.ClearParameters() clsRgeom_RugPlotFunction.ClearParameters() diff --git a/instat/dlgScatterPlot.vb b/instat/dlgScatterPlot.vb index cfd32fe5a44..57e76277263 100644 --- a/instat/dlgScatterPlot.vb +++ b/instat/dlgScatterPlot.vb @@ -1,5 +1,4 @@ - -' Instat-R +' Instat-R ' Copyright (C) 2015 ' ' This program is free software: you can redistribute it and/or modify @@ -15,100 +14,128 @@ ' 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 dlgScatterPlot Private clsRggplotFunction As New RFunction - Private clsRgeom_scatterplotFunction As New RFunction + Private clsRScatterGeomFunction As New RFunction Private clsRaesFunction As New RFunction + Private clsBaseOperator As New ROperator Private bFirstLoad As Boolean = True + Private bReset As Boolean = True Private Sub dlgScatterPlot_Load(sender As Object, e As EventArgs) Handles MyBase.Load - If bFirstLoad Then + autoTranslate(Me) + If bFirstLoad Then InitialiseDialog() - 'setdefauts - SetDefaults() bFirstLoad = False End If - autoTranslate(Me) + If bReset Then + SetDefaults() + End If + SetRCodeForControls(bReset) + bReset = False TestOkEnabled() - End Sub Private Sub InitialiseDialog() - ucrBase.clsRsyntax.SetOperation("+") - clsRggplotFunction.SetRCommand("ggplot") - clsRggplotFunction.SetPackageName("ggplot2") - clsRaesFunction.SetRCommand("aes") - clsRaesFunction.SetPackageName("ggplot2") - clsRggplotFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesFunction) - ucrBase.clsRsyntax.SetOperatorParameter(True, clsRFunc:=clsRggplotFunction) + ucrBase.iHelpTopicID = 433 - clsRgeom_scatterplotFunction.SetRCommand("geom_point") - clsRgeom_scatterplotFunction.SetPackageName("ggplot2") - ucrBase.clsRsyntax.SetOperatorParameter(False, clsRFunc:=clsRgeom_scatterplotFunction) + ucrSelectorForScatter.SetParameter(New RParameter("data", 0)) + ucrSelectorForScatter.SetParameterIsrfunction() - ucrVariablesAsFactorForScatter.SetFactorReceiver(ucrFactorOptionalReceiver) + ucrVariablesAsFactorForScatter.SetParameter(New RParameter("y", 1)) + ucrVariablesAsFactorForScatter.SetParameterIsString() + ucrVariablesAsFactorForScatter.bWithQuotes = False ucrVariablesAsFactorForScatter.Selector = ucrSelectorForScatter + ucrVariablesAsFactorForScatter.SetFactorReceiver(ucrFactorOptionalReceiver) ucrVariablesAsFactorForScatter.SetIncludedDataTypes({"factor", "numeric"}) + ucrReceiverX.SetParameter(New RParameter("x", 0)) + ucrReceiverX.SetParameterIsString() + ucrReceiverX.bWithQuotes = False ucrReceiverX.Selector = ucrSelectorForScatter ucrReceiverX.SetIncludedDataTypes({"factor", "numeric"}) + + ucrFactorOptionalReceiver.SetParameter(New RParameter("colour", 2)) + ucrFactorOptionalReceiver.SetParameterIsString() + ucrFactorOptionalReceiver.bWithQuotes = False ucrFactorOptionalReceiver.Selector = ucrSelectorForScatter ucrFactorOptionalReceiver.SetIncludedDataTypes({"factor", "numeric"}) sdgPlots.SetRSyntax(ucrBase.clsRsyntax) - ucrBase.iHelpTopicID = 433 ucrSaveScatterPlot.SetDataFrameSelector(ucrSelectorForScatter.ucrAvailableDataFrames) + ucrSaveScatterPlot.strPrefix = "Scatter" + ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False ucrBase.clsRsyntax.iCallType = 3 - End Sub + Private Sub SetDefaults() - 'setDefaults - ucrSaveScatterPlot.strPrefix = "Scatter" - clsRaesFunction.ClearParameters() - clsRgeom_scatterplotFunction.ClearParameters() + clsBaseOperator = New ROperator + clsRggplotFunction = New RFunction + clsRScatterGeomFunction = New RFunction + clsRaesFunction = New RFunction + ucrSelectorForScatter.Reset() - ucrSelectorForScatter.Focus() - ucrVariablesAsFactorForScatter.ResetControl() - sdgPlots.Reset() - ucrSaveScatterPlot.Reset() - SetXParameter() - SetYParameter() - TestOkEnabled() - End Sub - Private Sub ucrSelectorForScatter_DataFrameChanged() Handles ucrSelectorForScatter.DataFrameChanged - clsRggplotFunction.AddParameter("data", clsRFunctionParameter:=ucrSelectorForScatter.ucrAvailableDataFrames.clsCurrDataFrame) - End Sub - Private Sub SetXParameter() - If Not ucrReceiverX.IsEmpty Then - clsRaesFunction.AddParameter("x", ucrReceiverX.GetVariableNames(False)) - Else - clsRaesFunction.AddParameter("x", Chr(34) & Chr(34)) - End If - End Sub + clsBaseOperator.SetOperation("+") + clsBaseOperator.AddParameter("ggplot", clsRFunctionParameter:=clsRggplotFunction, iPosition:=0) + clsBaseOperator.AddParameter("scatter", clsRFunctionParameter:=clsRScatterGeomFunction) - Private Sub SetYParameter() - If Not ucrVariablesAsFactorForScatter.IsEmpty Then - clsRaesFunction.AddParameter("y", ucrVariablesAsFactorForScatter.GetVariableNames(False)) - Else - clsRaesFunction.AddParameter("y", Chr(34) & Chr(34)) - End If - End Sub - Private Sub ucrReceiverX_SelectionChanged(sender As Object, e As EventArgs) Handles ucrReceiverX.SelectionChanged - SetXParameter() - TestOkEnabled() + clsRggplotFunction.SetPackageName("ggplot2") + clsRggplotFunction.SetRCommand("ggplot") + clsRggplotFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesFunction, iPosition:=1) + + clsRaesFunction.SetPackageName("ggplot2") + clsRaesFunction.SetRCommand("aes") + + clsRScatterGeomFunction.SetRCommand("geom_point") + clsRScatterGeomFunction.SetPackageName("ggplot2") + + sdgPlots.Reset() + ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) End Sub - Private Sub ucrFactorOptionalReceiver_SelectionChanged(sender As Object, e As EventArgs) Handles ucrFactorOptionalReceiver.SelectionChanged - If Not ucrFactorOptionalReceiver.IsEmpty Then - clsRaesFunction.AddParameter("colour", ucrFactorOptionalReceiver.GetVariableNames(False)) - Else - clsRaesFunction.RemoveParameterByName("colour") - End If + Public Sub SetRCodeForControls(bReset As Boolean) + ucrSelectorForScatter.SetRCode(clsRggplotFunction, bReset) + ucrReceiverX.SetRCode(clsRaesFunction, bReset) + ucrVariablesAsFactorForScatter.SetRCode(clsRaesFunction, bReset) + ucrFactorOptionalReceiver.SetRCode(clsRaesFunction, bReset) End Sub + 'Private Sub ucrSelectorForScatter_DataFrameChanged() Handles ucrSelectorForScatter.DataFrameChanged + ' clsRggplotFunction.AddParameter("data", clsRFunctionParameter:=ucrSelectorForScatter.ucrAvailableDataFrames.clsCurrDataFrame) + 'End Sub + + 'Private Sub SetXParameter() + ' If Not ucrReceiverX.IsEmpty Then + ' clsRaesFunction.AddParameter("x", ucrReceiverX.GetVariableNames(False)) + ' Else + ' clsRaesFunction.AddParameter("x", Chr(34) & Chr(34)) + ' End If + 'End Sub + + 'Private Sub SetYParameter() + ' If Not ucrVariablesAsFactorForScatter.IsEmpty Then + ' clsRaesFunction.AddParameter("y", ucrVariablesAsFactorForScatter.GetVariableNames(False)) + ' Else + ' clsRaesFunction.AddParameter("y", Chr(34) & Chr(34)) + ' End If + 'End Sub + 'Private Sub ucrReceiverX_SelectionChanged(sender As Object, e As EventArgs) Handles ucrReceiverX.SelectionChanged + ' SetXParameter() + ' TestOkEnabled() + 'End Sub + + 'Private Sub ucrFactorOptionalReceiver_SelectionChanged(sender As Object, e As EventArgs) Handles ucrFactorOptionalReceiver.SelectionChanged + ' If Not ucrFactorOptionalReceiver.IsEmpty Then + ' clsRaesFunction.AddParameter("colour", ucrFactorOptionalReceiver.GetVariableNames(False)) + ' Else + ' clsRaesFunction.RemoveParameterByName("colour") + ' End If + 'End Sub + Private Sub TestOkEnabled() 'tests when okay Is enable. Both x and y aesthetics are mandatory but can be set to x="" or(exclusive) y="" in case the other one is filled. If (ucrReceiverX.IsEmpty() AndAlso ucrVariablesAsFactorForScatter.IsEmpty) OrElse (ucrSaveScatterPlot.chkSaveGraph.Checked AndAlso ucrSaveScatterPlot.ucrInputGraphName.IsEmpty) Then @@ -118,9 +145,10 @@ Public Class dlgScatterPlot 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 cmdOptions_Click(sender As Object, e As EventArgs) Handles cmdOptions.Click @@ -128,14 +156,14 @@ Public Class dlgScatterPlot sdgPlots.ShowDialog() End Sub - Private Sub ucrVariablesAsFactor_SelectionChanged() Handles ucrVariablesAsFactorForScatter.SelectionChanged - SetYParameter() - TestOkEnabled() - End Sub + 'Private Sub ucrVariablesAsFactor_SelectionChanged() Handles ucrVariablesAsFactorForScatter.SelectionChanged + ' SetYParameter() + ' TestOkEnabled() + 'End Sub Private Sub cmdScatterPlotOptions_Click(sender As Object, e As EventArgs) Handles cmdScatterPlotOptions.Click 'SetupLayer sends the components storing the plot info (clsRaesFunction, clsRggplotFunction, ...) of dlgScatteredPlot through to sdgLayerOptions where these will be edited. - sdgLayerOptions.SetupLayer(clsTempGgPlot:=clsRggplotFunction, clsTempGeomFunc:=clsRgeom_scatterplotFunction, clsTempAesFunc:=clsRaesFunction, bFixAes:=True, bFixGeom:=True, strDataframe:=ucrSelectorForScatter.ucrAvailableDataFrames.cboAvailableDataFrames.Text, bApplyAesGlobally:=True, bIgnoreGlobalAes:=False) + sdgLayerOptions.SetupLayer(clsTempGgPlot:=clsRggplotFunction, clsTempGeomFunc:=clsRScatterGeomFunction, clsTempAesFunc:=clsRaesFunction, bFixAes:=True, bFixGeom:=True, strDataframe:=ucrSelectorForScatter.ucrAvailableDataFrames.cboAvailableDataFrames.Text, bApplyAesGlobally:=True, bIgnoreGlobalAes:=False) sdgLayerOptions.ShowDialog() 'Coming from the sdgLayerOptions, clsRaesFunction and others has been modified. One then needs to display these modifications on the dlgScatteredPlot. @@ -161,7 +189,7 @@ Public Class dlgScatterPlot Next End Sub - Private Sub ucrSaveScatterPlot_GraphNameChanged() Handles ucrSaveScatterPlot.GraphNameChanged, ucrSaveScatterPlot.SaveGraphCheckedChanged + Private Sub ucrsavescatterplot_graphnamechanged() Handles ucrSaveScatterPlot.GraphNameChanged, ucrSaveScatterPlot.SaveGraphCheckedChanged If ucrSaveScatterPlot.bSaveGraph Then ucrBase.clsRsyntax.SetAssignTo(ucrSaveScatterPlot.strGraphName, strTempDataframe:=ucrSelectorForScatter.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:=ucrSaveScatterPlot.strGraphName) Else @@ -170,7 +198,7 @@ Public Class dlgScatterPlot TestOkEnabled() End Sub - Private Sub ucrSaveScatterPlot_ContentsChanged() Handles ucrSaveScatterPlot.ContentsChanged + Private Sub ucrSaveScatterPlot_ContentsChanged() Handles ucrSaveScatterPlot.ContentsChanged, ucrReceiverX.ControlContentsChanged, ucrVariablesAsFactorForScatter.ControlContentsChanged TestOkEnabled() End Sub End Class \ No newline at end of file diff --git a/instat/ucrVariablesAsFactor.vb b/instat/ucrVariablesAsFactor.vb index 41de7d8f667..3e1af8913a2 100644 --- a/instat/ucrVariablesAsFactor.vb +++ b/instat/ucrVariablesAsFactor.vb @@ -47,17 +47,21 @@ Public Class ucrVariablesAsFactor Public Overrides Function GetVariableNames(Optional bWithQuotes As Boolean = True) As String 'This sub provides the name of the variable that should be used by external components that want to access the "content" of this receiver. If it is in single mode, this is simply providing the name of the variable in use. 'However in multiple mode, a New variable will be created using the "stack" And "measure.vars" explained in SetReceiverStatus. - Dim strVariablesToStack As String = "" + Dim strVariables As String = "" If bSingleVariable Then - strVariablesToStack = ucrSingleVariable.GetVariableNames(bWithQuotes) + strVariables = ucrSingleVariable.GetVariableNames(bWithQuotes) Else - If Not bWithQuotes Then - strVariablesToStack = "value" - Else strVariablesToStack = Chr(34) & "value" & Chr(34) + If ucrMultipleVariables.IsEmpty Then + strVariables = "" + Else + strVariables = "value" + If bWithQuotes Then + strVariables = Chr(34) & strVariables & Chr(34) + End If End If End If - Return strVariablesToStack + Return strVariables End Function 'Warning: The two following subs seem obsolete. @@ -194,11 +198,6 @@ Public Class ucrVariablesAsFactor ucrVariableSelector.ucrAvailableDataFrames.clsCurrDataFrame.RemoveParameterByName("measure.vars") End If End Sub - - Public Sub ResetControl() - 'this resets the ucrReceiverFactor - SetDefaults() - End Sub Public Overrides Sub Add(strVar As String, Optional strDataFrame As String = "") If bSingleVariable Then @@ -216,6 +215,12 @@ Public Class ucrVariablesAsFactor End If End Sub + Protected Overrides Sub Selector_ResetAll() + ucrSingleVariable.Clear() + ucrMultipleVariables.Clear() + 'SetDefaults() + End Sub + Public Sub SetSingleReceiverStatus(bSingle As Boolean) bSingleVariable = bSingle SetReceiverStatus() @@ -295,7 +300,7 @@ Public Class ucrVariablesAsFactor End If Else bSingleVariable = True - If Selector IsNot Nothing Then + If Selector IsNot Nothing AndAlso lstCurrentVariables(0) <> "" Then ucrSingleVariable.Add(lstCurrentVariables(0), Selector.strCurrentDataFrame) End If End If From e3ebf08a9a991c7e20a6cd622be9a8c00cbff312 Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Tue, 11 Apr 2017 15:13:33 +0300 Subject: [PATCH 61/66] created dlgString Handling --- instat/dlgStringHandling.Designer.vb | 261 +++++++++++++++++++++++++++ instat/dlgStringHandling.resx | 120 ++++++++++++ instat/dlgStringHandling.vb | 59 ++++++ 3 files changed, 440 insertions(+) create mode 100644 instat/dlgStringHandling.Designer.vb create mode 100644 instat/dlgStringHandling.resx create mode 100644 instat/dlgStringHandling.vb diff --git a/instat/dlgStringHandling.Designer.vb b/instat/dlgStringHandling.Designer.vb new file mode 100644 index 00000000000..41326a54c16 --- /dev/null +++ b/instat/dlgStringHandling.Designer.vb @@ -0,0 +1,261 @@ + _ +Partial Class dlgStringHandling + 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.ucrSelectorStringHandling = New instat.ucrSelectorByDataFrameAddRemove() + Me.ucrInputPattern = New instat.ucrInputTextBox() + Me.ucrSave = New instat.ucrSave() + Me.ucrInputReplaceBy = New instat.ucrInputTextBox() + Me.lblColumn = New System.Windows.Forms.Label() + Me.lblRepalceBy = New System.Windows.Forms.Label() + Me.lblPattern = New System.Windows.Forms.Label() + Me.ucrReceiverStringHandling = New instat.ucrReceiverSingle() + Me.rdoCount = New System.Windows.Forms.RadioButton() + Me.rdoReplace = New System.Windows.Forms.RadioButton() + Me.rdoLocate = New System.Windows.Forms.RadioButton() + Me.rdoExtract = New System.Windows.Forms.RadioButton() + Me.rdoDetect = New System.Windows.Forms.RadioButton() + Me.ucrPnlStringHandling = New instat.UcrPanel() + Me.SuspendLayout() + ' + 'ucrBase + ' + Me.ucrBase.Location = New System.Drawing.Point(10, 295) + Me.ucrBase.Name = "ucrBase" + Me.ucrBase.Size = New System.Drawing.Size(410, 52) + Me.ucrBase.TabIndex = 0 + ' + 'ucrSelectorStringHandling + ' + Me.ucrSelectorStringHandling.bShowHiddenColumns = False + Me.ucrSelectorStringHandling.bUseCurrentFilter = True + Me.ucrSelectorStringHandling.Location = New System.Drawing.Point(10, 55) + Me.ucrSelectorStringHandling.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectorStringHandling.Name = "ucrSelectorStringHandling" + Me.ucrSelectorStringHandling.Size = New System.Drawing.Size(210, 180) + Me.ucrSelectorStringHandling.TabIndex = 2 + ' + 'ucrInputPattern + ' + Me.ucrInputPattern.AddQuotesIfUnrecognised = True + Me.ucrInputPattern.IsMultiline = False + Me.ucrInputPattern.IsReadOnly = False + Me.ucrInputPattern.Location = New System.Drawing.Point(240, 142) + Me.ucrInputPattern.Name = "ucrInputPattern" + Me.ucrInputPattern.Size = New System.Drawing.Size(137, 21) + Me.ucrInputPattern.TabIndex = 4 + ' + 'ucrSave + ' + Me.ucrSave.Location = New System.Drawing.Point(10, 260) + Me.ucrSave.Name = "ucrSave" + Me.ucrSave.Size = New System.Drawing.Size(406, 24) + Me.ucrSave.TabIndex = 5 + ' + 'ucrInputReplaceBy + ' + Me.ucrInputReplaceBy.AddQuotesIfUnrecognised = True + Me.ucrInputReplaceBy.IsMultiline = False + Me.ucrInputReplaceBy.IsReadOnly = False + Me.ucrInputReplaceBy.Location = New System.Drawing.Point(241, 192) + Me.ucrInputReplaceBy.Name = "ucrInputReplaceBy" + Me.ucrInputReplaceBy.Size = New System.Drawing.Size(137, 21) + Me.ucrInputReplaceBy.TabIndex = 6 + ' + 'lblColumn + ' + Me.lblColumn.AutoSize = True + Me.lblColumn.Location = New System.Drawing.Point(237, 78) + Me.lblColumn.Name = "lblColumn" + Me.lblColumn.Size = New System.Drawing.Size(42, 13) + Me.lblColumn.TabIndex = 7 + Me.lblColumn.Text = "Column" + ' + 'lblRepalceBy + ' + Me.lblRepalceBy.AutoSize = True + Me.lblRepalceBy.Location = New System.Drawing.Point(238, 176) + Me.lblRepalceBy.Name = "lblRepalceBy" + Me.lblRepalceBy.Size = New System.Drawing.Size(59, 13) + Me.lblRepalceBy.TabIndex = 8 + Me.lblRepalceBy.Text = "ReplaceBy" + ' + 'lblPattern + ' + Me.lblPattern.AutoSize = True + Me.lblPattern.Location = New System.Drawing.Point(238, 126) + Me.lblPattern.Name = "lblPattern" + Me.lblPattern.Size = New System.Drawing.Size(41, 13) + Me.lblPattern.TabIndex = 9 + Me.lblPattern.Text = "Pattern" + ' + 'ucrReceiverStringHandling + ' + Me.ucrReceiverStringHandling.frmParent = Me + Me.ucrReceiverStringHandling.Location = New System.Drawing.Point(240, 91) + Me.ucrReceiverStringHandling.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverStringHandling.Name = "ucrReceiverStringHandling" + Me.ucrReceiverStringHandling.Selector = Nothing + Me.ucrReceiverStringHandling.Size = New System.Drawing.Size(138, 20) + Me.ucrReceiverStringHandling.TabIndex = 10 + ' + 'rdoCount + ' + Me.rdoCount.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoCount.AutoSize = True + Me.rdoCount.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoCount.FlatAppearance.BorderSize = 2 + Me.rdoCount.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoCount.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoCount.Location = New System.Drawing.Point(102, 12) + Me.rdoCount.Name = "rdoCount" + Me.rdoCount.Size = New System.Drawing.Size(49, 27) + Me.rdoCount.TabIndex = 11 + Me.rdoCount.TabStop = True + Me.rdoCount.Text = "Count" + Me.rdoCount.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoCount.UseVisualStyleBackColor = True + ' + 'rdoReplace + ' + Me.rdoReplace.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoReplace.AutoSize = True + Me.rdoReplace.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoReplace.FlatAppearance.BorderSize = 2 + Me.rdoReplace.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoReplace.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoReplace.Location = New System.Drawing.Point(303, 12) + Me.rdoReplace.Name = "rdoReplace" + Me.rdoReplace.Size = New System.Drawing.Size(61, 27) + Me.rdoReplace.TabIndex = 12 + Me.rdoReplace.TabStop = True + Me.rdoReplace.Text = "Replace" + Me.rdoReplace.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoReplace.UseVisualStyleBackColor = True + ' + 'rdoLocate + ' + Me.rdoLocate.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoLocate.AutoSize = True + Me.rdoLocate.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoLocate.FlatAppearance.BorderSize = 2 + Me.rdoLocate.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoLocate.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoLocate.Location = New System.Drawing.Point(251, 12) + Me.rdoLocate.Name = "rdoLocate" + Me.rdoLocate.Size = New System.Drawing.Size(54, 27) + Me.rdoLocate.TabIndex = 13 + Me.rdoLocate.TabStop = True + Me.rdoLocate.Text = "Locate" + Me.rdoLocate.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoLocate.UseVisualStyleBackColor = True + ' + 'rdoExtract + ' + Me.rdoExtract.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoExtract.AutoSize = True + Me.rdoExtract.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoExtract.FlatAppearance.BorderSize = 2 + Me.rdoExtract.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoExtract.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoExtract.Location = New System.Drawing.Point(199, 12) + Me.rdoExtract.Name = "rdoExtract" + Me.rdoExtract.Size = New System.Drawing.Size(54, 27) + Me.rdoExtract.TabIndex = 14 + Me.rdoExtract.TabStop = True + Me.rdoExtract.Text = "Extract" + Me.rdoExtract.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoExtract.UseVisualStyleBackColor = True + ' + 'rdoDetect + ' + Me.rdoDetect.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoDetect.AutoSize = True + Me.rdoDetect.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoDetect.FlatAppearance.BorderSize = 2 + Me.rdoDetect.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoDetect.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoDetect.Location = New System.Drawing.Point(148, 12) + Me.rdoDetect.Name = "rdoDetect" + Me.rdoDetect.Size = New System.Drawing.Size(53, 27) + Me.rdoDetect.TabIndex = 15 + Me.rdoDetect.TabStop = True + Me.rdoDetect.Text = "Detect" + Me.rdoDetect.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoDetect.UseVisualStyleBackColor = True + ' + 'ucrPnlStringHandling + ' + Me.ucrPnlStringHandling.Location = New System.Drawing.Point(83, 1) + Me.ucrPnlStringHandling.Name = "ucrPnlStringHandling" + Me.ucrPnlStringHandling.Size = New System.Drawing.Size(281, 51) + Me.ucrPnlStringHandling.TabIndex = 16 + ' + 'dlgStringHandling + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(428, 355) + Me.Controls.Add(Me.rdoDetect) + Me.Controls.Add(Me.rdoExtract) + Me.Controls.Add(Me.rdoLocate) + Me.Controls.Add(Me.rdoReplace) + Me.Controls.Add(Me.rdoCount) + Me.Controls.Add(Me.ucrReceiverStringHandling) + Me.Controls.Add(Me.lblPattern) + Me.Controls.Add(Me.lblRepalceBy) + Me.Controls.Add(Me.lblColumn) + Me.Controls.Add(Me.ucrInputReplaceBy) + Me.Controls.Add(Me.ucrSave) + Me.Controls.Add(Me.ucrInputPattern) + Me.Controls.Add(Me.ucrSelectorStringHandling) + Me.Controls.Add(Me.ucrBase) + Me.Controls.Add(Me.ucrPnlStringHandling) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "dlgStringHandling" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "String Handling" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents ucrBase As ucrButtons + Friend WithEvents ucrSelectorStringHandling As ucrSelectorByDataFrameAddRemove + Friend WithEvents ucrInputPattern As ucrInputTextBox + Friend WithEvents ucrSave As ucrSave + Friend WithEvents ucrInputReplaceBy As ucrInputTextBox + Friend WithEvents lblColumn As Label + Friend WithEvents lblRepalceBy As Label + Friend WithEvents lblPattern As Label + Friend WithEvents ucrReceiverStringHandling As ucrReceiverSingle + Friend WithEvents rdoDetect As RadioButton + Friend WithEvents rdoExtract As RadioButton + Friend WithEvents rdoLocate As RadioButton + Friend WithEvents rdoReplace As RadioButton + Friend WithEvents rdoCount As RadioButton + Friend WithEvents ucrPnlStringHandling As UcrPanel +End Class diff --git a/instat/dlgStringHandling.resx b/instat/dlgStringHandling.resx new file mode 100644 index 00000000000..29dcb1b3a35 --- /dev/null +++ b/instat/dlgStringHandling.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/dlgStringHandling.vb b/instat/dlgStringHandling.vb new file mode 100644 index 00000000000..8c44061790a --- /dev/null +++ b/instat/dlgStringHandling.vb @@ -0,0 +1,59 @@ +' 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 dlgStringHandling + Private bFirstload = False + Private bReset = False + Private Sub dlgStringHandling_Load(sender As Object, e As EventArgs) Handles MyBase.Load + If bFirstload Then + InitialiseDialogue() + 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 InitialiseDialogue() + + End Sub + Private Sub SetDefaults() + + End Sub + + Private Sub TestOkEnabled() + + End Sub + + Private Sub UcrBase_Load(sender As Object, e As EventArgs) Handles ucrBase.Load + SetDefaults() + SetRCodeForControls(True) + TestOkEnabled() + End Sub + + Private Sub UcrReceiverString_Load(sender As Object, e As EventArgs) Handles ucrReceiverStringHandling.Load + + End Sub +End Class \ No newline at end of file From 411b5aea35fba34d605015ab728016680fb803a0 Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Tue, 11 Apr 2017 15:54:20 +0300 Subject: [PATCH 62/66] adding the dialog to project and adding it to form main --- instat/frmMain.Designer.vb | 27 ++++++++++++++++++--------- instat/frmMain.vb | 4 ++++ instat/instat.vbproj | 9 +++++++++ 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/instat/frmMain.Designer.vb b/instat/frmMain.Designer.vb index 31a5c96ade4..9e4011f810f 100644 --- a/instat/frmMain.Designer.vb +++ b/instat/frmMain.Designer.vb @@ -29,6 +29,7 @@ Partial Class frmMain Me.mnuDescribeOneVariableGraph = New System.Windows.Forms.ToolStripMenuItem() Me.ToolStripSeparator33 = New System.Windows.Forms.ToolStripSeparator() Me.mnuDescribeOneVariableFrequencies = New System.Windows.Forms.ToolStripMenuItem() + Me.RatingDataToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.mnuDescribeTwoVariables = New System.Windows.Forms.ToolStripMenuItem() Me.mnuDescribeTwoVariablesSummarise = New System.Windows.Forms.ToolStripMenuItem() Me.mnuDescribeTwoVariablesGraph = New System.Windows.Forms.ToolStripMenuItem() @@ -461,7 +462,7 @@ Partial Class frmMain Me.splDataOutput = New System.Windows.Forms.SplitContainer() Me.ucrDataViewer = New instat.ucrDataView() Me.ucrOutput = New instat.ucrOutputWindow() - Me.RatingDataToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.mnuPrepareColumnTextFindStringHandling = New System.Windows.Forms.ToolStripMenuItem() Me.stsStrip.SuspendLayout() Me.Tool_strip.SuspendLayout() Me.mnuBar.SuspendLayout() @@ -506,28 +507,34 @@ Partial Class frmMain 'mnuDescribeOneVariableSummarise ' Me.mnuDescribeOneVariableSummarise.Name = "mnuDescribeOneVariableSummarise" - Me.mnuDescribeOneVariableSummarise.Size = New System.Drawing.Size(152, 22) + Me.mnuDescribeOneVariableSummarise.Size = New System.Drawing.Size(146, 22) Me.mnuDescribeOneVariableSummarise.Tag = "Summarise..." Me.mnuDescribeOneVariableSummarise.Text = "Summarise..." ' 'mnuDescribeOneVariableGraph ' Me.mnuDescribeOneVariableGraph.Name = "mnuDescribeOneVariableGraph" - Me.mnuDescribeOneVariableGraph.Size = New System.Drawing.Size(152, 22) + Me.mnuDescribeOneVariableGraph.Size = New System.Drawing.Size(146, 22) Me.mnuDescribeOneVariableGraph.Tag = "Graph..." Me.mnuDescribeOneVariableGraph.Text = "Graph..." ' 'ToolStripSeparator33 ' Me.ToolStripSeparator33.Name = "ToolStripSeparator33" - Me.ToolStripSeparator33.Size = New System.Drawing.Size(149, 6) + Me.ToolStripSeparator33.Size = New System.Drawing.Size(143, 6) ' 'mnuDescribeOneVariableFrequencies ' Me.mnuDescribeOneVariableFrequencies.Name = "mnuDescribeOneVariableFrequencies" - Me.mnuDescribeOneVariableFrequencies.Size = New System.Drawing.Size(152, 22) + Me.mnuDescribeOneVariableFrequencies.Size = New System.Drawing.Size(146, 22) Me.mnuDescribeOneVariableFrequencies.Text = "Frequencies..." ' + 'RatingDataToolStripMenuItem + ' + Me.RatingDataToolStripMenuItem.Name = "RatingDataToolStripMenuItem" + Me.RatingDataToolStripMenuItem.Size = New System.Drawing.Size(146, 22) + Me.RatingDataToolStripMenuItem.Text = "Rating Data..." + ' 'mnuDescribeTwoVariables ' Me.mnuDescribeTwoVariables.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuDescribeTwoVariablesSummarise, Me.mnuDescribeTwoVariablesGraph, Me.ToolStripSeparator34, Me.mnuDescribeTwoVariablesFrequencies}) @@ -2965,6 +2972,7 @@ Partial Class frmMain ' 'mnuPrepareColumnTextFindReplace ' + Me.mnuPrepareColumnTextFindReplace.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuPrepareColumnTextFindStringHandling}) Me.mnuPrepareColumnTextFindReplace.Enabled = False Me.mnuPrepareColumnTextFindReplace.Name = "mnuPrepareColumnTextFindReplace" Me.mnuPrepareColumnTextFindReplace.Size = New System.Drawing.Size(152, 22) @@ -3634,11 +3642,11 @@ Partial Class frmMain Me.ucrOutput.Size = New System.Drawing.Size(295, 113) Me.ucrOutput.TabIndex = 0 ' - 'RatingDataToolStripMenuItem + 'mnuPrepareColumnTextFindStringHandling ' - Me.RatingDataToolStripMenuItem.Name = "RatingDataToolStripMenuItem" - Me.RatingDataToolStripMenuItem.Size = New System.Drawing.Size(152, 22) - Me.RatingDataToolStripMenuItem.Text = "Rating Data..." + Me.mnuPrepareColumnTextFindStringHandling.Name = "mnuPrepareColumnTextFindStringHandling" + Me.mnuPrepareColumnTextFindStringHandling.Size = New System.Drawing.Size(166, 22) + Me.mnuPrepareColumnTextFindStringHandling.Text = "String Handling..." ' 'frmMain ' @@ -4126,4 +4134,5 @@ Partial Class frmMain Friend WithEvents ucrScriptWindow As ucrScript Friend WithEvents mnuClimaticFileImportGriddedData As ToolStripMenuItem Friend WithEvents RatingDataToolStripMenuItem As ToolStripMenuItem + Friend WithEvents mnuPrepareColumnTextFindStringHandling As ToolStripMenuItem End Class diff --git a/instat/frmMain.vb b/instat/frmMain.vb index b017ffb9c91..e6e163330af 100644 --- a/instat/frmMain.vb +++ b/instat/frmMain.vb @@ -1345,6 +1345,10 @@ Public Class frmMain dlgRatingScales.ShowDialog() End Sub + Private Sub mnuPrepareColumnTextFindStringHandling_Click(sender As Object, e As EventArgs) Handles mnuPrepareColumnTextFindStringHandling.Click + dlgStringHandling.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 62b14708f5a..daeb55c29f8 100644 --- a/instat/instat.vbproj +++ b/instat/instat.vbproj @@ -455,6 +455,12 @@ Form + + dlgStringHandling.vb + + + Form + dlgSunshine.vb @@ -2812,6 +2818,9 @@ dlgStandardiseCountryNames.vb + + dlgStringHandling.vb + dlgSummaryBarOrPieChart.vb From 1264544a71af880857b96447949e79b120e5a58d Mon Sep 17 00:00:00 2001 From: Danny Parsons Date: Tue, 11 Apr 2017 15:10:52 +0100 Subject: [PATCH 63/66] added empty string parameter value default --- instat/dlgScatterPlot.vb | 6 ++++++ instat/ucrReceiver.vb | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/instat/dlgScatterPlot.vb b/instat/dlgScatterPlot.vb index 57e76277263..21192876b1d 100644 --- a/instat/dlgScatterPlot.vb +++ b/instat/dlgScatterPlot.vb @@ -49,12 +49,16 @@ Public Class dlgScatterPlot ucrVariablesAsFactorForScatter.Selector = ucrSelectorForScatter ucrVariablesAsFactorForScatter.SetFactorReceiver(ucrFactorOptionalReceiver) ucrVariablesAsFactorForScatter.SetIncludedDataTypes({"factor", "numeric"}) + ucrVariablesAsFactorForScatter.SetValuesToIgnore({Chr(34) & Chr(34)}) + ucrVariablesAsFactorForScatter.bAddParameterIfEmpty = True ucrReceiverX.SetParameter(New RParameter("x", 0)) ucrReceiverX.SetParameterIsString() ucrReceiverX.bWithQuotes = False ucrReceiverX.Selector = ucrSelectorForScatter ucrReceiverX.SetIncludedDataTypes({"factor", "numeric"}) + ucrReceiverX.SetValuesToIgnore({Chr(34) & Chr(34)}) + ucrReceiverX.bAddParameterIfEmpty = True ucrFactorOptionalReceiver.SetParameter(New RParameter("colour", 2)) ucrFactorOptionalReceiver.SetParameterIsString() @@ -89,6 +93,8 @@ Public Class dlgScatterPlot clsRaesFunction.SetPackageName("ggplot2") clsRaesFunction.SetRCommand("aes") + clsRaesFunction.AddParameter("x", Chr(34) & Chr(34)) + clsRaesFunction.AddParameter("y", Chr(34) & Chr(34)) clsRScatterGeomFunction.SetRCommand("geom_point") clsRScatterGeomFunction.SetPackageName("ggplot2") diff --git a/instat/ucrReceiver.vb b/instat/ucrReceiver.vb index ffa8fc1d065..313fb697c98 100644 --- a/instat/ucrReceiver.vb +++ b/instat/ucrReceiver.vb @@ -359,7 +359,13 @@ Public Class ucrReceiver End If 'Could need bParameterIsString and bParameterIsRFunction to be properties of RParameter if two functions need string/function If bParameterIsString Then - clsTempParam.SetArgumentValue(GetVariableNames(bWithQuotes)) + 'TODO this currently only works with one value to ignore. Also may need option not to set parameter value to strValuesToIgnore + ' although this currently can be done with bAddParameterIfEmpty = True + If IsEmpty() AndAlso strValuesToIgnore IsNot Nothing AndAlso strValuesToIgnore.Count = 1 Then + clsTempParam.SetArgumentValue(strValuesToIgnore(0)) + Else + clsTempParam.SetArgumentValue(GetVariableNames(bWithQuotes)) + End If ElseIf bParameterIsRFunction Then clsTempParam.SetArgument(GetVariables(bForceAsDataFrame)) End If From 814a5f4a65be033f86c66a6b6c052fb9ee5203c1 Mon Sep 17 00:00:00 2001 From: Danny Parsons Date: Tue, 11 Apr 2017 15:12:28 +0100 Subject: [PATCH 64/66] removed commented lines --- instat/dlgScatterPlot.vb | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/instat/dlgScatterPlot.vb b/instat/dlgScatterPlot.vb index 21192876b1d..5c1d1dd49d7 100644 --- a/instat/dlgScatterPlot.vb +++ b/instat/dlgScatterPlot.vb @@ -110,38 +110,6 @@ Public Class dlgScatterPlot ucrFactorOptionalReceiver.SetRCode(clsRaesFunction, bReset) End Sub - 'Private Sub ucrSelectorForScatter_DataFrameChanged() Handles ucrSelectorForScatter.DataFrameChanged - ' clsRggplotFunction.AddParameter("data", clsRFunctionParameter:=ucrSelectorForScatter.ucrAvailableDataFrames.clsCurrDataFrame) - 'End Sub - - 'Private Sub SetXParameter() - ' If Not ucrReceiverX.IsEmpty Then - ' clsRaesFunction.AddParameter("x", ucrReceiverX.GetVariableNames(False)) - ' Else - ' clsRaesFunction.AddParameter("x", Chr(34) & Chr(34)) - ' End If - 'End Sub - - 'Private Sub SetYParameter() - ' If Not ucrVariablesAsFactorForScatter.IsEmpty Then - ' clsRaesFunction.AddParameter("y", ucrVariablesAsFactorForScatter.GetVariableNames(False)) - ' Else - ' clsRaesFunction.AddParameter("y", Chr(34) & Chr(34)) - ' End If - 'End Sub - 'Private Sub ucrReceiverX_SelectionChanged(sender As Object, e As EventArgs) Handles ucrReceiverX.SelectionChanged - ' SetXParameter() - ' TestOkEnabled() - 'End Sub - - 'Private Sub ucrFactorOptionalReceiver_SelectionChanged(sender As Object, e As EventArgs) Handles ucrFactorOptionalReceiver.SelectionChanged - ' If Not ucrFactorOptionalReceiver.IsEmpty Then - ' clsRaesFunction.AddParameter("colour", ucrFactorOptionalReceiver.GetVariableNames(False)) - ' Else - ' clsRaesFunction.RemoveParameterByName("colour") - ' End If - 'End Sub - Private Sub TestOkEnabled() 'tests when okay Is enable. Both x and y aesthetics are mandatory but can be set to x="" or(exclusive) y="" in case the other one is filled. If (ucrReceiverX.IsEmpty() AndAlso ucrVariablesAsFactorForScatter.IsEmpty) OrElse (ucrSaveScatterPlot.chkSaveGraph.Checked AndAlso ucrSaveScatterPlot.ucrInputGraphName.IsEmpty) Then @@ -162,11 +130,6 @@ Public Class dlgScatterPlot sdgPlots.ShowDialog() End Sub - 'Private Sub ucrVariablesAsFactor_SelectionChanged() Handles ucrVariablesAsFactorForScatter.SelectionChanged - ' SetYParameter() - ' TestOkEnabled() - 'End Sub - Private Sub cmdScatterPlotOptions_Click(sender As Object, e As EventArgs) Handles cmdScatterPlotOptions.Click 'SetupLayer sends the components storing the plot info (clsRaesFunction, clsRggplotFunction, ...) of dlgScatteredPlot through to sdgLayerOptions where these will be edited. sdgLayerOptions.SetupLayer(clsTempGgPlot:=clsRggplotFunction, clsTempGeomFunc:=clsRScatterGeomFunction, clsTempAesFunc:=clsRaesFunction, bFixAes:=True, bFixGeom:=True, strDataframe:=ucrSelectorForScatter.ucrAvailableDataFrames.cboAvailableDataFrames.Text, bApplyAesGlobally:=True, bIgnoreGlobalAes:=False) From 4f4f4b4c6eb693b851396e22f04d43eac2ff4a63 Mon Sep 17 00:00:00 2001 From: Lily Date: Wed, 12 Apr 2017 11:07:59 +0100 Subject: [PATCH 65/66] View and Remove Keys tidy up --- instat/dlgViewAndRemoveKeys.Designer.vb | 10 ++--- instat/dlgViewAndRemoveKeys.vb | 49 ++++++++++++------------- 2 files changed, 29 insertions(+), 30 deletions(-) diff --git a/instat/dlgViewAndRemoveKeys.Designer.vb b/instat/dlgViewAndRemoveKeys.Designer.vb index 8d21e687788..e15634c8ebc 100644 --- a/instat/dlgViewAndRemoveKeys.Designer.vb +++ b/instat/dlgViewAndRemoveKeys.Designer.vb @@ -32,7 +32,7 @@ Partial Class dlgViewAndRemoveKeys 'lblSelectedKey ' Me.lblSelectedKey.AutoSize = True - Me.lblSelectedKey.Location = New System.Drawing.Point(266, 46) + Me.lblSelectedKey.Location = New System.Drawing.Point(266, 45) Me.lblSelectedKey.Name = "lblSelectedKey" Me.lblSelectedKey.Size = New System.Drawing.Size(73, 13) Me.lblSelectedKey.TabIndex = 1 @@ -41,15 +41,15 @@ Partial Class dlgViewAndRemoveKeys 'ucrChkRemoveKey ' Me.ucrChkRemoveKey.Checked = False - Me.ucrChkRemoveKey.Location = New System.Drawing.Point(269, 83) + Me.ucrChkRemoveKey.Location = New System.Drawing.Point(266, 87) Me.ucrChkRemoveKey.Name = "ucrChkRemoveKey" Me.ucrChkRemoveKey.Size = New System.Drawing.Size(145, 20) - Me.ucrChkRemoveKey.TabIndex = 4 + Me.ucrChkRemoveKey.TabIndex = 3 ' 'ucrReceiverSelectedKey ' Me.ucrReceiverSelectedKey.frmParent = Me - Me.ucrReceiverSelectedKey.Location = New System.Drawing.Point(269, 60) + Me.ucrReceiverSelectedKey.Location = New System.Drawing.Point(266, 60) Me.ucrReceiverSelectedKey.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverSelectedKey.Name = "ucrReceiverSelectedKey" Me.ucrReceiverSelectedKey.Selector = Nothing @@ -77,7 +77,7 @@ Partial Class dlgViewAndRemoveKeys ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(423, 260) + Me.ClientSize = New System.Drawing.Size(424, 260) Me.Controls.Add(Me.ucrChkRemoveKey) Me.Controls.Add(Me.lblSelectedKey) Me.Controls.Add(Me.ucrReceiverSelectedKey) diff --git a/instat/dlgViewAndRemoveKeys.vb b/instat/dlgViewAndRemoveKeys.vb index ecfbb9e6d48..5741a19fa9f 100644 --- a/instat/dlgViewAndRemoveKeys.vb +++ b/instat/dlgViewAndRemoveKeys.vb @@ -39,42 +39,41 @@ Public Class dlgViewAndRemoveKeys ucrSelectorKeys.Reset() End Sub - Private Sub SetDefaults() - 'reset - ucrSelectorKeys.Reset() - - clsGetKey = New RFunction - clsRemoveKey = New RFunction - ' Set default RFunction as the base function - clsGetKey.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_keys") - clsRemoveKey.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$remove_key") - ucrBase.clsRsyntax.SetBaseRFunction(clsGetKey) - - End Sub - - Private Sub SetRCodeForControls(bReset As Boolean) - SetRCode(Me, ucrBase.clsRsyntax.clsBaseFunction, bReset) - End Sub - Private Sub InitialiseDialog() - ucrBase.iHelpTopicID = 505 ucrBase.clsRsyntax.iCallType = 2 - 'Setting Receiver + 'Selector + ucrSelectorKeys.SetParameter(New RParameter("data_name", 0)) + ucrSelectorKeys.SetParameterIsString() + + 'Receiver + ucrReceiverSelectedKey.SetParameter(New RParameter("key_name", 1)) + ucrReceiverSelectedKey.SetParameterIsString() ucrReceiverSelectedKey.Selector = ucrSelectorKeys ucrReceiverSelectedKey.SetMeAsReceiver() ucrReceiverSelectedKey.SetItemType("key") - ucrReceiverSelectedKey.SetParameter(New RParameter("key_name", 1)) - ucrReceiverSelectedKey.SetParameterIsString() - - ucrSelectorKeys.SetParameter(New RParameter("data_name", 0)) - ucrSelectorKeys.SetParameterIsString() + 'Checkbox + ucrChkRemoveKey.SetText("Remove Key") ucrChkRemoveKey.AddFunctionNamesCondition(True, frmMain.clsRLink.strInstatDataObject & "$remove_key") ucrChkRemoveKey.AddFunctionNamesCondition(False, frmMain.clsRLink.strInstatDataObject & "$get_keys") - ucrChkRemoveKey.SetText("Remove Key") + End Sub + + Private Sub SetDefaults() + clsGetKey = New RFunction + clsRemoveKey = New RFunction + + ucrSelectorKeys.Reset() + ' Set default RFunction as the base function + clsGetKey.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_keys") + clsRemoveKey.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$remove_key") + ucrBase.clsRsyntax.SetBaseRFunction(clsGetKey) + End Sub + + Private Sub SetRCodeForControls(bReset As Boolean) + SetRCode(Me, ucrBase.clsRsyntax.clsBaseFunction, bReset) End Sub Private Sub TestOKEnabled() From 08b0c936289ec7f0ae26a2a7237d417693e9c4b8 Mon Sep 17 00:00:00 2001 From: Lily Date: Wed, 12 Apr 2017 14:46:26 +0100 Subject: [PATCH 66/66] Layout and minor edits --- instat/dlgName.Designer.vb | 25 +++++----- instat/dlgName.vb | 76 ++++++++++++++++++------------- instat/dlgRenameSheet.Designer.vb | 24 +++++----- instat/dlgRenameSheet.vb | 2 - instat/ucrDataView.vb | 2 +- 5 files changed, 70 insertions(+), 59 deletions(-) diff --git a/instat/dlgName.Designer.vb b/instat/dlgName.Designer.vb index 694759347e0..4b5700ebb70 100644 --- a/instat/dlgName.Designer.vb +++ b/instat/dlgName.Designer.vb @@ -34,7 +34,7 @@ Partial Class dlgName ' 'lblName ' - Me.lblName.Location = New System.Drawing.Point(255, 90) + Me.lblName.Location = New System.Drawing.Point(258, 91) Me.lblName.Name = "lblName" Me.lblName.Size = New System.Drawing.Size(100, 23) Me.lblName.TabIndex = 3 @@ -43,9 +43,9 @@ Partial Class dlgName ' 'lblCurrentName ' - Me.lblCurrentName.Location = New System.Drawing.Point(255, 39) + Me.lblCurrentName.Location = New System.Drawing.Point(258, 45) Me.lblCurrentName.Name = "lblCurrentName" - Me.lblCurrentName.Size = New System.Drawing.Size(100, 23) + Me.lblCurrentName.Size = New System.Drawing.Size(100, 21) Me.lblCurrentName.TabIndex = 1 Me.lblCurrentName.Text = "Current Name:" ' @@ -54,7 +54,7 @@ Partial Class dlgName Me.ucrInputNewName.AddQuotesIfUnrecognised = True Me.ucrInputNewName.IsMultiline = False Me.ucrInputNewName.IsReadOnly = False - Me.ucrInputNewName.Location = New System.Drawing.Point(257, 108) + Me.ucrInputNewName.Location = New System.Drawing.Point(258, 107) Me.ucrInputNewName.Name = "ucrInputNewName" Me.ucrInputNewName.Size = New System.Drawing.Size(137, 21) Me.ucrInputNewName.TabIndex = 4 @@ -71,28 +71,29 @@ Partial Class dlgName ' 'ucrBase ' - Me.ucrBase.Location = New System.Drawing.Point(10, 210) + 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 = 5 + Me.ucrBase.TabIndex = 7 ' 'ucrReceiverName ' Me.ucrReceiverName.frmParent = Me - Me.ucrReceiverName.Location = New System.Drawing.Point(257, 57) + Me.ucrReceiverName.Location = New System.Drawing.Point(258, 60) Me.ucrReceiverName.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverName.Name = "ucrReceiverName" Me.ucrReceiverName.Selector = Nothing Me.ucrReceiverName.Size = New System.Drawing.Size(137, 21) Me.ucrReceiverName.TabIndex = 2 + Me.ucrReceiverName.ucrSelector = Nothing ' 'lblVariableLabel ' Me.lblVariableLabel.AutoSize = True - Me.lblVariableLabel.Location = New System.Drawing.Point(255, 141) + Me.lblVariableLabel.Location = New System.Drawing.Point(258, 139) Me.lblVariableLabel.Name = "lblVariableLabel" Me.lblVariableLabel.Size = New System.Drawing.Size(74, 13) - Me.lblVariableLabel.TabIndex = 6 + Me.lblVariableLabel.TabIndex = 5 Me.lblVariableLabel.Text = "Column Label:" ' 'ucrInputVariableLabel @@ -100,16 +101,16 @@ Partial Class dlgName Me.ucrInputVariableLabel.AddQuotesIfUnrecognised = True Me.ucrInputVariableLabel.IsMultiline = False Me.ucrInputVariableLabel.IsReadOnly = False - Me.ucrInputVariableLabel.Location = New System.Drawing.Point(257, 159) + Me.ucrInputVariableLabel.Location = New System.Drawing.Point(258, 154) Me.ucrInputVariableLabel.Name = "ucrInputVariableLabel" Me.ucrInputVariableLabel.Size = New System.Drawing.Size(137, 21) - Me.ucrInputVariableLabel.TabIndex = 7 + Me.ucrInputVariableLabel.TabIndex = 6 ' 'dlgName ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(417, 263) + Me.ClientSize = New System.Drawing.Size(418, 256) Me.Controls.Add(Me.ucrInputVariableLabel) Me.Controls.Add(Me.lblVariableLabel) Me.Controls.Add(Me.ucrReceiverName) diff --git a/instat/dlgName.vb b/instat/dlgName.vb index c6cfba4b1ed..ca22d74673f 100644 --- a/instat/dlgName.vb +++ b/instat/dlgName.vb @@ -21,22 +21,23 @@ Public Class dlgName Dim bUseSelectedColumn As Boolean = False Dim strSelectedColumn As String = "" Dim strSelectedDataFrame As String = "" + Private clsDefaultRFunction As New RFunction Private Sub dlgName_Load(sender As Object, e As EventArgs) Handles Me.Load If bFirstLoad Then - Initialisedialog() + InitialiseDialog() bFirstLoad = False Else ReopenDialog() End If If bReset Then - Setdefaults() + SetDefaults() End If SetRCodeForControls(bReset) bReset = False autoTranslate(Me) If bUseSelectedColumn Then - Setdefaultcolumn() + SetDefaultColumn() End If End Sub @@ -45,6 +46,39 @@ Public Class dlgName DefaultNewName() End Sub + Private Sub InitialiseDialog() + ucrBase.iHelpTopicID = 33 + + 'Selector + ucrSelectVariables.SetParameter(New RParameter("data_name", 0)) + ucrSelectVariables.SetParameterIsString() + + 'Receiver + ucrReceiverName.SetParameter(New RParameter("column_name", 1)) + ucrReceiverName.SetParameterIsString() + ucrReceiverName.Selector = ucrSelectVariables + ucrReceiverName.SetMeAsReceiver() + + 'New Name Input + ucrInputNewName.SetParameter(New RParameter("new_val", 2)) + ucrInputNewName.SetValidationTypeAsRVariable() + + 'Label Input + ucrInputVariableLabel.SetParameter(New RParameter("label", 3)) + + DefaultNewName() + End Sub + + Public Sub SetDefaults() + clsDefaultRFunction = New RFunction + + ucrSelectVariables.Reset() + ucrInputNewName.Reset() + + clsDefaultRFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$rename_column_in_data") + ucrBase.clsRsyntax.SetBaseRFunction(clsDefaultRFunction) + End Sub + Private Sub TestOKEnabled() If Not ucrReceiverName.IsEmpty() AndAlso Not ucrInputNewName.IsEmpty() Then If (ucrReceiverName.GetVariableNames(bWithQuotes:=False) <> ucrInputNewName.GetText) Then @@ -57,61 +91,39 @@ Public Class dlgName End If End Sub - Private Sub Initialisedialog() - ucrReceiverName.Selector = ucrSelectVariables - ucrReceiverName.SetMeAsReceiver() - ucrReceiverName.SetParameter(New RParameter("column_name", 1)) - ucrReceiverName.SetParameterIsString() - ucrSelectVariables.SetParameter(New RParameter("data_name", 0)) - ucrSelectVariables.SetParameterIsString() - ucrBase.iHelpTopicID = 33 - DefaultNewName() - ucrInputNewName.SetParameter(New RParameter("new_val", 2)) - ucrInputNewName.SetValidationTypeAsRVariable() - ucrInputVariableLabel.SetParameter(New RParameter("label", 3)) - End Sub - Private Sub DefaultNewName() If ((Not ucrInputNewName.bUserTyped) AndAlso (Not ucrReceiverName.IsEmpty)) Then ucrInputNewName.SetName(ucrReceiverName.GetVariableNames(bWithQuotes:=False) & "1") End If End Sub - Public Sub Setdefaults() - Dim clsDefaultRFunction As New RFunction - ucrSelectVariables.Reset() - ucrInputNewName.Reset() - clsDefaultRFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$rename_column_in_data") - ucrBase.clsRsyntax.SetBaseRFunction(clsDefaultRFunction.Clone()) - End Sub - Private Sub SetRCodeForControls(bReset As Boolean) SetRCode(Me, ucrBase.clsRsyntax.clsBaseFunction, bReset) TestOKEnabled() End Sub - Public Sub Setcurrentcolumn(strcolumn As String, strdataframe As String) - strSelectedColumn = strcolumn - strSelectedDataFrame = strdataframe + Public Sub SetCurrentColumn(strColumn As String, strDataFrame As String) + strSelectedColumn = strColumn + strSelectedDataFrame = strDataFrame bUseSelectedColumn = True End Sub - Private Sub Setdefaultcolumn() + Private Sub SetDefaultColumn() ucrSelectVariables.SetDataframe(strSelectedDataFrame) ucrReceiverName.Add(strSelectedColumn, strSelectedDataFrame) bUseSelectedColumn = False End Sub Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset - Setdefaults() + SetDefaults() SetRCodeForControls(True) End Sub - Private Sub ucrInputNewName_ControlContentsChanged() Handles ucrInputNewName.ControlContentsChanged, ucrReceiverName.ControlContentsChanged, ucrSelectVariables.ControlContentsChanged + Private Sub ucrCoreControls_ControlContentsChanged() Handles ucrInputNewName.ControlContentsChanged, ucrReceiverName.ControlContentsChanged, ucrSelectVariables.ControlContentsChanged TestOKEnabled() End Sub - Private Sub ucrInputNewName_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverName.ControlValueChanged + Private Sub ucrReceiverName_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverName.ControlValueChanged DefaultNewName() End Sub End Class diff --git a/instat/dlgRenameSheet.Designer.vb b/instat/dlgRenameSheet.Designer.vb index 3bf30d7630a..97de3ab0893 100644 --- a/instat/dlgRenameSheet.Designer.vb +++ b/instat/dlgRenameSheet.Designer.vb @@ -32,9 +32,9 @@ Partial Class dlgRenameSheet ' 'lblNewName ' - Me.lblNewName.Location = New System.Drawing.Point(196, 13) + Me.lblNewName.Location = New System.Drawing.Point(196, 14) Me.lblNewName.Name = "lblNewName" - Me.lblNewName.Size = New System.Drawing.Size(100, 15) + Me.lblNewName.Size = New System.Drawing.Size(100, 26) Me.lblNewName.TabIndex = 1 Me.lblNewName.Tag = "New_Name" Me.lblNewName.Text = "New Name:" @@ -44,17 +44,17 @@ Partial Class dlgRenameSheet Me.ucrInputNewName.AddQuotesIfUnrecognised = True Me.ucrInputNewName.IsMultiline = False Me.ucrInputNewName.IsReadOnly = False - Me.ucrInputNewName.Location = New System.Drawing.Point(196, 28) + Me.ucrInputNewName.Location = New System.Drawing.Point(196, 29) Me.ucrInputNewName.Name = "ucrInputNewName" - Me.ucrInputNewName.Size = New System.Drawing.Size(131, 22) + Me.ucrInputNewName.Size = New System.Drawing.Size(131, 33) Me.ucrInputNewName.TabIndex = 2 ' 'ucrBase ' - Me.ucrBase.Location = New System.Drawing.Point(10, 94) + Me.ucrBase.Location = New System.Drawing.Point(10, 117) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(410, 52) - Me.ucrBase.TabIndex = 3 + Me.ucrBase.TabIndex = 5 ' 'ucrDataFrameToRename ' @@ -68,10 +68,10 @@ Partial Class dlgRenameSheet 'lblLabel ' Me.lblLabel.AutoSize = True - Me.lblLabel.Location = New System.Drawing.Point(196, 51) + Me.lblLabel.Location = New System.Drawing.Point(196, 64) Me.lblLabel.Name = "lblLabel" Me.lblLabel.Size = New System.Drawing.Size(94, 13) - Me.lblLabel.TabIndex = 4 + Me.lblLabel.TabIndex = 3 Me.lblLabel.Text = "Data Frame Label:" ' 'ucrInputLabel @@ -79,16 +79,16 @@ Partial Class dlgRenameSheet Me.ucrInputLabel.AddQuotesIfUnrecognised = True Me.ucrInputLabel.IsMultiline = False Me.ucrInputLabel.IsReadOnly = False - Me.ucrInputLabel.Location = New System.Drawing.Point(196, 66) + Me.ucrInputLabel.Location = New System.Drawing.Point(196, 79) Me.ucrInputLabel.Name = "ucrInputLabel" - Me.ucrInputLabel.Size = New System.Drawing.Size(131, 21) - Me.ucrInputLabel.TabIndex = 5 + Me.ucrInputLabel.Size = New System.Drawing.Size(131, 32) + Me.ucrInputLabel.TabIndex = 4 ' 'dlgRenameSheet ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(417, 151) + Me.ClientSize = New System.Drawing.Size(419, 178) Me.Controls.Add(Me.ucrInputLabel) Me.Controls.Add(Me.lblLabel) Me.Controls.Add(Me.ucrInputNewName) diff --git a/instat/dlgRenameSheet.vb b/instat/dlgRenameSheet.vb index 84cc64923d2..a1e81b57b1e 100644 --- a/instat/dlgRenameSheet.vb +++ b/instat/dlgRenameSheet.vb @@ -14,7 +14,6 @@ ' 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 dlgRenameSheet Public bFirstLoad As Boolean = True @@ -52,7 +51,6 @@ Public Class dlgRenameSheet End Sub ' check how changing dataframes affects it - Private Sub SetDefaults() Dim clsDefaultFunction As New RFunction ucrInputNewName.Reset() diff --git a/instat/ucrDataView.vb b/instat/ucrDataView.vb index 63c83cc7527..d09f0682ee2 100644 --- a/instat/ucrDataView.vb +++ b/instat/ucrDataView.vb @@ -311,7 +311,7 @@ Public Class ucrDataView End Sub Private Sub mnuColumnRename_Click(sender As Object, e As EventArgs) Handles mnuColumnRename.Click - dlgName.Setcurrentcolumn(SelectedColumnsAsArray()(0), grdCurrSheet.Name) + dlgName.SetCurrentColumn(SelectedColumnsAsArray()(0), grdCurrSheet.Name) dlgName.ShowDialog() End Sub