C2026-043-Tech-Debt_v1 - Stash 1
This commit is contained in:
@@ -1,13 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
//using System.IO;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using Volian.Base.Library;
|
||||
using C1.Win.C1FlexGrid;
|
||||
@@ -24,51 +19,32 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
get
|
||||
{
|
||||
ItemInfo procInfo = MyItemInfo.MyProcedure as ItemInfo;
|
||||
if (procInfo == null)
|
||||
_MyDVI = null;
|
||||
else
|
||||
_MyDVI = procInfo.ActiveParent as DocVersionInfo;
|
||||
return _MyDVI;
|
||||
if (!(MyItemInfo.MyProcedure is ItemInfo procInfo))
|
||||
_MyDVI = null;
|
||||
else
|
||||
_MyDVI = procInfo.ActiveParent as DocVersionInfo;
|
||||
return _MyDVI;
|
||||
}
|
||||
}
|
||||
private static UserInfo _MyUserInfo = null;
|
||||
|
||||
public static UserInfo MyUserInfo
|
||||
{
|
||||
get { return _MyUserInfo; }
|
||||
set { _MyUserInfo = value; }
|
||||
}
|
||||
private bool _IsSaving;
|
||||
public bool IsSaving
|
||||
{
|
||||
get { return _IsSaving; }
|
||||
set { _IsSaving = value; }
|
||||
}
|
||||
public VlnFlexGrid MyFlexGrid
|
||||
{
|
||||
get { return _MyFlexGrid; }
|
||||
set { _MyFlexGrid = value; }
|
||||
}
|
||||
private int _GridMargin = 11;
|
||||
/// <summary>
|
||||
/// Margin between the EditItem and the VlnFlexGrid. Appears on the Right.
|
||||
/// Will allow space to draw a Change Bar on the right side of the EditItem.
|
||||
/// </summary>
|
||||
public int GridMargin
|
||||
{
|
||||
get { return _GridMargin; }
|
||||
set { _GridMargin = value; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Event Handlers
|
||||
/// <summary>
|
||||
/// Raises an ItemClick event when the user clicks on the Tab
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void lblTab_MouseDown(object sender, MouseEventArgs e)
|
||||
public static UserInfo MyUserInfo { get; set; } = null;
|
||||
public bool IsSaving { get; set; }
|
||||
public VlnFlexGrid MyFlexGrid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Margin between the EditItem and the VlnFlexGrid. Appears on the Right.
|
||||
/// Will allow space to draw a Change Bar on the right side of the EditItem.
|
||||
/// </summary>
|
||||
public int GridMargin { get; set; } = 11;
|
||||
#endregion
|
||||
|
||||
#region Event Handlers
|
||||
/// <summary>
|
||||
/// Raises an ItemClick event when the user clicks on the Tab
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void lblTab_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
MyStepPanel.OnItemClick(this, new StepPanelEventArgs(this, e));
|
||||
}
|
||||
@@ -145,7 +121,6 @@ namespace Volian.Controls.Library
|
||||
void MyStepRTB_AdjustTableWidth(object sender, StepRTBTableWidthEventArgs args)
|
||||
{
|
||||
//Console.WriteLine("MyStepRTB_AdjustTableWidth");
|
||||
//if ((!_MyItemInfo.IsSection && !_MyItemInfo.IsProcedure) && (_MyItemInfo.IsTable || _MyItemInfo.IsFigure))
|
||||
if (args.EditMode)
|
||||
{
|
||||
int colR = MyStepPanel.ToDisplay(MyStepSectionLayoutData.ColRTable, MyItemInfo.ColumnMode);
|
||||
@@ -167,28 +142,13 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
}
|
||||
}
|
||||
bool MyStepRTB_IsNotCurrentSelection(object sender, EventArgs args)
|
||||
{
|
||||
return MyStepPanel.SelectedEditItem != this;
|
||||
}
|
||||
bool MyStepRTB_IsNotCurrentSelection(object sender, EventArgs args) => MyStepPanel.SelectedEditItem != this;
|
||||
|
||||
void MyStepRTB_OpenAnnotations(object sender, EventArgs args)
|
||||
{
|
||||
OpenAnnotations();
|
||||
}
|
||||
void MyFlexGrid_OpenAnnotations(object sender, EventArgs args)
|
||||
{
|
||||
OpenAnnotations();
|
||||
}
|
||||
void MyStepRTB_DoMouseWheel(object sender, MouseEventArgs args)
|
||||
{
|
||||
DoMouseWheel(args);
|
||||
}
|
||||
void MyStepRTB_DoSaveContents(object sender, EventArgs args)
|
||||
{
|
||||
SaveCurrentAndContents();
|
||||
}
|
||||
void MyStepRTB_VisibleChanged(object sender, EventArgs e)
|
||||
void MyStepRTB_OpenAnnotations(object sender, EventArgs args) => OpenAnnotations();
|
||||
void MyFlexGrid_OpenAnnotations(object sender, EventArgs args) => OpenAnnotations();
|
||||
void MyStepRTB_DoMouseWheel(object sender, MouseEventArgs args) => DoMouseWheel(args);
|
||||
void MyStepRTB_DoSaveContents(object sender, EventArgs args) => SaveCurrentAndContents();
|
||||
void MyStepRTB_VisibleChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (MyStepRTB == null) return;
|
||||
MyStepRTB.EditMode = MyStepRTB.Visible;
|
||||
@@ -204,7 +164,6 @@ namespace Volian.Controls.Library
|
||||
void MyFlexGrid_Click(object sender, EventArgs e)
|
||||
{
|
||||
MyFlexGrid.Focus();
|
||||
//MyStepPanel.MyStepTabPanel.MyStepTabRibbon.ToggleTableDesignButtons(false);
|
||||
MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetRibbonForGrid();
|
||||
MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetTableButtonsForMergeRangeSelection();
|
||||
MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetGridContextMenu();
|
||||
@@ -235,7 +194,6 @@ namespace Volian.Controls.Library
|
||||
private string _OrigRtf; // used to store original rtf to allow for 'escape' key restore
|
||||
void MyFlexGrid_SelChange(object sender, EventArgs e)
|
||||
{
|
||||
//if (Initializing) return;
|
||||
//Volian.Base.Library.vlnStackTrace.ShowStackLocal("MyFlexGrid_SelChange {0}",MyFlexGrid.Selection);
|
||||
RTBLastFocus = false;
|
||||
MyStepRTB.Visible = false; // Hide the editor if the Selection Changes
|
||||
@@ -244,7 +202,7 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
// B2020-088: get string using method in case of merged cells
|
||||
string rtf = MyFlexGrid.GetCellRTFString(MyFlexGrid.Row, MyFlexGrid.Col);
|
||||
_OrigRtf = rtf == null ? string.Empty : rtf;
|
||||
_OrigRtf = rtf ?? string.Empty;
|
||||
}
|
||||
}
|
||||
void MyStepRTB_KeyDown(object sender, KeyEventArgs e)
|
||||
@@ -310,7 +268,6 @@ namespace Volian.Controls.Library
|
||||
this.MyStepRTB.SetMenu += new StepRTBMenuEvent(MyStepRTB_SetMenu);
|
||||
this.MyStepRTB.OpenContextMenu += new StepRTBLocationEvent(MyStepRTB_OpenContextMenu);
|
||||
this.MyFlexGrid.EnterKeyPressed += new VlnFlexGridkeyEvent(MyFlexGrid_EnterKeyPressed);
|
||||
//this.MyStepRTB.EnterKeyPressed += new StepRTBCursorKeysEvent(MyStepRTB_EnterKeyPressed);
|
||||
// This Resize event has been useful for debugging purposes numerous times
|
||||
//
|
||||
//this.MyStepRTB.Resize += new EventHandler(MyStepRTB_Resize);
|
||||
@@ -330,12 +287,6 @@ namespace Volian.Controls.Library
|
||||
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)
|
||||
//{
|
||||
// args.Handled = true;
|
||||
// MyStepPanel.MyStepTabPanel.MyStepTabRibbon.ProcessEnterKey();
|
||||
//}
|
||||
|
||||
void MyFlexGrid_EnterKeyPressed(object sender, KeyEventArgs args)
|
||||
{
|
||||
args.Handled = true;
|
||||
@@ -352,16 +303,6 @@ namespace Volian.Controls.Library
|
||||
SetMenu(args.MenuGroup);
|
||||
}
|
||||
|
||||
// This Resize event been useful for debugging purposes numerous times
|
||||
//
|
||||
//void MyStepRTB_Resize(object sender, EventArgs e)
|
||||
//{
|
||||
// if (MyStepRTB.Visible)
|
||||
// {
|
||||
// //Volian.Base.Library.vlnStackTrace.ShowStack("MyStepRTB_Resize");
|
||||
// Console.WriteLine("MyStepRTB_Resize {0}", MyStepRTB.Width);
|
||||
// }
|
||||
//}
|
||||
void MyStepRTB_RoInsert(object sender, StepRTBRoEventArgs args)
|
||||
{
|
||||
//Console.WriteLine("GridItem - Enter MyStepRTB_RoInsert");
|
||||
@@ -372,12 +313,6 @@ namespace Volian.Controls.Library
|
||||
MyFlexGrid.FixTableCellsHeightWidth();
|
||||
MyFlexGrid.AdjustGridControlSize();
|
||||
MyFlexGrid.Visible = true;
|
||||
//MyFlexGrid.MergedRanges.Clear();
|
||||
//MyFlexGrid.Clear();
|
||||
//ConvertTableToGrid(args.RawValText, args.RODbID, args.ROID);
|
||||
//MyFlexGrid.RODbId = args.RODbID;
|
||||
//MyFlexGrid.ROID = args.ROID;
|
||||
//SaveContents();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -400,18 +335,7 @@ namespace Volian.Controls.Library
|
||||
#endregion
|
||||
#region Override Method and Properties
|
||||
public override int BorderWidth { get { return (MyFlexGrid.Width - MyFlexGrid.ClientRectangle.Width); } }
|
||||
//private bool _OnlyOnce = false;
|
||||
//protected override void OnPaint(PaintEventArgs e)
|
||||
//{
|
||||
// base.OnPaint(e);
|
||||
// if (!this.Enabled && !_OnlyOnce)
|
||||
// {
|
||||
// _OnlyOnce = true;
|
||||
// _MyDisablePanel.SendToBack();
|
||||
// _MyDisablePanel.BringToFront();
|
||||
// _OnlyOnce = false;
|
||||
// }
|
||||
//}
|
||||
|
||||
protected override void OnEnabledChanged(EventArgs e)
|
||||
{
|
||||
base.OnEnabledChanged(e);
|
||||
@@ -430,7 +354,6 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
gr.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceOver;
|
||||
gr.FillRectangle(new SolidBrush(Color.FromArgb(128, Color.FromKnownColor(KnownColor.ButtonFace))), rect);
|
||||
//gr.FillEllipse(Brushes.Red, 10, 10, 10, 10);
|
||||
}
|
||||
_MyDisablePanel.Location = this.MyFlexGrid.Location;
|
||||
_MyDisablePanel.Size = this.MyFlexGrid.Size;
|
||||
@@ -446,10 +369,6 @@ namespace Volian.Controls.Library
|
||||
public override string TabFormat { get { return _TabFormat; } set { _TabFormat = value; } }
|
||||
public override void AdjustTableWidthAndLocation()
|
||||
{
|
||||
//_MyStepRTB.Font = MyStepData.Font.WindowsFont;
|
||||
//ItemWidth = (int)GetTableWidth(MyStepRTB.Font, MyItemInfo.MyContent.Text, true);
|
||||
//ItemWidth = MyFlexGrid.Width;
|
||||
//ItemLocation = new Point(50, _MyParentEditItem.Bottom);
|
||||
|
||||
// We had a table that was in a funky state. This allows it to appear in editor so
|
||||
// that is could be deleted.
|
||||
@@ -586,11 +505,11 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
}
|
||||
}
|
||||
c = c + 1;
|
||||
c++;
|
||||
if (c == w)
|
||||
{
|
||||
c = 0;
|
||||
r = r + 1;
|
||||
r++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -651,35 +570,17 @@ namespace Volian.Controls.Library
|
||||
// if no ro has been defined yet, just return null
|
||||
if (MyFlexGrid.ROID == null) return null;
|
||||
ContentRoUsage rousg = null;
|
||||
// using (Item itm = MyItemInfo.Get())
|
||||
// {
|
||||
|
||||
using (RODb rodb = RODb.GetJustRoDb(MyFlexGrid.RODbId))
|
||||
{
|
||||
string padroid = (MyFlexGrid.ROID.Length <= 12) ? MyFlexGrid.ROID + "0000" : MyFlexGrid.ROID;
|
||||
rousg = itm.MyContent.ContentRoUsages.Add(MyFlexGrid.ROID, rodb);
|
||||
}
|
||||
//itm.Save();
|
||||
// }
|
||||
|
||||
MyItemInfo.MyContent.RefreshContentRoUsages();
|
||||
return string.Format(@"#Link:ReferencedObject:{0} {1} {2}", rousg.ROUsageID, MyFlexGrid.ROID, MyFlexGrid.RODbId);
|
||||
}
|
||||
//private void ConvertTableToGrid(string valtext, int rodbid, string roid)
|
||||
//{
|
||||
// VE_Font vefont = MyItemInfo.GetItemFont();
|
||||
// MyFlexGrid.Font = vefont.WindowsFont;
|
||||
// //Initializing = true;
|
||||
// MyFlexGrid.MergedRanges.Clear();
|
||||
// MyFlexGrid.Clear();
|
||||
// MyFlexGrid.ParseTableFromText(valtext);
|
||||
// MyFlexGrid.AutoSizeCols();
|
||||
// MyFlexGrid.AutoSizeRows();
|
||||
// MyFlexGrid.MakeRTFcells();
|
||||
// MyFlexGrid.RODbId = rodbid;
|
||||
// MyFlexGrid.ROID = roid;
|
||||
// MyFlexGrid.IsRoTable = true;
|
||||
// //Initializing = false;
|
||||
// SaveContents();
|
||||
//}
|
||||
|
||||
private bool FinishSave(string searchableText)
|
||||
{
|
||||
// Just in case if the grid was in a mode to change sizes, clear out that setting
|
||||
@@ -691,13 +592,9 @@ namespace Volian.Controls.Library
|
||||
string xml = MyFlexGrid.GetXMLData();
|
||||
using (Item itm = MyItemInfo.Get())
|
||||
{
|
||||
//if (!MatchingXML(itm.MyContent.MyGrid.Data, xml))
|
||||
//{
|
||||
// CompareXML(itm.MyContent.MyGrid.Data, xml);
|
||||
itm.MyContent.MyGrid.Data = xml;
|
||||
itm.MyContent.MyGrid.DTS = DateTime.Now;
|
||||
itm.MyContent.MyGrid.UserID = Volian.Base.Library.VlnSettings.UserID;
|
||||
//}
|
||||
// if this is the initial save of an ro table, then the 'DoLinkForRoTable' will
|
||||
// create the usage for it. this code gets run on modify of the ro table and also
|
||||
// on exit of the griditem. We don't want to save the ro usage again, if it's already
|
||||
@@ -705,12 +602,9 @@ namespace Volian.Controls.Library
|
||||
if (MyFlexGrid.IsRoTable && MyFlexGrid.ROID != null && itm.MyContent.ContentRoUsageCount < 1)
|
||||
{
|
||||
searchableText = string.Format(@"\v<START]\v0 {0} \v {1}[END>\v0 ", searchableText, DoLinkForRoTable(itm));
|
||||
//if (itm.MyContent.Text != searchableText)
|
||||
//{
|
||||
itm.MyContent.Text = searchableText;
|
||||
itm.MyContent.UserID = Volian.Base.Library.VlnSettings.UserID;
|
||||
itm.MyContent.DTS = DateTime.Now;
|
||||
//}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -726,82 +620,30 @@ namespace Volian.Controls.Library
|
||||
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.ChangeBarData.ChangeIds &&
|
||||
!this.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.EditorialChange)
|
||||
{
|
||||
StepConfig sc = itm.MyConfig as StepConfig;
|
||||
if (sc == null)
|
||||
sc = new StepConfig();
|
||||
sc.Step_ChangeID = this.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.ChgId;
|
||||
if (!(itm.MyConfig is StepConfig sc))
|
||||
sc = new StepConfig();
|
||||
sc.Step_ChangeID = this.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.ChgId;
|
||||
if (itm.MyConfig == null) itm.MyContent.Config = sc.ToString();
|
||||
}
|
||||
itm.Save();
|
||||
|
||||
StepConfig myItmCfg =MyItemInfo.MyConfig as StepConfig;
|
||||
// We saved changes made to some step text. Reset the change bar override.
|
||||
// IF there is a step config remove the change bar override by setting the CBOverride value to null
|
||||
// This fixes a problem reported by Farly where if the change bar or overridden to be off, the next
|
||||
// time a change was made, the change bar remained turned off.
|
||||
if (myItmCfg != null)
|
||||
myItmCfg.Step_CBOverride = null; // clear the change bar override
|
||||
// We saved changes made to some step text. Reset the change bar override.
|
||||
// IF there is a step config remove the change bar override by setting the CBOverride value to null
|
||||
// This fixes a problem reported by Farly where if the change bar or overridden to be off, the next
|
||||
// time a change was made, the change bar remained turned off.
|
||||
if (MyItemInfo.MyConfig is StepConfig myItmCfg)
|
||||
myItmCfg.Step_CBOverride = null; // clear the change bar override
|
||||
|
||||
MyItemInfo.MyContent.MyGrid.ResetContent(itm.MyContent.MyGrid);
|
||||
MyItemInfo.MyContent.MyGrid.ResetContent(itm.MyContent.MyGrid);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
private void CompareXML(string v1, string v2)
|
||||
{
|
||||
v1 = Regex.Replace(v1, "\r\n *", "");
|
||||
v1 = Regex.Replace(v1, "version *= *\"[^\"]*\"", "");
|
||||
v2 = Regex.Replace(v2, "\r\n *", "");
|
||||
v2 = Regex.Replace(v2, "version *= *\"[^\"]*\"", "");
|
||||
int iStart = 0;
|
||||
int l1 = v1.Length;
|
||||
int l2 = v2.Length;
|
||||
int l3 = Math.Min(l1, l2);
|
||||
while (iStart < l3 && v1[iStart] == v2[iStart])
|
||||
iStart++;
|
||||
int iEnd1 = l1 - 1;
|
||||
int iEnd2 = l2 - 1;
|
||||
while (iStart < iEnd1 && iStart < iEnd2 && v1[iEnd1] == v2[iEnd2])
|
||||
{
|
||||
iEnd1--;
|
||||
iEnd2--;
|
||||
}
|
||||
if (iStart < iEnd1) Console.WriteLine("v1 = {0}", v1.Substring(iStart, iEnd1 - iStart));
|
||||
if (iStart < iEnd2) Console.WriteLine("v2 = {0}", v2.Substring(iStart, iEnd2 - iStart));
|
||||
|
||||
}
|
||||
private bool MatchingXML(string v1, string v2)
|
||||
{
|
||||
v1 = Regex.Replace(v1, "\r\n *", "");
|
||||
v1 = Regex.Replace(v1, "version *= *\"[^\"]*\"", "");
|
||||
v2 = Regex.Replace(v2, "\r\n *", "");
|
||||
v2 = Regex.Replace(v2, "version *= *\"[^\"]*\"", "");
|
||||
int l1 = v1.Length;
|
||||
int l2 = v2.Length;
|
||||
if(l1 != l2 )return false;
|
||||
//int l3 = Math.Min(l1, l2);
|
||||
//int l4 = Math.Max(l1, l2);
|
||||
for (int i = 0; i < l1; i++)
|
||||
if (v1[i] != v2[i]) return false;
|
||||
return true;
|
||||
//Console.WriteLine("{0} - {1},{2}",i, showChar(v1[i]), showChar(v2[i]));
|
||||
//if(l1 > l3)Console.WriteLine("v1 = {0}",v1.Substring(l3));
|
||||
//if(l2 > l3)Console.WriteLine("v2 = {0}",v2.Substring(l3));
|
||||
}
|
||||
//private object showChar(char c)
|
||||
//{
|
||||
// int i = (int)c;
|
||||
// if (i <= 32)
|
||||
// return string.Format("<{0}>", i);
|
||||
// else
|
||||
// return c.ToString();
|
||||
//}
|
||||
public void BasicSave()
|
||||
{
|
||||
using (Item itm = MyItemInfo.Get())
|
||||
{
|
||||
itm.MyContent.MyGrid.Data = MyFlexGrid.GetXMLData();
|
||||
itm.Save();
|
||||
//MyItemInfo.MyContent.MyGrid.ResetContent(itm.MyContent.MyGrid);
|
||||
}
|
||||
}
|
||||
public override bool CanExpand { get { return false; } set { ;} }
|
||||
@@ -821,8 +663,8 @@ namespace Volian.Controls.Library
|
||||
MyFlexGrid.Select(0, 0);
|
||||
MyFlexGrid.FirstEntry = true; // to fix a problem with initial mouse click into table
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
catch (Exception)
|
||||
{
|
||||
FlexibleMessageBox.Show("The content of this table is corrupted. You will either need to restore a previous version or delete it.", "Table Corrupted", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
}
|
||||
@@ -831,22 +673,14 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
_MyLog.WarnFormat("Attempt to give Focus to Disposed Object {0}", MyID);
|
||||
}
|
||||
//ScrollToCenter();
|
||||
}
|
||||
public override void ItemShow()
|
||||
{
|
||||
MyFlexGrid.Focus();
|
||||
//ScrollToCenter();
|
||||
}
|
||||
public StepRTB DisplayRoStepRTB;
|
||||
public override StepRTB MyStepRTB
|
||||
{
|
||||
get
|
||||
{
|
||||
return MyFlexGrid.TableCellEditor;
|
||||
}
|
||||
}
|
||||
public override DialogResult ReplaceText(string rpltxt, string fndstr, bool caseSensitive, bool matchWholeWord, bool reverse, bool prompt, IWin32Window fndrpldlg)
|
||||
public override StepRTB MyStepRTB => MyFlexGrid.TableCellEditor;
|
||||
public override DialogResult ReplaceText(string rpltxt, string fndstr, bool caseSensitive, bool matchWholeWord, bool reverse, bool prompt, IWin32Window fndrpldlg)
|
||||
{
|
||||
int r = MyFlexGrid.Row;
|
||||
int c = MyFlexGrid.Col;
|
||||
@@ -874,11 +708,11 @@ namespace Volian.Controls.Library
|
||||
if (oldRtf != MyStepRTB.Rtf) MyFlexGrid[r, c] = MyStepRTB.Rtf;
|
||||
if (dr == DialogResult.Yes || dr == DialogResult.Cancel) return dr;
|
||||
}
|
||||
c = c + 1;
|
||||
c++;
|
||||
if (c == w)
|
||||
{
|
||||
c = 0;
|
||||
r = r + 1;
|
||||
r++;
|
||||
}
|
||||
if (r < h)
|
||||
{
|
||||
@@ -908,11 +742,11 @@ namespace Volian.Controls.Library
|
||||
if (oldRtf != MyStepRTB.Rtf) MyFlexGrid[r, c] = MyStepRTB.Rtf;
|
||||
if (dr == DialogResult.Yes || dr == DialogResult.Cancel) return dr;
|
||||
}
|
||||
c = c - 1;
|
||||
c--;
|
||||
if (c < 0)
|
||||
{
|
||||
c = MyFlexGrid.Cols.Count - 1;
|
||||
r = r - 1;
|
||||
r--;
|
||||
}
|
||||
cr = MyFlexGrid.GetMergedRange(r, c);
|
||||
if (r >= 0 && cr.r1 == r && cr.c1 == c)
|
||||
@@ -946,11 +780,11 @@ namespace Volian.Controls.Library
|
||||
bool scn = MyStepRTB.FindText(str, caseSensitive, matchWholeWord, reverse);
|
||||
if (scn) return true;
|
||||
}
|
||||
c = c + 1;
|
||||
c++;
|
||||
if (c == w)
|
||||
{
|
||||
c = 0;
|
||||
r = r + 1;
|
||||
r++;
|
||||
}
|
||||
if (r < h)
|
||||
{
|
||||
@@ -972,11 +806,11 @@ namespace Volian.Controls.Library
|
||||
bool scn = MyStepRTB.FindText(str, caseSensitive, matchWholeWord, reverse);
|
||||
if (scn) return true;
|
||||
}
|
||||
c = c - 1;
|
||||
c--;
|
||||
if (c < 0)
|
||||
{
|
||||
c = MyFlexGrid.Cols.Count - 1;
|
||||
r = r - 1;
|
||||
r--;
|
||||
}
|
||||
cr = MyFlexGrid.GetMergedRange(r, c);
|
||||
if (r >= 0 && cr.r1 == r && cr.c1 == c)
|
||||
@@ -1002,11 +836,11 @@ namespace Volian.Controls.Library
|
||||
MyFlexGrid.StartEditing();
|
||||
return;
|
||||
}
|
||||
c = c - 1;
|
||||
c--;
|
||||
if (c < 0)
|
||||
{
|
||||
c = MyFlexGrid.Cols.Count - 1;
|
||||
r = r - 1;
|
||||
r--;
|
||||
}
|
||||
if (r >= 0)
|
||||
{
|
||||
@@ -1055,11 +889,11 @@ namespace Volian.Controls.Library
|
||||
if (oldRtf != MyStepRTB.Rtf) MyFlexGrid[r, c] = MyStepRTB.Rtf;
|
||||
if (!scn) return false;
|
||||
}
|
||||
c = c + 1;
|
||||
c++;
|
||||
if (c == w)
|
||||
{
|
||||
c = 0;
|
||||
r = r + 1;
|
||||
r++;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -1092,29 +926,19 @@ namespace Volian.Controls.Library
|
||||
MyFlexGrid.ShowTableCellShading();
|
||||
}
|
||||
}
|
||||
public override void SetActive()
|
||||
{
|
||||
AdjustColorsForEditMode();
|
||||
}
|
||||
private bool _Empty = false;
|
||||
public override void SetActive() => AdjustColorsForEditMode();
|
||||
private bool _Empty = false;
|
||||
public override bool Empty
|
||||
{
|
||||
get { return _Empty; }
|
||||
set { _Empty = value; }
|
||||
}
|
||||
private bool _Initializing = false;
|
||||
public bool Initializing
|
||||
{
|
||||
get { return _Initializing; }
|
||||
set { _Initializing = value; }
|
||||
}
|
||||
private bool _ActiveMode = false;
|
||||
|
||||
public bool Initializing { get; set; } = false;
|
||||
private bool _ActiveMode = false;
|
||||
public override void RefreshDisplay(bool activeMode)
|
||||
{
|
||||
_ActiveMode = activeMode;
|
||||
//XmlDocument xd = new XmlDocument();
|
||||
//xd.LoadXml(MyItemInfo.MyContent.MyGrid.Data);
|
||||
//using (StringReader sr = new StringReader())
|
||||
Initializing = true;
|
||||
MyFlexGrid.LoadGrid(MyItemInfo);
|
||||
Initializing = false;
|
||||
@@ -1148,24 +972,10 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
// if this is an RO Table, regenerate xml. This is done in the case that
|
||||
// the rotable was updated by the ro editor.
|
||||
//if (MyFlexGrid.IsRoTable) RefreshGridData();
|
||||
RefreshDisplay(false);
|
||||
IdentifyMe(false);
|
||||
}
|
||||
|
||||
//private void RefreshGridData()
|
||||
//{
|
||||
// string ROID = MyFlexGrid.ROID;
|
||||
// int rodbid = MyFlexGrid.RODbId;
|
||||
// //MyFlexGrid.Clear();
|
||||
// ROFSTLookup MyROFSTLookup = MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst.ROFSTLookup;
|
||||
// MyFlexGrid.ConvertTableROToGrid(MyROFSTLookup.GetRoValue(ROID), rodbid, ROID);
|
||||
// //ConvertTableToGrid(MyROFSTLookup.GetRoValue(ROID), rodbid, ROID);
|
||||
// //MyFlexGrid.RODbId = rodbid;
|
||||
// //MyFlexGrid.ROID = ROID;
|
||||
// //MyFlexGrid.IsRoTable = true;
|
||||
// //SaveContents();
|
||||
//}
|
||||
public override void SetExpandAndExpander(ItemInfo itemInfo) { CanExpand = false; } // can't expand a table
|
||||
public void SavePastedCellRoTran()
|
||||
{
|
||||
@@ -1176,7 +986,7 @@ namespace Volian.Controls.Library
|
||||
int h = MyFlexGrid.Rows.Count;
|
||||
int r = 0;
|
||||
int c = 0;
|
||||
String Rtf = null;
|
||||
string Rtf;
|
||||
while (r < h)
|
||||
{
|
||||
CellRange cr = MyFlexGrid.GetMergedRange(r, c);
|
||||
@@ -1199,7 +1009,7 @@ namespace Volian.Controls.Library
|
||||
string linkstr = mro.Groups[2].Value;
|
||||
string[] roparts = linkstr.Split(" ".ToCharArray());
|
||||
ContentRoUsage rousg = null;
|
||||
int oldid = -1;
|
||||
int oldid;
|
||||
using (Item itm = MyItemInfo.Get())
|
||||
{
|
||||
using (RODb rodb = RODb.GetJustRoDb(Convert.ToInt32(roparts[2])))
|
||||
@@ -1288,11 +1098,11 @@ namespace Volian.Controls.Library
|
||||
SaveContents();
|
||||
}
|
||||
}
|
||||
c = c + 1;
|
||||
c++;
|
||||
if (c == w)
|
||||
{
|
||||
c = 0;
|
||||
r = r + 1;
|
||||
r++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1304,7 +1114,6 @@ namespace Volian.Controls.Library
|
||||
CellRange cr = MyFlexGrid.GetMergedRange(MyFlexGrid.Selection.r1, MyFlexGrid.Selection.c1); // B2018-127 get merged range
|
||||
int row = MyFlexGrid.Row;
|
||||
int col = MyFlexGrid.Col;
|
||||
//SaveContents();
|
||||
DoNotRefresh = true;
|
||||
MyStepRTB.Rtf = MyStepRTB.DoNewLinkInGridCell();
|
||||
DoNotRefresh = false;
|
||||
@@ -1343,11 +1152,11 @@ namespace Volian.Controls.Library
|
||||
return;
|
||||
}
|
||||
}
|
||||
c = c + 1;
|
||||
c++;
|
||||
if (c == w)
|
||||
{
|
||||
c = 0;
|
||||
r = r + 1;
|
||||
r++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user