diff --git a/instat/UserTables/dlgGeneralTable.Designer.vb b/instat/UserTables/dlgGeneralTable.Designer.vb index 481a6fbbd4..6d262a17ce 100644 --- a/instat/UserTables/dlgGeneralTable.Designer.vb +++ b/instat/UserTables/dlgGeneralTable.Designer.vb @@ -24,12 +24,21 @@ Partial Class dlgGeneralTable Private Sub InitializeComponent() Me.lblColumns = New System.Windows.Forms.Label() Me.btnMoreOptions = New System.Windows.Forms.Button() + Me.ucrChkSelectTheme = New instat.ucrCheck() + Me.ucrCboSelectThemes = New instat.ucrInputComboBox() Me.ucrNudPreview = New instat.ucrNud() Me.ucrChkPreview = New instat.ucrCheck() Me.ucrSaveTable = New instat.ucrSave() Me.ucrBase = New instat.ucrButtons() Me.ucrReceiverMultipleCols = New instat.ucrReceiverMultiple() Me.ucrSelectorCols = New instat.ucrSelectorByDataFrameAddRemove() + Me.grpBoxTitle = New System.Windows.Forms.GroupBox() + Me.lblTitle = New System.Windows.Forms.Label() + Me.ucrInputTitle = New instat.ucrInputTextBox() + Me.btnTitleStyle = New System.Windows.Forms.Button() + Me.lblHeaderTitle = New System.Windows.Forms.Label() + Me.ucrInputTitleFooter = New instat.ucrInputTextBox() + Me.grpBoxTitle.SuspendLayout() Me.SuspendLayout() ' 'lblColumns @@ -51,6 +60,27 @@ Partial Class dlgGeneralTable Me.btnMoreOptions.Text = "Table Options" Me.btnMoreOptions.UseVisualStyleBackColor = True ' + 'ucrChkSelectTheme + ' + Me.ucrChkSelectTheme.AutoSize = True + Me.ucrChkSelectTheme.Checked = False + Me.ucrChkSelectTheme.Location = New System.Drawing.Point(9, 361) + Me.ucrChkSelectTheme.Name = "ucrChkSelectTheme" + Me.ucrChkSelectTheme.Size = New System.Drawing.Size(182, 23) + Me.ucrChkSelectTheme.TabIndex = 33 + ' + 'ucrCboSelectThemes + ' + Me.ucrCboSelectThemes.AddQuotesIfUnrecognised = True + Me.ucrCboSelectThemes.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboSelectThemes.GetSetSelectedIndex = -1 + Me.ucrCboSelectThemes.IsReadOnly = False + Me.ucrCboSelectThemes.Location = New System.Drawing.Point(214, 361) + Me.ucrCboSelectThemes.Margin = New System.Windows.Forms.Padding(9) + Me.ucrCboSelectThemes.Name = "ucrCboSelectThemes" + Me.ucrCboSelectThemes.Size = New System.Drawing.Size(168, 21) + Me.ucrCboSelectThemes.TabIndex = 32 + ' 'ucrNudPreview ' Me.ucrNudPreview.AutoSize = True @@ -78,7 +108,7 @@ Partial Class dlgGeneralTable 'ucrSaveTable ' Me.ucrSaveTable.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrSaveTable.Location = New System.Drawing.Point(9, 242) + Me.ucrSaveTable.Location = New System.Drawing.Point(9, 392) Me.ucrSaveTable.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.ucrSaveTable.Name = "ucrSaveTable" Me.ucrSaveTable.Size = New System.Drawing.Size(319, 24) @@ -87,7 +117,7 @@ Partial Class dlgGeneralTable 'ucrBase ' Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(9, 276) + Me.ucrBase.Location = New System.Drawing.Point(9, 427) Me.ucrBase.Margin = New System.Windows.Forms.Padding(4) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(410, 52) @@ -118,11 +148,81 @@ Partial Class dlgGeneralTable Me.ucrSelectorCols.Size = New System.Drawing.Size(213, 183) Me.ucrSelectorCols.TabIndex = 22 ' + 'grpBoxTitle + ' + Me.grpBoxTitle.Controls.Add(Me.lblTitle) + Me.grpBoxTitle.Controls.Add(Me.ucrInputTitle) + Me.grpBoxTitle.Controls.Add(Me.btnTitleStyle) + Me.grpBoxTitle.Controls.Add(Me.lblHeaderTitle) + Me.grpBoxTitle.Controls.Add(Me.ucrInputTitleFooter) + Me.grpBoxTitle.Location = New System.Drawing.Point(7, 233) + Me.grpBoxTitle.Name = "grpBoxTitle" + Me.grpBoxTitle.Size = New System.Drawing.Size(463, 115) + Me.grpBoxTitle.TabIndex = 34 + Me.grpBoxTitle.TabStop = False + Me.grpBoxTitle.Text = "Title" + ' + 'lblTitle + ' + Me.lblTitle.AutoSize = True + Me.lblTitle.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblTitle.Location = New System.Drawing.Point(8, 22) + Me.lblTitle.Name = "lblTitle" + Me.lblTitle.Size = New System.Drawing.Size(59, 13) + Me.lblTitle.TabIndex = 26 + Me.lblTitle.Text = "Title Label:" + ' + 'ucrInputTitle + ' + Me.ucrInputTitle.AddQuotesIfUnrecognised = True + Me.ucrInputTitle.AutoSize = True + Me.ucrInputTitle.IsMultiline = False + Me.ucrInputTitle.IsReadOnly = False + Me.ucrInputTitle.Location = New System.Drawing.Point(11, 42) + Me.ucrInputTitle.Margin = New System.Windows.Forms.Padding(9) + Me.ucrInputTitle.Name = "ucrInputTitle" + Me.ucrInputTitle.Size = New System.Drawing.Size(359, 21) + Me.ucrInputTitle.TabIndex = 28 + ' + 'btnTitleStyle + ' + Me.btnTitleStyle.Location = New System.Drawing.Point(374, 42) + Me.btnTitleStyle.Name = "btnTitleStyle" + Me.btnTitleStyle.Size = New System.Drawing.Size(79, 23) + Me.btnTitleStyle.TabIndex = 30 + Me.btnTitleStyle.Text = "Style" + Me.btnTitleStyle.UseVisualStyleBackColor = True + ' + 'lblHeaderTitle + ' + Me.lblHeaderTitle.AutoSize = True + Me.lblHeaderTitle.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblHeaderTitle.Location = New System.Drawing.Point(8, 72) + Me.lblHeaderTitle.Name = "lblHeaderTitle" + Me.lblHeaderTitle.Size = New System.Drawing.Size(63, 13) + Me.lblHeaderTitle.TabIndex = 20 + Me.lblHeaderTitle.Text = "Title Footer:" + ' + 'ucrInputTitleFooter + ' + Me.ucrInputTitleFooter.AddQuotesIfUnrecognised = True + Me.ucrInputTitleFooter.AutoSize = True + Me.ucrInputTitleFooter.IsMultiline = False + Me.ucrInputTitleFooter.IsReadOnly = False + Me.ucrInputTitleFooter.Location = New System.Drawing.Point(11, 89) + Me.ucrInputTitleFooter.Margin = New System.Windows.Forms.Padding(9) + Me.ucrInputTitleFooter.Name = "ucrInputTitleFooter" + Me.ucrInputTitleFooter.Size = New System.Drawing.Size(359, 21) + Me.ucrInputTitleFooter.TabIndex = 22 + ' 'dlgGeneralTable ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(476, 338) + Me.ClientSize = New System.Drawing.Size(476, 479) + Me.Controls.Add(Me.grpBoxTitle) + Me.Controls.Add(Me.ucrChkSelectTheme) + Me.Controls.Add(Me.ucrCboSelectThemes) Me.Controls.Add(Me.ucrNudPreview) Me.Controls.Add(Me.ucrChkPreview) Me.Controls.Add(Me.ucrSaveTable) @@ -135,6 +235,8 @@ Partial Class dlgGeneralTable Me.Name = "dlgGeneralTable" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Presentation Table" + Me.grpBoxTitle.ResumeLayout(False) + Me.grpBoxTitle.PerformLayout() Me.ResumeLayout(False) Me.PerformLayout() @@ -147,4 +249,12 @@ Partial Class dlgGeneralTable Friend WithEvents ucrSaveTable As ucrSave Friend WithEvents ucrNudPreview As ucrNud Friend WithEvents ucrChkPreview As ucrCheck + Friend WithEvents ucrChkSelectTheme As ucrCheck + Friend WithEvents ucrCboSelectThemes As ucrInputComboBox + Friend WithEvents grpBoxTitle As GroupBox + Friend WithEvents lblTitle As Label + Friend WithEvents ucrInputTitle As ucrInputTextBox + Friend WithEvents btnTitleStyle As Button + Friend WithEvents lblHeaderTitle As Label + Friend WithEvents ucrInputTitleFooter As ucrInputTextBox End Class diff --git a/instat/UserTables/dlgGeneralTable.vb b/instat/UserTables/dlgGeneralTable.vb index fefc401eee..cb8210bf1c 100644 --- a/instat/UserTables/dlgGeneralTable.vb +++ b/instat/UserTables/dlgGeneralTable.vb @@ -2,7 +2,7 @@ Public Class dlgGeneralTable Private clsBaseOperator As New ROperator - Private clsHeadRFunction, clsGtRFunction As New RFunction + Private clsHeadRFunction, clsHeaderRFunction, clsCellsTitleRFunction, clsTitleStyleRFunction, clsTitleFooterRFunction, clsGtRFunction, clsThemeRFunction As New RFunction Private bFirstload As Boolean = True Private bReset As Boolean = True @@ -24,6 +24,11 @@ Public Class dlgGeneralTable Private Sub btnMoreOptions_Click(sender As Object, e As EventArgs) Handles btnMoreOptions.Click sdgTableOptions.Setup(ucrSelectorCols.strCurrentDataFrame, clsBaseOperator) sdgTableOptions.ShowDialog(Me) + ucrInputTitle.SetText(sdgTableOptions.ucrHeader.ucrInputTitle.GetText) + ucrInputTitleFooter.SetText(sdgTableOptions.ucrHeader.ucrInputTitleFooter.GetText) + ucrCboSelectThemes.SetText(sdgTableOptions.ucrCboSelectThemes.GetText) + ucrChkSelectTheme.Checked = sdgTableOptions.ucrChkSelectTheme.Checked + sdgTableStyles.GetNewUserInputAsRFunction() End Sub Private Sub ucrControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverMultipleCols.ControlContentsChanged @@ -44,6 +49,9 @@ Public Class dlgGeneralTable ucrReceiverMultipleCols.Selector = ucrSelectorCols ucrReceiverMultipleCols.SetLinkedDisplayControl(lblColumns) + ucrInputTitle.SetParameter(New RParameter("title", iNewPosition:=0)) + ucrInputTitleFooter.SetParameter(New RParameter("footnote", iNewPosition:=0)) + ucrChkPreview.SetText("Preview") ucrChkPreview.AddParameterPresentCondition(True, "head", bNewIsPositive:=True) ucrChkPreview.AddParameterPresentCondition(False, "head", bNewIsPositive:=False) @@ -61,14 +69,23 @@ Public Class dlgGeneralTable ucrSaveTable.SetCheckBoxText("Store Table") ucrSaveTable.SetAssignToIfUncheckedValue("last_table") + ucrChkSelectTheme.Checked = True + ucrChkSelectTheme.SetText("Select Theme") + ucrCboSelectThemes.SetItems({"None", "Dark Theme", "538 Theme", "Dot Matrix Theme", "Espn Theme", "Excel Theme", "Guardian Theme", "NY Times Theme", "PFF Theme"}) + ucrCboSelectThemes.SetDropDownStyleAsNonEditable() + ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False End Sub - Private Sub SetDefaults() clsBaseOperator = New ROperator + clsHeadRFunction = New RFunction clsGtRFunction = New RFunction + clsHeaderRFunction = New RFunction + clsCellsTitleRFunction = New RFunction + clsTitleFooterRFunction = New RFunction + clsTitleStyleRFunction = New RFunction ucrSelectorCols.Reset() ucrReceiverMultipleCols.SetMeAsReceiver() @@ -80,13 +97,34 @@ Public Class dlgGeneralTable clsHeadRFunction.SetPackageName("utils") clsHeadRFunction.SetRCommand("head") - clsHeadRFunction.AddParameter(strParameterName:="x", strParameterValue:=100, iPosition:=0, bIncludeArgumentName:=False) + clsHeadRFunction.AddParameter(strParameterName:="x", strParameterValue:=10, iPosition:=0, bIncludeArgumentName:=False) clsBaseOperator.AddParameter(strParameterName:="head", clsRFunctionParameter:=clsHeadRFunction, iPosition:=1, bIncludeArgumentName:=False) clsGtRFunction.SetPackageName("gt") clsGtRFunction.SetRCommand("gt") clsBaseOperator.AddParameter(strParameterName:="gt", clsRFunctionParameter:=clsGtRFunction, iPosition:=2, bIncludeArgumentName:=False) + Dim strCommand As String = "" + clsThemeRFunction.SetPackageName("gtExtras") + clsThemeRFunction.SetRCommand(strCommand) + clsBaseOperator.AddParameter("theme_format", clsRFunctionParameter:=clsThemeRFunction) + + clsHeaderRFunction.SetPackageName("gt") + clsHeaderRFunction.SetRCommand("tab_header") + clsHeaderRFunction.AddParameter("title", ucrInputTitle.GetText, iPosition:=1) + clsBaseOperator.AddParameter("theme_Header", clsRFunctionParameter:=clsHeaderRFunction) + + clsTitleFooterRFunction.SetPackageName("gt") + clsTitleFooterRFunction.SetRCommand("tab_footnote") + clsTitleFooterRFunction.AddParameter("footnote", ucrInputTitleFooter.GetText, iPosition:=1) + clsTitleFooterRFunction.AddParameter("locations", clsRFunctionParameter:=clsCellsTitleRFunction, iPosition:=2) + clsBaseOperator.AddParameter("theme_footer", clsRFunctionParameter:=clsTitleFooterRFunction) + + Dim strGroupParamValue As String = "title" + clsCellsTitleRFunction.SetPackageName("gt") + clsCellsTitleRFunction.SetRCommand("cells_title") + clsCellsTitleRFunction.AddParameter(strParameterName:="groups", strParameterValue:=Chr(34) & strGroupParamValue & Chr(34), iPosition:=0) + clsBaseOperator.SetAssignToOutputObject(strRObjectToAssignTo:="last_table", strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Table, strRObjectFormatToAssignTo:=RObjectFormat.Html, @@ -96,11 +134,11 @@ Public Class dlgGeneralTable ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) End Sub - Private Sub SetRCodeForControls(bReset As Boolean) ucrReceiverMultipleCols.SetRCode(clsBaseOperator, bReset) ucrSaveTable.SetRCode(clsBaseOperator, bReset) - + ucrInputTitle.SetRCode(clsHeaderRFunction, True, bCloneIfNeeded:=True) + ucrInputTitleFooter.SetRCode(clsTitleFooterRFunction, True, bCloneIfNeeded:=True) ucrChkPreview.SetRCode(clsBaseOperator, bReset) ucrNudPreview.SetRCode(clsHeadRFunction, bReset) End Sub @@ -116,4 +154,70 @@ Public Class dlgGeneralTable clsBaseOperator.RemoveParameterByName("head") End If End Sub + + Private Sub btnTitleFormat_Click(sender As Object, e As EventArgs) Handles btnTitleStyle.Click + Dim clsListStyleRFunction As RFunction = clsTablesUtils.ShowStyleSubDialog(Me.ParentForm, clsTitleStyleRFunction) + If clsListStyleRFunction Is Nothing Then + Exit Sub + End If + + clsTitleStyleRFunction = clsTablesUtils.GetNewStyleRFunction(clsListStyleRFunction, clsCellsTitleRFunction) + If clsTitleStyleRFunction IsNot Nothing Then + clsBaseOperator.AddParameter(strParameterName:="tab_style_for_title_param", clsRFunctionParameter:=clsTitleStyleRFunction) + End If + End Sub + + Private Sub ucrInputControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrInputTitle.ControlContentsChanged, ucrInputTitleFooter.ControlContentsChanged + ucrInputTitleFooter.Enabled = Not ucrInputTitle.IsEmpty() + If Not ucrInputTitle.IsEmpty Then + clsBaseOperator.AddParameter("theme_Header", clsRFunctionParameter:=clsHeaderRFunction) + Else + clsBaseOperator.RemoveParameterByName("theme_Header") + End If + If Not ucrInputTitleFooter.IsEmpty Then + clsBaseOperator.AddParameter("theme_footer", clsRFunctionParameter:=clsTitleFooterRFunction) + Else + clsBaseOperator.RemoveParameterByName("theme_footer") + End If + End Sub + + Private Sub ucrChkSelectTheme_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkSelectTheme.ControlValueChanged + If ucrChkSelectTheme.Checked Then + ucrCboSelectThemes.Visible = True + clsBaseOperator.AddParameter("theme_format", clsRFunctionParameter:=clsThemeRFunction) + Else + clsBaseOperator.RemoveParameterByName("theme_format") + ucrCboSelectThemes.Visible = False + clsThemeRFunction.ClearParameters() + End If + End Sub + + Private Sub ucrCboSelectThemes_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrCboSelectThemes.ControlValueChanged + + If clsThemeRFunction Is Nothing Then + Exit Sub + End If + Dim strCommand As String = "" + Select Case ucrCboSelectThemes.GetText + Case "Dark Theme" + strCommand = "gt_theme_dark" + Case "538 Theme" + strCommand = "gt_theme_538" + Case "Dot Matrix Theme" + strCommand = "gt_theme_dot_matrix" + Case "Espn Theme" + strCommand = "gt_theme_espn" + Case "Excel Theme" + strCommand = "gt_theme_excel" + Case "Guardian Theme" + strCommand = "gt_theme_guardian" + Case "NY Times Theme" + strCommand = "gt_theme_nytimes" + Case "PFF Theme" + strCommand = "gt_theme_pff" + End Select + + clsThemeRFunction.SetRCommand(strCommand) + End Sub + End Class \ No newline at end of file diff --git a/instat/UserTables/sdgTableOptions.Designer.vb b/instat/UserTables/sdgTableOptions.Designer.vb index 5f4be438d6..6963448c18 100644 --- a/instat/UserTables/sdgTableOptions.Designer.vb +++ b/instat/UserTables/sdgTableOptions.Designer.vb @@ -36,11 +36,10 @@ Partial Class sdgTableOptions Me.tbpSourceNotes = New System.Windows.Forms.TabPage() Me.ucrSourceNotes = New instat.ucrSourceNotes() Me.tbpThemes = New System.Windows.Forms.TabPage() + Me.ucrChkSelectTheme = New instat.ucrCheck() + Me.ucrChkManualTheme = New instat.ucrCheck() Me.ucrCboSelectThemes = New instat.ucrInputComboBox() Me.btnManualTheme = New System.Windows.Forms.Button() - Me.rdoSelectTheme = New System.Windows.Forms.RadioButton() - Me.rdoManualTheme = New System.Windows.Forms.RadioButton() - Me.ucrPnlThemesPanel = New instat.UcrPanel() Me.tbpOtherStyles = New System.Windows.Forms.TabPage() Me.ucrOtherStyles = New instat.ucrOtherStyles() Me.ucrSdgBaseButtons = New instat.ucrButtonsSubdialogue() @@ -182,11 +181,10 @@ Partial Class sdgTableOptions ' 'tbpThemes ' + Me.tbpThemes.Controls.Add(Me.ucrChkSelectTheme) + Me.tbpThemes.Controls.Add(Me.ucrChkManualTheme) Me.tbpThemes.Controls.Add(Me.ucrCboSelectThemes) Me.tbpThemes.Controls.Add(Me.btnManualTheme) - Me.tbpThemes.Controls.Add(Me.rdoSelectTheme) - Me.tbpThemes.Controls.Add(Me.rdoManualTheme) - Me.tbpThemes.Controls.Add(Me.ucrPnlThemesPanel) Me.tbpThemes.Location = New System.Drawing.Point(4, 22) Me.tbpThemes.Name = "tbpThemes" Me.tbpThemes.Size = New System.Drawing.Size(648, 431) @@ -194,13 +192,31 @@ Partial Class sdgTableOptions Me.tbpThemes.Text = "Themes" Me.tbpThemes.UseVisualStyleBackColor = True ' + 'ucrChkSelectTheme + ' + Me.ucrChkSelectTheme.AutoSize = True + Me.ucrChkSelectTheme.Checked = False + Me.ucrChkSelectTheme.Location = New System.Drawing.Point(25, 29) + Me.ucrChkSelectTheme.Name = "ucrChkSelectTheme" + Me.ucrChkSelectTheme.Size = New System.Drawing.Size(182, 23) + Me.ucrChkSelectTheme.TabIndex = 29 + ' + 'ucrChkManualTheme + ' + Me.ucrChkManualTheme.AutoSize = True + Me.ucrChkManualTheme.Checked = False + Me.ucrChkManualTheme.Location = New System.Drawing.Point(25, 57) + Me.ucrChkManualTheme.Name = "ucrChkManualTheme" + Me.ucrChkManualTheme.Size = New System.Drawing.Size(182, 23) + Me.ucrChkManualTheme.TabIndex = 28 + ' 'ucrCboSelectThemes ' Me.ucrCboSelectThemes.AddQuotesIfUnrecognised = True Me.ucrCboSelectThemes.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrCboSelectThemes.GetSetSelectedIndex = -1 Me.ucrCboSelectThemes.IsReadOnly = False - Me.ucrCboSelectThemes.Location = New System.Drawing.Point(157, 29) + Me.ucrCboSelectThemes.Location = New System.Drawing.Point(230, 29) Me.ucrCboSelectThemes.Margin = New System.Windows.Forms.Padding(9) Me.ucrCboSelectThemes.Name = "ucrCboSelectThemes" Me.ucrCboSelectThemes.Size = New System.Drawing.Size(168, 21) @@ -208,44 +224,13 @@ Partial Class sdgTableOptions ' 'btnManualTheme ' - Me.btnManualTheme.Location = New System.Drawing.Point(157, 59) + Me.btnManualTheme.Location = New System.Drawing.Point(231, 59) Me.btnManualTheme.Name = "btnManualTheme" Me.btnManualTheme.Size = New System.Drawing.Size(168, 21) Me.btnManualTheme.TabIndex = 2 Me.btnManualTheme.Text = "Custom Theme" Me.btnManualTheme.UseVisualStyleBackColor = True ' - 'rdoSelectTheme - ' - Me.rdoSelectTheme.AutoSize = True - Me.rdoSelectTheme.Checked = True - Me.rdoSelectTheme.Location = New System.Drawing.Point(22, 31) - Me.rdoSelectTheme.Name = "rdoSelectTheme" - Me.rdoSelectTheme.Size = New System.Drawing.Size(91, 17) - Me.rdoSelectTheme.TabIndex = 0 - Me.rdoSelectTheme.TabStop = True - Me.rdoSelectTheme.Text = "Select Theme" - Me.rdoSelectTheme.UseVisualStyleBackColor = True - ' - 'rdoManualTheme - ' - Me.rdoManualTheme.AutoSize = True - Me.rdoManualTheme.Location = New System.Drawing.Point(22, 61) - Me.rdoManualTheme.Name = "rdoManualTheme" - Me.rdoManualTheme.Size = New System.Drawing.Size(96, 17) - Me.rdoManualTheme.TabIndex = 1 - Me.rdoManualTheme.Text = "Manual Theme" - Me.rdoManualTheme.UseVisualStyleBackColor = True - ' - 'ucrPnlThemesPanel - ' - Me.ucrPnlThemesPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlThemesPanel.Location = New System.Drawing.Point(12, 16) - Me.ucrPnlThemesPanel.Margin = New System.Windows.Forms.Padding(6) - Me.ucrPnlThemesPanel.Name = "ucrPnlThemesPanel" - Me.ucrPnlThemesPanel.Size = New System.Drawing.Size(349, 70) - Me.ucrPnlThemesPanel.TabIndex = 4 - ' 'tbpOtherStyles ' Me.tbpOtherStyles.Controls.Add(Me.ucrOtherStyles) @@ -306,9 +291,6 @@ Partial Class sdgTableOptions Friend WithEvents tbpThemes As TabPage Friend WithEvents ucrCboSelectThemes As ucrInputComboBox Friend WithEvents btnManualTheme As Button - Friend WithEvents rdoSelectTheme As RadioButton - Friend WithEvents rdoManualTheme As RadioButton - Friend WithEvents ucrPnlThemesPanel As UcrPanel Friend WithEvents ucrSourceNotes As ucrSourceNotes Friend WithEvents tbpRows As TabPage Friend WithEvents ucrHeader As ucrHeader @@ -321,4 +303,6 @@ Partial Class sdgTableOptions Friend WithEvents ucrSdgBaseButtons As ucrButtonsSubdialogue Friend WithEvents tbpOtherStyles As TabPage Friend WithEvents ucrOtherStyles As ucrOtherStyles + Friend WithEvents ucrChkSelectTheme As ucrCheck + Friend WithEvents ucrChkManualTheme As ucrCheck End Class diff --git a/instat/UserTables/sdgTableOptions.vb b/instat/UserTables/sdgTableOptions.vb index d7fa2263d4..f18bba956f 100644 --- a/instat/UserTables/sdgTableOptions.vb +++ b/instat/UserTables/sdgTableOptions.vb @@ -26,15 +26,17 @@ Public Class sdgTableOptions If bFirstload Then InitialiseDialog() bFirstload = False + 'adding these because it's ignored on first load + ucrCboSelectThemes.SetText(dlgGeneralTable.ucrCboSelectThemes.GetText) End If autoTranslate(Me) End Sub Private Sub InitialiseDialog() ucrSdgBaseButtons.iHelpTopicID = 146 - - ucrPnlThemesPanel.AddRadioButton(rdoSelectTheme) - ucrPnlThemesPanel.AddRadioButton(rdoManualTheme) + ucrChkSelectTheme.Checked = True + ucrChkSelectTheme.SetText("Select Theme") + ucrChkManualTheme.SetText("Manual Theme") ucrCboSelectThemes.SetItems({"None", "Dark Theme", "538 Theme", "Dot Matrix Theme", "Espn Theme", "Excel Theme", "Guardian Theme", "NY Times Theme", "PFF Theme"}) ucrCboSelectThemes.SetDropDownStyleAsNonEditable() @@ -57,6 +59,11 @@ Public Class sdgTableOptions ucrSourceNotes.Setup(clsOperator) ucrOtherStyles.Setup(clsOperator) + ucrHeader.ucrInputTitle.SetText(dlgGeneralTable.ucrInputTitle.GetText) + ucrHeader.ucrInputTitleFooter.SetText(dlgGeneralTable.ucrInputTitleFooter.GetText) + ucrCboSelectThemes.SetText(dlgGeneralTable.ucrCboSelectThemes.GetText) + ucrChkSelectTheme.Checked = dlgGeneralTable.ucrChkSelectTheme.Checked + sdgTableStyles.GetNewUserInputAsRFunction() SetupTheme(clsOperator) End Sub @@ -82,22 +89,36 @@ Public Class sdgTableOptions clsThemeRFunction = New RFunction clsThemeRFunction.SetPackageName("gtExtras") End If + If ucrChkManualTheme.Checked Then + sdgSummaryThemes.SetRCode(bReset:=True, clsNewThemesTabOption:=clsThemeRFunction) + End If End Sub - Private Sub ucrPnlThemes_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlThemesPanel.ControlValueChanged - ucrCboSelectThemes.Visible = False - btnManualTheme.Visible = False - - If rdoSelectTheme.Checked Then + Private Sub ucrChkSelectTheme_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkSelectTheme.ControlValueChanged + If ucrChkSelectTheme.Checked Then + btnManualTheme.Visible = False ucrCboSelectThemes.Visible = True - clsThemeRFunction.SetPackageName("gtExtras") - clsThemeRFunction.ClearParameters() - ElseIf rdoManualTheme.Checked Then + ElseIf ucrChkSelectTheme.Checked Then + ucrChkManualTheme.Checked = True + Else + ucrCboSelectThemes.Visible = False + End If + End Sub + + Private Sub ucrChkManualTheme_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkManualTheme.ControlValueChanged + + If ucrChkManualTheme.Checked Then btnManualTheme.Visible = True - clsThemeRFunction.SetPackageName("gt") - clsThemeRFunction.SetRCommand("tab_options") + ucrChkSelectTheme.Checked = Not ucrChkManualTheme.Checked + btnManualTheme.Visible = ucrChkManualTheme.Checked End If + End Sub + Private Sub btnManualTheme_Click(sender As Object, e As EventArgs) Handles btnManualTheme.Click + clsThemeRFunction.SetPackageName("gt") + clsThemeRFunction.SetRCommand("tab_options") + sdgSummaryThemes.SetRCode(bReset:=True, clsNewThemesTabOption:=clsThemeRFunction) + sdgSummaryThemes.ShowDialog(Me) End Sub Private Sub ucrCboSelectThemes_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrCboSelectThemes.ControlValueChanged @@ -129,13 +150,11 @@ Public Class sdgTableOptions clsThemeRFunction.SetRCommand(strCommand) End Sub - Private Sub btnManualTheme_Click(sender As Object, e As EventArgs) Handles btnManualTheme.Click - sdgSummaryThemes.SetRCode(bReset:=True, clsNewThemesTabOption:=clsThemeRFunction) - sdgSummaryThemes.ShowDialog(Me) - End Sub - Private Sub SetThemeValuesOnReturn(clsOperator As ROperator) ' Set the themes parameter if there was a theme selected + If ucrChkManualTheme.Checked Then + sdgSummaryThemes.SetRCode(bReset:=True, clsNewThemesTabOption:=clsThemeRFunction) + End If If clsThemeRFunction IsNot Nothing AndAlso Not String.IsNullOrEmpty(clsThemeRFunction.strRCommand) Then clsOperator.AddParameter("theme_format", clsRFunctionParameter:=clsThemeRFunction) Else diff --git a/instat/UserTables/sdgTableStyles.vb b/instat/UserTables/sdgTableStyles.vb index d6c1c720bd..787a166aa5 100644 --- a/instat/UserTables/sdgTableStyles.vb +++ b/instat/UserTables/sdgTableStyles.vb @@ -87,15 +87,15 @@ Public Class sdgTableStyles '----------------- Dim dctFontWeight As New Dictionary(Of String, String) From { - {"Default", "NULL"}, - {"Normal", Chr(34) & "normal" & Chr(34)}, - {"Bold", Chr(34) & "bold" & Chr(34)}, - {"Lighter", Chr(34) & "lighter" & Chr(34)}, - {"Bolder", Chr(34) & "bold" & Chr(34)} - } + {"Default", "NULL"}, + {"Normal", Chr(34) & "normal" & Chr(34)}, + {"Bold", Chr(34) & "bold" & Chr(34)}, + {"Lighter", Chr(34) & "lighter" & Chr(34)}, + {"Bolder", Chr(34) & "bolder" & Chr(34)} +} ucrCboFontWeight.SetDropDownStyleAsNonEditable() - ucrCboFontWeight.SetParameter(New RParameter("weight", iNewPosition:=7)) + ucrCboFontWeight.SetParameter(New RParameter("weight", iNewPosition:=7)) ' Corrected parameter name ucrCboFontWeight.SetItems(dctFontWeight) ucrCboFontWeight.SetRDefault("NULL") '----------------- @@ -133,6 +133,7 @@ Public Class sdgTableStyles '----------------- '----------------- + ' Transform Dim dctTransform As New Dictionary(Of String, String) From { {"Default", "NULL"}, {"Uppercase", Chr(34) & "uppercase" & Chr(34)}, @@ -140,7 +141,7 @@ Public Class sdgTableStyles {"Capitalize", Chr(34) & "capitalize" & Chr(34)} } ucrCboTransform.SetDropDownStyleAsNonEditable() - ucrCboTransform.SetParameter(New RParameter("transform", iNewPosition:=9)) + ucrCboTransform.SetParameter(New RParameter("transform", iNewPosition:=9)) ' Corrected parameter name ucrCboTransform.SetItems(dctTransform) ucrCboTransform.SetRDefault("NULL") '----------------- @@ -169,18 +170,18 @@ Public Class sdgTableStyles ucrNudIndent.SetRDefault(0) '----------------- - '----------------- + ' White Space Dim dctWhiteSpace As New Dictionary(Of String, String) From { {"Default", "NULL"}, {"Normal", Chr(34) & "normal" & Chr(34)}, - {"No wrap", Chr(34) & "nowrap" & Chr(34)}, + {"No Wrap", Chr(34) & "nowrap" & Chr(34)}, ' Corrected key {"Pre", Chr(34) & "pre" & Chr(34)}, - {"Pre-wrap", Chr(34) & "pre-wrap" & Chr(34)}, - {"Pre-line", Chr(34) & "pre-line" & Chr(34)}, - {"Break-spaces", Chr(34) & "break-spaces" & Chr(34)} + {"Pre-Wrap", Chr(34) & "pre-wrap" & Chr(34)}, ' Corrected key + {"Pre-Line", Chr(34) & "pre-line" & Chr(34)}, ' Corrected key + {"Break Spaces", Chr(34) & "break-spaces" & Chr(34)} ' Corrected key } ucrCboWhiteSpace.SetDropDownStyleAsNonEditable() - ucrCboWhiteSpace.SetParameter(New RParameter("transform", iNewPosition:=11)) + ucrCboWhiteSpace.SetParameter(New RParameter("whitespace", iNewPosition:=12)) ' Corrected parameter name and position ucrCboWhiteSpace.SetItems(dctWhiteSpace) ucrCboWhiteSpace.SetRDefault("NULL") '----------------- diff --git a/instat/sdgSummaryThemes.vb b/instat/sdgSummaryThemes.vb index 8b1f5ab8f0..2c4d1fc2e8 100644 --- a/instat/sdgSummaryThemes.vb +++ b/instat/sdgSummaryThemes.vb @@ -18,6 +18,7 @@ Imports instat.Translations Public Class sdgSummaryThemes Private clsThemesTabOptionsFunction As New RFunction + Private bRCodeSet As Boolean = False Private bControlsInitialised As Boolean = False