Skip to content

Commit

Permalink
Merge pull request #9031 from Fidel365/snippets/calculator
Browse files Browse the repository at this point in the history
Adding help id's for snippets-2 and general improvements to calculator
  • Loading branch information
N-thony authored Jun 25, 2024
2 parents fbfa223 + 60141c3 commit e4ad29c
Show file tree
Hide file tree
Showing 10 changed files with 1,902 additions and 1,250 deletions.
4 changes: 2 additions & 2 deletions instat/dlgAddKey.vb
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ Public Class dlgAddKey
Private Sub SetHelpOptions()
Select Case enumAddkeyMode
Case AddkeyMode.Prepare
ucrBase.iHelpTopicID = 416
ucrBase.iHelpTopicID = 504
Case AddkeyMode.Climatic
ucrBase.iHelpTopicID = 424
ucrBase.iHelpTopicID = 611
End Select
End Sub

Expand Down
29 changes: 22 additions & 7 deletions instat/dlgCalculator.vb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ Imports System.ComponentModel
Imports instat.Translations

Public Class dlgCalculator
Public enumCalculatorMode As String = CalculatorMode.Prepare
Public Enum CalculatorMode
Prepare
Structured
End Enum

Private clsAttachFunction As New RFunction
Private clsDetachFunction As New RFunction
Private clsRemoveLabelsFunction As New RFunction
Expand All @@ -38,7 +44,7 @@ Public Class dlgCalculator
SetDefaults()
bFirstLoad = False
End If

SetHelpOptions()
ReopenDialog()
TestOKEnabled()
autoTranslate(Me)
Expand Down Expand Up @@ -69,6 +75,7 @@ Public Class dlgCalculator
bInsertColumnBefore:=ucrBase.clsRsyntax.clsBaseCommandString.bInsertColumnBefore,
bRequireCorrectLength:=ucrBase.clsRsyntax.clsBaseCommandString.bRequireCorrectLength)
ucrBase.Visible = True
SetHelpOptions()
End Sub

Private Sub ReopenDialog()
Expand All @@ -78,7 +85,6 @@ Public Class dlgCalculator
End Sub

Private Sub InitialiseDialog()
ucrBase.iHelpTopicID = 14
ucrCalc.ucrReceiverForCalculation.SetMeAsReceiver()
ucrCalc.ucrTryCalculator.SetIsCommand()
ucrCalc.ucrTryCalculator.SetReceiver(ucrCalc.ucrReceiverForCalculation)
Expand Down Expand Up @@ -212,7 +218,6 @@ Public Class dlgCalculator

' Test if OK button can be enabled
TestOKEnabled()

End Sub

Private Sub ucrBase_ClickOk(sender As Object, e As EventArgs) Handles ucrBase.ClickOk
Expand Down Expand Up @@ -254,6 +259,17 @@ Public Class dlgCalculator
End If
End Sub

Private Sub SetHelpOptions()
Select Case enumCalculatorMode
Case CalculatorMode.Prepare
ucrCalc.ucrInputCalOptions.SetName("Basic")
ucrBase.iHelpTopicID = 14
Case CalculatorMode.Structured
ucrCalc.ucrInputCalOptions.SetName("Circular")
ucrBase.iHelpTopicID = 677
End Select
End Sub

Private Sub ucrCalc_Click() Handles ucrCalc.CheckBoxClick
ManageScalarStorage()
End Sub
Expand All @@ -270,8 +286,8 @@ Public Class dlgCalculator
Private Sub ucrInputCalOptions_NameChanged() Handles ucrCalc.NameChanged
Select Case ucrCalc.ucrInputCalOptions.GetText
Case "Functions"
Me.Width = iBasicWidth * 1.5
ucrBase.iHelpTopicID = 439
Me.Width = iBasicWidth * 1.4
ucrBase.iHelpTopicID = 167
Case "Maths"
Me.Width = iBasicWidth * 1.38
ucrBase.iHelpTopicID = 126
Expand Down Expand Up @@ -308,7 +324,7 @@ Public Class dlgCalculator
Me.Width = iBasicWidth * 2.56
Case "Goodness of Fit"
Me.Width = iBasicWidth * 1.27
ucrBase.iHelpTopicID = 598
ucrBase.iHelpTopicID = 717
Case "Integer"
Me.Width = iBasicWidth * 1.5
ucrBase.iHelpTopicID = 463
Expand All @@ -322,7 +338,6 @@ Public Class dlgCalculator
Me.Width = iBasicWidth
End Select
End Sub

End Class


2 changes: 1 addition & 1 deletion instat/dlgCircular.vb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Public Class dlgCircular
End Sub

