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

Changes to the Use table dialog #9170

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
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
167 changes: 84 additions & 83 deletions instat/dlgUseTable.Designer.vb

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

66 changes: 38 additions & 28 deletions instat/dlgUseTable.vb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
'
' You should have received a copy of the GNU General Public License
' along with this program. If not, see <http://www.gnu.org/licenses/>.

Imports System.IO
Imports instat.Translations
Public Class dlgUseTable
Private bFirstLoad As Boolean = True
Expand Down Expand Up @@ -57,18 +57,20 @@ Public Class dlgUseTable
ucrTablesReceiver.SetItemType(RObjectTypeLabel.Table)

''To Be enabled later when the formats are supported.
rdoAsHTML.Enabled = False
rdoAsLaTex.Enabled = False
rdoAsRTF.Enabled = False
rdoAsWord.Enabled = False
'ucrPnlExportOptions.AddRadioButton(rdoAsHTML)
'ucrPnlExportOptions.AddRadioButton(rdoAsRTF)
'ucrPnlExportOptions.AddRadioButton(rdoAsWord)
'ucrPnlExportOptions.AddRadioButton(rdoAsLaTex)
'ucrPnlExportOptions.AddFunctionNamesCondition(rdoAsHTML, "as_raw_html")
'ucrPnlExportOptions.AddFunctionNamesCondition(rdoAsRTF, "as_rtf")
'ucrPnlExportOptions.AddFunctionNamesCondition(rdoAsWord, "as_word")
'ucrPnlExportOptions.AddFunctionNamesCondition(rdoAsLaTex, "as_word")
'rdoAsHTML.Enabled = False
'rdoAsLaTex.Enabled = False
'rdoAsRTF.Enabled = False
'rdoAsWord.Enabled = False
ucrPnlOptions.AddRadioButton(rdoAsHTML)
ucrPnlOptions.AddRadioButton(rdoAsRTF)
ucrPnlOptions.AddRadioButton(rdoAsWord)
ucrPnlOptions.AddRadioButton(rdoAsLaTex)
ucrPnlOptions.AddParameterValuesCondition(rdoAsHTML, "gtsave", "html")
ucrPnlOptions.AddParameterValuesCondition(rdoAsRTF, "gtsave", "rtf")
ucrPnlOptions.AddParameterValuesCondition(rdoAsWord, "gtsave", "docx")
ucrPnlOptions.AddParameterValuesCondition(rdoAsLaTex, "gtsave", "tex")

cmdTableOptions.Enabled = False

ucrSaveTable.SetPrefix("use_table")
ucrSaveTable.SetSaveType(strRObjectType:=RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html)
Expand Down Expand Up @@ -111,7 +113,8 @@ Public Class dlgUseTable
ucrTablesSelector.Reset()
ucrSaveTable.Reset()

clsDummyFunction.AddParameter("theme", "select", iPosition:=11)
clsDummyFunction.AddParameter("theme", "select", iPosition:=0)
clsDummyFunction.AddParameter("gtsave", "html", iPosition:=1)

clsgtExtraThemesFunction.SetPackageName("gtExtras")

Expand Down Expand Up @@ -171,20 +174,21 @@ Public Class dlgUseTable
clsThemesTabOptionsFunction.SetRCommand("tab_options")

clsRFunctionAsHTML.SetPackageName("gt")
clsRFunctionAsHTML.SetRCommand("as_raw_html")
clsRFunctionAsHTML.SetRCommand("gtsave")

clsRFunctionAsRTF.SetPackageName("gt")
clsRFunctionAsRTF.SetRCommand("as_rtf")
clsRFunctionAsRTF.SetRCommand("gtsave")

clsRFunctionAsWord.SetPackageName("gt")
clsRFunctionAsWord.SetRCommand("as_word")
clsRFunctionAsWord.SetRCommand("gtsave")

clsRFunctionAsLaTex.SetPackageName("gt")
clsRFunctionAsLaTex.SetRCommand("as_word")
clsRFunctionAsLaTex.SetRCommand("gtsave")

clsUseTableFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_object_data")

