From cfb58493fa3621570aee16808fbc9989ac7b069c Mon Sep 17 00:00:00 2001 From: John Date: Mon, 11 Jan 2010 14:05:31 +0000 Subject: [PATCH] fixed the problem where the last item in the step list was not scrolling all the way into view logic to change background color if the item contains an annotation --- .../DisplayTransition.Designer.cs | 58 +++++++++++++++++++ .../DisplayTransition.cs | 3 + PROMS/Volian.Controls.Library/StepItem.cs | 5 +- PROMS/Volian.Controls.Library/StepPanel.cs | 3 +- PROMS/Volian.Controls.Library/StepRTB.cs | 7 ++- 5 files changed, 72 insertions(+), 4 deletions(-) diff --git a/PROMS/Volian.Controls.Library/DisplayTransition.Designer.cs b/PROMS/Volian.Controls.Library/DisplayTransition.Designer.cs index 77b42f9f..fb9386cb 100644 --- a/PROMS/Volian.Controls.Library/DisplayTransition.Designer.cs +++ b/PROMS/Volian.Controls.Library/DisplayTransition.Designer.cs @@ -82,11 +82,20 @@ namespace Volian.Controls.Library this.groupPanelBtns.Style.BorderRightWidth = 1; this.groupPanelBtns.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; this.groupPanelBtns.Style.BorderTopWidth = 1; + this.groupPanelBtns.Style.Class = ""; this.groupPanelBtns.Style.CornerDiameter = 4; this.groupPanelBtns.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; this.groupPanelBtns.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; this.groupPanelBtns.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; this.groupPanelBtns.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; + // + // + // + this.groupPanelBtns.StyleMouseDown.Class = ""; + // + // + // + this.groupPanelBtns.StyleMouseOver.Class = ""; this.groupPanelBtns.TabIndex = 25; // // btnTranCancel @@ -146,11 +155,20 @@ namespace Volian.Controls.Library this.groupPanelTranFmt.Style.BorderRightWidth = 1; this.groupPanelTranFmt.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; this.groupPanelTranFmt.Style.BorderTopWidth = 1; + this.groupPanelTranFmt.Style.Class = ""; this.groupPanelTranFmt.Style.CornerDiameter = 4; this.groupPanelTranFmt.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; this.groupPanelTranFmt.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; this.groupPanelTranFmt.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; this.groupPanelTranFmt.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; + // + // + // + this.groupPanelTranFmt.StyleMouseDown.Class = ""; + // + // + // + this.groupPanelTranFmt.StyleMouseOver.Class = ""; this.groupPanelTranFmt.TabIndex = 27; this.groupPanelTranFmt.Text = "Select Format"; // @@ -193,11 +211,20 @@ namespace Volian.Controls.Library this.groupPanelTransitionSets.Style.BorderRightWidth = 1; this.groupPanelTransitionSets.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; this.groupPanelTransitionSets.Style.BorderTopWidth = 1; + this.groupPanelTransitionSets.Style.Class = ""; this.groupPanelTransitionSets.Style.CornerDiameter = 4; this.groupPanelTransitionSets.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; this.groupPanelTransitionSets.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; this.groupPanelTransitionSets.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; this.groupPanelTransitionSets.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; + // + // + // + this.groupPanelTransitionSets.StyleMouseDown.Class = ""; + // + // + // + this.groupPanelTransitionSets.StyleMouseOver.Class = ""; this.groupPanelTransitionSets.TabIndex = 31; this.groupPanelTransitionSets.Text = "Select Procedure Set"; // @@ -238,11 +265,20 @@ namespace Volian.Controls.Library this.groupPanelTransitionProcs.Style.BorderRightWidth = 1; this.groupPanelTransitionProcs.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; this.groupPanelTransitionProcs.Style.BorderTopWidth = 1; + this.groupPanelTransitionProcs.Style.Class = ""; this.groupPanelTransitionProcs.Style.CornerDiameter = 4; this.groupPanelTransitionProcs.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; this.groupPanelTransitionProcs.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; this.groupPanelTransitionProcs.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; this.groupPanelTransitionProcs.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; + // + // + // + this.groupPanelTransitionProcs.StyleMouseDown.Class = ""; + // + // + // + this.groupPanelTransitionProcs.StyleMouseOver.Class = ""; this.groupPanelTransitionProcs.TabIndex = 32; this.groupPanelTransitionProcs.Text = "Select Procedure"; // @@ -283,11 +319,20 @@ namespace Volian.Controls.Library this.groupPanelTransitionSect.Style.BorderRightWidth = 1; this.groupPanelTransitionSect.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; this.groupPanelTransitionSect.Style.BorderTopWidth = 1; + this.groupPanelTransitionSect.Style.Class = ""; this.groupPanelTransitionSect.Style.CornerDiameter = 4; this.groupPanelTransitionSect.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; this.groupPanelTransitionSect.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; this.groupPanelTransitionSect.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; this.groupPanelTransitionSect.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; + // + // + // + this.groupPanelTransitionSect.StyleMouseDown.Class = ""; + // + // + // + this.groupPanelTransitionSect.StyleMouseOver.Class = ""; this.groupPanelTransitionSect.TabIndex = 33; this.groupPanelTransitionSect.Text = "Select Section"; // @@ -330,11 +375,20 @@ namespace Volian.Controls.Library this.groupPanelTranstionSteps.Style.BorderRightWidth = 1; this.groupPanelTranstionSteps.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; this.groupPanelTranstionSteps.Style.BorderTopWidth = 1; + this.groupPanelTranstionSteps.Style.Class = ""; this.groupPanelTranstionSteps.Style.CornerDiameter = 4; this.groupPanelTranstionSteps.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; this.groupPanelTranstionSteps.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; this.groupPanelTranstionSteps.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; this.groupPanelTranstionSteps.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; + // + // + // + this.groupPanelTranstionSteps.StyleMouseDown.Class = ""; + // + // + // + this.groupPanelTranstionSteps.StyleMouseOver.Class = ""; this.groupPanelTranstionSteps.TabIndex = 34; this.groupPanelTranstionSteps.Text = "Select Step"; // @@ -364,6 +418,10 @@ namespace Volian.Controls.Library // // lblxTranRangeTip // + // + // + // + this.lblxTranRangeTip.BackgroundStyle.Class = ""; this.lblxTranRangeTip.Dock = System.Windows.Forms.DockStyle.Right; this.lblxTranRangeTip.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblxTranRangeTip.Location = new System.Drawing.Point(355, 0); diff --git a/PROMS/Volian.Controls.Library/DisplayTransition.cs b/PROMS/Volian.Controls.Library/DisplayTransition.cs index 1be633d3..2b675378 100644 --- a/PROMS/Volian.Controls.Library/DisplayTransition.cs +++ b/PROMS/Volian.Controls.Library/DisplayTransition.cs @@ -423,6 +423,9 @@ namespace Volian.Controls.Library startitm = (startitm.NextItemCount > 0 ? startitm.NextItems[0] : null); } tvTran.BeforeExpand += new TreeViewCancelEventHandler(tvTran_BeforeExpand); + // bug fix. TreeView needs the next two lines to properly display the bottom node. jsj 01/08/2010 + tvTran.ItemHeight++; + tvTran.ItemHeight--; } private void cbTranSectsFillIn(ItemInfo secitm, int secstart) { diff --git a/PROMS/Volian.Controls.Library/StepItem.cs b/PROMS/Volian.Controls.Library/StepItem.cs index 8205c2d3..28be2243 100644 --- a/PROMS/Volian.Controls.Library/StepItem.cs +++ b/PROMS/Volian.Controls.Library/StepItem.cs @@ -745,7 +745,7 @@ namespace Volian.Controls.Library _MyStepRTB.MyStepItem = this; //// TIMING: DisplayItem.TimeIt("CSLARTB InitComp"); BackColor = myStepPanel.PanelColor; - _MyStepRTB.BackColor = myStepPanel.InactiveColor; + //_MyStepRTB.BackColor = myStepPanel.InactiveColor; // TODO: Adjust top based upon format // TODO: Remove Label and just output ident on the paint event lblTab.Left = 20; @@ -1335,7 +1335,8 @@ namespace Volian.Controls.Library /// void StepItem_BackColorChanged(object sender, EventArgs e) { - _MyStepRTB.BackColor = BackColor; + //_MyStepRTB.BackColor = BackColor; + _MyStepRTB.SetBackColor(); } /// /// When the RichTextBox height changes, change the height of the control to match diff --git a/PROMS/Volian.Controls.Library/StepPanel.cs b/PROMS/Volian.Controls.Library/StepPanel.cs index f2859df2..22b1d5f9 100644 --- a/PROMS/Volian.Controls.Library/StepPanel.cs +++ b/PROMS/Volian.Controls.Library/StepPanel.cs @@ -334,7 +334,8 @@ namespace Volian.Controls.Library if (_SelectedStepRTB == value) return; // Same - No Change if (_SelectedStepRTB != null) { - _SelectedStepRTB.BackColor = InactiveColor; + //_SelectedStepRTB.BackColor = InactiveColor; + _SelectedStepRTB.SetBackColor(); _SelectedStepRTB.SaveText(); // Save any changes to the text _SelectedStepRTB.SaveConfig(); // This may be redundant _SelectedStepRTB.RTBFillIn(false); diff --git a/PROMS/Volian.Controls.Library/StepRTB.cs b/PROMS/Volian.Controls.Library/StepRTB.cs index 054a1450..7fe646ad 100644 --- a/PROMS/Volian.Controls.Library/StepRTB.cs +++ b/PROMS/Volian.Controls.Library/StepRTB.cs @@ -163,10 +163,15 @@ namespace Volian.Controls.Library if (value != null) { RTBFillIn(!ViewRTB); + SetBackColor(); //ViewRTB = MyStepItem.MyStepPanel.PanelViewEditMode == E_ViewMode.View; } } } + public void SetBackColor() + { + BackColor = _MyItemInfo.ItemAnnotationCount == 0 ? MyStepItem.MyStepPanel.InactiveColor : Color.FromArgb(255, 255, 128); + } private string _origRTF; public void RTBFillIn(bool edit) { @@ -1801,7 +1806,7 @@ namespace Volian.Controls.Library private RichTextBoxFinds _FindOptions = RichTextBoxFinds.None; public void FindText(string str, bool caseSensitive, bool matchWholeWord, bool reverse) { - RTF savRTF = new RTF(); + StepRTB savRTF = new RTF(); int startpos = SelectionStart + SelectionLength; savRTF.Text = this.Text;