diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 4f03e05cbb5..0641ba1678e 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -11,9 +11,9 @@ categories: - 'bugfix' - 'bug' - title: '🌦️ Climatic' - label: 'climatic' + label: 'Climatic' - title: '📝 Procurement' - label: 'procurement' + label: 'Procurement' exclude-labels: - 'skip-releasenotes' prerelease: true diff --git a/instat/dlgExportDataset.Designer.vb b/instat/dlgExportDataset.Designer.vb index aee550e6ea4..b741ebc7c64 100644 --- a/instat/dlgExportDataset.Designer.vb +++ b/instat/dlgExportDataset.Designer.vb @@ -19,7 +19,7 @@ Partial Class dlgExportDataset 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 @@ -36,63 +36,105 @@ Partial Class dlgExportDataset '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() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(dlgExportDataset)) - Me.cmdBrowse = New System.Windows.Forms.Button() - Me.lblExport = New System.Windows.Forms.Label() - Me.lblConfirmText = New System.Windows.Forms.Label() - Me.ucrInputExportFile = New instat.ucrInputTextBox() - Me.ucrAvailableSheets = New instat.ucrDataFrame() + Me.lblConfirm = New System.Windows.Forms.Label() + Me.lblDataFrames = New System.Windows.Forms.Label() + Me.lblSelectedDataFrames = New System.Windows.Forms.Label() + Me.lblFileExtension = New System.Windows.Forms.Label() + Me.cboFileType = New System.Windows.Forms.ComboBox() Me.ucrBase = New instat.ucrButtons() + Me.ucrFilePath = New instat.ucrFilePath() + Me.ucrSelectorDataFrames = New instat.ucrSelectorAddRemove() + Me.ucrReceiverMultipleDataFrames = New instat.ucrReceiverMultiple() + Me.chkSaveAsSingleFile = New System.Windows.Forms.CheckBox() Me.SuspendLayout() ' - 'cmdBrowse + 'lblConfirm ' - resources.ApplyResources(Me.cmdBrowse, "cmdBrowse") - Me.cmdBrowse.Name = "cmdBrowse" - Me.cmdBrowse.UseVisualStyleBackColor = True + resources.ApplyResources(Me.lblConfirm, "lblConfirm") + Me.lblConfirm.ForeColor = System.Drawing.Color.Green + Me.lblConfirm.Name = "lblConfirm" ' - 'lblExport + 'lblDataFrames ' - resources.ApplyResources(Me.lblExport, "lblExport") - Me.lblExport.Name = "lblExport" + resources.ApplyResources(Me.lblDataFrames, "lblDataFrames") + Me.lblDataFrames.Name = "lblDataFrames" ' - 'lblConfirmText + 'lblSelectedDataFrames ' - resources.ApplyResources(Me.lblConfirmText, "lblConfirmText") - Me.lblConfirmText.Name = "lblConfirmText" + resources.ApplyResources(Me.lblSelectedDataFrames, "lblSelectedDataFrames") + Me.lblSelectedDataFrames.Name = "lblSelectedDataFrames" ' - 'ucrInputExportFile + 'lblFileExtension ' - Me.ucrInputExportFile.AddQuotesIfUnrecognised = True - Me.ucrInputExportFile.IsMultiline = False - Me.ucrInputExportFile.IsReadOnly = False - resources.ApplyResources(Me.ucrInputExportFile, "ucrInputExportFile") - Me.ucrInputExportFile.Name = "ucrInputExportFile" + resources.ApplyResources(Me.lblFileExtension, "lblFileExtension") + Me.lblFileExtension.Name = "lblFileExtension" ' - 'ucrAvailableSheets + 'cboFileType ' - Me.ucrAvailableSheets.bDropUnusedFilterLevels = False - Me.ucrAvailableSheets.bUseCurrentFilter = True - resources.ApplyResources(Me.ucrAvailableSheets, "ucrAvailableSheets") - Me.ucrAvailableSheets.Name = "ucrAvailableSheets" + Me.cboFileType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.cboFileType.FormattingEnabled = True + Me.cboFileType.Items.AddRange(New Object() {resources.GetString("cboFileType.Items"), resources.GetString("cboFileType.Items1"), resources.GetString("cboFileType.Items2"), resources.GetString("cboFileType.Items3"), resources.GetString("cboFileType.Items4"), resources.GetString("cboFileType.Items5"), resources.GetString("cboFileType.Items6"), resources.GetString("cboFileType.Items7"), resources.GetString("cboFileType.Items8"), resources.GetString("cboFileType.Items9"), resources.GetString("cboFileType.Items10"), resources.GetString("cboFileType.Items11"), resources.GetString("cboFileType.Items12"), resources.GetString("cboFileType.Items13"), resources.GetString("cboFileType.Items14"), resources.GetString("cboFileType.Items15"), resources.GetString("cboFileType.Items16")}) + resources.ApplyResources(Me.cboFileType, "cboFileType") + Me.cboFileType.Name = "cboFileType" ' 'ucrBase ' resources.ApplyResources(Me.ucrBase, "ucrBase") Me.ucrBase.Name = "ucrBase" ' + 'ucrFilePath + ' + Me.ucrFilePath.DefaultFileSuggestionName = "" + Me.ucrFilePath.FilePath = "" + Me.ucrFilePath.FilePathBrowseText = "Browse" + Me.ucrFilePath.FilePathDialogFilter = resources.GetString("ucrFilePath.FilePathDialogFilter") + Me.ucrFilePath.FilePathDialogTitle = "Export Data File" + Me.ucrFilePath.FilePathLabel = "Export File(s):" + Me.ucrFilePath.FolderBrowse = False + resources.ApplyResources(Me.ucrFilePath, "ucrFilePath") + Me.ucrFilePath.Name = "ucrFilePath" + Me.ucrFilePath.SelectedFileFilterIndex = 1 + ' + 'ucrSelectorDataFrames + ' + Me.ucrSelectorDataFrames.bShowHiddenColumns = False + resources.ApplyResources(Me.ucrSelectorDataFrames, "ucrSelectorDataFrames") + Me.ucrSelectorDataFrames.Name = "ucrSelectorDataFrames" + ' + 'ucrReceiverMultipleDataFrames + ' + Me.ucrReceiverMultipleDataFrames.frmParent = Me + resources.ApplyResources(Me.ucrReceiverMultipleDataFrames, "ucrReceiverMultipleDataFrames") + Me.ucrReceiverMultipleDataFrames.Name = "ucrReceiverMultipleDataFrames" + Me.ucrReceiverMultipleDataFrames.Selector = Nothing + Me.ucrReceiverMultipleDataFrames.strNcFilePath = "" + Me.ucrReceiverMultipleDataFrames.ucrSelector = Nothing + ' + 'chkSaveAsSingleFile + ' + resources.ApplyResources(Me.chkSaveAsSingleFile, "chkSaveAsSingleFile") + Me.chkSaveAsSingleFile.Checked = True + Me.chkSaveAsSingleFile.CheckState = System.Windows.Forms.CheckState.Checked + Me.chkSaveAsSingleFile.Name = "chkSaveAsSingleFile" + Me.chkSaveAsSingleFile.UseVisualStyleBackColor = True + ' 'dlgExportDataset ' resources.ApplyResources(Me, "$this") Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.Controls.Add(Me.lblConfirmText) - Me.Controls.Add(Me.cmdBrowse) - Me.Controls.Add(Me.ucrInputExportFile) - Me.Controls.Add(Me.ucrAvailableSheets) + Me.Controls.Add(Me.chkSaveAsSingleFile) + Me.Controls.Add(Me.cboFileType) + Me.Controls.Add(Me.lblFileExtension) + Me.Controls.Add(Me.ucrReceiverMultipleDataFrames) + Me.Controls.Add(Me.lblSelectedDataFrames) + Me.Controls.Add(Me.lblDataFrames) + Me.Controls.Add(Me.ucrSelectorDataFrames) + Me.Controls.Add(Me.ucrFilePath) + Me.Controls.Add(Me.lblConfirm) Me.Controls.Add(Me.ucrBase) - Me.Controls.Add(Me.lblExport) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.MaximizeBox = False Me.MinimizeBox = False @@ -104,9 +146,13 @@ Partial Class dlgExportDataset End Sub Friend WithEvents ucrBase As ucrButtons - Friend WithEvents cmdBrowse As Button - Friend WithEvents lblExport As Label - Friend WithEvents ucrAvailableSheets As ucrDataFrame - Friend WithEvents ucrInputExportFile As ucrInputTextBox - Friend WithEvents lblConfirmText As Label + Friend WithEvents lblConfirm As Label + Friend WithEvents ucrFilePath As ucrFilePath + Friend WithEvents ucrSelectorDataFrames As ucrSelectorAddRemove + Friend WithEvents lblDataFrames As Label + Friend WithEvents lblSelectedDataFrames As Label + Friend WithEvents ucrReceiverMultipleDataFrames As ucrReceiverMultiple + Friend WithEvents lblFileExtension As Label + Friend WithEvents cboFileType As ComboBox + Friend WithEvents chkSaveAsSingleFile As CheckBox End Class diff --git a/instat/dlgExportDataset.resx b/instat/dlgExportDataset.resx index 17f50aa4b22..89ecb4b5a9e 100644 --- a/instat/dlgExportDataset.resx +++ b/instat/dlgExportDataset.resx @@ -1,306 +1,471 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - - NoControl - - - - 332, 55 - - - 75, 23 - - - - 3 - - - Browse - - - cmdBrowse - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 1 - - - NoControl - - - 9, 60 - - - 91, 13 - - - 1 - - - Export File: - - - lblExport - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 5 - - - True - - - NoControl - - - 85, 85 - - - 2, 0, 2, 0 - - - 148, 13 - - - 4 - - - Click Ok to Confirm the Export - - - lblConfirmText - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 0 - - - 90, 56 - - - 6, 8, 6, 8 - - - 240, 21 - - - 2 - - - ucrInputExportFile - - - instat.ucrInputTextBox, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 2 - - - 10, 10 - - - 0, 0, 0, 0 - - - 154, 41 - - - 0 - - - ucrAvailableSheets - - - instat.ucrDataFrame, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 3 - - - 8, 111 - - - 4, 5, 4, 5 - - - 405, 53 - - - 5 - - - ucrBase - - - instat.ucrButtons, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 4 - - - True - - - 6, 13 - - - True - - - 414, 165 - - - CenterScreen - - - Export Datasets - - - dlgExportDataset - - - System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + True + + + + NoControl + + + + 85, 240 + + + 2, 0, 2, 0 + + + 148, 13 + + + 4 + + + Click Ok to Confirm the Export + + + lblConfirm + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 8 + + + True + + + NoControl + + + 8, 10 + + + 2, 0, 2, 0 + + + 70, 13 + + + 7 + + + Data Frames: + + + lblDataFrames + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 5 + + + True + + + NoControl + + + 240, 10 + + + 115, 13 + + + 8 + + + Selected Data Frames: + + + lblSelectedDataFrames + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 4 + + + True + + + NoControl + + + 242, 161 + + + 2, 0, 2, 0 + + + 86, 13 + + + 12 + + + Select File Type: + + + lblFileExtension + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + .csv + + + .xlsx + + + .tsv + + + .psv + + + .feather + + + .fwf + + + .rds + + + .RData + + + .json + + + .yml + + + .dta + + + .sav + + + .dbf + + + .arff + + + .R + + + .xml + + + .html + + + 245, 175 + + + 170, 21 + + + 4 + + + cboFileType + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + 10, 270 + + + 4, 5, 4, 5 + + + 405, 53 + + + 6 + + + ucrBase + + + instat.ucrButtons, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 9 + + + Comma separated file (*.csv)|*.csv|Excel files (*.xlsx)|*.xlsx|TAB-separated data (*.tsv)|*.tsv|Pipe-separated data (*.psv)|*.psv|Feather r / Python interchange format (*.feather)|*.feather|Fixed-Width format data (*.fwf)|*.fwf|Serialized r objects (*.rds)|*.rds|Saved r objects (*.RData)|*.RData|JSON(*.json)|*.json|YAML(*.yml)|*.yml|Stata(*.dta)|*.dta|SPSS(*.sav)|*.sav|XBASE database files (*.dbf)|*.dbf| Weka Attribute - Relation File Format (*.arff)|*.arff|r syntax object (*.R)|*.R|Xml(*.xml)|*.xml|HTML(*.html)|*.html + + + 8, 211 + + + 425, 26 + + + 5 + + + ucrFilePath + + + instat.ucrFilePath, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 7 + + + 10, 28 + + + 0, 0, 0, 0 + + + 216, 147 + + + 1 + + + ucrSelectorDataFrames + + + instat.ucrSelectorAddRemove, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 6 + + + True + + + 6, 13 + + + True + + + 441, 331 + + + True + + + 243, 133 + + + 111, 17 + + + 13 + + + Save as single file + + + chkSaveAsSingleFile + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + CenterScreen + + + Export Datasets + + + dlgExportDataset + + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 243, 28 + + + 0, 0, 0, 0 + + + 120, 100 + + + 2 + + + ucrReceiverMultipleDataFrames + + + instat.ucrReceiverMultiple, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 3 + \ No newline at end of file diff --git a/instat/dlgExportDataset.vb b/instat/dlgExportDataset.vb index fa18fe80d90..26826c04134 100644 --- a/instat/dlgExportDataset.vb +++ b/instat/dlgExportDataset.vb @@ -14,16 +14,17 @@ ' You should have received a copy of the GNU General Public License ' along with this program. If not, see . -Imports System.IO +Imports instat Imports instat.Translations Public Class dlgExportDataset Dim bFirstLoad As Boolean = True Private bReset As Boolean = True - Private clsDefaultFunction As New RFunction - Private strCurrentFileName As String + Private clsDefaultFunction As RFunction Private Sub dlgExportDataset_Load(sender As Object, e As EventArgs) Handles Me.Load - autoTranslate(Me) + 'temporarily commented out because it overwrites lblConfirm text contents + 'autoTranslate(Me) + If bFirstLoad Then InitialiseDialog() bFirstLoad = False @@ -33,26 +34,31 @@ Public Class dlgExportDataset End If SetRCodeForControls(bReset) bReset = False - TestOkEnabled() End Sub Private Sub InitialiseDialog() - ucrInputExportFile.IsReadOnly = True - ucrAvailableSheets.SetParameter(New RParameter("x", 0)) - ucrAvailableSheets.SetParameterIsRFunction() - ucrAvailableSheets.SetText("Data Frame to Export:") + 'multiple reciever control that holds selected objects + ucrReceiverMultipleDataFrames.SetParameter(New RParameter("x", 0)) + ucrReceiverMultipleDataFrames.SetParameterIsRFunction() + ucrReceiverMultipleDataFrames.Selector = ucrSelectorDataFrames + ucrReceiverMultipleDataFrames.SetMeAsReceiver() + ucrReceiverMultipleDataFrames.strSelectorHeading = "Data Frames" + ucrReceiverMultipleDataFrames.SetItemType("dataframe") - ucrInputExportFile.SetParameter(New RParameter("file", 1)) - - lblConfirmText.Text = "Click Ok to Confirm the Export" - lblConfirmText.ForeColor = Color.Red + 'file path control + ucrFilePath.SetPathControlParameter(New RParameter("file", 1)) End Sub Private Sub SetDefaults() clsDefaultFunction = New RFunction - ucrInputExportFile.SetName("") - ucrAvailableSheets.Reset() + ucrSelectorDataFrames.Reset() + chkSaveAsSingleFile.Checked = False + chkSaveAsSingleFile.Visible = False + cboFileType.SelectedIndex = 0 + lblConfirm.Visible = False + ucrFilePath.ResetPathControl() + clsDefaultFunction.SetPackageName("rio") clsDefaultFunction.SetRCommand("export") @@ -60,57 +66,153 @@ Public Class dlgExportDataset End Sub Private Sub SetRCodeForControls(bReset As Boolean) - SetRCode(Me, ucrBase.clsRsyntax.clsBaseFunction, bReset) + 'done this way because, the selected base function could be a command string or clsDefaultFunction. + 'so we don't want to reset the controls if command string was the base function on reloading the form + If bReset Then + ucrReceiverMultipleDataFrames.SetRCode(clsDefaultFunction, bReset) + ucrFilePath.SetPathControlRcode(clsDefaultFunction, bReset) + End If End Sub Private Sub TestOkEnabled() - If Not ucrInputExportFile.IsEmpty AndAlso ucrAvailableSheets.cboAvailableDataFrames.Text <> "" Then - ucrBase.OKEnabled(True) - Else - ucrBase.OKEnabled(False) - End If - If Not ucrInputExportFile.IsEmpty() Then - lblConfirmText.Show() + If Not ucrFilePath.IsEmpty AndAlso Not ucrReceiverMultipleDataFrames.IsEmpty Then ucrBase.OKEnabled(True) + lblConfirm.Visible = True Else - lblConfirmText.Hide() ucrBase.OKEnabled(False) + lblConfirm.Visible = False 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 cmdBrowse_Click(sender As Object, e As EventArgs) Handles cmdBrowse.Click - Using dlgSave As New SaveFileDialog - dlgSave.Title = "Export File Dialog" - dlgSave.Filter = "Comma separated file (*.csv)|*.csv|Excel files (*.xlsx)|*.xlsx|TAB-separated data (*.tsv)|*.tsv|Pipe-separated data (*.psv)|*.psv|Feather r / Python interchange format (*.feather)|*.feather|Fixed-Width format data (*.fwf)|*.fwf|Serialized r objects (*.rds)|*.rds|Saved r objects (*.RData)|*.RData|JSON(*.json)|*.json|YAML(*.yml)|*.yml|Stata(*.dta)|*.dta|SPSS(*.sav)|*.sav|XBASE database files (*.dbf)|*.dbf| Weka Attribute - Relation File Format (*.arff)|*.arff|r syntax object (*.R)|*.R|Xml(*.xml)|*.xml|HTML(*.html)|*.html" - If Not String.IsNullOrEmpty(strCurrentFileName) Then - dlgSave.FileName = Path.GetFileName(strCurrentFileName) - dlgSave.InitialDirectory = Path.GetDirectoryName(strCurrentFileName) - Else - dlgSave.FileName = ucrAvailableSheets.cboAvailableDataFrames.Text - dlgSave.InitialDirectory = frmMain.clsInstatOptions.strWorkingDirectory - End If - If dlgSave.ShowDialog = DialogResult.OK Then - ucrInputExportFile.SetName(dlgSave.FileName.Replace("\", "/")) - strCurrentFileName = dlgSave.FileName - End If - End Using + Private Sub ucrReceiverMultipleDataFrames_ControlContentsChanged(ucrchangedControl As ucrCore) Handles ucrReceiverMultipleDataFrames.ControlContentsChanged + chkSaveAsSingleFile.Visible = ucrReceiverMultipleDataFrames.GetVariableNamesList().Length > 1 + ChangeFileControlsValues() + ucrFilePath.Clear() 'will raise event FilePathChanged + End Sub + + Private Sub chkSaveAsSingleFile_CheckedChanged(sender As Object, e As EventArgs) Handles chkSaveAsSingleFile.CheckedChanged + ChangeFileControlsValues() + ucrFilePath.Clear() 'will raise event FilePathChanged End Sub - Private Sub ucrInputExportFile_Click(sender As Object, e As EventArgs) Handles ucrInputExportFile.Click - cmdBrowse_Click(sender, e) + Private Sub cboFileExtension_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboFileType.SelectedIndexChanged + ucrFilePath.Clear() 'will raise event FilePathChanged + ucrFilePath.FilePathDialogFilter = GetFilePathDialogFilterText(cboFileType.SelectedItem) End Sub - Private Sub ucrInputExportFile_ControlContentsChanged(ucrchangedControl As ucrCore) Handles ucrInputExportFile.ControlContentsChanged, ucrAvailableSheets.ControlContentsChanged + ''' + ''' this event will always be called when changes happen to the core controls of the form; + ''' receiver, file path, save as single checkbox + ''' + Private Sub ucrFilePath_FilePathChanged() Handles ucrFilePath.FilePathChanged + 'if no or single data frame selected or save as single checked then just set the base function to the default + If ucrReceiverMultipleDataFrames.GetVariableNamesList().Length <= 1 OrElse chkSaveAsSingleFile.Checked Then + ucrBase.clsRsyntax.SetBaseRFunction(clsDefaultFunction) + lblConfirm.Text = "Click Ok to Confirm the Export." + Else + 'else, create a string command for exporting separate files to a directory. + 'note, as of 09/09/2020 rio didn't support exporting separate files in 1 command see issue #5590 + Dim lstItems As String() = ucrReceiverMultipleDataFrames.GetVariableNamesList(bWithQuotes:=False) + Dim strCommand As String = "" + For Each strItem In lstItems + strCommand = strCommand & "rio::export( x = data_book$get_data_frame(data_name=""" & strItem & """), file = """ & ucrFilePath.FilePath & "/" & strItem & GetSelectedExtension(cboFileType.SelectedItem) & """)" & Environment.NewLine + Next + ucrBase.clsRsyntax.SetCommandString(strCommand) + lblConfirm.Text = "Files with the same names will be overwritten." & Environment.NewLine & "Click Ok to Confirm the Export." + End If TestOkEnabled() End Sub - Private Sub ucrAvailableSheets_DataFrameChanged(sender As Object, e As EventArgs, strPrevDataFrame As String) Handles ucrAvailableSheets.DataFrameChanged - strCurrentFileName = "" + + ''' + ''' changes the file path and cboFileType control values; + ''' the FolderBrowse, DefaultFileSuggestionName, FilePathDialogFilter, selectable file types + ''' the changed settings determine the behaviour of the file path contro + ''' + Private Sub ChangeFileControlsValues() + Dim strPrevSelectedFileType As String = cboFileType.SelectedItem + Dim iSelectedDataFrames As Integer = ucrReceiverMultipleDataFrames.GetVariableNamesList().Length + ucrFilePath.FolderBrowse = False 'set file path control to open default SaveFileDialog prompt + ucrFilePath.DefaultFileSuggestionName = "" + ucrFilePath.FilePathDialogFilter = "" + cboFileType.Items.Clear() + + + ucrFilePath.FolderBrowse = iSelectedDataFrames > 1 AndAlso Not chkSaveAsSingleFile.Checked + + If iSelectedDataFrames > 1 AndAlso chkSaveAsSingleFile.Checked Then + 'file types currently supported insaving of multiple files into a single file + cboFileType.Items.Add("Excel files (*.xlsx)") + cboFileType.Items.Add("Serialized r objects (*.rds)") + cboFileType.Items.Add("Saved r objects (*.RData)") + cboFileType.Items.Add("HTML (*.html)") + Else + 'file types supported + cboFileType.Items.Add("Comma separated file (*.csv)") + cboFileType.Items.Add("Excel files (*.xlsx)") + cboFileType.Items.Add("TAB-separated data (*.tsv)") + cboFileType.Items.Add("Pipe-separated data (*.psv)") + cboFileType.Items.Add("Feather r / Python interchange format (*.feather)") + cboFileType.Items.Add("Fixed-Width format data (*.fwf)") + cboFileType.Items.Add("Serialized r objects (*.rds)") + cboFileType.Items.Add("Saved r objects (*.RData)") + cboFileType.Items.Add("JSON (*.json)") + cboFileType.Items.Add("YAML (*.yml)") + cboFileType.Items.Add("Stata (*.dta)") + cboFileType.Items.Add("SPSS (*.sav)") + cboFileType.Items.Add("XBASE database files (*.dbf)") + cboFileType.Items.Add("Weka Attribute - Relation File Format (*.arff)") + cboFileType.Items.Add("r syntax object (*.R)") + cboFileType.Items.Add("Xml (*.xml)") + cboFileType.Items.Add("HTML (*.html)") + cboFileType.Items.Add("Matlab (*.mat)") + cboFileType.Items.Add("SAS (*.sas7bdat)") + cboFileType.Items.Add("SAS XPORT (*.xpt)") + + 'set the default suggested name + ucrFilePath.DefaultFileSuggestionName = ucrReceiverMultipleDataFrames.GetVariableNames(bWithQuotes:=False) + End If + + 'previous selected file type may not be there in the current combobox items + cboFileType.SelectedItem = strPrevSelectedFileType + If String.IsNullOrEmpty(cboFileType.SelectedItem) Then + cboFileType.SelectedIndex = 0 + End If + + ucrFilePath.FilePathDialogFilter = GetFilePathDialogFilterText(cboFileType.SelectedItem) End Sub -End Class \ No newline at end of file + + ''' + ''' expected string format "filetype (*.ext)" + ''' + ''' + ''' + Private Function GetFilePathDialogFilterText(strText As String) As String + If String.IsNullOrEmpty(strText) Then + Return "" + End If + 'example of required format; Excel files (*.xlsx)|*.xlsx + Dim arrStr() As String = strText.Split({"(", ")"}, StringSplitOptions.RemoveEmptyEntries) + Return arrStr(0) & "(" & arrStr(1) & ")|" & arrStr(1) + + End Function + + ''' + ''' expected string format "filetype (*.ext)" + ''' + ''' + ''' + Private Function GetSelectedExtension(strText As String) As String + If String.IsNullOrEmpty(strText) Then + Return "" + End If + 'example of required format;.xlsx + Return strText.Split({"(", "*", ")"}, StringSplitOptions.RemoveEmptyEntries)(1) + End Function + +End Class diff --git a/instat/dlgExportGraphAsImage.Designer.vb b/instat/dlgExportGraphAsImage.Designer.vb index 47641fd28b7..16046ebbab2 100644 --- a/instat/dlgExportGraphAsImage.Designer.vb +++ b/instat/dlgExportGraphAsImage.Designer.vb @@ -40,12 +40,10 @@ Partial Class dlgExportGraphAsImage Private Sub InitializeComponent() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(dlgExportGraphAsImage)) Me.lblSelectedGraph = New System.Windows.Forms.Label() - Me.cmdBrowse = New System.Windows.Forms.Button() Me.ucrSelectedGraphReceiver = New instat.ucrReceiverSingle() Me.ucrSelectorGraphAsImage = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrBase = New instat.ucrButtons() - Me.lblExport = New System.Windows.Forms.Label() - Me.ucrInputFile = New instat.ucrInputTextBox() + Me.ucrFilePath = New instat.ucrFilePath() Me.SuspendLayout() ' 'lblSelectedGraph @@ -53,12 +51,6 @@ Partial Class dlgExportGraphAsImage resources.ApplyResources(Me.lblSelectedGraph, "lblSelectedGraph") Me.lblSelectedGraph.Name = "lblSelectedGraph" ' - 'cmdBrowse - ' - resources.ApplyResources(Me.cmdBrowse, "cmdBrowse") - Me.cmdBrowse.Name = "cmdBrowse" - Me.cmdBrowse.UseVisualStyleBackColor = True - ' 'ucrSelectedGraphReceiver ' Me.ucrSelectedGraphReceiver.frmParent = Me @@ -81,26 +73,23 @@ Partial Class dlgExportGraphAsImage resources.ApplyResources(Me.ucrBase, "ucrBase") Me.ucrBase.Name = "ucrBase" ' - 'lblExport - ' - resources.ApplyResources(Me.lblExport, "lblExport") - Me.lblExport.Name = "lblExport" - ' - 'ucrInputFile + 'ucrFilePath ' - Me.ucrInputFile.AddQuotesIfUnrecognised = True - Me.ucrInputFile.IsMultiline = False - Me.ucrInputFile.IsReadOnly = True - resources.ApplyResources(Me.ucrInputFile, "ucrInputFile") - Me.ucrInputFile.Name = "ucrInputFile" + Me.ucrFilePath.DefaultFileSuggestionName = "" + Me.ucrFilePath.FilePath = "" + Me.ucrFilePath.FilePathBrowseText = "Browse" + Me.ucrFilePath.FilePathDialogFilter = "JPEG (*.jpeg)|*.jpeg|PNG(*.png)|*.png|BitMaP(*.bmp)|*.bmp|EPS(*.eps)|*.eps|PostSc" & + "ript(*.ps)|*.ps|SVG(*.svg)|*.svg|WMF(*.wmf)|*.wmf|PDF(*.pdf)|*.pdf" + Me.ucrFilePath.FilePathDialogTitle = "Save Graph As Image" + Me.ucrFilePath.FilePathLabel = "Export File:" + resources.ApplyResources(Me.ucrFilePath, "ucrFilePath") + Me.ucrFilePath.Name = "ucrFilePath" ' 'dlgExportGraphAsImage ' resources.ApplyResources(Me, "$this") Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.Controls.Add(Me.ucrInputFile) - Me.Controls.Add(Me.lblExport) - Me.Controls.Add(Me.cmdBrowse) + Me.Controls.Add(Me.ucrFilePath) Me.Controls.Add(Me.lblSelectedGraph) Me.Controls.Add(Me.ucrSelectedGraphReceiver) Me.Controls.Add(Me.ucrSelectorGraphAsImage) @@ -117,8 +106,6 @@ Partial Class dlgExportGraphAsImage Friend WithEvents ucrBase As ucrButtons Friend WithEvents ucrSelectorGraphAsImage As ucrSelectorByDataFrameAddRemove Friend WithEvents ucrSelectedGraphReceiver As ucrReceiverSingle - Friend WithEvents cmdBrowse As Button Friend WithEvents lblSelectedGraph As Label - Friend WithEvents lblExport As Label - Friend WithEvents ucrInputFile As ucrInputTextBox + Friend WithEvents ucrFilePath As ucrFilePath End Class diff --git a/instat/dlgExportGraphAsImage.resx b/instat/dlgExportGraphAsImage.resx index fae21d03975..97ca7543720 100644 --- a/instat/dlgExportGraphAsImage.resx +++ b/instat/dlgExportGraphAsImage.resx @@ -1,318 +1,267 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - - True - - - - 264, 45 - - - 84, 13 - - - 1 - - - Selected Graph: - - - lblSelectedGraph - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 3 - - - 334, 194 - - - 75, 23 - - - 5 - - - Browse - - - cmdBrowse - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 2 - - - True - - - 6, 13 - - - True - - - 418, 280 - - - 92, 195 - - - - 6, 8, 6, 8 - - - 240, 21 - - - 4 - - - ucrInputFile - - - instat.ucrInputTextBox, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 0 - - - 9, 199 - - - 115, 13 - - - 3 - - - Export File: - - - lblExport - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 1 - - - 10, 10 - - - 0, 0, 0, 0 - - - 210, 180 - - - 0 - - - ucrSelectorGraphAsImage - - - instat.ucrSelectorByDataFrameAddRemove, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 5 - - - 10, 223 - - - 4, 5, 4, 5 - - - 404, 52 - - - 6 - - - ucrBase - - - instat.ucrButtons, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 6 - - - CenterScreen - - - Export Graph As Image - - - dlgExportGraphAsImage - - - System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 265, 60 - - - 0, 0, 0, 0 - - - 120, 20 - - - 2 - - - ucrSelectedGraphReceiver - - - instat.ucrReceiverSingle, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 4 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + True + + + + 264, 45 + + + 84, 13 + + + 1 + + + Selected Graph: + + + lblSelectedGraph + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + True + + + 6, 13 + + + True + + + 418, 280 + + + 14, 195 + + + 400, 26 + + + 7 + + + ucrFilePath + + + instat.ucrFilePath, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 0 + + + 10, 10 + + + + 0, 0, 0, 0 + + + 210, 180 + + + 0 + + + ucrSelectorGraphAsImage + + + instat.ucrSelectorByDataFrameAddRemove, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 3 + + + 10, 224 + + + 4, 5, 4, 5 + + + 404, 52 + + + 6 + + + ucrBase + + + instat.ucrButtons, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 4 + + + CenterScreen + + + Export Graph As Image + + + dlgExportGraphAsImage + + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 265, 60 + + + 0, 0, 0, 0 + + + 120, 20 + + + 2 + + + ucrSelectedGraphReceiver + + + instat.ucrReceiverSingle, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 2 + \ No newline at end of file diff --git a/instat/dlgExportGraphAsImage.vb b/instat/dlgExportGraphAsImage.vb index 084664cb992..539ee6c50ff 100644 --- a/instat/dlgExportGraphAsImage.vb +++ b/instat/dlgExportGraphAsImage.vb @@ -36,7 +36,8 @@ Public Class dlgExportGraphAsImage Private Sub InitialiseDialog() ucrBase.iHelpTopicID = 556 - ucrInputFile.SetParameter(New RParameter("filename", 0)) + + ucrFilePath.SetPathControlParameter(New RParameter("filename", 0)) ucrSelectedGraphReceiver.SetParameter(New RParameter("plot", 1)) ucrSelectedGraphReceiver.SetParameterIsRFunction() @@ -50,9 +51,8 @@ Public Class dlgExportGraphAsImage Private Sub SetDefaults() clsggSave = New RFunction - ucrInputFile.Reset() ucrSelectorGraphAsImage.Reset() - ucrInputFile.SetName("") + ucrFilePath.ResetPathControl() clsggSave.SetPackageName("ggplot2") clsggSave.SetRCommand("ggsave") @@ -60,15 +60,12 @@ Public Class dlgExportGraphAsImage End Sub Private Sub SetRCodeForControls(bReset As Boolean) - SetRCode(Me, ucrBase.clsRsyntax.clsBaseFunction, bReset) + ucrSelectorGraphAsImage.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + ucrFilePath.SetPathControlRcode(ucrBase.clsRsyntax.clsBaseFunction, bReset) End Sub Private Sub TestOkEnabled() - If Not ucrSelectedGraphReceiver.IsEmpty AndAlso Not ucrInputFile.IsEmpty Then - ucrBase.OKEnabled(True) - Else - ucrBase.OKEnabled(False) - End If + ucrBase.OKEnabled(Not ucrSelectedGraphReceiver.IsEmpty AndAlso Not ucrFilePath.IsEmpty) End Sub Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset @@ -77,17 +74,14 @@ Public Class dlgExportGraphAsImage TestOkEnabled() End Sub - Private Sub cmdBrowse_Click(sender As Object, e As EventArgs) Handles cmdBrowse.Click - Dim dlgSelectFile As New SaveFileDialog - dlgSelectFile.Title = "Save Graph As Image" - dlgSelectFile.Filter = "JPEG (*.jpeg)|*.jpeg|PNG(*.png)|*.png|BitMaP(*.bmp)|*.bmp|EPS(*.eps)|*.eps|PostScript(*.ps)|*.ps|SVG(*.svg)|*.svg|WMF(*.wmf)|*.wmf|PDF(*.pdf)|*.pdf" - dlgSelectFile.InitialDirectory = frmMain.clsInstatOptions.strWorkingDirectory - If dlgSelectFile.ShowDialog() = DialogResult.OK Then - ucrInputFile.SetName(dlgSelectFile.FileName.Replace("\", "/")) - End If + Private Sub ucrCoreControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrSelectedGraphReceiver.ControlContentsChanged + 'give a default suggested name from the receiver + ucrFilePath.DefaultFileSuggestionName = ucrSelectedGraphReceiver.GetVariableNames(bWithQuotes:=False) + TestOkEnabled() End Sub - Private Sub ucrCoreControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrSelectedGraphReceiver.ControlContentsChanged, ucrInputFile.ControlContentsChanged + Private Sub ucrFilePath_FilePathChanged() Handles ucrFilePath.FilePathChanged TestOkEnabled() End Sub -End Class \ No newline at end of file + +End Class diff --git a/instat/dlgExportRObjects.Designer.vb b/instat/dlgExportRObjects.Designer.vb index 4024a34ecb2..5d6715e539f 100644 --- a/instat/dlgExportRObjects.Designer.vb +++ b/instat/dlgExportRObjects.Designer.vb @@ -19,7 +19,7 @@ Partial Class dlgExportRObjects 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 @@ -36,16 +36,14 @@ Partial Class dlgExportRObjects '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() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(dlgExportRObjects)) Me.lblObjects = New System.Windows.Forms.Label() - Me.ucrReceiverObjects = New instat.ucrReceiverMultiple() + Me.ucrFilePath = New instat.ucrFilePath() + Me.ucrReceiverMultipleObjects = New instat.ucrReceiverMultiple() Me.ucrSelectorObjects = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrBase = New instat.ucrButtons() - Me.ucrInputExportFile = New instat.ucrInputTextBox() - Me.lblExportFile = New System.Windows.Forms.Label() - Me.cmdBrowse = New System.Windows.Forms.Button() Me.SuspendLayout() ' 'lblObjects @@ -53,14 +51,25 @@ Partial Class dlgExportRObjects resources.ApplyResources(Me.lblObjects, "lblObjects") Me.lblObjects.Name = "lblObjects" ' - 'ucrReceiverObjects + 'ucrFilePath ' - Me.ucrReceiverObjects.frmParent = Me - resources.ApplyResources(Me.ucrReceiverObjects, "ucrReceiverObjects") - Me.ucrReceiverObjects.Name = "ucrReceiverObjects" - Me.ucrReceiverObjects.Selector = Nothing - Me.ucrReceiverObjects.strNcFilePath = "" - Me.ucrReceiverObjects.ucrSelector = Nothing + Me.ucrFilePath.DefaultFileSuggestionName = "" + Me.ucrFilePath.FilePath = "" + Me.ucrFilePath.FilePathBrowseText = "Browse" + Me.ucrFilePath.FilePathDialogFilter = "Saved R objects (*.RData)|*.RData|Serialized R Objects (*.rds)|*.rds" + Me.ucrFilePath.FilePathDialogTitle = "Export R Objects" + Me.ucrFilePath.FilePathLabel = "Export File:" + resources.ApplyResources(Me.ucrFilePath, "ucrFilePath") + Me.ucrFilePath.Name = "ucrFilePath" + ' + 'ucrReceiverMultipleObjects + ' + Me.ucrReceiverMultipleObjects.frmParent = Me + resources.ApplyResources(Me.ucrReceiverMultipleObjects, "ucrReceiverMultipleObjects") + Me.ucrReceiverMultipleObjects.Name = "ucrReceiverMultipleObjects" + Me.ucrReceiverMultipleObjects.Selector = Nothing + Me.ucrReceiverMultipleObjects.strNcFilePath = "" + Me.ucrReceiverMultipleObjects.ucrSelector = Nothing ' 'ucrSelectorObjects ' @@ -75,34 +84,13 @@ Partial Class dlgExportRObjects resources.ApplyResources(Me.ucrBase, "ucrBase") Me.ucrBase.Name = "ucrBase" ' - 'ucrInputExportFile - ' - Me.ucrInputExportFile.AddQuotesIfUnrecognised = True - Me.ucrInputExportFile.IsMultiline = False - Me.ucrInputExportFile.IsReadOnly = False - resources.ApplyResources(Me.ucrInputExportFile, "ucrInputExportFile") - Me.ucrInputExportFile.Name = "ucrInputExportFile" - ' - 'lblExportFile - ' - resources.ApplyResources(Me.lblExportFile, "lblExportFile") - Me.lblExportFile.Name = "lblExportFile" - ' - 'cmdBrowse - ' - resources.ApplyResources(Me.cmdBrowse, "cmdBrowse") - Me.cmdBrowse.Name = "cmdBrowse" - Me.cmdBrowse.UseVisualStyleBackColor = True - ' 'dlgExportRObjects ' resources.ApplyResources(Me, "$this") Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.Controls.Add(Me.ucrInputExportFile) - Me.Controls.Add(Me.cmdBrowse) - Me.Controls.Add(Me.lblExportFile) + Me.Controls.Add(Me.ucrFilePath) Me.Controls.Add(Me.lblObjects) - Me.Controls.Add(Me.ucrReceiverObjects) + Me.Controls.Add(Me.ucrReceiverMultipleObjects) Me.Controls.Add(Me.ucrSelectorObjects) Me.Controls.Add(Me.ucrBase) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow @@ -115,9 +103,7 @@ Partial Class dlgExportRObjects End Sub Friend WithEvents ucrBase As ucrButtons Friend WithEvents ucrSelectorObjects As ucrSelectorByDataFrameAddRemove - Friend WithEvents ucrReceiverObjects As ucrReceiverMultiple + Friend WithEvents ucrReceiverMultipleObjects As ucrReceiverMultiple Friend WithEvents lblObjects As Label - Friend WithEvents ucrInputExportFile As ucrInputTextBox - Friend WithEvents lblExportFile As Label - Friend WithEvents cmdBrowse As Button + Friend WithEvents ucrFilePath As ucrFilePath End Class diff --git a/instat/dlgExportRObjects.resx b/instat/dlgExportRObjects.resx index 22966706d77..4164aefba4b 100644 --- a/instat/dlgExportRObjects.resx +++ b/instat/dlgExportRObjects.resx @@ -1,315 +1,267 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - - True - - - - 266, 45 - - - 91, 13 - - - 1 - - - Selected Objects: - - - lblObjects - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 3 - - - True - - - 6, 13 - - - 420, 288 - - - 92, 204 - - - - 6, 8, 6, 8 - - - 240, 23 - - - 4 - - - ucrInputExportFile - - - instat.ucrInputTextBox, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 0 - - - 333, 203 - - - 75, 23 - - - 5 - - - Browse - - - cmdBrowse - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 1 - - - 9, 206 - - - 95, 13 - - - 3 - - - Export File: - - - lblExportFile - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 2 - - - 10, 10 - - - 0, 0, 0, 0 - - - 210, 180 - - - 0 - - - ucrSelectorObjects - - - instat.ucrSelectorByDataFrameAddRemove, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 5 - - - 10, 232 - - - 4, 5, 4, 5 - - - 398, 52 - - - 6 - - - ucrBase - - - instat.ucrButtons, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 6 - - - CenterScreen - - - Export R Objects - - - dlgExportRObjects - - - System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 267, 60 - - - 0, 0, 0, 0 - - - 120, 100 - - - 2 - - - ucrReceiverObjects - - - instat.ucrReceiverMultiple, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 4 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + True + + + + NoControl + + + + 263, 45 + + + 91, 13 + + + 1 + + + Selected Objects: + + + lblObjects + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + 14, 199 + + + 394, 26 + + + 7 + + + ucrFilePath + + + instat.ucrFilePath, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 0 + + + True + + + 6, 13 + + + 417, 288 + + + 10, 10 + + + 0, 0, 0, 0 + + + 210, 180 + + + 0 + + + ucrSelectorObjects + + + instat.ucrSelectorByDataFrameAddRemove, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 3 + + + 10, 232 + + + 4, 5, 4, 5 + + + 398, 52 + + + 6 + + + ucrBase + + + instat.ucrButtons, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 4 + + + CenterScreen + + + Export R Objects + + + dlgExportRObjects + + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 267, 60 + + + 0, 0, 0, 0 + + + 120, 100 + + + 2 + + + ucrReceiverMultipleObjects + + + instat.ucrReceiverMultiple, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 2 + \ No newline at end of file diff --git a/instat/dlgExportRObjects.vb b/instat/dlgExportRObjects.vb index 5a11063f31b..5151a9fc889 100644 --- a/instat/dlgExportRObjects.vb +++ b/instat/dlgExportRObjects.vb @@ -14,12 +14,11 @@ ' You should have received a copy of the GNU General Public License ' along with this program. If not, see . -Imports System.IO Imports instat.Translations Public Class dlgExportRObjects Private bFirstLoad As Boolean = True Private bReset As Boolean = True - Private clsGetObjectsFunction, clsSaveRDS As New RFunction + Private clsExport As RFunction Private Sub dlgExportRObjects_Load(sender As Object, e As EventArgs) Handles MyBase.Load autoTranslate(Me) @@ -32,76 +31,59 @@ Public Class dlgExportRObjects End If SetRCodeForControls(bReset) bReset = False - TestOkEnabled() + 'TestOkEnabled() End Sub Private Sub InitialiseDialog() ucrBase.iHelpTopicID = 554 - ucrSelectorObjects.SetParameter(New RParameter("data_name", 1)) - ucrSelectorObjects.ucrAvailableDataFrames.SetParameterIsString() - - ucrReceiverObjects.SetParameter(New RParameter("object_name", 2)) - ucrReceiverObjects.SetParameterIsString() - ucrReceiverObjects.Selector = ucrSelectorObjects - ucrReceiverObjects.SetMeAsReceiver() - ucrReceiverObjects.strSelectorHeading = "Objects" - ucrReceiverObjects.SetItemType("object") - - ucrInputExportFile.SetParameter(New RParameter("file", 0)) - ucrInputExportFile.IsReadOnly = True + 'multiple reciever control that holds selected objects + ucrReceiverMultipleObjects.SetParameter(New RParameter("x", 0)) + ucrReceiverMultipleObjects.SetParameterIsRFunction() + ucrReceiverMultipleObjects.Selector = ucrSelectorObjects + ucrReceiverMultipleObjects.SetMeAsReceiver() + ucrReceiverMultipleObjects.strSelectorHeading = "Objects" + ucrReceiverMultipleObjects.SetItemType("object") + 'file path control that holds the file path and name + ucrFilePath.SetPathControlParameter(New RParameter("file", 1)) End Sub Private Sub SetDefaults() - clsGetObjectsFunction = New RFunction - clsSaveRDS = New RFunction + clsExport = New RFunction - ucrInputExportFile.SetName("") - ucrSelectorObjects.Reset() - clsGetObjectsFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_objects") - clsSaveRDS.SetRCommand("saveRDS") - clsSaveRDS.AddParameter("object", clsRFunctionParameter:=clsGetObjectsFunction) - ucrBase.clsRsyntax.SetBaseRFunction(clsSaveRDS) + 'reset controls + ucrSelectorObjects.Reset() 'will also reset the reciever + ucrFilePath.ResetPathControl() + + 'set R command and base function + clsExport.SetPackageName("rio") + clsExport.SetRCommand("export") + ucrBase.clsRsyntax.SetBaseRFunction(clsExport) End Sub Private Sub SetRCodeForControls(bReset As Boolean) - ucrSelectorObjects.SetRCode(clsGetObjectsFunction, bReset) - ucrReceiverObjects.SetRCode(clsGetObjectsFunction, bReset) - ucrInputExportFile.SetRCode(clsSaveRDS, bReset) + ucrReceiverMultipleObjects.SetRCode(clsExport, bReset) + ucrFilePath.SetPathControlRcode(clsExport, bReset) End Sub Private Sub TestOkEnabled() - If Not ucrInputExportFile.IsEmpty AndAlso Not ucrReceiverObjects.IsEmpty AndAlso ucrSelectorObjects.ucrAvailableDataFrames.cboAvailableDataFrames.Text <> "" Then - ucrBase.OKEnabled(True) - Else - ucrBase.OKEnabled(False) - End If + ucrBase.OKEnabled(Not ucrFilePath.IsEmpty AndAlso Not ucrReceiverMultipleObjects.IsEmpty AndAlso Not String.IsNullOrEmpty(ucrSelectorObjects.strCurrentDataFrame)) End Sub Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset SetDefaults() SetRCodeForControls(True) - TestOkEnabled() + 'TestOkEnabled() End Sub - Private Sub cmdBrowse_Click(sender As Object, e As EventArgs) Handles cmdBrowse.Click - Dim dlgSave As New SaveFileDialog - - dlgSave.Title = "Export R Objects" - dlgSave.InitialDirectory = frmMain.clsInstatOptions.strWorkingDirectory - dlgSave.Filter = "Serialized R Objects (*.rds)|*.rds" - If dlgSave.ShowDialog = DialogResult.OK Then - If dlgSave.FileName <> "" Then - ucrInputExportFile.SetName(Path.GetFullPath(dlgSave.FileName).ToString.Replace("\", "/")) - End If - End If - End Sub - - Private Sub ucrInputExportFile_Click(sender As Object, e As EventArgs) Handles ucrInputExportFile.Click - cmdBrowse_Click(sender, e) + Private Sub ucrReceiverMultipleObjects_ControlContentsChanged(ucrchangedControl As ucrCore) Handles ucrReceiverMultipleObjects.ControlContentsChanged + 'give a default suggested name if only a single object is selected object + ucrFilePath.DefaultFileSuggestionName = If(ucrReceiverMultipleObjects.GetVariableNamesList().Length = 1, ucrReceiverMultipleObjects.GetVariableNames(bWithQuotes:=False), "") + TestOkEnabled() End Sub - Private Sub ucrInputExportFile_ControlContentsChanged(ucrchangedControl As ucrCore) Handles ucrReceiverObjects.ControlContentsChanged, ucrSelectorObjects.ControlContentsChanged, ucrInputExportFile.ControlContentsChanged + Private Sub ucrFilePath_FilePathChanged() Handles ucrFilePath.FilePathChanged TestOkEnabled() End Sub -End Class \ No newline at end of file + +End Class diff --git a/instat/dlgExportRWorkspace.Designer.vb b/instat/dlgExportRWorkspace.Designer.vb index aa0dd3eace7..ee90b80096d 100644 --- a/instat/dlgExportRWorkspace.Designer.vb +++ b/instat/dlgExportRWorkspace.Designer.vb @@ -39,30 +39,17 @@ Partial Class dlgExportRWorkspace _ Private Sub InitializeComponent() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(dlgExportRWorkspace)) - Me.cmdBrowse = New System.Windows.Forms.Button() - Me.lblExport = New System.Windows.Forms.Label() Me.lblDataFrames = New System.Windows.Forms.Label() Me.lblSelectedDataFrames = New System.Windows.Forms.Label() Me.ucrSelectorForDataFrames = New instat.ucrSelectorAddRemove() - Me.ucrInputExportFile = New instat.ucrInputTextBox() Me.ucrChkGraphs = New instat.ucrCheck() Me.ucrChkModels = New instat.ucrCheck() Me.ucrChkMetadata = New instat.ucrCheck() Me.ucrReceiverMultiple = New instat.ucrReceiverMultiple() Me.ucrBase = New instat.ucrButtons() + Me.ucrFilePath = New instat.ucrFilePath() Me.SuspendLayout() ' - 'cmdBrowse - ' - resources.ApplyResources(Me.cmdBrowse, "cmdBrowse") - Me.cmdBrowse.Name = "cmdBrowse" - Me.cmdBrowse.UseVisualStyleBackColor = True - ' - 'lblExport - ' - resources.ApplyResources(Me.lblExport, "lblExport") - Me.lblExport.Name = "lblExport" - ' 'lblDataFrames ' resources.ApplyResources(Me.lblDataFrames, "lblDataFrames") @@ -79,14 +66,6 @@ Partial Class dlgExportRWorkspace resources.ApplyResources(Me.ucrSelectorForDataFrames, "ucrSelectorForDataFrames") Me.ucrSelectorForDataFrames.Name = "ucrSelectorForDataFrames" ' - 'ucrInputExportFile - ' - Me.ucrInputExportFile.AddQuotesIfUnrecognised = True - Me.ucrInputExportFile.IsMultiline = False - Me.ucrInputExportFile.IsReadOnly = False - resources.ApplyResources(Me.ucrInputExportFile, "ucrInputExportFile") - Me.ucrInputExportFile.Name = "ucrInputExportFile" - ' 'ucrChkGraphs ' Me.ucrChkGraphs.Checked = False @@ -119,15 +98,24 @@ Partial Class dlgExportRWorkspace resources.ApplyResources(Me.ucrBase, "ucrBase") Me.ucrBase.Name = "ucrBase" ' + 'ucrFilePath + ' + Me.ucrFilePath.DefaultFileSuggestionName = "" + Me.ucrFilePath.FilePath = "" + Me.ucrFilePath.FilePathBrowseText = "Browse" + Me.ucrFilePath.FilePathDialogFilter = "Saved R Objects (*.RData)|*.RData" + Me.ucrFilePath.FilePathDialogTitle = "Export R Workspace" + Me.ucrFilePath.FilePathLabel = "Export File:" + resources.ApplyResources(Me.ucrFilePath, "ucrFilePath") + Me.ucrFilePath.Name = "ucrFilePath" + ' 'dlgExportRWorkspace ' resources.ApplyResources(Me, "$this") Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.ucrFilePath) Me.Controls.Add(Me.lblSelectedDataFrames) Me.Controls.Add(Me.lblDataFrames) - Me.Controls.Add(Me.ucrInputExportFile) - Me.Controls.Add(Me.cmdBrowse) - Me.Controls.Add(Me.lblExport) Me.Controls.Add(Me.ucrChkGraphs) Me.Controls.Add(Me.ucrChkModels) Me.Controls.Add(Me.ucrChkMetadata) @@ -148,10 +136,8 @@ Partial Class dlgExportRWorkspace Friend WithEvents ucrChkGraphs As ucrCheck Friend WithEvents ucrChkModels As ucrCheck Friend WithEvents ucrChkMetadata As ucrCheck - Friend WithEvents ucrInputExportFile As ucrInputTextBox - Friend WithEvents cmdBrowse As Button - Friend WithEvents lblExport As Label Friend WithEvents lblDataFrames As Label Friend WithEvents lblSelectedDataFrames As Label Friend WithEvents ucrSelectorForDataFrames As ucrSelectorAddRemove + Friend WithEvents ucrFilePath As ucrFilePath End Class diff --git a/instat/dlgExportRWorkspace.resx b/instat/dlgExportRWorkspace.resx index 6d6a6faf634..fa840261ae5 100644 --- a/instat/dlgExportRWorkspace.resx +++ b/instat/dlgExportRWorkspace.resx @@ -1,417 +1,366 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - - 333, 247 - - - 75, 23 - - - - 9 - - - Browse - - - cmdBrowse - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 3 - - - 9, 251 - - - 100, 13 - - - 7 - - - Export File: - - - lblExport - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 4 - - - True - - - 10, 15 - - - 76, 13 - - - 0 - - - Data Frame(s): - - - lblDataFrames - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 1 - - - True - - - 247, 45 - - - 115, 13 - - - 2 - - - Selected Data Frames: - - - lblSelectedDataFrames - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 0 - - - 10, 30 - - - - 0, 0, 0, 0 - - - 213, 147 - - - 1 - - - ucrSelectorForDataFrames - - - instat.ucrSelectorAddRemove, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 10 - - - 92, 248 - - - 6, 8, 6, 8 - - - 240, 23 - - - 8 - - - ucrInputExportFile - - - instat.ucrInputTextBox, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 2 - - - 10, 193 - - - 4, 5, 4, 5 - - - 119, 20 - - - 5 - - - ucrChkGraphs - - - instat.ucrCheck, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 5 - - - 10, 219 - - - 4, 5, 4, 5 - - - 128, 20 - - - 6 - - - ucrChkModels - - - instat.ucrCheck, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 6 - - - 10, 167 - - - 4, 5, 4, 5 - - - 145, 20 - - - 4 - - - ucrChkMetadata - - - instat.ucrCheck, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 7 - - - True - - - 6, 13 - - - True - - - 417, 335 - - - 10, 278 - - - 4, 5, 4, 5 - - - 398, 52 - - - 10 - - - ucrBase - - - instat.ucrButtons, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 9 - - - CenterScreen - - - Export R Workspace - - - dlgExportRWorkspace - - - System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 250, 60 - - - 0, 0, 0, 0 - - - 120, 100 - - - 3 - - - ucrReceiverMultiple - - - instat.ucrReceiverMultiple, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 8 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + True + + + + 10, 15 + + + 76, 13 + + + 0 + + + Data Frame(s): + + + lblDataFrames + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + True + + + 247, 45 + + + 115, 13 + + + 2 + + + Selected Data Frames: + + + lblSelectedDataFrames + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + 10, 30 + + + + 0, 0, 0, 0 + + + 213, 147 + + + 1 + + + ucrSelectorForDataFrames + + + instat.ucrSelectorAddRemove, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 8 + + + 10, 193 + + + 4, 5, 4, 5 + + + 119, 20 + + + 5 + + + ucrChkGraphs + + + instat.ucrCheck, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 3 + + + 10, 219 + + + 4, 5, 4, 5 + + + 128, 20 + + + 6 + + + ucrChkModels + + + instat.ucrCheck, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 4 + + + 10, 167 + + + 4, 5, 4, 5 + + + 145, 20 + + + 4 + + + ucrChkMetadata + + + instat.ucrCheck, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 5 + + + True + + + 6, 13 + + + True + + + 417, 335 + + + 14, 245 + + + 400, 26 + + + 11 + + + ucrFilePath + + + instat.ucrFilePath, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 0 + + + 10, 278 + + + 4, 5, 4, 5 + + + 398, 52 + + + 10 + + + ucrBase + + + instat.ucrButtons, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 7 + + + CenterScreen + + + Export R Workspace + + + dlgExportRWorkspace + + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 250, 60 + + + 0, 0, 0, 0 + + + 120, 100 + + + 3 + + + ucrReceiverMultiple + + + instat.ucrReceiverMultiple, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 6 + \ No newline at end of file diff --git a/instat/dlgExportRWorkspace.vb b/instat/dlgExportRWorkspace.vb index 04f6b9e475e..6e9dc83abb5 100644 --- a/instat/dlgExportRWorkspace.vb +++ b/instat/dlgExportRWorkspace.vb @@ -14,7 +14,6 @@ ' You should have received a copy of the GNU General Public License ' along with this program. If not, see . -Imports System.IO Imports instat.Translations Public Class dlgExportRWorkspace Private bFirstLoad As Boolean = True @@ -36,7 +35,6 @@ Public Class dlgExportRWorkspace Private Sub InitialiseDialog() ucrBase.iHelpTopicID = 555 - ucrInputExportFile.IsReadOnly = True ucrReceiverMultiple.SetParameter(New RParameter("data_names", 0)) ucrReceiverMultiple.SetParameterIsString() @@ -44,7 +42,7 @@ Public Class dlgExportRWorkspace ucrReceiverMultiple.strSelectorHeading = "Data Frames" ucrReceiverMultiple.SetItemType("dataframe") - ucrInputExportFile.SetParameter(New RParameter("file", 1)) + ucrFilePath.SetPathControlParameter(New RParameter("file", 1)) ucrChkMetadata.SetParameter(New RParameter("include_metadata", 2)) ucrChkMetadata.SetText("Include Metadata") @@ -65,7 +63,7 @@ Public Class dlgExportRWorkspace Private Sub SetDefaults() clsDefaultFunction = New RFunction - ucrInputExportFile.SetName("") + ucrFilePath.ResetPathControl() ucrSelectorForDataFrames.Reset() ucrReceiverMultiple.SetMeAsReceiver() @@ -74,15 +72,16 @@ Public Class dlgExportRWorkspace End Sub Private Sub SetRCodeForControls(bReset As Boolean) - SetRCode(Me, ucrBase.clsRsyntax.clsBaseFunction, bReset) + 'ucrSelectorForDataFrames.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) 'todo. check if needed + ucrReceiverMultiple.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + ucrChkMetadata.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + ucrChkGraphs.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + ucrChkModels.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + ucrFilePath.SetPathControlRcode(ucrBase.clsRsyntax.clsBaseFunction, bReset) End Sub Private Sub TestOkEnabled() - If Not ucrInputExportFile.IsEmpty AndAlso Not ucrReceiverMultiple.IsEmpty Then - ucrBase.OKEnabled(True) - Else - ucrBase.OKEnabled(False) - End If + ucrBase.OKEnabled(Not ucrFilePath.IsEmpty AndAlso Not ucrReceiverMultiple.IsEmpty) End Sub Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset @@ -91,24 +90,13 @@ Public Class dlgExportRWorkspace TestOkEnabled() End Sub - Private Sub cmdBrowse_Click(sender As Object, e As EventArgs) Handles cmdBrowse.Click - Dim dlgSave As New SaveFileDialog - - dlgSave.Title = "Export R Workspace" - dlgSave.InitialDirectory = frmMain.clsInstatOptions.strWorkingDirectory - dlgSave.Filter = "Saved R Objects (*.RData)|*.RData" - If dlgSave.ShowDialog = DialogResult.OK Then - If dlgSave.FileName <> "" Then - ucrInputExportFile.SetName(Path.GetFullPath(dlgSave.FileName).ToString.Replace("\", "/")) - End If - End If - End Sub - - Private Sub ucrInputExportFile_Click(sender As Object, e As EventArgs) Handles ucrInputExportFile.Click - cmdBrowse_Click(sender, e) + Private Sub ucrInputExportFile_ControlContentsChanged(ucrchangedControl As ucrCore) Handles ucrReceiverMultiple.ControlContentsChanged + 'ucrReceiverMultiple is a multireceiver. So give a default suggested name if it has 1 item only + ucrFilePath.DefaultFileSuggestionName = If(ucrReceiverMultiple.GetVariableNamesList().Length = 1, ucrReceiverMultiple.GetVariableNames(bWithQuotes:=False), "") + TestOkEnabled() End Sub - Private Sub ucrInputExportFile_ControlContentsChanged(ucrchangedControl As ucrCore) Handles ucrInputExportFile.ControlContentsChanged, ucrReceiverMultiple.ControlContentsChanged + Private Sub ucrFilePath_FilePathChanged() Handles ucrFilePath.FilePathChanged TestOkEnabled() End Sub -End Class \ No newline at end of file +End Class diff --git a/instat/dlgNewDataFrame.resx b/instat/dlgNewDataFrame.resx index 7a631c1ab19..27a495fcffa 100644 --- a/instat/dlgNewDataFrame.resx +++ b/instat/dlgNewDataFrame.resx @@ -130,7 +130,7 @@ - 10 + 8 Rows: @@ -157,7 +157,7 @@ 50, 13 - 12 + 10 Columns: @@ -190,7 +190,7 @@ 95, 27 - 3 + 2 Command @@ -226,7 +226,7 @@ 95, 27 - 4 + 3 Random @@ -262,7 +262,7 @@ 95, 27 - 5 + 4 Empty @@ -298,7 +298,7 @@ 95, 27 - 2 + 1 Construct @@ -430,13 +430,13 @@ NoControl - 10, 61 + 10, 59 57, 13 - 6 + 5 Command: @@ -457,7 +457,7 @@ NoControl - 69, 55 + 69, 54 2, 2, 2, 2 @@ -466,7 +466,7 @@ 118, 22 - 7 + 6 Command Examples @@ -496,7 +496,7 @@ 74, 23 - 176 + 12 Try @@ -523,7 +523,7 @@ 293, 22 - 177 + 13 ucrInputTryMessage @@ -544,7 +544,7 @@ 417, 159 - 8 + 7 ucrInputCommand @@ -568,7 +568,7 @@ 405, 43 - 1 + 0 ucrPnlDataFrame @@ -616,7 +616,7 @@ 50, 20 - 13 + 11 ucrNudCols @@ -640,7 +640,7 @@ 50, 20 - 11 + 9 ucrNudRows @@ -664,7 +664,7 @@ 399, 48 - 14 + 15 ucrBase @@ -690,6 +690,9 @@ 439, 378 + + NoControl + CenterScreen diff --git a/instat/dlgNewDataFrame.vb b/instat/dlgNewDataFrame.vb index be5bc5d3d89..98092b7ab58 100644 --- a/instat/dlgNewDataFrame.vb +++ b/instat/dlgNewDataFrame.vb @@ -51,9 +51,9 @@ Public Class dlgNewDataFrame ucrNudCols.SetMinMax(1, Integer.MaxValue) ' ucrNewSheetName - ucrNewDFName.SetIsTextBox() ucrNewDFName.SetSaveTypeAsDataFrame() ucrNewDFName.SetLabelText("New Data Frame Name:") + ucrNewDFName.SetIsTextBox() ucrNewDFName.SetPrefix("data") 'ucrRdoOptions @@ -374,6 +374,12 @@ Public Class dlgNewDataFrame lstView.Items.Add(New ListViewItem({"occasions", "seq(as.Date(""1970/1/1""), by = ""4 months"", length = 30)"})) lstView.Items.Item(4).ToolTipText = "Regular sequence of monthly data" + + lstView.Items.Add(New ListViewItem({"prob1", "c(0.01, 0.05, 0.1, 0.2, 0.5, 0.8, 0.9, 0.95, 0.99)"})) + lstView.Items.Add(New ListViewItem({"prob2", "c(0.5, 0.8, 0.9, 0.95, 0.98, 0.99, 0.995, 0.998, 0.999)"})) + lstView.Items.Add(New ListViewItem({"quant1", "seq(-4, 4)"})) + lstView.Items.Add(New ListViewItem({"quant2", "c(40, 50, 60, 80, 100, 130, 160, 200, 250)"})) + End If 'set respective handlers diff --git a/instat/dlgSaveAs.Designer.vb b/instat/dlgSaveAs.Designer.vb index 5dae51a9efc..fc7dfd91955 100644 --- a/instat/dlgSaveAs.Designer.vb +++ b/instat/dlgSaveAs.Designer.vb @@ -39,50 +39,37 @@ Partial Class dlgSaveAs Private Sub InitializeComponent() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(dlgSaveAs)) - Me.ucrBase = New instat.ucrButtons() - Me.lblSaveDataTo = New System.Windows.Forms.Label() - Me.ucrInputFilePath = New instat.ucrInputTextBox() - Me.cmdChooseFile = New System.Windows.Forms.Button() Me.lblConfirm = New System.Windows.Forms.Label() + Me.ucrBase = New instat.ucrButtons() + Me.ucrFilePath = New instat.ucrFilePath() Me.SuspendLayout() ' + 'lblConfirm + ' + resources.ApplyResources(Me.lblConfirm, "lblConfirm") + Me.lblConfirm.Name = "lblConfirm" + ' 'ucrBase ' resources.ApplyResources(Me.ucrBase, "ucrBase") Me.ucrBase.Name = "ucrBase" ' - 'lblSaveDataTo - ' - resources.ApplyResources(Me.lblSaveDataTo, "lblSaveDataTo") - Me.lblSaveDataTo.Name = "lblSaveDataTo" + 'ucrFilePath ' - 'ucrInputFilePath - ' - Me.ucrInputFilePath.AddQuotesIfUnrecognised = True - Me.ucrInputFilePath.IsMultiline = False - Me.ucrInputFilePath.IsReadOnly = False - resources.ApplyResources(Me.ucrInputFilePath, "ucrInputFilePath") - Me.ucrInputFilePath.Name = "ucrInputFilePath" - ' - 'cmdChooseFile - ' - resources.ApplyResources(Me.cmdChooseFile, "cmdChooseFile") - Me.cmdChooseFile.Name = "cmdChooseFile" - Me.cmdChooseFile.UseVisualStyleBackColor = True - ' - 'lblConfirm - ' - resources.ApplyResources(Me.lblConfirm, "lblConfirm") - Me.lblConfirm.Name = "lblConfirm" + Me.ucrFilePath.FilePath = "" + Me.ucrFilePath.FilePathBrowseText = "Browse" + Me.ucrFilePath.FilePathDialogFilter = "RDS Data file (*.RDS)|*.RDS" + Me.ucrFilePath.FilePathDialogTitle = "Save Data File" + Me.ucrFilePath.FilePathLabel = "Save Data To:" + resources.ApplyResources(Me.ucrFilePath, "ucrFilePath") + Me.ucrFilePath.Name = "ucrFilePath" ' 'dlgSaveAs ' resources.ApplyResources(Me, "$this") Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.ucrFilePath) Me.Controls.Add(Me.lblConfirm) - Me.Controls.Add(Me.ucrInputFilePath) - Me.Controls.Add(Me.lblSaveDataTo) - Me.Controls.Add(Me.cmdChooseFile) Me.Controls.Add(Me.ucrBase) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.MaximizeBox = False @@ -95,8 +82,6 @@ Partial Class dlgSaveAs End Sub Friend WithEvents ucrBase As ucrButtons - Friend WithEvents lblSaveDataTo As Label - Friend WithEvents ucrInputFilePath As ucrInputTextBox - Friend WithEvents cmdChooseFile As Button Friend WithEvents lblConfirm As Label + Friend WithEvents ucrFilePath As ucrFilePath End Class diff --git a/instat/dlgSaveAs.resx b/instat/dlgSaveAs.resx index e4c7ca3cf67..7e6cf3c407a 100644 --- a/instat/dlgSaveAs.resx +++ b/instat/dlgSaveAs.resx @@ -117,18 +117,48 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + + NoControl + + + 96, 40 + + + 140, 13 + + + 3 + + + Click Ok to confirm the save + + + lblConfirm + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + - 10, 70 + 10, 63 - 4, 5, 4, 5 410, 53 - 4 @@ -142,102 +172,27 @@ $this - 4 - - - 10, 20 - - - 103, 13 - - - 0 - - - Save Data To: - - - lblSaveDataTo - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - 2 - - 125, 17 + + 10, 9 - - 6, 8, 6, 8 + + 419, 26 - - 316, 21 + + 7 - - 1 + + ucrFilePath - - ucrInputFilePath + + instat.ucrFilePath, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - instat.ucrInputTextBox, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - + $this - - 1 - - - 443, 17 - - - 65, 21 - - - 2 - - - Browse - - - cmdChooseFile - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 3 - - - True - - - 96, 45 - - - 0, 13 - - - 3 - - - lblConfirm - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - + 0 @@ -247,7 +202,7 @@ 6, 13 - 511, 130 + 430, 124 CenterScreen diff --git a/instat/dlgSaveAs.vb b/instat/dlgSaveAs.vb index 528985b723d..096daa62dc3 100644 --- a/instat/dlgSaveAs.vb +++ b/instat/dlgSaveAs.vb @@ -1,116 +1,86 @@ -' R- Instat -' Copyright (C) 2015-2017 -' -' 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 -' along with this program. If not, see . - -Imports System.IO -Imports instat.Translations -Public Class dlgSaveAs - Private bFirstLoad As Boolean = True - Private bReset As Boolean = True - Private clsSaveFunction As New RFunction - - Private Sub dlgSaveAs_Load(sender As Object, e As EventArgs) Handles Me.Load - If bFirstLoad Then - InitialiseDialog() - bFirstLoad = False - End If - If bReset Then - SetDefaults() - End If - SetRCodeForControls(bReset) - bReset = False - autoTranslate(Me) - End Sub - - Private Sub InitialiseDialog() - ucrBase.iHelpTopicID = 332 - - ucrInputFilePath.SetParameter(New RParameter("file", 0)) - ucrInputFilePath.IsReadOnly = True - - lblConfirm.Text = "Click Ok to confirm the save" - End Sub - - Private Sub SetDefaults() - clsSaveFunction = New RFunction - - ucrInputFilePath.Reset() - ucrInputFilePath.SetName("") - - clsSaveFunction.SetRCommand("saveRDS") - clsSaveFunction.AddParameter("object", frmMain.clsRLink.strInstatDataObject) - - ucrBase.clsRsyntax.SetBaseRFunction(clsSaveFunction) - End Sub - - Private Sub SetRCodeForControls(bReset As Boolean) - SetRCode(Me, ucrBase.clsRsyntax.clsBaseFunction, bReset) - TestOKEnabled() - End Sub - - Private Sub TestOKEnabled() - If Not ucrInputFilePath.IsEmpty() Then - lblConfirm.Show() - ucrBase.OKEnabled(True) - Else - lblConfirm.Hide() - ucrBase.OKEnabled(False) - End If - End Sub - - Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset - SetDefaults() - SetRCodeForControls(True) - End Sub - - Private Sub ucrBase_ClickOk(sender As Object, e As EventArgs) Handles ucrBase.ClickOk - frmMain.strSaveFilePath = ucrInputFilePath.GetText() - frmMain.clsRecentItems.addToMenu(Replace(ucrInputFilePath.GetText(), "/", "\")) - frmMain.bDataSaved = True - End Sub - - Private Sub cmdEditorSave_Click(sender As Object, e As EventArgs) Handles cmdChooseFile.Click - SelectFileToSave() - 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 SelectFileToSave() - Dim strCurrentFileName As String = ucrInputFilePath.GetText() - Using dlgSave As New SaveFileDialog - dlgSave.Title = "Save Data File" - dlgSave.Filter = "RDS Data file (*.RDS)|*.RDS" - If Not String.IsNullOrEmpty(strCurrentFileName) Then - strCurrentFileName = strCurrentFileName.Replace("/", "\") - dlgSave.FileName = Path.GetFileName(strCurrentFileName) - dlgSave.InitialDirectory = Path.GetDirectoryName(strCurrentFileName) - Else - dlgSave.InitialDirectory = frmMain.clsInstatOptions.strWorkingDirectory - End If - If DialogResult.OK = dlgSave.ShowDialog() Then - ucrInputFilePath.SetName(dlgSave.FileName.Replace("\", "/")) - End If - TestOKEnabled() - End Using - End Sub - - Private Sub ucrInputFilePath_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrInputFilePath.ControlContentsChanged - TestOKEnabled() - End Sub -End Class +' R- Instat +' Copyright (C) 2015-2017 +' +' 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 +' along with this program. If not, see . + +Imports instat.Translations +Public Class dlgSaveAs + Private bFirstLoad As Boolean = True + Private bReset As Boolean = True + Private clsSaveFunction As New RFunction + + Private Sub dlgSaveAs_Load(sender As Object, e As EventArgs) Handles Me.Load + If bFirstLoad Then + InitialiseDialog() + bFirstLoad = False + End If + If bReset Then + SetDefaults() + End If + SetRCodeForControls(bReset) + bReset = False + autoTranslate(Me) + End Sub + + Private Sub InitialiseDialog() + ucrBase.iHelpTopicID = 332 + + ucrFilePath.SetPathControlParameter(New RParameter("file", 0)) + + lblConfirm.Visible = False + lblConfirm.ForeColor = Color.Green + End Sub + + Private Sub SetDefaults() + clsSaveFunction = New RFunction + + ucrFilePath.ResetPathControl() + + clsSaveFunction.SetRCommand("saveRDS") + clsSaveFunction.AddParameter("object", frmMain.clsRLink.strInstatDataObject) + + ucrBase.clsRsyntax.SetBaseRFunction(clsSaveFunction) + End Sub + + Private Sub SetRCodeForControls(bReset As Boolean) + ucrFilePath.SetPathControlRcode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + TestOKEnabled() + End Sub + + Private Sub TestOKEnabled() + If ucrFilePath.IsEmpty() Then + lblConfirm.Visible = False + ucrBase.OKEnabled(False) + Else + lblConfirm.Visible = True + ucrBase.OKEnabled(True) + End If + End Sub + + Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset + SetDefaults() + SetRCodeForControls(True) + End Sub + + Private Sub ucrBase_ClickOk(sender As Object, e As EventArgs) Handles ucrBase.ClickOk + frmMain.strSaveFilePath = ucrFilePath.FilePath + frmMain.clsRecentItems.addToMenu(Replace(ucrFilePath.FilePath, "/", "\")) + frmMain.bDataSaved = True + End Sub + + Private Sub ucrFilePath_FilePathChanged() Handles ucrFilePath.FilePathChanged + TestOKEnabled() + End Sub + +End Class diff --git a/instat/dlgView.resx b/instat/dlgView.resx index f7d8627a9a9..e5b82ada13f 100644 --- a/instat/dlgView.resx +++ b/instat/dlgView.resx @@ -177,7 +177,7 @@ 210, 17 - 8 + 7 Display in Output Window @@ -285,7 +285,7 @@ 89, 13 - 11 + 10 Number of Rows: @@ -309,7 +309,7 @@ 210, 17 - 9 + 8 Display HTML in Output Window @@ -334,13 +334,13 @@ Flat - 205, 9 + 81, 12 - 140, 28 + 113, 28 - 2 + 1 All Columns @@ -367,13 +367,13 @@ Flat - 67, 9 + 194, 12 - 140, 28 + 113, 28 - 1 + 2 Choose Columns @@ -394,10 +394,10 @@ 1 - 47, 5 + 70, 8 - 335, 35 + 248, 35 0 @@ -430,7 +430,7 @@ 100, 20 - 10 + 9 ucrChkSortColumn diff --git a/instat/frmMain.Designer.vb b/instat/frmMain.Designer.vb index 7628807dfa6..38066d5fe94 100644 --- a/instat/frmMain.Designer.vb +++ b/instat/frmMain.Designer.vb @@ -642,20 +642,20 @@ Partial Class frmMain Me.splOverall = New System.Windows.Forms.SplitContainer() Me.splExtraWindows = New System.Windows.Forms.SplitContainer() Me.splMetadata = New System.Windows.Forms.SplitContainer() + Me.ucrColumnMeta = New instat.ucrColumnMetadata() + Me.ucrDataFrameMeta = New instat.ucrDataFrameMetadata() Me.splLogScript = New System.Windows.Forms.SplitContainer() + Me.ucrLogWindow = New instat.ucrLog() + Me.ucrScriptWindow = New instat.ucrScript() Me.splDataOutput = New System.Windows.Forms.SplitContainer() + Me.ucrDataViewer = New instat.ucrDataView() + Me.ucrOutput = New instat.ucrOutputWindow() Me.mnuRViewer = New System.Windows.Forms.ToolStripMenuItem() Me.mnuPlotly = New System.Windows.Forms.ToolStripMenuItem() Me.mnuColumnMetadata = New System.Windows.Forms.ToolStripMenuItem() Me.mnuDataFrameMetadata = New System.Windows.Forms.ToolStripMenuItem() Me.mnuScriptFile = New System.Windows.Forms.ToolStripMenuItem() Me.mnuLogFile = New System.Windows.Forms.ToolStripMenuItem() - Me.ucrColumnMeta = New instat.ucrColumnMetadata() - Me.ucrDataFrameMeta = New instat.ucrDataFrameMetadata() - Me.ucrLogWindow = New instat.ucrLog() - Me.ucrScriptWindow = New instat.ucrScript() - Me.ucrDataViewer = New instat.ucrDataView() - Me.ucrOutput = New instat.ucrOutputWindow() Me.stsStrip.SuspendLayout() Me.Tool_strip.SuspendLayout() Me.mnuBar.SuspendLayout() @@ -3451,8 +3451,8 @@ Partial Class frmMain ' 'mnuStructuredCircularDensityPlot ' - resources.ApplyResources(Me.mnuStructuredCircularDensityPlot, "mnuStructuredCircularDensityPlot") Me.mnuStructuredCircularDensityPlot.Name = "mnuStructuredCircularDensityPlot" + resources.ApplyResources(Me.mnuStructuredCircularDensityPlot, "mnuStructuredCircularDensityPlot") ' 'mnuStructuredCircularRosePlot ' @@ -4053,6 +4053,18 @@ Partial Class frmMain Me.splMetadata.Panel2.BackColor = System.Drawing.SystemColors.Control Me.splMetadata.Panel2.Controls.Add(Me.ucrDataFrameMeta) ' + 'ucrColumnMeta + ' + Me.ucrColumnMeta.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + resources.ApplyResources(Me.ucrColumnMeta, "ucrColumnMeta") + Me.ucrColumnMeta.Name = "ucrColumnMeta" + ' + 'ucrDataFrameMeta + ' + Me.ucrDataFrameMeta.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + resources.ApplyResources(Me.ucrDataFrameMeta, "ucrDataFrameMeta") + Me.ucrDataFrameMeta.Name = "ucrDataFrameMeta" + ' 'splLogScript ' Me.splLogScript.BackColor = System.Drawing.Color.LightGray @@ -4069,6 +4081,19 @@ Partial Class frmMain Me.splLogScript.Panel2.BackColor = System.Drawing.SystemColors.Control Me.splLogScript.Panel2.Controls.Add(Me.ucrScriptWindow) ' + 'ucrLogWindow + ' + Me.ucrLogWindow.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + resources.ApplyResources(Me.ucrLogWindow, "ucrLogWindow") + Me.ucrLogWindow.Name = "ucrLogWindow" + ' + 'ucrScriptWindow + ' + Me.ucrScriptWindow.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + resources.ApplyResources(Me.ucrScriptWindow, "ucrScriptWindow") + Me.ucrScriptWindow.Name = "ucrScriptWindow" + Me.ucrScriptWindow.Tag = "Script_Window" + ' 'splDataOutput ' Me.splDataOutput.BackColor = System.Drawing.Color.LightGray @@ -4085,6 +4110,20 @@ Partial Class frmMain Me.splDataOutput.Panel2.BackColor = System.Drawing.SystemColors.Control Me.splDataOutput.Panel2.Controls.Add(Me.ucrOutput) ' + 'ucrDataViewer + ' + Me.ucrDataViewer.BackColor = System.Drawing.SystemColors.Control + Me.ucrDataViewer.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + resources.ApplyResources(Me.ucrDataViewer, "ucrDataViewer") + Me.ucrDataViewer.Name = "ucrDataViewer" + Me.ucrDataViewer.Tag = "Data_View" + ' + 'ucrOutput + ' + Me.ucrOutput.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + resources.ApplyResources(Me.ucrOutput, "ucrOutput") + Me.ucrOutput.Name = "ucrOutput" + ' 'mnuRViewer ' Me.mnuRViewer.Name = "mnuRViewer" @@ -4115,45 +4154,6 @@ Partial Class frmMain Me.mnuLogFile.Name = "mnuLogFile" resources.ApplyResources(Me.mnuLogFile, "mnuLogFile") ' - 'ucrColumnMeta - ' - Me.ucrColumnMeta.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle - resources.ApplyResources(Me.ucrColumnMeta, "ucrColumnMeta") - Me.ucrColumnMeta.Name = "ucrColumnMeta" - ' - 'ucrDataFrameMeta - ' - Me.ucrDataFrameMeta.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle - resources.ApplyResources(Me.ucrDataFrameMeta, "ucrDataFrameMeta") - Me.ucrDataFrameMeta.Name = "ucrDataFrameMeta" - ' - 'ucrLogWindow - ' - Me.ucrLogWindow.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle - resources.ApplyResources(Me.ucrLogWindow, "ucrLogWindow") - Me.ucrLogWindow.Name = "ucrLogWindow" - ' - 'ucrScriptWindow - ' - Me.ucrScriptWindow.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle - resources.ApplyResources(Me.ucrScriptWindow, "ucrScriptWindow") - Me.ucrScriptWindow.Name = "ucrScriptWindow" - Me.ucrScriptWindow.Tag = "Script_Window" - ' - 'ucrDataViewer - ' - Me.ucrDataViewer.BackColor = System.Drawing.SystemColors.Control - Me.ucrDataViewer.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle - resources.ApplyResources(Me.ucrDataViewer, "ucrDataViewer") - Me.ucrDataViewer.Name = "ucrDataViewer" - Me.ucrDataViewer.Tag = "Data_View" - ' - 'ucrOutput - ' - Me.ucrOutput.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle - resources.ApplyResources(Me.ucrOutput, "ucrOutput") - Me.ucrOutput.Name = "ucrOutput" - ' 'frmMain ' resources.ApplyResources(Me, "$this") diff --git a/instat/frmMain.resx b/instat/frmMain.resx index ce3a9c26d1b..77c067d078f 100644 --- a/instat/frmMain.resx +++ b/instat/frmMain.resx @@ -2436,16 +2436,16 @@ Output Window - 196, 22 + 202, 22 - Column Metadata... + Column Metadata... - 196, 22 + 202, 22 - Data Frame Metadata... + Data Frame Metadata... @@ -2504,16 +2504,16 @@ Column Metadata - 160, 22 + 180, 22 - Log Window... + Log Window... - 160, 22 + 180, 22 - Script Window... + Script Window... @@ -2650,7 +2650,7 @@ 34, 34 - Reset Layout + Reset to Default Layout 6, 37 @@ -3561,9 +3561,6 @@ Scatter Plot... - - False - 192, 22 @@ -6447,9 +6444,6 @@ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - - NoControl - R-Instat diff --git a/instat/frmMain.vb b/instat/frmMain.vb index ed28737981b..350005c44ba 100644 --- a/instat/frmMain.vb +++ b/instat/frmMain.vb @@ -87,6 +87,7 @@ Public Class frmMain ' Decimal point must be `.` and not `,` because R only accepts `.` Thread.CurrentThread.CurrentCulture = New CultureInfo("en-GB") + ucrDataViewer.StartupMenuItemsVisibility(False) InitialiseOutputWindow() clsGrids.SetDataViewer(ucrDataViewer) clsGrids.SetMetadata(ucrDataFrameMeta.grdMetaData) @@ -133,6 +134,7 @@ Public Class frmMain clsRecentItems.SetDataViewWindow(ucrDataViewer) 'checks existence of MRU list clsRecentItems.checkOnLoad() + ucrDataViewer.StartupMenuItemsVisibility(True) Cursor = Cursors.Default SetMainMenusEnabled(True) @@ -273,6 +275,10 @@ Public Class frmMain mnuViewDataFrameMetadata.Checked = False mnuViewColumnMetadata.Checked = False mnuViewScriptWindow.Checked = False + mnuLogWindow.Checked = False + mnuScriptWindow.Checked = False + mnuColumnMetadat.Checked = False + mnuDataFrameMetadat.Checked = False mnuTbDataView.Checked = True mnuTbOutput.Checked = True @@ -459,21 +465,25 @@ Public Class frmMain Private Sub mnuWindowVariable_Click(sender As Object, e As EventArgs) Handles mnuViewColumnMetadata.Click mnuViewColumnMetadata.Checked = Not mnuViewColumnMetadata.Checked + mnuColumnMetadat.Checked = mnuViewColumnMetadata.Checked UpdateLayout() End Sub Private Sub mnuWindowDataFrame_Click(sender As Object, e As EventArgs) Handles mnuViewDataFrameMetadata.Click mnuViewDataFrameMetadata.Checked = Not mnuViewDataFrameMetadata.Checked + mnuDataFrameMetadat.Checked = mnuViewDataFrameMetadata.Checked UpdateLayout() End Sub Private Sub LogToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles mnuViewLog.Click mnuViewLog.Checked = Not mnuViewLog.Checked + mnuLogWindow.Checked = mnuViewLog.Checked UpdateLayout() End Sub Private Sub ScriptToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles mnuViewScriptWindow.Click mnuViewScriptWindow.Checked = Not mnuViewScriptWindow.Checked + mnuScriptWindow.Checked = mnuViewScriptWindow.Checked UpdateLayout() End Sub @@ -2053,31 +2063,37 @@ Public Class frmMain Private Sub MnuMetadata_ButtonClick(sender As Object, e As EventArgs) Handles mnuMetadata.ButtonClick mnuViewColumnMetadata.Checked = Not mnuViewColumnMetadata.Checked + mnuColumnMetadat.Checked = mnuViewColumnMetadata.Checked UpdateLayout() End Sub Private Sub MnuTbLog_ButtonClick(sender As Object, e As EventArgs) Handles mnuTbLog.ButtonClick mnuViewLog.Checked = Not mnuViewLog.Checked + mnuLogWindow.Checked = mnuViewLog.Checked UpdateLayout() End Sub Private Sub MnuColumnMetadat_Click(sender As Object, e As EventArgs) Handles mnuColumnMetadat.Click mnuViewColumnMetadata.Checked = Not mnuViewColumnMetadata.Checked + mnuColumnMetadat.Checked = mnuViewColumnMetadata.Checked UpdateLayout() End Sub Private Sub MnuDataFrameMetadat_Click(sender As Object, e As EventArgs) Handles mnuDataFrameMetadat.Click mnuViewDataFrameMetadata.Checked = Not mnuViewDataFrameMetadata.Checked + mnuDataFrameMetadat.Checked = mnuViewDataFrameMetadata.Checked UpdateLayout() End Sub Private Sub MnuScriptWindow_Click(sender As Object, e As EventArgs) Handles mnuScriptWindow.Click mnuViewScriptWindow.Checked = Not mnuViewScriptWindow.Checked + mnuScriptWindow.Checked = mnuViewScriptWindow.Checked UpdateLayout() End Sub Private Sub MnuLogWindow_Click(sender As Object, e As EventArgs) Handles mnuLogWindow.Click mnuViewLog.Checked = Not mnuViewLog.Checked + mnuLogWindow.Checked = mnuViewLog.Checked UpdateLayout() End Sub @@ -2278,4 +2294,8 @@ Public Class frmMain Private Sub mnuClimaticNCMPSummary_Click(sender As Object, e As EventArgs) Handles mnuClimaticNCMPSummary.Click dlgClimaticNCMPSummaryFile.ShowDialog() End Sub + + Private Sub mnuStructuredCircularDensityPlot_Click(sender As Object, e As EventArgs) Handles mnuStructuredCircularDensityPlot.Click + dlgCircularDensityPlot.ShowDialog() + End Sub End Class \ No newline at end of file diff --git a/instat/sdgInventoryPlot.Designer.vb b/instat/sdgInventoryPlot.Designer.vb index e6db2a894fa..499f9326b9e 100644 --- a/instat/sdgInventoryPlot.Designer.vb +++ b/instat/sdgInventoryPlot.Designer.vb @@ -26,65 +26,63 @@ Partial Class sdgInventoryPlot Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(sdgInventoryPlot)) Me.tbInventory = New System.Windows.Forms.TabControl() Me.tpFacets = New System.Windows.Forms.TabPage() + Me.ucrNudNumberofRows = New instat.ucrNud() + Me.ucrChkNoOfRowsOrColumns = New instat.ucrCheck() Me.rdoHorizontal = New System.Windows.Forms.RadioButton() Me.rdoVertical = New System.Windows.Forms.RadioButton() + Me.ucrPnlHorizonatalVertical = New instat.UcrPanel() + Me.ucrChkFacetYSize = New instat.ucrCheck() + Me.ucrNudFacetYSize = New instat.ucrNud() + Me.ucrChkFacetXSize = New instat.ucrCheck() + Me.ucrNudFacetXSize = New instat.ucrNud() + Me.ucrChkScales = New instat.ucrCheck() + Me.ucrInputScale = New instat.ucrInputComboBox() Me.tpTitles = New System.Windows.Forms.TabPage() Me.grpyAxisTitle = New System.Windows.Forms.GroupBox() - Me.Label2 = New System.Windows.Forms.Label() + Me.lblYAxisSize = New System.Windows.Forms.Label() Me.rdoAutoYAxis = New System.Windows.Forms.RadioButton() + Me.ucrInputYAxisTitle = New instat.ucrInputTextBox() Me.rdoNoYAxisTitle = New System.Windows.Forms.RadioButton() + Me.ucrNudYAxisTitleSize = New instat.ucrNud() Me.rdoSpecifyYAxisTitle = New System.Windows.Forms.RadioButton() + Me.UcrPnlYAxisTitle = New instat.UcrPanel() Me.lblYAxisTitleSize = New System.Windows.Forms.Label() Me.grpAxes = New System.Windows.Forms.GroupBox() - Me.Label1 = New System.Windows.Forms.Label() + Me.lblXAxisSize = New System.Windows.Forms.Label() Me.rdoAutoXAxis = New System.Windows.Forms.RadioButton() + Me.ucrNudXaxisTitleSize = New instat.ucrNud() + Me.ucrInputXAxisTitle = New instat.ucrInputTextBox() Me.rdoNoTitleXAxisTitle = New System.Windows.Forms.RadioButton() Me.rdoSpecifyXAxisTitle = New System.Windows.Forms.RadioButton() + Me.ucrPnlXAxisTitle = New instat.UcrPanel() Me.grpGraphTitles = New System.Windows.Forms.GroupBox() + Me.ucrNudTitleSize = New instat.ucrNud() Me.lblCaptionSize = New System.Windows.Forms.Label() Me.lblSubTitleSize = New System.Windows.Forms.Label() Me.lblTitleSize = New System.Windows.Forms.Label() Me.lblCaption = New System.Windows.Forms.Label() Me.lblSubTitle = New System.Windows.Forms.Label() Me.lblTitle = New System.Windows.Forms.Label() - Me.tpXAxis = New System.Windows.Forms.TabPage() - Me.grpXAxisLabels = New System.Windows.Forms.GroupBox() - Me.lblXFrom = New System.Windows.Forms.Label() - Me.lblXInStepsOf = New System.Windows.Forms.Label() - Me.lblXTo = New System.Windows.Forms.Label() - Me.tpYAxis = New System.Windows.Forms.TabPage() - Me.lblDateDisplayFormat = New System.Windows.Forms.Label() - Me.tpLegend = New System.Windows.Forms.TabPage() - Me.ttInventoryPlot = New System.Windows.Forms.ToolTip(Me.components) - Me.ucrNudNumberofRows = New instat.ucrNud() - Me.ucrChkNoOfRowsOrColumns = New instat.ucrCheck() - Me.ucrPnlHorizonatalVertical = New instat.UcrPanel() - Me.ucrChkFacetYSize = New instat.ucrCheck() - Me.ucrNudFacetYSize = New instat.ucrNud() - Me.ucrChkFacetXSize = New instat.ucrCheck() - Me.ucrNudFacetXSize = New instat.ucrNud() - Me.ucrChkScales = New instat.ucrCheck() - Me.ucrInputScale = New instat.ucrInputComboBox() - Me.ucrInputYAxisTitle = New instat.ucrInputTextBox() - Me.ucrNudYAxisTitleSize = New instat.ucrNud() - Me.UcrPnlYAxisTitle = New instat.UcrPanel() - Me.ucrNudXaxisTitleSize = New instat.ucrNud() - Me.ucrInputXAxisTitle = New instat.ucrInputTextBox() - Me.ucrPnlXAxisTitle = New instat.UcrPanel() - Me.ucrNudTitleSize = New instat.ucrNud() Me.ucrNudCaptionSize = New instat.ucrNud() Me.ucrNudSubTitleSize = New instat.ucrNud() Me.ucrInputGraphcCaption = New instat.ucrInputTextBox() Me.ucrInputGraphTitle = New instat.ucrInputTextBox() Me.ucrInputGraphSubTitle = New instat.ucrInputTextBox() + Me.tpXAxis = New System.Windows.Forms.TabPage() + Me.grpXAxisLabels = New System.Windows.Forms.GroupBox() Me.ucrChkSpecifyXAxisTickMarks = New instat.ucrCheck() Me.ucrNudXAxisLabelSize = New instat.ucrNud() Me.ucrChkXAxisAngle = New instat.ucrCheck() Me.ucrNudXAxisAngle = New instat.ucrNud() Me.ucrChkXAxisLabelSize = New instat.ucrCheck() + Me.lblXFrom = New System.Windows.Forms.Label() Me.ucrInputXFrom = New instat.ucrInputTextBox() Me.ucrInputXInStepsOf = New instat.ucrInputTextBox() Me.ucrInputXTo = New instat.ucrInputTextBox() + Me.lblXInStepsOf = New System.Windows.Forms.Label() + Me.lblXTo = New System.Windows.Forms.Label() + Me.tpYAxis = New System.Windows.Forms.TabPage() + Me.lblDateDisplayFormat = New System.Windows.Forms.Label() Me.ucrNudDateBreakNumber = New instat.ucrNud() Me.ucrInputDateBreakTime = New instat.ucrInputComboBox() Me.ucrChkSpecifyDateBreaks = New instat.ucrCheck() @@ -93,9 +91,12 @@ Partial Class sdgInventoryPlot Me.ucrNudYAxisLabelSize = New instat.ucrNud() Me.ucrChkYAxisAngle = New instat.ucrCheck() Me.ucrChkYAxisLabelSize = New instat.ucrCheck() + Me.tpLegend = New System.Windows.Forms.TabPage() Me.ucrInputLegendPosition = New instat.ucrInputComboBox() Me.ucrChkLegendPosition = New instat.ucrCheck() + Me.ttInventoryPlot = New System.Windows.Forms.ToolTip(Me.components) Me.ucrButtonsInventoryplot = New instat.ucrButtonsSubdialogue() + Me.grpYAxis = New System.Windows.Forms.GroupBox() Me.tbInventory.SuspendLayout() Me.tpFacets.SuspendLayout() Me.tpTitles.SuspendLayout() @@ -106,6 +107,7 @@ Partial Class sdgInventoryPlot Me.grpXAxisLabels.SuspendLayout() Me.tpYAxis.SuspendLayout() Me.tpLegend.SuspendLayout() + Me.grpYAxis.SuspendLayout() Me.SuspendLayout() ' 'tbInventory @@ -136,6 +138,22 @@ Partial Class sdgInventoryPlot Me.tpFacets.Name = "tpFacets" Me.tpFacets.UseVisualStyleBackColor = True ' + 'ucrNudNumberofRows + ' + Me.ucrNudNumberofRows.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudNumberofRows.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + resources.ApplyResources(Me.ucrNudNumberofRows, "ucrNudNumberofRows") + Me.ucrNudNumberofRows.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudNumberofRows.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudNumberofRows.Name = "ucrNudNumberofRows" + Me.ucrNudNumberofRows.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrChkNoOfRowsOrColumns + ' + Me.ucrChkNoOfRowsOrColumns.Checked = False + resources.ApplyResources(Me.ucrChkNoOfRowsOrColumns, "ucrChkNoOfRowsOrColumns") + Me.ucrChkNoOfRowsOrColumns.Name = "ucrChkNoOfRowsOrColumns" + ' 'rdoHorizontal ' resources.ApplyResources(Me.rdoHorizontal, "rdoHorizontal") @@ -152,6 +170,57 @@ Partial Class sdgInventoryPlot Me.rdoVertical.Tag = "Vertical" Me.rdoVertical.UseVisualStyleBackColor = True ' + 'ucrPnlHorizonatalVertical + ' + resources.ApplyResources(Me.ucrPnlHorizonatalVertical, "ucrPnlHorizonatalVertical") + Me.ucrPnlHorizonatalVertical.Name = "ucrPnlHorizonatalVertical" + ' + 'ucrChkFacetYSize + ' + Me.ucrChkFacetYSize.Checked = False + resources.ApplyResources(Me.ucrChkFacetYSize, "ucrChkFacetYSize") + Me.ucrChkFacetYSize.Name = "ucrChkFacetYSize" + ' + 'ucrNudFacetYSize + ' + Me.ucrNudFacetYSize.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudFacetYSize.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + resources.ApplyResources(Me.ucrNudFacetYSize, "ucrNudFacetYSize") + Me.ucrNudFacetYSize.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudFacetYSize.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudFacetYSize.Name = "ucrNudFacetYSize" + Me.ucrNudFacetYSize.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrChkFacetXSize + ' + Me.ucrChkFacetXSize.Checked = False + resources.ApplyResources(Me.ucrChkFacetXSize, "ucrChkFacetXSize") + Me.ucrChkFacetXSize.Name = "ucrChkFacetXSize" + ' + 'ucrNudFacetXSize + ' + Me.ucrNudFacetXSize.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudFacetXSize.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + resources.ApplyResources(Me.ucrNudFacetXSize, "ucrNudFacetXSize") + Me.ucrNudFacetXSize.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudFacetXSize.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudFacetXSize.Name = "ucrNudFacetXSize" + Me.ucrNudFacetXSize.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrChkScales + ' + Me.ucrChkScales.Checked = False + resources.ApplyResources(Me.ucrChkScales, "ucrChkScales") + Me.ucrChkScales.Name = "ucrChkScales" + ' + 'ucrInputScale + ' + Me.ucrInputScale.AddQuotesIfUnrecognised = True + Me.ucrInputScale.GetSetSelectedIndex = -1 + Me.ucrInputScale.IsReadOnly = False + resources.ApplyResources(Me.ucrInputScale, "ucrInputScale") + Me.ucrInputScale.Name = "ucrInputScale" + ' 'tpTitles ' Me.tpTitles.Controls.Add(Me.grpyAxisTitle) @@ -163,7 +232,7 @@ Partial Class sdgInventoryPlot ' 'grpyAxisTitle ' - Me.grpyAxisTitle.Controls.Add(Me.Label2) + Me.grpyAxisTitle.Controls.Add(Me.lblYAxisSize) Me.grpyAxisTitle.Controls.Add(Me.rdoAutoYAxis) Me.grpyAxisTitle.Controls.Add(Me.ucrInputYAxisTitle) Me.grpyAxisTitle.Controls.Add(Me.rdoNoYAxisTitle) @@ -175,10 +244,10 @@ Partial Class sdgInventoryPlot Me.grpyAxisTitle.Name = "grpyAxisTitle" Me.grpyAxisTitle.TabStop = False ' - 'Label2 + 'lblYAxisSize ' - resources.ApplyResources(Me.Label2, "Label2") - Me.Label2.Name = "Label2" + resources.ApplyResources(Me.lblYAxisSize, "lblYAxisSize") + Me.lblYAxisSize.Name = "lblYAxisSize" ' 'rdoAutoYAxis ' @@ -187,6 +256,14 @@ Partial Class sdgInventoryPlot Me.rdoAutoYAxis.TabStop = True Me.rdoAutoYAxis.UseVisualStyleBackColor = True ' + 'ucrInputYAxisTitle + ' + Me.ucrInputYAxisTitle.AddQuotesIfUnrecognised = True + Me.ucrInputYAxisTitle.IsMultiline = False + Me.ucrInputYAxisTitle.IsReadOnly = False + resources.ApplyResources(Me.ucrInputYAxisTitle, "ucrInputYAxisTitle") + Me.ucrInputYAxisTitle.Name = "ucrInputYAxisTitle" + ' 'rdoNoYAxisTitle ' resources.ApplyResources(Me.rdoNoYAxisTitle, "rdoNoYAxisTitle") @@ -194,6 +271,16 @@ Partial Class sdgInventoryPlot Me.rdoNoYAxisTitle.TabStop = True Me.rdoNoYAxisTitle.UseVisualStyleBackColor = True ' + 'ucrNudYAxisTitleSize + ' + Me.ucrNudYAxisTitleSize.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudYAxisTitleSize.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + resources.ApplyResources(Me.ucrNudYAxisTitleSize, "ucrNudYAxisTitleSize") + Me.ucrNudYAxisTitleSize.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudYAxisTitleSize.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudYAxisTitleSize.Name = "ucrNudYAxisTitleSize" + Me.ucrNudYAxisTitleSize.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' 'rdoSpecifyYAxisTitle ' resources.ApplyResources(Me.rdoSpecifyYAxisTitle, "rdoSpecifyYAxisTitle") @@ -201,6 +288,11 @@ Partial Class sdgInventoryPlot Me.rdoSpecifyYAxisTitle.TabStop = True Me.rdoSpecifyYAxisTitle.UseVisualStyleBackColor = True ' + 'UcrPnlYAxisTitle + ' + resources.ApplyResources(Me.UcrPnlYAxisTitle, "UcrPnlYAxisTitle") + Me.UcrPnlYAxisTitle.Name = "UcrPnlYAxisTitle" + ' 'lblYAxisTitleSize ' resources.ApplyResources(Me.lblYAxisTitleSize, "lblYAxisTitleSize") @@ -208,7 +300,7 @@ Partial Class sdgInventoryPlot ' 'grpAxes ' - Me.grpAxes.Controls.Add(Me.Label1) + Me.grpAxes.Controls.Add(Me.lblXAxisSize) Me.grpAxes.Controls.Add(Me.rdoAutoXAxis) Me.grpAxes.Controls.Add(Me.ucrNudXaxisTitleSize) Me.grpAxes.Controls.Add(Me.ucrInputXAxisTitle) @@ -219,10 +311,10 @@ Partial Class sdgInventoryPlot Me.grpAxes.Name = "grpAxes" Me.grpAxes.TabStop = False ' - 'Label1 + 'lblXAxisSize ' - resources.ApplyResources(Me.Label1, "Label1") - Me.Label1.Name = "Label1" + resources.ApplyResources(Me.lblXAxisSize, "lblXAxisSize") + Me.lblXAxisSize.Name = "lblXAxisSize" ' 'rdoAutoXAxis ' @@ -231,6 +323,24 @@ Partial Class sdgInventoryPlot Me.rdoAutoXAxis.TabStop = True Me.rdoAutoXAxis.UseVisualStyleBackColor = True ' + 'ucrNudXaxisTitleSize + ' + Me.ucrNudXaxisTitleSize.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudXaxisTitleSize.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + resources.ApplyResources(Me.ucrNudXaxisTitleSize, "ucrNudXaxisTitleSize") + Me.ucrNudXaxisTitleSize.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudXaxisTitleSize.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudXaxisTitleSize.Name = "ucrNudXaxisTitleSize" + Me.ucrNudXaxisTitleSize.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrInputXAxisTitle + ' + Me.ucrInputXAxisTitle.AddQuotesIfUnrecognised = True + Me.ucrInputXAxisTitle.IsMultiline = False + Me.ucrInputXAxisTitle.IsReadOnly = False + resources.ApplyResources(Me.ucrInputXAxisTitle, "ucrInputXAxisTitle") + Me.ucrInputXAxisTitle.Name = "ucrInputXAxisTitle" + ' 'rdoNoTitleXAxisTitle ' resources.ApplyResources(Me.rdoNoTitleXAxisTitle, "rdoNoTitleXAxisTitle") @@ -245,6 +355,11 @@ Partial Class sdgInventoryPlot Me.rdoSpecifyXAxisTitle.TabStop = True Me.rdoSpecifyXAxisTitle.UseVisualStyleBackColor = True ' + 'ucrPnlXAxisTitle + ' + resources.ApplyResources(Me.ucrPnlXAxisTitle, "ucrPnlXAxisTitle") + Me.ucrPnlXAxisTitle.Name = "ucrPnlXAxisTitle" + ' 'grpGraphTitles ' Me.grpGraphTitles.Controls.Add(Me.ucrNudTitleSize) @@ -263,6 +378,16 @@ Partial Class sdgInventoryPlot Me.grpGraphTitles.Name = "grpGraphTitles" Me.grpGraphTitles.TabStop = False ' + 'ucrNudTitleSize + ' + Me.ucrNudTitleSize.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudTitleSize.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + resources.ApplyResources(Me.ucrNudTitleSize, "ucrNudTitleSize") + Me.ucrNudTitleSize.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudTitleSize.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudTitleSize.Name = "ucrNudTitleSize" + Me.ucrNudTitleSize.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' 'lblCaptionSize ' resources.ApplyResources(Me.lblCaptionSize, "lblCaptionSize") @@ -293,202 +418,6 @@ Partial Class sdgInventoryPlot resources.ApplyResources(Me.lblTitle, "lblTitle") Me.lblTitle.Name = "lblTitle" ' - 'tpXAxis - ' - Me.tpXAxis.Controls.Add(Me.grpXAxisLabels) - resources.ApplyResources(Me.tpXAxis, "tpXAxis") - Me.tpXAxis.Name = "tpXAxis" - Me.tpXAxis.UseVisualStyleBackColor = True - ' - 'grpXAxisLabels - ' - Me.grpXAxisLabels.Controls.Add(Me.ucrChkSpecifyXAxisTickMarks) - Me.grpXAxisLabels.Controls.Add(Me.ucrNudXAxisLabelSize) - Me.grpXAxisLabels.Controls.Add(Me.ucrChkXAxisAngle) - Me.grpXAxisLabels.Controls.Add(Me.ucrNudXAxisAngle) - Me.grpXAxisLabels.Controls.Add(Me.ucrChkXAxisLabelSize) - Me.grpXAxisLabels.Controls.Add(Me.lblXFrom) - Me.grpXAxisLabels.Controls.Add(Me.ucrInputXFrom) - Me.grpXAxisLabels.Controls.Add(Me.ucrInputXInStepsOf) - Me.grpXAxisLabels.Controls.Add(Me.ucrInputXTo) - Me.grpXAxisLabels.Controls.Add(Me.lblXInStepsOf) - Me.grpXAxisLabels.Controls.Add(Me.lblXTo) - resources.ApplyResources(Me.grpXAxisLabels, "grpXAxisLabels") - Me.grpXAxisLabels.Name = "grpXAxisLabels" - Me.grpXAxisLabels.TabStop = False - ' - 'lblXFrom - ' - resources.ApplyResources(Me.lblXFrom, "lblXFrom") - Me.lblXFrom.Name = "lblXFrom" - ' - 'lblXInStepsOf - ' - resources.ApplyResources(Me.lblXInStepsOf, "lblXInStepsOf") - Me.lblXInStepsOf.Name = "lblXInStepsOf" - ' - 'lblXTo - ' - resources.ApplyResources(Me.lblXTo, "lblXTo") - Me.lblXTo.Name = "lblXTo" - ' - 'tpYAxis - ' - Me.tpYAxis.Controls.Add(Me.lblDateDisplayFormat) - Me.tpYAxis.Controls.Add(Me.ucrNudDateBreakNumber) - Me.tpYAxis.Controls.Add(Me.ucrInputDateBreakTime) - Me.tpYAxis.Controls.Add(Me.ucrChkSpecifyDateBreaks) - Me.tpYAxis.Controls.Add(Me.ucrInputDateDisplayFormat) - Me.tpYAxis.Controls.Add(Me.ucrNudYAxisAngle) - Me.tpYAxis.Controls.Add(Me.ucrNudYAxisLabelSize) - Me.tpYAxis.Controls.Add(Me.ucrChkYAxisAngle) - Me.tpYAxis.Controls.Add(Me.ucrChkYAxisLabelSize) - resources.ApplyResources(Me.tpYAxis, "tpYAxis") - Me.tpYAxis.Name = "tpYAxis" - Me.tpYAxis.UseVisualStyleBackColor = True - ' - 'lblDateDisplayFormat - ' - resources.ApplyResources(Me.lblDateDisplayFormat, "lblDateDisplayFormat") - Me.lblDateDisplayFormat.Name = "lblDateDisplayFormat" - ' - 'tpLegend - ' - Me.tpLegend.Controls.Add(Me.ucrInputLegendPosition) - Me.tpLegend.Controls.Add(Me.ucrChkLegendPosition) - resources.ApplyResources(Me.tpLegend, "tpLegend") - Me.tpLegend.Name = "tpLegend" - Me.tpLegend.UseVisualStyleBackColor = True - ' - 'ttInventoryPlot - ' - Me.ttInventoryPlot.AutoPopDelay = 10000 - Me.ttInventoryPlot.InitialDelay = 500 - Me.ttInventoryPlot.ReshowDelay = 100 - ' - 'ucrNudNumberofRows - ' - Me.ucrNudNumberofRows.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudNumberofRows.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - resources.ApplyResources(Me.ucrNudNumberofRows, "ucrNudNumberofRows") - Me.ucrNudNumberofRows.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudNumberofRows.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudNumberofRows.Name = "ucrNudNumberofRows" - Me.ucrNudNumberofRows.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrChkNoOfRowsOrColumns - ' - Me.ucrChkNoOfRowsOrColumns.Checked = False - resources.ApplyResources(Me.ucrChkNoOfRowsOrColumns, "ucrChkNoOfRowsOrColumns") - Me.ucrChkNoOfRowsOrColumns.Name = "ucrChkNoOfRowsOrColumns" - ' - 'ucrPnlHorizonatalVertical - ' - resources.ApplyResources(Me.ucrPnlHorizonatalVertical, "ucrPnlHorizonatalVertical") - Me.ucrPnlHorizonatalVertical.Name = "ucrPnlHorizonatalVertical" - ' - 'ucrChkFacetYSize - ' - Me.ucrChkFacetYSize.Checked = False - resources.ApplyResources(Me.ucrChkFacetYSize, "ucrChkFacetYSize") - Me.ucrChkFacetYSize.Name = "ucrChkFacetYSize" - ' - 'ucrNudFacetYSize - ' - Me.ucrNudFacetYSize.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudFacetYSize.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - resources.ApplyResources(Me.ucrNudFacetYSize, "ucrNudFacetYSize") - Me.ucrNudFacetYSize.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudFacetYSize.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudFacetYSize.Name = "ucrNudFacetYSize" - Me.ucrNudFacetYSize.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrChkFacetXSize - ' - Me.ucrChkFacetXSize.Checked = False - resources.ApplyResources(Me.ucrChkFacetXSize, "ucrChkFacetXSize") - Me.ucrChkFacetXSize.Name = "ucrChkFacetXSize" - ' - 'ucrNudFacetXSize - ' - Me.ucrNudFacetXSize.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudFacetXSize.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - resources.ApplyResources(Me.ucrNudFacetXSize, "ucrNudFacetXSize") - Me.ucrNudFacetXSize.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudFacetXSize.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudFacetXSize.Name = "ucrNudFacetXSize" - Me.ucrNudFacetXSize.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrChkScales - ' - Me.ucrChkScales.Checked = False - resources.ApplyResources(Me.ucrChkScales, "ucrChkScales") - Me.ucrChkScales.Name = "ucrChkScales" - ' - 'ucrInputScale - ' - Me.ucrInputScale.AddQuotesIfUnrecognised = True - Me.ucrInputScale.GetSetSelectedIndex = -1 - Me.ucrInputScale.IsReadOnly = False - resources.ApplyResources(Me.ucrInputScale, "ucrInputScale") - Me.ucrInputScale.Name = "ucrInputScale" - ' - 'ucrInputYAxisTitle - ' - Me.ucrInputYAxisTitle.AddQuotesIfUnrecognised = True - Me.ucrInputYAxisTitle.IsMultiline = False - Me.ucrInputYAxisTitle.IsReadOnly = False - resources.ApplyResources(Me.ucrInputYAxisTitle, "ucrInputYAxisTitle") - Me.ucrInputYAxisTitle.Name = "ucrInputYAxisTitle" - ' - 'ucrNudYAxisTitleSize - ' - Me.ucrNudYAxisTitleSize.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudYAxisTitleSize.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - resources.ApplyResources(Me.ucrNudYAxisTitleSize, "ucrNudYAxisTitleSize") - Me.ucrNudYAxisTitleSize.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudYAxisTitleSize.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudYAxisTitleSize.Name = "ucrNudYAxisTitleSize" - Me.ucrNudYAxisTitleSize.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'UcrPnlYAxisTitle - ' - resources.ApplyResources(Me.UcrPnlYAxisTitle, "UcrPnlYAxisTitle") - Me.UcrPnlYAxisTitle.Name = "UcrPnlYAxisTitle" - ' - 'ucrNudXaxisTitleSize - ' - Me.ucrNudXaxisTitleSize.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudXaxisTitleSize.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - resources.ApplyResources(Me.ucrNudXaxisTitleSize, "ucrNudXaxisTitleSize") - Me.ucrNudXaxisTitleSize.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudXaxisTitleSize.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudXaxisTitleSize.Name = "ucrNudXaxisTitleSize" - Me.ucrNudXaxisTitleSize.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrInputXAxisTitle - ' - Me.ucrInputXAxisTitle.AddQuotesIfUnrecognised = True - Me.ucrInputXAxisTitle.IsMultiline = False - Me.ucrInputXAxisTitle.IsReadOnly = False - resources.ApplyResources(Me.ucrInputXAxisTitle, "ucrInputXAxisTitle") - Me.ucrInputXAxisTitle.Name = "ucrInputXAxisTitle" - ' - 'ucrPnlXAxisTitle - ' - resources.ApplyResources(Me.ucrPnlXAxisTitle, "ucrPnlXAxisTitle") - Me.ucrPnlXAxisTitle.Name = "ucrPnlXAxisTitle" - ' - 'ucrNudTitleSize - ' - Me.ucrNudTitleSize.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudTitleSize.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - resources.ApplyResources(Me.ucrNudTitleSize, "ucrNudTitleSize") - Me.ucrNudTitleSize.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudTitleSize.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudTitleSize.Name = "ucrNudTitleSize" - Me.ucrNudTitleSize.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' 'ucrNudCaptionSize ' Me.ucrNudCaptionSize.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) @@ -533,6 +462,30 @@ Partial Class sdgInventoryPlot resources.ApplyResources(Me.ucrInputGraphSubTitle, "ucrInputGraphSubTitle") Me.ucrInputGraphSubTitle.Name = "ucrInputGraphSubTitle" ' + 'tpXAxis + ' + Me.tpXAxis.Controls.Add(Me.grpXAxisLabels) + resources.ApplyResources(Me.tpXAxis, "tpXAxis") + Me.tpXAxis.Name = "tpXAxis" + Me.tpXAxis.UseVisualStyleBackColor = True + ' + 'grpXAxisLabels + ' + Me.grpXAxisLabels.Controls.Add(Me.ucrChkSpecifyXAxisTickMarks) + Me.grpXAxisLabels.Controls.Add(Me.ucrNudXAxisLabelSize) + Me.grpXAxisLabels.Controls.Add(Me.ucrChkXAxisAngle) + Me.grpXAxisLabels.Controls.Add(Me.ucrNudXAxisAngle) + Me.grpXAxisLabels.Controls.Add(Me.ucrChkXAxisLabelSize) + Me.grpXAxisLabels.Controls.Add(Me.lblXFrom) + Me.grpXAxisLabels.Controls.Add(Me.ucrInputXFrom) + Me.grpXAxisLabels.Controls.Add(Me.ucrInputXInStepsOf) + Me.grpXAxisLabels.Controls.Add(Me.ucrInputXTo) + Me.grpXAxisLabels.Controls.Add(Me.lblXInStepsOf) + Me.grpXAxisLabels.Controls.Add(Me.lblXTo) + resources.ApplyResources(Me.grpXAxisLabels, "grpXAxisLabels") + Me.grpXAxisLabels.Name = "grpXAxisLabels" + Me.grpXAxisLabels.TabStop = False + ' 'ucrChkSpecifyXAxisTickMarks ' Me.ucrChkSpecifyXAxisTickMarks.Checked = False @@ -571,6 +524,11 @@ Partial Class sdgInventoryPlot resources.ApplyResources(Me.ucrChkXAxisLabelSize, "ucrChkXAxisLabelSize") Me.ucrChkXAxisLabelSize.Name = "ucrChkXAxisLabelSize" ' + 'lblXFrom + ' + resources.ApplyResources(Me.lblXFrom, "lblXFrom") + Me.lblXFrom.Name = "lblXFrom" + ' 'ucrInputXFrom ' Me.ucrInputXFrom.AddQuotesIfUnrecognised = True @@ -595,6 +553,28 @@ Partial Class sdgInventoryPlot resources.ApplyResources(Me.ucrInputXTo, "ucrInputXTo") Me.ucrInputXTo.Name = "ucrInputXTo" ' + 'lblXInStepsOf + ' + resources.ApplyResources(Me.lblXInStepsOf, "lblXInStepsOf") + Me.lblXInStepsOf.Name = "lblXInStepsOf" + ' + 'lblXTo + ' + resources.ApplyResources(Me.lblXTo, "lblXTo") + Me.lblXTo.Name = "lblXTo" + ' + 'tpYAxis + ' + Me.tpYAxis.Controls.Add(Me.grpYAxis) + resources.ApplyResources(Me.tpYAxis, "tpYAxis") + Me.tpYAxis.Name = "tpYAxis" + Me.tpYAxis.UseVisualStyleBackColor = True + ' + 'lblDateDisplayFormat + ' + resources.ApplyResources(Me.lblDateDisplayFormat, "lblDateDisplayFormat") + Me.lblDateDisplayFormat.Name = "lblDateDisplayFormat" + ' 'ucrNudDateBreakNumber ' Me.ucrNudDateBreakNumber.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) @@ -659,6 +639,14 @@ Partial Class sdgInventoryPlot resources.ApplyResources(Me.ucrChkYAxisLabelSize, "ucrChkYAxisLabelSize") Me.ucrChkYAxisLabelSize.Name = "ucrChkYAxisLabelSize" ' + 'tpLegend + ' + Me.tpLegend.Controls.Add(Me.ucrInputLegendPosition) + Me.tpLegend.Controls.Add(Me.ucrChkLegendPosition) + resources.ApplyResources(Me.tpLegend, "tpLegend") + Me.tpLegend.Name = "tpLegend" + Me.tpLegend.UseVisualStyleBackColor = True + ' 'ucrInputLegendPosition ' Me.ucrInputLegendPosition.AddQuotesIfUnrecognised = True @@ -673,11 +661,32 @@ Partial Class sdgInventoryPlot resources.ApplyResources(Me.ucrChkLegendPosition, "ucrChkLegendPosition") Me.ucrChkLegendPosition.Name = "ucrChkLegendPosition" ' + 'ttInventoryPlot + ' + Me.ttInventoryPlot.AutoPopDelay = 10000 + Me.ttInventoryPlot.InitialDelay = 500 + Me.ttInventoryPlot.ReshowDelay = 100 + ' 'ucrButtonsInventoryplot ' resources.ApplyResources(Me.ucrButtonsInventoryplot, "ucrButtonsInventoryplot") Me.ucrButtonsInventoryplot.Name = "ucrButtonsInventoryplot" ' + 'grpYAxis + ' + Me.grpYAxis.Controls.Add(Me.ucrChkSpecifyDateBreaks) + Me.grpYAxis.Controls.Add(Me.ucrNudYAxisLabelSize) + Me.grpYAxis.Controls.Add(Me.ucrNudYAxisAngle) + Me.grpYAxis.Controls.Add(Me.ucrInputDateDisplayFormat) + Me.grpYAxis.Controls.Add(Me.lblDateDisplayFormat) + Me.grpYAxis.Controls.Add(Me.ucrChkYAxisLabelSize) + Me.grpYAxis.Controls.Add(Me.ucrChkYAxisAngle) + Me.grpYAxis.Controls.Add(Me.ucrNudDateBreakNumber) + Me.grpYAxis.Controls.Add(Me.ucrInputDateBreakTime) + resources.ApplyResources(Me.grpYAxis, "grpYAxis") + Me.grpYAxis.Name = "grpYAxis" + Me.grpYAxis.TabStop = False + ' 'sdgInventoryPlot ' resources.ApplyResources(Me, "$this") @@ -702,8 +711,9 @@ Partial Class sdgInventoryPlot Me.grpXAxisLabels.ResumeLayout(False) Me.grpXAxisLabels.PerformLayout() Me.tpYAxis.ResumeLayout(False) - Me.tpYAxis.PerformLayout() Me.tpLegend.ResumeLayout(False) + Me.grpYAxis.ResumeLayout(False) + Me.grpYAxis.PerformLayout() Me.ResumeLayout(False) End Sub @@ -727,7 +737,7 @@ Partial Class sdgInventoryPlot Friend WithEvents UcrPnlYAxisTitle As UcrPanel Friend WithEvents lblYAxisTitleSize As Label Friend WithEvents grpAxes As GroupBox - Friend WithEvents Label1 As Label + Friend WithEvents lblXAxisSize As Label Friend WithEvents rdoAutoXAxis As RadioButton Friend WithEvents ucrNudXaxisTitleSize As ucrNud Friend WithEvents ucrInputXAxisTitle As ucrInputTextBox @@ -778,6 +788,7 @@ Partial Class sdgInventoryPlot Friend WithEvents rdoHorizontal As RadioButton Friend WithEvents rdoVertical As RadioButton Friend WithEvents ucrPnlHorizonatalVertical As UcrPanel - Friend WithEvents Label2 As Label + Friend WithEvents lblYAxisSize As Label Friend WithEvents ucrChkSpecifyXAxisTickMarks As ucrCheck + Friend WithEvents grpYAxis As GroupBox End Class diff --git a/instat/sdgInventoryPlot.resx b/instat/sdgInventoryPlot.resx index f955a8fa9fa..6f1374c456c 100644 --- a/instat/sdgInventoryPlot.resx +++ b/instat/sdgInventoryPlot.resx @@ -119,14 +119,14 @@ - 173, 124 + 126, 125 46, 20 - 59 + 9 ucrNudNumberofRows @@ -141,13 +141,13 @@ 0 - 12, 124 + 12, 125 156, 20 - 58 + 8 ucrChkNoOfRowsOrColumns @@ -169,13 +169,13 @@ NoControl - 12, 94 + 12, 99 72, 17 - 56 + 6 Horizontal @@ -199,13 +199,13 @@ NoControl - 108, 94 + 108, 99 60, 17 - 57 + 7 Vertical @@ -223,7 +223,7 @@ 3 - 12, 92 + 12, 97 165, 20 @@ -244,13 +244,13 @@ 4 - 187, 18 + 12, 44 84, 20 - 55 + 2 ucrChkFacetYSize @@ -265,13 +265,13 @@ 5 - 282, 18 + 126, 44 50, 20 - 54 + 3 ucrNudFacetYSize @@ -292,7 +292,7 @@ 84, 20 - 53 + 0 ucrChkFacetXSize @@ -307,13 +307,13 @@ 7 - 107, 18 + 126, 18 50, 20 - 52 + 1 ucrNudFacetXSize @@ -328,13 +328,13 @@ 8 - 12, 55 + 12, 70 100, 20 - 49 + 4 ucrChkScales @@ -349,13 +349,13 @@ 9 - 166, 55 + 126, 70 137, 21 - 48 + 5 ucrInputScale @@ -376,7 +376,7 @@ 3, 3, 3, 3 - 567, 309 + 507, 271 4 @@ -396,34 +396,34 @@ 0 - + True - + NoControl - - 39, 79 + + 5, 79 - + 30, 13 - - 47 + + 4 - + Size: - - Label2 + + lblYAxisSize - + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + grpyAxisTitle - + 0 @@ -439,7 +439,7 @@ 50, 17 - 44 + 0 Auto @@ -457,16 +457,16 @@ 1 - 6, 44 + 43, 47 7, 6, 7, 6 - 181, 21 + 146, 21 - 14 + 3 ucrInputYAxisTitle @@ -493,7 +493,7 @@ 62, 17 - 42 + 2 No Title @@ -511,7 +511,7 @@ 3 - 70, 75 + 43, 76 5, 5, 5, 5 @@ -520,7 +520,7 @@ 50, 20 - 22 + 5 ucrNudYAxisTitleSize @@ -547,7 +547,7 @@ 60, 17 - 41 + 1 Specify @@ -625,7 +625,7 @@ 240, 111 - 47 + 2 Y-Axis Title @@ -642,34 +642,34 @@ 0 - + True - + NoControl - - 35, 80 + + 5, 79 - + 30, 13 - - 46 + + 4 - + Size: - - Label1 + + lblXAxisSize - + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + grpAxes - + 0 @@ -685,7 +685,7 @@ 50, 17 - 43 + 0 Auto @@ -703,7 +703,7 @@ 1 - 67, 77 + 46, 76 5, 5, 5, 5 @@ -712,7 +712,7 @@ 50, 20 - 45 + 5 ucrNudXaxisTitleSize @@ -727,16 +727,16 @@ 2 - 6, 47 + 46, 47 7, 6, 7, 6 - 181, 21 + 146, 21 - 42 + 3 ucrInputXAxisTitle @@ -763,7 +763,7 @@ 62, 17 - 41 + 2 No Title @@ -793,7 +793,7 @@ 62, 17 - 40 + 1 Specifiy @@ -817,7 +817,7 @@ 5, 5, 5, 5 - 204, 81 + 228, 81 36 @@ -841,7 +841,7 @@ 242, 111 - 46 + 1 X-Axis Title @@ -859,13 +859,13 @@ 1 - 448, 18 + 425, 18 50, 20 - 18 + 3 ucrNudTitleSize @@ -886,13 +886,13 @@ NoControl - 360, 83 + 337, 75 69, 13 - 26 + 10 Caption Size: @@ -916,16 +916,16 @@ NoControl - 360, 53 + 337, 48 - 75, 13 + 68, 13 - 27 + 6 - Sub Title Size: + Subtitle Size: lblSubTitleSize @@ -946,13 +946,13 @@ NoControl - 361, 23 + 337, 20 53, 13 - 28 + 2 Title Size: @@ -976,13 +976,13 @@ NoControl - 5, 83 + 5, 75 78, 13 - 23 + 8 Graph Caption: @@ -1006,16 +1006,16 @@ NoControl - 5, 53 + 5, 48 - 84, 13 + 77, 13 - 24 + 4 - Graph Sub Title: + Graph Subtitle: lblSubTitle @@ -1036,13 +1036,13 @@ NoControl - 6, 23 + 6, 20 62, 13 - 25 + 0 Graph Title: @@ -1060,7 +1060,7 @@ 6 - 448, 78 + 425, 72 5, 5, 5, 5 @@ -1069,7 +1069,7 @@ 50, 20 - 22 + 11 ucrNudCaptionSize @@ -1084,7 +1084,7 @@ 7 - 448, 48 + 425, 45 5, 5, 5, 5 @@ -1093,7 +1093,7 @@ 50, 20 - 21 + 7 ucrNudSubTitleSize @@ -1108,7 +1108,7 @@ 8 - 119, 78 + 97, 72 7, 6, 7, 6 @@ -1117,7 +1117,7 @@ 181, 53 - 16 + 9 ucrInputGraphcCaption @@ -1132,7 +1132,7 @@ 9 - 119, 18 + 97, 18 7, 6, 7, 6 @@ -1141,7 +1141,7 @@ 181, 21 - 12 + 1 ucrInputGraphTitle @@ -1156,7 +1156,7 @@ 10 - 119, 48 + 97, 45 7, 6, 7, 6 @@ -1165,7 +1165,7 @@ 181, 21 - 14 + 5 ucrInputGraphSubTitle @@ -1183,10 +1183,10 @@ 9, 10 - 525, 136 + 488, 136 - 17 + 0 Graph @@ -1210,7 +1210,7 @@ 3, 3, 3, 3 - 567, 309 + 507, 271 0 @@ -1231,7 +1231,7 @@ 1 - 13, 18 + 8, 24 5, 5, 5, 5 @@ -1240,7 +1240,7 @@ 100, 20 - 66 + 0 ucrChkSpecifyXAxisTickMarks @@ -1255,13 +1255,13 @@ 0 - 253, 53 + 112, 79 50, 20 - 44 + 10 ucrNudXAxisLabelSize @@ -1276,7 +1276,7 @@ 1 - 13, 54 + 8, 53 5, 5, 5, 5 @@ -1285,7 +1285,7 @@ 75, 20 - 43 + 7 ucrChkXAxisAngle @@ -1300,7 +1300,7 @@ 2 - 91, 54 + 112, 52 5, 5, 5, 5 @@ -1309,7 +1309,7 @@ 50, 20 - 42 + 8 ucrNudXAxisAngle @@ -1324,7 +1324,7 @@ 3 - 169, 54 + 8, 82 5, 5, 5, 5 @@ -1333,7 +1333,7 @@ 75, 20 - 41 + 9 ucrChkXAxisLabelSize @@ -1354,13 +1354,13 @@ NoControl - 129, 20 + 108, 27 33, 13 - 33 + 1 From: @@ -1378,16 +1378,16 @@ 5 - 167, 17 + 143, 24 7, 6, 7, 6 - 50, 21 + 51, 21 - 38 + 2 ucrInputXFrom @@ -1402,7 +1402,7 @@ 6 - 440, 17 + 407, 24 7, 6, 7, 6 @@ -1411,7 +1411,7 @@ 51, 21 - 36 + 6 ucrInputXInStepsOf @@ -1426,7 +1426,7 @@ 7 - 288, 17 + 260, 24 7, 6, 7, 6 @@ -1435,7 +1435,7 @@ 51, 21 - 37 + 4 ucrInputXTo @@ -1456,13 +1456,13 @@ NoControl - 375, 20 + 344, 27 61, 13 - 35 + 5 In Steps of: @@ -1486,13 +1486,13 @@ NoControl - 261, 20 + 235, 27 23, 13 - 34 + 3 To: @@ -1510,13 +1510,13 @@ 10 - 6, 16 + 9, 10 - 504, 93 + 492, 110 - 28 + 0 X-Axis @@ -1540,7 +1540,7 @@ 3, 3, 3, 3 - 567, 309 + 507, 271 1 @@ -1560,110 +1560,80 @@ 2 - - True - - - NoControl - - - 281, 67 + + 8, 24 - - 79, 13 + + 5, 5, 5, 5 - - 79 + + 100, 20 - - Display Format: + + 0 - - lblDateDisplayFormat + + ucrChkSpecifyDateBreaks - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + instat.ucrCheck, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - tpYAxis + + grpYAxis - + 0 - - 143, 62 + + 112, 79 - + 5, 5, 5, 5 - - 45, 20 + + 50, 20 - - 67 + + 8 - - ucrNudDateBreakNumber + + ucrNudYAxisLabelSize - + instat.ucrNud, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - tpYAxis + + grpYAxis - + 1 - - 194, 61 - - - 7, 6, 7, 6 - - - 70, 21 - - - 66 - - - ucrInputDateBreakTime - - - instat.ucrInputComboBox, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - tpYAxis - - - 2 - - - 40, 63 + + 112, 52 - + 5, 5, 5, 5 - - 100, 20 + + 50, 20 - - 65 + + 6 - - ucrChkSpecifyDateBreaks + + ucrNudYAxisAngle - - instat.ucrCheck, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + instat.ucrNud, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - tpYAxis + + grpYAxis - - 3 + + 2 - 365, 63 + 341, 23 7, 6, 7, 6 @@ -1672,7 +1642,7 @@ 141, 21 - 62 + 4 ucrInputDateDisplayFormat @@ -1681,61 +1651,67 @@ instat.ucrInputComboBox, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - tpYAxis + grpYAxis - 4 + 3 - - 119, 106 + + True - - 5, 5, 5, 5 + + NoControl - - 50, 20 + + 260, 27 - - 64 + + 79, 13 - - ucrNudYAxisAngle + + 3 - - instat.ucrNud, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + Display Format: - - tpYAxis + + lblDateDisplayFormat - - 5 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 274, 106 + + grpYAxis - + + 4 + + + 8, 82 + + 5, 5, 5, 5 - - 50, 20 + + 75, 20 - - 53 + + 7 - - ucrNudYAxisLabelSize + + ucrChkYAxisLabelSize - - instat.ucrNud, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + instat.ucrCheck, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - tpYAxis + + grpYAxis - - 6 + + 5 - 40, 108 + 8, 53 5, 5, 5, 5 @@ -1744,7 +1720,7 @@ 75, 20 - 63 + 5 ucrChkYAxisAngle @@ -1753,35 +1729,83 @@ instat.ucrCheck, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - tpYAxis + grpYAxis - 7 + 6 - - 195, 108 + + 112, 23 - + 5, 5, 5, 5 - - 75, 20 + + 50, 20 - - 61 + + 1 - - ucrChkYAxisLabelSize + + ucrNudDateBreakNumber - - instat.ucrCheck, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + instat.ucrNud, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - tpYAxis + + grpYAxis - + + 7 + + + 175, 23 + + + 7, 6, 7, 6 + + + 70, 21 + + + 2 + + + ucrInputDateBreakTime + + + instat.ucrInputComboBox, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + grpYAxis + + 8 + + 9, 10 + + + 492, 110 + + + 0 + + + Y-Axis + + + grpYAxis + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpYAxis + + + 0 + 4, 22 @@ -1789,7 +1813,7 @@ 3, 3, 3, 3 - 567, 309 + 507, 271 2 @@ -1810,13 +1834,13 @@ 3 - 272, 67 + 130, 16 137, 21 - 8 + 1 ucrInputLegendPosition @@ -1831,13 +1855,13 @@ 0 - 32, 67 + 12, 18 204, 20 - 7 + 0 ucrChkLegendPosition @@ -1858,7 +1882,7 @@ 3, 3, 3, 3 - 567, 309 + 507, 271 3 @@ -1879,13 +1903,13 @@ 4 - 11, 0 + 9, 8 - 575, 335 + 515, 297 - 1 + 0 tbInventory @@ -1903,13 +1927,13 @@ 17, 17 - 211, 336 + 197, 307 142, 30 - 0 + 1 ucrButtonsInventoryplot @@ -1930,10 +1954,7 @@ 6, 13 - 589, 367 - - - NoControl + 537, 341 CenterParent diff --git a/instat/sdgInventoryPlot.vb b/instat/sdgInventoryPlot.vb index 07449d54722..1f1b4172f1a 100644 --- a/instat/sdgInventoryPlot.vb +++ b/instat/sdgInventoryPlot.vb @@ -267,7 +267,6 @@ Public Class sdgInventoryPlot SetXLabel() SetYLabel() AddRemoveXAxisBreaks() - End Sub Private Sub SetXLabel() @@ -317,7 +316,6 @@ Public Class sdgInventoryPlot Else clsInventory.RemoveParameterByName("row_col_number") End If - End If End Sub @@ -328,18 +326,15 @@ Public Class sdgInventoryPlot Else clsInventory.RemoveParameterByName("scale_xdate") End If - End If End Sub Private Sub ucrPnlXAxisTitle_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlXAxisTitle.ControlValueChanged, ucrInputXAxisTitle.ControlValueChanged SetXLabel() - End Sub Private Sub UcrPnlYAxisTitle_ControlValueChanged(ucrChangedControl As ucrCore) Handles UcrPnlYAxisTitle.ControlValueChanged, ucrInputYAxisTitle.ControlValueChanged SetYLabel() - End Sub Private Sub ucrChkNoOfRowsOrColumns_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkNoOfRowsOrColumns.ControlValueChanged @@ -353,6 +348,5 @@ Public Class sdgInventoryPlot Private Sub ucrChkSpecifyXAxisTickMarks_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputXFrom.ControlValueChanged, ucrInputXTo.ControlValueChanged, ucrInputXInStepsOf.ControlValueChanged AddRemoveXAxisBreaks() - End Sub End Class \ No newline at end of file diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index 93418619855..e764b1fe4de 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -2597,7 +2597,7 @@ DataSheet$set("public","make_inventory_plot", function(date_col, station_col = N } if(!missing(scale_xdate)){ g <- g + ggplot2::scale_x_continuous(breaks=seq(fromXAxis, toXAxis, byXaxis)) } - if(scale_ydate && !missing(date_ybreaks) && !missing(date_ylabels)){ g <- g + ggplot2::scale_y_date(date_breaks = paste0(step," ",date_ybreaks), date_labels = date_ylabels) } + if(scale_ydate && !missing(date_ybreaks) && !missing(date_ylabels)){ g <- g + ggplot2::scale_y_date(breaks = seq(min(curr_data[["common_date"]]), max(curr_data[["common_date"]]), by = paste0(step," ",date_ybreaks)), date_labels = date_ylabels) } } else { g <- ggplot2::ggplot(data = curr_data, ggplot2::aes_(x = as.name(date_col), y = 1, fill = as.name(key_name))) + ggplot2::geom_raster() + ggplot2::scale_fill_manual(values = key) + ggplot2::scale_x_date(date_minor_breaks = "1 year") diff --git a/instat/ucrDataView.Designer.vb b/instat/ucrDataView.Designer.vb index cad8d750a24..bb439ba4c5f 100644 --- a/instat/ucrDataView.Designer.vb +++ b/instat/ucrDataView.Designer.vb @@ -102,7 +102,7 @@ Partial Class ucrDataView Me.lblHeader = New System.Windows.Forms.Label() Me.tlpTableContainer = New System.Windows.Forms.TableLayoutPanel() Me.pnlDataContainer = New System.Windows.Forms.Panel() - Me.panelAllMenuItems = New System.Windows.Forms.Panel() + Me.panelSectionsAll = New System.Windows.Forms.Panel() Me.linkHelpInstructionVideos = New System.Windows.Forms.LinkLabel() Me.linkHelpRInstatWebsite = New System.Windows.Forms.LinkLabel() Me.linkHelpRpackages = New System.Windows.Forms.LinkLabel() @@ -114,13 +114,19 @@ Partial Class ucrDataView Me.lblHelp = New System.Windows.Forms.Label() Me.lblRecent = New System.Windows.Forms.Label() Me.lblStart = New System.Windows.Forms.Label() + Me.panelSectionStart = New System.Windows.Forms.Panel() + Me.panelSectionHelp = New System.Windows.Forms.Panel() + Me.panelSectionRecent = New System.Windows.Forms.Panel() Me.columnContextMenuStrip.SuspendLayout() Me.cellContextMenuStrip.SuspendLayout() Me.rowContextMenuStrip.SuspendLayout() Me.statusColumnMenu.SuspendLayout() Me.tlpTableContainer.SuspendLayout() Me.pnlDataContainer.SuspendLayout() - Me.panelAllMenuItems.SuspendLayout() + Me.panelSectionsAll.SuspendLayout() + Me.panelSectionStart.SuspendLayout() + Me.panelSectionHelp.SuspendLayout() + Me.panelSectionRecent.SuspendLayout() Me.SuspendLayout() ' 'grdData @@ -536,7 +542,7 @@ Partial Class ucrDataView ' 'pnlDataContainer ' - Me.pnlDataContainer.Controls.Add(Me.panelAllMenuItems) + Me.pnlDataContainer.Controls.Add(Me.panelSectionsAll) Me.pnlDataContainer.Controls.Add(Me.grdData) Me.pnlDataContainer.Dock = System.Windows.Forms.DockStyle.Fill Me.pnlDataContainer.Location = New System.Drawing.Point(3, 23) @@ -544,25 +550,16 @@ Partial Class ucrDataView Me.pnlDataContainer.Size = New System.Drawing.Size(438, 454) Me.pnlDataContainer.TabIndex = 7 ' - 'panelAllMenuItems - ' - Me.panelAllMenuItems.Controls.Add(Me.linkHelpInstructionVideos) - Me.panelAllMenuItems.Controls.Add(Me.linkHelpRInstatWebsite) - Me.panelAllMenuItems.Controls.Add(Me.linkHelpRpackages) - Me.panelAllMenuItems.Controls.Add(Me.linkHelpIntroduction) - Me.panelAllMenuItems.Controls.Add(Me.panelRecentMenuItems) - Me.panelAllMenuItems.Controls.Add(Me.linkStartOpenLibrary) - Me.panelAllMenuItems.Controls.Add(Me.linkStartOpenFile) - Me.panelAllMenuItems.Controls.Add(Me.linkStartNewDataFrame) - Me.panelAllMenuItems.Controls.Add(Me.lblHelp) - Me.panelAllMenuItems.Controls.Add(Me.lblRecent) - Me.panelAllMenuItems.Controls.Add(Me.lblStart) - Me.panelAllMenuItems.Dock = System.Windows.Forms.DockStyle.Fill - Me.panelAllMenuItems.Location = New System.Drawing.Point(0, 0) - Me.panelAllMenuItems.Name = "panelAllMenuItems" - Me.panelAllMenuItems.Size = New System.Drawing.Size(438, 454) - Me.panelAllMenuItems.TabIndex = 7 - Me.panelAllMenuItems.Visible = False + 'panelSectionsAll + ' + Me.panelSectionsAll.Controls.Add(Me.panelSectionRecent) + Me.panelSectionsAll.Controls.Add(Me.panelSectionHelp) + Me.panelSectionsAll.Controls.Add(Me.panelSectionStart) + Me.panelSectionsAll.Dock = System.Windows.Forms.DockStyle.Fill + Me.panelSectionsAll.Location = New System.Drawing.Point(0, 0) + Me.panelSectionsAll.Name = "panelSectionsAll" + Me.panelSectionsAll.Size = New System.Drawing.Size(438, 454) + Me.panelSectionsAll.TabIndex = 7 ' 'linkHelpInstructionVideos ' @@ -571,7 +568,7 @@ Partial Class ucrDataView Me.linkHelpInstructionVideos.Enabled = False Me.linkHelpInstructionVideos.ImeMode = System.Windows.Forms.ImeMode.NoControl Me.linkHelpInstructionVideos.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline - Me.linkHelpInstructionVideos.Location = New System.Drawing.Point(30, 390) + Me.linkHelpInstructionVideos.Location = New System.Drawing.Point(8, 94) Me.linkHelpInstructionVideos.Name = "linkHelpInstructionVideos" Me.linkHelpInstructionVideos.Size = New System.Drawing.Size(98, 13) Me.linkHelpInstructionVideos.TabIndex = 10 @@ -585,7 +582,7 @@ Partial Class ucrDataView Me.linkHelpRInstatWebsite.AutoSize = True Me.linkHelpRInstatWebsite.ImeMode = System.Windows.Forms.ImeMode.NoControl Me.linkHelpRInstatWebsite.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline - Me.linkHelpRInstatWebsite.Location = New System.Drawing.Point(30, 371) + Me.linkHelpRInstatWebsite.Location = New System.Drawing.Point(8, 75) Me.linkHelpRInstatWebsite.Name = "linkHelpRInstatWebsite" Me.linkHelpRInstatWebsite.Size = New System.Drawing.Size(83, 13) Me.linkHelpRInstatWebsite.TabIndex = 9 @@ -598,7 +595,7 @@ Partial Class ucrDataView Me.linkHelpRpackages.AutoSize = True Me.linkHelpRpackages.ImeMode = System.Windows.Forms.ImeMode.NoControl Me.linkHelpRpackages.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline - Me.linkHelpRpackages.Location = New System.Drawing.Point(30, 352) + Me.linkHelpRpackages.Location = New System.Drawing.Point(8, 56) Me.linkHelpRpackages.Name = "linkHelpRpackages" Me.linkHelpRpackages.Size = New System.Drawing.Size(116, 13) Me.linkHelpRpackages.TabIndex = 8 @@ -611,7 +608,7 @@ Partial Class ucrDataView Me.linkHelpIntroduction.AutoSize = True Me.linkHelpIntroduction.ImeMode = System.Windows.Forms.ImeMode.NoControl Me.linkHelpIntroduction.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline - Me.linkHelpIntroduction.Location = New System.Drawing.Point(30, 333) + Me.linkHelpIntroduction.Location = New System.Drawing.Point(8, 37) Me.linkHelpIntroduction.Name = "linkHelpIntroduction" Me.linkHelpIntroduction.Size = New System.Drawing.Size(63, 13) Me.linkHelpIntroduction.TabIndex = 7 @@ -623,9 +620,9 @@ Partial Class ucrDataView Me.panelRecentMenuItems.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.panelRecentMenuItems.AutoScroll = True - Me.panelRecentMenuItems.Location = New System.Drawing.Point(30, 160) + Me.panelRecentMenuItems.Location = New System.Drawing.Point(9, 37) Me.panelRecentMenuItems.Name = "panelRecentMenuItems" - Me.panelRecentMenuItems.Size = New System.Drawing.Size(377, 138) + Me.panelRecentMenuItems.Size = New System.Drawing.Size(354, 138) Me.panelRecentMenuItems.TabIndex = 6 ' 'linkStartOpenLibrary @@ -634,7 +631,7 @@ Partial Class ucrDataView Me.linkStartOpenLibrary.AutoSize = True Me.linkStartOpenLibrary.ImeMode = System.Windows.Forms.ImeMode.NoControl Me.linkStartOpenLibrary.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline - Me.linkStartOpenLibrary.Location = New System.Drawing.Point(30, 87) + Me.linkStartOpenLibrary.Location = New System.Drawing.Point(7, 75) Me.linkStartOpenLibrary.Name = "linkStartOpenLibrary" Me.linkStartOpenLibrary.Size = New System.Drawing.Size(95, 13) Me.linkStartOpenLibrary.TabIndex = 5 @@ -647,7 +644,7 @@ Partial Class ucrDataView Me.linkStartOpenFile.AutoSize = True Me.linkStartOpenFile.ImeMode = System.Windows.Forms.ImeMode.NoControl Me.linkStartOpenFile.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline - Me.linkStartOpenFile.Location = New System.Drawing.Point(30, 68) + Me.linkStartOpenFile.Location = New System.Drawing.Point(7, 56) Me.linkStartOpenFile.Name = "linkStartOpenFile" Me.linkStartOpenFile.Size = New System.Drawing.Size(81, 13) Me.linkStartOpenFile.TabIndex = 4 @@ -660,7 +657,7 @@ Partial Class ucrDataView Me.linkStartNewDataFrame.AutoSize = True Me.linkStartNewDataFrame.ImeMode = System.Windows.Forms.ImeMode.NoControl Me.linkStartNewDataFrame.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline - Me.linkStartNewDataFrame.Location = New System.Drawing.Point(30, 49) + Me.linkStartNewDataFrame.Location = New System.Drawing.Point(7, 37) Me.linkStartNewDataFrame.Name = "linkStartNewDataFrame" Me.linkStartNewDataFrame.Size = New System.Drawing.Size(96, 13) Me.linkStartNewDataFrame.TabIndex = 3 @@ -672,7 +669,7 @@ Partial Class ucrDataView Me.lblHelp.AutoSize = True Me.lblHelp.Font = New System.Drawing.Font("Microsoft Sans Serif", 15.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.lblHelp.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblHelp.Location = New System.Drawing.Point(28, 304) + Me.lblHelp.Location = New System.Drawing.Point(6, 8) Me.lblHelp.Name = "lblHelp" Me.lblHelp.Size = New System.Drawing.Size(56, 25) Me.lblHelp.TabIndex = 2 @@ -683,7 +680,7 @@ Partial Class ucrDataView Me.lblRecent.AutoSize = True Me.lblRecent.Font = New System.Drawing.Font("Microsoft Sans Serif", 15.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.lblRecent.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblRecent.Location = New System.Drawing.Point(28, 132) + Me.lblRecent.Location = New System.Drawing.Point(4, 8) Me.lblRecent.Name = "lblRecent" Me.lblRecent.Size = New System.Drawing.Size(80, 25) Me.lblRecent.TabIndex = 1 @@ -694,12 +691,46 @@ Partial Class ucrDataView Me.lblStart.AutoSize = True Me.lblStart.Font = New System.Drawing.Font("Microsoft Sans Serif", 15.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.lblStart.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblStart.Location = New System.Drawing.Point(28, 18) + Me.lblStart.Location = New System.Drawing.Point(5, 6) Me.lblStart.Name = "lblStart" Me.lblStart.Size = New System.Drawing.Size(57, 25) Me.lblStart.TabIndex = 0 Me.lblStart.Text = "Start" ' + 'panelSectionStart + ' + Me.panelSectionStart.Controls.Add(Me.lblStart) + Me.panelSectionStart.Controls.Add(Me.linkStartNewDataFrame) + Me.panelSectionStart.Controls.Add(Me.linkStartOpenFile) + Me.panelSectionStart.Controls.Add(Me.linkStartOpenLibrary) + Me.panelSectionStart.Location = New System.Drawing.Point(28, 20) + Me.panelSectionStart.Name = "panelSectionStart" + Me.panelSectionStart.Size = New System.Drawing.Size(374, 96) + Me.panelSectionStart.TabIndex = 11 + ' + 'panelSectionHelp + ' + Me.panelSectionHelp.Controls.Add(Me.lblHelp) + Me.panelSectionHelp.Controls.Add(Me.linkHelpIntroduction) + Me.panelSectionHelp.Controls.Add(Me.linkHelpInstructionVideos) + Me.panelSectionHelp.Controls.Add(Me.linkHelpRpackages) + Me.panelSectionHelp.Controls.Add(Me.linkHelpRInstatWebsite) + Me.panelSectionHelp.Location = New System.Drawing.Point(28, 330) + Me.panelSectionHelp.Name = "panelSectionHelp" + Me.panelSectionHelp.Size = New System.Drawing.Size(374, 118) + Me.panelSectionHelp.TabIndex = 12 + ' + 'panelSectionRecent + ' + Me.panelSectionRecent.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.panelSectionRecent.Controls.Add(Me.lblRecent) + Me.panelSectionRecent.Controls.Add(Me.panelRecentMenuItems) + Me.panelSectionRecent.Location = New System.Drawing.Point(28, 130) + Me.panelSectionRecent.Name = "panelSectionRecent" + Me.panelSectionRecent.Size = New System.Drawing.Size(374, 186) + Me.panelSectionRecent.TabIndex = 13 + ' 'ucrDataView ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -714,8 +745,13 @@ Partial Class ucrDataView Me.statusColumnMenu.ResumeLayout(False) Me.tlpTableContainer.ResumeLayout(False) Me.pnlDataContainer.ResumeLayout(False) - Me.panelAllMenuItems.ResumeLayout(False) - Me.panelAllMenuItems.PerformLayout() + Me.panelSectionsAll.ResumeLayout(False) + Me.panelSectionStart.ResumeLayout(False) + Me.panelSectionStart.PerformLayout() + Me.panelSectionHelp.ResumeLayout(False) + Me.panelSectionHelp.PerformLayout() + Me.panelSectionRecent.ResumeLayout(False) + Me.panelSectionRecent.PerformLayout() Me.ResumeLayout(False) End Sub @@ -783,7 +819,7 @@ Partial Class ucrDataView Private WithEvents mnuCellCopyRange As ToolStripMenuItem Private WithEvents mnuCellPasteRange As ToolStripMenuItem Friend WithEvents mnuCellHelp As ToolStripMenuItem - Friend WithEvents panelAllMenuItems As Panel + Friend WithEvents panelSectionsAll As Panel Friend WithEvents linkStartOpenLibrary As LinkLabel Friend WithEvents linkStartOpenFile As LinkLabel Friend WithEvents linkStartNewDataFrame As LinkLabel @@ -795,4 +831,7 @@ Partial Class ucrDataView Friend WithEvents linkHelpRInstatWebsite As LinkLabel Friend WithEvents linkHelpRpackages As LinkLabel Friend WithEvents linkHelpIntroduction As LinkLabel + Friend WithEvents panelSectionRecent As Panel + Friend WithEvents panelSectionHelp As Panel + Friend WithEvents panelSectionStart As Panel End Class diff --git a/instat/ucrDataView.vb b/instat/ucrDataView.vb index cd86c5af954..cb7d583b211 100644 --- a/instat/ucrDataView.vb +++ b/instat/ucrDataView.vb @@ -57,7 +57,6 @@ Public Class ucrDataView grdData.SetSettings(unvell.ReoGrid.WorksheetSettings.Edit_AutoFormatCell, False) grdData.SheetTabWidth = 450 SetRFunctions() - HideOrShowRecentPanel() End Sub 'Protected Overrides Sub OnFormClosing(ByVal e As FormClosingEventArgs) @@ -339,13 +338,12 @@ Public Class ucrDataView End If lblRowDisplay.Text = lblRowDisplay.Text & " | Showing " & grdCurrSheet.ColumnCount & " of " & iColumnCount & " columns" 'hide startup menu items - panelAllMenuItems.Visible = False + panelSectionsAll.Visible = False Else frmMain.tstatus.Text = "No data loaded" lblRowDisplay.Text = "" 'show startup menu items - panelAllMenuItems.Visible = True - 'todo. set the recent files list?? + panelSectionsAll.Visible = True End If End Sub @@ -886,7 +884,7 @@ Public Class ucrDataView ''' Public Sub ClearRecentFileMenuItems() panelRecentMenuItems.Controls.Clear() - HideOrShowRecentPanel() + HideOrShowRecentSection() End Sub ''' @@ -919,11 +917,25 @@ Public Class ucrDataView lblMenuItemPath.Height = 13 lblMenuItemPath.AutoSize = True panelRecentMenuItems.Controls.Add(lblMenuItemPath) - HideOrShowRecentPanel() + HideOrShowRecentSection() End Sub - Private Sub HideOrShowRecentPanel() - lblRecent.Visible = panelRecentMenuItems.Controls.Count > 0 + ''' + ''' toggles startup menu items visibility + ''' + ''' + Public Sub StartupMenuItemsVisibility(bVisibility As Boolean) + panelSectionStart.Visible = bVisibility + panelSectionHelp.Visible = bVisibility + If bVisibility Then + HideOrShowRecentSection() + Else + panelSectionRecent.Visible = False + End If + End Sub + + Private Sub HideOrShowRecentSection() + panelSectionRecent.Visible = panelRecentMenuItems.Controls.Count > 0 End Sub Private Sub linkHelpIntroduction_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles linkHelpIntroduction.LinkClicked diff --git a/instat/ucrFilePath.Designer.vb b/instat/ucrFilePath.Designer.vb index 6495abe1bf8..3769d36ee24 100644 --- a/instat/ucrFilePath.Designer.vb +++ b/instat/ucrFilePath.Designer.vb @@ -45,23 +45,24 @@ Partial Class ucrFilePath 'ucrInputFilePath ' Me.ucrInputFilePath.AddQuotesIfUnrecognised = True - Me.ucrInputFilePath.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.ucrInputFilePath.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.ucrInputFilePath.IsMultiline = False Me.ucrInputFilePath.IsReadOnly = True - Me.ucrInputFilePath.Location = New System.Drawing.Point(56, 2) + Me.ucrInputFilePath.Location = New System.Drawing.Point(77, 2) Me.ucrInputFilePath.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) Me.ucrInputFilePath.Name = "ucrInputFilePath" - Me.ucrInputFilePath.Size = New System.Drawing.Size(240, 23) - Me.ucrInputFilePath.TabIndex = 7 + Me.ucrInputFilePath.Size = New System.Drawing.Size(260, 23) + Me.ucrInputFilePath.TabIndex = 2 ' 'btnBrowse ' Me.btnBrowse.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.btnBrowse.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.btnBrowse.Location = New System.Drawing.Point(297, 1) + Me.btnBrowse.Location = New System.Drawing.Point(338, 1) Me.btnBrowse.Name = "btnBrowse" Me.btnBrowse.Size = New System.Drawing.Size(50, 23) - Me.btnBrowse.TabIndex = 8 + Me.btnBrowse.TabIndex = 3 Me.btnBrowse.Text = "Browse" Me.btnBrowse.UseVisualStyleBackColor = True ' @@ -72,7 +73,7 @@ Partial Class ucrFilePath Me.lblName.Location = New System.Drawing.Point(2, 6) Me.lblName.Name = "lblName" Me.lblName.Size = New System.Drawing.Size(50, 13) - Me.lblName.TabIndex = 6 + Me.lblName.TabIndex = 1 Me.lblName.Text = "Save As:" ' 'ucrFilePath @@ -83,7 +84,7 @@ Partial Class ucrFilePath Me.Controls.Add(Me.btnBrowse) Me.Controls.Add(Me.lblName) Me.Name = "ucrFilePath" - Me.Size = New System.Drawing.Size(351, 26) + Me.Size = New System.Drawing.Size(392, 26) Me.ResumeLayout(False) Me.PerformLayout() diff --git a/instat/ucrFilePath.vb b/instat/ucrFilePath.vb index d1db9f09ab9..b9855dadacb 100644 --- a/instat/ucrFilePath.vb +++ b/instat/ucrFilePath.vb @@ -14,9 +14,59 @@ ' You should have received a copy of the GNU General Public License ' along with this program. If not, see . +Imports System.IO + +'''-------------------------------------------------------------------------------------------- +''' +''' An object of this class represents a file path custom control that inherits +''' System.Windows.Forms.UserControl and is used to select the file name and path to be used in +''' saving a file. +''' +''' This class provides methods and fields to: +''' +''' +''' Set the parameter of the path control +''' +''' +''' Set the R code structure of the path control +''' +''' +''' Optional. Set a default suggested name +''' +''' +''' +'''-------------------------------------------------------------------------------------------- Public Class ucrFilePath + Private bFirstLoad As Boolean = True + Private strFilePathDialogFilter As String = "All Files *.*" + + ''' + ''' event raised when the file path contents has changed + ''' + Public Event FilePathChanged() + + ''' + ''' gets and sets the text property value of the browse button. + ''' + Public Property FilePathBrowseText() As String + Get + Return btnBrowse.Text + End Get + Set(ByVal value As String) + btnBrowse.Text = value + End Set + End Property + + ''' + ''' flag used to determine whether the opened dialog prompt will be + ''' FolderBrowserDialog or SaveFileDialog + ''' + Public Property FolderBrowse As Boolean = False - Public Property LabelText() As String + ''' + ''' gets and sets the label text property value of the input textbox + ''' + Public Property FilePathLabel() As String Get Return lblName.Text End Get @@ -25,14 +75,218 @@ Public Class ucrFilePath End Set End Property - Public Property BrowseText() As String + ''' + ''' used to set the title of the SaveFileDialog prompt + ''' + Public Property FilePathDialogTitle As String = "Save As" + + ''' + ''' used to set the allowed file filters or file extensions + ''' + Public Property FilePathDialogFilter As String Get - Return btnBrowse.Text + Return strFilePathDialogFilter End Get Set(ByVal value As String) - btnBrowse.Text = value + strFilePathDialogFilter = value + 'reset the filter index(start index is 1). + 'its safer To, just incase number of filters set are different from previously set + SelectedFileFilterIndex = 1 + End Set + End Property + + ''' + ''' gets or sets the last selected filter index. + ''' used by the SaveFileDiaolog prompt to 'remember' last selected file type filter + ''' and by dialogs to know selected filter index + ''' + Public Property SelectedFileFilterIndex As Integer + + ''' + ''' used to set the suggested name if no file name was set before + ''' + ''' + Public Property DefaultFileSuggestionName As String = "" + + ''' + ''' gets or sets the input file path used by the FolderBrowseDialog or SaveFileDialog prompt + ''' also sets PreviousSelectedWindowsFilePath to 'remember' the last selected file name and directory + ''' + Public Property FilePath() As String + Get + Return PathControl().GetText() + End Get + Set(ByVal value As String) + 'first replace backward slashed with forward slashes cause of R path formats + PathControl().SetName(value.Replace("\", "/")) + If value <> "" Then + 'to be safe, always replace the forward slashes with back slashes. values will be used by vb.net sialog prompts + PreviousSelectedWindowsFilePath = value.Replace("/", "\") + End If + RaiseEvent FilePathChanged() End Set End Property - 'todo. code logic additions + ''' + ''' gets or sets the previously set path. This is never cleared when sub clear() is called. + ''' its used internally to set initial directories of the folder or save dialogs prompts even when path was extenally cleared + ''' the path will always be in windows backslash convention format i.e uses "\" instead of "/" + ''' + Private Property PreviousSelectedWindowsFilePath As String = "" + + ''' + ''' gets the control that contains the input file path and name + ''' + ''' ucrInputTextBox + Public ReadOnly Property PathControl() As ucrInputTextBox + Get + Return ucrInputFilePath + End Get + End Property + + ''' + ''' Sets the R parameter to the path control + ''' + ''' + Public Sub SetPathControlParameter(rParameter As RParameter) + PathControl().SetParameter(rParameter) + End Sub + + ''' + ''' sets the R code to the path control + ''' + ''' + ''' + Public Sub SetPathControlRcode(clsNewCodeStructure As RCodeStructure, Optional bReset As Boolean = False) + PathControl().SetRCode(clsNewCodeStructure, bReset) + End Sub + + ''' + ''' resets the path control and and the file path + ''' + Public Sub ResetPathControl() + PathControl().Reset() + Clear() + End Sub + + Public Function IsEmpty() As Boolean + Return String.IsNullOrEmpty(FilePath) + End Function + + Public Sub Clear() + FilePath = "" + End Sub + + Private Sub ucrFilePath_Load(sender As Object, e As EventArgs) Handles Me.Load + If bFirstLoad Then + AddButtonInFilePathControlTextbox() + bFirstLoad = False + End If + End Sub + + ''' + ''' opens a SaveFileDialog prompt thats allows user to specify file name and path + ''' to be used in saving a file + ''' + ''' + ''' + Private Sub btnBrowse_Click(sender As Object, e As EventArgs) Handles btnBrowse.Click + If FolderBrowse Then + Using dlgFolderBrowse As New FolderBrowserDialog + If String.IsNullOrEmpty(PreviousSelectedWindowsFilePath) Then + dlgFolderBrowse.SelectedPath = frmMain.clsInstatOptions.strWorkingDirectory + Else + 'use the file path in windows backslash convention format + dlgFolderBrowse.SelectedPath = Path.GetDirectoryName(PreviousSelectedWindowsFilePath) + End If + If DialogResult.OK = dlgFolderBrowse.ShowDialog() Then + FilePath = dlgFolderBrowse.SelectedPath + 'reset the filter index(start index is 1). its safer to, just incase save dialog is used later + SelectedFileFilterIndex = 1 + End If + End Using + Else + Using dlgSaveFile As New SaveFileDialog + dlgSaveFile.Title = FilePathDialogTitle + dlgSaveFile.Filter = FilePathDialogFilter + If String.IsNullOrEmpty(PreviousSelectedWindowsFilePath) Then + dlgSaveFile.FileName = DefaultFileSuggestionName + dlgSaveFile.InitialDirectory = frmMain.clsInstatOptions.strWorkingDirectory + Else + 'if there is no current file path and there is a default suggested name, then use the default suggestion + 'else check if previous selected path has an extension to determine if the previous path included a file name and use it + 'else leave the FileName as empty(it's the default) + If IsEmpty() AndAlso Not String.IsNullOrEmpty(DefaultFileSuggestionName) Then + dlgSaveFile.FileName = DefaultFileSuggestionName + ElseIf Not String.IsNullOrEmpty(Path.GetExtension(PreviousSelectedWindowsFilePath)) Then + dlgSaveFile.FileName = Path.GetFileNameWithoutExtension(PreviousSelectedWindowsFilePath) + End If + + dlgSaveFile.InitialDirectory = Path.GetDirectoryName(PreviousSelectedWindowsFilePath) + dlgSaveFile.FilterIndex = SelectedFileFilterIndex + + End If + If DialogResult.OK = dlgSaveFile.ShowDialog() Then + FilePath = dlgSaveFile.FileName + SelectedFileFilterIndex = dlgSaveFile.FilterIndex + End If + End Using + End If + End Sub + + Private Sub ucrInputFilePath_Click(sender As Object, e As EventArgs) Handles ucrInputFilePath.Click + btnBrowse.PerformClick() + End Sub + + ''' + ''' adds the button for showing popup used to view the whole file path + ''' + Private Sub AddButtonInFilePathControlTextbox() + Dim btnViewMore As New Button + 'add the button to the comment textbox first + 'PathControl.txtInput.Controls.Clear() + PathControl.txtInput.Controls.Add(btnViewMore) + + 'then set the button properties + btnViewMore.Text = ":::" 'temp. This will be shown as centered. + btnViewMore.Size = New Size(25, PathControl.txtInput.ClientSize.Height + 2) + btnViewMore.TextAlign = ContentAlignment.TopCenter + btnViewMore.FlatStyle = FlatStyle.Standard + btnViewMore.FlatAppearance.BorderSize = 0 + btnViewMore.Cursor = Cursors.Default + btnViewMore.Dock = DockStyle.Right + btnViewMore.BackColor = btnBrowse.BackColor + btnViewMore.UseVisualStyleBackColor = True + + 'set the button event handler + AddHandler btnViewMore.Click, Sub() + 'shows a popup that displays the whole file path + Dim objPopup As New clsPopup + Dim txtShowFilePath As New TextBox With { + .Multiline = True, + .ScrollBars = ScrollBars.Vertical, + .WordWrap = True + } + + 'attach event handlers that allow editing of the poped up text + AddHandler txtShowFilePath.LostFocus, Sub() + FilePath = txtShowFilePath.Text + End Sub + AddHandler txtShowFilePath.KeyDown, Sub(sender As Object, e As KeyEventArgs) + If e.Control AndAlso e.KeyCode = Keys.Enter Then + FilePath = txtShowFilePath.Text + objPopup.Hide() + End If + End Sub + 'set the contents control and show the popup + objPopup.SetContentControl(txtShowFilePath) + objPopup.SetSize(ucrInputFilePath.Width, ucrInputFilePath.Height + 100) + objPopup.Show(ucrInputFilePath) + txtShowFilePath.Text = FilePath + txtShowFilePath.SelectionStart = FilePath.Length + End Sub + + End Sub + + End Class diff --git a/instat/ucrTry.vb b/instat/ucrTry.vb index b1e02e715e4..5d347fc4a61 100644 --- a/instat/ucrTry.vb +++ b/instat/ucrTry.vb @@ -214,7 +214,7 @@ Public Class ucrTry frmPopUp.Close() End Sub AddHandler txtPopUpErrorDetail.KeyDown, Sub(sender As Object, e As KeyEventArgs) - If e.Control AndAlso e.KeyCode = Keys.KeyCode.Enter Then + If e.Control AndAlso e.KeyCode = Keys.Enter Then frmPopUp.Close() End If End Sub