Private Sub InitialiseDialog()
ucrBase.iHelpTopicID = 520
ucrBase.iHelpTopicID = 175
ucrReceiverCircular.Selector = ucrSelectorCircular
ucrReceiverCircular.SetMeAsReceiver()

Expand Down
23 changes: 18 additions & 5 deletions instat/dlgCorrelation.vb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@

Imports instat.Translations
Public Class dlgCorrelation
Public Enum DefaultSequenceOption
MultipleOption
TwoVariableOption
ClimaticOption
End Enum

Private bFirstload As Boolean = True
Private bReset As Boolean = True
Private bRcodeSet As Boolean = True
Expand All @@ -30,17 +36,13 @@ Public Class dlgCorrelation
Private clsNotOperator As New ROperator
Private clsRGGscatMatricReverseOperator As New ROperator
Private strColFunction As String
Private enumDefaultSequenceOption As DefaultSequenceOption = DefaultSequenceOption.MultipleOption
Public enumDefaultSequenceOption As DefaultSequenceOption = DefaultSequenceOption.MultipleOption
Private bDefaultOptionChanged As Boolean = False
Private bResetSubdialog As Boolean = False
Public strDefaultDataFrame As String = ""
Public strDefaultColumns() As String = Nothing
Public mnuCurrent As ToolStripMenuItem

Private Enum DefaultSequenceOption
MultipleOption
TwoVariableOption
End Enum
Private Sub dlgCorrelation_Load(sender As Object, e As EventArgs) Handles MyBase.Load
If bFirstload Then
InitialiseDialog()
Expand All @@ -67,6 +69,8 @@ Public Class dlgCorrelation
rdoMultipleColumns.Checked = True
Case DefaultSequenceOption.TwoVariableOption
rdoTwoColumns.Checked = True
Case DefaultSequenceOption.ClimaticOption
rdoMultipleColumns.Checked = True
End Select
End Sub

Expand All @@ -76,6 +80,7 @@ Public Class dlgCorrelation
Public Sub SetMultipleSequenceAsDefaultOption()
enumDefaultSequenceOption = DefaultSequenceOption.MultipleOption
bDefaultOptionChanged = True
ucrBase.iHelpTopicID = 421
End Sub

