C2026-043-Tech-Debt_v1 - Stash 1

This commit is contained in:
2026-07-21 06:49:28 -04:00
parent 0fed1acfd8
commit 9486b37300
70 changed files with 4222 additions and 10191 deletions
+63 -126
View File
@@ -1,9 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using VEPROMS.CSLA.Library;
using Volian.Base.Library;
@@ -12,22 +8,13 @@ namespace Volian.Controls.Library
{
public partial class RtfRawItem : EditItem
{
#region IEditItem
public override StepRTB MyStepRTB
{
get { return _MyStepRTB; }
}
public override int TableWidth
{
get
{
return (int)_MyStepRTB.Width + RtfRawMargin;
}
}
/// <summary>
/// The left edge of the Tab (no visible tab, but use this for EditItem interfacing
/// </summary>
public override int ItemLeft
#region IEditItem
public override StepRTB MyStepRTB => _MyStepRTB;
public override int TableWidth => (int)_MyStepRTB.Width + RtfRawMargin;
/// <summary>
/// The left edge of the Tab (no visible tab, but use this for EditItem interfacing
/// </summary>
public override int ItemLeft
{
get { return Left + lblTab.Left; }
set { Left = value - lblTab.Left; }
@@ -62,11 +49,11 @@ namespace Volian.Controls.Library
Width = value + lblTab.Left + lblTab.Width;
}
}
public override int BorderWidth { get { return (_MyStepRTB.Width - _MyStepRTB.ClientRectangle.Width); } }
/// <summary>
/// Location of the RichTextBox
/// </summary>
public override Point ContentLocation
public override int BorderWidth => (_MyStepRTB.Width - _MyStepRTB.ClientRectangle.Width);
/// <summary>
/// Location of the RichTextBox
/// </summary>
public override Point ContentLocation
{
get { return new Point(Location.X + _MyStepRTB.Left, Location.Y); }
set { Location = new Point(value.X - _MyStepRTB.Left, value.Y); }
@@ -99,21 +86,15 @@ namespace Volian.Controls.Library
_MyToolTip.SetSuperTooltip(MyStepRTB, tpi);
ToolTipOnOff(); // B2025-050 Show the tooltip based on User Options Settings
}
public override void ToolTipOnOff()
{
_MyToolTip.Enabled = VlnSettings.StepTypeToolTip; // B2025-XXX Show the tooltip based on User Options Settings
}
public override void RefreshContent()
public override void ToolTipOnOff() => _MyToolTip.Enabled = VlnSettings.StepTypeToolTip; // B2025-XXX Show the tooltip based on User Options Settings
public override void RefreshContent()
{
IdentifyMe(false);
MyStepRTB.Rtf = MyItemInfo.MyContent.Text;
RefreshDisplay(false);
}
public override void RefreshOrdinal()
{
TabFormat = null;
}
public override void HandleResize() {}
public override void RefreshOrdinal() => TabFormat = null;
public override void HandleResize() {}
public override void MatchExpanded() {}
public override void ItemSelect()
{
@@ -136,11 +117,8 @@ namespace Volian.Controls.Library
_MyStepRTB.Focus();
ScrollToCenter();
}
public override void SetActive()
{
this.BackColor = MyStepPanel.ActiveColor;
}
public override void SetText()
public override void SetActive() => this.BackColor = MyStepPanel.ActiveColor;
public override void SetText()
{
LastMethodsPush("SetText");
if (MyItemInfo != null)
@@ -150,15 +128,9 @@ namespace Volian.Controls.Library
}
LastMethodsPop();
}
public override void SetExpandAndExpander(ItemInfo itemInfo)
{
CanExpand = false;
}
public override void SaveCurrentAndContents()
{
SaveContents();
}
public override void RefreshDisplay(bool activeMode)
public override void SetExpandAndExpander(ItemInfo itemInfo) => CanExpand = false;
public override void SaveCurrentAndContents() => SaveContents();
public override void RefreshDisplay(bool activeMode)
{
MyStepRTB.VwMode = MyStepPanel.VwMode;
Size sz = GetRtfRawSize(MyStepRTB.Rtf);
@@ -177,13 +149,10 @@ namespace Volian.Controls.Library
Width = sz.Width;
Height = _MyStepRTB.Height + _MyStepRTB.Top + 7;
ItemWidth = Width;
MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetButtonAndMenuEnabling(true);
MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetButtonAndMenuEnabling();
}
public override void ToggleEditView(E_ViewMode vwMode)
{
SaveContents();
}
public override string TabFormat
public override void ToggleEditView(E_ViewMode vwMode) => SaveContents();
public override string TabFormat
{
get { return null; }
set { ;}
@@ -204,15 +173,9 @@ namespace Volian.Controls.Library
public override Point TabLocation { get { return lblTab.Location; } }
public override Font ContentFont { get { return MyStepRTB.Font; } set { /*MyStepRTB.Font = value*/; } }
public override float ContentTop { get { return MyStepRTB.Top; } }
public override DialogResult ReplaceText(string rpltxt, string fndstr, bool caseSensitive, bool matchWholeWord, bool reverse, bool prompt, IWin32Window fndrpldlg)
{
return DialogResult.OK;
}
public override bool FindText(string str, bool caseSensitive, bool matchWholeWord, bool reverse)
{
return false;
}
public override void PositionToEnd()
public override DialogResult ReplaceText(string rpltxt, string fndstr, bool caseSensitive, bool matchWholeWord, bool reverse, bool prompt, IWin32Window fndrpldlg) => DialogResult.OK;
public override bool FindText(string str, bool caseSensitive, bool matchWholeWord, bool reverse) => false;
public override void PositionToEnd()
{
return;
}
@@ -220,15 +183,9 @@ namespace Volian.Controls.Library
{
return;
}
public override string SelectedTextForFind
{
get {return null;}
}
public override bool SpellCheckNext()
{
return false;
}
public override bool Empty
public override string SelectedTextForFind => null;
public override bool SpellCheckNext() => false;
public override bool Empty
{
get
{
@@ -236,30 +193,22 @@ namespace Volian.Controls.Library
}
set { _MyStepRTB.Text = value ? "" : " "; }
}
public override void RefreshTab()
{
TabFormat = null;
}
public override void SetupHeader(ItemInfo itemInfo)
public override void RefreshTab() => TabFormat = null;
public override void SetupHeader(ItemInfo itemInfo)
{
return;
}
public override void ShowExpanded() {}
#endregion
#region Properties
private static int _RtfRawMargin = 6; // make it a little bigger than rtbitems so it can be seen
/// <summary>
/// Margin between the EditItem and the RtfRawItem. Appears on the Right.
/// Will allow space to draw a Change Bar on the right side of the EditItem.
/// </summary>
public static int RtfRawMargin
{
get { return _RtfRawMargin; }
set { _RtfRawMargin = value; }
}
#endregion
#region Constructors
public RtfRawItem()
#endregion
#region Properties
/// <summary>
/// Margin between the EditItem and the RtfRawItem. Appears on the Right.
/// Will allow space to draw a Change Bar on the right side of the EditItem.
/// </summary>
public static int RtfRawMargin { get; set; } = 6;
#endregion
#region Constructors
public RtfRawItem()
{
InitializeComponent();
}
@@ -313,14 +262,10 @@ namespace Volian.Controls.Library
Click += new EventHandler(RtfRawItem_Click);
MyStepRTB.Click += new EventHandler(RtfRawItem_Click);
}
#endregion
#region EventHandlers
void RtfRawItem_Click(object sender, EventArgs e)
{
//if (MyStepPanel.DisplayItemChanging) return;
MyStepPanel.SelectedEditItem = this;
}
private void _MyStepRTB_HeightChanged(object sender, EventArgs args)
#endregion
#region EventHandlers
void RtfRawItem_Click(object sender, EventArgs e) => MyStepPanel.SelectedEditItem = this;
private void _MyStepRTB_HeightChanged(object sender, EventArgs args)
{
if (this.Height != _MyStepRTB.Height + _MyStepRTB.Top + 7) // add in 7 to make it look good // + 10)
{
@@ -349,13 +294,10 @@ namespace Volian.Controls.Library
if (MyStepPanel.DisplayItemChanging) return;
MyStepPanel.SelectedEditItem = this;
}
#endregion
#region Methods
public override void SetFocus()
{
MyStepRTB.Focus();
}
public override void SaveContents()
#endregion
#region Methods
public override void SetFocus() => MyStepRTB.Focus();
public override void SaveContents()
{
SaveText();
SaveConfig();
@@ -379,26 +321,27 @@ namespace Volian.Controls.Library
_origBitmap = GetBitmap(res);
MyStepRTB.ClearUndo();
}
catch (Exception ex)
catch (Exception)
{
//MessageBox.Show("The data could not be saved.", "Object Save", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
}
public System.Drawing.Bitmap GetBitmap(string rtf)
{
Bitmap bmap = null;
Bitmap bmap;
try
{
System.Drawing.Size sz = RtfRawItem.GetRtfRawSize(rtf);
Volian.Controls.Library.RTF myRtb = new RTF();
myRtb.Size = sz;
myRtb.Rtf = rtf;
bmap = new System.Drawing.Bitmap((int)sz.Width, (int)sz.Height);
Volian.Controls.Library.RTF myRtb = new RTF
{
Size = sz,
Rtf = rtf
};
bmap = new System.Drawing.Bitmap((int)sz.Width, (int)sz.Height);
System.Drawing.Graphics gr = System.Drawing.Graphics.FromImage(bmap);
myRtb.RenderClipped(gr, new System.Drawing.Rectangle(0, 0, (int)sz.Width, (int)sz.Height));
}
catch (Exception ex)
catch (Exception)
{
return null;
}
@@ -478,14 +421,8 @@ namespace Volian.Controls.Library
if (MyStepPanel != null && this == MyStepPanel.SelectedEditItem)
ScrollToCenter();
}
private void MyStepRTB_CursorKeyPress(object sender, KeyEventArgs args)
{
MyStepPanel.StepCursorKeys(this, args);
}
private void MyStepRTB_CursorMovement(object sender, StepRTBCursorMovementEventArgs args)
{
MyStepPanel.CursorMovement(this, args.CursorLocation, args.Key);
}
#endregion
}
private void MyStepRTB_CursorKeyPress(object sender, KeyEventArgs args) => MyStepPanel.StepCursorKeys(this, args);
private void MyStepRTB_CursorMovement(object sender, StepRTBCursorMovementEventArgs args) => MyStepPanel.CursorMovement(this, args.CursorLocation, args.Key);
#endregion
}
}