Skip to content

Commit

Permalink
Merge pull request #7425 from Vitalis95/ViewGraphdlg
Browse files Browse the repository at this point in the history
Added option to Use Graph dialog
  • Loading branch information
lloyddewit authored Jul 6, 2022
2 parents ced77e5 + fa9a421 commit 3a42c32
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 11 deletions.
55 changes: 48 additions & 7 deletions instat/dlgUseGraph.Designer.vb

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

36 changes: 33 additions & 3 deletions instat/dlgUseGraph.vb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
' along with this program. If not, see <http://www.gnu.org/licenses/>.

Imports instat.Translations
Public Class dlgUseGraph
Public Class dlgRenameGraph
Private bFirstLoad As Boolean = True
Private bReset As Boolean = True
Private clsUseGraphFunction As New RFunction
Expand Down Expand Up @@ -52,6 +52,7 @@ Public Class dlgUseGraph
End Sub

Private Sub InitialiseDialog()
Dim dctLegendPosition As New Dictionary(Of String, String)
ucrBase.iHelpTopicID = 430
ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False
ucrBase.clsRsyntax.iCallType = 3
Expand All @@ -65,10 +66,25 @@ Public Class dlgUseGraph
ucrGraphReceiver.SetParameterIsString()
ucrGraphReceiver.SetItemType("graph")

'Theme Tab Checkboxes under grpCommonOptions
ucrChkLegendPosition.SetText("Legend Position")
ucrChkLegendPosition.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)
ucrChkLegendPosition.AddParameterPresentCondition(True, "legend.position")
ucrChkLegendPosition.AddParameterPresentCondition(False, "legend.position", False)
ucrChkLegendPosition.SetLinkedDisplayControl(grpLegend)

ucrSaveGraph.SetPrefix("use_graph")
ucrSaveGraph.SetSaveTypeAsGraph()
ucrSaveGraph.SetDataFrameSelector(ucrGraphsSelector.ucrAvailableDataFrames)
ucrSaveGraph.SetCheckBoxText("Save Graph")
ucrSaveGraph.SetCheckBoxText("Save New Graph")
ucrSaveGraph.SetIsComboBox()
ucrSaveGraph.SetAssignToIfUncheckedValue("last_graph")
End Sub
Expand Down Expand Up @@ -109,6 +125,8 @@ Public Class dlgUseGraph
End Sub

Private Sub SetRCodeForControls(bReset As Boolean)
ucrChkLegendPosition.SetRCode(clsThemeFunction, bReset, bCloneIfNeeded:=True)
ucrInputLegendPosition.SetRCode(clsThemeFunction, bReset, bCloneIfNeeded:=True)
ucrGraphsSelector.SetRCode(clsUseGraphFunction, bReset)
ucrGraphReceiver.SetRCode(clsUseGraphFunction, bReset)
ucrSaveGraph.SetRCode(clsBaseOperator, bReset)
Expand Down Expand Up @@ -138,7 +156,19 @@ Public Class dlgUseGraph
sdgPlots.ShowDialog()
End Sub

Private Sub Controls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrGraphReceiver.ControlContentsChanged, ucrSaveGraph.ControlContentsChanged
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 ucrChkLegendPosition_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkLegendPosition.ControlValueChanged
AddRemoveTheme()
End Sub

Private Sub Controls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrGraphReceiver.ControlContentsChanged, ucrSaveGraph.ControlContentsChanged, ucrChkLegendPosition.ControlContentsChanged
TestOkEnabled()
End Sub
End Class
2 changes: 1 addition & 1 deletion instat/frmMain.vb
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,7 @@ Public Class frmMain
End Sub

Private Sub mnuDescribeUseGraph_Click(sender As Object, e As EventArgs) Handles mnuDescribeUseGraph.Click
dlgUseGraph.ShowDialog()
dlgRenameGraph.ShowDialog()
End Sub

Private Sub mnuDescribeCombineGraph_Click(sender As Object, e As EventArgs) Handles mnuDescribeCombineGraph.Click
Expand Down

0 comments on commit 3a42c32

Please sign in to comment.