Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Options linking work #2486

Merged
merged 3 commits into from
Jan 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions instat/clsInstatOptions.vb
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ Imports unvell.ReoGrid
Public lstColourPalette As List(Of Color)
Public strGraphDisplayOption As String
Public bCommandsinOutput As Boolean
Public bDefaultforComments As Boolean 'sets the default for comments on the dialog
Public bIncludeCommentDefault As Boolean 'sets the default for comments on the dialog

Public Sub New()
'TODO Is this sensible to do in constructor?
bIncludeRDefaultParameters = False
bDefaultforComments = True
bCommandsinOutput = False
bCommandsinOutput = True
bIncludeCommentDefault = True
SetFormatOutput(New Font(FontFamily.GenericMonospace, 8, FontStyle.Regular), Color.Blue)
SetFormatComment(New Font(FontFamily.GenericSansSerif, 8, FontStyle.Regular), Color.Green)
SetFormatCommand(New Font(FontFamily.GenericSansSerif, 8, FontStyle.Regular), Color.Black)
SetEditorFormat(New Font(FontFamily.GenericSansSerif, 10, FontStyle.Regular), Color.Black)
SetPreviewRows(10)
SetMaxRows(1000)
SetCommentsInOutput(True)
SetCommandInOutpt(True)
SetComment("code generated by the dialog")
'set the deault option here
SetGraphDisplayOption("view_output_window")
SetOutputWindowDisplay("")
'TODO is this sensible?
SetLanguageCultureCode(Thread.CurrentThread.CurrentCulture.Name)
SetWorkingDirectory(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments))
Expand Down Expand Up @@ -107,10 +107,15 @@ Imports unvell.ReoGrid
Public Sub SetGraphDisplayOption(strGraphOption As String)
strGraphDisplayOption = strGraphOption
'setting the string for graphs display
frmMain.clsRLink.strGraphDisplayOption = strGraphDisplayOption
End Sub

Public Sub SetCommandInOutpt(bCommand As Boolean)
bCommandsinOutput = bCommand
frmMain.clsRLink.bShowCommands = bCommandsinOutput
End Sub

Public Sub SetOutputWindowDisplay(strOutput As String)
'set the options for the display
Public Sub SetCommentsInOutput(bComment As Boolean)
bCommandsinOutput = bComment
End Sub
End Class
62 changes: 31 additions & 31 deletions instat/dlgOptions.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 13 additions & 6 deletions instat/dlgOptions.vb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Public Class dlgOptions
nudPreviewRows.Value = frmMain.clsInstatOptions.iPreviewRows
txtComment.Text = frmMain.clsInstatOptions.strComment
ucrWorkingDirectory.SetName(frmMain.clsInstatOptions.strWorkingDirectory)
chkDefault.Checked = frmMain.clsInstatOptions.bDefaultforComments
chkIncludeCommentsbyDefault.Checked = frmMain.clsInstatOptions.bIncludeCommentDefault
chkShowRCommandsinOutputWindow.Checked = frmMain.clsInstatOptions.bCommandsinOutput

Select Case frmMain.clsInstatOptions.strLanguageCultureCode
Expand Down Expand Up @@ -107,9 +107,8 @@ Public Class dlgOptions
frmMain.clsInstatOptions.SetLanguageCultureCode(strCurrLanguageCulture)
frmMain.clsInstatOptions.SetWorkingDirectory(strWorkingDirectory)
frmMain.clsInstatOptions.SetGraphDisplayOption(strGraphDisplayOption)
frmMain.clsInstatOptions.SetOutputWindowDisplay(strOutputWindowDisplay)
frmMain.clsInstatOptions.bCommandsinOutput = chkShowRCommandsinOutputWindow.Checked
frmMain.clsInstatOptions.bDefaultforComments = chkDefault.Checked
frmMain.clsInstatOptions.bIncludeCommentDefault = chkIncludeCommentsbyDefault.Checked
frmMain.clsInstatOptions.SetCommandInOutpt(chkShowRCommandsinOutputWindow.Checked)


End Sub
Expand Down Expand Up @@ -280,8 +279,8 @@ Public Class dlgOptions
ApplyEnabled(True)
End Sub

Private Sub chkIncludeDefaultParams_CheckedChanged(sender As Object, e As EventArgs) Handles chkIncludeDefaultParams.CheckedChanged
frmMain.clsInstatOptions.bIncludeRDefaultParameters = chkIncludeDefaultParams.Checked
Private Sub chkIncludeDefaultParams_CheckedChanged(sender As Object, e As EventArgs) Handles chkIncludeDefaultParams.CheckedChanged
ApplyEnabled(True)
End Sub

Private Sub nudMaxRows_TextChanged(sender As Object, e As EventArgs) Handles nudMaxRows.TextChanged
Expand All @@ -300,6 +299,14 @@ Public Class dlgOptions
ApplyEnabled(True)
End Sub

Private Sub chkDefault_CheckedChanged(sender As Object, e As EventArgs) Handles chkIncludeCommentsbyDefault.CheckedChanged
ApplyEnabled(True)
End Sub

Private Sub chkShowRCommandsinOutputWindow_CheckedChanged(sender As Object, e As EventArgs) Handles chkShowRCommandsinOutputWindow.CheckedChanged
ApplyEnabled(True)
End Sub

Private Sub ApplyEnabled(bEnable As Boolean)
cmdApply.Enabled = bEnable
cmdOk.Enabled = bEnable
Expand Down
4 changes: 2 additions & 2 deletions instat/ucrButtons.vb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Public Class ucrButtons
Public iHelpTopicID As Integer
Public bFirstLoad As Boolean
Public strComment As String
Public bIncludeCommentDefault As Boolean = True


Public Sub New()
' This call is required by the designer.
Expand Down Expand Up @@ -113,7 +113,7 @@ Public Class ucrButtons
End Sub

Private Sub SetDefaults()
chkComment.Checked = bIncludeCommentDefault
chkComment.Checked = frmMain.clsInstatOptions.bIncludeCommentDefault
SetCommentEditable()
'TODO default text should be translatable
'This is needed only so that the designer displays correctly in VS
Expand Down