diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml new file mode 100644 index 00000000000..cc948147285 --- /dev/null +++ b/.github/workflows/release-build.yml @@ -0,0 +1,196 @@ + +name: Create Installers + + + +on: + workflow_dispatch: + inputs: + major_version: + description: 'Major Version' + required: true + minor_version: + description: 'Minor Version' + required: true + revision_no: + description: 'Revision' + required: true + r-version: + description: 'Specify the R version to install' + required: true + default: '4.4.1' # Default version if the user does not specify + +jobs: + + build: + + # running on 2019 so that .NET version 4.5 and lower can be used + runs-on: windows-2019 + + # set variables + env: + Solution_Name: Instat.sln + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + + + # check out r-instat + steps: + + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + # Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild + - name: Setup MSBuild.exe + uses: microsoft/setup-msbuild@v1.1.3 + + # set up and restore NuGet packages + - name: Setup NuGet + uses: NuGet/setup-nuget@v1.1.1 + + - name: Restore NuGet + run: nuget restore $env:Solution_Name + + + # Restore the application to populate the obj folder with RuntimeIdentifiers + - name: Restore the application + run: msbuild $env:Solution_Name /t:Restore /p:Configuration=Release + + # increment build number + - name: Generate build number + uses: einaregilsson/build-number@v3 + with: + token: ${{secrets.github_token}} + + #update version numbers in assembley + - name: set-version-assemblyinfo + uses: dannevesdantas/set-version-assemblyinfo@v.1.0.0 + with: + # Folder location to search for AssemblyInfo.cs/.vb files + path: instat\My Project\AssemblyInfo.vb + # optional, default is ${{ github.workspace }} + # Version number to set on [AssemblyVersion] and [AssemblyFileVersion] attributes of AssemblyInfo.cs/.vb files + version: "${{ inputs.major_version }}.${{ inputs.minor_version }}.${{ inputs.revision_no }}.${env:BUILD_NUMBER}" + + # Create the app package by building and packaging the Windows Application Packaging project + # 64bit + - name: Create the app package 64 bit + run: msbuild $env:Solution_Name /p:Configuration=Release /p:Platform=x64 /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:PackageCertificateKeyFile=GitHubActionsWorkflow.pfx /p:PackageCertificatePassword=${{ secrets.Pfx_Key }} + env: + Appx_Bundle: Always + Appx_Package_Build_Mode: StoreUpload + Configuration: ${{ matrix.configuration }} + + # Build 64 bit installer without R + - name: Building the installer 64bit - No R + run: | + "%programfiles(x86)%\Inno Setup 6\iscc.exe" "inno_install_script_64bit.iss" + shell: cmd + + # Upload 64 bit installer without R + - name: Upload the 64 bit installer as an artifact + uses: actions/upload-artifact@v4 + if: ${{ github.event_name != 'pull_request' }} + with: + path: "Output/" + name: rinstat64NoR + + - name: Remove 64 bit without R installer + run: | + del "Output/*" + + # check out R-Instat Data + - name: Checkout Instat Data + uses: actions/checkout@v3 + with: + repository: ' africanmathsinitiative/R-Instat-Data' + fetch-depth: 0 + path: 'InstatData' + + # Create directory and copy over InstatData (64bit) + - name: Make Library directory 64 bit + run: | + MKDIR instat\bin\x64\Release\static\Library\ + + - name: Copy R-Instat Data 64 bit + run: | + ROBOCOPY InstatData\data\ instat\bin\x64\Release\static\Library\ /E + continue-on-error: true + + # Install R + - name: Set up R + uses: r-lib/actions/setup-r@v2 + with: + r-version: ${{ inputs.r-version }} + + - name: Debug paths + run: | + $R_HOME=$(Rscript -e 'cat(R.home())') + echo "R_HOME path: $R_HOME" + echo "Source path: $(pwd)\installer\Rprofile.site" + + - name: Update Rprofile.site + run: | + $R_HOME=$(Rscript -e 'cat(R.home())') + ROBOCOPY "${{ github.workspace }}\installer" "$R_HOME\etc" "Rprofile.site" /COPY:DAT + continue-on-error: true + + - name: Copy R 64 bit + run: | + $R_HOME=$(Rscript -e 'cat(R.home())') + ROBOCOPY "$R_HOME" "${{ github.workspace }}\instat\bin\x64\Release\static\R" /E + continue-on-error: true + + - name: Set R-tools + uses: r-windows/install-rtools@master + + # Check if the directory exists + - name: Verify InstallPackages.R directory + run: | + if (Test-Path "D:\a\R-Instat\R-Instat\instat\static\InstatObject\R") { + Write-Host "Directory exists." + } else { + Write-Host "Directory does not exist." + } + + # List the contents of the directory to check for the script + - name: List contents of InstatObject\R directory + run: | + Get-ChildItem "D:\a\R-Instat\R-Instat\instat\static\InstatObject\R" + + # Check if the directory exists + - name: Verify script directory + run: | + if (Test-Path "D:\a\R-Instat\R-Instat\instat\bin\x64\Release\static\R") { + Write-Host "Directory exists." + } else { + Write-Host "Directory does not exist." + } + + # List the contents of the directory to check for the script + - name: List contents of R\bin directory + run: | + Get-ChildItem "D:\a\R-Instat\R-Instat\instat\bin\x64\Release\static" + - name: List contents of R\bin directory + run: | + Get-ChildItem "D:\a\R-Instat\R-Instat\instat\bin\x64\Release\static\R" + + - name: Install R packages (64 bit) + run: | + "${{ github.workspace }}\instat\bin\x64\Release\static\R\bin\Rscript.exe" "${{ github.workspace }}\instat\static\InstatObject\R\InstallPackages.R" + shell: cmd + + - name: Building the installer 64bit - With R + run: | + "%programfiles(x86)%\Inno Setup 6\iscc.exe" "${{ github.workspace }}\inno_install_script_64bit.iss" + shell: cmd + + - name: Upload the 64 bit installer with R as an artifact + uses: actions/upload-artifact@v4 + if: ${{ github.event_name != 'pull_request' }} + with: + path: "Output/" + name: rinstat64WithR-innosetup + + diff --git a/installer/Rprofile.site b/installer/Rprofile.site new file mode 100644 index 00000000000..c12ffddf743 --- /dev/null +++ b/installer/Rprofile.site @@ -0,0 +1,25 @@ +# Things you might want to change + +# options(papersize="a4") +# options(editor="notepad") +# options(pager="internal") + +# set the default help type +# options(help_type="text") + options(help_type="html") + +# set a site library +# .Library.site <- file.path(chartr("\\", "/", R.home()), "site-library") + +# Only use internal library +if (length(.libPaths()) == 2) .libPaths(.libPaths()[2]) + +# set a CRAN mirror +# local({r <- getOption("repos") +# r["CRAN"] <- "http://my.local.cran" +# options(repos=r)}) + +# Give a fortune cookie, but only to interactive sessions +# (This would need the fortunes package to be installed.) +# if (interactive()) +# fortunes::fortune() diff --git a/instat/Interface/IDataViewGrid.vb b/instat/Interface/IDataViewGrid.vb index fa8914db568..3bc8368f164 100644 --- a/instat/Interface/IDataViewGrid.vb +++ b/instat/Interface/IDataViewGrid.vb @@ -29,6 +29,8 @@ Public Interface IDataViewGrid Event WorksheetChanged() + Event WorksheetInserted() + Event WorksheetRemoved(worksheet As clsWorksheetAdapter) Event FindRow() @@ -44,6 +46,8 @@ Public Interface IDataViewGrid Sub AdjustColumnWidthAfterWrapping(strColumn As String, Optional bApplyWrap As Boolean = False) + Sub Focus() + Function GetSelectedColumns() As List(Of clsColumnHeaderDisplay) Function GetFirstRowHeader() As String diff --git a/instat/Model/DataFrame/clsDataFramePage.vb b/instat/Model/DataFrame/clsDataFramePage.vb index 9d1250831aa..062e2216a90 100644 --- a/instat/Model/DataFrame/clsDataFramePage.vb +++ b/instat/Model/DataFrame/clsDataFramePage.vb @@ -205,6 +205,58 @@ Public Class clsDataFramePage Return Math.Ceiling(_iTotalColumnCount / iColumnIncrements) End Function + Public Sub Undo() + Dim clsUndoRFunction As New RFunction + clsUndoRFunction.SetRCommand(_clsRLink.strInstatDataObject & "$undo_last_action") + clsUndoRFunction.AddParameter("data_name", Chr(34) & _strDataFrameName & Chr(34)) + _clsRLink.RunScript(clsUndoRFunction.ToScript) + + End Sub + + Public Function IsUndo(strCurrentDataFrame As String) + Dim clsIsUndoFunction As New RFunction + Dim expTemp As SymbolicExpression + clsIsUndoFunction.SetRCommand(_clsRLink.strInstatDataObject & "$is_undo") + clsIsUndoFunction.AddParameter("data_name", Chr(34) & strCurrentDataFrame & Chr(34)) + + If clsIsUndoFunction IsNot Nothing Then + expTemp = frmMain.clsRLink.RunInternalScriptGetValue(clsIsUndoFunction.ToScript(), bSilent:=True) + If expTemp IsNot Nothing AndAlso expTemp.AsCharacter(0) = "TRUE" Then + Return True + End If + End If + + Return False + End Function + + Public Sub DisableEnableUndo(bDisable As Boolean, strCurrentDataFrame As String) + Dim clsEnableDisableUndoRFunction As New RFunction + clsEnableDisableUndoRFunction.SetRCommand(_clsRLink.strInstatDataObject & "$set_enable_disable_undo") + clsEnableDisableUndoRFunction.AddParameter("data_name", Chr(34) & strCurrentDataFrame & Chr(34)) + + Dim strDisable As String = If(bDisable, "TRUE", "FALSE") + clsEnableDisableUndoRFunction.AddParameter("disable_undo", strDisable) + _clsRLink.RunScript(clsEnableDisableUndoRFunction.ToScript) + + End Sub + + Public Function HasUndoHistory() + Dim expTemp As SymbolicExpression + Dim bHasHistory As Boolean = False + Dim clsHasHistoryFunction As New RFunction + + clsHasHistoryFunction.SetRCommand(_clsRLink.strInstatDataObject & "$has_undo_history") + clsHasHistoryFunction.AddParameter("data_name", Chr(34) & _strDataFrameName & Chr(34)) + If clsHasHistoryFunction IsNot Nothing Then + expTemp = frmMain.clsRLink.RunInternalScriptGetValue(clsHasHistoryFunction.ToScript(), bSilent:=True) + If expTemp IsNot Nothing AndAlso expTemp.AsCharacter(0) = "TRUE" Then + bHasHistory = True + End If + End If + + Return bHasHistory + End Function + Private Function GetDataFrameFromRCommand() As DataFrame Dim clsGetDataFrameRFunction As New RFunction Dim expTemp As SymbolicExpression @@ -286,7 +338,7 @@ Public Class clsDataFramePage columnHeader.strTypeShortCode = "(L)" ' Structured columns e.g. "circular or bigz or bigq " are coded with "(S)" ElseIf strHeaderType.Contains("circular") OrElse strHeaderType.Contains("bigz") OrElse - strHeaderType.Contains("bigq") OrElse strHeaderType.Contains("polynomial") Then + strHeaderType.Contains("bigq") OrElse strHeaderType.Contains("polynomial") OrElse strHeaderType.Contains("roman") Then columnHeader.strTypeShortCode = "(S)" ElseIf strHeaderType.Contains("list") Then columnHeader.strTypeShortCode = "(LT)" diff --git a/instat/UserControls/DataGrid/Linux/ucrDataViewLinuxGrid.vb b/instat/UserControls/DataGrid/Linux/ucrDataViewLinuxGrid.vb index b899d906312..103d1d540d0 100644 --- a/instat/UserControls/DataGrid/Linux/ucrDataViewLinuxGrid.vb +++ b/instat/UserControls/DataGrid/Linux/ucrDataViewLinuxGrid.vb @@ -35,6 +35,8 @@ Public Class ucrDataViewLinuxGrid Public Event WorksheetChanged() Implements IDataViewGrid.WorksheetChanged + Public Event WorksheetInserted() Implements IDataViewGrid.WorksheetInserted + Public Event WorksheetRemoved(worksheet As clsWorksheetAdapter) Implements IDataViewGrid.WorksheetRemoved Public Sub AddColumns(visiblePage As clsDataFramePage) Implements IDataViewGrid.AddColumns @@ -69,6 +71,10 @@ Public Class ucrDataViewLinuxGrid Next End Sub + Public Sub FocusGrid() Implements IDataViewGrid.Focus + Me.Focus() + End Sub + Public Function SelectedTab() As String If tcTabs.SelectedTab Is Nothing Then Return "" diff --git a/instat/UserControls/DataGrid/ReoGrid/ucrDataViewReoGrid.vb b/instat/UserControls/DataGrid/ReoGrid/ucrDataViewReoGrid.vb index 5971cb5d66c..d2b1a9cf276 100644 --- a/instat/UserControls/DataGrid/ReoGrid/ucrDataViewReoGrid.vb +++ b/instat/UserControls/DataGrid/ReoGrid/ucrDataViewReoGrid.vb @@ -35,6 +35,8 @@ Public Class ucrDataViewReoGrid Public Event WorksheetChanged() Implements IDataViewGrid.WorksheetChanged + Public Event WorksheetInserted() Implements IDataViewGrid.WorksheetInserted + Public Event WorksheetRemoved(worksheet As clsWorksheetAdapter) Implements IDataViewGrid.WorksheetRemoved Public Sub AddColumns(visiblePage As clsDataFramePage) Implements IDataViewGrid.AddColumns @@ -57,6 +59,11 @@ Public Class ucrDataViewReoGrid Next End Sub + Public Sub FocusGrid() Implements IDataViewGrid.Focus + grdData.Focus() + grdData.CurrentWorksheet.FocusPos = grdData.CurrentWorksheet.FocusPos + End Sub + Public Sub AddRowData(dataFrame As clsDataFrame) Implements IDataViewGrid.AddRowData Dim textColour As Color Dim strRowNames As String() @@ -217,6 +224,11 @@ Public Class ucrDataViewReoGrid RaiseEvent WorksheetChanged() End Sub + Private Sub grdData_WorksheetInserted(sender As Object, e As EventArgs) Handles grdData.WorksheetInserted + RaiseEvent WorksheetInserted() + End Sub + + Private Sub grdData_WorksheetRemoved(sender As Object, e As WorksheetRemovedEventArgs) Handles grdData.WorksheetRemoved RaiseEvent WorksheetRemoved(New clsWorksheetAdapter(e.Worksheet)) End Sub diff --git a/instat/UserTables/Cells/FootNotes/ucrCellsFootNotes.Designer.vb b/instat/UserTables/Cells/FootNotes/ucrCellsFootNotes.Designer.vb new file mode 100644 index 00000000000..e6c7a3e1c0e --- /dev/null +++ b/instat/UserTables/Cells/FootNotes/ucrCellsFootNotes.Designer.vb @@ -0,0 +1,202 @@ + _ +Partial Class ucrCellsFootNotes + Inherits System.Windows.Forms.UserControl + + 'UserControl overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.lblRowExpression = New System.Windows.Forms.Label() + Me.ucrInputRows = New instat.ucrInputTextBox() + Me.lblFooteNotes = New System.Windows.Forms.Label() + Me.btnClear = New System.Windows.Forms.Button() + Me.lblColumns = New System.Windows.Forms.Label() + Me.ucrSelectorCols = New instat.ucrSelectorByDataFrameAddRemove() + Me.dataGrid = New System.Windows.Forms.DataGridView() + Me.colStyles = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.ucrReceiverSingleCol = New instat.ucrReceiverSingle() + Me.btnAdd = New System.Windows.Forms.Button() + Me.ucrTxtFootNote = New instat.ucrInputTextBox() + Me.lblFootNote = New System.Windows.Forms.Label() + CType(Me.dataGrid, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'lblRowExpression + ' + Me.lblRowExpression.AutoSize = True + Me.lblRowExpression.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblRowExpression.Location = New System.Drawing.Point(238, 46) + Me.lblRowExpression.Name = "lblRowExpression" + Me.lblRowExpression.Size = New System.Drawing.Size(86, 13) + Me.lblRowExpression.TabIndex = 338 + Me.lblRowExpression.Text = "Row Expression:" + ' + 'ucrInputRows + ' + Me.ucrInputRows.AddQuotesIfUnrecognised = True + Me.ucrInputRows.AutoSize = True + Me.ucrInputRows.IsMultiline = False + Me.ucrInputRows.IsReadOnly = False + Me.ucrInputRows.Location = New System.Drawing.Point(240, 62) + Me.ucrInputRows.Name = "ucrInputRows" + Me.ucrInputRows.Size = New System.Drawing.Size(137, 21) + Me.ucrInputRows.TabIndex = 337 + ' + 'lblFooteNotes + ' + Me.lblFooteNotes.AutoSize = True + Me.lblFooteNotes.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblFooteNotes.Location = New System.Drawing.Point(233, 171) + Me.lblFooteNotes.Name = "lblFooteNotes" + Me.lblFooteNotes.Size = New System.Drawing.Size(62, 13) + Me.lblFooteNotes.TabIndex = 336 + Me.lblFooteNotes.Text = "Foot Notes:" + ' + 'btnClear + ' + Me.btnClear.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.btnClear.Location = New System.Drawing.Point(517, 162) + Me.btnClear.Name = "btnClear" + Me.btnClear.Size = New System.Drawing.Size(75, 23) + Me.btnClear.TabIndex = 335 + Me.btnClear.Tag = "" + Me.btnClear.Text = "Clear" + Me.btnClear.UseVisualStyleBackColor = True + ' + 'lblColumns + ' + Me.lblColumns.AutoSize = True + Me.lblColumns.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblColumns.Location = New System.Drawing.Point(238, 0) + Me.lblColumns.Name = "lblColumns" + Me.lblColumns.Size = New System.Drawing.Size(45, 13) + Me.lblColumns.TabIndex = 334 + Me.lblColumns.Text = "Column:" + ' + 'ucrSelectorCols + ' + Me.ucrSelectorCols.AutoSize = True + Me.ucrSelectorCols.bDropUnusedFilterLevels = False + Me.ucrSelectorCols.bShowHiddenColumns = False + Me.ucrSelectorCols.bUseCurrentFilter = True + Me.ucrSelectorCols.Location = New System.Drawing.Point(5, 0) + Me.ucrSelectorCols.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectorCols.Name = "ucrSelectorCols" + Me.ucrSelectorCols.Size = New System.Drawing.Size(213, 183) + Me.ucrSelectorCols.TabIndex = 332 + ' + 'dataGrid + ' + Me.dataGrid.AllowUserToAddRows = False + Me.dataGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.dataGrid.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.colStyles}) + Me.dataGrid.Location = New System.Drawing.Point(236, 188) + Me.dataGrid.Name = "dataGrid" + Me.dataGrid.RowHeadersWidth = 62 + Me.dataGrid.Size = New System.Drawing.Size(361, 73) + Me.dataGrid.TabIndex = 331 + ' + 'colStyles + ' + Me.colStyles.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.colStyles.HeaderText = "Foot Note Expressions" + Me.colStyles.MinimumWidth = 8 + Me.colStyles.Name = "colStyles" + ' + 'ucrReceiverSingleCol + ' + Me.ucrReceiverSingleCol.AutoSize = True + Me.ucrReceiverSingleCol.frmParent = Nothing + Me.ucrReceiverSingleCol.Location = New System.Drawing.Point(235, 13) + Me.ucrReceiverSingleCol.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverSingleCol.Name = "ucrReceiverSingleCol" + Me.ucrReceiverSingleCol.Selector = Nothing + Me.ucrReceiverSingleCol.Size = New System.Drawing.Size(142, 20) + Me.ucrReceiverSingleCol.strNcFilePath = "" + Me.ucrReceiverSingleCol.TabIndex = 339 + Me.ucrReceiverSingleCol.ucrSelector = Nothing + ' + 'btnAdd + ' + Me.btnAdd.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.btnAdd.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.btnAdd.Location = New System.Drawing.Point(241, 135) + Me.btnAdd.Name = "btnAdd" + Me.btnAdd.Size = New System.Drawing.Size(83, 23) + Me.btnAdd.TabIndex = 333 + Me.btnAdd.Tag = "" + Me.btnAdd.Text = "Add" + Me.btnAdd.UseVisualStyleBackColor = True + ' + 'ucrTxtFootNote + ' + Me.ucrTxtFootNote.AddQuotesIfUnrecognised = True + Me.ucrTxtFootNote.AutoSize = True + Me.ucrTxtFootNote.IsMultiline = False + Me.ucrTxtFootNote.IsReadOnly = False + Me.ucrTxtFootNote.Location = New System.Drawing.Point(241, 107) + Me.ucrTxtFootNote.Name = "ucrTxtFootNote" + Me.ucrTxtFootNote.Size = New System.Drawing.Size(299, 21) + Me.ucrTxtFootNote.TabIndex = 340 + ' + 'lblFootNote + ' + Me.lblFootNote.AutoSize = True + Me.lblFootNote.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblFootNote.Location = New System.Drawing.Point(243, 91) + Me.lblFootNote.Name = "lblFootNote" + Me.lblFootNote.Size = New System.Drawing.Size(81, 13) + Me.lblFootNote.TabIndex = 341 + Me.lblFootNote.Text = "Foot Note Text:" + ' + 'ucrCellsFootNotes + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.lblFootNote) + Me.Controls.Add(Me.ucrTxtFootNote) + Me.Controls.Add(Me.lblRowExpression) + Me.Controls.Add(Me.ucrInputRows) + Me.Controls.Add(Me.lblFooteNotes) + Me.Controls.Add(Me.btnClear) + Me.Controls.Add(Me.lblColumns) + Me.Controls.Add(Me.ucrSelectorCols) + Me.Controls.Add(Me.dataGrid) + Me.Controls.Add(Me.ucrReceiverSingleCol) + Me.Controls.Add(Me.btnAdd) + Me.Name = "ucrCellsFootNotes" + Me.Size = New System.Drawing.Size(602, 265) + CType(Me.dataGrid, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents lblRowExpression As Label + Friend WithEvents ucrInputRows As ucrInputTextBox + Friend WithEvents lblFooteNotes As Label + Friend WithEvents btnClear As Button + Friend WithEvents lblColumns As Label + Friend WithEvents ucrSelectorCols As ucrSelectorByDataFrameAddRemove + Friend WithEvents dataGrid As DataGridView + Friend WithEvents colStyles As DataGridViewTextBoxColumn + Friend WithEvents ucrReceiverSingleCol As ucrReceiverSingle + Friend WithEvents btnAdd As Button + Friend WithEvents ucrTxtFootNote As ucrInputTextBox + Friend WithEvents lblFootNote As Label +End Class diff --git a/instat/UserTables/Cells/FootNotes/ucrCellsFootNotes.resx b/instat/UserTables/Cells/FootNotes/ucrCellsFootNotes.resx new file mode 100644 index 00000000000..a249bebae7f --- /dev/null +++ b/instat/UserTables/Cells/FootNotes/ucrCellsFootNotes.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + True + + \ No newline at end of file diff --git a/instat/UserTables/Cells/FootNotes/ucrCellsFootNotes.vb b/instat/UserTables/Cells/FootNotes/ucrCellsFootNotes.vb new file mode 100644 index 00000000000..c7cc5c3cf51 --- /dev/null +++ b/instat/UserTables/Cells/FootNotes/ucrCellsFootNotes.vb @@ -0,0 +1,94 @@ +Public Class ucrCellsFootNotes + + Private clsOperator As New ROperator + Private bFirstload As Boolean = True + + Private Sub InitialiseControl() + ucrReceiverSingleCol.Selector = ucrSelectorCols + ucrReceiverSingleCol.SetMeAsReceiver() + End Sub + + Public Sub Setup(strDataFrameName As String, clsOperator As ROperator) + If bFirstload Then + InitialiseControl() + bFirstload = False + End If + + Me.clsOperator = clsOperator + + ' Set up the controls + ucrSelectorCols.SetDataframe(strDataFrameName, bEnableDataframe:=False) + SetupDataGrid(clsOperator) + + End Sub + + + Private Sub SetupDataGrid(clsOperator As ROperator) + Dim lstRParams As List(Of RParameter) = clsTablesUtils.FindRFunctionsParamsWithRParamValue({"tab_footnote"}, "locations", "cells_body", clsOperator) + ' Clear grid rgen add contents from operator + dataGrid.Rows.Clear() + For Each clsRParam As RParameter In lstRParams + + ' Create a new row that represents the tab_style() parameters + Dim row As New DataGridViewRow + row.CreateCells(dataGrid) + row.Cells(0).Value = clsRParam.clsArgumentCodeStructure.Clone.ToScript + + ' Tag and add the parameter function contents as a row + row.Tag = clsRParam + dataGrid.Rows.Add(row) + Next + End Sub + + Private Sub ucrInputControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrInputRows.ControlContentsChanged, ucrReceiverSingleCol.ControlContentsChanged + btnAdd.Enabled = Not ucrReceiverSingleCol.IsEmpty AndAlso Not ucrInputRows.IsEmpty + End Sub + + Private Sub btnAdd_Click(sender As Object, e As EventArgs) Handles btnAdd.Click + + Dim clsTabFootNoteRFunction As New RFunction + Dim clsLocationsRFunction As New RFunction + + + clsLocationsRFunction.SetPackageName("gt") + clsLocationsRFunction.SetRCommand("cells_body") + clsLocationsRFunction.AddParameter(New RParameter(strParameterName:="columns", strParamValue:=ucrReceiverSingleCol.GetVariableNames(bWithQuotes:=False), iNewPosition:=0)) + clsLocationsRFunction.AddParameter(New RParameter(strParameterName:="rows", strParamValue:=ucrInputRows.GetText, iNewPosition:=1)) + + clsTabFootNoteRFunction.SetPackageName("gt") + clsTabFootNoteRFunction.SetRCommand("tab_footnote") + clsTabFootNoteRFunction.AddParameter(strParameterName:="footnote", strParameterValue:=Chr(34) & ucrTxtFootNote.GetText & Chr(34), iPosition:=0) + clsTabFootNoteRFunction.AddParameter(strParameterName:="locations", clsRFunctionParameter:=clsLocationsRFunction, iPosition:=1) + + ' Create parameter with unique name + Dim clsRParam As New RParameter(strParameterName:="tab_footnote_cells_param" & (dataGrid.Rows.Count + 1), strParamValue:=clsTabFootNoteRFunction, bNewIncludeArgumentName:=False) + + ' Create row and its cells + Dim row As New DataGridViewRow + row.CreateCells(dataGrid) + row.Cells(0).Value = clsTabFootNoteRFunction.Clone.ToScript + + ' Tag the row with the parameter + row.Tag = clsRParam + + ' Add it to grid + dataGrid.Rows.Add(row) + + End Sub + + Private Sub btnClear_Click(sender As Object, e As EventArgs) Handles btnClear.Click + dataGrid.Rows.Clear() + End Sub + + Public Sub SetValuesToOperator() + ' Remove any previous cell footers + Dim lstRParams As List(Of RParameter) = clsTablesUtils.FindRFunctionsParamsWithRParamValue({"tab_footnote"}, "locations", "cells_body", clsOperator) + For Each clsRParam As RParameter In lstRParams + clsOperator.RemoveParameter(clsRParam) + Next + + ' Add new changes + clsTablesUtils.AddGridRowTagsRParamsToROperator(dataGrid, clsOperator) + End Sub + +End Class diff --git a/instat/UserTables/Cells/Formats/Date/sdgCellFormatDateOptions.Designer.vb b/instat/UserTables/Cells/Formats/Date/sdgCellFormatDateOptions.Designer.vb new file mode 100644 index 00000000000..a1bc3ea22f3 --- /dev/null +++ b/instat/UserTables/Cells/Formats/Date/sdgCellFormatDateOptions.Designer.vb @@ -0,0 +1,79 @@ + _ +Partial Class sdgCellFormatDateOptions + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.ucrInputCboDateFormat = New instat.ucrInputComboBox() + Me.lblDateFormat = New System.Windows.Forms.Label() + Me.ucrSdgBaseButtons = New instat.ucrButtonsSubdialogue() + Me.SuspendLayout() + ' + 'ucrInputCboDateFormat + ' + Me.ucrInputCboDateFormat.AddQuotesIfUnrecognised = True + Me.ucrInputCboDateFormat.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrInputCboDateFormat.GetSetSelectedIndex = -1 + Me.ucrInputCboDateFormat.IsReadOnly = False + Me.ucrInputCboDateFormat.Location = New System.Drawing.Point(12, 25) + Me.ucrInputCboDateFormat.Name = "ucrInputCboDateFormat" + Me.ucrInputCboDateFormat.Size = New System.Drawing.Size(137, 21) + Me.ucrInputCboDateFormat.TabIndex = 0 + ' + 'lblDateFormat + ' + Me.lblDateFormat.AutoSize = True + Me.lblDateFormat.Location = New System.Drawing.Point(7, 9) + Me.lblDateFormat.Name = "lblDateFormat" + Me.lblDateFormat.Size = New System.Drawing.Size(103, 13) + Me.lblDateFormat.TabIndex = 1 + Me.lblDateFormat.Text = "Specify Date Format" + ' + 'ucrSdgBaseButtons + ' + Me.ucrSdgBaseButtons.AutoSize = True + Me.ucrSdgBaseButtons.Location = New System.Drawing.Point(10, 65) + Me.ucrSdgBaseButtons.Margin = New System.Windows.Forms.Padding(4) + Me.ucrSdgBaseButtons.Name = "ucrSdgBaseButtons" + Me.ucrSdgBaseButtons.Size = New System.Drawing.Size(224, 30) + Me.ucrSdgBaseButtons.TabIndex = 343 + ' + 'sdgCellFormatDateOptions + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(255, 103) + Me.Controls.Add(Me.ucrSdgBaseButtons) + Me.Controls.Add(Me.lblDateFormat) + Me.Controls.Add(Me.ucrInputCboDateFormat) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.Name = "sdgCellFormatDateOptions" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent + Me.Text = "Cell Date Format Options" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents ucrInputCboDateFormat As ucrInputComboBox + Friend WithEvents lblDateFormat As Label + Friend WithEvents ucrSdgBaseButtons As ucrButtonsSubdialogue +End Class diff --git a/instat/UserTables/Cells/Formats/Date/sdgCellFormatDateOptions.resx b/instat/UserTables/Cells/Formats/Date/sdgCellFormatDateOptions.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/instat/UserTables/Cells/Formats/Date/sdgCellFormatDateOptions.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/instat/UserTables/Cells/Formats/Date/sdgCellFormatDateOptions.vb b/instat/UserTables/Cells/Formats/Date/sdgCellFormatDateOptions.vb new file mode 100644 index 00000000000..96d2cdc8784 --- /dev/null +++ b/instat/UserTables/Cells/Formats/Date/sdgCellFormatDateOptions.vb @@ -0,0 +1,104 @@ +Public Class sdgCellFormatDateOptions + + Private clsFormatDateRFunction As New RFunction + Private bFirstload As Boolean = True + + Private bUserMadeChanges As Boolean = False + Private bUserClickedReturn As Boolean = False + + Private Sub sdgCellFormatDateOptions_Load(sender As Object, e As EventArgs) Handles MyBase.Load + If bFirstload Then + InitialiseDialog() + bFirstload = False + End If + + SetDefaults() + SetRCode(True) + + bUserMadeChanges = False + bUserClickedReturn = False + End Sub + + Private Sub InitialiseDialog() + Dim dctDateFormat As New Dictionary(Of String, String) From { + {"2000-02-29", Chr(34) & "iso" & Chr(34)}, + {"Tuesday, February 29, 2000", Chr(34) & "wday_month_day_year" & Chr(34)}, + {"Tue, Feb 29, 2000", Chr(34) & "wd_m_day_year" & Chr(34)}, + {"Tuesday 29 February 2000", Chr(34) & "wday_day_month_year" & Chr(34)}, + {"February 29, 2000", Chr(34) & "month_day_year" & Chr(34)}, + {"Feb 29, 2000", Chr(34) & "m_day_year" & Chr(34)}, + {"29 Feb 2000", Chr(34) & "day_m_year" & Chr(34)}, + {"29 February 2000", Chr(34) & "day_month_year" & Chr(34)}, + {"29 February", Chr(34) & "day_month" & Chr(34)}, + {"29 Feb", Chr(34) & "day_m" & Chr(34)}, + {"2000", Chr(34) & "year" & Chr(34)}, + {"February", Chr(34) & "month" & Chr(34)}, + {"29", Chr(34) & "day" & Chr(34)}, + {"2000/02/29", Chr(34) & "year.mn.day" & Chr(34)}, + {"00/02/2", Chr(34) & " y.mn.day" & Chr(34)}, + {"2000-W09", Chr(34) & "year_week" & Chr(34)}, + {"2000-Q1", Chr(34) & "year_quarter" & Chr(34)}, + {"2/29/2000 (flexible)", Chr(34) & "yMd" & Chr(34)}, + {"Tue, 2/29/2000 (flexible)", Chr(34) & "yMEd" & Chr(34)}, + {"Feb 2000 (flexible)", Chr(34) & "yMMM" & Chr(34)}, + {"February 2000 (flexible)", Chr(34) & "yMMMM" & Chr(34)}, + {"Feb 29, 2000 (flexible)", Chr(34) & "yMMMd" & Chr(34)}, + {"Tue, Feb 29, 2000 (flexible)", Chr(34) & "yMMMEd" & Chr(34)}, + {"2/29/2000 A (flexible)", Chr(34) & "GyMd" & Chr(34)}, + {"Feb 29, 2000 AD (flexible)", Chr(34) & "GyMMMd" & Chr(34)}, + {"Tue, Feb 29, 2000 AD (flexible)", Chr(34) & "GyMMMEd" & Chr(34)}, + {"2/2000 (flexible)", Chr(34) & "yM" & Chr(34)}, + {"2/29 (flexible)", Chr(34) & "Md" & Chr(34)}, + {"Tue, 2/29 (flexible)", Chr(34) & "MEd" & Chr(34)}, + {"Feb 29 (flexible)", Chr(34) & "MMMd" & Chr(34)}, + {"Tue, Feb 29 (flexible)", Chr(34) & "MMMEd" & Chr(34)}, + {"February 29 (flexible)", Chr(34) & "MMMMd" & Chr(34)}, + {"Feb 2000 AD (flexible)", Chr(34) & "GyMMM" & Chr(34)}, + {"Q1 2000 (flexible)", Chr(34) & "yQQQ" & Chr(34)}, + {"1st quarter 2000", Chr(34) & "yQQQQ" & Chr(34)}, + {"2000 AD (flexible)", Chr(34) & "Gy" & Chr(34)}, + {"2000 (flexible)", Chr(34) & "y" & Chr(34)}, + {"Feb (flexible)", Chr(34) & "MMM" & Chr(34)}, + {"29 (flexible)", Chr(34) & "d" & Chr(34)}, + {"29 Tue (flexible)", Chr(34) & "Ed" & Chr(34)} + } + + ucrInputCboDateFormat.SetParameter(New RParameter("date_style", 3)) + ucrInputCboDateFormat.SetItems(dctDateFormat) + ucrInputCboDateFormat.SetDropDownStyleAsNonEditable() + ucrInputCboDateFormat.SetRDefault("iso") + + End Sub + + Private Sub SetDefaults() + clsFormatDateRFunction = New RFunction + + clsFormatDateRFunction.SetPackageName("gt") + clsFormatDateRFunction.SetRCommand("fmt_date") + clsFormatDateRFunction.AddParameter(strParameterName:="date_style", strParameterValue:=Chr(34) & "iso" & Chr(34)) + + End Sub + + Private Sub SetRCode(bReset As Boolean) + ucrInputCboDateFormat.SetRCode(clsFormatDateRFunction, bReset) + End Sub + + Public Function GetNewUserInputAsRFunction() As RFunction + If Not bUserClickedReturn OrElse Not bUserMadeChanges Then + Return Nothing + End If + + Return clsFormatDateRFunction + End Function + + + Private Sub ucrSdgBaseButtons_ClickReturn(sender As Object, e As EventArgs) Handles ucrSdgBaseButtons.ClickReturn + bUserClickedReturn = True + End Sub + + Private Sub controls_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputCboDateFormat.ControlValueChanged + bUserMadeChanges = True + End Sub + + +End Class \ No newline at end of file diff --git a/instat/UserTables/Cells/Formats/Number/sdgCellFormatNumberOptions.Designer.vb b/instat/UserTables/Cells/Formats/Number/sdgCellFormatNumberOptions.Designer.vb new file mode 100644 index 00000000000..ffbf40b7935 --- /dev/null +++ b/instat/UserTables/Cells/Formats/Number/sdgCellFormatNumberOptions.Designer.vb @@ -0,0 +1,197 @@ + _ +Partial Class sdgCellFormatNumberOptions + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.ucrChkSuffix = New instat.ucrCheck() + Me.ucrInputSeperatorMark = New instat.ucrInputTextBox() + Me.ucrChkSeparatorMark = New instat.ucrCheck() + Me.ucrChkDropTrailingDecimalMark = New instat.ucrCheck() + Me.ucrInputDecimalMark = New instat.ucrInputTextBox() + Me.ucrChkDecimalMark = New instat.ucrCheck() + Me.ucrChkDropTrailingZeros = New instat.ucrCheck() + Me.ucrChkSignificantFigures = New instat.ucrCheck() + Me.ucrChkDecimalPlaces = New instat.ucrCheck() + Me.ucrNudSignificantFigures = New instat.ucrNud() + Me.ucrNudDecimalPlaces = New instat.ucrNud() + Me.ucrSdgBaseButtons = New instat.ucrButtonsSubdialogue() + Me.SuspendLayout() + ' + 'ucrChkSuffix + ' + Me.ucrChkSuffix.AutoSize = True + Me.ucrChkSuffix.Checked = False + Me.ucrChkSuffix.Location = New System.Drawing.Point(8, 187) + Me.ucrChkSuffix.Name = "ucrChkSuffix" + Me.ucrChkSuffix.Size = New System.Drawing.Size(152, 23) + Me.ucrChkSuffix.TabIndex = 28 + ' + 'ucrInputSeperatorMark + ' + Me.ucrInputSeperatorMark.AddQuotesIfUnrecognised = True + Me.ucrInputSeperatorMark.AutoSize = True + Me.ucrInputSeperatorMark.IsMultiline = False + Me.ucrInputSeperatorMark.IsReadOnly = False + Me.ucrInputSeperatorMark.Location = New System.Drawing.Point(166, 96) + Me.ucrInputSeperatorMark.Name = "ucrInputSeperatorMark" + Me.ucrInputSeperatorMark.Size = New System.Drawing.Size(137, 21) + Me.ucrInputSeperatorMark.TabIndex = 27 + ' + 'ucrChkSeparatorMark + ' + Me.ucrChkSeparatorMark.AutoSize = True + Me.ucrChkSeparatorMark.Checked = False + Me.ucrChkSeparatorMark.Location = New System.Drawing.Point(8, 96) + Me.ucrChkSeparatorMark.Name = "ucrChkSeparatorMark" + Me.ucrChkSeparatorMark.Size = New System.Drawing.Size(152, 23) + Me.ucrChkSeparatorMark.TabIndex = 26 + ' + 'ucrChkDropTrailingDecimalMark + ' + Me.ucrChkDropTrailingDecimalMark.AutoSize = True + Me.ucrChkDropTrailingDecimalMark.Checked = False + Me.ucrChkDropTrailingDecimalMark.Location = New System.Drawing.Point(8, 158) + Me.ucrChkDropTrailingDecimalMark.Name = "ucrChkDropTrailingDecimalMark" + Me.ucrChkDropTrailingDecimalMark.Size = New System.Drawing.Size(152, 23) + Me.ucrChkDropTrailingDecimalMark.TabIndex = 25 + ' + 'ucrInputDecimalMark + ' + Me.ucrInputDecimalMark.AddQuotesIfUnrecognised = True + Me.ucrInputDecimalMark.AutoSize = True + Me.ucrInputDecimalMark.IsMultiline = False + Me.ucrInputDecimalMark.IsReadOnly = False + Me.ucrInputDecimalMark.Location = New System.Drawing.Point(166, 67) + Me.ucrInputDecimalMark.Name = "ucrInputDecimalMark" + Me.ucrInputDecimalMark.Size = New System.Drawing.Size(137, 21) + Me.ucrInputDecimalMark.TabIndex = 24 + ' + 'ucrChkDecimalMark + ' + Me.ucrChkDecimalMark.AutoSize = True + Me.ucrChkDecimalMark.Checked = False + Me.ucrChkDecimalMark.Location = New System.Drawing.Point(8, 67) + Me.ucrChkDecimalMark.Name = "ucrChkDecimalMark" + Me.ucrChkDecimalMark.Size = New System.Drawing.Size(152, 23) + Me.ucrChkDecimalMark.TabIndex = 23 + ' + 'ucrChkDropTrailingZeros + ' + Me.ucrChkDropTrailingZeros.AutoSize = True + Me.ucrChkDropTrailingZeros.Checked = False + Me.ucrChkDropTrailingZeros.Location = New System.Drawing.Point(8, 129) + Me.ucrChkDropTrailingZeros.Name = "ucrChkDropTrailingZeros" + Me.ucrChkDropTrailingZeros.Size = New System.Drawing.Size(152, 23) + Me.ucrChkDropTrailingZeros.TabIndex = 22 + ' + 'ucrChkSignificantFigures + ' + Me.ucrChkSignificantFigures.AutoSize = True + Me.ucrChkSignificantFigures.Checked = False + Me.ucrChkSignificantFigures.Location = New System.Drawing.Point(8, 36) + Me.ucrChkSignificantFigures.Name = "ucrChkSignificantFigures" + Me.ucrChkSignificantFigures.Size = New System.Drawing.Size(152, 23) + Me.ucrChkSignificantFigures.TabIndex = 21 + ' + 'ucrChkDecimalPlaces + ' + Me.ucrChkDecimalPlaces.AutoSize = True + Me.ucrChkDecimalPlaces.Checked = False + Me.ucrChkDecimalPlaces.Location = New System.Drawing.Point(8, 7) + Me.ucrChkDecimalPlaces.Name = "ucrChkDecimalPlaces" + Me.ucrChkDecimalPlaces.Size = New System.Drawing.Size(152, 23) + Me.ucrChkDecimalPlaces.TabIndex = 20 + ' + 'ucrNudSignificantFigures + ' + Me.ucrNudSignificantFigures.AutoSize = True + Me.ucrNudSignificantFigures.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudSignificantFigures.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudSignificantFigures.Location = New System.Drawing.Point(166, 39) + Me.ucrNudSignificantFigures.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudSignificantFigures.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudSignificantFigures.Name = "ucrNudSignificantFigures" + Me.ucrNudSignificantFigures.Size = New System.Drawing.Size(50, 20) + Me.ucrNudSignificantFigures.TabIndex = 19 + Me.ucrNudSignificantFigures.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrNudDecimalPlaces + ' + Me.ucrNudDecimalPlaces.AutoSize = True + Me.ucrNudDecimalPlaces.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudDecimalPlaces.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudDecimalPlaces.Location = New System.Drawing.Point(166, 7) + Me.ucrNudDecimalPlaces.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudDecimalPlaces.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudDecimalPlaces.Name = "ucrNudDecimalPlaces" + Me.ucrNudDecimalPlaces.Size = New System.Drawing.Size(50, 20) + Me.ucrNudDecimalPlaces.TabIndex = 18 + Me.ucrNudDecimalPlaces.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrSdgBaseButtons + ' + Me.ucrSdgBaseButtons.AutoSize = True + Me.ucrSdgBaseButtons.Location = New System.Drawing.Point(43, 223) + Me.ucrSdgBaseButtons.Margin = New System.Windows.Forms.Padding(4) + Me.ucrSdgBaseButtons.Name = "ucrSdgBaseButtons" + Me.ucrSdgBaseButtons.Size = New System.Drawing.Size(224, 30) + Me.ucrSdgBaseButtons.TabIndex = 342 + ' + 'sdgCellFormatNumberOptions + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(314, 263) + Me.Controls.Add(Me.ucrSdgBaseButtons) + Me.Controls.Add(Me.ucrChkSuffix) + Me.Controls.Add(Me.ucrInputSeperatorMark) + Me.Controls.Add(Me.ucrChkSeparatorMark) + Me.Controls.Add(Me.ucrChkDropTrailingDecimalMark) + Me.Controls.Add(Me.ucrInputDecimalMark) + Me.Controls.Add(Me.ucrChkDecimalMark) + Me.Controls.Add(Me.ucrChkDropTrailingZeros) + Me.Controls.Add(Me.ucrChkSignificantFigures) + Me.Controls.Add(Me.ucrChkDecimalPlaces) + Me.Controls.Add(Me.ucrNudSignificantFigures) + Me.Controls.Add(Me.ucrNudDecimalPlaces) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.Name = "sdgCellFormatNumberOptions" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent + Me.Text = "Cell Format Number Options" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents ucrChkSuffix As ucrCheck + Friend WithEvents ucrInputSeperatorMark As ucrInputTextBox + Friend WithEvents ucrChkSeparatorMark As ucrCheck + Friend WithEvents ucrChkDropTrailingDecimalMark As ucrCheck + Friend WithEvents ucrInputDecimalMark As ucrInputTextBox + Friend WithEvents ucrChkDecimalMark As ucrCheck + Friend WithEvents ucrChkDropTrailingZeros As ucrCheck + Friend WithEvents ucrChkSignificantFigures As ucrCheck + Friend WithEvents ucrChkDecimalPlaces As ucrCheck + Friend WithEvents ucrNudSignificantFigures As ucrNud + Friend WithEvents ucrNudDecimalPlaces As ucrNud + Friend WithEvents ucrSdgBaseButtons As ucrButtonsSubdialogue +End Class diff --git a/instat/UserTables/Cells/Formats/Number/sdgCellFormatNumberOptions.resx b/instat/UserTables/Cells/Formats/Number/sdgCellFormatNumberOptions.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/instat/UserTables/Cells/Formats/Number/sdgCellFormatNumberOptions.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/instat/UserTables/Cells/Formats/Number/sdgCellFormatNumberOptions.vb b/instat/UserTables/Cells/Formats/Number/sdgCellFormatNumberOptions.vb new file mode 100644 index 00000000000..8c944238b12 --- /dev/null +++ b/instat/UserTables/Cells/Formats/Number/sdgCellFormatNumberOptions.vb @@ -0,0 +1,127 @@ +Public Class sdgCellFormatNumberOptions + Private clsFormatNumberRFunction As New RFunction + Private bFirstload As Boolean = True + + Private bUserMadeChanges As Boolean = False + Private bUserClickedReturn As Boolean = False + + + Private Sub sdgCellFormatNumberOptions_Load(sender As Object, e As EventArgs) Handles MyBase.Load + If bFirstload Then + InitialiseDialog() + bFirstload = False + End If + + SetDefaults() + SetRCode(True) + + bUserMadeChanges = False + bUserClickedReturn = False + End Sub + + + Private Sub InitialiseDialog() + + '--------------- + ucrChkDecimalPlaces.SetText("Change Decimal Places") + ucrChkDecimalPlaces.AddToLinkedControls(ucrNudDecimalPlaces, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="2") + + ucrNudDecimalPlaces.SetParameter(New RParameter("decimals", 3)) + '--------------- + + '-------------- + ucrChkSignificantFigures.SetText("Change Significant Figures") + ucrChkSignificantFigures.AddToLinkedControls(ucrNudSignificantFigures, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True) + + ucrNudSignificantFigures.SetParameter(New RParameter("n_sigfig", 4)) + '-------------- + + + '-------------- + ucrChkDecimalMark.SetText("Change Decimal Mark") + ucrChkDecimalMark.AddToLinkedControls(ucrInputDecimalMark, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=".") + + ucrInputDecimalMark.SetParameter(New RParameter("dec_mark", 13)) + '-------------- + + '--------------- + ucrChkSeparatorMark.SetText("Change Digits Separator Mark") + ucrChkSeparatorMark.AddToLinkedControls(ucrInputSeperatorMark, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=",") + + ucrInputSeperatorMark.SetParameter(New RParameter("sep_mark", 14)) + '--------------- + + '--------------- + ucrChkDropTrailingZeros.SetText("Drop Trailing Zeros") + ucrChkDropTrailingZeros.SetParameter(New RParameter("drop_trailing_zeros", 5)) + ucrChkDropTrailingZeros.SetValuesCheckedAndUnchecked("TRUE", False) + ucrChkDropTrailingZeros.SetRDefault("FALSE") + '--------------- + + '--------------- + ucrChkDropTrailingDecimalMark.SetText("Drop Trailing Decimal Mark") + ucrChkDropTrailingDecimalMark.SetParameter(New RParameter("drop_trailing_dec_mark", 6)) + ucrChkDropTrailingDecimalMark.SetValuesCheckedAndUnchecked("TRUE", "FALSE") + ucrChkDropTrailingDecimalMark.SetRDefault("TRUE") + '--------------- + + '--------------- + ucrChkSuffix.SetText("Suffix Large Numbers") + ucrChkSuffix.SetParameter(New RParameter("suffixing", 10)) + ucrChkSuffix.SetValuesCheckedAndUnchecked("TRUE", "FALSE") + ucrChkSuffix.SetRDefault("FALSE") + '--------------- + + + End Sub + + Private Sub SetDefaults() + clsFormatNumberRFunction = New RFunction + + clsFormatNumberRFunction.SetPackageName("gt") + clsFormatNumberRFunction.SetRCommand("fmt_number") + + End Sub + + Private Sub SetRCode(bReset As Boolean) + ucrChkDecimalPlaces.SetRCode(clsFormatNumberRFunction, bReset) + ucrNudDecimalPlaces.SetRCode(clsFormatNumberRFunction, bReset) + + ucrChkSignificantFigures.SetRCode(clsFormatNumberRFunction, bReset) + ucrNudSignificantFigures.SetRCode(clsFormatNumberRFunction, bReset) + + ucrChkDecimalMark.SetRCode(clsFormatNumberRFunction, bReset) + ucrInputDecimalMark.SetRCode(clsFormatNumberRFunction, bReset) + + ucrChkSeparatorMark.SetRCode(clsFormatNumberRFunction, bReset) + ucrInputSeperatorMark.SetRCode(clsFormatNumberRFunction, bReset) + + ucrChkDropTrailingZeros.SetRCode(clsFormatNumberRFunction, bReset) + ucrChkDropTrailingDecimalMark.SetRCode(clsFormatNumberRFunction, bReset) + + ucrChkSuffix.SetRCode(clsFormatNumberRFunction, bReset) + + End Sub + + Public Function GetNewUserInputAsRFunction() As RFunction + If Not bUserClickedReturn OrElse Not bUserMadeChanges Then + Return Nothing + End If + + Return clsFormatNumberRFunction + End Function + + Private Sub ucrSdgBaseButtons_ClickReturn(sender As Object, e As EventArgs) Handles ucrSdgBaseButtons.ClickReturn + bUserClickedReturn = True + End Sub + + Private Sub controls_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkDecimalMark.ControlValueChanged, + ucrChkDecimalPlaces.ControlValueChanged, ucrChkDropTrailingDecimalMark.ControlValueChanged, ucrChkDropTrailingZeros.ControlValueChanged, + ucrChkSeparatorMark.ControlValueChanged, ucrChkSignificantFigures.ControlValueChanged, ucrChkSuffix.ControlValueChanged, + ucrInputDecimalMark.ControlValueChanged, ucrInputSeperatorMark.ControlValueChanged, ucrNudDecimalPlaces.ControlValueChanged, + ucrNudSignificantFigures.ControlValueChanged + + bUserMadeChanges = True + End Sub + +End Class \ No newline at end of file diff --git a/instat/UserTables/Cells/Formats/Text/sdgCellFormatTextOptions.Designer.vb b/instat/UserTables/Cells/Formats/Text/sdgCellFormatTextOptions.Designer.vb new file mode 100644 index 00000000000..0e699d42903 --- /dev/null +++ b/instat/UserTables/Cells/Formats/Text/sdgCellFormatTextOptions.Designer.vb @@ -0,0 +1,119 @@ + _ +Partial Class sdgCellFormatTextOptions + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.rdoEmail = New System.Windows.Forms.RadioButton() + Me.ucrInputFormatExpression = New instat.ucrInputTextBox() + Me.rdoCustom = New System.Windows.Forms.RadioButton() + Me.rdoUnits = New System.Windows.Forms.RadioButton() + Me.ucrCellFormatEmail = New instat.ucrCellFormatEmail() + Me.ucrSdgBaseButtons = New instat.ucrButtonsSubdialogue() + Me.SuspendLayout() + ' + 'rdoEmail + ' + Me.rdoEmail.AutoSize = True + Me.rdoEmail.Location = New System.Drawing.Point(5, 76) + Me.rdoEmail.Name = "rdoEmail" + Me.rdoEmail.Size = New System.Drawing.Size(65, 17) + Me.rdoEmail.TabIndex = 339 + Me.rdoEmail.TabStop = True + Me.rdoEmail.Text = "As Email" + Me.rdoEmail.UseVisualStyleBackColor = True + ' + 'ucrInputFormatExpression + ' + Me.ucrInputFormatExpression.AddQuotesIfUnrecognised = True + Me.ucrInputFormatExpression.AutoSize = True + Me.ucrInputFormatExpression.IsMultiline = False + Me.ucrInputFormatExpression.IsReadOnly = False + Me.ucrInputFormatExpression.Location = New System.Drawing.Point(123, 8) + Me.ucrInputFormatExpression.Name = "ucrInputFormatExpression" + Me.ucrInputFormatExpression.Size = New System.Drawing.Size(137, 21) + Me.ucrInputFormatExpression.TabIndex = 338 + ' + 'rdoCustom + ' + Me.rdoCustom.AutoSize = True + Me.rdoCustom.Location = New System.Drawing.Point(6, 8) + Me.rdoCustom.Name = "rdoCustom" + Me.rdoCustom.Size = New System.Drawing.Size(95, 17) + Me.rdoCustom.TabIndex = 337 + Me.rdoCustom.TabStop = True + Me.rdoCustom.Text = "Custom Format" + Me.rdoCustom.UseVisualStyleBackColor = True + ' + 'rdoUnits + ' + Me.rdoUnits.AutoSize = True + Me.rdoUnits.Location = New System.Drawing.Point(6, 42) + Me.rdoUnits.Name = "rdoUnits" + Me.rdoUnits.Size = New System.Drawing.Size(64, 17) + Me.rdoUnits.TabIndex = 336 + Me.rdoUnits.TabStop = True + Me.rdoUnits.Text = "As Units" + Me.rdoUnits.UseVisualStyleBackColor = True + ' + 'ucrCellFormatEmail + ' + Me.ucrCellFormatEmail.Location = New System.Drawing.Point(123, 76) + Me.ucrCellFormatEmail.Name = "ucrCellFormatEmail" + Me.ucrCellFormatEmail.Size = New System.Drawing.Size(190, 154) + Me.ucrCellFormatEmail.TabIndex = 340 + ' + 'ucrSdgBaseButtons + ' + Me.ucrSdgBaseButtons.AutoSize = True + Me.ucrSdgBaseButtons.Location = New System.Drawing.Point(52, 237) + Me.ucrSdgBaseButtons.Margin = New System.Windows.Forms.Padding(4) + Me.ucrSdgBaseButtons.Name = "ucrSdgBaseButtons" + Me.ucrSdgBaseButtons.Size = New System.Drawing.Size(224, 30) + Me.ucrSdgBaseButtons.TabIndex = 341 + ' + 'sdgCellFormatTextOptions + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(341, 271) + Me.Controls.Add(Me.ucrSdgBaseButtons) + Me.Controls.Add(Me.rdoEmail) + Me.Controls.Add(Me.ucrInputFormatExpression) + Me.Controls.Add(Me.rdoCustom) + Me.Controls.Add(Me.rdoUnits) + Me.Controls.Add(Me.ucrCellFormatEmail) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.Name = "sdgCellFormatTextOptions" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent + Me.Text = "Cell Text Format Options" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents rdoEmail As RadioButton + Friend WithEvents ucrInputFormatExpression As ucrInputTextBox + Friend WithEvents rdoCustom As RadioButton + Friend WithEvents rdoUnits As RadioButton + Friend WithEvents ucrCellFormatEmail As ucrCellFormatEmail + Friend WithEvents ucrSdgBaseButtons As ucrButtonsSubdialogue +End Class diff --git a/instat/UserTables/Cells/Formats/Text/sdgCellFormatTextOptions.resx b/instat/UserTables/Cells/Formats/Text/sdgCellFormatTextOptions.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/instat/UserTables/Cells/Formats/Text/sdgCellFormatTextOptions.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/instat/UserTables/Cells/Formats/Text/sdgCellFormatTextOptions.vb b/instat/UserTables/Cells/Formats/Text/sdgCellFormatTextOptions.vb new file mode 100644 index 00000000000..01ad42ce4a1 --- /dev/null +++ b/instat/UserTables/Cells/Formats/Text/sdgCellFormatTextOptions.vb @@ -0,0 +1,76 @@ +Imports instat.Translations +Public Class sdgCellFormatTextOptions + Private clsUnitsFormatRFunction, clsCustomFormatRFunction As New RFunction + Private bFirstload As Boolean = True + Private bUserMadeChanges As Boolean = False + Private bUserClickedReturn As Boolean = False + + + Private Sub sdgCellFormatTextOptions_Load(sender As Object, e As EventArgs) Handles MyBase.Load + If bFirstload Then + InitialiseDialog() + bFirstload = False + End If + + SetDefaults() + + bUserMadeChanges = False + bUserClickedReturn = False + autoTranslate(Me) + End Sub + + Private Sub InitialiseDialog() + rdoCustom.Checked = True + ucrCellFormatEmail.Enabled = False + End Sub + + Private Sub SetDefaults() + clsUnitsFormatRFunction = New RFunction + clsCustomFormatRFunction = New RFunction + + clsCustomFormatRFunction.SetPackageName("gt") + clsCustomFormatRFunction.SetRCommand("fmt") + + + clsUnitsFormatRFunction.SetPackageName("gt") + clsUnitsFormatRFunction.SetRCommand("fmt_units") + + + ucrInputFormatExpression.SetName("") + End Sub + + Public Function GetNewUserInputAsRFunction() As RFunction + If Not bUserClickedReturn OrElse Not bUserMadeChanges Then + Return Nothing + End If + + If rdoUnits.Checked Then + Return clsUnitsFormatRFunction + ElseIf rdoCustom.Checked AndAlso Not ucrInputFormatExpression.IsEmpty Then + Return clsCustomFormatRFunction + End If + + Return Nothing + End Function + + Private Sub radioButtons_CheckedChanged(sender As Object, e As EventArgs) Handles rdoCustom.CheckedChanged, rdoUnits.CheckedChanged, rdoEmail.CheckedChanged + ucrInputFormatExpression.Visible = rdoCustom.Checked + ucrCellFormatEmail.Visible = rdoEmail.Checked + bUserMadeChanges = True + End Sub + + Private Sub ucrInputFormatExpression_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputFormatExpression.ControlValueChanged + If ucrInputFormatExpression.IsEmpty Then + clsCustomFormatRFunction.ClearParameters() + Else + clsCustomFormatRFunction.AddParameter(strParameterName:="fns", strParameterValue:="function(x){ " & ucrInputFormatExpression.GetText() & " }") + End If + + bUserMadeChanges = True + + End Sub + + Private Sub ucrSdgBaseButtons_ClickReturn(sender As Object, e As EventArgs) Handles ucrSdgBaseButtons.ClickReturn + bUserClickedReturn = True + End Sub +End Class \ No newline at end of file diff --git a/instat/UserTables/Cells/Formats/Text/ucrCellFormatEmail.Designer.vb b/instat/UserTables/Cells/Formats/Text/ucrCellFormatEmail.Designer.vb new file mode 100644 index 00000000000..469ef8d0ae2 --- /dev/null +++ b/instat/UserTables/Cells/Formats/Text/ucrCellFormatEmail.Designer.vb @@ -0,0 +1,115 @@ + _ +Partial Class ucrCellFormatEmail + Inherits System.Windows.Forms.UserControl + + 'UserControl overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.ucrCboColors = New instat.ucrColors() + Me.lblColor = New System.Windows.Forms.Label() + Me.ucrChkShowUnderline = New instat.ucrCheck() + Me.ucrChkAsButton = New instat.ucrCheck() + Me.ucrReceiverSingleDisplayName = New instat.ucrReceiverSingle() + Me.Label1 = New System.Windows.Forms.Label() + Me.SuspendLayout() + ' + 'ucrCboColors + ' + Me.ucrCboColors.AddQuotesIfUnrecognised = True + Me.ucrCboColors.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboColors.GetSetSelectedIndex = -1 + Me.ucrCboColors.IsReadOnly = False + Me.ucrCboColors.Location = New System.Drawing.Point(9, 129) + Me.ucrCboColors.Name = "ucrCboColors" + Me.ucrCboColors.Size = New System.Drawing.Size(137, 21) + Me.ucrCboColors.TabIndex = 1 + ' + 'lblColor + ' + Me.lblColor.AutoSize = True + Me.lblColor.Location = New System.Drawing.Point(6, 113) + Me.lblColor.Name = "lblColor" + Me.lblColor.Size = New System.Drawing.Size(34, 13) + Me.lblColor.TabIndex = 2 + Me.lblColor.Text = "Color:" + ' + 'ucrChkShowUnderline + ' + Me.ucrChkShowUnderline.AutoSize = True + Me.ucrChkShowUnderline.Checked = False + Me.ucrChkShowUnderline.Location = New System.Drawing.Point(6, 80) + Me.ucrChkShowUnderline.Name = "ucrChkShowUnderline" + Me.ucrChkShowUnderline.Size = New System.Drawing.Size(189, 23) + Me.ucrChkShowUnderline.TabIndex = 3 + ' + 'ucrChkAsButton + ' + Me.ucrChkAsButton.AutoSize = True + Me.ucrChkAsButton.Checked = False + Me.ucrChkAsButton.Location = New System.Drawing.Point(6, 47) + Me.ucrChkAsButton.Name = "ucrChkAsButton" + Me.ucrChkAsButton.Size = New System.Drawing.Size(189, 23) + Me.ucrChkAsButton.TabIndex = 4 + ' + 'ucrReceiverSingleDisplayName + ' + Me.ucrReceiverSingleDisplayName.AutoSize = True + Me.ucrReceiverSingleDisplayName.frmParent = Nothing + Me.ucrReceiverSingleDisplayName.Location = New System.Drawing.Point(10, 19) + Me.ucrReceiverSingleDisplayName.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverSingleDisplayName.Name = "ucrReceiverSingleDisplayName" + Me.ucrReceiverSingleDisplayName.Selector = Nothing + Me.ucrReceiverSingleDisplayName.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverSingleDisplayName.strNcFilePath = "" + Me.ucrReceiverSingleDisplayName.TabIndex = 5 + Me.ucrReceiverSingleDisplayName.ucrSelector = Nothing + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(7, 5) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(74, 13) + Me.Label1.TabIndex = 6 + Me.Label1.Text = "Link Email To:" + ' + 'ucrCellFormatEmail + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.Label1) + Me.Controls.Add(Me.ucrReceiverSingleDisplayName) + Me.Controls.Add(Me.ucrChkAsButton) + Me.Controls.Add(Me.ucrChkShowUnderline) + Me.Controls.Add(Me.lblColor) + Me.Controls.Add(Me.ucrCboColors) + Me.Name = "ucrCellFormatEmail" + Me.Size = New System.Drawing.Size(205, 154) + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents ucrCboColors As ucrColors + Friend WithEvents lblColor As Label + Friend WithEvents ucrChkShowUnderline As ucrCheck + Friend WithEvents ucrChkAsButton As ucrCheck + Friend WithEvents ucrReceiverSingleDisplayName As ucrReceiverSingle + Friend WithEvents Label1 As Label +End Class diff --git a/instat/UserTables/Cells/Formats/Text/ucrCellFormatEmail.resx b/instat/UserTables/Cells/Formats/Text/ucrCellFormatEmail.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/instat/UserTables/Cells/Formats/Text/ucrCellFormatEmail.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/instat/UserTables/Cells/Formats/Text/ucrCellFormatEmail.vb b/instat/UserTables/Cells/Formats/Text/ucrCellFormatEmail.vb new file mode 100644 index 00000000000..d0f15fc038e --- /dev/null +++ b/instat/UserTables/Cells/Formats/Text/ucrCellFormatEmail.vb @@ -0,0 +1,36 @@ +Public Class ucrCellFormatEmail + + Private clsFormatEmailRFunction, clsFromColumnRFunction As New RFunction + Private bFirstload As Boolean = True + + Private Sub InitialiseControl() + ucrReceiverSingleDisplayName.SetParameter(New RParameter("display_name", 0)) + ucrReceiverSingleDisplayName.SetParameterIsString() + + + ucrChkAsButton.SetText("Display As Button") + ucrChkAsButton.SetParameter(New RParameter("as_button", 5)) + ucrChkAsButton.SetRDefault("FALSE") + + ucrChkShowUnderline.SetText("Show underline") + End Sub + + Public Sub Setup() + If bFirstload Then + InitialiseControl() + bFirstload = False + End If + + + clsFormatEmailRFunction = New RFunction + clsFormatEmailRFunction.SetRCommand("fmt_email") + 'TODO. This gt function is documented in https://gt.rstudio.com/reference/fmt_email.html but RStudio could not find the function. + ' Implement later. + + clsFromColumnRFunction = New RFunction + clsFromColumnRFunction.SetRCommand("from_column") + + End Sub + + +End Class diff --git a/instat/UserTables/Cells/Formats/ucrCellFormats.Designer.vb b/instat/UserTables/Cells/Formats/ucrCellFormats.Designer.vb new file mode 100644 index 00000000000..50da2a9ebce --- /dev/null +++ b/instat/UserTables/Cells/Formats/ucrCellFormats.Designer.vb @@ -0,0 +1,219 @@ + _ +Partial Class ucrCellFormats + Inherits System.Windows.Forms.UserControl + + 'UserControl overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.lblFormats = New System.Windows.Forms.Label() + Me.btnClearFormats = New System.Windows.Forms.Button() + Me.btnEnterFormat = New System.Windows.Forms.Button() + Me.dataGridFormats = New System.Windows.Forms.DataGridView() + Me.lblColumns = New System.Windows.Forms.Label() + Me.cboSelectFormat = New System.Windows.Forms.ComboBox() + Me.Label2 = New System.Windows.Forms.Label() + Me.ucrReceiverMultipleCols = New instat.ucrReceiverMultiple() + Me.ucrSelectorCols = New instat.ucrSelectorByDataFrameAddRemove() + Me.ucrRowExpression = New instat.ucrRowExpression() + Me.Label1 = New System.Windows.Forms.Label() + Me.colCodnition = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.colLabel = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.colRow = New System.Windows.Forms.DataGridViewTextBoxColumn() + CType(Me.dataGridFormats, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'lblFormats + ' + Me.lblFormats.AutoSize = True + Me.lblFormats.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblFormats.Location = New System.Drawing.Point(231, 220) + Me.lblFormats.Name = "lblFormats" + Me.lblFormats.Size = New System.Drawing.Size(47, 13) + Me.lblFormats.TabIndex = 312 + Me.lblFormats.Text = "Formats:" + ' + 'btnClearFormats + ' + Me.btnClearFormats.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.btnClearFormats.Location = New System.Drawing.Point(515, 211) + Me.btnClearFormats.Name = "btnClearFormats" + Me.btnClearFormats.Size = New System.Drawing.Size(75, 23) + Me.btnClearFormats.TabIndex = 311 + Me.btnClearFormats.Tag = "" + Me.btnClearFormats.Text = "Clear" + Me.btnClearFormats.UseVisualStyleBackColor = True + ' + 'btnEnterFormat + ' + Me.btnEnterFormat.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.btnEnterFormat.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.btnEnterFormat.Location = New System.Drawing.Point(234, 188) + Me.btnEnterFormat.Name = "btnEnterFormat" + Me.btnEnterFormat.Size = New System.Drawing.Size(126, 23) + Me.btnEnterFormat.TabIndex = 309 + Me.btnEnterFormat.Tag = "" + Me.btnEnterFormat.Text = "Enter Format" + Me.btnEnterFormat.UseVisualStyleBackColor = True + ' + 'dataGridFormats + ' + Me.dataGridFormats.AllowUserToAddRows = False + Me.dataGridFormats.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.dataGridFormats.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.colCodnition, Me.colLabel, Me.colRow}) + Me.dataGridFormats.Location = New System.Drawing.Point(234, 237) + Me.dataGridFormats.Name = "dataGridFormats" + Me.dataGridFormats.ReadOnly = True + Me.dataGridFormats.RowHeadersWidth = 62 + Me.dataGridFormats.Size = New System.Drawing.Size(361, 73) + Me.dataGridFormats.TabIndex = 307 + ' + 'lblColumns + ' + Me.lblColumns.AutoSize = True + Me.lblColumns.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblColumns.Location = New System.Drawing.Point(237, 60) + Me.lblColumns.Name = "lblColumns" + Me.lblColumns.Size = New System.Drawing.Size(56, 13) + Me.lblColumns.TabIndex = 310 + Me.lblColumns.Text = "Column(s):" + ' + 'cboSelectFormat + ' + Me.cboSelectFormat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.cboSelectFormat.FormattingEnabled = True + Me.cboSelectFormat.Items.AddRange(New Object() {"Text", "Number", "Date"}) + Me.cboSelectFormat.Location = New System.Drawing.Point(234, 33) + Me.cboSelectFormat.Name = "cboSelectFormat" + Me.cboSelectFormat.Size = New System.Drawing.Size(132, 21) + Me.cboSelectFormat.TabIndex = 321 + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.Label2.Location = New System.Drawing.Point(231, 17) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(75, 13) + Me.Label2.TabIndex = 322 + Me.Label2.Text = "Select Format:" + ' + 'ucrReceiverMultipleCols + ' + Me.ucrReceiverMultipleCols.AutoSize = True + Me.ucrReceiverMultipleCols.frmParent = Nothing + Me.ucrReceiverMultipleCols.Location = New System.Drawing.Point(234, 76) + Me.ucrReceiverMultipleCols.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverMultipleCols.Name = "ucrReceiverMultipleCols" + Me.ucrReceiverMultipleCols.Selector = Nothing + Me.ucrReceiverMultipleCols.Size = New System.Drawing.Size(132, 55) + Me.ucrReceiverMultipleCols.strNcFilePath = "" + Me.ucrReceiverMultipleCols.TabIndex = 317 + Me.ucrReceiverMultipleCols.ucrSelector = Nothing + ' + 'ucrSelectorCols + ' + Me.ucrSelectorCols.AutoSize = True + Me.ucrSelectorCols.bDropUnusedFilterLevels = False + Me.ucrSelectorCols.bShowHiddenColumns = False + Me.ucrSelectorCols.bUseCurrentFilter = True + Me.ucrSelectorCols.Location = New System.Drawing.Point(4, 6) + Me.ucrSelectorCols.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectorCols.Name = "ucrSelectorCols" + Me.ucrSelectorCols.Size = New System.Drawing.Size(213, 183) + Me.ucrSelectorCols.TabIndex = 308 + ' + 'ucrRowExpression + ' + Me.ucrRowExpression.Location = New System.Drawing.Point(234, 158) + Me.ucrRowExpression.Name = "ucrRowExpression" + Me.ucrRowExpression.Size = New System.Drawing.Size(132, 25) + Me.ucrRowExpression.TabIndex = 334 + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.Label1.Location = New System.Drawing.Point(236, 142) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(134, 13) + Me.Label1.TabIndex = 333 + Me.Label1.Text = "Row Expression (Optional):" + ' + 'colCodnition + ' + Me.colCodnition.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells + Me.colCodnition.HeaderText = "Format" + Me.colCodnition.MinimumWidth = 8 + Me.colCodnition.Name = "colCodnition" + Me.colCodnition.ReadOnly = True + Me.colCodnition.Width = 64 + ' + 'colLabel + ' + Me.colLabel.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells + Me.colLabel.HeaderText = "Column(s)" + Me.colLabel.MinimumWidth = 8 + Me.colLabel.Name = "colLabel" + Me.colLabel.ReadOnly = True + Me.colLabel.Width = 78 + ' + 'colRow + ' + Me.colRow.HeaderText = "Row Expression" + Me.colRow.Name = "colRow" + Me.colRow.ReadOnly = True + ' + 'ucrCellFormats + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.ucrRowExpression) + Me.Controls.Add(Me.Label1) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.cboSelectFormat) + Me.Controls.Add(Me.ucrReceiverMultipleCols) + Me.Controls.Add(Me.lblFormats) + Me.Controls.Add(Me.btnClearFormats) + Me.Controls.Add(Me.lblColumns) + Me.Controls.Add(Me.btnEnterFormat) + Me.Controls.Add(Me.ucrSelectorCols) + Me.Controls.Add(Me.dataGridFormats) + Me.Name = "ucrCellFormats" + Me.Size = New System.Drawing.Size(602, 312) + CType(Me.dataGridFormats, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents lblFormats As Label + Friend WithEvents btnClearFormats As Button + Friend WithEvents btnEnterFormat As Button + Friend WithEvents dataGridFormats As DataGridView + Friend WithEvents ucrReceiverMultipleCols As ucrReceiverMultiple + Friend WithEvents lblColumns As Label + Friend WithEvents ucrSelectorCols As ucrSelectorByDataFrameAddRemove + Friend WithEvents cboSelectFormat As ComboBox + Friend WithEvents Label2 As Label + Friend WithEvents ucrRowExpression As ucrRowExpression + Friend WithEvents Label1 As Label + Friend WithEvents colCodnition As DataGridViewTextBoxColumn + Friend WithEvents colLabel As DataGridViewTextBoxColumn + Friend WithEvents colRow As DataGridViewTextBoxColumn +End Class diff --git a/instat/UserTables/Cells/Formats/ucrCellFormats.resx b/instat/UserTables/Cells/Formats/ucrCellFormats.resx new file mode 100644 index 00000000000..df1d8e46938 --- /dev/null +++ b/instat/UserTables/Cells/Formats/ucrCellFormats.resx @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + True + + + True + + \ No newline at end of file diff --git a/instat/UserTables/Cells/Formats/ucrCellFormats.vb b/instat/UserTables/Cells/Formats/ucrCellFormats.vb new file mode 100644 index 00000000000..8a1ecd9ed70 --- /dev/null +++ b/instat/UserTables/Cells/Formats/ucrCellFormats.vb @@ -0,0 +1,146 @@ +Public Class ucrCellFormats + + Private clsOperator As New ROperator + Private bFirstload As Boolean = True + + + Private Sub InitialiseControl() + ucrReceiverMultipleCols.Selector = ucrSelectorCols + ucrReceiverMultipleCols.SetMeAsReceiver() + + cboSelectFormat.SelectedIndex = 0 + End Sub + + Public Sub Setup(strDataFrameName As String, clsOperator As ROperator) + If bFirstload Then + InitialiseControl() + bFirstload = False + End If + + Me.clsOperator = clsOperator + + ' Set up the selector + ucrSelectorCols.SetDataframe(strDataFrameName, bEnableDataframe:=False) + ucrReceiverMultipleCols.SetMeAsReceiver() + ucrRowExpression.Setup(strDataFrameName) + + ' Clear and Set up the data grid with contents + dataGridFormats.Rows.Clear() + SetupDataGrid(clsTablesUtils.FindRFunctionsParamsWithRCommand({"fmt", "fmt_units", "fmt_number", "fmt_currency"}, clsOperator)) + + End Sub + + Private Sub SetupDataGrid(lstRParams As List(Of RParameter)) + + For Each clsRParam As RParameter In lstRParams + + Dim clsFormatRFunction As RFunction = clsRParam.clsArgumentCodeStructure + + ' Create a new row that represents the tab_row_group() parameters + Dim row As New DataGridViewRow + row.CreateCells(dataGridFormats) + + ' Set the function name + row.Cells(0).Value = clsFormatRFunction.strRCommand + + For Each clsRowGroupRParam As RParameter In clsFormatRFunction.clsParameters + If clsRowGroupRParam.strArgumentName = "columns" Then + row.Cells(1).Value = clsTablesUtils.GetStringValue(clsRowGroupRParam.strArgumentValue, False) + ElseIf clsRowGroupRParam.strArgumentName = "rows" Then + row.Cells(2).Value = clsTablesUtils.GetStringValue(clsRowGroupRParam.strArgumentValue, False) + End If + Next + + ' Tag and add the tab_row_group() parameter function contents as a row + row.Tag = clsRParam + dataGridFormats.Rows.Add(row) + + Next + End Sub + + Private Sub ucrReceiverMultipleCols_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverMultipleCols.ControlContentsChanged + btnEnterFormat.Enabled = Not ucrReceiverMultipleCols.IsEmpty + End Sub + + Private Sub btnEnter_Click(sender As Object, e As EventArgs) Handles btnEnterFormat.Click + Dim clsFormatRFunction As RFunction = Nothing + If cboSelectFormat.Text = "Text" Then + sdgCellFormatTextOptions.ShowDialog(Me.ParentForm) + clsFormatRFunction = sdgCellFormatTextOptions.GetNewUserInputAsRFunction() + ElseIf cboSelectFormat.Text = "Number" Then + sdgCellFormatNumberOptions.ShowDialog(Me.ParentForm) + clsFormatRFunction = sdgCellFormatNumberOptions.GetNewUserInputAsRFunction() + ElseIf cboSelectFormat.Text = "Date" Then + sdgCellFormatDateOptions.ShowDialog(Me.ParentForm) + clsFormatRFunction = sdgCellFormatDateOptions.GetNewUserInputAsRFunction() + ElseIf cboSelectFormat.Text = "Missing" Then + ' TODO + End If + + If clsFormatRFunction Is Nothing Then + Exit Sub + End If + + AddFormatParameterToGrid(clsFormatRFunction) + ucrReceiverMultipleCols.Clear() + ucrRowExpression.Clear() + + End Sub + + + Private Sub AddFormatParameterToGrid(clsFormatRFunction As RFunction) + + Dim strColumnsExpression As String = ucrReceiverMultipleCols.GetVariableNames(bWithQuotes:=False) + Dim strRowsExpression As String = ucrRowExpression.GetText + + ' Add columns parameter + clsFormatRFunction.AddParameter(New RParameter(strParameterName:="columns", strParamValue:=strColumnsExpression, iNewPosition:=0)) + + ' Add rows as paramater if present + If Not ucrRowExpression.IsEmpty Then + clsFormatRFunction.AddParameter(New RParameter(strParameterName:="rows", strParamValue:=strRowsExpression, iNewPosition:=1)) + End If + + ' Create parameter with unique name + Dim clsRParam As New RParameter(strParameterName:="fmt_param" & (dataGridFormats.Rows.Count + 1), strParamValue:=clsFormatRFunction, bNewIncludeArgumentName:=False) + + ' Create row and its cells + Dim row As New DataGridViewRow + row.CreateCells(dataGridFormats) + row.Cells(0).Value = clsFormatRFunction.strRCommand + row.Cells(1).Value = strColumnsExpression + row.Cells(2).Value = strRowsExpression + + + ' Tag the row with the parameter + row.Tag = clsRParam + + ' Add it to grid + dataGridFormats.Rows.Add(row) + + End Sub + + Private Sub btnClearFormats_Click(sender As Object, e As EventArgs) Handles btnClearFormats.Click + dataGridFormats.Rows.Clear() + End Sub + + Private Sub cboSelectFormat_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboSelectFormat.TextChanged + If cboSelectFormat.Text = "Text" OrElse cboSelectFormat.Text = "Missing" Then + 'ucrReceiverMultipleCols.SetIncludedDataTypes({}) + ucrReceiverMultipleCols.strSelectorHeading = "Select Columns" + ElseIf cboSelectFormat.Text = "Number" Then + 'ucrReceiverMultipleCols.SetIncludedDataTypes({"numeric"}) + ucrReceiverMultipleCols.strSelectorHeading = "Select Numerics" + ElseIf cboSelectFormat.Text = "Date" Then + 'ucrReceiverMultipleCols.SetIncludedDataTypes({"date"}) + ucrReceiverMultipleCols.strSelectorHeading = "Select Dates" + End If + + ucrReceiverMultipleCols.SetMeAsReceiver() + End Sub + + Public Sub SetValuesToOperator() + clsTablesUtils.RemoveRFunctionsParamsWithRCommand({"fmt", "fmt_units", "fmt_number", "fmt_currency"}, clsOperator) + clsTablesUtils.AddGridRowTagsRParamsToROperator(dataGridFormats, clsOperator) + End Sub +End Class diff --git a/instat/UserTables/Cells/Styles/ucrCellStyles.Designer.vb b/instat/UserTables/Cells/Styles/ucrCellStyles.Designer.vb new file mode 100644 index 00000000000..90378b40f8c --- /dev/null +++ b/instat/UserTables/Cells/Styles/ucrCellStyles.Designer.vb @@ -0,0 +1,180 @@ + _ +Partial Class ucrCellStyles + Inherits System.Windows.Forms.UserControl + + 'UserControl overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.lblRowExpression = New System.Windows.Forms.Label() + Me.lblFormats = New System.Windows.Forms.Label() + Me.btnClearFormats = New System.Windows.Forms.Button() + Me.dataGridFormats = New System.Windows.Forms.DataGridView() + Me.colStyles = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.btnEnterStyle = New System.Windows.Forms.Button() + Me.Label1 = New System.Windows.Forms.Label() + Me.ucrRowExpression = New instat.ucrRowExpression() + Me.ucrReceiverMultipleCols = New instat.ucrReceiverMultiple() + Me.ucrSelectorCols = New instat.ucrSelectorByDataFrameAddRemove() + CType(Me.dataGridFormats, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'lblRowExpression + ' + Me.lblRowExpression.AutoSize = True + Me.lblRowExpression.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblRowExpression.Location = New System.Drawing.Point(368, 132) + Me.lblRowExpression.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblRowExpression.Name = "lblRowExpression" + Me.lblRowExpression.Size = New System.Drawing.Size(200, 20) + Me.lblRowExpression.TabIndex = 329 + Me.lblRowExpression.Text = "Row Expression (Optional):" + ' + 'lblFormats + ' + Me.lblFormats.AutoSize = True + Me.lblFormats.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblFormats.Location = New System.Drawing.Point(354, 255) + Me.lblFormats.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblFormats.Name = "lblFormats" + Me.lblFormats.Size = New System.Drawing.Size(56, 20) + Me.lblFormats.TabIndex = 326 + Me.lblFormats.Text = "Styles:" + ' + 'btnClearFormats + ' + Me.btnClearFormats.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.btnClearFormats.Location = New System.Drawing.Point(712, 242) + Me.btnClearFormats.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.btnClearFormats.Name = "btnClearFormats" + Me.btnClearFormats.Size = New System.Drawing.Size(112, 35) + Me.btnClearFormats.TabIndex = 5 + Me.btnClearFormats.Tag = "" + Me.btnClearFormats.Text = "Clear" + Me.btnClearFormats.UseVisualStyleBackColor = True + ' + 'dataGridFormats + ' + Me.dataGridFormats.AllowUserToAddRows = False + Me.dataGridFormats.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.dataGridFormats.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.colStyles}) + Me.dataGridFormats.Location = New System.Drawing.Point(358, 282) + Me.dataGridFormats.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.dataGridFormats.Name = "dataGridFormats" + Me.dataGridFormats.RowHeadersWidth = 62 + Me.dataGridFormats.Size = New System.Drawing.Size(472, 112) + Me.dataGridFormats.TabIndex = 6 + ' + 'colStyles + ' + Me.colStyles.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.colStyles.HeaderText = "Style Expressions" + Me.colStyles.MinimumWidth = 8 + Me.colStyles.Name = "colStyles" + ' + 'btnEnterStyle + ' + Me.btnEnterStyle.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.btnEnterStyle.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.btnEnterStyle.Location = New System.Drawing.Point(366, 209) + Me.btnEnterStyle.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.btnEnterStyle.Name = "btnEnterStyle" + Me.btnEnterStyle.Size = New System.Drawing.Size(189, 35) + Me.btnEnterStyle.TabIndex = 4 + Me.btnEnterStyle.Tag = "" + Me.btnEnterStyle.Text = "Enter Style" + Me.btnEnterStyle.UseVisualStyleBackColor = True + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.Label1.Location = New System.Drawing.Point(369, 11) + Me.Label1.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(85, 20) + Me.Label1.TabIndex = 331 + Me.Label1.Text = "Column(s):" + ' + 'ucrRowExpression + ' + Me.ucrRowExpression.Location = New System.Drawing.Point(366, 158) + Me.ucrRowExpression.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) + Me.ucrRowExpression.Name = "ucrRowExpression" + Me.ucrRowExpression.Size = New System.Drawing.Size(186, 38) + Me.ucrRowExpression.TabIndex = 332 + ' + 'ucrReceiverMultipleCols + ' + Me.ucrReceiverMultipleCols.AutoSize = True + Me.ucrReceiverMultipleCols.frmParent = Nothing + Me.ucrReceiverMultipleCols.Location = New System.Drawing.Point(366, 35) + Me.ucrReceiverMultipleCols.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverMultipleCols.Name = "ucrReceiverMultipleCols" + Me.ucrReceiverMultipleCols.Selector = Nothing + Me.ucrReceiverMultipleCols.Size = New System.Drawing.Size(180, 85) + Me.ucrReceiverMultipleCols.strNcFilePath = "" + Me.ucrReceiverMultipleCols.TabIndex = 2 + Me.ucrReceiverMultipleCols.ucrSelector = Nothing + ' + 'ucrSelectorCols + ' + Me.ucrSelectorCols.AutoSize = True + Me.ucrSelectorCols.bDropUnusedFilterLevels = False + Me.ucrSelectorCols.bShowHiddenColumns = False + Me.ucrSelectorCols.bUseCurrentFilter = True + Me.ucrSelectorCols.Location = New System.Drawing.Point(10, 11) + Me.ucrSelectorCols.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectorCols.Name = "ucrSelectorCols" + Me.ucrSelectorCols.Size = New System.Drawing.Size(320, 282) + Me.ucrSelectorCols.TabIndex = 1 + ' + 'ucrCellStyles + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(9.0!, 20.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.ucrRowExpression) + Me.Controls.Add(Me.ucrReceiverMultipleCols) + Me.Controls.Add(Me.Label1) + Me.Controls.Add(Me.lblRowExpression) + Me.Controls.Add(Me.lblFormats) + Me.Controls.Add(Me.btnClearFormats) + Me.Controls.Add(Me.btnEnterStyle) + Me.Controls.Add(Me.ucrSelectorCols) + Me.Controls.Add(Me.dataGridFormats) + Me.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.Name = "ucrCellStyles" + Me.Size = New System.Drawing.Size(836, 398) + CType(Me.dataGridFormats, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents lblRowExpression As Label + Friend WithEvents lblFormats As Label + Friend WithEvents btnClearFormats As Button + Friend WithEvents ucrSelectorCols As ucrSelectorByDataFrameAddRemove + Friend WithEvents dataGridFormats As DataGridView + Friend WithEvents btnEnterStyle As Button + Friend WithEvents colStyles As DataGridViewTextBoxColumn + Friend WithEvents ucrReceiverMultipleCols As ucrReceiverMultiple + Friend WithEvents Label1 As Label + Friend WithEvents ucrRowExpression As ucrRowExpression +End Class diff --git a/instat/UserTables/Cells/Styles/ucrCellStyles.resx b/instat/UserTables/Cells/Styles/ucrCellStyles.resx new file mode 100644 index 00000000000..d937ee32b35 --- /dev/null +++ b/instat/UserTables/Cells/Styles/ucrCellStyles.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + \ No newline at end of file diff --git a/instat/UserTables/Cells/Styles/ucrCellStyles.vb b/instat/UserTables/Cells/Styles/ucrCellStyles.vb new file mode 100644 index 00000000000..08a22c9f5c6 --- /dev/null +++ b/instat/UserTables/Cells/Styles/ucrCellStyles.vb @@ -0,0 +1,88 @@ +Public Class ucrCellStyles + Private clsOperator As New ROperator + Private bFirstload As Boolean = True + + Private Sub ucrCellStyles_Load(sender As Object, e As EventArgs) Handles MyBase.Load + If bFirstload Then + InitialiseControl() + bFirstload = False + End If + End Sub + + Private Sub InitialiseControl() + ucrReceiverMultipleCols.Selector = ucrSelectorCols + ucrReceiverMultipleCols.SetMeAsReceiver() + End Sub + + Public Sub Setup(strDataFrameName As String, clsOperator As ROperator) + If bFirstload Then + InitialiseControl() + bFirstload = False + End If + + Me.clsOperator = clsOperator + + ' Set up the selector + ucrSelectorCols.SetDataframe(strDataFrameName, bEnableDataframe:=False) + ucrRowExpression.Setup(strDataFrameName) + + ' Clear and Set up the data grid with contents + dataGridFormats.Rows.Clear() + SetupDataGrid(clsTablesUtils.FindRFunctionsParamsWithRParamValue({"tab_style"}, "locations", "cells_body", clsOperator)) + End Sub + + Private Sub SetupDataGrid(lstRParams As List(Of RParameter)) + For Each clsRParam As RParameter In lstRParams + ' Create a new row that represents the tab_style() parameters + Dim row As New DataGridViewRow + row.CreateCells(dataGridFormats) + row.Cells(0).Value = clsRParam.clsArgumentCodeStructure.Clone.ToScript + + ' Tag and add the tab_style() parameter function contents as a row + row.Tag = clsRParam + dataGridFormats.Rows.Add(row) + Next + End Sub + + Private Sub ucrInputControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverMultipleCols.ControlContentsChanged + btnEnterStyle.Enabled = Not ucrReceiverMultipleCols.IsEmpty + End Sub + + Private Sub btnEnterStyle_Click(sender As Object, e As EventArgs) Handles btnEnterStyle.Click + Dim clsListStyleRFunction As RFunction = clsTablesUtils.ShowStyleSubDialog(Me.ParentForm) + If clsListStyleRFunction Is Nothing Then + Exit Sub + End If + + Dim clsLocationsRFunction As New RFunction + clsLocationsRFunction.SetPackageName("gt") + clsLocationsRFunction.SetRCommand("cells_body") + clsLocationsRFunction.AddParameter(New RParameter(strParameterName:="columns", strParamValue:=ucrReceiverMultipleCols.GetVariableNames(bWithQuotes:=False), iNewPosition:=0)) + If Not ucrRowExpression.IsEmpty Then + clsLocationsRFunction.AddParameter(New RParameter(strParameterName:="rows", strParamValue:=ucrRowExpression.GetText(), iNewPosition:=1)) + End If + + Dim clsTabStyleRFunction As RFunction = clsTablesUtils.GetNewStyleRFunction(clsListStyleRFunction, clsLocationsRFunction) + + ' Create row and its cells + Dim row As New DataGridViewRow + row.CreateCells(dataGridFormats) + row.Cells(0).Value = clsTabStyleRFunction.Clone.ToScript + + ' Create parameter with unique name and tag the row with the parameter + row.Tag = New RParameter(strParameterName:="tab_style_cells_body_param" & (dataGridFormats.Rows.Count + 1), strParamValue:=clsTabStyleRFunction, bNewIncludeArgumentName:=False) + + ' Add it to grid + dataGridFormats.Rows.Add(row) + End Sub + + Private Sub btnClearFormats_Click(sender As Object, e As EventArgs) Handles btnClearFormats.Click + dataGridFormats.Rows.Clear() + End Sub + + Public Sub SetValuesToOperator() + clsTablesUtils.RemoveRParams(clsTablesUtils.FindRFunctionsParamsWithRParamValue({"tab_style"}, "locations", "cells_body", clsOperator), clsOperator) + clsTablesUtils.AddGridRowTagsRParamsToROperator(dataGridFormats, clsOperator) + End Sub + +End Class diff --git a/instat/UserTables/Cells/ucrCells.Designer.vb b/instat/UserTables/Cells/ucrCells.Designer.vb new file mode 100644 index 00000000000..2fb0f5c89d5 --- /dev/null +++ b/instat/UserTables/Cells/ucrCells.Designer.vb @@ -0,0 +1,147 @@ + +Partial Class ucrCells + Inherits System.Windows.Forms.UserControl + + 'UserControl overrides dispose to clean up the component list. + + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + + Private Sub InitializeComponent() + Me.rdoStyles = New System.Windows.Forms.RadioButton() + Me.rdoFormat = New System.Windows.Forms.RadioButton() + Me.rdoFootNotes = New System.Windows.Forms.RadioButton() + Me.ucrCellsFootNotes = New instat.ucrCellsFootNotes() + Me.ucrCellFormats = New instat.ucrCellFormats() + Me.ucrPnlCells = New instat.UcrPanel() + Me.ucrCellStyles = New instat.ucrCellStyles() + Me.SuspendLayout() + ' + 'rdoStyles + ' + Me.rdoStyles.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoStyles.BackColor = System.Drawing.SystemColors.Control + Me.rdoStyles.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None + Me.rdoStyles.CheckAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoStyles.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoStyles.FlatAppearance.BorderSize = 2 + Me.rdoStyles.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoStyles.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoStyles.ForeColor = System.Drawing.SystemColors.ActiveCaptionText + Me.rdoStyles.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoStyles.Location = New System.Drawing.Point(279, 3) + Me.rdoStyles.Name = "rdoStyles" + Me.rdoStyles.Size = New System.Drawing.Size(91, 29) + Me.rdoStyles.TabIndex = 292 + Me.rdoStyles.Text = "Styles" + Me.rdoStyles.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoStyles.UseVisualStyleBackColor = True + ' + 'rdoFormat + ' + Me.rdoFormat.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoFormat.BackColor = System.Drawing.SystemColors.Control + Me.rdoFormat.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None + Me.rdoFormat.CheckAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoFormat.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoFormat.FlatAppearance.BorderSize = 2 + Me.rdoFormat.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoFormat.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoFormat.ForeColor = System.Drawing.SystemColors.ActiveCaptionText + Me.rdoFormat.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoFormat.Location = New System.Drawing.Point(102, 3) + Me.rdoFormat.Name = "rdoFormat" + Me.rdoFormat.Size = New System.Drawing.Size(91, 29) + Me.rdoFormat.TabIndex = 290 + Me.rdoFormat.Text = "Formats" + Me.rdoFormat.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoFormat.UseVisualStyleBackColor = True + ' + 'rdoFootNotes + ' + Me.rdoFootNotes.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoFootNotes.BackColor = System.Drawing.SystemColors.Control + Me.rdoFootNotes.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None + Me.rdoFootNotes.CheckAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoFootNotes.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoFootNotes.FlatAppearance.BorderSize = 2 + Me.rdoFootNotes.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoFootNotes.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoFootNotes.ForeColor = System.Drawing.SystemColors.ActiveCaptionText + Me.rdoFootNotes.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoFootNotes.Location = New System.Drawing.Point(191, 3) + Me.rdoFootNotes.Name = "rdoFootNotes" + Me.rdoFootNotes.Size = New System.Drawing.Size(91, 29) + Me.rdoFootNotes.TabIndex = 291 + Me.rdoFootNotes.Text = "Footer Notes" + Me.rdoFootNotes.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoFootNotes.UseVisualStyleBackColor = True + ' + 'ucrCellsFootNotes + ' + Me.ucrCellsFootNotes.Location = New System.Drawing.Point(7, 38) + Me.ucrCellsFootNotes.Name = "ucrCellsFootNotes" + Me.ucrCellsFootNotes.Size = New System.Drawing.Size(604, 318) + Me.ucrCellsFootNotes.TabIndex = 294 + ' + 'ucrCellFormats + ' + Me.ucrCellFormats.Location = New System.Drawing.Point(7, 37) + Me.ucrCellFormats.Name = "ucrCellFormats" + Me.ucrCellFormats.Size = New System.Drawing.Size(604, 319) + Me.ucrCellFormats.TabIndex = 293 + ' + 'ucrPnlCells + ' + Me.ucrPnlCells.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlCells.Location = New System.Drawing.Point(85, 3) + Me.ucrPnlCells.Name = "ucrPnlCells" + Me.ucrPnlCells.Size = New System.Drawing.Size(309, 29) + Me.ucrPnlCells.TabIndex = 289 + ' + 'ucrCellStyles + ' + Me.ucrCellStyles.Location = New System.Drawing.Point(7, 56) + Me.ucrCellStyles.Name = "ucrCellStyles" + Me.ucrCellStyles.Size = New System.Drawing.Size(609, 264) + Me.ucrCellStyles.TabIndex = 295 + ' + 'ucrCells + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.ucrCellsFootNotes) + Me.Controls.Add(Me.ucrCellStyles) + Me.Controls.Add(Me.ucrCellFormats) + Me.Controls.Add(Me.rdoStyles) + Me.Controls.Add(Me.rdoFormat) + Me.Controls.Add(Me.rdoFootNotes) + Me.Controls.Add(Me.ucrPnlCells) + Me.Name = "ucrCells" + Me.Size = New System.Drawing.Size(629, 362) + Me.ResumeLayout(False) + + End Sub + + Friend WithEvents rdoStyles As RadioButton + Friend WithEvents rdoFormat As RadioButton + Friend WithEvents rdoFootNotes As RadioButton + Friend WithEvents ucrPnlCells As UcrPanel + Friend WithEvents ucrCellFormats As ucrCellFormats + Friend WithEvents ucrCellsFootNotes As ucrCellsFootNotes + Friend WithEvents ucrCellStyles As ucrCellStyles +End Class diff --git a/instat/UserTables/Cells/ucrCells.resx b/instat/UserTables/Cells/ucrCells.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/instat/UserTables/Cells/ucrCells.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/instat/UserTables/Cells/ucrCells.vb b/instat/UserTables/Cells/ucrCells.vb new file mode 100644 index 00000000000..9a367caef91 --- /dev/null +++ b/instat/UserTables/Cells/ucrCells.vb @@ -0,0 +1,35 @@ +Public Class ucrCells + + Private bFirstload As Boolean = True + Private Sub InitialiseDialog() + ucrPnlCells.AddRadioButton(rdoFormat) + ucrPnlCells.AddRadioButton(rdoFootNotes) + ucrPnlCells.AddRadioButton(rdoStyles) + rdoFormat.Checked = True + End Sub + + Public Sub Setup(strDataFrameName As String, clsOperator As ROperator) + If bFirstload Then + InitialiseDialog() + bFirstload = False + End If + + ucrCellFormats.Setup(strDataFrameName, clsOperator) + ucrCellsFootNotes.Setup(strDataFrameName, clsOperator) + ucrCellStyles.Setup(strDataFrameName, clsOperator) + + End Sub + + Private Sub ucrPnlRows_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlCells.ControlValueChanged + ucrCellFormats.Visible = rdoFormat.Checked + ucrCellsFootNotes.Visible = rdoFootNotes.Checked + ucrCellStyles.Visible = rdoStyles.Checked + End Sub + + Public Sub SetValuesToOperator() + ucrCellFormats.SetValuesToOperator() + ucrCellsFootNotes.SetValuesToOperator() + ucrCellStyles.SetValuesToOperator() + End Sub + +End Class diff --git a/instat/UserTables/Columns/ucrColumnFootNote.Designer.vb b/instat/UserTables/Columns/ucrColumnFootNote.Designer.vb new file mode 100644 index 00000000000..366a55af019 --- /dev/null +++ b/instat/UserTables/Columns/ucrColumnFootNote.Designer.vb @@ -0,0 +1,176 @@ + _ +Partial Class ucrColumnFootNote + Inherits System.Windows.Forms.UserControl + + 'UserControl overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.lblFooteNotes = New System.Windows.Forms.Label() + Me.btnClear = New System.Windows.Forms.Button() + Me.ucrSelectorCols = New instat.ucrSelectorByDataFrameAddRemove() + Me.dataGrid = New System.Windows.Forms.DataGridView() + Me.colStyles = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.lblFootNote = New System.Windows.Forms.Label() + Me.ucrTxtFootNote = New instat.ucrInputTextBox() + Me.btnAdd = New System.Windows.Forms.Button() + Me.ucrReceiverMultipleCols = New instat.ucrReceiverMultiple() + Me.Label1 = New System.Windows.Forms.Label() + CType(Me.dataGrid, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'lblFooteNotes + ' + Me.lblFooteNotes.AutoSize = True + Me.lblFooteNotes.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblFooteNotes.Location = New System.Drawing.Point(231, 196) + Me.lblFooteNotes.Name = "lblFooteNotes" + Me.lblFooteNotes.Size = New System.Drawing.Size(62, 13) + Me.lblFooteNotes.TabIndex = 347 + Me.lblFooteNotes.Text = "Foot Notes:" + ' + 'btnClear + ' + Me.btnClear.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.btnClear.Location = New System.Drawing.Point(515, 188) + Me.btnClear.Name = "btnClear" + Me.btnClear.Size = New System.Drawing.Size(75, 23) + Me.btnClear.TabIndex = 346 + Me.btnClear.Tag = "" + Me.btnClear.Text = "Clear" + Me.btnClear.UseVisualStyleBackColor = True + ' + 'ucrSelectorCols + ' + Me.ucrSelectorCols.AutoSize = True + Me.ucrSelectorCols.bDropUnusedFilterLevels = False + Me.ucrSelectorCols.bShowHiddenColumns = False + Me.ucrSelectorCols.bUseCurrentFilter = True + Me.ucrSelectorCols.Location = New System.Drawing.Point(4, 4) + Me.ucrSelectorCols.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectorCols.Name = "ucrSelectorCols" + Me.ucrSelectorCols.Size = New System.Drawing.Size(213, 183) + Me.ucrSelectorCols.TabIndex = 343 + ' + 'dataGrid + ' + Me.dataGrid.AllowUserToAddRows = False + Me.dataGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.dataGrid.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.colStyles}) + Me.dataGrid.Location = New System.Drawing.Point(234, 213) + Me.dataGrid.Name = "dataGrid" + Me.dataGrid.RowHeadersWidth = 62 + Me.dataGrid.Size = New System.Drawing.Size(361, 73) + Me.dataGrid.TabIndex = 342 + ' + 'colStyles + ' + Me.colStyles.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.colStyles.HeaderText = "Foot Note Expressions" + Me.colStyles.MinimumWidth = 8 + Me.colStyles.Name = "colStyles" + ' + 'lblFootNote + ' + Me.lblFootNote.AutoSize = True + Me.lblFootNote.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblFootNote.Location = New System.Drawing.Point(241, 118) + Me.lblFootNote.Name = "lblFootNote" + Me.lblFootNote.Size = New System.Drawing.Size(81, 13) + Me.lblFootNote.TabIndex = 352 + Me.lblFootNote.Text = "Foot Note Text:" + ' + 'ucrTxtFootNote + ' + Me.ucrTxtFootNote.AddQuotesIfUnrecognised = True + Me.ucrTxtFootNote.AutoSize = True + Me.ucrTxtFootNote.IsMultiline = False + Me.ucrTxtFootNote.IsReadOnly = False + Me.ucrTxtFootNote.Location = New System.Drawing.Point(239, 134) + Me.ucrTxtFootNote.Name = "ucrTxtFootNote" + Me.ucrTxtFootNote.Size = New System.Drawing.Size(305, 21) + Me.ucrTxtFootNote.TabIndex = 351 + ' + 'btnAdd + ' + Me.btnAdd.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.btnAdd.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.btnAdd.Location = New System.Drawing.Point(239, 162) + Me.btnAdd.Name = "btnAdd" + Me.btnAdd.Size = New System.Drawing.Size(83, 23) + Me.btnAdd.TabIndex = 344 + Me.btnAdd.Tag = "" + Me.btnAdd.Text = "Add" + Me.btnAdd.UseVisualStyleBackColor = True + ' + 'ucrReceiverMultipleCols + ' + Me.ucrReceiverMultipleCols.AutoSize = True + Me.ucrReceiverMultipleCols.frmParent = Nothing + Me.ucrReceiverMultipleCols.Location = New System.Drawing.Point(239, 24) + Me.ucrReceiverMultipleCols.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverMultipleCols.Name = "ucrReceiverMultipleCols" + Me.ucrReceiverMultipleCols.Selector = Nothing + Me.ucrReceiverMultipleCols.Size = New System.Drawing.Size(120, 80) + Me.ucrReceiverMultipleCols.strNcFilePath = "" + Me.ucrReceiverMultipleCols.TabIndex = 353 + Me.ucrReceiverMultipleCols.ucrSelector = Nothing + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.Label1.Location = New System.Drawing.Point(242, 8) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(56, 13) + Me.Label1.TabIndex = 354 + Me.Label1.Text = "Column(s):" + ' + 'ucrColumnFootNote + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.ucrReceiverMultipleCols) + Me.Controls.Add(Me.Label1) + Me.Controls.Add(Me.lblFooteNotes) + Me.Controls.Add(Me.btnClear) + Me.Controls.Add(Me.ucrSelectorCols) + Me.Controls.Add(Me.dataGrid) + Me.Controls.Add(Me.lblFootNote) + Me.Controls.Add(Me.ucrTxtFootNote) + Me.Controls.Add(Me.btnAdd) + Me.Name = "ucrColumnFootNote" + Me.Size = New System.Drawing.Size(600, 289) + CType(Me.dataGrid, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents lblFooteNotes As Label + Friend WithEvents btnClear As Button + Friend WithEvents ucrSelectorCols As ucrSelectorByDataFrameAddRemove + Friend WithEvents dataGrid As DataGridView + Friend WithEvents colStyles As DataGridViewTextBoxColumn + Friend WithEvents lblFootNote As Label + Friend WithEvents ucrTxtFootNote As ucrInputTextBox + Friend WithEvents btnAdd As Button + Friend WithEvents ucrReceiverMultipleCols As ucrReceiverMultiple + Friend WithEvents Label1 As Label +End Class diff --git a/instat/UserTables/Columns/ucrColumnFootNote.resx b/instat/UserTables/Columns/ucrColumnFootNote.resx new file mode 100644 index 00000000000..d937ee32b35 --- /dev/null +++ b/instat/UserTables/Columns/ucrColumnFootNote.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + \ No newline at end of file diff --git a/instat/UserTables/Columns/ucrColumnFootNote.vb b/instat/UserTables/Columns/ucrColumnFootNote.vb new file mode 100644 index 00000000000..2f07fed5d1c --- /dev/null +++ b/instat/UserTables/Columns/ucrColumnFootNote.vb @@ -0,0 +1,93 @@ +Public Class ucrColumnFootNote + Private clsOperator As New ROperator + Private bFirstload As Boolean = True + + Private Sub ucrColumnFootNote_Load(sender As Object, e As EventArgs) Handles MyBase.Load + If bFirstload Then + InitialiseControl() + bFirstload = False + End If + End Sub + + Private Sub InitialiseControl() + ucrReceiverMultipleCols.Selector = ucrSelectorCols + ucrReceiverMultipleCols.SetMeAsReceiver() + End Sub + + Public Sub Setup(strDataFrameName As String, clsOperator As ROperator) + Me.clsOperator = clsOperator + + ' Set up the selector + ucrSelectorCols.SetDataframe(strDataFrameName, bEnableDataframe:=False) + + ' Clear and Set up the data grid with contents + dataGrid.Rows.Clear() + SetupDataGrid(clsTablesUtils.FindRFunctionsParamsWithRParamValue({"tab_footnote"}, "locations", "cells_column_labels", clsOperator)) + End Sub + + Private Sub SetupDataGrid(lstRParams As List(Of RParameter)) + + For Each clsRParam As RParameter In lstRParams + ' Create a new row that represents the tab_style() parameters + Dim row As New DataGridViewRow + row.CreateCells(dataGrid) + row.Cells(0).Value = clsRParam.clsArgumentCodeStructure.Clone.ToScript + + ' Tag and add the tab_style() parameter function contents as a row + row.Tag = clsRParam + dataGrid.Rows.Add(row) + Next + End Sub + + Private Sub ucrInputControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverMultipleCols.ControlContentsChanged + btnAdd.Enabled = Not ucrReceiverMultipleCols.IsEmpty + End Sub + + Private Sub btnAdd_Click(sender As Object, e As EventArgs) Handles btnAdd.Click + + Dim clsTabFootNoteRFunction As New RFunction + Dim clsLocationsRFunction As New RFunction + + clsLocationsRFunction.SetPackageName("gt") + clsLocationsRFunction.SetRCommand("cells_column_labels") + clsLocationsRFunction.AddParameter(New RParameter(strParameterName:="columns", strParamValue:=ucrReceiverMultipleCols.GetVariableNames(bWithQuotes:=False), iNewPosition:=0)) + + clsTabFootNoteRFunction.SetPackageName("gt") + clsTabFootNoteRFunction.SetRCommand("tab_footnote") + clsTabFootNoteRFunction.AddParameter(strParameterName:="footnote", strParameterValue:=Chr(34) & ucrTxtFootNote.GetText & Chr(34), iPosition:=0) + clsTabFootNoteRFunction.AddParameter(strParameterName:="locations", clsRFunctionParameter:=clsLocationsRFunction, iPosition:=1) + + ' Create parameter with unique name + Dim clsRParam As New RParameter(strParameterName:="tab_footnote_columns_labels_param" & (dataGrid.Rows.Count + 1), strParamValue:=clsTabFootNoteRFunction, bNewIncludeArgumentName:=False) + + ' Create row and its cells + Dim row As New DataGridViewRow + row.CreateCells(dataGrid) + row.Cells(0).Value = clsTabFootNoteRFunction.Clone.ToScript + + ' Tag the row with the parameter + row.Tag = clsRParam + + ' Add it to grid + dataGrid.Rows.Add(row) + + ucrReceiverMultipleCols.Clear() + ucrTxtFootNote.SetName("") + End Sub + + Private Sub btnClear_Click(sender As Object, e As EventArgs) Handles btnClear.Click + dataGrid.Rows.Clear() + End Sub + + Public Sub SetValuesToOperator() + ' Remove any previous cell footers + Dim lstRParams As List(Of RParameter) = clsTablesUtils.FindRFunctionsParamsWithRParamValue({"tab_footnote"}, "locations", "cells_column_labels", clsOperator) + For Each clsRParam As RParameter In lstRParams + clsOperator.RemoveParameter(clsRParam) + Next + + ' Add new changes + clsTablesUtils.AddGridRowTagsRParamsToROperator(dataGrid, clsOperator) + End Sub + +End Class diff --git a/instat/UserTables/Columns/ucrColumnLabels.Designer.vb b/instat/UserTables/Columns/ucrColumnLabels.Designer.vb new file mode 100644 index 00000000000..e1dc857a503 --- /dev/null +++ b/instat/UserTables/Columns/ucrColumnLabels.Designer.vb @@ -0,0 +1,185 @@ + _ +Partial Class ucrColumnLabels + Inherits System.Windows.Forms.UserControl + + 'UserControl overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.dataGridColLabels = New System.Windows.Forms.DataGridView() + Me.ucrInputColLabel = New instat.ucrInputTextBox() + Me.lblCondition = New System.Windows.Forms.Label() + Me.lblColLabels = New System.Windows.Forms.Label() + Me.btnClearLabels = New System.Windows.Forms.Button() + Me.lblColumns = New System.Windows.Forms.Label() + Me.btnAddLabel = New System.Windows.Forms.Button() + Me.ucrReceiverSingleCol = New instat.ucrReceiverSingle() + Me.ucrSelectorCols = New instat.ucrSelectorByDataFrameAddRemove() + Me.colLabel = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.colCodnition = New System.Windows.Forms.DataGridViewTextBoxColumn() + CType(Me.dataGridColLabels, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'dataGridColLabels + ' + Me.dataGridColLabels.AllowUserToAddRows = False + Me.dataGridColLabels.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.dataGridColLabels.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.colLabel, Me.colCodnition}) + Me.dataGridColLabels.Location = New System.Drawing.Point(230, 159) + Me.dataGridColLabels.Name = "dataGridColLabels" + Me.dataGridColLabels.RowHeadersWidth = 62 + Me.dataGridColLabels.Size = New System.Drawing.Size(266, 95) + Me.dataGridColLabels.TabIndex = 309 + ' + 'ucrInputColLabel + ' + Me.ucrInputColLabel.AddQuotesIfUnrecognised = True + Me.ucrInputColLabel.AutoSize = True + Me.ucrInputColLabel.IsMultiline = False + Me.ucrInputColLabel.IsReadOnly = False + Me.ucrInputColLabel.Location = New System.Drawing.Point(230, 73) + Me.ucrInputColLabel.Name = "ucrInputColLabel" + Me.ucrInputColLabel.Size = New System.Drawing.Size(119, 21) + Me.ucrInputColLabel.TabIndex = 320 + ' + 'lblCondition + ' + Me.lblCondition.AutoSize = True + Me.lblCondition.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblCondition.Location = New System.Drawing.Point(227, 57) + Me.lblCondition.Name = "lblCondition" + Me.lblCondition.Size = New System.Drawing.Size(36, 13) + Me.lblCondition.TabIndex = 319 + Me.lblCondition.Text = "Label:" + ' + 'lblColLabels + ' + Me.lblColLabels.AutoSize = True + Me.lblColLabels.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblColLabels.Location = New System.Drawing.Point(227, 140) + Me.lblColLabels.Name = "lblColLabels" + Me.lblColLabels.Size = New System.Drawing.Size(79, 13) + Me.lblColLabels.TabIndex = 315 + Me.lblColLabels.Text = "Column Labels:" + ' + 'btnClearLabels + ' + Me.btnClearLabels.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.btnClearLabels.Location = New System.Drawing.Point(414, 135) + Me.btnClearLabels.Name = "btnClearLabels" + Me.btnClearLabels.Size = New System.Drawing.Size(79, 23) + Me.btnClearLabels.TabIndex = 314 + Me.btnClearLabels.Tag = "" + Me.btnClearLabels.Text = "Clear" + Me.btnClearLabels.UseVisualStyleBackColor = True + ' + 'lblColumns + ' + Me.lblColumns.AutoSize = True + Me.lblColumns.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblColumns.Location = New System.Drawing.Point(227, 11) + Me.lblColumns.Name = "lblColumns" + Me.lblColumns.Size = New System.Drawing.Size(45, 13) + Me.lblColumns.TabIndex = 313 + Me.lblColumns.Text = "Column:" + ' + 'btnAddLabel + ' + Me.btnAddLabel.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.btnAddLabel.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.btnAddLabel.Location = New System.Drawing.Point(230, 100) + Me.btnAddLabel.Name = "btnAddLabel" + Me.btnAddLabel.Size = New System.Drawing.Size(78, 23) + Me.btnAddLabel.TabIndex = 312 + Me.btnAddLabel.Tag = "" + Me.btnAddLabel.Text = "Add" + Me.btnAddLabel.UseVisualStyleBackColor = True + ' + 'ucrReceiverSingleCol + ' + Me.ucrReceiverSingleCol.AutoSize = True + Me.ucrReceiverSingleCol.frmParent = Nothing + Me.ucrReceiverSingleCol.Location = New System.Drawing.Point(229, 27) + Me.ucrReceiverSingleCol.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverSingleCol.Name = "ucrReceiverSingleCol" + Me.ucrReceiverSingleCol.Selector = Nothing + Me.ucrReceiverSingleCol.Size = New System.Drawing.Size(120, 21) + Me.ucrReceiverSingleCol.strNcFilePath = "" + Me.ucrReceiverSingleCol.TabIndex = 311 + Me.ucrReceiverSingleCol.ucrSelector = Nothing + ' + 'ucrSelectorCols + ' + Me.ucrSelectorCols.AutoSize = True + Me.ucrSelectorCols.bDropUnusedFilterLevels = False + Me.ucrSelectorCols.bShowHiddenColumns = False + Me.ucrSelectorCols.bUseCurrentFilter = True + Me.ucrSelectorCols.Location = New System.Drawing.Point(6, 5) + Me.ucrSelectorCols.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectorCols.Name = "ucrSelectorCols" + Me.ucrSelectorCols.Size = New System.Drawing.Size(213, 183) + Me.ucrSelectorCols.TabIndex = 310 + ' + 'colLabel + ' + Me.colLabel.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.colLabel.HeaderText = "Column" + Me.colLabel.MinimumWidth = 8 + Me.colLabel.Name = "colLabel" + ' + 'colCodnition + ' + Me.colCodnition.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.colCodnition.HeaderText = "Label" + Me.colCodnition.MinimumWidth = 8 + Me.colCodnition.Name = "colCodnition" + ' + 'ucrColumnLabels + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.dataGridColLabels) + Me.Controls.Add(Me.ucrInputColLabel) + Me.Controls.Add(Me.lblCondition) + Me.Controls.Add(Me.lblColLabels) + Me.Controls.Add(Me.btnClearLabels) + Me.Controls.Add(Me.lblColumns) + Me.Controls.Add(Me.btnAddLabel) + Me.Controls.Add(Me.ucrReceiverSingleCol) + Me.Controls.Add(Me.ucrSelectorCols) + Me.Name = "ucrColumnLabels" + Me.Size = New System.Drawing.Size(499, 257) + CType(Me.dataGridColLabels, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents dataGridColLabels As DataGridView + Friend WithEvents ucrInputColLabel As ucrInputTextBox + Friend WithEvents lblCondition As Label + Friend WithEvents lblColLabels As Label + Friend WithEvents btnClearLabels As Button + Friend WithEvents lblColumns As Label + Friend WithEvents btnAddLabel As Button + Friend WithEvents ucrReceiverSingleCol As ucrReceiverSingle + Friend WithEvents ucrSelectorCols As ucrSelectorByDataFrameAddRemove + Friend WithEvents colLabel As DataGridViewTextBoxColumn + Friend WithEvents colCodnition As DataGridViewTextBoxColumn +End Class diff --git a/instat/UserTables/Columns/ucrColumnLabels.resx b/instat/UserTables/Columns/ucrColumnLabels.resx new file mode 100644 index 00000000000..f5ee602f97b --- /dev/null +++ b/instat/UserTables/Columns/ucrColumnLabels.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + True + + \ No newline at end of file diff --git a/instat/UserTables/Columns/ucrColumnLabels.vb b/instat/UserTables/Columns/ucrColumnLabels.vb new file mode 100644 index 00000000000..cc4b5d2bcfa --- /dev/null +++ b/instat/UserTables/Columns/ucrColumnLabels.vb @@ -0,0 +1,102 @@ +Imports System.Reflection + +Public Class ucrColumnLabels + + Private clsOperator As New ROperator + Private bFirstload As Boolean = True + + Private Sub InitialiseDialog() + ucrReceiverSingleCol.Selector = ucrSelectorCols + ucrReceiverSingleCol.SetMeAsReceiver() + End Sub + + Public Sub Setup(strDataFrameName As String, clsOperator As ROperator) + If bFirstload Then + InitialiseDialog() + bFirstload = False + End If + + Me.clsOperator = clsOperator + + ucrSelectorCols.SetDataframe(strDataFrameName, bEnableDataframe:=False) + dataGridColLabels.Rows.Clear() + + Dim lstRParams As List(Of RParameter) = clsTablesUtils.FindRFunctionsParamsWithRCommand({"cols_label"}, clsOperator) + If lstRParams.Count > 0 Then + For Each clsColLabelRParam As RParameter In lstRParams(0).clsArgumentCodeStructure.clsParameters + Dim row As New DataGridViewRow + row.CreateCells(dataGridColLabels) + row.Cells(0).Value = clsColLabelRParam.strArgumentName + row.Cells(1).Value = clsTablesUtils.GetStringValue(clsColLabelRParam.strArgumentValue, False) + row.Tag = clsColLabelRParam + dataGridColLabels.Rows.Add(row) + Next + End If + + End Sub + + Private Sub btnAddLabel_Click(sender As Object, e As EventArgs) Handles btnAddLabel.Click + + Dim strColumnName As String = ucrReceiverSingleCol.GetVariableNames(bWithQuotes:=False) + Dim strColumnLabel As String = ucrInputColLabel.GetValue() + + Dim clsRParam As New RParameter(strParameterName:=clsTablesUtils.GetStringValue(strColumnName, False), strParamValue:=clsTablesUtils.GetStringValue(strColumnLabel, True)) + Dim row As DataGridViewRow = Nothing + + ' Update column label if column exists + For Each existingRow As DataGridViewRow In dataGridColLabels.Rows + If existingRow.Cells(0).Value = strColumnName Then + row = existingRow + row.Cells(1).Value = strColumnLabel + row.Tag = clsRParam + Exit For + End If + Next + + ' If column does not exist then add new column label + If row Is Nothing Then + row = New DataGridViewRow + row.CreateCells(dataGridColLabels) + row.Cells(0).Value = strColumnName + row.Cells(1).Value = strColumnLabel + row.Tag = clsRParam + dataGridColLabels.Rows.Add(row) + End If + + ' Clear controls + ucrReceiverSingleCol.Clear() + ucrInputColLabel.SetName("") + + End Sub + + Private Sub btnClearLabels_Click(sender As Object, e As EventArgs) Handles btnClearLabels.Click + dataGridColLabels.Rows.Clear() + End Sub + + + Private Sub ucrColSpanner_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverSingleCol.ControlContentsChanged, ucrInputColLabel.ControlContentsChanged + btnAddLabel.Enabled = Not ucrReceiverSingleCol.IsEmpty AndAlso Not ucrInputColLabel.IsEmpty + End Sub + + Public Sub SetValuesToOperator() + clsTablesUtils.RemoveRFunctionsParamsWithRCommand({"cols_label"}, clsOperator) + + If dataGridColLabels.Rows.Count = 0 Then + Exit Sub + End If + + Dim clsColsLabelRFunction As New RFunction + clsColsLabelRFunction.SetPackageName("gt") + clsColsLabelRFunction.SetRCommand("cols_label") + + For index As Integer = 0 To dataGridColLabels.Rows.Count - 1 + If dataGridColLabels.Rows.Item(index).Tag IsNot Nothing Then + Dim clsRParam As RParameter = dataGridColLabels.Rows.Item(index).Tag + clsColsLabelRFunction.AddParameter(clsRParam) + End If + Next + + clsOperator.AddParameter(New RParameter(strParameterName:="cols_label_param", strParamValue:=clsColsLabelRFunction, bNewIncludeArgumentName:=False)) + End Sub + +End Class diff --git a/instat/UserTables/Columns/ucrColumnNanoPlots.Designer.vb b/instat/UserTables/Columns/ucrColumnNanoPlots.Designer.vb new file mode 100644 index 00000000000..f0182c43b02 --- /dev/null +++ b/instat/UserTables/Columns/ucrColumnNanoPlots.Designer.vb @@ -0,0 +1,37 @@ + _ +Partial Class ucrColumnNanoPlots + Inherits System.Windows.Forms.UserControl + + 'UserControl overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.SuspendLayout() + ' + 'ucrColumnNanoPlots + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Name = "ucrColumnNanoPlots" + Me.Size = New System.Drawing.Size(648, 470) + Me.ResumeLayout(False) + + End Sub + +End Class diff --git a/instat/UserTables/Columns/ucrColumnNanoPlots.resx b/instat/UserTables/Columns/ucrColumnNanoPlots.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/instat/UserTables/Columns/ucrColumnNanoPlots.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/instat/UserTables/Columns/ucrColumnNanoPlots.vb b/instat/UserTables/Columns/ucrColumnNanoPlots.vb new file mode 100644 index 00000000000..4870a201ea9 --- /dev/null +++ b/instat/UserTables/Columns/ucrColumnNanoPlots.vb @@ -0,0 +1,13 @@ +Public Class ucrColumnNanoPlots + + Public Sub Setup(strDataFrameName As String, clsOperator As ROperator) + + End Sub + Public Sub SetValuesToOperator() + + End Sub + + Private Sub ucrColumnNanoPlots_Load(sender As Object, e As EventArgs) Handles MyBase.Load + + End Sub +End Class diff --git a/instat/UserTables/Columns/ucrColumnSpanners.Designer.vb b/instat/UserTables/Columns/ucrColumnSpanners.Designer.vb new file mode 100644 index 00000000000..671a01ee140 --- /dev/null +++ b/instat/UserTables/Columns/ucrColumnSpanners.Designer.vb @@ -0,0 +1,222 @@ + _ +Partial Class ucrColumnSpanners + Inherits System.Windows.Forms.UserControl + + 'UserControl overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.lblSpanners = New System.Windows.Forms.Label() + Me.btnClearSpanners = New System.Windows.Forms.Button() + Me.lblColumns = New System.Windows.Forms.Label() + Me.btnAddColSpanner = New System.Windows.Forms.Button() + Me.ucrSelectorCols = New instat.ucrSelectorByDataFrameAddRemove() + Me.dataGridColSpanners = New System.Windows.Forms.DataGridView() + Me.colLabel = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.colSpanners = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.colStyleExpression = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.ucrReceiverMultipleCols = New instat.ucrReceiverMultiple() + Me.lblColSpanner = New System.Windows.Forms.Label() + Me.ucrInputColSpanner = New instat.ucrInputTextBox() + Me.btnStyle = New System.Windows.Forms.Button() + CType(Me.dataGridColSpanners, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'lblSpanners + ' + Me.lblSpanners.AutoSize = True + Me.lblSpanners.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblSpanners.Location = New System.Drawing.Point(368, 263) + Me.lblSpanners.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblSpanners.Name = "lblSpanners" + Me.lblSpanners.Size = New System.Drawing.Size(140, 20) + Me.lblSpanners.TabIndex = 297 + Me.lblSpanners.Text = "Column Spanners:" + ' + 'btnClearSpanners + ' + Me.btnClearSpanners.Enabled = False + Me.btnClearSpanners.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.btnClearSpanners.Location = New System.Drawing.Point(714, 249) + Me.btnClearSpanners.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.btnClearSpanners.Name = "btnClearSpanners" + Me.btnClearSpanners.Size = New System.Drawing.Size(112, 35) + Me.btnClearSpanners.TabIndex = 295 + Me.btnClearSpanners.Tag = "" + Me.btnClearSpanners.Text = "Clear" + Me.btnClearSpanners.UseVisualStyleBackColor = True + ' + 'lblColumns + ' + Me.lblColumns.AutoSize = True + Me.lblColumns.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblColumns.Location = New System.Drawing.Point(363, 8) + Me.lblColumns.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblColumns.Name = "lblColumns" + Me.lblColumns.Size = New System.Drawing.Size(85, 20) + Me.lblColumns.TabIndex = 294 + Me.lblColumns.Text = "Column(s):" + ' + 'btnAddColSpanner + ' + Me.btnAddColSpanner.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.btnAddColSpanner.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.btnAddColSpanner.Location = New System.Drawing.Point(364, 212) + Me.btnAddColSpanner.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.btnAddColSpanner.Name = "btnAddColSpanner" + Me.btnAddColSpanner.Size = New System.Drawing.Size(132, 35) + Me.btnAddColSpanner.TabIndex = 292 + Me.btnAddColSpanner.Tag = "" + Me.btnAddColSpanner.Text = "Add" + Me.btnAddColSpanner.UseVisualStyleBackColor = True + ' + 'ucrSelectorCols + ' + Me.ucrSelectorCols.AutoSize = True + Me.ucrSelectorCols.bDropUnusedFilterLevels = False + Me.ucrSelectorCols.bShowHiddenColumns = False + Me.ucrSelectorCols.bUseCurrentFilter = True + Me.ucrSelectorCols.Location = New System.Drawing.Point(6, 8) + Me.ucrSelectorCols.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectorCols.Name = "ucrSelectorCols" + Me.ucrSelectorCols.Size = New System.Drawing.Size(320, 282) + Me.ucrSelectorCols.TabIndex = 290 + ' + 'dataGridColSpanners + ' + Me.dataGridColSpanners.AllowUserToAddRows = False + Me.dataGridColSpanners.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.dataGridColSpanners.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.colLabel, Me.colSpanners, Me.colStyleExpression}) + Me.dataGridColSpanners.Location = New System.Drawing.Point(360, 289) + Me.dataGridColSpanners.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.dataGridColSpanners.Name = "dataGridColSpanners" + Me.dataGridColSpanners.ReadOnly = True + Me.dataGridColSpanners.RowHeadersWidth = 62 + Me.dataGridColSpanners.Size = New System.Drawing.Size(466, 112) + Me.dataGridColSpanners.TabIndex = 289 + ' + 'colLabel + ' + Me.colLabel.HeaderText = "Label" + Me.colLabel.MinimumWidth = 8 + Me.colLabel.Name = "colLabel" + Me.colLabel.ReadOnly = True + Me.colLabel.Width = 60 + ' + 'colSpanners + ' + Me.colSpanners.HeaderText = "Column(s)" + Me.colSpanners.MinimumWidth = 8 + Me.colSpanners.Name = "colSpanners" + Me.colSpanners.ReadOnly = True + Me.colSpanners.Width = 90 + ' + 'colStyleExpression + ' + Me.colStyleExpression.HeaderText = "Style Expression" + Me.colStyleExpression.MinimumWidth = 8 + Me.colStyleExpression.Name = "colStyleExpression" + Me.colStyleExpression.ReadOnly = True + Me.colStyleExpression.Width = 90 + ' + 'ucrReceiverMultipleCols + ' + Me.ucrReceiverMultipleCols.AutoSize = True + Me.ucrReceiverMultipleCols.frmParent = Nothing + Me.ucrReceiverMultipleCols.Location = New System.Drawing.Point(360, 32) + Me.ucrReceiverMultipleCols.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverMultipleCols.Name = "ucrReceiverMultipleCols" + Me.ucrReceiverMultipleCols.Selector = Nothing + Me.ucrReceiverMultipleCols.Size = New System.Drawing.Size(180, 98) + Me.ucrReceiverMultipleCols.strNcFilePath = "" + Me.ucrReceiverMultipleCols.TabIndex = 299 + Me.ucrReceiverMultipleCols.ucrSelector = Nothing + ' + 'lblColSpanner + ' + Me.lblColSpanner.AutoSize = True + Me.lblColSpanner.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblColSpanner.Location = New System.Drawing.Point(368, 145) + Me.lblColSpanner.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblColSpanner.Name = "lblColSpanner" + Me.lblColSpanner.Size = New System.Drawing.Size(117, 20) + Me.lblColSpanner.TabIndex = 301 + Me.lblColSpanner.Text = "Spanner Label:" + ' + 'ucrInputColSpanner + ' + Me.ucrInputColSpanner.AddQuotesIfUnrecognised = True + Me.ucrInputColSpanner.AutoSize = True + Me.ucrInputColSpanner.IsMultiline = False + Me.ucrInputColSpanner.IsReadOnly = False + Me.ucrInputColSpanner.Location = New System.Drawing.Point(364, 171) + Me.ucrInputColSpanner.Margin = New System.Windows.Forms.Padding(14) + Me.ucrInputColSpanner.Name = "ucrInputColSpanner" + Me.ucrInputColSpanner.Size = New System.Drawing.Size(176, 32) + Me.ucrInputColSpanner.TabIndex = 307 + ' + 'btnStyle + ' + Me.btnStyle.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.btnStyle.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.btnStyle.Location = New System.Drawing.Point(549, 166) + Me.btnStyle.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.btnStyle.Name = "btnStyle" + Me.btnStyle.Size = New System.Drawing.Size(74, 35) + Me.btnStyle.TabIndex = 308 + Me.btnStyle.Tag = "" + Me.btnStyle.Text = "Style" + Me.btnStyle.UseVisualStyleBackColor = True + ' + 'ucrColumnSpanners + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(9.0!, 20.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.btnStyle) + Me.Controls.Add(Me.ucrInputColSpanner) + Me.Controls.Add(Me.lblColSpanner) + Me.Controls.Add(Me.ucrReceiverMultipleCols) + Me.Controls.Add(Me.lblSpanners) + Me.Controls.Add(Me.btnClearSpanners) + Me.Controls.Add(Me.lblColumns) + Me.Controls.Add(Me.btnAddColSpanner) + Me.Controls.Add(Me.ucrSelectorCols) + Me.Controls.Add(Me.dataGridColSpanners) + Me.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.Name = "ucrColumnSpanners" + Me.Size = New System.Drawing.Size(831, 408) + CType(Me.dataGridColSpanners, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents lblSpanners As Label + Friend WithEvents btnClearSpanners As Button + Friend WithEvents lblColumns As Label + Friend WithEvents btnAddColSpanner As Button + Friend WithEvents ucrSelectorCols As ucrSelectorByDataFrameAddRemove + Friend WithEvents dataGridColSpanners As DataGridView + Friend WithEvents ucrReceiverMultipleCols As ucrReceiverMultiple + Friend WithEvents lblColSpanner As Label + Friend WithEvents ucrInputColSpanner As ucrInputTextBox + Friend WithEvents btnStyle As Button + Friend WithEvents colLabel As DataGridViewTextBoxColumn + Friend WithEvents colSpanners As DataGridViewTextBoxColumn + Friend WithEvents colStyleExpression As DataGridViewTextBoxColumn +End Class diff --git a/instat/UserTables/Columns/ucrColumnSpanners.resx b/instat/UserTables/Columns/ucrColumnSpanners.resx new file mode 100644 index 00000000000..9efce73ddc6 --- /dev/null +++ b/instat/UserTables/Columns/ucrColumnSpanners.resx @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + True + + + True + + \ No newline at end of file diff --git a/instat/UserTables/Columns/ucrColumnSpanners.vb b/instat/UserTables/Columns/ucrColumnSpanners.vb new file mode 100644 index 00000000000..dfae2666d48 --- /dev/null +++ b/instat/UserTables/Columns/ucrColumnSpanners.vb @@ -0,0 +1,142 @@ +Imports unvell.ReoGrid.IO.OpenXML.Schema + +Public Class ucrColumnSpanners + + Private clsOperator As ROperator + Private bFirstload As Boolean = True + + Private Sub InitialiseDialog() + ucrReceiverMultipleCols.Selector = ucrSelectorCols + ucrReceiverMultipleCols.SetMeAsReceiver() + End Sub + + Public Sub Setup(strDataFrameName As String, clsOperator As ROperator) + If bFirstload Then + InitialiseDialog() + bFirstload = False + End If + + Me.clsOperator = clsOperator + + ucrSelectorCols.SetDataframe(strDataFrameName, bEnableDataframe:=False) + dataGridColSpanners.Rows.Clear() + + ' Note, the sequence of these 2 functions matters + SetupTabSpannersInDataGrid(clsTablesUtils.FindRFunctionsParamsWithRCommand({"tab_spanner"}, clsOperator)) + SetupTabSpannersStylesInDataGrid(clsTablesUtils.FindRFunctionsParamsWithRParamValue({"tab_style"}, "locations", "cells_column_spanners", clsOperator)) + + End Sub + + Private Sub SetupTabSpannersInDataGrid(lstRParams As List(Of RParameter)) + For Each clsRParam As RParameter In lstRParams + Dim clsTabSpannerRFunction As RFunction = clsRParam.clsArgumentCodeStructure + Dim row As New DataGridViewRow + row.CreateCells(dataGridColSpanners) + For Each clsTabSpannerRParam As RParameter In clsTabSpannerRFunction.clsParameters + If clsTabSpannerRParam.strArgumentName = "label" Then + row.Cells(0).Value = clsTablesUtils.GetStringValue(clsTabSpannerRParam.strArgumentValue, False) + ElseIf clsTabSpannerRParam.strArgumentName = "columns" Then + row.Cells(1).Value = clsTablesUtils.GetStringValue(clsTabSpannerRParam.strArgumentValue, False) + End If + Next + Dim arrParams(2) As RParameter + arrParams(0) = clsRParam + row.Tag = arrParams + dataGridColSpanners.Rows.Add(row) + Next + End Sub + + Private Sub SetupTabSpannersStylesInDataGrid(lstRParams As List(Of RParameter)) + For Each clsRParam As RParameter In lstRParams + Dim clsTabStyleRFunction As RFunction = clsRParam.clsArgumentCodeStructure + ' Get spanner Id + Dim strArgumentValueSpannerId As String = clsTabStyleRFunction.GetParameter("locations").clsArgumentCodeStructure.GetParameter("spanners").strArgumentValue + For index As Integer = 0 To dataGridColSpanners.Rows.Count - 1 + Dim row As DataGridViewRow = dataGridColSpanners.Rows(index) + Dim lstParams() As RParameter = row.Tag + If strArgumentValueSpannerId = lstParams(0).clsArgumentCodeStructure.GetParameter("id").strArgumentValue Then + row.Cells(2).Value = clsTabStyleRFunction.Clone().ToScript + lstParams(1) = clsRParam + row.Tag = lstParams + Exit For + End If + Next + Next + End Sub + + Private Sub btnStyle_Click(sender As Object, e As EventArgs) Handles btnStyle.Click + Dim clsListStyleRFunction As RFunction = clsTablesUtils.ShowStyleSubDialog(Me.ParentForm) + If clsListStyleRFunction Is Nothing Then + Exit Sub + End If + ucrInputColSpanner.Tag = clsListStyleRFunction + End Sub + + Private Sub btnAddColSpanner_Click(sender As Object, e As EventArgs) Handles btnAddColSpanner.Click + Dim strSpannerLabel As String = ucrInputColSpanner.GetText() + Dim strSpannerId As String = strSpannerLabel.Replace(" ", String.Empty) + Dim strSpannerColsRFunction As String = mdlCoreControl.GetRVector(ucrReceiverMultipleCols.GetVariableNamesList(bWithQuotes:=False), bOnlyIfMultipleElement:=False) + Dim strSpannerStyleExpression As String = "" + + Dim clsTabSpannerRFunction As New RFunction + clsTabSpannerRFunction.SetPackageName("gt") + clsTabSpannerRFunction.SetRCommand("tab_spanner") + clsTabSpannerRFunction.AddParameter(New RParameter(strParameterName:="label", strParamValue:=clsTablesUtils.GetStringValue(strSpannerLabel, True), iNewPosition:=0)) + clsTabSpannerRFunction.AddParameter(New RParameter(strParameterName:="columns", strParamValue:=strSpannerColsRFunction, iNewPosition:=1)) + clsTabSpannerRFunction.AddParameter(New RParameter(strParameterName:="id", strParamValue:=clsTablesUtils.GetStringValue(strSpannerId, True), iNewPosition:=2)) + + Dim arrParams(2) As RParameter + + ' Add add the spanner parameter as the first element + arrParams(0) = New RParameter(strParameterName:="tab_column_spanner_param" & (dataGridColSpanners.Rows.Count + 1), strParamValue:=clsTabSpannerRFunction, bNewIncludeArgumentName:=False) + + ' Add the spanner style as the second element + If ucrInputColSpanner.Tag IsNot Nothing Then + Dim clsLocationsRFunction As New RFunction + clsLocationsRFunction.SetPackageName("gt") + clsLocationsRFunction.SetRCommand("cells_column_spanners") + clsLocationsRFunction.AddParameter(New RParameter(strParameterName:="spanners", strParamValue:=clsTablesUtils.GetStringValue(strSpannerId, True), iNewPosition:=0)) + + Dim clsListStyleRFunction As RFunction = ucrInputColSpanner.Tag + Dim clsTabStyleRFunction As RFunction = clsTablesUtils.GetNewStyleRFunction(clsListStyleRFunction, clsLocationsRFunction) + + strSpannerStyleExpression = clsTabStyleRFunction.Clone.ToScript + + arrParams(1) = New RParameter(strParameterName:="tab_style_cells_column_spanner_param" & (dataGridColSpanners.Rows.Count + 1), strParamValue:=clsTabStyleRFunction, bNewIncludeArgumentName:=False) + End If + + Dim row As New DataGridViewRow + row.CreateCells(dataGridColSpanners) + row.Cells(0).Value = strSpannerLabel + row.Cells(1).Value = strSpannerColsRFunction + row.Cells(2).Value = strSpannerStyleExpression + ' Tag the array of parameters + row.Tag = arrParams + dataGridColSpanners.Rows.Add(row) + + ucrReceiverMultipleCols.Clear() + ucrInputColSpanner.SetName("") + ucrInputColSpanner.Tag = Nothing + End Sub + + Private Sub ucrColSpanner_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverMultipleCols.ControlContentsChanged, ucrInputColSpanner.ControlContentsChanged + btnAddColSpanner.Enabled = Not ucrReceiverMultipleCols.IsEmpty AndAlso Not ucrInputColSpanner.IsEmpty + End Sub + + Private Sub btnClearSpanners_Click(sender As Object, e As EventArgs) Handles btnClearSpanners.Click + dataGridColSpanners.Rows.Clear() + End Sub + + Public Sub SetValuesToOperator() + clsTablesUtils.RemoveRParams(clsTablesUtils.FindRFunctionsParamsWithRCommand({"tab_spanner"}, clsOperator), clsOperator) + clsTablesUtils.RemoveRParams(clsTablesUtils.FindRFunctionsParamsWithRParamValue({"tab_style"}, "locations", "cells_column_spanners", clsOperator), clsOperator) + + For index As Integer = 0 To dataGridColSpanners.Rows.Count - 1 + Dim lstParams() As RParameter = dataGridColSpanners.Rows(index).Tag + clsOperator.AddParameter(lstParams(0)) + If lstParams(1) IsNot Nothing Then + clsOperator.AddParameter(lstParams(1)) + End If + Next + End Sub +End Class diff --git a/instat/UserTables/Columns/ucrColumnStyles.Designer.vb b/instat/UserTables/Columns/ucrColumnStyles.Designer.vb new file mode 100644 index 00000000000..049fc16592d --- /dev/null +++ b/instat/UserTables/Columns/ucrColumnStyles.Designer.vb @@ -0,0 +1,149 @@ + _ +Partial Class ucrColumnStyles + Inherits System.Windows.Forms.UserControl + + 'UserControl overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.lblFormats = New System.Windows.Forms.Label() + Me.btnClearFormats = New System.Windows.Forms.Button() + Me.dataGridFormats = New System.Windows.Forms.DataGridView() + Me.colStyles = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.ucrReceiverMultipleCols = New instat.ucrReceiverMultiple() + Me.Label1 = New System.Windows.Forms.Label() + Me.btnEnterStyle = New System.Windows.Forms.Button() + Me.ucrSelectorCols = New instat.ucrSelectorByDataFrameAddRemove() + CType(Me.dataGridFormats, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'lblFormats + ' + Me.lblFormats.AutoSize = True + Me.lblFormats.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblFormats.Location = New System.Drawing.Point(234, 149) + Me.lblFormats.Name = "lblFormats" + Me.lblFormats.Size = New System.Drawing.Size(38, 13) + Me.lblFormats.TabIndex = 338 + Me.lblFormats.Text = "Styles:" + ' + 'btnClearFormats + ' + Me.btnClearFormats.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.btnClearFormats.Location = New System.Drawing.Point(473, 140) + Me.btnClearFormats.Name = "btnClearFormats" + Me.btnClearFormats.Size = New System.Drawing.Size(75, 23) + Me.btnClearFormats.TabIndex = 336 + Me.btnClearFormats.Tag = "" + Me.btnClearFormats.Text = "Clear" + Me.btnClearFormats.UseVisualStyleBackColor = True + ' + 'dataGridFormats + ' + Me.dataGridFormats.AllowUserToAddRows = False + Me.dataGridFormats.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.dataGridFormats.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.colStyles}) + Me.dataGridFormats.Location = New System.Drawing.Point(237, 166) + Me.dataGridFormats.Name = "dataGridFormats" + Me.dataGridFormats.RowHeadersWidth = 62 + Me.dataGridFormats.Size = New System.Drawing.Size(315, 73) + Me.dataGridFormats.TabIndex = 337 + ' + 'colStyles + ' + Me.colStyles.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.colStyles.HeaderText = "Style Expressions" + Me.colStyles.MinimumWidth = 8 + Me.colStyles.Name = "colStyles" + ' + 'ucrReceiverMultipleCols + ' + Me.ucrReceiverMultipleCols.AutoSize = True + Me.ucrReceiverMultipleCols.frmParent = Nothing + Me.ucrReceiverMultipleCols.Location = New System.Drawing.Point(234, 21) + Me.ucrReceiverMultipleCols.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverMultipleCols.Name = "ucrReceiverMultipleCols" + Me.ucrReceiverMultipleCols.Selector = Nothing + Me.ucrReceiverMultipleCols.Size = New System.Drawing.Size(120, 80) + Me.ucrReceiverMultipleCols.strNcFilePath = "" + Me.ucrReceiverMultipleCols.TabIndex = 334 + Me.ucrReceiverMultipleCols.ucrSelector = Nothing + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.Label1.Location = New System.Drawing.Point(237, 5) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(56, 13) + Me.Label1.TabIndex = 340 + Me.Label1.Text = "Column(s):" + ' + 'btnEnterStyle + ' + Me.btnEnterStyle.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.btnEnterStyle.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.btnEnterStyle.Location = New System.Drawing.Point(237, 110) + Me.btnEnterStyle.Name = "btnEnterStyle" + Me.btnEnterStyle.Size = New System.Drawing.Size(126, 23) + Me.btnEnterStyle.TabIndex = 335 + Me.btnEnterStyle.Tag = "" + Me.btnEnterStyle.Text = "Enter Style" + Me.btnEnterStyle.UseVisualStyleBackColor = True + ' + 'ucrSelectorCols + ' + Me.ucrSelectorCols.AutoSize = True + Me.ucrSelectorCols.bDropUnusedFilterLevels = False + Me.ucrSelectorCols.bShowHiddenColumns = False + Me.ucrSelectorCols.bUseCurrentFilter = True + Me.ucrSelectorCols.Location = New System.Drawing.Point(5, 5) + Me.ucrSelectorCols.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectorCols.Name = "ucrSelectorCols" + Me.ucrSelectorCols.Size = New System.Drawing.Size(213, 183) + Me.ucrSelectorCols.TabIndex = 333 + ' + 'ucrColumnStyles + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.lblFormats) + Me.Controls.Add(Me.btnClearFormats) + Me.Controls.Add(Me.dataGridFormats) + Me.Controls.Add(Me.ucrReceiverMultipleCols) + Me.Controls.Add(Me.Label1) + Me.Controls.Add(Me.btnEnterStyle) + Me.Controls.Add(Me.ucrSelectorCols) + Me.Name = "ucrColumnStyles" + Me.Size = New System.Drawing.Size(556, 243) + CType(Me.dataGridFormats, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents lblFormats As Label + Friend WithEvents btnClearFormats As Button + Friend WithEvents dataGridFormats As DataGridView + Friend WithEvents colStyles As DataGridViewTextBoxColumn + Friend WithEvents ucrReceiverMultipleCols As ucrReceiverMultiple + Friend WithEvents Label1 As Label + Friend WithEvents btnEnterStyle As Button + Friend WithEvents ucrSelectorCols As ucrSelectorByDataFrameAddRemove +End Class diff --git a/instat/UserTables/Columns/ucrColumnStyles.resx b/instat/UserTables/Columns/ucrColumnStyles.resx new file mode 100644 index 00000000000..d937ee32b35 --- /dev/null +++ b/instat/UserTables/Columns/ucrColumnStyles.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + \ No newline at end of file diff --git a/instat/UserTables/Columns/ucrColumnStyles.vb b/instat/UserTables/Columns/ucrColumnStyles.vb new file mode 100644 index 00000000000..fcfe94dd33b --- /dev/null +++ b/instat/UserTables/Columns/ucrColumnStyles.vb @@ -0,0 +1,93 @@ +Public Class ucrColumnStyles + + Private clsOperator As New ROperator + Private bFirstload As Boolean = True + + Private Sub ucrColumnStyles_Load(sender As Object, e As EventArgs) Handles MyBase.Load + If bFirstload Then + InitialiseControl() + bFirstload = False + End If + End Sub + + Private Sub InitialiseControl() + ucrReceiverMultipleCols.Selector = ucrSelectorCols + ucrReceiverMultipleCols.SetMeAsReceiver() + End Sub + + Public Sub Setup(strDataFrameName As String, clsOperator As ROperator) + + + Me.clsOperator = clsOperator + + ' Set up the selector + ucrSelectorCols.SetDataframe(strDataFrameName, bEnableDataframe:=False) + + ' Clear and Set up the data grid with contents + dataGridFormats.Rows.Clear() + SetupDataGrid(clsTablesUtils.FindRFunctionsParamsWithRParamValue({"tab_style"}, "locations", "cells_column_labels", clsOperator)) + + End Sub + + Private Sub SetupDataGrid(lstRParams As List(Of RParameter)) + + For Each clsRParam As RParameter In lstRParams + + ' Create a new row that represents the tab_style() parameters + Dim row As New DataGridViewRow + row.CreateCells(dataGridFormats) + row.Cells(0).Value = clsRParam.clsArgumentCodeStructure.Clone.ToScript + + ' Tag and add the tab_style() parameter function contents as a row + row.Tag = clsRParam + dataGridFormats.Rows.Add(row) + + Next + End Sub + + Private Sub ucrInputControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverMultipleCols.ControlContentsChanged + btnEnterStyle.Enabled = Not ucrReceiverMultipleCols.IsEmpty + End Sub + + Private Sub btnEnterStyle_Click(sender As Object, e As EventArgs) Handles btnEnterStyle.Click + + Dim clsListStyleRFunction As RFunction = clsTablesUtils.ShowStyleSubDialog(Me.ParentForm) + If clsListStyleRFunction Is Nothing Then + Exit Sub + End If + + Dim clsLocationsRFunction As New RFunction + clsLocationsRFunction.SetPackageName("gt") + clsLocationsRFunction.SetRCommand("cells_column_labels") + clsLocationsRFunction.AddParameter(New RParameter(strParameterName:="columns", strParamValue:=ucrReceiverMultipleCols.GetVariableNames(bWithQuotes:=False), iNewPosition:=0)) + + Dim clsTabStyleRFunction As RFunction = clsTablesUtils.GetNewStyleRFunction(clsListStyleRFunction, clsLocationsRFunction) + + ' Create parameter with unique name + Dim clsRParam As New RParameter(strParameterName:="tab_style_column_label_param" & (dataGridFormats.Rows.Count + 1), strParamValue:=clsTabStyleRFunction, bNewIncludeArgumentName:=False) + + ' Create row and its cells + Dim row As New DataGridViewRow + row.CreateCells(dataGridFormats) + row.Cells(0).Value = clsTabStyleRFunction.Clone.ToScript + + ' Tag the row with the parameter + row.Tag = clsRParam + + ' Add it to grid + dataGridFormats.Rows.Add(row) + + ucrReceiverMultipleCols.Clear() + End Sub + + Private Sub btnClearFormats_Click(sender As Object, e As EventArgs) Handles btnClearFormats.Click + dataGridFormats.Rows.Clear() + End Sub + + Public Sub SetValuesToOperator() + clsTablesUtils.RemoveRParams(clsTablesUtils.FindRFunctionsParamsWithRParamValue({"tab_style"}, "locations", "cells_column_labels", clsOperator), clsOperator) + clsTablesUtils.AddGridRowTagsRParamsToROperator(dataGridFormats, clsOperator) + End Sub + + +End Class diff --git a/instat/UserTables/Columns/ucrColumnWidth.Designer.vb b/instat/UserTables/Columns/ucrColumnWidth.Designer.vb new file mode 100644 index 00000000000..263cfcd421c --- /dev/null +++ b/instat/UserTables/Columns/ucrColumnWidth.Designer.vb @@ -0,0 +1,187 @@ + _ +Partial Class ucrColumnWidth + Inherits System.Windows.Forms.UserControl + + 'UserControl overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.lblColumnWidths = New System.Windows.Forms.Label() + Me.btnClear = New System.Windows.Forms.Button() + Me.lblColumns = New System.Windows.Forms.Label() + Me.btnAdd = New System.Windows.Forms.Button() + Me.ucrSelectorCols = New instat.ucrSelectorByDataFrameAddRemove() + Me.dataGrid = New System.Windows.Forms.DataGridView() + Me.colWidthExpression = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.lblColWidth = New System.Windows.Forms.Label() + Me.ucrReceiverMultipleCols = New instat.ucrReceiverMultiple() + Me.ucrNudWidth = New instat.ucrNud() + CType(Me.dataGrid, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'lblColumnWidths + ' + Me.lblColumnWidths.AutoSize = True + Me.lblColumnWidths.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblColumnWidths.Location = New System.Drawing.Point(368, 263) + Me.lblColumnWidths.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblColumnWidths.Name = "lblColumnWidths" + Me.lblColumnWidths.Size = New System.Drawing.Size(120, 20) + Me.lblColumnWidths.TabIndex = 313 + Me.lblColumnWidths.Text = "Column Widths:" + ' + 'btnClear + ' + Me.btnClear.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.btnClear.Location = New System.Drawing.Point(801, 249) + Me.btnClear.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.btnClear.Name = "btnClear" + Me.btnClear.Size = New System.Drawing.Size(112, 35) + Me.btnClear.TabIndex = 312 + Me.btnClear.Tag = "" + Me.btnClear.Text = "Clear" + Me.btnClear.UseVisualStyleBackColor = True + ' + 'lblColumns + ' + Me.lblColumns.AutoSize = True + Me.lblColumns.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblColumns.Location = New System.Drawing.Point(363, 8) + Me.lblColumns.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblColumns.Name = "lblColumns" + Me.lblColumns.Size = New System.Drawing.Size(85, 20) + Me.lblColumns.TabIndex = 311 + Me.lblColumns.Text = "Column(s):" + ' + 'btnAdd + ' + Me.btnAdd.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.btnAdd.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.btnAdd.Location = New System.Drawing.Point(364, 212) + Me.btnAdd.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.btnAdd.Name = "btnAdd" + Me.btnAdd.Size = New System.Drawing.Size(132, 35) + Me.btnAdd.TabIndex = 310 + Me.btnAdd.Tag = "" + Me.btnAdd.Text = "Add" + Me.btnAdd.UseVisualStyleBackColor = True + ' + 'ucrSelectorCols + ' + Me.ucrSelectorCols.AutoSize = True + Me.ucrSelectorCols.bDropUnusedFilterLevels = False + Me.ucrSelectorCols.bShowHiddenColumns = False + Me.ucrSelectorCols.bUseCurrentFilter = True + Me.ucrSelectorCols.Location = New System.Drawing.Point(6, 8) + Me.ucrSelectorCols.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectorCols.Name = "ucrSelectorCols" + Me.ucrSelectorCols.Size = New System.Drawing.Size(320, 282) + Me.ucrSelectorCols.TabIndex = 309 + ' + 'dataGrid + ' + Me.dataGrid.AllowUserToAddRows = False + Me.dataGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.dataGrid.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.colWidthExpression}) + Me.dataGrid.Location = New System.Drawing.Point(360, 289) + Me.dataGrid.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.dataGrid.Name = "dataGrid" + Me.dataGrid.RowHeadersWidth = 62 + Me.dataGrid.Size = New System.Drawing.Size(554, 112) + Me.dataGrid.TabIndex = 308 + ' + 'colWidthExpression + ' + Me.colWidthExpression.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.colWidthExpression.HeaderText = "Width Expression" + Me.colWidthExpression.MinimumWidth = 8 + Me.colWidthExpression.Name = "colWidthExpression" + Me.colWidthExpression.ReadOnly = True + ' + 'lblColWidth + ' + Me.lblColWidth.AutoSize = True + Me.lblColWidth.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblColWidth.Location = New System.Drawing.Point(368, 145) + Me.lblColWidth.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblColWidth.Name = "lblColWidth" + Me.lblColWidth.Size = New System.Drawing.Size(54, 20) + Me.lblColWidth.TabIndex = 315 + Me.lblColWidth.Text = "Width:" + ' + 'ucrReceiverMultipleCols + ' + Me.ucrReceiverMultipleCols.AutoSize = True + Me.ucrReceiverMultipleCols.frmParent = Nothing + Me.ucrReceiverMultipleCols.Location = New System.Drawing.Point(360, 32) + Me.ucrReceiverMultipleCols.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverMultipleCols.Name = "ucrReceiverMultipleCols" + Me.ucrReceiverMultipleCols.Selector = Nothing + Me.ucrReceiverMultipleCols.Size = New System.Drawing.Size(180, 98) + Me.ucrReceiverMultipleCols.strNcFilePath = "" + Me.ucrReceiverMultipleCols.TabIndex = 314 + Me.ucrReceiverMultipleCols.ucrSelector = Nothing + ' + 'ucrNudWidth + ' + Me.ucrNudWidth.AutoSize = True + Me.ucrNudWidth.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudWidth.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudWidth.Location = New System.Drawing.Point(369, 169) + Me.ucrNudWidth.Margin = New System.Windows.Forms.Padding(9, 9, 9, 9) + Me.ucrNudWidth.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudWidth.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudWidth.Name = "ucrNudWidth" + Me.ucrNudWidth.Size = New System.Drawing.Size(75, 31) + Me.ucrNudWidth.TabIndex = 318 + Me.ucrNudWidth.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrColumnWidth + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(9.0!, 20.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.ucrNudWidth) + Me.Controls.Add(Me.lblColumnWidths) + Me.Controls.Add(Me.btnClear) + Me.Controls.Add(Me.lblColumns) + Me.Controls.Add(Me.btnAdd) + Me.Controls.Add(Me.ucrSelectorCols) + Me.Controls.Add(Me.dataGrid) + Me.Controls.Add(Me.lblColWidth) + Me.Controls.Add(Me.ucrReceiverMultipleCols) + Me.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.Name = "ucrColumnWidth" + Me.Size = New System.Drawing.Size(920, 411) + CType(Me.dataGrid, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents lblColumnWidths As Label + Friend WithEvents btnClear As Button + Friend WithEvents lblColumns As Label + Friend WithEvents btnAdd As Button + Friend WithEvents ucrSelectorCols As ucrSelectorByDataFrameAddRemove + Friend WithEvents dataGrid As DataGridView + Friend WithEvents colWidthExpression As DataGridViewTextBoxColumn + Friend WithEvents lblColWidth As Label + Friend WithEvents ucrReceiverMultipleCols As ucrReceiverMultiple + Friend WithEvents ucrNudWidth As ucrNud +End Class diff --git a/instat/UserTables/Columns/ucrColumnWidth.resx b/instat/UserTables/Columns/ucrColumnWidth.resx new file mode 100644 index 00000000000..58cffaf9bfe --- /dev/null +++ b/instat/UserTables/Columns/ucrColumnWidth.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + \ No newline at end of file diff --git a/instat/UserTables/Columns/ucrColumnWidth.vb b/instat/UserTables/Columns/ucrColumnWidth.vb new file mode 100644 index 00000000000..9b6ecb92e3f --- /dev/null +++ b/instat/UserTables/Columns/ucrColumnWidth.vb @@ -0,0 +1,83 @@ +Public Class ucrColumnWidth + + Private clsOperator As New ROperator + Private bFirstload As Boolean = True + + Private Sub ucrColumnWidth_Load(sender As Object, e As EventArgs) Handles MyBase.Load + If bFirstload Then + InitialiseControl() + bFirstload = False + End If + End Sub + + Private Sub InitialiseControl() + ucrReceiverMultipleCols.Selector = ucrSelectorCols + ucrReceiverMultipleCols.SetMeAsReceiver() + + ucrNudWidth.Minimum = 0 + ucrNudWidth.Maximum = Decimal.MaxValue + End Sub + + Public Sub Setup(strDataFrameName As String, clsOperator As ROperator) + Me.clsOperator = clsOperator + + ' Set up the selector + ucrSelectorCols.SetDataframe(strDataFrameName, bEnableDataframe:=False) + + ' Clear and Set up the data grid with contents + dataGrid.Rows.Clear() + SetupDataGrid(clsTablesUtils.FindRFunctionsParamsWithRCommand({"cols_width"}, clsOperator)) + End Sub + + Private Sub SetupDataGrid(lstRParams As List(Of RParameter)) + For Each clsRParam As RParameter In lstRParams + ' Create a new row that represents the tab_style() parameters + Dim row As New DataGridViewRow + row.CreateCells(dataGrid) + row.Cells(0).Value = clsRParam.clsArgumentCodeStructure.Clone.ToScript + + ' Tag and add the tab_style() parameter function contents as a row + row.Tag = clsRParam + dataGrid.Rows.Add(row) + Next + End Sub + + Private Sub ucrInputControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverMultipleCols.ControlContentsChanged + btnAdd.Enabled = Not ucrReceiverMultipleCols.IsEmpty + End Sub + + Private Sub btnAdd_Click(sender As Object, e As EventArgs) Handles btnAdd.Click + + Dim clsColWidthRFunction As New RFunction + clsColWidthRFunction.SetPackageName("gt") + clsColWidthRFunction.SetRCommand("cols_width") + clsColWidthRFunction.AddParameter(strParameterName:="column_param", strParameterValue:=ucrReceiverMultipleCols.GetVariableNames(bWithQuotes:=False) & " ~ px(" & ucrNudWidth.Value & ")", iPosition:=0, bIncludeArgumentName:=False) + + ' Create parameter with unique name + Dim clsRParam As New RParameter(strParameterName:="tab_col_width_param" & (dataGrid.Rows.Count + 1), strParamValue:=clsColWidthRFunction, bNewIncludeArgumentName:=False) + + ' Create row and its cells + Dim row As New DataGridViewRow + row.CreateCells(dataGrid) + row.Cells(0).Value = clsColWidthRFunction.Clone.ToScript + + ' Tag the row with the parameter + row.Tag = clsRParam + + ' Add it to grid + dataGrid.Rows.Add(row) + + End Sub + + Private Sub btnClear_Click(sender As Object, e As EventArgs) Handles btnClear.Click + dataGrid.Rows.Clear() + End Sub + + Public Sub SetValuesToOperator() + ' Remove any previous col widths + clsTablesUtils.RemoveRFunctionsParamsWithRCommand({"cols_width"}, clsOperator) + + ' Add new changes + clsTablesUtils.AddGridRowTagsRParamsToROperator(dataGrid, clsOperator) + End Sub +End Class diff --git a/instat/UserTables/Columns/ucrColumns.Designer.vb b/instat/UserTables/Columns/ucrColumns.Designer.vb new file mode 100644 index 00000000000..c59d2dff065 --- /dev/null +++ b/instat/UserTables/Columns/ucrColumns.Designer.vb @@ -0,0 +1,245 @@ + +Partial Class ucrColumns + Inherits System.Windows.Forms.UserControl + + 'UserControl overrides dispose to clean up the component list. + + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + + Private Sub InitializeComponent() + Me.rdoColSpanners = New System.Windows.Forms.RadioButton() + Me.rdoColLabel = New System.Windows.Forms.RadioButton() + Me.rdoColFootNotes = New System.Windows.Forms.RadioButton() + Me.rdoColWidth = New System.Windows.Forms.RadioButton() + Me.rdoColNanoPlot = New System.Windows.Forms.RadioButton() + Me.ucrColumnSpanners = New instat.ucrColumnSpanners() + Me.ucrColumnLabels = New instat.ucrColumnLabels() + Me.ucrColumnFootNote = New instat.ucrColumnFootNote() + Me.ucrColumnWidth = New instat.ucrColumnWidth() + Me.ucrPnlCols = New instat.UcrPanel() + Me.ucrColumnNanoPlots = New instat.ucrColumnNanoPlots() + Me.rdoColStyles = New System.Windows.Forms.RadioButton() + Me.ucrColumnStyles = New instat.ucrColumnStyles() + Me.SuspendLayout() + ' + 'rdoColSpanners + ' + Me.rdoColSpanners.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoColSpanners.BackColor = System.Drawing.SystemColors.Control + Me.rdoColSpanners.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None + Me.rdoColSpanners.CheckAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoColSpanners.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoColSpanners.FlatAppearance.BorderSize = 2 + Me.rdoColSpanners.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoColSpanners.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoColSpanners.ForeColor = System.Drawing.SystemColors.ActiveCaptionText + Me.rdoColSpanners.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoColSpanners.Location = New System.Drawing.Point(419, 3) + Me.rdoColSpanners.Name = "rdoColSpanners" + Me.rdoColSpanners.Size = New System.Drawing.Size(91, 29) + Me.rdoColSpanners.TabIndex = 294 + Me.rdoColSpanners.Text = "Spanners" + Me.rdoColSpanners.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoColSpanners.UseVisualStyleBackColor = True + ' + 'rdoColLabel + ' + Me.rdoColLabel.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoColLabel.BackColor = System.Drawing.SystemColors.Control + Me.rdoColLabel.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None + Me.rdoColLabel.CheckAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoColLabel.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoColLabel.FlatAppearance.BorderSize = 2 + Me.rdoColLabel.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoColLabel.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoColLabel.ForeColor = System.Drawing.SystemColors.ActiveCaptionText + Me.rdoColLabel.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoColLabel.Location = New System.Drawing.Point(65, 3) + Me.rdoColLabel.Name = "rdoColLabel" + Me.rdoColLabel.Size = New System.Drawing.Size(91, 29) + Me.rdoColLabel.TabIndex = 296 + Me.rdoColLabel.Text = "Labels" + Me.rdoColLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoColLabel.UseVisualStyleBackColor = True + ' + 'rdoColFootNotes + ' + Me.rdoColFootNotes.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoColFootNotes.BackColor = System.Drawing.SystemColors.Control + Me.rdoColFootNotes.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None + Me.rdoColFootNotes.CheckAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoColFootNotes.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoColFootNotes.FlatAppearance.BorderSize = 2 + Me.rdoColFootNotes.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoColFootNotes.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoColFootNotes.ForeColor = System.Drawing.SystemColors.ActiveCaptionText + Me.rdoColFootNotes.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoColFootNotes.Location = New System.Drawing.Point(330, 3) + Me.rdoColFootNotes.Name = "rdoColFootNotes" + Me.rdoColFootNotes.Size = New System.Drawing.Size(91, 29) + Me.rdoColFootNotes.TabIndex = 298 + Me.rdoColFootNotes.Text = "Foot Notes" + Me.rdoColFootNotes.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoColFootNotes.UseVisualStyleBackColor = True + ' + 'rdoColWidth + ' + Me.rdoColWidth.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoColWidth.BackColor = System.Drawing.SystemColors.Control + Me.rdoColWidth.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None + Me.rdoColWidth.CheckAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoColWidth.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoColWidth.FlatAppearance.BorderSize = 2 + Me.rdoColWidth.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoColWidth.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoColWidth.ForeColor = System.Drawing.SystemColors.ActiveCaptionText + Me.rdoColWidth.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoColWidth.Location = New System.Drawing.Point(154, 3) + Me.rdoColWidth.Name = "rdoColWidth" + Me.rdoColWidth.Size = New System.Drawing.Size(91, 29) + Me.rdoColWidth.TabIndex = 300 + Me.rdoColWidth.Text = "Width" + Me.rdoColWidth.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoColWidth.UseVisualStyleBackColor = True + ' + 'rdoColNanoPlot + ' + Me.rdoColNanoPlot.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoColNanoPlot.BackColor = System.Drawing.SystemColors.Control + Me.rdoColNanoPlot.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None + Me.rdoColNanoPlot.CheckAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoColNanoPlot.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoColNanoPlot.FlatAppearance.BorderSize = 2 + Me.rdoColNanoPlot.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoColNanoPlot.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoColNanoPlot.ForeColor = System.Drawing.SystemColors.ActiveCaptionText + Me.rdoColNanoPlot.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoColNanoPlot.Location = New System.Drawing.Point(508, 3) + Me.rdoColNanoPlot.Name = "rdoColNanoPlot" + Me.rdoColNanoPlot.Size = New System.Drawing.Size(91, 29) + Me.rdoColNanoPlot.TabIndex = 303 + Me.rdoColNanoPlot.Text = "Nano Plot" + Me.rdoColNanoPlot.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoColNanoPlot.UseVisualStyleBackColor = True + ' + 'ucrColumnSpanners + ' + Me.ucrColumnSpanners.Location = New System.Drawing.Point(6, 40) + Me.ucrColumnSpanners.Name = "ucrColumnSpanners" + Me.ucrColumnSpanners.Size = New System.Drawing.Size(615, 266) + Me.ucrColumnSpanners.TabIndex = 295 + ' + 'ucrColumnLabels + ' + Me.ucrColumnLabels.Location = New System.Drawing.Point(13, 42) + Me.ucrColumnLabels.Name = "ucrColumnLabels" + Me.ucrColumnLabels.Size = New System.Drawing.Size(575, 262) + Me.ucrColumnLabels.TabIndex = 297 + ' + 'ucrColumnFootNote + ' + Me.ucrColumnFootNote.Location = New System.Drawing.Point(7, 37) + Me.ucrColumnFootNote.Name = "ucrColumnFootNote" + Me.ucrColumnFootNote.Size = New System.Drawing.Size(599, 292) + Me.ucrColumnFootNote.TabIndex = 299 + ' + 'ucrColumnWidth + ' + Me.ucrColumnWidth.Location = New System.Drawing.Point(5, 37) + Me.ucrColumnWidth.Name = "ucrColumnWidth" + Me.ucrColumnWidth.Size = New System.Drawing.Size(613, 267) + Me.ucrColumnWidth.TabIndex = 301 + ' + 'ucrPnlCols + ' + Me.ucrPnlCols.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlCols.Location = New System.Drawing.Point(8, 3) + Me.ucrPnlCols.Name = "ucrPnlCols" + Me.ucrPnlCols.Size = New System.Drawing.Size(634, 29) + Me.ucrPnlCols.TabIndex = 289 + ' + 'ucrColumnNanoPlots + ' + Me.ucrColumnNanoPlots.Location = New System.Drawing.Point(8, 42) + Me.ucrColumnNanoPlots.Name = "ucrColumnNanoPlots" + Me.ucrColumnNanoPlots.Size = New System.Drawing.Size(623, 262) + Me.ucrColumnNanoPlots.TabIndex = 304 + ' + 'rdoColStyles + ' + Me.rdoColStyles.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoColStyles.BackColor = System.Drawing.SystemColors.Control + Me.rdoColStyles.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None + Me.rdoColStyles.CheckAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoColStyles.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoColStyles.FlatAppearance.BorderSize = 2 + Me.rdoColStyles.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoColStyles.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoColStyles.ForeColor = System.Drawing.SystemColors.ActiveCaptionText + Me.rdoColStyles.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoColStyles.Location = New System.Drawing.Point(243, 3) + Me.rdoColStyles.Name = "rdoColStyles" + Me.rdoColStyles.Size = New System.Drawing.Size(91, 29) + Me.rdoColStyles.TabIndex = 305 + Me.rdoColStyles.Text = "Styles" + Me.rdoColStyles.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoColStyles.UseVisualStyleBackColor = True + ' + 'ucrColumnStyles + ' + Me.ucrColumnStyles.Location = New System.Drawing.Point(8, 42) + Me.ucrColumnStyles.Name = "ucrColumnStyles" + Me.ucrColumnStyles.Size = New System.Drawing.Size(556, 262) + Me.ucrColumnStyles.TabIndex = 306 + ' + 'ucrColumns + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.rdoColStyles) + Me.Controls.Add(Me.rdoColNanoPlot) + Me.Controls.Add(Me.ucrColumnFootNote) + Me.Controls.Add(Me.ucrColumnWidth) + Me.Controls.Add(Me.rdoColWidth) + Me.Controls.Add(Me.rdoColFootNotes) + Me.Controls.Add(Me.rdoColLabel) + Me.Controls.Add(Me.rdoColSpanners) + Me.Controls.Add(Me.ucrPnlCols) + Me.Controls.Add(Me.ucrColumnNanoPlots) + Me.Controls.Add(Me.ucrColumnStyles) + Me.Controls.Add(Me.ucrColumnSpanners) + Me.Controls.Add(Me.ucrColumnLabels) + Me.Name = "ucrColumns" + Me.Size = New System.Drawing.Size(651, 332) + Me.ResumeLayout(False) + + End Sub + Friend WithEvents ucrPnlCols As UcrPanel + Friend WithEvents rdoColSpanners As RadioButton + Friend WithEvents ucrColumnSpanners As ucrColumnSpanners + Friend WithEvents rdoColLabel As RadioButton + Friend WithEvents ucrColumnLabels As ucrColumnLabels + Friend WithEvents rdoColFootNotes As RadioButton + Friend WithEvents ucrColumnFootNote As ucrColumnFootNote + Friend WithEvents rdoColWidth As RadioButton + Friend WithEvents ucrColumnWidth As ucrColumnWidth + Friend WithEvents rdoColNanoPlot As RadioButton + Friend WithEvents ucrColumnNanoPlots As ucrColumnNanoPlots + Friend WithEvents rdoColStyles As RadioButton + Friend WithEvents ucrColumnStyles As ucrColumnStyles +End Class diff --git a/instat/UserTables/Columns/ucrColumns.resx b/instat/UserTables/Columns/ucrColumns.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/instat/UserTables/Columns/ucrColumns.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/instat/UserTables/Columns/ucrColumns.vb b/instat/UserTables/Columns/ucrColumns.vb new file mode 100644 index 00000000000..b3c7824fde1 --- /dev/null +++ b/instat/UserTables/Columns/ucrColumns.vb @@ -0,0 +1,55 @@ +Public Class ucrColumns + + Private bFirstload As Boolean = True + + + + Private Sub ucrColumns_Load(sender As Object, e As EventArgs) Handles MyBase.Load + If bFirstload Then + InitialiseDialog() + bFirstload = False + End If + End Sub + + Private Sub InitialiseDialog() + ucrPnlCols.AddRadioButton(rdoColLabel) + ucrPnlCols.AddRadioButton(rdoColStyles) + ucrPnlCols.AddRadioButton(rdoColWidth) + ucrPnlCols.AddRadioButton(rdoColFootNotes) + ucrPnlCols.AddRadioButton(rdoColSpanners) + + ' TODO. Nonplots disabled until R is upgraded + 'ucrPnlCols.AddRadioButton(rdoColNanoPlot) + rdoColNanoPlot.Enabled = False + + rdoColLabel.Checked = True + End Sub + + Public Sub Setup(strDataFrameName As String, clsOperator As ROperator) + ucrColumnLabels.Setup(strDataFrameName, clsOperator) + ucrColumnStyles.Setup(strDataFrameName, clsOperator) + ucrColumnWidth.Setup(strDataFrameName, clsOperator) + ucrColumnFootNote.Setup(strDataFrameName, clsOperator) + ucrColumnSpanners.Setup(strDataFrameName, clsOperator) + ucrColumnNanoPlots.Setup(strDataFrameName, clsOperator) + End Sub + + Private Sub ucrPnlCols_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlCols.ControlValueChanged + ucrColumnLabels.Visible = rdoColLabel.Checked + ucrColumnStyles.Visible = rdoColStyles.Checked + ucrColumnWidth.Visible = rdoColWidth.Checked + ucrColumnFootNote.Visible = rdoColFootNotes.Checked + ucrColumnSpanners.Visible = rdoColSpanners.Checked + ucrColumnNanoPlots.Visible = rdoColNanoPlot.Checked + End Sub + + Public Sub SetValuesToOperator() + ucrColumnLabels.SetValuesToOperator() + ucrColumnStyles.SetValuesToOperator() + ucrColumnWidth.SetValuesToOperator() + ucrColumnFootNote.SetValuesToOperator() + ucrColumnSpanners.SetValuesToOperator() + ucrColumnNanoPlots.SetValuesToOperator() + End Sub + +End Class diff --git a/instat/UserTables/Header/ucrHeader.Designer.vb b/instat/UserTables/Header/ucrHeader.Designer.vb new file mode 100644 index 00000000000..ebd3b82dd80 --- /dev/null +++ b/instat/UserTables/Header/ucrHeader.Designer.vb @@ -0,0 +1,202 @@ + _ +Partial Class ucrHeader + Inherits System.Windows.Forms.UserControl + + 'UserControl overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.ucrInputSubtitleFooter = New instat.ucrInputTextBox() + Me.ucrInputTitleFooter = New instat.ucrInputTextBox() + Me.lblHeaderSubtitle = New System.Windows.Forms.Label() + Me.lblHeaderTitle = New System.Windows.Forms.Label() + Me.btnSubTitleStyle = New System.Windows.Forms.Button() + Me.btnTitleStyle = New System.Windows.Forms.Button() + Me.ucrInputSubtitle = New instat.ucrInputTextBox() + Me.ucrInputTitle = New instat.ucrInputTextBox() + Me.lblSubtitle = New System.Windows.Forms.Label() + Me.lblTitle = New System.Windows.Forms.Label() + Me.grpBoxTitle = New System.Windows.Forms.GroupBox() + Me.grpBoxSubtitle = New System.Windows.Forms.GroupBox() + Me.grpBoxTitle.SuspendLayout() + Me.grpBoxSubtitle.SuspendLayout() + Me.SuspendLayout() + ' + 'ucrInputSubtitleFooter + ' + Me.ucrInputSubtitleFooter.AddQuotesIfUnrecognised = True + Me.ucrInputSubtitleFooter.AutoSize = True + Me.ucrInputSubtitleFooter.IsMultiline = False + Me.ucrInputSubtitleFooter.IsReadOnly = False + Me.ucrInputSubtitleFooter.Location = New System.Drawing.Point(9, 88) + Me.ucrInputSubtitleFooter.Margin = New System.Windows.Forms.Padding(9) + Me.ucrInputSubtitleFooter.Name = "ucrInputSubtitleFooter" + Me.ucrInputSubtitleFooter.Size = New System.Drawing.Size(361, 21) + Me.ucrInputSubtitleFooter.TabIndex = 23 + ' + 'ucrInputTitleFooter + ' + Me.ucrInputTitleFooter.AddQuotesIfUnrecognised = True + Me.ucrInputTitleFooter.AutoSize = True + Me.ucrInputTitleFooter.IsMultiline = False + Me.ucrInputTitleFooter.IsReadOnly = False + Me.ucrInputTitleFooter.Location = New System.Drawing.Point(11, 89) + Me.ucrInputTitleFooter.Margin = New System.Windows.Forms.Padding(9) + Me.ucrInputTitleFooter.Name = "ucrInputTitleFooter" + Me.ucrInputTitleFooter.Size = New System.Drawing.Size(359, 21) + Me.ucrInputTitleFooter.TabIndex = 22 + ' + 'lblHeaderSubtitle + ' + Me.lblHeaderSubtitle.AutoSize = True + Me.lblHeaderSubtitle.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblHeaderSubtitle.Location = New System.Drawing.Point(6, 72) + Me.lblHeaderSubtitle.Name = "lblHeaderSubtitle" + Me.lblHeaderSubtitle.Size = New System.Drawing.Size(78, 13) + Me.lblHeaderSubtitle.TabIndex = 21 + Me.lblHeaderSubtitle.Text = "Subtitle Footer:" + ' + 'lblHeaderTitle + ' + Me.lblHeaderTitle.AutoSize = True + Me.lblHeaderTitle.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblHeaderTitle.Location = New System.Drawing.Point(8, 72) + Me.lblHeaderTitle.Name = "lblHeaderTitle" + Me.lblHeaderTitle.Size = New System.Drawing.Size(63, 13) + Me.lblHeaderTitle.TabIndex = 20 + Me.lblHeaderTitle.Text = "Title Footer:" + ' + 'btnSubTitleStyle + ' + Me.btnSubTitleStyle.Location = New System.Drawing.Point(372, 40) + Me.btnSubTitleStyle.Name = "btnSubTitleStyle" + Me.btnSubTitleStyle.Size = New System.Drawing.Size(75, 23) + Me.btnSubTitleStyle.TabIndex = 31 + Me.btnSubTitleStyle.Text = "Style" + Me.btnSubTitleStyle.UseVisualStyleBackColor = True + ' + 'btnTitleStyle + ' + Me.btnTitleStyle.Location = New System.Drawing.Point(374, 42) + Me.btnTitleStyle.Name = "btnTitleStyle" + Me.btnTitleStyle.Size = New System.Drawing.Size(79, 23) + Me.btnTitleStyle.TabIndex = 30 + Me.btnTitleStyle.Text = "Style" + Me.btnTitleStyle.UseVisualStyleBackColor = True + ' + 'ucrInputSubtitle + ' + Me.ucrInputSubtitle.AddQuotesIfUnrecognised = True + Me.ucrInputSubtitle.AutoSize = True + Me.ucrInputSubtitle.IsMultiline = False + Me.ucrInputSubtitle.IsReadOnly = False + Me.ucrInputSubtitle.Location = New System.Drawing.Point(9, 42) + Me.ucrInputSubtitle.Margin = New System.Windows.Forms.Padding(9) + Me.ucrInputSubtitle.Name = "ucrInputSubtitle" + Me.ucrInputSubtitle.Size = New System.Drawing.Size(361, 21) + Me.ucrInputSubtitle.TabIndex = 29 + ' + 'ucrInputTitle + ' + Me.ucrInputTitle.AddQuotesIfUnrecognised = True + Me.ucrInputTitle.AutoSize = True + Me.ucrInputTitle.IsMultiline = False + Me.ucrInputTitle.IsReadOnly = False + Me.ucrInputTitle.Location = New System.Drawing.Point(11, 42) + Me.ucrInputTitle.Margin = New System.Windows.Forms.Padding(9) + Me.ucrInputTitle.Name = "ucrInputTitle" + Me.ucrInputTitle.Size = New System.Drawing.Size(359, 21) + Me.ucrInputTitle.TabIndex = 28 + ' + 'lblSubtitle + ' + Me.lblSubtitle.AutoSize = True + Me.lblSubtitle.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblSubtitle.Location = New System.Drawing.Point(6, 25) + Me.lblSubtitle.Name = "lblSubtitle" + Me.lblSubtitle.Size = New System.Drawing.Size(74, 13) + Me.lblSubtitle.TabIndex = 27 + Me.lblSubtitle.Text = "Subtitle Label:" + ' + 'lblTitle + ' + Me.lblTitle.AutoSize = True + Me.lblTitle.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblTitle.Location = New System.Drawing.Point(8, 22) + Me.lblTitle.Name = "lblTitle" + Me.lblTitle.Size = New System.Drawing.Size(59, 13) + Me.lblTitle.TabIndex = 26 + Me.lblTitle.Text = "Title Label:" + ' + 'grpBoxTitle + ' + Me.grpBoxTitle.Controls.Add(Me.lblTitle) + Me.grpBoxTitle.Controls.Add(Me.ucrInputTitle) + Me.grpBoxTitle.Controls.Add(Me.btnTitleStyle) + Me.grpBoxTitle.Controls.Add(Me.lblHeaderTitle) + Me.grpBoxTitle.Controls.Add(Me.ucrInputTitleFooter) + Me.grpBoxTitle.Location = New System.Drawing.Point(4, 5) + Me.grpBoxTitle.Name = "grpBoxTitle" + Me.grpBoxTitle.Size = New System.Drawing.Size(463, 115) + Me.grpBoxTitle.TabIndex = 32 + Me.grpBoxTitle.TabStop = False + Me.grpBoxTitle.Text = "Title" + ' + 'grpBoxSubtitle + ' + Me.grpBoxSubtitle.Controls.Add(Me.lblHeaderSubtitle) + Me.grpBoxSubtitle.Controls.Add(Me.ucrInputSubtitleFooter) + Me.grpBoxSubtitle.Controls.Add(Me.btnSubTitleStyle) + Me.grpBoxSubtitle.Controls.Add(Me.ucrInputSubtitle) + Me.grpBoxSubtitle.Controls.Add(Me.lblSubtitle) + Me.grpBoxSubtitle.Location = New System.Drawing.Point(4, 125) + Me.grpBoxSubtitle.Name = "grpBoxSubtitle" + Me.grpBoxSubtitle.Size = New System.Drawing.Size(463, 116) + Me.grpBoxSubtitle.TabIndex = 33 + Me.grpBoxSubtitle.TabStop = False + Me.grpBoxSubtitle.Text = "Subtitle" + ' + 'ucrHeader + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.grpBoxSubtitle) + Me.Controls.Add(Me.grpBoxTitle) + Me.Name = "ucrHeader" + Me.Size = New System.Drawing.Size(470, 246) + Me.grpBoxTitle.ResumeLayout(False) + Me.grpBoxTitle.PerformLayout() + Me.grpBoxSubtitle.ResumeLayout(False) + Me.grpBoxSubtitle.PerformLayout() + Me.ResumeLayout(False) + + End Sub + Friend WithEvents ucrInputSubtitleFooter As ucrInputTextBox + Friend WithEvents ucrInputTitleFooter As ucrInputTextBox + Friend WithEvents lblHeaderSubtitle As Label + Friend WithEvents lblHeaderTitle As Label + Friend WithEvents btnSubTitleStyle As Button + Friend WithEvents btnTitleStyle As Button + Friend WithEvents ucrInputSubtitle As ucrInputTextBox + Friend WithEvents ucrInputTitle As ucrInputTextBox + Friend WithEvents lblSubtitle As Label + Friend WithEvents lblTitle As Label + Friend WithEvents grpBoxTitle As GroupBox + Friend WithEvents grpBoxSubtitle As GroupBox +End Class diff --git a/instat/UserTables/Header/ucrHeader.resx b/instat/UserTables/Header/ucrHeader.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/instat/UserTables/Header/ucrHeader.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/instat/UserTables/Header/ucrHeader.vb b/instat/UserTables/Header/ucrHeader.vb new file mode 100644 index 00000000000..1be15500eee --- /dev/null +++ b/instat/UserTables/Header/ucrHeader.vb @@ -0,0 +1,183 @@ + +Public Class ucrHeader + Private clsOperator As New ROperator + Private clsHeaderRFunction, clsTitleFooterRFunction, clsSubtitleFooterRFunction, clsTitleLocationRFunction, clsSubtitleLocationRFunction, clsTitleStyleRFunction, clsSubtitleStyleRFunction As New RFunction + + + Private bFirstload As Boolean = True + + Private Sub InitialiseDialog() + + ucrInputTitle.SetParameter(New RParameter("title", iNewPosition:=0)) + + ucrInputSubtitle.SetParameter(New RParameter("subtitle", iNewPosition:=1)) + + ucrInputTitleFooter.SetParameter(New RParameter("footnote", iNewPosition:=0)) + + ucrInputSubtitleFooter.SetParameter(New RParameter("footnote", iNewPosition:=0)) + + End Sub + + Public Sub Setup(clsOperator As ROperator) + If bFirstload Then + InitialiseDialog() + bFirstload = False + End If + + Me.clsOperator = clsOperator + + SetRFunctions(clsOperator) + SetRCode() + + End Sub + + Private Sub SetRFunctions(clsOperator As ROperator) + + clsHeaderRFunction = Nothing + clsTitleStyleRFunction = Nothing + clsSubtitleStyleRFunction = Nothing + clsTitleLocationRFunction = Nothing + clsSubtitleLocationRFunction = Nothing + clsTitleFooterRFunction = Nothing + clsSubtitleFooterRFunction = Nothing + + '-------------- + ' Set up the header R function for title and subtitle + clsHeaderRFunction = clsTablesUtils.FindRFunctionsParamsWithRCommand({"tab_header"}, clsOperator).FirstOrDefault()?.clsArgumentCodeStructure + If clsHeaderRFunction Is Nothing Then + clsHeaderRFunction = New RFunction + clsHeaderRFunction.SetPackageName("gt") + clsHeaderRFunction.SetRCommand("tab_header") + End If + '-------------- + + '-------------- + ' Set up the title and subtitle styles R function + Dim lstTabStyleForRParams As List(Of RParameter) = clsTablesUtils.FindRFunctionsParamsWithRParamValue({"tab_style"}, "locations", "cells_title", clsOperator) + For Each clsTabStyleRParam As RParameter In lstTabStyleForRParams + For Each clsStyleLocationParam As RParameter In clsTabStyleRParam.clsArgumentCodeStructure.clsParameters + If clsStyleLocationParam.strArgumentName = "locations" AndAlso clsStyleLocationParam.clsArgumentCodeStructure.ContainsParameter("groups") Then + If clsTablesUtils.GetStringValue(clsStyleLocationParam.clsArgumentCodeStructure.GetParameter("groups").strArgumentValue, False) = "title" Then + clsTitleStyleRFunction = clsTabStyleRParam.clsArgumentCodeStructure + clsTitleLocationRFunction = clsStyleLocationParam.clsArgumentCodeStructure + ElseIf clsTablesUtils.GetStringValue(clsStyleLocationParam.clsArgumentCodeStructure.GetParameter("groups").strArgumentValue, False) = "subtitle" Then + clsSubtitleStyleRFunction = clsTabStyleRParam.clsArgumentCodeStructure + clsSubtitleLocationRFunction = clsStyleLocationParam.clsArgumentCodeStructure + End If + End If + Next + Next + '-------------- + + '-------------- + ' Set up the title footer and subtitle footer, locations R function + Dim lstTabFootNoteRParams As List(Of RParameter) = clsTablesUtils.FindRFunctionsParamsWithRParamValue({"tab_footnote"}, "locations", "cells_title", clsOperator) + For Each clsTabFootNoteRParam As RParameter In lstTabFootNoteRParams + For Each clsFooterParam As RParameter In clsTabFootNoteRParam.clsArgumentCodeStructure.clsParameters + If clsFooterParam.strArgumentName = "locations" AndAlso clsFooterParam.clsArgumentCodeStructure.ContainsParameter("groups") Then + If clsTablesUtils.GetStringValue(clsFooterParam.clsArgumentCodeStructure.GetParameter("groups").strArgumentValue, False) = "title" Then + clsTitleFooterRFunction = clsTabFootNoteRParam.clsArgumentCodeStructure + clsTitleLocationRFunction = clsFooterParam.clsArgumentCodeStructure + ElseIf clsTablesUtils.GetStringValue(clsFooterParam.clsArgumentCodeStructure.GetParameter("groups").strArgumentValue, False) = "subtitle" Then + clsSubtitleFooterRFunction = clsTabFootNoteRParam.clsArgumentCodeStructure + clsSubtitleLocationRFunction = clsFooterParam.clsArgumentCodeStructure + End If + End If + Next + Next + + If clsTitleFooterRFunction Is Nothing Then + clsTitleLocationRFunction = GetNewCellsTitleRFunction("title") + clsTitleFooterRFunction = New RFunction + + clsTitleFooterRFunction.SetPackageName("gt") + clsTitleFooterRFunction.SetRCommand("tab_footnote") + clsTitleFooterRFunction.AddParameter(strParameterName:="locations", clsRFunctionParameter:=clsTitleLocationRFunction, iPosition:=1) + + End If + + If clsSubtitleFooterRFunction Is Nothing Then + clsSubtitleLocationRFunction = GetNewCellsTitleRFunction("subtitle") + clsSubtitleFooterRFunction = New RFunction + + + clsSubtitleFooterRFunction.SetPackageName("gt") + clsSubtitleFooterRFunction.SetRCommand("tab_footnote") + clsSubtitleFooterRFunction.AddParameter(strParameterName:="locations", clsRFunctionParameter:=clsSubtitleLocationRFunction, iPosition:=1) + End If + '-------------- + End Sub + + Private Function GetNewCellsTitleRFunction(strGroupParamValue As String) + Dim clsCellsTitleRFunction As New RFunction + clsCellsTitleRFunction.SetPackageName("gt") + clsCellsTitleRFunction.SetRCommand("cells_title") + clsCellsTitleRFunction.AddParameter(strParameterName:="groups", strParameterValue:=Chr(34) & strGroupParamValue & Chr(34), iPosition:=0) + Return clsCellsTitleRFunction + End Function + + Private Sub SetRCode() + + ucrInputTitle.SetRCode(clsHeaderRFunction, True, bCloneIfNeeded:=True) + ucrInputSubtitle.SetRCode(clsHeaderRFunction, True, bCloneIfNeeded:=True) + + ucrInputTitleFooter.SetRCode(clsTitleFooterRFunction, True, bCloneIfNeeded:=True) + ucrInputSubtitleFooter.SetRCode(clsSubtitleFooterRFunction, True, bCloneIfNeeded:=True) + + End Sub + + Private Sub btnTitleFormat_Click(sender As Object, e As EventArgs) Handles btnTitleStyle.Click + Dim clsListStyleRFunction As RFunction = clsTablesUtils.ShowStyleSubDialog(Me.ParentForm, clsTitleStyleRFunction) + If clsListStyleRFunction Is Nothing Then + Exit Sub + End If + + clsTitleStyleRFunction = clsTablesUtils.GetNewStyleRFunction(clsListStyleRFunction, clsTitleLocationRFunction) + End Sub + + + Private Sub btnSubtitleFormat_Click(sender As Object, e As EventArgs) Handles btnSubTitleStyle.Click + Dim clsListStyleRFunction As RFunction = clsTablesUtils.ShowStyleSubDialog(Me.ParentForm, clsSubtitleStyleRFunction) + If clsListStyleRFunction Is Nothing Then + Exit Sub + End If + + clsSubtitleStyleRFunction = clsTablesUtils.GetNewStyleRFunction(clsListStyleRFunction, clsSubtitleLocationRFunction) + End Sub + + Private Sub ucrInputControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrInputTitle.ControlContentsChanged, ucrInputTitleFooter.ControlContentsChanged, ucrInputSubtitle.ControlContentsChanged, ucrInputSubtitleFooter.ControlContentsChanged + ucrInputTitleFooter.Enabled = Not ucrInputTitle.IsEmpty() + ucrInputSubtitle.Enabled = Not ucrInputTitle.IsEmpty() + ucrInputSubtitleFooter.Enabled = ucrInputSubtitle.Enabled AndAlso Not ucrInputSubtitle.IsEmpty() + End Sub + + Public Sub SetValuesToOperator() + ' Remove any previous header parameters + clsTablesUtils.RemoveRFunctionsParamsWithRCommand({"tab_header"}, clsOperator) + clsTablesUtils.RemoveRParams(clsTablesUtils.FindRFunctionsParamsWithRParamValue({"tab_footnote", "tab_style"}, "locations", "cells_title", clsOperator), clsOperator) + + ' Add new changes + If Not ucrInputTitle.IsEmpty Then + clsOperator.AddParameter(strParameterName:="tab_header_param", clsRFunctionParameter:=clsHeaderRFunction) + + If ucrInputTitleFooter.Enabled AndAlso Not ucrInputTitleFooter.IsEmpty Then + clsOperator.AddParameter(strParameterName:="tab_footer_for_tile_param", clsRFunctionParameter:=clsTitleFooterRFunction) + End If + + If ucrInputSubtitleFooter.Enabled AndAlso Not ucrInputSubtitleFooter.IsEmpty Then + clsOperator.AddParameter(strParameterName:="tab_footer_for_subtitle_param", clsRFunctionParameter:=clsSubtitleFooterRFunction) + End If + + End If + + If clsTitleStyleRFunction IsNot Nothing Then + clsOperator.AddParameter(strParameterName:="tab_style_for_title_param", clsRFunctionParameter:=clsTitleStyleRFunction) + End If + + If clsSubtitleStyleRFunction IsNot Nothing Then + clsOperator.AddParameter(strParameterName:="tab_style_for_subtitle_param", clsRFunctionParameter:=clsSubtitleStyleRFunction) + End If + + End Sub + +End Class diff --git a/instat/UserTables/Others/ucrOtherStyles.Designer.vb b/instat/UserTables/Others/ucrOtherStyles.Designer.vb new file mode 100644 index 00000000000..a86909180fc --- /dev/null +++ b/instat/UserTables/Others/ucrOtherStyles.Designer.vb @@ -0,0 +1,137 @@ + _ +Partial Class ucrOtherStyles + Inherits System.Windows.Forms.UserControl + + 'UserControl overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.cboLocation = New System.Windows.Forms.ComboBox() + Me.lblLocation = New System.Windows.Forms.Label() + Me.lblFormats = New System.Windows.Forms.Label() + Me.btnClearStyles = New System.Windows.Forms.Button() + Me.btnEnterStyle = New System.Windows.Forms.Button() + Me.dataGridStyles = New System.Windows.Forms.DataGridView() + Me.colLocation = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.colStyles = New System.Windows.Forms.DataGridViewTextBoxColumn() + CType(Me.dataGridStyles, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'cboLocation + ' + Me.cboLocation.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.cboLocation.FormattingEnabled = True + Me.cboLocation.Items.AddRange(New Object() {"Foot Notes", "Souce Notes"}) + Me.cboLocation.Location = New System.Drawing.Point(7, 20) + Me.cboLocation.Name = "cboLocation" + Me.cboLocation.Size = New System.Drawing.Size(127, 21) + Me.cboLocation.TabIndex = 311 + ' + 'lblLocation + ' + Me.lblLocation.AutoSize = True + Me.lblLocation.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblLocation.Location = New System.Drawing.Point(5, 3) + Me.lblLocation.Name = "lblLocation" + Me.lblLocation.Size = New System.Drawing.Size(84, 13) + Me.lblLocation.TabIndex = 310 + Me.lblLocation.Text = "Select Location:" + ' + 'lblFormats + ' + Me.lblFormats.AutoSize = True + Me.lblFormats.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblFormats.Location = New System.Drawing.Point(5, 83) + Me.lblFormats.Name = "lblFormats" + Me.lblFormats.Size = New System.Drawing.Size(38, 13) + Me.lblFormats.TabIndex = 330 + Me.lblFormats.Text = "Styles:" + ' + 'btnClearStyles + ' + Me.btnClearStyles.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.btnClearStyles.Location = New System.Drawing.Point(244, 74) + Me.btnClearStyles.Name = "btnClearStyles" + Me.btnClearStyles.Size = New System.Drawing.Size(75, 23) + Me.btnClearStyles.TabIndex = 328 + Me.btnClearStyles.Tag = "" + Me.btnClearStyles.Text = "Clear" + Me.btnClearStyles.UseVisualStyleBackColor = True + ' + 'btnEnterStyle + ' + Me.btnEnterStyle.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.btnEnterStyle.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.btnEnterStyle.Location = New System.Drawing.Point(8, 50) + Me.btnEnterStyle.Name = "btnEnterStyle" + Me.btnEnterStyle.Size = New System.Drawing.Size(126, 23) + Me.btnEnterStyle.TabIndex = 327 + Me.btnEnterStyle.Tag = "" + Me.btnEnterStyle.Text = "Enter Style" + Me.btnEnterStyle.UseVisualStyleBackColor = True + ' + 'dataGridStyles + ' + Me.dataGridStyles.AllowUserToAddRows = False + Me.dataGridStyles.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.dataGridStyles.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.colLocation, Me.colStyles}) + Me.dataGridStyles.Location = New System.Drawing.Point(8, 100) + Me.dataGridStyles.Name = "dataGridStyles" + Me.dataGridStyles.RowHeadersWidth = 62 + Me.dataGridStyles.Size = New System.Drawing.Size(315, 73) + Me.dataGridStyles.TabIndex = 329 + ' + 'colLocation + ' + Me.colLocation.HeaderText = "Location" + Me.colLocation.Name = "colLocation" + ' + 'colStyles + ' + Me.colStyles.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.colStyles.HeaderText = "Style Expressions" + Me.colStyles.MinimumWidth = 8 + Me.colStyles.Name = "colStyles" + ' + 'ucrOtherStyles + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.lblFormats) + Me.Controls.Add(Me.btnClearStyles) + Me.Controls.Add(Me.btnEnterStyle) + Me.Controls.Add(Me.dataGridStyles) + Me.Controls.Add(Me.cboLocation) + Me.Controls.Add(Me.lblLocation) + Me.Name = "ucrOtherStyles" + Me.Size = New System.Drawing.Size(326, 179) + CType(Me.dataGridStyles, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents cboLocation As ComboBox + Friend WithEvents lblLocation As Label + Friend WithEvents lblFormats As Label + Friend WithEvents btnClearStyles As Button + Friend WithEvents btnEnterStyle As Button + Friend WithEvents dataGridStyles As DataGridView + Friend WithEvents colLocation As DataGridViewTextBoxColumn + Friend WithEvents colStyles As DataGridViewTextBoxColumn +End Class diff --git a/instat/UserTables/Others/ucrOtherStyles.resx b/instat/UserTables/Others/ucrOtherStyles.resx new file mode 100644 index 00000000000..57eb4184f91 --- /dev/null +++ b/instat/UserTables/Others/ucrOtherStyles.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + True + + \ No newline at end of file diff --git a/instat/UserTables/Others/ucrOtherStyles.vb b/instat/UserTables/Others/ucrOtherStyles.vb new file mode 100644 index 00000000000..1835dc7e969 --- /dev/null +++ b/instat/UserTables/Others/ucrOtherStyles.vb @@ -0,0 +1,94 @@ +Public Class ucrOtherStyles + Private clsOperator As New ROperator + Private bFirstload As Boolean = True + + Private Sub ucrOtherStyles_Load(sender As Object, e As EventArgs) Handles MyBase.Load + If bFirstload Then + InitialiseControl() + bFirstload = False + End If + End Sub + + Private Sub InitialiseControl() + cboLocation.SelectedIndex = 0 + End Sub + + Public Sub Setup(clsOperator As ROperator) + Me.clsOperator = clsOperator + + ' Clear and Set up the data grid with contents + dataGridStyles.Rows.Clear() + SetupDataGrid(clsTablesUtils.FindRFunctionsParamsWithRParamValue({"tab_style"}, "locations", "cells_footnotes", clsOperator), "Foot Notes") + SetupDataGrid(clsTablesUtils.FindRFunctionsParamsWithRParamValue({"tab_style"}, "locations", "cells_source_notes", clsOperator), "Souce Notes") + End Sub + + Private Sub SetupDataGrid(lstRParams As List(Of RParameter), strLocation As String) + For Each clsRParam As RParameter In lstRParams + ' Create a new row that represents the tab_style() parameters + Dim row As New DataGridViewRow + row.CreateCells(dataGridStyles) + row.Cells(0).Value = strLocation + row.Cells(1).Value = clsRParam.clsArgumentCodeStructure.Clone.ToScript + + ' Tag and add the tab_style() parameter function contents as a row + row.Tag = clsRParam + dataGridStyles.Rows.Add(row) + Next + End Sub + + Private Sub btnEnterStyle_Click(sender As Object, e As EventArgs) Handles btnEnterStyle.Click + + Dim clsListStyleRFunction As RFunction = clsTablesUtils.ShowStyleSubDialog(Me.ParentForm) + If clsListStyleRFunction Is Nothing Then + Exit Sub + End If + + Dim clsLocationsRFunction As New RFunction + clsLocationsRFunction.SetPackageName("gt") + + If cboLocation.Text = "Foot Notes" Then + clsLocationsRFunction.SetRCommand("cells_footnotes") + + ElseIf cboLocation.Text = "Souce Notes" Then + clsLocationsRFunction.SetRCommand("cells_source_notes") + Else + Exit Sub + End If + + Dim clsTabStyleRFunction As RFunction = clsTablesUtils.GetNewStyleRFunction(clsListStyleRFunction, clsLocationsRFunction) + + ' Create parameter with unique name + Dim clsRParam As New RParameter(strParameterName:="tab_style_others_param" & (dataGridStyles.Rows.Count + 1), strParamValue:=clsTabStyleRFunction, bNewIncludeArgumentName:=False) + Dim row As DataGridViewRow = Nothing + + ' Update location style if it exists + For Each existingRow As DataGridViewRow In dataGridStyles.Rows + If existingRow.Cells(0).Value = cboLocation.Text Then + row = existingRow + row.Cells(1).Value = clsTabStyleRFunction.Clone.ToScript + row.Tag = clsRParam + Exit For + End If + Next + + ' If it does not exist then add new column label + If row Is Nothing Then + row = New DataGridViewRow + row.CreateCells(dataGridStyles) + row.Cells(0).Value = cboLocation.Text + row.Cells(1).Value = clsTabStyleRFunction.Clone.ToScript + row.Tag = clsRParam + dataGridStyles.Rows.Add(row) + End If + End Sub + + Private Sub btnClearStyle_Click(sender As Object, e As EventArgs) Handles btnClearStyles.Click + dataGridStyles.Rows.Clear() + End Sub + + Public Sub SetValuesToOperator() + clsTablesUtils.RemoveRParams(clsTablesUtils.FindRFunctionsParamsWithRParamValue({"tab_style"}, "locations", "cells_footnotes", clsOperator), clsOperator) + clsTablesUtils.RemoveRParams(clsTablesUtils.FindRFunctionsParamsWithRParamValue({"tab_style"}, "locations", "cells_source_notes", clsOperator), clsOperator) + clsTablesUtils.AddGridRowTagsRParamsToROperator(dataGridStyles, clsOperator) + End Sub +End Class diff --git a/instat/UserTables/Rows/ucrRowExpression.Designer.vb b/instat/UserTables/Rows/ucrRowExpression.Designer.vb new file mode 100644 index 00000000000..b071abd1f57 --- /dev/null +++ b/instat/UserTables/Rows/ucrRowExpression.Designer.vb @@ -0,0 +1,52 @@ + _ +Partial Class ucrRowExpression + Inherits System.Windows.Forms.UserControl + + 'UserControl overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.ucrInputExpression = New instat.ucrInputTextBox() + Me.SuspendLayout() + ' + 'ucrInputExpression + ' + Me.ucrInputExpression.AddQuotesIfUnrecognised = True + Me.ucrInputExpression.AutoSize = True + Me.ucrInputExpression.Dock = System.Windows.Forms.DockStyle.Fill + Me.ucrInputExpression.IsMultiline = False + Me.ucrInputExpression.IsReadOnly = False + Me.ucrInputExpression.Location = New System.Drawing.Point(0, 0) + Me.ucrInputExpression.Name = "ucrInputExpression" + Me.ucrInputExpression.Size = New System.Drawing.Size(146, 21) + Me.ucrInputExpression.TabIndex = 340 + ' + 'ucrRowExpression + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.ucrInputExpression) + Me.Name = "ucrRowExpression" + Me.Size = New System.Drawing.Size(146, 21) + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents ucrInputExpression As ucrInputTextBox +End Class diff --git a/instat/UserTables/Rows/ucrRowExpression.resx b/instat/UserTables/Rows/ucrRowExpression.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/instat/UserTables/Rows/ucrRowExpression.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/instat/UserTables/Rows/ucrRowExpression.vb b/instat/UserTables/Rows/ucrRowExpression.vb new file mode 100644 index 00000000000..8965ad550fb --- /dev/null +++ b/instat/UserTables/Rows/ucrRowExpression.vb @@ -0,0 +1,61 @@ +Public Class ucrRowExpression + + Public Event ControlContentsChanged(ucrChangedControl As ucrCore) + Private strDataFrameName As String + Private bFirstload As Boolean = True + + Private Sub UcrInputRowExpression_Load(sender As Object, e As EventArgs) Handles MyBase.Load + If bFirstload Then + InitialiseControl() + bFirstload = False + End If + End Sub + + Private Sub InitialiseControl() + Dim btnOptions As New Button + 'add the button to the comment textbox first + ucrInputExpression.txtInput.Controls.Clear() + ucrInputExpression.txtInput.Controls.Add(btnOptions) + + 'then set the button properties + btnOptions.Text = ":::" 'temp. This will be shown as centered ... An image as below commended code is preferred + 'btn.Image = Image.FromFile("C:\patowhiz\3dots.png") + btnOptions.Size = New Size(25, ucrInputExpression.txtInput.ClientSize.Height + 2) + btnOptions.TextAlign = ContentAlignment.TopCenter + btnOptions.FlatStyle = FlatStyle.Standard + btnOptions.FlatAppearance.BorderSize = 0 + btnOptions.Cursor = Cursors.Default + btnOptions.Dock = DockStyle.Right + 'btnOptions.BackColor = Parent.BackColor + btnOptions.UseVisualStyleBackColor = True + + 'set the btn event handler + AddHandler btnOptions.Click, Sub() + sdgTableRowExpression.Setup(strDataFrameName) + sdgTableRowExpression.ShowDialog(Me.ParentForm) + If sdgTableRowExpression.bUserClickedReturn Then + ucrInputExpression.SetName(sdgTableRowExpression.GetUserInputRowExpression()) + End If + End Sub + End Sub + + Public Sub Setup(strDataFrameName As String) + Me.strDataFrameName = strDataFrameName + End Sub + + Public Function IsEmpty() As Boolean + Return ucrInputExpression.IsEmpty() + End Function + + Public Function GetText() As String + Return ucrInputExpression.GetText() + End Function + + Public Sub Clear() + ucrInputExpression.SetName("") + End Sub + + Private Sub ucrInputExpression_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrInputExpression.ControlContentsChanged + RaiseEvent ControlContentsChanged(ucrChangedControl) + End Sub +End Class diff --git a/instat/UserTables/Rows/ucrRowGroup.Designer.vb b/instat/UserTables/Rows/ucrRowGroup.Designer.vb new file mode 100644 index 00000000000..187eb8e2181 --- /dev/null +++ b/instat/UserTables/Rows/ucrRowGroup.Designer.vb @@ -0,0 +1,212 @@ + +Partial Class ucrRowGroup + Inherits System.Windows.Forms.UserControl + + 'UserControl overrides dispose to clean up the component list. + + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + + Private Sub InitializeComponent() + Me.dataGridGroups = New System.Windows.Forms.DataGridView() + Me.btnClearGroups = New System.Windows.Forms.Button() + Me.btnAddCondition = New System.Windows.Forms.Button() + Me.lblGroups = New System.Windows.Forms.Label() + Me.lblCondition = New System.Windows.Forms.Label() + Me.ucrInputGroupLabel = New instat.ucrInputTextBox() + Me.btnStyle = New System.Windows.Forms.Button() + Me.ucrRowExpression = New instat.ucrRowExpression() + Me.lblGroupExpression = New System.Windows.Forms.Label() + Me.colId = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.colLabel = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.colCodnition = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.colStyleExpression = New System.Windows.Forms.DataGridViewTextBoxColumn() + CType(Me.dataGridGroups, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'dataGridGroups + ' + Me.dataGridGroups.AllowUserToAddRows = False + Me.dataGridGroups.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.dataGridGroups.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.colId, Me.colLabel, Me.colCodnition, Me.colStyleExpression}) + Me.dataGridGroups.Location = New System.Drawing.Point(12, 249) + Me.dataGridGroups.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.dataGridGroups.Name = "dataGridGroups" + Me.dataGridGroups.ReadOnly = True + Me.dataGridGroups.RowHeadersWidth = 62 + Me.dataGridGroups.Size = New System.Drawing.Size(484, 146) + Me.dataGridGroups.TabIndex = 11 + ' + 'btnClearGroups + ' + Me.btnClearGroups.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.btnClearGroups.Location = New System.Drawing.Point(368, 204) + Me.btnClearGroups.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.btnClearGroups.Name = "btnClearGroups" + Me.btnClearGroups.Size = New System.Drawing.Size(118, 35) + Me.btnClearGroups.TabIndex = 30 + Me.btnClearGroups.Tag = "" + Me.btnClearGroups.Text = "Clear" + Me.btnClearGroups.UseVisualStyleBackColor = True + ' + 'btnAddCondition + ' + Me.btnAddCondition.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.btnAddCondition.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.btnAddCondition.Location = New System.Drawing.Point(13, 170) + Me.btnAddCondition.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.btnAddCondition.Name = "btnAddCondition" + Me.btnAddCondition.Size = New System.Drawing.Size(144, 35) + Me.btnAddCondition.TabIndex = 25 + Me.btnAddCondition.Tag = "" + Me.btnAddCondition.Text = "Add" + Me.btnAddCondition.UseVisualStyleBackColor = True + ' + 'lblGroups + ' + Me.lblGroups.AutoSize = True + Me.lblGroups.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblGroups.Location = New System.Drawing.Point(7, 220) + Me.lblGroups.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblGroups.Name = "lblGroups" + Me.lblGroups.Size = New System.Drawing.Size(66, 20) + Me.lblGroups.TabIndex = 32 + Me.lblGroups.Text = "Groups:" + ' + 'lblCondition + ' + Me.lblCondition.AutoSize = True + Me.lblCondition.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblCondition.Location = New System.Drawing.Point(9, 8) + Me.lblCondition.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblCondition.Name = "lblCondition" + Me.lblCondition.Size = New System.Drawing.Size(101, 20) + Me.lblCondition.TabIndex = 282 + Me.lblCondition.Text = "Group Label:" + ' + 'ucrInputGroupLabel + ' + Me.ucrInputGroupLabel.AddQuotesIfUnrecognised = True + Me.ucrInputGroupLabel.AutoSize = True + Me.ucrInputGroupLabel.IsMultiline = False + Me.ucrInputGroupLabel.IsReadOnly = False + Me.ucrInputGroupLabel.Location = New System.Drawing.Point(8, 34) + Me.ucrInputGroupLabel.Margin = New System.Windows.Forms.Padding(14) + Me.ucrInputGroupLabel.Name = "ucrInputGroupLabel" + Me.ucrInputGroupLabel.Size = New System.Drawing.Size(180, 32) + Me.ucrInputGroupLabel.TabIndex = 308 + ' + 'btnStyle + ' + Me.btnStyle.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.btnStyle.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.btnStyle.Location = New System.Drawing.Point(210, 101) + Me.btnStyle.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.btnStyle.Name = "btnStyle" + Me.btnStyle.Size = New System.Drawing.Size(74, 35) + Me.btnStyle.TabIndex = 309 + Me.btnStyle.Tag = "" + Me.btnStyle.Text = "Style" + Me.btnStyle.UseVisualStyleBackColor = True + ' + 'ucrRowExpression + ' + Me.ucrRowExpression.Location = New System.Drawing.Point(13, 108) + Me.ucrRowExpression.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) + Me.ucrRowExpression.Name = "ucrRowExpression" + Me.ucrRowExpression.Size = New System.Drawing.Size(186, 38) + Me.ucrRowExpression.TabIndex = 333 + ' + 'lblGroupExpression + ' + Me.lblGroupExpression.AutoSize = True + Me.lblGroupExpression.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblGroupExpression.Location = New System.Drawing.Point(9, 80) + Me.lblGroupExpression.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblGroupExpression.Name = "lblGroupExpression" + Me.lblGroupExpression.Size = New System.Drawing.Size(129, 20) + Me.lblGroupExpression.TabIndex = 334 + Me.lblGroupExpression.Text = "Group Condition:" + ' + 'colId + ' + Me.colId.HeaderText = "Id" + Me.colId.MinimumWidth = 8 + Me.colId.Name = "colId" + Me.colId.ReadOnly = True + Me.colId.Width = 70 + ' + 'colLabel + ' + Me.colLabel.HeaderText = "Label" + Me.colLabel.MinimumWidth = 8 + Me.colLabel.Name = "colLabel" + Me.colLabel.ReadOnly = True + Me.colLabel.Width = 70 + ' + 'colCodnition + ' + Me.colCodnition.HeaderText = "Condition" + Me.colCodnition.MinimumWidth = 8 + Me.colCodnition.Name = "colCodnition" + Me.colCodnition.ReadOnly = True + Me.colCodnition.Width = 90 + ' + 'colStyleExpression + ' + Me.colStyleExpression.HeaderText = "Style Expression" + Me.colStyleExpression.MinimumWidth = 8 + Me.colStyleExpression.Name = "colStyleExpression" + Me.colStyleExpression.ReadOnly = True + Me.colStyleExpression.Width = 90 + ' + 'ucrRowGroup + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(9.0!, 20.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.lblGroupExpression) + Me.Controls.Add(Me.ucrRowExpression) + Me.Controls.Add(Me.btnStyle) + Me.Controls.Add(Me.ucrInputGroupLabel) + Me.Controls.Add(Me.lblCondition) + Me.Controls.Add(Me.lblGroups) + Me.Controls.Add(Me.btnClearGroups) + Me.Controls.Add(Me.btnAddCondition) + Me.Controls.Add(Me.dataGridGroups) + Me.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.Name = "ucrRowGroup" + Me.Size = New System.Drawing.Size(507, 403) + CType(Me.dataGridGroups, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents dataGridGroups As DataGridView + Friend WithEvents btnClearGroups As Button + Friend WithEvents btnAddCondition As Button + Friend WithEvents lblGroups As Label + Friend WithEvents lblCondition As Label + Friend WithEvents ucrInputGroupLabel As ucrInputTextBox + Friend WithEvents btnStyle As Button + Friend WithEvents ucrRowExpression As ucrRowExpression + Friend WithEvents lblGroupExpression As Label + Friend WithEvents colId As DataGridViewTextBoxColumn + Friend WithEvents colLabel As DataGridViewTextBoxColumn + Friend WithEvents colCodnition As DataGridViewTextBoxColumn + Friend WithEvents colStyleExpression As DataGridViewTextBoxColumn +End Class diff --git a/instat/UserTables/Rows/ucrRowGroup.resx b/instat/UserTables/Rows/ucrRowGroup.resx new file mode 100644 index 00000000000..7703172b4e8 --- /dev/null +++ b/instat/UserTables/Rows/ucrRowGroup.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + True + + + True + + + True + + \ No newline at end of file diff --git a/instat/UserTables/Rows/ucrRowGroup.vb b/instat/UserTables/Rows/ucrRowGroup.vb new file mode 100644 index 00000000000..9bded35fffa --- /dev/null +++ b/instat/UserTables/Rows/ucrRowGroup.vb @@ -0,0 +1,142 @@ +Public Class ucrRowGroup + + Private bFirstLoad As Boolean = True + Private clsOperator As New ROperator + + Private Sub ucrRowGroup_Load(sender As Object, e As EventArgs) Handles MyBase.Load + If bFirstLoad Then + InitialiseDialog() + bFirstLoad = False + End If + End Sub + + Private Sub InitialiseDialog() + btnStyle.Tag = Nothing + End Sub + + Public Sub Setup(strDataFrameName As String, clsOperator As ROperator) + Me.clsOperator = clsOperator + + ucrRowExpression.Setup(strDataFrameName) + dataGridGroups.Rows.Clear() + + ' Note, the sequence of these 2 functions matters + SetupTabRowGroupInDataGrid(clsTablesUtils.FindRFunctionsParamsWithRCommand({"tab_row_group"}, clsOperator)) + SetupTabRowGroupStylesInDataGrid(clsTablesUtils.FindRFunctionsParamsWithRParamValue({"tab_style"}, "locations", "cells_row_groups", clsOperator)) + End Sub + + Private Sub SetupTabRowGroupInDataGrid(lstRParams As List(Of RParameter)) + For Each clsRParam As RParameter In lstRParams + Dim clsTabRowGroupRFunction As RFunction = clsRParam.clsArgumentCodeStructure + Dim row As New DataGridViewRow + row.CreateCells(dataGridGroups) + For Each clsTabRowGroupRParam As RParameter In clsTabRowGroupRFunction.clsParameters + If clsTabRowGroupRParam.strArgumentName = "id" Then + row.Cells(0).Value = clsTablesUtils.GetStringValue(clsTabRowGroupRParam.strArgumentValue, False) + ElseIf clsTabRowGroupRParam.strArgumentName = "label" Then + row.Cells(1).Value = clsTablesUtils.GetStringValue(clsTabRowGroupRParam.strArgumentValue, False) + ElseIf clsTabRowGroupRParam.strArgumentName = "rows" Then + row.Cells(2).Value = clsTablesUtils.GetStringValue(clsTabRowGroupRParam.strArgumentValue, False) + End If + Next + Dim arrParams(2) As RParameter + arrParams(0) = clsRParam + row.Tag = arrParams + dataGridGroups.Rows.Add(row) + Next + End Sub + + Private Sub SetupTabRowGroupStylesInDataGrid(lstRParams As List(Of RParameter)) + For Each clsRParam As RParameter In lstRParams + Dim clsTabStyleRFunction As RFunction = clsRParam.clsArgumentCodeStructure + ' Get spanner Id + Dim strArgumentValueSpannerId As String = clsTabStyleRFunction.GetParameter("locations").clsArgumentCodeStructure.GetParameter("groups").strArgumentValue + For index As Integer = 0 To dataGridGroups.Rows.Count - 1 + Dim row As DataGridViewRow = dataGridGroups.Rows(index) + Dim lstParams() As RParameter = row.Tag + If strArgumentValueSpannerId = lstParams(0).clsArgumentCodeStructure.GetParameter("id").strArgumentValue Then + row.Cells(2).Value = clsTabStyleRFunction.Clone().ToScript + lstParams(1) = clsRParam + row.Tag = lstParams + Exit For + End If + Next + Next + End Sub + + Private Sub btnStyle_Click(sender As Object, e As EventArgs) Handles btnStyle.Click + Dim clsListStyleRFunction As RFunction = clsTablesUtils.ShowStyleSubDialog(Me.ParentForm) + If clsListStyleRFunction Is Nothing Then + Exit Sub + End If + btnStyle.Tag = clsListStyleRFunction + End Sub + + Private Sub btnAddCondition_Click(sender As Object, e As EventArgs) Handles btnAddCondition.Click + Dim strGroupId As String = ucrInputGroupLabel.GetText().Replace(" ", String.Empty) + Dim strGroupStyleExpression As String = "" + + Dim clsTabRowGroupRFunction As New RFunction + clsTabRowGroupRFunction.SetPackageName("gt") + clsTabRowGroupRFunction.SetRCommand("tab_row_group") + clsTabRowGroupRFunction.AddParameter(New RParameter(strParameterName:="label", strParamValue:=clsTablesUtils.GetStringValue(ucrInputGroupLabel.GetText(), True), iNewPosition:=0)) + clsTabRowGroupRFunction.AddParameter(New RParameter(strParameterName:="rows", strParamValue:=ucrRowExpression.GetText(), iNewPosition:=1)) + clsTabRowGroupRFunction.AddParameter(New RParameter(strParameterName:="id", strParamValue:=clsTablesUtils.GetStringValue(strGroupId, True), iNewPosition:=2)) + + Dim arrParams(2) As RParameter + + ' Add add the group parameter as the first element + arrParams(0) = New RParameter(strParameterName:="tab_row_group_param" & (dataGridGroups.Rows.Count + 1), strParamValue:=clsTabRowGroupRFunction, bNewIncludeArgumentName:=False) + + ' Add the group style as the second element + If btnStyle.Tag IsNot Nothing Then + Dim clsLocationsRFunction As New RFunction + clsLocationsRFunction.SetPackageName("gt") + clsLocationsRFunction.SetRCommand("cells_row_groups") + clsLocationsRFunction.AddParameter(New RParameter(strParameterName:="groups", strParamValue:=clsTablesUtils.GetStringValue(strGroupId, True), iNewPosition:=0)) + + Dim clsListStyleRFunction As RFunction = btnStyle.Tag + Dim clsTabStyleRFunction As RFunction = clsTablesUtils.GetNewStyleRFunction(clsListStyleRFunction, clsLocationsRFunction) + + strGroupStyleExpression = clsTabStyleRFunction.Clone.ToScript + + arrParams(1) = New RParameter(strParameterName:="tab_style_cells_row_groups_param" & (dataGridGroups.Rows.Count + 1), strParamValue:=clsTabStyleRFunction, bNewIncludeArgumentName:=False) + End If + + Dim row As New DataGridViewRow + row.CreateCells(dataGridGroups) + row.Cells(0).Value = strGroupId + row.Cells(1).Value = ucrInputGroupLabel.GetText() + row.Cells(2).Value = ucrRowExpression.GetText() + row.Cells(3).Value = strGroupStyleExpression + ' Tag the array of parameters + row.Tag = arrParams + dataGridGroups.Rows.Add(row) + + ucrInputGroupLabel.SetName("") + ucrRowExpression.Clear() + btnStyle.Tag = Nothing + End Sub + + Private Sub conditionValue_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrRowExpression.ControlContentsChanged, ucrInputGroupLabel.ControlContentsChanged + btnAddCondition.Enabled = Not ucrRowExpression.IsEmpty AndAlso Not ucrInputGroupLabel.IsEmpty + btnStyle.Enabled = btnAddCondition.Enabled + End Sub + + Private Sub btnClearGroups_Click(sender As Object, e As EventArgs) Handles btnClearGroups.Click + dataGridGroups.Rows.Clear() + End Sub + + Public Sub SetValuesToOperator() + clsTablesUtils.RemoveRParams(clsTablesUtils.FindRFunctionsParamsWithRCommand({"tab_row_group"}, clsOperator), clsOperator) + clsTablesUtils.RemoveRParams(clsTablesUtils.FindRFunctionsParamsWithRParamValue({"tab_style"}, "locations", "cells_row_groups", clsOperator), clsOperator) + + For index As Integer = 0 To dataGridGroups.Rows.Count - 1 + Dim lstParams() As RParameter = dataGridGroups.Rows(index).Tag + clsOperator.AddParameter(lstParams(0)) + If lstParams(1) IsNot Nothing Then + clsOperator.AddParameter(lstParams(1)) + End If + Next + End Sub +End Class diff --git a/instat/UserTables/Rows/ucrRowSummary.Designer.vb b/instat/UserTables/Rows/ucrRowSummary.Designer.vb new file mode 100644 index 00000000000..7ef44d485d4 --- /dev/null +++ b/instat/UserTables/Rows/ucrRowSummary.Designer.vb @@ -0,0 +1,344 @@ + _ +Partial Class ucrRowSummary + Inherits System.Windows.Forms.UserControl + + 'UserControl overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.dataGridSummaries = New System.Windows.Forms.DataGridView() + Me.btnStyle = New System.Windows.Forms.Button() + Me.lblSummaryTypes = New System.Windows.Forms.Label() + Me.lblSummaries = New System.Windows.Forms.Label() + Me.btnClearSummaries = New System.Windows.Forms.Button() + Me.btnAddSummaries = New System.Windows.Forms.Button() + Me.lblSummaryLabel = New System.Windows.Forms.Label() + Me.lblReplaceWith = New System.Windows.Forms.Label() + Me.btnFormat = New System.Windows.Forms.Button() + Me.lblColumns = New System.Windows.Forms.Label() + Me.lblGroupId = New System.Windows.Forms.Label() + Me.lblSide = New System.Windows.Forms.Label() + Me.ucrCboSide = New instat.ucrInputComboBox() + Me.ucrTxtGroupId = New instat.ucrInputTextBox() + Me.ucrReceiverMultipleCols = New instat.ucrReceiverMultiple() + Me.ucrSelectorCols = New instat.ucrSelectorByDataFrameAddRemove() + Me.ucrTxtReplaceNa = New instat.ucrInputTextBox() + Me.ucrCboSummaryType = New instat.ucrInputComboBox() + Me.ucrTxtSummaryLabel = New instat.ucrInputTextBox() + Me.colType = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.colExpression = New System.Windows.Forms.DataGridViewTextBoxColumn() + CType(Me.dataGridSummaries, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'dataGridSummaries + ' + Me.dataGridSummaries.AllowUserToAddRows = False + Me.dataGridSummaries.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.dataGridSummaries.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.colType, Me.colExpression}) + Me.dataGridSummaries.Location = New System.Drawing.Point(360, 451) + Me.dataGridSummaries.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.dataGridSummaries.Name = "dataGridSummaries" + Me.dataGridSummaries.ReadOnly = True + Me.dataGridSummaries.RowHeadersWidth = 62 + Me.dataGridSummaries.Size = New System.Drawing.Size(522, 120) + Me.dataGridSummaries.TabIndex = 335 + ' + 'btnStyle + ' + Me.btnStyle.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.btnStyle.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.btnStyle.Location = New System.Drawing.Point(740, 303) + Me.btnStyle.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.btnStyle.Name = "btnStyle" + Me.btnStyle.Size = New System.Drawing.Size(126, 35) + Me.btnStyle.TabIndex = 341 + Me.btnStyle.Tag = "" + Me.btnStyle.Text = "Style" + Me.btnStyle.UseVisualStyleBackColor = True + ' + 'lblSummaryTypes + ' + Me.lblSummaryTypes.AutoSize = True + Me.lblSummaryTypes.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblSummaryTypes.Location = New System.Drawing.Point(356, 144) + Me.lblSummaryTypes.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblSummaryTypes.Name = "lblSummaryTypes" + Me.lblSummaryTypes.Size = New System.Drawing.Size(118, 20) + Me.lblSummaryTypes.TabIndex = 339 + Me.lblSummaryTypes.Text = "Summary Type:" + ' + 'lblSummaries + ' + Me.lblSummaries.AutoSize = True + Me.lblSummaries.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblSummaries.Location = New System.Drawing.Point(362, 426) + Me.lblSummaries.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblSummaries.Name = "lblSummaries" + Me.lblSummaries.Size = New System.Drawing.Size(93, 20) + Me.lblSummaries.TabIndex = 338 + Me.lblSummaries.Text = "Summaries:" + ' + 'btnClearSummaries + ' + Me.btnClearSummaries.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.btnClearSummaries.Location = New System.Drawing.Point(758, 410) + Me.btnClearSummaries.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.btnClearSummaries.Name = "btnClearSummaries" + Me.btnClearSummaries.Size = New System.Drawing.Size(118, 35) + Me.btnClearSummaries.TabIndex = 337 + Me.btnClearSummaries.Tag = "" + Me.btnClearSummaries.Text = "Clear" + Me.btnClearSummaries.UseVisualStyleBackColor = True + ' + 'btnAddSummaries + ' + Me.btnAddSummaries.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.btnAddSummaries.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.btnAddSummaries.Location = New System.Drawing.Point(359, 373) + Me.btnAddSummaries.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.btnAddSummaries.Name = "btnAddSummaries" + Me.btnAddSummaries.Size = New System.Drawing.Size(144, 35) + Me.btnAddSummaries.TabIndex = 336 + Me.btnAddSummaries.Tag = "" + Me.btnAddSummaries.Text = "Add" + Me.btnAddSummaries.UseVisualStyleBackColor = True + ' + 'lblSummaryLabel + ' + Me.lblSummaryLabel.AutoSize = True + Me.lblSummaryLabel.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblSummaryLabel.Location = New System.Drawing.Point(355, 286) + Me.lblSummaryLabel.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblSummaryLabel.Name = "lblSummaryLabel" + Me.lblSummaryLabel.Size = New System.Drawing.Size(196, 20) + Me.lblSummaryLabel.TabIndex = 342 + Me.lblSummaryLabel.Text = "Summary Label (Optional):" + ' + 'lblReplaceWith + ' + Me.lblReplaceWith.AutoSize = True + Me.lblReplaceWith.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblReplaceWith.Location = New System.Drawing.Point(590, 144) + Me.lblReplaceWith.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblReplaceWith.Name = "lblReplaceWith" + Me.lblReplaceWith.Size = New System.Drawing.Size(203, 20) + Me.lblReplaceWith.TabIndex = 346 + Me.lblReplaceWith.Text = "Replace NA with (Optional):" + ' + 'btnFormat + ' + Me.btnFormat.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.btnFormat.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.btnFormat.Location = New System.Drawing.Point(594, 304) + Me.btnFormat.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.btnFormat.Name = "btnFormat" + Me.btnFormat.Size = New System.Drawing.Size(136, 35) + Me.btnFormat.TabIndex = 348 + Me.btnFormat.Tag = "" + Me.btnFormat.Text = "Format" + Me.btnFormat.UseVisualStyleBackColor = True + ' + 'lblColumns + ' + Me.lblColumns.AutoSize = True + Me.lblColumns.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblColumns.Location = New System.Drawing.Point(362, 13) + Me.lblColumns.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblColumns.Name = "lblColumns" + Me.lblColumns.Size = New System.Drawing.Size(85, 20) + Me.lblColumns.TabIndex = 350 + Me.lblColumns.Text = "Column(s):" + ' + 'lblGroupId + ' + Me.lblGroupId.AutoSize = True + Me.lblGroupId.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblGroupId.Location = New System.Drawing.Point(590, 216) + Me.lblGroupId.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblGroupId.Name = "lblGroupId" + Me.lblGroupId.Size = New System.Drawing.Size(152, 20) + Me.lblGroupId.TabIndex = 352 + Me.lblGroupId.Text = "Group ID (Optional):" + ' + 'lblSide + ' + Me.lblSide.AutoSize = True + Me.lblSide.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblSide.Location = New System.Drawing.Point(361, 216) + Me.lblSide.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblSide.Name = "lblSide" + Me.lblSide.Size = New System.Drawing.Size(45, 20) + Me.lblSide.TabIndex = 354 + Me.lblSide.Text = "Side:" + ' + 'ucrCboSide + ' + Me.ucrCboSide.AddQuotesIfUnrecognised = True + Me.ucrCboSide.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboSide.GetSetSelectedIndex = -1 + Me.ucrCboSide.IsReadOnly = False + Me.ucrCboSide.Location = New System.Drawing.Point(359, 237) + Me.ucrCboSide.Margin = New System.Windows.Forms.Padding(9, 9, 9, 9) + Me.ucrCboSide.Name = "ucrCboSide" + Me.ucrCboSide.Size = New System.Drawing.Size(176, 40) + Me.ucrCboSide.TabIndex = 355 + ' + 'ucrTxtGroupId + ' + Me.ucrTxtGroupId.AddQuotesIfUnrecognised = True + Me.ucrTxtGroupId.AutoSize = True + Me.ucrTxtGroupId.IsMultiline = False + Me.ucrTxtGroupId.IsReadOnly = False + Me.ucrTxtGroupId.Location = New System.Drawing.Point(594, 240) + Me.ucrTxtGroupId.Margin = New System.Windows.Forms.Padding(14) + Me.ucrTxtGroupId.Name = "ucrTxtGroupId" + Me.ucrTxtGroupId.Size = New System.Drawing.Size(180, 32) + Me.ucrTxtGroupId.TabIndex = 353 + ' + 'ucrReceiverMultipleCols + ' + Me.ucrReceiverMultipleCols.AutoSize = True + Me.ucrReceiverMultipleCols.frmParent = Nothing + Me.ucrReceiverMultipleCols.Location = New System.Drawing.Point(359, 38) + Me.ucrReceiverMultipleCols.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverMultipleCols.Name = "ucrReceiverMultipleCols" + Me.ucrReceiverMultipleCols.Selector = Nothing + Me.ucrReceiverMultipleCols.Size = New System.Drawing.Size(198, 85) + Me.ucrReceiverMultipleCols.strNcFilePath = "" + Me.ucrReceiverMultipleCols.TabIndex = 351 + Me.ucrReceiverMultipleCols.ucrSelector = Nothing + ' + 'ucrSelectorCols + ' + Me.ucrSelectorCols.AutoSize = True + Me.ucrSelectorCols.bDropUnusedFilterLevels = False + Me.ucrSelectorCols.bShowHiddenColumns = False + Me.ucrSelectorCols.bUseCurrentFilter = True + Me.ucrSelectorCols.Location = New System.Drawing.Point(9, 7) + Me.ucrSelectorCols.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectorCols.Name = "ucrSelectorCols" + Me.ucrSelectorCols.Size = New System.Drawing.Size(320, 282) + Me.ucrSelectorCols.TabIndex = 349 + ' + 'ucrTxtReplaceNa + ' + Me.ucrTxtReplaceNa.AddQuotesIfUnrecognised = True + Me.ucrTxtReplaceNa.AutoSize = True + Me.ucrTxtReplaceNa.IsMultiline = False + Me.ucrTxtReplaceNa.IsReadOnly = False + Me.ucrTxtReplaceNa.Location = New System.Drawing.Point(594, 166) + Me.ucrTxtReplaceNa.Margin = New System.Windows.Forms.Padding(14) + Me.ucrTxtReplaceNa.Name = "ucrTxtReplaceNa" + Me.ucrTxtReplaceNa.Size = New System.Drawing.Size(180, 32) + Me.ucrTxtReplaceNa.TabIndex = 347 + ' + 'ucrCboSummaryType + ' + Me.ucrCboSummaryType.AddQuotesIfUnrecognised = True + Me.ucrCboSummaryType.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboSummaryType.GetSetSelectedIndex = -1 + Me.ucrCboSummaryType.IsReadOnly = False + Me.ucrCboSummaryType.Location = New System.Drawing.Point(359, 167) + Me.ucrCboSummaryType.Margin = New System.Windows.Forms.Padding(9, 9, 9, 9) + Me.ucrCboSummaryType.Name = "ucrCboSummaryType" + Me.ucrCboSummaryType.Size = New System.Drawing.Size(176, 40) + Me.ucrCboSummaryType.TabIndex = 345 + ' + 'ucrTxtSummaryLabel + ' + Me.ucrTxtSummaryLabel.AddQuotesIfUnrecognised = True + Me.ucrTxtSummaryLabel.AutoSize = True + Me.ucrTxtSummaryLabel.IsMultiline = False + Me.ucrTxtSummaryLabel.IsReadOnly = False + Me.ucrTxtSummaryLabel.Location = New System.Drawing.Point(360, 312) + Me.ucrTxtSummaryLabel.Margin = New System.Windows.Forms.Padding(14) + Me.ucrTxtSummaryLabel.Name = "ucrTxtSummaryLabel" + Me.ucrTxtSummaryLabel.Size = New System.Drawing.Size(180, 32) + Me.ucrTxtSummaryLabel.TabIndex = 343 + ' + 'colType + ' + Me.colType.HeaderText = "Summary Expression" + Me.colType.MinimumWidth = 8 + Me.colType.Name = "colType" + Me.colType.ReadOnly = True + Me.colType.Width = 150 + ' + 'colExpression + ' + Me.colExpression.HeaderText = "Style Expression" + Me.colExpression.MinimumWidth = 8 + Me.colExpression.Name = "colExpression" + Me.colExpression.ReadOnly = True + Me.colExpression.Width = 150 + ' + 'ucrRowSummary + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(9.0!, 20.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.ucrCboSide) + Me.Controls.Add(Me.lblSide) + Me.Controls.Add(Me.ucrTxtGroupId) + Me.Controls.Add(Me.lblGroupId) + Me.Controls.Add(Me.ucrReceiverMultipleCols) + Me.Controls.Add(Me.lblColumns) + Me.Controls.Add(Me.ucrSelectorCols) + Me.Controls.Add(Me.btnFormat) + Me.Controls.Add(Me.ucrTxtReplaceNa) + Me.Controls.Add(Me.lblReplaceWith) + Me.Controls.Add(Me.ucrCboSummaryType) + Me.Controls.Add(Me.ucrTxtSummaryLabel) + Me.Controls.Add(Me.lblSummaryLabel) + Me.Controls.Add(Me.dataGridSummaries) + Me.Controls.Add(Me.btnStyle) + Me.Controls.Add(Me.lblSummaryTypes) + Me.Controls.Add(Me.lblSummaries) + Me.Controls.Add(Me.btnClearSummaries) + Me.Controls.Add(Me.btnAddSummaries) + Me.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.Name = "ucrRowSummary" + Me.Size = New System.Drawing.Size(890, 576) + CType(Me.dataGridSummaries, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents dataGridSummaries As DataGridView + Friend WithEvents btnStyle As Button + Friend WithEvents lblSummaryTypes As Label + Friend WithEvents lblSummaries As Label + Friend WithEvents btnClearSummaries As Button + Friend WithEvents btnAddSummaries As Button + Friend WithEvents ucrTxtSummaryLabel As ucrInputTextBox + Friend WithEvents lblSummaryLabel As Label + Friend WithEvents ucrCboSummaryType As ucrInputComboBox + Friend WithEvents ucrTxtReplaceNa As ucrInputTextBox + Friend WithEvents lblReplaceWith As Label + Friend WithEvents btnFormat As Button + Friend WithEvents ucrReceiverMultipleCols As ucrReceiverMultiple + Friend WithEvents lblColumns As Label + Friend WithEvents ucrSelectorCols As ucrSelectorByDataFrameAddRemove + Friend WithEvents ucrTxtGroupId As ucrInputTextBox + Friend WithEvents lblGroupId As Label + Friend WithEvents lblSide As Label + Friend WithEvents ucrCboSide As ucrInputComboBox + Friend WithEvents colType As DataGridViewTextBoxColumn + Friend WithEvents colExpression As DataGridViewTextBoxColumn +End Class diff --git a/instat/UserTables/Rows/ucrRowSummary.resx b/instat/UserTables/Rows/ucrRowSummary.resx new file mode 100644 index 00000000000..0f42d579fc9 --- /dev/null +++ b/instat/UserTables/Rows/ucrRowSummary.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + True + + \ No newline at end of file diff --git a/instat/UserTables/Rows/ucrRowSummary.vb b/instat/UserTables/Rows/ucrRowSummary.vb new file mode 100644 index 00000000000..c34ec209a0d --- /dev/null +++ b/instat/UserTables/Rows/ucrRowSummary.vb @@ -0,0 +1,232 @@ +Public Class ucrRowSummary + + Private bFirstLoad As Boolean = True + Private clsOperator As New ROperator + Private dctSummaryTypes, dctSides As New Dictionary(Of String, String) + + Private Sub ucrRowSummary_Load(sender As Object, e As EventArgs) Handles MyBase.Load + If bFirstLoad Then + InitialiseDialog() + bFirstLoad = False + End If + End Sub + + Private Sub InitialiseDialog() + ucrReceiverMultipleCols.Selector = ucrSelectorCols + ucrReceiverMultipleCols.SetDataType("numeric", bStrict:=True) + ucrReceiverMultipleCols.SetMeAsReceiver() + + dctSummaryTypes.Add("Minimum", "min") + dctSummaryTypes.Add("Maximum", "max") + dctSummaryTypes.Add("Mean", "mean") + dctSummaryTypes.Add("Median", "median") + dctSummaryTypes.Add("Standard Deviation", "sd") + dctSummaryTypes.Add("Sum", "sum") + dctSummaryTypes.Add("Length", "length") + ucrCboSummaryType.SetItems(dctSummaryTypes, bSetConditions:=False) + ucrCboSummaryType.SetDropDownStyleAsNonEditable() + ucrCboSummaryType.GetSetSelectedIndex = 0 + + dctSides.Add("Bottom", "bottom") + dctSides.Add("Top", "top") + ucrCboSide.SetItems(dctSides, bSetConditions:=False) + ucrCboSide.SetDropDownStyleAsNonEditable() + ucrCboSide.GetSetSelectedIndex = 0 + + btnFormat.Tag = Nothing + btnStyle.Tag = Nothing + + ' TODO. Disabled due to error thrwon when using data book. See comments inside GetFnParameters() + lblSummaryLabel.Enabled = False + ucrTxtSummaryLabel.Enabled = False + + ' TODO. Disabled until R is upgraded + lblSide.Enabled = False + ucrCboSide.Enabled = False + btnFormat.Enabled = False + btnStyle.Enabled = False + End Sub + + Public Sub Setup(strDataFrameName As String, clsOperator As ROperator) + Me.clsOperator = clsOperator + + ucrSelectorCols.SetDataframe(strDataFrameName, bEnableDataframe:=False) + dataGridSummaries.Rows.Clear() + + ' Note, the sequence of these 2 functions matters + SetupSummaryRowInDataGrid(clsTablesUtils.FindRFunctionsParamsWithRCommand({"summary_rows"}, clsOperator)) + SetupSummaryRowStylesInDataGrid(clsTablesUtils.FindRFunctionsParamsWithRParamValue({"tab_style"}, "locations", "cells_summary", clsOperator)) + End Sub + + Private Sub SetupSummaryRowInDataGrid(lstRParams As List(Of RParameter)) + For Each clsRParam As RParameter In lstRParams + Dim clsTabSummaryRowRFunction As RFunction = clsRParam.clsArgumentCodeStructure + Dim row As New DataGridViewRow + row.CreateCells(dataGridSummaries) + row.Cells(0).Value = clsTabSummaryRowRFunction.Clone.ToScript + + ' TODO. In future we could get the individual parameters + + 'For Each clsTabRowGroupRParam As RParameter In clsTabSummaryRowRFunction.clsParameters + ' If clsTabRowGroupRParam.strArgumentName = "fns" Then + ' row.Cells(0).Value = clsTablesUtils.GetStringValue(clsTabRowGroupRParam.strArgumentValue, False) + ' ElseIf clsTabRowGroupRParam.strArgumentName = "fms" Then + ' row.Cells(1).Value = clsTablesUtils.GetStringValue(clsTabRowGroupRParam.strArgumentValue, False) + ' End If + 'Next + Dim arrParams(2) As RParameter + arrParams(0) = clsRParam + row.Tag = arrParams + dataGridSummaries.Rows.Add(row) + Next + End Sub + + Private Sub SetupSummaryRowStylesInDataGrid(lstRParams As List(Of RParameter)) + For Each clsRParam As RParameter In lstRParams + Dim clsTabStyleRFunction As RFunction = clsRParam.clsArgumentCodeStructure + ' Get spanner Id + Dim iRowId As Integer + If Not Integer.TryParse(clsTabStyleRFunction.GetParameter("locations").clsArgumentCodeStructure.GetParameter("row").strArgumentValue, iRowId) Then + Continue For + End If + + + For index As Integer = 0 To dataGridSummaries.Rows.Count - 1 + Dim row As DataGridViewRow = dataGridSummaries.Rows(index) + Dim lstParams() As RParameter = row.Tag + + ' As of 2024/08/07 the gt summary_rows R function doesn't have a unique identifier like row groups. + ' So just use the data gridview index to show the style expressions + If index + 1 = iRowId Then + row.Cells(1).Value = clsTabStyleRFunction.Clone().ToScript + lstParams(1) = clsRParam + row.Tag = lstParams + Exit For + End If + Next + Next + End Sub + + Private Sub btnFormat_Click(sender As Object, e As EventArgs) Handles btnFormat.Click + sdgCellFormatNumberOptions.ShowDialog(Me.ParentForm) + Dim clsFormatRFunction As RFunction = sdgCellFormatNumberOptions.GetNewUserInputAsRFunction() + + If clsFormatRFunction IsNot Nothing Then + btnFormat.Tag = clsFormatRFunction + End If + + End Sub + + Private Sub btnStyle_Click(sender As Object, e As EventArgs) Handles btnStyle.Click + Dim clsListStyleRFunction As RFunction = clsTablesUtils.ShowStyleSubDialog(Me.ParentForm) + If clsListStyleRFunction Is Nothing Then + Exit Sub + End If + + Dim clsLocationsRFunction As New RFunction + clsLocationsRFunction.SetPackageName("gt") + clsLocationsRFunction.SetRCommand("cells_summary") + + If Not ucrTxtGroupId.IsEmpty Then + clsLocationsRFunction.AddParameter(New RParameter(strParameterName:="groups", strParamValue:=Chr(34) & ucrTxtGroupId.GetText & Chr(34), iNewPosition:=0)) + End If + clsLocationsRFunction.AddParameter(New RParameter(strParameterName:="columns", strParamValue:=ucrReceiverMultipleCols.GetVariableNames(bWithQuotes:=False), iNewPosition:=1)) + clsLocationsRFunction.AddParameter(New RParameter(strParameterName:="row", strParamValue:=dataGridSummaries.Rows.Count + 1, iNewPosition:=2)) + + Dim clsTabStyleRFunction As RFunction = clsTablesUtils.GetNewStyleRFunction(clsListStyleRFunction, clsLocationsRFunction) + + btnStyle.Tag = clsTabStyleRFunction + End Sub + + Private Sub conditionValue_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverMultipleCols.ControlContentsChanged + btnAddSummaries.Enabled = Not ucrReceiverMultipleCols.IsEmpty + End Sub + + Private Sub btnAddSummaries_Click(sender As Object, e As EventArgs) Handles btnAddSummaries.Click + Dim strSpannerLabel As String = ucrTxtGroupId.GetValue() + Dim strSpannerId As String = strSpannerLabel.Replace(" ", String.Empty) + Dim strSpannerColsRFunction As String = mdlCoreControl.GetRVector(ucrReceiverMultipleCols.GetVariableNamesList(bWithQuotes:=False), bOnlyIfMultipleElement:=False) + Dim strSpannerStyleExpression As String = "" + + Dim clsSummaryRowsRFunction As New RFunction + clsSummaryRowsRFunction.SetPackageName("gt") + clsSummaryRowsRFunction.SetRCommand("summary_rows") + + + If Not ucrTxtGroupId.IsEmpty Then + clsSummaryRowsRFunction.AddParameter(New RParameter(strParameterName:="groups", strParamValue:=Chr(34) & ucrTxtGroupId.GetText & Chr(34), iNewPosition:=0)) + End If + + clsSummaryRowsRFunction.AddParameter(New RParameter(strParameterName:="fns", strParamValue:=GetFnParameters(), iNewPosition:=1)) + clsSummaryRowsRFunction.AddParameter(New RParameter(strParameterName:="columns", strParamValue:=mdlCoreControl.GetRVector(ucrReceiverMultipleCols.GetVariableNamesList(bWithQuotes:=False), bOnlyIfMultipleElement:=False), iNewPosition:=2)) + + If btnFormat.Tag IsNot Nothing Then + Dim clsFormatRFunction As RFunction = btnFormat.Tag + clsSummaryRowsRFunction.AddParameter(New RParameter(strParameterName:="fmt", strParamValue:=clsFormatRFunction, iNewPosition:=3)) + End If + + 'TODO. Commented out until R-Instat R is upgraded + 'clsSummaryRowsRFunction.AddParameter(New RParameter(strParameterName:="side", strParamValue:=Chr(34) & dctSides.Item(ucrCboSide.GetText) & Chr(34), iNewPosition:=4)) + + If Not ucrTxtReplaceNa.IsEmpty Then + clsSummaryRowsRFunction.AddParameter(New RParameter(strParameterName:="missing_text", strParamValue:=Chr(34) & ucrTxtReplaceNa.GetText & Chr(34), iNewPosition:=0)) + End If + + Dim arrParams(2) As RParameter + + ' Add add the spanner parameter as the first element + arrParams(0) = New RParameter(strParameterName:="summary_rows_param" & (dataGridSummaries.Rows.Count + 1), strParamValue:=clsSummaryRowsRFunction, bNewIncludeArgumentName:=False) + + ' Add the spanner style as the second element + If btnStyle.Tag IsNot Nothing Then + Dim clsTabStyleRFunction As RFunction = btnStyle.Tag + strSpannerStyleExpression = clsTabStyleRFunction.Clone.ToScript + arrParams(1) = New RParameter(strParameterName:="tab_style_cells_summary_param" & (dataGridSummaries.Rows.Count + 1), strParamValue:=clsTabStyleRFunction, bNewIncludeArgumentName:=False) + End If + + Dim row As New DataGridViewRow + row.CreateCells(dataGridSummaries) + row.Cells(0).Value = clsSummaryRowsRFunction.Clone.ToScript + row.Cells(1).Value = strSpannerStyleExpression + ' Tag the array of parameters + row.Tag = arrParams + dataGridSummaries.Rows.Add(row) + + ucrReceiverMultipleCols.Clear() + ucrTxtGroupId.SetName("") + ucrTxtSummaryLabel.SetName("") + btnFormat.Tag = Nothing + btnStyle.Tag = Nothing + End Sub + + Private Function GetFnParameters() As String + ' TODO. As of 08/08/2024, GT example like list(fn = "min", label = "Minimum", id = "min") throws an error when exeuted in R-Instat + ' TODO. Investigate why the error why is thrown when using the databook + + Dim strFnType As String = dctSummaryTypes.Item(ucrCboSummaryType.GetText) + Dim strFnParams As String = "id = " & Chr(34) & strFnType & Chr(34) & ", fn = " & Chr(34) & strFnType & Chr(34) + If Not ucrTxtSummaryLabel.IsEmpty Then + strFnParams = strFnParams & ", label = " & Chr(34) & ucrCboSummaryType.GetText & Chr(34) + End If + ' TODO. Commented out due to error thrown + 'Return "list(" & strFnParams & ")" + Return Chr(34) & strFnType & Chr(34) + End Function + + Private Sub btnClearSummaries_Click(sender As Object, e As EventArgs) Handles btnClearSummaries.Click + dataGridSummaries.Rows.Clear() + End Sub + + Public Sub SetValuesToOperator() + clsTablesUtils.RemoveRParams(clsTablesUtils.FindRFunctionsParamsWithRCommand({"summary_rows"}, clsOperator), clsOperator) + clsTablesUtils.RemoveRParams(clsTablesUtils.FindRFunctionsParamsWithRParamValue({"tab_style"}, "locations", "cells_summary", clsOperator), clsOperator) + + For index As Integer = 0 To dataGridSummaries.Rows.Count - 1 + Dim lstParams() As RParameter = dataGridSummaries.Rows(index).Tag + clsOperator.AddParameter(lstParams(0)) + If lstParams(1) IsNot Nothing Then + clsOperator.AddParameter(lstParams(1)) + End If + Next + End Sub +End Class diff --git a/instat/UserTables/Rows/ucrRows.Designer.vb b/instat/UserTables/Rows/ucrRows.Designer.vb new file mode 100644 index 00000000000..443747332c0 --- /dev/null +++ b/instat/UserTables/Rows/ucrRows.Designer.vb @@ -0,0 +1,119 @@ + _ +Partial Class ucrRows + Inherits System.Windows.Forms.UserControl + + 'UserControl overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.rdoRowsGroups = New System.Windows.Forms.RadioButton() + Me.rdoRowsSummaries = New System.Windows.Forms.RadioButton() + Me.ucrPnlRows = New instat.UcrPanel() + Me.ucrRowSummary = New instat.ucrRowSummary() + Me.ucrRowGroups = New instat.ucrRowGroup() + Me.SuspendLayout() + ' + 'rdoRowsGroups + ' + Me.rdoRowsGroups.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoRowsGroups.BackColor = System.Drawing.SystemColors.Control + Me.rdoRowsGroups.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None + Me.rdoRowsGroups.CheckAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoRowsGroups.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoRowsGroups.FlatAppearance.BorderSize = 2 + Me.rdoRowsGroups.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoRowsGroups.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoRowsGroups.ForeColor = System.Drawing.SystemColors.ActiveCaptionText + Me.rdoRowsGroups.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoRowsGroups.Location = New System.Drawing.Point(267, 5) + Me.rdoRowsGroups.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.rdoRowsGroups.Name = "rdoRowsGroups" + Me.rdoRowsGroups.Size = New System.Drawing.Size(136, 45) + Me.rdoRowsGroups.TabIndex = 280 + Me.rdoRowsGroups.Text = "Groups" + Me.rdoRowsGroups.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoRowsGroups.UseVisualStyleBackColor = True + ' + 'rdoRowsSummaries + ' + Me.rdoRowsSummaries.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoRowsSummaries.BackColor = System.Drawing.SystemColors.Control + Me.rdoRowsSummaries.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None + Me.rdoRowsSummaries.CheckAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoRowsSummaries.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoRowsSummaries.FlatAppearance.BorderSize = 2 + Me.rdoRowsSummaries.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoRowsSummaries.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoRowsSummaries.ForeColor = System.Drawing.SystemColors.ActiveCaptionText + Me.rdoRowsSummaries.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoRowsSummaries.Location = New System.Drawing.Point(401, 5) + Me.rdoRowsSummaries.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.rdoRowsSummaries.Name = "rdoRowsSummaries" + Me.rdoRowsSummaries.Size = New System.Drawing.Size(136, 45) + Me.rdoRowsSummaries.TabIndex = 281 + Me.rdoRowsSummaries.Text = "Summaries" + Me.rdoRowsSummaries.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoRowsSummaries.UseVisualStyleBackColor = True + ' + 'ucrPnlRows + ' + Me.ucrPnlRows.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlRows.Location = New System.Drawing.Point(24, 5) + Me.ucrPnlRows.Margin = New System.Windows.Forms.Padding(9) + Me.ucrPnlRows.Name = "ucrPnlRows" + Me.ucrPnlRows.Size = New System.Drawing.Size(821, 45) + Me.ucrPnlRows.TabIndex = 279 + ' + 'ucrRowSummary + ' + Me.ucrRowSummary.Location = New System.Drawing.Point(8, 64) + Me.ucrRowSummary.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.ucrRowSummary.Name = "ucrRowSummary" + Me.ucrRowSummary.Size = New System.Drawing.Size(900, 588) + Me.ucrRowSummary.TabIndex = 284 + ' + 'ucrRowGroups + ' + Me.ucrRowGroups.Location = New System.Drawing.Point(4, 58) + Me.ucrRowGroups.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) + Me.ucrRowGroups.Name = "ucrRowGroups" + Me.ucrRowGroups.Size = New System.Drawing.Size(575, 411) + Me.ucrRowGroups.TabIndex = 283 + ' + 'ucrRows + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(9.0!, 20.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.rdoRowsGroups) + Me.Controls.Add(Me.rdoRowsSummaries) + Me.Controls.Add(Me.ucrPnlRows) + Me.Controls.Add(Me.ucrRowGroups) + Me.Controls.Add(Me.ucrRowSummary) + Me.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.Name = "ucrRows" + Me.Size = New System.Drawing.Size(993, 667) + Me.ResumeLayout(False) + + End Sub + Friend WithEvents rdoRowsGroups As RadioButton + Friend WithEvents rdoRowsSummaries As RadioButton + Friend WithEvents ucrPnlRows As UcrPanel + Friend WithEvents ucrRowGroups As ucrRowGroup + Friend WithEvents ucrRowSummary As ucrRowSummary +End Class diff --git a/instat/UserTables/Rows/ucrRows.resx b/instat/UserTables/Rows/ucrRows.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/instat/UserTables/Rows/ucrRows.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/instat/UserTables/Rows/ucrRows.vb b/instat/UserTables/Rows/ucrRows.vb new file mode 100644 index 00000000000..52581f9623c --- /dev/null +++ b/instat/UserTables/Rows/ucrRows.vb @@ -0,0 +1,34 @@ +Public Class ucrRows + + Private bFirstload As Boolean = True + + Private Sub ucrRows_Load(sender As Object, e As EventArgs) Handles MyBase.Load + If bFirstload Then + InitialiseDialog() + bFirstload = False + End If + End Sub + + Private Sub InitialiseDialog() + ucrPnlRows.AddRadioButton(rdoRowsGroups) + ucrPnlRows.AddRadioButton(rdoRowsSummaries) + rdoRowsGroups.Checked = True + End Sub + + Public Sub Setup(strDataFrameName As String, clsOperator As ROperator) + ucrRowGroups.Setup(strDataFrameName, clsOperator) + ucrRowSummary.Setup(strDataFrameName, clsOperator) + End Sub + + Private Sub ucrPnlRows_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlRows.ControlValueChanged + ucrRowGroups.Visible = rdoRowsGroups.Checked + ucrRowSummary.Visible = rdoRowsSummaries.Checked + End Sub + + Public Sub SetValuesToOperator() + ucrRowGroups.SetValuesToOperator() + ucrRowSummary.SetValuesToOperator() + End Sub + + +End Class diff --git a/instat/UserTables/SourceNotes/ucrSourceNotes.Designer.vb b/instat/UserTables/SourceNotes/ucrSourceNotes.Designer.vb new file mode 100644 index 00000000000..6519d25a573 --- /dev/null +++ b/instat/UserTables/SourceNotes/ucrSourceNotes.Designer.vb @@ -0,0 +1,92 @@ + _ +Partial Class ucrSourceNotes + Inherits System.Windows.Forms.UserControl + + 'UserControl overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.dataGridSourceNotes = New System.Windows.Forms.DataGridView() + Me.DataGridViewTextBoxColumn1 = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.lblSourceNotes = New System.Windows.Forms.Label() + Me.btnClearNotes = New System.Windows.Forms.Button() + CType(Me.dataGridSourceNotes, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'dataGridSourceNotes + ' + Me.dataGridSourceNotes.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ + Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.dataGridSourceNotes.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.dataGridSourceNotes.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.DataGridViewTextBoxColumn1}) + Me.dataGridSourceNotes.Location = New System.Drawing.Point(3, 23) + Me.dataGridSourceNotes.Name = "dataGridSourceNotes" + Me.dataGridSourceNotes.RowHeadersWidth = 62 + Me.dataGridSourceNotes.Size = New System.Drawing.Size(464, 197) + Me.dataGridSourceNotes.TabIndex = 9 + ' + 'DataGridViewTextBoxColumn1 + ' + Me.DataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.DataGridViewTextBoxColumn1.HeaderText = "Note Text" + Me.DataGridViewTextBoxColumn1.MinimumWidth = 8 + Me.DataGridViewTextBoxColumn1.Name = "DataGridViewTextBoxColumn1" + ' + 'lblSourceNotes + ' + Me.lblSourceNotes.AutoSize = True + Me.lblSourceNotes.Location = New System.Drawing.Point(6, 7) + Me.lblSourceNotes.Name = "lblSourceNotes" + Me.lblSourceNotes.Size = New System.Drawing.Size(73, 13) + Me.lblSourceNotes.TabIndex = 8 + Me.lblSourceNotes.Text = "Source notes:" + ' + 'btnClearNotes + ' + Me.btnClearNotes.Enabled = False + Me.btnClearNotes.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.btnClearNotes.Location = New System.Drawing.Point(392, 0) + Me.btnClearNotes.Name = "btnClearNotes" + Me.btnClearNotes.Size = New System.Drawing.Size(75, 23) + Me.btnClearNotes.TabIndex = 296 + Me.btnClearNotes.Tag = "" + Me.btnClearNotes.Text = "Clear" + Me.btnClearNotes.UseVisualStyleBackColor = True + ' + 'ucrSourceNotes + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.btnClearNotes) + Me.Controls.Add(Me.dataGridSourceNotes) + Me.Controls.Add(Me.lblSourceNotes) + Me.Name = "ucrSourceNotes" + Me.Size = New System.Drawing.Size(470, 223) + CType(Me.dataGridSourceNotes, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents dataGridSourceNotes As DataGridView + Friend WithEvents lblSourceNotes As Label + Friend WithEvents DataGridViewTextBoxColumn1 As DataGridViewTextBoxColumn + Friend WithEvents btnClearNotes As Button +End Class diff --git a/instat/UserTables/SourceNotes/ucrSourceNotes.resx b/instat/UserTables/SourceNotes/ucrSourceNotes.resx new file mode 100644 index 00000000000..228caedf30a --- /dev/null +++ b/instat/UserTables/SourceNotes/ucrSourceNotes.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + \ No newline at end of file diff --git a/instat/UserTables/SourceNotes/ucrSourceNotes.vb b/instat/UserTables/SourceNotes/ucrSourceNotes.vb new file mode 100644 index 00000000000..afdb4018770 --- /dev/null +++ b/instat/UserTables/SourceNotes/ucrSourceNotes.vb @@ -0,0 +1,61 @@ + +Public Class ucrSourceNotes + + Private clsOperator As ROperator + + Public Sub Setup(clsOperator As ROperator) + Me.clsOperator = clsOperator + dataGridSourceNotes.Rows.Clear() + + Dim lstRParams As List(Of RParameter) = clsTablesUtils.FindRFunctionsParamsWithRCommand({"tab_source_note"}, clsOperator) + For Each clsRParam As RParameter In lstRParams + Dim clsTabSourceNotesRFunction As RFunction = clsRParam.clsArgumentCodeStructure + Dim row As New DataGridViewRow + row.CreateCells(dataGridSourceNotes) + For Each clsTabSourceNoteRParam As RParameter In clsTabSourceNotesRFunction.clsParameters + If clsTabSourceNoteRParam.strArgumentName = "source_note" Then + row.Cells(0).Value = clsTablesUtils.GetStringValue(clsTabSourceNoteRParam.strArgumentValue, False) + End If + Next + row.Tag = clsRParam + dataGridSourceNotes.Rows.Add(row) + Next + + ' Always add a place holder row for new foot note + dataGridSourceNotes.Rows.Add() + End Sub + + Private Sub btnClearNotes_Click(sender As Object, e As EventArgs) Handles btnClearNotes.Click + dataGridSourceNotes.Rows.Clear() + dataGridSourceNotes.Rows.Add() + End Sub + + Private Sub dataGridNotes_CellEndEdit(sender As Object, e As DataGridViewCellEventArgs) Handles dataGridSourceNotes.CellEndEdit + + Dim row As DataGridViewRow = dataGridSourceNotes.Rows.Item(e.RowIndex) + Dim strNoteTextValue As String = row.Cells(0).Value + + ' If no foot note typed by user then just exit the sub + If String.IsNullOrEmpty(strNoteTextValue) Then + Exit Sub + End If + + Dim clsTabSourceNoteRParam As New RFunction + clsTabSourceNoteRParam.SetPackageName("gt") + clsTabSourceNoteRParam.SetRCommand("tab_source_note") + clsTabSourceNoteRParam.AddParameter(New RParameter(strParameterName:="source_note", strParamValue:=clsTablesUtils.GetStringValue(strNoteTextValue, True), iNewPosition:=0)) + + ' Overwrite the tag with the new unique parameter + row.Tag = New RParameter(strParameterName:="tab_source_note_param" & (dataGridSourceNotes.Rows.Count + 1), strParamValue:=clsTabSourceNoteRParam, bNewIncludeArgumentName:=False) + + ' If last row then add new empty row + If e.RowIndex = dataGridSourceNotes.Rows.Count - 1 Then + dataGridSourceNotes.Rows.Add() + End If + End Sub + + Public Sub SetValuesToOperator() + clsTablesUtils.RemoveRParams(clsTablesUtils.FindRFunctionsParamsWithRCommand({"tab_source_note"}, clsOperator), clsOperator) + clsTablesUtils.AddGridRowTagsRParamsToROperator(dataGridSourceNotes, clsOperator) + End Sub +End Class diff --git a/instat/UserTables/Stub/ucrStub.Designer.vb b/instat/UserTables/Stub/ucrStub.Designer.vb new file mode 100644 index 00000000000..94e76a4240e --- /dev/null +++ b/instat/UserTables/Stub/ucrStub.Designer.vb @@ -0,0 +1,114 @@ + +Partial Class ucrStub + Inherits System.Windows.Forms.UserControl + + 'UserControl overrides dispose to clean up the component list. + + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + + Private Sub InitializeComponent() + Me.ucrStubOptions = New instat.ucrStubOptions() + Me.rdoVariables = New System.Windows.Forms.RadioButton() + Me.rdoStyles = New System.Windows.Forms.RadioButton() + Me.ucrPnlStub = New instat.UcrPanel() + Me.ucrStubStyle = New instat.ucrStubStyle() + Me.SuspendLayout() + ' + 'ucrStubOptions + ' + Me.ucrStubOptions.Location = New System.Drawing.Point(3, 40) + Me.ucrStubOptions.Name = "ucrStubOptions" + Me.ucrStubOptions.Size = New System.Drawing.Size(405, 187) + Me.ucrStubOptions.TabIndex = 0 + ' + 'rdoVariables + ' + Me.rdoVariables.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoVariables.BackColor = System.Drawing.SystemColors.Control + Me.rdoVariables.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None + Me.rdoVariables.CheckAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoVariables.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoVariables.FlatAppearance.BorderSize = 2 + Me.rdoVariables.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoVariables.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoVariables.ForeColor = System.Drawing.SystemColors.ActiveCaptionText + Me.rdoVariables.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoVariables.Location = New System.Drawing.Point(106, 3) + Me.rdoVariables.Name = "rdoVariables" + Me.rdoVariables.Size = New System.Drawing.Size(91, 29) + Me.rdoVariables.TabIndex = 283 + Me.rdoVariables.Text = "Contents" + Me.rdoVariables.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoVariables.UseVisualStyleBackColor = True + ' + 'rdoStyles + ' + Me.rdoStyles.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoStyles.BackColor = System.Drawing.SystemColors.Control + Me.rdoStyles.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None + Me.rdoStyles.CheckAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoStyles.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoStyles.FlatAppearance.BorderSize = 2 + Me.rdoStyles.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoStyles.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoStyles.ForeColor = System.Drawing.SystemColors.ActiveCaptionText + Me.rdoStyles.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoStyles.Location = New System.Drawing.Point(195, 3) + Me.rdoStyles.Name = "rdoStyles" + Me.rdoStyles.Size = New System.Drawing.Size(91, 29) + Me.rdoStyles.TabIndex = 284 + Me.rdoStyles.Text = "Styles" + Me.rdoStyles.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoStyles.UseVisualStyleBackColor = True + ' + 'ucrPnlStub + ' + Me.ucrPnlStub.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlStub.Location = New System.Drawing.Point(81, 3) + Me.ucrPnlStub.Name = "ucrPnlStub" + Me.ucrPnlStub.Size = New System.Drawing.Size(232, 29) + Me.ucrPnlStub.TabIndex = 282 + ' + 'ucrStubStyle + ' + Me.ucrStubStyle.Location = New System.Drawing.Point(3, 43) + Me.ucrStubStyle.Name = "ucrStubStyle" + Me.ucrStubStyle.Size = New System.Drawing.Size(372, 186) + Me.ucrStubStyle.TabIndex = 285 + ' + 'ucrStub + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.ucrStubStyle) + Me.Controls.Add(Me.rdoVariables) + Me.Controls.Add(Me.rdoStyles) + Me.Controls.Add(Me.ucrPnlStub) + Me.Controls.Add(Me.ucrStubOptions) + Me.Name = "ucrStub" + Me.Size = New System.Drawing.Size(420, 239) + Me.ResumeLayout(False) + + End Sub + + Friend WithEvents ucrStubOptions As ucrStubOptions + Friend WithEvents rdoVariables As RadioButton + Friend WithEvents rdoStyles As RadioButton + Friend WithEvents ucrPnlStub As UcrPanel + Friend WithEvents ucrStubStyle As ucrStubStyle +End Class diff --git a/instat/UserTables/Stub/ucrStub.resx b/instat/UserTables/Stub/ucrStub.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/instat/UserTables/Stub/ucrStub.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/instat/UserTables/Stub/ucrStub.vb b/instat/UserTables/Stub/ucrStub.vb new file mode 100644 index 00000000000..b96c302de4d --- /dev/null +++ b/instat/UserTables/Stub/ucrStub.vb @@ -0,0 +1,33 @@ +Imports Antlr.Runtime + +Public Class ucrStub + + Private bFirstload As Boolean = True + + Private Sub initialiseDialog() + ucrPnlStub.AddRadioButton(rdoVariables) + ucrPnlStub.AddRadioButton(rdoStyles) + + rdoVariables.Checked = True + End Sub + + Public Sub Setup(strDataFrameName As String, clsOperator As ROperator) + If bFirstload Then + initialiseDialog() + bFirstload = False + End If + + ucrStubOptions.Setup(strDataFrameName, clsOperator) + ucrStubStyle.Setup(strDataFrameName, clsOperator) + End Sub + + Private Sub ucrPnlRows_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlStub.ControlValueChanged + ucrStubOptions.Visible = rdoVariables.Checked + ucrStubStyle.Visible = rdoStyles.Checked + End Sub + + Public Sub SetValuesToOperator() + ucrStubOptions.SetValuesToOperator() + ucrStubStyle.SetValuesToOperator() + End Sub +End Class diff --git a/instat/UserTables/Stub/ucrStubOptions.Designer.vb b/instat/UserTables/Stub/ucrStubOptions.Designer.vb new file mode 100644 index 00000000000..7f8eec498f3 --- /dev/null +++ b/instat/UserTables/Stub/ucrStubOptions.Designer.vb @@ -0,0 +1,138 @@ + _ +Partial Class ucrStubOptions + Inherits System.Windows.Forms.UserControl + + 'UserControl overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.ucrSelectorCols = New instat.ucrSelectorByDataFrameAddRemove() + Me.ucrInputStubHead = New instat.ucrInputTextBox() + Me.lblStubHeadLabel = New System.Windows.Forms.Label() + Me.lblRowName = New System.Windows.Forms.Label() + Me.ucrReceiverSingleRowName = New instat.ucrReceiverSingle() + Me.lblGroupByCol = New System.Windows.Forms.Label() + Me.ucrReceiverSingleGroupByCol = New instat.ucrReceiverSingle() + Me.SuspendLayout() + ' + 'ucrSelectorCols + ' + Me.ucrSelectorCols.AutoSize = True + Me.ucrSelectorCols.bDropUnusedFilterLevels = False + Me.ucrSelectorCols.bShowHiddenColumns = False + Me.ucrSelectorCols.bUseCurrentFilter = True + Me.ucrSelectorCols.Location = New System.Drawing.Point(3, 1) + Me.ucrSelectorCols.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectorCols.Name = "ucrSelectorCols" + Me.ucrSelectorCols.Size = New System.Drawing.Size(213, 183) + Me.ucrSelectorCols.TabIndex = 1 + ' + 'ucrInputStubHead + ' + Me.ucrInputStubHead.AddQuotesIfUnrecognised = True + Me.ucrInputStubHead.AutoSize = True + Me.ucrInputStubHead.IsMultiline = False + Me.ucrInputStubHead.IsReadOnly = False + Me.ucrInputStubHead.Location = New System.Drawing.Point(256, 122) + Me.ucrInputStubHead.Name = "ucrInputStubHead" + Me.ucrInputStubHead.Size = New System.Drawing.Size(142, 21) + Me.ucrInputStubHead.TabIndex = 4 + ' + 'lblStubHeadLabel + ' + Me.lblStubHeadLabel.AutoSize = True + Me.lblStubHeadLabel.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblStubHeadLabel.Location = New System.Drawing.Point(254, 106) + Me.lblStubHeadLabel.Name = "lblStubHeadLabel" + Me.lblStubHeadLabel.Size = New System.Drawing.Size(133, 13) + Me.lblStubHeadLabel.TabIndex = 296 + Me.lblStubHeadLabel.Text = "Stubhead Label (Optional):" + ' + 'lblRowName + ' + Me.lblRowName.AutoSize = True + Me.lblRowName.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblRowName.Location = New System.Drawing.Point(254, 16) + Me.lblRowName.Name = "lblRowName" + Me.lblRowName.Size = New System.Drawing.Size(63, 13) + Me.lblRowName.TabIndex = 295 + Me.lblRowName.Text = "Row Name:" + ' + 'ucrReceiverSingleRowName + ' + Me.ucrReceiverSingleRowName.AutoSize = True + Me.ucrReceiverSingleRowName.frmParent = Nothing + Me.ucrReceiverSingleRowName.Location = New System.Drawing.Point(257, 29) + Me.ucrReceiverSingleRowName.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverSingleRowName.Name = "ucrReceiverSingleRowName" + Me.ucrReceiverSingleRowName.Selector = Nothing + Me.ucrReceiverSingleRowName.Size = New System.Drawing.Size(142, 20) + Me.ucrReceiverSingleRowName.strNcFilePath = "" + Me.ucrReceiverSingleRowName.TabIndex = 2 + Me.ucrReceiverSingleRowName.ucrSelector = Nothing + ' + 'lblGroupByCol + ' + Me.lblGroupByCol.AutoSize = True + Me.lblGroupByCol.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblGroupByCol.Location = New System.Drawing.Point(253, 61) + Me.lblGroupByCol.Name = "lblGroupByCol" + Me.lblGroupByCol.Size = New System.Drawing.Size(102, 13) + Me.lblGroupByCol.TabIndex = 293 + Me.lblGroupByCol.Text = "Group By (Optional):" + ' + 'ucrReceiverSingleGroupByCol + ' + Me.ucrReceiverSingleGroupByCol.AutoSize = True + Me.ucrReceiverSingleGroupByCol.frmParent = Nothing + Me.ucrReceiverSingleGroupByCol.Location = New System.Drawing.Point(255, 75) + Me.ucrReceiverSingleGroupByCol.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverSingleGroupByCol.Name = "ucrReceiverSingleGroupByCol" + Me.ucrReceiverSingleGroupByCol.Selector = Nothing + Me.ucrReceiverSingleGroupByCol.Size = New System.Drawing.Size(142, 20) + Me.ucrReceiverSingleGroupByCol.strNcFilePath = "" + Me.ucrReceiverSingleGroupByCol.TabIndex = 3 + Me.ucrReceiverSingleGroupByCol.ucrSelector = Nothing + ' + 'ucrStubOptions + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.ucrSelectorCols) + Me.Controls.Add(Me.ucrInputStubHead) + Me.Controls.Add(Me.lblStubHeadLabel) + Me.Controls.Add(Me.lblRowName) + Me.Controls.Add(Me.ucrReceiverSingleRowName) + Me.Controls.Add(Me.lblGroupByCol) + Me.Controls.Add(Me.ucrReceiverSingleGroupByCol) + Me.Name = "ucrStubOptions" + Me.Size = New System.Drawing.Size(405, 187) + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents ucrSelectorCols As ucrSelectorByDataFrameAddRemove + Friend WithEvents ucrInputStubHead As ucrInputTextBox + Friend WithEvents lblStubHeadLabel As Label + Friend WithEvents lblRowName As Label + Friend WithEvents ucrReceiverSingleRowName As ucrReceiverSingle + Friend WithEvents lblGroupByCol As Label + Friend WithEvents ucrReceiverSingleGroupByCol As ucrReceiverSingle +End Class diff --git a/instat/UserTables/Stub/ucrStubOptions.resx b/instat/UserTables/Stub/ucrStubOptions.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/instat/UserTables/Stub/ucrStubOptions.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/instat/UserTables/Stub/ucrStubOptions.vb b/instat/UserTables/Stub/ucrStubOptions.vb new file mode 100644 index 00000000000..e78295e38fa --- /dev/null +++ b/instat/UserTables/Stub/ucrStubOptions.vb @@ -0,0 +1,69 @@ +Public Class ucrStubOptions + Private clsOperator As New ROperator + Private clsGtRFunction, clsStubHeadRFunction, clsStubStyleRFunction, clsStubLocationRFunction As New RFunction + Private bFirstload As Boolean = True + + Private Sub initialiseDialog() + ucrReceiverSingleRowName.SetParameter(New RParameter("rowname_col", 0)) + ucrReceiverSingleRowName.SetParameterIsString() + ucrReceiverSingleRowName.Selector = ucrSelectorCols + ucrReceiverSingleRowName.SetLinkedDisplayControl(lblRowName) + + ucrReceiverSingleGroupByCol.SetParameter(New RParameter("groupname_col", 1)) + ucrReceiverSingleGroupByCol.SetParameterIsString() + ucrReceiverSingleGroupByCol.Selector = ucrSelectorCols + ucrReceiverSingleGroupByCol.SetLinkedDisplayControl(lblGroupByCol) + + ucrInputStubHead.SetParameter(New RParameter("label", 0)) + End Sub + + Public Sub Setup(strDataFrameName As String, clsOperator As ROperator) + + If bFirstload Then + initialiseDialog() + bFirstload = False + End If + + Me.clsOperator = clsOperator + + ucrSelectorCols.SetDataframe(strDataFrameName, bEnableDataframe:=False) + ucrReceiverSingleRowName.SetMeAsReceiver() + + ' The GT paramter should always be there. + clsGtRFunction = clsTablesUtils.FindRFunctionsParamsWithRCommand({"gt"}, clsOperator).FirstOrDefault()?.clsArgumentCodeStructure + + clsStubHeadRFunction = clsTablesUtils.FindRFunctionsParamsWithRCommand({"tab_stubhead"}, clsOperator).FirstOrDefault()?.clsArgumentCodeStructure + If clsStubHeadRFunction Is Nothing Then + clsStubHeadRFunction = New RFunction + clsStubHeadRFunction.SetPackageName("gt") + clsStubHeadRFunction.SetRCommand("tab_stubhead") + End If + + SetRCode() + End Sub + + Private Sub SetRCode() + ucrReceiverSingleRowName.SetRCode(clsGtRFunction, True, bCloneIfNeeded:=True) + ucrReceiverSingleGroupByCol.SetRCode(clsGtRFunction, True, bCloneIfNeeded:=True) + ucrInputStubHead.SetRCode(clsStubHeadRFunction, True, bCloneIfNeeded:=True) + End Sub + + + Private Sub btnStyle_Click(sender As Object, e As EventArgs) + Dim clsListStyleRFunction As RFunction = clsTablesUtils.ShowStyleSubDialog(Me.ParentForm, clsStubStyleRFunction) + If clsListStyleRFunction Is Nothing Then + Exit Sub + End If + + clsStubStyleRFunction = clsTablesUtils.GetNewStyleRFunction(clsListStyleRFunction, clsStubLocationRFunction) + End Sub + + Public Sub SetValuesToOperator() + + clsTablesUtils.RemoveRFunctionsParamsWithRCommand({"tab_stubhead"}, clsOperator) + + If Not ucrInputStubHead.IsEmpty Then + clsOperator.AddParameter(New RParameter(strParameterName:="tab_stubhead_param", strParamValue:=clsStubHeadRFunction, bNewIncludeArgumentName:=False)) + End If + End Sub +End Class diff --git a/instat/UserTables/Stub/ucrStubStyle.Designer.vb b/instat/UserTables/Stub/ucrStubStyle.Designer.vb new file mode 100644 index 00000000000..7db09228c98 --- /dev/null +++ b/instat/UserTables/Stub/ucrStubStyle.Designer.vb @@ -0,0 +1,128 @@ + _ +Partial Class ucrStubStyle + Inherits System.Windows.Forms.UserControl + + 'UserControl overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.btnEnterStyle = New System.Windows.Forms.Button() + Me.lblFormats = New System.Windows.Forms.Label() + Me.btnClearStyle = New System.Windows.Forms.Button() + Me.dataGridFormats = New System.Windows.Forms.DataGridView() + Me.colStyles = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.Label1 = New System.Windows.Forms.Label() + Me.ucrRowExpression = New instat.ucrRowExpression() + CType(Me.dataGridFormats, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'btnEnterStyle + ' + Me.btnEnterStyle.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.btnEnterStyle.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.btnEnterStyle.Location = New System.Drawing.Point(8, 54) + Me.btnEnterStyle.Name = "btnEnterStyle" + Me.btnEnterStyle.Size = New System.Drawing.Size(126, 23) + Me.btnEnterStyle.TabIndex = 335 + Me.btnEnterStyle.Tag = "" + Me.btnEnterStyle.Text = "Enter Style" + Me.btnEnterStyle.UseVisualStyleBackColor = True + ' + 'lblFormats + ' + Me.lblFormats.AutoSize = True + Me.lblFormats.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblFormats.Location = New System.Drawing.Point(6, 85) + Me.lblFormats.Name = "lblFormats" + Me.lblFormats.Size = New System.Drawing.Size(38, 13) + Me.lblFormats.TabIndex = 338 + Me.lblFormats.Text = "Styles:" + ' + 'btnClearStyle + ' + Me.btnClearStyle.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.btnClearStyle.Location = New System.Drawing.Point(290, 76) + Me.btnClearStyle.Name = "btnClearStyle" + Me.btnClearStyle.Size = New System.Drawing.Size(75, 23) + Me.btnClearStyle.TabIndex = 337 + Me.btnClearStyle.Tag = "" + Me.btnClearStyle.Text = "Clear" + Me.btnClearStyle.UseVisualStyleBackColor = True + ' + 'dataGridFormats + ' + Me.dataGridFormats.AllowUserToAddRows = False + Me.dataGridFormats.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.dataGridFormats.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.colStyles}) + Me.dataGridFormats.Location = New System.Drawing.Point(8, 102) + Me.dataGridFormats.Name = "dataGridFormats" + Me.dataGridFormats.RowHeadersWidth = 62 + Me.dataGridFormats.Size = New System.Drawing.Size(361, 73) + Me.dataGridFormats.TabIndex = 336 + ' + 'colStyles + ' + Me.colStyles.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.colStyles.HeaderText = "Style Expressions" + Me.colStyles.MinimumWidth = 8 + Me.colStyles.Name = "colStyles" + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.Label1.Location = New System.Drawing.Point(6, 4) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(131, 13) + Me.Label1.TabIndex = 333 + Me.Label1.Text = "Row Expression(Optional):" + ' + 'ucrRowExpression + ' + Me.ucrRowExpression.Location = New System.Drawing.Point(3, 20) + Me.ucrRowExpression.Name = "ucrRowExpression" + Me.ucrRowExpression.Size = New System.Drawing.Size(134, 26) + Me.ucrRowExpression.TabIndex = 339 + ' + 'ucrStubStyle + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.ucrRowExpression) + Me.Controls.Add(Me.lblFormats) + Me.Controls.Add(Me.btnClearStyle) + Me.Controls.Add(Me.dataGridFormats) + Me.Controls.Add(Me.btnEnterStyle) + Me.Controls.Add(Me.Label1) + Me.Name = "ucrStubStyle" + Me.Size = New System.Drawing.Size(372, 177) + CType(Me.dataGridFormats, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents btnEnterStyle As Button + Friend WithEvents lblFormats As Label + Friend WithEvents btnClearStyle As Button + Friend WithEvents dataGridFormats As DataGridView + Friend WithEvents colStyles As DataGridViewTextBoxColumn + Friend WithEvents Label1 As Label + Friend WithEvents ucrRowExpression As ucrRowExpression +End Class diff --git a/instat/UserTables/Stub/ucrStubStyle.resx b/instat/UserTables/Stub/ucrStubStyle.resx new file mode 100644 index 00000000000..d937ee32b35 --- /dev/null +++ b/instat/UserTables/Stub/ucrStubStyle.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + \ No newline at end of file diff --git a/instat/UserTables/Stub/ucrStubStyle.vb b/instat/UserTables/Stub/ucrStubStyle.vb new file mode 100644 index 00000000000..71f87724290 --- /dev/null +++ b/instat/UserTables/Stub/ucrStubStyle.vb @@ -0,0 +1,72 @@ +Public Class ucrStubStyle + Private clsOperator As New ROperator + Private bFirstload As Boolean = True + + Public Sub Setup(strDataFrameName As String, clsOperator As ROperator) + If bFirstload Then + 'InitialiseControl() + bFirstload = False + End If + + Me.clsOperator = clsOperator + + ucrRowExpression.Setup(strDataFrameName) + + ' Clear and Set up the data grid with contents + dataGridFormats.Rows.Clear() + SetupDataGrid(clsTablesUtils.FindRFunctionsParamsWithRParamValue({"tab_style"}, "locations", "cells_stub", clsOperator)) + End Sub + + Private Sub SetupDataGrid(lstRParams As List(Of RParameter)) + For Each clsRParam As RParameter In lstRParams + ' Create a new row that represents the tab_style() parameters + Dim row As New DataGridViewRow + row.CreateCells(dataGridFormats) + row.Cells(0).Value = clsRParam.clsArgumentCodeStructure.Clone.ToScript + + ' Tag and add the tab_style() parameter function contents as a row + row.Tag = clsRParam + dataGridFormats.Rows.Add(row) + Next + End Sub + + Private Sub btnEnterStyle_Click(sender As Object, e As EventArgs) Handles btnEnterStyle.Click + Dim clsListStyleRFunction As RFunction = clsTablesUtils.ShowStyleSubDialog(Me.ParentForm) + If clsListStyleRFunction Is Nothing Then + Exit Sub + End If + + Dim clsLocationsRFunction As New RFunction + clsLocationsRFunction.SetPackageName("gt") + clsLocationsRFunction.SetRCommand("cells_stub") + + If Not ucrRowExpression.IsEmpty Then + clsLocationsRFunction.AddParameter(New RParameter(strParameterName:="rows", strParamValue:=ucrRowExpression.GetText(), iNewPosition:=1)) + End If + + Dim clsTabStyleRFunction As RFunction = clsTablesUtils.GetNewStyleRFunction(clsListStyleRFunction, clsLocationsRFunction) + + ' Create parameter with unique name + Dim clsRParam As New RParameter(strParameterName:="tab_style_stub_param" & (dataGridFormats.Rows.Count + 1), strParamValue:=clsTabStyleRFunction, bNewIncludeArgumentName:=False) + + ' Create row and its cells + Dim row As New DataGridViewRow + row.CreateCells(dataGridFormats) + row.Cells(0).Value = clsTabStyleRFunction.Clone.ToScript + + ' Tag the row with the parameter + row.Tag = clsRParam + + ' Add it to grid + dataGridFormats.Rows.Add(row) + End Sub + + Private Sub btnClearStyle_Click(sender As Object, e As EventArgs) Handles btnClearStyle.Click + dataGridFormats.Rows.Clear() + End Sub + + Public Sub SetValuesToOperator() + clsTablesUtils.RemoveRParams(clsTablesUtils.FindRFunctionsParamsWithRParamValue({"tab_style"}, "locations", "cells_stub", clsOperator), clsOperator) + clsTablesUtils.AddGridRowTagsRParamsToROperator(dataGridFormats, clsOperator) + End Sub +End Class diff --git a/instat/UserTables/clsTablesUtils.vb b/instat/UserTables/clsTablesUtils.vb new file mode 100644 index 00000000000..cace4963759 --- /dev/null +++ b/instat/UserTables/clsTablesUtils.vb @@ -0,0 +1,114 @@ +Imports System.Reflection + +Public Class clsTablesUtils + + Public Shared Function ShowStyleSubDialog(owner As Form, Optional clsListStyleRFunction As RFunction = Nothing) As RFunction + If clsListStyleRFunction IsNot Nothing AndAlso clsListStyleRFunction.ContainsParameter("style") Then + sdgTableStyles.Setup(clsListStyleRFunction.GetParameter("style").clsArgumentCodeStructure) + Else + sdgTableStyles.Setup() + End If + + sdgTableStyles.ShowDialog(owner) + Return sdgTableStyles.GetNewUserInputAsRFunction() + End Function + + 'TODO. Delete + Public Shared Function FindRFunctionsWithRCommand(strRCommandName As String, clsOperator As ROperator) As List(Of RFunction) + Dim lstRFunctions As New List(Of RFunction) + For Each clsRParam As RParameter In clsOperator.clsParameters + If clsRParam.bIsFunction AndAlso clsRParam.HasValue() Then + Dim rFunction As RFunction = clsRParam.clsArgumentCodeStructure + If rFunction.strRCommand = strRCommandName Then + lstRFunctions.Add(rFunction) + End If + End If + Next + Return lstRFunctions + End Function + + Public Shared Function GetNewStyleRFunction(clsListStyleRFunction As RFunction, clsLocationsRFunction As RFunction) As RFunction + Dim clsTabStyleRFunction As New RFunction + clsTabStyleRFunction.SetPackageName("gt") + clsTabStyleRFunction.SetRCommand("tab_style") + clsTabStyleRFunction.AddParameter(strParameterName:="style", clsRFunctionParameter:=clsListStyleRFunction, iPosition:=0) + clsTabStyleRFunction.AddParameter(strParameterName:="locations", clsRFunctionParameter:=clsLocationsRFunction, iPosition:=1) + Return clsTabStyleRFunction + End Function + + Public Shared Function FindRFunctionsParamsWithRCommand(strRCommandNames() As String, clsOperator As ROperator) As List(Of RParameter) + Dim lstRFunctionParams As New List(Of RParameter) + For Each clsRParam As RParameter In clsOperator.clsParameters + If clsRParam.bIsFunction AndAlso clsRParam.HasValue() Then + If strRCommandNames.Contains(DirectCast(clsRParam.clsArgumentCodeStructure, RFunction).strRCommand) Then + lstRFunctionParams.Add(clsRParam) + End If + End If + Next + Return lstRFunctionParams + End Function + + Public Shared Sub RemoveRFunctionsParamsWithRCommand(strRCommandNames() As String, clsOperator As ROperator) + ' Remove all the previous footer parameters first + Dim lstParams As New List(Of RParameter) + For Each clsRParam As RParameter In clsOperator.clsParameters + If clsRParam.bIsFunction AndAlso clsRParam.HasValue() Then + If strRCommandNames.Contains(DirectCast(clsRParam.clsArgumentCodeStructure, RFunction).strRCommand) Then + lstParams.Add(clsRParam) + End If + End If + Next + + RemoveRParams(lstParams, clsOperator) + End Sub + + Public Shared Sub RemoveRParams(lstParams As IEnumerable(Of RParameter), clsOperator As ROperator) + For Each clsRParam As RParameter In lstParams + clsOperator.RemoveParameter(clsRParam) + Next + End Sub + + Public Shared Sub AddGridRowTagsRParamsToROperator(dataGrid As DataGridView, clsOperator As ROperator) + For index As Integer = 0 To dataGrid.Rows.Count - 1 + If dataGrid.Rows.Item(index).Tag IsNot Nothing Then + Dim clsRParam As RParameter = dataGrid.Rows.Item(index).Tag + clsOperator.AddParameter(clsRParam) + End If + Next + End Sub + + ''' + ''' E.g Finding cells_body in R Function tab_style( style = cell_fill(color = "gray85"), locations = cells_body() ) + ''' + ''' e.g tab_style + ''' e.g locations + ''' e.g cells_body + ''' Operator that contains the parent strRCommandName + ''' + Public Shared Function FindRFunctionsParamsWithRParamValue(strRCommandNames() As String, strParamName As String, strParamValueRCommand As String, clsOperator As ROperator) As List(Of RParameter) + + Dim lstRFunctionParams As List(Of RParameter) = FindRFunctionsParamsWithRCommand(strRCommandNames, clsOperator) + Dim lstRFunctionsParamsFound As New List(Of RParameter) + + For Each clsRParam As RParameter In lstRFunctionParams + Dim rFunctionParent As RFunction = clsRParam.clsArgumentCodeStructure + If strRCommandNames.Contains(rFunctionParent.strRCommand) AndAlso rFunctionParent.ContainsParameter(strParamName) Then + + Dim rFunctionchild As RFunction = rFunctionParent.GetParameter(strParamName).clsArgumentCodeStructure + If rFunctionchild.strRCommand = strParamValueRCommand Then + lstRFunctionsParamsFound.Add(clsRParam) + End If + + End If + Next + Return lstRFunctionsParamsFound + End Function + + Public Shared Function GetStringValue(str As String, bwithQuotes As Boolean) As String + If String.IsNullOrEmpty(str) Then + str = "" + End If + Return If(bwithQuotes, """" & str & """", str.Replace("""", "")) + End Function + +End Class diff --git a/instat/UserTables/dlgGeneralTable.Designer.vb b/instat/UserTables/dlgGeneralTable.Designer.vb new file mode 100644 index 00000000000..481a6fbbd41 --- /dev/null +++ b/instat/UserTables/dlgGeneralTable.Designer.vb @@ -0,0 +1,150 @@ + _ +Partial Class dlgGeneralTable + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.lblColumns = New System.Windows.Forms.Label() + Me.btnMoreOptions = New System.Windows.Forms.Button() + Me.ucrNudPreview = New instat.ucrNud() + Me.ucrChkPreview = New instat.ucrCheck() + Me.ucrSaveTable = New instat.ucrSave() + Me.ucrBase = New instat.ucrButtons() + Me.ucrReceiverMultipleCols = New instat.ucrReceiverMultiple() + Me.ucrSelectorCols = New instat.ucrSelectorByDataFrameAddRemove() + Me.SuspendLayout() + ' + 'lblColumns + ' + Me.lblColumns.AutoSize = True + Me.lblColumns.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblColumns.Location = New System.Drawing.Point(247, 50) + Me.lblColumns.Name = "lblColumns" + Me.lblColumns.Size = New System.Drawing.Size(50, 13) + Me.lblColumns.TabIndex = 24 + Me.lblColumns.Text = "Columns:" + ' + 'btnMoreOptions + ' + Me.btnMoreOptions.Location = New System.Drawing.Point(9, 204) + Me.btnMoreOptions.Name = "btnMoreOptions" + Me.btnMoreOptions.Size = New System.Drawing.Size(141, 23) + Me.btnMoreOptions.TabIndex = 25 + Me.btnMoreOptions.Text = "Table Options" + Me.btnMoreOptions.UseVisualStyleBackColor = True + ' + 'ucrNudPreview + ' + Me.ucrNudPreview.AutoSize = True + Me.ucrNudPreview.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudPreview.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudPreview.Location = New System.Drawing.Point(370, 174) + Me.ucrNudPreview.Margin = New System.Windows.Forms.Padding(6) + Me.ucrNudPreview.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudPreview.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudPreview.Name = "ucrNudPreview" + Me.ucrNudPreview.Size = New System.Drawing.Size(50, 20) + Me.ucrNudPreview.TabIndex = 31 + Me.ucrNudPreview.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrChkPreview + ' + Me.ucrChkPreview.AutoSize = True + Me.ucrChkPreview.Checked = False + Me.ucrChkPreview.Location = New System.Drawing.Point(250, 175) + Me.ucrChkPreview.Margin = New System.Windows.Forms.Padding(6) + Me.ucrChkPreview.Name = "ucrChkPreview" + Me.ucrChkPreview.Size = New System.Drawing.Size(119, 23) + Me.ucrChkPreview.TabIndex = 30 + ' + 'ucrSaveTable + ' + Me.ucrSaveTable.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrSaveTable.Location = New System.Drawing.Point(9, 242) + Me.ucrSaveTable.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.ucrSaveTable.Name = "ucrSaveTable" + Me.ucrSaveTable.Size = New System.Drawing.Size(319, 24) + Me.ucrSaveTable.TabIndex = 27 + ' + 'ucrBase + ' + Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrBase.Location = New System.Drawing.Point(9, 276) + Me.ucrBase.Margin = New System.Windows.Forms.Padding(4) + Me.ucrBase.Name = "ucrBase" + Me.ucrBase.Size = New System.Drawing.Size(410, 52) + Me.ucrBase.TabIndex = 26 + ' + 'ucrReceiverMultipleCols + ' + Me.ucrReceiverMultipleCols.AutoSize = True + Me.ucrReceiverMultipleCols.frmParent = Me + Me.ucrReceiverMultipleCols.Location = New System.Drawing.Point(250, 63) + Me.ucrReceiverMultipleCols.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverMultipleCols.Name = "ucrReceiverMultipleCols" + Me.ucrReceiverMultipleCols.Selector = Nothing + Me.ucrReceiverMultipleCols.Size = New System.Drawing.Size(141, 100) + Me.ucrReceiverMultipleCols.strNcFilePath = "" + Me.ucrReceiverMultipleCols.TabIndex = 23 + Me.ucrReceiverMultipleCols.ucrSelector = Nothing + ' + 'ucrSelectorCols + ' + Me.ucrSelectorCols.AutoSize = True + Me.ucrSelectorCols.bDropUnusedFilterLevels = False + Me.ucrSelectorCols.bShowHiddenColumns = False + Me.ucrSelectorCols.bUseCurrentFilter = True + Me.ucrSelectorCols.Location = New System.Drawing.Point(9, 9) + Me.ucrSelectorCols.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectorCols.Name = "ucrSelectorCols" + Me.ucrSelectorCols.Size = New System.Drawing.Size(213, 183) + Me.ucrSelectorCols.TabIndex = 22 + ' + 'dlgGeneralTable + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(476, 338) + Me.Controls.Add(Me.ucrNudPreview) + Me.Controls.Add(Me.ucrChkPreview) + Me.Controls.Add(Me.ucrSaveTable) + Me.Controls.Add(Me.ucrBase) + Me.Controls.Add(Me.btnMoreOptions) + Me.Controls.Add(Me.lblColumns) + Me.Controls.Add(Me.ucrReceiverMultipleCols) + Me.Controls.Add(Me.ucrSelectorCols) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.Name = "dlgGeneralTable" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "Presentation Table" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents ucrSelectorCols As ucrSelectorByDataFrameAddRemove + Friend WithEvents ucrReceiverMultipleCols As ucrReceiverMultiple + Friend WithEvents btnMoreOptions As Button + Friend WithEvents lblColumns As Label + Friend WithEvents ucrBase As ucrButtons + Friend WithEvents ucrSaveTable As ucrSave + Friend WithEvents ucrNudPreview As ucrNud + Friend WithEvents ucrChkPreview As ucrCheck +End Class diff --git a/instat/UserTables/dlgGeneralTable.resx b/instat/UserTables/dlgGeneralTable.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/instat/UserTables/dlgGeneralTable.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/instat/UserTables/dlgGeneralTable.vb b/instat/UserTables/dlgGeneralTable.vb new file mode 100644 index 00000000000..fefc401eee2 --- /dev/null +++ b/instat/UserTables/dlgGeneralTable.vb @@ -0,0 +1,119 @@ +Imports instat.Translations + +Public Class dlgGeneralTable + Private clsBaseOperator As New ROperator + Private clsHeadRFunction, clsGtRFunction As New RFunction + + Private bFirstload As Boolean = True + Private bReset As Boolean = True + + Private Sub dlgGeneralTable_Load(sender As Object, e As EventArgs) Handles MyBase.Load + If bFirstload Then + initialiseDialog() + bFirstload = False + End If + If bReset Then + SetDefaults() + End If + SetRCodeForControls(bReset) + bReset = False + autoTranslate(Me) + TestOKEnabled() + End Sub + + Private Sub btnMoreOptions_Click(sender As Object, e As EventArgs) Handles btnMoreOptions.Click + sdgTableOptions.Setup(ucrSelectorCols.strCurrentDataFrame, clsBaseOperator) + sdgTableOptions.ShowDialog(Me) + End Sub + + Private Sub ucrControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverMultipleCols.ControlContentsChanged + TestOKEnabled() + End Sub + + Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset + SetDefaults() + SetRCodeForControls(True) + TestOKEnabled() + End Sub + + Private Sub initialiseDialog() + ucrBase.iHelpTopicID = 419 + + ucrReceiverMultipleCols.SetParameter(New RParameter("df_columns_to_use_param", 0, bNewIncludeArgumentName:=False)) + ucrReceiverMultipleCols.SetParameterIsRFunction() + ucrReceiverMultipleCols.Selector = ucrSelectorCols + ucrReceiverMultipleCols.SetLinkedDisplayControl(lblColumns) + + ucrChkPreview.SetText("Preview") + ucrChkPreview.AddParameterPresentCondition(True, "head", bNewIsPositive:=True) + ucrChkPreview.AddParameterPresentCondition(False, "head", bNewIsPositive:=False) + ucrChkPreview.AddToLinkedControls(ucrNudPreview, {True}, bNewLinkedHideIfParameterMissing:=True) + + ucrNudPreview.SetParameter(New RParameter("x", 0, bNewIncludeArgumentName:=False)) + ucrNudPreview.Minimum = 6 + ucrNudPreview.Maximum = Decimal.MaxValue + ucrNudPreview.SetRDefault(6) + + ucrSaveTable.SetPrefix("presentation_table") + ucrSaveTable.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) + ucrSaveTable.SetDataFrameSelector(ucrSelectorCols.ucrAvailableDataFrames) + ucrSaveTable.SetIsComboBox() + ucrSaveTable.SetCheckBoxText("Store Table") + ucrSaveTable.SetAssignToIfUncheckedValue("last_table") + + ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False + End Sub + + + Private Sub SetDefaults() + clsBaseOperator = New ROperator + clsHeadRFunction = New RFunction + clsGtRFunction = New RFunction + + ucrSelectorCols.Reset() + ucrReceiverMultipleCols.SetMeAsReceiver() + ucrSaveTable.Reset() + ucrChkPreview.Checked = True + + clsBaseOperator.SetOperation("%>%") + clsBaseOperator.bBrackets = False + + clsHeadRFunction.SetPackageName("utils") + clsHeadRFunction.SetRCommand("head") + clsHeadRFunction.AddParameter(strParameterName:="x", strParameterValue:=100, iPosition:=0, bIncludeArgumentName:=False) + clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=1, bIncludeArgumentName:=False) + + clsGtRFunction.SetPackageName("gt") + clsGtRFunction.SetRCommand("gt") + clsBaseOperator.AddParameter(strParameterName:="gt", clsRFunctionParameter:=clsGtRFunction, iPosition:=2, bIncludeArgumentName:=False) + + clsBaseOperator.SetAssignToOutputObject(strRObjectToAssignTo:="last_table", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Table, + strRObjectFormatToAssignTo:=RObjectFormat.Html, + strRDataFrameNameToAddObjectTo:=ucrSelectorCols.strCurrentDataFrame, + strObjectName:="last_table") + + ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) + End Sub + + + Private Sub SetRCodeForControls(bReset As Boolean) + ucrReceiverMultipleCols.SetRCode(clsBaseOperator, bReset) + ucrSaveTable.SetRCode(clsBaseOperator, bReset) + + ucrChkPreview.SetRCode(clsBaseOperator, bReset) + ucrNudPreview.SetRCode(clsHeadRFunction, bReset) + End Sub + + Private Sub TestOKEnabled() + ucrBase.OKEnabled(Not ucrReceiverMultipleCols.IsEmpty AndAlso ucrSaveTable.IsComplete) + End Sub + + Private Sub ucrChkPreview_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkPreview.ControlValueChanged + If ucrChkPreview.Checked Then + clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=1, bIncludeArgumentName:=False) + Else + clsBaseOperator.RemoveParameterByName("head") + End If + End Sub +End Class \ No newline at end of file diff --git a/instat/UserTables/sdgTableOptions.Designer.vb b/instat/UserTables/sdgTableOptions.Designer.vb new file mode 100644 index 00000000000..5f4be438d62 --- /dev/null +++ b/instat/UserTables/sdgTableOptions.Designer.vb @@ -0,0 +1,324 @@ + _ +Partial Class sdgTableOptions + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.tbpFormatOptions = New System.Windows.Forms.TabControl() + Me.tbpHeader = New System.Windows.Forms.TabPage() + Me.ucrHeader = New instat.ucrHeader() + Me.tbpStub = New System.Windows.Forms.TabPage() + Me.ucrStub = New instat.ucrStub() + Me.tbpColumns = New System.Windows.Forms.TabPage() + Me.ucrColumns = New instat.ucrColumns() + Me.tbpRows = New System.Windows.Forms.TabPage() + Me.ucrRows = New instat.ucrRows() + Me.tbpCells = New System.Windows.Forms.TabPage() + Me.ucrCells = New instat.ucrCells() + Me.tbpSourceNotes = New System.Windows.Forms.TabPage() + Me.ucrSourceNotes = New instat.ucrSourceNotes() + Me.tbpThemes = New System.Windows.Forms.TabPage() + Me.ucrCboSelectThemes = New instat.ucrInputComboBox() + Me.btnManualTheme = New System.Windows.Forms.Button() + Me.rdoSelectTheme = New System.Windows.Forms.RadioButton() + Me.rdoManualTheme = New System.Windows.Forms.RadioButton() + Me.ucrPnlThemesPanel = New instat.UcrPanel() + Me.tbpOtherStyles = New System.Windows.Forms.TabPage() + Me.ucrOtherStyles = New instat.ucrOtherStyles() + Me.ucrSdgBaseButtons = New instat.ucrButtonsSubdialogue() + Me.tbpFormatOptions.SuspendLayout() + Me.tbpHeader.SuspendLayout() + Me.tbpStub.SuspendLayout() + Me.tbpColumns.SuspendLayout() + Me.tbpRows.SuspendLayout() + Me.tbpCells.SuspendLayout() + Me.tbpSourceNotes.SuspendLayout() + Me.tbpThemes.SuspendLayout() + Me.tbpOtherStyles.SuspendLayout() + Me.SuspendLayout() + ' + 'tbpFormatOptions + ' + Me.tbpFormatOptions.Controls.Add(Me.tbpHeader) + Me.tbpFormatOptions.Controls.Add(Me.tbpStub) + Me.tbpFormatOptions.Controls.Add(Me.tbpColumns) + Me.tbpFormatOptions.Controls.Add(Me.tbpRows) + Me.tbpFormatOptions.Controls.Add(Me.tbpCells) + Me.tbpFormatOptions.Controls.Add(Me.tbpSourceNotes) + Me.tbpFormatOptions.Controls.Add(Me.tbpThemes) + Me.tbpFormatOptions.Controls.Add(Me.tbpOtherStyles) + Me.tbpFormatOptions.Location = New System.Drawing.Point(3, 5) + Me.tbpFormatOptions.Name = "tbpFormatOptions" + Me.tbpFormatOptions.SelectedIndex = 0 + Me.tbpFormatOptions.Size = New System.Drawing.Size(656, 457) + Me.tbpFormatOptions.TabIndex = 5 + ' + 'tbpHeader + ' + Me.tbpHeader.Controls.Add(Me.ucrHeader) + Me.tbpHeader.Location = New System.Drawing.Point(4, 22) + Me.tbpHeader.Name = "tbpHeader" + Me.tbpHeader.Padding = New System.Windows.Forms.Padding(3) + Me.tbpHeader.Size = New System.Drawing.Size(648, 431) + Me.tbpHeader.TabIndex = 0 + Me.tbpHeader.Text = "Header" + Me.tbpHeader.UseVisualStyleBackColor = True + ' + 'ucrHeader + ' + Me.ucrHeader.Location = New System.Drawing.Point(7, 6) + Me.ucrHeader.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.ucrHeader.Name = "ucrHeader" + Me.ucrHeader.Size = New System.Drawing.Size(601, 300) + Me.ucrHeader.TabIndex = 16 + ' + 'tbpStub + ' + Me.tbpStub.Controls.Add(Me.ucrStub) + Me.tbpStub.Location = New System.Drawing.Point(4, 22) + Me.tbpStub.Name = "tbpStub" + Me.tbpStub.Size = New System.Drawing.Size(648, 431) + Me.tbpStub.TabIndex = 9 + Me.tbpStub.Text = "Stub" + Me.tbpStub.UseVisualStyleBackColor = True + ' + 'ucrStub + ' + Me.ucrStub.Location = New System.Drawing.Point(7, 7) + Me.ucrStub.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.ucrStub.Name = "ucrStub" + Me.ucrStub.Size = New System.Drawing.Size(425, 258) + Me.ucrStub.TabIndex = 0 + ' + 'tbpColumns + ' + Me.tbpColumns.Controls.Add(Me.ucrColumns) + Me.tbpColumns.Location = New System.Drawing.Point(4, 22) + Me.tbpColumns.Name = "tbpColumns" + Me.tbpColumns.Size = New System.Drawing.Size(648, 431) + Me.tbpColumns.TabIndex = 8 + Me.tbpColumns.Text = "Columns" + Me.tbpColumns.UseVisualStyleBackColor = True + ' + 'ucrColumns + ' + Me.ucrColumns.Location = New System.Drawing.Point(5, 6) + Me.ucrColumns.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.ucrColumns.Name = "ucrColumns" + Me.ucrColumns.Size = New System.Drawing.Size(632, 360) + Me.ucrColumns.TabIndex = 0 + ' + 'tbpRows + ' + Me.tbpRows.Controls.Add(Me.ucrRows) + Me.tbpRows.Location = New System.Drawing.Point(4, 22) + Me.tbpRows.Name = "tbpRows" + Me.tbpRows.Size = New System.Drawing.Size(648, 431) + Me.tbpRows.TabIndex = 7 + Me.tbpRows.Text = "Rows" + Me.tbpRows.UseVisualStyleBackColor = True + ' + 'ucrRows + ' + Me.ucrRows.Location = New System.Drawing.Point(7, 9) + Me.ucrRows.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.ucrRows.Name = "ucrRows" + Me.ucrRows.Size = New System.Drawing.Size(600, 421) + Me.ucrRows.TabIndex = 0 + ' + 'tbpCells + ' + Me.tbpCells.Controls.Add(Me.ucrCells) + Me.tbpCells.Location = New System.Drawing.Point(4, 22) + Me.tbpCells.Name = "tbpCells" + Me.tbpCells.Size = New System.Drawing.Size(648, 431) + Me.tbpCells.TabIndex = 3 + Me.tbpCells.Text = "Cells" + Me.tbpCells.UseVisualStyleBackColor = True + ' + 'ucrCells + ' + Me.ucrCells.Location = New System.Drawing.Point(8, 8) + Me.ucrCells.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.ucrCells.Name = "ucrCells" + Me.ucrCells.Size = New System.Drawing.Size(644, 360) + Me.ucrCells.TabIndex = 6 + ' + 'tbpSourceNotes + ' + Me.tbpSourceNotes.Controls.Add(Me.ucrSourceNotes) + Me.tbpSourceNotes.Location = New System.Drawing.Point(4, 22) + Me.tbpSourceNotes.Name = "tbpSourceNotes" + Me.tbpSourceNotes.Size = New System.Drawing.Size(648, 431) + Me.tbpSourceNotes.TabIndex = 4 + Me.tbpSourceNotes.Text = "Source Notes" + Me.tbpSourceNotes.UseVisualStyleBackColor = True + ' + 'ucrSourceNotes + ' + Me.ucrSourceNotes.Location = New System.Drawing.Point(7, 7) + Me.ucrSourceNotes.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.ucrSourceNotes.Name = "ucrSourceNotes" + Me.ucrSourceNotes.Size = New System.Drawing.Size(581, 190) + Me.ucrSourceNotes.TabIndex = 0 + ' + 'tbpThemes + ' + Me.tbpThemes.Controls.Add(Me.ucrCboSelectThemes) + Me.tbpThemes.Controls.Add(Me.btnManualTheme) + Me.tbpThemes.Controls.Add(Me.rdoSelectTheme) + Me.tbpThemes.Controls.Add(Me.rdoManualTheme) + Me.tbpThemes.Controls.Add(Me.ucrPnlThemesPanel) + Me.tbpThemes.Location = New System.Drawing.Point(4, 22) + Me.tbpThemes.Name = "tbpThemes" + Me.tbpThemes.Size = New System.Drawing.Size(648, 431) + Me.tbpThemes.TabIndex = 6 + Me.tbpThemes.Text = "Themes" + Me.tbpThemes.UseVisualStyleBackColor = True + ' + 'ucrCboSelectThemes + ' + Me.ucrCboSelectThemes.AddQuotesIfUnrecognised = True + Me.ucrCboSelectThemes.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboSelectThemes.GetSetSelectedIndex = -1 + Me.ucrCboSelectThemes.IsReadOnly = False + Me.ucrCboSelectThemes.Location = New System.Drawing.Point(157, 29) + Me.ucrCboSelectThemes.Margin = New System.Windows.Forms.Padding(9) + Me.ucrCboSelectThemes.Name = "ucrCboSelectThemes" + Me.ucrCboSelectThemes.Size = New System.Drawing.Size(168, 21) + Me.ucrCboSelectThemes.TabIndex = 3 + ' + 'btnManualTheme + ' + Me.btnManualTheme.Location = New System.Drawing.Point(157, 59) + Me.btnManualTheme.Name = "btnManualTheme" + Me.btnManualTheme.Size = New System.Drawing.Size(168, 21) + Me.btnManualTheme.TabIndex = 2 + Me.btnManualTheme.Text = "Custom Theme" + Me.btnManualTheme.UseVisualStyleBackColor = True + ' + 'rdoSelectTheme + ' + Me.rdoSelectTheme.AutoSize = True + Me.rdoSelectTheme.Checked = True + Me.rdoSelectTheme.Location = New System.Drawing.Point(22, 31) + Me.rdoSelectTheme.Name = "rdoSelectTheme" + Me.rdoSelectTheme.Size = New System.Drawing.Size(91, 17) + Me.rdoSelectTheme.TabIndex = 0 + Me.rdoSelectTheme.TabStop = True + Me.rdoSelectTheme.Text = "Select Theme" + Me.rdoSelectTheme.UseVisualStyleBackColor = True + ' + 'rdoManualTheme + ' + Me.rdoManualTheme.AutoSize = True + Me.rdoManualTheme.Location = New System.Drawing.Point(22, 61) + Me.rdoManualTheme.Name = "rdoManualTheme" + Me.rdoManualTheme.Size = New System.Drawing.Size(96, 17) + Me.rdoManualTheme.TabIndex = 1 + Me.rdoManualTheme.Text = "Manual Theme" + Me.rdoManualTheme.UseVisualStyleBackColor = True + ' + 'ucrPnlThemesPanel + ' + Me.ucrPnlThemesPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlThemesPanel.Location = New System.Drawing.Point(12, 16) + Me.ucrPnlThemesPanel.Margin = New System.Windows.Forms.Padding(6) + Me.ucrPnlThemesPanel.Name = "ucrPnlThemesPanel" + Me.ucrPnlThemesPanel.Size = New System.Drawing.Size(349, 70) + Me.ucrPnlThemesPanel.TabIndex = 4 + ' + 'tbpOtherStyles + ' + Me.tbpOtherStyles.Controls.Add(Me.ucrOtherStyles) + Me.tbpOtherStyles.Location = New System.Drawing.Point(4, 22) + Me.tbpOtherStyles.Name = "tbpOtherStyles" + Me.tbpOtherStyles.Padding = New System.Windows.Forms.Padding(3) + Me.tbpOtherStyles.Size = New System.Drawing.Size(648, 431) + Me.tbpOtherStyles.TabIndex = 10 + Me.tbpOtherStyles.Text = "Other Styles" + Me.tbpOtherStyles.UseVisualStyleBackColor = True + ' + 'ucrOtherStyles + ' + Me.ucrOtherStyles.Location = New System.Drawing.Point(8, 7) + Me.ucrOtherStyles.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.ucrOtherStyles.Name = "ucrOtherStyles" + Me.ucrOtherStyles.Size = New System.Drawing.Size(326, 179) + Me.ucrOtherStyles.TabIndex = 0 + ' + 'ucrSdgBaseButtons + ' + Me.ucrSdgBaseButtons.AutoSize = True + Me.ucrSdgBaseButtons.Location = New System.Drawing.Point(200, 465) + Me.ucrSdgBaseButtons.Margin = New System.Windows.Forms.Padding(4) + Me.ucrSdgBaseButtons.Name = "ucrSdgBaseButtons" + Me.ucrSdgBaseButtons.Size = New System.Drawing.Size(224, 30) + Me.ucrSdgBaseButtons.TabIndex = 343 + ' + 'sdgTableOptions + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(661, 500) + Me.Controls.Add(Me.ucrSdgBaseButtons) + Me.Controls.Add(Me.tbpFormatOptions) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.Name = "sdgTableOptions" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent + Me.Text = "Table Options" + Me.tbpFormatOptions.ResumeLayout(False) + Me.tbpHeader.ResumeLayout(False) + Me.tbpStub.ResumeLayout(False) + Me.tbpColumns.ResumeLayout(False) + Me.tbpRows.ResumeLayout(False) + Me.tbpCells.ResumeLayout(False) + Me.tbpSourceNotes.ResumeLayout(False) + Me.tbpThemes.ResumeLayout(False) + Me.tbpThemes.PerformLayout() + Me.tbpOtherStyles.ResumeLayout(False) + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents tbpFormatOptions As TabControl + Friend WithEvents tbpHeader As TabPage + Friend WithEvents tbpCells As TabPage + Friend WithEvents tbpSourceNotes As TabPage + Friend WithEvents tbpThemes As TabPage + Friend WithEvents ucrCboSelectThemes As ucrInputComboBox + Friend WithEvents btnManualTheme As Button + Friend WithEvents rdoSelectTheme As RadioButton + Friend WithEvents rdoManualTheme As RadioButton + Friend WithEvents ucrPnlThemesPanel As UcrPanel + Friend WithEvents ucrSourceNotes As ucrSourceNotes + Friend WithEvents tbpRows As TabPage + Friend WithEvents ucrHeader As ucrHeader + Friend WithEvents tbpColumns As TabPage + Friend WithEvents ucrColumns As ucrColumns + Friend WithEvents ucrRows As ucrRows + Friend WithEvents tbpStub As TabPage + Friend WithEvents ucrStub As ucrStub + Friend WithEvents ucrCells As ucrCells + Friend WithEvents ucrSdgBaseButtons As ucrButtonsSubdialogue + Friend WithEvents tbpOtherStyles As TabPage + Friend WithEvents ucrOtherStyles As ucrOtherStyles +End Class diff --git a/instat/UserTables/sdgTableOptions.resx b/instat/UserTables/sdgTableOptions.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/instat/UserTables/sdgTableOptions.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/instat/UserTables/sdgTableOptions.vb b/instat/UserTables/sdgTableOptions.vb new file mode 100644 index 00000000000..53386ef1e0b --- /dev/null +++ b/instat/UserTables/sdgTableOptions.vb @@ -0,0 +1,165 @@ +' 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 sdgTableOptions + + Private clsOperator As ROperator + Private clsThemeRFunction As RFunction + Private bFirstload As Boolean = True + + Private Sub sdgTableOptions_Load(sender As Object, e As EventArgs) Handles MyBase.Load + If bFirstload Then + InitialiseDialog() + bFirstload = False + End If + autoTranslate(Me) + End Sub + + Private Sub InitialiseDialog() + ucrSdgBaseButtons.iHelpTopicID = 146 + + ucrPnlThemesPanel.AddRadioButton(rdoSelectTheme) + ucrPnlThemesPanel.AddRadioButton(rdoManualTheme) + + ucrCboSelectThemes.SetItems({"None", "Dark Theme", "538 Theme", "Dot Matrix Theme", "Espn Theme", "Excel Theme", "Guardian Theme", "NY Times Theme", "PFF Theme"}) + ucrCboSelectThemes.SetDropDownStyleAsNonEditable() + End Sub + + ''' + ''' An R operateor that has a parameter named "gt" set up. + ''' The parameter should be an R Function that generates script "gt:gt()" as part of the last script statement. + ''' + ''' + Public Sub Setup(strDataFrameName As String, clsNewOperator As ROperator) + If clsTablesUtils.FindRFunctionsParamsWithRCommand({"gt"}, clsNewOperator).Count = 0 Then + MsgBox("Developer Error: Parameter with 'gt' as name MUST be set up before using this subdialog") + Exit Sub + End If + + clsOperator = clsNewOperator + + ucrHeader.Setup(clsOperator) + ucrStub.Setup(strDataFrameName, clsOperator) + ucrRows.Setup(strDataFrameName, clsOperator) + ucrColumns.Setup(strDataFrameName, clsOperator) + ucrCells.Setup(strDataFrameName, clsOperator) + ucrSourceNotes.Setup(clsOperator) + ucrOtherStyles.Setup(clsOperator) + + SetupTheme(clsOperator) + End Sub + + Private Sub ucrSdgBaseButtons_ClickReturn(sender As Object, e As EventArgs) Handles ucrSdgBaseButtons.ClickReturn + ucrHeader.SetValuesToOperator() + ucrStub.SetValuesToOperator() + ucrColumns.SetValuesToOperator() + ucrRows.SetValuesToOperator() + ucrCells.SetValuesToOperator() + ucrSourceNotes.SetValuesToOperator() + ucrOtherStyles.SetValuesToOperator() + SetThemeValuesOnReturn(clsOperator) + End Sub + + + '----------------------------------------- + ' Themes + + Private Sub SetupTheme(clsOperator As ROperator) + clsThemeRFunction = New RFunction + + ' Uncheck then the check radio button to forces the panel to raise its ControlValueChanged event + rdoSelectTheme.Checked = False + rdoSelectTheme.Checked = True + + If Not clsOperator.ContainsParameter("theme_format") Then + Exit Sub + End If + + clsThemeRFunction = clsOperator.GetParameter("theme_format").clsArgumentCodeStructure + + If clsThemeRFunction.strRCommand = "tab_options" Then + rdoManualTheme.Checked = True + Else + rdoSelectTheme.Checked = True + ucrCboSelectThemes.SetName(clsThemeRFunction.strRCommand) + End If + + End Sub + + Private Sub ucrPnlThemes_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlThemesPanel.ControlValueChanged + ucrCboSelectThemes.Visible = False + btnManualTheme.Visible = False + + If rdoSelectTheme.Checked Then + ucrCboSelectThemes.Visible = True + clsThemeRFunction.SetPackageName("gtExtras") + clsThemeRFunction.ClearParameters() + ElseIf rdoManualTheme.Checked Then + btnManualTheme.Visible = True + clsThemeRFunction.SetPackageName("gt") + clsThemeRFunction.SetRCommand("tab_options") + End If + + End Sub + + Private Sub ucrCboSelectThemes_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrCboSelectThemes.ControlValueChanged + + If clsThemeRFunction Is Nothing Then + Exit Sub + End If + + Dim strCommand As String = "" + Select Case ucrCboSelectThemes.GetText + Case "Dark Theme" + strCommand = "gt_theme_dark" + Case "538 Theme" + strCommand = "gt_theme_538" + Case "Dot Matrix Theme" + strCommand = "gt_theme_dot_matrix" + Case "Espn Theme" + strCommand = "gt_theme_espn" + Case "Excel Theme" + strCommand = "gt_theme_excel" + Case "Guardian Theme" + strCommand = "gt_theme_guardian" + Case "NY Times Theme" + strCommand = "gt_theme_nytimes" + Case "PFF Theme" + strCommand = "gt_theme_pff" + End Select + + clsThemeRFunction.SetRCommand(strCommand) + End Sub + + Private Sub btnManualTheme_Click(sender As Object, e As EventArgs) Handles btnManualTheme.Click + sdgSummaryThemes.SetRCode(bReset:=True, clsNewThemesTabOption:=clsThemeRFunction) + sdgSummaryThemes.ShowDialog(Me) + End Sub + + Private Sub SetThemeValuesOnReturn(clsOperator As ROperator) + ' Set the themes parameter if there was a theme selected + If clsThemeRFunction IsNot Nothing AndAlso Not String.IsNullOrEmpty(clsThemeRFunction.strRCommand) Then + clsOperator.AddParameter("theme_format", clsRFunctionParameter:=clsThemeRFunction) + Else + clsOperator.RemoveParameterByName("theme_format") + End If + End Sub + '----------------------------------------- + + +End Class \ No newline at end of file diff --git a/instat/UserTables/sdgTableRowExpression.Designer.vb b/instat/UserTables/sdgTableRowExpression.Designer.vb new file mode 100644 index 00000000000..45e15079c89 --- /dev/null +++ b/instat/UserTables/sdgTableRowExpression.Designer.vb @@ -0,0 +1,139 @@ + +Partial Class sdgTableRowExpression + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + + Private Sub InitializeComponent() + Me.cboCondition = New System.Windows.Forms.ComboBox() + Me.lblCondition = New System.Windows.Forms.Label() + Me.lblExpression = New System.Windows.Forms.Label() + Me.ucrSelectorCols = New instat.ucrSelectorByDataFrameAddRemove() + Me.ucrSdgBaseButtons = New instat.ucrButtonsSubdialogue() + Me.btnAddCondition = New System.Windows.Forms.Button() + Me.ucrReceiverExpression = New instat.ucrReceiverExpression() + Me.SuspendLayout() + ' + 'cboCondition + ' + Me.cboCondition.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.cboCondition.FormattingEnabled = True + Me.cboCondition.Items.AddRange(New Object() {"==", "<", "<=", ">", ">=", "!=", "Expression"}) + Me.cboCondition.Location = New System.Drawing.Point(360, 38) + Me.cboCondition.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.cboCondition.Name = "cboCondition" + Me.cboCondition.Size = New System.Drawing.Size(220, 28) + Me.cboCondition.TabIndex = 285 + ' + 'lblCondition + ' + Me.lblCondition.AutoSize = True + Me.lblCondition.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblCondition.Location = New System.Drawing.Point(356, 14) + Me.lblCondition.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblCondition.Name = "lblCondition" + Me.lblCondition.Size = New System.Drawing.Size(80, 20) + Me.lblCondition.TabIndex = 284 + Me.lblCondition.Text = "Condition:" + ' + 'lblExpression + ' + Me.lblExpression.AutoSize = True + Me.lblExpression.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblExpression.Location = New System.Drawing.Point(356, 157) + Me.lblExpression.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblExpression.Name = "lblExpression" + Me.lblExpression.Size = New System.Drawing.Size(91, 20) + Me.lblExpression.TabIndex = 283 + Me.lblExpression.Text = "Expression:" + ' + 'ucrSelectorCols + ' + Me.ucrSelectorCols.AutoSize = True + Me.ucrSelectorCols.bDropUnusedFilterLevels = False + Me.ucrSelectorCols.bShowHiddenColumns = False + Me.ucrSelectorCols.bUseCurrentFilter = True + Me.ucrSelectorCols.Location = New System.Drawing.Point(8, 6) + Me.ucrSelectorCols.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectorCols.Name = "ucrSelectorCols" + Me.ucrSelectorCols.Size = New System.Drawing.Size(320, 282) + Me.ucrSelectorCols.TabIndex = 281 + ' + 'ucrSdgBaseButtons + ' + Me.ucrSdgBaseButtons.AutoSize = True + Me.ucrSdgBaseButtons.Location = New System.Drawing.Point(159, 338) + Me.ucrSdgBaseButtons.Margin = New System.Windows.Forms.Padding(6) + Me.ucrSdgBaseButtons.Name = "ucrSdgBaseButtons" + Me.ucrSdgBaseButtons.Size = New System.Drawing.Size(336, 46) + Me.ucrSdgBaseButtons.TabIndex = 344 + ' + 'btnAddCondition + ' + Me.btnAddCondition.Location = New System.Drawing.Point(580, 35) + Me.btnAddCondition.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.btnAddCondition.Name = "btnAddCondition" + Me.btnAddCondition.Size = New System.Drawing.Size(98, 35) + Me.btnAddCondition.TabIndex = 346 + Me.btnAddCondition.Text = "Add" + Me.btnAddCondition.UseVisualStyleBackColor = True + ' + 'ucrReceiverExpression + ' + Me.ucrReceiverExpression.AutoSize = True + Me.ucrReceiverExpression.frmParent = Me + Me.ucrReceiverExpression.Location = New System.Drawing.Point(360, 182) + Me.ucrReceiverExpression.Margin = New System.Windows.Forms.Padding(9) + Me.ucrReceiverExpression.Name = "ucrReceiverExpression" + Me.ucrReceiverExpression.Selector = Nothing + Me.ucrReceiverExpression.Size = New System.Drawing.Size(266, 45) + Me.ucrReceiverExpression.strNcFilePath = "" + Me.ucrReceiverExpression.TabIndex = 347 + Me.ucrReceiverExpression.ucrSelector = Nothing + ' + 'sdgTableRowExpression + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(9.0!, 20.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(684, 397) + Me.Controls.Add(Me.ucrReceiverExpression) + Me.Controls.Add(Me.btnAddCondition) + Me.Controls.Add(Me.ucrSdgBaseButtons) + Me.Controls.Add(Me.cboCondition) + Me.Controls.Add(Me.lblCondition) + Me.Controls.Add(Me.lblExpression) + Me.Controls.Add(Me.ucrSelectorCols) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.Name = "sdgTableRowExpression" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent + Me.Text = "Set Expression" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents cboCondition As ComboBox + Friend WithEvents lblCondition As Label + Friend WithEvents lblExpression As Label + Friend WithEvents ucrSelectorCols As ucrSelectorByDataFrameAddRemove + Friend WithEvents ucrSdgBaseButtons As ucrButtonsSubdialogue + Friend WithEvents btnAddCondition As Button + Friend WithEvents ucrReceiverExpression As ucrReceiverExpression +End Class diff --git a/instat/UserTables/sdgTableRowExpression.resx b/instat/UserTables/sdgTableRowExpression.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/instat/UserTables/sdgTableRowExpression.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/instat/UserTables/sdgTableRowExpression.vb b/instat/UserTables/sdgTableRowExpression.vb new file mode 100644 index 00000000000..b115b6333ec --- /dev/null +++ b/instat/UserTables/sdgTableRowExpression.vb @@ -0,0 +1,44 @@ +Public Class sdgTableRowExpression + Private bFirstload As Boolean = True + Public bUserClickedReturn As Boolean = False + + Private Sub sdgTableRowExpression_Load(sender As Object, e As EventArgs) Handles MyBase.Load + If bFirstload Then + InitialiseControl() + bFirstload = False + End If + + bUserClickedReturn = False + End Sub + + Private Sub InitialiseControl() + ucrReceiverExpression.Selector = ucrSelectorCols + ucrReceiverExpression.SetMeAsReceiver() + End Sub + + Public Sub Setup(strDataFrameName As String) + If bFirstload Then + InitialiseControl() + bFirstload = False + End If + + + ' Set up the selector + ucrSelectorCols.SetDataframe(strDataFrameName, bEnableDataframe:=False) + ucrReceiverExpression.Clear() + + End Sub + + ' TODO. In future this can be refactored to return an RFunction + Public Function GetUserInputRowExpression() As String + Return ucrReceiverExpression.GetText() + End Function + + Private Sub btnAddCondition_Click(sender As Object, e As EventArgs) Handles btnAddCondition.Click + ucrReceiverExpression.AddToReceiverAtCursorPosition(cboCondition.Text) + End Sub + + Private Sub ucrSdgBaseButtons_ClickReturn(sender As Object, e As EventArgs) Handles ucrSdgBaseButtons.ClickReturn + bUserClickedReturn = True + End Sub +End Class \ No newline at end of file diff --git a/instat/UserTables/sdgTableStyles.Designer.vb b/instat/UserTables/sdgTableStyles.Designer.vb new file mode 100644 index 00000000000..75bdb4b6f3f --- /dev/null +++ b/instat/UserTables/sdgTableStyles.Designer.vb @@ -0,0 +1,611 @@ + _ +Partial Class sdgTableStyles + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.Label2 = New System.Windows.Forms.Label() + Me.grpBoxColor = New System.Windows.Forms.GroupBox() + Me.ucrCboColorBackground = New instat.ucrColors() + Me.ucrCboColorText = New instat.ucrColors() + Me.lblFill = New System.Windows.Forms.Label() + Me.grpBoxAlignment = New System.Windows.Forms.GroupBox() + Me.lblAlignVertical = New System.Windows.Forms.Label() + Me.ucrCboAlignVertical = New instat.ucrInputComboBox() + Me.lblAlignHorizontal = New System.Windows.Forms.Label() + Me.ucrCboAlignHorizontal = New instat.ucrInputComboBox() + Me.lblUnderlineType = New System.Windows.Forms.Label() + Me.ucrCboUnderlineType = New instat.ucrInputComboBox() + Me.lblFontWeight = New System.Windows.Forms.Label() + Me.grpBoxFont = New System.Windows.Forms.GroupBox() + Me.ucrTxtFontSize = New instat.ucrInputTextBox() + Me.ucrCboFontWeight = New instat.ucrInputComboBox() + Me.lblFontFamily = New System.Windows.Forms.Label() + Me.ucrCboFontStyle = New instat.ucrInputComboBox() + Me.ucrCboFontFamily = New instat.ucrInputComboBox() + Me.lblFontStyle = New System.Windows.Forms.Label() + Me.lblFontSize = New System.Windows.Forms.Label() + Me.grpBoxOthers = New System.Windows.Forms.GroupBox() + Me.ucrNudIndent = New instat.ucrNud() + Me.lblStretch = New System.Windows.Forms.Label() + Me.ucrCboStretch = New instat.ucrInputComboBox() + Me.lblWhiteSpace = New System.Windows.Forms.Label() + Me.ucrCboWhiteSpace = New instat.ucrInputComboBox() + Me.lblIndent = New System.Windows.Forms.Label() + Me.lblTransform = New System.Windows.Forms.Label() + Me.ucrCboTransform = New instat.ucrInputComboBox() + Me.grpBoxBorders = New System.Windows.Forms.GroupBox() + Me.ucrNudBorderWeight = New instat.ucrNud() + Me.grpBoxSides = New System.Windows.Forms.GroupBox() + Me.ucrChkBorderLeft = New instat.ucrCheck() + Me.ucrChkBorderBottom = New instat.ucrCheck() + Me.ucrChkBorderTop = New instat.ucrCheck() + Me.ucrChkBorderRight = New instat.ucrCheck() + Me.lblBorderStyle = New System.Windows.Forms.Label() + Me.ucrCboBorderStyle = New instat.ucrInputComboBox() + Me.ucrCboBorderColor = New instat.ucrColors() + Me.lblBorderWeight = New System.Windows.Forms.Label() + Me.lblBorderColor = New System.Windows.Forms.Label() + Me.ucrBaseSubdialog = New instat.ucrButtonsSubdialogue() + Me.grpBoxColor.SuspendLayout() + Me.grpBoxAlignment.SuspendLayout() + Me.grpBoxFont.SuspendLayout() + Me.grpBoxOthers.SuspendLayout() + Me.grpBoxBorders.SuspendLayout() + Me.grpBoxSides.SuspendLayout() + Me.SuspendLayout() + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(155, 21) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(68, 13) + Me.Label2.TabIndex = 16 + Me.Label2.Text = "Background:" + ' + 'grpBoxColor + ' + Me.grpBoxColor.Controls.Add(Me.ucrCboColorBackground) + Me.grpBoxColor.Controls.Add(Me.ucrCboColorText) + Me.grpBoxColor.Controls.Add(Me.lblFill) + Me.grpBoxColor.Controls.Add(Me.Label2) + Me.grpBoxColor.Location = New System.Drawing.Point(7, 78) + Me.grpBoxColor.Name = "grpBoxColor" + Me.grpBoxColor.Size = New System.Drawing.Size(594, 68) + Me.grpBoxColor.TabIndex = 29 + Me.grpBoxColor.TabStop = False + Me.grpBoxColor.Text = "Color" + ' + 'ucrCboColorBackground + ' + Me.ucrCboColorBackground.AddQuotesIfUnrecognised = True + Me.ucrCboColorBackground.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboColorBackground.GetSetSelectedIndex = -1 + Me.ucrCboColorBackground.IsReadOnly = False + Me.ucrCboColorBackground.Location = New System.Drawing.Point(157, 37) + Me.ucrCboColorBackground.Name = "ucrCboColorBackground" + Me.ucrCboColorBackground.Size = New System.Drawing.Size(137, 21) + Me.ucrCboColorBackground.TabIndex = 18 + ' + 'ucrCboColorText + ' + Me.ucrCboColorText.AddQuotesIfUnrecognised = True + Me.ucrCboColorText.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboColorText.GetSetSelectedIndex = -1 + Me.ucrCboColorText.IsReadOnly = False + Me.ucrCboColorText.Location = New System.Drawing.Point(9, 37) + Me.ucrCboColorText.Name = "ucrCboColorText" + Me.ucrCboColorText.Size = New System.Drawing.Size(137, 21) + Me.ucrCboColorText.TabIndex = 17 + ' + 'lblFill + ' + Me.lblFill.AutoSize = True + Me.lblFill.Location = New System.Drawing.Point(6, 21) + Me.lblFill.Name = "lblFill" + Me.lblFill.Size = New System.Drawing.Size(31, 13) + Me.lblFill.TabIndex = 14 + Me.lblFill.Text = "Text:" + ' + 'grpBoxAlignment + ' + Me.grpBoxAlignment.Controls.Add(Me.lblAlignVertical) + Me.grpBoxAlignment.Controls.Add(Me.ucrCboAlignVertical) + Me.grpBoxAlignment.Controls.Add(Me.lblAlignHorizontal) + Me.grpBoxAlignment.Controls.Add(Me.ucrCboAlignHorizontal) + Me.grpBoxAlignment.Location = New System.Drawing.Point(7, 149) + Me.grpBoxAlignment.Name = "grpBoxAlignment" + Me.grpBoxAlignment.Size = New System.Drawing.Size(594, 65) + Me.grpBoxAlignment.TabIndex = 28 + Me.grpBoxAlignment.TabStop = False + Me.grpBoxAlignment.Text = "Alignment" + ' + 'lblAlignVertical + ' + Me.lblAlignVertical.AutoSize = True + Me.lblAlignVertical.Location = New System.Drawing.Point(155, 20) + Me.lblAlignVertical.Name = "lblAlignVertical" + Me.lblAlignVertical.Size = New System.Drawing.Size(45, 13) + Me.lblAlignVertical.TabIndex = 20 + Me.lblAlignVertical.Text = "Vertical:" + ' + 'ucrCboAlignVertical + ' + Me.ucrCboAlignVertical.AddQuotesIfUnrecognised = True + Me.ucrCboAlignVertical.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboAlignVertical.GetSetSelectedIndex = -1 + Me.ucrCboAlignVertical.IsReadOnly = False + Me.ucrCboAlignVertical.Location = New System.Drawing.Point(158, 36) + Me.ucrCboAlignVertical.Name = "ucrCboAlignVertical" + Me.ucrCboAlignVertical.Size = New System.Drawing.Size(137, 21) + Me.ucrCboAlignVertical.TabIndex = 19 + ' + 'lblAlignHorizontal + ' + Me.lblAlignHorizontal.AutoSize = True + Me.lblAlignHorizontal.Location = New System.Drawing.Point(6, 20) + Me.lblAlignHorizontal.Name = "lblAlignHorizontal" + Me.lblAlignHorizontal.Size = New System.Drawing.Size(57, 13) + Me.lblAlignHorizontal.TabIndex = 18 + Me.lblAlignHorizontal.Text = "Horizontal:" + ' + 'ucrCboAlignHorizontal + ' + Me.ucrCboAlignHorizontal.AddQuotesIfUnrecognised = True + Me.ucrCboAlignHorizontal.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboAlignHorizontal.GetSetSelectedIndex = -1 + Me.ucrCboAlignHorizontal.IsReadOnly = False + Me.ucrCboAlignHorizontal.Location = New System.Drawing.Point(9, 36) + Me.ucrCboAlignHorizontal.Name = "ucrCboAlignHorizontal" + Me.ucrCboAlignHorizontal.Size = New System.Drawing.Size(137, 21) + Me.ucrCboAlignHorizontal.TabIndex = 17 + ' + 'lblUnderlineType + ' + Me.lblUnderlineType.AutoSize = True + Me.lblUnderlineType.Location = New System.Drawing.Point(6, 67) + Me.lblUnderlineType.Name = "lblUnderlineType" + Me.lblUnderlineType.Size = New System.Drawing.Size(82, 13) + Me.lblUnderlineType.TabIndex = 21 + Me.lblUnderlineType.Text = "Underline Type:" + ' + 'ucrCboUnderlineType + ' + Me.ucrCboUnderlineType.AddQuotesIfUnrecognised = True + Me.ucrCboUnderlineType.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboUnderlineType.GetSetSelectedIndex = -1 + Me.ucrCboUnderlineType.IsReadOnly = False + Me.ucrCboUnderlineType.Location = New System.Drawing.Point(9, 83) + Me.ucrCboUnderlineType.Name = "ucrCboUnderlineType" + Me.ucrCboUnderlineType.Size = New System.Drawing.Size(137, 21) + Me.ucrCboUnderlineType.TabIndex = 20 + ' + 'lblFontWeight + ' + Me.lblFontWeight.AutoSize = True + Me.lblFontWeight.Location = New System.Drawing.Point(297, 19) + Me.lblFontWeight.Name = "lblFontWeight" + Me.lblFontWeight.Size = New System.Drawing.Size(44, 13) + Me.lblFontWeight.TabIndex = 14 + Me.lblFontWeight.Text = "Weight:" + ' + 'grpBoxFont + ' + Me.grpBoxFont.Controls.Add(Me.ucrTxtFontSize) + Me.grpBoxFont.Controls.Add(Me.ucrCboFontWeight) + Me.grpBoxFont.Controls.Add(Me.lblFontWeight) + Me.grpBoxFont.Controls.Add(Me.lblFontFamily) + Me.grpBoxFont.Controls.Add(Me.ucrCboFontStyle) + Me.grpBoxFont.Controls.Add(Me.ucrCboFontFamily) + Me.grpBoxFont.Controls.Add(Me.lblFontStyle) + Me.grpBoxFont.Controls.Add(Me.lblFontSize) + Me.grpBoxFont.Location = New System.Drawing.Point(7, 6) + Me.grpBoxFont.Name = "grpBoxFont" + Me.grpBoxFont.Size = New System.Drawing.Size(594, 68) + Me.grpBoxFont.TabIndex = 26 + Me.grpBoxFont.TabStop = False + Me.grpBoxFont.Text = "Font" + ' + 'ucrTxtFontSize + ' + Me.ucrTxtFontSize.AddQuotesIfUnrecognised = True + Me.ucrTxtFontSize.AutoSize = True + Me.ucrTxtFontSize.IsMultiline = False + Me.ucrTxtFontSize.IsReadOnly = False + Me.ucrTxtFontSize.Location = New System.Drawing.Point(447, 35) + Me.ucrTxtFontSize.Name = "ucrTxtFontSize" + Me.ucrTxtFontSize.Size = New System.Drawing.Size(137, 21) + Me.ucrTxtFontSize.TabIndex = 15 + ' + 'ucrCboFontWeight + ' + Me.ucrCboFontWeight.AddQuotesIfUnrecognised = True + Me.ucrCboFontWeight.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboFontWeight.GetSetSelectedIndex = -1 + Me.ucrCboFontWeight.IsReadOnly = False + Me.ucrCboFontWeight.Location = New System.Drawing.Point(300, 35) + Me.ucrCboFontWeight.Name = "ucrCboFontWeight" + Me.ucrCboFontWeight.Size = New System.Drawing.Size(137, 21) + Me.ucrCboFontWeight.TabIndex = 13 + ' + 'lblFontFamily + ' + Me.lblFontFamily.AutoSize = True + Me.lblFontFamily.Location = New System.Drawing.Point(6, 19) + Me.lblFontFamily.Name = "lblFontFamily" + Me.lblFontFamily.Size = New System.Drawing.Size(69, 13) + Me.lblFontFamily.TabIndex = 6 + Me.lblFontFamily.Text = "Type (family):" + ' + 'ucrCboFontStyle + ' + Me.ucrCboFontStyle.AddQuotesIfUnrecognised = True + Me.ucrCboFontStyle.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboFontStyle.GetSetSelectedIndex = -1 + Me.ucrCboFontStyle.IsReadOnly = False + Me.ucrCboFontStyle.Location = New System.Drawing.Point(154, 35) + Me.ucrCboFontStyle.Name = "ucrCboFontStyle" + Me.ucrCboFontStyle.Size = New System.Drawing.Size(137, 21) + Me.ucrCboFontStyle.TabIndex = 7 + ' + 'ucrCboFontFamily + ' + Me.ucrCboFontFamily.AddQuotesIfUnrecognised = True + Me.ucrCboFontFamily.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboFontFamily.GetSetSelectedIndex = -1 + Me.ucrCboFontFamily.IsReadOnly = False + Me.ucrCboFontFamily.Location = New System.Drawing.Point(9, 35) + Me.ucrCboFontFamily.Name = "ucrCboFontFamily" + Me.ucrCboFontFamily.Size = New System.Drawing.Size(137, 21) + Me.ucrCboFontFamily.TabIndex = 5 + ' + 'lblFontStyle + ' + Me.lblFontStyle.AutoSize = True + Me.lblFontStyle.Location = New System.Drawing.Point(151, 19) + Me.lblFontStyle.Name = "lblFontStyle" + Me.lblFontStyle.Size = New System.Drawing.Size(33, 13) + Me.lblFontStyle.TabIndex = 8 + Me.lblFontStyle.Text = "Style:" + ' + 'lblFontSize + ' + Me.lblFontSize.AutoSize = True + Me.lblFontSize.Location = New System.Drawing.Point(444, 19) + Me.lblFontSize.Name = "lblFontSize" + Me.lblFontSize.Size = New System.Drawing.Size(30, 13) + Me.lblFontSize.TabIndex = 10 + Me.lblFontSize.Text = "Size:" + ' + 'grpBoxOthers + ' + Me.grpBoxOthers.Controls.Add(Me.lblUnderlineType) + Me.grpBoxOthers.Controls.Add(Me.ucrCboUnderlineType) + Me.grpBoxOthers.Controls.Add(Me.ucrNudIndent) + Me.grpBoxOthers.Controls.Add(Me.lblStretch) + Me.grpBoxOthers.Controls.Add(Me.ucrCboStretch) + Me.grpBoxOthers.Controls.Add(Me.lblWhiteSpace) + Me.grpBoxOthers.Controls.Add(Me.ucrCboWhiteSpace) + Me.grpBoxOthers.Controls.Add(Me.lblIndent) + Me.grpBoxOthers.Controls.Add(Me.lblTransform) + Me.grpBoxOthers.Controls.Add(Me.ucrCboTransform) + Me.grpBoxOthers.Location = New System.Drawing.Point(7, 330) + Me.grpBoxOthers.Name = "grpBoxOthers" + Me.grpBoxOthers.Size = New System.Drawing.Size(594, 132) + Me.grpBoxOthers.TabIndex = 30 + Me.grpBoxOthers.TabStop = False + Me.grpBoxOthers.Text = "Others" + ' + 'ucrNudIndent + ' + Me.ucrNudIndent.AutoSize = True + Me.ucrNudIndent.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudIndent.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudIndent.Location = New System.Drawing.Point(469, 35) + Me.ucrNudIndent.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudIndent.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudIndent.Name = "ucrNudIndent" + Me.ucrNudIndent.Size = New System.Drawing.Size(50, 20) + Me.ucrNudIndent.TabIndex = 27 + Me.ucrNudIndent.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'lblStretch + ' + Me.lblStretch.AutoSize = True + Me.lblStretch.Location = New System.Drawing.Point(302, 20) + Me.lblStretch.Name = "lblStretch" + Me.lblStretch.Size = New System.Drawing.Size(44, 13) + Me.lblStretch.TabIndex = 24 + Me.lblStretch.Text = "Stretch:" + ' + 'ucrCboStretch + ' + Me.ucrCboStretch.AddQuotesIfUnrecognised = True + Me.ucrCboStretch.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboStretch.GetSetSelectedIndex = -1 + Me.ucrCboStretch.IsReadOnly = False + Me.ucrCboStretch.Location = New System.Drawing.Point(303, 36) + Me.ucrCboStretch.Name = "ucrCboStretch" + Me.ucrCboStretch.Size = New System.Drawing.Size(137, 21) + Me.ucrCboStretch.TabIndex = 23 + ' + 'lblWhiteSpace + ' + Me.lblWhiteSpace.AutoSize = True + Me.lblWhiteSpace.Location = New System.Drawing.Point(155, 20) + Me.lblWhiteSpace.Name = "lblWhiteSpace" + Me.lblWhiteSpace.Size = New System.Drawing.Size(72, 13) + Me.lblWhiteSpace.TabIndex = 22 + Me.lblWhiteSpace.Text = "White Space:" + ' + 'ucrCboWhiteSpace + ' + Me.ucrCboWhiteSpace.AddQuotesIfUnrecognised = True + Me.ucrCboWhiteSpace.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboWhiteSpace.GetSetSelectedIndex = -1 + Me.ucrCboWhiteSpace.IsReadOnly = False + Me.ucrCboWhiteSpace.Location = New System.Drawing.Point(158, 36) + Me.ucrCboWhiteSpace.Name = "ucrCboWhiteSpace" + Me.ucrCboWhiteSpace.Size = New System.Drawing.Size(137, 21) + Me.ucrCboWhiteSpace.TabIndex = 21 + ' + 'lblIndent + ' + Me.lblIndent.AutoSize = True + Me.lblIndent.Location = New System.Drawing.Point(466, 16) + Me.lblIndent.Name = "lblIndent" + Me.lblIndent.Size = New System.Drawing.Size(40, 13) + Me.lblIndent.TabIndex = 19 + Me.lblIndent.Text = "Indent:" + ' + 'lblTransform + ' + Me.lblTransform.AutoSize = True + Me.lblTransform.Location = New System.Drawing.Point(6, 20) + Me.lblTransform.Name = "lblTransform" + Me.lblTransform.Size = New System.Drawing.Size(57, 13) + Me.lblTransform.TabIndex = 18 + Me.lblTransform.Text = "Transform:" + ' + 'ucrCboTransform + ' + Me.ucrCboTransform.AddQuotesIfUnrecognised = True + Me.ucrCboTransform.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboTransform.GetSetSelectedIndex = -1 + Me.ucrCboTransform.IsReadOnly = False + Me.ucrCboTransform.Location = New System.Drawing.Point(9, 36) + Me.ucrCboTransform.Name = "ucrCboTransform" + Me.ucrCboTransform.Size = New System.Drawing.Size(137, 21) + Me.ucrCboTransform.TabIndex = 17 + ' + 'grpBoxBorders + ' + Me.grpBoxBorders.Controls.Add(Me.ucrNudBorderWeight) + Me.grpBoxBorders.Controls.Add(Me.grpBoxSides) + Me.grpBoxBorders.Controls.Add(Me.lblBorderStyle) + Me.grpBoxBorders.Controls.Add(Me.ucrCboBorderStyle) + Me.grpBoxBorders.Controls.Add(Me.ucrCboBorderColor) + Me.grpBoxBorders.Controls.Add(Me.lblBorderWeight) + Me.grpBoxBorders.Controls.Add(Me.lblBorderColor) + Me.grpBoxBorders.Location = New System.Drawing.Point(7, 218) + Me.grpBoxBorders.Name = "grpBoxBorders" + Me.grpBoxBorders.Size = New System.Drawing.Size(594, 109) + Me.grpBoxBorders.TabIndex = 31 + Me.grpBoxBorders.TabStop = False + Me.grpBoxBorders.Text = "Borders" + ' + 'ucrNudBorderWeight + ' + Me.ucrNudBorderWeight.AutoSize = True + Me.ucrNudBorderWeight.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudBorderWeight.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudBorderWeight.Location = New System.Drawing.Point(469, 36) + Me.ucrNudBorderWeight.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudBorderWeight.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudBorderWeight.Name = "ucrNudBorderWeight" + Me.ucrNudBorderWeight.Size = New System.Drawing.Size(50, 20) + Me.ucrNudBorderWeight.TabIndex = 26 + Me.ucrNudBorderWeight.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'grpBoxSides + ' + Me.grpBoxSides.Controls.Add(Me.ucrChkBorderLeft) + Me.grpBoxSides.Controls.Add(Me.ucrChkBorderBottom) + Me.grpBoxSides.Controls.Add(Me.ucrChkBorderTop) + Me.grpBoxSides.Controls.Add(Me.ucrChkBorderRight) + Me.grpBoxSides.Location = New System.Drawing.Point(9, 19) + Me.grpBoxSides.Name = "grpBoxSides" + Me.grpBoxSides.Size = New System.Drawing.Size(259, 83) + Me.grpBoxSides.TabIndex = 21 + Me.grpBoxSides.TabStop = False + Me.grpBoxSides.Text = "Sides" + ' + 'ucrChkBorderLeft + ' + Me.ucrChkBorderLeft.AutoSize = True + Me.ucrChkBorderLeft.Checked = False + Me.ucrChkBorderLeft.Location = New System.Drawing.Point(6, 21) + Me.ucrChkBorderLeft.Name = "ucrChkBorderLeft" + Me.ucrChkBorderLeft.Size = New System.Drawing.Size(100, 23) + Me.ucrChkBorderLeft.TabIndex = 26 + ' + 'ucrChkBorderBottom + ' + Me.ucrChkBorderBottom.AutoSize = True + Me.ucrChkBorderBottom.Checked = False + Me.ucrChkBorderBottom.Location = New System.Drawing.Point(137, 54) + Me.ucrChkBorderBottom.Name = "ucrChkBorderBottom" + Me.ucrChkBorderBottom.Size = New System.Drawing.Size(100, 23) + Me.ucrChkBorderBottom.TabIndex = 28 + ' + 'ucrChkBorderTop + ' + Me.ucrChkBorderTop.AutoSize = True + Me.ucrChkBorderTop.Checked = False + Me.ucrChkBorderTop.Location = New System.Drawing.Point(137, 21) + Me.ucrChkBorderTop.Name = "ucrChkBorderTop" + Me.ucrChkBorderTop.Size = New System.Drawing.Size(100, 23) + Me.ucrChkBorderTop.TabIndex = 29 + ' + 'ucrChkBorderRight + ' + Me.ucrChkBorderRight.AutoSize = True + Me.ucrChkBorderRight.Checked = False + Me.ucrChkBorderRight.Location = New System.Drawing.Point(6, 54) + Me.ucrChkBorderRight.Name = "ucrChkBorderRight" + Me.ucrChkBorderRight.Size = New System.Drawing.Size(100, 23) + Me.ucrChkBorderRight.TabIndex = 27 + ' + 'lblBorderStyle + ' + Me.lblBorderStyle.AutoSize = True + Me.lblBorderStyle.Location = New System.Drawing.Point(300, 65) + Me.lblBorderStyle.Name = "lblBorderStyle" + Me.lblBorderStyle.Size = New System.Drawing.Size(33, 13) + Me.lblBorderStyle.TabIndex = 25 + Me.lblBorderStyle.Text = "Style:" + ' + 'ucrCboBorderStyle + ' + Me.ucrCboBorderStyle.AddQuotesIfUnrecognised = True + Me.ucrCboBorderStyle.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboBorderStyle.GetSetSelectedIndex = -1 + Me.ucrCboBorderStyle.IsReadOnly = False + Me.ucrCboBorderStyle.Location = New System.Drawing.Point(300, 81) + Me.ucrCboBorderStyle.Name = "ucrCboBorderStyle" + Me.ucrCboBorderStyle.Size = New System.Drawing.Size(137, 21) + Me.ucrCboBorderStyle.TabIndex = 24 + ' + 'ucrCboBorderColor + ' + Me.ucrCboBorderColor.AddQuotesIfUnrecognised = True + Me.ucrCboBorderColor.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboBorderColor.GetSetSelectedIndex = -1 + Me.ucrCboBorderColor.IsReadOnly = False + Me.ucrCboBorderColor.Location = New System.Drawing.Point(300, 35) + Me.ucrCboBorderColor.Name = "ucrCboBorderColor" + Me.ucrCboBorderColor.Size = New System.Drawing.Size(137, 21) + Me.ucrCboBorderColor.TabIndex = 23 + ' + 'lblBorderWeight + ' + Me.lblBorderWeight.AutoSize = True + Me.lblBorderWeight.Location = New System.Drawing.Point(466, 20) + Me.lblBorderWeight.Name = "lblBorderWeight" + Me.lblBorderWeight.Size = New System.Drawing.Size(44, 13) + Me.lblBorderWeight.TabIndex = 21 + Me.lblBorderWeight.Text = "Weight:" + ' + 'lblBorderColor + ' + Me.lblBorderColor.AutoSize = True + Me.lblBorderColor.Location = New System.Drawing.Point(300, 20) + Me.lblBorderColor.Name = "lblBorderColor" + Me.lblBorderColor.Size = New System.Drawing.Size(34, 13) + Me.lblBorderColor.TabIndex = 22 + Me.lblBorderColor.Text = "Color:" + ' + 'ucrBaseSubdialog + ' + Me.ucrBaseSubdialog.AutoSize = True + Me.ucrBaseSubdialog.Location = New System.Drawing.Point(185, 467) + Me.ucrBaseSubdialog.Margin = New System.Windows.Forms.Padding(4) + Me.ucrBaseSubdialog.Name = "ucrBaseSubdialog" + Me.ucrBaseSubdialog.Size = New System.Drawing.Size(224, 29) + Me.ucrBaseSubdialog.TabIndex = 25 + ' + 'sdgTableStyles + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(607, 504) + Me.Controls.Add(Me.grpBoxBorders) + Me.Controls.Add(Me.grpBoxOthers) + Me.Controls.Add(Me.grpBoxColor) + Me.Controls.Add(Me.grpBoxAlignment) + Me.Controls.Add(Me.grpBoxFont) + Me.Controls.Add(Me.ucrBaseSubdialog) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.Name = "sdgTableStyles" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent + Me.Text = "Styles" + Me.grpBoxColor.ResumeLayout(False) + Me.grpBoxColor.PerformLayout() + Me.grpBoxAlignment.ResumeLayout(False) + Me.grpBoxAlignment.PerformLayout() + Me.grpBoxFont.ResumeLayout(False) + Me.grpBoxFont.PerformLayout() + Me.grpBoxOthers.ResumeLayout(False) + Me.grpBoxOthers.PerformLayout() + Me.grpBoxBorders.ResumeLayout(False) + Me.grpBoxBorders.PerformLayout() + Me.grpBoxSides.ResumeLayout(False) + Me.grpBoxSides.PerformLayout() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents ucrCboColorBackground As ucrColors + Friend WithEvents ucrCboColorText As ucrColors + Friend WithEvents Label2 As Label + Friend WithEvents grpBoxColor As GroupBox + Friend WithEvents lblFill As Label + Friend WithEvents ucrCboAlignHorizontal As ucrInputComboBox + Friend WithEvents grpBoxAlignment As GroupBox + Friend WithEvents lblAlignHorizontal As Label + Friend WithEvents lblUnderlineType As Label + Friend WithEvents ucrCboUnderlineType As ucrInputComboBox + Friend WithEvents ucrTxtFontSize As ucrInputTextBox + Friend WithEvents ucrCboFontWeight As ucrInputComboBox + Friend WithEvents lblFontWeight As Label + Friend WithEvents ucrCboFontStyle As ucrInputComboBox + Friend WithEvents grpBoxFont As GroupBox + Friend WithEvents lblFontFamily As Label + Friend WithEvents ucrCboFontFamily As ucrInputComboBox + Friend WithEvents lblFontStyle As Label + Friend WithEvents lblFontSize As Label + Friend WithEvents ucrBaseSubdialog As ucrButtonsSubdialogue + Friend WithEvents lblAlignVertical As Label + Friend WithEvents ucrCboAlignVertical As ucrInputComboBox + Friend WithEvents grpBoxOthers As GroupBox + Friend WithEvents lblTransform As Label + Friend WithEvents ucrCboTransform As ucrInputComboBox + Friend WithEvents lblIndent As Label + Friend WithEvents lblWhiteSpace As Label + Friend WithEvents ucrCboWhiteSpace As ucrInputComboBox + Friend WithEvents lblStretch As Label + Friend WithEvents ucrCboStretch As ucrInputComboBox + Friend WithEvents grpBoxBorders As GroupBox + Friend WithEvents lblBorderStyle As Label + Friend WithEvents ucrCboBorderStyle As ucrInputComboBox + Friend WithEvents ucrCboBorderColor As ucrColors + Friend WithEvents lblBorderWeight As Label + Friend WithEvents lblBorderColor As Label + Friend WithEvents ucrChkBorderTop As ucrCheck + Friend WithEvents ucrChkBorderBottom As ucrCheck + Friend WithEvents ucrChkBorderRight As ucrCheck + Friend WithEvents ucrChkBorderLeft As ucrCheck + Friend WithEvents grpBoxSides As GroupBox + Friend WithEvents ucrNudBorderWeight As ucrNud + Friend WithEvents ucrNudIndent As ucrNud +End Class diff --git a/instat/UserTables/sdgTableStyles.resx b/instat/UserTables/sdgTableStyles.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/instat/UserTables/sdgTableStyles.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/instat/UserTables/sdgTableStyles.vb b/instat/UserTables/sdgTableStyles.vb new file mode 100644 index 00000000000..d6c1c720bdc --- /dev/null +++ b/instat/UserTables/sdgTableStyles.vb @@ -0,0 +1,373 @@ +Imports instat.Translations + +Public Class sdgTableStyles + Private clsStyleListRFunction, clsCellTextRFunction, clsCellFillRFunction, clsCellBordersRFunction, clsCellBorderSidesRFunction As New RFunction + Private bFirstload As Boolean = True + Private bUserClickedReturn As Boolean = False + + Private Sub sdgTableTextFormatOptions_Load(sender As Object, e As EventArgs) Handles MyBase.Load + If bFirstload Then + InitialiseDialog() + bFirstload = False + End If + + SetRCode() + + bUserClickedReturn = False + autoTranslate(Me) + End Sub + + Private Sub InitialiseDialog() + ucrBaseSubdialog.iHelpTopicID = 150 + + '----------------- + ucrCboColorText.SetDropDownStyleAsNonEditable() + ucrCboColorText.SetParameter(New RParameter("color", iNewPosition:=0)) + ucrCboColorText.SetColours() + ucrCboColorText.SetRDefault("NULL") + '----------------- + + '----------------- + Dim dctFontFamily As New Dictionary(Of String, String) From { + {"Default", "NULL"}, + {"Arial (sans-serif)", Chr(34) & "Arial, sans-serif" & Chr(34)}, + {"Verdana (sans-serif)", Chr(34) & "Verdana, sans-serif" & Chr(34)}, + {"Tahoma", Chr(34) & "Tahoma, sans-serif" & Chr(34)}, + {"Trebuchet MS", Chr(34) & "'Trebuchet MS', sans-serif" & Chr(34)}, + {"Times New Roman (serif)", Chr(34) & "'Times New Roman', serif" & Chr(34)}, + {"Georgia (serif)", Chr(34) & "Georgia, serif" & Chr(34)}, + {"Garamond (serif)", Chr(34) & "Garamond, serif" & Chr(34)} + } + ucrCboFontFamily.SetDropDownStyleAsNonEditable() + ucrCboFontFamily.SetParameter(New RParameter("font", iNewPosition:=1)) + ucrCboFontFamily.SetItems(dctFontFamily) + ucrCboFontFamily.SetRDefault("NULL") + '----------------- + + '----------------- + Dim dctAlignHorizontal As New Dictionary(Of String, String) From { + {"Default", "NULL"}, + {"Center", Chr(34) & "center" & Chr(34)}, + {"Left", Chr(34) & "left" & Chr(34)}, + {"Right", Chr(34) & "right" & Chr(34)}, + {"Justify", Chr(34) & "justify" & Chr(34)} + } + ucrCboAlignHorizontal.SetDropDownStyleAsNonEditable() + ucrCboAlignHorizontal.SetParameter(New RParameter("align", iNewPosition:=3)) + ucrCboAlignHorizontal.SetItems(dctAlignHorizontal) + ucrCboAlignHorizontal.SetRDefault("NULL") + '----------------- + + '----------------- + Dim dctAlignVertical As New Dictionary(Of String, String) From { + {"Default", "NULL"}, + {"Middle", Chr(34) & "middle" & Chr(34)}, + {"Top", Chr(34) & "top" & Chr(34)}, + {"Bottom", Chr(34) & "bottom" & Chr(34)} + } + ucrCboAlignVertical.SetDropDownStyleAsNonEditable() + ucrCboAlignVertical.SetParameter(New RParameter("v_align", iNewPosition:=4)) + ucrCboAlignVertical.SetItems(dctAlignVertical) + ucrCboAlignVertical.SetRDefault("NULL") + '----------------- + + '----------------- + Dim dctFontStyle As New Dictionary(Of String, String) From { + {"Default", "NULL"}, + {"Normal", Chr(34) & "normal" & Chr(34)}, + {"Italic", Chr(34) & "italic" & Chr(34)}, + {"Oblique", Chr(34) & "oblique" & Chr(34)} + } + + ucrCboFontStyle.SetDropDownStyleAsNonEditable() + ucrCboFontStyle.SetParameter(New RParameter("style", iNewPosition:=5)) + ucrCboFontStyle.SetItems(dctFontStyle) + ucrCboFontStyle.SetRDefault("NULL") + '----------------- + + '----------------- + Dim dctFontWeight As New Dictionary(Of String, String) From { + {"Default", "NULL"}, + {"Normal", Chr(34) & "normal" & Chr(34)}, + {"Bold", Chr(34) & "bold" & Chr(34)}, + {"Lighter", Chr(34) & "lighter" & Chr(34)}, + {"Bolder", Chr(34) & "bold" & Chr(34)} + } + + ucrCboFontWeight.SetDropDownStyleAsNonEditable() + ucrCboFontWeight.SetParameter(New RParameter("weight", iNewPosition:=7)) + ucrCboFontWeight.SetItems(dctFontWeight) + ucrCboFontWeight.SetRDefault("NULL") + '----------------- + + '----------------- + Dim dctUnderlineType As New Dictionary(Of String, String) From { + {"None", "NULL"}, + {"Underline", Chr(34) & "underline" & Chr(34)}, + {"Overline", Chr(34) & "overline" & Chr(34)}, + {"Line-through", Chr(34) & "line-through" & Chr(34)} + } + ucrCboUnderlineType.SetDropDownStyleAsNonEditable() + ucrCboUnderlineType.SetParameter(New RParameter("decorate", iNewPosition:=8)) + ucrCboUnderlineType.SetItems(dctUnderlineType) + ucrCboUnderlineType.SetRDefault("NULL") + + + 'Dim dctUnderlineStyle As New Dictionary(Of String, String) From { + ' {"Default", "NULL"}, + ' {"Solid", Chr(34) & "solid" & Chr(34)}, + ' {"Double", Chr(34) & "double" & Chr(34)}, + ' {"Dotted", Chr(34) & "dotted" & Chr(34)}, + ' {"Dashed", Chr(34) & "dashed" & Chr(34)}, + ' {"Wavy", Chr(34) & "wavy" & Chr(34)} + '} + 'ucrCboUnderlineStyle.SetDropDownStyleAsNonEditable() + 'ucrCboUnderlineStyle.SetParameter(New RParameter("text.decoration.style")) + 'ucrCboUnderlineStyle.SetItems(dctUnderlineStyle) + 'ucrCboUnderlineStyle.SetRDefault("NULL") + + 'ucrCboUnderLineColor.SetDropDownStyleAsNonEditable() + 'ucrCboUnderLineColor.SetParameter(New RParameter("text.decoration.color")) + 'ucrCboUnderLineColor.SetColours() + 'ucrCboUnderLineColor.SetRDefault("NULL") + '----------------- + + '----------------- + Dim dctTransform As New Dictionary(Of String, String) From { + {"Default", "NULL"}, + {"Uppercase", Chr(34) & "uppercase" & Chr(34)}, + {"Lowercase", Chr(34) & "lowercase" & Chr(34)}, + {"Capitalize", Chr(34) & "capitalize" & Chr(34)} + } + ucrCboTransform.SetDropDownStyleAsNonEditable() + ucrCboTransform.SetParameter(New RParameter("transform", iNewPosition:=9)) + ucrCboTransform.SetItems(dctTransform) + ucrCboTransform.SetRDefault("NULL") + '----------------- + + '----------------- + Dim dctStretch As New Dictionary(Of String, String) From { + {"Default", "NULL"}, + {"Ultra-condensed", Chr(34) & "ultra-condensed" & Chr(34)}, + {"Extra-condensed", Chr(34) & "extra-condensed" & Chr(34)}, + {"Condensed", Chr(34) & "condensed" & Chr(34)}, + {"Semi-condensed", Chr(34) & "semi-condensed" & Chr(34)}, + {"normal", Chr(34) & "normal" & Chr(34)}, + {"Semi-expanded", Chr(34) & "semi-expanded" & Chr(34)}, + {"Expanded", Chr(34) & "expanded" & Chr(34)}, + {"Extra-expanded", Chr(34) & "extra-expanded" & Chr(34)}, + {"Ultra-expanded", Chr(34) & "ultra-expanded" & Chr(34)} + } + ucrCboStretch.SetDropDownStyleAsNonEditable() + ucrCboStretch.SetParameter(New RParameter("stretch", iNewPosition:=10)) + ucrCboStretch.SetItems(dctStretch) + ucrCboStretch.SetRDefault("NULL") + '----------------- + + '----------------- + ucrNudIndent.SetParameter(New RParameter("indent", iNewPosition:=11)) + ucrNudIndent.SetRDefault(0) + '----------------- + + '----------------- + Dim dctWhiteSpace As New Dictionary(Of String, String) From { + {"Default", "NULL"}, + {"Normal", Chr(34) & "normal" & Chr(34)}, + {"No wrap", Chr(34) & "nowrap" & Chr(34)}, + {"Pre", Chr(34) & "pre" & Chr(34)}, + {"Pre-wrap", Chr(34) & "pre-wrap" & Chr(34)}, + {"Pre-line", Chr(34) & "pre-line" & Chr(34)}, + {"Break-spaces", Chr(34) & "break-spaces" & Chr(34)} + } + ucrCboWhiteSpace.SetDropDownStyleAsNonEditable() + ucrCboWhiteSpace.SetParameter(New RParameter("transform", iNewPosition:=11)) + ucrCboWhiteSpace.SetItems(dctWhiteSpace) + ucrCboWhiteSpace.SetRDefault("NULL") + '----------------- + + '--------------------------------------------------- + ' Cell fill controls + ucrCboColorBackground.SetDropDownStyleAsNonEditable() + ucrCboColorBackground.SetParameter(New RParameter("color", iNewPosition:=0)) + ucrCboColorBackground.SetColours() + ucrCboColorBackground.SetRDefault("NULL") + '----------------- + + '--------------------------------------------------- + ' Cell Border + '----------------- + ucrChkBorderLeft.SetText("Left") + ucrChkBorderLeft.SetParameter(New RParameter("left", iNewPosition:=0, bNewIncludeArgumentName:=False)) + ucrChkBorderLeft.SetValuesCheckedAndUnchecked(Chr(34) & "left" & Chr(34), "NULL") + ucrChkBorderLeft.SetRDefault("NULL") + + ucrChkBorderRight.SetText("Right") + ucrChkBorderRight.SetParameter(New RParameter("right", iNewPosition:=1, bNewIncludeArgumentName:=False)) + ucrChkBorderRight.SetValuesCheckedAndUnchecked(Chr(34) & "right" & Chr(34), "NULL") + ucrChkBorderRight.SetRDefault("NULL") + + ucrChkBorderTop.SetText("Top") + ucrChkBorderTop.SetParameter(New RParameter("top", iNewPosition:=2, bNewIncludeArgumentName:=False)) + ucrChkBorderTop.SetValuesCheckedAndUnchecked(Chr(34) & "top" & Chr(34), "NULL") + ucrChkBorderTop.SetRDefault("NULL") + + ucrChkBorderBottom.SetText("Bottom") + ucrChkBorderBottom.SetParameter(New RParameter("bottom", iNewPosition:=3, bNewIncludeArgumentName:=False)) + ucrChkBorderBottom.SetValuesCheckedAndUnchecked(Chr(34) & "bottom" & Chr(34), "NULL") + ucrChkBorderBottom.SetRDefault("NULL") + + '----------------- + ucrCboBorderColor.SetDropDownStyleAsNonEditable() + ucrCboBorderColor.SetParameter(New RParameter("color", iNewPosition:=1)) + ucrCboBorderColor.SetColours() + ucrCboBorderColor.SetRDefault("NULL") + '----------------- + + '----------------- + Dim dctBorderStyle As New Dictionary(Of String, String) From { + {"Default", "solid"}, + {"Solid", Chr(34) & "solid" & Chr(34)}, + {"Dashed", Chr(34) & "dashed" & Chr(34)}, + {"Dotted", Chr(34) & "dotted" & Chr(34)} + } + ucrCboBorderStyle.SetDropDownStyleAsNonEditable() + ucrCboBorderStyle.SetParameter(New RParameter("style", iNewPosition:=2)) + ucrCboBorderStyle.SetItems(dctBorderStyle) + ucrCboBorderStyle.SetRDefault("solid") + '----------------- + + '----------------- + ucrNudBorderWeight.SetParameter(New RParameter("weight", iNewPosition:=3)) + ucrNudBorderWeight.SetRDefault(1) + '----------------- + + '--------------------------------------------------- + + End Sub + + Public Sub Setup(Optional clsNewStyleListRFunction As RFunction = Nothing) + clsStyleListRFunction = New RFunction + clsCellTextRFunction = New RFunction + clsCellFillRFunction = New RFunction + clsCellBordersRFunction = New RFunction + clsCellBorderSidesRFunction = New RFunction + + clsStyleListRFunction.SetRCommand("list") + + clsCellTextRFunction.SetPackageName("gt") + clsCellTextRFunction.SetRCommand("cell_text") + + clsCellFillRFunction.SetPackageName("gt") + clsCellFillRFunction.SetRCommand("cell_fill") + + clsCellBordersRFunction.SetPackageName("gt") + clsCellBordersRFunction.SetRCommand("cell_borders") + + clsCellBorderSidesRFunction.SetRCommand("c") + + ucrTxtFontSize.SetName("") + + If clsNewStyleListRFunction IsNot Nothing Then + clsStyleListRFunction = clsNewStyleListRFunction + + If clsStyleListRFunction.ContainsParameter("cell_text_param") Then + clsCellTextRFunction = clsStyleListRFunction.GetParameter("cell_text_param").clsArgumentCodeStructure + Dim sizeValue As String = clsCellTextRFunction.GetParameter("size")?.clsArgumentCodeStructure.GetParameter("x")?.strArgumentValue + ucrTxtFontSize.SetName(If(sizeValue IsNot Nothing, sizeValue, "")) + End If + + If clsStyleListRFunction.ContainsParameter("cell_fill_param") Then + clsCellFillRFunction = clsStyleListRFunction.GetParameter("cell_fill_param").clsArgumentCodeStructure + End If + + If clsStyleListRFunction.ContainsParameter("cell_borders_param") Then + clsCellBordersRFunction = clsStyleListRFunction.GetParameter("cell_borders_param").clsArgumentCodeStructure + If clsCellBordersRFunction.ContainsParameter("sides") Then + clsCellBordersRFunction = clsCellBordersRFunction.GetParameter("sides").clsArgumentCodeStructure + End If + End If + + End If + End Sub + + Public Function GetNewUserInputAsRFunction() As RFunction + If Not bUserClickedReturn Then + Return Nothing + End If + + If clsCellTextRFunction.clsParameters.Count > 0 Then + clsStyleListRFunction.AddParameter(strParameterName:="cell_text_param", clsRFunctionParameter:=clsCellTextRFunction, bIncludeArgumentName:=False, iPosition:=0) + End If + + If clsCellFillRFunction.clsParameters.Count > 0 Then + clsStyleListRFunction.AddParameter(strParameterName:="cell_fill_param", clsRFunctionParameter:=clsCellFillRFunction, bIncludeArgumentName:=False, iPosition:=1) + End If + + If clsCellBordersRFunction.clsParameters.Count > 0 OrElse clsCellBorderSidesRFunction.clsParameters.Count > 0 Then + If clsCellBorderSidesRFunction.clsParameters.Count > 0 Then + clsCellBordersRFunction.AddParameter(strParameterName:="sides", clsRFunctionParameter:=clsCellBorderSidesRFunction, iPosition:=0) + End If + clsStyleListRFunction.AddParameter(strParameterName:="cell_borders_param", clsRFunctionParameter:=clsCellBordersRFunction, bIncludeArgumentName:=False, iPosition:=1) + End If + + Return If(clsStyleListRFunction.clsParameters.Count > 0, clsStyleListRFunction, Nothing) + End Function + + + Private Sub SetRCode() + '----------------- + ' Cell text controls + ucrCboFontFamily.SetRCode(clsCellTextRFunction, bReset:=False, bCloneIfNeeded:=True) + ucrCboFontStyle.SetRCode(clsCellTextRFunction, bReset:=False, bCloneIfNeeded:=True) + ucrCboFontWeight.SetRCode(clsCellTextRFunction, bReset:=False, bCloneIfNeeded:=True) + ucrCboColorText.SetRCode(clsCellTextRFunction, bReset:=False, bCloneIfNeeded:=True) + ucrCboUnderlineType.SetRCode(clsCellTextRFunction, bReset:=False, bCloneIfNeeded:=True) + 'ucrCboUnderlineStyle.SetRCode(clsNewStyleRFunction, bReset:=False, bCloneIfNeeded:=True) + 'ucrCboUnderLineColor.SetRCode(clsNewStyleRFunction, bReset:=False, bCloneIfNeeded:=True) + ucrCboAlignHorizontal.SetRCode(clsCellTextRFunction, bReset:=False, bCloneIfNeeded:=True) + ucrCboAlignVertical.SetRCode(clsCellTextRFunction, bReset:=False, bCloneIfNeeded:=True) + ucrCboTransform.SetRCode(clsCellTextRFunction, bReset:=False, bCloneIfNeeded:=True) + ucrCboWhiteSpace.SetRCode(clsCellTextRFunction, bReset:=False, bCloneIfNeeded:=True) + ucrCboStretch.SetRCode(clsCellTextRFunction, bReset:=False, bCloneIfNeeded:=True) + 'ucrTxtIndent.SetRCode(clsCellTextRFunction, bReset:=False, bCloneIfNeeded:=True) + ucrNudIndent.SetRCode(clsCellTextRFunction, bReset:=False, bCloneIfNeeded:=True) + '----------------- + + '----------------- + 'Cell fill controls + ucrCboColorBackground.SetRCode(clsCellFillRFunction, bReset:=False, bCloneIfNeeded:=True) + '----------------- + + '----------------- + 'Cell border controls + ucrChkBorderLeft.SetRCode(clsCellBorderSidesRFunction, bReset:=False, bCloneIfNeeded:=True) + ucrChkBorderRight.SetRCode(clsCellBorderSidesRFunction, bReset:=False, bCloneIfNeeded:=True) + ucrChkBorderTop.SetRCode(clsCellBorderSidesRFunction, bReset:=False, bCloneIfNeeded:=True) + ucrChkBorderBottom.SetRCode(clsCellBorderSidesRFunction, bReset:=False, bCloneIfNeeded:=True) + + ucrCboBorderColor.SetRCode(clsCellBordersRFunction, bReset:=False, bCloneIfNeeded:=True) + ucrCboBorderStyle.SetRCode(clsCellBordersRFunction, bReset:=False, bCloneIfNeeded:=True) + ucrNudBorderWeight.SetRCode(clsCellBordersRFunction, bReset:=False, bCloneIfNeeded:=True) + '----------------- + End Sub + + + Private Sub ucrBaseSubdialog_ClickReturn(sender As Object, e As EventArgs) Handles ucrBaseSubdialog.ClickReturn + bUserClickedReturn = True + End Sub + + Private Sub ucrTxtFontSize_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrTxtFontSize.ControlValueChanged + If ucrTxtFontSize.IsEmpty Then + clsCellTextRFunction.RemoveParameterByName("size") + Else + Dim pxRFunction As New RFunction + pxRFunction.SetPackageName("gt") + pxRFunction.SetRCommand("px") + pxRFunction.AddParameter(strParameterName:="x", strParameterValue:=ucrTxtFontSize.GetText(), bIncludeArgumentName:=False, iPosition:=2) + clsCellTextRFunction.AddParameter(strParameterName:="size", clsRFunctionParameter:=pxRFunction) + End If + End Sub + + + +End Class \ No newline at end of file diff --git a/instat/clsInstatOptions.vb b/instat/clsInstatOptions.vb index 1bd05535f48..548562707c6 100644 --- a/instat/clsInstatOptions.vb +++ b/instat/clsInstatOptions.vb @@ -31,6 +31,8 @@ Imports RDotNet Public iPreviewRows As Nullable(Of Integer) Public iMaxRows As Nullable(Of Integer) Public iMaxCols As Nullable(Of Integer) + Public iUndoColLimit As Nullable(Of Integer) + Public iUndoRowLimit As Nullable(Of Integer) Public lstColourPalette As List(Of Color) Public strGraphDisplayOption As String Public bCommandsinOutput As Nullable(Of Boolean) @@ -43,6 +45,8 @@ Imports RDotNet Public bShowSignifStars As Nullable(Of Boolean) Public bChangeDataFrame As Nullable(Of Boolean) Public bAutoSaveData As Nullable(Of Boolean) + Public bSwitchOffUndo As Nullable(Of Boolean) + Public bUndoSwitchAction As Nullable(Of Boolean) Public iAutoSaveDataMinutes As Nullable(Of Integer) Public bShowWaitDialog As Nullable(Of Boolean) Public iWaitTimeDelaySeconds As Nullable(Of Integer) @@ -75,6 +79,8 @@ Imports RDotNet iPreviewRows = clsInstatOptionsDefaults.DEFAULTiPreviewRows iMaxRows = clsInstatOptionsDefaults.DEFAULTiMaxRows iMaxCols = clsInstatOptionsDefaults.DEFAULTiMaxCols + iUndoColLimit = clsInstatOptionsDefaults.DEFAULTiUndoColLimit + iUndoRowLimit = clsInstatOptionsDefaults.DEFAULTiUndoRowLimit strComment = Translations.GetTranslation(clsInstatOptionsDefaults.DEFAULTstrComment) strGraphDisplayOption = clsInstatOptionsDefaults.DEFAULTstrGraphDisplayOption strLanguageCultureCode = clsInstatOptionsDefaults.DEFAULTstrLanguageCultureCode @@ -84,6 +90,7 @@ Imports RDotNet bShowSignifStars = clsInstatOptionsDefaults.DEFAULTbShowSignifStars bChangeDataFrame = clsInstatOptionsDefaults.DEFAULTbChangeDataFrame bAutoSaveData = clsInstatOptionsDefaults.DEFAULTbAutoSaveData + bSwitchOffUndo = clsInstatOptionsDefaults.DEFAULTbSwitchOffUndo iAutoSaveDataMinutes = clsInstatOptionsDefaults.DEFAULTiAutoSaveDataMinutes bShowWaitDialog = clsInstatOptionsDefaults.DEFAULTbShowWaitDialog iWaitTimeDelaySeconds = clsInstatOptionsDefaults.DEFAULTiWaitTimeDelaySeconds @@ -144,6 +151,18 @@ Imports RDotNet SetMaxCols(clsInstatOptionsDefaults.DEFAULTiMaxCols) End If + If iUndoColLimit.HasValue Then + SetUndoColLimit(iUndoColLimit) + Else + SetUndoColLimit(clsInstatOptionsDefaults.DEFAULTiUndoColLimit) + End If + + If iUndoRowLimit.HasValue Then + SetUndoRowLimit(iUndoRowLimit) + Else + SetUndoRowLimit(clsInstatOptionsDefaults.DEFAULTiUndoRowLimit) + End If + If bCommandsinOutput.HasValue Then SetCommandInOutpt(bCommandsinOutput) Else @@ -244,6 +263,12 @@ Imports RDotNet SetAutoSaveData(clsInstatOptionsDefaults.DEFAULTbAutoSaveData) End If + If bSwitchOffUndo.HasValue Then + SetOffUndo(bSwitchOffUndo) + Else + SetOffUndo(clsInstatOptionsDefaults.DEFAULTbSwitchOffUndo) + End If + If iAutoSaveDataMinutes.HasValue Then SetAutoSaveDataMinutes(iAutoSaveDataMinutes) Else @@ -356,6 +381,14 @@ Imports RDotNet Return If(expression Is Nothing OrElse expression.Type = Internals.SymbolicExpressionType.Null, Nothing, expression.AsCharacter(0)) End Function + Public Sub SetUndoColLimit(iNewUndoColLimit As Integer) + iUndoColLimit = iNewUndoColLimit + End Sub + + Public Sub SetUndoRowLimit(iNewUndoRowLimit As Integer) + iUndoRowLimit = iNewUndoRowLimit + End Sub + Public Sub SetMaxRows(iRows As Integer) iMaxRows = iRows frmMain.UpdateAllGrids() @@ -530,6 +563,10 @@ Imports RDotNet bAutoSaveData = bNewAutoSave End Sub + Public Sub SetOffUndo(bNewSwitchOffUndo As Boolean) + bSwitchOffUndo = bNewSwitchOffUndo + End Sub + Public Sub SetAutoSaveDataMinutes(iNewMinutes As Integer) iAutoSaveDataMinutes = iNewMinutes frmMain.ResetTimer() diff --git a/instat/clsInstatOptionsDefaults.vb b/instat/clsInstatOptionsDefaults.vb index 7047c81a86a..8a4ee9b62cd 100644 --- a/instat/clsInstatOptionsDefaults.vb +++ b/instat/clsInstatOptionsDefaults.vb @@ -33,6 +33,8 @@ Public Class clsInstatOptionsDefaults Public Shared ReadOnly DEFAULTiPreviewRows As Integer = 10 Public Shared ReadOnly DEFAULTiMaxRows As Integer = 1000 Public Shared ReadOnly DEFAULTiMaxCols As Integer = 50 + Public Shared ReadOnly DEFAULTiUndoColLimit As Integer = 200 + Public Shared ReadOnly DEFAULTiUndoRowLimit As Integer = 200000 Public Shared ReadOnly DEFAULTstrComment As String = "Dialog:" Public Shared ReadOnly DEFAULTstrGraphDisplayOption As String = "view_output_window" Public Shared ReadOnly DEFAULTbChangeDataFrame As Boolean = False @@ -45,6 +47,7 @@ Public Class clsInstatOptionsDefaults Public Shared ReadOnly DEFAULTiDigits As Integer = 4 Public Shared ReadOnly DEFAULTbShowSignifStars As Boolean = False Public Shared ReadOnly DEFAULTbAutoSaveData As Boolean = True + Public Shared ReadOnly DEFAULTbSwitchOffUndo As Boolean = False Public Shared ReadOnly DEFAULTiAutoSaveDataMinutes As Integer = 10 Public Shared ReadOnly DEFAULTbShowWaitDialog As Boolean = True Public Shared ReadOnly DEFAULTiWaitTimeDelaySeconds As Integer = 2 diff --git a/instat/dlgCalculator.vb b/instat/dlgCalculator.vb index b12f61d9ae4..c7eee20e0ad 100644 --- a/instat/dlgCalculator.vb +++ b/instat/dlgCalculator.vb @@ -36,8 +36,11 @@ Public Class dlgCalculator Private strDefaultKeyboard As String ' Note: This list needs to be updated when a new keyboard is added. Private strKeyboards() As String = {"Basic", "Maths", "Logical and Symbols", "Transform", "Summary", "Probability", "Factor", "Text/Strings (Character Columns)", "Dates/Times", "Circular", "Wakefield", "Goodness of Fit", "List", "Complex", "Integer", "Functions"} + Private Shared ReadOnly Logger As NLog.Logger = NLog.LogManager.GetCurrentClassLogger() + Private Sub dlgCalculator_Load(sender As Object, e As EventArgs) Handles MyBase.Load + Dim start = DateTime.Now If bFirstLoad Then InitialiseDialog() iBasicWidth = Me.Width @@ -48,6 +51,10 @@ Public Class dlgCalculator ReopenDialog() TestOKEnabled() autoTranslate(Me) + + Logger.Debug("This is in the load") + Logger.Debug(Process.GetCurrentProcess().WorkingSet64) + Logger.Debug("Time", DateTime.Now - start) End Sub Private Sub TestOKEnabled() diff --git a/instat/dlgClimSoft.Designer.vb b/instat/dlgClimSoft.Designer.vb index 1c5b32afda8..44f5fa99426 100644 --- a/instat/dlgClimSoft.Designer.vb +++ b/instat/dlgClimSoft.Designer.vb @@ -49,6 +49,7 @@ Partial Class dlgClimSoft Me.ucrDtpEndDataDate = New instat.ucrDateTimePicker() Me.ucrDtpStartDataDate = New instat.ucrDateTimePicker() Me.ucrChkImportFlagsMetadata = New instat.ucrCheck() + Me.ucrChKUnstackData = New instat.ucrCheck() Me.lblConnection = New System.Windows.Forms.Label() Me.lblToDataDate = New System.Windows.Forms.Label() Me.lblSelectTable = New System.Windows.Forms.Label() @@ -67,7 +68,6 @@ Partial Class dlgClimSoft Me.ucrReceiverMultipleElements = New instat.ucrReceiverMultiple() Me.ucrReceiverMultipleStations = New instat.ucrReceiverMultiple() Me.ucrBase = New instat.ucrButtons() - Me.ucrChKUnstackData = New instat.ucrCheck() Me.SuspendLayout() ' 'btnConnection @@ -87,7 +87,7 @@ Partial Class dlgClimSoft Me.lblSelectElements.Location = New System.Drawing.Point(285, 226) Me.lblSelectElements.Name = "lblSelectElements" Me.lblSelectElements.Size = New System.Drawing.Size(86, 13) - Me.lblSelectElements.TabIndex = 4 + Me.lblSelectElements.TabIndex = 5 Me.lblSelectElements.Text = "Select Elements:" ' 'lblSelectStations @@ -173,6 +173,17 @@ Partial Class dlgClimSoft Me.ucrChkImportFlagsMetadata.TabIndex = 37 Me.ttClimsoft.SetToolTip(Me.ucrChkImportFlagsMetadata, "Unstack elements") ' + 'ucrChKUnstackData + ' + Me.ucrChKUnstackData.AutoSize = True + Me.ucrChKUnstackData.Checked = False + Me.ucrChKUnstackData.Location = New System.Drawing.Point(8, 289) + Me.ucrChKUnstackData.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) + Me.ucrChKUnstackData.Name = "ucrChKUnstackData" + Me.ucrChKUnstackData.Size = New System.Drawing.Size(169, 23) + Me.ucrChKUnstackData.TabIndex = 38 + Me.ttClimsoft.SetToolTip(Me.ucrChKUnstackData, "Select Observation Data Date Range") + ' 'lblConnection ' Me.lblConnection.AutoSize = True @@ -325,7 +336,7 @@ Partial Class dlgClimSoft Me.ucrCboElements.Margin = New System.Windows.Forms.Padding(9, 12, 9, 12) Me.ucrCboElements.Name = "ucrCboElements" Me.ucrCboElements.Size = New System.Drawing.Size(137, 21) - Me.ucrCboElements.TabIndex = 5 + Me.ucrCboElements.TabIndex = 6 ' 'ucrCboStations ' @@ -359,7 +370,7 @@ Partial Class dlgClimSoft Me.ucrReceiverMultipleElements.Selector = Nothing Me.ucrReceiverMultipleElements.Size = New System.Drawing.Size(137, 100) Me.ucrReceiverMultipleElements.strNcFilePath = "" - Me.ucrReceiverMultipleElements.TabIndex = 6 + Me.ucrReceiverMultipleElements.TabIndex = 7 Me.ucrReceiverMultipleElements.ucrSelector = Nothing ' 'ucrReceiverMultipleStations @@ -385,17 +396,6 @@ Partial Class dlgClimSoft Me.ucrBase.Size = New System.Drawing.Size(408, 52) Me.ucrBase.TabIndex = 14 ' - 'ucrChKUnstackData - ' - Me.ucrChKUnstackData.AutoSize = True - Me.ucrChKUnstackData.Checked = False - Me.ucrChKUnstackData.Location = New System.Drawing.Point(8, 289) - Me.ucrChKUnstackData.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) - Me.ucrChKUnstackData.Name = "ucrChKUnstackData" - Me.ucrChKUnstackData.Size = New System.Drawing.Size(169, 23) - Me.ucrChKUnstackData.TabIndex = 38 - Me.ttClimsoft.SetToolTip(Me.ucrChKUnstackData, "Select Observation Data Date Range") - ' 'dlgClimSoft ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) diff --git a/instat/dlgClimSoft.vb b/instat/dlgClimSoft.vb index b448a049de6..4bff7f4305b 100644 --- a/instat/dlgClimSoft.vb +++ b/instat/dlgClimSoft.vb @@ -275,8 +275,8 @@ Public Class dlgClimSoft Dim strTableName As String = dctTables.Item(ucrCboTable.GetText).Trim("""") Dim strStationColumn As String = dctStationCols.Item(ucrCboStations.GetText).Trim("""") Dim strElementsColumn As String = dctElementsCols.Item(ucrCboElements.GetText).Trim("""") - Dim strStationsValues As String = String.Join(",", ucrReceiverMultipleStations.GetVariableNamesList(bWithQuotes:=True, strQuotes:="'")) - Dim strElementsValues As String = String.Join(",", ucrReceiverMultipleElements.GetVariableNamesList(bWithQuotes:=True, strQuotes:="'")) + Dim strStationsValues As String = GetSQLArrayFilter(ucrReceiverMultipleStations.GetVariableNamesList(bWithQuotes:=False)) + Dim strElementsValues As String = GetSQLArrayFilter(ucrReceiverMultipleElements.GetVariableNamesList(bWithQuotes:=False)) Dim strQueryCondition As String = " INNER JOIN station ON " & strTableName & ".recordedFrom = station.stationId" & " INNER JOIN obselement ON " & strTableName & ".describedBy = obselement.elementId WHERE" & " station." & strStationColumn & " IN (" & strStationsValues & ")" & @@ -308,6 +308,18 @@ Public Class dlgClimSoft End Try End Sub + Private Function GetSQLArrayFilter(values() As String) As String + Dim strSQL As String = "" + For index As Integer = 0 To values.Length - 1 + If index = 0 Then + strSQL = "'" & values(index).Replace("'", "''") & "'" + Else + strSQL = strSQL & "," & "'" & values(index).Replace("'", "''") & "'" + End If + Next + Return strSQL + End Function + Private Sub ucrControlsContents_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverMultipleStations.ControlContentsChanged, ucrReceiverMultipleElements.ControlContentsChanged, ucrCboTable.ControlContentsChanged, ucrCboQCStatus.ControlContentsChanged, ucrDtpStartDataDate.ControlContentsChanged, ucrDtpEndDataDate.ControlContentsChanged, ucrPnlOptions.ControlContentsChanged, ucrChkImportStationsMetadata.ControlContentsChanged, ucrChkImportElementsMetadata.ControlContentsChanged, ucrChkImportFlagsMetadata.ControlContentsChanged Dim bValid As Boolean = False If rdoData.Checked Then diff --git a/instat/dlgClimaticCheckDataRain.vb b/instat/dlgClimaticCheckDataRain.vb index 454d67d285f..97e2fb3b035 100644 --- a/instat/dlgClimaticCheckDataRain.vb +++ b/instat/dlgClimaticCheckDataRain.vb @@ -23,6 +23,7 @@ Public Class dlgClimaticCheckDataRain Private clsGroupByFunc As New RFunction Private clsRainFilterFunc As New RFunction Private clsRunCalcFunc As New RFunction + Private clsDayFilterFunc As New RFunction Private clsListFunc As New RFunction Private clsGroupByMonth As New RFunction 'Large @@ -66,6 +67,7 @@ Public Class dlgClimaticCheckDataRain 'Dry Month Private clsGroupByMonthYearFunction As New RFunction Private clsDryMonthCalculationFunc As New RFunction + Private clsDayFilterCalcFunction As New RFunction Private clsListCalcFunction As New RFunction Private clsSumFuction As New RFunction Private clsDryMonthTestCalculationFunc As New RFunction @@ -74,7 +76,9 @@ Public Class dlgClimaticCheckDataRain Private clsDrySumFuction As New RFunction Private clsFilterMonthFunction As New RFunction Private clsGroupByListFunc As New RFunction + Private clsManuplationDayListFunction As New RFunction Private clsDryMonthEqualOperator As New ROperator + Private clsDayEqualOperator As New ROperator Private clsDryMonthAndOperator As New ROperator Private clsLessOperator As New ROperator Private clsDryTestAndOperator As New ROperator @@ -84,6 +88,7 @@ Public Class dlgClimaticCheckDataRain 'Combined Filters Private clsOrOperator As New ROperator Private clsListSubCalc As New RFunction + Private clsListDayFunction As New RFunction 'Outlier Private clsListForOutlierManipulations As New RFunction Private clsRainyDaysFunc As New RFunction @@ -253,6 +258,7 @@ Public Class dlgClimaticCheckDataRain clsSecondGreaterSameOperator.Clear() clsRainFilterFunc.Clear() + clsDayFilterFunc.Clear() clsLargeTestCalcFunc.Clear() clsSameCalcFunc.Clear() clsCumulativeTestFunc.Clear() @@ -261,6 +267,7 @@ Public Class dlgClimaticCheckDataRain clsUpperOutlierlimitTestFunc.Clear() clsListForOutlierManipulations.Clear() clsDryMonthCalculationFunc.Clear() + clsDayFilterCalcFunction.Clear() clsGroupByMonthYearFunction.Clear() clsListCalcFunction.Clear() clsSumFuction.Clear() @@ -270,7 +277,9 @@ Public Class dlgClimaticCheckDataRain clsDrySumFuction.Clear() clsFilterMonthFunction.Clear() clsGroupByListFunc.Clear() + clsManuplationDayListFunction.Clear() clsDryMonthEqualOperator.Clear() + clsDayEqualOperator.Clear() clsDryMonthAndOperator.Clear() clsLessOperator.Clear() clsDryTestAndOperator.Clear() @@ -296,11 +305,23 @@ Public Class dlgClimaticCheckDataRain clsRainFilterFunc.AddParameter("function_exp", clsROperatorParameter:=clsOrOperator, iPosition:=1) clsRainFilterFunc.AddParameter("sub_calculations", clsRFunctionParameter:=clsListSubCalc, iPosition:=2) clsRainFilterFunc.AddParameter("result_data_frame", Chr(34) & "qcRain" & Chr(34), iPosition:=4) - clsRainFilterFunc.AddParameter("save", 2, iPosition:=5) clsRainFilterFunc.SetAssignTo("rainfall_filter") + clsManuplationDayListFunction.SetRCommand("list") + clsManuplationDayListFunction.AddParameter("list", clsRFunctionParameter:=clsRainFilterFunc, iPosition:=0, bIncludeArgumentName:=False) + + clsDayFilterFunc.SetRCommand("instat_calculation$new") + clsDayFilterFunc.AddParameter("type", Chr(34) & "filter" & Chr(34), iPosition:=0) + clsDayFilterFunc.AddParameter("function_exp", Chr(34) & "day" & Chr(34), iPosition:=1) + clsDayFilterFunc.AddParameter("sub_calculations", clsRFunctionParameter:=clsListDayFunction, iPosition:=2) + clsDayFilterFunc.AddParameter("result_data_frame", Chr(34) & "qcRain" & Chr(34), iPosition:=4) + clsDayFilterFunc.SetAssignTo("filter_first_day") + clsListSubCalc.SetRCommand("list") + clsListDayFunction.SetRCommand("list") + clsListDayFunction.AddParameter("cal", clsRFunctionParameter:=clsDayFilterCalcFunction, iPosition:=0, bIncludeArgumentName:=False) + clsManipList.SetRCommand("list") clsManipList.AddParameter("manip1", clsRFunctionParameter:=clsGroupByFunc, bIncludeArgumentName:=False, iPosition:=0) @@ -530,6 +551,13 @@ Public Class dlgClimaticCheckDataRain clsDryMonthCalculationFunc.AddParameter("result_name", Chr(34) & strDryMonthCalc & Chr(34), iPosition:=4) clsDryMonthCalculationFunc.SetAssignTo("dry_month_calculation") + clsDayFilterCalcFunction.SetRCommand("instat_calculation$new") + clsDayFilterCalcFunction.AddParameter("type", Chr(34) & "calculation" & Chr(34), iPosition:=0) + clsDayFilterCalcFunction.AddParameter("function_exp", clsROperatorParameter:=clsDayEqualOperator, iPosition:=1) + clsDayFilterCalcFunction.AddParameter("manipulations", clsRFunctionParameter:=clsManuplationDayListFunction, iPosition:=3) + clsDayFilterCalcFunction.AddParameter("result_name", Chr(34) & "day" & Chr(34), iPosition:=4) + clsDayFilterCalcFunction.SetAssignTo("day_calculation") + clsListCalcFunction.SetRCommand("list") clsListCalcFunction.AddParameter("year_month_grouping", clsRFunctionParameter:=clsGroupByMonthYearFunction, bIncludeArgumentName:=False, iPosition:=1) @@ -537,6 +565,10 @@ Public Class dlgClimaticCheckDataRain clsDryMonthEqualOperator.AddParameter("sum", clsRFunctionParameter:=clsSumFuction, iPosition:=0) clsDryMonthEqualOperator.AddParameter("zero", 0, iPosition:=1) + clsDayEqualOperator.SetOperation("==") + clsDayEqualOperator.AddParameter("one", "1", iPosition:=1, bIncludeArgumentName:=False) + clsDayEqualOperator.bToScriptAsRString = True + clsSumFuction.SetRCommand("sum") clsLessOperator.SetOperation("<") @@ -570,9 +602,9 @@ Public Class dlgClimaticCheckDataRain ' Run Calc function clsRunCalcFunc.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$run_instat_calculation") - clsRunCalcFunc.AddParameter("calc", clsRFunctionParameter:=clsRainFilterFunc, iPosition:=0) clsRunCalcFunc.AddParameter("display", "FALSE", iPosition:=1) ucrBase.clsRsyntax.SetBaseRFunction(clsRunCalcFunc) + AddRemoveDayFilter() End Sub Private Sub setRcodeForControls(bReset) @@ -624,6 +656,7 @@ Public Class dlgClimaticCheckDataRain ucrChkLogicalColumns.SetRCode(clsLargeTestCalcFunc, bReset) ucrChkCalculatedColumns.SetRCode(clsCumulativeCalcFunc, bReset) + 'AddRemoveDayFilter() End Sub Private Sub TestOkEnabled() @@ -683,10 +716,11 @@ Public Class dlgClimaticCheckDataRain GroupByMonth() End Sub - Private Sub ucrSelectorRain_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectorRain.ControlValueChanged, ucrReceiverElement.ControlValueChanged + Private Sub ucrSelectorRain_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectorRain.ControlValueChanged, ucrReceiverElement.ControlValueChanged, ucrReceiverDay.ControlValueChanged, ucrReceiverMonth.ControlValueChanged, ucrReceiverYear.ControlValueChanged strCurrDataName = Chr(34) & ucrSelectorRain.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34) clsRainyDaysFunc.AddParameter("calculated_from", "list(" & strCurrDataName & "=" & ucrReceiverElement.GetVariableNames & ")", iPosition:=2) clsDryMonthCalculationFunc.AddParameter("calculated_from", "list(" & strCurrDataName & "=" & ucrReceiverElement.GetVariableNames & ")", iPosition:=2) + clsDayFilterCalcFunction.AddParameter("calculated_from", "list(" & Chr(34) & "qcRain" & Chr(34) & "=" & ucrReceiverDay.GetVariableNames & "," & Chr(34) & "qcRain" & Chr(34) & "=" & ucrReceiverMonth.GetVariableNames & "," & Chr(34) & "qcRain" & Chr(34) & "=" & ucrReceiverYear.GetVariableNames & ")", iPosition:=2) clsUpperOutlierLimitValueCalcFunc.AddParameter("calculated_from", "list(" & strCurrDataName & "=" & ucrReceiverElement.GetVariableNames & ")", iPosition:=2) clsLargeTestCalcFunc.AddParameter("calculated_from", "list(" & strCurrDataName & "=" & ucrReceiverElement.GetVariableNames & ")", iPosition:=2) clsSameCalcFunc.AddParameter("calculated_from", "list(" & strCurrDataName & "= " & ucrReceiverElement.GetVariableNames & ")", iPosition:=2) @@ -697,10 +731,14 @@ Public Class dlgClimaticCheckDataRain GroupByOptions() GroupByMonth() + AddRemoveDayFilter() + AddDoy() End Sub Private Sub ucrSelectorRain_DataFrameChanged() Handles ucrSelectorRain.DataFrameChanged AutoFillRainColumn() + AddRemoveDayFilter() + AddDoy() End Sub Private Sub AutoFillRainColumn() @@ -718,4 +756,31 @@ Public Class dlgClimaticCheckDataRain Private Sub ucrReceiverElement_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverElement.ControlContentsChanged, ucrChkLarge.ControlContentsChanged, ucrChkSame.ControlContentsChanged, ucrChkWetDays.ControlContentsChanged, ucrNudLarge.ControlContentsChanged, ucrNudSame.ControlContentsChanged, ucrNudWetDays.ControlContentsChanged, ucrChkOutlier.ControlContentsChanged, ucrChkOmitZero.ControlContentsChanged, ucrInputThresholdValue.ControlContentsChanged, ucrChkDryMonth.ControlContentsChanged, ucrInputThreshold.ControlContentsChanged, ucrReceiverMonth.ControlContentsChanged, ucrInputSameValue.ControlContentsChanged TestOkEnabled() End Sub + + Private Sub ucrChkDryMonth_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkDryMonth.ControlValueChanged + AddRemoveDayFilter() + End Sub + + Private Sub AddRemoveDayFilter() + clsRunCalcFunc.RemoveParameterByName("calc") + If ucrChkDryMonth.Checked Then + clsRunCalcFunc.AddParameter("calc", clsRFunctionParameter:=clsDayFilterFunc, iPosition:=0) + clsDayFilterFunc.AddParameter("save", 2, iPosition:=5) + clsRainFilterFunc.RemoveParameterByName("save") + Else + clsRunCalcFunc.AddParameter("calc", clsRFunctionParameter:=clsRainFilterFunc, iPosition:=0) + clsRainFilterFunc.AddParameter("save", 2, iPosition:=5) + clsDayFilterFunc.RemoveParameterByName("save") + End If + AddDoy() + End Sub + + Private Sub AddDoy() + If Not ucrReceiverDay.IsEmpty Then + clsDayEqualOperator.AddParameter("doy", ucrReceiverDay.GetVariableNames(False), iPosition:=0, bIncludeArgumentName:=False) + + Else + clsDayEqualOperator.RemoveParameterByName("doy") + End If + End Sub End Class diff --git a/instat/dlgClimaticLengthOfSeason.Designer.vb b/instat/dlgClimaticLengthOfSeason.Designer.vb index 3638ded5f76..25c8f8d3eee 100644 --- a/instat/dlgClimaticLengthOfSeason.Designer.vb +++ b/instat/dlgClimaticLengthOfSeason.Designer.vb @@ -78,7 +78,7 @@ Partial Class dlgClimaticLengthOfSeason ' Me.ucrChkType.AutoSize = True Me.ucrChkType.Checked = False - Me.ucrChkType.Location = New System.Drawing.Point(5, 285) + Me.ucrChkType.Location = New System.Drawing.Point(5, 279) Me.ucrChkType.Name = "ucrChkType" Me.ucrChkType.Size = New System.Drawing.Size(87, 23) Me.ucrChkType.TabIndex = 11 @@ -98,7 +98,7 @@ Partial Class dlgClimaticLengthOfSeason Me.ucrInputTextType.AutoSize = True Me.ucrInputTextType.IsMultiline = False Me.ucrInputTextType.IsReadOnly = False - Me.ucrInputTextType.Location = New System.Drawing.Point(97, 284) + Me.ucrInputTextType.Location = New System.Drawing.Point(149, 278) Me.ucrInputTextType.Name = "ucrInputTextType" Me.ucrInputTextType.Size = New System.Drawing.Size(137, 21) Me.ucrInputTextType.TabIndex = 12 @@ -184,7 +184,7 @@ Partial Class dlgClimaticLengthOfSeason Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrBase.Location = New System.Drawing.Point(5, 311) Me.ucrBase.Name = "ucrBase" - Me.ucrBase.Size = New System.Drawing.Size(405, 52) + Me.ucrBase.Size = New System.Drawing.Size(408, 52) Me.ucrBase.TabIndex = 13 ' 'dlgClimaticLengthOfSeason diff --git a/instat/dlgClimaticLengthOfSeason.vb b/instat/dlgClimaticLengthOfSeason.vb index 321ef0fc7ee..e6221ade614 100644 --- a/instat/dlgClimaticLengthOfSeason.vb +++ b/instat/dlgClimaticLengthOfSeason.vb @@ -20,8 +20,8 @@ Public Class dlgClimaticLengthOfSeason Private bReset As Boolean = True Private strCurrDataName As String = "" - Private clsLengthOfSeasonFunction, clsApplyInstatCalcFunction, clsCombinationCalcFunction, clsStartEndStatusFunction, clsIfElseFunction, clsIsNAFunction, clsCombinationListFunction As New RFunction - Private clsMinusOpertor, clsAndOperator, clsOROperator As New ROperator + Private clsLengthOfSeasonFunction, clsConvertColumnTypeFunction, clsApplyInstatCalcFunction, clsAsCharacterFunction, clsCombinationCalcFunction, clsStartEndStatusFunction, clsCaseWhenFunction, clsIsNAFunction, clsIsNA1Function, clsCombinationListFunction As New RFunction + Private clsMinusOpertor, clsAndOperator, clsOROperator, clsCaseWhenOperator, clsCaseWhen1Operator, clsCaseWhen2Operator, clsCaseWhen3Operator, clsAssignOperator, clsAssign1Operator, clsAssign2Operator, clsAssign3Operator, clsAssign4Operator, clsAnd1Operator, clsAnd2Operator As New ROperator Private Sub dlgClimaticLengthOfSeason_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstLoad Then @@ -50,7 +50,6 @@ Public Class dlgClimaticLengthOfSeason ucrReceiverStartofRainsLogical.bWithQuotes = False ucrReceiverStartofRainsLogical.Selector = ucrSelectorLengthofSeason - ucrReceiverEndofRains.SetParameter(New RParameter("end_rain", 0, bNewIncludeArgumentName:=False)) ucrReceiverEndofRains.SetParameterIsString() ucrReceiverEndofRains.bWithQuotes = False @@ -70,7 +69,6 @@ Public Class dlgClimaticLengthOfSeason ucrInputLengthofSeason.SetDataFrameSelector(ucrSelectorLengthofSeason.ucrAvailableDataFrames) ucrInputLengthofSeason.SetName("Length") - ucrChkType.AddParameterPresentCondition(True, "sub2", True) ucrChkType.AddParameterPresentCondition(False, "sub2", False) ucrChkType.AddToLinkedControls(ucrInputTextType, {True}, bNewLinkedHideIfParameterMissing:=True) @@ -91,12 +89,24 @@ Public Class dlgClimaticLengthOfSeason clsStartEndStatusFunction.Clear() clsCombinationListFunction.Clear() clsIsNAFunction.Clear() - + clsIsNA1Function.Clear() + clsAsCharacterFunction.Clear() clsMinusOpertor.Clear() clsAndOperator.Clear() clsOROperator.Clear() - + clsCaseWhenOperator.Clear() + clsCaseWhen1Operator.Clear() + clsCaseWhen2Operator.Clear() + clsCaseWhen3Operator.Clear() + clsAssignOperator.Clear() + clsAssign1Operator.Clear() + clsAssign2Operator.Clear() + clsAssign3Operator.Clear() + clsAssign4Operator.Clear() + clsAnd1Operator.Clear() + clsAnd2Operator.Clear() + clsConvertColumnTypeFunction.Clear() ucrSelectorLengthofSeason.Reset() ucrReceiverStartofRains.SetMeAsReceiver() @@ -115,24 +125,80 @@ Public Class dlgClimaticLengthOfSeason 'start status calculation clsStartEndStatusFunction.SetRCommand("instat_calculation$new") clsStartEndStatusFunction.AddParameter("type", Chr(34) & "calculation" & Chr(34), iPosition:=0) - clsStartEndStatusFunction.AddParameter("function_exp", clsRFunctionParameter:=clsIfElseFunction, iPosition:=1) + clsStartEndStatusFunction.AddParameter("function_exp", clsRFunctionParameter:=clsCaseWhenFunction, iPosition:=1) clsStartEndStatusFunction.AddParameter("result_name", Chr(34) & strTypeName & Chr(34), iPosition:=2) clsStartEndStatusFunction.AddParameter("save", 2, iPosition:=6) clsStartEndStatusFunction.SetAssignTo("start_end_status") - clsIfElseFunction.SetPackageName("dplyr") - clsIfElseFunction.SetRCommand("if_else") - clsIfElseFunction.AddParameter("is.na", clsRFunctionParameter:=clsIsNAFunction, bIncludeArgumentName:=False, iPosition:=0) - clsIfElseFunction.AddParameter("NA", "NA", bIncludeArgumentName:=False, iPosition:=1) - clsIfElseFunction.AddParameter("and", clsROperatorParameter:=clsAndOperator, bIncludeArgumentName:=False, iPosition:=2) - clsIfElseFunction.bToScriptAsRString = True + clsCaseWhenFunction.SetPackageName("dplyr") + clsCaseWhenFunction.SetRCommand("case_when") + clsCaseWhenFunction.AddParameter("is.na", clsROperatorParameter:=clsCaseWhenOperator, bIncludeArgumentName:=False, iPosition:=0) + clsCaseWhenFunction.AddParameter("NA", clsROperatorParameter:=clsCaseWhen1Operator, bIncludeArgumentName:=False, iPosition:=1) + clsCaseWhenFunction.AddParameter("and", clsROperatorParameter:=clsCaseWhen2Operator, bIncludeArgumentName:=False, iPosition:=2) + clsCaseWhenFunction.AddParameter("test", clsROperatorParameter:=clsCaseWhen3Operator, bIncludeArgumentName:=False, iPosition:=3) + clsCaseWhenFunction.bToScriptAsRString = True clsAndOperator.SetOperation("&") clsIsNAFunction.SetRCommand("is.na") - clsIsNAFunction.AddParameter("or", clsROperatorParameter:=clsOROperator, bIncludeArgumentName:=False) + + clsIsNA1Function.SetRCommand("is.na") + + clsCaseWhenOperator.SetOperation("~") + clsCaseWhenOperator.AddParameter("left", clsROperatorParameter:=clsOROperator, iPosition:=0, bIncludeArgumentName:=False) + clsCaseWhenOperator.AddParameter("right", "NA_character_", iPosition:=1, bIncludeArgumentName:=False) + clsCaseWhenOperator.bBrackets = False + + clsCaseWhen1Operator.SetOperation("~") + clsCaseWhen1Operator.AddParameter("left", clsROperatorParameter:=clsAssignOperator, iPosition:=0, bIncludeArgumentName:=False) + clsCaseWhen1Operator.AddParameter("right", clsRFunctionParameter:=clsAsCharacterFunction, iPosition:=1, bIncludeArgumentName:=False) + clsCaseWhen1Operator.bBrackets = False + + clsCaseWhen2Operator.SetOperation("~") + clsCaseWhen2Operator.AddParameter("left", clsROperatorParameter:=clsAssign2Operator, iPosition:=0, bIncludeArgumentName:=False) + clsCaseWhen2Operator.AddParameter("right", "'NONE'", iPosition:=1, bIncludeArgumentName:=False) + clsCaseWhen2Operator.bBrackets = False + + clsCaseWhen3Operator.SetOperation("~") + clsCaseWhen3Operator.AddParameter("left", clsROperatorParameter:=clsAssign4Operator, iPosition:=0, bIncludeArgumentName:=False) + clsCaseWhen3Operator.AddParameter("right", "'MORE'", iPosition:=1, bIncludeArgumentName:=False) + clsCaseWhen3Operator.bBrackets = False + + clsAsCharacterFunction.SetRCommand("as.character") + + clsAssignOperator.SetOperation("==") + clsAssignOperator.bBrackets = False + + clsAssign2Operator.SetOperation("==") + clsAssign2Operator.AddParameter("left", clsROperatorParameter:=clsAnd1Operator, iPosition:=0, bIncludeArgumentName:=False) + clsAssign2Operator.AddParameter("right", "TRUE", iPosition:=1, bIncludeArgumentName:=False) + clsAssign2Operator.bBrackets = False + + clsAnd1Operator.SetOperation("&") + clsAnd1Operator.AddParameter("left", clsROperatorParameter:=clsAssign1Operator, iPosition:=0, bIncludeArgumentName:=False) + clsAnd1Operator.bBrackets = False + + clsAssign1Operator.SetOperation("==") + clsAssign1Operator.AddParameter("right", "FALSE", iPosition:=1, bIncludeArgumentName:=False) + clsAssign1Operator.bBrackets = False + + clsAssign4Operator.SetOperation("==") + clsAssign4Operator.AddParameter("left", clsROperatorParameter:=clsAnd2Operator, iPosition:=0, bIncludeArgumentName:=False) + clsAssign4Operator.AddParameter("right", "FALSE", iPosition:=1, bIncludeArgumentName:=False) + clsAssign4Operator.bBrackets = False + + clsAnd2Operator.SetOperation("&") + clsAnd2Operator.AddParameter("left", clsROperatorParameter:=clsAssign3Operator, iPosition:=0, bIncludeArgumentName:=False) + clsAnd2Operator.bBrackets = False + + clsAssign3Operator.SetOperation("==") + clsAssign3Operator.AddParameter("right", "TRUE", iPosition:=1, bIncludeArgumentName:=False) + clsAssign3Operator.bBrackets = False clsOROperator.SetOperation("|") + clsOROperator.AddParameter("left", clsRFunctionParameter:=clsIsNAFunction, iPosition:=0, bIncludeArgumentName:=False) + clsOROperator.AddParameter("right", clsRFunctionParameter:=clsIsNA1Function, iPosition:=1, bIncludeArgumentName:=False) + clsOROperator.bBrackets = False 'combination calculation clsCombinationCalcFunction.SetRCommand("instat_calculation$new") @@ -148,13 +214,25 @@ Public Class dlgClimaticLengthOfSeason clsApplyInstatCalcFunction.AddParameter("calc", clsRFunctionParameter:=clsCombinationCalcFunction, iPosition:=0) clsApplyInstatCalcFunction.AddParameter("display", "FALSE", iPosition:=1) + clsConvertColumnTypeFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$convert_column_to_type") + clsConvertColumnTypeFunction.AddParameter("to_type", Chr(34) & "factor" & Chr(34), iPosition:=2) + 'Base Function + ucrBase.clsRsyntax.ClearCodes() ucrBase.clsRsyntax.SetBaseRFunction(clsApplyInstatCalcFunction) End Sub Private Sub SetRCodeForControls(bReset As Boolean) - ucrReceiverStartofRainsLogical.AddAdditionalCodeParameterPair(clsOROperator, New RParameter("start_status", 0), iAdditionalPairNo:=1) - ucrReceiverEndofRainsLogical.AddAdditionalCodeParameterPair(clsOROperator, New RParameter("end_status", 1), iAdditionalPairNo:=1) + ucrReceiverStartofRainsLogical.AddAdditionalCodeParameterPair(clsIsNAFunction, New RParameter("start_status", 0, bNewIncludeArgumentName:=False), iAdditionalPairNo:=1) + ucrReceiverEndofRainsLogical.AddAdditionalCodeParameterPair(clsIsNA1Function, New RParameter("end_status", 1, bNewIncludeArgumentName:=False), iAdditionalPairNo:=1) + ucrReceiverStartofRainsLogical.AddAdditionalCodeParameterPair(clsAsCharacterFunction, New RParameter("start_status", 0, bNewIncludeArgumentName:=False), iAdditionalPairNo:=2) + ucrReceiverStartofRainsLogical.AddAdditionalCodeParameterPair(clsAssignOperator, New RParameter("start_status", 0), iAdditionalPairNo:=3) + ucrReceiverEndofRainsLogical.AddAdditionalCodeParameterPair(clsAssignOperator, New RParameter("end_status", 1), iAdditionalPairNo:=2) + ucrReceiverEndofRainsLogical.AddAdditionalCodeParameterPair(clsAnd1Operator, New RParameter("end_status", 1), iAdditionalPairNo:=3) + ucrReceiverStartofRainsLogical.AddAdditionalCodeParameterPair(clsAssign1Operator, New RParameter("start_status", 0), iAdditionalPairNo:=4) + ucrReceiverEndofRainsLogical.AddAdditionalCodeParameterPair(clsAnd2Operator, New RParameter("end_status", 1), iAdditionalPairNo:=4) + ucrReceiverStartofRainsLogical.AddAdditionalCodeParameterPair(clsAssign3Operator, New RParameter("start_status", 0), iAdditionalPairNo:=5) + ucrInputTextType.AddAdditionalCodeParameterPair(clsConvertColumnTypeFunction, New RParameter("col_names", 1), iAdditionalPairNo:=1) ucrReceiverStartofRains.SetRCode(clsMinusOpertor, bReset) ucrReceiverEndofRains.SetRCode(clsMinusOpertor, bReset) @@ -212,12 +290,19 @@ Public Class dlgClimaticLengthOfSeason Private Sub ucrChkType_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkType.ControlValueChanged If ucrChkType.Checked Then clsCombinationListFunction.AddParameter("sub2", clsRFunctionParameter:=clsStartEndStatusFunction, bIncludeArgumentName:=False, iPosition:=1) + ucrBase.clsRsyntax.AddToAfterCodes(clsConvertColumnTypeFunction, iPosition:=0) Else clsCombinationListFunction.RemoveParameterByName("sub2") + ucrBase.clsRsyntax.RemoveFromAfterCodes(clsConvertColumnTypeFunction) + End If End Sub Private Sub ucrChkLengthofSeason_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrChkLengthofSeason.ControlContentsChanged, ucrChkType.ControlContentsChanged, ucrInputLengthofSeason.ControlContentsChanged, ucrInputTextType.ControlContentsChanged, ucrReceiverStartofRains.ControlContentsChanged, ucrReceiverEndofRains.ControlContentsChanged, ucrReceiverStartofRainsLogical.ControlContentsChanged, ucrReceiverEndofRainsLogical.ControlContentsChanged TestOKEnabled() End Sub + + Private Sub ucrSelectorLengthofSeason_DataFrameChanged() Handles ucrSelectorLengthofSeason.DataFrameChanged + clsConvertColumnTypeFunction.AddParameter("data_name", Chr(34) & ucrSelectorLengthofSeason.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) + End Sub End Class \ No newline at end of file diff --git a/instat/dlgClimograph.Designer.vb b/instat/dlgClimograph.Designer.vb index 241a4a22a6c..1e7a8f54281 100644 --- a/instat/dlgClimograph.Designer.vb +++ b/instat/dlgClimograph.Designer.vb @@ -22,40 +22,67 @@ Partial Class dlgClimograph 'Ne la modifiez pas à l'aide de l'éditeur de code. _ Private Sub InitializeComponent() - Me.ucrReceiverAbsolute = New instat.ucrReceiverSingle() + Me.components = New System.ComponentModel.Container() Me.lblAbsolute = New System.Windows.Forms.Label() - Me.ucrInputStation = New instat.ucrInputComboBox() - Me.ucr1stFactorReceiver = New instat.ucrReceiverSingle() Me.lblFacetBy = New System.Windows.Forms.Label() - Me.ucrReceiverRain = New instat.ucrReceiverSingle() Me.lblRain = New System.Windows.Forms.Label() - Me.ucrReceiverMaxtem = New instat.ucrReceiverSingle() Me.lblMaxtem = New System.Windows.Forms.Label() - Me.ucrReceiverMintemp = New instat.ucrReceiverSingle() Me.lblMintem = New System.Windows.Forms.Label() Me.rdoClimograph = New System.Windows.Forms.RadioButton() Me.rdoWalterLieth = New System.Windows.Forms.RadioButton() + Me.lblMonth = New System.Windows.Forms.Label() + Me.lblFacet = New System.Windows.Forms.Label() + Me.lblRainC = New System.Windows.Forms.Label() + Me.lblElement1 = New System.Windows.Forms.Label() + Me.lblElement2 = New System.Windows.Forms.Label() + Me.lblMonthC = New System.Windows.Forms.Label() + Me.rdoViridis = New System.Windows.Forms.RadioButton() + Me.rdoPalette = New System.Windows.Forms.RadioButton() + Me.rdoSinglecolour = New System.Windows.Forms.RadioButton() + Me.contextMenuStripOptions = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.toolStripMenuItemPlotOptions = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItemBarchartOptions = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItemTmaxLineOptions = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItemTminLineOptions = New System.Windows.Forms.ToolStripMenuItem() + Me.rdoClimateBars = New System.Windows.Forms.RadioButton() + Me.lblRainBar = New System.Windows.Forms.Label() + Me.lblElement1Bar = New System.Windows.Forms.Label() + Me.lblElement2Bar = New System.Windows.Forms.Label() + Me.lblMonthBar = New System.Windows.Forms.Label() + Me.ucrReceiverRainBar = New instat.ucrReceiverSingle() + Me.ucrReceiverElement1Bar = New instat.ucrReceiverSingle() + Me.ucrReceiverElement2Bar = New instat.ucrReceiverSingle() + Me.ucrReceiverMonthBar = New instat.ucrReceiverSingle() + Me.cmdOptions = New instat.ucrSplitButton() + Me.ucrInputPalette = New instat.ucrInputComboBox() + Me.ucrPnlColour = New instat.UcrPanel() + Me.ucrInputColourPalette = New instat.ucrInputComboBox() + Me.ucrChkColour = New instat.ucrCheck() + Me.ucrChkTile = New instat.ucrCheck() + Me.ucrChkText = New instat.ucrCheck() + Me.ucrChkRibbon = New instat.ucrCheck() + Me.ucrInputLegendPosition = New instat.ucrInputComboBox() + Me.ucrChkLegend = New instat.ucrCheck() + Me.ucrInputFacet = New instat.ucrInputComboBox() + Me.ucrReceiverFacet = New instat.ucrReceiverSingle() + Me.ucrReceiverRainC = New instat.ucrReceiverSingle() + Me.ucrReceiverElement1 = New instat.ucrReceiverSingle() + Me.ucrReceiverElement2 = New instat.ucrReceiverSingle() + Me.ucrReceiverMonthC = New instat.ucrReceiverSingle() + Me.ucrReceiverAbsolute = New instat.ucrReceiverSingle() + Me.ucrInputStation = New instat.ucrInputComboBox() + Me.ucr1stFactorReceiver = New instat.ucrReceiverSingle() + Me.ucrReceiverRain = New instat.ucrReceiverSingle() + Me.ucrReceiverMaxtem = New instat.ucrReceiverSingle() + Me.ucrReceiverMintemp = New instat.ucrReceiverSingle() Me.ucrPnlClimograph = New instat.UcrPanel() Me.ucrBase = New instat.ucrButtons() Me.ucrSave = New instat.ucrSave() Me.ucrReceiverMonth = New instat.ucrReceiverSingle() - Me.lblMonth = New System.Windows.Forms.Label() Me.ucrSelectorClimograph = New instat.ucrSelectorByDataFrameAddRemove() + Me.contextMenuStripOptions.SuspendLayout() Me.SuspendLayout() ' - 'ucrReceiverAbsolute - ' - Me.ucrReceiverAbsolute.AutoSize = True - Me.ucrReceiverAbsolute.frmParent = Me - Me.ucrReceiverAbsolute.Location = New System.Drawing.Point(267, 280) - Me.ucrReceiverAbsolute.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverAbsolute.Name = "ucrReceiverAbsolute" - Me.ucrReceiverAbsolute.Selector = Nothing - Me.ucrReceiverAbsolute.Size = New System.Drawing.Size(120, 20) - Me.ucrReceiverAbsolute.strNcFilePath = "" - Me.ucrReceiverAbsolute.TabIndex = 77 - Me.ucrReceiverAbsolute.ucrSelector = Nothing - ' 'lblAbsolute ' Me.lblAbsolute.AutoSize = True @@ -65,30 +92,6 @@ Partial Class dlgClimograph Me.lblAbsolute.TabIndex = 76 Me.lblAbsolute.Text = "Temperature min, min:" ' - 'ucrInputStation - ' - Me.ucrInputStation.AddQuotesIfUnrecognised = True - Me.ucrInputStation.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrInputStation.GetSetSelectedIndex = -1 - Me.ucrInputStation.IsReadOnly = False - Me.ucrInputStation.Location = New System.Drawing.Point(379, 68) - Me.ucrInputStation.Name = "ucrInputStation" - Me.ucrInputStation.Size = New System.Drawing.Size(86, 21) - Me.ucrInputStation.TabIndex = 65 - ' - 'ucr1stFactorReceiver - ' - Me.ucr1stFactorReceiver.AutoSize = True - Me.ucr1stFactorReceiver.frmParent = Me - Me.ucr1stFactorReceiver.Location = New System.Drawing.Point(267, 68) - Me.ucr1stFactorReceiver.Margin = New System.Windows.Forms.Padding(0) - Me.ucr1stFactorReceiver.Name = "ucr1stFactorReceiver" - Me.ucr1stFactorReceiver.Selector = Nothing - Me.ucr1stFactorReceiver.Size = New System.Drawing.Size(109, 26) - Me.ucr1stFactorReceiver.strNcFilePath = "" - Me.ucr1stFactorReceiver.TabIndex = 64 - Me.ucr1stFactorReceiver.ucrSelector = Nothing - ' 'lblFacetBy ' Me.lblFacetBy.AutoSize = True @@ -100,19 +103,6 @@ Partial Class dlgClimograph Me.lblFacetBy.Tag = "" Me.lblFacetBy.Text = "Station:" ' - 'ucrReceiverRain - ' - Me.ucrReceiverRain.AutoSize = True - Me.ucrReceiverRain.frmParent = Me - Me.ucrReceiverRain.Location = New System.Drawing.Point(267, 150) - Me.ucrReceiverRain.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverRain.Name = "ucrReceiverRain" - Me.ucrReceiverRain.Selector = Nothing - Me.ucrReceiverRain.Size = New System.Drawing.Size(120, 20) - Me.ucrReceiverRain.strNcFilePath = "" - Me.ucrReceiverRain.TabIndex = 69 - Me.ucrReceiverRain.ucrSelector = Nothing - ' 'lblRain ' Me.lblRain.AutoSize = True @@ -122,19 +112,6 @@ Partial Class dlgClimograph Me.lblRain.TabIndex = 68 Me.lblRain.Text = "RainFall:" ' - 'ucrReceiverMaxtem - ' - Me.ucrReceiverMaxtem.AutoSize = True - Me.ucrReceiverMaxtem.frmParent = Me - Me.ucrReceiverMaxtem.Location = New System.Drawing.Point(267, 193) - Me.ucrReceiverMaxtem.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverMaxtem.Name = "ucrReceiverMaxtem" - Me.ucrReceiverMaxtem.Selector = Nothing - Me.ucrReceiverMaxtem.Size = New System.Drawing.Size(120, 20) - Me.ucrReceiverMaxtem.strNcFilePath = "" - Me.ucrReceiverMaxtem.TabIndex = 71 - Me.ucrReceiverMaxtem.ucrSelector = Nothing - ' 'lblMaxtem ' Me.lblMaxtem.AutoSize = True @@ -144,19 +121,6 @@ Partial Class dlgClimograph Me.lblMaxtem.TabIndex = 70 Me.lblMaxtem.Text = "Temperature Max:" ' - 'ucrReceiverMintemp - ' - Me.ucrReceiverMintemp.AutoSize = True - Me.ucrReceiverMintemp.frmParent = Me - Me.ucrReceiverMintemp.Location = New System.Drawing.Point(267, 234) - Me.ucrReceiverMintemp.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverMintemp.Name = "ucrReceiverMintemp" - Me.ucrReceiverMintemp.Selector = Nothing - Me.ucrReceiverMintemp.Size = New System.Drawing.Size(120, 20) - Me.ucrReceiverMintemp.strNcFilePath = "" - Me.ucrReceiverMintemp.TabIndex = 73 - Me.ucrReceiverMintemp.ucrSelector = Nothing - ' 'lblMintem ' Me.lblMintem.AutoSize = True @@ -170,19 +134,18 @@ Partial Class dlgClimograph ' Me.rdoClimograph.Appearance = System.Windows.Forms.Appearance.Button Me.rdoClimograph.BackColor = System.Drawing.SystemColors.Control - Me.rdoClimograph.Enabled = False Me.rdoClimograph.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption Me.rdoClimograph.FlatAppearance.BorderSize = 2 Me.rdoClimograph.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption Me.rdoClimograph.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.rdoClimograph.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoClimograph.Location = New System.Drawing.Point(195, 13) + Me.rdoClimograph.Location = New System.Drawing.Point(107, 10) Me.rdoClimograph.Name = "rdoClimograph" - Me.rdoClimograph.Size = New System.Drawing.Size(119, 28) + Me.rdoClimograph.Size = New System.Drawing.Size(79, 28) Me.rdoClimograph.TabIndex = 62 Me.rdoClimograph.TabStop = True Me.rdoClimograph.Tag = "" - Me.rdoClimograph.Text = "Ordinary Climograph" + Me.rdoClimograph.Text = "Climograph" Me.rdoClimograph.TextAlign = System.Drawing.ContentAlignment.MiddleCenter Me.rdoClimograph.UseVisualStyleBackColor = False ' @@ -195,7 +158,7 @@ Partial Class dlgClimograph Me.rdoWalterLieth.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption Me.rdoWalterLieth.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.rdoWalterLieth.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoWalterLieth.Location = New System.Drawing.Point(117, 13) + Me.rdoWalterLieth.Location = New System.Drawing.Point(185, 10) Me.rdoWalterLieth.Name = "rdoWalterLieth" Me.rdoWalterLieth.Size = New System.Drawing.Size(80, 28) Me.rdoWalterLieth.TabIndex = 61 @@ -205,19 +168,499 @@ Partial Class dlgClimograph Me.rdoWalterLieth.TextAlign = System.Drawing.ContentAlignment.MiddleCenter Me.rdoWalterLieth.UseVisualStyleBackColor = False ' + 'lblMonth + ' + Me.lblMonth.AutoSize = True + Me.lblMonth.Location = New System.Drawing.Point(267, 93) + Me.lblMonth.Name = "lblMonth" + Me.lblMonth.Size = New System.Drawing.Size(40, 13) + Me.lblMonth.TabIndex = 66 + Me.lblMonth.Text = "Month:" + ' + 'lblFacet + ' + Me.lblFacet.AutoSize = True + Me.lblFacet.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblFacet.Location = New System.Drawing.Point(267, 53) + Me.lblFacet.Name = "lblFacet" + Me.lblFacet.Size = New System.Drawing.Size(52, 13) + Me.lblFacet.TabIndex = 84 + Me.lblFacet.Tag = "" + Me.lblFacet.Text = "Facet By:" + ' + 'lblRainC + ' + Me.lblRainC.AutoSize = True + Me.lblRainC.Location = New System.Drawing.Point(267, 134) + Me.lblRainC.Name = "lblRainC" + Me.lblRainC.Size = New System.Drawing.Size(48, 13) + Me.lblRainC.TabIndex = 89 + Me.lblRainC.Text = "RainFall:" + ' + 'lblElement1 + ' + Me.lblElement1.AutoSize = True + Me.lblElement1.Location = New System.Drawing.Point(267, 177) + Me.lblElement1.Name = "lblElement1" + Me.lblElement1.Size = New System.Drawing.Size(90, 13) + Me.lblElement1.TabIndex = 91 + Me.lblElement1.Text = "Element1 (TMax):" + ' + 'lblElement2 + ' + Me.lblElement2.AutoSize = True + Me.lblElement2.Location = New System.Drawing.Point(267, 218) + Me.lblElement2.Name = "lblElement2" + Me.lblElement2.Size = New System.Drawing.Size(87, 13) + Me.lblElement2.TabIndex = 93 + Me.lblElement2.Text = "Element2 (TMin):" + ' + 'lblMonthC + ' + Me.lblMonthC.AutoSize = True + Me.lblMonthC.Location = New System.Drawing.Point(267, 93) + Me.lblMonthC.Name = "lblMonthC" + Me.lblMonthC.Size = New System.Drawing.Size(40, 13) + Me.lblMonthC.TabIndex = 87 + Me.lblMonthC.Text = "Month:" + ' + 'rdoViridis + ' + Me.rdoViridis.AutoSize = True + Me.rdoViridis.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoViridis.Location = New System.Drawing.Point(14, 382) + Me.rdoViridis.Name = "rdoViridis" + Me.rdoViridis.Size = New System.Drawing.Size(52, 17) + Me.rdoViridis.TabIndex = 123 + Me.rdoViridis.TabStop = True + Me.rdoViridis.Text = "Viridis" + Me.rdoViridis.UseVisualStyleBackColor = True + ' + 'rdoPalette + ' + Me.rdoPalette.AutoSize = True + Me.rdoPalette.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoPalette.Location = New System.Drawing.Point(14, 408) + Me.rdoPalette.Name = "rdoPalette" + Me.rdoPalette.Size = New System.Drawing.Size(58, 17) + Me.rdoPalette.TabIndex = 121 + Me.rdoPalette.TabStop = True + Me.rdoPalette.Text = "Palette" + Me.rdoPalette.UseVisualStyleBackColor = True + ' + 'rdoSinglecolour + ' + Me.rdoSinglecolour.AutoSize = True + Me.rdoSinglecolour.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoSinglecolour.Location = New System.Drawing.Point(14, 433) + Me.rdoSinglecolour.Name = "rdoSinglecolour" + Me.rdoSinglecolour.Size = New System.Drawing.Size(87, 17) + Me.rdoSinglecolour.TabIndex = 124 + Me.rdoSinglecolour.TabStop = True + Me.rdoSinglecolour.Text = "Single Colour" + Me.rdoSinglecolour.UseVisualStyleBackColor = True + ' + 'contextMenuStripOptions + ' + Me.contextMenuStripOptions.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.toolStripMenuItemPlotOptions, Me.toolStripMenuItemBarchartOptions, Me.toolStripMenuItemTmaxLineOptions, Me.toolStripMenuItemTminLineOptions}) + Me.contextMenuStripOptions.Name = "contextMenuStripOk" + Me.contextMenuStripOptions.Size = New System.Drawing.Size(181, 114) + ' + 'toolStripMenuItemPlotOptions + ' + Me.toolStripMenuItemPlotOptions.Name = "toolStripMenuItemPlotOptions" + Me.toolStripMenuItemPlotOptions.Size = New System.Drawing.Size(180, 22) + Me.toolStripMenuItemPlotOptions.Text = "Plot Options" + ' + 'toolStripMenuItemBarchartOptions + ' + Me.toolStripMenuItemBarchartOptions.Name = "toolStripMenuItemBarchartOptions" + Me.toolStripMenuItemBarchartOptions.Size = New System.Drawing.Size(180, 22) + Me.toolStripMenuItemBarchartOptions.Text = "BarChart Options" + ' + 'toolStripMenuItemTmaxLineOptions + ' + Me.toolStripMenuItemTmaxLineOptions.Name = "toolStripMenuItemTmaxLineOptions" + Me.toolStripMenuItemTmaxLineOptions.Size = New System.Drawing.Size(180, 22) + Me.toolStripMenuItemTmaxLineOptions.Text = "Line Options (Tmax)" + ' + 'toolStripMenuItemTminLineOptions + ' + Me.toolStripMenuItemTminLineOptions.Name = "toolStripMenuItemTminLineOptions" + Me.toolStripMenuItemTminLineOptions.Size = New System.Drawing.Size(180, 22) + Me.toolStripMenuItemTminLineOptions.Text = "Line Options (Tmin)" + ' + 'rdoClimateBars + ' + Me.rdoClimateBars.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoClimateBars.BackColor = System.Drawing.SystemColors.Control + Me.rdoClimateBars.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoClimateBars.FlatAppearance.BorderSize = 2 + Me.rdoClimateBars.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoClimateBars.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoClimateBars.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoClimateBars.Location = New System.Drawing.Point(263, 10) + Me.rdoClimateBars.Name = "rdoClimateBars" + Me.rdoClimateBars.Size = New System.Drawing.Size(91, 28) + Me.rdoClimateBars.TabIndex = 128 + Me.rdoClimateBars.TabStop = True + Me.rdoClimateBars.Tag = "" + Me.rdoClimateBars.Text = "Climate Charts" + Me.rdoClimateBars.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoClimateBars.UseVisualStyleBackColor = False + ' + 'lblRainBar + ' + Me.lblRainBar.AutoSize = True + Me.lblRainBar.Location = New System.Drawing.Point(267, 134) + Me.lblRainBar.Name = "lblRainBar" + Me.lblRainBar.Size = New System.Drawing.Size(48, 13) + Me.lblRainBar.TabIndex = 134 + Me.lblRainBar.Text = "RainFall:" + ' + 'lblElement1Bar + ' + Me.lblElement1Bar.AutoSize = True + Me.lblElement1Bar.Location = New System.Drawing.Point(267, 177) + Me.lblElement1Bar.Name = "lblElement1Bar" + Me.lblElement1Bar.Size = New System.Drawing.Size(90, 13) + Me.lblElement1Bar.TabIndex = 136 + Me.lblElement1Bar.Text = "Element1 (TMax):" + ' + 'lblElement2Bar + ' + Me.lblElement2Bar.AutoSize = True + Me.lblElement2Bar.Location = New System.Drawing.Point(267, 218) + Me.lblElement2Bar.Name = "lblElement2Bar" + Me.lblElement2Bar.Size = New System.Drawing.Size(87, 13) + Me.lblElement2Bar.TabIndex = 138 + Me.lblElement2Bar.Text = "Element2 (TMin):" + ' + 'lblMonthBar + ' + Me.lblMonthBar.AutoSize = True + Me.lblMonthBar.Location = New System.Drawing.Point(267, 93) + Me.lblMonthBar.Name = "lblMonthBar" + Me.lblMonthBar.Size = New System.Drawing.Size(40, 13) + Me.lblMonthBar.TabIndex = 132 + Me.lblMonthBar.Text = "Month:" + ' + 'ucrReceiverRainBar + ' + Me.ucrReceiverRainBar.AutoSize = True + Me.ucrReceiverRainBar.frmParent = Me + Me.ucrReceiverRainBar.Location = New System.Drawing.Point(267, 150) + Me.ucrReceiverRainBar.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverRainBar.Name = "ucrReceiverRainBar" + Me.ucrReceiverRainBar.Selector = Nothing + Me.ucrReceiverRainBar.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverRainBar.strNcFilePath = "" + Me.ucrReceiverRainBar.TabIndex = 135 + Me.ucrReceiverRainBar.ucrSelector = Nothing + ' + 'ucrReceiverElement1Bar + ' + Me.ucrReceiverElement1Bar.AutoSize = True + Me.ucrReceiverElement1Bar.frmParent = Me + Me.ucrReceiverElement1Bar.Location = New System.Drawing.Point(267, 193) + Me.ucrReceiverElement1Bar.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverElement1Bar.Name = "ucrReceiverElement1Bar" + Me.ucrReceiverElement1Bar.Selector = Nothing + Me.ucrReceiverElement1Bar.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverElement1Bar.strNcFilePath = "" + Me.ucrReceiverElement1Bar.TabIndex = 137 + Me.ucrReceiverElement1Bar.ucrSelector = Nothing + ' + 'ucrReceiverElement2Bar + ' + Me.ucrReceiverElement2Bar.AutoSize = True + Me.ucrReceiverElement2Bar.frmParent = Me + Me.ucrReceiverElement2Bar.Location = New System.Drawing.Point(267, 234) + Me.ucrReceiverElement2Bar.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverElement2Bar.Name = "ucrReceiverElement2Bar" + Me.ucrReceiverElement2Bar.Selector = Nothing + Me.ucrReceiverElement2Bar.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverElement2Bar.strNcFilePath = "" + Me.ucrReceiverElement2Bar.TabIndex = 139 + Me.ucrReceiverElement2Bar.ucrSelector = Nothing + ' + 'ucrReceiverMonthBar + ' + Me.ucrReceiverMonthBar.AutoSize = True + Me.ucrReceiverMonthBar.frmParent = Me + Me.ucrReceiverMonthBar.Location = New System.Drawing.Point(267, 109) + Me.ucrReceiverMonthBar.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverMonthBar.Name = "ucrReceiverMonthBar" + Me.ucrReceiverMonthBar.Selector = Nothing + Me.ucrReceiverMonthBar.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverMonthBar.strNcFilePath = "" + Me.ucrReceiverMonthBar.TabIndex = 133 + Me.ucrReceiverMonthBar.ucrSelector = Nothing + ' + 'cmdOptions + ' + Me.cmdOptions.AutoSize = True + Me.cmdOptions.ContextMenuStrip = Me.contextMenuStripOptions + Me.cmdOptions.Location = New System.Drawing.Point(11, 234) + Me.cmdOptions.Name = "cmdOptions" + Me.cmdOptions.Size = New System.Drawing.Size(148, 25) + Me.cmdOptions.SplitMenuStrip = Me.contextMenuStripOptions + Me.cmdOptions.TabIndex = 126 + Me.cmdOptions.Tag = "Plot Options" + Me.cmdOptions.Text = "Plot Options" + Me.cmdOptions.UseVisualStyleBackColor = True + ' + 'ucrInputPalette + ' + Me.ucrInputPalette.AddQuotesIfUnrecognised = True + Me.ucrInputPalette.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrInputPalette.GetSetSelectedIndex = -1 + Me.ucrInputPalette.IsReadOnly = False + Me.ucrInputPalette.Location = New System.Drawing.Point(136, 407) + Me.ucrInputPalette.Name = "ucrInputPalette" + Me.ucrInputPalette.Size = New System.Drawing.Size(63, 21) + Me.ucrInputPalette.TabIndex = 122 + ' + 'ucrPnlColour + ' + Me.ucrPnlColour.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlColour.Location = New System.Drawing.Point(11, 379) + Me.ucrPnlColour.Name = "ucrPnlColour" + Me.ucrPnlColour.Size = New System.Drawing.Size(92, 77) + Me.ucrPnlColour.TabIndex = 120 + ' + 'ucrInputColourPalette + ' + Me.ucrInputColourPalette.AddQuotesIfUnrecognised = True + Me.ucrInputColourPalette.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrInputColourPalette.GetSetSelectedIndex = -1 + Me.ucrInputColourPalette.IsReadOnly = False + Me.ucrInputColourPalette.Location = New System.Drawing.Point(136, 380) + Me.ucrInputColourPalette.Name = "ucrInputColourPalette" + Me.ucrInputColourPalette.Size = New System.Drawing.Size(63, 21) + Me.ucrInputColourPalette.TabIndex = 119 + ' + 'ucrChkColour + ' + Me.ucrChkColour.AutoSize = True + Me.ucrChkColour.Checked = False + Me.ucrChkColour.Location = New System.Drawing.Point(14, 358) + Me.ucrChkColour.Name = "ucrChkColour" + Me.ucrChkColour.Size = New System.Drawing.Size(198, 24) + Me.ucrChkColour.TabIndex = 107 + ' + 'ucrChkTile + ' + Me.ucrChkTile.AutoSize = True + Me.ucrChkTile.Checked = False + Me.ucrChkTile.Location = New System.Drawing.Point(14, 297) + Me.ucrChkTile.Name = "ucrChkTile" + Me.ucrChkTile.Size = New System.Drawing.Size(147, 24) + Me.ucrChkTile.TabIndex = 105 + ' + 'ucrChkText + ' + Me.ucrChkText.AutoSize = True + Me.ucrChkText.Checked = False + Me.ucrChkText.Location = New System.Drawing.Point(14, 327) + Me.ucrChkText.Name = "ucrChkText" + Me.ucrChkText.Size = New System.Drawing.Size(98, 24) + Me.ucrChkText.TabIndex = 104 + ' + 'ucrChkRibbon + ' + Me.ucrChkRibbon.AutoSize = True + Me.ucrChkRibbon.Checked = False + Me.ucrChkRibbon.Location = New System.Drawing.Point(14, 269) + Me.ucrChkRibbon.Name = "ucrChkRibbon" + Me.ucrChkRibbon.Size = New System.Drawing.Size(147, 24) + Me.ucrChkRibbon.TabIndex = 103 + ' + 'ucrInputLegendPosition + ' + Me.ucrInputLegendPosition.AddQuotesIfUnrecognised = True + Me.ucrInputLegendPosition.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrInputLegendPosition.GetSetSelectedIndex = -1 + Me.ucrInputLegendPosition.IsReadOnly = False + Me.ucrInputLegendPosition.Location = New System.Drawing.Point(115, 461) + Me.ucrInputLegendPosition.Name = "ucrInputLegendPosition" + Me.ucrInputLegendPosition.Size = New System.Drawing.Size(112, 21) + Me.ucrInputLegendPosition.TabIndex = 97 + ' + 'ucrChkLegend + ' + Me.ucrChkLegend.AutoSize = True + Me.ucrChkLegend.Checked = False + Me.ucrChkLegend.Location = New System.Drawing.Point(14, 462) + Me.ucrChkLegend.Name = "ucrChkLegend" + Me.ucrChkLegend.Size = New System.Drawing.Size(98, 24) + Me.ucrChkLegend.TabIndex = 96 + ' + 'ucrInputFacet + ' + Me.ucrInputFacet.AddQuotesIfUnrecognised = True + Me.ucrInputFacet.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrInputFacet.GetSetSelectedIndex = -1 + Me.ucrInputFacet.IsReadOnly = False + Me.ucrInputFacet.Location = New System.Drawing.Point(379, 68) + Me.ucrInputFacet.Name = "ucrInputFacet" + Me.ucrInputFacet.Size = New System.Drawing.Size(86, 21) + Me.ucrInputFacet.TabIndex = 86 + ' + 'ucrReceiverFacet + ' + Me.ucrReceiverFacet.AutoSize = True + Me.ucrReceiverFacet.frmParent = Me + Me.ucrReceiverFacet.Location = New System.Drawing.Point(267, 68) + Me.ucrReceiverFacet.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverFacet.Name = "ucrReceiverFacet" + Me.ucrReceiverFacet.Selector = Nothing + Me.ucrReceiverFacet.Size = New System.Drawing.Size(109, 26) + Me.ucrReceiverFacet.strNcFilePath = "" + Me.ucrReceiverFacet.TabIndex = 85 + Me.ucrReceiverFacet.ucrSelector = Nothing + ' + 'ucrReceiverRainC + ' + Me.ucrReceiverRainC.AutoSize = True + Me.ucrReceiverRainC.frmParent = Me + Me.ucrReceiverRainC.Location = New System.Drawing.Point(267, 150) + Me.ucrReceiverRainC.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverRainC.Name = "ucrReceiverRainC" + Me.ucrReceiverRainC.Selector = Nothing + Me.ucrReceiverRainC.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverRainC.strNcFilePath = "" + Me.ucrReceiverRainC.TabIndex = 90 + Me.ucrReceiverRainC.ucrSelector = Nothing + ' + 'ucrReceiverElement1 + ' + Me.ucrReceiverElement1.AutoSize = True + Me.ucrReceiverElement1.frmParent = Me + Me.ucrReceiverElement1.Location = New System.Drawing.Point(267, 193) + Me.ucrReceiverElement1.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverElement1.Name = "ucrReceiverElement1" + Me.ucrReceiverElement1.Selector = Nothing + Me.ucrReceiverElement1.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverElement1.strNcFilePath = "" + Me.ucrReceiverElement1.TabIndex = 92 + Me.ucrReceiverElement1.ucrSelector = Nothing + ' + 'ucrReceiverElement2 + ' + Me.ucrReceiverElement2.AutoSize = True + Me.ucrReceiverElement2.frmParent = Me + Me.ucrReceiverElement2.Location = New System.Drawing.Point(267, 234) + Me.ucrReceiverElement2.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverElement2.Name = "ucrReceiverElement2" + Me.ucrReceiverElement2.Selector = Nothing + Me.ucrReceiverElement2.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverElement2.strNcFilePath = "" + Me.ucrReceiverElement2.TabIndex = 94 + Me.ucrReceiverElement2.ucrSelector = Nothing + ' + 'ucrReceiverMonthC + ' + Me.ucrReceiverMonthC.AutoSize = True + Me.ucrReceiverMonthC.frmParent = Me + Me.ucrReceiverMonthC.Location = New System.Drawing.Point(267, 109) + Me.ucrReceiverMonthC.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverMonthC.Name = "ucrReceiverMonthC" + Me.ucrReceiverMonthC.Selector = Nothing + Me.ucrReceiverMonthC.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverMonthC.strNcFilePath = "" + Me.ucrReceiverMonthC.TabIndex = 88 + Me.ucrReceiverMonthC.ucrSelector = Nothing + ' + 'ucrReceiverAbsolute + ' + Me.ucrReceiverAbsolute.AutoSize = True + Me.ucrReceiverAbsolute.frmParent = Me + Me.ucrReceiverAbsolute.Location = New System.Drawing.Point(267, 280) + Me.ucrReceiverAbsolute.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverAbsolute.Name = "ucrReceiverAbsolute" + Me.ucrReceiverAbsolute.Selector = Nothing + Me.ucrReceiverAbsolute.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverAbsolute.strNcFilePath = "" + Me.ucrReceiverAbsolute.TabIndex = 77 + Me.ucrReceiverAbsolute.ucrSelector = Nothing + ' + 'ucrInputStation + ' + Me.ucrInputStation.AddQuotesIfUnrecognised = True + Me.ucrInputStation.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrInputStation.GetSetSelectedIndex = -1 + Me.ucrInputStation.IsReadOnly = False + Me.ucrInputStation.Location = New System.Drawing.Point(379, 68) + Me.ucrInputStation.Name = "ucrInputStation" + Me.ucrInputStation.Size = New System.Drawing.Size(86, 21) + Me.ucrInputStation.TabIndex = 65 + ' + 'ucr1stFactorReceiver + ' + Me.ucr1stFactorReceiver.AutoSize = True + Me.ucr1stFactorReceiver.frmParent = Me + Me.ucr1stFactorReceiver.Location = New System.Drawing.Point(267, 68) + Me.ucr1stFactorReceiver.Margin = New System.Windows.Forms.Padding(0) + Me.ucr1stFactorReceiver.Name = "ucr1stFactorReceiver" + Me.ucr1stFactorReceiver.Selector = Nothing + Me.ucr1stFactorReceiver.Size = New System.Drawing.Size(109, 26) + Me.ucr1stFactorReceiver.strNcFilePath = "" + Me.ucr1stFactorReceiver.TabIndex = 64 + Me.ucr1stFactorReceiver.ucrSelector = Nothing + ' + 'ucrReceiverRain + ' + Me.ucrReceiverRain.AutoSize = True + Me.ucrReceiverRain.frmParent = Me + Me.ucrReceiverRain.Location = New System.Drawing.Point(267, 150) + Me.ucrReceiverRain.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverRain.Name = "ucrReceiverRain" + Me.ucrReceiverRain.Selector = Nothing + Me.ucrReceiverRain.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverRain.strNcFilePath = "" + Me.ucrReceiverRain.TabIndex = 69 + Me.ucrReceiverRain.ucrSelector = Nothing + ' + 'ucrReceiverMaxtem + ' + Me.ucrReceiverMaxtem.AutoSize = True + Me.ucrReceiverMaxtem.frmParent = Me + Me.ucrReceiverMaxtem.Location = New System.Drawing.Point(267, 193) + Me.ucrReceiverMaxtem.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverMaxtem.Name = "ucrReceiverMaxtem" + Me.ucrReceiverMaxtem.Selector = Nothing + Me.ucrReceiverMaxtem.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverMaxtem.strNcFilePath = "" + Me.ucrReceiverMaxtem.TabIndex = 71 + Me.ucrReceiverMaxtem.ucrSelector = Nothing + ' + 'ucrReceiverMintemp + ' + Me.ucrReceiverMintemp.AutoSize = True + Me.ucrReceiverMintemp.frmParent = Me + Me.ucrReceiverMintemp.Location = New System.Drawing.Point(267, 234) + Me.ucrReceiverMintemp.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverMintemp.Name = "ucrReceiverMintemp" + Me.ucrReceiverMintemp.Selector = Nothing + Me.ucrReceiverMintemp.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverMintemp.strNcFilePath = "" + Me.ucrReceiverMintemp.TabIndex = 73 + Me.ucrReceiverMintemp.ucrSelector = Nothing + ' 'ucrPnlClimograph ' Me.ucrPnlClimograph.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlClimograph.Location = New System.Drawing.Point(107, 5) + Me.ucrPnlClimograph.Location = New System.Drawing.Point(92, 5) Me.ucrPnlClimograph.Name = "ucrPnlClimograph" - Me.ucrPnlClimograph.Size = New System.Drawing.Size(236, 41) + Me.ucrPnlClimograph.Size = New System.Drawing.Size(295, 41) Me.ucrPnlClimograph.TabIndex = 60 ' 'ucrBase ' Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(12, 332) + Me.ucrBase.Location = New System.Drawing.Point(12, 520) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(408, 52) Me.ucrBase.TabIndex = 75 @@ -225,7 +668,7 @@ Partial Class dlgClimograph 'ucrSave ' Me.ucrSave.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrSave.Location = New System.Drawing.Point(12, 305) + Me.ucrSave.Location = New System.Drawing.Point(14, 493) Me.ucrSave.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.ucrSave.Name = "ucrSave" Me.ucrSave.Size = New System.Drawing.Size(282, 24) @@ -244,15 +687,6 @@ Partial Class dlgClimograph Me.ucrReceiverMonth.TabIndex = 67 Me.ucrReceiverMonth.ucrSelector = Nothing ' - 'lblMonth - ' - Me.lblMonth.AutoSize = True - Me.lblMonth.Location = New System.Drawing.Point(267, 93) - Me.lblMonth.Name = "lblMonth" - Me.lblMonth.Size = New System.Drawing.Size(40, 13) - Me.lblMonth.TabIndex = 66 - Me.lblMonth.Text = "Month:" - ' 'ucrSelectorClimograph ' Me.ucrSelectorClimograph.AutoSize = True @@ -269,7 +703,40 @@ Partial Class dlgClimograph ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(477, 388) + Me.ClientSize = New System.Drawing.Size(472, 578) + Me.Controls.Add(Me.ucrReceiverRainBar) + Me.Controls.Add(Me.lblRainBar) + Me.Controls.Add(Me.ucrReceiverElement1Bar) + Me.Controls.Add(Me.lblElement1Bar) + Me.Controls.Add(Me.ucrReceiverElement2Bar) + Me.Controls.Add(Me.lblElement2Bar) + Me.Controls.Add(Me.ucrReceiverMonthBar) + Me.Controls.Add(Me.lblMonthBar) + Me.Controls.Add(Me.rdoClimateBars) + Me.Controls.Add(Me.cmdOptions) + Me.Controls.Add(Me.rdoSinglecolour) + Me.Controls.Add(Me.rdoViridis) + Me.Controls.Add(Me.ucrInputPalette) + Me.Controls.Add(Me.rdoPalette) + Me.Controls.Add(Me.ucrPnlColour) + Me.Controls.Add(Me.ucrInputColourPalette) + Me.Controls.Add(Me.ucrChkColour) + Me.Controls.Add(Me.ucrChkTile) + Me.Controls.Add(Me.ucrChkText) + Me.Controls.Add(Me.ucrChkRibbon) + Me.Controls.Add(Me.ucrInputLegendPosition) + Me.Controls.Add(Me.ucrChkLegend) + Me.Controls.Add(Me.ucrInputFacet) + Me.Controls.Add(Me.ucrReceiverFacet) + Me.Controls.Add(Me.lblFacet) + Me.Controls.Add(Me.ucrReceiverRainC) + Me.Controls.Add(Me.lblRainC) + Me.Controls.Add(Me.ucrReceiverElement1) + Me.Controls.Add(Me.lblElement1) + Me.Controls.Add(Me.ucrReceiverElement2) + Me.Controls.Add(Me.lblElement2) + Me.Controls.Add(Me.ucrReceiverMonthC) + Me.Controls.Add(Me.lblMonthC) Me.Controls.Add(Me.ucrReceiverAbsolute) Me.Controls.Add(Me.lblAbsolute) Me.Controls.Add(Me.ucrInputStation) @@ -295,6 +762,7 @@ Partial Class dlgClimograph Me.Name = "dlgClimograph" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Climograph" + Me.contextMenuStripOptions.ResumeLayout(False) Me.ResumeLayout(False) Me.PerformLayout() @@ -319,4 +787,42 @@ Partial Class dlgClimograph Friend WithEvents ucrReceiverMonth As ucrReceiverSingle Friend WithEvents lblMonth As Label Friend WithEvents ucrSelectorClimograph As ucrSelectorByDataFrameAddRemove + Friend WithEvents ucrInputFacet As ucrInputComboBox + Friend WithEvents ucrReceiverFacet As ucrReceiverSingle + Friend WithEvents lblFacet As Label + Friend WithEvents ucrReceiverRainC As ucrReceiverSingle + Friend WithEvents lblRainC As Label + Friend WithEvents ucrReceiverElement1 As ucrReceiverSingle + Friend WithEvents lblElement1 As Label + Friend WithEvents ucrReceiverElement2 As ucrReceiverSingle + Friend WithEvents lblElement2 As Label + Friend WithEvents ucrReceiverMonthC As ucrReceiverSingle + Friend WithEvents lblMonthC As Label + Friend WithEvents ucrInputLegendPosition As ucrInputComboBox + Friend WithEvents ucrChkRibbon As ucrCheck + Friend WithEvents ucrChkText As ucrCheck + Friend WithEvents ucrChkTile As ucrCheck + Friend WithEvents ucrChkLegend As ucrCheck + Friend WithEvents rdoViridis As RadioButton + Friend WithEvents ucrInputPalette As ucrInputComboBox + Friend WithEvents rdoPalette As RadioButton + Friend WithEvents ucrPnlColour As UcrPanel + Friend WithEvents ucrInputColourPalette As ucrInputComboBox + Friend WithEvents ucrChkColour As ucrCheck + Friend WithEvents rdoSinglecolour As RadioButton + Friend WithEvents contextMenuStripOptions As ContextMenuStrip + Friend WithEvents toolStripMenuItemPlotOptions As ToolStripMenuItem + Friend WithEvents toolStripMenuItemBarchartOptions As ToolStripMenuItem + Friend WithEvents toolStripMenuItemTmaxLineOptions As ToolStripMenuItem + Friend WithEvents toolStripMenuItemTminLineOptions As ToolStripMenuItem + Friend WithEvents cmdOptions As ucrSplitButton + Friend WithEvents rdoClimateBars As RadioButton + Friend WithEvents ucrReceiverRainBar As ucrReceiverSingle + Friend WithEvents lblRainBar As Label + Friend WithEvents ucrReceiverElement1Bar As ucrReceiverSingle + Friend WithEvents lblElement1Bar As Label + Friend WithEvents ucrReceiverElement2Bar As ucrReceiverSingle + Friend WithEvents lblElement2Bar As Label + Friend WithEvents ucrReceiverMonthBar As ucrReceiverSingle + Friend WithEvents lblMonthBar As Label End Class diff --git a/instat/dlgClimograph.resx b/instat/dlgClimograph.resx index 1af7de150c9..aae6333c398 100644 --- a/instat/dlgClimograph.resx +++ b/instat/dlgClimograph.resx @@ -117,4 +117,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + \ No newline at end of file diff --git a/instat/dlgClimograph.vb b/instat/dlgClimograph.vb index 5852c08272f..6939f27a817 100644 --- a/instat/dlgClimograph.vb +++ b/instat/dlgClimograph.vb @@ -25,14 +25,95 @@ Public Class dlgClimograph Private ReadOnly strFacetRow As String = "Facet Row" Private ReadOnly strFacetCol As String = "Facet Column" Private ReadOnly strNone As String = "None" + Private ReadOnly strFacetWrap1 As String = "Facet Wrap" + Private ReadOnly strFacetRow1 As String = "Facet Row" + Private ReadOnly strFacetCol1 As String = "Facet Column" + Private ReadOnly strNone1 As String = "None" Private clsFacetFunction As New RFunction Private clsGroupByFunction As New RFunction + Private clsGeomBarFunction As New RFunction + Private clsGeomLineStarFunction As New RFunction + Private clsGeomLineStar1Function As New RFunction + Private clsRggplotFunction As New RFunction + Private clsBarAesFunction As New RFunction + Private clsAesLineStarFunction As New RFunction + Private clsAesLineStar1Function As New RFunction + Private clsFacetFunction1 As New RFunction + Private clsGroupByFunction1 As New RFunction + Private bResetSubdialog As Boolean = True + Private bResetLineLayerSubdialog As Boolean = True + Private clsCoordPolarFunction As New RFunction + Private clsRFacetFunction As New RFunction + Private clsAnnotateFunction As New RFunction + Private clsCoordPolarStartOperator As New ROperator + Private clsXScaleDateFunction As New RFunction + Private clsYScaleDateFunction As New RFunction + Private clsScaleFillViridisFunction As New RFunction + Private clsScaleColourViridisFunction As New RFunction + Private clsLabsFunction As New RFunction + Private clsLabFunction As New RFunction + Private clsXlabFunction As New RFunction + Private clsYlabFunction As New RFunction + Private clsSecondaryAxisFunction As New RFunction + Private clsSecondaryAxis1Function As New RFunction + Private clsSecondaryAxis2Function As New RFunction + Private dctThemeFunctions As New Dictionary(Of String, RFunction) + Private clsXScalecontinuousFunction As New RFunction + Private clsXScalediscreteFunction As New RFunction + Private clsScaleycontinuousFunction As New RFunction + Private clsYScalecontinuousFunction As New RFunction + Private clsGeomRibbonFunction As New RFunction + Private clsGeomRibbon1Function As New RFunction + Private clsGeomTileFunction As New RFunction + Private clsAesGeomRibbonFunction As New RFunction + Private clsAesGeomRibbon1Function As New RFunction + Private clsGeomTextBarFunction As New RFunction + Private clsGeomTextTmaxFunction As New RFunction + Private clsGeomTextTminFunction As New RFunction + Private clsGeomTextTmaxStarFunction As New RFunction + Private clsGeomTextTminStarFunction As New RFunction + Private clsRoundBarFunction As New RFunction + Private clsGeomBarTmaxFunction As New RFunction + Private clsAesTmaxBarFunction As New RFunction + Private clsAesTminBarFunction As New RFunction + Private clsGeomBarTminFunction As New RFunction + Private clsRoundTmaxFunction As New RFunction + Private clsRoundTminFunction As New RFunction + Private clsAesGeomTextBarFunction As New RFunction + Private clsAesGeomTextTmaxFunction As New RFunction + Private clsAesGeomTextStarTmaxFunction As New RFunction + Private clsAesGeomTextTminFunction As New RFunction + Private clsAesGeomTextStarTminFunction As New RFunction + Private clsThemeFunction As New RFunction + Private clsMaxFunction As New RFunction + Private clsMax1Function As New RFunction + Private clsVectorFunction As New RFunction + Private clsGetObjectDataFunction, clsGetDataFrameFunction, clsColourPaletteFunction, clsLocalRaesFunction, clsFillBrewerFunction, clsScalefillDistillerFunction As New RFunction + Private clsStarOperator As New ROperator + Private clsStar1Operator As New ROperator + Private clsDivideOperator As New ROperator + Private clsDivide1Operator As ROperator + Private clsFacetVariablesOperator As New ROperator + Private clsFacetRowOp1 As New ROperator + Private clsFacetColOp1 As New ROperator + Private clsPipeOperator1 As New ROperator Private clsFacetOperator As New ROperator Private clsFacetRowOp As New ROperator Private clsFacetColOp As New ROperator Private clsPipeOperator As New ROperator Private bUpdateComboOptions As Boolean = True Private bUpdatingParameters As Boolean = False + Private bUpdateComboOptions1 As Boolean = True + Private bUpdatingParameters1 As Boolean = False + Private strTemBar As String = "Tem" + Private strRainBar As String = "Rain" + Private clsPlus1Operator, clsPlus2Operator, clsPlus3Operator, clsPlus5Operator As New ROperator + Private clsPlus6Operator, clsPlus7Operator, clsPlus8Operator, clsPlus9Operator, clsPlus10Operator, clsPlus11Operator As New ROperator + Private clsRainBarFunction, clsTmaxBarFunction, clsTminBarFunction, clsLabsRainFunction, clsLabsTempFunction As New RFunction + Private clsRainBarTextFunction, clsTmaxBarTextFunction, clsTminBarTextFunction, clsRainGgplotFunction, clsTemGgplotFunction As New RFunction + Private clsAesTmaxBarFunction1, clsAesTminBarFunction1, clsAesTemGgplotFunction, clsAesRainGgplotFunction, clsSecAxisRainFunction, clsSecAxisTemFunction As New RFunction + Private clsAesRainBarTextFunction, clsPlotGridFunction, clsAesTmaxBarTextFunction, clsAesTminBarTextFunction, clsRainRoundFunction, clsTmaxRoundFunction, clsTminRoundFunction As New RFunction + Private strScale As String = "scale_Factor" Private Sub dlgClimograph_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstload Then @@ -46,18 +127,25 @@ Public Class dlgClimograph bReset = False TestOKEnabled() autoTranslate(Me) + ResizeDialogue() End Sub Private Sub InitialiseDialog() + Dim dctLegendPosition As New Dictionary(Of String, String) + Dim dctColourPallette As New Dictionary(Of String, String) + Dim dctPalette As New Dictionary(Of String, String) + ucrBase.iHelpTopicID = 432 - ucrSelectorClimograph.SetParameter(New RParameter("data", 0)) + ucrSelectorClimograph.SetParameter(New RParameter("data", 0, bNewIncludeArgumentName:=False)) ucrSelectorClimograph.SetParameterIsrfunction() ucrPnlClimograph.AddRadioButton(rdoClimograph) ucrPnlClimograph.AddRadioButton(rdoWalterLieth) + ucrPnlClimograph.AddRadioButton(rdoClimateBars) ucrPnlClimograph.AddParameterValuesCondition(rdoWalterLieth, "checked", "WalterLieth") ucrPnlClimograph.AddParameterValuesCondition(rdoClimograph, "checked", "Climograph") + ucrPnlClimograph.AddParameterValuesCondition(rdoClimateBars, "checked", "climate Charts") ucrReceiverMonth.SetParameter(New RParameter("month", 1)) ucrReceiverMonth.SetParameterIsString() @@ -67,6 +155,24 @@ Public Class dlgClimograph ucrReceiverMonth.strSelectorHeading = "Month Variables" ucrReceiverMonth.SetLinkedDisplayControl(lblMonth) + ucrReceiverMonthC.SetParameter(New RParameter("x", 2)) + ucrReceiverMonthC.SetParameterIsRFunction() + ucrReceiverMonthC.Selector = ucrSelectorClimograph + ucrReceiverMonthC.bWithQuotes = False + ucrReceiverMonthC.SetClimaticType("month") + ucrReceiverMonthC.bAutoFill = True + ucrReceiverMonthC.strSelectorHeading = "Month Variables" + ucrReceiverMonthC.SetLinkedDisplayControl(lblMonthC) + + ucrReceiverMonthBar.SetParameter(New RParameter("x", 2)) + ucrReceiverMonthBar.SetParameterIsRFunction() + ucrReceiverMonthBar.Selector = ucrSelectorClimograph + ucrReceiverMonthBar.bWithQuotes = False + ucrReceiverMonthBar.SetClimaticType("month") + ucrReceiverMonthBar.bAutoFill = True + ucrReceiverMonthBar.strSelectorHeading = "Month Variables" + ucrReceiverMonthBar.SetLinkedDisplayControl(lblMonthBar) + ucrReceiverRain.SetParameter(New RParameter("p_mes", 3)) ucrReceiverRain.SetParameterIsString() ucrReceiverRain.Selector = ucrSelectorClimograph @@ -75,6 +181,24 @@ Public Class dlgClimograph ucrReceiverRain.strSelectorHeading = "Rain Variables" ucrReceiverRain.SetLinkedDisplayControl(lblRain) + ucrReceiverRainC.SetParameter(New RParameter("y", 1)) + ucrReceiverRainC.SetParameterIsRFunction() + ucrReceiverRainC.Selector = ucrSelectorClimograph + ucrReceiverRainC.bWithQuotes = False + ucrReceiverRainC.SetClimaticType("rain") + ucrReceiverRainC.bAutoFill = True + ucrReceiverRainC.strSelectorHeading = "Rain Variables" + ucrReceiverRainC.SetLinkedDisplayControl(lblRainC) + + ucrReceiverRainBar.SetParameter(New RParameter("y", 1)) + ucrReceiverRainBar.SetParameterIsRFunction() + ucrReceiverRainBar.Selector = ucrSelectorClimograph + ucrReceiverRainBar.bWithQuotes = False + ucrReceiverRainBar.SetClimaticType("rain") + ucrReceiverRainBar.bAutoFill = True + ucrReceiverRainBar.strSelectorHeading = "Rain Variables" + ucrReceiverRainBar.SetLinkedDisplayControl(lblRainBar) + ucrReceiverMaxtem.SetParameter(New RParameter("tm_max", 4)) ucrReceiverMaxtem.SetParameterIsString() ucrReceiverMaxtem.Selector = ucrSelectorClimograph @@ -91,7 +215,43 @@ Public Class dlgClimograph ucrReceiverMintemp.strSelectorHeading = "Variables" ucrReceiverMintemp.SetLinkedDisplayControl(lblMintem) - ucr1stFactorReceiver.SetParameter(New RParameter("station")) + ucrReceiverElement1.SetParameter(New RParameter("y", 4, False)) + ucrReceiverElement1.SetParameterIsRFunction() + ucrReceiverElement1.Selector = ucrSelectorClimograph + ucrReceiverElement1.bWithQuotes = False + ucrReceiverElement1.SetClimaticType("temp_max") + ucrReceiverElement1.bAutoFill = True + ucrReceiverElement1.strSelectorHeading = "Variables" + ucrReceiverElement1.SetLinkedDisplayControl(lblElement1) + + ucrReceiverElement1Bar.SetParameter(New RParameter("y", 4, False)) + ucrReceiverElement1Bar.SetParameterIsRFunction() + ucrReceiverElement1Bar.Selector = ucrSelectorClimograph + ucrReceiverElement1Bar.bWithQuotes = False + ucrReceiverElement1Bar.SetClimaticType("temp_max") + ucrReceiverElement1Bar.bAutoFill = True + ucrReceiverElement1Bar.strSelectorHeading = "Variables" + ucrReceiverElement1Bar.SetLinkedDisplayControl(lblElement1Bar) + + ucrReceiverElement2.SetParameter(New RParameter("tmin", 5, False)) + ucrReceiverElement2.SetParameterIsRFunction() + ucrReceiverElement2.Selector = ucrSelectorClimograph + ucrReceiverElement2.bWithQuotes = False + ucrReceiverElement2.SetClimaticType("temp_min") + ucrReceiverElement2.bAutoFill = True + ucrReceiverElement2.strSelectorHeading = "Variables" + ucrReceiverElement2.SetLinkedDisplayControl(lblElement2) + + ucrReceiverElement2Bar.SetParameter(New RParameter("tmin", 5, False)) + ucrReceiverElement2Bar.SetParameterIsRFunction() + ucrReceiverElement2Bar.Selector = ucrSelectorClimograph + ucrReceiverElement2Bar.bWithQuotes = False + ucrReceiverElement2Bar.SetClimaticType("temp_min") + ucrReceiverElement2Bar.bAutoFill = True + ucrReceiverElement2Bar.strSelectorHeading = "Variables" + ucrReceiverElement2Bar.SetLinkedDisplayControl(lblElement2Bar) + + ucr1stFactorReceiver.SetParameter(New RParameter("var1")) ucr1stFactorReceiver.Selector = ucrSelectorClimograph ucr1stFactorReceiver.SetIncludedDataTypes({"factor"}) ucr1stFactorReceiver.strSelectorHeading = "Factors" @@ -102,18 +262,124 @@ Public Class dlgClimograph ucrInputStation.SetItems({strFacetWrap, strFacetRow, strFacetCol, strNone}) ucrInputStation.SetDropDownStyleAsNonEditable() + ucrReceiverFacet.SetParameter(New RParameter("var1")) + ucrReceiverFacet.Selector = ucrSelectorClimograph + ucrReceiverFacet.SetClimaticType("year") + ucrReceiverFacet.bAutoFill = True + ucrReceiverFacet.bWithQuotes = False + ucrReceiverFacet.SetParameterIsString() + ucrReceiverFacet.SetValuesToIgnore({"."}) + + ucrInputFacet.SetItems({strFacetWrap, strFacetRow, strFacetCol, strNone}) + ucrInputFacet.SetDropDownStyleAsNonEditable() + ucrReceiverAbsolute.SetParameter(New RParameter("ta_min", 6)) ucrReceiverAbsolute.SetParameterIsString() ucrReceiverAbsolute.Selector = ucrSelectorClimograph ucrReceiverAbsolute.strSelectorHeading = "Variables" ucrReceiverAbsolute.SetLinkedDisplayControl(lblAbsolute) + ucrPnlClimograph.AddToLinkedControls({ucr1stFactorReceiver, ucrReceiverAbsolute, ucrReceiverMintemp, ucrReceiverMonth, ucrReceiverMaxtem, ucrReceiverRain, ucrInputStation}, {rdoWalterLieth}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlClimograph.AddToLinkedControls({ucrChkColour, ucrChkTile, ucrChkLegend, ucrReceiverElement2, ucrReceiverElement1, ucrReceiverMonthC, ucrReceiverRainC, ucrChkRibbon, ucrChkText}, {rdoClimograph}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlClimograph.AddToLinkedControls({ucrReceiverElement2Bar, ucrReceiverElement1Bar, ucrReceiverMonthBar, ucrReceiverRainBar}, {rdoClimateBars}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlClimograph.AddToLinkedControls({ucrReceiverFacet, ucrInputFacet}, {rdoClimograph, rdoClimateBars}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + + ucrPnlColour.AddRadioButton(rdoViridis) + ucrPnlColour.AddRadioButton(rdoPalette) + ucrPnlColour.AddRadioButton(rdoSinglecolour) + ucrPnlColour.AddParameterValuesCondition(rdoPalette, "Check", "palette") + ucrPnlColour.AddParameterValuesCondition(rdoViridis, "Check", "viridis") + ucrPnlColour.AddParameterValuesCondition(rdoSinglecolour, "Check", "single") + ucrPnlColour.AddToLinkedControls(ucrInputPalette, {rdoPalette}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="Blues") + ucrPnlColour.AddToLinkedControls(ucrInputColourPalette, {rdoViridis}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="Viridis") + + ucrChkLegend.SetText("Legend:") + ucrChkLegend.AddToLinkedControls({ucrInputLegendPosition}, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="None") + ucrInputLegendPosition.SetDropDownStyleAsNonEditable() + ucrInputLegendPosition.SetParameter(New RParameter("legend.position")) + dctLegendPosition.Add("None", Chr(34) & "none" & Chr(34)) + dctLegendPosition.Add("Left", Chr(34) & "left" & Chr(34)) + dctLegendPosition.Add("Right", Chr(34) & "right" & Chr(34)) + dctLegendPosition.Add("Top", Chr(34) & "top" & Chr(34)) + dctLegendPosition.Add("Bottom", Chr(34) & "bottom" & Chr(34)) + ucrInputLegendPosition.SetItems(dctLegendPosition) + ucrChkLegend.AddParameterPresentCondition(True, "legend.position") + ucrChkLegend.AddParameterPresentCondition(False, "legend.position", False) + + ucrChkRibbon.SetText("Add Ribbon") + ucrChkRibbon.AddParameterValuesCondition(True, "checked", "True") + ucrChkRibbon.AddParameterValuesCondition(False, "checked", "False") + + ucrChkTile.SetText("Add Tile") + ucrChkTile.AddParameterValuesCondition(True, "checked", "True") + ucrChkTile.AddParameterValuesCondition(False, "checked", "False") + + ucrChkText.SetText("Add Label") + ucrChkText.AddParameterValuesCondition(True, "checked", "True") + ucrChkText.AddParameterValuesCondition(False, "checked", "False") + + ucrInputPalette.SetParameter(New RParameter("palette", 10)) + ucrInputPalette.SetDropDownStyleAsNonEditable() + dctPalette.Add("Blues", Chr(34) & "Blues" & Chr(34)) + dctPalette.Add("Greens", Chr(34) & "Greens" & Chr(34)) + dctPalette.Add("Greys", Chr(34) & "Greys" & Chr(34)) + dctPalette.Add("Oranges", Chr(34) & "Oranges" & Chr(34)) + dctPalette.Add("Purples", Chr(34) & "Purples" & Chr(34)) + dctPalette.Add("Reds", Chr(34) & "Reds" & Chr(34)) + dctPalette.Add("BuGn", Chr(34) & "BuGn" & Chr(34)) + dctPalette.Add("BuPu", Chr(34) & "BuPu" & Chr(34)) + dctPalette.Add("GnBu", Chr(34) & "GnBu" & Chr(34)) + dctPalette.Add("OrRd", Chr(34) & "OrRd" & Chr(34)) + dctPalette.Add("PuBu", Chr(34) & "PuBu" & Chr(34)) + dctPalette.Add("PuBuGn", Chr(34) & "PuBuGn" & Chr(34)) + dctPalette.Add("PuRd", Chr(34) & "PuRd" & Chr(34)) + dctPalette.Add("RdPu", Chr(34) & "RdPu" & Chr(34)) + dctPalette.Add("YlGn", Chr(34) & "YlGn" & Chr(34)) + dctPalette.Add("YlGnBu", Chr(34) & "YlGnBu" & Chr(34)) + dctPalette.Add("YlOrBr", Chr(34) & "YlOrBr" & Chr(34)) + dctPalette.Add("YlOrRd", Chr(34) & "YlOrRd" & Chr(34)) + dctPalette.Add("Spectral", Chr(34) & "Spectral" & Chr(34)) + dctPalette.Add("BrBG", Chr(34) & "BrBG" & Chr(34)) + dctPalette.Add("PiYG", Chr(34) & "PiYG" & Chr(34)) + dctPalette.Add("PRGn", Chr(34) & "PRGn" & Chr(34)) + dctPalette.Add("PuOr", Chr(34) & "PuOr" & Chr(34)) + dctPalette.Add("RdBu", Chr(34) & "RdBu" & Chr(34)) + dctPalette.Add("RdGy", Chr(34) & "RdGy" & Chr(34)) + dctPalette.Add("RdYlBu", Chr(34) & "RdYlBu" & Chr(34)) + dctPalette.Add("RdYlGn", Chr(34) & "RdYlGn" & Chr(34)) + dctPalette.Add("Accent", Chr(34) & "Accent" & Chr(34)) + dctPalette.Add("Dark2", Chr(34) & "Dark2" & Chr(34)) + dctPalette.Add("Pastel1", Chr(34) & "Pastel1" & Chr(34)) + dctPalette.Add("Pastel2", Chr(34) & "Pastel2" & Chr(34)) + dctPalette.Add("Set1", Chr(34) & "Set1" & Chr(34)) + dctPalette.Add("Set2", Chr(34) & "Set2" & Chr(34)) + dctPalette.Add("Set3", Chr(34) & "Set3" & Chr(34)) + ucrInputPalette.SetItems(dctPalette) + + ucrInputColourPalette.SetParameter(New RParameter("option", 0)) + dctColourPallette.Add("viridis", Chr(34) & "viridis" & Chr(34)) + dctColourPallette.Add("magma", Chr(34) & "magma" & Chr(34)) + dctColourPallette.Add("inferno", Chr(34) & "inferno" & Chr(34)) + dctColourPallette.Add("plasma", Chr(34) & "plasma" & Chr(34)) + dctColourPallette.Add("cividis", Chr(34) & "cividis" & Chr(34)) + dctColourPallette.Add("mako", Chr(34) & "mako" & Chr(34)) + dctColourPallette.Add("rocket", Chr(34) & "rocket" & Chr(34)) + dctColourPallette.Add("turbo", Chr(34) & "turbo" & Chr(34)) + ucrInputColourPalette.SetItems(dctColourPallette) + ucrInputColourPalette.SetDropDownStyleAsNonEditable() + + ucrChkColour.SetText("Change Bars Colour") + ucrChkColour.AddParameterValuesCondition(True, "checked", "True") + ucrChkColour.AddParameterValuesCondition(False, "checked", "False") + ucrChkColour.AddToLinkedControls({ucrPnlColour}, {True}, bNewLinkedHideIfParameterMissing:=True) + ucrSave.SetPrefix("wl_graph") ucrSave.SetIsComboBox() ucrSave.SetSaveTypeAsGraph() - ucrSave.SetCheckBoxText("Save") + ucrSave.SetCheckBoxText("Store Graph") ucrSave.SetDataFrameSelector(ucrSelectorClimograph.ucrAvailableDataFrames) ucrSave.SetAssignToIfUncheckedValue("last_graph") + ResizeDialogue() End Sub Private Sub SetDefaults() @@ -122,21 +388,131 @@ Public Class dlgClimograph clsDummyFunction = New RFunction clsGroupByFunction = New RFunction clsPipeOperator = New ROperator - clsFacetFunction = New RFunction clsFacetOperator = New ROperator clsFacetRowOp = New ROperator clsFacetColOp = New ROperator + clsGeomRibbonFunction = New RFunction + clsGeomRibbon1Function = New RFunction + clsAesGeomRibbonFunction = New RFunction + clsAesGeomRibbon1Function = New RFunction + clsGeomBarFunction = New RFunction + clsGeomLineStarFunction = New RFunction + clsGeomLineStar1Function = New RFunction + clsAesLineStarFunction = New RFunction + clsAesLineStar1Function = New RFunction + clsRggplotFunction = New RFunction + clsBarAesFunction = New RFunction + clsFacetFunction1 = New RFunction + clsSecondaryAxisFunction = New RFunction + clsSecondaryAxis1Function = New RFunction + clsSecondaryAxis2Function = New RFunction + clsGeomTextBarFunction = New RFunction + clsGeomTextTmaxFunction = New RFunction + clsGeomTextTminFunction = New RFunction + clsAesGeomTextBarFunction = New RFunction + clsAesGeomTextTmaxFunction = New RFunction + clsAesGeomTextTminFunction = New RFunction + clsGeomTextTmaxStarFunction = New RFunction + clsGeomTextTminStarFunction = New RFunction + clsAesGeomTextStarTmaxFunction = New RFunction + clsAesGeomTextStarTminFunction = New RFunction + clsXScalediscreteFunction = New RFunction + clsRoundBarFunction = New RFunction + clsRoundTmaxFunction = New RFunction + clsRoundTminFunction = New RFunction + clsGeomTileFunction = New RFunction + clsStarOperator = New ROperator + clsStar1Operator = New ROperator + clsDivideOperator = New ROperator + clsDivide1Operator = New ROperator + clsFacetVariablesOperator = New ROperator + clsFacetRowOp1 = New ROperator + clsFacetColOp1 = New ROperator + clsPipeOperator1 = New ROperator + clsGroupByFunction1 = New RFunction + clsMaxFunction = New RFunction + clsMax1Function = New RFunction + clsVectorFunction = New RFunction + clsScaleycontinuousFunction = New RFunction + clsLabFunction = New RFunction + clsGetObjectDataFunction = New RFunction + clsColourPaletteFunction = New RFunction + clsScalefillDistillerFunction = New RFunction + clsFillBrewerFunction = New RFunction + clsGeomBarTminFunction = New RFunction + clsGeomBarTmaxFunction = New RFunction + clsAesTmaxBarFunction = New RFunction + clsAesTminBarFunction = New RFunction + clsPlus1Operator = New ROperator + clsPlus2Operator = New ROperator + clsPlus3Operator = New ROperator + clsPlus5Operator = New ROperator + clsPlus6Operator = New ROperator + clsPlus7Operator = New ROperator + clsPlus8Operator = New ROperator + clsPlus9Operator = New ROperator + clsRainBarFunction = New RFunction + clsTmaxBarFunction = New RFunction + clsTminBarFunction = New RFunction + clsLabsRainFunction = New RFunction + clsLabsTempFunction = New RFunction + clsRainBarTextFunction = New RFunction + clsTmaxBarTextFunction = New RFunction + clsTminBarTextFunction = New RFunction + clsRainGgplotFunction = New RFunction + clsTemGgplotFunction = New RFunction + clsAesTmaxBarFunction1 = New RFunction + clsAesTminBarFunction1 = New RFunction + clsAesTemGgplotFunction = New RFunction + clsAesRainGgplotFunction = New RFunction + clsSecAxisRainFunction = New RFunction + clsSecAxisTemFunction = New RFunction + clsAesRainBarTextFunction = New RFunction + clsAesTmaxBarTextFunction = New RFunction + clsAesTminBarTextFunction = New RFunction + clsRainRoundFunction = New RFunction + clsTmaxRoundFunction = New RFunction + clsTminRoundFunction = New RFunction + clsPlotGridFunction = New RFunction + clsGetDataFrameFunction = New RFunction + clsPlus10Operator = New ROperator + clsPlus11Operator = New ROperator ucrSelectorClimograph.Reset() + ucrSelectorClimograph.SetGgplotFunction(clsBaseOperator) ucrSave.Reset() + bResetSubdialog = True + bResetLineLayerSubdialog = True ucrInputStation.SetName(strFacetWrap) ucrInputStation.bUpdateRCodeFromControl = True - ucrReceiverMonth.SetMeAsReceiver() + ucrInputFacet.SetName(strFacetWrap) + ucrInputFacet.bUpdateRCodeFromControl = True - clsDummyFunction.AddParameter("checked", "WalterLieth", iPosition:=0) + clsDummyFunction.AddParameter("checked", "Climograph", iPosition:=0) + clsDummyFunction.AddParameter("Check", "viridis", iPosition:=1) + + clsBaseOperator.SetOperation("+") + clsBaseOperator.AddParameter("ggplot", clsRFunctionParameter:=clsRggplotFunction, iPosition:=0) + clsBaseOperator.AddParameter("geom_bar", clsRFunctionParameter:=clsGeomBarFunction, iPosition:=2) + + clsFacetFunction1.SetPackageName("ggplot2") + clsFacetRowOp1.SetOperation("+") + clsFacetRowOp1.bBrackets = False + clsFacetColOp1.SetOperation("+") + clsFacetColOp1.bBrackets = False + clsFacetVariablesOperator.SetOperation("~") + clsFacetVariablesOperator.bForceIncludeOperation = True + clsFacetVariablesOperator.bBrackets = False + clsFacetFunction1.AddParameter("facets", clsROperatorParameter:=clsFacetVariablesOperator, iPosition:=0) + + clsPipeOperator1.SetOperation("%>%") + SetPipeAssignTo1() + + clsGroupByFunction1.SetPackageName("dplyr") + clsGroupByFunction1.SetRCommand("group_by") clsPipeOperator.SetOperation("%>%") SetPipeAssignTo() @@ -156,34 +532,383 @@ Public Class dlgClimograph clsGroupByFunction.SetPackageName("dplyr") clsGroupByFunction.SetRCommand("group_by") - clsBaseOperator.SetOperation("+") - clsBaseOperator.AddParameter("ggwalter_lieth", clsRFunctionParameter:=clsGgwalterliethFunction, iPosition:=0) + clsRggplotFunction.SetPackageName("ggplot2") + clsRggplotFunction.SetRCommand("ggplot") + clsRggplotFunction.AddParameter("mapping", clsRFunctionParameter:=clsBarAesFunction, iPosition:=1) + + clsBarAesFunction.SetRCommand("aes") + + clsGeomBarFunction.SetRCommand("geom_bar") + clsGeomBarFunction.AddParameter("stat", Chr(34) & "identity" & Chr(34), iPosition:=1) + clsGeomBarFunction.AddParameter("alpha", "0.5", iPosition:=2) + + clsGeomBarTmaxFunction.SetRCommand("geom_bar") + clsGeomBarTmaxFunction.AddParameter("stat", Chr(34) & "identity" & Chr(34), iPosition:=1) + clsGeomBarTmaxFunction.AddParameter("fill", "red", iPosition:=2) + + clsAesTmaxBarFunction.SetRCommand("aes") + + clsGeomBarTminFunction.SetRCommand("geom_bar") + clsGeomBarTminFunction.AddParameter("stat", Chr(34) & "identity" & Chr(34), iPosition:=1) + clsGeomBarTminFunction.AddParameter("fill", "blue", iPosition:=2) + + clsAesTminBarFunction.SetRCommand("aes") + + clsGeomLineStarFunction.SetRCommand("geom_line") + clsGeomLineStarFunction.AddParameter("mapping", clsRFunctionParameter:=clsAesLineStarFunction, iPosition:=0) + clsGeomLineStarFunction.AddParameter("colour", Chr(34) & "red" & Chr(34), iPosition:=1) + + clsGeomLineStar1Function.SetRCommand("geom_line") + clsGeomLineStar1Function.AddParameter("mapping", clsRFunctionParameter:=clsAesLineStar1Function, iPosition:=0) + clsGeomLineStar1Function.AddParameter("colour", Chr(34) & "blue" & Chr(34), iPosition:=1) + + clsAesLineStarFunction.SetRCommand("aes") + clsAesLineStarFunction.AddParameter("group", "1", iPosition:=2) + + clsAesLineStar1Function.SetRCommand("aes") + clsAesLineStar1Function.AddParameter("group", "1", iPosition:=2) + + clsSecondaryAxisFunction.SetRCommand("sec_axis") + clsSecondaryAxisFunction.AddParameter("x", "~.*0.0393701", iPosition:=0, bIncludeArgumentName:=False) + clsSecondaryAxisFunction.AddParameter("name", Chr(34) & "Rainfall (inches)" & Chr(34), iPosition:=1) + + clsSecondaryAxis1Function.SetRCommand("sec_axis") + clsSecondaryAxis1Function.AddParameter("x", "~.*32", iPosition:=0, bIncludeArgumentName:=False) + clsSecondaryAxis1Function.AddParameter("name", Chr(34) & "Temperature (F)" & Chr(34), iPosition:=1) + + clsXScalediscreteFunction.SetRCommand("scale_x_discrete") + clsXScalediscreteFunction.AddParameter("name", Chr(34) & "Month" & Chr(34), iPosition:=0) + + clsGeomRibbonFunction.SetRCommand("geom_ribbon") + clsGeomRibbonFunction.AddParameter("mapping", clsRFunctionParameter:=clsAesGeomRibbonFunction, iPosition:=0, bIncludeArgumentName:=False) + clsGeomRibbonFunction.AddParameter("fill", Chr(34) & "#000000" & Chr(34), iPosition:=1) + clsGeomRibbonFunction.AddParameter("alpha", "0.2", iPosition:=2) + + clsAesGeomRibbonFunction.SetRCommand("aes") + clsAesGeomRibbonFunction.AddParameter("group", "1", iPosition:=2) + + clsGeomTileFunction.SetRCommand("geom_tile") + clsGeomTileFunction.AddParameter("alpha", "0.5", iPosition:=0) + + clsGeomRibbon1Function.SetRCommand("geom_ribbon") + clsGeomRibbon1Function.AddParameter("mapping", clsRFunctionParameter:=clsAesGeomRibbon1Function, iPosition:=0, bIncludeArgumentName:=False) + clsGeomRibbon1Function.AddParameter("fill", Chr(34) & "#000000" & Chr(34), iPosition:=1) + clsGeomRibbon1Function.AddParameter("alpha", "0.2", iPosition:=2) + + clsAesGeomRibbon1Function.SetRCommand("aes") + clsAesGeomRibbon1Function.AddParameter("ymin", clsROperatorParameter:=clsStar1Operator, iPosition:=0) + clsAesGeomRibbon1Function.AddParameter("ymax", clsROperatorParameter:=clsStarOperator, iPosition:=1) + clsAesGeomRibbon1Function.AddParameter("group", "1", iPosition:=2) + + clsGeomTextBarFunction.SetRCommand("geom_text") + clsGeomTextBarFunction.AddParameter("mapping", clsRFunctionParameter:=clsAesGeomTextBarFunction, iPosition:=0, bIncludeArgumentName:=False) + clsGeomTextBarFunction.AddParameter("vjust", "-0.5", iPosition:=1) + clsGeomTextBarFunction.AddParameter("size", "3", iPosition:=2) + + clsAesGeomTextBarFunction.SetRCommand("aes") + clsAesGeomTextBarFunction.AddParameter("label", clsRFunctionParameter:=clsRoundBarFunction, iPosition:=1) + + clsRoundBarFunction.SetRCommand("round") + clsRoundBarFunction.AddParameter("x", "1", iPosition:=1, bIncludeArgumentName:=False) + + clsGeomTextTmaxFunction.SetRCommand("geom_text") + clsGeomTextTmaxFunction.AddParameter("mapping", clsRFunctionParameter:=clsAesGeomTextTmaxFunction, iPosition:=0, bIncludeArgumentName:=False) + clsGeomTextTmaxFunction.AddParameter("colour", Chr(34) & "blue" & Chr(34), iPosition:=1) + clsGeomTextTmaxFunction.AddParameter("vjust", "-0.5", iPosition:=2) + clsGeomTextTmaxFunction.AddParameter("size", "3", iPosition:=3) + clsGeomTextTmaxFunction.AddParameter("Show.legend", "FALSE", iPosition:=4) + + clsAesGeomTextTmaxFunction.SetRCommand("aes") + clsAesGeomTextTmaxFunction.AddParameter("label", clsRFunctionParameter:=clsRoundTmaxFunction, iPosition:=1) + + clsGeomTextTmaxStarFunction.SetRCommand("geom_text") + clsGeomTextTmaxStarFunction.AddParameter("mapping", clsRFunctionParameter:=clsAesGeomTextStarTmaxFunction, iPosition:=0, bIncludeArgumentName:=False) + clsGeomTextTmaxStarFunction.AddParameter("colour", Chr(34) & "blue" & Chr(34), iPosition:=1) + clsGeomTextTmaxStarFunction.AddParameter("vjust", "-0.5", iPosition:=2) + clsGeomTextTmaxStarFunction.AddParameter("size", "3", iPosition:=3) + clsGeomTextTmaxStarFunction.AddParameter("Show.legend", "FALSE", iPosition:=4) + + clsAesGeomTextStarTmaxFunction.SetRCommand("aes") + clsAesGeomTextStarTmaxFunction.AddParameter("y", clsROperatorParameter:=clsStarOperator, iPosition:=0) + clsAesGeomTextStarTmaxFunction.AddParameter("label", clsRFunctionParameter:=clsRoundTmaxFunction, iPosition:=1) + + clsRoundTmaxFunction.SetRCommand("round") + clsRoundTmaxFunction.AddParameter("x", "1", iPosition:=1, bIncludeArgumentName:=False) + + clsGeomTextTminFunction.SetRCommand("geom_text") + clsGeomTextTminFunction.AddParameter("mapping", clsRFunctionParameter:=clsAesGeomTextTminFunction, iPosition:=0, bIncludeArgumentName:=False) + clsGeomTextTminFunction.AddParameter("colour", Chr(34) & "red" & Chr(34), iPosition:=1) + clsGeomTextTminFunction.AddParameter("vjust", "1.5", iPosition:=2) + clsGeomTextTminFunction.AddParameter("size", "3", iPosition:=3) + clsGeomTextTminFunction.AddParameter("Show.legend", "FALSE", iPosition:=4) + + clsAesGeomTextTminFunction.SetRCommand("aes") + clsAesGeomTextTminFunction.AddParameter("label", clsRFunctionParameter:=clsRoundTminFunction, iPosition:=1) + + clsGeomTextTminStarFunction.SetRCommand("geom_text") + clsGeomTextTminStarFunction.AddParameter("mapping", clsRFunctionParameter:=clsAesGeomTextStarTminFunction, iPosition:=0, bIncludeArgumentName:=False) + clsGeomTextTminStarFunction.AddParameter("colour", Chr(34) & "red" & Chr(34), iPosition:=1) + clsGeomTextTminStarFunction.AddParameter("vjust", "1.5", iPosition:=2) + clsGeomTextTminStarFunction.AddParameter("size", "3", iPosition:=3) + clsGeomTextTminStarFunction.AddParameter("Show.legend", "FALSE", iPosition:=4) + + clsAesGeomTextStarTminFunction.SetRCommand("aes") + clsAesGeomTextStarTminFunction.AddParameter("y", clsROperatorParameter:=clsStar1Operator, iPosition:=0) + clsAesGeomTextStarTminFunction.AddParameter("label", clsRFunctionParameter:=clsRoundTminFunction, iPosition:=1) + + clsRoundTminFunction.SetRCommand("round") + clsRoundTminFunction.AddParameter("x", "1", iPosition:=1, bIncludeArgumentName:=False) + + clsSecondaryAxis2Function.SetRCommand("sec_axis") + clsSecondaryAxis2Function.AddParameter("x", clsROperatorParameter:=clsDivide1Operator, iPosition:=0, bIncludeArgumentName:=False) + clsSecondaryAxis2Function.AddParameter("name", Chr(34) & "Temperature (c)" & Chr(34), iPosition:=1) + + clsDivide1Operator.SetOperation("/") + clsDivide1Operator.AddParameter("left", "~ .", iPosition:=0, bIncludeArgumentName:=False) + clsDivide1Operator.AddParameter("right", clsROperatorParameter:=clsDivideOperator, iPosition:=1, bIncludeArgumentName:=False) + + clsStarOperator.SetOperation("*") + clsStarOperator.AddParameter("right", strScale, iPosition:=1, bIncludeArgumentName:=False) + + clsStar1Operator.SetOperation("*") + clsStar1Operator.AddParameter("right", strScale, iPosition:=1, bIncludeArgumentName:=False) + + clsDivideOperator.SetOperation("/") + clsDivideOperator.AddParameter("left", clsRFunctionParameter:=clsMaxFunction, iPosition:=0, bIncludeArgumentName:=False) + clsDivideOperator.AddParameter("right", clsRFunctionParameter:=clsMax1Function, iPosition:=1, bIncludeArgumentName:=False) + clsDivideOperator.SetAssignTo(strScale,) + + clsMaxFunction.SetRCommand("max") + + clsMax1Function.SetRCommand("max") + clsMax1Function.AddParameter("x", clsRFunctionParameter:=clsVectorFunction, iPosition:=0, bIncludeArgumentName:=False) + + clsVectorFunction.SetRCommand("c") + + clsScaleycontinuousFunction.SetRCommand("scale_y_continuous") + + clsLabFunction.SetRCommand("labs") + + clsColourPaletteFunction.SetPackageName("viridis") + clsColourPaletteFunction.SetRCommand("scale_fill_viridis") + + clsScalefillDistillerFunction.SetPackageName("ggplot2") + clsScalefillDistillerFunction.SetRCommand("scale_fill_distiller") + + clsFillBrewerFunction.SetPackageName("ggplot2") + clsFillBrewerFunction.SetRCommand("scale_fill_brewer") + + clsPlus1Operator.SetOperation("+") + clsPlus1Operator.AddParameter("left", clsRFunctionParameter:=clsRainGgplotFunction, iPosition:=0, bIncludeArgumentName:=False) + clsPlus1Operator.AddParameter("right", clsROperatorParameter:=clsPlus2Operator, iPosition:=1, bIncludeArgumentName:=False) + clsPlus1Operator.SetAssignTo(strRainBar) + + clsPlus2Operator.SetOperation("+") + clsPlus2Operator.AddParameter("left", clsRFunctionParameter:=clsRainBarFunction, iPosition:=0, bIncludeArgumentName:=False) + clsPlus2Operator.AddParameter("right", clsROperatorParameter:=clsPlus3Operator, iPosition:=1, bIncludeArgumentName:=False) + + clsPlus3Operator.SetOperation("+") + clsPlus3Operator.AddParameter("left", clsRFunctionParameter:=clsRainBarTextFunction, iPosition:=0, bIncludeArgumentName:=False) + clsPlus3Operator.AddParameter("right", clsRFunctionParameter:=clsLabsRainFunction, iPosition:=1, bIncludeArgumentName:=False) + + clsRainGgplotFunction.SetRCommand("ggplot") + + clsAesRainGgplotFunction.SetRCommand("aes") + + clsRainBarFunction.SetRCommand("geom_bar") + clsRainBarFunction.AddParameter("stat", Chr(34) & "identity" & Chr(34), iPosition:=0) + clsRainBarFunction.AddParameter("alpha", "0.5", iPosition:=1) + clsRainBarFunction.AddParameter("fill", Chr(34) & "purple" & Chr(34), iPosition:=2) + + clsRainBarTextFunction.SetRCommand("geom_text") + clsRainBarTextFunction.AddParameter("size", "3", iPosition:=2) + + clsRainRoundFunction.SetRCommand("round") + clsRainRoundFunction.AddParameter("y", "1", bIncludeArgumentName:=False) + + clsAesRainBarTextFunction.SetRCommand("aes") + + clsLabsRainFunction.SetRCommand("scale_y_continuous") + clsLabsRainFunction.AddParameter("name", Chr(34) & "Rainfall (mm)" & Chr(34), iPosition:=0) + clsLabsRainFunction.AddParameter("sec.axis", clsRFunctionParameter:=clsSecAxisRainFunction, iPosition:=1) + + clsSecAxisRainFunction.SetRCommand("sec_axis") + clsSecAxisRainFunction.AddParameter("x", "~.*0.0393701", iPosition:=0, bIncludeArgumentName:=False) + clsSecAxisRainFunction.AddParameter("name", Chr(34) & "Rainfall (inches)" & Chr(34), iPosition:=1) + + clsPlus5Operator.SetOperation("+") + clsPlus5Operator.SetAssignTo(strTemBar) + + clsPlus6Operator.SetOperation("+") + + clsPlus7Operator.SetOperation("+") + + clsPlus8Operator.SetOperation("+") + + clsPlus9Operator.SetOperation("+") + + clsPlus10Operator.SetOperation("+") + + clsPlus11Operator.SetOperation("+") + + clsTemGgplotFunction.SetRCommand("ggplot") + + clsAesTemGgplotFunction.SetRCommand("aes") + + clsTmaxBarFunction.SetRCommand("geom_bar") + clsTmaxBarFunction.AddParameter("stat", Chr(34) & "identity" & Chr(34), iPosition:=1) + clsTmaxBarFunction.AddParameter("fill", Chr(34) & "red" & Chr(34), iPosition:=2) + + clsAesTmaxBarFunction1.SetRCommand("aes") + + clsTminBarFunction.SetRCommand("geom_bar") + clsTminBarFunction.AddParameter("stat", Chr(34) & "identity" & Chr(34), iPosition:=1) + clsTminBarFunction.AddParameter("fill", Chr(34) & "blue" & Chr(34), iPosition:=2) + + clsAesTminBarFunction1.SetRCommand("aes") + + clsTmaxBarTextFunction.SetRCommand("geom_text") + clsTmaxBarTextFunction.AddParameter("size", "3", iPosition:=2) + + clsAesTmaxBarTextFunction.SetRCommand("aes") + + clsTmaxRoundFunction.SetRCommand("round") + clsTmaxRoundFunction.AddParameter("y", "1", iPosition:=1, bIncludeArgumentName:=False) + + clsTminBarTextFunction.SetRCommand("geom_text") + clsTminBarTextFunction.AddParameter("size", "3", iPosition:=2) + + clsAesTminBarTextFunction.SetRCommand("aes") + + clsTminRoundFunction.SetRCommand("round") + clsTminRoundFunction.AddParameter("y", "1", iPosition:=1, bIncludeArgumentName:=False) + + clsLabsTempFunction.SetRCommand("scale_y_continuous") + clsLabsTempFunction.AddParameter("name", Chr(34) & "Temperature (C)" & Chr(34), iPosition:=0) + clsLabsTempFunction.AddParameter("sec.axis", clsRFunctionParameter:=clsSecAxisTemFunction, iPosition:=1) + + clsSecAxisTemFunction.SetRCommand("sec_axis") + clsSecAxisTemFunction.AddParameter("x", "~.*32", iPosition:=0, bIncludeArgumentName:=False) + clsSecAxisTemFunction.AddParameter("name", Chr(34) & "Temperature (F)" & Chr(34), iPosition:=1) + + clsPlotGridFunction.SetPackageName("cowplot") + clsPlotGridFunction.SetRCommand("plot_grid") + clsPlotGridFunction.AddParameter("x", strTemBar, iPosition:=0, bIncludeArgumentName:=False) + clsPlotGridFunction.AddParameter("y", strRainBar, iPosition:=1, bIncludeArgumentName:=False) + clsPlotGridFunction.AddParameter("ncol", "1", iPosition:=2) + + clsLabsFunction = GgplotDefaults.clsDefaultLabs.Clone() + clsXlabFunction = GgplotDefaults.clsXlabTitleFunction.Clone() + clsYlabFunction = GgplotDefaults.clsYlabTitleFunction.Clone() + clsXScalecontinuousFunction = GgplotDefaults.clsXScalecontinuousFunction.Clone() + clsYScalecontinuousFunction = GgplotDefaults.clsYScalecontinuousFunction.Clone() + clsRFacetFunction = GgplotDefaults.clsFacetFunction.Clone() + clsBaseOperator.AddParameter(GgplotDefaults.clsDefaultThemeParameter.Clone()) + clsCoordPolarStartOperator = GgplotDefaults.clsCoordPolarStartOperator.Clone() + clsCoordPolarFunction = GgplotDefaults.clsCoordPolarFunction.Clone() + clsXScaleDateFunction = GgplotDefaults.clsXScaleDateFunction.Clone() + clsYScaleDateFunction = GgplotDefaults.clsYScaleDateFunction.Clone() + clsThemeFunction = GgplotDefaults.clsDefaultThemeFunction.Clone() + clsLocalRaesFunction = GgplotDefaults.clsAesFunction.Clone() + dctThemeFunctions = New Dictionary(Of String, RFunction)(GgplotDefaults.dctThemeFunctions) + clsScaleFillViridisFunction = GgplotDefaults.clsScaleFillViridisFunction + clsScaleColourViridisFunction = GgplotDefaults.clsScaleColorViridisFunction + clsAnnotateFunction = GgplotDefaults.clsAnnotateFunction + + clsGetDataFrameFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_data_frame") + + clsGetObjectDataFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_object_data") + clsGetObjectDataFunction.AddParameter("data_name", Chr(34) & ucrSelectorClimograph.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) + clsGetObjectDataFunction.AddParameter("as_file", "TRUE", iPosition:=2) + + clsBaseOperator.SetAssignTo("last_graph", strTempDataframe:=ucrSelectorClimograph.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") + + ucrBase.clsRsyntax.ClearCodes() ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) + ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction, iPosition:=0) + ucrBase.clsRsyntax.AddToBeforeCodes(clsGetDataFrameFunction, iPosition:=0) End Sub Private Sub SetRCodeForControls(bReset) - ucrSelectorClimograph.SetRCode(clsGgwalterliethFunction, bReset) - ucrPnlClimograph.SetRCode(clsDummyFunction, bReset) + ucrReceiverRainC.SetRCode(clsMaxFunction, bReset) ucrReceiverMonth.SetRCode(clsGgwalterliethFunction, bReset) ucrReceiverRain.SetRCode(clsGgwalterliethFunction, bReset) ucrReceiverMintemp.SetRCode(clsGgwalterliethFunction, bReset) ucrReceiverMaxtem.SetRCode(clsGgwalterliethFunction, bReset) ucrReceiverAbsolute.SetRCode(clsGgwalterliethFunction, bReset) ucrSave.SetRCode(clsBaseOperator, bReset) + ucrChkLegend.SetRCode(clsThemeFunction, bReset, bCloneIfNeeded:=True) + ucrInputLegendPosition.SetRCode(clsThemeFunction, bReset, bCloneIfNeeded:=True) If bReset Then - AutoFacetStation() + ucrReceiverElement2.SetRCode(clsVectorFunction, bReset) + ucrReceiverElement1.SetRCode(clsVectorFunction, bReset) + ucrPnlClimograph.SetRCode(clsDummyFunction, bReset) + ucrChkRibbon.SetRCode(clsGeomRibbonFunction, bReset) + ucrChkTile.SetRCode(clsGeomTileFunction, bReset) + ucrChkText.SetRCode(clsBaseOperator, bReset) + ucrPnlColour.SetRCode(clsDummyFunction, bReset) + ucrChkColour.SetRCode(clsBaseOperator, bReset) End If End Sub Private Sub TestOKEnabled() - If rdoWalterLieth.Checked AndAlso ((Not ucrReceiverAbsolute.IsEmpty AndAlso Not ucrReceiverMaxtem.IsEmpty AndAlso Not ucrReceiverMintemp.IsEmpty AndAlso Not ucrReceiverMonth.IsEmpty AndAlso Not ucrReceiverRain.IsEmpty) OrElse Not ucrSave.IsComplete) Then + If rdoClimograph.Checked AndAlso Not ucrReceiverMonthC.IsEmpty AndAlso ((Not ucrReceiverElement1.IsEmpty OrElse Not ucrReceiverElement2.IsEmpty OrElse Not ucrReceiverRainC.IsEmpty) OrElse Not ucrSave.IsComplete) Then + ucrBase.OKEnabled(True) + ElseIf rdoWalterLieth.Checked AndAlso ((Not ucrReceiverAbsolute.IsEmpty AndAlso Not ucrReceiverMaxtem.IsEmpty AndAlso Not ucrReceiverMintemp.IsEmpty AndAlso Not ucrReceiverMonth.IsEmpty AndAlso Not ucrReceiverRain.IsEmpty) OrElse Not ucrSave.IsComplete) Then + ucrBase.OKEnabled(True) + ElseIf rdoClimateBars.Checked AndAlso Not ucrReceiverMonthBar.IsEmpty AndAlso ((Not ucrReceiverElement1Bar.IsEmpty AndAlso Not ucrReceiverElement2Bar.IsEmpty OrElse Not ucrReceiverRainBar.IsEmpty) OrElse Not ucrSave.IsComplete) Then ucrBase.OKEnabled(True) Else ucrBase.OKEnabled(False) End If End Sub + Private Sub ucrPnlClimograph_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlClimograph.ControlValueChanged + ResizeDialogue() + If rdoClimograph.Checked Then + cmdOptions.Visible = True + ucrBase.clsRsyntax.RemoveFromBeforeCodes(clsPlus1Operator) + ucrBase.clsRsyntax.RemoveFromBeforeCodes(clsPlus5Operator) + clsBaseOperator.RemoveParameterByName("ggwalter_lieth") + ucrReceiverMonthC.SetMeAsReceiver() + clsBaseOperator.AddParameter("ggplot", clsRFunctionParameter:=clsRggplotFunction, iPosition:=0) + clsBaseOperator.AddParameter("geom_bar", clsRFunctionParameter:=clsGeomBarFunction, iPosition:=2) + ElseIf rdoWalterLieth.Checked Then + cmdOptions.Visible = False + ucrBase.clsRsyntax.RemoveFromBeforeCodes(clsPlus1Operator) + ucrBase.clsRsyntax.RemoveFromBeforeCodes(clsPlus5Operator) + clsBaseOperator.RemoveParameterByName("ggplot") + clsBaseOperator.RemoveParameterByName("geom_bar") + ucrReceiverMonth.SetMeAsReceiver() + clsGgwalterliethFunction.AddParameter("data", ucrSelectorClimograph.ucrAvailableDataFrames.cboAvailableDataFrames.Text, iPosition:=0) + clsBaseOperator.AddParameter("ggwalter_lieth", clsRFunctionParameter:=clsGgwalterliethFunction, iPosition:=0) + Else + cmdOptions.Visible = False + clsBaseOperator.RemoveParameterByName("ggwalter_lieth") + clsBaseOperator.RemoveParameterByName("ggplot") + clsBaseOperator.RemoveParameterByName("geom_bar") + clsBaseOperator.RemoveParameterByName("facets") + clsBaseOperator.RemoveParameterByName("facets1") + clsBaseOperator.AddParameter("plot_grid", clsRFunctionParameter:=clsPlotGridFunction, iPosition:=0) + ucrBase.clsRsyntax.AddToBeforeCodes(clsPlus1Operator, iPosition:=1) + ucrBase.clsRsyntax.AddToBeforeCodes(clsPlus5Operator, iPosition:=2) + End If + AutoFacetStation() + AddRemoveFacetClimograph() + AddRemoveFacetsWalterLieth() + AddRemoveGeomBar() + AddRemoveGeomLine1() + AddRemoveGeomLines() + AddRemoveSecondaryAxis() + AddRemoveGeomRibbon() + AddRemoveGeomTextBar() + AddRemoveGeomTextTmax() + AddRemoveGeomTextTmin() + EnableTileAndRibbon() + AddRemoveTemBars() + End Sub + Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset SetDefaults() SetRCodeForControls(True) @@ -191,6 +916,263 @@ Public Class dlgClimograph TestOKEnabled() End Sub + Private Sub cmdOptions_Click(sender As Object, e As EventArgs) Handles cmdOptions.Click, toolStripMenuItemPlotOptions.Click + sdgPlots.SetRCode(clsNewOperator:=ucrBase.clsRsyntax.clsBaseOperator, clsNewYScalecontinuousFunction:=clsYScalecontinuousFunction, clsNewXScalecontinuousFunction:=clsXScalecontinuousFunction, + clsNewXLabsTitleFunction:=clsXlabFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, clsNewFacetFunction:=clsRFacetFunction, + dctNewThemeFunctions:=dctThemeFunctions, ucrNewBaseSelector:=ucrSelectorClimograph, clsNewThemeFunction:=clsThemeFunction, clsNewGlobalAesFunction:=clsBarAesFunction, + clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, clsNewXScaleDateFunction:=clsXScaleDateFunction, clsNewAnnotateFunction:=clsAnnotateFunction, + clsNewScaleFillViridisFunction:=clsScaleFillViridisFunction, clsNewScaleColourViridisFunction:=clsScaleColourViridisFunction, clsNewYScaleDateFunction:=clsYScaleDateFunction, clsNewFacetVariablesOperator:=clsFacetVariablesOperator, bReset:=bResetSubdialog) + sdgPlots.ShowDialog() + AutoFacetStation() + AddRemoveFacetClimograph() + AddRemoveFacetsWalterLieth() + AddRemoveGeomBar() + AddRemoveGeomLine1() + AddRemoveGeomLines() + AddRemoveSecondaryAxis() + AddRemoveGeomRibbon() + AddRemoveGeomTextBar() + AddRemoveGeomTextTmax() + AddRemoveGeomTextTmin() + bResetSubdialog = False + End Sub + + Private Sub openSdgLayerOptions(clsNewGeomFunc As RFunction) + sdgLayerOptions.SetupLayer(clsNewGgPlot:=clsRggplotFunction, clsNewGeomFunc:=clsNewGeomFunc, + clsNewGlobalAesFunc:=clsBarAesFunction, clsNewLocalAes:=clsLocalRaesFunction, + bFixGeom:=True, ucrNewBaseSelector:=ucrSelectorClimograph, + bApplyAesGlobally:=True, bReset:=bResetLineLayerSubdialog) + sdgLayerOptions.ShowDialog() + bResetLineLayerSubdialog = False + 'Coming from the sdgLayerOptions, clsRaesFunction and others have been modified. + ' One then needs to display these modifications on the dlgScatteredPlot. + + 'The aesthetics parameters on the main dialog are repopulated as required. + For Each clsParam In clsBarAesFunction.clsParameters + If clsParam.strArgumentName = "x" Then + If clsParam.strArgumentValue = Chr(34) & Chr(34) Then + ucrReceiverMonthC.Clear() + End If + 'In the y case, the value stored in the clsReasFunction in the multiple variables + ' case is "value", however that one shouldn't be written in the multiple + ' variables receiver (otherwise it would stack all variables and the stack + ' ("value") itself!). + 'Warning: what if someone used the name value for one of it's variables + ' independently from the multiple variables method? Here if the receiver is + ' actually in single mode, the variable "value" will still be given back, which + ' throws the problem back to the creation of "value" in the multiple receiver case. + ElseIf clsParam.strArgumentName = "y" AndAlso clsParam.strArgumentValue <> "value" Then + 'Still might be in the case of bSingleVariable with mapping y="". + If clsParam.strArgumentValue = Chr(34) & Chr(34) Then + ucrReceiverRainC.Clear() + Else + ucrReceiverRainC.Add(clsParam.strArgumentValue) + End If + End If + Next + TestOKEnabled() + AddRemoveGeomBar() + End Sub + + Private Sub openSdgLayerOptionstmax(clsNewGeomFunc As RFunction, clsNewAesFunction As RFunction) + sdgLayerOptions.SetupLayer(clsNewGgPlot:=clsRggplotFunction, clsNewGeomFunc:=clsNewGeomFunc, + clsNewGlobalAesFunc:=clsLocalRaesFunction, clsNewLocalAes:=clsNewAesFunction, + bFixGeom:=True, ucrNewBaseSelector:=ucrSelectorClimograph, + bApplyAesGlobally:=False, bReset:=bResetLineLayerSubdialog) + sdgLayerOptions.ShowDialog() + bResetLineLayerSubdialog = False + 'Coming from the sdgLayerOptions, clsRaesFunction and others have been modified. + ' One then needs to display these modifications on the dlgScatteredPlot. + + 'The aesthetics parameters on the main dialog are repopulated as required. + For Each clsParam In clsNewAesFunction.clsParameters + If clsParam.strArgumentName = "x" Then + If clsParam.strArgumentValue = Chr(34) & Chr(34) Then + ucrReceiverMonthC.Clear() + End If + ElseIf clsParam.strArgumentName = "y" AndAlso clsParam.strArgumentValue <> "value" Then + ucrReceiverElement1.Add(clsParam.strArgumentValue) + End If + Next + TestOKEnabled() + End Sub + + Private Sub openSdgLayerOptionstmin(clsNewGeomFunc As RFunction, clsNewAesFunction As RFunction) + sdgLayerOptions.SetupLayer(clsNewGgPlot:=clsRggplotFunction, clsNewGeomFunc:=clsNewGeomFunc, + clsNewGlobalAesFunc:=clsLocalRaesFunction, clsNewLocalAes:=clsNewAesFunction, + bFixGeom:=True, ucrNewBaseSelector:=ucrSelectorClimograph, + bApplyAesGlobally:=False, bReset:=bResetLineLayerSubdialog) + sdgLayerOptions.ShowDialog() + bResetLineLayerSubdialog = False + For Each clsParam In clsNewAesFunction.clsParameters + If clsParam.strArgumentName = "x" Then + If clsParam.strArgumentValue = Chr(34) & Chr(34) Then + ucrReceiverMonthC.Clear() + End If + ElseIf clsParam.strArgumentName = "y" AndAlso clsParam.strArgumentValue <> "value" Then + ucrReceiverElement2.Add(clsParam.strArgumentValue) + End If + Next + TestOKEnabled() + End Sub + + Private Sub ucrInputFacet_ControlValueChanged(ucrChangedControl As ucrInputComboBox) Handles ucrInputFacet.ControlValueChanged + If Not bUpdateComboOptions1 Then + Exit Sub + End If + Dim strChangedText As String = ucrChangedControl.GetText() + If strChangedText <> strNone Then + If Not strChangedText = strFacetCol1 AndAlso Not strChangedText = strFacetRow1 AndAlso + Not ucrInputFacet.Equals(ucrChangedControl) AndAlso ucrInputFacet.GetText() = strChangedText Then + bUpdateComboOptions1 = False + ucrInputFacet.SetName(strNone1) + bUpdateComboOptions1 = True + End If + If (strChangedText = strFacetWrap1 AndAlso ucrInputFacet.GetText = strFacetRow1) OrElse (strChangedText = strFacetRow1 AndAlso + ucrInputFacet.GetText = strFacetWrap1) OrElse (strChangedText = strFacetWrap1 AndAlso + ucrInputFacet.GetText = strFacetCol1) OrElse (strChangedText = strFacetCol1 AndAlso ucrInputFacet.GetText = strFacetWrap1) Then + ucrInputFacet.SetName(strNone1) + End If + End If + UpdateParameters1() + AddRemoveFacets1() + AddRemoveGroupBy1() + End Sub + + Private Sub UpdateParameters1() + clsFacetVariablesOperator.RemoveParameterByName("var1") + clsFacetColOp1.RemoveParameterByName("col" & ucrInputFacet.Name) + clsFacetRowOp1.RemoveParameterByName("row" & ucrInputFacet.Name) + + clsBaseOperator.RemoveParameterByName("facets") + bUpdatingParameters1 = True + ucrReceiverFacet.SetRCode(Nothing) + Select Case ucrInputFacet.GetText() + Case strFacetWrap1 + ucrReceiverFacet.ChangeParameterName("var1") + ucrReceiverFacet.SetRCode(clsFacetVariablesOperator) + Case strFacetCol1 + ucrReceiverFacet.ChangeParameterName("col" & ucrInputFacet.Name) + ucrReceiverFacet.SetRCode(clsFacetColOp1) + Case strFacetRow1 + ucrReceiverFacet.ChangeParameterName("row" & ucrInputFacet.Name) + ucrReceiverFacet.SetRCode(clsFacetRowOp1) + End Select + If Not clsRFacetFunction.ContainsParameter("x") Then + clsRFacetFunction.AddParameter("x", Chr(34) & Chr(34)) + End If + bUpdatingParameters1 = False + End Sub + + Private Sub AddRemoveFacets1() + Dim bWrap As Boolean = False + Dim bCol As Boolean = False + Dim bRow As Boolean = False + + If bUpdatingParameters1 Then + Exit Sub + End If + + clsBaseOperator.RemoveParameterByName("facets") + If Not ucrReceiverFacet.IsEmpty Then + Select Case ucrInputFacet.GetText() + Case strFacetWrap1 + bWrap = True + Case strFacetCol1 + bCol = True + Case strFacetRow1 + bRow = True + End Select + End If + + If bWrap OrElse bRow OrElse bCol Then + clsBaseOperator.AddParameter("facets", clsRFunctionParameter:=clsFacetFunction1) + End If + If bWrap Then + clsFacetFunction1.SetRCommand("facet_wrap") + End If + If bRow OrElse bCol Then + clsFacetFunction1.SetRCommand("facet_grid") + End If + If bRow Then + clsFacetVariablesOperator.AddParameter("left", clsROperatorParameter:=clsFacetRowOp1, iPosition:=0) + ElseIf bCol AndAlso bWrap = False Then + clsFacetVariablesOperator.AddParameter("left", ".", iPosition:=0) + Else + clsFacetVariablesOperator.RemoveParameterByName("left") + End If + If bCol Then + clsFacetVariablesOperator.AddParameter("right", clsROperatorParameter:=clsFacetColOp1, iPosition:=1) + ElseIf bRow AndAlso bWrap = False Then + clsFacetVariablesOperator.AddParameter("right", ".", iPosition:=1) + Else + clsFacetVariablesOperator.RemoveParameterByName("right") + End If + End Sub + + Private Sub AddRemoveFacetClimograph() + If rdoClimograph.Checked Then + If Not ucrReceiverFacet.IsEmpty Then + clsBaseOperator.AddParameter("facets", clsRFunctionParameter:=clsFacetFunction1) + Else + clsBaseOperator.RemoveParameterByName("facets") + End If + ElseIf rdoClimateBars.Checked Then + AddRemoveTemBars() + Else + clsBaseOperator.RemoveParameterByName("facets") + End If + End Sub + Private Sub ucrReceiverFacet_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverFacet.ControlValueChanged + AddRemoveFacetClimograph() + AddRemoveFacets1() + AddRemoveGroupBy1() + End Sub + + Private Sub GetParameterValue1(clsOperator As ROperator) + Dim i As Integer = 0 + For Each clsTempParam As RParameter In clsOperator.clsParameters + If clsTempParam.strArgumentValue <> "" AndAlso clsTempParam.strArgumentValue <> "." Then + clsGroupByFunction1.AddParameter(i, clsTempParam.strArgumentValue, bIncludeArgumentName:=False, iPosition:=i) + i = i + 1 + End If + Next + End Sub + + Private Sub AddRemoveGroupBy1() + If clsPipeOperator1.ContainsParameter("mutate") Then + clsGroupByFunction1.ClearParameters() + If clsBaseOperator.ContainsParameter("facets") Then + Select Case ucrInputFacet.GetText() + Case strFacetWrap1 + GetParameterValue1(clsFacetVariablesOperator) + Case strFacetCol1 + GetParameterValue1(clsFacetColOp1) + Case strFacetRow1 + GetParameterValue1(clsFacetRowOp1) + End Select + End If + + If clsGroupByFunction1.iParameterCount > 0 Then + clsPipeOperator1.AddParameter("group_by", clsRFunctionParameter:=clsGroupByFunction1, iPosition:=1) + Else + clsPipeOperator1.RemoveParameterByName("group_by") + End If + Else + clsPipeOperator1.RemoveParameterByName("group_by") + End If + + SetPipeAssignTo1() + End Sub + + Private Sub SetPipeAssignTo1() + If ucrSelectorClimograph.ucrAvailableDataFrames.cboAvailableDataFrames.Text <> "" AndAlso clsPipeOperator1.clsParameters.Count > 1 Then + clsPipeOperator1.SetAssignTo(ucrSelectorClimograph.ucrAvailableDataFrames.cboAvailableDataFrames.Text) + Else + clsPipeOperator1.RemoveAssignTo() + End If + End Sub + Private Sub ucrInput_ControlValueChanged(ucrChangedControl As ucrInputComboBox) Handles ucrInputStation.ControlValueChanged If Not bUpdateComboOptions Then Exit Sub @@ -215,7 +1197,7 @@ Public Class dlgClimograph End Sub Private Sub UpdateParameters() - clsFacetOperator.RemoveParameterByName("wrap" & ucrInputStation.Name) + clsFacetOperator.RemoveParameterByName("var1") clsFacetColOp.RemoveParameterByName("col" & ucrInputStation.Name) clsFacetRowOp.RemoveParameterByName("row" & ucrInputStation.Name) @@ -224,7 +1206,7 @@ Public Class dlgClimograph ucr1stFactorReceiver.SetRCode(Nothing) Select Case ucrInputStation.GetText() Case strFacetWrap - ucr1stFactorReceiver.ChangeParameterName("wrap" & ucrInputStation.Name) + ucr1stFactorReceiver.ChangeParameterName("var1") ucr1stFactorReceiver.SetRCode(clsFacetOperator) Case strFacetCol ucr1stFactorReceiver.ChangeParameterName("col" & ucrInputStation.Name) @@ -258,7 +1240,7 @@ Public Class dlgClimograph End If If bWrap OrElse bRow OrElse bCol Then - clsBaseOperator.AddParameter("facets", clsRFunctionParameter:=clsFacetFunction) + clsBaseOperator.AddParameter("facets1", clsRFunctionParameter:=clsFacetFunction) End If If bWrap Then clsFacetFunction.SetRCommand("facet_wrap") @@ -282,29 +1264,55 @@ Public Class dlgClimograph End If End Sub - Private Sub ucr1stFactorReceiver_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucr1stFactorReceiver.ControlValueChanged - If Not ucr1stFactorReceiver.IsEmpty Then - clsGgwalterliethFunction.AddParameter("station", ucr1stFactorReceiver.GetVariableNames(), iPosition:=1) + Private Sub AddRemoveFacetsWalterLieth() + If rdoWalterLieth.Checked Then + If Not ucr1stFactorReceiver.IsEmpty Then + clsGgwalterliethFunction.AddParameter("station", ucr1stFactorReceiver.GetVariableNames(), iPosition:=1) + Else + clsGgwalterliethFunction.RemoveParameterByName("station") + clsBaseOperator.RemoveParameterByName("facets1") + End If Else - clsGgwalterliethFunction.RemoveParameterByName("station") + clsBaseOperator.RemoveParameterByName("facets1") End If + End Sub + + Private Sub ucr1stFactorReceiver_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucr1stFactorReceiver.ControlValueChanged + AddRemoveFacetsWalterLieth() AddRemoveFacets() AddRemoveGroupBy() End Sub Private Sub AutoFacetStation() - Dim ucrCurrentReceiver As ucrReceiver = ucrSelectorClimograph.CurrentReceiver + If rdoClimograph.Checked Then + Dim currentReceiver As ucrReceiver = ucrSelectorClimograph.CurrentReceiver + + If currentReceiver IsNot Nothing Then + ucrReceiverFacet.AddItemsWithMetadataProperty(ucrSelectorClimograph.ucrAvailableDataFrames.cboAvailableDataFrames.Text, "Climatic_Type", {"year_label"}) + currentReceiver.SetMeAsReceiver() + AddRemoveGroupBy1() + End If + Else + Dim ucrCurrentReceiver As ucrReceiver = ucrSelectorClimograph.CurrentReceiver - If ucrCurrentReceiver IsNot Nothing Then - ucr1stFactorReceiver.AddItemsWithMetadataProperty(ucrSelectorClimograph.ucrAvailableDataFrames.cboAvailableDataFrames.Text, "Climatic_Type", {"station_label"}) - ucrCurrentReceiver.SetMeAsReceiver() - AddRemoveGroupBy() + If ucrCurrentReceiver IsNot Nothing Then + ucr1stFactorReceiver.AddItemsWithMetadataProperty(ucrSelectorClimograph.ucrAvailableDataFrames.cboAvailableDataFrames.Text, "Climatic_Type", {"station_label"}) + ucrCurrentReceiver.SetMeAsReceiver() + AddRemoveGroupBy() + End If End If End Sub Private Sub ucrSelectorClimograph_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectorClimograph.ControlValueChanged + clsGetDataFrameFunction.AddParameter("data_name", Chr(34) & ucrSelectorClimograph.strCurrentDataFrame & Chr(34), iPosition:=0) + clsGetDataFrameFunction.SetAssignTo(ucrSelectorClimograph.ucrAvailableDataFrames.cboAvailableDataFrames.Text) + clsRggplotFunction.AddParameter("data", ucrSelectorClimograph.ucrAvailableDataFrames.cboAvailableDataFrames.Text, iPosition:=0) AutoFacetStation() SetPipeAssignTo() + SetPipeAssignTo1() + AddRemoveGeomRibbon() + Dataframechange() + AddRemoveTemBars() End Sub Private Sub GetParameterValue(clsOperator As ROperator) @@ -318,7 +1326,6 @@ Public Class dlgClimograph End Sub Private Sub AddRemoveGroupBy() - If clsPipeOperator.ContainsParameter("mutate") Then clsGroupByFunction.ClearParameters() If clsBaseOperator.ContainsParameter("facets") Then @@ -331,7 +1338,6 @@ Public Class dlgClimograph GetParameterValue(clsFacetRowOp) End Select End If - If clsGroupByFunction.iParameterCount > 0 Then clsPipeOperator.AddParameter("group_by", clsRFunctionParameter:=clsGroupByFunction, iPosition:=1) Else @@ -344,6 +1350,10 @@ Public Class dlgClimograph SetPipeAssignTo() End Sub + Private Sub ucrInputFacet_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputFacet.ControlValueChanged + + End Sub + Private Sub SetPipeAssignTo() If ucrSelectorClimograph.ucrAvailableDataFrames.cboAvailableDataFrames.Text <> "" AndAlso clsPipeOperator.clsParameters.Count > 1 Then clsPipeOperator.SetAssignTo(ucrSelectorClimograph.ucrAvailableDataFrames.cboAvailableDataFrames.Text) @@ -352,7 +1362,449 @@ Public Class dlgClimograph End If End Sub - Private Sub AllControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrPnlClimograph.ControlContentsChanged, ucrReceiverRain.ControlContentsChanged, ucrReceiverAbsolute.ControlContentsChanged, ucrReceiverMonth.ControlContentsChanged, ucrReceiverMaxtem.ControlContentsChanged, ucrReceiverMintemp.ControlContentsChanged, ucrSave.ControlContentsChanged + Private Sub ucrReceiverElement1_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverElement1.ControlValueChanged + AddRemoveSecondaryAxis() + AddRemoveGeomLines() + AddRemoveGeomRibbon() + AddRemoveGeomTextTmax() + EnableTileAndRibbon() + End Sub + + Private Sub AddRemoveTheme() + If clsThemeFunction.iParameterCount > 0 Then + clsBaseOperator.AddParameter("theme", clsRFunctionParameter:=clsThemeFunction, iPosition:=15) + Else + clsBaseOperator.RemoveParameterByName("theme") + End If + End Sub + + Private Sub ucrChkLegend_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkLegend.ControlValueChanged, ucrInputLegendPosition.ControlValueChanged + AddRemoveTheme() + End Sub + + + Private Sub AddRemoveGeomTextBar() + If rdoClimograph.Checked AndAlso ucrChkText.Checked AndAlso Not ucrReceiverRainC.IsEmpty Then + clsRoundBarFunction.AddParameter("y", ucrReceiverRainC.GetVariableNames(False), iPosition:=0, bIncludeArgumentName:=False) + clsAesGeomTextBarFunction.AddParameter("label", clsRFunctionParameter:=clsRoundBarFunction, iPosition:=1) + clsBaseOperator.AddParameter("geom_text", clsRFunctionParameter:=clsGeomTextBarFunction, iPosition:=5, bIncludeArgumentName:=False) + Else + clsBaseOperator.RemoveParameterByName("geom_text") + End If + End Sub + + Private Sub AddRemoveGeomTextTmax() + If rdoClimograph.Checked And ucrChkText.Checked And Not ucrReceiverElement1.IsEmpty Then + clsRoundTmaxFunction.AddParameter("y", ucrReceiverElement1.GetVariableNames(False), iPosition:=0, bIncludeArgumentName:=False) + + If Not ucrReceiverRainC.IsEmpty Then + clsStarOperator.AddParameter("left", ucrReceiverElement1.GetVariableNames(False), iPosition:=1, bIncludeArgumentName:=False) + clsBaseOperator.AddParameter("geom_text1", clsRFunctionParameter:=clsGeomTextTmaxStarFunction, iPosition:=6, bIncludeArgumentName:=False) + Else + clsAesGeomTextTmaxFunction.AddParameter("y", ucrReceiverElement1.GetVariableNames(False), iPosition:=0) + clsBaseOperator.AddParameter("geom_text1", clsRFunctionParameter:=clsGeomTextTmaxFunction, iPosition:=6, bIncludeArgumentName:=False) + End If + Else + clsBaseOperator.RemoveParameterByName("geom_text1") + End If + End Sub + + Private Sub AddRemoveGeomTextTmin() + If rdoClimograph.Checked And ucrChkText.Checked And Not ucrReceiverElement2.IsEmpty Then + clsRoundTminFunction.AddParameter("y", ucrReceiverElement2.GetVariableNames(False), iPosition:=0, bIncludeArgumentName:=False) + + If Not ucrReceiverRainC.IsEmpty Then + clsStar1Operator.AddParameter("left", ucrReceiverElement2.GetVariableNames(False), iPosition:=0, bIncludeArgumentName:=False) + clsBaseOperator.AddParameter("geom_text2", clsRFunctionParameter:=clsGeomTextTminStarFunction, iPosition:=7, bIncludeArgumentName:=False) + Else + clsAesGeomTextTminFunction.AddParameter("y", ucrReceiverElement2.GetVariableNames(False), iPosition:=0) + clsBaseOperator.AddParameter("geom_text2", clsRFunctionParameter:=clsGeomTextTminFunction, iPosition:=7, bIncludeArgumentName:=False) + End If + Else + clsBaseOperator.RemoveParameterByName("geom_text2") + End If + End Sub + + Private Sub AddRemoveGeomRibbon() + If rdoClimograph.Checked And ucrChkRibbon.Checked And ucrChkRibbon.Enabled Then + clsBaseOperator.AddParameter("scale_x_discrete", clsRFunctionParameter:=clsXScalediscreteFunction, iPosition:=12) + + If Not ucrReceiverRainC.IsEmpty Then + clsStar1Operator.AddParameter("left", ucrReceiverElement2.GetVariableNames(False), iPosition:=0, bIncludeArgumentName:=False) + clsStarOperator.AddParameter("left", ucrReceiverElement1.GetVariableNames(False), iPosition:=1, bIncludeArgumentName:=False) + clsBaseOperator.AddParameter("geom_ribbon", clsRFunctionParameter:=clsGeomRibbon1Function, iPosition:=1) + Else + clsAesGeomRibbonFunction.AddParameter("ymin", ucrReceiverElement2.GetVariableNames(False), iPosition:=0) + clsAesGeomRibbonFunction.AddParameter("ymax", ucrReceiverElement1.GetVariableNames(False), iPosition:=1) + clsBaseOperator.AddParameter("geom_ribbon", clsRFunctionParameter:=clsGeomRibbonFunction, iPosition:=1) + End If + Else + clsBaseOperator.RemoveParameterByName("geom_ribbon") + clsBaseOperator.RemoveParameterByName("scale_x_discrete") + End If + End Sub + + Private Sub ucrChkTile_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkTile.ControlValueChanged + AddRemoveGeomBar() + EnableTileAndRibbon() + End Sub + + Private Sub ucrChkRibbon_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkRibbon.ControlValueChanged + AddRemoveGeomRibbon() + EnableTileAndRibbon() + End Sub + + Private Sub AddRemoveGeomLines() + If rdoClimograph.Checked And Not ucrReceiverElement1.IsEmpty Then + clsAesLineStarFunction.AddParameter("x", ucrReceiverMonthC.GetVariableNames(False), iPosition:=0) + + If Not ucrReceiverRainC.IsEmpty Then + clsStarOperator.AddParameter("left", ucrReceiverElement1.GetVariableNames(False), iPosition:=0, bIncludeArgumentName:=False) + clsAesLineStarFunction.AddParameter("y", clsROperatorParameter:=clsStarOperator, iPosition:=1) + Else + clsAesLineStarFunction.AddParameter("y", ucrReceiverElement1.GetVariableNames(False), iPosition:=0) + End If + + clsBaseOperator.AddParameter("geom_line", clsRFunctionParameter:=clsGeomLineStarFunction, iPosition:=4) + Else + clsBaseOperator.RemoveParameterByName("geom_line") + End If + End Sub + + Private Sub AddRemoveGeomLine1() + If rdoClimograph.Checked And Not ucrReceiverElement2.IsEmpty Then + clsAesLineStar1Function.AddParameter("x", ucrReceiverMonthC.GetVariableNames(False), iPosition:=0) + + If Not ucrReceiverRainC.IsEmpty Then + clsStar1Operator.AddParameter("left", ucrReceiverElement2.GetVariableNames(False), iPosition:=0, bIncludeArgumentName:=False) + clsAesLineStar1Function.AddParameter("y", clsROperatorParameter:=clsStar1Operator, iPosition:=1) + Else + clsAesLineStar1Function.AddParameter("y", ucrReceiverElement2.GetVariableNames(False), iPosition:=0) + End If + + clsBaseOperator.AddParameter("geom_line1", clsRFunctionParameter:=clsGeomLineStar1Function, iPosition:=4) + Else + clsBaseOperator.RemoveParameterByName("geom_line1") + End If + End Sub + + Private Sub AddRemoveGeomBar() + ' Handle case when rdoClimograph is not checked or ucrReceiverRainC is empty + If Not rdoClimograph.Checked OrElse ucrReceiverRainC.IsEmpty Then + RemoveAllParameters() + Return + End If + + ' Set common parameters + clsBarAesFunction.AddParameter("y", ucrReceiverRainC.GetVariableNames(False), iPosition:=0) + clsLabFunction.AddParameter("fill", Chr(34) & "Rainfall" & Chr(34), iPosition:=0) + clsBaseOperator.AddParameter("labs", clsRFunctionParameter:=clsLabFunction, iPosition:=13) + + ' Handle geom parameters + If ucrChkTile.Checked Then + clsBarAesFunction.AddParameter("fill", ucrReceiverRainC.GetVariableNames(False), iPosition:=3) + clsBaseOperator.AddParameter("geom_tile", clsRFunctionParameter:=clsGeomTileFunction, iPosition:=1) + clsBaseOperator.AddParameter("geom_bar", clsRFunctionParameter:=clsGeomBarFunction, iPosition:=2) + Else + clsBarAesFunction.AddParameter("fill", ucrReceiverMonthC.GetVariableNames(False), iPosition:=3) + clsBaseOperator.AddParameter("geom_bar", clsRFunctionParameter:=clsGeomBarFunction, iPosition:=2) + clsBaseOperator.RemoveParameterByName("geom_tile") + End If + + ' Handle color parameters + If ucrChkColour.Checked Then + Dim clsAsnumericFunction As New RFunction + clsAsnumericFunction.SetRCommand("as.numeric") + clsAsnumericFunction.AddParameter("x", ucrReceiverMonthC.GetVariableNames(False), iPosition:=0, bIncludeArgumentName:=False) + + clsBaseOperator.RemoveParameterByName("palette") + clsBaseOperator.RemoveParameterByName("scale_fill_brewer") + clsBaseOperator.RemoveParameterByName("scale_fill_distiller") + + If rdoViridis.Checked Then + clsBarAesFunction.AddParameter("fill", clsRFunctionParameter:=clsAsnumericFunction, iPosition:=3) + clsColourPaletteFunction.AddParameter("option", Chr(34) & ucrInputColourPalette.GetText() & Chr(34), iPosition:=0) + clsBaseOperator.AddParameter("palette", clsRFunctionParameter:=clsColourPaletteFunction, iPosition:=6) + ElseIf rdoPalette.Checked AndAlso Not ucrReceiverMonthC.IsEmpty Then + clsBarAesFunction.AddParameter("fill", ucrReceiverMonthC.GetVariableNames(False), iPosition:=3) + If ucrReceiverMonthC.strCurrDataType = "factor" OrElse ucrReceiverMonthC.strCurrDataType = "ordered,factor" Then + clsFillBrewerFunction.AddParameter("palette", Chr(34) & ucrInputPalette.GetText() & Chr(34)) + clsBaseOperator.AddParameter("scale_fill_brewer", clsRFunctionParameter:=clsFillBrewerFunction, iPosition:=6) + Else + clsScalefillDistillerFunction.AddParameter("palette", Chr(34) & ucrInputPalette.GetText() & Chr(34)) + clsBaseOperator.AddParameter("scale_fill_distiller", clsRFunctionParameter:=clsScalefillDistillerFunction, iPosition:=6) + End If + Else + clsBarAesFunction.AddParameter("fill", Chr(34) & "" & Chr(34), iPosition:=3) + End If + Else + clsBaseOperator.RemoveParameterByName("palette") + clsBaseOperator.RemoveParameterByName("scale_fill_brewer") + clsBaseOperator.RemoveParameterByName("scale_fill_distiller") + End If + End Sub + + Private Sub RemoveAllParameters() + clsBarAesFunction.RemoveParameterByName("y") + clsBaseOperator.RemoveParameterByName("geom_tile") + clsBaseOperator.RemoveParameterByName("geom_bar") + clsBaseOperator.RemoveParameterByName("labs") + clsBaseOperator.RemoveParameterByName("palette") + clsBaseOperator.RemoveParameterByName("scale_fill_brewer") + clsBaseOperator.RemoveParameterByName("scale_fill_distiller") + End Sub + + Private Sub EnableTileAndRibbon() + ucrChkRibbon.Enabled = (Not ucrReceiverElement1.IsEmpty AndAlso Not ucrReceiverElement2.IsEmpty) AndAlso Not ucrChkTile.Checked + ucrChkTile.Enabled = Not ucrChkRibbon.Checked AndAlso Not ucrReceiverRainC.IsEmpty + End Sub + + Private Sub AddRemoveSecondaryAxis() + If Not rdoClimograph.Checked Then + clsBaseOperator.RemoveParameterByName("scale_y_continuous") + Return + End If + + ' Add the scale_y_continuous parameter + clsBaseOperator.AddParameter("scale_y_continuous", clsRFunctionParameter:=clsScaleycontinuousFunction, iPosition:=9) + + ' Set the "name" parameter based on ucrReceiverRainC + Dim name As String + Dim secondaryAxisFunction As RFunction + + If Not ucrReceiverRainC.IsEmpty Then + name = "Rainfall (mm)" + secondaryAxisFunction = If(Not ucrReceiverElement1.IsEmpty OrElse Not ucrReceiverElement2.IsEmpty, clsSecondaryAxis2Function, clsSecondaryAxisFunction) + Else + name = "Temperature (c)" + secondaryAxisFunction = clsSecondaryAxis1Function + End If + + ' Add parameters to clsScaleycontinuousFunction + clsScaleycontinuousFunction.AddParameter("name", Chr(34) & name & Chr(34), iPosition:=0) + clsScaleycontinuousFunction.AddParameter("sec.axis", clsRFunctionParameter:=secondaryAxisFunction, iPosition:=1) + End Sub + + Private Sub ucrReceiverElement2_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverElement2.ControlValueChanged + AddRemoveSecondaryAxis() + AddRemoveGeomLine1() + AddRemoveGeomRibbon() + AddRemoveGeomTextTmin() + EnableTileAndRibbon() + AddRemoveTemBars() + End Sub + + Private Sub ucrReceiverRainC_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverRainC.ControlValueChanged + AddRemoveSecondaryAxis() + AddRemoveGeomBar() + AddRemoveGeomTextBar() + EnableTileAndRibbon() + AddRemoveGeomLines() + AddRemoveGeomLine1() + AddRemoveGeomRibbon() + AddRemoveGeomTextTmin() + AddRemoveGeomTextTmax() + End Sub + + Private Sub ucrReceiverMonthC_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverMonthC.ControlValueChanged + If Not ucrReceiverMonthC.IsEmpty Then + clsBarAesFunction.AddParameter("x", ucrReceiverMonthC.GetVariableNames(False), iPosition:=1) + Else + clsBarAesFunction.AddParameter("x", Chr(34) & "" & Chr(34), iPosition:=1) + End If + AddRemoveGeomRibbon() + AddRemoveGeomBar() + AddRemoveGeomLines() + AddRemoveGeomLine1() + End Sub + + Private Sub ucrSelectorClimograph_DataFrameChanged() Handles ucrSelectorClimograph.DataFrameChanged + clsGetObjectDataFunction.AddParameter("data_name", Chr(34) & ucrSelectorClimograph.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) + AddRemoveGeomRibbon() + Dataframechange() + End Sub + + Private Sub Dataframechange() + If rdoWalterLieth.Checked Then + clsGgwalterliethFunction.AddParameter("data", ucrSelectorClimograph.ucrAvailableDataFrames.cboAvailableDataFrames.Text, iPosition:=0) + Else + clsBaseOperator.RemoveParameterByName("ggwalter_lieth") + End If + End Sub + + Private Sub toolStripMenuItemBarchartOptions_Click(sender As Object, e As EventArgs) Handles toolStripMenuItemBarchartOptions.Click + openSdgLayerOptions(clsGeomBarFunction) + End Sub + + Private Sub toolStripMenuItemTminLineOptions_Click(sender As Object, e As EventArgs) Handles toolStripMenuItemTminLineOptions.Click + openSdgLayerOptionstmin(clsGeomLineStar1Function, clsAesLineStar1Function) + clsAesLineStar1Function.AddParameter("group", "1", iPosition:=2) + AddRemoveGeomLine1() + End Sub + + Private Sub toolStripMenuItemTmaxLineOptions_Click(sender As Object, e As EventArgs) Handles toolStripMenuItemTmaxLineOptions.Click + openSdgLayerOptionstmax(clsGeomLineStarFunction, clsAesLineStarFunction) + clsAesLineStarFunction.AddParameter("group", "1", iPosition:=2) + AddRemoveGeomLines() + End Sub + + Private Sub ucrChkText_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkText.ControlValueChanged + AddRemoveGeomTextBar() + AddRemoveGeomTextTmax() + AddRemoveGeomTextTmin() + End Sub + + Private Sub AddRemoveTemBars() + If rdoClimateBars.Checked Then + clsBaseOperator.RemoveParameterByName("geom_text") + clsBaseOperator.RemoveParameterByName("geom_text1") + clsBaseOperator.RemoveParameterByName("geom_tile") + clsBaseOperator.RemoveParameterByName("geom_bar") + clsBaseOperator.RemoveParameterByName("labs") + clsBaseOperator.RemoveParameterByName("palette") + clsBaseOperator.RemoveParameterByName("scale_fill_brewer") + clsBaseOperator.RemoveParameterByName("scale_fill_distiller") + clsBaseOperator.RemoveParameterByName("geom_line1") + clsBaseOperator.RemoveParameterByName("geom_line") + clsBaseOperator.RemoveParameterByName("geom_text2") + clsBaseOperator.RemoveParameterByName("geom_ribbon") + clsBaseOperator.RemoveParameterByName("scale_x_discrete") + clsBaseOperator.RemoveParameterByName("scale_y_continuous") + clsBaseOperator.RemoveParameterByName("facets") + clsBaseOperator.RemoveParameterByName("facets1") + If Not ucrReceiverFacet.IsEmpty Then + clsAesRainGgplotFunction.AddParameter("x", ucrReceiverMonthBar.GetVariableNames(False), iPosition:=0) + clsAesRainGgplotFunction.AddParameter("y", ucrReceiverRainBar.GetVariableNames(False), iPosition:=1) + clsRainGgplotFunction.AddParameter("data", ucrSelectorClimograph.ucrAvailableDataFrames.cboAvailableDataFrames.Text, iPosition:=0) + clsRainGgplotFunction.AddParameter("mapping", clsRFunctionParameter:=clsAesRainGgplotFunction, iPosition:=1, bIncludeArgumentName:=False) + + clsRainRoundFunction.AddParameter("x", ucrReceiverRainBar.GetVariableNames(False), iPosition:=0, bIncludeArgumentName:=False) + clsAesRainBarTextFunction.AddParameter("label", clsRFunctionParameter:=clsRainRoundFunction, iPosition:=0) + clsRainBarTextFunction.AddParameter("mapping", clsRFunctionParameter:=clsAesRainBarTextFunction, iPosition:=0, bIncludeArgumentName:=False) + + clsPlus10Operator.AddParameter("left", clsRFunctionParameter:=clsLabsRainFunction, iPosition:=0, bIncludeArgumentName:=False) + clsPlus10Operator.AddParameter("right", clsRFunctionParameter:=clsFacetFunction1, iPosition:=1, bIncludeArgumentName:=False) + clsPlus3Operator.AddParameter("left", clsRFunctionParameter:=clsRainBarTextFunction, iPosition:=0, bIncludeArgumentName:=False) + clsPlus3Operator.AddParameter("right", clsROperatorParameter:=clsPlus10Operator, iPosition:=1, bIncludeArgumentName:=False) + clsPlus2Operator.AddParameter("left", clsRFunctionParameter:=clsRainBarFunction, iPosition:=0, bIncludeArgumentName:=False) + clsPlus2Operator.AddParameter("right", clsROperatorParameter:=clsPlus3Operator, iPosition:=1, bIncludeArgumentName:=False) + clsPlus1Operator.AddParameter("left", clsRFunctionParameter:=clsRainGgplotFunction, iPosition:=0, bIncludeArgumentName:=False) + clsPlus1Operator.AddParameter("right", clsROperatorParameter:=clsPlus2Operator, iPosition:=1, bIncludeArgumentName:=False) + + clsAesTemGgplotFunction.AddParameter("x", ucrReceiverMonthBar.GetVariableNames(False), iPosition:=0) + clsTemGgplotFunction.AddParameter("data", ucrSelectorClimograph.ucrAvailableDataFrames.cboAvailableDataFrames.Text, iPosition:=0) + clsTemGgplotFunction.AddParameter("mapping", clsRFunctionParameter:=clsAesTemGgplotFunction, iPosition:=1, bIncludeArgumentName:=False) + + clsAesTmaxBarFunction1.AddParameter("y", ucrReceiverElement1Bar.GetVariableNames(False), iPosition:=0) + clsTmaxBarFunction.AddParameter("mapping", clsRFunctionParameter:=clsAesTmaxBarFunction1, iPosition:=0, bIncludeArgumentName:=False) + + clsAesTminBarFunction1.AddParameter("y", "-" & ucrReceiverElement2Bar.GetVariableNames(False), iPosition:=0) + clsTminBarFunction.AddParameter("mapping", clsRFunctionParameter:=clsAesTminBarFunction1, iPosition:=0, bIncludeArgumentName:=False) + + clsTmaxRoundFunction.AddParameter("x", ucrReceiverElement1Bar.GetVariableNames(False), iPosition:=0, bIncludeArgumentName:=False) + clsAesTmaxBarTextFunction.AddParameter("y", ucrReceiverElement1Bar.GetVariableNames(False), iPosition:=0) + clsAesTmaxBarTextFunction.AddParameter("label", clsRFunctionParameter:=clsTmaxRoundFunction, iPosition:=1) + clsTmaxBarTextFunction.AddParameter("mapping", clsRFunctionParameter:=clsAesTmaxBarTextFunction, iPosition:=0, bIncludeArgumentName:=False) + + clsTminRoundFunction.AddParameter("x", ucrReceiverElement2Bar.GetVariableNames(False), iPosition:=0, bIncludeArgumentName:=False) + clsAesTminBarTextFunction.AddParameter("y", "-" & ucrReceiverElement2Bar.GetVariableNames(False), iPosition:=0) + clsAesTminBarTextFunction.AddParameter("label", clsRFunctionParameter:=clsTminRoundFunction, iPosition:=1) + clsTminBarTextFunction.AddParameter("mapping", clsRFunctionParameter:=clsAesTminBarTextFunction, iPosition:=0, bIncludeArgumentName:=False) + + clsPlus11Operator.AddParameter("left", clsRFunctionParameter:=clsLabsTempFunction, iPosition:=0, bIncludeArgumentName:=False) + clsPlus11Operator.AddParameter("right", clsRFunctionParameter:=clsFacetFunction1, iPosition:=1, bIncludeArgumentName:=False) + clsPlus9Operator.AddParameter("left", clsRFunctionParameter:=clsTminBarTextFunction, iPosition:=0, bIncludeArgumentName:=False) + clsPlus9Operator.AddParameter("right", clsROperatorParameter:=clsPlus11Operator, iPosition:=1, bIncludeArgumentName:=False) + clsPlus8Operator.AddParameter("left", clsRFunctionParameter:=clsTmaxBarTextFunction, iPosition:=0, bIncludeArgumentName:=False) + clsPlus8Operator.AddParameter("right", clsROperatorParameter:=clsPlus9Operator, iPosition:=1, bIncludeArgumentName:=False) + clsPlus7Operator.AddParameter("left", clsRFunctionParameter:=clsTminBarFunction, iPosition:=0, bIncludeArgumentName:=False) + clsPlus7Operator.AddParameter("right", clsROperatorParameter:=clsPlus8Operator, iPosition:=1, bIncludeArgumentName:=False) + clsPlus6Operator.AddParameter("left", clsRFunctionParameter:=clsTmaxBarFunction, iPosition:=0, bIncludeArgumentName:=False) + clsPlus6Operator.AddParameter("right", clsROperatorParameter:=clsPlus7Operator, iPosition:=1, bIncludeArgumentName:=False) + clsPlus5Operator.AddParameter("left", clsRFunctionParameter:=clsTemGgplotFunction, iPosition:=0, bIncludeArgumentName:=False) + clsPlus5Operator.AddParameter("right", clsROperatorParameter:=clsPlus6Operator, iPosition:=1, bIncludeArgumentName:=False) + clsBaseOperator.AddParameter("plot_grid", clsRFunctionParameter:=clsPlotGridFunction, iPosition:=0) + + Else + clsAesRainGgplotFunction.AddParameter("x", ucrReceiverMonthBar.GetVariableNames(False), iPosition:=0) + clsAesRainGgplotFunction.AddParameter("y", ucrReceiverRainBar.GetVariableNames(False), iPosition:=1) + clsRainGgplotFunction.AddParameter("data", ucrSelectorClimograph.ucrAvailableDataFrames.cboAvailableDataFrames.Text, iPosition:=0) + clsRainGgplotFunction.AddParameter("mapping", clsRFunctionParameter:=clsAesRainGgplotFunction, iPosition:=1, bIncludeArgumentName:=False) + clsRainRoundFunction.AddParameter("x", ucrReceiverRainBar.GetVariableNames(False), iPosition:=0, bIncludeArgumentName:=False) + clsAesRainBarTextFunction.AddParameter("label", clsRFunctionParameter:=clsRainRoundFunction, iPosition:=0) + clsRainBarTextFunction.AddParameter("mapping", clsRFunctionParameter:=clsAesRainBarTextFunction, iPosition:=0, bIncludeArgumentName:=False) + clsPlus3Operator.AddParameter("left", clsRFunctionParameter:=clsRainBarTextFunction, iPosition:=0, bIncludeArgumentName:=False) + clsPlus3Operator.AddParameter("right", clsRFunctionParameter:=clsLabsRainFunction, iPosition:=1, bIncludeArgumentName:=False) + clsPlus2Operator.AddParameter("left", clsRFunctionParameter:=clsRainBarFunction, iPosition:=0, bIncludeArgumentName:=False) + clsPlus2Operator.AddParameter("right", clsROperatorParameter:=clsPlus3Operator, iPosition:=1, bIncludeArgumentName:=False) + clsPlus1Operator.AddParameter("left", clsRFunctionParameter:=clsRainGgplotFunction, iPosition:=0, bIncludeArgumentName:=False) + clsPlus1Operator.AddParameter("right", clsROperatorParameter:=clsPlus2Operator, iPosition:=1, bIncludeArgumentName:=False) + + clsAesTemGgplotFunction.AddParameter("x", ucrReceiverMonthBar.GetVariableNames(False), iPosition:=0) + clsTemGgplotFunction.AddParameter("data", ucrSelectorClimograph.ucrAvailableDataFrames.cboAvailableDataFrames.Text, iPosition:=0) + clsTemGgplotFunction.AddParameter("mapping", clsRFunctionParameter:=clsAesTemGgplotFunction, iPosition:=1, bIncludeArgumentName:=False) + + clsAesTmaxBarFunction1.AddParameter("y", ucrReceiverElement1Bar.GetVariableNames(False), iPosition:=0) + clsTmaxBarFunction.AddParameter("mapping", clsRFunctionParameter:=clsAesTmaxBarFunction1, iPosition:=0, bIncludeArgumentName:=False) + + clsAesTminBarFunction1.AddParameter("y", "-" & ucrReceiverElement2Bar.GetVariableNames(False), iPosition:=0) + clsTminBarFunction.AddParameter("mapping", clsRFunctionParameter:=clsAesTminBarFunction1, iPosition:=0, bIncludeArgumentName:=False) + + clsTmaxRoundFunction.AddParameter("x", ucrReceiverElement1Bar.GetVariableNames(False), iPosition:=0, bIncludeArgumentName:=False) + clsAesTmaxBarTextFunction.AddParameter("y", ucrReceiverElement1Bar.GetVariableNames(False), iPosition:=0) + clsAesTmaxBarTextFunction.AddParameter("label", clsRFunctionParameter:=clsTmaxRoundFunction, iPosition:=1) + clsTmaxBarTextFunction.AddParameter("mapping", clsRFunctionParameter:=clsAesTmaxBarTextFunction, iPosition:=0, bIncludeArgumentName:=False) + + clsTminRoundFunction.AddParameter("x", ucrReceiverElement2Bar.GetVariableNames(False), iPosition:=0, bIncludeArgumentName:=False) + clsAesTminBarTextFunction.AddParameter("y", "-" & ucrReceiverElement2Bar.GetVariableNames(False), iPosition:=0) + clsAesTminBarTextFunction.AddParameter("label", clsRFunctionParameter:=clsTminRoundFunction, iPosition:=1) + clsTminBarTextFunction.AddParameter("mapping", clsRFunctionParameter:=clsAesTminBarTextFunction, iPosition:=0, bIncludeArgumentName:=False) + clsPlus9Operator.AddParameter("left", clsRFunctionParameter:=clsTminBarTextFunction, iPosition:=0, bIncludeArgumentName:=False) + clsPlus9Operator.AddParameter("right", clsRFunctionParameter:=clsLabsTempFunction, iPosition:=1, bIncludeArgumentName:=False) + clsPlus8Operator.AddParameter("left", clsRFunctionParameter:=clsTmaxBarTextFunction, iPosition:=0, bIncludeArgumentName:=False) + clsPlus8Operator.AddParameter("right", clsROperatorParameter:=clsPlus9Operator, iPosition:=1, bIncludeArgumentName:=False) + clsPlus7Operator.AddParameter("left", clsRFunctionParameter:=clsTminBarFunction, iPosition:=0, bIncludeArgumentName:=False) + clsPlus7Operator.AddParameter("right", clsROperatorParameter:=clsPlus8Operator, iPosition:=1, bIncludeArgumentName:=False) + clsPlus6Operator.AddParameter("left", clsRFunctionParameter:=clsTmaxBarFunction, iPosition:=0, bIncludeArgumentName:=False) + clsPlus6Operator.AddParameter("right", clsROperatorParameter:=clsPlus7Operator, iPosition:=1, bIncludeArgumentName:=False) + clsPlus5Operator.AddParameter("left", clsRFunctionParameter:=clsTemGgplotFunction, iPosition:=0, bIncludeArgumentName:=False) + clsPlus5Operator.AddParameter("right", clsROperatorParameter:=clsPlus6Operator, iPosition:=1, bIncludeArgumentName:=False) + clsBaseOperator.AddParameter("plot_grid", clsRFunctionParameter:=clsPlotGridFunction, iPosition:=0) + End If + Else + clsBaseOperator.RemoveParameterByName("plot_grid") + End If + End Sub + + Private Sub ucrSave_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSave.ControlValueChanged + If ucrSave.ucrChkSave.Checked Then + clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & ucrSave.GetText & Chr(34), iPosition:=1) + Else + clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & "last_graph" & Chr(34), iPosition:=1) + End If + End Sub + + Private Sub ucrPnlColour_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlColour.ControlValueChanged, ucrChkColour.ControlValueChanged, ucrInputPalette.ControlValueChanged, ucrInputColourPalette.ControlValueChanged + AddRemoveGeomBar() + End Sub + + Private Sub ResizeDialogue() + If rdoClimograph.Checked Then + Me.Size = New Size(488, 617) + Me.ucrSave.Location = New Point(14, 493) + Me.ucrBase.Location = New Point(12, 520) + Else + Me.Size = New Size(488, 417) + Me.ucrSave.Location = New Point(14, 293) + Me.ucrBase.Location = New Point(12, 320) + End If + End Sub + + Private Sub AllControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrPnlClimograph.ControlContentsChanged, ucrReceiverRain.ControlContentsChanged, ucrReceiverAbsolute.ControlContentsChanged, ucrReceiverMonth.ControlContentsChanged, ucrReceiverMaxtem.ControlContentsChanged, ucrReceiverMintemp.ControlContentsChanged, ucrSave.ControlContentsChanged, ucrReceiverElement1.ControlContentsChanged, ucrReceiverElement2.ControlContentsChanged, ucrReceiverMonthC.ControlContentsChanged, ucrReceiverRainC.ControlContentsChanged, ucrReceiverElement1Bar.ControlContentsChanged, ucrReceiverElement2Bar.ControlContentsChanged, ucrReceiverMonthBar.ControlContentsChanged, ucrReceiverRainBar.ControlContentsChanged TestOKEnabled() End Sub + + Private Sub ucrReceiverElement1Bar_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverElement1Bar.ControlValueChanged, ucrReceiverMonthBar.ControlValueChanged, ucrReceiverRainBar.ControlValueChanged, ucrReceiverElement2Bar.ControlValueChanged + AddRemoveTemBars() + End Sub End Class \ No newline at end of file diff --git a/instat/dlgColumnStats.vb b/instat/dlgColumnStats.vb index 05a549e559e..2ea3642cb84 100644 --- a/instat/dlgColumnStats.vb +++ b/instat/dlgColumnStats.vb @@ -113,7 +113,6 @@ Public Class dlgColumnStats clsSummariesList.SetRCommand("c") clsSummariesList.AddParameter("summary_count_non_missing", Chr(34) & "summary_count_non_missing" & Chr(34), bIncludeArgumentName:=False, iPosition:=1) - clsSummariesList.AddParameter("summary_count", Chr(34) & "summary_count" & Chr(34), bIncludeArgumentName:=False, iPosition:=3) clsSummariesList.AddParameter("summary_sum", Chr(34) & "summary_sum" & Chr(34), bIncludeArgumentName:=False, iPosition:=11) clsDefaultFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$calculate_summary") diff --git a/instat/dlgDescribeTwoVariable.Designer.vb b/instat/dlgDescribeTwoVariable.Designer.vb index e0234ea7e9f..fe9da77487d 100644 --- a/instat/dlgDescribeTwoVariable.Designer.vb +++ b/instat/dlgDescribeTwoVariable.Designer.vb @@ -60,18 +60,18 @@ Partial Class dlgDescribeTwoVariable Me.cmdSummaries = New System.Windows.Forms.Button() Me.lblMarginName = New System.Windows.Forms.Label() Me.grpDisplay = New System.Windows.Forms.GroupBox() - Me.ucrReceiverColumns = New instat.ucrReceiverMultiple() - Me.ucrChkDisplayAsPercentage = New instat.ucrCheck() Me.rdoOCol = New System.Windows.Forms.RadioButton() Me.rdoOCell = New System.Windows.Forms.RadioButton() Me.rdoORow = New System.Windows.Forms.RadioButton() - Me.ucrpnlPercent = New instat.UcrPanel() + Me.ucrReceiverThreeVariableThirdVariable = New instat.ucrReceiverSingle() Me.ucrReceiverPercentages = New instat.ucrReceiverSingle() + Me.ucrpnlPercent = New instat.UcrPanel() Me.ucrReceiverThreeVariableSecondFactor = New instat.ucrReceiverSingle() Me.ucrReceiverSecondTwoVariableFactor = New instat.ucrReceiverSingle() - Me.ucrReceiverThreeVariableThirdVariable = New instat.ucrReceiverSingle() Me.ucrReceiverFirstVars = New instat.ucrReceiverMultiple() Me.ucrSaveTable = New instat.ucrSave() + Me.ucrReceiverColumns = New instat.ucrReceiverMultiple() + Me.ucrChkDisplayAsPercentage = New instat.ucrCheck() Me.ucrInputMarginName = New instat.ucrInputTextBox() Me.ucrReorderSummary = New instat.ucrReorder() Me.ucrBase = New instat.ucrButtons() @@ -79,12 +79,13 @@ Partial Class dlgDescribeTwoVariable Me.ucrSelectorDescribeTwoVar = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrPnlDescribe = New instat.UcrPanel() Me.ucrReceiverSkimrGroupByFactor = New instat.ucrReceiverSingle() + Me.ucrChkDisplayMargins = New instat.ucrCheck() Me.ucrChkSummariesRowCol = New instat.ucrCheck() + Me.ucrChkLevSig = New instat.ucrCheck() + Me.ucrChkTotal = New instat.ucrCheck() Me.ucrChkMeans = New instat.ucrCheck() - Me.ucrChkDisplayMargins = New instat.ucrCheck() - Me.ucrChkSwapXYVar = New instat.ucrCheck() Me.ucrChkCorrelations = New instat.ucrCheck() - Me.ucrChkLevSig = New instat.ucrCheck() + Me.ucrChkSwapXYVar = New instat.ucrCheck() Me.ucrChkOmitMissing = New instat.ucrCheck() Me.grpSummaries.SuspendLayout() Me.grpDisplay.SuspendLayout() @@ -111,7 +112,7 @@ Partial Class dlgDescribeTwoVariable ' Me.cmdFormatTable.Enabled = False Me.cmdFormatTable.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdFormatTable.Location = New System.Drawing.Point(489, 634) + Me.cmdFormatTable.Location = New System.Drawing.Point(489, 645) Me.cmdFormatTable.Margin = New System.Windows.Forms.Padding(4) Me.cmdFormatTable.Name = "cmdFormatTable" Me.cmdFormatTable.Size = New System.Drawing.Size(156, 34) @@ -133,7 +134,7 @@ Partial Class dlgDescribeTwoVariable 'cmdMissingOptions ' Me.cmdMissingOptions.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdMissingOptions.Location = New System.Drawing.Point(539, 439) + Me.cmdMissingOptions.Location = New System.Drawing.Point(538, 440) Me.cmdMissingOptions.Margin = New System.Windows.Forms.Padding(4) Me.cmdMissingOptions.Name = "cmdMissingOptions" Me.cmdMissingOptions.Size = New System.Drawing.Size(158, 34) @@ -325,7 +326,7 @@ Partial Class dlgDescribeTwoVariable 'cmdSummaries ' Me.cmdSummaries.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdSummaries.Location = New System.Drawing.Point(465, 344) + Me.cmdSummaries.Location = New System.Drawing.Point(465, 372) Me.cmdSummaries.Margin = New System.Windows.Forms.Padding(4) Me.cmdSummaries.Name = "cmdSummaries" Me.cmdSummaries.Size = New System.Drawing.Size(180, 34) @@ -349,7 +350,7 @@ Partial Class dlgDescribeTwoVariable ' Me.grpDisplay.Controls.Add(Me.ucrReceiverColumns) Me.grpDisplay.Controls.Add(Me.ucrChkDisplayAsPercentage) - Me.grpDisplay.Location = New System.Drawing.Point(414, 277) + Me.grpDisplay.Location = New System.Drawing.Point(414, 278) Me.grpDisplay.Margin = New System.Windows.Forms.Padding(4) Me.grpDisplay.Name = "grpDisplay" Me.grpDisplay.Padding = New System.Windows.Forms.Padding(4) @@ -358,29 +359,6 @@ Partial Class dlgDescribeTwoVariable Me.grpDisplay.TabStop = False Me.grpDisplay.Text = "Percentages" ' - 'ucrReceiverColumns - ' - Me.ucrReceiverColumns.AutoSize = True - Me.ucrReceiverColumns.frmParent = Me - Me.ucrReceiverColumns.Location = New System.Drawing.Point(19, 92) - Me.ucrReceiverColumns.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverColumns.Name = "ucrReceiverColumns" - Me.ucrReceiverColumns.Selector = Nothing - Me.ucrReceiverColumns.Size = New System.Drawing.Size(180, 121) - Me.ucrReceiverColumns.strNcFilePath = "" - Me.ucrReceiverColumns.TabIndex = 55 - Me.ucrReceiverColumns.ucrSelector = Nothing - ' - 'ucrChkDisplayAsPercentage - ' - Me.ucrChkDisplayAsPercentage.AutoSize = True - Me.ucrChkDisplayAsPercentage.Checked = False - Me.ucrChkDisplayAsPercentage.Location = New System.Drawing.Point(14, 22) - Me.ucrChkDisplayAsPercentage.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) - Me.ucrChkDisplayAsPercentage.Name = "ucrChkDisplayAsPercentage" - Me.ucrChkDisplayAsPercentage.Size = New System.Drawing.Size(171, 34) - Me.ucrChkDisplayAsPercentage.TabIndex = 54 - ' 'rdoOCol ' Me.rdoOCol.AutoSize = True @@ -395,7 +373,7 @@ Partial Class dlgDescribeTwoVariable 'rdoOCell ' Me.rdoOCell.AutoSize = True - Me.rdoOCell.Location = New System.Drawing.Point(612, 335) + Me.rdoOCell.Location = New System.Drawing.Point(612, 334) Me.rdoOCell.Name = "rdoOCell" Me.rdoOCell.Size = New System.Drawing.Size(84, 24) Me.rdoOCell.TabIndex = 41 @@ -406,7 +384,7 @@ Partial Class dlgDescribeTwoVariable 'rdoORow ' Me.rdoORow.AutoSize = True - Me.rdoORow.Location = New System.Drawing.Point(517, 336) + Me.rdoORow.Location = New System.Drawing.Point(518, 336) Me.rdoORow.Name = "rdoORow" Me.rdoORow.Size = New System.Drawing.Size(90, 24) Me.rdoORow.TabIndex = 42 @@ -414,20 +392,24 @@ Partial Class dlgDescribeTwoVariable Me.rdoORow.Text = "Row(%)" Me.rdoORow.UseVisualStyleBackColor = True ' - 'ucrpnlPercent + 'ucrReceiverThreeVariableThirdVariable ' - Me.ucrpnlPercent.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrpnlPercent.Location = New System.Drawing.Point(424, 331) - Me.ucrpnlPercent.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) - Me.ucrpnlPercent.Name = "ucrpnlPercent" - Me.ucrpnlPercent.Size = New System.Drawing.Size(270, 37) - Me.ucrpnlPercent.TabIndex = 43 + Me.ucrReceiverThreeVariableThirdVariable.AutoSize = True + Me.ucrReceiverThreeVariableThirdVariable.frmParent = Me + Me.ucrReceiverThreeVariableThirdVariable.Location = New System.Drawing.Point(465, 314) + Me.ucrReceiverThreeVariableThirdVariable.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverThreeVariableThirdVariable.Name = "ucrReceiverThreeVariableThirdVariable" + Me.ucrReceiverThreeVariableThirdVariable.Selector = Nothing + Me.ucrReceiverThreeVariableThirdVariable.Size = New System.Drawing.Size(180, 30) + Me.ucrReceiverThreeVariableThirdVariable.strNcFilePath = "" + Me.ucrReceiverThreeVariableThirdVariable.TabIndex = 14 + Me.ucrReceiverThreeVariableThirdVariable.ucrSelector = Nothing ' 'ucrReceiverPercentages ' Me.ucrReceiverPercentages.AutoSize = True Me.ucrReceiverPercentages.frmParent = Me - Me.ucrReceiverPercentages.Location = New System.Drawing.Point(431, 369) + Me.ucrReceiverPercentages.Location = New System.Drawing.Point(430, 369) Me.ucrReceiverPercentages.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverPercentages.Name = "ucrReceiverPercentages" Me.ucrReceiverPercentages.Selector = Nothing @@ -436,6 +418,15 @@ Partial Class dlgDescribeTwoVariable Me.ucrReceiverPercentages.TabIndex = 39 Me.ucrReceiverPercentages.ucrSelector = Nothing ' + 'ucrpnlPercent + ' + Me.ucrpnlPercent.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrpnlPercent.Location = New System.Drawing.Point(424, 332) + Me.ucrpnlPercent.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) + Me.ucrpnlPercent.Name = "ucrpnlPercent" + Me.ucrpnlPercent.Size = New System.Drawing.Size(270, 38) + Me.ucrpnlPercent.TabIndex = 43 + ' 'ucrReceiverThreeVariableSecondFactor ' Me.ucrReceiverThreeVariableSecondFactor.AutoSize = True @@ -462,19 +453,6 @@ Partial Class dlgDescribeTwoVariable Me.ucrReceiverSecondTwoVariableFactor.TabIndex = 1 Me.ucrReceiverSecondTwoVariableFactor.ucrSelector = Nothing ' - 'ucrReceiverThreeVariableThirdVariable - ' - Me.ucrReceiverThreeVariableThirdVariable.AutoSize = True - Me.ucrReceiverThreeVariableThirdVariable.frmParent = Me - Me.ucrReceiverThreeVariableThirdVariable.Location = New System.Drawing.Point(465, 306) - Me.ucrReceiverThreeVariableThirdVariable.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverThreeVariableThirdVariable.Name = "ucrReceiverThreeVariableThirdVariable" - Me.ucrReceiverThreeVariableThirdVariable.Selector = Nothing - Me.ucrReceiverThreeVariableThirdVariable.Size = New System.Drawing.Size(180, 30) - Me.ucrReceiverThreeVariableThirdVariable.strNcFilePath = "" - Me.ucrReceiverThreeVariableThirdVariable.TabIndex = 14 - Me.ucrReceiverThreeVariableThirdVariable.ucrSelector = Nothing - ' 'ucrReceiverFirstVars ' Me.ucrReceiverFirstVars.AutoSize = True @@ -497,6 +475,29 @@ Partial Class dlgDescribeTwoVariable Me.ucrSaveTable.Size = New System.Drawing.Size(459, 36) Me.ucrSaveTable.TabIndex = 24 ' + 'ucrReceiverColumns + ' + Me.ucrReceiverColumns.AutoSize = True + Me.ucrReceiverColumns.frmParent = Nothing + Me.ucrReceiverColumns.Location = New System.Drawing.Point(20, 92) + Me.ucrReceiverColumns.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverColumns.Name = "ucrReceiverColumns" + Me.ucrReceiverColumns.Selector = Nothing + Me.ucrReceiverColumns.Size = New System.Drawing.Size(180, 122) + Me.ucrReceiverColumns.strNcFilePath = "" + Me.ucrReceiverColumns.TabIndex = 55 + Me.ucrReceiverColumns.ucrSelector = Nothing + ' + 'ucrChkDisplayAsPercentage + ' + Me.ucrChkDisplayAsPercentage.AutoSize = True + Me.ucrChkDisplayAsPercentage.Checked = False + Me.ucrChkDisplayAsPercentage.Location = New System.Drawing.Point(14, 22) + Me.ucrChkDisplayAsPercentage.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) + Me.ucrChkDisplayAsPercentage.Name = "ucrChkDisplayAsPercentage" + Me.ucrChkDisplayAsPercentage.Size = New System.Drawing.Size(171, 51) + Me.ucrChkDisplayAsPercentage.TabIndex = 54 + ' 'ucrInputMarginName ' Me.ucrInputMarginName.AddQuotesIfUnrecognised = True @@ -511,7 +512,7 @@ Partial Class dlgDescribeTwoVariable ' 'ucrReorderSummary ' - Me.ucrReorderSummary.Location = New System.Drawing.Point(412, 387) + Me.ucrReorderSummary.Location = New System.Drawing.Point(412, 409) Me.ucrReorderSummary.Margin = New System.Windows.Forms.Padding(9) Me.ucrReorderSummary.Name = "ucrReorderSummary" Me.ucrReorderSummary.Size = New System.Drawing.Size(291, 234) @@ -576,71 +577,81 @@ Partial Class dlgDescribeTwoVariable Me.ucrReceiverSkimrGroupByFactor.TabIndex = 2 Me.ucrReceiverSkimrGroupByFactor.ucrSelector = Nothing ' + 'ucrChkDisplayMargins + ' + Me.ucrChkDisplayMargins.AutoSize = True + Me.ucrChkDisplayMargins.Checked = False + Me.ucrChkDisplayMargins.Location = New System.Drawing.Point(26, 444) + Me.ucrChkDisplayMargins.Margin = New System.Windows.Forms.Padding(9) + Me.ucrChkDisplayMargins.Name = "ucrChkDisplayMargins" + Me.ucrChkDisplayMargins.Size = New System.Drawing.Size(214, 34) + Me.ucrChkDisplayMargins.TabIndex = 18 + ' 'ucrChkSummariesRowCol ' Me.ucrChkSummariesRowCol.AutoSize = True Me.ucrChkSummariesRowCol.Checked = False - Me.ucrChkSummariesRowCol.Location = New System.Drawing.Point(22, 506) + Me.ucrChkSummariesRowCol.Location = New System.Drawing.Point(22, 507) Me.ucrChkSummariesRowCol.Margin = New System.Windows.Forms.Padding(9) Me.ucrChkSummariesRowCol.Name = "ucrChkSummariesRowCol" Me.ucrChkSummariesRowCol.Size = New System.Drawing.Size(270, 34) Me.ucrChkSummariesRowCol.TabIndex = 20 ' + 'ucrChkLevSig + ' + Me.ucrChkLevSig.AutoSize = True + Me.ucrChkLevSig.Checked = False + Me.ucrChkLevSig.Location = New System.Drawing.Point(596, 279) + Me.ucrChkLevSig.Margin = New System.Windows.Forms.Padding(9) + Me.ucrChkLevSig.Name = "ucrChkLevSig" + Me.ucrChkLevSig.Size = New System.Drawing.Size(129, 34) + Me.ucrChkLevSig.TabIndex = 38 + ' + 'ucrChkTotal + ' + Me.ucrChkTotal.AutoSize = True + Me.ucrChkTotal.Checked = False + Me.ucrChkTotal.Location = New System.Drawing.Point(465, 279) + Me.ucrChkTotal.Margin = New System.Windows.Forms.Padding(9) + Me.ucrChkTotal.Name = "ucrChkTotal" + Me.ucrChkTotal.Size = New System.Drawing.Size(146, 34) + Me.ucrChkTotal.TabIndex = 44 + ' 'ucrChkMeans ' Me.ucrChkMeans.AutoSize = True Me.ucrChkMeans.Checked = False - Me.ucrChkMeans.Location = New System.Drawing.Point(450, 278) + Me.ucrChkMeans.Location = New System.Drawing.Point(465, 312) Me.ucrChkMeans.Margin = New System.Windows.Forms.Padding(9) Me.ucrChkMeans.Name = "ucrChkMeans" - Me.ucrChkMeans.Size = New System.Drawing.Size(145, 34) + Me.ucrChkMeans.Size = New System.Drawing.Size(146, 34) Me.ucrChkMeans.TabIndex = 37 ' - 'ucrChkDisplayMargins + 'ucrChkCorrelations ' - Me.ucrChkDisplayMargins.AutoSize = True - Me.ucrChkDisplayMargins.Checked = False - Me.ucrChkDisplayMargins.Location = New System.Drawing.Point(26, 444) - Me.ucrChkDisplayMargins.Margin = New System.Windows.Forms.Padding(9) - Me.ucrChkDisplayMargins.Name = "ucrChkDisplayMargins" - Me.ucrChkDisplayMargins.Size = New System.Drawing.Size(214, 34) - Me.ucrChkDisplayMargins.TabIndex = 18 + Me.ucrChkCorrelations.AutoSize = True + Me.ucrChkCorrelations.Checked = False + Me.ucrChkCorrelations.Location = New System.Drawing.Point(465, 381) + Me.ucrChkCorrelations.Margin = New System.Windows.Forms.Padding(9) + Me.ucrChkCorrelations.Name = "ucrChkCorrelations" + Me.ucrChkCorrelations.Size = New System.Drawing.Size(224, 34) + Me.ucrChkCorrelations.TabIndex = 35 ' 'ucrChkSwapXYVar ' Me.ucrChkSwapXYVar.AutoSize = True Me.ucrChkSwapXYVar.Checked = False - Me.ucrChkSwapXYVar.Location = New System.Drawing.Point(450, 309) + Me.ucrChkSwapXYVar.Location = New System.Drawing.Point(465, 347) Me.ucrChkSwapXYVar.Margin = New System.Windows.Forms.Padding(9) Me.ucrChkSwapXYVar.Name = "ucrChkSwapXYVar" Me.ucrChkSwapXYVar.Size = New System.Drawing.Size(236, 34) Me.ucrChkSwapXYVar.TabIndex = 36 ' - 'ucrChkCorrelations - ' - Me.ucrChkCorrelations.AutoSize = True - Me.ucrChkCorrelations.Checked = False - Me.ucrChkCorrelations.Location = New System.Drawing.Point(450, 344) - Me.ucrChkCorrelations.Margin = New System.Windows.Forms.Padding(9) - Me.ucrChkCorrelations.Name = "ucrChkCorrelations" - Me.ucrChkCorrelations.Size = New System.Drawing.Size(223, 34) - Me.ucrChkCorrelations.TabIndex = 35 - ' - 'ucrChkLevSig - ' - Me.ucrChkLevSig.AutoSize = True - Me.ucrChkLevSig.Checked = False - Me.ucrChkLevSig.Location = New System.Drawing.Point(595, 278) - Me.ucrChkLevSig.Margin = New System.Windows.Forms.Padding(9) - Me.ucrChkLevSig.Name = "ucrChkLevSig" - Me.ucrChkLevSig.Size = New System.Drawing.Size(129, 34) - Me.ucrChkLevSig.TabIndex = 38 - ' 'ucrChkOmitMissing ' Me.ucrChkOmitMissing.AutoSize = True Me.ucrChkOmitMissing.Checked = False - Me.ucrChkOmitMissing.Location = New System.Drawing.Point(450, 383) + Me.ucrChkOmitMissing.Location = New System.Drawing.Point(465, 416) Me.ucrChkOmitMissing.Margin = New System.Windows.Forms.Padding(9) Me.ucrChkOmitMissing.Name = "ucrChkOmitMissing" Me.ucrChkOmitMissing.Size = New System.Drawing.Size(214, 34) @@ -651,7 +662,9 @@ Partial Class dlgDescribeTwoVariable Me.AutoScaleDimensions = New System.Drawing.SizeF(144.0!, 144.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ClientSize = New System.Drawing.Size(723, 748) + Me.ClientSize = New System.Drawing.Size(723, 700) + Me.Controls.Add(Me.cmdSummaries) + Me.Controls.Add(Me.ucrReceiverThreeVariableThirdVariable) Me.Controls.Add(Me.ucrReceiverPercentages) Me.Controls.Add(Me.rdoORow) Me.Controls.Add(Me.rdoOCell) @@ -663,7 +676,6 @@ Partial Class dlgDescribeTwoVariable Me.Controls.Add(Me.ucrSaveTable) Me.Controls.Add(Me.grpDisplay) Me.Controls.Add(Me.ucrInputMarginName) - Me.Controls.Add(Me.cmdSummaries) Me.Controls.Add(Me.ucrReorderSummary) Me.Controls.Add(Me.lblMarginName) Me.Controls.Add(Me.cmdFormatTable) @@ -677,20 +689,20 @@ Partial Class dlgDescribeTwoVariable Me.Controls.Add(Me.rdoSkim) Me.Controls.Add(Me.ucrPnlDescribe) Me.Controls.Add(Me.ucrReceiverSkimrGroupByFactor) - Me.Controls.Add(Me.lblThirdVariable) Me.Controls.Add(Me.lblSecondGroupByFactor) Me.Controls.Add(Me.lbSecondVariable) Me.Controls.Add(Me.lblFirstGroupByFactor) Me.Controls.Add(Me.lblThreeVariableSecondFactor) - Me.Controls.Add(Me.ucrChkSummariesRowCol) - Me.Controls.Add(Me.ucrChkMeans) Me.Controls.Add(Me.ucrChkDisplayMargins) - Me.Controls.Add(Me.ucrChkSwapXYVar) - Me.Controls.Add(Me.ucrChkCorrelations) + Me.Controls.Add(Me.cmdMissingOptions) + Me.Controls.Add(Me.ucrChkSummariesRowCol) + Me.Controls.Add(Me.lblThirdVariable) Me.Controls.Add(Me.ucrChkLevSig) + Me.Controls.Add(Me.ucrChkTotal) + Me.Controls.Add(Me.ucrChkCorrelations) + Me.Controls.Add(Me.ucrChkSwapXYVar) + Me.Controls.Add(Me.ucrChkMeans) Me.Controls.Add(Me.ucrChkOmitMissing) - Me.Controls.Add(Me.cmdMissingOptions) - Me.Controls.Add(Me.ucrReceiverThreeVariableThirdVariable) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.Margin = New System.Windows.Forms.Padding(4) Me.MaximizeBox = False @@ -755,4 +767,5 @@ Partial Class dlgDescribeTwoVariable Friend WithEvents rdoOCol As RadioButton Friend WithEvents ucrpnlPercent As UcrPanel Friend WithEvents ucrReceiverColumns As ucrReceiverMultiple + Friend WithEvents ucrChkTotal As ucrCheck End Class diff --git a/instat/dlgDescribeTwoVariable.vb b/instat/dlgDescribeTwoVariable.vb index 5d42d1e4ae1..7c0bf0f82d2 100644 --- a/instat/dlgDescribeTwoVariable.vb +++ b/instat/dlgDescribeTwoVariable.vb @@ -153,7 +153,7 @@ Public Class dlgDescribeTwoVariable ucrChkCorrelations.AddParameterValuesCondition(True, "corr", "True") ucrChkCorrelations.AddParameterValuesCondition(False, "corr", "False") - ucrChkMeans.SetText("Means") + ucrChkMeans.SetText("Means/Model") ucrChkMeans.SetParameter(New RParameter("means", 5)) ucrChkMeans.SetValuesCheckedAndUnchecked("TRUE", "FALSE") ucrChkMeans.SetRDefault("FALSE") @@ -163,6 +163,11 @@ Public Class dlgDescribeTwoVariable ucrChkLevSig.SetValuesCheckedAndUnchecked("TRUE", "FALSE") ucrChkLevSig.SetRDefault("FALSE") + ucrChkTotal.SetText("Total") + ucrChkTotal.SetParameter(New RParameter("total", 5)) + ucrChkTotal.SetValuesCheckedAndUnchecked("TRUE", "FALSE") + ucrChkTotal.SetRDefault("FALSE") + ucrChkSwapXYVar.SetText("Swap First/Second Variables") ucrChkSwapXYVar.AddParameterValuesCondition(True, "var", "True") ucrChkSwapXYVar.AddParameterValuesCondition(False, "var", "False") @@ -174,8 +179,6 @@ Public Class dlgDescribeTwoVariable ucrPnlDescribe.AddParameterValuesCondition(rdoSkim, "checked", "skim") ucrPnlDescribe.AddParameterValuesCondition(rdoThreeVariable, "checked", "three_variable") - rdoThreeVariable.Enabled = False - ucrpnlPercent.AddRadioButton(rdoOCol) ucrpnlPercent.AddRadioButton(rdoORow) ucrpnlPercent.AddRadioButton(rdoOCell) @@ -185,7 +188,7 @@ Public Class dlgDescribeTwoVariable ucrPnlDescribe.AddToLinkedControls({ucrReceiverSkimrGroupByFactor, ucrReceiverSecondSkimrGroupByFactor}, {rdoSkim}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrPnlDescribe.AddToLinkedControls({ucrReceiverThreeVariableThirdVariable}, {rdoThreeVariable}, bNewLinkedHideIfParameterMissing:=True) - ucrPnlDescribe.AddToLinkedControls({ucrReceiverSecondTwoVariableFactor, ucrChkSummariesRowCol}, {rdoTwoVariable}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlDescribe.AddToLinkedControls({ucrReceiverSecondTwoVariableFactor}, {rdoTwoVariable}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrPnlDescribe.AddToLinkedControls({ucrReceiverThreeVariableSecondFactor}, {rdoThreeVariable}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrpnlPercent.AddToLinkedControls({ucrReceiverPercentages}, {rdoORow}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) @@ -198,8 +201,9 @@ Public Class dlgDescribeTwoVariable ucrSaveTable.SetDataFrameSelector(ucrSelectorDescribeTwoVar.ucrAvailableDataFrames) ucrSaveTable.SetIsTextBox() - + rdoThreeVariable.Enabled = False ucrReorderSummary.bDataIsSummaries = True + AddRemoveTotalParm() End Sub Private Sub SetDefaults() @@ -307,12 +311,12 @@ Public Class dlgDescribeTwoVariable clsCombineSwapAnova2Table.SetRCommand("c") clsMappingFunction.SetPackageName("purrr") - clsMappingFunction.SetRCommand("map") + clsMappingFunction.SetRCommand("walk") clsMappingFunction.AddParameter(".x", clsROperatorParameter:=clsYlistOperator, iPosition:=0) clsMappingFunction.AddParameter(".f", clsROperatorParameter:=clsAnovaTable2Operator, iPosition:=1) clsMapping2Function.SetPackageName("purrr") - clsMapping2Function.SetRCommand("map") + clsMapping2Function.SetRCommand("walk") clsMapping2Function.AddParameter(".x", clsROperatorParameter:=clsYlist2Operator, iPosition:=0) clsMapping2Function.AddParameter(".f", clsROperatorParameter:=clsAnovaSwapTable2Opeator, iPosition:=1) @@ -353,19 +357,20 @@ Public Class dlgDescribeTwoVariable clsGroupByFunction.SetPackageName("dplyr") clsGroupByFunction.SetRCommand("group_by") - clsGroupByPipeOperator2.SetOperation("%>%") + clsGroupByPipeOperator2.SetOperation("%>%", bBracketsTemp:=False) clsGroupByPipeOperator2.AddParameter("left", clsROperatorParameter:=clsGroupByPipeOperatorData, iPosition:=0) clsGroupByPipeOperator2.AddParameter("right", clsRFunctionParameter:=clsGroupByFunction, iPosition:=1) - clsGroupByPipeOperator3.SetOperation("%>%") + clsGroupByPipeOperator3.SetOperation("%>%", bBracketsTemp:=False) clsGroupByPipeOperator3.AddParameter("left", clsROperatorParameter:=clsGroupByPipeOperator2, iPosition:=0) clsGroupByPipeOperator3.AddParameter("right", clsRFunctionParameter:=clsSummariseFunction, iPosition:=1) - clsGroupByPipeOperator4.SetOperation("%>%") + clsGroupByPipeOperator4.SetOperation("%>%", bBracketsTemp:=False) clsGroupByPipeOperator4.AddParameter("left", clsROperatorParameter:=clsGroupByPipeOperator3, iPosition:=0) clsGroupByPipeOperator4.AddParameter("right", clsRFunctionParameter:=clsgtFunction, iPosition:=1) clsGroupByPipeOperatorData.AddParameter("data", clsRFunctionParameter:=ucrSelectorDescribeTwoVar.ucrAvailableDataFrames.clsCurrDataFrame, iPosition:=0) + clsGroupByPipeOperatorData.bBrackets = False clsSummariseFunction.SetRCommand("summarise") clsSummariseFunction.AddParameter("cor", clsRFunctionParameter:=clsCorrFunction, bIncludeArgumentName:=False, iPosition:=0) @@ -376,7 +381,6 @@ Public Class dlgDescribeTwoVariable clsSkimrFunction.SetRCommand("skim_without_charts") clsRAnovaTableFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$anova_tables") - clsRAnovaTableFunction.AddParameter("data", Chr(34) & ucrSelectorDescribeTwoVar.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) clsRAnovaTableFunction.AddParameter("x_col_names", clsRFunctionParameter:=clsCombineAnovaFunction, iPosition:=1) clsRAnovaTableFunction.AddParameter("y_col_name", clsRFunctionParameter:=clsCombineFunction, iPosition:=2) clsRAnovaTableFunction.AddParameter("signif.stars", "FALSE", iPosition:=3) @@ -504,6 +508,7 @@ Public Class dlgDescribeTwoVariable ucrSelectorDescribeTwoVar.AddAdditionalCodeParameterPair(clsSummaryTableFunction, ucrSelectorDescribeTwoVar.GetParameter(), iAdditionalPairNo:=1) ucrSaveTable.AddAdditionalRCode(clsJoiningPipeOperator, iAdditionalPairNo:=1) + ucrSaveTable.AddAdditionalRCode(clsGroupByPipeOperator4, iAdditionalPairNo:=2) ucrChkOmitMissing.SetRCode(clsSummaryTableFunction, bReset) ucrReceiverFirstVars.SetRCode(clsDummyFunction, bReset) @@ -528,6 +533,7 @@ Public Class dlgDescribeTwoVariable bRcodeSet = True FillListView() + AddRemoveTotalParm() End Sub Public Sub TestOKEnabled() @@ -582,6 +588,14 @@ Public Class dlgDescribeTwoVariable Return strFirstVariablesType = "categorical" AndAlso strSecondVariableType = "numeric" AndAlso strThirdVariableType = "numeric" End Function + Private Function IsFactorByNumericByFactor() As Boolean + Return strFirstVariablesType = "categorical" AndAlso strSecondVariableType = "numeric" AndAlso strThirdVariableType = "categorical" + End Function + + Private Function IsFactorByFactorByNumeric() As Boolean + Return strFirstVariablesType = "categorical" AndAlso strSecondVariableType = "categorical" AndAlso strThirdVariableType = "numeric" + End Function + Private Sub ucrBaseDescribeTwoVar_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset SetDefaults() SetRCodeForControls(True) @@ -593,6 +607,10 @@ Public Class dlgDescribeTwoVariable If IsFactorByNumeric() Then sdgSummaries.SetRFunction(clsSummariesListFunction, clsSummaryTableFunction, clsCombineFunction, ucrSelectorDescribeTwoVar, bResetSubdialog) End If + ElseIf rdoThreeVariable.Checked Then + If IsFactorByFactorByNumeric() OrElse IsFactorByNumericByFactor() Then + sdgSummaries.SetRFunction(clsSummariesListFunction, clsSummaryTableFunction, clsCombineFunction, ucrSelectorDescribeTwoVar, bResetSubdialog) + End If End If bResetSubdialog = False sdgSummaries.ShowDialog() @@ -613,7 +631,7 @@ Public Class dlgDescribeTwoVariable ucrInputMarginName.Visible = ucrChkDisplayMargins.Checked AndAlso IsFactorByFactor() grpDisplay.Visible = rdoTwoVariable.Checked AndAlso IsFactorByFactor() ucrReceiverPercentages.Visible = ucrChkDisplayAsPercentage.Checked AndAlso rdoORow.Checked AndAlso IsFactorByFactor() - ucrpnlPercent.Visible = ucrChkDisplayAsPercentage.Checked AndAlso IsFactorByFactor() + ucrpnlPercent.Visible = IsFactorByFactor() AndAlso ucrChkDisplayAsPercentage.Checked ucrReceiverColumns.Visible = ucrChkDisplayAsPercentage.Checked AndAlso IsFactorByFactor() AndAlso rdoOCol.Checked ucrChkCorrelations.Visible = False ucrChkSwapXYVar.Visible = False @@ -625,20 +643,18 @@ Public Class dlgDescribeTwoVariable ucrChkSwapXYVar.Visible = IsNumericByNumeric() OrElse IsFactorByNumeric() ucrChkCorrelations.Visible = IsNumericByNumeric() cmdMissingOptions.Visible = ucrChkOmitMissing.Checked - - ElseIf rdoThreeVariable.Checked Then - ucrChkOmitMissing.Visible = IsFactorByNumeric() OrElse IsNumericByFactor() - Else - ucrChkOmitMissing.Visible = False - cmdMissingOptions.Visible = False End If If rdoThreeVariable.Checked Then - If IsNumericByFactorByFactor() OrElse IsNumericByFactorByNumeric() Then + If IsFactorByFactorByNumeric() OrElse IsFactorByNumericByFactor() Then + ucrReorderSummary.Visible = True + cmdSummaries.Visible = True + Else ucrReorderSummary.Visible = False cmdSummaries.Visible = False End If - ucrChkDisplayMargins.Visible = IsFactorByFactorByFactor() - ucrInputMarginName.Visible = ucrChkDisplayMargins.Checked AndAlso IsFactorByFactorByFactor() + ucrChkSwapXYVar.Visible = IsNumericByNumericByNumeric() OrElse IsNumericByNumericByFactor() + ucrChkSummariesRowCol.Visible = IsFactorByFactorByNumeric() OrElse IsFactorByNumericByFactor() + ucrChkOmitMissing.Visible = IsFactorByNumericByNumeric() OrElse IsNumericByNumericByFactor() End If End Sub @@ -650,6 +666,7 @@ Public Class dlgDescribeTwoVariable cmdFormatTable.Visible = False ucrChkMeans.Visible = False ucrChkLevSig.Visible = False + ucrChkTotal.Visible = False cmdMissingOptions.Visible = False If rdoSkim.Checked Then clsDummyFunction.AddParameter("checked", "skim", iPosition:=0) @@ -690,28 +707,26 @@ Public Class dlgDescribeTwoVariable cmdFormatTable.Visible = False ucrChkMeans.Visible = True ucrChkLevSig.Visible = True + ucrChkTotal.Visible = True ElseIf IsNumericByFactor() Then ucrBase.clsRsyntax.SetBaseRFunction(clsMappingFunction) ucrChkMeans.Visible = True ucrChkLevSig.Visible = True + ucrChkTotal.Visible = True ucrSaveTable.Visible = True ucrSaveTable.Location = New Point(23, 450) clsDummyFunction.AddParameter("factor_cols", "Sum", iPosition:=1) - ucrBase.clsRsyntax.SetBaseROperator(clsJoiningPipeOperator) ucrSaveTable.SetPrefix("summary_table") ucrSaveTable.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) ucrSaveTable.SetAssignToIfUncheckedValue("last_table") ucrSaveTable.SetCheckBoxText("Store Table") - clsJoiningPipeOperator.SetAssignToOutputObject(strRObjectToAssignTo:="last_table", - strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Table, - strRObjectFormatToAssignTo:=RObjectFormat.Html, - strRDataFrameNameToAddObjectTo:=ucrSelectorDescribeTwoVar.strCurrentDataFrame, - strObjectName:="last_table") + ElseIf IsFactorByFactor() Then ucrSaveTable.Visible = True cmdFormatTable.Visible = True ucrChkMeans.Visible = False ucrChkLevSig.Visible = False + ucrChkTotal.Visible = False ucrSaveTable.Location = New Point(23, 351) clsDummyFunction.AddParameter("factor_cols", "FactorVar", iPosition:=1) ucrBase.clsRsyntax.SetBaseROperator(clsJoiningPipeOperator) @@ -726,6 +741,7 @@ Public Class dlgDescribeTwoVariable strObjectName:="last_table") ElseIf IsFactorByNumeric() Then ucrBase.clsRsyntax.RemoveFromAfterCodes(clsRCorrelationFunction) + If ucrChkSwapXYVar.Checked Then ucrBase.clsRsyntax.SetBaseRFunction(clsMapping2Function) clsDummyFunction.AddParameter("var", "True", iPosition:=5) @@ -735,6 +751,7 @@ Public Class dlgDescribeTwoVariable cmdFormatTable.Visible = False ucrChkMeans.Visible = True ucrChkLevSig.Visible = True + ucrChkTotal.Visible = True Else clsDummyFunction.AddParameter("var", "False", iPosition:=5) ucrSaveTable.Visible = True @@ -744,6 +761,7 @@ Public Class dlgDescribeTwoVariable cmdFormatTable.Visible = True ucrChkMeans.Visible = False ucrChkLevSig.Visible = False + ucrChkTotal.Visible = False ucrSaveTable.Location = New Point(23, 450) clsDummyFunction.AddParameter("factor_cols", "Sum", iPosition:=1) ucrBase.clsRsyntax.SetBaseROperator(clsJoiningPipeOperator) @@ -761,45 +779,77 @@ Public Class dlgDescribeTwoVariable End If ElseIf rdoThreeVariable.Checked Then clsDummyFunction.AddParameter("checked", "three_variable", iPosition:=0) - ucrBase.clsRsyntax.SetBaseROperator(clsJoiningPipeOperator) - ucrSaveTable.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) - ucrSaveTable.SetCheckBoxText("Save Table") + If IsFactorByFactorByFactor() Then cmdFormatTable.Visible = True - + ucrSaveTable.Location = New Point(23, 341) + ucrSaveTable.Visible = True + ucrSaveTable.SetPrefix("frequency_table") + ucrSaveTable.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) + ucrSaveTable.SetAssignToIfUncheckedValue("last_table") + ucrSaveTable.SetCheckBoxText("Store Table") ucrBase.clsRsyntax.SetBaseROperator(clsJoiningPipeOperator) clsJoiningPipeOperator.SetAssignToOutputObject(strRObjectToAssignTo:="last_table", strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Table, strRObjectFormatToAssignTo:=RObjectFormat.Html, strRDataFrameNameToAddObjectTo:=ucrSelectorDescribeTwoVar.strCurrentDataFrame, strObjectName:="last_table") - End If - If IsFactorByNumericByNumeric() Then + ElseIf IsFactorByNumericByNumeric() Then cmdFormatTable.Visible = False + ucrSaveTable.Visible = True + ucrSaveTable.Location = New Point(23, 300) + ucrSaveTable.SetPrefix("cor_table") + ucrSaveTable.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) + ucrSaveTable.SetAssignToIfUncheckedValue("last_table") + ucrSaveTable.SetCheckBoxText("Store Cor") ucrBase.clsRsyntax.SetBaseROperator(clsGroupByPipeOperator4) clsGroupByPipeOperator4.SetAssignToOutputObject(strRObjectToAssignTo:="last_table", - strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Table, - strRObjectFormatToAssignTo:=RObjectFormat.Html, - strRDataFrameNameToAddObjectTo:=ucrSelectorDescribeTwoVar.strCurrentDataFrame, - strObjectName:="last_table") - End If - If IsNumericByNumericByFactor() Then - ucrBase.clsRsyntax.SetBaseRFunction(clsMappingFunction) + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Table, + strRObjectFormatToAssignTo:=RObjectFormat.Html, + strRDataFrameNameToAddObjectTo:=ucrSelectorDescribeTwoVar.strCurrentDataFrame, + strObjectName:="last_table") + ElseIf IsNumericByNumericByFactor() Then cmdFormatTable.Visible = False - End If - If IsNumericByNumericByNumeric() Then + ucrSaveTable.Visible = False + ucrChkMeans.Visible = True + ucrChkLevSig.Visible = True + ucrChkTotal.Visible = True + If ucrChkSwapXYVar.Checked Then + ucrBase.clsRsyntax.SetBaseRFunction(clsMapping2Function) + clsDummyFunction.AddParameter("var", "True", iPosition:=5) + Else + clsDummyFunction.AddParameter("var", "False", iPosition:=5) + ucrBase.clsRsyntax.SetBaseRFunction(clsMappingFunction) + End If + ElseIf IsNumericByNumericByNumeric() Then cmdFormatTable.Visible = False + ucrSaveTable.Visible = False ucrBase.clsRsyntax.SetBaseRFunction(clsMappingFunction) - End If - If IsNumericByFactorByFactor() Then + ElseIf IsNumericByFactorByFactor() Then cmdFormatTable.Visible = False + ucrSaveTable.Visible = False ucrBase.clsRsyntax.SetBaseRFunction(clsMappingFunction) - End If - If IsNumericByFactorByNumeric() Then + ElseIf IsNumericByFactorByNumeric() Then cmdFormatTable.Visible = False + ucrSaveTable.Visible = False ucrBase.clsRsyntax.SetBaseRFunction(clsMappingFunction) + ElseIf IsFactorByNumericByFactor() OrElse IsFactorByFactorByNumeric() Then + ucrSaveTable.SetPrefix("summary_table") + ucrSaveTable.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) + ucrSaveTable.SetAssignToIfUncheckedValue("last_table") + ucrSaveTable.SetCheckBoxText("Save Table") + ucrBase.clsRsyntax.SetBaseROperator(clsJoiningPipeOperator) + clsJoiningPipeOperator.SetAssignToOutputObject(strRObjectToAssignTo:="last_table", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Table, + strRObjectFormatToAssignTo:=RObjectFormat.Html, + strRDataFrameNameToAddObjectTo:=ucrSelectorDescribeTwoVar.strCurrentDataFrame, + strObjectName:="last_table") + ucrReorderSummary.Visible = True + cmdSummaries.Visible = True + ucrSaveTable.Visible = True + ucrChkSummariesRowCol.Visible = True + ucrSaveTable.Location = New Point(23, 440) End If - ucrSaveTable.SetCheckBoxText("Store Table") End If FactorColumns() End Sub @@ -888,9 +938,15 @@ Public Class dlgDescribeTwoVariable Private Sub ChangeLocations() If rdoTwoVariable.Checked Then If IsFactorByNumeric() Then - ucrBase.Location = New Point(iUcrBaseXLocation, 487) - Me.Size = New Point(iDialogueXsize, 580) - cmdFormatTable.Location = New Point(326, 423) + If ucrChkSwapXYVar.Checked Then + ucrBase.Location = New Point(iUcrBaseXLocation, 400) + Me.Size = New Point(iDialogueXsize, 500) + cmdFormatTable.Location = New Point(326, 350) + Else + ucrBase.Location = New Point(iUcrBaseXLocation, 487) + Me.Size = New Point(iDialogueXsize, 580) + cmdFormatTable.Location = New Point(326, 423) + End If ElseIf IsNumericByFactor() Then ucrBase.Location = New Point(iUcrBaseXLocation, 319) Me.Size = New Point(iDialogueXsize, 415) @@ -903,17 +959,23 @@ Public Class dlgDescribeTwoVariable Me.Size = New Point(iDialogueXsize, 425) End If ElseIf rdoThreeVariable.Checked Then + If IsNumericByNumericByFactor() OrElse IsNumericByNumericByNumeric() OrElse IsNumericByFactorByFactor() OrElse IsNumericByFactorByNumeric() Then - ucrBase.Location = New Point(iUcrBaseXLocation, 328) - Me.Size = New Point(iDialogueXsize, 425) + ucrBase.Location = New Point(iUcrBaseXLocation, 353) + ucrChkSwapXYVar.Location = New Point(300, 320) + Me.Size = New Point(iDialogueXsize, 450) ElseIf IsFactorByFactorByFactor() Then ucrBase.Location = New Point(iUcrBaseXLocation, 370) Me.Size = New Point(iDialogueXsize, 465) cmdFormatTable.Visible = True cmdFormatTable.Location = New Point(326, 350) + ElseIf IsFactorByFactorByNumeric() OrElse IsFactorByNumericByFactor() Then + ucrBase.Location = New Point(iUcrBaseXLocation, 470) + Me.Size = New Point(iDialogueXsize, 570) Else - ucrBase.Location = New Point(iUcrBaseXLocation, 385) - Me.Size = New Point(iDialogueXsize, 480) + ucrBase.Location = New Point(iUcrBaseXLocation, 328) + Me.Size = New Point(iDialogueXsize, 425) + End If Else ucrBase.Location = New Point(iUcrBaseXLocation, 328) @@ -935,7 +997,11 @@ Public Class dlgDescribeTwoVariable If ucrReceiverFirstVars.IsEmpty Then clsGroupByFunction.RemoveParameterByName("var") Else - clsGroupByFunction.AddParameter("var", ucrReceiverFirstVars.GetVariableNames(False), iPosition:=1, bIncludeArgumentName:=False) + Dim lstControlVars As List(Of String) = ucrReceiverFirstVars.GetVariableNamesAsList() + Dim strControlVar As String = String.Join(",", lstControlVars) + + clsGroupByFunction.AddParameter("var", strControlVar, iPosition:=1, bIncludeArgumentName:=False) + End If End If End If @@ -987,9 +1053,19 @@ Public Class dlgDescribeTwoVariable If rdoThreeVariable.Checked Then clsSummaryOperator.AddParameter("col_factor", clsRFunctionParameter:=clsPivotWiderFunction, iPosition:=1) If IsFactorByFactorByFactor() Then - clsSummaryTableFunction.AddParameter("factors", "c(" & Chr(34) & ucrReceiverFirstVars.lstSelectedVariables.Items(0).Text & Chr(34) & "," & ucrReceiverThreeVariableSecondFactor.GetVariableNames & "," & ucrReceiverThreeVariableThirdVariable.GetVariableNames & ")") - clsSummaryTableFunction.AddParameter("columns_to_summarise", Chr(34) & ucrReceiverFirstVars.lstSelectedVariables.Items(0).Text & Chr(34)) - clsPivotWiderFunction.AddParameter("names_from", ucrReceiverFirstVars.lstSelectedVariables.Items(0).Text, iPosition:=0) + clsSummaryTableFunction.AddParameter("factors", "c(" & ucrReceiverThreeVariableSecondFactor.GetVariableNames & "," & ucrReceiverThreeVariableThirdVariable.GetVariableNames & "," & ".x" & ")") + clsSummaryTableFunction.AddParameter("columns_to_summarise", ".x") + clsPivotWiderFunction.AddParameter("names_from", "{{ .x }}", iPosition:=1) + ElseIf IsFactorByFactorByNumeric() Then + clsMapSummaryFunction.AddParameter(".x", "c(" & ucrReceiverFirstVars.GetVariableNames.Replace("c(", "").Replace(")", "") & "," & ucrReceiverThreeVariableSecondFactor.GetVariableNames.Replace("c(", "").Replace(")", "") & ")") + clsSummaryTableFunction.AddParameter("factors", ".x") + clsSummaryTableFunction.AddParameter("columns_to_summarise", ucrReceiverThreeVariableThirdVariable.GetVariableNames) + SummariesInRowsOrCols() + ElseIf IsFactorByNumericByFactor() Then + clsMapSummaryFunction.AddParameter(".x", "c(" & ucrReceiverFirstVars.GetVariableNames.Replace("c(", "").Replace(")", "") & "," & ucrReceiverThreeVariableThirdVariable.GetVariableNames.Replace("c(", "").Replace(")", "") & ")") + clsSummaryTableFunction.AddParameter("factors", ".x") + clsSummaryTableFunction.AddParameter("columns_to_summarise", ucrReceiverThreeVariableSecondFactor.GetVariableNames) + SummariesInRowsOrCols() Else clsPivotWiderFunction.AddParameter("names_from", Chr(39) & "summary-variable" & Chr(39), iPosition:=0) clsSummaryTableFunction.AddParameter("columns_to_summarise", ucrReceiverFirstVars.GetVariableNames) @@ -1000,12 +1076,21 @@ Public Class dlgDescribeTwoVariable Private Sub AddRemoveFirstAnova2Param() If rdoThreeVariable.Checked Then - If IsNumericByNumericByFactor() OrElse IsNumericByNumericByNumeric() OrElse IsNumericByFactorByFactor() OrElse IsNumericByFactorByNumeric() Then - If ucrReceiverFirstVars.IsEmpty Then - clsYlistOperator.RemoveParameterByName("cols") - Else + If Not ucrReceiverFirstVars.IsEmpty Then + If IsNumericByNumericByFactor() Then + If ucrChkSwapXYVar.Checked Then + clsYlist2Operator.AddParameter("cols", ucrReceiverFirstVars.GetVariableNames(True), iPosition:=0, bIncludeArgumentName:=False) + clsYlistOperator.RemoveParameterByName("cols") + Else + clsYlistOperator.AddParameter("cols", ucrReceiverFirstVars.GetVariableNames(True), iPosition:=0, bIncludeArgumentName:=False) + clsYlist2Operator.RemoveParameterByName("cols") + End If + ElseIf IsNumericByNumericByNumeric() OrElse IsNumericByFactorByFactor() OrElse IsNumericByFactorByNumeric() Then clsYlistOperator.AddParameter("cols", ucrReceiverFirstVars.GetVariableNames(True), iPosition:=0, bIncludeArgumentName:=False) End If + Else + clsYlist2Operator.RemoveParameterByName("cols") + clsYlistOperator.RemoveParameterByName("cols") End If ElseIf rdoTwoVariable.Checked Then If IsNumericByNumeric() Then @@ -1051,12 +1136,29 @@ Public Class dlgDescribeTwoVariable Private Sub AddRemoveSecondAnovaParam() If rdoThreeVariable.Checked Then - If IsNumericByNumericByFactor() OrElse IsNumericByNumericByNumeric() OrElse IsNumericByFactorByFactor() OrElse IsNumericByFactorByNumeric() Then - If ucrReceiverThreeVariableSecondFactor.IsEmpty Then - clsCombineAnova2Function.RemoveParameterByName("x") - Else + If Not ucrReceiverThreeVariableSecondFactor.IsEmpty Then + If IsNumericByNumericByFactor() Then + If ucrChkSwapXYVar.Checked Then + clsCombineSwapAnova2Table.AddParameter("x", ".x", bIncludeArgumentName:=False) + clsRAnovaSwapTable2Funtion.AddParameter("x_col_names", "c(" & ucrReceiverThreeVariableSecondFactor.GetVariableNames & "," & ucrReceiverThreeVariableThirdVariable.GetVariableNames & ")", iPosition:=2) + + clsCombineAnova2Function.RemoveParameterByName("x") + Else + clsCombineAnova2Function.AddParameter("x", ucrReceiverThreeVariableSecondFactor.GetVariableNames(True), iPosition:=1, bIncludeArgumentName:=False) + clsCombineSwapAnova2Table.RemoveParameterByName("x") + clsRAnovaSwapTable2Funtion.AddParameter("x_col_names", ".x", iPosition:=2) + + End If + ElseIf IsNumericByNumericByNumeric() OrElse IsNumericByFactorByFactor() OrElse IsNumericByFactorByNumeric() Then clsCombineAnova2Function.AddParameter("x", ucrReceiverThreeVariableSecondFactor.GetVariableNames(True), iPosition:=1, bIncludeArgumentName:=False) + + Else + clsCombineAnova2Function.RemoveParameterByName("x") + clsCombineSwapAnova2Table.RemoveParameterByName("x") End If + Else + clsCombineAnova2Function.RemoveParameterByName("x") + clsCombineSwapAnova2Table.RemoveParameterByName("x") End If ElseIf rdoTwoVariable.Checked Then If IsNumericByNumeric() Then @@ -1094,6 +1196,9 @@ Public Class dlgDescribeTwoVariable Else clsCombineAnova2Function.AddParameter("x", ucrReceiverSecondTwoVariableFactor.GetVariableNames(True), iPosition:=1, bIncludeArgumentName:=False) End If + Else + clsCombineSwapAnova2Table.RemoveParameterByName("x") + clsCombineAnova2Function.RemoveParameterByName("x") End If End If @@ -1101,12 +1206,15 @@ Public Class dlgDescribeTwoVariable Private Sub AddRemoveThirdAnovaParam() If rdoThreeVariable.Checked Then - If IsNumericByNumericByFactor() OrElse IsNumericByNumericByNumeric() OrElse IsNumericByFactorByFactor() OrElse IsNumericByFactorByNumeric() Then - If ucrReceiverThreeVariableThirdVariable.IsEmpty Then - clsCombineAnova2Function.RemoveParameterByName("y") - Else + If Not ucrReceiverThreeVariableThirdVariable.IsEmpty Then + If IsNumericByNumericByFactor() OrElse IsNumericByNumericByNumeric() OrElse IsNumericByFactorByFactor() OrElse IsNumericByFactorByNumeric() Then clsCombineAnova2Function.AddParameter("y", ucrReceiverThreeVariableThirdVariable.GetVariableNames(True), iPosition:=2, bIncludeArgumentName:=False) + Else + clsCombineAnova2Function.RemoveParameterByName("y") + End If + Else + clsCombineAnova2Function.RemoveParameterByName("y") End If End If End Sub @@ -1199,10 +1307,12 @@ Public Class dlgDescribeTwoVariable FactorColumns() AddRemoveFrequencyParameters() AddingColumnFactor() + ChangeBaseRCode() End Sub Private Sub ucrSelectorDescribeTwoVar_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectorDescribeTwoVar.ControlValueChanged clsGroupByPipeOperator.AddParameter("data", clsRFunctionParameter:=ucrSelectorDescribeTwoVar.ucrAvailableDataFrames.clsCurrDataFrame, iPosition:=0) + clsRAnovaTableFunction.AddParameter("data", Chr(34) & ucrSelectorDescribeTwoVar.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) End Sub Private Sub UpdateSummaryTableFunction() @@ -1216,9 +1326,9 @@ Public Class dlgDescribeTwoVariable clsSummaryTableFunction.AddParameter("summaries", clsRFunctionParameter:=clsSummariesListFunction, iPosition:=4) End If ElseIf rdoThreeVariable.Checked Then - If IsFactorByNumeric() Then + If IsFactorByFactorByNumeric() OrElse IsFactorByNumericByFactor() Then clsSummaryTableFunction.AddParameter("summaries", clsRFunctionParameter:=clsSummariesListFunction, iPosition:=4) - ElseIf IsFactorByFactor() Then + ElseIf IsFactorByFactorByFactor() Then clsSummaryTableFunction.AddParameter("summaries", "count_label", iPosition:=4) End If End If @@ -1239,6 +1349,7 @@ Public Class dlgDescribeTwoVariable AddRemoveSecondAnovaParam() AddRemoveThirdAnovaParam() AddRemoveFirstAnova2Param() + FactorColumns() End Sub Private Sub ChangeSumaryLabelText() @@ -1277,8 +1388,12 @@ Public Class dlgDescribeTwoVariable strSummaryName = "ANOVA tables" ElseIf IsFactorByFactorByFactor() Then strSummaryName = "Frequency tables" - Else + ElseIf IsFactorByNumericByFactor() Then + strSummaryName = "Summary tables" + ElseIf IsFactorByFactorByNumeric() Then strSummaryName = "Summary tables" + Else + strSummaryName = "" End If End If If strSummaryName <> "" Then @@ -1418,6 +1533,12 @@ Public Class dlgDescribeTwoVariable AddRemoveSecondCorrParam() AddRemoveSecondAnovaParam() AddRemoveFirstAnova2Param() + FactorColumns() + ChangeLocations() + ChangeSumaryLabelText() + ChangeBaseRCode() + ManageControlsVisibility() + AddRemoveThirdAnovaParam() End Sub Private Sub Controls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverFirstVars.ControlContentsChanged, @@ -1541,6 +1662,7 @@ Public Class dlgDescribeTwoVariable Private Sub ucrChkSummariesRowCol_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkSummariesRowCol.ControlValueChanged ManageControlsVisibility() SummariesInRowsOrCols() + ChangeBaseRCode() End Sub Private Sub ucrChkCorrelations_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkCorrelations.ControlValueChanged @@ -1552,6 +1674,9 @@ Public Class dlgDescribeTwoVariable AddRemoveSecondAnovaParam() ChangeBaseRCode() ChangeSumaryLabelText() + ManageControlsVisibility() + ChangeLocations() + AddRemoveThirdAnovaParam() End Sub Private Sub AddingColumnFactor() @@ -1601,4 +1726,14 @@ Public Class dlgDescribeTwoVariable clsDummyFunction.AddParameter("percent", "cell", iPosition:=6) End If End Sub + + Private Sub ucrChkTotal_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkTotal.ControlValueChanged + AddRemoveTotalParm() + End Sub + + Private Sub AddRemoveTotalParm() + clsRAnovaTable2Function.AddParameter("total", If(ucrChkTotal.Checked, "TRUE", "FALSE"), iPosition:=6) + clsRAnovaSwapTable2Funtion.AddParameter("total", If(ucrChkTotal.Checked AndAlso ucrChkSwapXYVar.Checked, "TRUE", "FALSE"), iPosition:=6) + + End Sub End Class diff --git a/instat/dlgDistances.Designer.vb b/instat/dlgDistances.Designer.vb new file mode 100644 index 00000000000..f9c6c3c9c89 --- /dev/null +++ b/instat/dlgDistances.Designer.vb @@ -0,0 +1,278 @@ + _ +Partial Class dlgDistances + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.lblLon = New System.Windows.Forms.Label() + Me.lblLat = New System.Windows.Forms.Label() + Me.rdoValue = New System.Windows.Forms.RadioButton() + Me.rdoVariable = New System.Windows.Forms.RadioButton() + Me.grpFrom = New System.Windows.Forms.GroupBox() + Me.ucrInputVariable = New instat.ucrInputComboBox() + Me.ucrReceiverVariable = New instat.ucrReceiverSingle() + Me.lblLatFrom = New System.Windows.Forms.Label() + Me.lblLongFrom = New System.Windows.Forms.Label() + Me.ucrReceiverLat = New instat.ucrReceiverSingle() + Me.ucrReceiverLong = New instat.ucrReceiverSingle() + Me.ucrSelectorDistance = New instat.ucrSelectorByDataFrameAddRemove() + Me.ucrBase = New instat.ucrButtons() + Me.ucrPnlFrom = New instat.UcrPanel() + Me.ucrSaveDistance = New instat.ucrSave() + Me.ucrInputLon = New instat.ucrInputTextBox() + Me.ucrInputLat = New instat.ucrInputTextBox() + Me.grpFrom.SuspendLayout() + Me.SuspendLayout() + ' + 'lblLon + ' + Me.lblLon.AutoSize = True + Me.lblLon.Location = New System.Drawing.Point(433, 45) + Me.lblLon.Name = "lblLon" + Me.lblLon.Size = New System.Drawing.Size(49, 20) + Me.lblLon.TabIndex = 1 + Me.lblLon.Text = "Long:" + ' + 'lblLat + ' + Me.lblLat.AutoSize = True + Me.lblLat.Location = New System.Drawing.Point(432, 119) + Me.lblLat.Name = "lblLat" + Me.lblLat.Size = New System.Drawing.Size(36, 20) + Me.lblLat.TabIndex = 3 + Me.lblLat.Text = "Lat:" + ' + 'rdoValue + ' + Me.rdoValue.AutoSize = True + Me.rdoValue.Location = New System.Drawing.Point(371, 209) + Me.rdoValue.Name = "rdoValue" + Me.rdoValue.Size = New System.Drawing.Size(83, 24) + Me.rdoValue.TabIndex = 6 + Me.rdoValue.TabStop = True + Me.rdoValue.Text = "Values" + Me.rdoValue.UseVisualStyleBackColor = True + ' + 'rdoVariable + ' + Me.rdoVariable.AutoSize = True + Me.rdoVariable.Location = New System.Drawing.Point(497, 208) + Me.rdoVariable.Name = "rdoVariable" + Me.rdoVariable.Size = New System.Drawing.Size(92, 24) + Me.rdoVariable.TabIndex = 7 + Me.rdoVariable.TabStop = True + Me.rdoVariable.Text = "Variable" + Me.rdoVariable.UseVisualStyleBackColor = True + ' + 'grpFrom + ' + Me.grpFrom.Controls.Add(Me.ucrInputVariable) + Me.grpFrom.Controls.Add(Me.ucrReceiverVariable) + Me.grpFrom.Controls.Add(Me.lblLatFrom) + Me.grpFrom.Controls.Add(Me.lblLongFrom) + Me.grpFrom.Location = New System.Drawing.Point(335, 186) + Me.grpFrom.Name = "grpFrom" + Me.grpFrom.Size = New System.Drawing.Size(298, 135) + Me.grpFrom.TabIndex = 5 + Me.grpFrom.TabStop = False + Me.grpFrom.Text = "From:" + ' + 'ucrInputVariable + ' + Me.ucrInputVariable.AddQuotesIfUnrecognised = True + Me.ucrInputVariable.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrInputVariable.GetSetSelectedIndex = -1 + Me.ucrInputVariable.IsReadOnly = False + Me.ucrInputVariable.Location = New System.Drawing.Point(157, 94) + Me.ucrInputVariable.Margin = New System.Windows.Forms.Padding(9, 9, 9, 9) + Me.ucrInputVariable.Name = "ucrInputVariable" + Me.ucrInputVariable.Size = New System.Drawing.Size(135, 32) + Me.ucrInputVariable.TabIndex = 13 + ' + 'ucrReceiverVariable + ' + Me.ucrReceiverVariable.AutoSize = True + Me.ucrReceiverVariable.frmParent = Me + Me.ucrReceiverVariable.Location = New System.Drawing.Point(157, 55) + Me.ucrReceiverVariable.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverVariable.Name = "ucrReceiverVariable" + Me.ucrReceiverVariable.Selector = Nothing + Me.ucrReceiverVariable.Size = New System.Drawing.Size(135, 30) + Me.ucrReceiverVariable.strNcFilePath = "" + Me.ucrReceiverVariable.TabIndex = 12 + Me.ucrReceiverVariable.ucrSelector = Nothing + ' + 'lblLatFrom + ' + Me.lblLatFrom.AutoSize = True + Me.lblLatFrom.Location = New System.Drawing.Point(7, 99) + Me.lblLatFrom.Name = "lblLatFrom" + Me.lblLatFrom.Size = New System.Drawing.Size(36, 20) + Me.lblLatFrom.TabIndex = 10 + Me.lblLatFrom.Text = "Lat:" + ' + 'lblLongFrom + ' + Me.lblLongFrom.AutoSize = True + Me.lblLongFrom.Location = New System.Drawing.Point(3, 58) + Me.lblLongFrom.Name = "lblLongFrom" + Me.lblLongFrom.Size = New System.Drawing.Size(49, 20) + Me.lblLongFrom.TabIndex = 8 + Me.lblLongFrom.Text = "Long:" + ' + 'ucrReceiverLat + ' + Me.ucrReceiverLat.AutoSize = True + Me.ucrReceiverLat.frmParent = Me + Me.ucrReceiverLat.Location = New System.Drawing.Point(432, 142) + Me.ucrReceiverLat.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverLat.Name = "ucrReceiverLat" + Me.ucrReceiverLat.Selector = Nothing + Me.ucrReceiverLat.Size = New System.Drawing.Size(180, 41) + Me.ucrReceiverLat.strNcFilePath = "" + Me.ucrReceiverLat.TabIndex = 4 + Me.ucrReceiverLat.ucrSelector = Nothing + ' + 'ucrReceiverLong + ' + Me.ucrReceiverLong.AutoSize = True + Me.ucrReceiverLong.frmParent = Me + Me.ucrReceiverLong.Location = New System.Drawing.Point(430, 73) + Me.ucrReceiverLong.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverLong.Name = "ucrReceiverLong" + Me.ucrReceiverLong.Selector = Nothing + Me.ucrReceiverLong.Size = New System.Drawing.Size(180, 46) + Me.ucrReceiverLong.strNcFilePath = "" + Me.ucrReceiverLong.TabIndex = 2 + Me.ucrReceiverLong.ucrSelector = Nothing + ' + 'ucrSelectorDistance + ' + Me.ucrSelectorDistance.AutoSize = True + Me.ucrSelectorDistance.bDropUnusedFilterLevels = False + Me.ucrSelectorDistance.bShowHiddenColumns = False + Me.ucrSelectorDistance.bUseCurrentFilter = True + Me.ucrSelectorDistance.Location = New System.Drawing.Point(5, 22) + Me.ucrSelectorDistance.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectorDistance.Name = "ucrSelectorDistance" + Me.ucrSelectorDistance.Size = New System.Drawing.Size(318, 274) + Me.ucrSelectorDistance.TabIndex = 0 + ' + 'ucrBase + ' + Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrBase.Location = New System.Drawing.Point(9, 408) + Me.ucrBase.Margin = New System.Windows.Forms.Padding(6) + Me.ucrBase.Name = "ucrBase" + Me.ucrBase.Size = New System.Drawing.Size(615, 78) + Me.ucrBase.TabIndex = 15 + ' + 'ucrPnlFrom + ' + Me.ucrPnlFrom.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlFrom.Location = New System.Drawing.Point(356, 207) + Me.ucrPnlFrom.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) + Me.ucrPnlFrom.Name = "ucrPnlFrom" + Me.ucrPnlFrom.Size = New System.Drawing.Size(263, 31) + Me.ucrPnlFrom.TabIndex = 8 + ' + 'ucrSaveDistance + ' + Me.ucrSaveDistance.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrSaveDistance.Location = New System.Drawing.Point(8, 348) + Me.ucrSaveDistance.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) + Me.ucrSaveDistance.Name = "ucrSaveDistance" + Me.ucrSaveDistance.Size = New System.Drawing.Size(548, 33) + Me.ucrSaveDistance.TabIndex = 14 + ' + 'ucrInputLon + ' + Me.ucrInputLon.AddQuotesIfUnrecognised = True + Me.ucrInputLon.AutoSize = True + Me.ucrInputLon.IsMultiline = False + Me.ucrInputLon.IsReadOnly = False + Me.ucrInputLon.Location = New System.Drawing.Point(389, 243) + Me.ucrInputLon.Margin = New System.Windows.Forms.Padding(9, 9, 9, 9) + Me.ucrInputLon.Name = "ucrInputLon" + Me.ucrInputLon.Size = New System.Drawing.Size(92, 32) + Me.ucrInputLon.TabIndex = 16 + ' + 'ucrInputLat + ' + Me.ucrInputLat.AddQuotesIfUnrecognised = True + Me.ucrInputLat.AutoSize = True + Me.ucrInputLat.IsMultiline = False + Me.ucrInputLat.IsReadOnly = False + Me.ucrInputLat.Location = New System.Drawing.Point(390, 282) + Me.ucrInputLat.Margin = New System.Windows.Forms.Padding(9, 9, 9, 9) + Me.ucrInputLat.Name = "ucrInputLat" + Me.ucrInputLat.Size = New System.Drawing.Size(92, 32) + Me.ucrInputLat.TabIndex = 17 + ' + 'dlgDistances + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(9.0!, 20.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(645, 496) + Me.Controls.Add(Me.ucrInputLat) + Me.Controls.Add(Me.ucrInputLon) + Me.Controls.Add(Me.ucrSaveDistance) + Me.Controls.Add(Me.rdoVariable) + Me.Controls.Add(Me.rdoValue) + Me.Controls.Add(Me.lblLat) + Me.Controls.Add(Me.lblLon) + Me.Controls.Add(Me.ucrReceiverLat) + Me.Controls.Add(Me.ucrReceiverLong) + Me.Controls.Add(Me.ucrSelectorDistance) + Me.Controls.Add(Me.ucrBase) + Me.Controls.Add(Me.ucrPnlFrom) + Me.Controls.Add(Me.grpFrom) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "dlgDistances" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "Distances" + Me.grpFrom.ResumeLayout(False) + Me.grpFrom.PerformLayout() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents ucrBase As ucrButtons + Friend WithEvents ucrSelectorDistance As ucrSelectorByDataFrameAddRemove + Friend WithEvents ucrReceiverLong As ucrReceiverSingle + Friend WithEvents rdoVariable As RadioButton + Friend WithEvents rdoValue As RadioButton + Friend WithEvents lblLat As Label + Friend WithEvents lblLon As Label + Friend WithEvents ucrReceiverLat As ucrReceiverSingle + Friend WithEvents ucrPnlFrom As UcrPanel + Friend WithEvents grpFrom As GroupBox + Friend WithEvents lblLatFrom As Label + Friend WithEvents lblLongFrom As Label + Friend WithEvents ucrInputVariable As ucrInputComboBox + Friend WithEvents ucrReceiverVariable As ucrReceiverSingle + Friend WithEvents ucrSaveDistance As ucrSave + Friend WithEvents ucrInputLon As ucrInputTextBox + Friend WithEvents ucrInputLat As ucrInputTextBox +End Class diff --git a/instat/dlgDistances.resx b/instat/dlgDistances.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/instat/dlgDistances.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/instat/dlgDistances.vb b/instat/dlgDistances.vb new file mode 100644 index 00000000000..0e3ccc3a91f --- /dev/null +++ b/instat/dlgDistances.vb @@ -0,0 +1,197 @@ +' 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 dlgDistances + Private bFirstLoad As Boolean = True + Private bReset As Boolean = True + Private clsConcFunction, clsRoundOffFunction, clsConc2Function, clsDummyFunction, clsDistFunction As New RFunction + Private clsOpeningOperator, clsClosingOperator, clsConversionOperator As New ROperator + + Private Sub dlgDistances_Load(sender As Object, e As EventArgs) Handles MyBase.Load + If bFirstLoad Then + InitialiseDialog() + bFirstLoad = False + End If + If bReset Then + SetDefaults() + End If + SetRCodeForControls(bReset) + bReset = False + TestOKEnabled() + autoTranslate(Me) + End Sub + Private Sub InitialiseDialog() + + ucrSelectorDistance.SetParameter(New RParameter("df", 0)) + ucrSelectorDistance.SetParameterIsrfunction() + + ucrReceiverLong.SetParameter(New RParameter("long", 1, bNewIncludeArgumentName:=False)) + ucrReceiverLong.Selector = ucrSelectorDistance + ucrReceiverLong.SetParameterIsRFunction() + ucrReceiverLong.SetClimaticType("lon") + ucrReceiverLong.bAutoFill = True + ucrReceiverLong.SetLinkedDisplayControl(lblLon) + + ucrReceiverLat.SetParameter(New RParameter("lat", 2, bNewIncludeArgumentName:=False)) + ucrReceiverLat.Selector = ucrSelectorDistance + ucrReceiverLat.SetParameterIsRFunction() + ucrReceiverLat.SetClimaticType("lat") + ucrReceiverLat.bAutoFill = True + ucrReceiverLat.SetLinkedDisplayControl(lblLat) + + ucrPnlFrom.AddRadioButton(rdoValue) + ucrPnlFrom.AddRadioButton(rdoVariable) + ucrPnlFrom.AddParameterValuesCondition(rdoValue, "checked", "value") + ucrPnlFrom.AddParameterValuesCondition(rdoVariable, "checked", "variable") + + ucrInputLon.SetParameter(New RParameter("lon", 0, bNewIncludeArgumentName:=False)) + ucrInputLon.SetValidationTypeAsNumeric(dcmMin:=-180.0, dcmMax:=180.0) + ucrInputLon.SetLinkedDisplayControl(lblLongFrom) + + ucrInputLat.SetParameter(New RParameter("lat", 1, bNewIncludeArgumentName:=False)) + ucrInputLat.SetValidationTypeAsNumeric(dcmMin:=-90.0, dcmMax:=90.0) + ucrInputLat.SetLinkedDisplayControl(lblLatFrom) + + ucrPnlFrom.AddToLinkedControls(ucrInputLon, {rdoValue}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlFrom.AddToLinkedControls(ucrInputLat, {rdoValue}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlFrom.AddToLinkedControls({ucrReceiverVariable, ucrInputVariable}, {rdoVariable}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + + ucrSaveDistance.SetLabelText("New Column Name:") + ucrSaveDistance.SetDataFrameSelector(ucrSelectorDistance.ucrAvailableDataFrames) + ucrSaveDistance.SetIsComboBox() + ucrSaveDistance.SetSaveTypeAsColumn() + ucrSaveDistance.SetPrefix("distances") + + rdoVariable.Enabled = False + End Sub + Private Sub SetDefaults() + clsConc2Function = New RFunction + clsConcFunction = New RFunction + clsDistFunction = New RFunction + clsDummyFunction = New RFunction + clsRoundOffFunction = New RFunction + clsOpeningOperator = New ROperator + clsClosingOperator = New ROperator + clsConversionOperator = New ROperator + + ucrSelectorDistance.Reset() + ucrSaveDistance.Reset() + ucrReceiverLong.SetMeAsReceiver() + + clsDummyFunction.AddParameter("checked", "value", iPosition:=0) + + clsConcFunction.SetRCommand("c") + clsConcFunction.SetAssignTo("citycenter") + clsConcFunction.AddParameter("lon", 0, iPosition:=0, bIncludeArgumentName:=False) + clsConcFunction.AddParameter("lat", 0, iPosition:=1, bIncludeArgumentName:=False) + + clsConc2Function.SetRCommand("c") + + clsClosingOperator.SetOperation("]") + clsClosingOperator.AddParameter("left", clsRFunctionParameter:=clsConc2Function, iPosition:=0) + clsClosingOperator.AddParameter("right", "", iPosition:=1) + + clsOpeningOperator.SetOperation("[,") + clsOpeningOperator.AddParameter("right", clsROperatorParameter:=clsClosingOperator, iPosition:=1) + + clsDistFunction.SetPackageName("geosphere") + clsDistFunction.SetRCommand("distGeo") + clsDistFunction.AddParameter("city", clsRFunctionParameter:=clsConcFunction, iPosition:=0, bIncludeArgumentName:=False) + clsDistFunction.AddParameter("para", clsROperatorParameter:=clsOpeningOperator, iPosition:=2, bIncludeArgumentName:=False) + + clsConversionOperator.SetOperation("/") + clsConversionOperator.AddParameter("left", clsRFunctionParameter:=clsDistFunction, iPosition:=0) + clsConversionOperator.AddParameter("right", "1000", iPosition:=1) + + clsRoundOffFunction.SetRCommand("round") + clsRoundOffFunction.AddParameter("dec", clsROperatorParameter:=clsConversionOperator, iPosition:=0, bIncludeArgumentName:=False) + clsRoundOffFunction.AddParameter("two", 2, iPosition:=1, bIncludeArgumentName:=False) + + ucrBase.clsRsyntax.SetAssignTo(strAssignToName:=ucrSaveDistance.GetText, strTempDataframe:=ucrSelectorDistance.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempColumn:=ucrSaveDistance.GetText) + + ucrBase.clsRsyntax.SetBaseRFunction(clsRoundOffFunction) + + End Sub + + Private Sub SetRCodeForControls(bReset As Boolean) + ucrInputLat.SetRCode(clsConcFunction, bReset) + ucrInputLon.SetRCode(clsConcFunction, bReset) + ucrPnlFrom.SetRCode(clsDummyFunction, bReset) + ucrSaveDistance.SetRCode(clsRoundOffFunction, bReset) + If bReset Then + ucrReceiverLong.SetRCode(clsConc2Function, bReset) + ucrReceiverLat.SetRCode(clsConc2Function, bReset) + End If + End Sub + + Private Sub TestOKEnabled() + If Not ucrReceiverLong.IsEmpty AndAlso Not ucrReceiverLat.IsEmpty AndAlso ucrSaveDistance.IsComplete AndAlso Not ucrInputLat.IsEmpty Then + ucrBase.OKEnabled(True) + Else + ucrBase.OKEnabled(False) + End If + End Sub + + Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset + SetDefaults() + SetRCodeForControls(True) + TestOKEnabled() + End Sub + + Private Sub ucrSelectorDistance_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectorDistance.ControlValueChanged + clsOpeningOperator.AddParameter("left", clsRFunctionParameter:=ucrSelectorDistance.ucrAvailableDataFrames.clsCurrDataFrame, iPosition:=0) + End Sub + + Private Sub ucrReceiverLat_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverLat.ControlValueChanged + If Not ucrReceiverLat.IsEmpty Then + clsConc2Function.AddParameter("lat", ucrReceiverLat.GetVariableNames, iPosition:=1, bIncludeArgumentName:=False) + Else + clsConc2Function.RemoveParameterByName("lat") + End If + End Sub + + Private Sub ucrReceiverLong_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverLong.ControlValueChanged + If Not ucrReceiverLong.IsEmpty Then + clsConc2Function.AddParameter("long", ucrReceiverLong.GetVariableNames, iPosition:=0, bIncludeArgumentName:=False) + Else + clsConc2Function.RemoveParameterByName("long") + End If + End Sub + + Private Sub ucrReceiverLat_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverLat.ControlContentsChanged, ucrReceiverLong.ControlContentsChanged, ucrSaveDistance.ControlContentsChanged + TestOKEnabled() + End Sub + + Private Sub ucrInputLat_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputLat.ControlValueChanged + If Not ucrInputLat.IsEmpty Then + clsConcFunction.AddParameter("lat", ucrInputLat.GetText, iPosition:=1, bIncludeArgumentName:=False) + Else + clsConcFunction.RemoveParameterByName("lat") + End If + End Sub + + Private Sub ucrInputLon_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputLon.ControlValueChanged + If Not ucrInputLon.IsEmpty Then + clsConcFunction.AddParameter("lon", ucrInputLon.GetText, iPosition:=0, bIncludeArgumentName:=False) + Else + clsConcFunction.RemoveParameterByName("lon") + End If + End Sub + +End Class \ No newline at end of file diff --git a/instat/dlgEndOfRainsSeason.vb b/instat/dlgEndOfRainsSeason.vb index 2067cedc683..8bf2b645f9b 100644 --- a/instat/dlgEndOfRainsSeason.vb +++ b/instat/dlgEndOfRainsSeason.vb @@ -29,7 +29,7 @@ Public Class dlgEndOfRainsSeason #Region "general_code_structures" ' General - Private clsRunCalculation As New RFunction + Private clsRunCalculation, clsListCalFunction, clsDummyFunction As New RFunction Private clsFirstOrLastFunction As New RFunction ' Group by @@ -243,8 +243,8 @@ Public Class dlgEndOfRainsSeason ucrInputEndRainDoy.SetValidationTypeAsRVariable() ucrInputEndRainDoy.SetDataFrameSelector(ucrSelectorForWaterBalance.ucrAvailableDataFrames) - ucrChkEndofRainsDate.AddParameterPresentCondition(True, "sub2") - ucrChkEndofRainsDate.AddParameterPresentCondition(False, "sub2", False) + ucrChkEndofRainsDate.AddParameterValuesCondition(True, "sub2", "True") + ucrChkEndofRainsDate.AddParameterValuesCondition(False, "sub2", "False") ucrChkEndofRainsDate.SetText("Date") ucrInputEndofRainsDate.SetParameter(New RParameter("result_name", 2)) @@ -252,8 +252,8 @@ Public Class dlgEndOfRainsSeason ucrInputEndofRainsDate.SetDataFrameSelector(ucrSelectorForWaterBalance.ucrAvailableDataFrames) ucrChkEndofRainsOccurence.SetText("Occurrence") - ucrChkEndofRainsOccurence.AddParameterPresentCondition(True, "sub3") - ucrChkEndofRainsOccurence.AddParameterPresentCondition(False, "sub3", False) + ucrChkEndofRainsOccurence.AddParameterValuesCondition(True, "sub3", "True") + ucrChkEndofRainsOccurence.AddParameterValuesCondition(False, "sub3", "False") ucrInputEndofRainsOccurence.SetParameter(New RParameter("result_name", 2)) ucrInputEndofRainsOccurence.SetValidationTypeAsRVariable() @@ -289,15 +289,15 @@ Public Class dlgEndOfRainsSeason ucrInputSeasonDoy.SetDataFrameSelector(ucrSelectorForWaterBalance.ucrAvailableDataFrames) ucrChkEndofSeasonDate.SetText("Date") - ucrChkEndofSeasonDate.AddParameterPresentCondition(True, "sub2") - ucrChkEndofSeasonDate.AddParameterPresentCondition(False, "sub2", False) + ucrChkEndofSeasonDate.AddParameterValuesCondition(True, "sub2", "True") + ucrChkEndofSeasonDate.AddParameterValuesCondition(False, "sub2", "False") ucrInputEndofSeasonDate.SetParameter(New RParameter("result_name", 3)) ucrInputEndofSeasonDate.SetValidationTypeAsRVariable() ucrInputEndofSeasonDate.SetDataFrameSelector(ucrSelectorForWaterBalance.ucrAvailableDataFrames) - ucrChkEndofSeasonOccurence.AddParameterPresentCondition(True, "sub3") - ucrChkEndofSeasonOccurence.AddParameterPresentCondition(False, "sub3", False) + ucrChkEndofSeasonOccurence.AddParameterValuesCondition(True, "sub3", "True") + ucrChkEndofSeasonOccurence.AddParameterValuesCondition(False, "sub3", "False") ucrChkEndofSeasonOccurence.SetText("Occurrence") ucrInputEndofSeasonOccurence.SetParameter(New RParameter("result_name", 2)) @@ -363,6 +363,7 @@ Public Class dlgEndOfRainsSeason #Region "clear_code_structures" ' General clsRunCalculation.Clear() + clsListCalFunction.Clear() clsFirstOrLastFunction.Clear() ' Group by @@ -498,6 +499,10 @@ Public Class dlgEndOfRainsSeason ucrNudCapacity.SetText("100") ucrNudWBLessThan.SetText("0.5") + clsDummyFunction = New RFunction + clsDummyFunction.AddParameter("sub2", "True", iPosition:=0) + clsDummyFunction.AddParameter("sub3", "True", iPosition:=1) + ' Group by clsGroupByStationYearCalc.SetRCommand("instat_calculation$new") clsGroupByStationYearCalc.AddParameter("type", Chr(34) & "by" & Chr(34), iPosition:=0) @@ -644,9 +649,13 @@ Public Class dlgEndOfRainsSeason clsEndRainsCombinationSubCalcList.SetRCommand("list") clsEndRainsCombinationSubCalcList.AddParameter("sub1", clsRFunctionParameter:=clsEndRainsLastDoySummaryCalc, bIncludeArgumentName:=False, iPosition:=0) + clsListCalFunction.SetRCommand("list") + clsListCalFunction.AddParameter("drop", "FALSE", iPosition:=0) + clsRunCalculation.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$run_instat_calculation") clsRunCalculation.AddParameter("display", "FALSE") clsRunCalculation.AddParameter("calc", clsRFunctionParameter:=clsEndRainsCombinationCalc) + clsRunCalculation.AddParameter("param_list", clsRFunctionParameter:=clsListCalFunction, iPosition:=2) ucrBase.clsRsyntax.SetBaseRFunction(clsRunCalculation) #End Region @@ -952,14 +961,14 @@ Public Class dlgEndOfRainsSeason End If ucrChkEndofSeasonDoy.SetRCode(clsEndSeasonCombinationSubCalcList, bReset) - ucrChkEndofSeasonDate.SetRCode(clsEndSeasonCombinationSubCalcList, bReset) - ucrChkEndofSeasonOccurence.SetRCode(clsEndSeasonCombinationSubCalcList, bReset) + ucrChkEndofSeasonDate.SetRCode(clsDummyFunction, bReset) + ucrChkEndofSeasonOccurence.SetRCode(clsDummyFunction, bReset) ucrNudAmount.SetRCode(clsEndRainsRollSumRainConditionOperator, bReset) ucrNudTotalOverDays.SetRCode(clsRollSumRainFunction, bReset) ucrChkEndofRainsDoy.SetRCode(clsEndRainsCombinationSubCalcList, bReset) - ucrChkEndofRainsDate.SetRCode(clsEndRainsCombinationSubCalcList, bReset) - ucrChkEndofRainsOccurence.SetRCode(clsEndRainsCombinationSubCalcList, bReset) + ucrChkEndofRainsDate.SetRCode(clsDummyFunction, bReset) + ucrChkEndofRainsOccurence.SetRCode(clsDummyFunction, bReset) ucrPnlEndOfRainsAndSeasons.SetRCode(clsFirstOrLastFunction, bReset) End Sub diff --git a/instat/dlgExportToClimsoft.Designer.vb b/instat/dlgExportToClimsoft.Designer.vb index 5e3e78b822a..04cd11be29c 100644 --- a/instat/dlgExportToClimsoft.Designer.vb +++ b/instat/dlgExportToClimsoft.Designer.vb @@ -25,27 +25,32 @@ Partial Class dlgExportToClimsoft Me.lblElement = New System.Windows.Forms.Label() Me.lblDate = New System.Windows.Forms.Label() Me.lblHour = New System.Windows.Forms.Label() - Me.lblLevel = New System.Windows.Forms.Label() - Me.lblStation = New System.Windows.Forms.Label() Me.lblExport = New System.Windows.Forms.Label() Me.cmdBrowse = New System.Windows.Forms.Button() - Me.ucrChkExportDataFrame = New instat.ucrCheck() + Me.rdoHourly = New System.Windows.Forms.RadioButton() + Me.rdoDaily = New System.Windows.Forms.RadioButton() + Me.lblStationID = New System.Windows.Forms.Label() + Me.rdoExportData = New System.Windows.Forms.RadioButton() + Me.rdoNewDataFrame = New System.Windows.Forms.RadioButton() + Me.grpSave = New System.Windows.Forms.GroupBox() + Me.rdoExportComments = New System.Windows.Forms.RadioButton() + Me.ucrDataFrameSheets = New instat.ucrDataFrame() + Me.ucrPnlOutput = New instat.UcrPanel() + Me.ucrReceiverStationID = New instat.ucrReceiverSingle() Me.ucrInputExportFile = New instat.ucrInputTextBox() - Me.ucrReceiverStation = New instat.ucrReceiverSingle() Me.ucrSaveNewDataFrame = New instat.ucrSave() - Me.ucrChkNewDataFrame = New instat.ucrCheck() - Me.ucrInputLevel = New instat.ucrInputTextBox() Me.ucrInputHour = New instat.ucrInputTextBox() Me.ucrBase = New instat.ucrButtons() Me.ucrReceiverElements = New instat.ucrReceiverMultiple() Me.ucrReceiverDate = New instat.ucrReceiverSingle() Me.ucrSelectorImportToClimsoft = New instat.ucrSelectorByDataFrameAddRemove() + Me.ucrPnlDailyHourly = New instat.UcrPanel() Me.SuspendLayout() ' 'lblElement ' Me.lblElement.AutoSize = True - Me.lblElement.Location = New System.Drawing.Point(278, 189) + Me.lblElement.Location = New System.Drawing.Point(278, 179) Me.lblElement.Name = "lblElement" Me.lblElement.Size = New System.Drawing.Size(53, 13) Me.lblElement.TabIndex = 10 @@ -54,67 +59,163 @@ Partial Class dlgExportToClimsoft 'lblDate ' Me.lblDate.AutoSize = True - Me.lblDate.Location = New System.Drawing.Point(278, 56) + Me.lblDate.Location = New System.Drawing.Point(278, 93) Me.lblDate.Name = "lblDate" Me.lblDate.Size = New System.Drawing.Size(33, 13) - Me.lblDate.TabIndex = 11 + Me.lblDate.TabIndex = 6 Me.lblDate.Text = "Date:" ' 'lblHour ' Me.lblHour.AutoSize = True - Me.lblHour.Location = New System.Drawing.Point(278, 100) + Me.lblHour.Location = New System.Drawing.Point(278, 136) Me.lblHour.Name = "lblHour" Me.lblHour.Size = New System.Drawing.Size(33, 13) - Me.lblHour.TabIndex = 20 + Me.lblHour.TabIndex = 8 Me.lblHour.Text = "Hour:" ' - 'lblLevel - ' - Me.lblLevel.AutoSize = True - Me.lblLevel.Location = New System.Drawing.Point(278, 144) - Me.lblLevel.Name = "lblLevel" - Me.lblLevel.Size = New System.Drawing.Size(36, 13) - Me.lblLevel.TabIndex = 21 - Me.lblLevel.Text = "Level:" - ' - 'lblStation - ' - Me.lblStation.AutoSize = True - Me.lblStation.Location = New System.Drawing.Point(278, 15) - Me.lblStation.Name = "lblStation" - Me.lblStation.Size = New System.Drawing.Size(43, 13) - Me.lblStation.TabIndex = 69 - Me.lblStation.Text = "Station:" - ' 'lblExport ' Me.lblExport.AutoSize = True Me.lblExport.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblExport.Location = New System.Drawing.Point(9, 377) + Me.lblExport.Location = New System.Drawing.Point(9, 431) Me.lblExport.Name = "lblExport" Me.lblExport.Size = New System.Drawing.Size(59, 13) - Me.lblExport.TabIndex = 71 + Me.lblExport.TabIndex = 15 Me.lblExport.Text = "Export File:" ' 'cmdBrowse ' Me.cmdBrowse.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdBrowse.Location = New System.Drawing.Point(326, 372) + Me.cmdBrowse.Location = New System.Drawing.Point(326, 426) Me.cmdBrowse.Name = "cmdBrowse" Me.cmdBrowse.Size = New System.Drawing.Size(80, 23) - Me.cmdBrowse.TabIndex = 73 + Me.cmdBrowse.TabIndex = 17 Me.cmdBrowse.Text = "Browse" Me.cmdBrowse.UseVisualStyleBackColor = True ' - 'ucrChkExportDataFrame - ' - Me.ucrChkExportDataFrame.AutoSize = True - Me.ucrChkExportDataFrame.Checked = False - Me.ucrChkExportDataFrame.Location = New System.Drawing.Point(9, 306) - Me.ucrChkExportDataFrame.Name = "ucrChkExportDataFrame" - Me.ucrChkExportDataFrame.Size = New System.Drawing.Size(266, 23) - Me.ucrChkExportDataFrame.TabIndex = 74 + 'rdoHourly + ' + Me.rdoHourly.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoHourly.BackColor = System.Drawing.SystemColors.Control + Me.rdoHourly.Enabled = False + Me.rdoHourly.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoHourly.FlatAppearance.BorderSize = 2 + Me.rdoHourly.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoHourly.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoHourly.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoHourly.Location = New System.Drawing.Point(190, 8) + Me.rdoHourly.Name = "rdoHourly" + Me.rdoHourly.Size = New System.Drawing.Size(91, 28) + Me.rdoHourly.TabIndex = 2 + Me.rdoHourly.TabStop = True + Me.rdoHourly.Tag = "Frequency" + Me.rdoHourly.Text = "Hourly" + Me.rdoHourly.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoHourly.UseVisualStyleBackColor = False + ' + 'rdoDaily + ' + Me.rdoDaily.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoDaily.BackColor = System.Drawing.SystemColors.Control + Me.rdoDaily.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoDaily.FlatAppearance.BorderSize = 2 + Me.rdoDaily.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoDaily.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoDaily.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoDaily.Location = New System.Drawing.Point(101, 8) + Me.rdoDaily.Name = "rdoDaily" + Me.rdoDaily.Size = New System.Drawing.Size(91, 28) + Me.rdoDaily.TabIndex = 1 + Me.rdoDaily.TabStop = True + Me.rdoDaily.Tag = "Frequency" + Me.rdoDaily.Text = "Daily" + Me.rdoDaily.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoDaily.UseVisualStyleBackColor = False + ' + 'lblStationID + ' + Me.lblStationID.AutoSize = True + Me.lblStationID.Location = New System.Drawing.Point(279, 56) + Me.lblStationID.Name = "lblStationID" + Me.lblStationID.Size = New System.Drawing.Size(57, 13) + Me.lblStationID.TabIndex = 4 + Me.lblStationID.Text = "Station ID:" + ' + 'rdoExportData + ' + Me.rdoExportData.AutoSize = True + Me.rdoExportData.Location = New System.Drawing.Point(15, 281) + Me.rdoExportData.Name = "rdoExportData" + Me.rdoExportData.Size = New System.Drawing.Size(107, 17) + Me.rdoExportData.TabIndex = 94 + Me.rdoExportData.TabStop = True + Me.rdoExportData.Text = "Export Data (csv)" + Me.rdoExportData.UseVisualStyleBackColor = True + ' + 'rdoNewDataFrame + ' + Me.rdoNewDataFrame.AutoSize = True + Me.rdoNewDataFrame.Location = New System.Drawing.Point(15, 252) + Me.rdoNewDataFrame.Name = "rdoNewDataFrame" + Me.rdoNewDataFrame.Size = New System.Drawing.Size(105, 17) + Me.rdoNewDataFrame.TabIndex = 93 + Me.rdoNewDataFrame.TabStop = True + Me.rdoNewDataFrame.Text = "New Data Frame" + Me.rdoNewDataFrame.UseVisualStyleBackColor = True + ' + 'grpSave + ' + Me.grpSave.Location = New System.Drawing.Point(8, 237) + Me.grpSave.Name = "grpSave" + Me.grpSave.Size = New System.Drawing.Size(165, 109) + Me.grpSave.TabIndex = 96 + Me.grpSave.TabStop = False + Me.grpSave.Text = "Save" + ' + 'rdoExportComments + ' + Me.rdoExportComments.AutoSize = True + Me.rdoExportComments.Location = New System.Drawing.Point(15, 306) + Me.rdoExportComments.Name = "rdoExportComments" + Me.rdoExportComments.Size = New System.Drawing.Size(107, 17) + Me.rdoExportComments.TabIndex = 97 + Me.rdoExportComments.TabStop = True + Me.rdoExportComments.Text = "Export Comments" + Me.rdoExportComments.UseVisualStyleBackColor = True + ' + 'ucrDataFrameSheets + ' + Me.ucrDataFrameSheets.AutoSize = True + Me.ucrDataFrameSheets.bDropUnusedFilterLevels = False + Me.ucrDataFrameSheets.bUseCurrentFilter = True + Me.ucrDataFrameSheets.Location = New System.Drawing.Point(11, 349) + Me.ucrDataFrameSheets.Margin = New System.Windows.Forms.Padding(0) + Me.ucrDataFrameSheets.Name = "ucrDataFrameSheets" + Me.ucrDataFrameSheets.Size = New System.Drawing.Size(151, 50) + Me.ucrDataFrameSheets.TabIndex = 89 + ' + 'ucrPnlOutput + ' + Me.ucrPnlOutput.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlOutput.Location = New System.Drawing.Point(12, 251) + Me.ucrPnlOutput.Margin = New System.Windows.Forms.Padding(6) + Me.ucrPnlOutput.Name = "ucrPnlOutput" + Me.ucrPnlOutput.Size = New System.Drawing.Size(151, 86) + Me.ucrPnlOutput.TabIndex = 95 + ' + 'ucrReceiverStationID + ' + Me.ucrReceiverStationID.AutoSize = True + Me.ucrReceiverStationID.frmParent = Me + Me.ucrReceiverStationID.Location = New System.Drawing.Point(276, 73) + Me.ucrReceiverStationID.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverStationID.Name = "ucrReceiverStationID" + Me.ucrReceiverStationID.Selector = Nothing + Me.ucrReceiverStationID.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverStationID.strNcFilePath = "" + Me.ucrReceiverStationID.TabIndex = 5 + Me.ucrReceiverStationID.ucrSelector = Nothing ' 'ucrInputExportFile ' @@ -122,53 +223,20 @@ Partial Class dlgExportToClimsoft Me.ucrInputExportFile.AutoSize = True Me.ucrInputExportFile.IsMultiline = False Me.ucrInputExportFile.IsReadOnly = False - Me.ucrInputExportFile.Location = New System.Drawing.Point(142, 373) + Me.ucrInputExportFile.Location = New System.Drawing.Point(142, 427) Me.ucrInputExportFile.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) Me.ucrInputExportFile.Name = "ucrInputExportFile" Me.ucrInputExportFile.Size = New System.Drawing.Size(182, 21) - Me.ucrInputExportFile.TabIndex = 72 - ' - 'ucrReceiverStation - ' - Me.ucrReceiverStation.AutoSize = True - Me.ucrReceiverStation.frmParent = Me - Me.ucrReceiverStation.Location = New System.Drawing.Point(278, 33) - Me.ucrReceiverStation.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverStation.Name = "ucrReceiverStation" - Me.ucrReceiverStation.Selector = Nothing - Me.ucrReceiverStation.Size = New System.Drawing.Size(120, 20) - Me.ucrReceiverStation.strNcFilePath = "" - Me.ucrReceiverStation.TabIndex = 70 - Me.ucrReceiverStation.ucrSelector = Nothing + Me.ucrInputExportFile.TabIndex = 16 ' 'ucrSaveNewDataFrame ' Me.ucrSaveNewDataFrame.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrSaveNewDataFrame.Location = New System.Drawing.Point(9, 338) + Me.ucrSaveNewDataFrame.Location = New System.Drawing.Point(9, 399) Me.ucrSaveNewDataFrame.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.ucrSaveNewDataFrame.Name = "ucrSaveNewDataFrame" Me.ucrSaveNewDataFrame.Size = New System.Drawing.Size(348, 24) - Me.ucrSaveNewDataFrame.TabIndex = 68 - ' - 'ucrChkNewDataFrame - ' - Me.ucrChkNewDataFrame.AutoSize = True - Me.ucrChkNewDataFrame.Checked = False - Me.ucrChkNewDataFrame.Location = New System.Drawing.Point(9, 277) - Me.ucrChkNewDataFrame.Name = "ucrChkNewDataFrame" - Me.ucrChkNewDataFrame.Size = New System.Drawing.Size(266, 23) - Me.ucrChkNewDataFrame.TabIndex = 22 - ' - 'ucrInputLevel - ' - Me.ucrInputLevel.AddQuotesIfUnrecognised = True - Me.ucrInputLevel.AutoSize = True - Me.ucrInputLevel.IsMultiline = False - Me.ucrInputLevel.IsReadOnly = False - Me.ucrInputLevel.Location = New System.Drawing.Point(278, 162) - Me.ucrInputLevel.Name = "ucrInputLevel" - Me.ucrInputLevel.Size = New System.Drawing.Size(119, 21) - Me.ucrInputLevel.TabIndex = 19 + Me.ucrSaveNewDataFrame.TabIndex = 14 ' 'ucrInputHour ' @@ -176,45 +244,46 @@ Partial Class dlgExportToClimsoft Me.ucrInputHour.AutoSize = True Me.ucrInputHour.IsMultiline = False Me.ucrInputHour.IsReadOnly = False - Me.ucrInputHour.Location = New System.Drawing.Point(278, 119) + Me.ucrInputHour.Location = New System.Drawing.Point(278, 153) + Me.ucrInputHour.Margin = New System.Windows.Forms.Padding(9) Me.ucrInputHour.Name = "ucrInputHour" Me.ucrInputHour.Size = New System.Drawing.Size(119, 21) - Me.ucrInputHour.TabIndex = 18 + Me.ucrInputHour.TabIndex = 9 ' 'ucrBase ' Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(7, 403) + Me.ucrBase.Location = New System.Drawing.Point(7, 459) Me.ucrBase.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(408, 52) - Me.ucrBase.TabIndex = 17 + Me.ucrBase.TabIndex = 18 ' 'ucrReceiverElements ' Me.ucrReceiverElements.AutoSize = True Me.ucrReceiverElements.frmParent = Me - Me.ucrReceiverElements.Location = New System.Drawing.Point(278, 209) + Me.ucrReceiverElements.Location = New System.Drawing.Point(278, 199) Me.ucrReceiverElements.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverElements.Name = "ucrReceiverElements" Me.ucrReceiverElements.Selector = Nothing Me.ucrReceiverElements.Size = New System.Drawing.Size(120, 100) Me.ucrReceiverElements.strNcFilePath = "" - Me.ucrReceiverElements.TabIndex = 6 + Me.ucrReceiverElements.TabIndex = 11 Me.ucrReceiverElements.ucrSelector = Nothing ' 'ucrReceiverDate ' Me.ucrReceiverDate.AutoSize = True Me.ucrReceiverDate.frmParent = Me - Me.ucrReceiverDate.Location = New System.Drawing.Point(278, 74) + Me.ucrReceiverDate.Location = New System.Drawing.Point(278, 110) Me.ucrReceiverDate.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverDate.Name = "ucrReceiverDate" Me.ucrReceiverDate.Selector = Nothing Me.ucrReceiverDate.Size = New System.Drawing.Size(120, 20) Me.ucrReceiverDate.strNcFilePath = "" - Me.ucrReceiverDate.TabIndex = 5 + Me.ucrReceiverDate.TabIndex = 7 Me.ucrReceiverDate.ucrSelector = Nothing ' 'ucrSelectorImportToClimsoft @@ -223,29 +292,42 @@ Partial Class dlgExportToClimsoft Me.ucrSelectorImportToClimsoft.bDropUnusedFilterLevels = False Me.ucrSelectorImportToClimsoft.bShowHiddenColumns = False Me.ucrSelectorImportToClimsoft.bUseCurrentFilter = True - Me.ucrSelectorImportToClimsoft.Location = New System.Drawing.Point(9, 10) + Me.ucrSelectorImportToClimsoft.Location = New System.Drawing.Point(9, 52) Me.ucrSelectorImportToClimsoft.Margin = New System.Windows.Forms.Padding(0) Me.ucrSelectorImportToClimsoft.Name = "ucrSelectorImportToClimsoft" Me.ucrSelectorImportToClimsoft.Size = New System.Drawing.Size(213, 183) - Me.ucrSelectorImportToClimsoft.TabIndex = 1 + Me.ucrSelectorImportToClimsoft.TabIndex = 3 + ' + 'ucrPnlDailyHourly + ' + Me.ucrPnlDailyHourly.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlDailyHourly.Location = New System.Drawing.Point(91, 8) + Me.ucrPnlDailyHourly.Margin = New System.Windows.Forms.Padding(4) + Me.ucrPnlDailyHourly.Name = "ucrPnlDailyHourly" + Me.ucrPnlDailyHourly.Size = New System.Drawing.Size(207, 28) + Me.ucrPnlDailyHourly.TabIndex = 0 ' 'dlgExportToClimsoft ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True - Me.ClientSize = New System.Drawing.Size(417, 460) - Me.Controls.Add(Me.ucrChkExportDataFrame) + Me.ClientSize = New System.Drawing.Size(417, 467) + Me.Controls.Add(Me.rdoExportComments) + Me.Controls.Add(Me.rdoExportData) + Me.Controls.Add(Me.rdoNewDataFrame) + Me.Controls.Add(Me.ucrDataFrameSheets) + Me.Controls.Add(Me.ucrPnlOutput) + Me.Controls.Add(Me.grpSave) + Me.Controls.Add(Me.lblStationID) + Me.Controls.Add(Me.ucrReceiverStationID) + Me.Controls.Add(Me.rdoDaily) + Me.Controls.Add(Me.rdoHourly) Me.Controls.Add(Me.lblExport) Me.Controls.Add(Me.cmdBrowse) Me.Controls.Add(Me.ucrInputExportFile) - Me.Controls.Add(Me.ucrReceiverStation) - Me.Controls.Add(Me.lblStation) Me.Controls.Add(Me.ucrSaveNewDataFrame) - Me.Controls.Add(Me.ucrChkNewDataFrame) - Me.Controls.Add(Me.lblLevel) Me.Controls.Add(Me.lblHour) - Me.Controls.Add(Me.ucrInputLevel) Me.Controls.Add(Me.ucrInputHour) Me.Controls.Add(Me.ucrBase) Me.Controls.Add(Me.lblDate) @@ -253,6 +335,7 @@ Partial Class dlgExportToClimsoft Me.Controls.Add(Me.ucrReceiverElements) Me.Controls.Add(Me.ucrReceiverDate) Me.Controls.Add(Me.ucrSelectorImportToClimsoft) + Me.Controls.Add(Me.ucrPnlDailyHourly) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog Me.Name = "dlgExportToClimsoft" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent @@ -268,16 +351,21 @@ Partial Class dlgExportToClimsoft Friend WithEvents lblElement As Label Friend WithEvents lblDate As Label Friend WithEvents ucrBase As ucrButtons - Friend WithEvents lblLevel As Label Friend WithEvents lblHour As Label - Friend WithEvents ucrInputLevel As ucrInputTextBox Friend WithEvents ucrInputHour As ucrInputTextBox - Friend WithEvents ucrChkNewDataFrame As ucrCheck Friend WithEvents ucrSaveNewDataFrame As ucrSave - Friend WithEvents lblStation As Label - Friend WithEvents ucrReceiverStation As ucrReceiverSingle Friend WithEvents lblExport As Label Friend WithEvents cmdBrowse As Button Friend WithEvents ucrInputExportFile As ucrInputTextBox - Friend WithEvents ucrChkExportDataFrame As ucrCheck + Friend WithEvents rdoDaily As RadioButton + Friend WithEvents rdoHourly As RadioButton + Friend WithEvents ucrPnlDailyHourly As UcrPanel + Friend WithEvents lblStationID As Label + Friend WithEvents ucrReceiverStationID As ucrReceiverSingle + Friend WithEvents rdoExportData As RadioButton + Friend WithEvents rdoNewDataFrame As RadioButton + Friend WithEvents ucrDataFrameSheets As ucrDataFrame + Friend WithEvents ucrPnlOutput As UcrPanel + Friend WithEvents grpSave As GroupBox + Friend WithEvents rdoExportComments As RadioButton End Class diff --git a/instat/dlgExportToClimsoft.vb b/instat/dlgExportToClimsoft.vb index 91876cd7eaf..5db37c474ee 100644 --- a/instat/dlgExportToClimsoft.vb +++ b/instat/dlgExportToClimsoft.vb @@ -20,7 +20,7 @@ Imports instat.Translations Public Class dlgExportToClimsoft Private bFirstLoad As Boolean = True Private bReset As Boolean = True - Private clsDataFrameFunction, clsCurrentNewColumnFunction, clsDummyFunction, clsMutateFunction, clsExportClimsoftFunction As New RFunction + Private clsDataFrameFunction, clsGetDataFrameFunction, clsCurrentNewColumnFunction, clsDummyFunction, clsMutateFunction, clsExportClimsoftFunction, clsPasteFunction, clsSprintfFunction, clsPosixctFunction, clsExportCommentsFunction As New RFunction Private clsPipeOperator As New ROperator Private Sub dlgExportToClimsoft_Load(sender As Object, e As EventArgs) Handles MyBase.Load @@ -35,15 +35,26 @@ Public Class dlgExportToClimsoft bReset = False TestOkEnabled() autoTranslate(Me) - AddStationName() End Sub Private Sub InitialiseDialog() - ucrBase.iHelpTopicID=476 - ucrReceiverStation.SetClimaticType("station") - ucrReceiverStation.bAutoFill = True - ucrReceiverStation.Selector = ucrSelectorImportToClimsoft - ucrReceiverStation.SetLinkedDisplayControl(lblStation) + ucrBase.iHelpTopicID = 476 + ucrReceiverStationID.SetParameter(New RParameter("station_id", 1)) + ucrReceiverStationID.SetParameterIsRFunction() + ucrReceiverStationID.SetLinkedDisplayControl(lblStationID) + ucrReceiverStationID.Selector = ucrSelectorImportToClimsoft + + ucrDataFrameSheets.SetParameter(New RParameter("x", 0)) + ucrDataFrameSheets.SetParameterIsRFunction() + + ucrPnlOutput.AddRadioButton(rdoNewDataFrame) + ucrPnlOutput.AddRadioButton(rdoExportData) + ucrPnlOutput.AddRadioButton(rdoExportComments) + ucrPnlOutput.AddParameterValuesCondition(rdoNewDataFrame, "check", "dataframe") + ucrPnlOutput.AddParameterValuesCondition(rdoExportData, "check", "export") + ucrPnlOutput.AddParameterValuesCondition(rdoExportComments, "check", "comments") + + ucrPnlOutput.AddToLinkedControls({ucrDataFrameSheets, ucrInputExportFile}, {rdoExportComments}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True) ucrReceiverDate.SetParameter(New RParameter("date", 2)) ucrReceiverDate.SetParameterIsRFunction() @@ -52,27 +63,19 @@ Public Class dlgExportToClimsoft ucrReceiverDate.Selector = ucrSelectorImportToClimsoft ucrReceiverDate.bAutoFill = True + ucrPnlDailyHourly.AddRadioButton(rdoDaily) + ucrPnlDailyHourly.AddRadioButton(rdoHourly) + ucrPnlDailyHourly.AddParameterValuesCondition(rdoDaily, "checked", "daily") + ucrPnlDailyHourly.AddParameterValuesCondition(rdoHourly, "checked", "hourly") + ucrInputHour.SetParameter(New RParameter("hour", 3)) ucrInputHour.SetLinkedDisplayControl(lblHour) - ucrInputLevel.SetParameter(New RParameter("level", 4)) - ucrInputLevel.SetLinkedDisplayControl(lblLevel) - ucrReceiverElements.SetParameter(New RParameter("element", 5, bNewIncludeArgumentName:=False)) ucrReceiverElements.SetParameterIsRFunction() ucrReceiverElements.SetLinkedDisplayControl(lblElement) ucrReceiverElements.Selector = ucrSelectorImportToClimsoft - ucrChkNewDataFrame.SetText("New Data Frame Name") - ucrChkNewDataFrame.AddToLinkedControls(ucrSaveNewDataFrame, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - ucrChkNewDataFrame.AddParameterValuesCondition(True, "dataframe", "True") - ucrChkNewDataFrame.AddParameterValuesCondition(False, "dataframe", "False") - - ucrChkExportDataFrame.SetText(" Export Data Frame(s)") - ucrChkExportDataFrame.AddToLinkedControls(ucrInputExportFile, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - ucrChkExportDataFrame.AddParameterValuesCondition(True, "export", "True") - ucrChkExportDataFrame.AddParameterValuesCondition(False, "export", "False") - ucrSaveNewDataFrame.SetSaveTypeAsDataFrame() ucrSaveNewDataFrame.SetIsTextBox() ucrSaveNewDataFrame.SetLabelText("Data Frame Name:") @@ -80,7 +83,6 @@ Public Class dlgExportToClimsoft ucrInputExportFile.SetParameter(New RParameter("file", 1)) ucrInputExportFile.IsReadOnly = True ucrInputExportFile.SetLinkedDisplayControl(lblExport) - End Sub Private Sub SetDefaults() @@ -89,18 +91,27 @@ Public Class dlgExportToClimsoft clsCurrentNewColumnFunction = New RFunction clsMutateFunction = New RFunction clsExportClimsoftFunction = New RFunction + clsPasteFunction = New RFunction + clsSprintfFunction = New RFunction + clsExportCommentsFunction = New RFunction clsPipeOperator = New ROperator ucrSelectorImportToClimsoft.Reset() ucrSaveNewDataFrame.Reset() - ucrReceiverElements.SetMeAsReceiver() + ucrReceiverStationID.SetMeAsReceiver() clsDummyFunction.AddParameter("dataframe", "True", iPosition:=0) clsDummyFunction.AddParameter("export", "False", iPosition:=1) + clsDummyFunction.AddParameter("checked", "daily", iPosition:=2) + clsDummyFunction.AddParameter("value", "True", iPosition:=3) + clsDummyFunction.AddParameter("check", "dataframe", iPosition:=4) + + clsPosixctFunction.SetRCommand("as.POSIXct") + clsPosixctFunction.AddParameter("x", clsRFunctionParameter:=clsPasteFunction, bIncludeArgumentName:=False, iPosition:=0) + clsPosixctFunction.AddParameter("format", Chr(34) & "%Y-%m-%d %H:%M:%S" & Chr(34), iPosition:=1) clsDataFrameFunction.SetRCommand("data.frame") - clsDataFrameFunction.AddParameter("hour", 6, iPosition:=3) - clsDataFrameFunction.AddParameter("level", "surface", iPosition:=4) + clsDataFrameFunction.AddParameter("date_time", clsRFunctionParameter:=clsPosixctFunction, iPosition:=4) clsDataFrameFunction.AddParameter("x", "columns", iPosition:=5, bIncludeArgumentName:=False) clsPipeOperator.SetOperation("%>%") @@ -110,40 +121,68 @@ Public Class dlgExportToClimsoft clsMutateFunction.SetPackageName("dplyr") clsMutateFunction.SetRCommand("mutate") - clsExportClimsoftFunction.SetPackageName("rio") - clsExportClimsoftFunction.SetRCommand("export") - clsExportClimsoftFunction.AddParameter("x", clsROperatorParameter:=clsPipeOperator, iPosition:=0) + clsExportClimsoftFunction.SetRCommand("write.csv") + clsExportClimsoftFunction.AddParameter("x", clsROperatorParameter:=clsPipeOperator, iPosition:=0, bIncludeArgumentName:=False) + clsPasteFunction.SetRCommand("paste") + clsPasteFunction.SetAssignTo("date1") + + clsSprintfFunction.SetRCommand("sprintf") + clsSprintfFunction.AddParameter("hour", 6, iPosition:=1, bIncludeArgumentName:=False) + + clsGetDataFrameFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_data_frame") + clsGetDataFrameFunction.SetAssignTo(ucrDataFrameSheets.cboAvailableDataFrames.Text) + + clsExportCommentsFunction.SetPackageName("rio") + clsExportCommentsFunction.SetRCommand("export") + clsExportCommentsFunction.AddParameter("x", clsRFunctionParameter:=clsGetDataFrameFunction, iPosition:=1) + + ucrBase.clsRsyntax.ClearCodes() ucrBase.clsRsyntax.SetBaseROperator(clsPipeOperator) - ucrBase.clsRsyntax.AddToBeforeCodes(clsCurrentNewColumnFunction) + ucrBase.clsRsyntax.AddToBeforeCodes(clsCurrentNewColumnFunction, iPosition:=0) + ucrBase.clsRsyntax.AddToBeforeCodes(clsPasteFunction, iPosition:=1) DataFrameAssignTo() End Sub Private Sub SetRCodeForControls(bReset As Boolean) - ucrReceiverDate.SetRCode(clsDataFrameFunction, bReset) - ucrInputHour.SetRCode(clsDataFrameFunction, bReset) - ucrInputLevel.SetRCode(clsDataFrameFunction, bReset) + ucrInputExportFile.AddAdditionalCodeParameterPair(clsExportCommentsFunction, New RParameter("file", 0), iAdditionalPairNo:=1) + + ucrReceiverDate.SetRCode(clsPasteFunction, bReset) + ucrInputHour.SetRCode(clsSprintfFunction, bReset) + ucrReceiverStationID.SetRCode(clsDataFrameFunction, bReset) ucrSaveNewDataFrame.SetRCode(clsPipeOperator, bReset) ucrInputExportFile.SetRCode(clsExportClimsoftFunction, bReset) + ucrPnlDailyHourly.SetRCode(clsDummyFunction, bReset) If bReset Then - ucrChkExportDataFrame.SetRCode(clsDummyFunction, bReset) - ucrChkNewDataFrame.SetRCode(clsDummyFunction, bReset) + ucrPnlOutput.SetRCode(clsDummyFunction, bReset) End If End Sub Private Sub TestOkEnabled() - ucrBase.OKEnabled(Not ucrReceiverDate.IsEmpty _ - AndAlso Not ucrReceiverElements.IsEmpty _ - AndAlso Not ucrReceiverStation.IsEmpty - ) - If ucrChkNewDataFrame.Checked And Not ucrSaveNewDataFrame.IsComplete Then - ucrBase.OKEnabled(False) - End If - If ucrChkExportDataFrame.Checked And ucrInputExportFile.IsEmpty Then - ucrBase.OKEnabled(False) - End If + If rdoNewDataFrame.Checked Then + If Not ucrReceiverDate.IsEmpty AndAlso Not ucrReceiverElements.IsEmpty AndAlso ucrSaveNewDataFrame.IsComplete Then + ucrBase.OKEnabled(True) + Else + ucrBase.OKEnabled(False) + End If + ElseIf rdoExportData.Checked Then + If Not ucrReceiverDate.IsEmpty AndAlso Not ucrReceiverElements.IsEmpty AndAlso Not ucrInputExportFile.IsEmpty Then + ucrBase.OKEnabled(True) + Else + ucrBase.OKEnabled(False) + End If + + Else + If ucrDataFrameSheets.cboAvailableDataFrames.Text <> "" AndAlso Not ucrInputExportFile.IsEmpty Then + ucrBase.OKEnabled(True) + + Else + ucrBase.OKEnabled(False) + + End If + End If End Sub Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset @@ -159,17 +198,12 @@ Public Class dlgExportToClimsoft End If ucrSaveNewDataFrame.SetPrefix(strDataframeName & "__climsoft") - End Sub Private Sub ucrSelectorImportToClimsoft_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectorImportToClimsoft.ControlValueChanged DataFrameAssignTo() End Sub - Private Sub ucrChkNewDataFrame_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkNewDataFrame.ControlValueChanged, ucrChkExportDataFrame.ControlValueChanged - SettingBaseFunction() - End Sub - Private Sub ucrReceiverElements_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverElements.ControlValueChanged ucrBase.clsRsyntax.GetBeforeCodes().Clear() clsCurrentNewColumnFunction = ucrReceiverElements.GetVariables(True).Clone @@ -178,23 +212,21 @@ Public Class dlgExportToClimsoft SettingBaseFunction() End Sub - Private Sub AddStationName() - If ucrReceiverStation.IsEmpty Then - ucrReceiverStation.SetText(ucrSelectorImportToClimsoft.strCurrentDataFrame) - ucrBase.clsRsyntax.SetBaseROperator(clsPipeOperator) - clsPipeOperator.AddParameter("right", clsRFunctionParameter:=clsMutateFunction, iPosition:=1) - Else - clsPipeOperator.RemoveParameterByName("right") - End If - If ucrSelectorImportToClimsoft.lstAvailableVariable.FindItemWithText(ucrReceiverStation.GetVariableNames(False)) Is Nothing Then - clsMutateFunction.AddParameter("station", ucrReceiverStation.GetVariableNames(), iPosition:=0) - clsPipeOperator.AddParameter("right", clsRFunctionParameter:=clsMutateFunction, iPosition:=1) - clsDataFrameFunction.RemoveParameterByName("station") - Else - Dim clsGetVariable As RFunction = ucrReceiverStation.GetVariables - clsGetVariable.SetAssignTo("station") - clsDataFrameFunction.AddParameter("station", clsRFunctionParameter:=clsGetVariable, iPosition:=1) - clsPipeOperator.RemoveParameterByName("right") + Private Sub ucrDataFrameSheets_Load(sender As Object, e As EventArgs) Handles ucrDataFrameSheets.Load + If ucrDataFrameSheets.cboAvailableDataFrames.Items.Count > 0 Then + ' Check if the .comment dataframe exists + Dim bcommentExists As Boolean = False + For Each dataframe As String In ucrDataFrameSheets.cboAvailableDataFrames.Items + If dataframe = ".comment" Then + bcommentExists = True + Exit For + End If + Next + + ' Set .comment as the default selection if it exists + If bcommentExists Then + ucrDataFrameSheets.cboAvailableDataFrames.SelectedItem = ".comment" + End If End If End Sub @@ -203,25 +235,31 @@ Public Class dlgExportToClimsoft End Sub Private Sub SettingBaseFunction() + cmdBrowse.Visible = False - If ucrChkNewDataFrame.Checked And ucrChkExportDataFrame.Checked Then - ucrBase.clsRsyntax.SetBaseROperator(clsPipeOperator) - ucrBase.clsRsyntax.ClearCodes() - ucrBase.clsRsyntax.AddToBeforeCodes(clsCurrentNewColumnFunction) - ucrBase.clsRsyntax.AddToAfterCodes(clsExportClimsoftFunction) - cmdBrowse.Visible = True - ElseIf ucrChkNewDataFrame.Checked AndAlso Not ucrChkExportDataFrame.Checked Then + If rdoNewDataFrame.Checked Then ucrBase.clsRsyntax.SetBaseROperator(clsPipeOperator) ucrBase.clsRsyntax.GetAfterCodes().Clear() cmdBrowse.Visible = False + ucrInputExportFile.Visible = False + ucrSaveNewDataFrame.Visible = True - ElseIf ucrChkExportDataFrame.Checked AndAlso Not ucrChkNewDataFrame.Checked Then - ucrBase.clsRsyntax.GetBeforeCodes().Clear() + ElseIf rdoExportData.Checked Then + ucrBase.clsRsyntax.GetAfterCodes().Clear() ucrBase.clsRsyntax.AddToBeforeCodes(clsCurrentNewColumnFunction) ucrBase.clsRsyntax.SetBaseRFunction(clsExportClimsoftFunction) ucrBase.clsRsyntax.GetAfterCodes().Clear() cmdBrowse.Visible = True + ucrInputExportFile.Visible = True + ucrSaveNewDataFrame.Visible = False + Else + ucrBase.clsRsyntax.ClearCodes() + ucrBase.clsRsyntax.SetBaseRFunction(clsExportCommentsFunction) + cmdBrowse.Visible = True + ucrInputExportFile.Visible = True + ucrSaveNewDataFrame.Visible = False End If + End Sub Private Sub SelectFileToSave() @@ -240,13 +278,9 @@ Public Class dlgExportToClimsoft End Using End Sub - Private Sub ucrReceiverStation_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverStation.ControlValueChanged - AddStationName() - End Sub - Private Sub ucrReceiverElements_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverElements.ControlContentsChanged, - ucrReceiverDate.ControlContentsChanged, ucrReceiverStation.ControlContentsChanged, ucrSaveNewDataFrame.ControlContentsChanged, ucrInputLevel.ControlContentsChanged, - ucrInputLevel.ControlContentsChanged, ucrInputExportFile.ControlContentsChanged, ucrChkExportDataFrame.ControlContentsChanged + ucrReceiverDate.ControlContentsChanged, ucrSaveNewDataFrame.ControlContentsChanged, + ucrReceiverStationID.ControlContentsChanged, ucrInputExportFile.ControlContentsChanged, ucrDataFrameSheets.ControlContentsChanged TestOkEnabled() End Sub @@ -256,4 +290,38 @@ Public Class dlgExportToClimsoft End If SettingBaseFunction() End Sub + + Private Sub ucrDataFrameSheets_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrDataFrameSheets.ControlValueChanged + SettingBaseFunction() + + clsGetDataFrameFunction.AddParameter("data_name", Chr(34) & ucrDataFrameSheets.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) + clsGetDataFrameFunction.SetAssignTo(ucrDataFrameSheets.cboAvailableDataFrames.Text) + + End Sub + + Private Sub ucrInputHour_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputHour.ControlValueChanged + If Not ucrInputHour.IsEmpty Then + clsSprintfFunction.AddParameter("fmt", Chr(34) & "%02d:00:00" & Chr(34), iPosition:=0) + clsSprintfFunction.AddParameter("hour", ucrInputHour.GetText, bIncludeArgumentName:=False, iPosition:=1) + + Else + clsSprintfFunction.RemoveParameterByName("format") + clsSprintfFunction.RemoveParameterByName("hour") + End If + End Sub + + Private Sub ucrReceiverDate_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverDate.ControlValueChanged + If Not ucrReceiverDate.IsEmpty Then + clsPasteFunction.AddParameter("date_time", clsRFunctionParameter:=clsSprintfFunction, iPosition:=3, bIncludeArgumentName:=False) + Else + clsPasteFunction.RemoveParameterByName("date") + clsPasteFunction.RemoveParameterByName("date_time") + End If + End Sub + + Private Sub ucrPnlOutput_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlOutput.ControlValueChanged + SettingBaseFunction() + TestOkEnabled() + End Sub + End Class \ No newline at end of file diff --git a/instat/dlgGeneralForGraphics.Designer.vb b/instat/dlgGeneralForGraphics.Designer.vb index a175bff8c64..9497bf9debe 100644 --- a/instat/dlgGeneralForGraphics.Designer.vb +++ b/instat/dlgGeneralForGraphics.Designer.vb @@ -39,7 +39,7 @@ Partial Class dlgGeneralForGraphics Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() - Me.grpAethetics = New System.Windows.Forms.GroupBox() + Me.grpAesthetics = New System.Windows.Forms.GroupBox() Me.ucrChkUseasNumeric = New instat.ucrCheck() Me.ucrReceiverY = New instat.ucrReceiverSingle() Me.lblYVariable = New System.Windows.Forms.Label() @@ -101,30 +101,30 @@ Partial Class dlgGeneralForGraphics Me.ucrGraphicsSelector = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrAdditionalLayers = New instat.ucrAdditionalLayers() Me.ucrBase = New instat.ucrButtons() - Me.grpAethetics.SuspendLayout() + Me.grpAesthetics.SuspendLayout() Me.ContextMenuPackagesList.SuspendLayout() Me.contextMenuStripOptions.SuspendLayout() Me.SuspendLayout() ' - 'grpAethetics - ' - Me.grpAethetics.Controls.Add(Me.ucrChkUseasNumeric) - Me.grpAethetics.Controls.Add(Me.ucrReceiverY) - Me.grpAethetics.Controls.Add(Me.lblYVariable) - Me.grpAethetics.Controls.Add(Me.lblXVariable) - Me.grpAethetics.Controls.Add(Me.ucrReceiverX) - Me.grpAethetics.Controls.Add(Me.lblLabel) - Me.grpAethetics.Controls.Add(Me.ucrLabelReceiver) - Me.grpAethetics.Controls.Add(Me.lblColour) - Me.grpAethetics.Controls.Add(Me.ucrColourReceiver) - Me.grpAethetics.Controls.Add(Me.lblFill) - Me.grpAethetics.Controls.Add(Me.ucrFillReceiver) - Me.grpAethetics.Location = New System.Drawing.Point(277, 31) - Me.grpAethetics.Name = "grpAethetics" - Me.grpAethetics.Size = New System.Drawing.Size(174, 257) - Me.grpAethetics.TabIndex = 23 - Me.grpAethetics.TabStop = False - Me.grpAethetics.Text = "Aethetics:" + 'grpAesthetics + ' + Me.grpAesthetics.Controls.Add(Me.ucrChkUseasNumeric) + Me.grpAesthetics.Controls.Add(Me.ucrReceiverY) + Me.grpAesthetics.Controls.Add(Me.lblYVariable) + Me.grpAesthetics.Controls.Add(Me.lblXVariable) + Me.grpAesthetics.Controls.Add(Me.ucrReceiverX) + Me.grpAesthetics.Controls.Add(Me.lblLabel) + Me.grpAesthetics.Controls.Add(Me.ucrLabelReceiver) + Me.grpAesthetics.Controls.Add(Me.lblColour) + Me.grpAesthetics.Controls.Add(Me.ucrColourReceiver) + Me.grpAesthetics.Controls.Add(Me.lblFill) + Me.grpAesthetics.Controls.Add(Me.ucrFillReceiver) + Me.grpAesthetics.Location = New System.Drawing.Point(277, 31) + Me.grpAesthetics.Name = "grpAesthetics" + Me.grpAesthetics.Size = New System.Drawing.Size(174, 257) + Me.grpAesthetics.TabIndex = 23 + Me.grpAesthetics.TabStop = False + Me.grpAesthetics.Text = "Aesthetics:" ' 'ucrChkUseasNumeric ' @@ -631,7 +631,7 @@ Partial Class dlgGeneralForGraphics Me.Controls.Add(Me.lblFacetBy) Me.Controls.Add(Me.cmdOptions) Me.Controls.Add(Me.cmdRHelp) - Me.Controls.Add(Me.grpAethetics) + Me.Controls.Add(Me.grpAesthetics) Me.Controls.Add(Me.ucrInputLegendPosition) Me.Controls.Add(Me.ucrChkFlipCoordinates) Me.Controls.Add(Me.ucrChkLegend) @@ -645,9 +645,9 @@ Partial Class dlgGeneralForGraphics Me.Name = "dlgGeneralForGraphics" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Tag = "General " - Me.Text = "General Graphics" - Me.grpAethetics.ResumeLayout(False) - Me.grpAethetics.PerformLayout() + Me.Text = "General" + Me.grpAesthetics.ResumeLayout(False) + Me.grpAesthetics.PerformLayout() Me.ContextMenuPackagesList.ResumeLayout(False) Me.contextMenuStripOptions.ResumeLayout(False) Me.ResumeLayout(False) @@ -661,7 +661,7 @@ Partial Class dlgGeneralForGraphics Friend WithEvents ucrChkLegend As ucrCheck Friend WithEvents ucrChkFlipCoordinates As ucrCheck Friend WithEvents ucrInputLegendPosition As ucrInputComboBox - Friend WithEvents grpAethetics As GroupBox + Friend WithEvents grpAesthetics As GroupBox Friend WithEvents lblColour As Label Friend WithEvents ucrColourReceiver As ucrReceiverSingle Friend WithEvents lblFill As Label diff --git a/instat/dlgLinePlot.vb b/instat/dlgLinePlot.vb index c5338de519e..68609714cc8 100644 --- a/instat/dlgLinePlot.vb +++ b/instat/dlgLinePlot.vb @@ -255,7 +255,6 @@ Public Class dlgLinePlot dctMethodOptions.Add("rlm", "MASS::rlm") ucrInputMethod.SetItems(dctMethodOptions) ucrInputMethod.SetDropDownStyleAsNonEditable() - ucrInputMethod.SetRDefault(Chr(34) & "loess" & Chr(34)) ucrNudSpan.SetParameter(New RParameter("span", 4)) ucrNudSpan.SetMinMax(0, Integer.MaxValue) @@ -425,7 +424,8 @@ Public Class dlgLinePlot ucrInputStation.SetDropDownStyleAsNonEditable() ucrPnlOptions.AddToLinkedControls({ucrChkPathOrStep, ucrChkWithSE, ucrChkLineofBestFit}, {rdoLine}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - ucrPnlOptions.AddToLinkedControls({ucrChkAddLine, ucrInputMethod, ucrInputFormula}, {rdoSmoothing}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlOptions.AddToLinkedControls({ucrChkAddLine, ucrInputFormula}, {rdoSmoothing}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlOptions.AddToLinkedControls(ucrInputMethod, {rdoSmoothing}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="loess") ucrPnlOptions.AddToLinkedControls({ucrChkAddSE, ucrChkFormula, ucrChkSpan}, {rdoSmoothing}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="FALSE") ucrPnlOptions.AddToLinkedControls({ucrReceiverXEnd, ucrChkDumbbellColour, ucrChkDumbbellSize}, {rdoDumbbell}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrPnlOptions.AddToLinkedControls({ucrChkAddPoints}, {rdoLine, rdoSmoothing, rdoLinerange}, bNewLinkedHideIfParameterMissing:=True) @@ -539,6 +539,8 @@ Public Class dlgLinePlot clsGeomLineFunction.SetPackageName("ggplot2") clsGeomLineFunction.SetRCommand("geom_line") + clsGeomLineFunction.AddParameter("colour", Chr(34) & "blue" & Chr(34)) + clsGeomLineFunction.AddParameter("size", "0.8") clsAesLinerangeFunction.SetRCommand("aes") @@ -595,12 +597,15 @@ Public Class dlgLinePlot clsPathFunction.SetPackageName("ggplot2") clsPathFunction.SetRCommand("geom_path") + clsPathFunction.AddParameter("linemitre", "10") clsGeomStepFunction.SetPackageName("ggplot2") clsGeomStepFunction.SetRCommand("geom_step") clsGeomSmoothFunction.SetPackageName("ggplot2") clsGeomSmoothFunction.SetRCommand("geom_smooth") + clsGeomSmoothFunction.AddParameter("method", Chr(34) & "loess" & Chr(34), iPosition:=0) + clsGeomSmoothFunction.AddParameter("size", "1") clsGeomDumbbellFunction.SetPackageName("ggplot2") clsGeomDumbbellFunction.SetRCommand("geom_dumbbell") @@ -650,12 +655,10 @@ Public Class dlgLinePlot ucrFactorOptionalReceiver.SetRCode(clsRaesFunction, bReset) ucrSave.SetRCode(clsBaseOperator, bReset) ucrChkAddPoints.SetRCode(clsBaseOperator, bReset) - ucrChkAddLine.SetRCode(clsBaseOperator, bReset) ucrChkWithSE.SetRCode(clsGeomSmoothFunc, bReset) ucrChkAddSE.SetRCode(clsGeomSmoothFunction, bReset) ucrReceiverYMax.SetRCode(clsAesLinerangeFunction, bReset) ucrReceiverYMin.SetRCode(clsAesLinerangeFunction, bReset) - ucrInputMethod.SetRCode(clsGeomSmoothFunction, bReset) ucrNudSpan.SetRCode(clsGeomSmoothFunction, bReset) ucrFamilyInput.SetRCode(clsListFunction, bReset) ucrChkFormula.SetRCode(clsBaseOperator, bReset) @@ -667,11 +670,14 @@ Public Class dlgLinePlot ucrChkLegend.SetRCode(clsThemeFunction, bReset, bCloneIfNeeded:=True) ucrInputLegendPosition.SetRCode(clsThemeFunction, bReset, bCloneIfNeeded:=True) If bReset Then + ucrInputMethod.SetRCode(clsGeomSmoothFunction, bReset) ucrChkRibbon.SetRCode(clsBaseOperator, bReset) ucrChkPathOrStep.SetRCode(clsBaseOperator, bReset) ucrPnlOptions.SetRCode(clsDummyFunction, bReset) ucrChkLineofBestFit.SetRCode(clsBaseOperator, bReset) ucrChkAddLineLineRange.SetRCode(clsBaseOperator, bReset) + ucrChkAddLine.SetRCode(clsBaseOperator, bReset) + ucrChkSpan.SetRCode(clsGeomSmoothFunction, bReset) End If SetGroupParam() End Sub @@ -875,14 +881,14 @@ Public Class dlgLinePlot End Sub Private Sub LineOptionsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles LineOptionsToolStripMenuItem.Click - clsGeomLineFunction.AddParameter("colour", Chr(34) & "blue" & Chr(34)) - clsGeomLineFunction.AddParameter("size", "0.8") - openSdgLayerOptions(clsGeomLineFunction) + If rdoLine.Checked Then + openSdgLayerOptions(clsGeomLineFunction) + Else + openSdgLayerOptions(clsGeomLineFunc) + End If End Sub Private Sub SmoothOptionsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SmoothOptionsToolStripMenuItem.Click - clsGeomSmoothFunction.AddParameter("method", Chr(34) & "lm" & Chr(34), iPosition:=0) - clsGeomSmoothFunction.AddParameter("size", "1") openSdgLayerOptions(clsGeomSmoothFunction) End Sub @@ -891,7 +897,6 @@ Public Class dlgLinePlot End Sub Private Sub PathOptionsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles PathOptionsToolStripMenuItem.Click - clsPathFunction.AddParameter("linemitre", "10") openSdgLayerOptions(clsPathFunction) End Sub diff --git a/instat/dlgMosaicPlot.vb b/instat/dlgMosaicPlot.vb index c8b26f265e4..0b00c5c9d2d 100644 --- a/instat/dlgMosaicPlot.vb +++ b/instat/dlgMosaicPlot.vb @@ -390,6 +390,8 @@ Public Class dlgMosaicPlot If bWrap OrElse bRow OrElse bCol Then clsBaseOperator.AddParameter("facets", clsRFunctionParameter:=clsFacetFunction) + Else + clsBaseOperator.RemoveParameterByName("facets") End If If bWrap Then clsFacetFunction.SetRCommand("facet_wrap") diff --git a/instat/dlgOptions.Designer.vb b/instat/dlgOptions.Designer.vb index ed5bd9584f7..53fdd6c58d4 100644 --- a/instat/dlgOptions.Designer.vb +++ b/instat/dlgOptions.Designer.vb @@ -38,12 +38,12 @@ Partial Class dlgOptions 'Do not modify it using the code editor. Private Sub InitializeComponent() - Dim TreeNode7 As System.Windows.Forms.TreeNode = New System.Windows.Forms.TreeNode("Languages") - Dim TreeNode8 As System.Windows.Forms.TreeNode = New System.Windows.Forms.TreeNode("Comments") - Dim TreeNode9 As System.Windows.Forms.TreeNode = New System.Windows.Forms.TreeNode("Import") - Dim TreeNode10 As System.Windows.Forms.TreeNode = New System.Windows.Forms.TreeNode("Output Window") - Dim TreeNode11 As System.Windows.Forms.TreeNode = New System.Windows.Forms.TreeNode("Commands") - Dim TreeNode12 As System.Windows.Forms.TreeNode = New System.Windows.Forms.TreeNode("Data View") + Dim TreeNode1 As System.Windows.Forms.TreeNode = New System.Windows.Forms.TreeNode("Languages") + Dim TreeNode2 As System.Windows.Forms.TreeNode = New System.Windows.Forms.TreeNode("Comments") + Dim TreeNode3 As System.Windows.Forms.TreeNode = New System.Windows.Forms.TreeNode("Import") + Dim TreeNode4 As System.Windows.Forms.TreeNode = New System.Windows.Forms.TreeNode("Output Window") + Dim TreeNode5 As System.Windows.Forms.TreeNode = New System.Windows.Forms.TreeNode("Commands") + Dim TreeNode6 As System.Windows.Forms.TreeNode = New System.Windows.Forms.TreeNode("Data View") Me.cmdApply = New System.Windows.Forms.Button() Me.cmdHelp = New System.Windows.Forms.Button() Me.cmdCancel = New System.Windows.Forms.Button() @@ -94,6 +94,13 @@ Partial Class dlgOptions Me.ucrNudWaitSeconds = New instat.ucrNud() Me.ucrChkIncludeDefaultParams = New instat.ucrCheck() Me.tbpDataView = New System.Windows.Forms.TabPage() + Me.ucrChkTurnOffUndo = New instat.ucrCheck() + Me.Label4 = New System.Windows.Forms.Label() + Me.Label3 = New System.Windows.Forms.Label() + Me.ucrNudRowUndoLimit = New instat.ucrNud() + Me.Label2 = New System.Windows.Forms.Label() + Me.Label1 = New System.Windows.Forms.Label() + Me.ucrNudColUndoLimit = New instat.ucrNud() Me.lblEvery = New System.Windows.Forms.Label() Me.lblMinutes = New System.Windows.Forms.Label() Me.ucrChkAutoSave = New instat.ucrCheck() @@ -153,9 +160,10 @@ Partial Class dlgOptions ' 'cmdApply ' - Me.cmdApply.Location = New System.Drawing.Point(384, 324) + Me.cmdApply.Location = New System.Drawing.Point(576, 486) + Me.cmdApply.Margin = New System.Windows.Forms.Padding(4) Me.cmdApply.Name = "cmdApply" - Me.cmdApply.Size = New System.Drawing.Size(75, 23) + Me.cmdApply.Size = New System.Drawing.Size(112, 34) Me.cmdApply.TabIndex = 10 Me.cmdApply.Tag = "Apply" Me.cmdApply.Text = "Apply" @@ -163,9 +171,10 @@ Partial Class dlgOptions ' 'cmdHelp ' - Me.cmdHelp.Location = New System.Drawing.Point(465, 324) + Me.cmdHelp.Location = New System.Drawing.Point(698, 486) + Me.cmdHelp.Margin = New System.Windows.Forms.Padding(4) Me.cmdHelp.Name = "cmdHelp" - Me.cmdHelp.Size = New System.Drawing.Size(75, 23) + Me.cmdHelp.Size = New System.Drawing.Size(112, 34) Me.cmdHelp.TabIndex = 12 Me.cmdHelp.Tag = "Help" Me.cmdHelp.Text = "Help" @@ -173,9 +182,10 @@ Partial Class dlgOptions ' 'cmdCancel ' - Me.cmdCancel.Location = New System.Drawing.Point(303, 324) + Me.cmdCancel.Location = New System.Drawing.Point(454, 486) + Me.cmdCancel.Margin = New System.Windows.Forms.Padding(4) Me.cmdCancel.Name = "cmdCancel" - Me.cmdCancel.Size = New System.Drawing.Size(75, 23) + Me.cmdCancel.Size = New System.Drawing.Size(112, 34) Me.cmdCancel.TabIndex = 9 Me.cmdCancel.Tag = "Cancel" Me.cmdCancel.Text = "Cancel" @@ -183,9 +193,10 @@ Partial Class dlgOptions ' 'cmdOk ' - Me.cmdOk.Location = New System.Drawing.Point(222, 324) + Me.cmdOk.Location = New System.Drawing.Point(333, 486) + Me.cmdOk.Margin = New System.Windows.Forms.Padding(4) Me.cmdOk.Name = "cmdOk" - Me.cmdOk.Size = New System.Drawing.Size(75, 23) + Me.cmdOk.Size = New System.Drawing.Size(112, 34) Me.cmdOk.TabIndex = 11 Me.cmdOk.Tag = "Ok" Me.cmdOk.Text = "Ok" @@ -194,9 +205,10 @@ Partial Class dlgOptions 'cmdLanguage ' Me.cmdLanguage.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdLanguage.Location = New System.Drawing.Point(545, 324) + Me.cmdLanguage.Location = New System.Drawing.Point(818, 486) + Me.cmdLanguage.Margin = New System.Windows.Forms.Padding(4) Me.cmdLanguage.Name = "cmdLanguage" - Me.cmdLanguage.Size = New System.Drawing.Size(37, 23) + Me.cmdLanguage.Size = New System.Drawing.Size(56, 34) Me.cmdLanguage.TabIndex = 13 Me.cmdLanguage.Tag = "" Me.cmdLanguage.Text = "Lang" @@ -204,7 +216,8 @@ Partial Class dlgOptions ' 'spltControls ' - Me.spltControls.Location = New System.Drawing.Point(5, 1) + Me.spltControls.Location = New System.Drawing.Point(8, 2) + Me.spltControls.Margin = New System.Windows.Forms.Padding(4) Me.spltControls.Name = "spltControls" ' 'spltControls.Panel1 @@ -215,15 +228,17 @@ Partial Class dlgOptions 'spltControls.Panel2 ' Me.spltControls.Panel2.Controls.Add(Me.tbcOptions) - Me.spltControls.Size = New System.Drawing.Size(760, 317) - Me.spltControls.SplitterDistance = 184 + Me.spltControls.Size = New System.Drawing.Size(1140, 476) + Me.spltControls.SplitterDistance = 276 + Me.spltControls.SplitterWidth = 6 Me.spltControls.TabIndex = 8 ' 'cmdFactoryReset ' - Me.cmdFactoryReset.Location = New System.Drawing.Point(13, 287) + Me.cmdFactoryReset.Location = New System.Drawing.Point(20, 430) + Me.cmdFactoryReset.Margin = New System.Windows.Forms.Padding(4) Me.cmdFactoryReset.Name = "cmdFactoryReset" - Me.cmdFactoryReset.Size = New System.Drawing.Size(100, 23) + Me.cmdFactoryReset.Size = New System.Drawing.Size(150, 34) Me.cmdFactoryReset.TabIndex = 13 Me.cmdFactoryReset.Tag = "Help" Me.cmdFactoryReset.Text = "Factory Reset" @@ -233,31 +248,32 @@ Partial Class dlgOptions ' Me.trOptions.Dock = System.Windows.Forms.DockStyle.Fill Me.trOptions.Location = New System.Drawing.Point(0, 0) + Me.trOptions.Margin = New System.Windows.Forms.Padding(4) Me.trOptions.Name = "trOptions" - TreeNode7.Name = "ndLanguages" - TreeNode7.Tag = "1" - TreeNode7.Text = "Languages" - TreeNode7.ToolTipText = "Choose different languages" - TreeNode8.Name = "ndComments" - TreeNode8.Tag = "2" - TreeNode8.Text = "Comments" - TreeNode8.ToolTipText = "Comments for the dialogs" - TreeNode9.Name = "ndImport" - TreeNode9.Tag = "3" - TreeNode9.Text = "Import" - TreeNode9.ToolTipText = "Import Data Settings" - TreeNode10.Name = "ndOutputWindow" - TreeNode10.Tag = "4" - TreeNode10.Text = "Output Window" - TreeNode10.ToolTipText = "Output Window Formatting Options" - TreeNode11.Name = "ndCommands" - TreeNode11.Tag = "8" - TreeNode11.Text = "Commands" - TreeNode11.ToolTipText = "Commands Options" - TreeNode12.Name = "ndDataView" - TreeNode12.Text = "Data View" - Me.trOptions.Nodes.AddRange(New System.Windows.Forms.TreeNode() {TreeNode7, TreeNode8, TreeNode9, TreeNode10, TreeNode11, TreeNode12}) - Me.trOptions.Size = New System.Drawing.Size(184, 317) + TreeNode1.Name = "ndLanguages" + TreeNode1.Tag = "1" + TreeNode1.Text = "Languages" + TreeNode1.ToolTipText = "Choose different languages" + TreeNode2.Name = "ndComments" + TreeNode2.Tag = "2" + TreeNode2.Text = "Comments" + TreeNode2.ToolTipText = "Comments for the dialogs" + TreeNode3.Name = "ndImport" + TreeNode3.Tag = "3" + TreeNode3.Text = "Import" + TreeNode3.ToolTipText = "Import Data Settings" + TreeNode4.Name = "ndOutputWindow" + TreeNode4.Tag = "4" + TreeNode4.Text = "Output Window" + TreeNode4.ToolTipText = "Output Window Formatting Options" + TreeNode5.Name = "ndCommands" + TreeNode5.Tag = "8" + TreeNode5.Text = "Commands" + TreeNode5.ToolTipText = "Commands Options" + TreeNode6.Name = "ndDataView" + TreeNode6.Text = "Data View" + Me.trOptions.Nodes.AddRange(New System.Windows.Forms.TreeNode() {TreeNode1, TreeNode2, TreeNode3, TreeNode4, TreeNode5, TreeNode6}) + Me.trOptions.Size = New System.Drawing.Size(276, 476) Me.trOptions.TabIndex = 0 ' 'tbcOptions @@ -276,9 +292,10 @@ Partial Class dlgOptions Me.tbcOptions.Controls.Add(Me.tbpWebsite) Me.tbcOptions.Dock = System.Windows.Forms.DockStyle.Fill Me.tbcOptions.Location = New System.Drawing.Point(0, 0) + Me.tbcOptions.Margin = New System.Windows.Forms.Padding(4) Me.tbcOptions.Name = "tbcOptions" Me.tbcOptions.SelectedIndex = 0 - Me.tbcOptions.Size = New System.Drawing.Size(572, 317) + Me.tbcOptions.Size = New System.Drawing.Size(858, 476) Me.tbcOptions.TabIndex = 0 ' 'tbpLanguages @@ -286,10 +303,11 @@ Partial Class dlgOptions Me.tbpLanguages.Controls.Add(Me.lversion) Me.tbpLanguages.Controls.Add(Me.lblLanguage) Me.tbpLanguages.Controls.Add(Me.ucrInputLanguage) - Me.tbpLanguages.Location = New System.Drawing.Point(4, 22) + Me.tbpLanguages.Location = New System.Drawing.Point(4, 29) + Me.tbpLanguages.Margin = New System.Windows.Forms.Padding(4) Me.tbpLanguages.Name = "tbpLanguages" - Me.tbpLanguages.Padding = New System.Windows.Forms.Padding(3) - Me.tbpLanguages.Size = New System.Drawing.Size(564, 291) + Me.tbpLanguages.Padding = New System.Windows.Forms.Padding(4) + Me.tbpLanguages.Size = New System.Drawing.Size(850, 443) Me.tbpLanguages.TabIndex = 0 Me.tbpLanguages.Tag = "Languages" Me.tbpLanguages.Text = "Languages" @@ -297,10 +315,9 @@ Partial Class dlgOptions ' 'lversion ' - Me.lversion.Location = New System.Drawing.Point(306, 267) - Me.lversion.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) + Me.lversion.Location = New System.Drawing.Point(459, 400) Me.lversion.Name = "lversion" - Me.lversion.Size = New System.Drawing.Size(254, 18) + Me.lversion.Size = New System.Drawing.Size(381, 27) Me.lversion.TabIndex = 4 Me.lversion.Text = "v. " Me.lversion.TextAlign = System.Drawing.ContentAlignment.TopRight @@ -308,9 +325,10 @@ Partial Class dlgOptions 'lblLanguage ' Me.lblLanguage.AutoSize = True - Me.lblLanguage.Location = New System.Drawing.Point(9, 18) + Me.lblLanguage.Location = New System.Drawing.Point(14, 27) + Me.lblLanguage.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblLanguage.Name = "lblLanguage" - Me.lblLanguage.Size = New System.Drawing.Size(61, 13) + Me.lblLanguage.Size = New System.Drawing.Size(89, 20) Me.lblLanguage.TabIndex = 3 Me.lblLanguage.Text = "Language :" ' @@ -320,19 +338,20 @@ Partial Class dlgOptions Me.ucrInputLanguage.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrInputLanguage.GetSetSelectedIndex = -1 Me.ucrInputLanguage.IsReadOnly = False - Me.ucrInputLanguage.Location = New System.Drawing.Point(75, 15) - Me.ucrInputLanguage.Margin = New System.Windows.Forms.Padding(6) + Me.ucrInputLanguage.Location = New System.Drawing.Point(112, 22) + Me.ucrInputLanguage.Margin = New System.Windows.Forms.Padding(9, 9, 9, 9) Me.ucrInputLanguage.Name = "ucrInputLanguage" - Me.ucrInputLanguage.Size = New System.Drawing.Size(110, 21) + Me.ucrInputLanguage.Size = New System.Drawing.Size(165, 32) Me.ucrInputLanguage.TabIndex = 2 ' 'tbpComments ' Me.tbpComments.Controls.Add(Me.pnComments) - Me.tbpComments.Location = New System.Drawing.Point(4, 22) + Me.tbpComments.Location = New System.Drawing.Point(4, 29) + Me.tbpComments.Margin = New System.Windows.Forms.Padding(4) Me.tbpComments.Name = "tbpComments" - Me.tbpComments.Padding = New System.Windows.Forms.Padding(3) - Me.tbpComments.Size = New System.Drawing.Size(564, 291) + Me.tbpComments.Padding = New System.Windows.Forms.Padding(4) + Me.tbpComments.Size = New System.Drawing.Size(850, 443) Me.tbpComments.TabIndex = 1 Me.tbpComments.Tag = "Comments" Me.tbpComments.Text = "Comments" @@ -343,9 +362,10 @@ Partial Class dlgOptions Me.pnComments.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.pnComments.Controls.Add(Me.ucrInputComment) Me.pnComments.Controls.Add(Me.lblComment) - Me.pnComments.Location = New System.Drawing.Point(10, 10) + Me.pnComments.Location = New System.Drawing.Point(15, 15) + Me.pnComments.Margin = New System.Windows.Forms.Padding(4) Me.pnComments.Name = "pnComments" - Me.pnComments.Size = New System.Drawing.Size(391, 29) + Me.pnComments.Size = New System.Drawing.Size(586, 44) Me.pnComments.TabIndex = 2 ' 'ucrInputComment @@ -354,18 +374,19 @@ Partial Class dlgOptions Me.ucrInputComment.AutoSize = True Me.ucrInputComment.IsMultiline = False Me.ucrInputComment.IsReadOnly = False - Me.ucrInputComment.Location = New System.Drawing.Point(96, 5) - Me.ucrInputComment.Margin = New System.Windows.Forms.Padding(6) + Me.ucrInputComment.Location = New System.Drawing.Point(144, 8) + Me.ucrInputComment.Margin = New System.Windows.Forms.Padding(9, 9, 9, 9) Me.ucrInputComment.Name = "ucrInputComment" - Me.ucrInputComment.Size = New System.Drawing.Size(292, 21) + Me.ucrInputComment.Size = New System.Drawing.Size(438, 32) Me.ucrInputComment.TabIndex = 1 ' 'lblComment ' Me.lblComment.AutoSize = True - Me.lblComment.Location = New System.Drawing.Point(2, 9) + Me.lblComment.Location = New System.Drawing.Point(3, 14) + Me.lblComment.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblComment.Name = "lblComment" - Me.lblComment.Size = New System.Drawing.Size(54, 13) + Me.lblComment.Size = New System.Drawing.Size(82, 20) Me.lblComment.TabIndex = 0 Me.lblComment.Tag = "Comment:" Me.lblComment.Text = "Comment:" @@ -375,9 +396,10 @@ Partial Class dlgOptions Me.tbpImport.Controls.Add(Me.lblPreviewRows) Me.tbpImport.Controls.Add(Me.ucrNudPreviewRows) Me.tbpImport.Controls.Add(Me.pnImportData) - Me.tbpImport.Location = New System.Drawing.Point(4, 22) + Me.tbpImport.Location = New System.Drawing.Point(4, 29) + Me.tbpImport.Margin = New System.Windows.Forms.Padding(4) Me.tbpImport.Name = "tbpImport" - Me.tbpImport.Size = New System.Drawing.Size(564, 291) + Me.tbpImport.Size = New System.Drawing.Size(850, 443) Me.tbpImport.TabIndex = 3 Me.tbpImport.Text = "Import" Me.tbpImport.UseVisualStyleBackColor = True @@ -385,9 +407,10 @@ Partial Class dlgOptions 'lblPreviewRows ' Me.lblPreviewRows.AutoSize = True - Me.lblPreviewRows.Location = New System.Drawing.Point(3, 9) + Me.lblPreviewRows.Location = New System.Drawing.Point(4, 14) + Me.lblPreviewRows.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblPreviewRows.Name = "lblPreviewRows" - Me.lblPreviewRows.Size = New System.Drawing.Size(130, 13) + Me.lblPreviewRows.Size = New System.Drawing.Size(189, 20) Me.lblPreviewRows.TabIndex = 0 Me.lblPreviewRows.Text = "Number of Preview Rows:" ' @@ -396,12 +419,12 @@ Partial Class dlgOptions Me.ucrNudPreviewRows.AutoSize = True Me.ucrNudPreviewRows.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudPreviewRows.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudPreviewRows.Location = New System.Drawing.Point(270, 5) - Me.ucrNudPreviewRows.Margin = New System.Windows.Forms.Padding(5) + Me.ucrNudPreviewRows.Location = New System.Drawing.Point(405, 8) + Me.ucrNudPreviewRows.Margin = New System.Windows.Forms.Padding(8) Me.ucrNudPreviewRows.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudPreviewRows.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudPreviewRows.Name = "ucrNudPreviewRows" - Me.ucrNudPreviewRows.Size = New System.Drawing.Size(50, 20) + Me.ucrNudPreviewRows.Size = New System.Drawing.Size(75, 30) Me.ucrNudPreviewRows.TabIndex = 3 Me.ucrNudPreviewRows.Value = New Decimal(New Integer() {10, 0, 0, 0}) ' @@ -409,7 +432,8 @@ Partial Class dlgOptions ' Me.pnImportData.AutoSize = True Me.pnImportData.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.pnImportData.Location = New System.Drawing.Point(10, 10) + Me.pnImportData.Location = New System.Drawing.Point(15, 15) + Me.pnImportData.Margin = New System.Windows.Forms.Padding(4) Me.pnImportData.Name = "pnImportData" Me.pnImportData.Size = New System.Drawing.Size(0, 0) Me.pnImportData.TabIndex = 2 @@ -422,10 +446,11 @@ Partial Class dlgOptions Me.tbpOutputWindow.Controls.Add(Me.ucrChkIncludeCommentsbyDefault) Me.tbpOutputWindow.Controls.Add(Me.grpROptions) Me.tbpOutputWindow.Controls.Add(Me.pnFormatOptions) - Me.tbpOutputWindow.Location = New System.Drawing.Point(4, 22) + Me.tbpOutputWindow.Location = New System.Drawing.Point(4, 29) + Me.tbpOutputWindow.Margin = New System.Windows.Forms.Padding(4) Me.tbpOutputWindow.Name = "tbpOutputWindow" - Me.tbpOutputWindow.Padding = New System.Windows.Forms.Padding(3) - Me.tbpOutputWindow.Size = New System.Drawing.Size(564, 291) + Me.tbpOutputWindow.Padding = New System.Windows.Forms.Padding(4) + Me.tbpOutputWindow.Size = New System.Drawing.Size(850, 443) Me.tbpOutputWindow.TabIndex = 2 Me.tbpOutputWindow.Text = "Output Window" Me.tbpOutputWindow.UseVisualStyleBackColor = True @@ -435,12 +460,12 @@ Partial Class dlgOptions Me.ucrNudMaxOutputsHeight.AutoSize = True Me.ucrNudMaxOutputsHeight.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudMaxOutputsHeight.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudMaxOutputsHeight.Location = New System.Drawing.Point(506, 135) - Me.ucrNudMaxOutputsHeight.Margin = New System.Windows.Forms.Padding(5) + Me.ucrNudMaxOutputsHeight.Location = New System.Drawing.Point(759, 202) + Me.ucrNudMaxOutputsHeight.Margin = New System.Windows.Forms.Padding(8) Me.ucrNudMaxOutputsHeight.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudMaxOutputsHeight.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudMaxOutputsHeight.Name = "ucrNudMaxOutputsHeight" - Me.ucrNudMaxOutputsHeight.Size = New System.Drawing.Size(50, 20) + Me.ucrNudMaxOutputsHeight.Size = New System.Drawing.Size(75, 30) Me.ucrNudMaxOutputsHeight.TabIndex = 29 Me.ucrNudMaxOutputsHeight.Value = New Decimal(New Integer() {0, 0, 0, 0}) ' @@ -448,30 +473,30 @@ Partial Class dlgOptions ' Me.ucrChkMaxOutputsHeight.AutoSize = True Me.ucrChkMaxOutputsHeight.Checked = False - Me.ucrChkMaxOutputsHeight.Location = New System.Drawing.Point(300, 135) - Me.ucrChkMaxOutputsHeight.Margin = New System.Windows.Forms.Padding(5) + Me.ucrChkMaxOutputsHeight.Location = New System.Drawing.Point(450, 202) + Me.ucrChkMaxOutputsHeight.Margin = New System.Windows.Forms.Padding(8) Me.ucrChkMaxOutputsHeight.Name = "ucrChkMaxOutputsHeight" - Me.ucrChkMaxOutputsHeight.Size = New System.Drawing.Size(196, 34) + Me.ucrChkMaxOutputsHeight.Size = New System.Drawing.Size(294, 51) Me.ucrChkMaxOutputsHeight.TabIndex = 28 ' 'ucrChkShowRCommandsinOutputWindow ' Me.ucrChkShowRCommandsinOutputWindow.AutoSize = True Me.ucrChkShowRCommandsinOutputWindow.Checked = False - Me.ucrChkShowRCommandsinOutputWindow.Location = New System.Drawing.Point(10, 160) - Me.ucrChkShowRCommandsinOutputWindow.Margin = New System.Windows.Forms.Padding(5) + Me.ucrChkShowRCommandsinOutputWindow.Location = New System.Drawing.Point(15, 240) + Me.ucrChkShowRCommandsinOutputWindow.Margin = New System.Windows.Forms.Padding(8) Me.ucrChkShowRCommandsinOutputWindow.Name = "ucrChkShowRCommandsinOutputWindow" - Me.ucrChkShowRCommandsinOutputWindow.Size = New System.Drawing.Size(271, 34) + Me.ucrChkShowRCommandsinOutputWindow.Size = New System.Drawing.Size(406, 51) Me.ucrChkShowRCommandsinOutputWindow.TabIndex = 27 ' 'ucrChkIncludeCommentsbyDefault ' Me.ucrChkIncludeCommentsbyDefault.AutoSize = True Me.ucrChkIncludeCommentsbyDefault.Checked = False - Me.ucrChkIncludeCommentsbyDefault.Location = New System.Drawing.Point(10, 135) - Me.ucrChkIncludeCommentsbyDefault.Margin = New System.Windows.Forms.Padding(5) + Me.ucrChkIncludeCommentsbyDefault.Location = New System.Drawing.Point(15, 202) + Me.ucrChkIncludeCommentsbyDefault.Margin = New System.Windows.Forms.Padding(8) Me.ucrChkIncludeCommentsbyDefault.Name = "ucrChkIncludeCommentsbyDefault" - Me.ucrChkIncludeCommentsbyDefault.Size = New System.Drawing.Size(271, 34) + Me.ucrChkIncludeCommentsbyDefault.Size = New System.Drawing.Size(406, 51) Me.ucrChkIncludeCommentsbyDefault.TabIndex = 26 ' 'grpROptions @@ -479,9 +504,11 @@ Partial Class dlgOptions Me.grpROptions.Controls.Add(Me.ucrChkShowSignifStars) Me.grpROptions.Controls.Add(Me.ucrNudDigits) Me.grpROptions.Controls.Add(Me.lblNoDigits) - Me.grpROptions.Location = New System.Drawing.Point(10, 192) + Me.grpROptions.Location = New System.Drawing.Point(15, 288) + Me.grpROptions.Margin = New System.Windows.Forms.Padding(4) Me.grpROptions.Name = "grpROptions" - Me.grpROptions.Size = New System.Drawing.Size(271, 93) + Me.grpROptions.Padding = New System.Windows.Forms.Padding(4) + Me.grpROptions.Size = New System.Drawing.Size(406, 140) Me.grpROptions.TabIndex = 25 Me.grpROptions.TabStop = False Me.grpROptions.Text = "R Options" @@ -490,10 +517,10 @@ Partial Class dlgOptions ' Me.ucrChkShowSignifStars.AutoSize = True Me.ucrChkShowSignifStars.Checked = False - Me.ucrChkShowSignifStars.Location = New System.Drawing.Point(7, 49) - Me.ucrChkShowSignifStars.Margin = New System.Windows.Forms.Padding(5) + Me.ucrChkShowSignifStars.Location = New System.Drawing.Point(10, 74) + Me.ucrChkShowSignifStars.Margin = New System.Windows.Forms.Padding(8) Me.ucrChkShowSignifStars.Name = "ucrChkShowSignifStars" - Me.ucrChkShowSignifStars.Size = New System.Drawing.Size(255, 34) + Me.ucrChkShowSignifStars.Size = New System.Drawing.Size(382, 51) Me.ucrChkShowSignifStars.TabIndex = 28 ' 'ucrNudDigits @@ -501,21 +528,22 @@ Partial Class dlgOptions Me.ucrNudDigits.AutoSize = True Me.ucrNudDigits.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudDigits.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudDigits.Location = New System.Drawing.Point(177, 23) - Me.ucrNudDigits.Margin = New System.Windows.Forms.Padding(5) + Me.ucrNudDigits.Location = New System.Drawing.Point(266, 34) + Me.ucrNudDigits.Margin = New System.Windows.Forms.Padding(8) Me.ucrNudDigits.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudDigits.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudDigits.Name = "ucrNudDigits" - Me.ucrNudDigits.Size = New System.Drawing.Size(50, 20) + Me.ucrNudDigits.Size = New System.Drawing.Size(75, 30) Me.ucrNudDigits.TabIndex = 27 Me.ucrNudDigits.Value = New Decimal(New Integer() {0, 0, 0, 0}) ' 'lblNoDigits ' Me.lblNoDigits.AutoSize = True - Me.lblNoDigits.Location = New System.Drawing.Point(6, 23) + Me.lblNoDigits.Location = New System.Drawing.Point(9, 34) + Me.lblNoDigits.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblNoDigits.Name = "lblNoDigits" - Me.lblNoDigits.Size = New System.Drawing.Size(137, 13) + Me.lblNoDigits.Size = New System.Drawing.Size(204, 20) Me.lblNoDigits.TabIndex = 1 Me.lblNoDigits.Text = "Number of Digits to Display:" ' @@ -532,43 +560,48 @@ Partial Class dlgOptions Me.pnFormatOptions.Controls.Add(Me.lblOutputFormat) Me.pnFormatOptions.Controls.Add(Me.cmdCommentFormat) Me.pnFormatOptions.Controls.Add(Me.lblCommandFormat) - Me.pnFormatOptions.Location = New System.Drawing.Point(10, 10) + Me.pnFormatOptions.Location = New System.Drawing.Point(15, 15) + Me.pnFormatOptions.Margin = New System.Windows.Forms.Padding(4) Me.pnFormatOptions.Name = "pnFormatOptions" - Me.pnFormatOptions.Size = New System.Drawing.Size(391, 118) + Me.pnFormatOptions.Size = New System.Drawing.Size(586, 175) Me.pnFormatOptions.TabIndex = 21 ' 'rtbCommentPreview ' - Me.rtbCommentPreview.Location = New System.Drawing.Point(124, 89) + Me.rtbCommentPreview.Location = New System.Drawing.Point(186, 134) + Me.rtbCommentPreview.Margin = New System.Windows.Forms.Padding(4) Me.rtbCommentPreview.Name = "rtbCommentPreview" Me.rtbCommentPreview.ReadOnly = True - Me.rtbCommentPreview.Size = New System.Drawing.Size(147, 26) + Me.rtbCommentPreview.Size = New System.Drawing.Size(218, 37) Me.rtbCommentPreview.TabIndex = 22 Me.rtbCommentPreview.Text = "" ' 'rtbOutputPreview ' - Me.rtbOutputPreview.Location = New System.Drawing.Point(124, 49) + Me.rtbOutputPreview.Location = New System.Drawing.Point(186, 74) + Me.rtbOutputPreview.Margin = New System.Windows.Forms.Padding(4) Me.rtbOutputPreview.Name = "rtbOutputPreview" Me.rtbOutputPreview.ReadOnly = True - Me.rtbOutputPreview.Size = New System.Drawing.Size(147, 26) + Me.rtbOutputPreview.Size = New System.Drawing.Size(218, 37) Me.rtbOutputPreview.TabIndex = 21 Me.rtbOutputPreview.Text = "" ' 'rtbCommandPreview ' - Me.rtbCommandPreview.Location = New System.Drawing.Point(124, 9) + Me.rtbCommandPreview.Location = New System.Drawing.Point(186, 14) + Me.rtbCommandPreview.Margin = New System.Windows.Forms.Padding(4) Me.rtbCommandPreview.Name = "rtbCommandPreview" Me.rtbCommandPreview.ReadOnly = True - Me.rtbCommandPreview.Size = New System.Drawing.Size(147, 26) + Me.rtbCommandPreview.Size = New System.Drawing.Size(218, 37) Me.rtbCommandPreview.TabIndex = 20 Me.rtbCommandPreview.Text = "" ' 'cmdCommandFormat ' - Me.cmdCommandFormat.Location = New System.Drawing.Point(288, 9) + Me.cmdCommandFormat.Location = New System.Drawing.Point(432, 14) + Me.cmdCommandFormat.Margin = New System.Windows.Forms.Padding(4) Me.cmdCommandFormat.Name = "cmdCommandFormat" - Me.cmdCommandFormat.Size = New System.Drawing.Size(100, 23) + Me.cmdCommandFormat.Size = New System.Drawing.Size(150, 34) Me.cmdCommandFormat.TabIndex = 10 Me.cmdCommandFormat.Text = "Change..." Me.cmdCommandFormat.UseVisualStyleBackColor = True @@ -576,17 +609,19 @@ Partial Class dlgOptions 'lblCommentFormat ' Me.lblCommentFormat.AutoSize = True - Me.lblCommentFormat.Location = New System.Drawing.Point(4, 94) + Me.lblCommentFormat.Location = New System.Drawing.Point(6, 141) + Me.lblCommentFormat.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblCommentFormat.Name = "lblCommentFormat" - Me.lblCommentFormat.Size = New System.Drawing.Size(89, 13) + Me.lblCommentFormat.Size = New System.Drawing.Size(137, 20) Me.lblCommentFormat.TabIndex = 19 Me.lblCommentFormat.Text = "Comment Format:" ' 'cmdOutputFormat ' - Me.cmdOutputFormat.Location = New System.Drawing.Point(288, 49) + Me.cmdOutputFormat.Location = New System.Drawing.Point(432, 74) + Me.cmdOutputFormat.Margin = New System.Windows.Forms.Padding(4) Me.cmdOutputFormat.Name = "cmdOutputFormat" - Me.cmdOutputFormat.Size = New System.Drawing.Size(100, 23) + Me.cmdOutputFormat.Size = New System.Drawing.Size(150, 34) Me.cmdOutputFormat.TabIndex = 16 Me.cmdOutputFormat.Text = "Change..." Me.cmdOutputFormat.UseVisualStyleBackColor = True @@ -594,17 +629,19 @@ Partial Class dlgOptions 'lblOutputFormat ' Me.lblOutputFormat.AutoSize = True - Me.lblOutputFormat.Location = New System.Drawing.Point(4, 54) + Me.lblOutputFormat.Location = New System.Drawing.Point(6, 81) + Me.lblOutputFormat.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblOutputFormat.Name = "lblOutputFormat" - Me.lblOutputFormat.Size = New System.Drawing.Size(77, 13) + Me.lblOutputFormat.Size = New System.Drawing.Size(117, 20) Me.lblOutputFormat.TabIndex = 18 Me.lblOutputFormat.Text = "Output Format:" ' 'cmdCommentFormat ' - Me.cmdCommentFormat.Location = New System.Drawing.Point(288, 89) + Me.cmdCommentFormat.Location = New System.Drawing.Point(432, 134) + Me.cmdCommentFormat.Margin = New System.Windows.Forms.Padding(4) Me.cmdCommentFormat.Name = "cmdCommentFormat" - Me.cmdCommentFormat.Size = New System.Drawing.Size(100, 23) + Me.cmdCommentFormat.Size = New System.Drawing.Size(150, 34) Me.cmdCommentFormat.TabIndex = 16 Me.cmdCommentFormat.Text = "Change..." Me.cmdCommentFormat.UseVisualStyleBackColor = True @@ -612,19 +649,21 @@ Partial Class dlgOptions 'lblCommandFormat ' Me.lblCommandFormat.AutoSize = True - Me.lblCommandFormat.Location = New System.Drawing.Point(4, 14) + Me.lblCommandFormat.Location = New System.Drawing.Point(6, 21) + Me.lblCommandFormat.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblCommandFormat.Name = "lblCommandFormat" - Me.lblCommandFormat.Size = New System.Drawing.Size(92, 13) + Me.lblCommandFormat.Size = New System.Drawing.Size(141, 20) Me.lblCommandFormat.TabIndex = 17 Me.lblCommandFormat.Text = "Command Format:" ' 'tbpEditor ' Me.tbpEditor.Controls.Add(Me.pnFormatEditor) - Me.tbpEditor.Location = New System.Drawing.Point(4, 22) + Me.tbpEditor.Location = New System.Drawing.Point(4, 29) + Me.tbpEditor.Margin = New System.Windows.Forms.Padding(4) Me.tbpEditor.Name = "tbpEditor" - Me.tbpEditor.Padding = New System.Windows.Forms.Padding(3) - Me.tbpEditor.Size = New System.Drawing.Size(564, 291) + Me.tbpEditor.Padding = New System.Windows.Forms.Padding(4) + Me.tbpEditor.Size = New System.Drawing.Size(850, 443) Me.tbpEditor.TabIndex = 10 Me.tbpEditor.Text = "Editor Window" Me.tbpEditor.ToolTipText = "Data View" @@ -636,16 +675,18 @@ Partial Class dlgOptions Me.pnFormatEditor.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.pnFormatEditor.Controls.Add(Me.cmdEditorFont) Me.pnFormatEditor.Controls.Add(Me.lblFont) - Me.pnFormatEditor.Location = New System.Drawing.Point(10, 10) + Me.pnFormatEditor.Location = New System.Drawing.Point(15, 15) + Me.pnFormatEditor.Margin = New System.Windows.Forms.Padding(4) Me.pnFormatEditor.Name = "pnFormatEditor" - Me.pnFormatEditor.Size = New System.Drawing.Size(212, 28) + Me.pnFormatEditor.Size = New System.Drawing.Size(318, 41) Me.pnFormatEditor.TabIndex = 22 ' 'cmdEditorFont ' - Me.cmdEditorFont.Location = New System.Drawing.Point(109, 2) + Me.cmdEditorFont.Location = New System.Drawing.Point(164, 3) + Me.cmdEditorFont.Margin = New System.Windows.Forms.Padding(4) Me.cmdEditorFont.Name = "cmdEditorFont" - Me.cmdEditorFont.Size = New System.Drawing.Size(100, 23) + Me.cmdEditorFont.Size = New System.Drawing.Size(150, 34) Me.cmdEditorFont.TabIndex = 10 Me.cmdEditorFont.Text = "Change..." Me.cmdEditorFont.UseVisualStyleBackColor = True @@ -653,9 +694,10 @@ Partial Class dlgOptions 'lblFont ' Me.lblFont.AutoSize = True - Me.lblFont.Location = New System.Drawing.Point(4, 7) + Me.lblFont.Location = New System.Drawing.Point(6, 10) + Me.lblFont.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblFont.Name = "lblFont" - Me.lblFont.Size = New System.Drawing.Size(66, 13) + Me.lblFont.Size = New System.Drawing.Size(101, 20) Me.lblFont.TabIndex = 17 Me.lblFont.Text = "Format Font:" ' @@ -665,10 +707,11 @@ Partial Class dlgOptions Me.tbpCommands.Controls.Add(Me.ucrChkShowWaitDialog) Me.tbpCommands.Controls.Add(Me.ucrNudWaitSeconds) Me.tbpCommands.Controls.Add(Me.ucrChkIncludeDefaultParams) - Me.tbpCommands.Location = New System.Drawing.Point(4, 22) + Me.tbpCommands.Location = New System.Drawing.Point(4, 29) + Me.tbpCommands.Margin = New System.Windows.Forms.Padding(4) Me.tbpCommands.Name = "tbpCommands" - Me.tbpCommands.Padding = New System.Windows.Forms.Padding(3) - Me.tbpCommands.Size = New System.Drawing.Size(564, 291) + Me.tbpCommands.Padding = New System.Windows.Forms.Padding(4) + Me.tbpCommands.Size = New System.Drawing.Size(850, 443) Me.tbpCommands.TabIndex = 4 Me.tbpCommands.Tag = "Commands" Me.tbpCommands.Text = "Commands" @@ -677,9 +720,10 @@ Partial Class dlgOptions 'lblWaitSeconds ' Me.lblWaitSeconds.AutoSize = True - Me.lblWaitSeconds.Location = New System.Drawing.Point(403, 46) + Me.lblWaitSeconds.Location = New System.Drawing.Point(604, 69) + Me.lblWaitSeconds.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblWaitSeconds.Name = "lblWaitSeconds" - Me.lblWaitSeconds.Size = New System.Drawing.Size(47, 13) + Me.lblWaitSeconds.Size = New System.Drawing.Size(69, 20) Me.lblWaitSeconds.TabIndex = 8 Me.lblWaitSeconds.Text = "seconds" ' @@ -687,10 +731,10 @@ Partial Class dlgOptions ' Me.ucrChkShowWaitDialog.AutoSize = True Me.ucrChkShowWaitDialog.Checked = False - Me.ucrChkShowWaitDialog.Location = New System.Drawing.Point(6, 47) - Me.ucrChkShowWaitDialog.Margin = New System.Windows.Forms.Padding(5) + Me.ucrChkShowWaitDialog.Location = New System.Drawing.Point(9, 70) + Me.ucrChkShowWaitDialog.Margin = New System.Windows.Forms.Padding(8) Me.ucrChkShowWaitDialog.Name = "ucrChkShowWaitDialog" - Me.ucrChkShowWaitDialog.Size = New System.Drawing.Size(337, 34) + Me.ucrChkShowWaitDialog.Size = New System.Drawing.Size(506, 51) Me.ucrChkShowWaitDialog.TabIndex = 6 ' 'ucrNudWaitSeconds @@ -698,12 +742,12 @@ Partial Class dlgOptions Me.ucrNudWaitSeconds.AutoSize = True Me.ucrNudWaitSeconds.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudWaitSeconds.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudWaitSeconds.Location = New System.Drawing.Point(349, 45) - Me.ucrNudWaitSeconds.Margin = New System.Windows.Forms.Padding(5) + Me.ucrNudWaitSeconds.Location = New System.Drawing.Point(524, 68) + Me.ucrNudWaitSeconds.Margin = New System.Windows.Forms.Padding(8) Me.ucrNudWaitSeconds.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudWaitSeconds.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudWaitSeconds.Name = "ucrNudWaitSeconds" - Me.ucrNudWaitSeconds.Size = New System.Drawing.Size(50, 20) + Me.ucrNudWaitSeconds.Size = New System.Drawing.Size(75, 30) Me.ucrNudWaitSeconds.TabIndex = 5 Me.ucrNudWaitSeconds.Value = New Decimal(New Integer() {0, 0, 0, 0}) ' @@ -711,14 +755,21 @@ Partial Class dlgOptions ' Me.ucrChkIncludeDefaultParams.AutoSize = True Me.ucrChkIncludeDefaultParams.Checked = False - Me.ucrChkIncludeDefaultParams.Location = New System.Drawing.Point(6, 20) - Me.ucrChkIncludeDefaultParams.Margin = New System.Windows.Forms.Padding(5) + Me.ucrChkIncludeDefaultParams.Location = New System.Drawing.Point(9, 30) + Me.ucrChkIncludeDefaultParams.Margin = New System.Windows.Forms.Padding(8) Me.ucrChkIncludeDefaultParams.Name = "ucrChkIncludeDefaultParams" - Me.ucrChkIncludeDefaultParams.Size = New System.Drawing.Size(398, 34) + Me.ucrChkIncludeDefaultParams.Size = New System.Drawing.Size(597, 51) Me.ucrChkIncludeDefaultParams.TabIndex = 3 ' 'tbpDataView ' + Me.tbpDataView.Controls.Add(Me.ucrChkTurnOffUndo) + Me.tbpDataView.Controls.Add(Me.Label4) + Me.tbpDataView.Controls.Add(Me.Label3) + Me.tbpDataView.Controls.Add(Me.ucrNudRowUndoLimit) + Me.tbpDataView.Controls.Add(Me.Label2) + Me.tbpDataView.Controls.Add(Me.Label1) + Me.tbpDataView.Controls.Add(Me.ucrNudColUndoLimit) Me.tbpDataView.Controls.Add(Me.lblEvery) Me.tbpDataView.Controls.Add(Me.lblMinutes) Me.tbpDataView.Controls.Add(Me.ucrChkAutoSave) @@ -728,29 +779,110 @@ Partial Class dlgOptions Me.tbpDataView.Controls.Add(Me.lblMaxCols) Me.tbpDataView.Controls.Add(Me.ucrNudMaxRows) Me.tbpDataView.Controls.Add(Me.lblMaxRows) - Me.tbpDataView.Location = New System.Drawing.Point(4, 22) + Me.tbpDataView.Location = New System.Drawing.Point(4, 29) + Me.tbpDataView.Margin = New System.Windows.Forms.Padding(4) Me.tbpDataView.Name = "tbpDataView" - Me.tbpDataView.Padding = New System.Windows.Forms.Padding(3) - Me.tbpDataView.Size = New System.Drawing.Size(564, 291) + Me.tbpDataView.Padding = New System.Windows.Forms.Padding(4) + Me.tbpDataView.Size = New System.Drawing.Size(850, 443) Me.tbpDataView.TabIndex = 9 Me.tbpDataView.Text = "Data View" Me.tbpDataView.UseVisualStyleBackColor = True ' + 'ucrChkTurnOffUndo + ' + Me.ucrChkTurnOffUndo.AutoSize = True + Me.ucrChkTurnOffUndo.Checked = False + Me.ucrChkTurnOffUndo.Location = New System.Drawing.Point(20, 349) + Me.ucrChkTurnOffUndo.Margin = New System.Windows.Forms.Padding(8) + Me.ucrChkTurnOffUndo.Name = "ucrChkTurnOffUndo" + Me.ucrChkTurnOffUndo.Size = New System.Drawing.Size(326, 51) + Me.ucrChkTurnOffUndo.TabIndex = 12 + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(25, 297) + Me.Label4.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(541, 20) + Me.Label4.TabIndex = 11 + Me.Label4.Text = "(Any changes from the default only apply to the current session of R-Instat.)" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(684, 262) + Me.Label3.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(46, 20) + Me.Label3.TabIndex = 10 + Me.Label3.Text = "rows." + ' + 'ucrNudRowUndoLimit + ' + Me.ucrNudRowUndoLimit.AutoSize = True + Me.ucrNudRowUndoLimit.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudRowUndoLimit.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudRowUndoLimit.Location = New System.Drawing.Point(529, 259) + Me.ucrNudRowUndoLimit.Margin = New System.Windows.Forms.Padding(8) + Me.ucrNudRowUndoLimit.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudRowUndoLimit.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudRowUndoLimit.Name = "ucrNudRowUndoLimit" + Me.ucrNudRowUndoLimit.Size = New System.Drawing.Size(106, 30) + Me.ucrNudRowUndoLimit.TabIndex = 9 + Me.ucrNudRowUndoLimit.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(644, 230) + Me.Label2.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(86, 20) + Me.Label2.TabIndex = 8 + Me.Label2.Text = "columns or" + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(16, 230) + Me.Label1.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(482, 20) + Me.Label1.TabIndex = 7 + Me.Label1.Text = "Switch off spreadsheet-syle undo when a dataframe has more than" + ' + 'ucrNudColUndoLimit + ' + Me.ucrNudColUndoLimit.AutoSize = True + Me.ucrNudColUndoLimit.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudColUndoLimit.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudColUndoLimit.Location = New System.Drawing.Point(529, 227) + Me.ucrNudColUndoLimit.Margin = New System.Windows.Forms.Padding(8) + Me.ucrNudColUndoLimit.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudColUndoLimit.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudColUndoLimit.Name = "ucrNudColUndoLimit" + Me.ucrNudColUndoLimit.Size = New System.Drawing.Size(106, 30) + Me.ucrNudColUndoLimit.TabIndex = 6 + Me.ucrNudColUndoLimit.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' 'lblEvery ' Me.lblEvery.AutoSize = True - Me.lblEvery.Location = New System.Drawing.Point(220, 115) + Me.lblEvery.Location = New System.Drawing.Point(330, 172) + Me.lblEvery.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblEvery.Name = "lblEvery" - Me.lblEvery.Size = New System.Drawing.Size(33, 13) + Me.lblEvery.Size = New System.Drawing.Size(46, 20) Me.lblEvery.TabIndex = 4 Me.lblEvery.Text = "every" ' 'lblMinutes ' Me.lblMinutes.AutoSize = True - Me.lblMinutes.Location = New System.Drawing.Point(340, 115) + Me.lblMinutes.Location = New System.Drawing.Point(510, 172) + Me.lblMinutes.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblMinutes.Name = "lblMinutes" - Me.lblMinutes.Size = New System.Drawing.Size(43, 13) + Me.lblMinutes.Size = New System.Drawing.Size(65, 20) Me.lblMinutes.TabIndex = 4 Me.lblMinutes.Text = "minutes" ' @@ -758,20 +890,20 @@ Partial Class dlgOptions ' Me.ucrChkAutoSave.AutoSize = True Me.ucrChkAutoSave.Checked = False - Me.ucrChkAutoSave.Location = New System.Drawing.Point(13, 114) - Me.ucrChkAutoSave.Margin = New System.Windows.Forms.Padding(5) + Me.ucrChkAutoSave.Location = New System.Drawing.Point(20, 171) + Me.ucrChkAutoSave.Margin = New System.Windows.Forms.Padding(8) Me.ucrChkAutoSave.Name = "ucrChkAutoSave" - Me.ucrChkAutoSave.Size = New System.Drawing.Size(217, 34) + Me.ucrChkAutoSave.Size = New System.Drawing.Size(326, 51) Me.ucrChkAutoSave.TabIndex = 3 ' 'ucrChkShowDataonGrid ' Me.ucrChkShowDataonGrid.AutoSize = True Me.ucrChkShowDataonGrid.Checked = False - Me.ucrChkShowDataonGrid.Location = New System.Drawing.Point(13, 78) - Me.ucrChkShowDataonGrid.Margin = New System.Windows.Forms.Padding(5) + Me.ucrChkShowDataonGrid.Location = New System.Drawing.Point(20, 117) + Me.ucrChkShowDataonGrid.Margin = New System.Windows.Forms.Padding(8) Me.ucrChkShowDataonGrid.Name = "ucrChkShowDataonGrid" - Me.ucrChkShowDataonGrid.Size = New System.Drawing.Size(393, 34) + Me.ucrChkShowDataonGrid.Size = New System.Drawing.Size(590, 51) Me.ucrChkShowDataonGrid.TabIndex = 3 ' 'ucrNudAutoSaveMinutes @@ -779,12 +911,12 @@ Partial Class dlgOptions Me.ucrNudAutoSaveMinutes.AutoSize = True Me.ucrNudAutoSaveMinutes.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudAutoSaveMinutes.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudAutoSaveMinutes.Location = New System.Drawing.Point(268, 112) - Me.ucrNudAutoSaveMinutes.Margin = New System.Windows.Forms.Padding(5) + Me.ucrNudAutoSaveMinutes.Location = New System.Drawing.Point(402, 168) + Me.ucrNudAutoSaveMinutes.Margin = New System.Windows.Forms.Padding(8) Me.ucrNudAutoSaveMinutes.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudAutoSaveMinutes.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudAutoSaveMinutes.Name = "ucrNudAutoSaveMinutes" - Me.ucrNudAutoSaveMinutes.Size = New System.Drawing.Size(50, 20) + Me.ucrNudAutoSaveMinutes.Size = New System.Drawing.Size(75, 30) Me.ucrNudAutoSaveMinutes.TabIndex = 2 Me.ucrNudAutoSaveMinutes.Value = New Decimal(New Integer() {0, 0, 0, 0}) ' @@ -793,21 +925,22 @@ Partial Class dlgOptions Me.ucrNudMaxCols.AutoSize = True Me.ucrNudMaxCols.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudMaxCols.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudMaxCols.Location = New System.Drawing.Point(268, 41) - Me.ucrNudMaxCols.Margin = New System.Windows.Forms.Padding(5) + Me.ucrNudMaxCols.Location = New System.Drawing.Point(402, 62) + Me.ucrNudMaxCols.Margin = New System.Windows.Forms.Padding(8) Me.ucrNudMaxCols.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudMaxCols.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudMaxCols.Name = "ucrNudMaxCols" - Me.ucrNudMaxCols.Size = New System.Drawing.Size(50, 20) + Me.ucrNudMaxCols.Size = New System.Drawing.Size(75, 30) Me.ucrNudMaxCols.TabIndex = 2 Me.ucrNudMaxCols.Value = New Decimal(New Integer() {0, 0, 0, 0}) ' 'lblMaxCols ' Me.lblMaxCols.AutoSize = True - Me.lblMaxCols.Location = New System.Drawing.Point(10, 44) + Me.lblMaxCols.Location = New System.Drawing.Point(15, 66) + Me.lblMaxCols.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblMaxCols.Name = "lblMaxCols" - Me.lblMaxCols.Size = New System.Drawing.Size(198, 13) + Me.lblMaxCols.Size = New System.Drawing.Size(297, 20) Me.lblMaxCols.TabIndex = 1 Me.lblMaxCols.Text = "Maximum Number of Columns to Display:" ' @@ -816,21 +949,22 @@ Partial Class dlgOptions Me.ucrNudMaxRows.AutoSize = True Me.ucrNudMaxRows.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudMaxRows.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudMaxRows.Location = New System.Drawing.Point(268, 15) - Me.ucrNudMaxRows.Margin = New System.Windows.Forms.Padding(5) + Me.ucrNudMaxRows.Location = New System.Drawing.Point(402, 22) + Me.ucrNudMaxRows.Margin = New System.Windows.Forms.Padding(8) Me.ucrNudMaxRows.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudMaxRows.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudMaxRows.Name = "ucrNudMaxRows" - Me.ucrNudMaxRows.Size = New System.Drawing.Size(50, 20) + Me.ucrNudMaxRows.Size = New System.Drawing.Size(75, 30) Me.ucrNudMaxRows.TabIndex = 2 Me.ucrNudMaxRows.Value = New Decimal(New Integer() {0, 0, 0, 0}) ' 'lblMaxRows ' Me.lblMaxRows.AutoSize = True - Me.lblMaxRows.Location = New System.Drawing.Point(10, 18) + Me.lblMaxRows.Location = New System.Drawing.Point(15, 27) + Me.lblMaxRows.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblMaxRows.Name = "lblMaxRows" - Me.lblMaxRows.Size = New System.Drawing.Size(185, 13) + Me.lblMaxRows.Size = New System.Drawing.Size(275, 20) Me.lblMaxRows.TabIndex = 1 Me.lblMaxRows.Text = "Maximum Number of Rows to Display:" ' @@ -839,19 +973,21 @@ Partial Class dlgOptions Me.tbpWorkingDirectory.Controls.Add(Me.cmdWorkingDirectory) Me.tbpWorkingDirectory.Controls.Add(Me.lblWorkingDirectory) Me.tbpWorkingDirectory.Controls.Add(Me.ucrWorkingDirectory) - Me.tbpWorkingDirectory.Location = New System.Drawing.Point(4, 22) + Me.tbpWorkingDirectory.Location = New System.Drawing.Point(4, 29) + Me.tbpWorkingDirectory.Margin = New System.Windows.Forms.Padding(4) Me.tbpWorkingDirectory.Name = "tbpWorkingDirectory" - Me.tbpWorkingDirectory.Padding = New System.Windows.Forms.Padding(3) - Me.tbpWorkingDirectory.Size = New System.Drawing.Size(564, 291) + Me.tbpWorkingDirectory.Padding = New System.Windows.Forms.Padding(4) + Me.tbpWorkingDirectory.Size = New System.Drawing.Size(850, 443) Me.tbpWorkingDirectory.TabIndex = 11 Me.tbpWorkingDirectory.Text = "Working Directory" Me.tbpWorkingDirectory.UseVisualStyleBackColor = True ' 'cmdWorkingDirectory ' - Me.cmdWorkingDirectory.Location = New System.Drawing.Point(399, 16) + Me.cmdWorkingDirectory.Location = New System.Drawing.Point(598, 24) + Me.cmdWorkingDirectory.Margin = New System.Windows.Forms.Padding(4) Me.cmdWorkingDirectory.Name = "cmdWorkingDirectory" - Me.cmdWorkingDirectory.Size = New System.Drawing.Size(24, 21) + Me.cmdWorkingDirectory.Size = New System.Drawing.Size(36, 32) Me.cmdWorkingDirectory.TabIndex = 2 Me.cmdWorkingDirectory.Text = "..." Me.cmdWorkingDirectory.UseVisualStyleBackColor = True @@ -859,9 +995,10 @@ Partial Class dlgOptions 'lblWorkingDirectory ' Me.lblWorkingDirectory.AutoSize = True - Me.lblWorkingDirectory.Location = New System.Drawing.Point(13, 20) + Me.lblWorkingDirectory.Location = New System.Drawing.Point(20, 30) + Me.lblWorkingDirectory.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblWorkingDirectory.Name = "lblWorkingDirectory" - Me.lblWorkingDirectory.Size = New System.Drawing.Size(95, 13) + Me.lblWorkingDirectory.Size = New System.Drawing.Size(138, 20) Me.lblWorkingDirectory.TabIndex = 0 Me.lblWorkingDirectory.Text = "Working Directory:" ' @@ -871,10 +1008,10 @@ Partial Class dlgOptions Me.ucrWorkingDirectory.AutoSize = True Me.ucrWorkingDirectory.IsMultiline = False Me.ucrWorkingDirectory.IsReadOnly = False - Me.ucrWorkingDirectory.Location = New System.Drawing.Point(138, 17) - Me.ucrWorkingDirectory.Margin = New System.Windows.Forms.Padding(6) + Me.ucrWorkingDirectory.Location = New System.Drawing.Point(207, 26) + Me.ucrWorkingDirectory.Margin = New System.Windows.Forms.Padding(9, 9, 9, 9) Me.ucrWorkingDirectory.Name = "ucrWorkingDirectory" - Me.ucrWorkingDirectory.Size = New System.Drawing.Size(255, 21) + Me.ucrWorkingDirectory.Size = New System.Drawing.Size(382, 32) Me.ucrWorkingDirectory.TabIndex = 1 ' 'tbpGraphDisplay @@ -883,10 +1020,11 @@ Partial Class dlgOptions Me.tbpGraphDisplay.Controls.Add(Me.rdoDisplayinRViewer) Me.tbpGraphDisplay.Controls.Add(Me.rdoDisplayinOutputWindow) Me.tbpGraphDisplay.Controls.Add(Me.ucrPnlGraphDisplay) - Me.tbpGraphDisplay.Location = New System.Drawing.Point(4, 22) + Me.tbpGraphDisplay.Location = New System.Drawing.Point(4, 29) + Me.tbpGraphDisplay.Margin = New System.Windows.Forms.Padding(4) Me.tbpGraphDisplay.Name = "tbpGraphDisplay" - Me.tbpGraphDisplay.Padding = New System.Windows.Forms.Padding(3) - Me.tbpGraphDisplay.Size = New System.Drawing.Size(564, 291) + Me.tbpGraphDisplay.Padding = New System.Windows.Forms.Padding(4) + Me.tbpGraphDisplay.Size = New System.Drawing.Size(850, 443) Me.tbpGraphDisplay.TabIndex = 12 Me.tbpGraphDisplay.Text = "Graph Display" Me.tbpGraphDisplay.UseVisualStyleBackColor = True @@ -895,9 +1033,10 @@ Partial Class dlgOptions ' Me.rdoDisplayinSeparateWindows.AutoSize = True Me.rdoDisplayinSeparateWindows.Checked = True - Me.rdoDisplayinSeparateWindows.Location = New System.Drawing.Point(6, 52) + Me.rdoDisplayinSeparateWindows.Location = New System.Drawing.Point(9, 78) + Me.rdoDisplayinSeparateWindows.Margin = New System.Windows.Forms.Padding(4) Me.rdoDisplayinSeparateWindows.Name = "rdoDisplayinSeparateWindows" - Me.rdoDisplayinSeparateWindows.Size = New System.Drawing.Size(163, 17) + Me.rdoDisplayinSeparateWindows.Size = New System.Drawing.Size(239, 24) Me.rdoDisplayinSeparateWindows.TabIndex = 1 Me.rdoDisplayinSeparateWindows.TabStop = True Me.rdoDisplayinSeparateWindows.Text = "Display in Separate Windows" @@ -906,9 +1045,10 @@ Partial Class dlgOptions 'rdoDisplayinRViewer ' Me.rdoDisplayinRViewer.AutoSize = True - Me.rdoDisplayinRViewer.Location = New System.Drawing.Point(6, 29) + Me.rdoDisplayinRViewer.Location = New System.Drawing.Point(9, 44) + Me.rdoDisplayinRViewer.Margin = New System.Windows.Forms.Padding(4) Me.rdoDisplayinRViewer.Name = "rdoDisplayinRViewer" - Me.rdoDisplayinRViewer.Size = New System.Drawing.Size(116, 17) + Me.rdoDisplayinRViewer.Size = New System.Drawing.Size(169, 24) Me.rdoDisplayinRViewer.TabIndex = 1 Me.rdoDisplayinRViewer.Text = "Display in R Viewer" Me.rdoDisplayinRViewer.UseVisualStyleBackColor = True @@ -916,9 +1056,10 @@ Partial Class dlgOptions 'rdoDisplayinOutputWindow ' Me.rdoDisplayinOutputWindow.AutoSize = True - Me.rdoDisplayinOutputWindow.Location = New System.Drawing.Point(6, 6) + Me.rdoDisplayinOutputWindow.Location = New System.Drawing.Point(9, 9) + Me.rdoDisplayinOutputWindow.Margin = New System.Windows.Forms.Padding(4) Me.rdoDisplayinOutputWindow.Name = "rdoDisplayinOutputWindow" - Me.rdoDisplayinOutputWindow.Size = New System.Drawing.Size(147, 17) + Me.rdoDisplayinOutputWindow.Size = New System.Drawing.Size(214, 24) Me.rdoDisplayinOutputWindow.TabIndex = 1 Me.rdoDisplayinOutputWindow.Text = "Display in Output Window" Me.rdoDisplayinOutputWindow.UseVisualStyleBackColor = True @@ -926,10 +1067,10 @@ Partial Class dlgOptions 'ucrPnlGraphDisplay ' Me.ucrPnlGraphDisplay.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlGraphDisplay.Location = New System.Drawing.Point(0, 3) - Me.ucrPnlGraphDisplay.Margin = New System.Windows.Forms.Padding(5) + Me.ucrPnlGraphDisplay.Location = New System.Drawing.Point(0, 4) + Me.ucrPnlGraphDisplay.Margin = New System.Windows.Forms.Padding(8) Me.ucrPnlGraphDisplay.Name = "ucrPnlGraphDisplay" - Me.ucrPnlGraphDisplay.Size = New System.Drawing.Size(365, 66) + Me.ucrPnlGraphDisplay.Size = New System.Drawing.Size(548, 99) Me.ucrPnlGraphDisplay.TabIndex = 3 ' 'tbpTailoredMenus @@ -938,10 +1079,11 @@ Partial Class dlgOptions Me.tbpTailoredMenus.Controls.Add(Me.ucrChkViewOptionsByContextMenu) Me.tbpTailoredMenus.Controls.Add(Me.ucrChkViewProcurementMenu) Me.tbpTailoredMenus.Controls.Add(Me.ucrChkViewClimaticMenu) - Me.tbpTailoredMenus.Location = New System.Drawing.Point(4, 22) + Me.tbpTailoredMenus.Location = New System.Drawing.Point(4, 29) + Me.tbpTailoredMenus.Margin = New System.Windows.Forms.Padding(4) Me.tbpTailoredMenus.Name = "tbpTailoredMenus" - Me.tbpTailoredMenus.Padding = New System.Windows.Forms.Padding(3) - Me.tbpTailoredMenus.Size = New System.Drawing.Size(564, 291) + Me.tbpTailoredMenus.Padding = New System.Windows.Forms.Padding(4) + Me.tbpTailoredMenus.Size = New System.Drawing.Size(850, 443) Me.tbpTailoredMenus.TabIndex = 13 Me.tbpTailoredMenus.Text = "Tailored Menus" Me.tbpTailoredMenus.UseVisualStyleBackColor = True @@ -950,40 +1092,40 @@ Partial Class dlgOptions ' Me.ucrChkViewStructuredMenu.AutoSize = True Me.ucrChkViewStructuredMenu.Checked = False - Me.ucrChkViewStructuredMenu.Location = New System.Drawing.Point(7, 12) - Me.ucrChkViewStructuredMenu.Margin = New System.Windows.Forms.Padding(5) + Me.ucrChkViewStructuredMenu.Location = New System.Drawing.Point(10, 18) + Me.ucrChkViewStructuredMenu.Margin = New System.Windows.Forms.Padding(8) Me.ucrChkViewStructuredMenu.Name = "ucrChkViewStructuredMenu" - Me.ucrChkViewStructuredMenu.Size = New System.Drawing.Size(378, 34) + Me.ucrChkViewStructuredMenu.Size = New System.Drawing.Size(567, 51) Me.ucrChkViewStructuredMenu.TabIndex = 2 ' 'ucrChkViewOptionsByContextMenu ' Me.ucrChkViewOptionsByContextMenu.AutoSize = True Me.ucrChkViewOptionsByContextMenu.Checked = False - Me.ucrChkViewOptionsByContextMenu.Location = New System.Drawing.Point(7, 137) - Me.ucrChkViewOptionsByContextMenu.Margin = New System.Windows.Forms.Padding(5) + Me.ucrChkViewOptionsByContextMenu.Location = New System.Drawing.Point(10, 206) + Me.ucrChkViewOptionsByContextMenu.Margin = New System.Windows.Forms.Padding(8) Me.ucrChkViewOptionsByContextMenu.Name = "ucrChkViewOptionsByContextMenu" - Me.ucrChkViewOptionsByContextMenu.Size = New System.Drawing.Size(413, 34) + Me.ucrChkViewOptionsByContextMenu.Size = New System.Drawing.Size(620, 51) Me.ucrChkViewOptionsByContextMenu.TabIndex = 1 ' 'ucrChkViewProcurementMenu ' Me.ucrChkViewProcurementMenu.AutoSize = True Me.ucrChkViewProcurementMenu.Checked = False - Me.ucrChkViewProcurementMenu.Location = New System.Drawing.Point(7, 95) - Me.ucrChkViewProcurementMenu.Margin = New System.Windows.Forms.Padding(5) + Me.ucrChkViewProcurementMenu.Location = New System.Drawing.Point(10, 142) + Me.ucrChkViewProcurementMenu.Margin = New System.Windows.Forms.Padding(8) Me.ucrChkViewProcurementMenu.Name = "ucrChkViewProcurementMenu" - Me.ucrChkViewProcurementMenu.Size = New System.Drawing.Size(413, 34) + Me.ucrChkViewProcurementMenu.Size = New System.Drawing.Size(620, 51) Me.ucrChkViewProcurementMenu.TabIndex = 0 ' 'ucrChkViewClimaticMenu ' Me.ucrChkViewClimaticMenu.AutoSize = True Me.ucrChkViewClimaticMenu.Checked = False - Me.ucrChkViewClimaticMenu.Location = New System.Drawing.Point(7, 53) - Me.ucrChkViewClimaticMenu.Margin = New System.Windows.Forms.Padding(5) + Me.ucrChkViewClimaticMenu.Location = New System.Drawing.Point(10, 80) + Me.ucrChkViewClimaticMenu.Margin = New System.Windows.Forms.Padding(8) Me.ucrChkViewClimaticMenu.Name = "ucrChkViewClimaticMenu" - Me.ucrChkViewClimaticMenu.Size = New System.Drawing.Size(407, 34) + Me.ucrChkViewClimaticMenu.Size = New System.Drawing.Size(610, 51) Me.ucrChkViewClimaticMenu.TabIndex = 0 ' 'tbpClimsoft @@ -996,10 +1138,11 @@ Partial Class dlgOptions Me.tbpClimsoft.Controls.Add(Me.ucrInputPort) Me.tbpClimsoft.Controls.Add(Me.ucrInputHost) Me.tbpClimsoft.Controls.Add(Me.ucrInputDatabaseName) - Me.tbpClimsoft.Location = New System.Drawing.Point(4, 22) + Me.tbpClimsoft.Location = New System.Drawing.Point(4, 29) + Me.tbpClimsoft.Margin = New System.Windows.Forms.Padding(4) Me.tbpClimsoft.Name = "tbpClimsoft" - Me.tbpClimsoft.Padding = New System.Windows.Forms.Padding(3) - Me.tbpClimsoft.Size = New System.Drawing.Size(564, 291) + Me.tbpClimsoft.Padding = New System.Windows.Forms.Padding(4) + Me.tbpClimsoft.Size = New System.Drawing.Size(850, 443) Me.tbpClimsoft.TabIndex = 14 Me.tbpClimsoft.Text = "Climsoft" Me.tbpClimsoft.UseVisualStyleBackColor = True @@ -1008,9 +1151,10 @@ Partial Class dlgOptions ' Me.lblUserName.AutoSize = True Me.lblUserName.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblUserName.Location = New System.Drawing.Point(6, 103) + Me.lblUserName.Location = New System.Drawing.Point(9, 154) + Me.lblUserName.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblUserName.Name = "lblUserName" - Me.lblUserName.Size = New System.Drawing.Size(58, 13) + Me.lblUserName.Size = New System.Drawing.Size(87, 20) Me.lblUserName.TabIndex = 19 Me.lblUserName.Text = "Username:" ' @@ -1018,9 +1162,10 @@ Partial Class dlgOptions ' Me.lblPort.AutoSize = True Me.lblPort.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblPort.Location = New System.Drawing.Point(6, 76) + Me.lblPort.Location = New System.Drawing.Point(9, 114) + Me.lblPort.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblPort.Name = "lblPort" - Me.lblPort.Size = New System.Drawing.Size(29, 13) + Me.lblPort.Size = New System.Drawing.Size(42, 20) Me.lblPort.TabIndex = 18 Me.lblPort.Text = "Port:" ' @@ -1028,9 +1173,10 @@ Partial Class dlgOptions ' Me.lblHost.AutoSize = True Me.lblHost.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblHost.Location = New System.Drawing.Point(6, 49) + Me.lblHost.Location = New System.Drawing.Point(9, 74) + Me.lblHost.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblHost.Name = "lblHost" - Me.lblHost.Size = New System.Drawing.Size(32, 13) + Me.lblHost.Size = New System.Drawing.Size(47, 20) Me.lblHost.TabIndex = 17 Me.lblHost.Text = "Host:" ' @@ -1038,9 +1184,10 @@ Partial Class dlgOptions ' Me.lblDatabaseName.AutoSize = True Me.lblDatabaseName.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblDatabaseName.Location = New System.Drawing.Point(6, 21) + Me.lblDatabaseName.Location = New System.Drawing.Point(9, 32) + Me.lblDatabaseName.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblDatabaseName.Name = "lblDatabaseName" - Me.lblDatabaseName.Size = New System.Drawing.Size(87, 13) + Me.lblDatabaseName.Size = New System.Drawing.Size(129, 20) Me.lblDatabaseName.TabIndex = 16 Me.lblDatabaseName.Text = "Database Name:" ' @@ -1050,10 +1197,10 @@ Partial Class dlgOptions Me.ucrInputUserName.AutoSize = True Me.ucrInputUserName.IsMultiline = False Me.ucrInputUserName.IsReadOnly = False - Me.ucrInputUserName.Location = New System.Drawing.Point(168, 96) - Me.ucrInputUserName.Margin = New System.Windows.Forms.Padding(6) + Me.ucrInputUserName.Location = New System.Drawing.Point(252, 144) + Me.ucrInputUserName.Margin = New System.Windows.Forms.Padding(9, 9, 9, 9) Me.ucrInputUserName.Name = "ucrInputUserName" - Me.ucrInputUserName.Size = New System.Drawing.Size(137, 21) + Me.ucrInputUserName.Size = New System.Drawing.Size(206, 32) Me.ucrInputUserName.TabIndex = 15 ' 'ucrInputPort @@ -1062,10 +1209,10 @@ Partial Class dlgOptions Me.ucrInputPort.AutoSize = True Me.ucrInputPort.IsMultiline = False Me.ucrInputPort.IsReadOnly = False - Me.ucrInputPort.Location = New System.Drawing.Point(168, 69) - Me.ucrInputPort.Margin = New System.Windows.Forms.Padding(6) + Me.ucrInputPort.Location = New System.Drawing.Point(252, 104) + Me.ucrInputPort.Margin = New System.Windows.Forms.Padding(9, 9, 9, 9) Me.ucrInputPort.Name = "ucrInputPort" - Me.ucrInputPort.Size = New System.Drawing.Size(137, 21) + Me.ucrInputPort.Size = New System.Drawing.Size(206, 32) Me.ucrInputPort.TabIndex = 14 ' 'ucrInputHost @@ -1074,10 +1221,10 @@ Partial Class dlgOptions Me.ucrInputHost.AutoSize = True Me.ucrInputHost.IsMultiline = False Me.ucrInputHost.IsReadOnly = False - Me.ucrInputHost.Location = New System.Drawing.Point(168, 43) - Me.ucrInputHost.Margin = New System.Windows.Forms.Padding(6) + Me.ucrInputHost.Location = New System.Drawing.Point(252, 64) + Me.ucrInputHost.Margin = New System.Windows.Forms.Padding(9, 9, 9, 9) Me.ucrInputHost.Name = "ucrInputHost" - Me.ucrInputHost.Size = New System.Drawing.Size(137, 21) + Me.ucrInputHost.Size = New System.Drawing.Size(206, 32) Me.ucrInputHost.TabIndex = 13 ' 'ucrInputDatabaseName @@ -1086,20 +1233,19 @@ Partial Class dlgOptions Me.ucrInputDatabaseName.AutoSize = True Me.ucrInputDatabaseName.IsMultiline = False Me.ucrInputDatabaseName.IsReadOnly = False - Me.ucrInputDatabaseName.Location = New System.Drawing.Point(168, 17) - Me.ucrInputDatabaseName.Margin = New System.Windows.Forms.Padding(6) + Me.ucrInputDatabaseName.Location = New System.Drawing.Point(252, 26) + Me.ucrInputDatabaseName.Margin = New System.Windows.Forms.Padding(9, 9, 9, 9) Me.ucrInputDatabaseName.Name = "ucrInputDatabaseName" - Me.ucrInputDatabaseName.Size = New System.Drawing.Size(137, 21) + Me.ucrInputDatabaseName.Size = New System.Drawing.Size(206, 32) Me.ucrInputDatabaseName.TabIndex = 12 ' 'tbpWebsite ' Me.tbpWebsite.Controls.Add(Me.ucrChkReminder) - Me.tbpWebsite.Location = New System.Drawing.Point(4, 22) - Me.tbpWebsite.Margin = New System.Windows.Forms.Padding(2) + Me.tbpWebsite.Location = New System.Drawing.Point(4, 29) Me.tbpWebsite.Name = "tbpWebsite" - Me.tbpWebsite.Padding = New System.Windows.Forms.Padding(2) - Me.tbpWebsite.Size = New System.Drawing.Size(564, 291) + Me.tbpWebsite.Padding = New System.Windows.Forms.Padding(3) + Me.tbpWebsite.Size = New System.Drawing.Size(850, 443) Me.tbpWebsite.TabIndex = 15 Me.tbpWebsite.Text = "Website" Me.tbpWebsite.UseVisualStyleBackColor = True @@ -1108,18 +1254,18 @@ Partial Class dlgOptions ' Me.ucrChkReminder.AutoSize = True Me.ucrChkReminder.Checked = False - Me.ucrChkReminder.Location = New System.Drawing.Point(7, 22) - Me.ucrChkReminder.Margin = New System.Windows.Forms.Padding(5) + Me.ucrChkReminder.Location = New System.Drawing.Point(10, 33) + Me.ucrChkReminder.Margin = New System.Windows.Forms.Padding(8) Me.ucrChkReminder.Name = "ucrChkReminder" - Me.ucrChkReminder.Size = New System.Drawing.Size(413, 34) + Me.ucrChkReminder.Size = New System.Drawing.Size(620, 51) Me.ucrChkReminder.TabIndex = 2 ' 'dlgOptions ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) + Me.AutoScaleDimensions = New System.Drawing.SizeF(144.0!, 144.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True - Me.ClientSize = New System.Drawing.Size(770, 353) + Me.ClientSize = New System.Drawing.Size(1155, 530) Me.Controls.Add(Me.cmdLanguage) Me.Controls.Add(Me.cmdApply) Me.Controls.Add(Me.cmdHelp) @@ -1127,6 +1273,7 @@ Partial Class dlgOptions Me.Controls.Add(Me.cmdOk) Me.Controls.Add(Me.spltControls) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.Margin = New System.Windows.Forms.Padding(4) Me.MaximizeBox = False Me.MinimizeBox = False Me.Name = "dlgOptions" @@ -1256,4 +1403,11 @@ Partial Class dlgOptions Friend WithEvents lversion As Label Friend WithEvents tbpWebsite As TabPage Friend WithEvents ucrChkReminder As ucrCheck + Friend WithEvents ucrNudColUndoLimit As ucrNud + Friend WithEvents Label2 As Label + Friend WithEvents Label1 As Label + Friend WithEvents Label3 As Label + Friend WithEvents ucrNudRowUndoLimit As ucrNud + Friend WithEvents Label4 As Label + Friend WithEvents ucrChkTurnOffUndo As ucrCheck End Class diff --git a/instat/dlgOptions.vb b/instat/dlgOptions.vb index 35cf301c8b7..f1c25588dca 100644 --- a/instat/dlgOptions.vb +++ b/instat/dlgOptions.vb @@ -61,6 +61,13 @@ Public Class dlgOptions ucrNudWaitSeconds.Maximum = Integer.MaxValue ucrNudWaitSeconds.Increment = 0.5 + ucrNudColUndoLimit.Maximum = 1000 + ucrNudColUndoLimit.Minimum = 0 + ucrNudColUndoLimit.Increment = 100 + ucrNudRowUndoLimit.Maximum = Integer.MaxValue + ucrNudRowUndoLimit.Minimum = 100000 + ucrNudRowUndoLimit.Increment = 100000 + strPreviewText = "R-Instat 2017" rtbCommandPreview.Text = strPreviewText rtbCommentPreview.Text = strPreviewText @@ -78,6 +85,7 @@ Public Class dlgOptions ucrChkShowDataonGrid.SetText("Display dialog's selected data frame in grid") ucrChkIncludeDefaultParams.SetText("Include Default Parameter Values in R Commands") ucrChkAutoSave.SetText("Auto save a backup of data") + ucrChkTurnOffUndo.SetText("Switch off Spreadsheet-Style Undo") ucrChkShowWaitDialog.SetText("Show waiting dialog when command takes longer than") ucrChkReminder.SetText("Remind me later when R-Instat new version available") ucrChkAutoSave.AddToLinkedControls(ucrNudAutoSaveMinutes, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) @@ -102,12 +110,15 @@ Public Class dlgOptions Private Sub LoadInstatOptions() ucrChkIncludeDefaultParams.Checked = frmMain.clsInstatOptions.bIncludeRDefaultParameters ucrChkAutoSave.Checked = frmMain.clsInstatOptions.bAutoSaveData + ucrChkTurnOffUndo.Checked = frmMain.clsInstatOptions.bSwitchOffUndo SetOutputFont(frmMain.clsInstatOptions.fntOutput, frmMain.clsInstatOptions.clrOutput) SetCommandFont(frmMain.clsInstatOptions.fntScript, frmMain.clsInstatOptions.clrScript) SetCommentFont(frmMain.clsInstatOptions.fntComment, frmMain.clsInstatOptions.clrComment) SetEditorFont(frmMain.clsInstatOptions.fntEditor, frmMain.clsInstatOptions.clrEditor) ucrNudMaxRows.Value = frmMain.clsInstatOptions.iMaxRows ucrNudMaxCols.Value = frmMain.clsInstatOptions.iMaxCols + ucrNudColUndoLimit.Value = frmMain.clsInstatOptions.iUndoColLimit + ucrNudRowUndoLimit.Value = frmMain.clsInstatOptions.iUndoRowLimit ucrNudAutoSaveMinutes.Value = frmMain.clsInstatOptions.iAutoSaveDataMinutes ucrNudPreviewRows.Value = frmMain.clsInstatOptions.iPreviewRows ucrInputComment.SetName(frmMain.clsInstatOptions.strComment) @@ -171,7 +182,10 @@ Public Class dlgOptions frmMain.clsInstatOptions.SetPreviewRows(ucrNudPreviewRows.Value) frmMain.clsInstatOptions.SetMaxRows(ucrNudMaxRows.Value) frmMain.clsInstatOptions.SetMaxCols(ucrNudMaxCols.Value) + frmMain.clsInstatOptions.SetUndoColLimit(ucrNudColUndoLimit.Value) + frmMain.clsInstatOptions.SetUndoRowLimit(ucrNudRowUndoLimit.Value) frmMain.clsInstatOptions.SetAutoSaveData(ucrChkAutoSave.Checked) + frmMain.clsInstatOptions.SetOffUndo(ucrChkTurnOffUndo.Checked) frmMain.clsInstatOptions.SetAutoSaveDataMinutes(ucrNudAutoSaveMinutes.Value) frmMain.clsInstatOptions.SetLanguageCultureCode(strCurrLanguageCulture) frmMain.clsInstatOptions.SetWorkingDirectory(strWorkingDirectory) @@ -195,6 +209,7 @@ Public Class dlgOptions frmMain.clsInstatOptions.SetMaximumOutputsHeight(If(ucrChkMaxOutputsHeight.Checked, ucrNudMaxOutputsHeight.Value, -1)) frmMain.clsInstatOptions.ExecuteRGlobalOptions() + frmMain.DisableEnableUndo(ucrChkTurnOffUndo.Checked) End Sub Private Sub SetView() @@ -360,7 +375,7 @@ Public Class dlgOptions End Sub - Private Sub AllControls_ControlValueChanged() Handles ucrNudMaxCols.ControlValueChanged, ucrNudAutoSaveMinutes.ControlValueChanged, ucrNudPreviewRows.ControlValueChanged, ucrInputComment.ControlContentsChanged, ucrChkIncludeCommentsbyDefault.ControlValueChanged, ucrNudMaxRows.ControlValueChanged, ucrChkIncludeDefaultParams.ControlValueChanged, ucrChkShowRCommandsinOutputWindow.ControlValueChanged, ucrNudDigits.ControlValueChanged, ucrChkShowSignifStars.ControlValueChanged, ucrChkShowDataonGrid.ControlValueChanged, ucrChkAutoSave.ControlValueChanged, ucrChkShowWaitDialog.ControlValueChanged, ucrNudWaitSeconds.ControlValueChanged, ucrChkViewClimaticMenu.ControlValueChanged, ucrChkViewStructuredMenu.ControlValueChanged, ucrChkViewProcurementMenu.ControlValueChanged, ucrChkViewOptionsByContextMenu.ControlValueChanged, ucrInputDatabaseName.ControlValueChanged, ucrInputHost.ControlValueChanged, ucrInputPort.ControlValueChanged, ucrInputUserName.ControlValueChanged, ucrChkMaxOutputsHeight.ControlValueChanged, ucrNudMaxOutputsHeight.ControlValueChanged, ucrChkReminder.ControlValueChanged + Private Sub AllControls_ControlValueChanged() Handles ucrNudMaxCols.ControlValueChanged, ucrNudAutoSaveMinutes.ControlValueChanged, ucrNudPreviewRows.ControlValueChanged, ucrInputComment.ControlContentsChanged, ucrChkIncludeCommentsbyDefault.ControlValueChanged, ucrNudMaxRows.ControlValueChanged, ucrChkIncludeDefaultParams.ControlValueChanged, ucrChkShowRCommandsinOutputWindow.ControlValueChanged, ucrNudDigits.ControlValueChanged, ucrChkShowSignifStars.ControlValueChanged, ucrChkShowDataonGrid.ControlValueChanged, ucrChkAutoSave.ControlValueChanged, ucrChkTurnOffUndo.ControlValueChanged, ucrChkShowWaitDialog.ControlValueChanged, ucrNudWaitSeconds.ControlValueChanged, ucrChkViewClimaticMenu.ControlValueChanged, ucrChkViewStructuredMenu.ControlValueChanged, ucrChkViewProcurementMenu.ControlValueChanged, ucrChkViewOptionsByContextMenu.ControlValueChanged, ucrInputDatabaseName.ControlValueChanged, ucrInputHost.ControlValueChanged, ucrInputPort.ControlValueChanged, ucrInputUserName.ControlValueChanged, ucrChkMaxOutputsHeight.ControlValueChanged, ucrNudMaxOutputsHeight.ControlValueChanged, ucrChkReminder.ControlValueChanged, ucrNudColUndoLimit.ControlValueChanged, ucrNudRowUndoLimit.ControlValueChanged ApplyEnabled(True) End Sub @@ -428,7 +443,15 @@ Public Class dlgOptions ApplyEnabled(True) End Sub - Private Sub AllControls_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrNudWaitSeconds.ControlValueChanged, ucrNudPreviewRows.ControlValueChanged, ucrNudMaxRows.ControlValueChanged, ucrNudMaxCols.ControlValueChanged, ucrNudDigits.ControlValueChanged, ucrNudAutoSaveMinutes.ControlValueChanged, ucrInputUserName.ControlValueChanged, ucrInputPort.ControlValueChanged, ucrInputHost.ControlValueChanged, ucrInputDatabaseName.ControlValueChanged, ucrInputComment.ControlContentsChanged, ucrChkViewStructuredMenu.ControlValueChanged, ucrChkViewProcurementMenu.ControlValueChanged, ucrChkViewOptionsByContextMenu.ControlValueChanged, ucrChkViewClimaticMenu.ControlValueChanged, ucrChkShowWaitDialog.ControlValueChanged, ucrChkShowSignifStars.ControlValueChanged, ucrChkShowRCommandsinOutputWindow.ControlValueChanged, ucrChkShowDataonGrid.ControlValueChanged, ucrChkIncludeDefaultParams.ControlValueChanged, ucrChkIncludeCommentsbyDefault.ControlValueChanged, ucrChkAutoSave.ControlValueChanged, ucrNudMaxOutputsHeight.ControlValueChanged, ucrChkMaxOutputsHeight.ControlValueChanged, ucrChkReminder.ControlValueChanged + Private Sub AllControls_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrNudWaitSeconds.ControlValueChanged, ucrNudPreviewRows.ControlValueChanged, ucrNudMaxRows.ControlValueChanged, ucrNudMaxCols.ControlValueChanged, ucrNudDigits.ControlValueChanged, ucrNudAutoSaveMinutes.ControlValueChanged, ucrInputUserName.ControlValueChanged, ucrInputPort.ControlValueChanged, ucrInputHost.ControlValueChanged, ucrInputDatabaseName.ControlValueChanged, ucrInputComment.ControlContentsChanged, ucrChkViewStructuredMenu.ControlValueChanged, ucrChkViewProcurementMenu.ControlValueChanged, ucrChkViewOptionsByContextMenu.ControlValueChanged, ucrChkViewClimaticMenu.ControlValueChanged, ucrChkShowWaitDialog.ControlValueChanged, ucrChkShowSignifStars.ControlValueChanged, ucrChkShowRCommandsinOutputWindow.ControlValueChanged, ucrChkShowDataonGrid.ControlValueChanged, ucrChkIncludeDefaultParams.ControlValueChanged, ucrChkIncludeCommentsbyDefault.ControlValueChanged, ucrChkAutoSave.ControlValueChanged, ucrNudMaxOutputsHeight.ControlValueChanged, ucrChkMaxOutputsHeight.ControlValueChanged, ucrChkReminder.ControlValueChanged, ucrNudColUndoLimit.ControlValueChanged, ucrNudRowUndoLimit.ControlValueChanged, ucrChkTurnOffUndo.ControlValueChanged + + End Sub + + Private Sub ucrInputLanguage_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputLanguage.ControlValueChanged + + End Sub + + Private Sub ucrPnlGraphDisplay_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlGraphDisplay.ControlValueChanged End Sub diff --git a/instat/dlgPICSACrops.Designer.vb b/instat/dlgPICSACrops.Designer.vb index dee8add1de3..e787f1db1b8 100644 --- a/instat/dlgPICSACrops.Designer.vb +++ b/instat/dlgPICSACrops.Designer.vb @@ -19,7 +19,7 @@ Partial Class dlgPICSACrops 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,7 +36,7 @@ Partial Class dlgPICSACrops 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. - _ + Private Sub InitializeComponent() Me.lblSelectedSet = New System.Windows.Forms.Label() Me.Label2 = New System.Windows.Forms.Label() @@ -49,13 +49,16 @@ Partial Class dlgPICSACrops Me.ucrReceiverStart = New instat.ucrReceiverSingle() Me.ucrReceiverEnd = New instat.ucrReceiverSingle() Me.grpCropDefinitions = New System.Windows.Forms.GroupBox() - Me.lblPlantingDays = New System.Windows.Forms.Label() - Me.lblCropLengthDays = New System.Windows.Forms.Label() - Me.lblWaterAmounts = New System.Windows.Forms.Label() - Me.ucrChkRequirePlantingDays = New instat.ucrCheck() Me.ucrInputCropLengths = New instat.ucrInputComboBox() Me.ucrInputWaterAmounts = New instat.ucrInputComboBox() Me.ucrInputPlantingDates = New instat.ucrInputComboBox() + Me.rdoBoth = New System.Windows.Forms.RadioButton() + Me.rdoNo = New System.Windows.Forms.RadioButton() + Me.rdoYes = New System.Windows.Forms.RadioButton() + Me.lblPlantingDays = New System.Windows.Forms.Label() + Me.lblCropLengthDays = New System.Windows.Forms.Label() + Me.lblWaterAmounts = New System.Windows.Forms.Label() + Me.ucrPnlStartCheck = New instat.UcrPanel() Me.ucrChkDataProp = New instat.ucrCheck() Me.ucrChkPrintDataProp = New instat.ucrCheck() Me.ucrReceiverRainfall = New instat.ucrReceiverSingle() @@ -64,6 +67,7 @@ Partial Class dlgPICSACrops Me.ucrReceiverStation = New instat.ucrReceiverSingle() Me.ucrSelectorForCrops = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrBase = New instat.ucrButtons() + Me.lblStarts = New System.Windows.Forms.Label() Me.grpSeasonReceivers.SuspendLayout() Me.grpCropDefinitions.SuspendLayout() Me.SuspendLayout() @@ -180,24 +184,100 @@ Partial Class dlgPICSACrops ' 'grpCropDefinitions ' - Me.grpCropDefinitions.Controls.Add(Me.lblPlantingDays) - Me.grpCropDefinitions.Controls.Add(Me.lblCropLengthDays) - Me.grpCropDefinitions.Controls.Add(Me.lblWaterAmounts) - Me.grpCropDefinitions.Controls.Add(Me.ucrChkRequirePlantingDays) + Me.grpCropDefinitions.Controls.Add(Me.lblStarts) Me.grpCropDefinitions.Controls.Add(Me.ucrInputCropLengths) Me.grpCropDefinitions.Controls.Add(Me.ucrInputWaterAmounts) Me.grpCropDefinitions.Controls.Add(Me.ucrInputPlantingDates) + Me.grpCropDefinitions.Controls.Add(Me.rdoBoth) + Me.grpCropDefinitions.Controls.Add(Me.rdoNo) + Me.grpCropDefinitions.Controls.Add(Me.rdoYes) + Me.grpCropDefinitions.Controls.Add(Me.lblPlantingDays) + Me.grpCropDefinitions.Controls.Add(Me.lblCropLengthDays) + Me.grpCropDefinitions.Controls.Add(Me.lblWaterAmounts) + Me.grpCropDefinitions.Controls.Add(Me.ucrPnlStartCheck) Me.grpCropDefinitions.Location = New System.Drawing.Point(6, 194) Me.grpCropDefinitions.Name = "grpCropDefinitions" - Me.grpCropDefinitions.Size = New System.Drawing.Size(323, 158) + Me.grpCropDefinitions.Size = New System.Drawing.Size(292, 158) Me.grpCropDefinitions.TabIndex = 39 Me.grpCropDefinitions.TabStop = False Me.grpCropDefinitions.Text = "Crop Definitions" ' + 'ucrInputCropLengths + ' + Me.ucrInputCropLengths.AddQuotesIfUnrecognised = True + Me.ucrInputCropLengths.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrInputCropLengths.GetSetSelectedIndex = -1 + Me.ucrInputCropLengths.IsReadOnly = False + Me.ucrInputCropLengths.Location = New System.Drawing.Point(106, 129) + Me.ucrInputCropLengths.Margin = New System.Windows.Forms.Padding(6) + Me.ucrInputCropLengths.Name = "ucrInputCropLengths" + Me.ucrInputCropLengths.Size = New System.Drawing.Size(170, 21) + Me.ucrInputCropLengths.TabIndex = 55 + ' + 'ucrInputWaterAmounts + ' + Me.ucrInputWaterAmounts.AddQuotesIfUnrecognised = True + Me.ucrInputWaterAmounts.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrInputWaterAmounts.GetSetSelectedIndex = -1 + Me.ucrInputWaterAmounts.IsReadOnly = False + Me.ucrInputWaterAmounts.Location = New System.Drawing.Point(107, 92) + Me.ucrInputWaterAmounts.Margin = New System.Windows.Forms.Padding(9) + Me.ucrInputWaterAmounts.Name = "ucrInputWaterAmounts" + Me.ucrInputWaterAmounts.Size = New System.Drawing.Size(169, 21) + Me.ucrInputWaterAmounts.TabIndex = 40 + ' + 'ucrInputPlantingDates + ' + Me.ucrInputPlantingDates.AddQuotesIfUnrecognised = True + Me.ucrInputPlantingDates.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrInputPlantingDates.GetSetSelectedIndex = -1 + Me.ucrInputPlantingDates.IsReadOnly = False + Me.ucrInputPlantingDates.Location = New System.Drawing.Point(107, 58) + Me.ucrInputPlantingDates.Margin = New System.Windows.Forms.Padding(9) + Me.ucrInputPlantingDates.Name = "ucrInputPlantingDates" + Me.ucrInputPlantingDates.Size = New System.Drawing.Size(169, 21) + Me.ucrInputPlantingDates.TabIndex = 53 + ' + 'rdoBoth + ' + Me.rdoBoth.AutoSize = True + Me.rdoBoth.Location = New System.Drawing.Point(225, 25) + Me.rdoBoth.Margin = New System.Windows.Forms.Padding(2) + Me.rdoBoth.Name = "rdoBoth" + Me.rdoBoth.Size = New System.Drawing.Size(47, 17) + Me.rdoBoth.TabIndex = 44 + Me.rdoBoth.TabStop = True + Me.rdoBoth.Text = "Both" + Me.rdoBoth.UseVisualStyleBackColor = True + ' + 'rdoNo + ' + Me.rdoNo.AutoSize = True + Me.rdoNo.Location = New System.Drawing.Point(153, 25) + Me.rdoNo.Margin = New System.Windows.Forms.Padding(2) + Me.rdoNo.Name = "rdoNo" + Me.rdoNo.Size = New System.Drawing.Size(39, 17) + Me.rdoNo.TabIndex = 45 + Me.rdoNo.TabStop = True + Me.rdoNo.Text = "No" + Me.rdoNo.UseVisualStyleBackColor = True + ' + 'rdoYes + ' + Me.rdoYes.AutoSize = True + Me.rdoYes.Location = New System.Drawing.Point(81, 25) + Me.rdoYes.Margin = New System.Windows.Forms.Padding(2) + Me.rdoYes.Name = "rdoYes" + Me.rdoYes.Size = New System.Drawing.Size(43, 17) + Me.rdoYes.TabIndex = 43 + Me.rdoYes.TabStop = True + Me.rdoYes.Text = "Yes" + Me.rdoYes.UseVisualStyleBackColor = True + ' 'lblPlantingDays ' Me.lblPlantingDays.AutoSize = True - Me.lblPlantingDays.Location = New System.Drawing.Point(6, 51) + Me.lblPlantingDays.Location = New System.Drawing.Point(3, 60) Me.lblPlantingDays.Name = "lblPlantingDays" Me.lblPlantingDays.Size = New System.Drawing.Size(81, 13) Me.lblPlantingDays.TabIndex = 42 @@ -206,7 +286,7 @@ Partial Class dlgPICSACrops 'lblCropLengthDays ' Me.lblCropLengthDays.AutoSize = True - Me.lblCropLengthDays.Location = New System.Drawing.Point(6, 129) + Me.lblCropLengthDays.Location = New System.Drawing.Point(5, 133) Me.lblCropLengthDays.Name = "lblCropLengthDays" Me.lblCropLengthDays.Size = New System.Drawing.Size(101, 13) Me.lblCropLengthDays.TabIndex = 41 @@ -215,59 +295,27 @@ Partial Class dlgPICSACrops 'lblWaterAmounts ' Me.lblWaterAmounts.AutoSize = True - Me.lblWaterAmounts.Location = New System.Drawing.Point(6, 92) + Me.lblWaterAmounts.Location = New System.Drawing.Point(5, 95) Me.lblWaterAmounts.Name = "lblWaterAmounts" Me.lblWaterAmounts.Size = New System.Drawing.Size(89, 13) Me.lblWaterAmounts.TabIndex = 40 Me.lblWaterAmounts.Text = "Water Amount(s):" ' - 'ucrChkRequirePlantingDays - ' - Me.ucrChkRequirePlantingDays.AutoSize = True - Me.ucrChkRequirePlantingDays.Checked = False - Me.ucrChkRequirePlantingDays.Location = New System.Drawing.Point(6, 18) - Me.ucrChkRequirePlantingDays.Name = "ucrChkRequirePlantingDays" - Me.ucrChkRequirePlantingDays.Size = New System.Drawing.Size(286, 23) - Me.ucrChkRequirePlantingDays.TabIndex = 39 - ' - 'ucrInputCropLengths - ' - Me.ucrInputCropLengths.AddQuotesIfUnrecognised = True - Me.ucrInputCropLengths.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrInputCropLengths.GetSetSelectedIndex = -1 - Me.ucrInputCropLengths.IsReadOnly = False - Me.ucrInputCropLengths.Location = New System.Drawing.Point(172, 126) - Me.ucrInputCropLengths.Name = "ucrInputCropLengths" - Me.ucrInputCropLengths.Size = New System.Drawing.Size(137, 21) - Me.ucrInputCropLengths.TabIndex = 38 - ' - 'ucrInputWaterAmounts - ' - Me.ucrInputWaterAmounts.AddQuotesIfUnrecognised = True - Me.ucrInputWaterAmounts.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrInputWaterAmounts.GetSetSelectedIndex = -1 - Me.ucrInputWaterAmounts.IsReadOnly = False - Me.ucrInputWaterAmounts.Location = New System.Drawing.Point(172, 89) - Me.ucrInputWaterAmounts.Name = "ucrInputWaterAmounts" - Me.ucrInputWaterAmounts.Size = New System.Drawing.Size(137, 21) - Me.ucrInputWaterAmounts.TabIndex = 38 - ' - 'ucrInputPlantingDates + 'ucrPnlStartCheck ' - Me.ucrInputPlantingDates.AddQuotesIfUnrecognised = True - Me.ucrInputPlantingDates.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrInputPlantingDates.GetSetSelectedIndex = -1 - Me.ucrInputPlantingDates.IsReadOnly = False - Me.ucrInputPlantingDates.Location = New System.Drawing.Point(172, 51) - Me.ucrInputPlantingDates.Name = "ucrInputPlantingDates" - Me.ucrInputPlantingDates.Size = New System.Drawing.Size(137, 21) - Me.ucrInputPlantingDates.TabIndex = 38 + Me.ucrPnlStartCheck.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlStartCheck.Location = New System.Drawing.Point(75, 14) + Me.ucrPnlStartCheck.Margin = New System.Windows.Forms.Padding(6) + Me.ucrPnlStartCheck.Name = "ucrPnlStartCheck" + Me.ucrPnlStartCheck.Size = New System.Drawing.Size(201, 37) + Me.ucrPnlStartCheck.TabIndex = 46 ' 'ucrChkDataProp ' Me.ucrChkDataProp.AutoSize = True Me.ucrChkDataProp.Checked = False Me.ucrChkDataProp.Location = New System.Drawing.Point(10, 358) + Me.ucrChkDataProp.Margin = New System.Windows.Forms.Padding(6) Me.ucrChkDataProp.Name = "ucrChkDataProp" Me.ucrChkDataProp.Size = New System.Drawing.Size(172, 23) Me.ucrChkDataProp.TabIndex = 37 @@ -277,6 +325,7 @@ Partial Class dlgPICSACrops Me.ucrChkPrintDataProp.AutoSize = True Me.ucrChkPrintDataProp.Checked = False Me.ucrChkPrintDataProp.Location = New System.Drawing.Point(188, 358) + Me.ucrChkPrintDataProp.Margin = New System.Windows.Forms.Padding(6) Me.ucrChkPrintDataProp.Name = "ucrChkPrintDataProp" Me.ucrChkPrintDataProp.Size = New System.Drawing.Size(255, 23) Me.ucrChkPrintDataProp.TabIndex = 36 @@ -350,10 +399,20 @@ Partial Class dlgPICSACrops Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrBase.Location = New System.Drawing.Point(10, 392) + Me.ucrBase.Margin = New System.Windows.Forms.Padding(4) Me.ucrBase.Name = "ucrBase" - Me.ucrBase.Size = New System.Drawing.Size(405, 52) + Me.ucrBase.Size = New System.Drawing.Size(408, 52) Me.ucrBase.TabIndex = 0 ' + 'lblStarts + ' + Me.lblStarts.AutoSize = True + Me.lblStarts.Location = New System.Drawing.Point(6, 27) + Me.lblStarts.Name = "lblStarts" + Me.lblStarts.Size = New System.Drawing.Size(70, 13) + Me.lblStarts.TabIndex = 56 + Me.lblStarts.Text = "Include Start:" + ' 'dlgPICSACrops ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) @@ -407,13 +466,17 @@ Partial Class dlgPICSACrops Friend WithEvents cmdOptions As Button Friend WithEvents ucrChkPrintDataProp As ucrCheck Friend WithEvents ucrChkDataProp As ucrCheck - Friend WithEvents ucrInputPlantingDates As ucrInputComboBox - Friend WithEvents ucrInputWaterAmounts As ucrInputComboBox - Friend WithEvents ucrInputCropLengths As ucrInputComboBox Friend WithEvents grpSeasonReceivers As GroupBox Friend WithEvents grpCropDefinitions As GroupBox - Friend WithEvents ucrChkRequirePlantingDays As ucrCheck Friend WithEvents lblCropLengthDays As Label Friend WithEvents lblWaterAmounts As Label Friend WithEvents lblPlantingDays As Label + Friend WithEvents rdoNo As RadioButton + Friend WithEvents rdoBoth As RadioButton + Friend WithEvents rdoYes As RadioButton + Friend WithEvents ucrPnlStartCheck As UcrPanel + Friend WithEvents ucrInputWaterAmounts As ucrInputComboBox + Friend WithEvents ucrInputPlantingDates As ucrInputComboBox + Friend WithEvents ucrInputCropLengths As ucrInputComboBox + Friend WithEvents lblStarts As Label End Class diff --git a/instat/dlgPICSACrops.vb b/instat/dlgPICSACrops.vb index b0c55f14f33..a340b3716cc 100644 --- a/instat/dlgPICSACrops.vb +++ b/instat/dlgPICSACrops.vb @@ -18,6 +18,8 @@ Imports instat.Translations Public Class dlgPICSACrops Private clsCropsFunction As New RFunction + Private clsDummyFunction As New RFunction + Private clsSequenceFunction, clsSequencewaterFunction, clsSequencePlantingFunction As New RFunction Public bFirstLoad As Boolean = True Private bReset As Boolean = True Private strCurrDataName As String = "" @@ -38,7 +40,6 @@ Public Class dlgPICSACrops Private Sub InitialiseDialog() ucrBase.iHelpTopicID = 480 - ' Sub dialog not yet created. cmdOptions.Visible = False @@ -87,28 +88,30 @@ Public Class dlgPICSACrops ucrReceiverEnd.SetDataType("numeric") ucrReceiverEnd.bAttachedToPrimaryDataFrame = False - 'Planting date - ucrChkRequirePlantingDays.SetText("Require start day before planting day") - ucrChkRequirePlantingDays.SetParameter(New RParameter("start_check", 10), bNewChangeParameterValue:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") - ucrChkRequirePlantingDays.SetRDefault("TRUE") + ucrPnlStartCheck.AddRadioButton(rdoYes) + ucrPnlStartCheck.AddRadioButton(rdoNo) + ucrPnlStartCheck.AddRadioButton(rdoBoth) + ucrPnlStartCheck.AddParameterValuesCondition(rdoYes, "check", "yes") + ucrPnlStartCheck.AddParameterValuesCondition(rdoNo, "check", "no") + ucrPnlStartCheck.AddParameterValuesCondition(rdoBoth, "check", "both") ucrInputPlantingDates.SetParameter(New RParameter("plant_days", 5)) ucrInputPlantingDates.SetValidationTypeAsNumericList() - ucrInputPlantingDates.SetItems({"120", "80, 90, 100, 110, 120", "92, 122, 153"}) + ucrInputPlantingDates.SetItems({"160", "80, 90, 100, 110, 120", "92, 122, 153", "124, 184, 10", "92, 152, 15"}) ucrInputPlantingDates.AddQuotesIfUnrecognised = False ucrInputPlantingDates.bAllowNonConditionValues = True 'Planting Length ucrInputCropLengths.SetParameter(New RParameter("plant_lengths", 6)) ucrInputCropLengths.SetValidationTypeAsNumericList() - ucrInputCropLengths.SetItems({"120", "100, 110, 120, 130, 140", "80, 90, 100, 110", "120, 150, 180"}) + ucrInputCropLengths.SetItems({"120", "100, 110, 120, 130, 140", "80, 90, 100, 110", "120, 150, 180", "60, 120, 10"}) ucrInputCropLengths.AddQuotesIfUnrecognised = False ucrInputCropLengths.bAllowNonConditionValues = True 'Water amount ucrInputWaterAmounts.SetParameter(New RParameter("rain_totals", 7)) ucrInputWaterAmounts.SetValidationTypeAsNumericList() - ucrInputWaterAmounts.SetItems({"600", "300, 400, 500, 600, 700", "300, 500, 700"}) + ucrInputWaterAmounts.SetItems({"600", "300, 400, 500, 600, 700", "300, 500, 700", "200, 600, 50", "500, 700, 25"}) ucrInputWaterAmounts.AddQuotesIfUnrecognised = False ucrInputWaterAmounts.bAllowNonConditionValues = True @@ -180,19 +183,27 @@ Public Class dlgPICSACrops Private Sub SetDefaults() clsCropsFunction = New RFunction - + clsDummyFunction = New RFunction + clsSequenceFunction = New RFunction + clsSequencePlantingFunction = New RFunction + clsSequencewaterFunction = New RFunction 'Currently this must come before reset to ensure autofilling is done correctly 'Once autofilling is being triggered correctly this can go after Reset. ucrSelectorForCrops.Reset() ucrReceiverRainfall.SetMeAsReceiver() + clsDummyFunction.AddParameter("check", "both", iPosition:=0) + 'Crops Function clsCropsFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$crops_definitions") + + clsSequenceFunction.SetRCommand("seq") + clsSequencePlantingFunction.SetRCommand("seq") + clsSequencewaterFunction.SetRCommand("seq") + ' Temp disabled until list working correctly - 'clsCropsFunction.AddParameter("plant_days", "120") - 'clsCropsFunction.AddParameter("plant_lengths", "120") - 'clsCropsFunction.AddParameter("rain_totals", "600") - ucrInputPlantingDates.SetName("120") + + ucrInputPlantingDates.SetName("160") ucrInputCropLengths.SetName("120") ucrInputWaterAmounts.SetName("600") clsCropsFunction.AddParameter("definition_props", "TRUE", iPosition:=11) @@ -200,6 +211,7 @@ Public Class dlgPICSACrops ucrBase.clsRsyntax.SetBaseRFunction(clsCropsFunction) ucrBase.clsRsyntax.iCallType = 2 TestOkEnabled() + AddingStartCheckParm() End Sub Public Sub SetRCodeForControls(bReset As Boolean) @@ -219,13 +231,12 @@ Public Class dlgPICSACrops ucrReceiverEnd.SetRCode(clsCropsFunction, bReset) ' Disabled as list validation not working correctly with reading/writing controls - 'ucrInputPlantingDates.SetRCode(clsCropsFunction, bReset) - 'ucrInputPlantingLengths.SetRCode(clsCropsFunction, bReset) - 'ucrInputWaterAmounts.SetRCode(clsCropsFunction, bReset) - - ucrChkRequirePlantingDays.SetRCode(clsCropsFunction, bReset) ucrChkDataProp.SetRCode(clsCropsFunction, bReset) ucrChkPrintDataProp.SetRCode(clsCropsFunction, bReset) + If bReset Then + ucrPnlStartCheck.SetRCode(clsDummyFunction, bReset) + End If + AddingStartCheckParm() End Sub Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset @@ -242,14 +253,11 @@ Public Class dlgPICSACrops End If End Sub - Private Sub ucrReceiverYear_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverYear.ControlContentsChanged, ucrReceiverRainfall.ControlContentsChanged, ucrReceiverStart.ControlContentsChanged, ucrReceiverEnd.ControlContentsChanged, ucrReceiverDay.ControlContentsChanged, ucrInputPlantingDates.ControlContentsChanged, ucrInputCropLengths.ControlContentsChanged, ucrInputWaterAmounts.ControlContentsChanged + Private Sub ucrReceiverYear_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverYear.ControlContentsChanged, ucrReceiverRainfall.ControlContentsChanged, ucrReceiverStart.ControlContentsChanged, ucrReceiverEnd.ControlContentsChanged, ucrReceiverDay.ControlContentsChanged, + ucrInputCropLengths.ControlContentsChanged, ucrInputPlantingDates.ControlContentsChanged, ucrInputWaterAmounts.ControlContentsChanged TestOkEnabled() End Sub - Private Sub ucrInputPlantingDates_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputPlantingDates.ControlValueChanged - PlantingDaysParam() - End Sub - Private Sub ucrSelectorForCrops_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectorForCrops.ControlValueChanged If ucrSelectorForCrops.CurrentReceiver Is Nothing OrElse ucrSelectorForCrops.CurrentReceiver.bAttachedToPrimaryDataFrame Then clsCropsFunction.AddParameter("data_name", Chr(34) & ucrSelectorForCrops.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) @@ -259,26 +267,108 @@ Public Class dlgPICSACrops End Sub Private Sub PlantingDaysParam() + Dim strPlantingDates As String = ucrInputPlantingDates.GetText + If ucrInputPlantingDates.IsEmpty Then + clsSequencePlantingFunction.RemoveParameterByName("plant") clsCropsFunction.RemoveParameterByName("plant_days") Else - clsCropsFunction.AddParameter("plant_days", "c(" & ucrInputPlantingDates.GetText() & ")", iPosition:=5) + Dim plantingDates As String() = ucrInputPlantingDates.GetText().Split(","c) + + If plantingDates.Length = 3 Then + Dim first As Integer = Integer.Parse(plantingDates(0).Trim()) + Dim second As Integer = Integer.Parse(plantingDates(1).Trim()) + Dim third As Integer = Integer.Parse(plantingDates(2).Trim()) + + If third < second Then + ' Assume a sequence and run the sequence function + clsSequencePlantingFunction.AddParameter("plant", strPlantingDates, iPosition:=5, bIncludeArgumentName:=False) + clsCropsFunction.AddParameter("plant_days", clsRFunctionParameter:=clsSequencePlantingFunction) + Else + ' List the values as provided + clsCropsFunction.AddParameter("plant_days", "c(" & strPlantingDates & ")", iPosition:=5) + End If + Else + ' List the values as provided + clsCropsFunction.AddParameter("plant_days", "c(" & strPlantingDates & ")", iPosition:=5) + End If + End If + End Sub + + Private Sub ucrPnlStartCheck_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlStartCheck.ControlValueChanged + AddingStartCheckParm() + End Sub + + Private Sub AddingStartCheckParm() + If rdoYes.Checked Then + clsCropsFunction.AddParameter("start_check", Chr(34) & "yes" & Chr(34), iPosition:=10) + ElseIf rdoNo.Checked Then + clsCropsFunction.AddParameter("start_check", Chr(34) & "no" & Chr(34), iPosition:=10) + Else + clsCropsFunction.AddParameter("start_check", Chr(34) & "both" & Chr(34), iPosition:=10) End If End Sub Private Sub ucrInputCropLengths_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputCropLengths.ControlValueChanged + Dim strCropLengths As String = ucrInputCropLengths.GetText + If ucrInputCropLengths.IsEmpty Then + clsSequenceFunction.RemoveParameterByName("plant") clsCropsFunction.RemoveParameterByName("plant_lengths") Else - clsCropsFunction.AddParameter("plant_lengths", "c(" & ucrInputCropLengths.GetText() & ")", iPosition:=6) + Dim plantingDates As String() = ucrInputCropLengths.GetText().Split(","c) + + If plantingDates.Length = 3 Then + Dim first As Integer = Integer.Parse(plantingDates(0).Trim()) + Dim second As Integer = Integer.Parse(plantingDates(1).Trim()) + Dim third As Integer = Integer.Parse(plantingDates(2).Trim()) + + If third < second Then + ' Assume a sequence and run the sequence function + clsSequenceFunction.AddParameter("plant", strCropLengths, iPosition:=5, bIncludeArgumentName:=False) + clsCropsFunction.AddParameter("plant_lengths", clsRFunctionParameter:=clsSequenceFunction) + Else + ' List the values as provided + clsCropsFunction.AddParameter("plant_lengths", "c(" & strCropLengths & ")", iPosition:=6) + End If + Else + ' List the values as provided + clsCropsFunction.AddParameter("plant_lengths", "c(" & strCropLengths & ")", iPosition:=6) + End If End If End Sub + Private Sub ucrInputPlantingDates_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputPlantingDates.ControlValueChanged + PlantingDaysParam() + End Sub + Private Sub ucrInputWaterAmounts_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputWaterAmounts.ControlValueChanged + Dim strWaterAmounts As String = ucrInputWaterAmounts.GetText + If ucrInputWaterAmounts.IsEmpty Then clsCropsFunction.RemoveParameterByName("rain_totals") + clsSequencewaterFunction.RemoveParameterByName("totals") Else - clsCropsFunction.AddParameter("rain_totals", "c(" & ucrInputWaterAmounts.GetText() & ")", iPosition:=7) + Dim plantingDates As String() = ucrInputWaterAmounts.GetText().Split(","c) + + If plantingDates.Length = 3 Then + Dim first As Integer = Integer.Parse(plantingDates(0).Trim()) + Dim second As Integer = Integer.Parse(plantingDates(1).Trim()) + Dim third As Integer = Integer.Parse(plantingDates(2).Trim()) + + If third < second Then + ' Assume a sequence and run the sequence function + clsSequencewaterFunction.AddParameter("totals", strWaterAmounts, iPosition:=5, bIncludeArgumentName:=False) + clsCropsFunction.AddParameter("rain_totals", clsRFunctionParameter:=clsSequencewaterFunction) + Else + ' List the values as provided + clsCropsFunction.AddParameter("rain_totals", "c(" & strWaterAmounts & ")", iPosition:=7) + End If + Else + ' List the values as provided + clsCropsFunction.AddParameter("rain_totals", "c(" & strWaterAmounts & ")", iPosition:=7) + End If End If End Sub + End Class \ No newline at end of file diff --git a/instat/dlgRPackages.Designer.vb b/instat/dlgRPackages.Designer.vb index c8fd71c7a55..ac7d9b97aa1 100644 --- a/instat/dlgRPackages.Designer.vb +++ b/instat/dlgRPackages.Designer.vb @@ -1,9 +1,9 @@ - _ + Partial Class dlgInstallRPackage Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. - _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then @@ -20,22 +20,29 @@ Partial Class dlgInstallRPackage 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. - _ + Private Sub InitializeComponent() Me.cmdCheck = New System.Windows.Forms.Button() Me.lblRPackage = New System.Windows.Forms.Label() - Me.ucrInputMessage = New instat.ucrInputTextBox() + Me.rdoCRAN = New System.Windows.Forms.RadioButton() + Me.rdoRPackage = New System.Windows.Forms.RadioButton() + Me.lblRepository = New System.Windows.Forms.Label() Me.ucrBase = New instat.ucrButtons() Me.ucrInputTextBoxRPackage = New instat.ucrInputTextBox() + Me.ucrPnlRPackages = New instat.UcrPanel() + Me.ucrInputMessage = New instat.ucrInputTextBox() + Me.ucrInputRepositoryName = New instat.ucrInputTextBox() + Me.ucrInputPackage = New instat.ucrInputComboBox() Me.SuspendLayout() ' 'cmdCheck ' Me.cmdCheck.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdCheck.Location = New System.Drawing.Point(14, 81) + Me.cmdCheck.Location = New System.Drawing.Point(18, 150) + Me.cmdCheck.Margin = New System.Windows.Forms.Padding(4) Me.cmdCheck.Name = "cmdCheck" - Me.cmdCheck.Size = New System.Drawing.Size(75, 22) - Me.cmdCheck.TabIndex = 16 + Me.cmdCheck.Size = New System.Drawing.Size(112, 33) + Me.cmdCheck.TabIndex = 7 Me.cmdCheck.Text = "Check" Me.cmdCheck.UseVisualStyleBackColor = True ' @@ -43,31 +50,73 @@ Partial Class dlgInstallRPackage ' Me.lblRPackage.AutoSize = True Me.lblRPackage.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblRPackage.Location = New System.Drawing.Point(11, 33) + Me.lblRPackage.Location = New System.Drawing.Point(17, 68) + Me.lblRPackage.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblRPackage.Name = "lblRPackage" - Me.lblRPackage.Size = New System.Drawing.Size(64, 13) - Me.lblRPackage.TabIndex = 1 + Me.lblRPackage.Size = New System.Drawing.Size(91, 20) + Me.lblRPackage.TabIndex = 3 Me.lblRPackage.Text = "R Package:" ' - 'ucrInputMessage + 'rdoCRAN ' - Me.ucrInputMessage.AddQuotesIfUnrecognised = True - Me.ucrInputMessage.AutoSize = True - Me.ucrInputMessage.IsMultiline = False - Me.ucrInputMessage.IsReadOnly = True - Me.ucrInputMessage.Location = New System.Drawing.Point(95, 81) - Me.ucrInputMessage.Name = "ucrInputMessage" - Me.ucrInputMessage.Size = New System.Drawing.Size(337, 22) - Me.ucrInputMessage.TabIndex = 17 + Me.rdoCRAN.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoCRAN.BackColor = System.Drawing.SystemColors.Control + Me.rdoCRAN.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoCRAN.FlatAppearance.BorderSize = 2 + Me.rdoCRAN.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoCRAN.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoCRAN.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoCRAN.Location = New System.Drawing.Point(206, 9) + Me.rdoCRAN.Margin = New System.Windows.Forms.Padding(4) + Me.rdoCRAN.Name = "rdoCRAN" + Me.rdoCRAN.Size = New System.Drawing.Size(136, 42) + Me.rdoCRAN.TabIndex = 1 + Me.rdoCRAN.TabStop = True + Me.rdoCRAN.Tag = "Frequency" + Me.rdoCRAN.Text = "CRAN" + Me.rdoCRAN.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoCRAN.UseVisualStyleBackColor = False + ' + 'rdoRPackage + ' + Me.rdoRPackage.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoRPackage.BackColor = System.Drawing.SystemColors.Control + Me.rdoRPackage.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoRPackage.FlatAppearance.BorderSize = 2 + Me.rdoRPackage.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoRPackage.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoRPackage.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoRPackage.Location = New System.Drawing.Point(338, 9) + Me.rdoRPackage.Margin = New System.Windows.Forms.Padding(4) + Me.rdoRPackage.Name = "rdoRPackage" + Me.rdoRPackage.Size = New System.Drawing.Size(136, 42) + Me.rdoRPackage.TabIndex = 2 + Me.rdoRPackage.TabStop = True + Me.rdoRPackage.Tag = "Frequency" + Me.rdoRPackage.Text = "R Package " + Me.rdoRPackage.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoRPackage.UseVisualStyleBackColor = False + ' + 'lblRepository + ' + Me.lblRepository.AutoSize = True + Me.lblRepository.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblRepository.Location = New System.Drawing.Point(15, 108) + Me.lblRepository.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblRepository.Name = "lblRepository" + Me.lblRepository.Size = New System.Drawing.Size(135, 20) + Me.lblRepository.TabIndex = 5 + Me.lblRepository.Text = "Repository Name:" ' 'ucrBase ' Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(24, 130) + Me.ucrBase.Location = New System.Drawing.Point(15, 199) + Me.ucrBase.Margin = New System.Windows.Forms.Padding(6) Me.ucrBase.Name = "ucrBase" - Me.ucrBase.Size = New System.Drawing.Size(408, 52) - Me.ucrBase.TabIndex = 15 + Me.ucrBase.Size = New System.Drawing.Size(611, 77) + Me.ucrBase.TabIndex = 9 ' 'ucrInputTextBoxRPackage ' @@ -75,23 +124,76 @@ Partial Class dlgInstallRPackage Me.ucrInputTextBoxRPackage.AutoSize = True Me.ucrInputTextBoxRPackage.IsMultiline = False Me.ucrInputTextBoxRPackage.IsReadOnly = False - Me.ucrInputTextBoxRPackage.Location = New System.Drawing.Point(75, 31) + Me.ucrInputTextBoxRPackage.Location = New System.Drawing.Point(151, 66) + Me.ucrInputTextBoxRPackage.Margin = New System.Windows.Forms.Padding(14) Me.ucrInputTextBoxRPackage.Name = "ucrInputTextBoxRPackage" - Me.ucrInputTextBoxRPackage.Size = New System.Drawing.Size(197, 22) - Me.ucrInputTextBoxRPackage.TabIndex = 0 + Me.ucrInputTextBoxRPackage.Size = New System.Drawing.Size(296, 33) + Me.ucrInputTextBoxRPackage.TabIndex = 4 + ' + 'ucrPnlRPackages + ' + Me.ucrPnlRPackages.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlRPackages.Location = New System.Drawing.Point(174, 8) + Me.ucrPnlRPackages.Margin = New System.Windows.Forms.Padding(9) + Me.ucrPnlRPackages.Name = "ucrPnlRPackages" + Me.ucrPnlRPackages.Size = New System.Drawing.Size(339, 51) + Me.ucrPnlRPackages.TabIndex = 0 + ' + 'ucrInputMessage + ' + Me.ucrInputMessage.AddQuotesIfUnrecognised = True + Me.ucrInputMessage.AutoSize = True + Me.ucrInputMessage.IsMultiline = False + Me.ucrInputMessage.IsReadOnly = True + Me.ucrInputMessage.Location = New System.Drawing.Point(151, 150) + Me.ucrInputMessage.Margin = New System.Windows.Forms.Padding(14) + Me.ucrInputMessage.Name = "ucrInputMessage" + Me.ucrInputMessage.Size = New System.Drawing.Size(475, 33) + Me.ucrInputMessage.TabIndex = 8 + ' + 'ucrInputRepositoryName + ' + Me.ucrInputRepositoryName.AddQuotesIfUnrecognised = True + Me.ucrInputRepositoryName.AutoSize = True + Me.ucrInputRepositoryName.IsMultiline = False + Me.ucrInputRepositoryName.IsReadOnly = False + Me.ucrInputRepositoryName.Location = New System.Drawing.Point(151, 105) + Me.ucrInputRepositoryName.Margin = New System.Windows.Forms.Padding(14) + Me.ucrInputRepositoryName.Name = "ucrInputRepositoryName" + Me.ucrInputRepositoryName.Size = New System.Drawing.Size(471, 33) + Me.ucrInputRepositoryName.TabIndex = 6 + ' + 'ucrInputPackage + ' + Me.ucrInputPackage.AddQuotesIfUnrecognised = True + Me.ucrInputPackage.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrInputPackage.GetSetSelectedIndex = -1 + Me.ucrInputPackage.IsReadOnly = False + Me.ucrInputPackage.Location = New System.Drawing.Point(151, 61) + Me.ucrInputPackage.Margin = New System.Windows.Forms.Padding(9, 9, 9, 9) + Me.ucrInputPackage.Name = "ucrInputPackage" + Me.ucrInputPackage.Size = New System.Drawing.Size(323, 32) + Me.ucrInputPackage.TabIndex = 10 ' 'dlgInstallRPackage ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) + Me.AutoScaleDimensions = New System.Drawing.SizeF(144.0!, 144.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True - Me.ClientSize = New System.Drawing.Size(448, 194) - Me.Controls.Add(Me.ucrInputMessage) - Me.Controls.Add(Me.cmdCheck) + Me.ClientSize = New System.Drawing.Size(645, 291) + Me.Controls.Add(Me.rdoRPackage) + Me.Controls.Add(Me.rdoCRAN) Me.Controls.Add(Me.ucrBase) Me.Controls.Add(Me.lblRPackage) Me.Controls.Add(Me.ucrInputTextBoxRPackage) + Me.Controls.Add(Me.ucrPnlRPackages) + Me.Controls.Add(Me.ucrInputRepositoryName) + Me.Controls.Add(Me.lblRepository) + Me.Controls.Add(Me.cmdCheck) + Me.Controls.Add(Me.ucrInputMessage) + Me.Controls.Add(Me.ucrInputPackage) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.Margin = New System.Windows.Forms.Padding(4) Me.MaximizeBox = False Me.MinimizeBox = False Me.Name = "dlgInstallRPackage" @@ -106,4 +208,10 @@ Partial Class dlgInstallRPackage Friend WithEvents ucrInputMessage As ucrInputTextBox Friend WithEvents cmdCheck As Button Friend WithEvents lblRPackage As Label + Friend WithEvents ucrPnlRPackages As UcrPanel + Friend WithEvents rdoCRAN As RadioButton + Friend WithEvents rdoRPackage As RadioButton + Friend WithEvents lblRepository As Label + Friend WithEvents ucrInputRepositoryName As ucrInputTextBox + Friend WithEvents ucrInputPackage As ucrInputComboBox End Class diff --git a/instat/dlgRPackages.vb b/instat/dlgRPackages.vb index 3ef639aaa9a..488477f7658 100644 --- a/instat/dlgRPackages.vb +++ b/instat/dlgRPackages.vb @@ -1,11 +1,14 @@ -Imports instat +Imports instat.Translations Imports RDotNet Public Class dlgInstallRPackage Private bReset As Boolean = True Private bFirstLoad As Boolean = True + Private bUniqueChecked As Boolean = False Private clsInstallPackage As New RFunction + Private clsRepositoryFunction As New RFunction Private clsBeforeOptionsFunc As New RFunction Private clsAfterOptionsFunc As New RFunction + Private clsDummyFunction As New RFunction Private Sub dlgRPackages_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstLoad Then @@ -17,13 +20,42 @@ Public Class dlgInstallRPackage End If SetRCodeForControls(bReset) bReset = False + bUniqueChecked = False TestOkEnabled() + autoTranslate(Me) End Sub Private Sub InitialiseDialog() + Dim dctPackages As New Dictionary(Of String, String) + ucrBase.iHelpTopicID = 592 ucrBase.clsRsyntax.iCallType = 2 ucrInputTextBoxRPackage.SetParameter(New RParameter("pkgs", 1)) + ucrPnlRPackages.AddRadioButton(rdoCRAN) + ucrPnlRPackages.AddRadioButton(rdoRPackage) + + ucrInputPackage.SetParameter(New RParameter("pkgs", 1)) + dctPackages.Add(" ", Chr(34) & " " & Chr(34)) + dctPackages.Add("rpicsa", Chr(34) & "rpicsa" & Chr(34)) + dctPackages.Add("epicsawrap", Chr(34) & "epicsawrap" & Chr(34)) + dctPackages.Add("cdms.products", Chr(34) & "cdms.products" & Chr(34)) + dctPackages.Add("carbonr", Chr(34) & "carbonr" & Chr(34)) + dctPackages.Add("rapidpror", Chr(34) & "rapidpror" & Chr(34)) + dctPackages.Add("openappr", Chr(34) & "openappr" & Chr(34)) + dctPackages.Add("networkGraphsR", Chr(34) & "networkGraphsR" & Chr(34)) + ucrInputPackage.SetItems(dctPackages) + + ucrPnlRPackages.AddParameterValuesCondition(rdoCRAN, "checked", "cran") + ucrPnlRPackages.AddParameterValuesCondition(rdoRPackage, "checked", "rpackage") + + ucrInputMessage.SetLinkedDisplayControl(cmdCheck) + + ucrInputRepositoryName.SetLinkedDisplayControl(lblRepository) + + ucrPnlRPackages.AddToLinkedControls(ucrInputRepositoryName, {rdoRPackage}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="IDEMSInternational") + ucrPnlRPackages.AddToLinkedControls({ucrInputTextBoxRPackage}, {rdoCRAN}, bNewLinkedHideIfParameterMissing:=True) + ucrPnlRPackages.AddToLinkedControls(ucrInputPackage, {rdoRPackage}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=" ") + CheckEnable() End Sub @@ -31,6 +63,11 @@ Public Class dlgInstallRPackage clsInstallPackage = New RFunction clsBeforeOptionsFunc = New RFunction clsAfterOptionsFunc = New RFunction + clsRepositoryFunction = New RFunction + clsDummyFunction = New RFunction + bUniqueChecked = False + + clsDummyFunction.AddParameter("checked", "cran", iPosition:=1) clsInstallPackage.SetRCommand("install.packages") clsInstallPackage.AddParameter("repos", Chr(34) & "https://cran.rstudio.com/" & Chr(34), iPosition:=1) @@ -38,32 +75,40 @@ Public Class dlgInstallRPackage clsBeforeOptionsFunc.SetRCommand("options") clsBeforeOptionsFunc.AddParameter(strParameterName:="warn", strParameterValue:="2") + clsRepositoryFunction.SetRCommand("install_github") + clsRepositoryFunction.SetPackageName("devtools") + clsRepositoryFunction.AddParameter("upgrade", Chr(34) & "never" & Chr(34), iPosition:=1) clsAfterOptionsFunc.SetRCommand("options") clsAfterOptionsFunc.AddParameter(strParameterName:="warn", strParameterValue:="0") - ucrBase.clsRsyntax.AddToBeforeCodes(clsBeforeOptionsFunc) - ucrBase.clsRsyntax.AddToAfterCodes(clsAfterOptionsFunc) ucrBase.clsRsyntax.SetBaseRFunction(clsInstallPackage) End Sub Private Sub SetRCodeForControls(bReset As Boolean) ucrInputTextBoxRPackage.SetRCode(clsInstallPackage, bReset) + ucrInputPackage.SetRCode(clsInstallPackage, bReset) + If bReset Then + ucrPnlRPackages.SetRCode(clsDummyFunction, bReset) + ucrInputRepositoryName.SetRCode(clsRepositoryFunction, bReset) + End If End Sub Private Sub TestOkEnabled() - If ucrInputTextBoxRPackage.IsEmpty Then - ucrBase.OKEnabled(False) - Else - ucrBase.OKEnabled(True) + If rdoCRAN.Checked Then + ucrBase.OKEnabled(Not ucrInputTextBoxRPackage.IsEmpty) + ElseIf rdoRPackage.Checked Then + ucrBase.OKEnabled(Not ucrInputRepositoryName.IsEmpty AndAlso Not ucrInputPackage.IsEmpty AndAlso bUniqueChecked) End If End Sub - Private Sub ucrInputTextBoxRPackage_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrInputTextBoxRPackage.ControlContentsChanged + Private Sub ucrInputTextBoxRPackage_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrInputTextBoxRPackage.ControlContentsChanged, ucrInputPackage.ControlContentsChanged + bUniqueChecked = False ucrInputMessage.SetText("") ucrInputMessage.txtInput.BackColor = Color.White CheckEnable() TestOkEnabled() + GithubOption() End Sub Private Sub Check() @@ -71,11 +116,15 @@ Public Class dlgInstallRPackage Dim expOutput As SymbolicExpression Dim chrOutput As CharacterVector - clsPackageCheck.SetRCommand("package_check") - clsPackageCheck.AddParameter("package", Chr(34) & ucrInputTextBoxRPackage.GetText() & Chr(34)) - + If rdoCRAN.Checked Then + clsPackageCheck.SetRCommand("package_check") + clsPackageCheck.AddParameter("package", Chr(34) & ucrInputTextBoxRPackage.GetText() & Chr(34)) + ElseIf rdoRPackage.Checked Then + clsPackageCheck.SetRCommand("check_github_repo") + clsPackageCheck.AddParameter("repo", Chr(34) & ucrInputPackage.GetText() & Chr(34)) + clsPackageCheck.AddParameter("owner", Chr(34) & ucrInputRepositoryName.GetText() & Chr(34)) + End If expOutput = frmMain.clsRLink.RunInternalScriptGetValue(clsPackageCheck.ToScript(), bSilent:=True) - If expOutput Is Nothing OrElse expOutput.Type = Internals.SymbolicExpressionType.Null Then ucrInputMessage.SetText("Cannot get package information.") Exit Sub @@ -86,32 +135,78 @@ Public Class dlgInstallRPackage ucrInputMessage.SetText("Cannot get package information.") Exit Sub End If - Select Case chrOutput(0) + Case "0" + bUniqueChecked = False + If rdoCRAN.Checked Then + ucrInputMessage.SetText("Package is up to date.") + ucrInputMessage.txtInput.BackColor = Color.LightSkyBlue + ElseIf rdoRPackage.Checked Then + ucrInputMessage.SetText("Package is up to date.") + ucrInputMessage.txtInput.BackColor = Color.Orange + End If + Case "1" - If chrOutput.Count = 4 Then - If chrOutput(1) = "0" Then - ucrInputMessage.SetText("Package is installed and up to date.") - ucrInputMessage.txtInput.BackColor = Color.Yellow - ElseIf chrOutput(1) = "-1" Then - ucrInputMessage.SetText("Package is installed. Newer version available: " & chrOutput(3) & " (current: " & chrOutput(2) & ").") + bUniqueChecked = True + If rdoCRAN.Checked Then + If chrOutput.Count = 4 Then + If chrOutput(1) = "0" Then + ucrInputMessage.SetText("Package is installed and up to date.") + ucrInputMessage.txtInput.BackColor = Color.LightBlue + ElseIf chrOutput(1) = "-1" Then + ucrInputMessage.SetText("Package is installed. Newer version available: " & chrOutput(3) & " (current: " & chrOutput(2) & ").") + End If + Else + ucrInputMessage.SetText("Package is installed. No version information available.") End If - Else - ucrInputMessage.SetText("Package is installed. No version information available.") + ElseIf rdoRPackage.Checked Then + ucrInputMessage.SetText("Package exists in the repo and is ready for installation") + ucrInputMessage.txtInput.BackColor = Color.LightGreen End If Case "2" - ucrInputMessage.SetText("Package exists and not currently installed.") - ucrInputMessage.txtInput.BackColor = Color.LightGreen + If rdoCRAN.Checked Then + ucrInputMessage.SetText("Package exists and not currently installed.") + ucrInputMessage.txtInput.BackColor = Color.LightGreen + ElseIf rdoRPackage.Checked Then + ucrInputMessage.SetText("Unable to retrieve from GitHub. Check internet connection?") + ucrInputMessage.txtInput.BackColor = Color.LightCoral + bUniqueChecked = False + End If Case "3" - ucrInputMessage.SetText("Package is installed but not a current CRAN package") - ucrInputMessage.txtInput.BackColor = Color.LightBlue + If rdoCRAN.Checked Then + ucrInputMessage.SetText("Package is installed but not a current CRAN package") + ucrInputMessage.txtInput.BackColor = Color.LightBlue + ElseIf rdoRPackage.Checked Then + ucrInputMessage.SetText("Package is installed but not from GitHub") + ucrInputMessage.txtInput.BackColor = Color.LightGreen + bUniqueChecked = False + End If Case "4" - ucrInputMessage.SetText("Not a current CRAN package. Perhaps spelled wrongly, or archived?") - ucrInputMessage.txtInput.BackColor = Color.LightSkyBlue + If rdoCRAN.Checked Then + ucrInputMessage.SetText("Not a current CRAN package. Perhaps spelled wrongly, or archived?") + ucrInputMessage.txtInput.BackColor = Color.LightSkyBlue + bUniqueChecked = False + ElseIf rdoRPackage.Checked Then + ucrInputMessage.SetText("Package exists in the repo and is ready for installation") + ucrInputMessage.txtInput.BackColor = Color.LightGreen + bUniqueChecked = True + End If Case "5" - ucrInputMessage.SetText("No internet connection.Try reconnecting") + If rdoCRAN.Checked Then + ucrInputMessage.SetText("No internet connection.Try reconnecting") + ucrInputMessage.txtInput.BackColor = Color.LightCoral + bUniqueChecked = False + ElseIf rdoRPackage.Checked Then + ucrInputMessage.SetText("Package exists but is not in the R language") + ucrInputMessage.txtInput.BackColor = Color.LightCoral + bUniqueChecked = False + End If + Case "6" + ucrInputMessage.SetText("Error occurred, repository doesn't exist") ucrInputMessage.txtInput.BackColor = Color.LightCoral + bUniqueChecked = False End Select + TestOkEnabled() End Sub Private Sub CheckEnable() @@ -122,9 +217,49 @@ Public Class dlgInstallRPackage cmdCheck.Enabled = False ucrInputMessage.Enabled = False End If + If Not ucrInputPackage.IsEmpty Then + cmdCheck.Enabled = True + ucrInputMessage.Enabled = True + Else + cmdCheck.Enabled = False + ucrInputMessage.Enabled = False + End If End Sub Private Sub cmdCheck_Click(sender As Object, e As EventArgs) Handles cmdCheck.Click check() End Sub -End Class \ No newline at end of file + + Private Sub ucrPnlRPackages_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlRPackages.ControlValueChanged + If rdoCRAN.Checked Then + ucrBase.clsRsyntax.SetBaseRFunction(clsInstallPackage) + ucrBase.clsRsyntax.AddToBeforeCodes(clsBeforeOptionsFunc) + ucrBase.clsRsyntax.AddToAfterCodes(clsAfterOptionsFunc) + Else + ucrBase.clsRsyntax.SetBaseRFunction(clsRepositoryFunction) + ucrBase.clsRsyntax.RemoveFromBeforeCodes(clsBeforeOptionsFunc) + ucrBase.clsRsyntax.RemoveFromAfterCodes(clsAfterOptionsFunc) + End If + ucrInputTextBoxRPackage.txtInput.Clear() + End Sub + + Private Sub ucrInputRepositoryName_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrInputRepositoryName.ControlValueChanged + TestOkEnabled() + GithubOption() + bUniqueChecked = False + End Sub + + Private Sub GithubOption() + If Not (ucrInputPackage.IsEmpty AndAlso ucrInputRepositoryName.IsEmpty) Then + clsRepositoryFunction.AddParameter("paste", Chr(34) & ucrInputRepositoryName.GetText & "/" & ucrInputPackage.GetText() & Chr(34), bIncludeArgumentName:=False) + Else + clsRepositoryFunction.RemoveParameterByName("paste") + End If + End Sub + + Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset + SetDefaults() + SetRCodeForControls(True) + TestOkEnabled() + End Sub +End Class diff --git a/instat/dlgRestoreBackup.vb b/instat/dlgRestoreBackup.vb index 6737206db9a..02cba02cab6 100644 --- a/instat/dlgRestoreBackup.vb +++ b/instat/dlgRestoreBackup.vb @@ -198,6 +198,14 @@ Public Class dlgRestoreBackup End If End Sub + Public Function GetScript() As String + Return strScript + End Function + + Public Function GetDataFilePath() As String + Return strLoadDateFilePath + End Function + Private Sub ucrInputSavedPathData_Leave(sender As Object, e As EventArgs) Handles ucrInputSavedPathData.Leave If Not String.IsNullOrEmpty(ucrInputSavedPathData.IsEmpty) Then frmMain.clsRecentItems.addToMenu(Replace(ucrInputSavedPathData.FilePath, "\", "/")) diff --git a/instat/dlgStartofRains.Designer.vb b/instat/dlgStartofRains.Designer.vb index e5f35fb174b..ab78e3eb6e2 100644 --- a/instat/dlgStartofRains.Designer.vb +++ b/instat/dlgStartofRains.Designer.vb @@ -38,474 +38,106 @@ Partial Class dlgStartofRains 'Do not modify it using the code editor. Private Sub InitializeComponent() - Me.grpConditionsForSatrtofRains = New System.Windows.Forms.GroupBox() - Me.ucrNudDPOverallInterval = New instat.ucrNud() - Me.ucrNudDSMaximumDays = New instat.ucrNud() - Me.ucrNudDSLengthOfTime = New instat.ucrNud() - Me.lblDPOverallInterval = New System.Windows.Forms.Label() - Me.ucrNudRDMinimumDays = New instat.ucrNud() - Me.ucrNudDPRainPeriod = New instat.ucrNud() - Me.lblDPLength = New System.Windows.Forms.Label() - Me.ucrChkDryPeriod = New instat.ucrCheck() - Me.lblDSLengthofTime = New System.Windows.Forms.Label() - Me.lblDPMaxRain = New System.Windows.Forms.Label() - Me.ucrNudRDOutOfDays = New instat.ucrNud() - Me.ucrNudDPMaxRain = New instat.ucrNud() - Me.ucrChkDrySpell = New instat.ucrCheck() - Me.lblDSMaximumDays = New System.Windows.Forms.Label() - Me.lblRDMinimum = New System.Windows.Forms.Label() - Me.lblTROverDays = New System.Windows.Forms.Label() - Me.lblRDWidth = New System.Windows.Forms.Label() - Me.ucrChkNumberOfRainyDays = New instat.ucrCheck() - Me.ucrNudTROverDays = New instat.ucrNud() - Me.ucrNudTRAmount = New instat.ucrNud() - Me.lblTRVal = New System.Windows.Forms.Label() - Me.ucrChkTotalRainfall = New instat.ucrCheck() - Me.ucrNudTRPercentile = New instat.ucrNud() - Me.rdoTRAmount = New System.Windows.Forms.RadioButton() - Me.rdoTRPercentile = New System.Windows.Forms.RadioButton() - Me.ucrPnlTRCalculateBy = New instat.UcrPanel() - Me.grpRainParameters = New System.Windows.Forms.GroupBox() Me.ucrInputThreshold = New instat.ucrInputComboBox() - Me.ucrInputFilterPreview = New instat.ucrInputTextBox() - Me.cmdDoyRange = New System.Windows.Forms.Button() - Me.lblThreshold = New System.Windows.Forms.Label() - Me.lblDOY = New System.Windows.Forms.Label() - Me.lblDate = New System.Windows.Forms.Label() - Me.lblYear = New System.Windows.Forms.Label() - Me.lblStation = New System.Windows.Forms.Label() Me.lblRainfall = New System.Windows.Forms.Label() + Me.lblStation = New System.Windows.Forms.Label() + Me.lblYear = New System.Windows.Forms.Label() + Me.lblDate = New System.Windows.Forms.Label() + Me.lblDOY = New System.Windows.Forms.Label() Me.grpDisplay = New System.Windows.Forms.GroupBox() Me.ucrInputNewStatusColumnName = New instat.ucrInputTextBox() Me.ucrChkAsDate = New instat.ucrCheck() Me.ucrChkStatus = New instat.ucrCheck() Me.ucrInputNewDateColumnName = New instat.ucrInputTextBox() - Me.ucrChkAsDoy = New instat.ucrCheck() + Me.ucrSelectorForStartofRains = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrInputNewDoyColumnName = New instat.ucrInputTextBox() + Me.ucrChkAsDoy = New instat.ucrCheck() Me.ucrReceiverStation = New instat.ucrReceiverSingle() Me.ucrReceiverDate = New instat.ucrReceiverSingle() Me.ucrReceiverYear = New instat.ucrReceiverSingle() - Me.ucrReceiverDOY = New instat.ucrReceiverSingle() Me.ucrReceiverRainfall = New instat.ucrReceiverSingle() - Me.ucrSelectorForStartofRains = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrBase = New instat.ucrButtons() + Me.ucrInputFilterPreview = New instat.ucrInputTextBox() + Me.ucrReceiverDOY = New instat.ucrReceiverSingle() + Me.grpConditionsForSatrtofRains = New System.Windows.Forms.GroupBox() + Me.cmdAdditionnal = New System.Windows.Forms.Button() + Me.ucrChkAdditional = New instat.ucrCheck() + Me.ucrReceiverEvap = New instat.ucrReceiverSingle() + Me.lblFraction = New System.Windows.Forms.Label() + Me.ucrNudEvapo = New instat.ucrNud() + Me.rdoEvapo = New System.Windows.Forms.RadioButton() + Me.lblTROverDays = New System.Windows.Forms.Label() + Me.ucrNudTROverDays = New instat.ucrNud() + Me.ucrNudTRAmount = New instat.ucrNud() + Me.lblTRVal = New System.Windows.Forms.Label() + Me.ucrChkTotalRainfall = New instat.ucrCheck() + Me.ucrNudTRPercentile = New instat.ucrNud() + Me.rdoTRAmount = New System.Windows.Forms.RadioButton() + Me.rdoTRPercentile = New System.Windows.Forms.RadioButton() + Me.ucrPnlTRCalculateBy = New instat.UcrPanel() + Me.lblThreshold = New System.Windows.Forms.Label() + Me.grpRainParameters = New System.Windows.Forms.GroupBox() + Me.cmdDoyRange = New System.Windows.Forms.Button() + Me.grpDisplay.SuspendLayout() Me.grpConditionsForSatrtofRains.SuspendLayout() Me.grpRainParameters.SuspendLayout() - Me.grpDisplay.SuspendLayout() Me.SuspendLayout() ' - 'grpConditionsForSatrtofRains - ' - Me.grpConditionsForSatrtofRains.Controls.Add(Me.ucrNudDPOverallInterval) - Me.grpConditionsForSatrtofRains.Controls.Add(Me.ucrNudDSMaximumDays) - Me.grpConditionsForSatrtofRains.Controls.Add(Me.ucrNudDSLengthOfTime) - Me.grpConditionsForSatrtofRains.Controls.Add(Me.lblDPOverallInterval) - Me.grpConditionsForSatrtofRains.Controls.Add(Me.ucrNudRDMinimumDays) - Me.grpConditionsForSatrtofRains.Controls.Add(Me.ucrNudDPRainPeriod) - Me.grpConditionsForSatrtofRains.Controls.Add(Me.lblDPLength) - Me.grpConditionsForSatrtofRains.Controls.Add(Me.ucrChkDryPeriod) - Me.grpConditionsForSatrtofRains.Controls.Add(Me.lblDSLengthofTime) - Me.grpConditionsForSatrtofRains.Controls.Add(Me.lblDPMaxRain) - Me.grpConditionsForSatrtofRains.Controls.Add(Me.ucrNudRDOutOfDays) - Me.grpConditionsForSatrtofRains.Controls.Add(Me.ucrNudDPMaxRain) - Me.grpConditionsForSatrtofRains.Controls.Add(Me.ucrChkDrySpell) - Me.grpConditionsForSatrtofRains.Controls.Add(Me.lblDSMaximumDays) - Me.grpConditionsForSatrtofRains.Controls.Add(Me.lblRDMinimum) - Me.grpConditionsForSatrtofRains.Controls.Add(Me.lblTROverDays) - Me.grpConditionsForSatrtofRains.Controls.Add(Me.lblRDWidth) - Me.grpConditionsForSatrtofRains.Controls.Add(Me.ucrChkNumberOfRainyDays) - Me.grpConditionsForSatrtofRains.Controls.Add(Me.ucrNudTROverDays) - Me.grpConditionsForSatrtofRains.Controls.Add(Me.ucrNudTRAmount) - Me.grpConditionsForSatrtofRains.Controls.Add(Me.lblTRVal) - Me.grpConditionsForSatrtofRains.Controls.Add(Me.ucrChkTotalRainfall) - Me.grpConditionsForSatrtofRains.Controls.Add(Me.ucrNudTRPercentile) - Me.grpConditionsForSatrtofRains.Controls.Add(Me.rdoTRAmount) - Me.grpConditionsForSatrtofRains.Controls.Add(Me.rdoTRPercentile) - Me.grpConditionsForSatrtofRains.Controls.Add(Me.ucrPnlTRCalculateBy) - Me.grpConditionsForSatrtofRains.Location = New System.Drawing.Point(4, 284) - Me.grpConditionsForSatrtofRains.Name = "grpConditionsForSatrtofRains" - Me.grpConditionsForSatrtofRains.Size = New System.Drawing.Size(686, 174) - Me.grpConditionsForSatrtofRains.TabIndex = 12 - Me.grpConditionsForSatrtofRains.TabStop = False - Me.grpConditionsForSatrtofRains.Text = "Conditions for Start of Rains" - ' - 'ucrNudDPOverallInterval - ' - Me.ucrNudDPOverallInterval.AutoSize = True - Me.ucrNudDPOverallInterval.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudDPOverallInterval.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudDPOverallInterval.Location = New System.Drawing.Point(641, 145) - Me.ucrNudDPOverallInterval.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudDPOverallInterval.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudDPOverallInterval.Name = "ucrNudDPOverallInterval" - Me.ucrNudDPOverallInterval.Size = New System.Drawing.Size(42, 20) - Me.ucrNudDPOverallInterval.TabIndex = 25 - Me.ucrNudDPOverallInterval.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrNudDSMaximumDays - ' - Me.ucrNudDSMaximumDays.AutoSize = True - Me.ucrNudDSMaximumDays.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudDSMaximumDays.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudDSMaximumDays.Location = New System.Drawing.Point(255, 112) - Me.ucrNudDSMaximumDays.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudDSMaximumDays.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudDSMaximumDays.Name = "ucrNudDSMaximumDays" - Me.ucrNudDSMaximumDays.Size = New System.Drawing.Size(42, 20) - Me.ucrNudDSMaximumDays.TabIndex = 16 - Me.ucrNudDSMaximumDays.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrNudDSLengthOfTime - ' - Me.ucrNudDSLengthOfTime.AutoSize = True - Me.ucrNudDSLengthOfTime.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudDSLengthOfTime.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudDSLengthOfTime.Location = New System.Drawing.Point(459, 112) - Me.ucrNudDSLengthOfTime.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudDSLengthOfTime.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudDSLengthOfTime.Name = "ucrNudDSLengthOfTime" - Me.ucrNudDSLengthOfTime.Size = New System.Drawing.Size(42, 20) - Me.ucrNudDSLengthOfTime.TabIndex = 18 - Me.ucrNudDSLengthOfTime.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'lblDPOverallInterval - ' - Me.lblDPOverallInterval.AutoSize = True - Me.lblDPOverallInterval.Location = New System.Drawing.Point(505, 147) - Me.lblDPOverallInterval.Name = "lblDPOverallInterval" - Me.lblDPOverallInterval.Size = New System.Drawing.Size(117, 13) - Me.lblDPOverallInterval.TabIndex = 24 - Me.lblDPOverallInterval.Text = "Overall Interval Length:" - ' - 'ucrNudRDMinimumDays - ' - Me.ucrNudRDMinimumDays.AutoSize = True - Me.ucrNudRDMinimumDays.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudRDMinimumDays.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudRDMinimumDays.Location = New System.Drawing.Point(255, 79) - Me.ucrNudRDMinimumDays.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudRDMinimumDays.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudRDMinimumDays.Name = "ucrNudRDMinimumDays" - Me.ucrNudRDMinimumDays.Size = New System.Drawing.Size(42, 20) - Me.ucrNudRDMinimumDays.TabIndex = 11 - Me.ucrNudRDMinimumDays.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrNudDPRainPeriod - ' - Me.ucrNudDPRainPeriod.AutoSize = True - Me.ucrNudDPRainPeriod.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudDPRainPeriod.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudDPRainPeriod.Location = New System.Drawing.Point(459, 145) - Me.ucrNudDPRainPeriod.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudDPRainPeriod.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudDPRainPeriod.Name = "ucrNudDPRainPeriod" - Me.ucrNudDPRainPeriod.Size = New System.Drawing.Size(42, 20) - Me.ucrNudDPRainPeriod.TabIndex = 23 - Me.ucrNudDPRainPeriod.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'lblDPLength - ' - Me.lblDPLength.AutoSize = True - Me.lblDPLength.Location = New System.Drawing.Point(301, 147) - Me.lblDPLength.Name = "lblDPLength" - Me.lblDPLength.Size = New System.Drawing.Size(100, 13) - Me.lblDPLength.TabIndex = 22 - Me.lblDPLength.Text = "Maximum Dry Days:" - ' - 'ucrChkDryPeriod - ' - Me.ucrChkDryPeriod.AutoSize = True - Me.ucrChkDryPeriod.Checked = False - Me.ucrChkDryPeriod.Location = New System.Drawing.Point(4, 145) - Me.ucrChkDryPeriod.Name = "ucrChkDryPeriod" - Me.ucrChkDryPeriod.Size = New System.Drawing.Size(94, 23) - Me.ucrChkDryPeriod.TabIndex = 19 - ' - 'lblDSLengthofTime - ' - Me.lblDSLengthofTime.AutoSize = True - Me.lblDSLengthofTime.Location = New System.Drawing.Point(301, 116) - Me.lblDSLengthofTime.Name = "lblDSLengthofTime" - Me.lblDSLengthofTime.Size = New System.Drawing.Size(117, 13) - Me.lblDSLengthofTime.TabIndex = 17 - Me.lblDSLengthofTime.Text = "Overall Interval Length:" - ' - 'lblDPMaxRain - ' - Me.lblDPMaxRain.AutoSize = True - Me.lblDPMaxRain.Location = New System.Drawing.Point(118, 147) - Me.lblDPMaxRain.Name = "lblDPMaxRain" - Me.lblDPMaxRain.Size = New System.Drawing.Size(79, 13) - Me.lblDPMaxRain.TabIndex = 20 - Me.lblDPMaxRain.Text = "Maximum Rain:" - ' - 'ucrNudRDOutOfDays - ' - Me.ucrNudRDOutOfDays.AutoSize = True - Me.ucrNudRDOutOfDays.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudRDOutOfDays.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudRDOutOfDays.Location = New System.Drawing.Point(459, 79) - Me.ucrNudRDOutOfDays.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudRDOutOfDays.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudRDOutOfDays.Name = "ucrNudRDOutOfDays" - Me.ucrNudRDOutOfDays.Size = New System.Drawing.Size(42, 20) - Me.ucrNudRDOutOfDays.TabIndex = 13 - Me.ucrNudRDOutOfDays.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrNudDPMaxRain - ' - Me.ucrNudDPMaxRain.AutoSize = True - Me.ucrNudDPMaxRain.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudDPMaxRain.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudDPMaxRain.Location = New System.Drawing.Point(255, 145) - Me.ucrNudDPMaxRain.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudDPMaxRain.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudDPMaxRain.Name = "ucrNudDPMaxRain" - Me.ucrNudDPMaxRain.Size = New System.Drawing.Size(42, 20) - Me.ucrNudDPMaxRain.TabIndex = 21 - Me.ucrNudDPMaxRain.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrChkDrySpell - ' - Me.ucrChkDrySpell.AutoSize = True - Me.ucrChkDrySpell.Checked = False - Me.ucrChkDrySpell.Location = New System.Drawing.Point(4, 112) - Me.ucrChkDrySpell.Name = "ucrChkDrySpell" - Me.ucrChkDrySpell.Size = New System.Drawing.Size(94, 23) - Me.ucrChkDrySpell.TabIndex = 14 - ' - 'lblDSMaximumDays - ' - Me.lblDSMaximumDays.AutoSize = True - Me.lblDSMaximumDays.Location = New System.Drawing.Point(97, 116) - Me.lblDSMaximumDays.Name = "lblDSMaximumDays" - Me.lblDSMaximumDays.Size = New System.Drawing.Size(100, 13) - Me.lblDSMaximumDays.TabIndex = 15 - Me.lblDSMaximumDays.Text = "Maximum Dry Days:" - ' - 'lblRDMinimum - ' - Me.lblRDMinimum.AutoSize = True - Me.lblRDMinimum.Location = New System.Drawing.Point(146, 82) - Me.lblRDMinimum.Name = "lblRDMinimum" - Me.lblRDMinimum.Size = New System.Drawing.Size(51, 13) - Me.lblRDMinimum.TabIndex = 10 - Me.lblRDMinimum.Text = "Minimum:" - ' - 'lblTROverDays - ' - Me.lblTROverDays.AutoSize = True - Me.lblTROverDays.Location = New System.Drawing.Point(144, 26) - Me.lblTROverDays.Name = "lblTROverDays" - Me.lblTROverDays.Size = New System.Drawing.Size(60, 13) - Me.lblTROverDays.TabIndex = 1 - Me.lblTROverDays.Tag = "" - Me.lblTROverDays.Text = "Over Days:" - ' - 'lblRDWidth - ' - Me.lblRDWidth.AutoSize = True - Me.lblRDWidth.Location = New System.Drawing.Point(353, 82) - Me.lblRDWidth.Name = "lblRDWidth" - Me.lblRDWidth.Size = New System.Drawing.Size(66, 13) - Me.lblRDWidth.TabIndex = 12 - Me.lblRDWidth.Text = "Out of Days:" - ' - 'ucrChkNumberOfRainyDays - ' - Me.ucrChkNumberOfRainyDays.AutoSize = True - Me.ucrChkNumberOfRainyDays.Checked = False - Me.ucrChkNumberOfRainyDays.Location = New System.Drawing.Point(4, 79) - Me.ucrChkNumberOfRainyDays.Name = "ucrChkNumberOfRainyDays" - Me.ucrChkNumberOfRainyDays.Size = New System.Drawing.Size(143, 23) - Me.ucrChkNumberOfRainyDays.TabIndex = 9 - ' - 'ucrNudTROverDays - ' - Me.ucrNudTROverDays.AutoSize = True - Me.ucrNudTROverDays.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudTROverDays.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudTROverDays.Location = New System.Drawing.Point(235, 22) - Me.ucrNudTROverDays.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudTROverDays.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudTROverDays.Name = "ucrNudTROverDays" - Me.ucrNudTROverDays.Size = New System.Drawing.Size(42, 20) - Me.ucrNudTROverDays.TabIndex = 2 - Me.ucrNudTROverDays.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrNudTRAmount - ' - Me.ucrNudTRAmount.AutoSize = True - Me.ucrNudTRAmount.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudTRAmount.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudTRAmount.Location = New System.Drawing.Point(569, 22) - Me.ucrNudTRAmount.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudTRAmount.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudTRAmount.Name = "ucrNudTRAmount" - Me.ucrNudTRAmount.Size = New System.Drawing.Size(42, 20) - Me.ucrNudTRAmount.TabIndex = 6 - Me.ucrNudTRAmount.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'lblTRVal - ' - Me.lblTRVal.AutoSize = True - Me.lblTRVal.Location = New System.Drawing.Point(276, 26) - Me.lblTRVal.Name = "lblTRVal" - Me.lblTRVal.Size = New System.Drawing.Size(136, 13) - Me.lblTRVal.TabIndex = 3 - Me.lblTRVal.Text = "Calculate Rainfall Value by:" - ' - 'ucrChkTotalRainfall - ' - Me.ucrChkTotalRainfall.AutoSize = True - Me.ucrChkTotalRainfall.Checked = False - Me.ucrChkTotalRainfall.Location = New System.Drawing.Point(4, 22) - Me.ucrChkTotalRainfall.Name = "ucrChkTotalRainfall" - Me.ucrChkTotalRainfall.Size = New System.Drawing.Size(131, 23) - Me.ucrChkTotalRainfall.TabIndex = 0 - ' - 'ucrNudTRPercentile - ' - Me.ucrNudTRPercentile.AutoSize = True - Me.ucrNudTRPercentile.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudTRPercentile.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudTRPercentile.Location = New System.Drawing.Point(569, 48) - Me.ucrNudTRPercentile.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudTRPercentile.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudTRPercentile.Name = "ucrNudTRPercentile" - Me.ucrNudTRPercentile.Size = New System.Drawing.Size(42, 20) - Me.ucrNudTRPercentile.TabIndex = 8 - Me.ucrNudTRPercentile.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'rdoTRAmount - ' - Me.rdoTRAmount.AutoSize = True - Me.rdoTRAmount.Location = New System.Drawing.Point(479, 24) - Me.rdoTRAmount.Name = "rdoTRAmount" - Me.rdoTRAmount.Size = New System.Drawing.Size(61, 17) - Me.rdoTRAmount.TabIndex = 5 - Me.rdoTRAmount.TabStop = True - Me.rdoTRAmount.Text = "Amount" - Me.rdoTRAmount.UseVisualStyleBackColor = True - ' - 'rdoTRPercentile - ' - Me.rdoTRPercentile.AutoSize = True - Me.rdoTRPercentile.Location = New System.Drawing.Point(479, 48) - Me.rdoTRPercentile.Name = "rdoTRPercentile" - Me.rdoTRPercentile.Size = New System.Drawing.Size(72, 17) - Me.rdoTRPercentile.TabIndex = 7 - Me.rdoTRPercentile.TabStop = True - Me.rdoTRPercentile.Text = "Percentile" - Me.rdoTRPercentile.UseVisualStyleBackColor = True - ' - 'ucrPnlTRCalculateBy - ' - Me.ucrPnlTRCalculateBy.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlTRCalculateBy.Location = New System.Drawing.Point(476, 17) - Me.ucrPnlTRCalculateBy.Name = "ucrPnlTRCalculateBy" - Me.ucrPnlTRCalculateBy.Size = New System.Drawing.Size(146, 62) - Me.ucrPnlTRCalculateBy.TabIndex = 4 - ' - 'grpRainParameters - ' - Me.grpRainParameters.Controls.Add(Me.ucrInputThreshold) - Me.grpRainParameters.Controls.Add(Me.ucrInputFilterPreview) - Me.grpRainParameters.Controls.Add(Me.cmdDoyRange) - Me.grpRainParameters.Controls.Add(Me.lblThreshold) - Me.grpRainParameters.Location = New System.Drawing.Point(4, 238) - Me.grpRainParameters.Name = "grpRainParameters" - Me.grpRainParameters.Size = New System.Drawing.Size(686, 40) - Me.grpRainParameters.TabIndex = 11 - Me.grpRainParameters.TabStop = False - ' 'ucrInputThreshold ' Me.ucrInputThreshold.AddQuotesIfUnrecognised = True Me.ucrInputThreshold.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrInputThreshold.GetSetSelectedIndex = -1 Me.ucrInputThreshold.IsReadOnly = False - Me.ucrInputThreshold.Location = New System.Drawing.Point(70, 11) + Me.ucrInputThreshold.Location = New System.Drawing.Point(70, 9) Me.ucrInputThreshold.Name = "ucrInputThreshold" Me.ucrInputThreshold.Size = New System.Drawing.Size(62, 21) - Me.ucrInputThreshold.TabIndex = 21 - ' - 'ucrInputFilterPreview - ' - Me.ucrInputFilterPreview.AddQuotesIfUnrecognised = True - Me.ucrInputFilterPreview.AutoSize = True - Me.ucrInputFilterPreview.IsMultiline = False - Me.ucrInputFilterPreview.IsReadOnly = True - Me.ucrInputFilterPreview.Location = New System.Drawing.Point(277, 13) - Me.ucrInputFilterPreview.Name = "ucrInputFilterPreview" - Me.ucrInputFilterPreview.Size = New System.Drawing.Size(242, 22) - Me.ucrInputFilterPreview.TabIndex = 3 - ' - 'cmdDoyRange - ' - Me.cmdDoyRange.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdDoyRange.Location = New System.Drawing.Point(159, 10) - Me.cmdDoyRange.Name = "cmdDoyRange" - Me.cmdDoyRange.Size = New System.Drawing.Size(105, 26) - Me.cmdDoyRange.TabIndex = 2 - Me.cmdDoyRange.Tag = "" - Me.cmdDoyRange.Text = "Day Range" - Me.cmdDoyRange.UseVisualStyleBackColor = True - ' - 'lblThreshold - ' - Me.lblThreshold.AutoSize = True - Me.lblThreshold.Location = New System.Drawing.Point(10, 14) - Me.lblThreshold.Name = "lblThreshold" - Me.lblThreshold.Size = New System.Drawing.Size(57, 13) - Me.lblThreshold.TabIndex = 0 - Me.lblThreshold.Tag = "Threshold" - Me.lblThreshold.Text = "Threshold:" + Me.ucrInputThreshold.TabIndex = 13 ' - 'lblDOY + 'lblRainfall ' - Me.lblDOY.AutoSize = True - Me.lblDOY.Location = New System.Drawing.Point(263, 158) - Me.lblDOY.Name = "lblDOY" - Me.lblDOY.Size = New System.Drawing.Size(66, 13) - Me.lblDOY.TabIndex = 7 - Me.lblDOY.Text = "Day of Year:" + Me.lblRainfall.AutoSize = True + Me.lblRainfall.Location = New System.Drawing.Point(293, 187) + Me.lblRainfall.Name = "lblRainfall" + Me.lblRainfall.Size = New System.Drawing.Size(70, 13) + Me.lblRainfall.TabIndex = 62 + Me.lblRainfall.Text = "Rain Column:" ' - 'lblDate + 'lblStation ' - Me.lblDate.AutoSize = True - Me.lblDate.Location = New System.Drawing.Point(263, 72) - Me.lblDate.Name = "lblDate" - Me.lblDate.Size = New System.Drawing.Size(33, 13) - Me.lblDate.TabIndex = 3 - Me.lblDate.Text = "Date:" + Me.lblStation.AutoSize = True + Me.lblStation.Location = New System.Drawing.Point(293, 15) + Me.lblStation.Name = "lblStation" + Me.lblStation.Size = New System.Drawing.Size(43, 13) + Me.lblStation.TabIndex = 54 + Me.lblStation.Text = "Station:" ' 'lblYear ' Me.lblYear.AutoSize = True - Me.lblYear.Location = New System.Drawing.Point(263, 115) + Me.lblYear.Location = New System.Drawing.Point(293, 101) Me.lblYear.Name = "lblYear" Me.lblYear.Size = New System.Drawing.Size(32, 13) - Me.lblYear.TabIndex = 5 + Me.lblYear.TabIndex = 58 Me.lblYear.Text = "Year:" ' - 'lblStation + 'lblDate ' - Me.lblStation.AutoSize = True - Me.lblStation.Location = New System.Drawing.Point(263, 29) - Me.lblStation.Name = "lblStation" - Me.lblStation.Size = New System.Drawing.Size(43, 13) - Me.lblStation.TabIndex = 1 - Me.lblStation.Text = "Station:" + Me.lblDate.AutoSize = True + Me.lblDate.Location = New System.Drawing.Point(293, 58) + Me.lblDate.Name = "lblDate" + Me.lblDate.Size = New System.Drawing.Size(33, 13) + Me.lblDate.TabIndex = 56 + Me.lblDate.Text = "Date:" ' - 'lblRainfall + 'lblDOY ' - Me.lblRainfall.AutoSize = True - Me.lblRainfall.Location = New System.Drawing.Point(263, 201) - Me.lblRainfall.Name = "lblRainfall" - Me.lblRainfall.Size = New System.Drawing.Size(70, 13) - Me.lblRainfall.TabIndex = 9 - Me.lblRainfall.Text = "Rain Column:" + Me.lblDOY.AutoSize = True + Me.lblDOY.Location = New System.Drawing.Point(293, 144) + Me.lblDOY.Name = "lblDOY" + Me.lblDOY.Size = New System.Drawing.Size(66, 13) + Me.lblDOY.TabIndex = 60 + Me.lblDOY.Text = "Day of Year:" ' 'grpDisplay ' @@ -513,10 +145,10 @@ Partial Class dlgStartofRains Me.grpDisplay.Controls.Add(Me.ucrChkAsDate) Me.grpDisplay.Controls.Add(Me.ucrChkStatus) Me.grpDisplay.Controls.Add(Me.ucrInputNewDateColumnName) - Me.grpDisplay.Location = New System.Drawing.Point(4, 459) + Me.grpDisplay.Location = New System.Drawing.Point(13, 465) Me.grpDisplay.Name = "grpDisplay" - Me.grpDisplay.Size = New System.Drawing.Size(686, 49) - Me.grpDisplay.TabIndex = 13 + Me.grpDisplay.Size = New System.Drawing.Size(584, 49) + Me.grpDisplay.TabIndex = 66 Me.grpDisplay.TabStop = False Me.grpDisplay.Text = "Display" ' @@ -526,28 +158,28 @@ Partial Class dlgStartofRains Me.ucrInputNewStatusColumnName.AutoSize = True Me.ucrInputNewStatusColumnName.IsMultiline = False Me.ucrInputNewStatusColumnName.IsReadOnly = False - Me.ucrInputNewStatusColumnName.Location = New System.Drawing.Point(494, 18) + Me.ucrInputNewStatusColumnName.Location = New System.Drawing.Point(461, 18) Me.ucrInputNewStatusColumnName.Name = "ucrInputNewStatusColumnName" Me.ucrInputNewStatusColumnName.Size = New System.Drawing.Size(117, 21) - Me.ucrInputNewStatusColumnName.TabIndex = 19 + Me.ucrInputNewStatusColumnName.TabIndex = 51 ' 'ucrChkAsDate ' Me.ucrChkAsDate.AutoSize = True Me.ucrChkAsDate.Checked = False - Me.ucrChkAsDate.Location = New System.Drawing.Point(227, 18) + Me.ucrChkAsDate.Location = New System.Drawing.Point(194, 18) Me.ucrChkAsDate.Name = "ucrChkAsDate" Me.ucrChkAsDate.Size = New System.Drawing.Size(51, 23) - Me.ucrChkAsDate.TabIndex = 16 + Me.ucrChkAsDate.TabIndex = 48 ' 'ucrChkStatus ' Me.ucrChkStatus.AutoSize = True Me.ucrChkStatus.Checked = False - Me.ucrChkStatus.Location = New System.Drawing.Point(405, 18) + Me.ucrChkStatus.Location = New System.Drawing.Point(372, 18) Me.ucrChkStatus.Name = "ucrChkStatus" Me.ucrChkStatus.Size = New System.Drawing.Size(84, 23) - Me.ucrChkStatus.TabIndex = 18 + Me.ucrChkStatus.TabIndex = 50 ' 'ucrInputNewDateColumnName ' @@ -555,19 +187,22 @@ Partial Class dlgStartofRains Me.ucrInputNewDateColumnName.AutoSize = True Me.ucrInputNewDateColumnName.IsMultiline = False Me.ucrInputNewDateColumnName.IsReadOnly = False - Me.ucrInputNewDateColumnName.Location = New System.Drawing.Point(281, 18) + Me.ucrInputNewDateColumnName.Location = New System.Drawing.Point(248, 18) Me.ucrInputNewDateColumnName.Name = "ucrInputNewDateColumnName" Me.ucrInputNewDateColumnName.Size = New System.Drawing.Size(115, 21) - Me.ucrInputNewDateColumnName.TabIndex = 17 + Me.ucrInputNewDateColumnName.TabIndex = 49 ' - 'ucrChkAsDoy + 'ucrSelectorForStartofRains ' - Me.ucrChkAsDoy.AutoSize = True - Me.ucrChkAsDoy.Checked = False - Me.ucrChkAsDoy.Location = New System.Drawing.Point(13, 477) - Me.ucrChkAsDoy.Name = "ucrChkAsDoy" - Me.ucrChkAsDoy.Size = New System.Drawing.Size(83, 23) - Me.ucrChkAsDoy.TabIndex = 14 + Me.ucrSelectorForStartofRains.AutoSize = True + Me.ucrSelectorForStartofRains.bDropUnusedFilterLevels = False + Me.ucrSelectorForStartofRains.bShowHiddenColumns = False + Me.ucrSelectorForStartofRains.bUseCurrentFilter = True + Me.ucrSelectorForStartofRains.Location = New System.Drawing.Point(14, 6) + Me.ucrSelectorForStartofRains.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectorForStartofRains.Name = "ucrSelectorForStartofRains" + Me.ucrSelectorForStartofRains.Size = New System.Drawing.Size(213, 183) + Me.ucrSelectorForStartofRains.TabIndex = 53 ' 'ucrInputNewDoyColumnName ' @@ -575,119 +210,347 @@ Partial Class dlgStartofRains Me.ucrInputNewDoyColumnName.AutoSize = True Me.ucrInputNewDoyColumnName.IsMultiline = False Me.ucrInputNewDoyColumnName.IsReadOnly = False - Me.ucrInputNewDoyColumnName.Location = New System.Drawing.Point(99, 477) + Me.ucrInputNewDoyColumnName.Location = New System.Drawing.Point(75, 483) Me.ucrInputNewDoyColumnName.Name = "ucrInputNewDoyColumnName" Me.ucrInputNewDoyColumnName.Size = New System.Drawing.Size(127, 21) - Me.ucrInputNewDoyColumnName.TabIndex = 15 + Me.ucrInputNewDoyColumnName.TabIndex = 68 + ' + 'ucrChkAsDoy + ' + Me.ucrChkAsDoy.AutoSize = True + Me.ucrChkAsDoy.Checked = False + Me.ucrChkAsDoy.Location = New System.Drawing.Point(20, 483) + Me.ucrChkAsDoy.Name = "ucrChkAsDoy" + Me.ucrChkAsDoy.Size = New System.Drawing.Size(69, 23) + Me.ucrChkAsDoy.TabIndex = 67 ' 'ucrReceiverStation ' Me.ucrReceiverStation.AutoSize = True Me.ucrReceiverStation.frmParent = Me - Me.ucrReceiverStation.Location = New System.Drawing.Point(260, 45) + Me.ucrReceiverStation.Location = New System.Drawing.Point(290, 31) Me.ucrReceiverStation.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverStation.Name = "ucrReceiverStation" Me.ucrReceiverStation.Selector = Nothing Me.ucrReceiverStation.Size = New System.Drawing.Size(143, 20) Me.ucrReceiverStation.strNcFilePath = "" - Me.ucrReceiverStation.TabIndex = 2 + Me.ucrReceiverStation.TabIndex = 55 Me.ucrReceiverStation.ucrSelector = Nothing ' 'ucrReceiverDate ' Me.ucrReceiverDate.AutoSize = True Me.ucrReceiverDate.frmParent = Me - Me.ucrReceiverDate.Location = New System.Drawing.Point(260, 88) + Me.ucrReceiverDate.Location = New System.Drawing.Point(290, 74) Me.ucrReceiverDate.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverDate.Name = "ucrReceiverDate" Me.ucrReceiverDate.Selector = Nothing Me.ucrReceiverDate.Size = New System.Drawing.Size(143, 20) Me.ucrReceiverDate.strNcFilePath = "" - Me.ucrReceiverDate.TabIndex = 4 + Me.ucrReceiverDate.TabIndex = 57 Me.ucrReceiverDate.ucrSelector = Nothing ' 'ucrReceiverYear ' Me.ucrReceiverYear.AutoSize = True Me.ucrReceiverYear.frmParent = Me - Me.ucrReceiverYear.Location = New System.Drawing.Point(260, 131) + Me.ucrReceiverYear.Location = New System.Drawing.Point(290, 117) Me.ucrReceiverYear.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverYear.Name = "ucrReceiverYear" Me.ucrReceiverYear.Selector = Nothing Me.ucrReceiverYear.Size = New System.Drawing.Size(143, 20) Me.ucrReceiverYear.strNcFilePath = "" - Me.ucrReceiverYear.TabIndex = 6 + Me.ucrReceiverYear.TabIndex = 59 Me.ucrReceiverYear.ucrSelector = Nothing ' - 'ucrReceiverDOY - ' - Me.ucrReceiverDOY.AutoSize = True - Me.ucrReceiverDOY.frmParent = Me - Me.ucrReceiverDOY.Location = New System.Drawing.Point(260, 174) - Me.ucrReceiverDOY.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverDOY.Name = "ucrReceiverDOY" - Me.ucrReceiverDOY.Selector = Nothing - Me.ucrReceiverDOY.Size = New System.Drawing.Size(143, 20) - Me.ucrReceiverDOY.strNcFilePath = "" - Me.ucrReceiverDOY.TabIndex = 8 - Me.ucrReceiverDOY.ucrSelector = Nothing - ' 'ucrReceiverRainfall ' Me.ucrReceiverRainfall.AutoSize = True Me.ucrReceiverRainfall.frmParent = Me - Me.ucrReceiverRainfall.Location = New System.Drawing.Point(260, 217) + Me.ucrReceiverRainfall.Location = New System.Drawing.Point(290, 203) Me.ucrReceiverRainfall.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverRainfall.Name = "ucrReceiverRainfall" Me.ucrReceiverRainfall.Selector = Nothing Me.ucrReceiverRainfall.Size = New System.Drawing.Size(143, 20) Me.ucrReceiverRainfall.strNcFilePath = "" - Me.ucrReceiverRainfall.TabIndex = 10 + Me.ucrReceiverRainfall.TabIndex = 63 Me.ucrReceiverRainfall.ucrSelector = Nothing ' - 'ucrSelectorForStartofRains - ' - Me.ucrSelectorForStartofRains.AutoSize = True - Me.ucrSelectorForStartofRains.bDropUnusedFilterLevels = False - Me.ucrSelectorForStartofRains.bShowHiddenColumns = False - Me.ucrSelectorForStartofRains.bUseCurrentFilter = True - Me.ucrSelectorForStartofRains.Location = New System.Drawing.Point(5, 9) - Me.ucrSelectorForStartofRains.Margin = New System.Windows.Forms.Padding(0) - Me.ucrSelectorForStartofRains.Name = "ucrSelectorForStartofRains" - Me.ucrSelectorForStartofRains.Size = New System.Drawing.Size(213, 183) - Me.ucrSelectorForStartofRains.TabIndex = 0 - ' 'ucrBase ' Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(5, 514) + Me.ucrBase.Location = New System.Drawing.Point(14, 520) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(408, 52) - Me.ucrBase.TabIndex = 20 + Me.ucrBase.TabIndex = 69 + ' + 'ucrInputFilterPreview + ' + Me.ucrInputFilterPreview.AddQuotesIfUnrecognised = True + Me.ucrInputFilterPreview.AutoSize = True + Me.ucrInputFilterPreview.IsMultiline = False + Me.ucrInputFilterPreview.IsReadOnly = True + Me.ucrInputFilterPreview.Location = New System.Drawing.Point(277, 11) + Me.ucrInputFilterPreview.Name = "ucrInputFilterPreview" + Me.ucrInputFilterPreview.Size = New System.Drawing.Size(242, 22) + Me.ucrInputFilterPreview.TabIndex = 15 + ' + 'ucrReceiverDOY + ' + Me.ucrReceiverDOY.AutoSize = True + Me.ucrReceiverDOY.frmParent = Me + Me.ucrReceiverDOY.Location = New System.Drawing.Point(290, 160) + Me.ucrReceiverDOY.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverDOY.Name = "ucrReceiverDOY" + Me.ucrReceiverDOY.Selector = Nothing + Me.ucrReceiverDOY.Size = New System.Drawing.Size(143, 20) + Me.ucrReceiverDOY.strNcFilePath = "" + Me.ucrReceiverDOY.TabIndex = 61 + Me.ucrReceiverDOY.ucrSelector = Nothing + ' + 'grpConditionsForSatrtofRains + ' + Me.grpConditionsForSatrtofRains.Controls.Add(Me.cmdAdditionnal) + Me.grpConditionsForSatrtofRains.Controls.Add(Me.ucrChkAdditional) + Me.grpConditionsForSatrtofRains.Controls.Add(Me.ucrReceiverEvap) + Me.grpConditionsForSatrtofRains.Controls.Add(Me.lblFraction) + Me.grpConditionsForSatrtofRains.Controls.Add(Me.ucrNudEvapo) + Me.grpConditionsForSatrtofRains.Controls.Add(Me.rdoEvapo) + Me.grpConditionsForSatrtofRains.Controls.Add(Me.lblTROverDays) + Me.grpConditionsForSatrtofRains.Controls.Add(Me.ucrNudTROverDays) + Me.grpConditionsForSatrtofRains.Controls.Add(Me.ucrNudTRAmount) + Me.grpConditionsForSatrtofRains.Controls.Add(Me.lblTRVal) + Me.grpConditionsForSatrtofRains.Controls.Add(Me.ucrChkTotalRainfall) + Me.grpConditionsForSatrtofRains.Controls.Add(Me.ucrNudTRPercentile) + Me.grpConditionsForSatrtofRains.Controls.Add(Me.rdoTRAmount) + Me.grpConditionsForSatrtofRains.Controls.Add(Me.rdoTRPercentile) + Me.grpConditionsForSatrtofRains.Controls.Add(Me.ucrPnlTRCalculateBy) + Me.grpConditionsForSatrtofRains.Location = New System.Drawing.Point(13, 270) + Me.grpConditionsForSatrtofRains.Name = "grpConditionsForSatrtofRains" + Me.grpConditionsForSatrtofRains.Size = New System.Drawing.Size(584, 185) + Me.grpConditionsForSatrtofRains.TabIndex = 65 + Me.grpConditionsForSatrtofRains.TabStop = False + Me.grpConditionsForSatrtofRains.Text = "Conditions for Start of Rains" + ' + 'cmdAdditionnal + ' + Me.cmdAdditionnal.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdAdditionnal.Location = New System.Drawing.Point(159, 147) + Me.cmdAdditionnal.Name = "cmdAdditionnal" + Me.cmdAdditionnal.Size = New System.Drawing.Size(105, 26) + Me.cmdAdditionnal.TabIndex = 16 + Me.cmdAdditionnal.Tag = "" + Me.cmdAdditionnal.Text = "Add" + Me.cmdAdditionnal.UseVisualStyleBackColor = True + ' + 'ucrChkAdditional + ' + Me.ucrChkAdditional.AutoSize = True + Me.ucrChkAdditional.Checked = False + Me.ucrChkAdditional.Location = New System.Drawing.Point(4, 151) + Me.ucrChkAdditional.Name = "ucrChkAdditional" + Me.ucrChkAdditional.Size = New System.Drawing.Size(143, 23) + Me.ucrChkAdditional.TabIndex = 45 + ' + 'ucrReceiverEvap + ' + Me.ucrReceiverEvap.AutoSize = True + Me.ucrReceiverEvap.frmParent = Me + Me.ucrReceiverEvap.Location = New System.Drawing.Point(289, 81) + Me.ucrReceiverEvap.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverEvap.Name = "ucrReceiverEvap" + Me.ucrReceiverEvap.Selector = Nothing + Me.ucrReceiverEvap.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverEvap.strNcFilePath = "" + Me.ucrReceiverEvap.TabIndex = 24 + Me.ucrReceiverEvap.ucrSelector = Nothing + ' + 'lblFraction + ' + Me.lblFraction.AutoSize = True + Me.lblFraction.Location = New System.Drawing.Point(428, 83) + Me.lblFraction.Name = "lblFraction" + Me.lblFraction.Size = New System.Drawing.Size(48, 13) + Me.lblFraction.TabIndex = 25 + Me.lblFraction.Text = "Fraction:" + ' + 'ucrNudEvapo + ' + Me.ucrNudEvapo.AutoSize = True + Me.ucrNudEvapo.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudEvapo.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudEvapo.Location = New System.Drawing.Point(493, 78) + Me.ucrNudEvapo.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudEvapo.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudEvapo.Name = "ucrNudEvapo" + Me.ucrNudEvapo.Size = New System.Drawing.Size(42, 20) + Me.ucrNudEvapo.TabIndex = 26 + Me.ucrNudEvapo.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'rdoEvapo + ' + Me.rdoEvapo.AutoSize = True + Me.rdoEvapo.Location = New System.Drawing.Point(199, 83) + Me.rdoEvapo.Name = "rdoEvapo" + Me.rdoEvapo.Size = New System.Drawing.Size(82, 17) + Me.rdoEvapo.TabIndex = 23 + Me.rdoEvapo.TabStop = True + Me.rdoEvapo.Text = "Evaporation" + Me.rdoEvapo.UseVisualStyleBackColor = True + ' + 'lblTROverDays + ' + Me.lblTROverDays.AutoSize = True + Me.lblTROverDays.Location = New System.Drawing.Point(144, 25) + Me.lblTROverDays.Name = "lblTROverDays" + Me.lblTROverDays.Size = New System.Drawing.Size(60, 13) + Me.lblTROverDays.TabIndex = 18 + Me.lblTROverDays.Tag = "" + Me.lblTROverDays.Text = "Over Days:" + ' + 'ucrNudTROverDays + ' + Me.ucrNudTROverDays.AutoSize = True + Me.ucrNudTROverDays.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudTROverDays.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudTROverDays.Location = New System.Drawing.Point(210, 21) + Me.ucrNudTROverDays.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudTROverDays.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudTROverDays.Name = "ucrNudTROverDays" + Me.ucrNudTROverDays.Size = New System.Drawing.Size(42, 20) + Me.ucrNudTROverDays.TabIndex = 19 + Me.ucrNudTROverDays.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrNudTRAmount + ' + Me.ucrNudTRAmount.AutoSize = True + Me.ucrNudTRAmount.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudTRAmount.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudTRAmount.Location = New System.Drawing.Point(289, 58) + Me.ucrNudTRAmount.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudTRAmount.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudTRAmount.Name = "ucrNudTRAmount" + Me.ucrNudTRAmount.Size = New System.Drawing.Size(42, 20) + Me.ucrNudTRAmount.TabIndex = 22 + Me.ucrNudTRAmount.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'lblTRVal + ' + Me.lblTRVal.AutoSize = True + Me.lblTRVal.Location = New System.Drawing.Point(20, 60) + Me.lblTRVal.Name = "lblTRVal" + Me.lblTRVal.Size = New System.Drawing.Size(37, 13) + Me.lblTRVal.TabIndex = 20 + Me.lblTRVal.Text = "Value:" + ' + 'ucrChkTotalRainfall + ' + Me.ucrChkTotalRainfall.AutoSize = True + Me.ucrChkTotalRainfall.Checked = False + Me.ucrChkTotalRainfall.Location = New System.Drawing.Point(4, 22) + Me.ucrChkTotalRainfall.Name = "ucrChkTotalRainfall" + Me.ucrChkTotalRainfall.Size = New System.Drawing.Size(131, 23) + Me.ucrChkTotalRainfall.TabIndex = 17 + ' + 'ucrNudTRPercentile + ' + Me.ucrNudTRPercentile.AutoSize = True + Me.ucrNudTRPercentile.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudTRPercentile.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudTRPercentile.Location = New System.Drawing.Point(289, 109) + Me.ucrNudTRPercentile.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudTRPercentile.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudTRPercentile.Name = "ucrNudTRPercentile" + Me.ucrNudTRPercentile.Size = New System.Drawing.Size(42, 20) + Me.ucrNudTRPercentile.TabIndex = 28 + Me.ucrNudTRPercentile.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'rdoTRAmount + ' + Me.rdoTRAmount.AutoSize = True + Me.rdoTRAmount.Location = New System.Drawing.Point(199, 60) + Me.rdoTRAmount.Name = "rdoTRAmount" + Me.rdoTRAmount.Size = New System.Drawing.Size(61, 17) + Me.rdoTRAmount.TabIndex = 21 + Me.rdoTRAmount.TabStop = True + Me.rdoTRAmount.Text = "Amount" + Me.rdoTRAmount.UseVisualStyleBackColor = True + ' + 'rdoTRPercentile + ' + Me.rdoTRPercentile.AutoSize = True + Me.rdoTRPercentile.Location = New System.Drawing.Point(199, 109) + Me.rdoTRPercentile.Name = "rdoTRPercentile" + Me.rdoTRPercentile.Size = New System.Drawing.Size(72, 17) + Me.rdoTRPercentile.TabIndex = 27 + Me.rdoTRPercentile.TabStop = True + Me.rdoTRPercentile.Text = "Percentile" + Me.rdoTRPercentile.UseVisualStyleBackColor = True + ' + 'ucrPnlTRCalculateBy + ' + Me.ucrPnlTRCalculateBy.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlTRCalculateBy.Location = New System.Drawing.Point(130, 55) + Me.ucrPnlTRCalculateBy.Name = "ucrPnlTRCalculateBy" + Me.ucrPnlTRCalculateBy.Size = New System.Drawing.Size(165, 75) + Me.ucrPnlTRCalculateBy.TabIndex = 4 + ' + 'lblThreshold + ' + Me.lblThreshold.AutoSize = True + Me.lblThreshold.Location = New System.Drawing.Point(10, 12) + Me.lblThreshold.Name = "lblThreshold" + Me.lblThreshold.Size = New System.Drawing.Size(57, 13) + Me.lblThreshold.TabIndex = 12 + Me.lblThreshold.Tag = "Threshold" + Me.lblThreshold.Text = "Threshold:" + ' + 'grpRainParameters + ' + Me.grpRainParameters.Controls.Add(Me.ucrInputThreshold) + Me.grpRainParameters.Controls.Add(Me.ucrInputFilterPreview) + Me.grpRainParameters.Controls.Add(Me.cmdDoyRange) + Me.grpRainParameters.Controls.Add(Me.lblThreshold) + Me.grpRainParameters.Location = New System.Drawing.Point(13, 222) + Me.grpRainParameters.Name = "grpRainParameters" + Me.grpRainParameters.Size = New System.Drawing.Size(584, 40) + Me.grpRainParameters.TabIndex = 64 + Me.grpRainParameters.TabStop = False + ' + 'cmdDoyRange + ' + Me.cmdDoyRange.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdDoyRange.Location = New System.Drawing.Point(159, 8) + Me.cmdDoyRange.Name = "cmdDoyRange" + Me.cmdDoyRange.Size = New System.Drawing.Size(105, 26) + Me.cmdDoyRange.TabIndex = 14 + Me.cmdDoyRange.Tag = "" + Me.cmdDoyRange.Text = "Day Range" + Me.cmdDoyRange.UseVisualStyleBackColor = True ' 'dlgStartofRains ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True - Me.ClientSize = New System.Drawing.Size(696, 573) + Me.ClientSize = New System.Drawing.Size(610, 582) Me.Controls.Add(Me.lblRainfall) - Me.Controls.Add(Me.ucrChkAsDoy) - Me.Controls.Add(Me.ucrInputNewDoyColumnName) Me.Controls.Add(Me.lblStation) - Me.Controls.Add(Me.ucrReceiverStation) - Me.Controls.Add(Me.ucrReceiverDate) - Me.Controls.Add(Me.ucrReceiverYear) - Me.Controls.Add(Me.ucrReceiverDOY) - Me.Controls.Add(Me.ucrReceiverRainfall) Me.Controls.Add(Me.lblYear) Me.Controls.Add(Me.lblDate) Me.Controls.Add(Me.lblDOY) - Me.Controls.Add(Me.grpRainParameters) - Me.Controls.Add(Me.grpConditionsForSatrtofRains) Me.Controls.Add(Me.ucrSelectorForStartofRains) + Me.Controls.Add(Me.ucrInputNewDoyColumnName) + Me.Controls.Add(Me.ucrChkAsDoy) + Me.Controls.Add(Me.ucrReceiverStation) + Me.Controls.Add(Me.ucrReceiverDate) + Me.Controls.Add(Me.ucrReceiverYear) + Me.Controls.Add(Me.ucrReceiverRainfall) Me.Controls.Add(Me.ucrBase) + Me.Controls.Add(Me.ucrReceiverDOY) + Me.Controls.Add(Me.grpConditionsForSatrtofRains) + Me.Controls.Add(Me.grpRainParameters) Me.Controls.Add(Me.grpDisplay) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.MaximizeBox = False @@ -696,66 +559,55 @@ Partial Class dlgStartofRains Me.ShowIcon = False Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Start of Rains" + Me.grpDisplay.ResumeLayout(False) + Me.grpDisplay.PerformLayout() Me.grpConditionsForSatrtofRains.ResumeLayout(False) Me.grpConditionsForSatrtofRains.PerformLayout() Me.grpRainParameters.ResumeLayout(False) Me.grpRainParameters.PerformLayout() - Me.grpDisplay.ResumeLayout(False) - Me.grpDisplay.PerformLayout() Me.ResumeLayout(False) Me.PerformLayout() End Sub - Friend WithEvents ucrBase As ucrButtons - Friend WithEvents ucrSelectorForStartofRains As ucrSelectorByDataFrameAddRemove - Friend WithEvents grpConditionsForSatrtofRains As GroupBox - Friend WithEvents lblDSLengthofTime As Label - Friend WithEvents lblDSMaximumDays As Label - Friend WithEvents lblTRVal As Label - Friend WithEvents lblRDMinimum As Label - Friend WithEvents grpRainParameters As GroupBox - Friend WithEvents lblTROverDays As Label - Friend WithEvents lblDOY As Label - Friend WithEvents ucrReceiverRainfall As ucrReceiverSingle - Friend WithEvents ucrReceiverDOY As ucrReceiverSingle - Friend WithEvents lblRDWidth As Label - Friend WithEvents lblThreshold As Label + Friend WithEvents ucrInputThreshold As ucrInputComboBox + Friend WithEvents lblRainfall As Label + Friend WithEvents lblStation As Label + Friend WithEvents lblYear As Label Friend WithEvents lblDate As Label + Friend WithEvents lblDOY As Label + Friend WithEvents grpDisplay As GroupBox + Friend WithEvents ucrInputNewStatusColumnName As ucrInputTextBox + Friend WithEvents ucrChkAsDate As ucrCheck + Friend WithEvents ucrChkStatus As ucrCheck + Friend WithEvents ucrInputNewDateColumnName As ucrInputTextBox + Friend WithEvents ucrSelectorForStartofRains As ucrSelectorByDataFrameAddRemove + Friend WithEvents ucrInputNewDoyColumnName As ucrInputTextBox + Friend WithEvents ucrChkAsDoy As ucrCheck + Friend WithEvents ucrReceiverStation As ucrReceiverSingle Friend WithEvents ucrReceiverDate As ucrReceiverSingle Friend WithEvents ucrReceiverYear As ucrReceiverSingle - Friend WithEvents lblYear As Label - Friend WithEvents rdoTRPercentile As RadioButton - Friend WithEvents rdoTRAmount As RadioButton - Friend WithEvents lblDPOverallInterval As Label - Friend WithEvents lblDPLength As Label - Friend WithEvents lblDPMaxRain As Label + Friend WithEvents ucrReceiverRainfall As ucrReceiverSingle + Friend WithEvents ucrBase As ucrButtons + Friend WithEvents ucrReceiverDOY As ucrReceiverSingle + Friend WithEvents grpConditionsForSatrtofRains As GroupBox + Friend WithEvents cmdAdditionnal As Button + Friend WithEvents ucrChkAdditional As ucrCheck + Friend WithEvents ucrReceiverEvap As ucrReceiverSingle + Friend WithEvents lblFraction As Label + Friend WithEvents ucrNudEvapo As ucrNud + Friend WithEvents rdoEvapo As RadioButton + Friend WithEvents lblTROverDays As Label Friend WithEvents ucrNudTROverDays As ucrNud - Friend WithEvents ucrNudTRPercentile As ucrNud - Friend WithEvents lblStation As Label - Friend WithEvents ucrReceiverStation As ucrReceiverSingle - Friend WithEvents ucrChkTotalRainfall As ucrCheck Friend WithEvents ucrNudTRAmount As ucrNud + Friend WithEvents lblTRVal As Label + Friend WithEvents ucrChkTotalRainfall As ucrCheck + Friend WithEvents ucrNudTRPercentile As ucrNud + Friend WithEvents rdoTRAmount As RadioButton + Friend WithEvents rdoTRPercentile As RadioButton Friend WithEvents ucrPnlTRCalculateBy As UcrPanel - Friend WithEvents ucrNudRDMinimumDays As ucrNud - Friend WithEvents ucrNudRDOutOfDays As ucrNud - Friend WithEvents ucrChkNumberOfRainyDays As ucrCheck - Friend WithEvents ucrNudDSLengthOfTime As ucrNud - Friend WithEvents ucrNudDSMaximumDays As ucrNud - Friend WithEvents ucrNudDPOverallInterval As ucrNud - Friend WithEvents ucrNudDPRainPeriod As ucrNud - Friend WithEvents ucrNudDPMaxRain As ucrNud - Friend WithEvents ucrChkDrySpell As ucrCheck - Friend WithEvents ucrChkDryPeriod As ucrCheck - Friend WithEvents ucrInputNewDoyColumnName As ucrInputTextBox + Friend WithEvents grpRainParameters As GroupBox Friend WithEvents ucrInputFilterPreview As ucrInputTextBox Friend WithEvents cmdDoyRange As Button - Friend WithEvents ucrInputNewDateColumnName As ucrInputTextBox - Friend WithEvents ucrChkAsDate As ucrCheck - Friend WithEvents ucrChkAsDoy As ucrCheck - Friend WithEvents lblRainfall As Label - Friend WithEvents ucrChkStatus As ucrCheck - Friend WithEvents ucrInputNewStatusColumnName As ucrInputTextBox - Friend WithEvents grpDisplay As GroupBox - Friend WithEvents ucrInputThreshold As ucrInputComboBox + Friend WithEvents lblThreshold As Label End Class \ No newline at end of file diff --git a/instat/dlgStartofRains.vb b/instat/dlgStartofRains.vb index 8717e3e6506..ca242b4e7c5 100644 --- a/instat/dlgStartofRains.vb +++ b/instat/dlgStartofRains.vb @@ -17,9 +17,10 @@ Imports instat.Translations Public Class dlgStartofRains - Private clsCalcRainDay, clsCalcStartDOY, clsCalcStartDate, clsCombinationCalc, clsCombinationManipList, clsCombinationSubCalcList, clsListSubCalc, clsManipulationFirstDOYPerYear, clsConditionsFilter, clsCombinedList As New RFunction + Private bResetSubdialog As Boolean = True + Private clsCalcRainDay, clsCalcStartDOY, clsVectorFunction, clsGetlinkeddataFunction, clsGetDataFrameFunction, clsListevapFunction, clsRollEvaporationFunction, clsFractionEvapFunction, clsSumEvapFunction, clsConvertColumnType1Function, clsConvertColumnType2Function, clsConvertColumnTypeFunction, clsGetColumnDataTypeFunction, clsDummyFunction, clsIfelseStatusFunction, clsIfelseStatus1Function, clsFirstStatusFunction, clsIsNAStatusFunction, clsCalcStartDate, clsCombinationCalc, clsListCalFunction, clsCombinationManipList, clsCombinationSubCalcList, clsListSubCalc, clsManipulationFirstDOYPerYear, clsConditionsFilter, clsCombinedList As New RFunction Private clsDayFromAndTo, clsGroupByStation, clsGroupByYear, clsListToTalRain, clsApplyInstatFunction, clsFirstDOY, clsFirstDate As New RFunction - Private clsDayFromAndToOperator, clsDayFromOperator, clsDayToOperator, clsRainDayOperator, clsRainDayConditionOperator, clsConditionsAndOperator, clsTRCombineOperator, clsRollingSumRainDayOperator, clsDSCombineOperator, clsDPCombineOperator As New ROperator + Private clsDayFromAndToOperator, clsEvapOperator, clsDayFromOperator, clsDayToOperator, clsRainDayOperator, clsRainDayConditionOperator, clsConditionsAndOperator, clsTRCombineOperator, clsRollingSumRainDayOperator, clsDSCombineOperator, clsDPCombineOperator As New ROperator Private clsDayFilterCalcFromConvert, clsDayFilterCalcFromList As New RFunction Private clsSpellsFunction As New RFunction @@ -70,6 +71,8 @@ Public Class dlgStartofRains Public bFirstLoad As Boolean = True Private bReset As Boolean = True Private strWetSpell As String = "wet_spell" + Private strFactionEvap As String = "fraction_evap" + Private strSumFractionEvap As String = "roll_sum_evap" Private Sub dlgStartofRains_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstLoad Then @@ -130,6 +133,11 @@ Public Class dlgStartofRains ucrReceiverRainfall.SetClimaticType("rain") ucrReceiverRainfall.bAutoFill = True + ucrReceiverEvap.SetParameter(New RParameter("evap", 0, False)) + ucrReceiverEvap.SetParameterIsString() + ucrReceiverEvap.bWithQuotes = False + ucrReceiverEvap.Selector = ucrSelectorForStartofRains + ucrInputThreshold.SetParameter(New RParameter("threshold", 1)) dctInputThreshold.Add("0.85", "0.85") dctInputThreshold.Add("0.5", "0.5") @@ -140,18 +148,21 @@ Public Class dlgStartofRains ucrInputThreshold.SetLinkedDisplayControl(lblThreshold) ucrInputThreshold.SetRDefault(0.85) - - 'Total Rainfall ucrPnlTRCalculateBy.AddRadioButton(rdoTRAmount) ucrPnlTRCalculateBy.AddRadioButton(rdoTRPercentile) + ucrPnlTRCalculateBy.AddRadioButton(rdoEvapo) ucrPnlTRCalculateBy.AddParameterPresentCondition(rdoTRAmount, "tr_perc_sub", False) ucrPnlTRCalculateBy.AddParameterPresentCondition(rdoTRPercentile, "tr_perc_sub") + ucrPnlTRCalculateBy.AddParameterPresentCondition(rdoEvapo, "tr_perc_sub") ucrPnlTRCalculateBy.AddToLinkedControls(ucrNudTRPercentile, {rdoTRPercentile}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=0.8) ucrPnlTRCalculateBy.AddToLinkedControls(ucrNudTRAmount, {rdoTRAmount}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=20) + ucrPnlTRCalculateBy.AddToLinkedControls(ucrNudEvapo, {rdoEvapo}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=0.5) + ucrPnlTRCalculateBy.AddToLinkedControls(ucrReceiverEvap, {rdoEvapo}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrPnlTRCalculateBy.SetLinkedDisplayControl(lblTRVal) ucrPnlTRCalculateBy.AddParameterPresentCondition(rdoTRPercentile, "tr_perc") ucrPnlTRCalculateBy.AddParameterPresentCondition(rdoTRAmount, "tr_amount") + ucrPnlTRCalculateBy.AddParameterPresentCondition(rdoEvapo, "evap") ucrNudTRAmount.SetParameter(New RParameter("tr_amount", 1, False), False) ucrNudTRAmount.SetMinMax(1, Integer.MaxValue) @@ -171,57 +182,15 @@ Public Class dlgStartofRains ucrNudTRPercentile.DecimalPlaces = 2 ucrNudTRPercentile.Increment = 0.1 - 'Number of Rainy days - ucrChkNumberOfRainyDays.SetParameter(New RParameter("rd_sub", clsCalcRainDayRollingSum, 2, False), False) - ucrChkNumberOfRainyDays.AddAdditionalCodeParameterPair(clsConditionsAndOperator, New RParameter("rain_days", clsRollingSumRainDayOperator, 2, False), iAdditionalPairNo:=1) - ucrChkNumberOfRainyDays.SetText("Number of Rainy Days") - - ucrNudRDMinimumDays.SetParameter(New RParameter("1", 1)) - ucrNudRDMinimumDays.SetLinkedDisplayControl(lblRDMinimum) - ucrNudRDMinimumDays.SetMinMax(1, 366) - - ucrNudRDOutOfDays.SetParameter(New RParameter("n", 1)) - ucrNudRDOutOfDays.SetLinkedDisplayControl(lblRDWidth) - ucrNudRDOutOfDays.SetMinMax(1, 366) - - ucrChkNumberOfRainyDays.AddToLinkedControls(ucrNudRDMinimumDays, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=1) - ucrChkNumberOfRainyDays.AddToLinkedControls(ucrNudRDOutOfDays, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=2) - - 'Dry Spell - ucrChkDrySpell.SetParameter(New RParameter("ds_sub", clsCalcDrySpellRollMax, 3, False), False) - ucrChkDrySpell.AddAdditionalCodeParameterPair(clsConditionsAndOperator, New RParameter("dry_spell", clsDSCombineOperator, 3, False), iAdditionalPairNo:=1) - ucrChkDrySpell.SetText("Dry Spell") - ucrChkDrySpell.AddToLinkedControls(ucrNudDSLengthOfTime, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=21) - ucrChkDrySpell.AddToLinkedControls(ucrNudDSMaximumDays, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=9) - ucrNudDSLengthOfTime.SetLinkedDisplayControl(lblDSLengthofTime) - ucrNudDSMaximumDays.SetLinkedDisplayControl(lblDSMaximumDays) - - ucrNudDSLengthOfTime.SetParameter(New RParameter("n", 1)) - ucrNudDSLengthOfTime.SetMinMax(1, 366) - - ucrNudDSMaximumDays.SetParameter(New RParameter("ds_max", 1)) - ucrNudDSMaximumDays.SetMinMax(1, 366) - - ' Dry Period - ucrChkDryPeriod.SetParameter(New RParameter("dp_sub", clsCalcRollSumNumberDryPeriod, 3, False), False) - ucrChkDryPeriod.AddAdditionalCodeParameterPair(clsConditionsAndOperator, New RParameter("dry_period", clsDPCombineOperator, 4, False), iAdditionalPairNo:=1) - ucrChkDryPeriod.SetText("Dry Period") - - ucrNudDPRainPeriod.SetParameter(New RParameter("n", 0)) - ucrNudDPRainPeriod.SetLinkedDisplayControl(lblDPLength) - ucrNudDPRainPeriod.SetMinMax(1, 366) - - ucrNudDPMaxRain.SetParameter(New RParameter("right", 1)) - ucrNudDPMaxRain.SetLinkedDisplayControl(lblDPMaxRain) - ucrNudDPMaxRain.SetMinMax(1, Integer.MaxValue) - - ucrNudDPOverallInterval.SetParameter(New RParameter("0", 0)) - ucrNudDPOverallInterval.SetLinkedDisplayControl(lblDPOverallInterval) - ucrNudDPOverallInterval.SetMinMax(1, 366) + ucrNudEvapo.SetParameter(New RParameter("frac", 1, False)) + ucrNudEvapo.SetMinMax(0.01, 10) + ucrNudEvapo.DecimalPlaces = 2 + ucrNudEvapo.Increment = 0.01 + ucrNudEvapo.SetLinkedDisplayControl(lblFraction) - ucrChkDryPeriod.AddToLinkedControls(ucrNudDPMaxRain, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=40) - ucrChkDryPeriod.AddToLinkedControls(ucrNudDPOverallInterval, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=45) - ucrChkDryPeriod.AddToLinkedControls(ucrNudDPRainPeriod, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=30) + ucrChkAdditional.SetText("Additional Conditions") + ucrChkAdditional.AddParameterValuesCondition(True, "additional", "True") + ucrChkAdditional.AddParameterValuesCondition(False, "additional", "False") 'save ucrInputNewDoyColumnName.SetParameter(New RParameter("result_name", 2)) @@ -242,15 +211,18 @@ Public Class dlgStartofRains ucrChkAsDoy.AddParameterPresentCondition(True, "sub1", True) ucrChkAsDoy.AddParameterPresentCondition(False, "sub1", False) - ucrChkAsDoy.SetText("Day of Year") + ucrChkAsDoy.SetText("Day") - ucrChkAsDate.AddParameterPresentCondition(True, "sub2", True) - ucrChkAsDate.AddParameterPresentCondition(False, "sub2", False) + ucrChkAsDate.AddParameterValuesCondition(True, "sub2", "True") + ucrChkAsDate.AddParameterValuesCondition(False, "sub2", "False") ucrChkAsDate.SetText("Date") - ucrChkStatus.AddParameterPresentCondition(True, "sub3", True) - ucrChkStatus.AddParameterPresentCondition(False, "sub3", False) + ucrChkStatus.AddParameterValuesCondition(True, "sub3", "True") + ucrChkStatus.AddParameterValuesCondition(False, "sub3", "False") ucrChkStatus.SetText("Occurrence") + SetReceiver() + AdditionalCondition() + ChangeDSValue() End Sub Private Sub SetDefaults() @@ -265,6 +237,15 @@ Public Class dlgStartofRains Dim strStartStatus As String = "start_rain_status" Dim strStartDoy As String = "start_rain" Dim strRollSumRainDryPeriod As String = "roll_sum_rain_dry_period" + Dim strYearType As String = "year_type" + + clsRainRollingSumFunction = New RFunction + clsGetlinkeddataFunction = New RFunction + clsVectorFunction = New RFunction + clsGetDataFrameFunction = New RFunction + clsDayFilterCalcFromConvert = New RFunction + clsDayFilterCalcFromList = New RFunction + clsDummyFunction = New RFunction clsDayFromAndTo.Clear() clsDayFromAndToOperator.Clear() @@ -279,7 +260,21 @@ Public Class dlgStartofRains clsCombinedList.Clear() clsCombinationCalc.Clear() clsListSubCalc.Clear() + clsListCalFunction.Clear() clsCombinationSubCalcList.Clear() + clsIfelseStatus1Function.Clear() + clsIfelseStatusFunction.Clear() + clsFirstStatusFunction.Clear() + clsIsNAStatusFunction.Clear() + clsGetColumnDataTypeFunction.Clear() + clsConvertColumnTypeFunction.Clear() + clsConvertColumnType2Function.Clear() + clsConvertColumnType1Function.Clear() + clsFractionEvapFunction.Clear() + clsSumEvapFunction.Clear() + clsEvapOperator.Clear() + clsRollEvaporationFunction.Clear() + clsListevapFunction.Clear() clsSpellsFunction.Clear() clsRainDaySpellsOperator.Clear() @@ -309,7 +304,6 @@ Public Class dlgStartofRains clsIsNaFirstDryPeriod.Clear() clsCalcRainRollingSum.Clear() - clsRainRollingSumFunction = New RFunction clsTRWetSpellList.Clear() clsTRWetSpell.Clear() clsTRWetSpellFunction.Clear() @@ -345,15 +339,18 @@ Public Class dlgStartofRains clsDSCombineOperator.Clear() clsDPCombineOperator.Clear() - ucrReceiverRainfall.SetMeAsReceiver() + bResetSubdialog = True ucrSelectorForStartofRains.Reset() - clsDayFilterCalcFromConvert = New RFunction clsDayFilterCalcFromConvert.SetRCommand("calc_from_convert") - clsDayFilterCalcFromList = New RFunction + clsDayFilterCalcFromList.SetRCommand("list") clsDayFilterCalcFromConvert.AddParameter("x", clsRFunctionParameter:=clsDayFilterCalcFromList, iPosition:=0) + clsDummyFunction.AddParameter("sub2", "True", iPosition:=0) + clsDummyFunction.AddParameter("sub3", "True", iPosition:=1) + clsDummyFunction.AddParameter("additional", "False", iPosition:=2) + 'Day From and To clsDayFromAndTo.SetRCommand("instat_calculation$new") clsDayFromAndTo.AddParameter("type", Chr(34) & "filter" & Chr(34), iPosition:=0) @@ -383,6 +380,18 @@ Public Class dlgStartofRains clsGroupByYear.AddParameter("type", Chr(34) & "by" & Chr(34), iPosition:=0) clsGroupByYear.SetAssignTo("grouping_by_year") + clsGetColumnDataTypeFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_column_data_types") + clsGetColumnDataTypeFunction.AddParameter("data_name", Chr(34) & ucrSelectorForStartofRains.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) + clsGetColumnDataTypeFunction.SetAssignTo(strYearType) + + clsConvertColumnTypeFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$convert_column_to_type") + clsConvertColumnTypeFunction.AddParameter("data_name", Chr(34) & ucrSelectorForStartofRains.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) + clsConvertColumnTypeFunction.AddParameter("to_type", Chr(34) & "factor" & Chr(34), iPosition:=2) + + clsConvertColumnType1Function.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$convert_column_to_type") + clsConvertColumnType1Function.AddParameter("data_name", Chr(34) & ucrSelectorForStartofRains.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) + clsConvertColumnType1Function.AddParameter("to_type", "year_type", iPosition:=2) + 'TOTAL RAIN: associated with ucrChkTotalRainfall clsCalcRainRollingSum.SetRCommand("instat_calculation$new") clsCalcRainRollingSum.AddParameter("type", Chr(34) & "calculation" & Chr(34), iPosition:=0) @@ -531,8 +540,33 @@ Public Class dlgStartofRains clsIsNaFirstDrySpell.SetRCommand("is.na") clsIsNaFirstDrySpell.AddParameter("x", clsRFunctionParameter:=clsFirstDrySpell, iPosition:=0) - 'DRY PERIOD + clsFractionEvapFunction.SetRCommand("instat_calculation$new") + clsFractionEvapFunction.AddParameter("type", Chr(34) & "calculation" & Chr(34), iPosition:=0) + clsFractionEvapFunction.AddParameter("function_exp", clsROperatorParameter:=clsEvapOperator, iPosition:=1) + clsFractionEvapFunction.AddParameter("result_name", Chr(34) & strFactionEvap & Chr(34), iPosition:=2) + clsFractionEvapFunction.SetAssignTo(strFactionEvap) + clsEvapOperator.SetOperation("*") + clsEvapOperator.bToScriptAsRString = True + + clsSumEvapFunction.SetRCommand("instat_calculation$new") + clsSumEvapFunction.AddParameter("type", Chr(34) & "calculation" & Chr(34), iPosition:=0) + clsSumEvapFunction.AddParameter("function_exp", clsRFunctionParameter:=clsRollEvaporationFunction, iPosition:=1) + clsSumEvapFunction.AddParameter("result_name", Chr(34) & strSumFractionEvap & Chr(34), iPosition:=2) + clsSumEvapFunction.AddParameter("sub_calculations", clsRFunctionParameter:=clsListevapFunction, iPosition:=3) + clsSumEvapFunction.SetAssignTo(strSumFractionEvap) + + clsListevapFunction.SetRCommand("list") + clsListevapFunction.AddParameter("x", strFactionEvap, iPosition:=0, bIncludeArgumentName:=False) + + clsRollEvaporationFunction.SetPackageName("RcppRoll") + clsRollEvaporationFunction.SetRCommand("roll_sumr") + clsRollEvaporationFunction.AddParameter("x", strFactionEvap, iPosition:=0) + clsRollEvaporationFunction.AddParameter("fill", "NA", iPosition:=2) + clsRollEvaporationFunction.AddParameter("na.rm", "FALSE", iPosition:=3) + clsRollEvaporationFunction.bToScriptAsRString = True + + 'DRY PERIOD clsCalcRainRollingSumDryPeriod.SetRCommand("instat_calculation$new") clsCalcRainRollingSumDryPeriod.AddParameter("type", Chr(34) & "calculation" & Chr(34), iPosition:=0) clsCalcRainRollingSumDryPeriod.AddParameter("function_exp", clsRFunctionParameter:=clsLeadRollingSumRainDryPeriodFunction, iPosition:=1) @@ -593,7 +627,7 @@ Public Class dlgStartofRains clsConditionsFilter.SetAssignTo("conditions_filter") clsCombinedList.SetRCommand("list") - clsCombinedList.AddParameter("tr_sub", clsRFunctionParameter:=clsCalcRainRollingSum, bIncludeArgumentName:=False) + clsCombinedList.AddParameter("tr_sub", clsRFunctionParameter:=clsCalcRainRollingSum, bIncludeArgumentName:=False, iPosition:=0) clsConditionsOrOverallOperator.SetOperation("|") clsConditionsOrOverallOperator.bToScriptAsRString = True @@ -683,11 +717,29 @@ Public Class dlgStartofRains ' Status clsCalcStatus.SetRCommand("instat_calculation$new") clsCalcStatus.AddParameter("type", Chr(34) & "summary" & Chr(34), iPosition:=0) - clsCalcStatus.AddParameter("function_exp", Chr(34) & "n() > 0" & Chr(34), iPosition:=1) + clsCalcStatus.AddParameter("function_exp", clsRFunctionParameter:=clsIfelseStatusFunction, iPosition:=1) clsCalcStatus.AddParameter("result_name", Chr(34) & strStartStatus & Chr(34), iPosition:=3) clsCalcStatus.AddParameter("save", 2, iPosition:=4) clsCalcStatus.SetAssignTo("start_of_rains_status") + clsIfelseStatusFunction.SetRCommand("ifelse") + clsIfelseStatusFunction.bToScriptAsRString = True + clsIfelseStatusFunction.AddParameter("x", "n() > 0", iPosition:=0, bIncludeArgumentName:=False) + clsIfelseStatusFunction.AddParameter("y", clsRFunctionParameter:=clsIfelseStatus1Function, iPosition:=1, bIncludeArgumentName:=False) + clsIfelseStatusFunction.AddParameter("z", "FALSE", iPosition:=2, bIncludeArgumentName:=False) + + clsIfelseStatus1Function.SetRCommand("ifelse") + clsIfelseStatus1Function.AddParameter("yes", clsRFunctionParameter:=clsFirstStatusFunction, iPosition:=0, bIncludeArgumentName:=False) + clsIfelseStatus1Function.AddParameter("test", "NA", iPosition:=1, bIncludeArgumentName:=False) + clsIfelseStatus1Function.AddParameter("no", "TRUE", iPosition:=2, bIncludeArgumentName:=False) + + clsFirstStatusFunction.SetPackageName("dplyr") + clsFirstStatusFunction.SetRCommand("first") + clsFirstStatusFunction.AddParameter("x", clsRFunctionParameter:=clsIsNAStatusFunction, iPosition:=0, bIncludeArgumentName:=False) + + clsIsNAStatusFunction.SetRCommand("is.na") + clsIsNAStatusFunction.AddParameter("x", strRollSumRain, iPosition:=0, bIncludeArgumentName:=False) + 'Combination clsCombinationCalc.SetRCommand("instat_calculation$new") clsCombinationCalc.AddParameter("type", Chr(34) & "combination" & Chr(34), iPosition:=0) @@ -702,18 +754,43 @@ Public Class dlgStartofRains clsCombinationSubCalcList.SetRCommand("list") clsCombinationSubCalcList.AddParameter("sub1", clsRFunctionParameter:=clsCalcStartDOY, bIncludeArgumentName:=False, iPosition:=0) + clsCombinationSubCalcList.AddParameter("sub2", clsRFunctionParameter:=clsCalcStartDate, bIncludeArgumentName:=False, iPosition:=1) + clsCombinationSubCalcList.AddParameter("sub3", clsRFunctionParameter:=clsCalcStatus, bIncludeArgumentName:=False, iPosition:=2) 'Sub_Calculations List clsListSubCalc.SetRCommand("list") - clsListSubCalc.AddParameter("sub1", iPosition:=0, clsRFunctionParameter:=clsCalcStartDOY, bIncludeArgumentName:=False) + + clsGetDataFrameFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_data_names") + + clsGetlinkeddataFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_linked_to_data_name") + clsGetlinkeddataFunction.SetAssignTo("linked_data_name") + + clsVectorFunction.SetRCommand("c") + + clsConvertColumnType2Function.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$convert_column_to_type") + clsConvertColumnType2Function.AddParameter("data_name", "linked_data_name", iPosition:=0) + clsConvertColumnType2Function.AddParameter("to_type", "year_type", iPosition:=2) 'Run Calculations + clsListCalFunction.SetRCommand("list") + clsListCalFunction.AddParameter("drop", "FALSE", iPosition:=0) + clsApplyInstatFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$run_instat_calculation") clsApplyInstatFunction.AddParameter("display", "FALSE", iPosition:=1) clsApplyInstatFunction.AddParameter("calc", clsRFunctionParameter:=clsCombinationCalc, iPosition:=0) + clsApplyInstatFunction.AddParameter("param_list", clsRFunctionParameter:=clsListCalFunction, iPosition:=2) + + ucrBase.clsRsyntax.ClearCodes() - 'Base Function ucrBase.clsRsyntax.SetBaseRFunction(clsApplyInstatFunction) + ucrBase.clsRsyntax.AddToBeforeCodes(clsGetColumnDataTypeFunction, iPosition:=0) + ucrBase.clsRsyntax.AddToBeforeCodes(clsConvertColumnTypeFunction, iPosition:=1) + ucrBase.clsRsyntax.AddToAfterCodes(clsGetlinkeddataFunction, iPosition:=0) + ucrBase.clsRsyntax.AddToAfterCodes(clsConvertColumnType1Function, iPosition:=1) + ucrBase.clsRsyntax.AddToAfterCodes(clsConvertColumnType2Function, iPosition:=2) + SetReceiver() + ChangeDSValue() + AdditionalCondition() End Sub Private Sub SetRCodeForControls(bReset As Boolean) @@ -726,17 +803,16 @@ Public Class dlgStartofRains ucrReceiverRainfall.AddAdditionalCodeParameterPair(clsFirstRain, New RParameter("x", 0), iAdditionalPairNo:=4) ucrReceiverRainfall.AddAdditionalCodeParameterPair(clsIsNaRain, New RParameter("x", 0), iAdditionalPairNo:=5) ucrInputThreshold.AddAdditionalCodeParameterPair(clsRainDayConditionOperator, New RParameter("threshold", 1), iAdditionalPairNo:=1) - - 'clsSORStartSummary.SetControlParameters(ucrReceiverRainfall, iAdditionalPairNo:=4) - 'clsSORStatusSummary.SetControlParameters(ucrReceiverRainfall, iAdditionalPairNo:=5) - - ucrNudDPRainPeriod.AddAdditionalCodeParameterPair(clsSumRainDryPeriodIntervalPlusOperator, ucrNudDPRainPeriod.GetParameter(), iAdditionalPairNo:=1) ucrInputNewDoyColumnName.AddAdditionalCodeParameterPair(clsCalcStartDOY, New RParameter("result_name", 3), iAdditionalPairNo:=1) + ucrNudTROverDays.AddAdditionalCodeParameterPair(clsRollEvaporationFunction, New RParameter("n", 1), iAdditionalPairNo:=1) ucrReceiverDOY.SetRCode(clsDayToOperator, bReset) ucrChkAsDoy.SetRCode(clsCombinationSubCalcList, bReset) - ucrChkStatus.SetRCode(clsCombinationSubCalcList, bReset) - ucrChkAsDate.SetRCode(clsCombinationSubCalcList, bReset) + ucrChkStatus.SetRCode(clsDummyFunction, bReset) + ucrChkAsDate.SetRCode(clsDummyFunction, bReset) + If bReset Then + ucrChkAdditional.SetRCode(clsDummyFunction, bReset) + End If ucrInputThreshold.SetRCode(clsRainDayOperator, bReset) ucrReceiverDate.SetRCode(clsFirstDate, bReset) @@ -749,25 +825,12 @@ Public Class dlgStartofRains ucrNudTROverDays.SetRCode(clsRainRollingSumFunction, bReset) ucrNudTRPercentile.SetRCode(clsTRWetSpellFunction, bReset) ucrReceiverRainfall.SetRCode(clsRainRollingSumFunction, bReset) - - 'Rain Days - ucrChkNumberOfRainyDays.SetRCode(clsCombinedList, bReset) - ucrNudRDOutOfDays.SetRCode(clsRainDayRollingSumFunction, bReset) - - 'DrySpell - ucrChkDrySpell.SetRCode(clsCombinedList, bReset) - ucrNudDSLengthOfTime.SetRCode(clsDrySpellPeriodRollMaxFunction, bReset) - - 'DryPeriod - ucrChkDryPeriod.SetRCode(clsCombinedList, bReset) - ucrNudDPRainPeriod.SetRCode(clsRollingSumRainDryPeriodFunction, bReset) - ucrNudDPMaxRain.SetRCode(clsSumRainDryPeriodOperator, bReset) - ucrNudDPOverallInterval.SetRCode(clsSumRainDryPeriodIntervalMinusOperator, bReset) - - ' Combine - ucrNudRDMinimumDays.SetRCode(clsRollingSumRainDayOperator, bReset) - ucrNudDSMaximumDays.SetRCode(clsDSCombineOperator, bReset) ucrNudTRAmount.SetRCode(clsTRCombineOperator, bReset) + + 'Evaporation + ucrReceiverEvap.SetRCode(clsEvapOperator, bReset) + ucrNudEvapo.SetRCode(clsEvapOperator, bReset) + AdditionalCondition() End Sub Private Sub TestOKEnabled() @@ -777,25 +840,16 @@ Public Class dlgStartofRains Not ucrReceiverDOY.IsEmpty AndAlso Not ucrReceiverYear.IsEmpty AndAlso ucrInputThreshold.GetText <> "" AndAlso - ( - (ucrChkNumberOfRainyDays.Checked AndAlso ucrNudRDMinimumDays.GetText <> "" AndAlso ucrNudRDOutOfDays.GetText <> "") OrElse - Not ucrChkNumberOfRainyDays.Checked) AndAlso ( ( (ucrChkTotalRainfall.Checked AndAlso ucrNudTROverDays.GetText <> "") AndAlso - ((rdoTRAmount.Checked AndAlso ucrNudTRAmount.GetText <> "") OrElse (rdoTRPercentile.Checked AndAlso ucrNudTRPercentile.GetText <> ""))) OrElse - Not ucrChkTotalRainfall.Checked) AndAlso - ( - (ucrChkDrySpell.Checked AndAlso ucrNudDSMaximumDays.GetText <> "" AndAlso ucrNudDSLengthOfTime.GetText <> "") OrElse - Not ucrChkDrySpell.Checked) AndAlso - ( - (ucrChkDryPeriod.Checked AndAlso ucrNudDPMaxRain.GetText <> "" AndAlso ucrNudDPRainPeriod.GetText <> "" AndAlso ucrNudDPOverallInterval.GetText <> "") OrElse - Not ucrChkDryPeriod.Checked) Then + ((rdoTRAmount.Checked AndAlso ucrNudTRAmount.GetText <> "") OrElse (rdoTRPercentile.Checked AndAlso ucrNudTRPercentile.GetText <> "") OrElse (rdoEvapo.Checked AndAlso Not ucrReceiverEvap.IsEmpty AndAlso ucrNudTRPercentile.GetText <> ""))) OrElse + Not ucrChkTotalRainfall.Checked) Then bOkEnabled = True Else bOkEnabled = False End If - If Not (ucrChkTotalRainfall.Checked OrElse ucrChkNumberOfRainyDays.Checked OrElse ucrChkDrySpell.Checked OrElse ucrChkDryPeriod.Checked) Then + If Not ucrChkTotalRainfall.Checked Then bOkEnabled = False End If If Not (ucrChkAsDoy.Checked OrElse ucrChkAsDate.Checked OrElse ucrChkStatus.Checked) Then @@ -831,21 +885,43 @@ Public Class dlgStartofRains End Sub Private Sub CombinedFilter() - If ucrChkTotalRainfall.Checked Then If rdoTRAmount.Checked Then + clsTRCombineOperator.RemoveParameterByName("evap") clsCombinedList.RemoveParameterByName("tr_perc_sub") clsTRCombineOperator.RemoveParameterByName("tr_perc") + clsCombinedList.RemoveParameterByName("evap_frac") clsTRCombineOperator.AddParameter("tr_amount", ucrNudTRAmount.Value, bIncludeArgumentName:=False, iPosition:=1) - Else + ucrBase.clsRsyntax.RemoveFromBeforeCodes(clsFractionEvapFunction) + ucrBase.clsRsyntax.RemoveFromBeforeCodes(clsSumEvapFunction) + ElseIf rdoTRPercentile.Checked Then + clsTRCombineOperator.RemoveParameterByName("evap") clsTRCombineOperator.RemoveParameterByName("tr_amount") + clsCombinedList.RemoveParameterByName("evap_frac") clsCombinedList.AddParameter("tr_perc_sub", clsRFunctionParameter:=clsTRWetSpell, bIncludeArgumentName:=False) clsTRCombineOperator.AddParameter("tr_perc", strParameterValue:=strWetSpell, iPosition:=1) + ucrBase.clsRsyntax.RemoveFromBeforeCodes(clsFractionEvapFunction) + ucrBase.clsRsyntax.RemoveFromBeforeCodes(clsSumEvapFunction) + Else + clsCombinedList.RemoveParameterByName("tr_perc_sub") + clsTRCombineOperator.RemoveParameterByName("tr_perc_sub") + clsTRCombineOperator.RemoveParameterByName("tr_amount") + clsCombinedList.AddParameter("evap_frac", strSumFractionEvap, bIncludeArgumentName:=False, iPosition:=1) + clsTRCombineOperator.AddParameter("evap", strParameterValue:=strSumFractionEvap, iPosition:=1, bIncludeArgumentName:=False) + If Not ucrReceiverEvap.IsEmpty Then + clsFractionEvapFunction.AddParameter("calculated_from", "list(" & strCurrDataName & "=" & ucrReceiverEvap.GetVariableNames & ")", iPosition:=3) + Else + clsFractionEvapFunction.RemoveParameterByName("calculated_from") + End If + ucrBase.clsRsyntax.AddToBeforeCodes(clsFractionEvapFunction, iPosition:=2) + ucrBase.clsRsyntax.AddToBeforeCodes(clsSumEvapFunction, iPosition:=3) End If Else clsTRCombineOperator.RemoveParameterByName("tr_amount") clsCombinedList.RemoveParameterByName("tr_perc_sub") + clsCombinedList.RemoveParameterByName("evap_frac") clsTRCombineOperator.RemoveParameterByName("tr_perc") + clsTRCombineOperator.RemoveParameterByName("evap") End If End Sub @@ -865,9 +941,17 @@ Public Class dlgStartofRains Private Sub GroupByYearOptions() If Not ucrReceiverYear.IsEmpty Then + clsGetColumnDataTypeFunction.AddParameter("columns", ucrReceiverYear.GetVariableNames(), iPosition:=1) + clsConvertColumnTypeFunction.AddParameter("col_names", ucrReceiverYear.GetVariableNames(), iPosition:=1) + clsConvertColumnType1Function.AddParameter("col_names", ucrReceiverYear.GetVariableNames(), iPosition:=1) + clsConvertColumnType2Function.AddParameter("col_names", ucrReceiverYear.GetVariableNames(), iPosition:=1) clsGroupByYear.AddParameter("calculated_from", "list(" & strCurrDataName & "=" & ucrReceiverYear.GetVariableNames & ")", iPosition:=3) Else clsGroupByYear.RemoveParameterByName("calculated_from") + clsGetColumnDataTypeFunction.RemoveParameterByName("columns") + clsConvertColumnTypeFunction.RemoveParameterByName("col_names") + clsConvertColumnType1Function.RemoveParameterByName("col_names") + clsConvertColumnType2Function.RemoveParameterByName("col_names") End If End Sub @@ -887,8 +971,9 @@ Public Class dlgStartofRains clsCalcRainRollingSumDryPeriod.AddParameter("calculated_from", "list(" & strCurrDataName & "=" & ucrReceiverRainfall.GetVariableNames & ")", iPosition:=3) End Sub - Private Sub ucrChkTotalRainfall_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkTotalRainfall.ControlValueChanged, ucrPnlTRCalculateBy.ControlValueChanged, ucrNudTRAmount.ControlValueChanged + Private Sub ucrChkTotalRainfall_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkTotalRainfall.ControlValueChanged, ucrPnlTRCalculateBy.ControlValueChanged, ucrNudTRAmount.ControlValueChanged, ucrNudEvapo.ControlValueChanged, ucrReceiverEvap.ControlValueChanged CombinedFilter() + SetReceiver() If ucrChkTotalRainfall.Checked Then clsIsNaOperatorStartDOY.AddParameter("1", clsRFunctionParameter:=clsIsNaFirstRollSumRain, iPosition:=1) clsConditionsOrOverallOperator.AddParameter("is.na_roll_sum_rain", clsRFunctionParameter:=clsIsNaRollSumRain, iPosition:=2) @@ -906,6 +991,7 @@ Public Class dlgStartofRains DryPeriod() GroupByStationOptions() GroupByYearOptions() + CombinedFilter() End Sub Private Sub ucrReceiverDOY_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverDOY.ControlValueChanged, ucrSelectorForStartofRains.ControlValueChanged @@ -925,21 +1011,19 @@ Public Class dlgStartofRains Private Sub ucrReceiverStation_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverStation.ControlValueChanged GroupByStationOptions() + YearStationVariable() End Sub Private Sub ucrReceiverYear_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverYear.ControlValueChanged GroupByYearOptions() - End Sub - - Private Sub MaximumValuesControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrChkDryPeriod.ControlContentsChanged, ucrNudDPRainPeriod.ControlContentsChanged, ucrNudDPOverallInterval.ControlContentsChanged - If ucrChkDryPeriod.Checked Then - ucrNudDPRainPeriod.Maximum = ucrNudDPOverallInterval.Value - ucrNudDPOverallInterval.Minimum = ucrNudDPRainPeriod.Value - End If - TestOKEnabled() + YearStationVariable() End Sub Private Sub ucrSelectorForStartofRains_DataFrameChanged() Handles ucrSelectorForStartofRains.DataFrameChanged + clsGetColumnDataTypeFunction.AddParameter("data_name", Chr(34) & ucrSelectorForStartofRains.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) + clsConvertColumnTypeFunction.AddParameter("data_name", Chr(34) & ucrSelectorForStartofRains.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) + clsConvertColumnType1Function.AddParameter("data_name", Chr(34) & ucrSelectorForStartofRains.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) + clsGetlinkeddataFunction.AddParameter("data_name", Chr(34) & ucrSelectorForStartofRains.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0, bIncludeArgumentName:=False) clsDayFilterCalcFromList.ClearParameters() End Sub @@ -960,7 +1044,7 @@ Public Class dlgStartofRains Private Sub ucrChkAsDoy_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkAsDoy.ControlValueChanged If ucrChkAsDoy.Checked Then clsCombinationSubCalcList.AddParameter("sub1", clsRFunctionParameter:=clsCalcStartDOY, bIncludeArgumentName:=False, iPosition:=0) - clsListSubCalc.AddParameter("sub1", clsRFunctionParameter:=clsCalcStartDOY, bIncludeArgumentName:=False, iPosition:=1) + clsListSubCalc.AddParameter("sub1", clsRFunctionParameter:=clsCalcStartDOY, bIncludeArgumentName:=False, iPosition:=0) Else clsCombinationSubCalcList.RemoveParameterByName("sub1") clsListSubCalc.RemoveParameterByName("sub1") @@ -975,42 +1059,153 @@ Public Class dlgStartofRains Private Sub ucrChkStatus_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkStatus.ControlValueChanged If ucrChkStatus.Checked Then clsCombinationSubCalcList.AddParameter("sub3", clsRFunctionParameter:=clsCalcStatus, bIncludeArgumentName:=False, iPosition:=2) + clsListSubCalc.AddParameter("sub3", clsRFunctionParameter:=clsCalcStatus, bIncludeArgumentName:=False, iPosition:=2) Else clsCombinationSubCalcList.RemoveParameterByName("sub3") + clsListSubCalc.RemoveParameterByName("sub3") End If End Sub - Private Sub CoreControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverRainfall.ControlContentsChanged, ucrInputNewDoyColumnName.ControlContentsChanged, ucrReceiverDate.ControlContentsChanged, ucrReceiverDOY.ControlContentsChanged, ucrReceiverYear.ControlContentsChanged, ucrInputThreshold.ControlContentsChanged, ucrChkNumberOfRainyDays.ControlContentsChanged, ucrNudRDMinimumDays.ControlContentsChanged, ucrNudRDOutOfDays.ControlContentsChanged, ucrChkTotalRainfall.ControlContentsChanged, ucrNudTROverDays.ControlContentsChanged, ucrPnlTRCalculateBy.ControlContentsChanged, ucrNudTRAmount.ControlContentsChanged, ucrNudTRPercentile.ControlContentsChanged, ucrChkDrySpell.ControlContentsChanged, ucrNudDSMaximumDays.ControlContentsChanged, ucrNudDSLengthOfTime.ControlContentsChanged, ucrNudDPMaxRain.ControlContentsChanged, ucrChkAsDoy.ControlContentsChanged, ucrChkAsDate.ControlContentsChanged, ucrInputNewDateColumnName.ControlContentsChanged, ucrChkStatus.ControlContentsChanged, ucrInputNewStatusColumnName.ControlContentsChanged + Private Sub CoreControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverRainfall.ControlContentsChanged, ucrInputNewDoyColumnName.ControlContentsChanged, ucrReceiverDate.ControlContentsChanged, ucrReceiverDOY.ControlContentsChanged, ucrReceiverYear.ControlContentsChanged, ucrInputThreshold.ControlContentsChanged, ucrChkTotalRainfall.ControlContentsChanged, ucrNudTROverDays.ControlContentsChanged, ucrPnlTRCalculateBy.ControlContentsChanged, ucrNudTRAmount.ControlContentsChanged, ucrNudTRPercentile.ControlContentsChanged, ucrChkAsDoy.ControlContentsChanged, ucrChkAsDate.ControlContentsChanged, ucrInputNewDateColumnName.ControlContentsChanged, ucrChkStatus.ControlContentsChanged, ucrInputNewStatusColumnName.ControlContentsChanged, ucrNudEvapo.ControlContentsChanged, ucrReceiverEvap.ControlContentsChanged TestOKEnabled() End Sub - Private Sub ucrChkNumberOfRainyDays_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkNumberOfRainyDays.ControlValueChanged - If ucrChkNumberOfRainyDays.Checked Then - clsIsNaOperatorStartDOY.AddParameter("2", clsRFunctionParameter:=clsIsNaFirstRollSumRainDay, iPosition:=2) - clsConditionsOrOverallOperator.AddParameter("is.na_roll_sum_rain_day", clsRFunctionParameter:=clsIsNaRollSumRainDay, iPosition:=3) + Private Sub SetReceiver() + If rdoEvapo.Checked Then + ucrReceiverEvap.SetMeAsReceiver() Else - clsIsNaOperatorStartDOY.RemoveParameterByName("2") - clsConditionsOrOverallOperator.RemoveParameterByName("is.na_roll_sum_rain_day") + ucrReceiverRainfall.SetMeAsReceiver() End If End Sub - Private Sub ucrChkDrySpell_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkDrySpell.ControlValueChanged - If ucrChkDrySpell.Checked Then - clsIsNaOperatorStartDOY.AddParameter("3", clsRFunctionParameter:=clsIsNaFirstDrySpell, iPosition:=3) - clsConditionsOrOverallOperator.AddParameter("is.na_dry_spell", clsRFunctionParameter:=clsIsNaDrySpell, iPosition:=4) + Private Sub AdditionalCondition() + cmdAdditionnal.Visible = ucrChkAdditional.Checked + End Sub + + Private Sub ucrChkAdditional_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkAdditional.ControlValueChanged + AdditionalCondition() + ChangeDSValue() + End Sub + + Private Sub cmdAdditionnal_Click(sender As Object, e As EventArgs) Handles cmdAdditionnal.Click + sdgAdditionalCondition.SetRCode(clsNewCombinedList:=clsCombinedList, clsNewCalcRollSumNumberDryPeriod:=clsCalcRollSumNumberDryPeriod, clsNewCalcRainDayRollingSum:=clsCalcRainDayRollingSum, clsNewCalcDrySpellRollMax:=clsCalcDrySpellRollMax, clsNewConditionsAndOperator:=clsConditionsAndOperator, clsNewRollingSumRainDayOperator:=clsRollingSumRainDayOperator, clsNewDSCombineOperator:=clsDSCombineOperator, clsNewDPCombineOperator:=clsDPCombineOperator, clsNewSumRainDryPeriodIntervalPlusOperator:=clsSumRainDryPeriodIntervalPlusOperator, bReset:=bResetSubdialog) + sdgAdditionalCondition.ShowDialog() + bResetSubdialog = False + AdditionalCondition() + ChangeDSValue() + End Sub + + Private Sub ChangeDSValue() + If ucrChkAdditional.Checked Then + If sdgAdditionalCondition.ucrChkNumberOfRainyDays.Checked Then + clsConditionsAndOperator.AddParameter("rain_days", clsROperatorParameter:=clsRollingSumRainDayOperator, iPosition:=2, bIncludeArgumentName:=False) + clsIsNaOperatorStartDOY.AddParameter("2", clsRFunctionParameter:=clsIsNaFirstRollSumRainDay, iPosition:=2) + clsConditionsOrOverallOperator.AddParameter("is.na_roll_sum_rain_day", clsRFunctionParameter:=clsIsNaRollSumRainDay, iPosition:=3) + clsCombinedList.AddParameter("rd_sub", clsRFunctionParameter:=clsCalcRainDayRollingSum, bIncludeArgumentName:=False, iPosition:=1) + Else + clsCombinedList.RemoveParameterByName("rd_sub") + clsConditionsAndOperator.RemoveParameterByName("rain_days") + clsIsNaOperatorStartDOY.RemoveParameterByName("2") + clsConditionsOrOverallOperator.RemoveParameterByName("is.na_roll_sum_rain_day") + End If + If sdgAdditionalCondition.ucrChkDrySpell.Checked Then + clsConditionsAndOperator.AddParameter("dry_spell", clsROperatorParameter:=clsDSCombineOperator, iPosition:=3, bIncludeArgumentName:=False) + clsIsNaOperatorStartDOY.AddParameter("3", clsRFunctionParameter:=clsIsNaFirstDrySpell, iPosition:=3) + clsConditionsOrOverallOperator.AddParameter("is.na_dry_spell", clsRFunctionParameter:=clsIsNaDrySpell, iPosition:=4) + clsCombinedList.AddParameter("ds_sub", clsRFunctionParameter:=clsCalcDrySpellRollMax, iPosition:=2, bIncludeArgumentName:=False) + Else + clsConditionsAndOperator.RemoveParameterByName("dry_spell") + clsCombinedList.RemoveParameterByName("ds_sub") + clsIsNaOperatorStartDOY.RemoveParameterByName("3") + clsConditionsOrOverallOperator.RemoveParameterByName("is.na_dry_spell") + End If + If sdgAdditionalCondition.ucrChkDryPeriod.Checked Then + clsConditionsAndOperator.AddParameter("dry_period", clsROperatorParameter:=clsDPCombineOperator, iPosition:=4, bIncludeArgumentName:=False) + clsIsNaOperatorStartDOY.AddParameter("4", clsRFunctionParameter:=clsIsNaFirstDryPeriod, iPosition:=4) + clsConditionsOrOverallOperator.AddParameter("is.na_dry_period", clsRFunctionParameter:=clsIsNaDryPeriod, iPosition:=5) + clsCombinedList.AddParameter("dp_sub", clsRFunctionParameter:=clsCalcRollSumNumberDryPeriod, iPosition:=3, bIncludeArgumentName:=False) + Else + clsConditionsAndOperator.RemoveParameterByName("dry_period") + clsCombinedList.RemoveParameterByName("dp_sub") + clsIsNaOperatorStartDOY.RemoveParameterByName("4") + clsConditionsOrOverallOperator.RemoveParameterByName("is.na_dry_period") + End If + If Not sdgAdditionalCondition.ucrNudDSMaximumDays.IsEmpty Then + clsDSCombineOperator.AddParameter("ds_max", sdgAdditionalCondition.ucrNudDSMaximumDays.GetText(), iPosition:=1) + Else + clsDSCombineOperator.RemoveParameterByName("ds_max") + End If + If Not sdgAdditionalCondition.ucrNudRDMinimumDays.IsEmpty Then + clsRollingSumRainDayOperator.AddParameter("1", sdgAdditionalCondition.ucrNudRDMinimumDays.GetText(), iPosition:=1) + Else + clsRollingSumRainDayOperator.RemoveParameterByName("1") + End If + If Not sdgAdditionalCondition.ucrNudDPMaxRain.IsEmpty Then + clsSumRainDryPeriodOperator.AddParameter("right", sdgAdditionalCondition.ucrNudDPMaxRain.GetText(), iPosition:=1) + Else + clsSumRainDryPeriodOperator.RemoveParameterByName("right") + End If + If Not sdgAdditionalCondition.ucrNudDPRainPeriod.IsEmpty Then + clsRollingSumRainDryPeriodFunction.AddParameter("n", sdgAdditionalCondition.ucrNudDPRainPeriod.GetText(), iPosition:=1) + clsSumRainDryPeriodIntervalPlusOperator.AddParameter("n", sdgAdditionalCondition.ucrNudDPRainPeriod.GetText(), iPosition:=0) + Else + clsSumRainDryPeriodIntervalPlusOperator.RemoveParameterByName("n") + clsRollingSumRainDryPeriodFunction.RemoveParameterByName("n") + End If + If Not sdgAdditionalCondition.ucrNudDPOverallInterval.IsEmpty Then + clsSumRainDryPeriodIntervalMinusOperator.AddParameter("0", sdgAdditionalCondition.ucrNudDPOverallInterval.GetText(), iPosition:=0) + Else + clsSumRainDryPeriodIntervalMinusOperator.RemoveParameterByName("0") + End If + If Not sdgAdditionalCondition.ucrNudDSLengthOfTime.IsEmpty Then + clsDrySpellPeriodRollMaxFunction.AddParameter("n", sdgAdditionalCondition.ucrNudDSLengthOfTime.GetText(), iPosition:=0) + Else + clsDrySpellPeriodRollMaxFunction.RemoveParameterByName("n") + End If + If Not sdgAdditionalCondition.ucrNudRDOutOfDays.IsEmpty Then + clsRainDayRollingSumFunction.AddParameter("n", sdgAdditionalCondition.ucrNudRDOutOfDays.GetText(), iPosition:=1) + Else + clsRainDayRollingSumFunction.RemoveParameterByName("n") + End If Else + clsCombinedList.RemoveParameterByName("rd_sub") + clsCombinedList.RemoveParameterByName("ds_sub") + clsCombinedList.RemoveParameterByName("dp_sub") + + clsIsNaOperatorStartDOY.RemoveParameterByName("4") + clsConditionsOrOverallOperator.RemoveParameterByName("is.na_dry_period") clsIsNaOperatorStartDOY.RemoveParameterByName("3") clsConditionsOrOverallOperator.RemoveParameterByName("is.na_dry_spell") + clsIsNaOperatorStartDOY.RemoveParameterByName("2") + clsConditionsOrOverallOperator.RemoveParameterByName("is.na_roll_sum_rain_day") + + clsConditionsAndOperator.RemoveParameterByName("dry_period") + clsConditionsAndOperator.RemoveParameterByName("dry_spell") + clsConditionsAndOperator.RemoveParameterByName("rain_days") + + clsRainDayRollingSumFunction.RemoveParameterByName("n") + clsDrySpellPeriodRollMaxFunction.RemoveParameterByName("n") + clsSumRainDryPeriodOperator.RemoveParameterByName("right") + clsDSCombineOperator.RemoveParameterByName("ds_max") + clsRollingSumRainDayOperator.RemoveParameterByName("1") + clsSumRainDryPeriodIntervalPlusOperator.RemoveParameterByName("n") + clsRollingSumRainDryPeriodFunction.RemoveParameterByName("n") + clsSumRainDryPeriodIntervalMinusOperator.RemoveParameterByName("0") End If End Sub - Private Sub ucrChkDryPeriod_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkDryPeriod.ControlValueChanged - If ucrChkDryPeriod.Checked Then - clsIsNaOperatorStartDOY.AddParameter("4", clsRFunctionParameter:=clsIsNaFirstDryPeriod, iPosition:=4) - clsConditionsOrOverallOperator.AddParameter("is.na_dry_period", clsRFunctionParameter:=clsIsNaDryPeriod, iPosition:=5) + Private Sub YearStationVariable() + If Not ucrReceiverYear.IsEmpty Then + clsVectorFunction.AddParameter("x", ucrReceiverYear.GetVariableNames(), iPosition:=0, bIncludeArgumentName:=False) + If Not ucrReceiverStation.IsEmpty Then + clsVectorFunction.AddParameter("y", ucrReceiverStation.GetVariableNames(), iPosition:=1, bIncludeArgumentName:=False) + Else + clsVectorFunction.RemoveParameterByName("y") + End If + clsGetlinkeddataFunction.AddParameter("link_cols", clsRFunctionParameter:=clsVectorFunction, iPosition:=1) Else - clsIsNaOperatorStartDOY.RemoveParameterByName("4") - clsConditionsOrOverallOperator.RemoveParameterByName("is.na_dry_period") + clsGetlinkeddataFunction.RemoveParameterByName("link_cols") + clsVectorFunction.RemoveParameterByName("x") End If End Sub End Class diff --git a/instat/dlgSummaryTables.Designer.vb b/instat/dlgSummaryTables.Designer.vb index 2fc3646bcd2..cc8ebfa2823 100644 --- a/instat/dlgSummaryTables.Designer.vb +++ b/instat/dlgSummaryTables.Designer.vb @@ -278,6 +278,7 @@ Partial Class dlgSummaryTables Me.cmdFormatTable.TabIndex = 19 Me.cmdFormatTable.Text = "Format Table..." Me.cmdFormatTable.UseVisualStyleBackColor = True + Me.cmdFormatTable.Visible = False ' 'rdoFrequencyTable ' diff --git a/instat/dlgSummaryTables.resx b/instat/dlgSummaryTables.resx index c776d802beb..c838926ad7f 100644 --- a/instat/dlgSummaryTables.resx +++ b/instat/dlgSummaryTables.resx @@ -123,7 +123,4 @@ 17, 17 - - 17, 17 - \ No newline at end of file diff --git a/instat/dlgSummaryTables.vb b/instat/dlgSummaryTables.vb index bd7aba23fa4..f69bfc8f878 100644 --- a/instat/dlgSummaryTables.vb +++ b/instat/dlgSummaryTables.vb @@ -22,18 +22,14 @@ Public Class dlgSummaryTables Private clsSummariesList As New RFunction Private bResetSubdialog As Boolean = False Private bResetFormatSubdialog As Boolean = False - Private clsSummaryDefaultFunction, clsFrequencyDefaultFunction, clsConcFunction As New RFunction + Private clsSummaryDefaultFunction, clsFrequencyDefaultFunction As New RFunction Private bRCodeSet As Boolean = True - Private clsStubHeadFunction, clsPivotWiderFunction As New RFunction + Private clsPivotWiderFunction As New RFunction Private iUcrBaseXLocation, iDialogueXsize As Integer - Private clsTableTitleFunction, clsTabFootnoteTitleFunction, clsTableSourcenoteFunction, clsFootnoteTitleLocationFunction, clsFootnoteSubtitleLocationFunction, - clsTabFootnoteSubtitleFunction, clsFootnoteCellFunction, clsFootnoteCellBodyFunction, - clsSecondFootnoteCellFunction, clsSecondFootnoteCellBodyFunction, clsTabStyleFunction, clsDummyFunction, - clsTabStyleCellTextFunction, clsTabStylePxFunction, clsTabStyleCellTitleFunction, clsThemesTabOptionsFunction, - clsgtExtraThemesFunction, clsGtFunction As New RFunction + Private clsDummyFunction As New RFunction - Private clsSummaryOperator, clsFrequencyOperator, clsPipeOperator, clsJoiningPipeOperator As New ROperator + Private clsSummaryOperator, clsFrequencyOperator, clsJoiningPipeOperator As New ROperator Private Sub dlgNewSummaryTables_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstload Then @@ -192,31 +188,13 @@ Public Class dlgSummaryTables clsSummaryDefaultFunction = New RFunction clsFrequencyDefaultFunction = New RFunction clsSummariesList = New RFunction - clsConcFunction = New RFunction - clsTableTitleFunction = New RFunction - clsTabFootnoteTitleFunction = New RFunction - clsTableSourcenoteFunction = New RFunction - clsFootnoteTitleLocationFunction = New RFunction - clsFootnoteSubtitleLocationFunction = New RFunction - clsSummaryOperator = New ROperator - clsPipeOperator = New ROperator - clsTabFootnoteSubtitleFunction = New RFunction - clsFootnoteCellBodyFunction = New RFunction - clsSecondFootnoteCellBodyFunction = New RFunction - clsFootnoteCellFunction = New RFunction - clsSecondFootnoteCellFunction = New RFunction - clsTabStyleFunction = New RFunction - clsTabStyleCellTextFunction = New RFunction - clsTabStylePxFunction = New RFunction - clsTabStyleCellTitleFunction = New RFunction - clsJoiningPipeOperator = New ROperator - clsFrequencyOperator = New ROperator clsDummyFunction = New RFunction - clsThemesTabOptionsFunction = New RFunction - clsgtExtraThemesFunction = New RFunction - clsGtFunction = New RFunction clsPivotWiderFunction = New RFunction + clsJoiningPipeOperator = New ROperator + clsSummaryOperator = New ROperator + clsFrequencyOperator = New ROperator + ucrReceiverFactors.SetMeAsReceiver() ucrSelectorSummaryTables.Reset() ucrSaveTable.Reset() @@ -227,55 +205,9 @@ Public Class dlgSummaryTables clsDummyFunction.AddParameter("rdo_checked", "rdoFrequency", iPosition:=1) clsDummyFunction.AddParameter("factor_cols", "FactorVar", iPosition:=2) - clsSummaryOperator.SetOperation("%>%") - clsSummaryOperator.bBrackets = False - - clsConcFunction.SetRCommand("c") - - clsPipeOperator.SetOperation("%>%") - clsPipeOperator.bBrackets = False - - clsJoiningPipeOperator.SetOperation("%>%") - clsJoiningPipeOperator.AddParameter("mutable", clsROperatorParameter:=clsSummaryOperator, iPosition:=0) - - clsThemesTabOptionsFunction.SetPackageName("gt") - clsThemesTabOptionsFunction.SetRCommand("tab_options") - - clsgtExtraThemesFunction.SetPackageName("gtExtras") - clsGtFunction.SetPackageName("gt") - clsGtFunction.SetRCommand("gt") - - clsStubHeadFunction.SetPackageName("gt") - clsStubHeadFunction.SetRCommand("tab_stubhead") - - clsTabStyleFunction.SetRCommand("tab_style") - clsTabStyleFunction.SetPackageName("gt") - clsTabStyleFunction.AddParameter("style", clsRFunctionParameter:=clsTabStyleCellTextFunction, iPosition:=0) - clsTabStyleFunction.AddParameter("location", clsRFunctionParameter:=clsTabStyleCellTitleFunction, iPosition:=1) - - clsTabStyleCellTitleFunction.SetPackageName("gt") - clsTabStyleCellTitleFunction.SetRCommand("cells_title") - clsTabStyleCellTitleFunction.AddParameter("groups", Chr(34) & "title" & Chr(34), iPosition:=0) - - clsTabStyleCellTextFunction.SetPackageName("gt") - clsTabStyleCellTextFunction.SetRCommand("cell_text") - clsTabStyleCellTextFunction.AddParameter("size", clsRFunctionParameter:=clsTabStylePxFunction, iPosition:=0) - - clsTabStylePxFunction.SetPackageName("gt") - clsTabStylePxFunction.SetRCommand("px") - clsTabStylePxFunction.AddParameter("size", "18", bIncludeArgumentName:=False, iPosition:=0) - clsPivotWiderFunction.SetRCommand("pivot_wider") clsPivotWiderFunction.AddParameter("values_from", "value", iPosition:=1) - clsSummaryOperator.AddParameter("tableFun", clsRFunctionParameter:=clsSummaryDefaultFunction, iPosition:=0) - clsSummaryOperator.AddParameter("gttbl", clsRFunctionParameter:=clsGtFunction, iPosition:=2) - - clsFrequencyOperator.SetOperation("%>%") - clsFrequencyOperator.bBrackets = False - clsFrequencyOperator.AddParameter("tableFun", clsRFunctionParameter:=clsFrequencyDefaultFunction, iPosition:=0) - clsFrequencyOperator.AddParameter("gttbl", clsRFunctionParameter:=clsGtFunction, iPosition:=2) - clsSummariesList.SetRCommand("c") clsSummariesList.AddParameter("summary_mean", Chr(34) & "summary_mean" & Chr(34), bIncludeArgumentName:=False) ' TODO decide which default(s) to use? @@ -290,35 +222,24 @@ Public Class dlgSummaryTables clsFrequencyDefaultFunction.AddParameter("summaries", "count_label", iPosition:=11) clsFrequencyDefaultFunction.SetAssignToObject("frequency_table") - clsTableTitleFunction.SetPackageName("gt") - clsTableTitleFunction.SetRCommand("tab_header") - - clsTabFootnoteTitleFunction.SetPackageName("gt") - clsTabFootnoteTitleFunction.SetRCommand("tab_footnote") - - clsTabFootnoteSubtitleFunction.SetPackageName("gt") - clsTabFootnoteSubtitleFunction.SetRCommand("tab_footnote") - clsFootnoteCellFunction.SetPackageName("gt") - clsFootnoteCellFunction.SetRCommand("tab_footnote") - - clsSecondFootnoteCellFunction.SetPackageName("gt") - clsSecondFootnoteCellFunction.SetRCommand("tab_footnote") - - clsFootnoteTitleLocationFunction.SetPackageName("gt") - clsFootnoteTitleLocationFunction.SetRCommand("cells_title") - - clsFootnoteSubtitleLocationFunction.SetPackageName("gt") - clsFootnoteSubtitleLocationFunction.SetRCommand("cells_title") + ' Gt function + Dim clsGtFunction As New RFunction + clsGtFunction.SetPackageName("gt") + clsGtFunction.SetRCommand("gt") - clsTableSourcenoteFunction.SetPackageName("gt") - clsTableSourcenoteFunction.SetRCommand("tab_source_note") + clsSummaryOperator.SetOperation("%>%") + clsSummaryOperator.bBrackets = False + clsSummaryOperator.AddParameter("tableFun", clsRFunctionParameter:=clsSummaryDefaultFunction, iPosition:=0) + clsSummaryOperator.AddParameter("gt", clsRFunctionParameter:=clsGtFunction.Clone, iPosition:=2) - clsFootnoteCellBodyFunction.SetPackageName("gt") - clsFootnoteCellBodyFunction.SetRCommand("cells_body") + clsFrequencyOperator.SetOperation("%>%") + clsFrequencyOperator.bBrackets = False + clsFrequencyOperator.AddParameter("tableFun", clsRFunctionParameter:=clsFrequencyDefaultFunction, iPosition:=0) + clsFrequencyOperator.AddParameter("gt", clsRFunctionParameter:=clsGtFunction.Clone, iPosition:=2) - clsSecondFootnoteCellBodyFunction.SetPackageName("gt") - clsSecondFootnoteCellBodyFunction.SetRCommand("cells_body") + clsJoiningPipeOperator.SetOperation("%>%") + clsJoiningPipeOperator.AddParameter("mutable", clsROperatorParameter:=clsSummaryOperator, iPosition:=0) ucrBase.clsRsyntax.SetBaseROperator(clsJoiningPipeOperator) clsJoiningPipeOperator.SetAssignToOutputObject(strRObjectToAssignTo:="last_table", @@ -386,6 +307,8 @@ Public Class dlgSummaryTables End Sub Private Sub cmdSummaries_Click(sender As Object, e As EventArgs) Handles cmdSummaries.Click + Dim clsConcFunction As New RFunction + clsConcFunction.SetRCommand("c") sdgSummaries.SetRFunction(clsSummariesList, clsSummaryDefaultFunction, clsConcFunction, ucrSelectorSummaryTables, bResetSubdialog) bResetSubdialog = False sdgSummaries.bEnable2VariableTab = False @@ -396,26 +319,19 @@ Public Class dlgSummaryTables End Sub Private Sub cmdFormatTable_Click(sender As Object, e As EventArgs) Handles cmdFormatTable.Click - If rdoSummaryTable.Checked Then - sdgFormatSummaryTables.SetRCode(clsNewTableTitleFunction:=clsTableTitleFunction, clsNewTabFootnoteTitleFunction:=clsTabFootnoteTitleFunction, clsNewTableSourcenoteFunction:=clsTableSourcenoteFunction, clsNewDummyFunction:=clsDummyFunction, - clsNewFootnoteCellFunction:=clsFootnoteCellFunction, clsNewSecondFootnoteCellBodyFunction:=clsSecondFootnoteCellBodyFunction, - clsNewPipeOperator:=clsPipeOperator, clsNewFootnoteTitleLocationFunction:=clsFootnoteTitleLocationFunction, clsNewFootnoteCellBodyFunction:=clsFootnoteCellBodyFunction, - clsNewFootnoteSubtitleLocationFunction:=clsFootnoteSubtitleLocationFunction, clsNewTabFootnoteSubtitleFunction:=clsTabFootnoteSubtitleFunction, clsNewJoiningOperator:=clsJoiningPipeOperator, - clsNewMutableOperator:=clsSummaryOperator, clsNewSecondFootnoteCellFunction:=clsSecondFootnoteCellFunction, - clsNewTabStyleCellTextFunction:=clsTabStyleCellTextFunction, clsNewTabStyleFunction:=clsTabStyleFunction, clsNewTabStylePxFunction:=clsTabStylePxFunction, clsNewThemesTabOptionFunction:=clsThemesTabOptionsFunction, - clsNewgtExtraThemesFunction:=clsgtExtraThemesFunction, bReset:=bResetFormatSubdialog) + + Dim clsROperator As ROperator + If rdoFrequencyTable.Checked Then + clsROperator = clsFrequencyOperator + ElseIf rdoSummaryTable.Checked Then + clsROperator = clsSummaryOperator Else - sdgFormatSummaryTables.SetRCode(clsNewTableTitleFunction:=clsTableTitleFunction, clsNewTabFootnoteTitleFunction:=clsTabFootnoteTitleFunction, clsNewTableSourcenoteFunction:=clsTableSourcenoteFunction, clsNewDummyFunction:=clsDummyFunction, - clsNewFootnoteCellFunction:=clsFootnoteCellFunction, clsNewSecondFootnoteCellBodyFunction:=clsSecondFootnoteCellBodyFunction, - clsNewPipeOperator:=clsPipeOperator, clsNewFootnoteTitleLocationFunction:=clsFootnoteTitleLocationFunction, clsNewFootnoteCellBodyFunction:=clsFootnoteCellBodyFunction, - clsNewFootnoteSubtitleLocationFunction:=clsFootnoteSubtitleLocationFunction, clsNewTabFootnoteSubtitleFunction:=clsTabFootnoteSubtitleFunction, clsNewJoiningOperator:=clsJoiningPipeOperator, - clsNewMutableOperator:=clsFrequencyOperator, clsNewSecondFootnoteCellFunction:=clsSecondFootnoteCellFunction, - clsNewTabStyleCellTextFunction:=clsTabStyleCellTextFunction, clsNewTabStyleFunction:=clsTabStyleFunction, clsNewTabStylePxFunction:=clsTabStylePxFunction, clsNewThemesTabOptionFunction:=clsThemesTabOptionsFunction, - clsNewgtExtraThemesFunction:=clsgtExtraThemesFunction, bReset:=bResetFormatSubdialog) + Exit Sub End If - sdgFormatSummaryTables.ShowDialog() - bResetFormatSubdialog = False + 'sdgTableOptions.Setup(clsROperator) + sdgTableOptions.ShowDialog(Me) + End Sub Private Sub ucrChkWeights_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkWeight.ControlValueChanged diff --git a/instat/dlgTransformClimatic.vb b/instat/dlgTransformClimatic.vb index 1b6f7c6009b..1ce2dca1340 100644 --- a/instat/dlgTransformClimatic.vb +++ b/instat/dlgTransformClimatic.vb @@ -1236,6 +1236,7 @@ Public Class dlgTransformClimatic RainDays() ReduceWaterBalance() RainfallChange() + AddCalculate() End Sub Private Sub ucrReceiverStation_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverStation.ControlValueChanged diff --git a/instat/frmMain.Designer.vb b/instat/frmMain.Designer.vb index 18e4c4f4f17..925cc2f7010 100644 --- a/instat/frmMain.Designer.vb +++ b/instat/frmMain.Designer.vb @@ -58,13 +58,13 @@ Partial Class frmMain Me.mnuDescribeTwoThreeVariablesTwoWayFrequencies = New System.Windows.Forms.ToolStripMenuItem() Me.mnuDescribeTwoThreeVariablesThreeWayFrequencies = New System.Windows.Forms.ToolStripMenuItem() Me.mnuDescribeSpecificTablesGraphs = New System.Windows.Forms.ToolStripMenuItem() - Me.mnuDescribeGeneral = New System.Windows.Forms.ToolStripMenuItem() - Me.ToolStripSeparator38 = New System.Windows.Forms.ToolStripSeparator() Me.mnuDescribeSpecificBarPieChart = New System.Windows.Forms.ToolStripMenuItem() Me.mnuDescribeSpecificBoxplotJitterViolinPlot = New System.Windows.Forms.ToolStripMenuItem() Me.mnuDescribeSpecificHistogramDensityFrequencyPlot = New System.Windows.Forms.ToolStripMenuItem() Me.mnuDescribeSpecificPointPlot = New System.Windows.Forms.ToolStripMenuItem() Me.mnuDescribeSpecificLineSmoothPlot = New System.Windows.Forms.ToolStripMenuItem() + Me.ToolStripSeparator38 = New System.Windows.Forms.ToolStripSeparator() + Me.mnuDescribeGeneral = New System.Windows.Forms.ToolStripMenuItem() Me.ToolStripSeparator26 = New System.Windows.Forms.ToolStripSeparator() Me.mnuDescribeSpecificMapPlot = New System.Windows.Forms.ToolStripMenuItem() Me.mnuDescribeSpecificDotPlot = New System.Windows.Forms.ToolStripMenuItem() @@ -72,6 +72,8 @@ Partial Class frmMain Me.mnuDescribeSpecificCummulativeDistribution = New System.Windows.Forms.ToolStripMenuItem() Me.mnuDescribeSpecificParallelCoordinatePlot = New System.Windows.Forms.ToolStripMenuItem() Me.mnuDescribeSpecificTables = New System.Windows.Forms.ToolStripMenuItem() + Me.mnuDescribeSummaries = New System.Windows.Forms.ToolStripMenuItem() + Me.mnuDescribePresentation = New System.Windows.Forms.ToolStripMenuItem() Me.ToolStripSeparator9 = New System.Windows.Forms.ToolStripSeparator() Me.mnuDescribeMultivariate = New System.Windows.Forms.ToolStripMenuItem() Me.mnuDescribeMultivariateCorrelations = New System.Windows.Forms.ToolStripMenuItem() @@ -197,9 +199,7 @@ Partial Class frmMain Me.mnuClimaticFileImportfromClimateDataStore = New System.Windows.Forms.ToolStripMenuItem() Me.mnuClimaticFileImportandTidyNetCDF = New System.Windows.Forms.ToolStripMenuItem() Me.mnuClimaticFileImportandTidyShapefile = New System.Windows.Forms.ToolStripMenuItem() - Me.ToolStripSeparator20 = New System.Windows.Forms.ToolStripSeparator() Me.mnuClimateFileImportfromClimSoft = New System.Windows.Forms.ToolStripMenuItem() - Me.mnuClimateFileImportfromClimSoftWizard = New System.Windows.Forms.ToolStripMenuItem() Me.mnuClimaticFileImportfromCliData = New System.Windows.Forms.ToolStripMenuItem() Me.ToolStripSeparator15 = New System.Windows.Forms.ToolStripSeparator() Me.mnuClimaticFileExportToClimsoft = New System.Windows.Forms.ToolStripMenuItem() @@ -254,6 +254,7 @@ Partial Class frmMain Me.ToolStripSeparator70 = New System.Windows.Forms.ToolStripSeparator() Me.mnuClimaticCheckDataHomogenization = New System.Windows.Forms.ToolStripMenuItem() Me.mnuClimaticCheckDataCheckStationLocations = New System.Windows.Forms.ToolStripMenuItem() + Me.mnuClimaticCheckDataDistances = New System.Windows.Forms.ToolStripMenuItem() Me.mnuClimaticPrepare = New System.Windows.Forms.ToolStripMenuItem() Me.mnuCimaticPrepareTransform = New System.Windows.Forms.ToolStripMenuItem() Me.mnuClimaticPrepareConversions = New System.Windows.Forms.ToolStripMenuItem() @@ -383,6 +384,7 @@ Partial Class frmMain Me.tlSeparatorFile3 = New System.Windows.Forms.ToolStripSeparator() Me.mnuFIleExit = New System.Windows.Forms.ToolStripMenuItem() Me.mnuEdit = New System.Windows.Forms.ToolStripMenuItem() + Me.mnuUndo = New System.Windows.Forms.ToolStripMenuItem() Me.mnuEditFind = New System.Windows.Forms.ToolStripMenuItem() Me.mnuEditCopy = New System.Windows.Forms.ToolStripMenuItem() Me.mnuEditPaste = New System.Windows.Forms.ToolStripMenuItem() @@ -848,23 +850,12 @@ Partial Class frmMain ' 'mnuDescribeSpecificTablesGraphs ' - Me.mnuDescribeSpecificTablesGraphs.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuDescribeGeneral, Me.ToolStripSeparator38, Me.mnuDescribeSpecificBarPieChart, Me.mnuDescribeSpecificBoxplotJitterViolinPlot, Me.mnuDescribeSpecificHistogramDensityFrequencyPlot, Me.mnuDescribeSpecificPointPlot, Me.mnuDescribeSpecificLineSmoothPlot, Me.ToolStripSeparator26, Me.mnuDescribeSpecificMapPlot, Me.mnuDescribeSpecificDotPlot, Me.mnuDescribeSpecificMosaic, Me.mnuDescribeSpecificCummulativeDistribution, Me.mnuDescribeSpecificParallelCoordinatePlot}) + Me.mnuDescribeSpecificTablesGraphs.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuDescribeSpecificBarPieChart, Me.mnuDescribeSpecificBoxplotJitterViolinPlot, Me.mnuDescribeSpecificHistogramDensityFrequencyPlot, Me.mnuDescribeSpecificPointPlot, Me.mnuDescribeSpecificLineSmoothPlot, Me.ToolStripSeparator38, Me.mnuDescribeGeneral, Me.ToolStripSeparator26, Me.mnuDescribeSpecificMapPlot, Me.mnuDescribeSpecificDotPlot, Me.mnuDescribeSpecificMosaic, Me.mnuDescribeSpecificCummulativeDistribution, Me.mnuDescribeSpecificParallelCoordinatePlot}) Me.mnuDescribeSpecificTablesGraphs.Name = "mnuDescribeSpecificTablesGraphs" Me.mnuDescribeSpecificTablesGraphs.Size = New System.Drawing.Size(271, 34) Me.mnuDescribeSpecificTablesGraphs.Tag = "Graph_Dialogs" Me.mnuDescribeSpecificTablesGraphs.Text = "Graphs" ' - 'mnuDescribeGeneral - ' - Me.mnuDescribeGeneral.Name = "mnuDescribeGeneral" - Me.mnuDescribeGeneral.Size = New System.Drawing.Size(312, 34) - Me.mnuDescribeGeneral.Text = "General..." - ' - 'ToolStripSeparator38 - ' - Me.ToolStripSeparator38.Name = "ToolStripSeparator38" - Me.ToolStripSeparator38.Size = New System.Drawing.Size(309, 6) - ' 'mnuDescribeSpecificBarPieChart ' Me.mnuDescribeSpecificBarPieChart.Name = "mnuDescribeSpecificBarPieChart" @@ -905,6 +896,17 @@ Partial Class frmMain Me.mnuDescribeSpecificLineSmoothPlot.Text = "Line Plot..." Me.mnuDescribeSpecificLineSmoothPlot.ToolTipText = "Line Plots, Smoothed Plots, Dumbbell and Slope Plots" ' + 'ToolStripSeparator38 + ' + Me.ToolStripSeparator38.Name = "ToolStripSeparator38" + Me.ToolStripSeparator38.Size = New System.Drawing.Size(309, 6) + ' + 'mnuDescribeGeneral + ' + Me.mnuDescribeGeneral.Name = "mnuDescribeGeneral" + Me.mnuDescribeGeneral.Size = New System.Drawing.Size(312, 34) + Me.mnuDescribeGeneral.Text = "General..." + ' 'ToolStripSeparator26 ' Me.ToolStripSeparator26.Name = "ToolStripSeparator26" @@ -948,12 +950,25 @@ Partial Class frmMain ' 'mnuDescribeSpecificTables ' + Me.mnuDescribeSpecificTables.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuDescribeSummaries, Me.mnuDescribePresentation}) Me.mnuDescribeSpecificTables.Name = "mnuDescribeSpecificTables" Me.mnuDescribeSpecificTables.Size = New System.Drawing.Size(271, 34) Me.mnuDescribeSpecificTables.Tag = "Table_Dialogs" Me.mnuDescribeSpecificTables.Text = "Tables..." Me.mnuDescribeSpecificTables.ToolTipText = "Frequency tables and Summary tables" ' + 'mnuDescribeSummaries + ' + Me.mnuDescribeSummaries.Name = "mnuDescribeSummaries" + Me.mnuDescribeSummaries.Size = New System.Drawing.Size(224, 34) + Me.mnuDescribeSummaries.Text = "Summaries..." + ' + 'mnuDescribePresentation + ' + Me.mnuDescribePresentation.Name = "mnuDescribePresentation" + Me.mnuDescribePresentation.Size = New System.Drawing.Size(224, 34) + Me.mnuDescribePresentation.Text = "Presentation..." + ' 'ToolStripSeparator9 ' Me.ToolStripSeparator9.Name = "ToolStripSeparator9" @@ -1751,7 +1766,7 @@ Partial Class frmMain ' 'mnuClimaticFile ' - Me.mnuClimaticFile.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuClimaticFileImportSST, Me.mnuClimaticFileImportfromIRIDataLibrary, Me.mnuClimaticFileImportfromClimateDataStore, Me.mnuClimaticFileImportandTidyNetCDF, Me.mnuClimaticFileImportandTidyShapefile, Me.ToolStripSeparator20, Me.mnuClimateFileImportfromClimSoft, Me.mnuClimateFileImportfromClimSoftWizard, Me.mnuClimaticFileImportfromCliData, Me.ToolStripSeparator15, Me.mnuClimaticFileExportToClimsoft, Me.mnuClimaticFileExportToCPT, Me.mnuExportToWWRToolStrip, Me.mnuClimaticFileExportToClimpact, Me.mnuClimaticFileExportToGoogleBucketsToolStrip}) + Me.mnuClimaticFile.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuClimaticFileImportSST, Me.mnuClimaticFileImportfromIRIDataLibrary, Me.mnuClimaticFileImportfromClimateDataStore, Me.mnuClimaticFileImportandTidyNetCDF, Me.mnuClimaticFileImportandTidyShapefile, Me.mnuClimateFileImportfromClimSoft, Me.mnuClimaticFileImportfromCliData, Me.ToolStripSeparator15, Me.mnuClimaticFileExportToClimsoft, Me.mnuClimaticFileExportToCPT, Me.mnuExportToWWRToolStrip, Me.mnuClimaticFileExportToClimpact, Me.mnuClimaticFileExportToGoogleBucketsToolStrip}) Me.mnuClimaticFile.Name = "mnuClimaticFile" Me.mnuClimaticFile.Size = New System.Drawing.Size(325, 34) Me.mnuClimaticFile.Text = "File" @@ -1786,23 +1801,12 @@ Partial Class frmMain Me.mnuClimaticFileImportandTidyShapefile.Size = New System.Drawing.Size(426, 34) Me.mnuClimaticFileImportandTidyShapefile.Text = "Import and Tidy Shapefile..." ' - 'ToolStripSeparator20 - ' - Me.ToolStripSeparator20.Name = "ToolStripSeparator20" - Me.ToolStripSeparator20.Size = New System.Drawing.Size(423, 6) - ' 'mnuClimateFileImportfromClimSoft ' Me.mnuClimateFileImportfromClimSoft.Name = "mnuClimateFileImportfromClimSoft" Me.mnuClimateFileImportfromClimSoft.Size = New System.Drawing.Size(426, 34) Me.mnuClimateFileImportfromClimSoft.Text = "Import from Climsoft..." ' - 'mnuClimateFileImportfromClimSoftWizard - ' - Me.mnuClimateFileImportfromClimSoftWizard.Name = "mnuClimateFileImportfromClimSoftWizard" - Me.mnuClimateFileImportfromClimSoftWizard.Size = New System.Drawing.Size(426, 34) - Me.mnuClimateFileImportfromClimSoftWizard.Text = "Import from Climsoft Wizard..." - ' 'mnuClimaticFileImportfromCliData ' Me.mnuClimaticFileImportfromCliData.Enabled = False @@ -2065,7 +2069,7 @@ Partial Class frmMain ' 'mnuClimaticCheckData ' - Me.mnuClimaticCheckData.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuClimaticCheckDataInventory, Me.mnuClimaticCheckDataDisplayDaily, Me.ToolStripSeparator65, Me.mnuClimaticCheckDataFillMissingValues, Me.mnuClimaticCheckDataBoxplot, Me.mnuClimaticCheckDataQCTemperatures, Me.mnuClimaticCheckDataQCRainfall, Me.ToolStripSeparator70, Me.mnuClimaticCheckDataHomogenization, Me.mnuClimaticCheckDataCheckStationLocations}) + Me.mnuClimaticCheckData.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuClimaticCheckDataInventory, Me.mnuClimaticCheckDataDisplayDaily, Me.ToolStripSeparator65, Me.mnuClimaticCheckDataFillMissingValues, Me.mnuClimaticCheckDataBoxplot, Me.mnuClimaticCheckDataQCTemperatures, Me.mnuClimaticCheckDataQCRainfall, Me.ToolStripSeparator70, Me.mnuClimaticCheckDataHomogenization, Me.mnuClimaticCheckDataCheckStationLocations, Me.mnuClimaticCheckDataDistances}) Me.mnuClimaticCheckData.Name = "mnuClimaticCheckData" Me.mnuClimaticCheckData.Size = New System.Drawing.Size(325, 34) Me.mnuClimaticCheckData.Text = "Check Data" @@ -2128,6 +2132,12 @@ Partial Class frmMain Me.mnuClimaticCheckDataCheckStationLocations.Size = New System.Drawing.Size(313, 34) Me.mnuClimaticCheckDataCheckStationLocations.Text = "Check Station Locations..." ' + 'mnuClimaticCheckDataDistances + ' + Me.mnuClimaticCheckDataDistances.Name = "mnuClimaticCheckDataDistances" + Me.mnuClimaticCheckDataDistances.Size = New System.Drawing.Size(313, 34) + Me.mnuClimaticCheckDataDistances.Text = "Distances..." + ' 'mnuClimaticPrepare ' Me.mnuClimaticPrepare.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuCimaticPrepareTransform, Me.mnuClimaticPrepareConversions, Me.ToolStripSeparator37, Me.mnuClimaticPrepareClimaticSummaries, Me.mnuClimaticPrepareStartoftheRains, Me.mnuClimaticPrepareEndOfRains, Me.mnuClimaticPrepareLengthOfSeason, Me.mnuClimaticPrepareSpells, Me.mnuClimaticPrepareExtremes, Me.ToolStripSeparator64, Me.mnuClimaticPrepareClimdex, Me.ToolStripSeparator51, Me.mnuClimaticPrepareEvapotranspiration, Me.mnuClimaticPrepareSummary, Me.mnuClimaticPrepareNewWorksheet, Me.mnuClimaticPrepareImportDailyData, Me.mnuClimaticPrepareMakeFactor, Me.mnuClimaticPrepareShiftDailyData, Me.mnuClimaticPrepareUnstackDailyData, Me.mnuClimaticPrepareStackDailyData}) @@ -3012,17 +3022,24 @@ Partial Class frmMain ' 'mnuEdit ' - Me.mnuEdit.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuEditFind, Me.mnuEditCopy, Me.mnuEditPaste, Me.mnuEditPasteNew, Me.mnuEditWordwrap, Me.mnuEditSelectAll}) + Me.mnuEdit.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuUndo, Me.mnuEditFind, Me.mnuEditCopy, Me.mnuEditPaste, Me.mnuEditPasteNew, Me.mnuEditWordwrap, Me.mnuEditSelectAll}) Me.mnuEdit.Name = "mnuEdit" Me.mnuEdit.Size = New System.Drawing.Size(58, 29) Me.mnuEdit.Tag = "Edit" Me.mnuEdit.Text = "Edit" ' + 'mnuUndo + ' + Me.mnuUndo.Name = "mnuUndo" + Me.mnuUndo.ShortcutKeys = CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.Z), System.Windows.Forms.Keys) + Me.mnuUndo.Size = New System.Drawing.Size(270, 34) + Me.mnuUndo.Text = "Undo" + ' 'mnuEditFind ' Me.mnuEditFind.Name = "mnuEditFind" Me.mnuEditFind.ShortcutKeys = CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.F), System.Windows.Forms.Keys) - Me.mnuEditFind.Size = New System.Drawing.Size(253, 34) + Me.mnuEditFind.Size = New System.Drawing.Size(270, 34) Me.mnuEditFind.Tag = "Find" Me.mnuEditFind.Text = "Find" ' @@ -3030,7 +3047,7 @@ Partial Class frmMain ' Me.mnuEditCopy.Name = "mnuEditCopy" Me.mnuEditCopy.ShortcutKeys = CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.C), System.Windows.Forms.Keys) - Me.mnuEditCopy.Size = New System.Drawing.Size(253, 34) + Me.mnuEditCopy.Size = New System.Drawing.Size(270, 34) Me.mnuEditCopy.Tag = "Copy" Me.mnuEditCopy.Text = "Copy" ' @@ -3038,27 +3055,27 @@ Partial Class frmMain ' Me.mnuEditPaste.Name = "mnuEditPaste" Me.mnuEditPaste.ShortcutKeys = CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.V), System.Windows.Forms.Keys) - Me.mnuEditPaste.Size = New System.Drawing.Size(253, 34) + Me.mnuEditPaste.Size = New System.Drawing.Size(270, 34) Me.mnuEditPaste.Tag = "Paste" Me.mnuEditPaste.Text = "Paste" ' 'mnuEditPasteNew ' Me.mnuEditPasteNew.Name = "mnuEditPasteNew" - Me.mnuEditPasteNew.Size = New System.Drawing.Size(253, 34) + Me.mnuEditPasteNew.Size = New System.Drawing.Size(270, 34) Me.mnuEditPasteNew.Text = "Paste New" ' 'mnuEditWordwrap ' Me.mnuEditWordwrap.Name = "mnuEditWordwrap" - Me.mnuEditWordwrap.Size = New System.Drawing.Size(253, 34) + Me.mnuEditWordwrap.Size = New System.Drawing.Size(270, 34) Me.mnuEditWordwrap.Text = "Wordwrap" ' 'mnuEditSelectAll ' Me.mnuEditSelectAll.Name = "mnuEditSelectAll" Me.mnuEditSelectAll.ShortcutKeys = CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.A), System.Windows.Forms.Keys) - Me.mnuEditSelectAll.Size = New System.Drawing.Size(253, 34) + Me.mnuEditSelectAll.Size = New System.Drawing.Size(270, 34) Me.mnuEditSelectAll.Tag = "Select_All" Me.mnuEditSelectAll.Text = "Select All " ' @@ -3381,7 +3398,6 @@ Partial Class frmMain Me.mnuBar.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow Me.mnuBar.Location = New System.Drawing.Point(0, 0) Me.mnuBar.Name = "mnuBar" - Me.mnuBar.Padding = New System.Windows.Forms.Padding(6, 2, 0, 2) Me.mnuBar.RenderMode = System.Windows.Forms.ToolStripRenderMode.System Me.mnuBar.ShowItemToolTips = True Me.mnuBar.Size = New System.Drawing.Size(1251, 33) @@ -5067,7 +5083,7 @@ Partial Class frmMain Me.splOverall.BackColor = System.Drawing.Color.LightGray Me.splOverall.Dock = System.Windows.Forms.DockStyle.Fill Me.splOverall.Location = New System.Drawing.Point(0, 72) - Me.splOverall.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.splOverall.Margin = New System.Windows.Forms.Padding(4) Me.splOverall.Name = "splOverall" Me.splOverall.Orientation = System.Windows.Forms.Orientation.Horizontal ' @@ -5081,7 +5097,7 @@ Partial Class frmMain Me.splOverall.Panel2.BackColor = System.Drawing.SystemColors.Control Me.splOverall.Panel2.Controls.Add(Me.splDataOutput) Me.splOverall.Size = New System.Drawing.Size(1251, 619) - Me.splOverall.SplitterDistance = 251 + Me.splOverall.SplitterDistance = 248 Me.splOverall.SplitterWidth = 8 Me.splOverall.TabIndex = 10 ' @@ -5090,7 +5106,7 @@ Partial Class frmMain Me.splExtraWindows.BackColor = System.Drawing.Color.LightGray Me.splExtraWindows.Dock = System.Windows.Forms.DockStyle.Fill Me.splExtraWindows.Location = New System.Drawing.Point(0, 0) - Me.splExtraWindows.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.splExtraWindows.Margin = New System.Windows.Forms.Padding(4) Me.splExtraWindows.Name = "splExtraWindows" ' 'splExtraWindows.Panel1 @@ -5102,7 +5118,7 @@ Partial Class frmMain ' Me.splExtraWindows.Panel2.BackColor = System.Drawing.SystemColors.Control Me.splExtraWindows.Panel2.Controls.Add(Me.ucrScriptWindow) - Me.splExtraWindows.Size = New System.Drawing.Size(1251, 251) + Me.splExtraWindows.Size = New System.Drawing.Size(1251, 248) Me.splExtraWindows.SplitterDistance = 378 Me.splExtraWindows.SplitterWidth = 8 Me.splExtraWindows.TabIndex = 0 @@ -5112,7 +5128,7 @@ Partial Class frmMain Me.splMetadata.BackColor = System.Drawing.Color.LightGray Me.splMetadata.Dock = System.Windows.Forms.DockStyle.Fill Me.splMetadata.Location = New System.Drawing.Point(0, 0) - Me.splMetadata.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.splMetadata.Margin = New System.Windows.Forms.Padding(4) Me.splMetadata.Name = "splMetadata" ' 'splMetadata.Panel1 @@ -5123,7 +5139,7 @@ Partial Class frmMain ' Me.splMetadata.Panel2.BackColor = System.Drawing.SystemColors.Control Me.splMetadata.Panel2.Controls.Add(Me.ucrDataFrameMeta) - Me.splMetadata.Size = New System.Drawing.Size(378, 251) + Me.splMetadata.Size = New System.Drawing.Size(378, 248) Me.splMetadata.SplitterDistance = 102 Me.splMetadata.SplitterWidth = 8 Me.splMetadata.TabIndex = 0 @@ -5137,7 +5153,7 @@ Partial Class frmMain Me.ucrColumnMeta.Location = New System.Drawing.Point(0, 0) Me.ucrColumnMeta.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) Me.ucrColumnMeta.Name = "ucrColumnMeta" - Me.ucrColumnMeta.Size = New System.Drawing.Size(102, 251) + Me.ucrColumnMeta.Size = New System.Drawing.Size(102, 248) Me.ucrColumnMeta.TabIndex = 0 ' 'ucrDataFrameMeta @@ -5148,7 +5164,7 @@ Partial Class frmMain Me.ucrDataFrameMeta.Location = New System.Drawing.Point(0, 0) Me.ucrDataFrameMeta.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) Me.ucrDataFrameMeta.Name = "ucrDataFrameMeta" - Me.ucrDataFrameMeta.Size = New System.Drawing.Size(268, 251) + Me.ucrDataFrameMeta.Size = New System.Drawing.Size(268, 248) Me.ucrDataFrameMeta.TabIndex = 0 ' 'ucrScriptWindow @@ -5159,7 +5175,7 @@ Partial Class frmMain Me.ucrScriptWindow.Location = New System.Drawing.Point(0, 0) Me.ucrScriptWindow.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) Me.ucrScriptWindow.Name = "ucrScriptWindow" - Me.ucrScriptWindow.Size = New System.Drawing.Size(865, 251) + Me.ucrScriptWindow.Size = New System.Drawing.Size(865, 248) Me.ucrScriptWindow.strActiveTabText = "" Me.ucrScriptWindow.TabIndex = 2 Me.ucrScriptWindow.Tag = "Script_Window" @@ -5169,7 +5185,7 @@ Partial Class frmMain Me.splDataOutput.BackColor = System.Drawing.Color.LightGray Me.splDataOutput.Dock = System.Windows.Forms.DockStyle.Fill Me.splDataOutput.Location = New System.Drawing.Point(0, 0) - Me.splDataOutput.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.splDataOutput.Margin = New System.Windows.Forms.Padding(4) Me.splDataOutput.Name = "splDataOutput" ' 'splDataOutput.Panel1 @@ -5181,7 +5197,7 @@ Partial Class frmMain ' Me.splDataOutput.Panel2.BackColor = System.Drawing.SystemColors.Control Me.splDataOutput.Panel2.Controls.Add(Me.ucrOutput) - Me.splDataOutput.Size = New System.Drawing.Size(1251, 360) + Me.splDataOutput.Size = New System.Drawing.Size(1251, 363) Me.splDataOutput.SplitterDistance = 573 Me.splDataOutput.SplitterWidth = 8 Me.splDataOutput.TabIndex = 0 @@ -5195,7 +5211,7 @@ Partial Class frmMain Me.ucrDataViewer.Location = New System.Drawing.Point(0, 0) Me.ucrDataViewer.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) Me.ucrDataViewer.Name = "ucrDataViewer" - Me.ucrDataViewer.Size = New System.Drawing.Size(573, 360) + Me.ucrDataViewer.Size = New System.Drawing.Size(573, 363) Me.ucrDataViewer.TabIndex = 0 Me.ucrDataViewer.Tag = "Data_View" ' @@ -5207,7 +5223,7 @@ Partial Class frmMain Me.ucrOutput.Location = New System.Drawing.Point(0, 0) Me.ucrOutput.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) Me.ucrOutput.Name = "ucrOutput" - Me.ucrOutput.Size = New System.Drawing.Size(670, 360) + Me.ucrOutput.Size = New System.Drawing.Size(670, 363) Me.ucrOutput.TabIndex = 0 ' 'mnuPlotly @@ -5257,11 +5273,9 @@ Partial Class frmMain Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) Me.IsMdiContainer = True Me.MainMenuStrip = Me.mnuBar - Me.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.Margin = New System.Windows.Forms.Padding(4) Me.Name = "frmMain" - Me.Text = "R-Instat " + My.Application.Info.Version.Major.ToString + "." + - My.Application.Info.Version.Minor.ToString + "." + - My.Application.Info.Version.Build.ToString + Me.Text = "R-Instat .." Me.WindowState = System.Windows.Forms.FormWindowState.Maximized Me.stsStrip.ResumeLayout(False) Me.stsStrip.PerformLayout() @@ -5587,7 +5601,6 @@ Partial Class frmMain Friend WithEvents mnuPrepareKeysAndLinksAddComment As ToolStripMenuItem Friend WithEvents mnuClimaticModelsExtremes As ToolStripMenuItem Friend WithEvents mnuClimaticModelCircular As ToolStripMenuItem - Friend WithEvents ToolStripSeparator15 As ToolStripSeparator Friend WithEvents mnuClimaticPrepareClimaticSummaries As ToolStripMenuItem Friend WithEvents mnuClimaticCheckDataInventory As ToolStripMenuItem Friend WithEvents mnuClimaticCheckDataDisplayDaily As ToolStripMenuItem @@ -5828,8 +5841,6 @@ Partial Class frmMain Friend WithEvents ToolStripSeparator67 As ToolStripSeparator Friend WithEvents ToolStripSeparator68 As ToolStripSeparator Friend WithEvents mnuStructuredCircularCirclize As ToolStripMenuItem - Friend WithEvents ToolStripSeparator20 As ToolStripSeparator - Friend WithEvents mnuClimateFileImportfromClimSoftWizard As ToolStripMenuItem Friend WithEvents mnuExportToWWRToolStrip As ToolStripMenuItem Friend WithEvents mnuViewStructuredMenu As ToolStripMenuItem Friend WithEvents mnuClimaticNCMP As ToolStripMenuItem @@ -5950,6 +5961,10 @@ Partial Class frmMain Friend WithEvents mnuClimaticFileExportToGoogleBucketsToolStrip As ToolStripMenuItem Friend WithEvents ToolStripSeparator79 As ToolStripSeparator + + Friend WithEvents mnuDescribeSummaries As ToolStripMenuItem + Friend WithEvents mnuDescribePresentation As ToolStripMenuItem + Friend WithEvents MenusAndDialogsToolStripMenuItem As ToolStripMenuItem Friend WithEvents FileToolStripMenuItem As ToolStripMenuItem Friend WithEvents EditToolStripMenuItem As ToolStripMenuItem @@ -5969,4 +5984,7 @@ Partial Class frmMain Friend WithEvents mnuSwapDataMetadata As ToolStripMenuItem Friend WithEvents RInstatResourcesSiteToolStripMenuItem As ToolStripMenuItem Friend WithEvents mnuImportFromOpenAppBuilder As ToolStripMenuItem + Friend WithEvents ToolStripSeparator15 As ToolStripSeparator + Friend WithEvents mnuClimaticCheckDataDistances As ToolStripMenuItem + Friend WithEvents mnuUndo As ToolStripMenuItem End Class diff --git a/instat/frmMain.vb b/instat/frmMain.vb index c89ed417c92..de20ca54564 100644 --- a/instat/frmMain.vb +++ b/instat/frmMain.vb @@ -222,6 +222,10 @@ Public Class frmMain AddHandler System.Windows.Forms.Application.Idle, AddressOf Application_Idle '--------------------------------------- + '-------------------------------------- + CreateAdditionalLibraryDirectory() + '------------------------------------- + SetAppVersionNumber() isMaximised = True 'Need to get the windowstate when the application is loaded End Sub @@ -393,6 +397,35 @@ Public Class frmMain End If End Function + Private Sub CreateAdditionalLibraryDirectory() + ' Define the custom library path in the ApplicationData folder + Dim strLibraryPath As String = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "R-Instat", "library") + + Try + ' Check if the directory exists, if not, create it + If Not Directory.Exists(strLibraryPath) Then + Directory.CreateDirectory(strLibraryPath) + End If + + 'To ensure this part of the code only runs when the application Is Not in the Debug mode (i.e., in Release mode) +#If Not DEBUG Then + ' Add the custom library path to R's .libPaths for user-level package installation + Dim strScript As String = $".libPaths(c('{strLibraryPath.Replace("\", "/")}', .libPaths()))" & Environment.NewLine & + "if (length(.libPaths()) > 2) { + current_paths <- .libPaths() + valid_indices <- c(1, 3)[c(1, 3) <= length(current_paths)] + .libPaths(current_paths[valid_indices]) + }" + + ' Execute the R script to update the library paths + clsRLink.RunScript(strScript:=strScript, bSeparateThread:=False, bSilent:=False) +#End If + Catch ex As Exception + ' Handle potential errors (e.g., directory creation failure) + MessageBox.Show($"Failed to create or update library directory: {ex.Message}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) + End Try + End Sub + Private Sub ExecuteSetupRScriptsAndSetupRLinkAndDatabook() Dim strRScripts As String = "" Dim strDataFilePath As String = "" @@ -464,24 +497,26 @@ Public Class frmMain Dim lastExitStatus As String = File.ReadAllText(strMarkerFilePath).Trim() If lastExitStatus <> "CleanExit" AndAlso MsgBox("We have detected that R-Instat may have closed unexpectedly last time." & Environment.NewLine & - "Would you like to see auto recovery options?", + "The Tools > Restore Backup dialog allows you to restore backed-up data, or save the corresponding log file." & Environment.NewLine & + "To proceed, click Yes.", MessageBoxButtons.YesNo, "Auto Recovery") = MsgBoxResult.Yes Then - dlgAutoSaveRecovery.strAutoSavedLogFilePaths = strAutoSavedLogFilePaths - dlgAutoSaveRecovery.strAutoSavedDataFilePaths = strAutoSavedDataFilePaths - dlgAutoSaveRecovery.strAutoSavedInternalLogFilePaths = strAutoSavedInternalLogFilePaths - dlgAutoSaveRecovery.ShowDialog() + dlgRestoreBackup.ShowDialog() 'todo. the dialog design is meant to only return just one option; script, data file path or new session. 'refactor the dialog to enforce the design 'get the R script from read file if selected by the user - strScript = dlgAutoSaveRecovery.GetScript() + strScript = dlgRestoreBackup.GetScript() 'get the data file path if selected by the user - strDataFilePath = dlgAutoSaveRecovery.GetDataFilePath() + strDataFilePath = dlgRestoreBackup.GetDataFilePath() End If End If + If Not Directory.Exists(strAutoSaveLogFolderPath) Then + Directory.CreateDirectory(strAutoSaveLogFolderPath) + End If + Using writer As StreamWriter = New StreamWriter(strMarkerFilePath, False) writer.WriteLine("Running") End Using @@ -554,6 +589,12 @@ Public Class frmMain mnuTbLan.Visible = bVisible End Sub + Public Sub SetAppVersionNumber() + Me.Text = "R-Instat " & My.Application.Info.Version.Major.ToString() & "." & + My.Application.Info.Version.Minor.ToString() & "." & + My.Application.Info.Version.Build.ToString() + End Sub + Private Sub SetMainMenusEnabled(bEnabled As Boolean) mnuFile.Enabled = bEnabled mnuEdit.Enabled = bEnabled @@ -644,6 +685,10 @@ Public Class frmMain End If End Sub + Public Sub DisableEnableUndo(bDisable As Boolean) + ucrDataViewer.DisableEnableUndo(bDisable) + End Sub + Private Sub mnuFileNewDataFrame_Click(sender As Object, e As EventArgs) Handles mnuFileNewDataFrame.Click dlgNewDataFrame.ShowDialog() End Sub @@ -653,10 +698,6 @@ Public Class frmMain dlgRegularSequence.ShowDialog() End Sub - Private Sub mnuDescribeSpecificTables_Click(sender As Object, e As EventArgs) Handles mnuDescribeSpecificTables.Click - dlgSummaryTables.ShowDialog() - End Sub - Private Sub mnuPrepareReshapeStack_Click(sender As Object, e As EventArgs) Handles mnuPrepareColumnReshapeStack.Click dlgStack.enumStackMode = dlgStack.StackMode.Prepare dlgStack.ShowDialog() @@ -1414,10 +1455,6 @@ Public Class frmMain dlgClimSoft.ShowDialog() End Sub - Private Sub mnuClimateFileImportfromClimSoftWizard_Click(sender As Object, e As EventArgs) Handles mnuClimateFileImportfromClimSoftWizard.Click - dlgClimsoftWizard.ShowDialog() - End Sub - Private Sub mnuClimaticFileImportFromCliData_Click(sender As Object, e As EventArgs) Handles mnuClimaticFileImportfromCliData.Click dlgCliData.ShowDialog() End Sub @@ -2782,6 +2819,13 @@ Public Class frmMain dlgExportClimaticDefinitions.ShowDialog() End Sub + Private Sub mnuDescribeSummaries_Click(sender As Object, e As EventArgs) Handles mnuDescribeSummaries.Click + dlgSummaryTables.ShowDialog() + End Sub + + Private Sub mnuDescribePresentation_Click(sender As Object, e As EventArgs) Handles mnuDescribePresentation.Click + dlgGeneralTable.ShowDialog() + End Sub Private Sub FileToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles FileToolStripMenuItem.Click Help.ShowHelp(Me, strStaticPath & "\" & strHelpFilePath, HelpNavigator.TopicId, "13") End Sub @@ -2851,4 +2895,11 @@ Public Class frmMain Private Sub mnuImportFromOpenAppBuilder_Click(sender As Object, e As EventArgs) Handles mnuImportFromOpenAppBuilder.Click dlgImportOpenAppBuilder.ShowDialog() End Sub + Private Sub mnuClimaticCheckDataDistances_Click(sender As Object, e As EventArgs) Handles mnuClimaticCheckDataDistances.Click + dlgDistances.ShowDialog() + End Sub + + Private Sub mnuUndo_Click(sender As Object, e As EventArgs) Handles mnuUndo.Click + ucrDataViewer.Undo() + End Sub End Class diff --git a/instat/instat.vbproj b/instat/instat.vbproj index 1b2d4bf4295..8f72bfeb211 100644 --- a/instat/instat.vbproj +++ b/instat/instat.vbproj @@ -239,6 +239,12 @@ Form + + dlgDistances.vb + + + Form + dlgEdit.vb @@ -319,6 +325,12 @@ + + sdgAdditionalCondition.vb + + + Form + sdgClimsoft.vb @@ -379,6 +391,97 @@ Form + + ucrCellsFootNotes.vb + + + UserControl + + + sdgCellFormatDateOptions.vb + + + Form + + + sdgCellFormatNumberOptions.vb + + + Form + + + sdgCellFormatTextOptions.vb + + + Form + + + ucrCellFormatEmail.vb + + + UserControl + + + ucrCellFormats.vb + + + UserControl + + + ucrCellStyles.vb + + + UserControl + + + + ucrColumnFootNote.vb + + + UserControl + + + ucrColumnNanoPlots.vb + + + UserControl + + + ucrColumnStyles.vb + + + UserControl + + + ucrColumnWidth.vb + + + UserControl + + + dlgGeneralTable.vb + + + Form + + + ucrOtherStyles.vb + + + UserControl + + + ucrRowExpression.vb + + + UserControl + + + sdgTableOptions.vb + + + Form + frmMaximiseOutput.vb @@ -3049,6 +3152,90 @@ UserControl + + ucrCells.vb + + + UserControl + + + ucrColumnLabels.vb + + + UserControl + + + ucrColumns.vb + + + UserControl + + + ucrColumnSpanners.vb + + + UserControl + + + ucrHeader.vb + + + UserControl + + + ucrRowGroup.vb + + + UserControl + + + ucrRows.vb + + + UserControl + + + ucrRowSummary.vb + + + UserControl + + + sdgTableRowExpression.vb + + + Form + + + sdgTableStyles.vb + + + Form + + + ucrSourceNotes.vb + + + UserControl + + + ucrStub.vb + + + UserControl + + + ucrStubOptions.vb + + + UserControl + + + ucrStubStyle.vb + + + UserControl + @@ -3116,6 +3303,9 @@ dlgDisplayTopN.vb Designer + + dlgDistances.vb + dlgEdit.vb @@ -3221,6 +3411,9 @@ dlgThreeVariablePivotTable.vb + + sdgAdditionalCondition.vb + sdgClimsoft.vb @@ -3251,6 +3444,51 @@ sdgSummaryThemes.vb + + ucrCellsFootNotes.vb + + + sdgCellFormatDateOptions.vb + + + sdgCellFormatNumberOptions.vb + + + sdgCellFormatTextOptions.vb + + + ucrCellFormatEmail.vb + + + ucrCellFormats.vb + + + ucrCellStyles.vb + + + ucrColumnFootNote.vb + + + ucrColumnNanoPlots.vb + + + ucrColumnStyles.vb + + + ucrColumnWidth.vb + + + dlgGeneralTable.vb + + + ucrOtherStyles.vb + + + ucrRowExpression.vb + + + sdgTableOptions.vb + frmMaximiseOutput.vb Designer @@ -5352,6 +5590,48 @@ ucrOutputPages.vb + + ucrCells.vb + + + ucrColumnLabels.vb + + + ucrColumns.vb + + + ucrColumnSpanners.vb + + + ucrHeader.vb + + + ucrRowGroup.vb + + + ucrRows.vb + + + ucrRowSummary.vb + + + sdgTableRowExpression.vb + + + sdgTableStyles.vb + + + ucrSourceNotes.vb + + + ucrStub.vb + + + ucrStubOptions.vb + + + ucrStubStyle.vb + diff --git a/instat/sdgAdditionalCondition.Designer.vb b/instat/sdgAdditionalCondition.Designer.vb new file mode 100644 index 00000000000..65c12bbc860 --- /dev/null +++ b/instat/sdgAdditionalCondition.Designer.vb @@ -0,0 +1,286 @@ + _ +Partial Class sdgAdditionalCondition + Inherits System.Windows.Forms.Form + + 'Form remplace la méthode Dispose pour nettoyer la liste des composants. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Requise par le Concepteur Windows Form + Private components As System.ComponentModel.IContainer + + 'REMARQUE : la procédure suivante est requise par le Concepteur Windows Form + 'Elle peut être modifiée à l'aide du Concepteur Windows Form. + 'Ne la modifiez pas à l'aide de l'éditeur de code. + _ + Private Sub InitializeComponent() + Me.ucrChkNumberOfRainyDays = New instat.ucrCheck() + Me.ucrSdgButtons = New instat.ucrButtonsSubdialogue() + Me.ucrNudDPOverallInterval = New instat.ucrNud() + Me.ucrNudDSMaximumDays = New instat.ucrNud() + Me.ucrNudDSLengthOfTime = New instat.ucrNud() + Me.lblDPOverallInterval = New System.Windows.Forms.Label() + Me.ucrNudRDMinimumDays = New instat.ucrNud() + Me.ucrNudDPRainPeriod = New instat.ucrNud() + Me.lblDPLength = New System.Windows.Forms.Label() + Me.ucrChkDryPeriod = New instat.ucrCheck() + Me.lblDSLengthofTime = New System.Windows.Forms.Label() + Me.lblDPMaxRain = New System.Windows.Forms.Label() + Me.ucrNudRDOutOfDays = New instat.ucrNud() + Me.ucrNudDPMaxRain = New instat.ucrNud() + Me.ucrChkDrySpell = New instat.ucrCheck() + Me.lblDSMaximumDays = New System.Windows.Forms.Label() + Me.lblRDMinimum = New System.Windows.Forms.Label() + Me.lblRDWidth = New System.Windows.Forms.Label() + Me.SuspendLayout() + ' + 'ucrChkNumberOfRainyDays + ' + Me.ucrChkNumberOfRainyDays.AutoSize = True + Me.ucrChkNumberOfRainyDays.Checked = False + Me.ucrChkNumberOfRainyDays.Location = New System.Drawing.Point(14, 12) + Me.ucrChkNumberOfRainyDays.Name = "ucrChkNumberOfRainyDays" + Me.ucrChkNumberOfRainyDays.Size = New System.Drawing.Size(161, 23) + Me.ucrChkNumberOfRainyDays.TabIndex = 81 + ' + 'ucrSdgButtons + ' + Me.ucrSdgButtons.AutoSize = True + Me.ucrSdgButtons.Location = New System.Drawing.Point(108, 138) + Me.ucrSdgButtons.Name = "ucrSdgButtons" + Me.ucrSdgButtons.Size = New System.Drawing.Size(259, 29) + Me.ucrSdgButtons.TabIndex = 80 + ' + 'ucrNudDPOverallInterval + ' + Me.ucrNudDPOverallInterval.AutoSize = True + Me.ucrNudDPOverallInterval.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudDPOverallInterval.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudDPOverallInterval.Location = New System.Drawing.Point(249, 104) + Me.ucrNudDPOverallInterval.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudDPOverallInterval.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudDPOverallInterval.Name = "ucrNudDPOverallInterval" + Me.ucrNudDPOverallInterval.Size = New System.Drawing.Size(42, 20) + Me.ucrNudDPOverallInterval.TabIndex = 79 + Me.ucrNudDPOverallInterval.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrNudDSMaximumDays + ' + Me.ucrNudDSMaximumDays.AutoSize = True + Me.ucrNudDSMaximumDays.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudDSMaximumDays.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudDSMaximumDays.Location = New System.Drawing.Point(249, 44) + Me.ucrNudDSMaximumDays.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudDSMaximumDays.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudDSMaximumDays.Name = "ucrNudDSMaximumDays" + Me.ucrNudDSMaximumDays.Size = New System.Drawing.Size(42, 20) + Me.ucrNudDSMaximumDays.TabIndex = 70 + Me.ucrNudDSMaximumDays.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrNudDSLengthOfTime + ' + Me.ucrNudDSLengthOfTime.AutoSize = True + Me.ucrNudDSLengthOfTime.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudDSLengthOfTime.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudDSLengthOfTime.Location = New System.Drawing.Point(415, 44) + Me.ucrNudDSLengthOfTime.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudDSLengthOfTime.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudDSLengthOfTime.Name = "ucrNudDSLengthOfTime" + Me.ucrNudDSLengthOfTime.Size = New System.Drawing.Size(42, 20) + Me.ucrNudDSLengthOfTime.TabIndex = 72 + Me.ucrNudDSLengthOfTime.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'lblDPOverallInterval + ' + Me.lblDPOverallInterval.AutoSize = True + Me.lblDPOverallInterval.Location = New System.Drawing.Point(128, 107) + Me.lblDPOverallInterval.Name = "lblDPOverallInterval" + Me.lblDPOverallInterval.Size = New System.Drawing.Size(117, 13) + Me.lblDPOverallInterval.TabIndex = 78 + Me.lblDPOverallInterval.Text = "Overall Interval Length:" + ' + 'ucrNudRDMinimumDays + ' + Me.ucrNudRDMinimumDays.AutoSize = True + Me.ucrNudRDMinimumDays.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudRDMinimumDays.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudRDMinimumDays.Location = New System.Drawing.Point(249, 12) + Me.ucrNudRDMinimumDays.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudRDMinimumDays.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudRDMinimumDays.Name = "ucrNudRDMinimumDays" + Me.ucrNudRDMinimumDays.Size = New System.Drawing.Size(42, 20) + Me.ucrNudRDMinimumDays.TabIndex = 65 + Me.ucrNudRDMinimumDays.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrNudDPRainPeriod + ' + Me.ucrNudDPRainPeriod.AutoSize = True + Me.ucrNudDPRainPeriod.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudDPRainPeriod.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudDPRainPeriod.Location = New System.Drawing.Point(415, 77) + Me.ucrNudDPRainPeriod.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudDPRainPeriod.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudDPRainPeriod.Name = "ucrNudDPRainPeriod" + Me.ucrNudDPRainPeriod.Size = New System.Drawing.Size(42, 20) + Me.ucrNudDPRainPeriod.TabIndex = 77 + Me.ucrNudDPRainPeriod.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'lblDPLength + ' + Me.lblDPLength.AutoSize = True + Me.lblDPLength.Location = New System.Drawing.Point(313, 77) + Me.lblDPLength.Name = "lblDPLength" + Me.lblDPLength.Size = New System.Drawing.Size(100, 13) + Me.lblDPLength.TabIndex = 76 + Me.lblDPLength.Text = "Maximum Dry Days:" + ' + 'ucrChkDryPeriod + ' + Me.ucrChkDryPeriod.AutoSize = True + Me.ucrChkDryPeriod.Checked = False + Me.ucrChkDryPeriod.Location = New System.Drawing.Point(14, 77) + Me.ucrChkDryPeriod.Name = "ucrChkDryPeriod" + Me.ucrChkDryPeriod.Size = New System.Drawing.Size(138, 55) + Me.ucrChkDryPeriod.TabIndex = 73 + ' + 'lblDSLengthofTime + ' + Me.lblDSLengthofTime.AutoSize = True + Me.lblDSLengthofTime.Location = New System.Drawing.Point(296, 48) + Me.lblDSLengthofTime.Name = "lblDSLengthofTime" + Me.lblDSLengthofTime.Size = New System.Drawing.Size(117, 13) + Me.lblDSLengthofTime.TabIndex = 71 + Me.lblDSLengthofTime.Text = "Overall Interval Length:" + ' + 'lblDPMaxRain + ' + Me.lblDPMaxRain.AutoSize = True + Me.lblDPMaxRain.Location = New System.Drawing.Point(164, 79) + Me.lblDPMaxRain.Name = "lblDPMaxRain" + Me.lblDPMaxRain.Size = New System.Drawing.Size(79, 13) + Me.lblDPMaxRain.TabIndex = 74 + Me.lblDPMaxRain.Text = "Maximum Rain:" + ' + 'ucrNudRDOutOfDays + ' + Me.ucrNudRDOutOfDays.AutoSize = True + Me.ucrNudRDOutOfDays.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudRDOutOfDays.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudRDOutOfDays.Location = New System.Drawing.Point(415, 12) + Me.ucrNudRDOutOfDays.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudRDOutOfDays.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudRDOutOfDays.Name = "ucrNudRDOutOfDays" + Me.ucrNudRDOutOfDays.Size = New System.Drawing.Size(42, 20) + Me.ucrNudRDOutOfDays.TabIndex = 67 + Me.ucrNudRDOutOfDays.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrNudDPMaxRain + ' + Me.ucrNudDPMaxRain.AutoSize = True + Me.ucrNudDPMaxRain.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudDPMaxRain.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudDPMaxRain.Location = New System.Drawing.Point(249, 76) + Me.ucrNudDPMaxRain.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudDPMaxRain.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudDPMaxRain.Name = "ucrNudDPMaxRain" + Me.ucrNudDPMaxRain.Size = New System.Drawing.Size(42, 20) + Me.ucrNudDPMaxRain.TabIndex = 75 + Me.ucrNudDPMaxRain.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrChkDrySpell + ' + Me.ucrChkDrySpell.AutoSize = True + Me.ucrChkDrySpell.Checked = False + Me.ucrChkDrySpell.Location = New System.Drawing.Point(14, 44) + Me.ucrChkDrySpell.Name = "ucrChkDrySpell" + Me.ucrChkDrySpell.Size = New System.Drawing.Size(126, 23) + Me.ucrChkDrySpell.TabIndex = 68 + ' + 'lblDSMaximumDays + ' + Me.lblDSMaximumDays.AutoSize = True + Me.lblDSMaximumDays.Location = New System.Drawing.Point(143, 48) + Me.lblDSMaximumDays.Name = "lblDSMaximumDays" + Me.lblDSMaximumDays.Size = New System.Drawing.Size(100, 13) + Me.lblDSMaximumDays.TabIndex = 69 + Me.lblDSMaximumDays.Text = "Maximum Dry Days:" + ' + 'lblRDMinimum + ' + Me.lblRDMinimum.AutoSize = True + Me.lblRDMinimum.Location = New System.Drawing.Point(192, 15) + Me.lblRDMinimum.Name = "lblRDMinimum" + Me.lblRDMinimum.Size = New System.Drawing.Size(51, 13) + Me.lblRDMinimum.TabIndex = 64 + Me.lblRDMinimum.Text = "Minimum:" + ' + 'lblRDWidth + ' + Me.lblRDWidth.AutoSize = True + Me.lblRDWidth.Location = New System.Drawing.Point(347, 12) + Me.lblRDWidth.Name = "lblRDWidth" + Me.lblRDWidth.Size = New System.Drawing.Size(66, 13) + Me.lblRDWidth.TabIndex = 66 + Me.lblRDWidth.Text = "Out of Days:" + ' + 'sdgAdditionalCondition + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(470, 179) + Me.Controls.Add(Me.ucrChkNumberOfRainyDays) + Me.Controls.Add(Me.ucrSdgButtons) + Me.Controls.Add(Me.ucrNudDPOverallInterval) + Me.Controls.Add(Me.ucrNudDSMaximumDays) + Me.Controls.Add(Me.ucrNudDSLengthOfTime) + Me.Controls.Add(Me.lblDPOverallInterval) + Me.Controls.Add(Me.ucrNudRDMinimumDays) + Me.Controls.Add(Me.ucrNudDPRainPeriod) + Me.Controls.Add(Me.lblDPLength) + Me.Controls.Add(Me.ucrChkDryPeriod) + Me.Controls.Add(Me.lblDSLengthofTime) + Me.Controls.Add(Me.lblDPMaxRain) + Me.Controls.Add(Me.ucrNudRDOutOfDays) + Me.Controls.Add(Me.ucrNudDPMaxRain) + Me.Controls.Add(Me.ucrChkDrySpell) + Me.Controls.Add(Me.lblDSMaximumDays) + Me.Controls.Add(Me.lblRDMinimum) + Me.Controls.Add(Me.lblRDWidth) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "sdgAdditionalCondition" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "Additional Condition" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents ucrChkNumberOfRainyDays As ucrCheck + Friend WithEvents ucrSdgButtons As ucrButtonsSubdialogue + Friend WithEvents ucrNudDPOverallInterval As ucrNud + Friend WithEvents ucrNudDSMaximumDays As ucrNud + Friend WithEvents ucrNudDSLengthOfTime As ucrNud + Friend WithEvents lblDPOverallInterval As Label + Friend WithEvents ucrNudRDMinimumDays As ucrNud + Friend WithEvents ucrNudDPRainPeriod As ucrNud + Friend WithEvents lblDPLength As Label + Friend WithEvents ucrChkDryPeriod As ucrCheck + Friend WithEvents lblDSLengthofTime As Label + Friend WithEvents lblDPMaxRain As Label + Friend WithEvents ucrNudRDOutOfDays As ucrNud + Friend WithEvents ucrNudDPMaxRain As ucrNud + Friend WithEvents ucrChkDrySpell As ucrCheck + Friend WithEvents lblDSMaximumDays As Label + Friend WithEvents lblRDMinimum As Label + Friend WithEvents lblRDWidth As Label +End Class diff --git a/instat/sdgAdditionalCondition.resx b/instat/sdgAdditionalCondition.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/instat/sdgAdditionalCondition.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/instat/sdgAdditionalCondition.vb b/instat/sdgAdditionalCondition.vb new file mode 100644 index 00000000000..6dfb3e53a67 --- /dev/null +++ b/instat/sdgAdditionalCondition.vb @@ -0,0 +1,110 @@ +' 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 sdgAdditionalCondition + Public bFirstLoad As Boolean = True + Public bControlsInitialised As Boolean = False + Private clsCombinedList, clsCalcDrySpellRollMax, clsCalcRainDayRollingSum, clsCalcRollSumNumberDryPeriod As RFunction + Private clsConditionsAndOperator, clsRollingSumRainDayOperator, clsDSCombineOperator, clsDPCombineOperator, clsSumRainDryPeriodIntervalPlusOperator As ROperator + + Private Sub sdgAdditionalCondition_Load(sender As Object, e As EventArgs) Handles MyBase.Load + autoTranslate(Me) + InitialiseControls() + End Sub + + Public Sub InitialiseControls() + ucrChkNumberOfRainyDays.SetText("Number of Rainy Days") + ucrChkNumberOfRainyDays.SetParameter(New RParameter("rd_sub", clsCalcRainDayRollingSum, 2, False), False) + ucrChkNumberOfRainyDays.AddAdditionalCodeParameterPair(clsConditionsAndOperator, New RParameter("rain_days", clsRollingSumRainDayOperator, 2, False), iAdditionalPairNo:=1) + + ucrNudRDMinimumDays.SetParameter(New RParameter("1", 1)) + ucrNudRDMinimumDays.SetLinkedDisplayControl(lblRDMinimum) + ucrNudRDMinimumDays.SetMinMax(1, 366) + + ucrNudRDOutOfDays.SetParameter(New RParameter("n", 1)) + ucrNudRDOutOfDays.SetLinkedDisplayControl(lblRDWidth) + ucrNudRDOutOfDays.SetMinMax(1, 366) + + ucrChkNumberOfRainyDays.AddToLinkedControls(ucrNudRDMinimumDays, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=1) + ucrChkNumberOfRainyDays.AddToLinkedControls(ucrNudRDOutOfDays, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=2) + + 'Dry Spell + ucrChkDrySpell.SetText("Dry Spell") + ucrChkDrySpell.SetParameter(New RParameter("ds_sub", clsCalcDrySpellRollMax, 3, False), False) + ucrChkDrySpell.AddAdditionalCodeParameterPair(clsConditionsAndOperator, New RParameter("dry_spell", clsDSCombineOperator, 3, False), iAdditionalPairNo:=1) + ucrChkDrySpell.AddToLinkedControls(ucrNudDSLengthOfTime, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=21) + ucrChkDrySpell.AddToLinkedControls(ucrNudDSMaximumDays, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=9) + ucrNudDSLengthOfTime.SetLinkedDisplayControl(lblDSLengthofTime) + ucrNudDSMaximumDays.SetLinkedDisplayControl(lblDSMaximumDays) + + ucrNudDSLengthOfTime.SetParameter(New RParameter("n", 1)) + ucrNudDSLengthOfTime.SetMinMax(1, 366) + + ucrNudDSMaximumDays.SetParameter(New RParameter("right", 1)) + ucrNudDSMaximumDays.SetMinMax(1, 366) + ucrNudDSMaximumDays.Increment = 1 + + ' Dry Period + ucrChkDryPeriod.SetText("Dry Period") + ucrChkDryPeriod.SetParameter(New RParameter("dp_sub", clsCalcRollSumNumberDryPeriod, 3, False), False) + ucrChkDryPeriod.AddAdditionalCodeParameterPair(clsConditionsAndOperator, New RParameter("dry_period", clsDPCombineOperator, 4, False), iAdditionalPairNo:=1) + + ucrNudDPRainPeriod.SetParameter(New RParameter("n", 0)) + ucrNudDPRainPeriod.SetLinkedDisplayControl(lblDPLength) + ucrNudDPRainPeriod.SetMinMax(1, 366) + + ucrNudDPMaxRain.SetParameter(New RParameter("right", 1)) + ucrNudDPMaxRain.SetLinkedDisplayControl(lblDPMaxRain) + ucrNudDPMaxRain.SetMinMax(1, Integer.MaxValue) + + ucrNudDPOverallInterval.SetParameter(New RParameter("0", 0)) + ucrNudDPOverallInterval.SetLinkedDisplayControl(lblDPOverallInterval) + ucrNudDPOverallInterval.SetMinMax(1, 366) + + ucrChkDryPeriod.AddToLinkedControls(ucrNudDPMaxRain, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=40) + ucrChkDryPeriod.AddToLinkedControls(ucrNudDPOverallInterval, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=45) + ucrChkDryPeriod.AddToLinkedControls(ucrNudDPRainPeriod, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=30) + End Sub + + Public Sub SetRCode(clsNewCombinedList As RFunction, clsNewCalcDrySpellRollMax As RFunction, clsNewCalcRainDayRollingSum As RFunction, clsNewCalcRollSumNumberDryPeriod As RFunction, clsNewConditionsAndOperator As ROperator, clsNewRollingSumRainDayOperator As ROperator, clsNewDSCombineOperator As ROperator, clsNewDPCombineOperator As ROperator, clsNewSumRainDryPeriodIntervalPlusOperator As ROperator, Optional bReset As Boolean = False) + If Not bControlsInitialised Then + InitialiseControls() + End If + clsCombinedList = clsNewCombinedList + clsCalcDrySpellRollMax = clsNewCalcDrySpellRollMax + clsCalcRainDayRollingSum = clsNewCalcRainDayRollingSum + clsCalcRollSumNumberDryPeriod = clsNewCalcRollSumNumberDryPeriod + clsConditionsAndOperator = clsNewConditionsAndOperator + clsRollingSumRainDayOperator = clsNewRollingSumRainDayOperator + clsDSCombineOperator = clsNewDSCombineOperator + clsDPCombineOperator = clsNewDPCombineOperator + clsSumRainDryPeriodIntervalPlusOperator = clsNewSumRainDryPeriodIntervalPlusOperator + + ucrNudDPRainPeriod.AddAdditionalCodeParameterPair(clsSumRainDryPeriodIntervalPlusOperator, ucrNudDPRainPeriod.GetParameter(), iAdditionalPairNo:=1) + + ucrChkNumberOfRainyDays.SetRCode(clsCombinedList, bReset, bCloneIfNeeded:=True) + ucrChkDryPeriod.SetRCode(clsCombinedList, bReset, bCloneIfNeeded:=True) + ucrChkDrySpell.SetRCode(clsCombinedList, bReset, bCloneIfNeeded:=True) + End Sub + + Private Sub MaximumValuesControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrChkDryPeriod.ControlContentsChanged, ucrNudDPRainPeriod.ControlContentsChanged, ucrNudDPOverallInterval.ControlContentsChanged + If ucrChkDryPeriod.Checked Then + ucrNudDPRainPeriod.Maximum = ucrNudDPOverallInterval.Value + ucrNudDPOverallInterval.Minimum = ucrNudDPRainPeriod.Value + End If + End Sub +End Class \ No newline at end of file diff --git a/instat/sdgClimsoft.vb b/instat/sdgClimsoft.vb index e23c63a5b8f..c5f4e51094e 100644 --- a/instat/sdgClimsoft.vb +++ b/instat/sdgClimsoft.vb @@ -28,6 +28,8 @@ Public Class sdgClimsoft Exit Sub End If + ucrBaseSubdialog.iHelpTopicID = 352 + 'Columns to include '--------------------------------------- ucrChkIncludeStationId.SetText("Station Id") diff --git a/instat/sdgImportFromClimSoft.vb b/instat/sdgImportFromClimSoft.vb index 392722acea6..0b826309739 100644 --- a/instat/sdgImportFromClimSoft.vb +++ b/instat/sdgImportFromClimSoft.vb @@ -38,6 +38,8 @@ Public Class sdgImportFromClimSoft End Sub Private Sub InitialiseDialog() + ucrBaseSdgClimSoft.iHelpTopicID = 354 + Dim dctDatabaseNames As New Dictionary(Of String, String) Dim dctPorts As New Dictionary(Of String, String) Dim dctDrv As New Dictionary(Of String, String) diff --git a/instat/sdgSelectMonth.vb b/instat/sdgSelectMonth.vb index 63c4f6209eb..e625c96a900 100644 --- a/instat/sdgSelectMonth.vb +++ b/instat/sdgSelectMonth.vb @@ -30,6 +30,7 @@ Public Class sdgSelectMonth ucrMonthAsFactor.SetAsMultipleSelectorGrid(ucrReceiverMonth, hiddenColNames:={ucrFactor.DefaultColumnNames.Level}, bIncludeNALevel:=False) + ucrMonthAsFactor.btnSelectAll.Enabled = False End Sub Public Sub SetRCode(Optional clsNewInOperator As ROperator = Nothing, Optional clsNewListCalcFunction As RFunction = Nothing, Optional clsNewFilterMonthFunction As RFunction = Nothing, Optional ucrNewReceiverMonth As ucrReceiverSingle = Nothing, Optional bReset As Boolean = False) diff --git a/instat/static/InstatObject/R/Backend_Components/summary_functions.R b/instat/static/InstatObject/R/Backend_Components/summary_functions.R index 4e647613ff9..92e81c7bdc4 100644 --- a/instat/static/InstatObject/R/Backend_Components/summary_functions.R +++ b/instat/static/InstatObject/R/Backend_Components/summary_functions.R @@ -4,43 +4,63 @@ DataSheet$set("public", "merge_data", function(new_data, by = NULL, type = "left old_metadata <- attributes(private$data) curr_data <- self$get_data_frame(use_current_filter = FALSE) by_col_attributes <- list() + if(!is.null(by)) { for(i in seq_along(by)) { - # TODO also check that !is.null(names(by)) ? - by_col_attributes[[names(by)[[i]]]] <- get_column_attributes(curr_data[[names(by)[[i]]]]) + # Collect column attributes + by_col_attributes[[by[[i]]]] <- get_column_attributes(curr_data[[by[[i]]]]) + + # Check and align the data types for each "by" column + if (class(curr_data[[by[[i]]]]) != class(new_data[[by[[i]]]])) { + warning(paste0("Type is different for ", by[[i]], " in the two data frames. Setting as numeric in both data frames.")) + + # Convert factors to numeric if necessary + if (class(curr_data[[by[[i]]]]) == "factor") { + curr_data[[by[[i]]]] <- as.numeric(as.character(curr_data[[by[[i]]]])) + } else if (class(new_data[[by[[i]]]]) == "factor") { + new_data[[by[[i]]]] <- as.numeric(as.character(new_data[[by[[i]]]])) + } else { + stop(paste0("Type is different for ", by[[i]], " in the two data frames and cannot be coerced.")) + } + } } } - if(type == "left") { - new_data <- dplyr::left_join(curr_data, new_data, by) - } - else if(type == "right") { - new_data <- dplyr::right_join(curr_data, new_data, by) - } - else if(type == "full") { - new_data <- dplyr::full_join(curr_data, new_data, by) - } - else if(type == "inner") { - new_data <- dplyr::inner_join(curr_data, new_data, by) + + # Perform the appropriate join based on the "type" argument + if (type == "left") { + new_data <- dplyr::left_join(curr_data, new_data, by = by) + } else if (type == "right") { + new_data <- dplyr::right_join(curr_data, new_data, by = by) + } else if (type == "full") { + new_data <- dplyr::full_join(curr_data, new_data, by = by) + } else if (type == "inner") { + new_data <- dplyr::inner_join(curr_data, new_data, by = by) + } else { + stop("type must be one of left, right, inner, or full") } - else stop("type must be one of left, right, inner or full") + + # Update the data in the object self$set_data(new_data) - self$append_to_changes(Merged_data) - #TODO will column/row count be correct here? - for(name in names(old_metadata)) { - if(!name %in% c("names", "class", "row.names")) { + self$append_to_changes("Merged_data") + + # Restore the old metadata + for (name in names(old_metadata)) { + if (!name %in% c("names", "class", "row.names")) { self$append_to_metadata(name, old_metadata[[name]]) } } - self$append_to_metadata(is_calculated_label, TRUE) + + self$append_to_metadata("is_calculated_label", TRUE) self$add_defaults_meta() self$add_defaults_variables_metadata(setdiff(names(new_data), names(curr_data))) - if(!is.null(by)) { - for(i in seq_along(by_col_attributes)) { - self$append_column_attributes(col_name = names(by_col_attributes)[i], new_attr = by_col_attributes[[i]]) + + # Add back column attributes for the "by" columns + if (!is.null(by)) { + for (i in seq_along(by_col_attributes)) { + self$append_column_attributes(col_name = by[[i]], new_attr = by_col_attributes[[i]]) } } -} -) +}) DataBook$set("public", "append_summaries_to_data_object", function(out, data_name, columns_to_summarise, summaries, factors = c(), summary_name, calc, calc_name = "") { if(!is.character(data_name)) stop("data_name must be of type character") diff --git a/instat/static/InstatObject/R/InstallPackages.R b/instat/static/InstatObject/R/InstallPackages.R index 7cfea6f7431..6b8ccf7f91c 100644 --- a/instat/static/InstatObject/R/InstallPackages.R +++ b/instat/static/InstatObject/R/InstallPackages.R @@ -157,7 +157,10 @@ packs <- c("abind", "agricolae", "agridat", install.packages(packs, dependencies = FALSE, repos='https://cloud.r-project.org', type="win.binary") # Only use internal library -if (length(.libPaths()) == 2) .libPaths(.libPaths()[2]) +if (length(.libPaths()) >= 2){ + current_paths <- .libPaths() + .libPaths(current_paths[c(1, 3)[c(1, 3) <= length(current_paths)]]) +} #install development packages not on CRAN devtools::install_github("ianmoran11/mmtable2") diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index 00ea4778cc8..45145ecd644 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -5,7 +5,7 @@ DataSheet <- R6::R6Class("DataSheet", imported_from = "", messages = TRUE, convert=TRUE, create = TRUE, start_point=1, filters = list(), column_selections = list(), objects = list(), - calculations = list(), scalars = list(), keys = list(), comments = list(), keep_attributes = TRUE) + calculations = list(), scalars = list(), keys = list(), comments = list(), keep_attributes = TRUE, undo_history = list(), redo_undo_history = list(), disable_undo = FALSE) { # Set up the data object self$set_data(data, messages) @@ -59,10 +59,13 @@ DataSheet <- R6::R6Class("DataSheet", column_selections = list(), objects = list(), keys = list(), + undo_history = list(), + redo_undo_history = list(), comments = list(), calculations = list(), scalars = list(), - changes = list(), + changes = list(), + disable_undo = FALSE, .current_filter = list(), .current_column_selection = list(), .data_changed = FALSE, @@ -160,6 +163,21 @@ DataSheet$set("public", "set_data", function(new_data, messages=TRUE, check_name } } ) +DataSheet$set("public", "set_enable_disable_undo", function(disable_undo) { + private$disable_undo <- disable_undo + if(disable_undo) { + private$undo_history <- list() + gc() + } +}) + +DataSheet$set("public", "save_state_to_undo_history", function() { + self$set_undo_history(private$data, attributes(private$data)) +}) + +DataSheet$set("public", "is_undo", function() { + return(private$disable_undo) +}) DataSheet$set("public", "set_meta", function(new_meta) { meta_data_copy <- new_meta @@ -184,6 +202,60 @@ DataSheet$set("public", "clear_metadata", function() { } ) +DataSheet$set("public", "has_undo_history", function() { + return(length(private$undo_history) > 0) +} +) + +DataSheet$set("public", "undo_last_action", function() { + + # Check if there's any action to undo + if (length(private$undo_history) > 0) { + # Get the last state from the undo history + previous_state <- private$undo_history[[length(private$undo_history)]] + + # Restore the data and its attributes + restored_data <- previous_state$data # Extract the dataframe + restored_attributes <- previous_state$attributes # Extract the attributes + + # Set the dataframe in the DataSheet + self$set_data(as.data.frame(restored_data)) + + # Restore attributes + restored_attributes <- previous_state$attributes # Extract the attributes + for (property in names(restored_attributes)) { + self$append_to_metadata(property, restored_attributes[[property]]) + } + # Remove the latest state from the undo history + private$undo_history <- private$undo_history[-length(private$undo_history)] + + # Trigger garbage collection to free memory + gc() + } else { + message("No more actions to undo.") + } +}) + + +# Redo function +DataSheet$set("public", "redo_last_action", function() { + if (length(private$redo_undo_history) > 0) { + # Get the last undone state from redo undo_history + next_state <- private$redo_undo_history[[length(private$redo_undo_history)]] + + # Restore the next state + self$set_data(as.data.frame(next_state)) + + # Move the state back to the undo_history + private$undo_history <- append(private$undo_history, list(next_state)) + + # Remove the state from redo undo_history + private$redo_undo_history <- private$redo_undo_history[-length(private$redo_undo_history)] + } else { + message("No more actions to redo.") + } +}) + #Removed until can be fixed with attributes # DataSheet$set("public", "set_variables_metadata", function(new_meta) { # if(!is.data.frame(new_meta)) stop("variable metadata must be of type: data.frame") @@ -241,6 +313,40 @@ DataSheet$set("public", "set_scalars", function(new_scalars) { } ) +# Set undo_history with memory management +DataSheet$set("public", "set_undo_history", function(new_data, attributes = list()) { + if (!is.data.frame(new_data)) stop("new_data must be of type: data.frame") + + if (!private$disable_undo) { + # Define memory and undo_history limits + MAX_undo_history_SIZE <- 10 # Limit to last 10 undo_history states + MAX_MEMORY_LIMIT_MB <- 1024 # Limit the memory usage for undo_history + + # Check current memory usage + current_memory <- monitor_memory() + + # If memory exceeds limit, remove the oldest entry + if (current_memory > MAX_MEMORY_LIMIT_MB) { + message(paste("Memory limit exceeded:", round(current_memory, 2), "MB. Removing oldest entry.")) + private$undo_history <- private$undo_history[-1] # Remove the oldest entry + gc() # Trigger garbage collection to free memory + } + + # Limit undo_history size + if (length(private$undo_history) >= MAX_undo_history_SIZE) { + private$undo_history <- private$undo_history[-1] # Remove the oldest entry + gc() # Trigger garbage collection to free memory + } + + # Package the new data and attributes into a list + new_undo_entry <- list(data = new_data, attributes = attributes) + + # Append the new entry to the undo history + private$undo_history <- append(private$undo_history, list(new_undo_entry)) + } +}) + + DataSheet$set("public", "set_keys", function(new_keys) { if(!is.list(new_keys)) stop("new_keys must be of type: list") self$append_to_changes(list(Set_property, "keys")) @@ -665,6 +771,9 @@ DataSheet$set("public", "add_scalar", function(scalar_name = "", scalar_value) { ) DataSheet$set("public", "add_columns_to_data", function(col_name = "", col_data, use_col_name_as_prefix = FALSE, hidden = FALSE, before, adjacent_column = "", num_cols, require_correct_length = TRUE, keep_existing_position = TRUE) { + # Save the current state to undo_history before making modifications + self$save_state_to_undo_history() + # Column name must be character if(!is.character(col_name)) stop("Column name must be of type: character") if(missing(num_cols)) { @@ -693,9 +802,9 @@ DataSheet$set("public", "add_columns_to_data", function(col_name = "", col_data, } } - if(length(col_name) != num_cols) { + if(length(col_name) != num_cols && (num_cols == 1 || length(col_name) == 1)) { use_col_name_as_prefix = TRUE - } + } else use_col_name_as_prefix = FALSE replaced <- FALSE previous_length = self$get_column_count() @@ -712,8 +821,10 @@ DataSheet$set("public", "add_columns_to_data", function(col_name = "", col_data, if(require_correct_length) stop("Length of new column must be divisible by the length of the data frame") else curr_col <- rep(curr_col, length.out = self$get_data_frame_length()) } - if(use_col_name_as_prefix) curr_col_name = self$get_next_default_column_name(col_name[i]) - else curr_col_name = col_name[[i]] +print(use_col_name_as_prefix) + if(use_col_name_as_prefix) curr_col_name = self$get_next_default_column_name(col_name) + else curr_col_name = col_name[i] + curr_col_name <- make.names(iconv(curr_col_name, to = "ASCII//TRANSLIT", sub = ".")) new_col_names <- c(new_col_names, curr_col_name) if(curr_col_name %in% self$get_column_names()) { @@ -812,6 +923,10 @@ DataSheet$set("public", "cor", function(x_col_names, y_col_name, use = "everythi DataSheet$set("public", "rename_column_in_data", function(curr_col_name = "", new_col_name = "", label = "", type = "single", .fn, .cols = everything(), new_column_names_df, new_labels_df, ...) { curr_data <- self$get_data_frame(use_current_filter = FALSE, use_column_selection = FALSE) + + # Save the current state to undo_history before making modifications + self$save_state_to_undo_history() + # Column name must be character if (type == "single") { if (new_col_name != curr_col_name) { @@ -902,6 +1017,9 @@ DataSheet$set("public", "rename_column_in_data", function(curr_col_name = "", ne DataSheet$set("public", "remove_columns_in_data", function(cols=c(), allow_delete_all = FALSE) { + # Save the current state to undo_history before making modifications + self$save_state_to_undo_history() + if(length(cols) == self$get_column_count()) { if(allow_delete_all) { warning("You are deleting all columns in the data frame.") @@ -936,6 +1054,7 @@ DataSheet$set("public", "remove_columns_in_data", function(cols=c(), allow_delet DataSheet$set("public", "replace_value_in_data", function(col_names, rows, old_value, old_is_missing = FALSE, start_value = NA, end_value = NA, new_value, new_is_missing = FALSE, closed_start_value = TRUE, closed_end_value = TRUE, locf = FALSE, from_last = FALSE) { curr_data <- self$get_data_frame(use_current_filter = FALSE) + self$save_state_to_undo_history() # Column name must be character if(!all(is.character(col_names))) stop("Column name must be of type: character") if (!all(col_names %in% names(curr_data))) stop("Cannot find all columns in the data.") @@ -1280,6 +1399,8 @@ DataSheet$set("public", "add_defaults_variables_metadata", function(column_names DataSheet$set("public", "remove_rows_in_data", function(row_names) { curr_data <- self$get_data_frame(use_current_filter = FALSE) + self$save_state_to_undo_history() + if(!all(row_names %in% rownames(curr_data))) stop("Some of the row_names not found in data") rows_to_remove <- which(rownames(curr_data) %in% row_names) #Prefer not to use dplyr::slice as it produces a tibble @@ -1304,6 +1425,9 @@ DataSheet$set("public", "get_next_default_column_name", function(prefix) { DataSheet$set("public", "reorder_columns_in_data", function(col_order) { if (ncol(self$get_data_frame(use_current_filter = FALSE, use_column_selection = FALSE)) != length(col_order)) stop("Columns to order should be same as columns in the data.") + # Save the current state to undo_history before making modifications + self$save_state_to_undo_history() + if(is.numeric(col_order)) { if(!(identical(sort(col_order), sort(as.numeric(1:ncol(data)))))) { stop("Invalid column order") @@ -1326,6 +1450,7 @@ DataSheet$set("public", "reorder_columns_in_data", function(col_order) { DataSheet$set("public", "insert_row_in_data", function(start_row, row_data = c(), number_rows = 1, before = FALSE) { curr_data <- self$get_data_frame(use_current_filter = FALSE) + self$save_state_to_undo_history() curr_row_names <- rownames(curr_data) if (!start_row %in% curr_row_names) { stop(paste(start_row, " not found in rows")) @@ -1426,36 +1551,35 @@ DataSheet$set("public", "get_column_factor_levels", function(col_name = "") { DataSheet$set("public", "sort_dataframe", function(col_names = c(), decreasing = FALSE, na.last = TRUE, by_row_names = FALSE, row_names_as_numeric = TRUE) { curr_data <- self$get_data_frame(use_current_filter = FALSE) - string <- list() - if(missing(col_names) || length(col_names) == 0) { - if(by_row_names) { - if(row_names_as_numeric) row_names_sort <- as.numeric(row.names(curr_data)) - else row_names_sort <- row.names(curr_data) - if(decreasing) self$set_data(arrange(curr_data, desc(row_names_sort))) + + # Check for missing or empty column names + if (missing(col_names) || length(col_names) == 0) { + if (by_row_names) { + row_names_sort <- if (row_names_as_numeric) as.numeric(row.names(curr_data)) else row.names(curr_data) + if (decreasing) self$set_data(arrange(curr_data, desc(row_names_sort))) else self$set_data(arrange(curr_data, row_names_sort)) + } else { + message("No sorting to be done.") } - else message("No sorting to be done.") - } - else { - col_names_exp = c() - i = 1 - for(col_name in col_names){ - if(!(col_name %in% names(curr_data))) { - stop(col_name, " is not a column in ", get_metadata(data_name_label)) + } else { + # Build the expressions using rlang for sorting columns + col_names_exp <- purrr::map(col_names, function(col_name) { + if (!(col_name %in% names(curr_data))) { + stop(col_name, " is not a column in the data.") } - if(decreasing) col_names_exp[[i]] <- lazyeval::interp(~ desc(var), var = as.name(col_name)) - else col_names_exp[[i]] <- lazyeval::interp(~ var, var = as.name(col_name)) - i = i + 1 - } - if(by_row_names) warning("Cannot sort by columns and row names. Sorting will be done by given columns only.") - #self$set_data(dplyr::arrange_(curr_data, .dots = col_names_exp)) - self$set_data(dplyr::arrange(curr_data, dplyr::across(dplyr::all_of(col_names_exp)))) + if (decreasing) dplyr::desc(rlang::sym(col_name)) else rlang::sym(col_name) + }) + + # Handle the case where sorting by row names and column names at the same time + if (by_row_names) warning("Cannot sort by columns and row names. Sorting will be done by given columns only.") + # Sort the data based on the expressions + self$set_data(dplyr::arrange(curr_data, !!!col_names_exp)) } self$data_changed <- TRUE } ) - + DataSheet$set("public", "convert_column_to_type", function(col_names = c(), to_type, factor_values = NULL, set_digits, set_decimals = FALSE, keep_attr = TRUE, ignore_labels = FALSE, keep.labels = TRUE) { if(!all(col_names %in% self$get_column_names())) stop("Some column names not found in the data") @@ -4509,6 +4633,8 @@ DataSheet$set("public", "remove_empty", function(which = c("rows", "cols")) { DataSheet$set("public", "replace_values_with_NA", function(row_index, column_index) { curr_data <- self$get_data_frame(use_current_filter = FALSE) + self$save_state_to_undo_history() + if(!all(row_index %in% seq_len(nrow(curr_data)))) stop("All row indexes must be within the dataframe") if(!all(column_index %in% seq_len(ncol(curr_data)))) stop("All column indexes must be within the dataframe") curr_data[row_index, column_index] <- NA @@ -4522,22 +4648,40 @@ DataSheet$set("public", "has_labels", function(col_names) { } ) -DataSheet$set("public", "anova_tables2", function(x_col_names, y_col_name, signif.stars = FALSE, sign_level = FALSE, means = FALSE) { - - if(missing(x_col_names) || missing(y_col_name)) stop("Both x_col_names and y_col_names are required") - if(sign_level || signif.stars) message("This is no longer descriptive") - if(sign_level) end_col = 5 else end_col = 4 - +DataSheet$set("public", "anova_tables2", function(x_col_names, y_col_name, total = FALSE, signif.stars = FALSE, sign_level = FALSE, means = FALSE) { + if (missing(x_col_names) || missing(y_col_name)) stop("Both x_col_names and y_col_names are required") + if (sign_level || signif.stars) message("This is no longer descriptive") + if (sign_level) end_col = 5 else end_col = 4 + + # Construct the formula if (length(x_col_names) == 1) { - formula_str <- paste0( as.name(y_col_name), "~ ", as.name(x_col_names)) + formula_str <- paste0(as.name(y_col_name), "~ ", as.name(x_col_names)) } else if (length(x_col_names) > 1) { formula_str <- paste0(as.name(y_col_name), "~ ", as.name(paste(x_col_names, collapse = " + "))) } - return_item <- NULL - mod <- lm(formula = as.formula(formula_str), data = self$get_data_frame()) - return_item[[paste0("ANOVA table: ", formula_str, sep = "")]] <- anova(mod)[1:end_col] - if(means) return_item[[paste0("Means table of ", y_col_name)]] <- model.tables(aov(mod), type = "means") - return(return_item) + # Fit the model + mod <- lm(formula = as.formula(formula_str), data = self$get_data_frame()) + anova_mod <- anova(mod)[1:end_col] %>% tibble::as_tibble(rownames = " ") + + # Add the total row if requested + if (total) anova_mod <- anova_mod %>% tibble::add_row(` ` = "Total", dplyr::summarise(., across(where(is.numeric), sum))) + anova_mod$`F value` <- round(anova_mod$`F value`, 4) + if (sign_level) anova_mod$`Pr(>F)` <- format.pval(anova_mod$`Pr(>F)`, digits = 4, eps = 0.001) + cat(paste0("ANOVA of ", formula_str, ":\n")) + print(anova_mod) + cat("\n") + # Optionally print means + if (means) { + if (class(mod$model[[x_col_names]]) %in% c("numeric", "integer")){ + cat("Model coefficients:\n") + print(mod$coefficients) + cat("\n") + } else { + cat(paste0("Means table of ", y_col_name, ":\n")) + print(model.tables(aov(mod), type = "means")) + cat("\n") + } + } } -) \ No newline at end of file +) diff --git a/instat/static/InstatObject/R/instat_object_R6.R b/instat/static/InstatObject/R/instat_object_R6.R index ee580e5519a..5270526bc58 100644 --- a/instat/static/InstatObject/R/instat_object_R6.R +++ b/instat/static/InstatObject/R/instat_object_R6.R @@ -11,6 +11,7 @@ DataBook <- R6::R6Class("DataBook", self$set_meta(instat_obj_metadata) self$set_objects(list()) self$set_scalars(list()) + self$set_undo_history(list()) if (missing(data_tables) || length(data_tables) == 0) { self$set_data_objects(list()) @@ -31,6 +32,7 @@ DataBook <- R6::R6Class("DataBook", .metadata = list(), .objects = list(), .scalars = list(), + .undo_history = list(), .links = list(), .data_sheets_changed = FALSE, .database_connection = NULL, @@ -316,6 +318,13 @@ DataBook$set("public", "set_objects", function(new_objects) { } ) +DataBook$set("public", "set_undo_history", function(new_undo_history) { + if (!is.list(new_undo_history)) stop("undo_history must be of type: list") + + private$.undo_history <- new_undo_history +} +) + DataBook$set("public", "set_scalars", function(new_scalars) { if(!is.list(new_scalars)) stop("new_scalars must be of type: list") private$.scalars <- new_scalars @@ -1352,6 +1361,30 @@ DataBook$set("public","has_key", function(data_name) { } ) +DataBook$set("public","set_enable_disable_undo", function(data_name, disable_undo) { + self$get_data_objects(data_name)$set_enable_disable_undo(disable_undo) +} +) + +DataBook$set("public", "is_undo", function(data_name) { + self$get_data_objects(data_name)$is_undo() +}) + +DataBook$set("public","has_undo_history", function(data_name) { + self$get_data_objects(data_name)$has_undo_history() +} +) + +DataBook$set("public","undo_last_action", function(data_name) { + self$get_data_objects(data_name)$undo_last_action() +} +) + +DataBook$set("public","redo_last_action", function(data_name) { + self$get_data_objects(data_name)$redo_last_action() +} +) + DataBook$set("public","get_keys", function(data_name, key_name) { self$get_data_objects(data_name)$get_keys(key_name) } @@ -1930,7 +1963,7 @@ DataBook$set("public", "import_climsoft_data", function(tableName, #-------------------------------- con <- self$get_database_connection() if(is.null(con)){ - stop("No database connection") + stop("No database connection") } if(missing(tableName) || missing(station_filter_column) || missing(element_filter_column) || length(stations) == 0 || length(elements) == 0){ @@ -2001,6 +2034,8 @@ DataBook$set("public", "import_climsoft_data", function(tableName, #filters #-------------------------------- + stations <- gsub("'", "''", stations) # Escape any apostrophes + elements <- gsub("'", "''", elements) # Escape any apostrophes sql_stations_filter <- paste0(" station.", station_filter_column, " IN ", paste0("(", paste0("'", stations, "'", collapse = ", "), ")")) sql_elements_filter <- paste0(" obselement.", element_filter_column, " IN ", paste0("(", paste0("'", elements, "'", collapse = ", "), ")")) @@ -2035,12 +2070,12 @@ DataBook$set("public", "import_climsoft_data", function(tableName, if(import_selected_stations_metadata){ stations_metadata_name <- next_default_item("stations_metadata", self$get_data_names(), include_index = FALSE) - data_list[[stations_metadata_name]] <- DBI::dbGetQuery(con, paste0("SELECT * FROM station WHERE", sql_stations_filter)) + data_list[[stations_metadata_name]] <- DBI::dbGetQuery(con, paste0("SELECT * FROM station WHERE ", sql_stations_filter)) } if(import_selected_elements_metadata){ elements_metadata_name <- next_default_item("elements_metadata", self$get_data_names(), include_index = FALSE) - data_list[[elements_metadata_name]] <- DBI::dbGetQuery(con, paste0("SELECT * FROM obselement WHERE", sql_elements_filter)) + data_list[[elements_metadata_name]] <- DBI::dbGetQuery(con, paste0("SELECT * FROM obselement WHERE ", sql_elements_filter)) } #-------------------------------- @@ -2106,131 +2141,6 @@ DataBook$set("public", "import_climsoft_data", function(tableName, }) -#TODO. Deprecated. Delete this after after deleting the import from Climsoft wizard dialog -DataBook$set("public", "import_from_climsoft", function(stationfiltercolumn = "stationId", stations = c(), elementfiltercolumn = "elementId", elements = c(), include_observation_data = FALSE, include_observation_flags = FALSE, unstack_data = FALSE, include_elements_info = FALSE, start_date = NULL, end_date = NULL) { - #need to perform checks here - con <- self$get_database_connection() - - #get stations database data and station ids values - if (length(stations) > 0) { - #construct a string of station values from the passed station vector eg of result ('191','122') - passed_station_values <- paste0("(", paste0("'", stations, "'", collapse = ", "), ")") - - #get the station info of the passed station values - db_station_info <- DBI::dbGetQuery(con, paste0( "SELECT * FROM station WHERE ", stationfiltercolumn, " IN ", passed_station_values, ";")) - - #set values of station ids only - if (stationfiltercolumn == "stationId") { - station_ids_values <- passed_station_values - } else{ - station_ids_values <- paste0("(", paste0("'", db_station_info$stationId, "'", collapse = ", "),")") - } - } - - #if true get observation data - if (include_observation_data) { - #if there are no elements passed then stop and throw error - if (length(elements) < 1) stop("start_date must be of type Date.") - - #set values of element ids only - if (elementfiltercolumn == "elementId") { - #get element id values directly from passed data - element_ids_values <- paste0("(", paste0(elements, collapse = ", "), ")") - } else{ - #get element id values from the database - passed_element_values <- paste0("(", paste0("'", elements, "'", collapse = ", "), ")") - db_elements_ids <- DBI::dbGetQuery( con, paste0("SELECT elementId FROM obselement WHERE ", elementfiltercolumn, " IN ", passed_element_values, ";" )) - element_ids_values <- paste0("(", paste0(sprintf("%d", db_elements_ids$elementId), collapse = ", "), ")") - } - - if(include_elements_info) { - db_elements_info <- DBI::dbGetQuery(con, paste0("SELECT elementId, elementName, abbreviation, description, elementtype, upperLimit, lowerLimit, units FROM obselement WHERE elementId ", " IN ", element_ids_values, ";" )) - } - - flags_column_col_sql <- " " - if (include_observation_flags) { - flags_column_col_sql <- ", observationfinal.flag AS flag" - } - - #get databounds filter query if dates have been passed - date_bounds_filter <- "" - if (!is.null(start_date)) { - if (!lubridate::is.Date(start_date)) - stop("start_date must be of type Date.") - start_date <- format(start_date, format = "%Y-%m-%d") - date_bounds_filter = paste0(date_bounds_filter, " AND obsDatetime >= ", sQuote(start_date)) - } - if (!is.null(end_date)) { - if (!lubridate::is.Date(end_date)) - stop("end_date must be of type Date.") - end_date <- format(end_date, format = "%Y-%m-%d") - date_bounds_filter <- paste0(date_bounds_filter," AND obsDatetime <=", sQuote(end_date)) - } - - #construct observation data sql query and get data from database - if (length(stations) > 0) { - #if stations passed get observation data of selected elements of passed stations - db_observation_data <- DBI::dbGetQuery(con, paste0("SELECT observationfinal.recordedFrom As station, obselement.abbreviation AS element, observationfinal.obsDatetime AS datetime, observationfinal.obsValue AS obsvalue", flags_column_col_sql, " FROM observationfinal INNER JOIN obselement ON observationfinal.describedBy = obselement.elementId WHERE observationfinal.recordedFrom IN ", station_ids_values, " AND observationfinal.describedBy IN ", element_ids_values, date_bounds_filter, " ORDER BY observationfinal.recordedFrom, observationfinal.describedBy;")) - } else{ - #if stations have not been passed get observation data of passed elements of all stations - db_observation_data <- DBI::dbGetQuery(con, paste0("SELECT observationfinal.recordedFrom As station, obselement.abbreviation AS element, observationfinal.obsDatetime AS datetime, observationfinal.obsValue AS obsvalue", flags_column_col_sql, " FROM observationfinal INNER JOIN obselement ON observationfinal.describedBy = obselement.elementId WHERE observationfinal.describedBy IN ", element_ids_values, date_bounds_filter, " ORDER BY observationfinal.recordedFrom, observationfinal.describedBy;")) - - #then get the stations ids (uniquely) from the observation data and use the ids to get station info - station_ids_values <- paste0("(", paste0("'", as.character(unique(db_observation_data$station) ), "'", collapse = ", "), ")") - db_station_info <- DBI::dbGetQuery(con, paste0("SELECT * FROM station WHERE stationId IN ", station_ids_values, ";" )) - } - - station_data_name <- next_default_item("stations_info", self$get_data_names(), include_index = FALSE) - elements_data_name <- next_default_item("elements_info", self$get_data_names(), include_index = FALSE) - observation_data_name <- next_default_item("observation_data", self$get_data_names(), include_index = FALSE) - - #elements info could be optional - if (include_elements_info) { - data_list <- list(db_station_info, db_elements_info, db_observation_data) - names(data_list) <- c(station_data_name, elements_data_name, observation_data_name) - } else{ - data_list <- list(db_station_info, db_observation_data) - names(data_list) <- c(station_data_name, observation_data_name) - } - - } else{ - if (length(stations) > 0) { - data_list <- list(db_station_info) - names(data_list) <- next_default_item("stations_info", self$get_data_names()) - } - } - - #import the data as separate data frames - self$import_data(data_tables = data_list) - - #if observation data was included, and key links, convert columns and optionally unstack data - if (include_observation_data) { - #add relationship key between the observation data and station data - #linked by stationId and recordedFrom columns - self$add_key(station_data_name, c("stationId")) - self$add_link(from_data_frame = observation_data_name, to_data_frame = station_data_name, link_pairs = c(recordedFrom = "stationId"), type = keyed_link_label) - - #convert stations in observation data to factors - self$convert_column_to_type(data_name = observation_data_name, col_names = "station", to_type = "factor") - #convert elements in observation data to factors - self$convert_column_to_type(data_name = observation_data_name, col_names = "element", to_type = "factor") - #convert flags to factors if included - if(include_observation_flags){ - self$convert_column_to_type(data_name = observation_data_name, col_names = "flag", to_type = "factor") - } - #create a plain date column from the observation data datetime column values - obsdate <- self$get_columns_from_data(data_name = observation_data_name, col_names = "datetime", use_current_filter = FALSE) - self$add_columns_to_data(data_name = observation_data_name, col_name = "date", col_data = as.Date(x = obsdate), before = FALSE, adjacent_column = "datetime") - - if(unstack_data){ - observation_data <- self$get_data_frame(data_name = observation_data_name) - observation_data_unstacked <- reshape2::dcast(data = observation_data, formula = station + datetime + date ~ element, value.var = "obsvalue") - self$import_data(data_tables = list(observation_data_unstacked = observation_data_unstacked)) - } - } - -}) - DataBook$set("public", "import_from_iri", function(download_from, data_file, data_frame_name, location_data_name, path, X1, X2 = NA, Y1, Y2 = NA, get_area_point = "area"){ data_list <- import_from_iri(download_from = download_from, data_file = data_file, path = path, X1 = X1, X2 = X2, Y1 = Y1, Y2 = Y2, get_area_point = get_area_point) @@ -2323,20 +2233,8 @@ DataBook$set("public", "crops_definitions", function(data_name, year, station, r year_col <- self$get_columns_from_data(data_name, year) unique_year <- na.omit(unique(year_col)) - expand_list <- list() - names_list <- c() - - expand_list[[length(expand_list) + 1]] <- rain_totals - names_list[length(names_list) + 1] <- rain_total_name - - expand_list[[length(expand_list) + 1]] <- plant_lengths - names_list[length(names_list) + 1] <- plant_length_name - - expand_list[[length(expand_list) + 1]] <- plant_days - names_list[length(names_list) + 1] <- plant_day_name - - expand_list[[length(expand_list) + 1]] <- unique_year - names_list[length(names_list) + 1] <- year + expand_list <- list(rain_totals, plant_lengths, plant_days, unique_year) + names_list <- c(rain_total_name, plant_length_name, plant_day_name, year) if(is_station) { station_col <- self$get_columns_from_data(data_name, station) @@ -2344,8 +2242,10 @@ DataBook$set("public", "crops_definitions", function(data_name, year, station, r expand_list[[length(expand_list) + 1]] <- unique_station names_list[length(names_list) + 1] <- station } + df <- setNames(expand.grid(expand_list), names_list) daily_data <- self$get_data_frame(data_name) + if(season_data_name != data_name) { join_by <- by names(join_by) <- season_by @@ -2365,7 +2265,7 @@ DataBook$set("public", "crops_definitions", function(data_name, year, station, r } # Plant day condition - if(start_check) { + if(start_check %in% c("yes", "both")) { df$plant_day_cond <- (df[[start_day]] <= df[[plant_day_name]]) } @@ -2373,34 +2273,57 @@ DataBook$set("public", "crops_definitions", function(data_name, year, station, r df$length_cond <- (df[[plant_day_name]] + df[[plant_length_name]] <= df[[end_day]]) # Rain total condition - df[["rain_total_actual"]] <- sapply(1:nrow(df), - function(x) { - ind <- daily_data[[year]] == df[[year]][x] & daily_data[[day]] >= df[[plant_day_name]][x] & - daily_data[[day]] < (df[[plant_day_name]][x] + df[[plant_length_name]][x]) - if(is_station) ind <- ind & (daily_data[[station]] == df[[station]][x]) - rain_values <- daily_data[[rain]][ind] - sum_rain <- sum(rain_values, na.rm = TRUE) - # TODO + 1 is needed because of non leap years - # if period include 29 Feb then period is 1 less than required length - if(length(rain_values) + 1 < df[[plant_length_name]][x] || (anyNA(rain_values) && sum_rain < df[[rain_total_name]][x])) sum_rain <- NA - sum_rain - } - ) + # Create a column for the rain total actuals initialised with NA + df[["rain_total_actual"]] <- NA + + # Vectorise the conditions for each + for (i in 1:nrow(df)) { + # Create a condition to filter the daily data based on the year, day, and plant day/length + ind <- daily_data[[year]] == df[[year]][i] & + daily_data[[day]] >= df[[plant_day_name]][i] & + daily_data[[day]] < (df[[plant_day_name]][i] + df[[plant_length_name]][i]) + + if (is_station) { + ind <- ind & (daily_data[[station]] == df[[station]][i]) + } + + # Filter the daily data based on the condition + rain_values <- daily_data[[rain]][ind] + + # Calculate the sum of rain values and check conditions + sum_rain <- sum(rain_values, na.rm = TRUE) + + if (length(rain_values) + 1 < df[[plant_length_name]][i] || (anyNA(rain_values) && sum_rain < df[[rain_total_name]][i])) { + sum_rain <- NA + } + + # Assign the calculated sum to the respective row in the result dataframe + df[["rain_total_actual"]][i] <- sum_rain + } df$rain_cond <- df[[rain_total_name]] <= df[["rain_total_actual"]] # All three conditions met - df$overall_cond <- ((if(start_check) df$plant_day_cond else TRUE) & df$length_cond & df$rain_cond) + if (start_check == "yes"){ + df$overall_cond <- df$plant_day_cond & df$length_cond & df$rain_cond + } else if (start_check == "no"){ + df$overall_cond <- TRUE & df$length_cond & df$rain_cond + } else { + df$overall_cond_with_start <- df$plant_day_cond & df$length_cond & df$rain_cond + df$overall_cond_no_start <- TRUE & df$length_cond & df$rain_cond + } crops_name <- "crop_def" crops_name <- next_default_item(prefix = crops_name, existing_names = self$get_data_names(), include_index = FALSE) data_tables <- list(df) names(data_tables) <- crops_name self$import_data(data_tables = data_tables) + if(season_data_name != data_name) { crops_by <- season_by names(crops_by) <- by self$add_link(crops_name, season_data_name, crops_by, keyed_link_label) } + if(definition_props) { calc_from <- list() if(!missing(station)) calc_from[[length(calc_from) + 1]] <- station @@ -2409,24 +2332,65 @@ DataBook$set("public", "crops_definitions", function(data_name, year, station, r calc_from[[length(calc_from) + 1]] <- rain_total_name names(calc_from) <- rep(crops_name, length(calc_from)) grouping <- instat_calculation$new(type = "by", calculated_from = calc_from) - prop_calc_from <- list("overall_cond") - names(prop_calc_from) <- crops_name - propor_table <- instat_calculation$new(function_exp="sum(overall_cond, na.rm = TRUE)/length(na.omit(overall_cond))", - save = 2, calculated_from = prop_calc_from, - manipulations = list(grouping), - type="summary", result_name = "prop_success", result_data_frame = "crop_prop") - prop_data_frame <- self$run_instat_calculation(propor_table, display = TRUE) - if(print_table) { - prop_data_frame$prop_success <- round(prop_data_frame$prop_success, 2) - prop_table_unstacked <- reshape2::dcast(formula = as.formula(paste(if(!missing(station)) paste(station, "+"), plant_length_name, "+", rain_total_name, "~", plant_day_name)), data = prop_data_frame, value.var = "prop_success") - if(!missing(station)) f <- interaction(prop_table_unstacked[[station]], prop_table_unstacked[[plant_length_name]], lex.order = TRUE) - else f <- prop_table_unstacked[[plant_length_name]] - prop_table_split <- split(prop_table_unstacked, f) - return(prop_table_split) + + if (start_check %in% c("yes", "no")){ + prop_calc_from <- list("overall_cond") + names(prop_calc_from) <- crops_name + propor_table <- instat_calculation$new(function_exp="sum(overall_cond, na.rm = TRUE)/length(na.omit(overall_cond))", + save = 2, calculated_from = prop_calc_from, + manipulations = list(grouping), + type="summary", result_name = "prop_success", result_data_frame = "crop_prop") + prop_data_frame <- self$run_instat_calculation(propor_table, display = TRUE) + if(print_table) { + prop_data_frame$prop_success <- round(prop_data_frame$prop_success, 2) + prop_table_unstacked <- reshape2::dcast(formula = as.formula(paste(if(!missing(station)) paste(station, "+"), plant_length_name, "+", rain_total_name, "~", plant_day_name)), data = prop_data_frame, value.var = "prop_success") + if(!missing(station)) f <- interaction(prop_table_unstacked[[station]], prop_table_unstacked[[plant_length_name]], lex.order = TRUE) + else f <- prop_table_unstacked[[plant_length_name]] + prop_table_split <- split(prop_table_unstacked, f) + return(prop_table_split) + } + } else { + prop_calc_from_with_start <- list("overall_cond_with_start") + names(prop_calc_from_with_start) <- crops_name + propor_table_with_start <- instat_calculation$new(function_exp="sum(overall_cond_with_start, na.rm = TRUE)/length(na.omit(overall_cond_with_start))", + save = 2, calculated_from = prop_calc_from_with_start, + manipulations = list(grouping), + type="summary", result_name = "prop_success", result_data_frame = "crop_prop_with_start") + prop_data_frame_with_start <- self$run_instat_calculation(propor_table_with_start, display = TRUE) + + prop_calc_from_no_start <- list("overall_cond_no_start") + names(prop_calc_from_no_start) <- crops_name + propor_table_no_start <- instat_calculation$new(function_exp="sum(overall_cond_no_start, na.rm = TRUE)/length(na.omit(overall_cond_no_start))", + save = 2, calculated_from = prop_calc_from_no_start, + manipulations = list(grouping), + type="summary", result_name = "prop_success", result_data_frame = "crop_prop_no_start") + prop_data_frame_no_start <- self$run_instat_calculation(propor_table_no_start, display = TRUE) + + if(print_table) { + prop_data_frame_with_start$prop_success <- round(prop_data_frame_with_start$prop_success, 2) + prop_table_unstacked_with_start <- reshape2::dcast(formula = as.formula(paste(if(!missing(station)) paste(station, "+"), plant_length_name, "+", rain_total_name, "~", plant_day_name)), data = prop_data_frame_with_start, value.var = "prop_success") + if(!missing(station)) f <- interaction(prop_table_unstacked_with_start[[station]], prop_table_unstacked_with_start[[plant_length_name]], lex.order = TRUE) + else f <- prop_table_unstacked_with_start[[plant_length_name]] + prop_table_split_with_start <- split(prop_table_unstacked_with_start, f) + + prop_data_frame_no_start$prop_success <- round(prop_data_frame_no_start$prop_success, 2) + prop_table_unstacked_no_start <- reshape2::dcast(formula = as.formula(paste(if(!missing(station)) paste(station, "+"), plant_length_name, "+", rain_total_name, "~", plant_day_name)), data = prop_data_frame_no_start, value.var = "prop_success") + if(!missing(station)) f <- interaction(prop_table_unstacked_no_start[[station]], prop_table_unstacked_no_start[[plant_length_name]], lex.order = TRUE) + else f <- prop_table_unstacked_no_start[[plant_length_name]] + prop_table_split_no_start <- split(prop_table_unstacked_no_start, f) + + # Create an empty list to store the merged data + merged_list <- list() + + # Vectorize the addition of source indicators and merging of data frames + prop_table_split_with_start <- lapply(prop_table_split_with_start, function(df) { + df$source <- 'with start' + return(df) + }) + } } } -} -) +}) #' Converting grid (wide) format daily climatic data into tidy (long format) data #' @param x Input data frame @@ -3079,7 +3043,7 @@ DataBook$set("public","wrap_or_unwrap_data", function(data_name, col_name, colum } ) -DataBook$set("public", "anova_tables2", function(data_name, x_col_names, y_col_name, signif.stars = FALSE, sign_level = FALSE, means = FALSE) { - self$get_data_objects(data_name)$anova_tables2(x_col_names = x_col_names, y_col_name = y_col_name, signif.stars = signif.stars, sign_level = sign_level, means = means) +DataBook$set("public", "anova_tables2", function(data_name, x_col_names, y_col_name, total = TRUE, signif.stars = FALSE, sign_level = FALSE, means = FALSE) { + self$get_data_objects(data_name)$anova_tables2(x_col_names = x_col_names, y_col_name = y_col_name, total = total, signif.stars = signif.stars, sign_level = sign_level, means = means) } ) diff --git a/instat/static/InstatObject/R/stand_alone_functions.R b/instat/static/InstatObject/R/stand_alone_functions.R index 79b7472c29f..ef7ae16ee90 100644 --- a/instat/static/InstatObject/R/stand_alone_functions.R +++ b/instat/static/InstatObject/R/stand_alone_functions.R @@ -24,11 +24,7 @@ convert_to_character_matrix <- function(data, format_decimal_places = TRUE, deci #which are recognised oddly by the R.Net out[, i] <- as.character(data[[i]]) } else { - temp_data <- c() - for(val in data[[i]]){ - temp_data <- append(temp_data, format(val, digits = decimal_places[i], scientific = is_scientific[i])) - } - out[, i] <- temp_data + out[,i] <- format(data[[i]], digits = decimal_places[i], scientific = is_scientific[i]) } if (!is.null(na_display)) { out[is.na(data[[i]]), i] <- na_display @@ -3359,3 +3355,78 @@ ggwalter_lieth <- function (data, month, station = NULL, p_mes, tm_max, tm_min, return(wandlplot) } + +# Function to check if a repo exists and is in R. Can give either owner and repo, or give url +check_github_repo <- function(owner = NULL, repo = NULL, url = NULL) { + if (!is.null(url)){ + # Extract the part after 'github.com' + url <- sub(".*github.com/", "", url) + + # Extract the correct parts + owner <- dirname(url) + repo <- basename(url) + } + # Check if the package is already installed + if (requireNamespace(repo, quietly = TRUE)) { + + # Get the installed package's remote SHA (if installed via GitHub) + local_sha <- packageDescription(repo)$GithubSHA1 + + if (!is.null(local_sha)) { + # Get the latest commit SHA from the GitHub repository + latest_commit <- tryCatch({ + response <- gh::gh("/repos/:owner/:repo/commits", owner = owner, repo = repo, .limit = 1) + response[[1]]$sha + }, error = function(e) { + # Handle error if GitHub API call fails + return(NULL) + }) + + if (!is.null(latest_commit)) { + if (local_sha == latest_commit) { + return(0) # Package is installed and up-to-date + } else { + return(1) # Package is installed but not the latest version + } + } else { + return(2) # Unable to retrieve the latest commit from GitHub + } + } else { + return(3) # Package is installed but not from GitHub + } + + # If not installed, check if the repository exists on GitHub + } else { + tryCatch({ + response <- gh::gh("/repos/:owner/:repo", owner = owner, repo = repo, verb = "GET", silent = TRUE) + if (response$language == "R") { + return(4) # Repository exists and is in the R language + } else { + return(5) # Repository exists, but isn't in the R language + } + }, error = function(e) { + return(6) # Error occurred, repository doesn't exist + }) + } +} +#Convert Decimal to Fractions +frac10 <- function(x) {paste0(round(x * 10), "/", 10)} #Give fraction our of 10 for a decimal value +frac20 <- function(x) {paste0(round(x * 20), "/", 20)} #Give fraction our of 20 for a decimal value +frac100 <- function(x) {paste0(round(x * 100), "/", 100)} # Give fraction our of 100 for a decimal value + +frac_den <- function(x, den) {paste0(round(x * den), "/", den)} # Give fraction for a given denominator + +# Monitor memory usage function +monitor_memory <- function() { + if (.Platform$OS.type == "windows") { + mem_used <- memory.size() + } #else { + # mem_used <- sum(gc()[, "used"]) / 1024 # Convert KB to MB on non-Windows systems + # } + return(mem_used) +} + +time_operation <- function(expr) { + timing <- system.time(expr) + print(timing) +} \ No newline at end of file diff --git a/instat/translations/rInstatTranslations.db b/instat/translations/rInstatTranslations.db index 9f9e8ebd4de..3387a3bfc95 100644 Binary files a/instat/translations/rInstatTranslations.db and b/instat/translations/rInstatTranslations.db differ diff --git a/instat/ucrCalculator.Designer.vb b/instat/ucrCalculator.Designer.vb index 91563cf0e2c..e2921d45d82 100644 --- a/instat/ucrCalculator.Designer.vb +++ b/instat/ucrCalculator.Designer.vb @@ -635,6 +635,10 @@ Partial Class ucrCalculator Me.ucrSelectorForCalculations = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrReceiverForCalculation = New instat.ucrReceiverExpression() Me.grpFunctions = New System.Windows.Forms.GroupBox() + Me.cmdFracDen = New System.Windows.Forms.Button() + Me.cmdFrac20 = New System.Windows.Forms.Button() + Me.cmdFrac100 = New System.Windows.Forms.Button() + Me.cmdFrac10 = New System.Windows.Forms.Button() Me.cmdDigitsumSession = New System.Windows.Forms.Button() Me.cmdDigitsquSession = New System.Windows.Forms.Button() Me.cmdFunctionsDigitsum = New System.Windows.Forms.Button() @@ -7773,6 +7777,10 @@ Partial Class ucrCalculator ' 'grpFunctions ' + Me.grpFunctions.Controls.Add(Me.cmdFracDen) + Me.grpFunctions.Controls.Add(Me.cmdFrac20) + Me.grpFunctions.Controls.Add(Me.cmdFrac100) + Me.grpFunctions.Controls.Add(Me.cmdFrac10) Me.grpFunctions.Controls.Add(Me.cmdDigitsumSession) Me.grpFunctions.Controls.Add(Me.cmdDigitsquSession) Me.grpFunctions.Controls.Add(Me.cmdFunctionsDigitsum) @@ -7806,11 +7814,55 @@ Partial Class ucrCalculator Me.grpFunctions.Margin = New System.Windows.Forms.Padding(2) Me.grpFunctions.Name = "grpFunctions" Me.grpFunctions.Padding = New System.Windows.Forms.Padding(2) - Me.grpFunctions.Size = New System.Drawing.Size(259, 254) + Me.grpFunctions.Size = New System.Drawing.Size(259, 280) Me.grpFunctions.TabIndex = 216 Me.grpFunctions.TabStop = False Me.grpFunctions.Text = "Functions" ' + 'cmdFracDen + ' + Me.cmdFracDen.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdFracDen.Location = New System.Drawing.Point(189, 159) + Me.cmdFracDen.Margin = New System.Windows.Forms.Padding(2) + Me.cmdFracDen.Name = "cmdFracDen" + Me.cmdFracDen.Size = New System.Drawing.Size(62, 30) + Me.cmdFracDen.TabIndex = 232 + Me.cmdFracDen.Text = "frac_den" + Me.cmdFracDen.UseVisualStyleBackColor = True + ' + 'cmdFrac20 + ' + Me.cmdFrac20.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdFrac20.Location = New System.Drawing.Point(67, 159) + Me.cmdFrac20.Margin = New System.Windows.Forms.Padding(2) + Me.cmdFrac20.Name = "cmdFrac20" + Me.cmdFrac20.Size = New System.Drawing.Size(62, 30) + Me.cmdFrac20.TabIndex = 231 + Me.cmdFrac20.Text = "frac20" + Me.cmdFrac20.UseVisualStyleBackColor = True + ' + 'cmdFrac100 + ' + Me.cmdFrac100.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdFrac100.Location = New System.Drawing.Point(128, 159) + Me.cmdFrac100.Margin = New System.Windows.Forms.Padding(2) + Me.cmdFrac100.Name = "cmdFrac100" + Me.cmdFrac100.Size = New System.Drawing.Size(62, 30) + Me.cmdFrac100.TabIndex = 230 + Me.cmdFrac100.Text = "frac100" + Me.cmdFrac100.UseVisualStyleBackColor = True + ' + 'cmdFrac10 + ' + Me.cmdFrac10.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdFrac10.Location = New System.Drawing.Point(2, 159) + Me.cmdFrac10.Margin = New System.Windows.Forms.Padding(2) + Me.cmdFrac10.Name = "cmdFrac10" + Me.cmdFrac10.Size = New System.Drawing.Size(66, 30) + Me.cmdFrac10.TabIndex = 229 + Me.cmdFrac10.Text = "frac10" + Me.cmdFrac10.UseVisualStyleBackColor = True + ' 'cmdDigitsumSession ' Me.cmdDigitsumSession.ImeMode = System.Windows.Forms.ImeMode.NoControl @@ -7893,7 +7945,7 @@ Partial Class ucrCalculator ' Me.cmdRhelpFunctions.AutoSize = True Me.cmdRhelpFunctions.ContextMenuStrip = Me.ContextMenuStripFunctions - Me.cmdRhelpFunctions.Location = New System.Drawing.Point(165, 217) + Me.cmdRhelpFunctions.Location = New System.Drawing.Point(165, 246) Me.cmdRhelpFunctions.Margin = New System.Windows.Forms.Padding(2) Me.cmdRhelpFunctions.Name = "cmdRhelpFunctions" Me.cmdRhelpFunctions.Size = New System.Drawing.Size(86, 30) @@ -7988,7 +8040,7 @@ Partial Class ucrCalculator ' Me.cmdCoef.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) Me.cmdCoef.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdCoef.Location = New System.Drawing.Point(128, 188) + Me.cmdCoef.Location = New System.Drawing.Point(128, 217) Me.cmdCoef.Margin = New System.Windows.Forms.Padding(2) Me.cmdCoef.Name = "cmdCoef" Me.cmdCoef.Size = New System.Drawing.Size(62, 30) @@ -8012,7 +8064,7 @@ Partial Class ucrCalculator ' Me.cmdProd.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) Me.cmdProd.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdProd.Location = New System.Drawing.Point(2, 188) + Me.cmdProd.Location = New System.Drawing.Point(2, 217) Me.cmdProd.Margin = New System.Windows.Forms.Padding(2) Me.cmdProd.Name = "cmdProd" Me.cmdProd.Size = New System.Drawing.Size(66, 30) @@ -8036,7 +8088,7 @@ Partial Class ucrCalculator ' Me.cmdCombn.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) Me.cmdCombn.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdCombn.Location = New System.Drawing.Point(67, 188) + Me.cmdCombn.Location = New System.Drawing.Point(67, 217) Me.cmdCombn.Margin = New System.Windows.Forms.Padding(2) Me.cmdCombn.Name = "cmdCombn" Me.cmdCombn.Size = New System.Drawing.Size(62, 30) @@ -8060,7 +8112,7 @@ Partial Class ucrCalculator ' Me.cmdCoeffs2.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) Me.cmdCoeffs2.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdCoeffs2.Location = New System.Drawing.Point(189, 188) + Me.cmdCoeffs2.Location = New System.Drawing.Point(189, 217) Me.cmdCoeffs2.Margin = New System.Windows.Forms.Padding(2) Me.cmdCoeffs2.Name = "cmdCoeffs2" Me.cmdCoeffs2.Size = New System.Drawing.Size(62, 30) @@ -8096,7 +8148,7 @@ Partial Class ucrCalculator ' Me.cmdCoeffs.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) Me.cmdCoeffs.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdCoeffs.Location = New System.Drawing.Point(189, 159) + Me.cmdCoeffs.Location = New System.Drawing.Point(189, 188) Me.cmdCoeffs.Margin = New System.Windows.Forms.Padding(2) Me.cmdCoeffs.Name = "cmdCoeffs" Me.cmdCoeffs.Size = New System.Drawing.Size(62, 30) @@ -8120,7 +8172,7 @@ Partial Class ucrCalculator ' Me.cmdRoots.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) Me.cmdRoots.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdRoots.Location = New System.Drawing.Point(128, 159) + Me.cmdRoots.Location = New System.Drawing.Point(128, 188) Me.cmdRoots.Margin = New System.Windows.Forms.Padding(2) Me.cmdRoots.Name = "cmdRoots" Me.cmdRoots.Size = New System.Drawing.Size(62, 30) @@ -8132,7 +8184,7 @@ Partial Class ucrCalculator ' Me.cmdPolynomial.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) Me.cmdPolynomial.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdPolynomial.Location = New System.Drawing.Point(2, 159) + Me.cmdPolynomial.Location = New System.Drawing.Point(2, 188) Me.cmdPolynomial.Margin = New System.Windows.Forms.Padding(2) Me.cmdPolynomial.Name = "cmdPolynomial" Me.cmdPolynomial.Size = New System.Drawing.Size(66, 30) @@ -8144,7 +8196,7 @@ Partial Class ucrCalculator ' Me.cmdOrigin.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) Me.cmdOrigin.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdOrigin.Location = New System.Drawing.Point(67, 159) + Me.cmdOrigin.Location = New System.Drawing.Point(67, 188) Me.cmdOrigin.Margin = New System.Windows.Forms.Padding(2) Me.cmdOrigin.Name = "cmdOrigin" Me.cmdOrigin.Size = New System.Drawing.Size(62, 30) @@ -8168,6 +8220,7 @@ Partial Class ucrCalculator Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True + Me.Controls.Add(Me.grpList) Me.Controls.Add(Me.ucrChkStoreScalar) Me.Controls.Add(Me.cmdRhelpList) Me.Controls.Add(Me.cmdWakefieldHelp) @@ -8180,7 +8233,6 @@ Partial Class ucrCalculator Me.Controls.Add(Me.ucrSelectorForCalculations) Me.Controls.Add(Me.ucrReceiverForCalculation) Me.Controls.Add(Me.lblExpression) - Me.Controls.Add(Me.grpList) Me.Controls.Add(Me.grpFunctions) Me.Controls.Add(Me.grpLogical) Me.Controls.Add(Me.grpDates) @@ -8885,4 +8937,8 @@ Partial Class ucrCalculator Friend WithEvents cmdRescale As Button Friend WithEvents ScalesToolStripMenuItem As ToolStripMenuItem Friend WithEvents ucrChkStoreScalar As CheckBox + Friend WithEvents cmdFracDen As Button + Friend WithEvents cmdFrac20 As Button + Friend WithEvents cmdFrac100 As Button + Friend WithEvents cmdFrac10 As Button End Class diff --git a/instat/ucrCalculator.vb b/instat/ucrCalculator.vb index c1688b45298..745d960a3dc 100644 --- a/instat/ucrCalculator.vb +++ b/instat/ucrCalculator.vb @@ -494,6 +494,10 @@ Public Class ucrCalculator ttCalculator.SetToolTip(cmdPascal, "Gives Pascal triangles, e.g. for c(1,2,3,4) gives 1, (1,1), (1, 2, 1), (1, 3, 3, 1)") ttCalculator.SetToolTip(cmdMASSFractions, "changes decimal data into a character variable with fractions. So 1.5 becomes 3/2, 0.25 becomes 1/4 etc.") ttCalculator.SetToolTip(cmdDecimals, "the inverse of the fractions key. So 3/2 becomes 1.5, 1/4 becomes 0.25 etc.") + ttCalculator.SetToolTip(cmdFrac10, "Give fraction our of 10 for a decimal value. For example for 0.36 the value is 4/10") + ttCalculator.SetToolTip(cmdFrac20, "Give fraction our of 20 for a decimal value. For example for 0.36 the value is 7/20") + ttCalculator.SetToolTip(cmdFrac100, "Give fraction our of 100 for a decimal value. For example for 0.36 the value is 36/100") + ttCalculator.SetToolTip(cmdFracDen, "Give fraction for a given denominator. For example frac_den(0.36, 50) gives 18/50") '--------------------------------------------------------------------------------------------------------------------- Const strTooltipCmdLength = "number Of observations: For example length(c(1,2,3,4,NA)) = 5 " @@ -5893,7 +5897,7 @@ Public Class ucrCalculator Private Sub cmdOrigin_Click(sender As Object, e As EventArgs) Handles cmdOrigin.Click If chkShowParameters.Checked Then - ucrReceiverForCalculation.AddToReceiverAtCursorPosition("polynom::change.origin( p= ,o= )", 6) + ucrReceiverForCalculation.AddToReceiverAtCursorPosition("polynom::change.origin(p= ,o= )", 6) Else ucrReceiverForCalculation.AddToReceiverAtCursorPosition("polynom::change.origin(, )", 3) End If @@ -6097,4 +6101,36 @@ Public Class ucrCalculator ucrReceiverForCalculation.AddToReceiverAtCursorPosition("decimals( )", 2) End If End Sub + + Private Sub cmdFrac10_Click(sender As Object, e As EventArgs) Handles cmdFrac10.Click + If chkShowParameters.Checked Then + ucrReceiverForCalculation.AddToReceiverAtCursorPosition("frac10(x= )", 2) + Else + ucrReceiverForCalculation.AddToReceiverAtCursorPosition("frac10( )", 2) + End If + End Sub + + Private Sub cmdFrac20_Click(sender As Object, e As EventArgs) Handles cmdFrac20.Click + If chkShowParameters.Checked Then + ucrReceiverForCalculation.AddToReceiverAtCursorPosition("frac20(x= )", 2) + Else + ucrReceiverForCalculation.AddToReceiverAtCursorPosition("frac20( )", 2) + End If + End Sub + + Private Sub cmdFrac100_Click(sender As Object, e As EventArgs) Handles cmdFrac100.Click + If chkShowParameters.Checked Then + ucrReceiverForCalculation.AddToReceiverAtCursorPosition("frac100(x= )", 2) + Else + ucrReceiverForCalculation.AddToReceiverAtCursorPosition("frac100( )", 2) + End If + End Sub + + Private Sub cmdFracDen_Click(sender As Object, e As EventArgs) Handles cmdFracDen.Click + If chkShowParameters.Checked Then + ucrReceiverForCalculation.AddToReceiverAtCursorPosition("frac_den(x= ,den= )", 8) + Else + ucrReceiverForCalculation.AddToReceiverAtCursorPosition("frac_den(, )", 3) + End If + End Sub End Class \ No newline at end of file diff --git a/instat/ucrColors.vb b/instat/ucrColors.vb index faa479b290f..fe3ddac174d 100644 --- a/instat/ucrColors.vb +++ b/instat/ucrColors.vb @@ -27,7 +27,7 @@ Public Class ucrColors ' Add any initialization after the InitializeComponent() call. If dctColours.Count = 0 Then - dctColours.Add("NULL", "NULL") + dctColours.Add("None", "NULL") dctColours.Add(strPickColour, strPickColour) dctColours.Add("Black", Chr(34) & "black" & Chr(34)) dctColours.Add("White", Chr(34) & "white" & Chr(34)) diff --git a/instat/ucrColumnMetadata.vb b/instat/ucrColumnMetadata.vb index d9f4db985ec..2d102ea97c4 100644 --- a/instat/ucrColumnMetadata.vb +++ b/instat/ucrColumnMetadata.vb @@ -387,7 +387,7 @@ Public Class ucrColumnMetadata If _grid.GetSelectedRows.Count = GetCurrentDataFrameFocus()?.iTotalColumnCount Then MsgBox("Cannot delete all visible columns." & Environment.NewLine & "Use Prepare > Data Object > Delete Data Frame if you wish to delete the data.", MsgBoxStyle.Information, "Cannot Delete All Columns") Else - Dim deleteCol = MsgBox("Are you sure you want to delete these column(s)?" & Environment.NewLine & "This action cannot be undone.", MessageBoxButtons.YesNo, "Delete Column") + Dim deleteCol = MsgBox("Are you sure you want to delete these column(s)?", MessageBoxButtons.YesNo, "Delete Column") If deleteCol = DialogResult.Yes Then StartWait() GetCurrentDataFrameFocus().clsPrepareFunctions.DeleteColumn(GetSelectedDataframeColumnsFromSelectedRows) diff --git a/instat/ucrDataView.Designer.vb b/instat/ucrDataView.Designer.vb index 72b122e3328..6f86b446e0f 100644 --- a/instat/ucrDataView.Designer.vb +++ b/instat/ucrDataView.Designer.vb @@ -150,9 +150,9 @@ Partial Class ucrDataView Me.lblRowNext = New System.Windows.Forms.Label() Me.lblColLast = New System.Windows.Forms.Label() Me.lblRowBack = New System.Windows.Forms.Label() + Me.ttGoToRowOrColPage = New System.Windows.Forms.ToolTip(Me.components) Me.ucrReoGrid = New instat.ucrDataViewReoGrid() Me.ucrLinuxGrid = New instat.ucrDataViewLinuxGrid() - Me.ttGoToRowOrColPage = New System.Windows.Forms.ToolTip(Me.components) Me.columnContextMenuStrip.SuspendLayout() Me.cellContextMenuStrip.SuspendLayout() Me.rowContextMenuStrip.SuspendLayout() @@ -171,159 +171,159 @@ Partial Class ucrDataView Me.columnContextMenuStrip.ImageScalingSize = New System.Drawing.Size(20, 20) Me.columnContextMenuStrip.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuColumnRename, Me.mnuDuplicateColumn, Me.mnuReorderColumns, Me.mnuInsertColsBefore, Me.mnuInsertColsAfter, Me.mnuDeleteCol, Me.ToolStripSeparator13, Me.mnuEditCell2, Me.mnuDeleteCells2, Me.toolStripMenuItem2, Me.mnuConvertToFactor, Me.mnuCovertToOrderedFactors, Me.mnuConvertText, Me.mnuConvertToLogical, Me.mnuConvertVariate, Me.ToolStripSeparator1, Me.mnuLevelsLabels, Me.toolStripMenuItem21, Me.mnuSort, Me.mnuColumnAddComment, Me.mnuColumnFilterRows, Me.mnuColumnContextColumnSelection, Me.mnuColumnContextRemoveCurrentColumnSelection, Me.mnuClearColumnFilter, Me.ToolStripSeparator8, Me.mnuHelp}) Me.columnContextMenuStrip.Name = "columnContextMenuStrip" - Me.columnContextMenuStrip.Size = New System.Drawing.Size(215, 496) + Me.columnContextMenuStrip.Size = New System.Drawing.Size(293, 706) ' 'mnuColumnRename ' Me.mnuColumnRename.Name = "mnuColumnRename" - Me.mnuColumnRename.Size = New System.Drawing.Size(214, 22) + Me.mnuColumnRename.Size = New System.Drawing.Size(292, 32) Me.mnuColumnRename.Text = "Rename Column..." ' 'mnuDuplicateColumn ' Me.mnuDuplicateColumn.Name = "mnuDuplicateColumn" - Me.mnuDuplicateColumn.Size = New System.Drawing.Size(214, 22) + Me.mnuDuplicateColumn.Size = New System.Drawing.Size(292, 32) Me.mnuDuplicateColumn.Text = "Duplicate Column..." ' 'mnuReorderColumns ' Me.mnuReorderColumns.Name = "mnuReorderColumns" - Me.mnuReorderColumns.Size = New System.Drawing.Size(214, 22) + Me.mnuReorderColumns.Size = New System.Drawing.Size(292, 32) Me.mnuReorderColumns.Text = "Reorder Column(s)..." ' 'mnuInsertColsBefore ' Me.mnuInsertColsBefore.Name = "mnuInsertColsBefore" - Me.mnuInsertColsBefore.Size = New System.Drawing.Size(214, 22) + Me.mnuInsertColsBefore.Size = New System.Drawing.Size(292, 32) Me.mnuInsertColsBefore.Text = "Insert Column(s) Before" ' 'mnuInsertColsAfter ' Me.mnuInsertColsAfter.Name = "mnuInsertColsAfter" - Me.mnuInsertColsAfter.Size = New System.Drawing.Size(214, 22) + Me.mnuInsertColsAfter.Size = New System.Drawing.Size(292, 32) Me.mnuInsertColsAfter.Text = "Insert Column(s) After" ' 'mnuDeleteCol ' Me.mnuDeleteCol.Name = "mnuDeleteCol" - Me.mnuDeleteCol.Size = New System.Drawing.Size(214, 22) + Me.mnuDeleteCol.Size = New System.Drawing.Size(292, 32) Me.mnuDeleteCol.Text = "Delete Column(s)" ' 'ToolStripSeparator13 ' Me.ToolStripSeparator13.Name = "ToolStripSeparator13" - Me.ToolStripSeparator13.Size = New System.Drawing.Size(211, 6) + Me.ToolStripSeparator13.Size = New System.Drawing.Size(289, 6) ' 'mnuEditCell2 ' Me.mnuEditCell2.Enabled = False Me.mnuEditCell2.Name = "mnuEditCell2" - Me.mnuEditCell2.Size = New System.Drawing.Size(214, 22) + Me.mnuEditCell2.Size = New System.Drawing.Size(292, 32) Me.mnuEditCell2.Text = "Edit Cell..." ' 'mnuDeleteCells2 ' Me.mnuDeleteCells2.Enabled = False Me.mnuDeleteCells2.Name = "mnuDeleteCells2" - Me.mnuDeleteCells2.Size = New System.Drawing.Size(214, 22) + Me.mnuDeleteCells2.Size = New System.Drawing.Size(292, 32) Me.mnuDeleteCells2.Text = "Delete Cell(s)" ' 'toolStripMenuItem2 ' Me.toolStripMenuItem2.Name = "toolStripMenuItem2" - Me.toolStripMenuItem2.Size = New System.Drawing.Size(211, 6) + Me.toolStripMenuItem2.Size = New System.Drawing.Size(289, 6) ' 'mnuConvertToFactor ' Me.mnuConvertToFactor.Name = "mnuConvertToFactor" - Me.mnuConvertToFactor.Size = New System.Drawing.Size(214, 22) + Me.mnuConvertToFactor.Size = New System.Drawing.Size(292, 32) Me.mnuConvertToFactor.Text = "Convert to Factor" ' 'mnuCovertToOrderedFactors ' Me.mnuCovertToOrderedFactors.Name = "mnuCovertToOrderedFactors" - Me.mnuCovertToOrderedFactors.Size = New System.Drawing.Size(214, 22) + Me.mnuCovertToOrderedFactors.Size = New System.Drawing.Size(292, 32) Me.mnuCovertToOrderedFactors.Text = "Convert to Ordered Factor" ' 'mnuConvertText ' Me.mnuConvertText.Name = "mnuConvertText" - Me.mnuConvertText.Size = New System.Drawing.Size(214, 22) + Me.mnuConvertText.Size = New System.Drawing.Size(292, 32) Me.mnuConvertText.Text = "Convert to Character" ' 'mnuConvertToLogical ' Me.mnuConvertToLogical.Name = "mnuConvertToLogical" - Me.mnuConvertToLogical.Size = New System.Drawing.Size(214, 22) + Me.mnuConvertToLogical.Size = New System.Drawing.Size(292, 32) Me.mnuConvertToLogical.Text = "Convert to Logical" ' 'mnuConvertVariate ' Me.mnuConvertVariate.Name = "mnuConvertVariate" - Me.mnuConvertVariate.Size = New System.Drawing.Size(214, 22) + Me.mnuConvertVariate.Size = New System.Drawing.Size(292, 32) Me.mnuConvertVariate.Text = "Convert to Numeric" ' 'ToolStripSeparator1 ' Me.ToolStripSeparator1.Name = "ToolStripSeparator1" - Me.ToolStripSeparator1.Size = New System.Drawing.Size(211, 6) + Me.ToolStripSeparator1.Size = New System.Drawing.Size(289, 6) ' 'mnuLevelsLabels ' Me.mnuLevelsLabels.Name = "mnuLevelsLabels" - Me.mnuLevelsLabels.Size = New System.Drawing.Size(214, 22) + Me.mnuLevelsLabels.Size = New System.Drawing.Size(292, 32) Me.mnuLevelsLabels.Text = "Levels/Labels..." ' 'toolStripMenuItem21 ' Me.toolStripMenuItem21.Name = "toolStripMenuItem21" - Me.toolStripMenuItem21.Size = New System.Drawing.Size(211, 6) + Me.toolStripMenuItem21.Size = New System.Drawing.Size(289, 6) ' 'mnuSort ' Me.mnuSort.Name = "mnuSort" - Me.mnuSort.Size = New System.Drawing.Size(214, 22) + Me.mnuSort.Size = New System.Drawing.Size(292, 32) Me.mnuSort.Text = "Sort..." ' 'mnuColumnAddComment ' Me.mnuColumnAddComment.Name = "mnuColumnAddComment" - Me.mnuColumnAddComment.Size = New System.Drawing.Size(214, 22) + Me.mnuColumnAddComment.Size = New System.Drawing.Size(292, 32) Me.mnuColumnAddComment.Text = "Add Comment..." ' 'mnuColumnFilterRows ' Me.mnuColumnFilterRows.Name = "mnuColumnFilterRows" - Me.mnuColumnFilterRows.Size = New System.Drawing.Size(214, 22) + Me.mnuColumnFilterRows.Size = New System.Drawing.Size(292, 32) Me.mnuColumnFilterRows.Text = "Filter Rows..." ' 'mnuColumnContextColumnSelection ' Me.mnuColumnContextColumnSelection.Name = "mnuColumnContextColumnSelection" - Me.mnuColumnContextColumnSelection.Size = New System.Drawing.Size(214, 22) + Me.mnuColumnContextColumnSelection.Size = New System.Drawing.Size(292, 32) Me.mnuColumnContextColumnSelection.Text = "Select Columns..." ' 'mnuColumnContextRemoveCurrentColumnSelection ' Me.mnuColumnContextRemoveCurrentColumnSelection.Name = "mnuColumnContextRemoveCurrentColumnSelection" - Me.mnuColumnContextRemoveCurrentColumnSelection.Size = New System.Drawing.Size(214, 22) + Me.mnuColumnContextRemoveCurrentColumnSelection.Size = New System.Drawing.Size(292, 32) Me.mnuColumnContextRemoveCurrentColumnSelection.Text = "Remove Column Selection" ' 'mnuClearColumnFilter ' Me.mnuClearColumnFilter.Name = "mnuClearColumnFilter" - Me.mnuClearColumnFilter.Size = New System.Drawing.Size(214, 22) + Me.mnuClearColumnFilter.Size = New System.Drawing.Size(292, 32) Me.mnuClearColumnFilter.Text = "Remove Current Filter" ' 'ToolStripSeparator8 ' Me.ToolStripSeparator8.Name = "ToolStripSeparator8" - Me.ToolStripSeparator8.Size = New System.Drawing.Size(211, 6) + Me.ToolStripSeparator8.Size = New System.Drawing.Size(289, 6) ' 'mnuHelp ' Me.mnuHelp.Name = "mnuHelp" - Me.mnuHelp.Size = New System.Drawing.Size(214, 22) + Me.mnuHelp.Size = New System.Drawing.Size(292, 32) Me.mnuHelp.Text = "Help" ' 'cellContextMenuStrip @@ -331,146 +331,146 @@ Partial Class ucrDataView Me.cellContextMenuStrip.ImageScalingSize = New System.Drawing.Size(20, 20) Me.cellContextMenuStrip.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuRenameColumn, Me.mnuDuplColumn, Me.mnuReorderColumn, Me.mnuDeleteCol2, Me.ToolStripSeparator14, Me.mnuEditCell, Me.mnuDeleteCells, Me.ToolStripSeparator5, Me.mnuConvertToFact, Me.mnuConvertToOrderedFactor, Me.mnuConvertToCharacter, Me.mnuConvertToLogic, Me.mnuConvertToNumeric, Me.ToolStripSeparator6, Me.mnuLabelsLevel, Me.ToolStripSeparator7, Me.mnuSorts, Me.mnuComment, Me.mnuFilterRows, Me.mnuCellContextColumnSelection, Me.mnuCellContextRemoveCurrentColumnSelection, Me.mnuRemoveCurrentFilters, Me.ToolStripSeparator9, Me.mnuHelp1}) Me.cellContextMenuStrip.Name = "cellContextMenuStrip" - Me.cellContextMenuStrip.Size = New System.Drawing.Size(215, 452) + Me.cellContextMenuStrip.Size = New System.Drawing.Size(293, 642) ' 'mnuRenameColumn ' Me.mnuRenameColumn.Name = "mnuRenameColumn" - Me.mnuRenameColumn.Size = New System.Drawing.Size(214, 22) + Me.mnuRenameColumn.Size = New System.Drawing.Size(292, 32) Me.mnuRenameColumn.Text = "Rename Column..." ' 'mnuDuplColumn ' Me.mnuDuplColumn.Name = "mnuDuplColumn" - Me.mnuDuplColumn.Size = New System.Drawing.Size(214, 22) + Me.mnuDuplColumn.Size = New System.Drawing.Size(292, 32) Me.mnuDuplColumn.Text = "Duplicate Column..." ' 'mnuReorderColumn ' Me.mnuReorderColumn.Name = "mnuReorderColumn" - Me.mnuReorderColumn.Size = New System.Drawing.Size(214, 22) + Me.mnuReorderColumn.Size = New System.Drawing.Size(292, 32) Me.mnuReorderColumn.Text = "Reorder Column(s)..." ' 'mnuDeleteCol2 ' Me.mnuDeleteCol2.Enabled = False Me.mnuDeleteCol2.Name = "mnuDeleteCol2" - Me.mnuDeleteCol2.Size = New System.Drawing.Size(214, 22) + Me.mnuDeleteCol2.Size = New System.Drawing.Size(292, 32) Me.mnuDeleteCol2.Text = "Delete Column(s)" ' 'ToolStripSeparator14 ' Me.ToolStripSeparator14.Name = "ToolStripSeparator14" - Me.ToolStripSeparator14.Size = New System.Drawing.Size(211, 6) + Me.ToolStripSeparator14.Size = New System.Drawing.Size(289, 6) ' 'mnuEditCell ' Me.mnuEditCell.Name = "mnuEditCell" - Me.mnuEditCell.Size = New System.Drawing.Size(214, 22) + Me.mnuEditCell.Size = New System.Drawing.Size(292, 32) Me.mnuEditCell.Text = "Edit Cell..." ' 'mnuDeleteCells ' Me.mnuDeleteCells.Name = "mnuDeleteCells" - Me.mnuDeleteCells.Size = New System.Drawing.Size(214, 22) + Me.mnuDeleteCells.Size = New System.Drawing.Size(292, 32) Me.mnuDeleteCells.Text = "Delete Cell(s)" ' 'ToolStripSeparator5 ' Me.ToolStripSeparator5.Name = "ToolStripSeparator5" - Me.ToolStripSeparator5.Size = New System.Drawing.Size(211, 6) + Me.ToolStripSeparator5.Size = New System.Drawing.Size(289, 6) ' 'mnuConvertToFact ' Me.mnuConvertToFact.Name = "mnuConvertToFact" - Me.mnuConvertToFact.Size = New System.Drawing.Size(214, 22) + Me.mnuConvertToFact.Size = New System.Drawing.Size(292, 32) Me.mnuConvertToFact.Text = "Convert to Factor" ' 'mnuConvertToOrderedFactor ' Me.mnuConvertToOrderedFactor.Name = "mnuConvertToOrderedFactor" - Me.mnuConvertToOrderedFactor.Size = New System.Drawing.Size(214, 22) + Me.mnuConvertToOrderedFactor.Size = New System.Drawing.Size(292, 32) Me.mnuConvertToOrderedFactor.Text = "Convert to Ordered Factor" ' 'mnuConvertToCharacter ' Me.mnuConvertToCharacter.Name = "mnuConvertToCharacter" - Me.mnuConvertToCharacter.Size = New System.Drawing.Size(214, 22) + Me.mnuConvertToCharacter.Size = New System.Drawing.Size(292, 32) Me.mnuConvertToCharacter.Text = "Convert to Character" ' 'mnuConvertToLogic ' Me.mnuConvertToLogic.Name = "mnuConvertToLogic" - Me.mnuConvertToLogic.Size = New System.Drawing.Size(214, 22) + Me.mnuConvertToLogic.Size = New System.Drawing.Size(292, 32) Me.mnuConvertToLogic.Text = "Convert to Logical" ' 'mnuConvertToNumeric ' Me.mnuConvertToNumeric.Name = "mnuConvertToNumeric" - Me.mnuConvertToNumeric.Size = New System.Drawing.Size(214, 22) + Me.mnuConvertToNumeric.Size = New System.Drawing.Size(292, 32) Me.mnuConvertToNumeric.Text = "Convert to Numeric" ' 'ToolStripSeparator6 ' Me.ToolStripSeparator6.Name = "ToolStripSeparator6" - Me.ToolStripSeparator6.Size = New System.Drawing.Size(211, 6) + Me.ToolStripSeparator6.Size = New System.Drawing.Size(289, 6) ' 'mnuLabelsLevel ' Me.mnuLabelsLevel.Name = "mnuLabelsLevel" - Me.mnuLabelsLevel.Size = New System.Drawing.Size(214, 22) + Me.mnuLabelsLevel.Size = New System.Drawing.Size(292, 32) Me.mnuLabelsLevel.Text = "Levels/Labels..." ' 'ToolStripSeparator7 ' Me.ToolStripSeparator7.Name = "ToolStripSeparator7" - Me.ToolStripSeparator7.Size = New System.Drawing.Size(211, 6) + Me.ToolStripSeparator7.Size = New System.Drawing.Size(289, 6) ' 'mnuSorts ' Me.mnuSorts.Name = "mnuSorts" - Me.mnuSorts.Size = New System.Drawing.Size(214, 22) + Me.mnuSorts.Size = New System.Drawing.Size(292, 32) Me.mnuSorts.Text = "Sort..." ' 'mnuComment ' Me.mnuComment.Name = "mnuComment" - Me.mnuComment.Size = New System.Drawing.Size(214, 22) + Me.mnuComment.Size = New System.Drawing.Size(292, 32) Me.mnuComment.Text = "Add Comment..." ' 'mnuFilterRows ' Me.mnuFilterRows.Name = "mnuFilterRows" - Me.mnuFilterRows.Size = New System.Drawing.Size(214, 22) + Me.mnuFilterRows.Size = New System.Drawing.Size(292, 32) Me.mnuFilterRows.Text = "Filter Rows..." ' 'mnuCellContextColumnSelection ' Me.mnuCellContextColumnSelection.Name = "mnuCellContextColumnSelection" - Me.mnuCellContextColumnSelection.Size = New System.Drawing.Size(214, 22) + Me.mnuCellContextColumnSelection.Size = New System.Drawing.Size(292, 32) Me.mnuCellContextColumnSelection.Text = "Select Columns..." ' 'mnuCellContextRemoveCurrentColumnSelection ' Me.mnuCellContextRemoveCurrentColumnSelection.Name = "mnuCellContextRemoveCurrentColumnSelection" - Me.mnuCellContextRemoveCurrentColumnSelection.Size = New System.Drawing.Size(214, 22) + Me.mnuCellContextRemoveCurrentColumnSelection.Size = New System.Drawing.Size(292, 32) Me.mnuCellContextRemoveCurrentColumnSelection.Text = "Remove Column Selection" ' 'mnuRemoveCurrentFilters ' Me.mnuRemoveCurrentFilters.Name = "mnuRemoveCurrentFilters" - Me.mnuRemoveCurrentFilters.Size = New System.Drawing.Size(214, 22) + Me.mnuRemoveCurrentFilters.Size = New System.Drawing.Size(292, 32) Me.mnuRemoveCurrentFilters.Text = "Remove Current Filter" ' 'ToolStripSeparator9 ' Me.ToolStripSeparator9.Name = "ToolStripSeparator9" - Me.ToolStripSeparator9.Size = New System.Drawing.Size(211, 6) + Me.ToolStripSeparator9.Size = New System.Drawing.Size(289, 6) ' 'mnuHelp1 ' Me.mnuHelp1.Name = "mnuHelp1" - Me.mnuHelp1.Size = New System.Drawing.Size(214, 22) + Me.mnuHelp1.Size = New System.Drawing.Size(292, 32) Me.mnuHelp1.Text = "Help" ' 'rowContextMenuStrip @@ -478,77 +478,77 @@ Partial Class ucrDataView Me.rowContextMenuStrip.ImageScalingSize = New System.Drawing.Size(20, 20) Me.rowContextMenuStrip.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuInsertRowsBefore, Me.mnuInsertRowsAfter, Me.mnuDeleteRows, Me.ToolStripSeparator2, Me.mnuAddComment, Me.ToolStripSeparator4, Me.mnuFilter, Me.mnuRowContextColumnSelection, Me.mnuRowContextRemoveCurrentColumnSelection, Me.mnuRemoveCurrentFilter, Me.ToolStripSeparator10, Me.mnuHelp2}) Me.rowContextMenuStrip.Name = "columnContextMenuStrip" - Me.rowContextMenuStrip.Size = New System.Drawing.Size(215, 220) + Me.rowContextMenuStrip.Size = New System.Drawing.Size(292, 343) ' 'mnuInsertRowsBefore ' Me.mnuInsertRowsBefore.Name = "mnuInsertRowsBefore" - Me.mnuInsertRowsBefore.Size = New System.Drawing.Size(214, 22) + Me.mnuInsertRowsBefore.Size = New System.Drawing.Size(291, 32) Me.mnuInsertRowsBefore.Text = "Insert Row(s) Before" ' 'mnuInsertRowsAfter ' Me.mnuInsertRowsAfter.Name = "mnuInsertRowsAfter" - Me.mnuInsertRowsAfter.Size = New System.Drawing.Size(214, 22) + Me.mnuInsertRowsAfter.Size = New System.Drawing.Size(291, 32) Me.mnuInsertRowsAfter.Text = "Insert Row(s) After" ' 'mnuDeleteRows ' Me.mnuDeleteRows.Name = "mnuDeleteRows" - Me.mnuDeleteRows.Size = New System.Drawing.Size(214, 22) + Me.mnuDeleteRows.Size = New System.Drawing.Size(291, 32) Me.mnuDeleteRows.Text = "Delete Row(s)" ' 'ToolStripSeparator2 ' Me.ToolStripSeparator2.Name = "ToolStripSeparator2" - Me.ToolStripSeparator2.Size = New System.Drawing.Size(211, 6) + Me.ToolStripSeparator2.Size = New System.Drawing.Size(288, 6) ' 'mnuAddComment ' Me.mnuAddComment.Name = "mnuAddComment" - Me.mnuAddComment.Size = New System.Drawing.Size(214, 22) + Me.mnuAddComment.Size = New System.Drawing.Size(291, 32) Me.mnuAddComment.Text = "Add Comment..." ' 'ToolStripSeparator4 ' Me.ToolStripSeparator4.Name = "ToolStripSeparator4" - Me.ToolStripSeparator4.Size = New System.Drawing.Size(211, 6) + Me.ToolStripSeparator4.Size = New System.Drawing.Size(288, 6) ' 'mnuFilter ' Me.mnuFilter.Name = "mnuFilter" - Me.mnuFilter.Size = New System.Drawing.Size(214, 22) + Me.mnuFilter.Size = New System.Drawing.Size(291, 32) Me.mnuFilter.Tag = "Filter..." Me.mnuFilter.Text = "Filter Rows..." ' 'mnuRowContextColumnSelection ' Me.mnuRowContextColumnSelection.Name = "mnuRowContextColumnSelection" - Me.mnuRowContextColumnSelection.Size = New System.Drawing.Size(214, 22) + Me.mnuRowContextColumnSelection.Size = New System.Drawing.Size(291, 32) Me.mnuRowContextColumnSelection.Text = "Select Columns..." ' 'mnuRowContextRemoveCurrentColumnSelection ' Me.mnuRowContextRemoveCurrentColumnSelection.Name = "mnuRowContextRemoveCurrentColumnSelection" - Me.mnuRowContextRemoveCurrentColumnSelection.Size = New System.Drawing.Size(214, 22) + Me.mnuRowContextRemoveCurrentColumnSelection.Size = New System.Drawing.Size(291, 32) Me.mnuRowContextRemoveCurrentColumnSelection.Text = "Remove Column Selection" ' 'mnuRemoveCurrentFilter ' Me.mnuRemoveCurrentFilter.Name = "mnuRemoveCurrentFilter" - Me.mnuRemoveCurrentFilter.Size = New System.Drawing.Size(214, 22) + Me.mnuRemoveCurrentFilter.Size = New System.Drawing.Size(291, 32) Me.mnuRemoveCurrentFilter.Tag = "Remove_Current_Filter" Me.mnuRemoveCurrentFilter.Text = "Remove Current Filter" ' 'ToolStripSeparator10 ' Me.ToolStripSeparator10.Name = "ToolStripSeparator10" - Me.ToolStripSeparator10.Size = New System.Drawing.Size(211, 6) + Me.ToolStripSeparator10.Size = New System.Drawing.Size(288, 6) ' 'mnuHelp2 ' Me.mnuHelp2.Name = "mnuHelp2" - Me.mnuHelp2.Size = New System.Drawing.Size(214, 22) + Me.mnuHelp2.Size = New System.Drawing.Size(291, 32) Me.mnuHelp2.Text = "Help" ' 'statusColumnMenu @@ -556,77 +556,77 @@ Partial Class ucrDataView Me.statusColumnMenu.ImageScalingSize = New System.Drawing.Size(20, 20) Me.statusColumnMenu.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.renameSheet, Me.reorderSheet, Me.CopySheet, Me.deleteDataFrame, Me.HideSheet, Me.unhideSheet, Me.ToolStripSeparator12, Me.mnuBottomAddComment, Me.mnuViewHTML, Me.ViewSheet, Me.ToolStripSeparator11, Me.mnuHelp3}) Me.statusColumnMenu.Name = "statusColumnMenu" - Me.statusColumnMenu.Size = New System.Drawing.Size(163, 236) + Me.statusColumnMenu.Size = New System.Drawing.Size(218, 336) ' 'renameSheet ' Me.renameSheet.Name = "renameSheet" - Me.renameSheet.Size = New System.Drawing.Size(162, 22) + Me.renameSheet.Size = New System.Drawing.Size(217, 32) Me.renameSheet.Text = "Rename..." ' 'reorderSheet ' Me.reorderSheet.Name = "reorderSheet" - Me.reorderSheet.Size = New System.Drawing.Size(162, 22) + Me.reorderSheet.Size = New System.Drawing.Size(217, 32) Me.reorderSheet.Text = "Reorder..." ' 'CopySheet ' Me.CopySheet.Name = "CopySheet" - Me.CopySheet.Size = New System.Drawing.Size(162, 22) + Me.CopySheet.Size = New System.Drawing.Size(217, 32) Me.CopySheet.Text = "Copy..." ' 'deleteDataFrame ' Me.deleteDataFrame.Name = "deleteDataFrame" - Me.deleteDataFrame.Size = New System.Drawing.Size(162, 22) + Me.deleteDataFrame.Size = New System.Drawing.Size(217, 32) Me.deleteDataFrame.Text = "Delete..." ' 'HideSheet ' Me.HideSheet.Name = "HideSheet" - Me.HideSheet.Size = New System.Drawing.Size(162, 22) + Me.HideSheet.Size = New System.Drawing.Size(217, 32) Me.HideSheet.Text = "Hide" ' 'unhideSheet ' Me.unhideSheet.Name = "unhideSheet" - Me.unhideSheet.Size = New System.Drawing.Size(162, 22) + Me.unhideSheet.Size = New System.Drawing.Size(217, 32) Me.unhideSheet.Text = "Unhide..." ' 'ToolStripSeparator12 ' Me.ToolStripSeparator12.Name = "ToolStripSeparator12" - Me.ToolStripSeparator12.Size = New System.Drawing.Size(159, 6) + Me.ToolStripSeparator12.Size = New System.Drawing.Size(214, 6) ' 'mnuBottomAddComment ' Me.mnuBottomAddComment.Name = "mnuBottomAddComment" - Me.mnuBottomAddComment.Size = New System.Drawing.Size(162, 22) + Me.mnuBottomAddComment.Size = New System.Drawing.Size(217, 32) Me.mnuBottomAddComment.Text = "Add Comment..." ' 'mnuViewHTML ' Me.mnuViewHTML.Enabled = False Me.mnuViewHTML.Name = "mnuViewHTML" - Me.mnuViewHTML.Size = New System.Drawing.Size(162, 22) + Me.mnuViewHTML.Size = New System.Drawing.Size(217, 32) Me.mnuViewHTML.Text = "View HTML" ' 'ViewSheet ' Me.ViewSheet.Name = "ViewSheet" - Me.ViewSheet.Size = New System.Drawing.Size(162, 22) + Me.ViewSheet.Size = New System.Drawing.Size(217, 32) Me.ViewSheet.Text = "View Data Frame" ' 'ToolStripSeparator11 ' Me.ToolStripSeparator11.Name = "ToolStripSeparator11" - Me.ToolStripSeparator11.Size = New System.Drawing.Size(159, 6) + Me.ToolStripSeparator11.Size = New System.Drawing.Size(214, 6) ' 'mnuHelp3 ' Me.mnuHelp3.Name = "mnuHelp3" - Me.mnuHelp3.Size = New System.Drawing.Size(162, 22) + Me.mnuHelp3.Size = New System.Drawing.Size(217, 32) Me.mnuHelp3.Text = "Help" ' 'lblHeaderDataView @@ -636,9 +636,10 @@ Partial Class ucrDataView Me.lblHeaderDataView.Dock = System.Windows.Forms.DockStyle.Fill Me.lblHeaderDataView.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!) Me.lblHeaderDataView.ForeColor = System.Drawing.SystemColors.Control - Me.lblHeaderDataView.Location = New System.Drawing.Point(3, 0) + Me.lblHeaderDataView.Location = New System.Drawing.Point(4, 0) + Me.lblHeaderDataView.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblHeaderDataView.Name = "lblHeaderDataView" - Me.lblHeaderDataView.Size = New System.Drawing.Size(742, 20) + Me.lblHeaderDataView.Size = New System.Drawing.Size(1114, 30) Me.lblHeaderDataView.TabIndex = 5 Me.lblHeaderDataView.Text = "Data View" Me.lblHeaderDataView.TextAlign = System.Drawing.ContentAlignment.MiddleCenter @@ -649,7 +650,7 @@ Partial Class ucrDataView Me.tlpTableContainer.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333!)) Me.tlpTableContainer.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333!)) Me.tlpTableContainer.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333!)) - Me.tlpTableContainer.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 13.0!)) + Me.tlpTableContainer.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20.0!)) Me.tlpTableContainer.Controls.Add(Me.panelSectionsAll, 0, 1) Me.tlpTableContainer.Controls.Add(Me.lblHeaderDataView, 0, 0) Me.tlpTableContainer.Controls.Add(Me.TblPanPageDisplay, 1, 2) @@ -657,12 +658,13 @@ Partial Class ucrDataView Me.tlpTableContainer.Controls.Add(Me.ucrLinuxGrid, 1, 1) Me.tlpTableContainer.Dock = System.Windows.Forms.DockStyle.Fill Me.tlpTableContainer.Location = New System.Drawing.Point(0, 0) + Me.tlpTableContainer.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.tlpTableContainer.Name = "tlpTableContainer" Me.tlpTableContainer.RowCount = 3 - Me.tlpTableContainer.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20.0!)) + Me.tlpTableContainer.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30.0!)) Me.tlpTableContainer.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!)) - Me.tlpTableContainer.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20.0!)) - Me.tlpTableContainer.Size = New System.Drawing.Size(748, 481) + Me.tlpTableContainer.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30.0!)) + Me.tlpTableContainer.Size = New System.Drawing.Size(1122, 722) Me.tlpTableContainer.TabIndex = 6 ' 'panelSectionsAll @@ -672,10 +674,11 @@ Partial Class ucrDataView Me.panelSectionsAll.Controls.Add(Me.panelSectionStart) Me.panelSectionsAll.Controls.Add(Me.panelSectionRecent) Me.panelSectionsAll.Dock = System.Windows.Forms.DockStyle.Fill - Me.panelSectionsAll.Location = New System.Drawing.Point(3, 23) + Me.panelSectionsAll.Location = New System.Drawing.Point(4, 34) + Me.panelSectionsAll.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.panelSectionsAll.Name = "panelSectionsAll" Me.tlpTableContainer.SetRowSpan(Me.panelSectionsAll, 2) - Me.panelSectionsAll.Size = New System.Drawing.Size(243, 455) + Me.panelSectionsAll.Size = New System.Drawing.Size(366, 684) Me.panelSectionsAll.TabIndex = 9 ' 'panelSectionAdvanced @@ -684,9 +687,10 @@ Partial Class ucrDataView Me.panelSectionAdvanced.Controls.Add(Me.lblAdvanced) Me.panelSectionAdvanced.Controls.Add(Me.linkStartRestoreBackup) Me.panelSectionAdvanced.Controls.Add(Me.linkStartPasteScriptfromClipboard) - Me.panelSectionAdvanced.Location = New System.Drawing.Point(27, 412) + Me.panelSectionAdvanced.Location = New System.Drawing.Point(40, 618) + Me.panelSectionAdvanced.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.panelSectionAdvanced.Name = "panelSectionAdvanced" - Me.panelSectionAdvanced.Size = New System.Drawing.Size(374, 83) + Me.panelSectionAdvanced.Size = New System.Drawing.Size(561, 124) Me.panelSectionAdvanced.TabIndex = 12 ' 'linkStartAddRPackage @@ -695,9 +699,10 @@ Partial Class ucrDataView Me.linkStartAddRPackage.AutoSize = True Me.linkStartAddRPackage.ImeMode = System.Windows.Forms.ImeMode.NoControl Me.linkStartAddRPackage.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline - Me.linkStartAddRPackage.Location = New System.Drawing.Point(5, 64) + Me.linkStartAddRPackage.Location = New System.Drawing.Point(8, 96) + Me.linkStartAddRPackage.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.linkStartAddRPackage.Name = "linkStartAddRPackage" - Me.linkStartAddRPackage.Size = New System.Drawing.Size(187, 13) + Me.linkStartAddRPackage.Size = New System.Drawing.Size(275, 20) Me.linkStartAddRPackage.TabIndex = 6 Me.linkStartAddRPackage.TabStop = True Me.linkStartAddRPackage.Text = "Add R Package To R-Instat... (Online)" @@ -707,9 +712,10 @@ Partial Class ucrDataView Me.lblAdvanced.AutoSize = True Me.lblAdvanced.Font = New System.Drawing.Font("Microsoft Sans Serif", 15.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.lblAdvanced.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblAdvanced.Location = New System.Drawing.Point(3, 4) + Me.lblAdvanced.Location = New System.Drawing.Point(4, 6) + Me.lblAdvanced.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblAdvanced.Name = "lblAdvanced" - Me.lblAdvanced.Size = New System.Drawing.Size(108, 25) + Me.lblAdvanced.Size = New System.Drawing.Size(159, 37) Me.lblAdvanced.TabIndex = 0 Me.lblAdvanced.Text = "Advanced" ' @@ -719,9 +725,10 @@ Partial Class ucrDataView Me.linkStartRestoreBackup.AutoSize = True Me.linkStartRestoreBackup.ImeMode = System.Windows.Forms.ImeMode.NoControl Me.linkStartRestoreBackup.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline - Me.linkStartRestoreBackup.Location = New System.Drawing.Point(5, 47) + Me.linkStartRestoreBackup.Location = New System.Drawing.Point(8, 70) + Me.linkStartRestoreBackup.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.linkStartRestoreBackup.Name = "linkStartRestoreBackup" - Me.linkStartRestoreBackup.Size = New System.Drawing.Size(145, 13) + Me.linkStartRestoreBackup.Size = New System.Drawing.Size(216, 20) Me.linkStartRestoreBackup.TabIndex = 4 Me.linkStartRestoreBackup.TabStop = True Me.linkStartRestoreBackup.Text = "Restore Data From Backup..." @@ -732,9 +739,10 @@ Partial Class ucrDataView Me.linkStartPasteScriptfromClipboard.AutoSize = True Me.linkStartPasteScriptfromClipboard.ImeMode = System.Windows.Forms.ImeMode.NoControl Me.linkStartPasteScriptfromClipboard.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline - Me.linkStartPasteScriptfromClipboard.Location = New System.Drawing.Point(5, 30) + Me.linkStartPasteScriptfromClipboard.Location = New System.Drawing.Point(8, 45) + Me.linkStartPasteScriptfromClipboard.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.linkStartPasteScriptfromClipboard.Name = "linkStartPasteScriptfromClipboard" - Me.linkStartPasteScriptfromClipboard.Size = New System.Drawing.Size(137, 13) + Me.linkStartPasteScriptfromClipboard.Size = New System.Drawing.Size(207, 20) Me.linkStartPasteScriptfromClipboard.TabIndex = 5 Me.linkStartPasteScriptfromClipboard.TabStop = True Me.linkStartPasteScriptfromClipboard.Text = "Paste Script From Clipboard" @@ -745,9 +753,10 @@ Partial Class ucrDataView Me.panelSectionHelp.Controls.Add(Me.linkHelpGettingStarted) Me.panelSectionHelp.Controls.Add(Me.lblHelp) Me.panelSectionHelp.Controls.Add(Me.linkHelpRInstatResourcesSite) - Me.panelSectionHelp.Location = New System.Drawing.Point(28, 317) + Me.panelSectionHelp.Location = New System.Drawing.Point(42, 476) + Me.panelSectionHelp.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.panelSectionHelp.Name = "panelSectionHelp" - Me.panelSectionHelp.Size = New System.Drawing.Size(374, 81) + Me.panelSectionHelp.Size = New System.Drawing.Size(561, 122) Me.panelSectionHelp.TabIndex = 12 ' 'linkHelpData @@ -756,9 +765,10 @@ Partial Class ucrDataView Me.linkHelpData.AutoSize = True Me.linkHelpData.ImeMode = System.Windows.Forms.ImeMode.NoControl Me.linkHelpData.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline - Me.linkHelpData.Location = New System.Drawing.Point(5, 47) + Me.linkHelpData.Location = New System.Drawing.Point(8, 70) + Me.linkHelpData.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.linkHelpData.Name = "linkHelpData" - Me.linkHelpData.Size = New System.Drawing.Size(39, 13) + Me.linkHelpData.Size = New System.Drawing.Size(56, 20) Me.linkHelpData.TabIndex = 12 Me.linkHelpData.TabStop = True Me.linkHelpData.Text = "Data..." @@ -769,9 +779,10 @@ Partial Class ucrDataView Me.linkHelpGettingStarted.AutoSize = True Me.linkHelpGettingStarted.ImeMode = System.Windows.Forms.ImeMode.NoControl Me.linkHelpGettingStarted.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline - Me.linkHelpGettingStarted.Location = New System.Drawing.Point(5, 30) + Me.linkHelpGettingStarted.Location = New System.Drawing.Point(8, 45) + Me.linkHelpGettingStarted.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.linkHelpGettingStarted.Name = "linkHelpGettingStarted" - Me.linkHelpGettingStarted.Size = New System.Drawing.Size(87, 13) + Me.linkHelpGettingStarted.Size = New System.Drawing.Size(131, 20) Me.linkHelpGettingStarted.TabIndex = 11 Me.linkHelpGettingStarted.TabStop = True Me.linkHelpGettingStarted.Text = "Getting Started..." @@ -781,9 +792,10 @@ 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(3, 4) + Me.lblHelp.Location = New System.Drawing.Point(4, 6) + Me.lblHelp.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblHelp.Name = "lblHelp" - Me.lblHelp.Size = New System.Drawing.Size(56, 25) + Me.lblHelp.Size = New System.Drawing.Size(82, 37) Me.lblHelp.TabIndex = 2 Me.lblHelp.Text = "Help" ' @@ -793,9 +805,10 @@ Partial Class ucrDataView Me.linkHelpRInstatResourcesSite.AutoSize = True Me.linkHelpRInstatResourcesSite.ImeMode = System.Windows.Forms.ImeMode.NoControl Me.linkHelpRInstatResourcesSite.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline - Me.linkHelpRInstatResourcesSite.Location = New System.Drawing.Point(5, 64) + Me.linkHelpRInstatResourcesSite.Location = New System.Drawing.Point(8, 96) + Me.linkHelpRInstatResourcesSite.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.linkHelpRInstatResourcesSite.Name = "linkHelpRInstatResourcesSite" - Me.linkHelpRInstatResourcesSite.Size = New System.Drawing.Size(158, 13) + Me.linkHelpRInstatResourcesSite.Size = New System.Drawing.Size(239, 20) Me.linkHelpRInstatResourcesSite.TabIndex = 9 Me.linkHelpRInstatResourcesSite.TabStop = True Me.linkHelpRInstatResourcesSite.Text = "R-Instat Resources Site (Online)" @@ -807,9 +820,10 @@ Partial Class ucrDataView 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, 15) + Me.panelSectionStart.Location = New System.Drawing.Point(42, 22) + Me.panelSectionStart.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.panelSectionStart.Name = "panelSectionStart" - Me.panelSectionStart.Size = New System.Drawing.Size(374, 100) + Me.panelSectionStart.Size = New System.Drawing.Size(561, 150) Me.panelSectionStart.TabIndex = 11 ' 'linkStartPasteData @@ -818,9 +832,10 @@ Partial Class ucrDataView Me.linkStartPasteData.AutoSize = True Me.linkStartPasteData.ImeMode = System.Windows.Forms.ImeMode.NoControl Me.linkStartPasteData.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline - Me.linkStartPasteData.Location = New System.Drawing.Point(5, 81) + Me.linkStartPasteData.Location = New System.Drawing.Point(8, 122) + Me.linkStartPasteData.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.linkStartPasteData.Name = "linkStartPasteData" - Me.linkStartPasteData.Size = New System.Drawing.Size(142, 13) + Me.linkStartPasteData.Size = New System.Drawing.Size(213, 20) Me.linkStartPasteData.TabIndex = 7 Me.linkStartPasteData.TabStop = True Me.linkStartPasteData.Text = "Paste Data From Clipboard..." @@ -830,9 +845,10 @@ 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(3, 4) + Me.lblStart.Location = New System.Drawing.Point(4, 6) + Me.lblStart.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblStart.Name = "lblStart" - Me.lblStart.Size = New System.Drawing.Size(57, 25) + Me.lblStart.Size = New System.Drawing.Size(85, 37) Me.lblStart.TabIndex = 0 Me.lblStart.Text = "Start" ' @@ -842,9 +858,10 @@ 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(5, 30) + Me.linkStartNewDataFrame.Location = New System.Drawing.Point(8, 45) + Me.linkStartNewDataFrame.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.linkStartNewDataFrame.Name = "linkStartNewDataFrame" - Me.linkStartNewDataFrame.Size = New System.Drawing.Size(96, 13) + Me.linkStartNewDataFrame.Size = New System.Drawing.Size(141, 20) Me.linkStartNewDataFrame.TabIndex = 3 Me.linkStartNewDataFrame.TabStop = True Me.linkStartNewDataFrame.Text = "New Data Frame..." @@ -855,9 +872,10 @@ 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(5, 47) + Me.linkStartOpenFile.Location = New System.Drawing.Point(8, 70) + Me.linkStartOpenFile.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.linkStartOpenFile.Name = "linkStartOpenFile" - Me.linkStartOpenFile.Size = New System.Drawing.Size(90, 13) + Me.linkStartOpenFile.Size = New System.Drawing.Size(137, 20) Me.linkStartOpenFile.TabIndex = 4 Me.linkStartOpenFile.TabStop = True Me.linkStartOpenFile.Text = "Import From File..." @@ -868,9 +886,10 @@ 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(5, 64) + Me.linkStartOpenLibrary.Location = New System.Drawing.Point(8, 96) + Me.linkStartOpenLibrary.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.linkStartOpenLibrary.Name = "linkStartOpenLibrary" - Me.linkStartOpenLibrary.Size = New System.Drawing.Size(105, 13) + Me.linkStartOpenLibrary.Size = New System.Drawing.Size(159, 20) Me.linkStartOpenLibrary.TabIndex = 5 Me.linkStartOpenLibrary.TabStop = True Me.linkStartOpenLibrary.Text = "Import From Library..." @@ -881,9 +900,10 @@ Partial Class ucrDataView 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, 124) + Me.panelSectionRecent.Location = New System.Drawing.Point(42, 186) + Me.panelSectionRecent.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.panelSectionRecent.Name = "panelSectionRecent" - Me.panelSectionRecent.Size = New System.Drawing.Size(179, 186) + Me.panelSectionRecent.Size = New System.Drawing.Size(270, 279) Me.panelSectionRecent.TabIndex = 13 ' 'lblRecent @@ -891,9 +911,10 @@ 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(3, 4) + Me.lblRecent.Location = New System.Drawing.Point(4, 6) + Me.lblRecent.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblRecent.Name = "lblRecent" - Me.lblRecent.Size = New System.Drawing.Size(80, 25) + Me.lblRecent.Size = New System.Drawing.Size(116, 37) Me.lblRecent.TabIndex = 1 Me.lblRecent.Text = "Recent" ' @@ -902,9 +923,10 @@ 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(5, 30) + Me.panelRecentMenuItems.Location = New System.Drawing.Point(8, 45) + Me.panelRecentMenuItems.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.panelRecentMenuItems.Name = "panelRecentMenuItems" - Me.panelRecentMenuItems.Size = New System.Drawing.Size(159, 138) + Me.panelRecentMenuItems.Size = New System.Drawing.Size(240, 207) Me.panelRecentMenuItems.TabIndex = 6 ' 'TblPanPageDisplay @@ -936,21 +958,22 @@ Partial Class ucrDataView Me.TblPanPageDisplay.Controls.Add(Me.lblRowBack, 3, 0) Me.TblPanPageDisplay.Dock = System.Windows.Forms.DockStyle.Fill Me.TblPanPageDisplay.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.TblPanPageDisplay.Location = New System.Drawing.Point(249, 461) + Me.TblPanPageDisplay.Location = New System.Drawing.Point(374, 692) Me.TblPanPageDisplay.Margin = New System.Windows.Forms.Padding(0) Me.TblPanPageDisplay.Name = "TblPanPageDisplay" Me.TblPanPageDisplay.RowCount = 1 Me.TblPanPageDisplay.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!)) - Me.TblPanPageDisplay.Size = New System.Drawing.Size(499, 20) + Me.TblPanPageDisplay.Size = New System.Drawing.Size(748, 30) Me.TblPanPageDisplay.TabIndex = 8 ' 'lblColFirst ' Me.lblColFirst.AutoSize = True Me.lblColFirst.Dock = System.Windows.Forms.DockStyle.Fill - Me.lblColFirst.Location = New System.Drawing.Point(315, 0) + Me.lblColFirst.Location = New System.Drawing.Point(472, 0) + Me.lblColFirst.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblColFirst.Name = "lblColFirst" - Me.lblColFirst.Size = New System.Drawing.Size(18, 20) + Me.lblColFirst.Size = New System.Drawing.Size(26, 30) Me.lblColFirst.TabIndex = 15 Me.lblColFirst.Text = "«" Me.lblColFirst.TextAlign = System.Drawing.ContentAlignment.MiddleCenter @@ -959,9 +982,10 @@ Partial Class ucrDataView ' Me.lblColDisplay.AutoSize = True Me.lblColDisplay.Dock = System.Windows.Forms.DockStyle.Fill - Me.lblColDisplay.Location = New System.Drawing.Point(252, 0) + Me.lblColDisplay.Location = New System.Drawing.Point(378, 0) + Me.lblColDisplay.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblColDisplay.Name = "lblColDisplay" - Me.lblColDisplay.Size = New System.Drawing.Size(57, 20) + Me.lblColDisplay.Size = New System.Drawing.Size(86, 30) Me.lblColDisplay.TabIndex = 14 Me.lblColDisplay.Text = "Label1" Me.lblColDisplay.TextAlign = System.Drawing.ContentAlignment.MiddleCenter @@ -970,9 +994,10 @@ Partial Class ucrDataView ' Me.lblColNext.AutoSize = True Me.lblColNext.Dock = System.Windows.Forms.DockStyle.Fill - Me.lblColNext.Location = New System.Drawing.Point(363, 0) + Me.lblColNext.Location = New System.Drawing.Point(541, 0) + Me.lblColNext.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblColNext.Name = "lblColNext" - Me.lblColNext.Size = New System.Drawing.Size(18, 20) + Me.lblColNext.Size = New System.Drawing.Size(27, 30) Me.lblColNext.TabIndex = 13 Me.lblColNext.Text = ">" Me.lblColNext.TextAlign = System.Drawing.ContentAlignment.MiddleCenter @@ -981,9 +1006,10 @@ Partial Class ucrDataView ' Me.lblColBack.AutoSize = True Me.lblColBack.Dock = System.Windows.Forms.DockStyle.Fill - Me.lblColBack.Location = New System.Drawing.Point(339, 0) + Me.lblColBack.Location = New System.Drawing.Point(506, 0) + Me.lblColBack.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblColBack.Name = "lblColBack" - Me.lblColBack.Size = New System.Drawing.Size(18, 20) + Me.lblColBack.Size = New System.Drawing.Size(27, 30) Me.lblColBack.TabIndex = 12 Me.lblColBack.Text = "<" Me.lblColBack.TextAlign = System.Drawing.ContentAlignment.MiddleCenter @@ -992,9 +1018,10 @@ Partial Class ucrDataView ' Me.lblRowLast.AutoSize = True Me.lblRowLast.Dock = System.Windows.Forms.DockStyle.Fill - Me.lblRowLast.Location = New System.Drawing.Point(228, 0) + Me.lblRowLast.Location = New System.Drawing.Point(344, 0) + Me.lblRowLast.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblRowLast.Name = "lblRowLast" - Me.lblRowLast.Size = New System.Drawing.Size(18, 20) + Me.lblRowLast.Size = New System.Drawing.Size(26, 30) Me.lblRowLast.TabIndex = 11 Me.lblRowLast.Text = "»" Me.lblRowLast.TextAlign = System.Drawing.ContentAlignment.MiddleCenter @@ -1003,9 +1030,10 @@ Partial Class ucrDataView ' Me.lblRowFirst.AutoSize = True Me.lblRowFirst.Dock = System.Windows.Forms.DockStyle.Fill - Me.lblRowFirst.Location = New System.Drawing.Point(156, 0) + Me.lblRowFirst.Location = New System.Drawing.Point(240, 0) + Me.lblRowFirst.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblRowFirst.Name = "lblRowFirst" - Me.lblRowFirst.Size = New System.Drawing.Size(18, 20) + Me.lblRowFirst.Size = New System.Drawing.Size(26, 30) Me.lblRowFirst.TabIndex = 10 Me.lblRowFirst.Text = "«" Me.lblRowFirst.TextAlign = System.Drawing.ContentAlignment.MiddleCenter @@ -1015,9 +1043,10 @@ Partial Class ucrDataView Me.lblRowDisplay.AutoSize = True Me.lblRowDisplay.Dock = System.Windows.Forms.DockStyle.Fill Me.lblRowDisplay.ImageAlign = System.Drawing.ContentAlignment.TopCenter - Me.lblRowDisplay.Location = New System.Drawing.Point(93, 0) + Me.lblRowDisplay.Location = New System.Drawing.Point(146, 0) + Me.lblRowDisplay.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblRowDisplay.Name = "lblRowDisplay" - Me.lblRowDisplay.Size = New System.Drawing.Size(57, 20) + Me.lblRowDisplay.Size = New System.Drawing.Size(86, 30) Me.lblRowDisplay.TabIndex = 9 Me.lblRowDisplay.Text = "Label1" Me.lblRowDisplay.TextAlign = System.Drawing.ContentAlignment.MiddleRight @@ -1026,9 +1055,10 @@ Partial Class ucrDataView ' Me.lblRowNext.AutoSize = True Me.lblRowNext.Dock = System.Windows.Forms.DockStyle.Fill - Me.lblRowNext.Location = New System.Drawing.Point(204, 0) + Me.lblRowNext.Location = New System.Drawing.Point(309, 0) + Me.lblRowNext.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblRowNext.Name = "lblRowNext" - Me.lblRowNext.Size = New System.Drawing.Size(18, 20) + Me.lblRowNext.Size = New System.Drawing.Size(27, 30) Me.lblRowNext.TabIndex = 8 Me.lblRowNext.Text = ">" Me.lblRowNext.TextAlign = System.Drawing.ContentAlignment.MiddleCenter @@ -1037,9 +1067,10 @@ Partial Class ucrDataView ' Me.lblColLast.AutoSize = True Me.lblColLast.Dock = System.Windows.Forms.DockStyle.Fill - Me.lblColLast.Location = New System.Drawing.Point(387, 0) + Me.lblColLast.Location = New System.Drawing.Point(576, 0) + Me.lblColLast.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblColLast.Name = "lblColLast" - Me.lblColLast.Size = New System.Drawing.Size(18, 20) + Me.lblColLast.Size = New System.Drawing.Size(26, 30) Me.lblColLast.TabIndex = 7 Me.lblColLast.Text = "»" Me.lblColLast.TextAlign = System.Drawing.ContentAlignment.MiddleCenter @@ -1048,9 +1079,10 @@ Partial Class ucrDataView ' Me.lblRowBack.AutoSize = True Me.lblRowBack.Dock = System.Windows.Forms.DockStyle.Fill - Me.lblRowBack.Location = New System.Drawing.Point(180, 0) + Me.lblRowBack.Location = New System.Drawing.Point(274, 0) + Me.lblRowBack.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblRowBack.Name = "lblRowBack" - Me.lblRowBack.Size = New System.Drawing.Size(18, 20) + Me.lblRowBack.Size = New System.Drawing.Size(27, 30) Me.lblRowBack.TabIndex = 5 Me.lblRowBack.Text = "<" Me.lblRowBack.TextAlign = System.Drawing.ContentAlignment.MiddleCenter @@ -1058,29 +1090,28 @@ Partial Class ucrDataView 'ucrReoGrid ' Me.ucrReoGrid.Dock = System.Windows.Forms.DockStyle.Fill - Me.ucrReoGrid.Location = New System.Drawing.Point(500, 22) - Me.ucrReoGrid.Margin = New System.Windows.Forms.Padding(2) + Me.ucrReoGrid.Location = New System.Drawing.Point(751, 33) Me.ucrReoGrid.Name = "ucrReoGrid" - Me.ucrReoGrid.Size = New System.Drawing.Size(246, 437) + Me.ucrReoGrid.Size = New System.Drawing.Size(368, 656) Me.ucrReoGrid.TabIndex = 12 ' 'ucrLinuxGrid ' Me.ucrLinuxGrid.Dock = System.Windows.Forms.DockStyle.Fill - Me.ucrLinuxGrid.Location = New System.Drawing.Point(251, 22) - Me.ucrLinuxGrid.Margin = New System.Windows.Forms.Padding(2) + Me.ucrLinuxGrid.Location = New System.Drawing.Point(377, 33) Me.ucrLinuxGrid.Name = "ucrLinuxGrid" - Me.ucrLinuxGrid.Size = New System.Drawing.Size(245, 437) + Me.ucrLinuxGrid.Size = New System.Drawing.Size(368, 656) Me.ucrLinuxGrid.TabIndex = 13 ' 'ucrDataView ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) + Me.AutoScaleDimensions = New System.Drawing.SizeF(144.0!, 144.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True Me.Controls.Add(Me.tlpTableContainer) + Me.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.Name = "ucrDataView" - Me.Size = New System.Drawing.Size(748, 481) + Me.Size = New System.Drawing.Size(1122, 722) Me.Tag = "Data_View" Me.columnContextMenuStrip.ResumeLayout(False) Me.cellContextMenuStrip.ResumeLayout(False) diff --git a/instat/ucrDataView.resx b/instat/ucrDataView.resx index 59af2d7d414..ff250794f81 100644 --- a/instat/ucrDataView.resx +++ b/instat/ucrDataView.resx @@ -133,6 +133,6 @@ 706, 17 - 25 + 118 \ No newline at end of file diff --git a/instat/ucrDataView.vb b/instat/ucrDataView.vb index e41522cc43e..7b1acaca241 100644 --- a/instat/ucrDataView.vb +++ b/instat/ucrDataView.vb @@ -82,6 +82,7 @@ Public Class ucrDataView Private Sub AttachEventsToGrid() AddHandler _grid.WorksheetChanged, AddressOf CurrentWorksheetChanged + AddHandler _grid.WorksheetInserted, AddressOf WorksheetInserted AddHandler _grid.WorksheetRemoved, AddressOf WorksheetRemoved AddHandler _grid.ReplaceValueInData, AddressOf ReplaceValueInData AddHandler _grid.PasteValuesToDataframe, AddressOf PasteValuesToDataFrame @@ -100,6 +101,7 @@ Public Class ucrDataView _grid.AddRowData(dataFrame) _grid.UpdateWorksheetStyle(fillWorkSheet) dataFrame.clsVisibleDataFramePage.HasChanged = False + RefreshDisplayInformation() End Sub @@ -155,6 +157,8 @@ Public Class ucrDataView RefreshDisplayInformation() End If End If + EnableDisableUndoMenu() + _grid.Focus() End Sub ''' @@ -185,11 +189,12 @@ Public Class ucrDataView If GetSelectedColumns.Count = GetCurrentDataFrameFocus()?.iTotalColumnCount Then MsgBox("Cannot delete all visible columns." & Environment.NewLine & "Use Prepare > Data Object > Delete Data Frame if you wish to delete the data.", MsgBoxStyle.Information, "Cannot Delete All Columns") Else - Dim deleteCol = MsgBox("Are you sure you want to delete these column(s)?" & Environment.NewLine & "This action cannot be undone.", MessageBoxButtons.YesNo, "Delete Column") + Dim deleteCol = MsgBox("Are you sure you want to delete these column(s)?", MessageBoxButtons.YesNo, "Delete Column") If deleteCol = DialogResult.Yes Then StartWait() GetCurrentDataFrameFocus().clsPrepareFunctions.DeleteColumn(GetSelectedColumnNames()) EndWait() + _grid.Focus() End If End If End Sub @@ -198,12 +203,14 @@ Public Class ucrDataView StartWait() GetCurrentDataFrameFocus().clsPrepareFunctions.InsertRows(GetSelectedRows.Count, GetLastSelectedRow(), False) EndWait() + _grid.Focus() End Sub Private Sub mnuInsertRowsBefore_Click(sender As Object, e As EventArgs) Handles mnuInsertRowsBefore.Click StartWait() GetCurrentDataFrameFocus().clsPrepareFunctions.InsertRows(GetSelectedRows.Count, GetFirstSelectedRow, True) EndWait() + _grid.Focus() End Sub Private Sub mnuDeleteRows_Click(sender As Object, e As EventArgs) Handles mnuDeleteRows.Click @@ -212,6 +219,7 @@ Public Class ucrDataView StartWait() GetCurrentDataFrameFocus().clsPrepareFunctions.DeleteRows(GetSelectedRows()) EndWait() + _grid.Focus() End If End Sub @@ -227,6 +235,12 @@ Public Class ucrDataView _grid.SelectAll() End Sub + Private Sub EnableDisableUndoMenu() + If GetWorkSheetCount() <> 0 AndAlso _clsDataBook IsNot Nothing AndAlso GetCurrentDataFrameFocus() IsNot Nothing Then + frmMain.mnuUndo.Enabled = GetCurrentDataFrameFocus.clsVisibleDataFramePage.HasUndoHistory + End If + End Sub + Private Sub deleteSheet_Click(sender As Object, e As EventArgs) Handles deleteDataFrame.Click dlgDeleteDataFrames.SetDataFrameToAdd(_grid.CurrentWorksheet.Name) dlgDeleteDataFrames.ShowDialog() @@ -241,9 +255,14 @@ Public Class ucrDataView dlgName.ShowDialog() End Sub + Public Sub WorksheetInserted() + DisableEnableUndo(frmMain.clsInstatOptions.bSwitchOffUndo) + End Sub + Public Sub CurrentWorksheetChanged() frmMain.ucrColumnMeta.SetCurrentDataFrame(GetCurrentDataFrameNameFocus()) RefreshDisplayInformation() + IsUndo() End Sub Public Function GetFirstRowHeader() As String @@ -262,18 +281,31 @@ Public Class ucrDataView _grid.AdjustColumnWidthAfterWrapping(strColumn, bApplyWrap) End Sub + Public Sub IsUndo() + If GetWorkSheetCount() <> 0 AndAlso _clsDataBook IsNot Nothing AndAlso GetCurrentDataFrameFocus() IsNot Nothing Then + frmMain.clsInstatOptions.SetOffUndo(GetCurrentDataFrameFocus.clsVisibleDataFramePage.IsUndo(GetCurrentDataFrameNameFocus)) + End If + End Sub + Private Sub RefreshDisplayInformation() If GetWorkSheetCount() <> 0 AndAlso _clsDataBook IsNot Nothing AndAlso GetCurrentDataFrameFocus() IsNot Nothing Then frmMain.tstatus.Text = _grid.CurrentWorksheet.Name SetDisplayLabels() UpdateNavigationButtons() SetGridVisibility(True) + EnableDisableUndoMenu() Else frmMain.tstatus.Text = GetTranslation("No data loaded") SetGridVisibility(False) End If End Sub + Public Sub DisableEnableUndo(bDisable As Boolean) + If GetWorkSheetCount() <> 0 AndAlso _clsDataBook IsNot Nothing AndAlso GetCurrentDataFrameFocus() IsNot Nothing Then + GetCurrentDataFrameFocus.clsVisibleDataFramePage.DisableEnableUndo(bDisable, GetCurrentDataFrameNameFocus) + End If + End Sub + Private Sub ResizeLabels() Const iMinSize As Single = 4.5 TblPanPageDisplay.Font = New Font(TblPanPageDisplay.Font.FontFamily, 12, TblPanPageDisplay.Font.Style) @@ -908,6 +940,7 @@ Public Class ucrDataView StartWait() GetCurrentDataFrameFocus().clsPrepareFunctions.DeleteCells(GetSelectedRows(), GetSelectedColumnIndexes()) EndWait() + _grid.Focus() End If End Sub @@ -1002,10 +1035,53 @@ Public Class ucrDataView EditCell() End Sub - Private Sub FindRow() + Public Sub FindRow() dlgFindInVariableOrFilter.ShowDialog() End Sub + Public Sub Undo() + If frmMain.clsInstatOptions.bSwitchOffUndo Then + ' Show a message box indicating that undo is turned off + MsgBox("Undo is turned off, go to Tools > Options to turn it on.", vbInformation, "Undo Disabled") + Exit Sub + End If + + If _clsDataBook.DataFrames.Count > 0 Then + If (GetCurrentDataFrameFocus().iTotalColumnCount >= frmMain.clsInstatOptions.iUndoColLimit) OrElse + (GetCurrentDataFrameFocus().iTotalRowCount >= frmMain.clsInstatOptions.iUndoRowLimit) Then + + ' Retrieve the default limits for rows and columns + Dim colLimit As Integer = frmMain.clsInstatOptions.iUndoColLimit + Dim rowLimit As Integer = frmMain.clsInstatOptions.iUndoRowLimit + + ' Construct the concise message + Dim msg As String = "The current data frame exceeds the undo limit (Columns: " & colLimit & ", Rows: " & rowLimit & ")." + + ' Append information on whether it's the rows, columns, or both + If GetCurrentDataFrameFocus().iTotalColumnCount >= colLimit AndAlso + GetCurrentDataFrameFocus().iTotalRowCount >= rowLimit Then + msg &= " Both columns and rows exceed the limit." + ElseIf GetCurrentDataFrameFocus().iTotalColumnCount >= colLimit Then + msg &= " Columns exceed the limit." + ElseIf GetCurrentDataFrameFocus().iTotalRowCount >= rowLimit Then + msg &= " Rows exceed the limit." + End If + + msg &= " Please go to Tools > Options to adjust the limits." + + ' Display the message box + MsgBox(msg, vbExclamation, "Undo Limit Exceeded") + + Exit Sub + End If + + + If GetCurrentDataFrameFocus.clsVisibleDataFramePage.HasUndoHistory Then + GetCurrentDataFrameFocus.clsVisibleDataFramePage.Undo() + End If + End If + End Sub + Public Sub SearchRowInGrid(rowNumbers As List(Of Integer), strColumn As String, Optional iRow As Integer = 0, Optional bApplyToRows As Boolean = False) _grid.SearchRowInGrid(rowNumbers, strColumn, iRow, bApplyToRows) diff --git a/instat/ucrGeom.vb b/instat/ucrGeom.vb index 4728c91cea1..14e65e832f2 100644 --- a/instat/ucrGeom.vb +++ b/instat/ucrGeom.vb @@ -1372,7 +1372,7 @@ Public Class ucrGeom clsgeom_line.SetGeomName("geom_line") 'x and y are mandatory, but these are autofilled by "" when no variable is mapped. "Partially mandatory" - clsgeom_line.AddAesParameter("x", strIncludedDataTypes:={"factor", "numeric"}) + clsgeom_line.AddAesParameter("x", strIncludedDataTypes:={"factor", "numeric", "Date"}) clsgeom_line.AddAesParameter("y", strIncludedDataTypes:={"factor", "numeric"}) 'Optional clsgeom_line.AddAesParameter("alpha", strIncludedDataTypes:={"numeric", "factor"}) diff --git a/instat/ucrScript.Designer.vb b/instat/ucrScript.Designer.vb index 5d4628065c0..e1240b0807b 100644 --- a/instat/ucrScript.Designer.vb +++ b/instat/ucrScript.Designer.vb @@ -53,6 +53,7 @@ Partial Class ucrScript Me.mnuRunAllText = New System.Windows.Forms.ToolStripMenuItem() Me.ToolStripSeparator3 = New System.Windows.Forms.ToolStripSeparator() Me.mnuOpenScriptasFile = New System.Windows.Forms.ToolStripMenuItem() + Me.mnuInsertScript = New System.Windows.Forms.ToolStripMenuItem() Me.mnuLoadScriptFromFile = New System.Windows.Forms.ToolStripMenuItem() Me.mnuSaveScript = New System.Windows.Forms.ToolStripMenuItem() Me.ToolStripSeparator4 = New System.Windows.Forms.ToolStripSeparator() @@ -60,6 +61,7 @@ Partial Class ucrScript Me.lblHeaderScript = New System.Windows.Forms.Label() Me.tlpTableContainer = New System.Windows.Forms.TableLayoutPanel() Me.Panel = New System.Windows.Forms.Panel() + Me.cmdInsertScript = New System.Windows.Forms.Button() Me.cmdSave = New System.Windows.Forms.Button() Me.cmdLoadScript = New System.Windows.Forms.Button() Me.cmdRemoveTab = New System.Windows.Forms.Button() @@ -70,8 +72,8 @@ Partial Class ucrScript Me.cmdRunStatementSelection = New System.Windows.Forms.Button() Me.TabControl = New System.Windows.Forms.TabControl() Me.toolTipScriptWindow = New System.Windows.Forms.ToolTip(Me.components) - Me.cmdInsertScript = New System.Windows.Forms.Button() - Me.mnuInsertScript = New System.Windows.Forms.ToolStripMenuItem() + Me.mnuReformatCode = New System.Windows.Forms.ToolStripMenuItem() + Me.ToolStripSeparator5 = New System.Windows.Forms.ToolStripSeparator() Me.mnuContextScript.SuspendLayout() Me.tlpTableContainer.SuspendLayout() Me.Panel.SuspendLayout() @@ -80,9 +82,9 @@ Partial Class ucrScript 'mnuContextScript ' Me.mnuContextScript.ImageScalingSize = New System.Drawing.Size(24, 24) - Me.mnuContextScript.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuUndo, Me.mnuRedo, Me.ToolStripSeparator1, Me.mnuCut, Me.mnuCopy, Me.mnuPaste, Me.mnuSelectAll, Me.mnuClear, Me.ToolStripSeparator2, Me.mnuRunCurrentStatementSelection, Me.mnuRunAllText, Me.ToolStripSeparator3, Me.mnuOpenScriptasFile, Me.mnuInsertScript, Me.mnuLoadScriptFromFile, Me.mnuSaveScript, Me.ToolStripSeparator4, Me.mnuHelp}) + Me.mnuContextScript.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuUndo, Me.mnuRedo, Me.ToolStripSeparator1, Me.mnuCut, Me.mnuCopy, Me.mnuPaste, Me.mnuSelectAll, Me.mnuClear, Me.ToolStripSeparator2, Me.mnuRunCurrentStatementSelection, Me.mnuRunAllText, Me.ToolStripSeparator5, Me.mnuReformatCode, Me.ToolStripSeparator3, Me.mnuOpenScriptasFile, Me.mnuInsertScript, Me.mnuLoadScriptFromFile, Me.mnuSaveScript, Me.ToolStripSeparator4, Me.mnuHelp}) Me.mnuContextScript.Name = "mnuContextLogFile" - Me.mnuContextScript.Size = New System.Drawing.Size(426, 509) + Me.mnuContextScript.Size = New System.Drawing.Size(426, 547) ' 'mnuUndo ' @@ -168,6 +170,12 @@ Partial Class ucrScript Me.mnuOpenScriptasFile.Size = New System.Drawing.Size(425, 32) Me.mnuOpenScriptasFile.Text = "Open Script as File" ' + 'mnuInsertScript + ' + Me.mnuInsertScript.Name = "mnuInsertScript" + Me.mnuInsertScript.Size = New System.Drawing.Size(425, 32) + Me.mnuInsertScript.Text = "Insert Script" + ' 'mnuLoadScriptFromFile ' Me.mnuLoadScriptFromFile.Name = "mnuLoadScriptFromFile" @@ -214,7 +222,7 @@ Partial Class ucrScript Me.tlpTableContainer.Controls.Add(Me.TabControl, 0, 2) Me.tlpTableContainer.Dock = System.Windows.Forms.DockStyle.Fill Me.tlpTableContainer.Location = New System.Drawing.Point(0, 0) - Me.tlpTableContainer.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.tlpTableContainer.Margin = New System.Windows.Forms.Padding(4) Me.tlpTableContainer.Name = "tlpTableContainer" Me.tlpTableContainer.RowCount = 3 Me.tlpTableContainer.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30.0!)) @@ -239,15 +247,25 @@ Partial Class ucrScript Me.Panel.Controls.Add(Me.cmdRunStatementSelection) Me.Panel.Dock = System.Windows.Forms.DockStyle.Fill Me.Panel.Location = New System.Drawing.Point(4, 34) - Me.Panel.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.Panel.Margin = New System.Windows.Forms.Padding(4) Me.Panel.Name = "Panel" Me.Panel.Size = New System.Drawing.Size(997, 42) Me.Panel.TabIndex = 10 ' + 'cmdInsertScript + ' + Me.cmdInsertScript.Location = New System.Drawing.Point(503, 2) + Me.cmdInsertScript.Margin = New System.Windows.Forms.Padding(4) + Me.cmdInsertScript.Name = "cmdInsertScript" + Me.cmdInsertScript.Size = New System.Drawing.Size(112, 34) + Me.cmdInsertScript.TabIndex = 8 + Me.cmdInsertScript.Text = "Insert" + Me.cmdInsertScript.UseVisualStyleBackColor = True + ' 'cmdSave ' Me.cmdSave.Location = New System.Drawing.Point(279, 2) - Me.cmdSave.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.cmdSave.Margin = New System.Windows.Forms.Padding(4) Me.cmdSave.Name = "cmdSave" Me.cmdSave.Size = New System.Drawing.Size(82, 34) Me.cmdSave.TabIndex = 3 @@ -257,7 +275,7 @@ Partial Class ucrScript 'cmdLoadScript ' Me.cmdLoadScript.Location = New System.Drawing.Point(194, 2) - Me.cmdLoadScript.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.cmdLoadScript.Margin = New System.Windows.Forms.Padding(4) Me.cmdLoadScript.Name = "cmdLoadScript" Me.cmdLoadScript.Size = New System.Drawing.Size(82, 34) Me.cmdLoadScript.TabIndex = 2 @@ -267,7 +285,7 @@ Partial Class ucrScript 'cmdRemoveTab ' Me.cmdRemoveTab.Location = New System.Drawing.Point(620, 2) - Me.cmdRemoveTab.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.cmdRemoveTab.Margin = New System.Windows.Forms.Padding(4) Me.cmdRemoveTab.Name = "cmdRemoveTab" Me.cmdRemoveTab.Size = New System.Drawing.Size(112, 34) Me.cmdRemoveTab.TabIndex = 5 @@ -277,7 +295,7 @@ Partial Class ucrScript 'cmdAddTab ' Me.cmdAddTab.Location = New System.Drawing.Point(386, 2) - Me.cmdAddTab.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.cmdAddTab.Margin = New System.Windows.Forms.Padding(4) Me.cmdAddTab.Name = "cmdAddTab" Me.cmdAddTab.Size = New System.Drawing.Size(112, 34) Me.cmdAddTab.TabIndex = 4 @@ -287,7 +305,7 @@ Partial Class ucrScript 'cmdHelp ' Me.cmdHelp.Location = New System.Drawing.Point(872, 2) - Me.cmdHelp.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.cmdHelp.Margin = New System.Windows.Forms.Padding(4) Me.cmdHelp.Name = "cmdHelp" Me.cmdHelp.Size = New System.Drawing.Size(82, 34) Me.cmdHelp.TabIndex = 7 @@ -297,7 +315,7 @@ Partial Class ucrScript 'cmdClear ' Me.cmdClear.Location = New System.Drawing.Point(735, 2) - Me.cmdClear.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.cmdClear.Margin = New System.Windows.Forms.Padding(4) Me.cmdClear.Name = "cmdClear" Me.cmdClear.Size = New System.Drawing.Size(120, 34) Me.cmdClear.TabIndex = 6 @@ -307,7 +325,7 @@ Partial Class ucrScript 'cmdRunAll ' Me.cmdRunAll.Location = New System.Drawing.Point(87, 2) - Me.cmdRunAll.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.cmdRunAll.Margin = New System.Windows.Forms.Padding(4) Me.cmdRunAll.Name = "cmdRunAll" Me.cmdRunAll.Size = New System.Drawing.Size(82, 34) Me.cmdRunAll.TabIndex = 1 @@ -317,7 +335,7 @@ Partial Class ucrScript 'cmdRunStatementSelection ' Me.cmdRunStatementSelection.Location = New System.Drawing.Point(3, 2) - Me.cmdRunStatementSelection.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.cmdRunStatementSelection.Margin = New System.Windows.Forms.Padding(4) Me.cmdRunStatementSelection.Name = "cmdRunStatementSelection" Me.cmdRunStatementSelection.Size = New System.Drawing.Size(82, 34) Me.cmdRunStatementSelection.TabIndex = 0 @@ -328,27 +346,22 @@ Partial Class ucrScript ' Me.TabControl.Dock = System.Windows.Forms.DockStyle.Fill Me.TabControl.Location = New System.Drawing.Point(4, 84) - Me.TabControl.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.TabControl.Margin = New System.Windows.Forms.Padding(4) Me.TabControl.Name = "TabControl" Me.TabControl.SelectedIndex = 0 Me.TabControl.Size = New System.Drawing.Size(997, 662) Me.TabControl.TabIndex = 1 ' - 'cmdInsertScript + 'mnuReformatCode ' - Me.cmdInsertScript.Location = New System.Drawing.Point(503, 2) - Me.cmdInsertScript.Margin = New System.Windows.Forms.Padding(4) - Me.cmdInsertScript.Name = "cmdInsertScript" - Me.cmdInsertScript.Size = New System.Drawing.Size(112, 34) - Me.cmdInsertScript.TabIndex = 8 - Me.cmdInsertScript.Text = "Insert" - Me.cmdInsertScript.UseVisualStyleBackColor = True + Me.mnuReformatCode.Name = "mnuReformatCode" + Me.mnuReformatCode.Size = New System.Drawing.Size(425, 32) + Me.mnuReformatCode.Text = "Reformat Code" ' - 'mnuInsertScript + 'ToolStripSeparator5 ' - Me.mnuInsertScript.Name = "mnuInsertScript" - Me.mnuInsertScript.Size = New System.Drawing.Size(425, 32) - Me.mnuInsertScript.Text = "Insert Script" + Me.ToolStripSeparator5.Name = "ToolStripSeparator5" + Me.ToolStripSeparator5.Size = New System.Drawing.Size(422, 6) ' 'ucrScript ' @@ -356,7 +369,7 @@ Partial Class ucrScript Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True Me.Controls.Add(Me.tlpTableContainer) - Me.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.Margin = New System.Windows.Forms.Padding(4) Me.Name = "ucrScript" Me.Size = New System.Drawing.Size(1005, 750) Me.Tag = "Script_Window" @@ -399,4 +412,6 @@ Partial Class ucrScript Friend WithEvents cmdLoadScript As Button Friend WithEvents cmdInsertScript As Button Friend WithEvents mnuInsertScript As ToolStripMenuItem + Friend WithEvents ToolStripSeparator5 As ToolStripSeparator + Friend WithEvents mnuReformatCode As ToolStripMenuItem End Class \ No newline at end of file diff --git a/instat/ucrScript.vb b/instat/ucrScript.vb index 8f1cad6613d..794614210ce 100644 --- a/instat/ucrScript.vb +++ b/instat/ucrScript.vb @@ -19,6 +19,7 @@ Imports System.IO Imports System.Windows.Controls Imports RInsightF461 Imports ScintillaNET +Imports RDotNet Public Class ucrScript @@ -1024,5 +1025,29 @@ Public Class ucrScript TabControl.SelectedTab.Text = sender.text sender.Dispose() End Sub + Private Sub mnuReformatCode_Click(sender As Object, e As EventArgs) Handles mnuReformatCode.Click + ' Exit early if no text is selected + If clsScriptActive.SelectionStart = clsScriptActive.SelectionEnd Then + Exit Sub + End If + + ' Your R script text from Scintilla + Dim scriptText As String = clsScriptActive.SelectedText.Replace("""", "\""") + Dim clsStylerFunction As New RFunction + + clsStylerFunction.SetPackageName("styler") + clsStylerFunction.SetRCommand("style_text") + clsStylerFunction.AddParameter("text", Chr(34) & scriptText & Chr(34), bIncludeArgumentName:=False) + + Dim expTemp As SymbolicExpression = frmMain.clsRLink.RunInternalScriptGetValue(clsStylerFunction.ToScript(), bSilent:=True) + + ' Check if the result from R is valid + If expTemp IsNot Nothing AndAlso expTemp.Type <> Internals.SymbolicExpressionType.Null Then + ' If valid, format and replace the selected text + Dim formattedCode As String() = expTemp.AsCharacter().ToArray + Dim formattedText As String = String.Join(Environment.NewLine, formattedCode) + clsScriptActive.ReplaceSelection(formattedText) + End If + End Sub End Class