''' <summary>
Expand All @@ -84,7 +89,15 @@ Public Class dlgCorrelation
Public Sub SetTwoVariableSequenceAsDefaultOption()
enumDefaultSequenceOption = DefaultSequenceOption.TwoVariableOption
bDefaultOptionChanged = True
ucrBase.iHelpTopicID = 153
End Sub

Public Sub SetClimaticAsDefaultOption()
enumDefaultSequenceOption = DefaultSequenceOption.ClimaticOption
bDefaultOptionChanged = True
ucrBase.iHelpTopicID = 637
End Sub

Private Sub InitialiseDialog()
Dim dctNaPrint As New Dictionary(Of String, String)
Dim dctDiagonal As New Dictionary(Of String, String)
Expand Down
16 changes: 16 additions & 0 deletions instat/dlgOpenNetCDF.vb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ Imports RDotNet
Imports System.ComponentModel

Public Class dlgOpenNetCDF
Public enumNetCDFMode As String = NetCDFMode.File
Public Enum NetCDFMode
File
Climatic
End Enum

Private bFirstLoad As Boolean = True
Private bReset As Boolean = True
Private clsImportNetcdfFunction, clsNcOpenFunction, clsNcCloseFunction, clsRFileDetails As New RFunction
Expand Down Expand Up @@ -66,6 +72,7 @@ Public Class dlgOpenNetCDF
Else
OpenFile()
End If
SetHelpOptions()
bReset = False
TestOkEnabled()
autoTranslate(Me)
Expand Down Expand Up @@ -152,6 +159,15 @@ Public Class dlgOpenNetCDF
End If
End Sub

Private Sub SetHelpOptions()
Select Case enumNetCDFMode
Case NetCDFMode.File
ucrBase.iHelpTopicID = 393
Case NetCDFMode.Climatic
ucrBase.iHelpTopicID = 381
End Select
End Sub

Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset
SetDefaults()
SetRCodeForControls(True)
Expand Down
12 changes: 7 additions & 5 deletions instat/frmMain.vb
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,7 @@ Public Class frmMain
End Sub

Private Sub mnuDescribeOneVariableSummarise_Click(sender As Object, e As EventArgs) Handles mnuDescribeOneVariableSummarise.Click
dlgOneVariableSummarise.enumOnevariableMode = dlgOneVariableSummarise.OnevariableMode.Describe
dlgOneVariableSummarise.ShowDialog()
End Sub

Expand Down Expand Up @@ -1322,7 +1323,7 @@ Public Class frmMain
End Sub

Private Sub mnuHelpHistFAQ_Click(sender As Object, e As EventArgs) Handles mnuHelpFAQ.Click
Help.ShowHelp(Me, strStaticPath & "\" & strHelpFilePath, HelpNavigator.TopicId, "290")
Help.ShowHelp(Me, strStaticPath & "\" & strHelpFilePath, HelpNavigator.TopicId, "324")
End Sub

Private Sub mnuHelpGetingStarted_Click(sender As Object, e As EventArgs) Handles mnuHelpGetingStarted.Click
Expand Down Expand Up @@ -1502,6 +1503,7 @@ Public Class frmMain
End Sub

Private Sub mnuClimaticFileImportandTidyNetCDF_Click(sender As Object, e As EventArgs) Handles mnuClimaticFileImportandTidyNetCDF.Click
dlgOpenNetCDF.enumNetCDFMode = dlgOpenNetCDF.NetCDFMode.Climatic
dlgOpenNetCDF.ShowDialog()
End Sub

Expand Down Expand Up @@ -1958,6 +1960,7 @@ Public Class frmMain
End Sub

Private Sub mnuFileImportandTidyNetCDFFile_Click(sender As Object, e As EventArgs) Handles mnuFileImportandTidyNetCDFFile.Click
dlgOpenNetCDF.enumNetCDFMode = dlgOpenNetCDF.NetCDFMode.File
dlgOpenNetCDF.ShowDialog()
End Sub

Expand Down Expand Up @@ -2192,6 +2195,7 @@ Public Class frmMain
End Sub

Private Sub mnuPrepareCalculateCalculations_Click(sender As Object, e As EventArgs) Handles mnuPrepareCalculator.Click
dlgCalculator.enumCalculatorMode = dlgCalculator.CalculatorMode.Prepare
dlgCalculator.ShowDialog()
End Sub

Expand Down Expand Up @@ -2357,7 +2361,7 @@ Public Class frmMain
End Sub

Private Sub mnuClimaticCompareCorrelations_Click(sender As Object, e As EventArgs) Handles mnuClimaticCompareCorrelations.Click
dlgCorrelation.SetMultipleSequenceAsDefaultOption()
dlgCorrelation.SetClimaticAsDefaultOption()
dlgCorrelation.ShowDialog()
End Sub

Expand All @@ -2377,9 +2381,7 @@ Public Class frmMain
End Sub

Private Sub mnuStructuredCircularCalculator_Click(sender As Object, e As EventArgs) Handles mnuStructuredCircularCalculator.Click
If dlgCalculator.bFirstLoad Then
dlgCalculator.SetDefaultKeyboard("Circular")
End If
dlgCalculator.enumCalculatorMode = dlgCalculator.CalculatorMode.Structured
dlgCalculator.ShowDialog()
End Sub

Expand Down
12 changes: 12 additions & 0 deletions instat/sdgCorrPlot.vb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Public Class sdgCorrPlot
Public strDataFrame As String

Private Sub sdgCorrPlot_Load(sender As Object, e As EventArgs) Handles MyBase.Load
SetSelectedDefaultSequenceOption()
autoTranslate(Me)
End Sub

Expand Down Expand Up @@ -167,6 +168,17 @@ Public Class sdgCorrPlot
End If
End Sub

Private Sub SetSelectedDefaultSequenceOption()
Select Case dlgCorrelation.enumDefaultSequenceOption
Case dlgCorrelation.DefaultSequenceOption.MultipleOption
ucrBaseSdgCorrPlot.iHelpTopicID = 188
Case dlgCorrelation.DefaultSequenceOption.TwoVariableOption
ucrBaseSdgCorrPlot.iHelpTopicID = 675
Case dlgCorrelation.DefaultSequenceOption.ClimaticOption
ucrBaseSdgCorrPlot.iHelpTopicID = 676
End Select
End Sub

Private Sub ucrInputComboGeom_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputComboGeom.ControlValueChanged
Visibility()
End Sub
Expand Down
10 changes: 10 additions & 0 deletions instat/sdgOpenNetCDF.vb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Public Class sdgOpenNetCDF
Private bMultiImport As Boolean = False

Private Sub sdgOpenNetCDF_Load(sender As Object, e As EventArgs) Handles MyBase.Load
SetHelpOptions()
autoTranslate(Me)
End Sub

Expand Down Expand Up @@ -484,4 +485,13 @@ Public Class sdgOpenNetCDF
End If
bOKEnabled = Not bWarning
End Sub

Private Sub SetHelpOptions()
Select Case dlgOpenNetCDF.enumNetCDFMode
Case dlgOpenNetCDF.NetCDFMode.File
ucrBase.iHelpTopicID = 119
Case dlgOpenNetCDF.NetCDFMode.Climatic
ucrBase.iHelpTopicID = 117
End Select
End Sub
End Class
Loading

0 comments on commit e4ad29c

Please sign in to comment.