diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.cs index e121f00f..43e01701 100644 --- a/PROMS/Volian.Controls.Library/StepTabRibbon.cs +++ b/PROMS/Volian.Controls.Library/StepTabRibbon.cs @@ -2707,8 +2707,8 @@ namespace Volian.Controls.Library ChangeTableTextFontSize(newSize); } + } } - } // B2021-052 table cell text that ends with a link (RO or Transition) was not accepting a change in font size private void ChangeTableTextFontSize(float newSize) @@ -2732,7 +2732,7 @@ namespace Volian.Controls.Library MyStepRTB.Select(MyStepRTB.TextLength - 1, 1); // select the space at the end of the text MyStepRTB.SelectedText = ""; // remove the space MyStepRTB.Select(ss, sl); - } + } } private void ToggleBold() @@ -4422,6 +4422,7 @@ namespace Volian.Controls.Library if (MyFlexGrid.Cols[0].Width == -1) MyFlexGrid.Cols[0].Width = MyFlexGrid.Cols.DefaultSize; MyFlexGrid.Cols.Fixed = MyFlexGrid.Cols.Count; MyFlexGrid.Rows.Fixed = MyFlexGrid.Rows.Count; + MyFlexGrid.StyleBackColor = MyFlexGrid.DefaultFixedBackgroundColor; // C2021-004 force the fixed background color ToggleTableDesignButtons(false); //MyFlexGrid.ListStyles(); } @@ -4430,7 +4431,7 @@ namespace Volian.Controls.Library // set grid back to "normal" mode MyFlexGrid.Cols.Fixed = 0; MyFlexGrid.Rows.Fixed = 0; - MyFlexGrid.StyleBackColor = Color.White; + MyFlexGrid.ShowTableCellShading(); // C2021-004 show the table cell colors ToggleTableDesignButtons(true); //MyFlexGrid.ListStyles(); } @@ -4643,6 +4644,50 @@ namespace Volian.Controls.Library ChangeFontSize(SelectionOption.All, newSize); } } + #region Table Cell Shading + // C2021-004 Table Cell Shading + private void btnTblDgnCellShading_SelectedColorChanged(object sender, EventArgs e) + { + Color newshading = btnCellShading.SelectedColor; + MyFlexGrid.SetShading(MyFlexGrid.Selection, newshading); // assign the selected color the selected cell(s) + MyEditItem.Invalidate(); + MyFlexGrid.Invalidate(); + } + // This adds a button named "More Shading Options..." to the DotNetBar defined Color Selector button + private bool _CustomButtonAdded = false; + private void btnCellShading_PopupShowing(object sender, EventArgs e) + { + if (MyItemInfo == null || MyItemInfo.ActiveFormat.PlantFormat.FormatData.ShadingOptionList == null) return; //not shading options defined in format + if (!_CustomButtonAdded) + { + ButtonItem button = new ButtonItem(); + button.Text = "More Shading Options..."; + button.BeginGroup = true; + foreach (ShadingOption ShadeOpt in MyItemInfo.ActiveFormat.PlantFormat.FormatData.ShadingOptionList) + { + ButtonItem btn = new ButtonItem(); + btn.Tag = ShadeOpt; + btn.Text = ShadeOpt.ToString(); + btn.Click += new EventHandler(MoreShadingOptionsClick); + button.SubItems.Add(btn); + } + btnCellShading.SubItems.Add(button); + ((MenuPanel)((PopupItem)button.Parent).PopupControl).RecalcLayout(); + _CustomButtonAdded = true; + } + } + private void MoreShadingOptionsClick(object sender, EventArgs e) + { + ShadingOption sopt = (ShadingOption)((BaseItem)sender).Tag; + /* debug information + //string str = string.Format("Alpha {0}\n Red {1}\nBlue {2}\nGreen{3}", sopt.Alpha, sopt.Red, sopt.Blue, sopt.Green); + //MessageBox.Show(str,"more shading click"); + */ + MyFlexGrid.SetShading(MyFlexGrid.Selection, sopt); + MyEditItem.Invalidate(); + MyFlexGrid.Invalidate(); + } + #endregion } public class StepTabRibbonEventArgs : EventArgs { diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.designer.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.designer.cs index e51e7841..f9aaf819 100644 Binary files a/PROMS/Volian.Controls.Library/StepTabRibbon.designer.cs and b/PROMS/Volian.Controls.Library/StepTabRibbon.designer.cs differ