Skip to content

Commit

Permalink
Merge pull request #640 from africanmathsinitiative/master
Browse files Browse the repository at this point in the history
merge from main
  • Loading branch information
dannyparsons authored Jun 13, 2017
2 parents 5045efc + ef11c9a commit dc32f9f
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions instat/dlgView.vb
Original file line number Diff line number Diff line change
Expand Up @@ -46,28 +46,29 @@ Public Class dlgView
ucrPnlDisplayWindow.AddRadioButton(rdoDispOutputWindow)
ucrPnlDisplayWindow.AddRadioButton(rdoDispSepOutputWindow)
ucrPnlDisplayWindow.AddRadioButton(rdoHTMLOutputWindow)

ucrPnlDisplayWindow.AddToLinkedControls(ucrChkSpecifyRows, {rdoDispOutputWindow}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True)
ucrPnlDisplayWindow.AddFunctionNamesCondition(rdoDispSepOutputWindow, "View")
ucrPnlDisplayWindow.AddFunctionNamesCondition(rdoHTMLOutputWindow, "sjt.df")
ucrPnlDisplayWindow.AddFunctionNamesCondition(rdoDispOutputWindow, {"head", "tail", frmMain.clsRLink.strInstatDataObject & "$get_columns_from_data"})
ucrPnlDisplayWindow.SetDefaultState(rdoTop)

ucrPnlDisplayFrom.AddRadioButton(rdoBottom)
ucrPnlDisplayFrom.AddRadioButton(rdoTop)
ucrPnlDisplayFrom.SetLinkedDisplayControl(lblDisplayFrom)
ucrPnlDisplayFrom.AddFunctionNamesCondition(rdoTop, "head")
ucrPnlDisplayFrom.AddFunctionNamesCondition(rdoBottom, "tail")
ucrPnlDisplayFrom.bAllowNonConditionValues = True

' ucrPnlDisplayFrom.bAllowNonConditionValues = True

' This linking only applies if rdoDispOutputWindow is checked
ucrChkSpecifyRows.SetText("Specify Rows")
ucrChkSpecifyRows.AddToLinkedControls(ucrPnlDisplayFrom, {True}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=rdoTop)
ucrChkSpecifyRows.AddToLinkedControls(ucrNudNumberRows, {True}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=6)
ucrChkSpecifyRows.AddFunctionNamesCondition(True, {"head", "tail"})
ucrChkSpecifyRows.AddFunctionNamesCondition(False, {frmMain.clsRLink.strInstatDataObject & "$get_columns_from_data"})
ucrChkSpecifyRows.bAllowNonConditionValues = True
' ucrChkSpecifyRows.bAllowNonConditionValues = True

ucrPnlDisplayWindow.AddFunctionNamesCondition(rdoDispSepOutputWindow, "View")
ucrPnlDisplayWindow.AddFunctionNamesCondition(rdoDispOutputWindow, {"head", "tail", frmMain.clsRLink.strInstatDataObject & "$get_columns_from_data"})
ucrPnlDisplayWindow.AddFunctionNamesCondition(rdoHTMLOutputWindow, "sjt.df")

' Linking for when rdoHTML is checked
ucrChkSortColumn.Visible = False
'ucrPnlDisplayWindow.AddToLinkedControls(ucrChkSortColumn, {rdoHTMLOutputWindow}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=True)
'ucrChkSortColumn.SetText("Sort by Column")
Expand Down Expand Up @@ -100,31 +101,31 @@ Public Class dlgView
ucrReceiverView.SetMeAsReceiver()

clsOutputWindowFunction.SetPackageName("utils")
' clsOutputWindowFunction.AddParameter("x", clsRFunctionParameter:=ucrReceiverView.GetVariables(True))
clsOutputWindowFunction.AddParameter("title", Chr(34) & ucrSelectorForView.ucrAvailableDataFrames.cboAvailableDataFrames.SelectedItem & Chr(34))

clsSeparateWindowFunction.SetPackageName("utils")
clsSeparateWindowFunction.SetRCommand("View")
clsSeparateWindowFunction.AddParameter("title", Chr(34) & ucrSelectorForView.ucrAvailableDataFrames.cboAvailableDataFrames.SelectedItem & Chr(34))

clsHTMLFunction.SetPackageName("sjPlot")
clsHTMLFunction.SetRCommand("sjt.df")
clsHTMLFunction.AddParameter("describe", "FALSE", iPosition:=1)
clsHTMLFunction.AddParameter("altr.row.col", "TRUE", iPosition:=2)
clsHTMLFunction.AddParameter("hide.progress", "TRUE", iPosition:=4)

clsSeparateWindowFunction.SetPackageName("utils")
clsSeparateWindowFunction.SetRCommand("View")

ucrBase.clsRsyntax.SetBaseRFunction(clsSeparateWindowFunction)
End Sub

Private Sub SetRCodeForControls(bReset As Boolean)
bControlsUpdated = False
ucrNudNumberRows.Maximum = Decimal.MaxValue
ucrReceiverView.SetRCode(clsSeparateWindowFunction, bReset)
ucrPnlDisplayWindow.SetRCode(clsSeparateWindowFunction, bReset)
ucrPnlDisplayWindow.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset)
ucrPnlDisplayFrom.SetRCode(clsOutputWindowFunction, bReset)
ucrNudNumberRows.SetRCode(clsOutputWindowFunction, bReset)
ucrChkSpecifyRows.SetRCode(clsOutputWindowFunction, bReset)
ucrSelectorForView.SetRCode(clsSeparateWindowFunction, bReset)
ucrReceiverView.AddAdditionalCodeParameterPair(clsHTMLFunction, New RParameter("mydf"), iAdditionalPairNo:=1)
ucrReceiverView.AddAdditionalCodeParameterPair(clsOutputWindowFunction, New RParameter("x"), iAdditionalPairNo:=2)
ucrSelectorForView.SetRCode(clsOutputWindowFunction, bReset)
DataFrameLength()
bControlsUpdated = True
End Sub
Expand Down Expand Up @@ -160,8 +161,8 @@ Public Class dlgView
End Sub

Private Sub ChangeFunctionParameters()
ucrBase.clsRsyntax.iCallType = 2
If rdoDispOutputWindow.Checked Then
ucrBase.clsRsyntax.iCallType = 2
If ucrChkSpecifyRows.Checked Then
ucrBase.clsRsyntax.SetBaseRFunction(clsOutputWindowFunction)
If rdoTop.Checked Then
Expand Down

0 comments on commit dc32f9f

Please sign in to comment.