diff --git a/instat/dlgUseTable.Designer.vb b/instat/dlgUseTable.Designer.vb index 31ab547960..2c8c4e2571 100644 --- a/instat/dlgUseTable.Designer.vb +++ b/instat/dlgUseTable.Designer.vb @@ -22,72 +22,24 @@ Partial Class dlgUseTable 'Do not modify it using the code editor. _ Private Sub InitializeComponent() - Me.ucrBase = New instat.ucrButtons() - Me.ucrTablesReceiver = New instat.ucrReceiverSingle() - Me.lblTablesToUse = New System.Windows.Forms.Label() - Me.ucrSaveTable = New instat.ucrSave() - Me.ucrPnlExportOptions = New instat.UcrPanel() Me.rdoAsHTML = New System.Windows.Forms.RadioButton() Me.rdoAsRTF = New System.Windows.Forms.RadioButton() Me.rdoAsWord = New System.Windows.Forms.RadioButton() Me.rdoAsLaTex = New System.Windows.Forms.RadioButton() - Me.cmdFormatOptions = New System.Windows.Forms.Button() - Me.lblExportTable = New System.Windows.Forms.Label() + Me.cmdTableOptions = New System.Windows.Forms.Button() + Me.lblTable = New System.Windows.Forms.Label() + Me.lblExportTables = New System.Windows.Forms.Label() + Me.ucrSaveTable = New instat.ucrSave() + Me.ucrTablesReceiver = New instat.ucrReceiverSingle() Me.ucrTablesSelector = New instat.ucrSelectorByDataFrameAddRemove() + Me.ucrBase = New instat.ucrButtons() + Me.ucrPnlOptions = New instat.UcrPanel() Me.SuspendLayout() ' - 'ucrBase - ' - Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(2, 397) - Me.ucrBase.Name = "ucrBase" - Me.ucrBase.Size = New System.Drawing.Size(407, 52) - Me.ucrBase.TabIndex = 0 - ' - 'ucrTablesReceiver - ' - Me.ucrTablesReceiver.AutoSize = True - Me.ucrTablesReceiver.frmParent = Me - Me.ucrTablesReceiver.Location = New System.Drawing.Point(256, 59) - Me.ucrTablesReceiver.Margin = New System.Windows.Forms.Padding(0) - Me.ucrTablesReceiver.Name = "ucrTablesReceiver" - Me.ucrTablesReceiver.Selector = Nothing - Me.ucrTablesReceiver.Size = New System.Drawing.Size(135, 20) - Me.ucrTablesReceiver.strNcFilePath = "" - Me.ucrTablesReceiver.TabIndex = 2 - Me.ucrTablesReceiver.ucrSelector = Nothing - ' - 'lblTablesToUse - ' - Me.lblTablesToUse.AutoSize = True - Me.lblTablesToUse.Location = New System.Drawing.Point(255, 43) - Me.lblTablesToUse.Name = "lblTablesToUse" - Me.lblTablesToUse.Size = New System.Drawing.Size(75, 13) - Me.lblTablesToUse.TabIndex = 3 - Me.lblTablesToUse.Text = "Table To Use:" - ' - 'ucrSaveTable - ' - Me.ucrSaveTable.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrSaveTable.Location = New System.Drawing.Point(10, 360) - Me.ucrSaveTable.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) - Me.ucrSaveTable.Name = "ucrSaveTable" - Me.ucrSaveTable.Size = New System.Drawing.Size(390, 34) - Me.ucrSaveTable.TabIndex = 4 - ' - 'ucrPnlExportOptions - ' - Me.ucrPnlExportOptions.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlExportOptions.Enabled = False - Me.ucrPnlExportOptions.Location = New System.Drawing.Point(8, 243) - Me.ucrPnlExportOptions.Name = "ucrPnlExportOptions" - Me.ucrPnlExportOptions.Size = New System.Drawing.Size(105, 110) - Me.ucrPnlExportOptions.TabIndex = 5 - ' 'rdoAsHTML ' Me.rdoAsHTML.AutoSize = True - Me.rdoAsHTML.Location = New System.Drawing.Point(14, 250) + Me.rdoAsHTML.Location = New System.Drawing.Point(14, 269) Me.rdoAsHTML.Name = "rdoAsHTML" Me.rdoAsHTML.Size = New System.Drawing.Size(55, 17) Me.rdoAsHTML.TabIndex = 6 @@ -98,7 +50,7 @@ Partial Class dlgUseTable 'rdoAsRTF ' Me.rdoAsRTF.AutoSize = True - Me.rdoAsRTF.Location = New System.Drawing.Point(14, 275) + Me.rdoAsRTF.Location = New System.Drawing.Point(14, 294) Me.rdoAsRTF.Name = "rdoAsRTF" Me.rdoAsRTF.Size = New System.Drawing.Size(46, 17) Me.rdoAsRTF.TabIndex = 7 @@ -109,7 +61,7 @@ Partial Class dlgUseTable 'rdoAsWord ' Me.rdoAsWord.AutoSize = True - Me.rdoAsWord.Location = New System.Drawing.Point(14, 300) + Me.rdoAsWord.Location = New System.Drawing.Point(14, 319) Me.rdoAsWord.Name = "rdoAsWord" Me.rdoAsWord.Size = New System.Drawing.Size(51, 17) Me.rdoAsWord.TabIndex = 8 @@ -120,7 +72,7 @@ Partial Class dlgUseTable 'rdoAsLaTex ' Me.rdoAsLaTex.AutoSize = True - Me.rdoAsLaTex.Location = New System.Drawing.Point(14, 325) + Me.rdoAsLaTex.Location = New System.Drawing.Point(14, 344) Me.rdoAsLaTex.Name = "rdoAsLaTex" Me.rdoAsLaTex.Size = New System.Drawing.Size(55, 17) Me.rdoAsLaTex.TabIndex = 9 @@ -128,24 +80,56 @@ Partial Class dlgUseTable Me.rdoAsLaTex.Text = "LaTex" Me.rdoAsLaTex.UseVisualStyleBackColor = True ' - 'cmdFormatOptions + 'cmdTableOptions + ' + Me.cmdTableOptions.Location = New System.Drawing.Point(8, 214) + Me.cmdTableOptions.Name = "cmdTableOptions" + Me.cmdTableOptions.Size = New System.Drawing.Size(135, 23) + Me.cmdTableOptions.TabIndex = 11 + Me.cmdTableOptions.Text = "Table Options" + Me.cmdTableOptions.UseVisualStyleBackColor = True + ' + 'lblTable ' - Me.cmdFormatOptions.Location = New System.Drawing.Point(256, 183) - Me.cmdFormatOptions.Name = "cmdFormatOptions" - Me.cmdFormatOptions.Size = New System.Drawing.Size(135, 23) - Me.cmdFormatOptions.TabIndex = 11 - Me.cmdFormatOptions.Text = "Format Options" - Me.cmdFormatOptions.UseVisualStyleBackColor = True + Me.lblTable.AutoSize = True + Me.lblTable.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblTable.Location = New System.Drawing.Point(258, 43) + Me.lblTable.Name = "lblTable" + Me.lblTable.Size = New System.Drawing.Size(37, 13) + Me.lblTable.TabIndex = 25 + Me.lblTable.Text = "Table:" + ' + 'lblExportTables + ' + Me.lblExportTables.AutoSize = True + Me.lblExportTables.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblExportTables.Location = New System.Drawing.Point(12, 248) + Me.lblExportTables.Name = "lblExportTables" + Me.lblExportTables.Size = New System.Drawing.Size(84, 13) + Me.lblExportTables.TabIndex = 26 + Me.lblExportTables.Text = "Export Table as:" + ' + 'ucrSaveTable ' - 'lblExportTable + Me.ucrSaveTable.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrSaveTable.Location = New System.Drawing.Point(10, 379) + Me.ucrSaveTable.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.ucrSaveTable.Name = "ucrSaveTable" + Me.ucrSaveTable.Size = New System.Drawing.Size(390, 34) + Me.ucrSaveTable.TabIndex = 4 ' - Me.lblExportTable.AutoSize = True - Me.lblExportTable.Enabled = False - Me.lblExportTable.Location = New System.Drawing.Point(5, 227) - Me.lblExportTable.Name = "lblExportTable" - Me.lblExportTable.Size = New System.Drawing.Size(119, 13) - Me.lblExportTable.TabIndex = 12 - Me.lblExportTable.Text = "Export Table Object As:" + 'ucrTablesReceiver + ' + Me.ucrTablesReceiver.AutoSize = True + Me.ucrTablesReceiver.frmParent = Me + Me.ucrTablesReceiver.Location = New System.Drawing.Point(256, 59) + Me.ucrTablesReceiver.Margin = New System.Windows.Forms.Padding(0) + Me.ucrTablesReceiver.Name = "ucrTablesReceiver" + Me.ucrTablesReceiver.Selector = Nothing + Me.ucrTablesReceiver.Size = New System.Drawing.Size(135, 20) + Me.ucrTablesReceiver.strNcFilePath = "" + Me.ucrTablesReceiver.TabIndex = 2 + Me.ucrTablesReceiver.ucrSelector = Nothing ' 'ucrTablesSelector ' @@ -159,23 +143,40 @@ Partial Class dlgUseTable Me.ucrTablesSelector.Size = New System.Drawing.Size(213, 183) Me.ucrTablesSelector.TabIndex = 1 ' + 'ucrBase + ' + Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrBase.Location = New System.Drawing.Point(2, 417) + Me.ucrBase.Name = "ucrBase" + Me.ucrBase.Size = New System.Drawing.Size(407, 52) + Me.ucrBase.TabIndex = 0 + ' + 'ucrPnlOptions + ' + Me.ucrPnlOptions.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlOptions.Location = New System.Drawing.Point(8, 263) + Me.ucrPnlOptions.Margin = New System.Windows.Forms.Padding(5) + Me.ucrPnlOptions.Name = "ucrPnlOptions" + Me.ucrPnlOptions.Size = New System.Drawing.Size(158, 106) + Me.ucrPnlOptions.TabIndex = 27 + ' 'dlgUseTable ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(411, 450) - Me.Controls.Add(Me.lblExportTable) - Me.Controls.Add(Me.cmdFormatOptions) + Me.ClientSize = New System.Drawing.Size(411, 478) + Me.Controls.Add(Me.lblExportTables) + Me.Controls.Add(Me.lblTable) + Me.Controls.Add(Me.cmdTableOptions) Me.Controls.Add(Me.rdoAsLaTex) Me.Controls.Add(Me.rdoAsWord) Me.Controls.Add(Me.rdoAsRTF) Me.Controls.Add(Me.rdoAsHTML) - Me.Controls.Add(Me.ucrPnlExportOptions) Me.Controls.Add(Me.ucrSaveTable) - Me.Controls.Add(Me.lblTablesToUse) Me.Controls.Add(Me.ucrTablesReceiver) Me.Controls.Add(Me.ucrTablesSelector) Me.Controls.Add(Me.ucrBase) + Me.Controls.Add(Me.ucrPnlOptions) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog Me.MaximizeBox = False Me.MinimizeBox = False @@ -190,13 +191,13 @@ Partial Class dlgUseTable Friend WithEvents ucrBase As ucrButtons Friend WithEvents ucrTablesSelector As ucrSelectorByDataFrameAddRemove Friend WithEvents ucrTablesReceiver As ucrReceiverSingle - Friend WithEvents lblTablesToUse As Label - Friend WithEvents ucrPnlExportOptions As UcrPanel Friend WithEvents ucrSaveTable As ucrSave Friend WithEvents rdoAsWord As RadioButton Friend WithEvents rdoAsRTF As RadioButton Friend WithEvents rdoAsHTML As RadioButton - Friend WithEvents cmdFormatOptions As Button + Friend WithEvents cmdTableOptions As Button Friend WithEvents rdoAsLaTex As RadioButton - Friend WithEvents lblExportTable As Label + Friend WithEvents lblTable As Label + Friend WithEvents lblExportTables As Label + Friend WithEvents ucrPnlOptions As UcrPanel End Class diff --git a/instat/dlgUseTable.vb b/instat/dlgUseTable.vb index 1757a270ec..738a980e0a 100644 --- a/instat/dlgUseTable.vb +++ b/instat/dlgUseTable.vb @@ -13,7 +13,7 @@ ' ' You should have received a copy of the GNU General Public License ' along with this program. If not, see . - +Imports System.IO Imports instat.Translations Public Class dlgUseTable Private bFirstLoad As Boolean = True @@ -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) @@ -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") @@ -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 @@ -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() @@ -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 \ No newline at end of file