clsPipeOperator.SetOperation("%>%")
clsPipeOperator.bBrackets = False

ucrBase.clsRsyntax.SetBaseROperator(clsJoiningPipeOperator)
End Sub
Expand All @@ -193,6 +197,9 @@ Public Class dlgUseTable
ucrTablesSelector.SetRCode(clsUseTableFunction, bReset)
ucrTablesReceiver.SetRCode(clsUseTableFunction, bReset)
ucrSaveTable.SetRCode(clsJoiningPipeOperator, bReset)
If bReset Then
ucrPnlOptions.SetRCode(clsDummyFunction, bReset)
End If
End Sub

Private Sub TestOKEnabled()
Expand All @@ -209,30 +216,33 @@ Public Class dlgUseTable
TestOKEnabled()
End Sub

Private Sub cmdFormatOptions_Click(sender As Object, e As EventArgs) Handles cmdFormatOptions.Click
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,
clsNewgtExtraThemesFunction:=clsgtExtraThemesFunction, clsNewThemesTabOptionFunction:=clsThemesTabOptionsFunction, bReset:=bReset)
sdgFormatSummaryTables.ShowDialog()
Private Sub cmdTableOptions_Click(sender As Object, e As EventArgs) Handles cmdTableOptions.Click
sdgTableOptions.Setup(ucrTablesSelector.strCurrentDataFrame, clsPipeOperator)
sdgTableOptions.ShowDialog(Me)
End Sub

Private Sub ucrCoreControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrTablesReceiver.ControlContentsChanged, ucrSaveTable.ControlContentsChanged
TestOKEnabled()
End Sub

Private Sub ucrPnlExportOptions_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlExportOptions.ControlValueChanged
Private Sub ucrPnlOptions_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlOptions.ControlValueChanged
If rdoAsHTML.Checked Then
clsJoiningPipeOperator.AddParameter("y", clsRFunctionParameter:=clsRFunctionAsHTML)
clsRFunctionAsHTML.AddParameter("filename", Chr(34) & ucrTablesSelector.ucrAvailableDataFrames.cboAvailableDataFrames.SelectedItem & ".html" & Chr(34), iPosition:=1)
clsRFunctionAsHTML.AddParameter("path", Chr(34) & FileIO.SpecialDirectories.MyDocuments.Replace("\", "/") & Chr(34), iPosition:=2)
ElseIf rdoAsRTF.Checked Then
clsJoiningPipeOperator.AddParameter("y", clsRFunctionParameter:=clsRFunctionAsRTF)
clsRFunctionAsRTF.AddParameter("filename", Chr(34) & ucrTablesSelector.ucrAvailableDataFrames.cboAvailableDataFrames.SelectedItem & ".rtf" & Chr(34), iPosition:=1)
clsRFunctionAsRTF.AddParameter("path", Chr(34) & FileIO.SpecialDirectories.MyDocuments.Replace("\", "/") & Chr(34), iPosition:=2)
ElseIf rdoAsWord.Checked Then
clsJoiningPipeOperator.AddParameter("y", clsRFunctionParameter:=clsRFunctionAsWord)
clsRFunctionAsWord.AddParameter("filename", Chr(34) & ucrTablesSelector.ucrAvailableDataFrames.cboAvailableDataFrames.SelectedItem & ".docx" & Chr(34), iPosition:=1)
clsRFunctionAsWord.AddParameter("path", Chr(34) & FileIO.SpecialDirectories.MyDocuments.Replace("\", "/") & Chr(34), iPosition:=2)
Else
clsJoiningPipeOperator.AddParameter("y", clsRFunctionParameter:=clsRFunctionAsLaTex)
clsRFunctionAsLaTex.AddParameter("filename", Chr(34) & ucrTablesSelector.ucrAvailableDataFrames.cboAvailableDataFrames.SelectedItem & ".tex" & Chr(34), iPosition:=1)
clsRFunctionAsLaTex.AddParameter("path", Chr(34) & FileIO.SpecialDirectories.MyDocuments.Replace("\", "/") & Chr(34), iPosition:=2)
End If
End Sub

End Class
Loading