From 9ce881087abc8243b288fd42e2814a2af10b5a16 Mon Sep 17 00:00:00 2001 From: John Date: Thu, 18 Nov 2021 19:29:45 +0000 Subject: [PATCH] C2021-004 logic to show the table shading --- PROMS/Volian.Controls.Library/GridItem.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/PROMS/Volian.Controls.Library/GridItem.cs b/PROMS/Volian.Controls.Library/GridItem.cs index 287ebb5b..03127687 100644 --- a/PROMS/Volian.Controls.Library/GridItem.cs +++ b/PROMS/Volian.Controls.Library/GridItem.cs @@ -327,7 +327,7 @@ namespace Volian.Controls.Library cs.ForeColor = Color.Black; cs = MyFlexGrid.Styles["Highlight"]; cs.ForeColor = Color.Black; - cs.BackColor = MyStepPanel.InactiveColor; + cs.BackColor = MyFlexGrid.MyShading.GetColor(MyFlexGrid.Row, MyFlexGrid.Col); // C2021-004 reset the last active table cell's shading color when leaving } //void MyStepRTB_EnterKeyPressed(object sender, KeyEventArgs args) @@ -679,7 +679,7 @@ namespace Volian.Controls.Library // in the grid: MyFlexGrid.Cols.Fixed = 0; MyFlexGrid.Rows.Fixed = 0; - MyFlexGrid.StyleBackColor = Color.White; + MyFlexGrid.ShowTableCellShading(); // C2021-004 if the grid was in Fixed Mode, then also re-show the table cell shading string xml = MyFlexGrid.GetXMLData(); using (Item itm = MyItemInfo.Get()) @@ -1072,12 +1072,17 @@ namespace Volian.Controls.Library SetActive(); else // Otherwise Set the BackColor to either the InactiveColor or the AnnotationColor { - MyFlexGrid.StyleBackColor = + MyFlexGrid.StyleBackColor = MyItemInfo.ItemAnnotationCount == 0 ? MyStepPanel.InactiveColor : MyStepPanel.AnnotationColor; // Turn-off Size adjustment MyFlexGrid.Cols.Fixed = 0; MyFlexGrid.Rows.Fixed = 0; } + // C2021-004 Table Cell Shading. + // If the table has annotations, then show the yellow annoation background (table is not active control when in here) + // otherwise show the table shading assigned by the user + if (MyFlexGrid.GetMyItemInfo().ItemAnnotationCount == 0) + MyFlexGrid.ShowTableCellShading(); } } public override void SetActive()