Fixed Invalid message for DSOPanel (MSWord)
Comment-out unused varaible Calculate Table Width and Location Fixed Arrow-Up and Arrow-Down to account for Tables Adjust Table location based upon the width of the Table
This commit is contained in:
parent
dc6721f54c
commit
e278a2ca37
@ -136,7 +136,7 @@ namespace Volian.Controls.Library
|
|||||||
//this._MyDSOFramer.Leave += new EventHandler(_MyDSOFramer_Leave);
|
//this._MyDSOFramer.Leave += new EventHandler(_MyDSOFramer_Leave);
|
||||||
//this._MyDSOFramer.OnActivationChange += new AxDSOFramer._DFramerCtlEvents_OnActivationChangeEventHandler(_MyDSOFramer_OnActivationChange);
|
//this._MyDSOFramer.OnActivationChange += new AxDSOFramer._DFramerCtlEvents_OnActivationChangeEventHandler(_MyDSOFramer_OnActivationChange);
|
||||||
this.Enter += new EventHandler(DSOTabPanel_Enter);
|
this.Enter += new EventHandler(DSOTabPanel_Enter);
|
||||||
this.Leave += new EventHandler(DSOTabPanel_Leave);
|
//this.Leave += new EventHandler(DSOTabPanel_Leave);
|
||||||
//this.GotFocus += new EventHandler(DSOTabPanel_GotFocus);
|
//this.GotFocus += new EventHandler(DSOTabPanel_GotFocus);
|
||||||
//this.LostFocus += new EventHandler(DSOTabPanel_LostFocus);
|
//this.LostFocus += new EventHandler(DSOTabPanel_LostFocus);
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
@ -236,17 +236,16 @@ namespace Volian.Controls.Library
|
|||||||
#endregion
|
#endregion
|
||||||
#region Event Handlers
|
#region Event Handlers
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// When the user leaves a Word document, place the transparent frame on top with the words "InActive" in the upper right
|
/// Display MyTransparentPanel over the DSOPanel so that the Word "Inactive" appears in the upper right hand corner.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sender"></param>
|
public void InActive()
|
||||||
/// <param name="e"></param>
|
|
||||||
void DSOTabPanel_Leave(object sender, EventArgs e)
|
|
||||||
{
|
{
|
||||||
//vlnStackTrace.ShowStack("DSOTabPanel_Leave {0} DocID {1} Index {2} {3}", _In_DSOTabPanel_Enter, this._MyDocumentInfo.DocID, _MyDisplayTabControl.MyBar.SelectedDockTab, sender.GetType().FullName);
|
|
||||||
_MyTransparentPanel.BringToFront();
|
_MyTransparentPanel.BringToFront();
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Force this item to be selected when the transparent window is clicked.
|
/// Force this item to be selected when the transparent window is clicked.
|
||||||
|
/// This will in-turn send the Transparent Panel to back and make the DSO Panel
|
||||||
|
/// editable.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sender"></param>
|
/// <param name="sender"></param>
|
||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
@ -281,7 +280,7 @@ namespace Volian.Controls.Library
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
this.Enter -= new EventHandler(DSOTabPanel_Enter);
|
this.Enter -= new EventHandler(DSOTabPanel_Enter);
|
||||||
this.Leave -= new EventHandler(DSOTabPanel_Leave);
|
// this.Leave -= new EventHandler(DSOTabPanel_Leave);
|
||||||
// SaveDirty(); // SaveDirty happens in CloseDSO(bool)
|
// SaveDirty(); // SaveDirty happens in CloseDSO(bool)
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@ -330,6 +329,7 @@ namespace Volian.Controls.Library
|
|||||||
_MyDisplayTabControl.OnItemSelectedChanged(this,new ItemSelectedChangedEventArgs(MyDisplayTabItem.MyItemInfo));
|
_MyDisplayTabControl.OnItemSelectedChanged(this,new ItemSelectedChangedEventArgs(MyDisplayTabItem.MyItemInfo));
|
||||||
_MyDSOFramer.Focus();
|
_MyDSOFramer.Focus();
|
||||||
_In_DSOTabPanel_Enter = false;
|
_In_DSOTabPanel_Enter = false;
|
||||||
|
_MyDisplayTabControl.SelectedDisplayTabItem = MyDisplayTabItem;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
@ -459,5 +459,9 @@ namespace Volian.Controls.Library
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return string.Format("DSOTabPanel Document {0}", MyDocumentInfo.DocID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -468,18 +468,41 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Private Methods
|
#region Private Methods
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// Gets and sets the SelectedDisplayTabItem (Active Tab)
|
///// Gets and sets the SelectedDisplayTabItem (Active Tab)
|
||||||
/// </summary>
|
///// </summary>
|
||||||
|
//public DisplayTabItem SelectedDisplayTabItem1
|
||||||
|
//{
|
||||||
|
// get { return (DisplayTabItem)_MyBar.SelectedDockContainerItem; }
|
||||||
|
// set
|
||||||
|
// {
|
||||||
|
// //Volian.Base.Library.vlnStackTrace.ShowStackLocal("SelectedDisplayTabItem");
|
||||||
|
// if (value != null)
|
||||||
|
// {
|
||||||
|
// value.Focus();
|
||||||
|
// value.Selected = true;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
public void SelectDisplayTabItem(DisplayTabItem myDisplayTabItem)
|
||||||
|
{
|
||||||
|
if (myDisplayTabItem != null)
|
||||||
|
{
|
||||||
|
myDisplayTabItem.Focus();
|
||||||
|
myDisplayTabItem.Selected = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private DisplayTabItem _SelectedDisplayTabItem=null;
|
||||||
public DisplayTabItem SelectedDisplayTabItem
|
public DisplayTabItem SelectedDisplayTabItem
|
||||||
{
|
{
|
||||||
get { return (DisplayTabItem)_MyBar.SelectedDockContainerItem; }
|
get { return _SelectedDisplayTabItem; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (value != null)
|
if (_SelectedDisplayTabItem != value)
|
||||||
{
|
{
|
||||||
value.Focus();
|
if (_SelectedDisplayTabItem != null && _SelectedDisplayTabItem.MyDSOTabPanel != null)
|
||||||
value.Selected = true;
|
_SelectedDisplayTabItem.MyDSOTabPanel.InActive();
|
||||||
|
_SelectedDisplayTabItem = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -553,14 +576,14 @@ namespace Volian.Controls.Library
|
|||||||
pg = _MyDisplayTabItems[key];
|
pg = _MyDisplayTabItems[key];
|
||||||
pg.Selected = true;
|
pg.Selected = true;
|
||||||
if (SelectedDisplayTabItem != pg) // If the selected page doesn't match
|
if (SelectedDisplayTabItem != pg) // If the selected page doesn't match
|
||||||
SelectedDisplayTabItem = pg; // Set the selected page
|
SelectDisplayTabItem(pg); // Set the selected page
|
||||||
}
|
}
|
||||||
else // If not already open, create a new Page
|
else // If not already open, create a new Page
|
||||||
{
|
{
|
||||||
pg = new DisplayTabItem(this.components, this, proc, key); // Open a new Procedure Tab
|
pg = new DisplayTabItem(this.components, this, proc, key); // Open a new Procedure Tab
|
||||||
_MyDisplayTabItems.Add(key, pg);
|
_MyDisplayTabItems.Add(key, pg);
|
||||||
pg.Selected = true;
|
pg.Selected = true;
|
||||||
SelectedDisplayTabItem = pg;
|
SelectDisplayTabItem(pg);
|
||||||
pg.MyStepTabPanel.MyProcedureItemInfo = proc;
|
pg.MyStepTabPanel.MyProcedureItemInfo = proc;
|
||||||
|
|
||||||
// When more than one procedure is openned, the ribbon control cuts off the bottom of the buttons.
|
// When more than one procedure is openned, the ribbon control cuts off the bottom of the buttons.
|
||||||
@ -608,7 +631,7 @@ namespace Volian.Controls.Library
|
|||||||
pg = new DisplayTabItem(this.components, this, myItemInfo, key); // Open a new document page
|
pg = new DisplayTabItem(this.components, this, myItemInfo, key); // Open a new document page
|
||||||
_MyDisplayTabItems.Add(key, pg);
|
_MyDisplayTabItems.Add(key, pg);
|
||||||
}
|
}
|
||||||
SelectedDisplayTabItem = pg;
|
SelectDisplayTabItem(pg);
|
||||||
pg.MyDSOTabPanel.EnterPanel();
|
pg.MyDSOTabPanel.EnterPanel();
|
||||||
return pg;
|
return pg;
|
||||||
}
|
}
|
||||||
@ -629,7 +652,7 @@ namespace Volian.Controls.Library
|
|||||||
pg = new DisplayTabItem(this.components, this, myDocumentInfo, key); // Open a new document page
|
pg = new DisplayTabItem(this.components, this, myDocumentInfo, key); // Open a new document page
|
||||||
_MyDisplayTabItems.Add(key, pg);
|
_MyDisplayTabItems.Add(key, pg);
|
||||||
}
|
}
|
||||||
SelectedDisplayTabItem = pg;
|
SelectDisplayTabItem(pg);
|
||||||
pg.MyDSOTabPanel.EnterPanel();
|
pg.MyDSOTabPanel.EnterPanel();
|
||||||
return pg;
|
return pg;
|
||||||
}
|
}
|
||||||
|
@ -204,7 +204,7 @@ namespace Volian.Controls.Library
|
|||||||
//
|
//
|
||||||
// tabPanel
|
// tabPanel
|
||||||
//
|
//
|
||||||
_MyDisplayTabControl.SelectedDisplayTabItem = this;
|
_MyDisplayTabControl.SelectDisplayTabItem(this);
|
||||||
_MyDSOTabPanel.MyDisplayTabItem = this;
|
_MyDSOTabPanel.MyDisplayTabItem = this;
|
||||||
DSOTabPanel.IgnoreEnter = false;
|
DSOTabPanel.IgnoreEnter = false;
|
||||||
}
|
}
|
||||||
@ -226,10 +226,18 @@ namespace Volian.Controls.Library
|
|||||||
//
|
//
|
||||||
// tabPanel
|
// tabPanel
|
||||||
//
|
//
|
||||||
_MyDisplayTabControl.SelectedDisplayTabItem = this;
|
_MyDisplayTabControl.SelectDisplayTabItem(this);
|
||||||
_MyDSOTabPanel.MyDisplayTabItem = this;
|
_MyDSOTabPanel.MyDisplayTabItem = this;
|
||||||
DSOTabPanel.IgnoreEnter = false;
|
DSOTabPanel.IgnoreEnter = false;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
if (MyDSOTabPanel != null)
|
||||||
|
return MyDSOTabPanel.ToString();
|
||||||
|
if (MyStepTabPanel != null)
|
||||||
|
return MyStepTabPanel.ToString();
|
||||||
|
return "NULL";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ namespace Volian.Controls.Library
|
|||||||
// split text into lines
|
// split text into lines
|
||||||
string[] breaks = { "\r\n" };
|
string[] breaks = { "\r\n" };
|
||||||
string[] lines = txt.Split(breaks, StringSplitOptions.None);
|
string[] lines = txt.Split(breaks, StringSplitOptions.None);
|
||||||
string lastLine = lines[lines.Length - 1];
|
//string lastLine = lines[lines.Length - 1];
|
||||||
foreach (string line in lines)
|
foreach (string line in lines)
|
||||||
Add(new RtfLine(line));
|
Add(new RtfLine(line));
|
||||||
}
|
}
|
||||||
|
@ -97,6 +97,11 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
private bool _Loading = true;
|
private bool _Loading = true;
|
||||||
private StepData _MyStepData;
|
private StepData _MyStepData;
|
||||||
|
public StepData MyStepData
|
||||||
|
{
|
||||||
|
get { return _MyStepData; }
|
||||||
|
set { _MyStepData = value; }
|
||||||
|
}
|
||||||
private ItemInfo _MyItemInfo;
|
private ItemInfo _MyItemInfo;
|
||||||
private static int _WidthAdjust = 3;
|
private static int _WidthAdjust = 3;
|
||||||
|
|
||||||
@ -224,7 +229,7 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
_MyStepRTB.Font = _MyStepData.Font.WindowsFont;
|
_MyStepRTB.Font = _MyStepData.Font.WindowsFont;
|
||||||
ItemWidth = (int)TableWidth(_MyStepRTB.Font, _MyItemInfo.MyContent.Text, true);
|
ItemWidth = (int)TableWidth(_MyStepRTB.Font, _MyItemInfo.MyContent.Text, true);
|
||||||
ItemLocation = new Point(50, _MyParentStepItem.Bottom);
|
ItemLocation = new Point(50, _MyParentStepItem.Bottom);
|
||||||
ItemLocation = TableLocation(_MyParentStepItem, _MyStepSectionLayoutData, ItemWidth);
|
ItemLocation = TableLocation(_MyParentStepItem, _MyStepSectionLayoutData, ItemWidth);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -487,12 +492,21 @@ namespace Volian.Controls.Library
|
|||||||
if (_MyPreviousStepItem != null)
|
if (_MyPreviousStepItem != null)
|
||||||
{
|
{
|
||||||
_IgnoreResize=true;
|
_IgnoreResize=true;
|
||||||
if (_MyStepData != null && (_MyStepData.Type == "Table" || _MyStepData.ParentType == "Table"))
|
if (_MyStepData != null && (_MyStepData.Type.ToLower().Contains("table") || _MyStepData.ParentType.ToLower().Contains("table")))
|
||||||
{
|
{
|
||||||
ItemWidth = (int)TableWidth(_MyStepRTB.Font, _MyItemInfo.MyContent.Text, true);
|
ItemWidth = (int)TableWidth(_MyStepRTB.Font, _MyItemInfo.MyContent.Text, true);
|
||||||
|
Location = new Point(_MyPreviousStepItem.Left, FindTop(_MyPreviousStepItem.BottomMostStepItem.Bottom));
|
||||||
|
}
|
||||||
|
else if (value.MyItemInfo.IsTablePart)
|
||||||
|
{
|
||||||
|
ItemLocation = new Point(value.MyParentStepItem.TextLeft, value.MyParentStepItem.Bottom);
|
||||||
|
ItemWidth = value.MyParentStepItem.TextWidth;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
Width = MyPreviousStepItem.Width;
|
Width = MyPreviousStepItem.Width;
|
||||||
|
Location = new Point(_MyPreviousStepItem.Left, FindTop(_MyPreviousStepItem.BottomMostStepItem.Bottom));
|
||||||
|
}
|
||||||
_IgnoreResize=false;
|
_IgnoreResize=false;
|
||||||
//ShowMe("");
|
//ShowMe("");
|
||||||
//if (MyID > _StartingID)
|
//if (MyID > _StartingID)
|
||||||
@ -503,7 +517,6 @@ namespace Volian.Controls.Library
|
|||||||
// , FindTop(_MyPreviousStepItem.BottomMostStepItem.Bottom)
|
// , FindTop(_MyPreviousStepItem.BottomMostStepItem.Bottom)
|
||||||
// , _MyPreviousStepItem.Bottom);
|
// , _MyPreviousStepItem.Bottom);
|
||||||
//Location = new Point(_MyPreviousStepItem.Left, _MyPreviousStepItem.BottomMostStepItem.Bottom);
|
//Location = new Point(_MyPreviousStepItem.Left, _MyPreviousStepItem.BottomMostStepItem.Bottom);
|
||||||
Location = new Point(_MyPreviousStepItem.Left, FindTop(_MyPreviousStepItem.BottomMostStepItem.Bottom));
|
|
||||||
switch (_MyChildRelation)
|
switch (_MyChildRelation)
|
||||||
{
|
{
|
||||||
case ChildRelation.None:
|
case ChildRelation.None:
|
||||||
@ -1615,28 +1628,11 @@ namespace Volian.Controls.Library
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void StepItem_Resize(object sender, EventArgs e)
|
private void StepItem_Resize(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
//if (_MyItemInfo != null && _MyItemInfo.MyContent.Type == 20008)
|
|
||||||
//{
|
|
||||||
// vlnStackTrace.ShowStackLocal(string.Format("{0},{1}", _MyItemInfo.ItemID, _MyStepRTB.Width), 3);
|
|
||||||
// Console.WriteLine("asd");
|
|
||||||
//}
|
|
||||||
//ShowMe("Resize");
|
//ShowMe("Resize");
|
||||||
if (MyStepRTB.Text.EndsWith("\n"))
|
if (MyStepRTB.Text.EndsWith("\n"))
|
||||||
if (!_LookForID.Contains(MyID))
|
if (!_LookForID.Contains(MyID))
|
||||||
{
|
|
||||||
//Console.WriteLine("{0} Added a CR",MyID);
|
|
||||||
_LookForID.Add(MyID);
|
_LookForID.Add(MyID);
|
||||||
}
|
|
||||||
//if ((_WatchThis > 0 && MyID > 2100) || MyID == _LookForID)
|
|
||||||
//{
|
|
||||||
// Console.WriteLine("{0}Resize {1},{2}",WatchThisIndent, MyID, this);
|
|
||||||
// if (MyID == _LookForID)
|
|
||||||
// Console.WriteLine("{0}------------------------",WatchThisIndent);
|
|
||||||
//}
|
|
||||||
if (_MyItemInfo == null) return;
|
if (_MyItemInfo == null) return;
|
||||||
//Console.WriteLine("{0} Resize - {1}, BottomMost {2}", MyID, MyPath,BottomMostStepItem.MyPath);
|
|
||||||
//if (_lookForID == MyID)
|
|
||||||
// _lookForID = MyID;
|
|
||||||
if (_IgnoreResize) return;
|
if (_IgnoreResize) return;
|
||||||
AdjustLocation();
|
AdjustLocation();
|
||||||
if (lblHeader != null) lblHeader.Width = this.Width;
|
if (lblHeader != null) lblHeader.Width = this.Width;
|
||||||
@ -1848,7 +1844,7 @@ namespace Volian.Controls.Library
|
|||||||
return childStepItems[childStepItems.Count - 1];
|
return childStepItems[childStepItems.Count - 1];
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Calculate the width of the table
|
/// Calculate TableWidth based upon the the contents
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="myFont"></param>
|
/// <param name="myFont"></param>
|
||||||
/// <param name="txt"></param>
|
/// <param name="txt"></param>
|
||||||
@ -1858,35 +1854,29 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
string[] lines = txt.Split("\n".ToCharArray());
|
string[] lines = txt.Split("\n".ToCharArray());
|
||||||
float max = 0;
|
float max = 0;
|
||||||
//string lineMax = "";
|
|
||||||
SizeF siz10 = new SizeF();
|
|
||||||
using (Graphics g = this.CreateGraphics())
|
using (Graphics g = this.CreateGraphics())
|
||||||
{
|
{
|
||||||
PointF pnt = new PointF(0, 0);
|
PointF pnt = new PointF(0, 0);
|
||||||
siz10 = g.MeasureString("MMMMMMMMMM", myFont, pnt, StringFormat.GenericTypographic);
|
foreach (string line in lines)
|
||||||
}
|
|
||||||
foreach (string line in lines)
|
|
||||||
{
|
|
||||||
//string line2 = (addBorder ? "--" : "") + Regex.Replace(line, @"\\.*? ", ""); // Remove RTF Commands - Really should not be any
|
|
||||||
string line2 = Regex.Replace(line, @"\\.*? ", ""); // Remove RTF Commands - Really should not be any
|
|
||||||
//line2 = line2.Replace(@"\u8209?", "-");
|
|
||||||
//line2 = line2.Replace("<START]", "");
|
|
||||||
//line2 = Regex.Replace(line2, @"#Link:.*?\[END>","");
|
|
||||||
line2 = StepRTB.RemoveLinkComments(line2);
|
|
||||||
// MeasureString doesn't work properly if the line include graphics characters.
|
|
||||||
//SizeF siz = g.MeasureString(line2, myFont, pnt, StringFormat.GenericTypographic);
|
|
||||||
float wid = line2.Length * siz10.Width / 10;
|
|
||||||
//Console.WriteLine("'LineWidth'\t'{0}'\t{1}\t{2:0.}\t{3:0.}\t{4:0.}",
|
|
||||||
// line2.Length, wid, max, _MyStepPanel.MyStepPanelSettings.TableWidthAdjust, line2);
|
|
||||||
if (wid + _MyStepPanel.MyStepPanelSettings.TableWidthAdjust > max)
|
|
||||||
{
|
{
|
||||||
max = wid + _MyStepPanel.MyStepPanelSettings.TableWidthAdjust;
|
string lineAdj = Regex.Replace(line, @"\\u....\?", "X"); // Replace Special characters
|
||||||
//lineMax = line2;
|
//line2 = Regex.Replace(line2, @"\\.*? ", ""); // Remove RTF Commands - Really should not be any
|
||||||
|
lineAdj = StepRTB.RemoveLinkComments(lineAdj);
|
||||||
|
// MeasureString doesn't work properly if the line include graphics characters.
|
||||||
|
// So, Measure a string of the same length with 'M's.
|
||||||
|
SizeF siz = g.MeasureString("".PadLeft(lineAdj.Length + (addBorder ? 2 : 0), 'M'), myFont, pnt, StringFormat.GenericTypographic);
|
||||||
|
float wid = siz.Width;
|
||||||
|
if (wid > max)
|
||||||
|
{
|
||||||
|
max = wid;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//vlnStackTrace.ShowStackLocal("TableWidth", 1, 10);
|
float widLimit = (float) _MyStepPanel.ToDisplay(_MyStepSectionLayoutData.WidSTableEdit, MyItemInfo.ColumnMode);
|
||||||
//Console.WriteLine("TableWidth = {0}, lineMax = '{1}', myFont = {2}", max, lineMax, myFont);
|
widLimit += (float)_MyStepPanel.ToDisplay(_MyStepSectionLayoutData.ColS);
|
||||||
return max;
|
widLimit += (float) _MyStepPanel.ToDisplay(_MyStepSectionLayoutData.ColRTable, MyItemInfo.ColumnMode);
|
||||||
|
max += _MyStepPanel.MyStepPanelSettings.TableWidthAdjust;
|
||||||
|
return Math.Min(max,widLimit);
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Calculates the table location
|
/// Calculates the table location
|
||||||
@ -1895,11 +1885,25 @@ namespace Volian.Controls.Library
|
|||||||
/// <param name="myStepSectionLayoutData"></param>
|
/// <param name="myStepSectionLayoutData"></param>
|
||||||
/// <param name="width"></param>
|
/// <param name="width"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private Point TableLocation(StepItem myParentStepItem, StepSectionLayoutData myStepSectionLayoutData, int width)
|
public Point TableLocation(StepItem myParentStepItem, StepSectionLayoutData myStepSectionLayoutData, int width)
|
||||||
{
|
{
|
||||||
int x = myParentStepItem.TextLeft;
|
// Should center on parent unless it is a centered table in the AER column
|
||||||
int y = myParentStepItem.Bottom;
|
int center = myParentStepItem.TextLeft + myParentStepItem.TextWidth / 2;
|
||||||
if (x + width > myParentStepItem.Right) x = myParentStepItem.Right - width;
|
int rightLimit = myParentStepItem.Right;
|
||||||
|
// Then should center on the wid Limit
|
||||||
|
if (MyItemInfo.FormatStepData.Type.Contains("AER") == false && MyItemInfo.RNOLevel == 0)
|
||||||
|
{
|
||||||
|
int colR = _MyStepPanel.ToDisplay(_MyStepSectionLayoutData.ColRTable, MyItemInfo.ColumnMode);
|
||||||
|
rightLimit += colR * MyItemInfo.ColumnMode;
|
||||||
|
center += (colR * MyItemInfo.ColumnMode) / 2;
|
||||||
|
center -= (myParentStepItem.TextLeft - (int)MyItemInfo.MyDocStyle.Layout.LeftMargin) / 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Calulate the x location
|
||||||
|
//int x = myParentStepItem.TextLeft;
|
||||||
|
int x = center - width / 2;
|
||||||
|
int y = FindTop(myParentStepItem.Bottom);
|
||||||
|
if (x + width > rightLimit) x = rightLimit - width;
|
||||||
int colT = _MyStepPanel.ToDisplay(myStepSectionLayoutData.ColT);
|
int colT = _MyStepPanel.ToDisplay(myStepSectionLayoutData.ColT);
|
||||||
if (x < colT) x = colT;
|
if (x < colT) x = colT;
|
||||||
return new Point(x, y);
|
return new Point(x, y);
|
||||||
@ -2194,8 +2198,8 @@ namespace Volian.Controls.Library
|
|||||||
AddChildAfter(MyItemInfo.Sections, expand);
|
AddChildAfter(MyItemInfo.Sections, expand);
|
||||||
if (MyItemInfo.RNOs != null && MyItemInfo.RNOLevel < MyItemInfo.ColumnMode)
|
if (MyItemInfo.RNOs != null && MyItemInfo.RNOLevel < MyItemInfo.ColumnMode)
|
||||||
AddChildRNO(MyItemInfo.RNOs, expand);
|
AddChildRNO(MyItemInfo.RNOs, expand);
|
||||||
AddChildAfter(MyItemInfo.Steps, expand);
|
|
||||||
AddChildAfter(MyItemInfo.Tables, expand);
|
AddChildAfter(MyItemInfo.Tables, expand);
|
||||||
|
AddChildAfter(MyItemInfo.Steps, expand);
|
||||||
if (MyItemInfo.RNOs != null && MyItemInfo.RNOLevel >= MyItemInfo.ColumnMode)
|
if (MyItemInfo.RNOs != null && MyItemInfo.RNOLevel >= MyItemInfo.ColumnMode)
|
||||||
AddChildRNO(MyItemInfo.RNOs, expand);
|
AddChildRNO(MyItemInfo.RNOs, expand);
|
||||||
if (!_MyvlnExpander.Expanded)
|
if (!_MyvlnExpander.Expanded)
|
||||||
@ -2255,10 +2259,13 @@ namespace Volian.Controls.Library
|
|||||||
// Console.WriteLine("Ooops!!!");
|
// Console.WriteLine("Ooops!!!");
|
||||||
int? bottom = null;
|
int? bottom = null;
|
||||||
StepItem stepItem = this;
|
StepItem stepItem = this;
|
||||||
if (stepItem._MyChildRelation == ChildRelation.None)
|
if (!MyItemInfo.IsTablePart)
|
||||||
return null;
|
{
|
||||||
if (stepItem._MyChildRelation == ChildRelation.After && !RNORight)
|
if (stepItem._MyChildRelation == ChildRelation.None)
|
||||||
return null;
|
return null;
|
||||||
|
if (stepItem._MyChildRelation == ChildRelation.After && !RNORight)
|
||||||
|
return null;
|
||||||
|
}
|
||||||
while (stepItem != null && stepItem._MyChildRelation != ChildRelation.None && stepItem._MyChildRelation != ChildRelation.After)
|
while (stepItem != null && stepItem._MyChildRelation != ChildRelation.None && stepItem._MyChildRelation != ChildRelation.After)
|
||||||
stepItem = stepItem.UpOneStepItem;
|
stepItem = stepItem.UpOneStepItem;
|
||||||
if (stepItem == null || stepItem._MyChildRelation == ChildRelation.None)
|
if (stepItem == null || stepItem._MyChildRelation == ChildRelation.None)
|
||||||
|
@ -690,16 +690,24 @@ namespace Volian.Controls.Library
|
|||||||
public void CursorMovement(StepRTB rtb, Point position, E_ArrowKeys arrow)
|
public void CursorMovement(StepRTB rtb, Point position, E_ArrowKeys arrow)
|
||||||
{
|
{
|
||||||
ItemInfo ii = null;
|
ItemInfo ii = null;
|
||||||
|
// The following lines are debug to check that the results of moving down and moving up are the same
|
||||||
|
//ItemInfo ix = null;
|
||||||
switch (arrow)
|
switch (arrow)
|
||||||
{
|
{
|
||||||
case E_ArrowKeys.Up:
|
case E_ArrowKeys.Up:
|
||||||
case E_ArrowKeys.CtrlUp:
|
case E_ArrowKeys.CtrlUp:
|
||||||
ii = ArrowUp(rtb.MyItemInfo);
|
ii = ArrowUp(rtb.MyItemInfo);
|
||||||
|
// The following lines are debug to check that the results of moving down and moving up are the same
|
||||||
|
//ix = ArrowDown(ii);
|
||||||
|
//Console.WriteLine("'Up',{0},{1},{2},{3}", rtb.MyItemInfo.ItemID, rtb.MyItemInfo.DBSequence, ii.DBSequence, ix.DBSequence);
|
||||||
if (ii != null) SelectedStepRTB = _LookupStepItems[ii.ItemID].MyStepRTB;
|
if (ii != null) SelectedStepRTB = _LookupStepItems[ii.ItemID].MyStepRTB;
|
||||||
break;
|
break;
|
||||||
case E_ArrowKeys.Down:
|
case E_ArrowKeys.Down:
|
||||||
case E_ArrowKeys.CtrlDown:
|
case E_ArrowKeys.CtrlDown:
|
||||||
ii = ArrowDown(rtb.MyItemInfo);
|
ii = ArrowDown(rtb.MyItemInfo);
|
||||||
|
// The following lines are debug to check that the results of moving down and moving up are the same
|
||||||
|
//ix = ArrowUp(ii);
|
||||||
|
//Console.WriteLine("'Down',{0},{1},{2},{3}", rtb.MyItemInfo.ItemID, rtb.MyItemInfo.DBSequence, ii.DBSequence, ix.DBSequence);
|
||||||
if (ii != null) SelectedStepRTB = _LookupStepItems[ii.ItemID].MyStepRTB;
|
if (ii != null) SelectedStepRTB = _LookupStepItems[ii.ItemID].MyStepRTB;
|
||||||
break;
|
break;
|
||||||
case E_ArrowKeys.Right:
|
case E_ArrowKeys.Right:
|
||||||
@ -718,6 +726,9 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
private ItemInfo ArrowUp(ItemInfo ii)
|
private ItemInfo ArrowUp(ItemInfo ii)
|
||||||
{
|
{
|
||||||
|
// Arrow-Up from a Substep should look for a Table.
|
||||||
|
if (ii.IsStepPart && (ii.ActiveParent as ItemInfo).Tables != null)
|
||||||
|
return BottomPart((ii.ActiveParent as ItemInfo).Tables[0]);
|
||||||
// if on RNO, check display mode (1 column/2 column, etc) and how deep RNO is before going to
|
// if on RNO, check display mode (1 column/2 column, etc) and how deep RNO is before going to
|
||||||
// parents substeps.
|
// parents substeps.
|
||||||
if (ii.IsRNOPart && ii.MyParent.Steps != null && ii.RNOLevel >= ii.ColumnMode) return BottomPart(ii.MyParent.Steps[0].LastSibling);
|
if (ii.IsRNOPart && ii.MyParent.Steps != null && ii.RNOLevel >= ii.ColumnMode) return BottomPart(ii.MyParent.Steps[0].LastSibling);
|
||||||
@ -756,8 +767,11 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
// Subitems - go to top part of subitem
|
// Subitems - go to top part of subitem
|
||||||
// (the lookAtSub prevented looping within a substep group at same level)
|
// (the lookAtSub prevented looping within a substep group at same level)
|
||||||
if (lookAtSub && ii.Steps != null) return TopPart(ii.Steps[0]);
|
// Arrow down from a Table should look for a Substep
|
||||||
|
if(ii.IsTablePart && (ii.ActiveParent as ItemInfo).Steps != null)
|
||||||
|
return TopPart((ii.ActiveParent as ItemInfo).Steps[0]);
|
||||||
if (lookAtSub && ii.Tables != null) return TopPart(ii.Tables[0]);
|
if (lookAtSub && ii.Tables != null) return TopPart(ii.Tables[0]);
|
||||||
|
if (lookAtSub && ii.Steps != null) return TopPart(ii.Steps[0]);
|
||||||
// RNOs: Use PMode (column)
|
// RNOs: Use PMode (column)
|
||||||
if (lookAtRNO && ii.RNOs != null && ii.RNOLevel >= ii.ColumnMode) return TopPart(ii.RNOs[0]);
|
if (lookAtRNO && ii.RNOs != null && ii.RNOLevel >= ii.ColumnMode) return TopPart(ii.RNOs[0]);
|
||||||
// Nextsibling - go to top part of sibling
|
// Nextsibling - go to top part of sibling
|
||||||
|
@ -191,8 +191,11 @@ namespace Volian.Controls.Library
|
|||||||
int widS = /* _WidthAdjust + borderWidth + */ MyStepItem.MyStepPanel.ToDisplay(MyStepItem.MyStepSectionLayoutData.WidSTableEdit, MyItemInfo.ColumnMode);
|
int widS = /* _WidthAdjust + borderWidth + */ MyStepItem.MyStepPanel.ToDisplay(MyStepItem.MyStepSectionLayoutData.WidSTableEdit, MyItemInfo.ColumnMode);
|
||||||
//int wNew = _MyStepItem.MyStepPanel.ToDisplay(_MyStepItem.MyStepSectionLayoutData.WidT);
|
//int wNew = _MyStepItem.MyStepPanel.ToDisplay(_MyStepItem.MyStepSectionLayoutData.WidT);
|
||||||
int wNew = 70 + widS + colR * MyItemInfo.ColumnMode;
|
int wNew = 70 + widS + colR * MyItemInfo.ColumnMode;
|
||||||
if(wNew > _MyStepItem.ItemWidth)
|
if (wNew > _MyStepItem.ItemWidth)
|
||||||
_MyStepItem.ItemWidth= wNew;
|
{
|
||||||
|
_MyStepItem.ItemWidth = wNew;
|
||||||
|
_MyStepItem.ItemLocation = _MyStepItem.TableLocation(_MyStepItem.MyParentStepItem, _MyStepItem.MyStepSectionLayoutData, wNew);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_InitializingRTB = true;
|
_InitializingRTB = true;
|
||||||
_SelectedRtfSB.Remove(0, _SelectedRtfSB.Length);
|
_SelectedRtfSB.Remove(0, _SelectedRtfSB.Length);
|
||||||
@ -234,14 +237,13 @@ namespace Volian.Controls.Library
|
|||||||
RemoveEventHandlers();
|
RemoveEventHandlers();
|
||||||
if ((!_MyItemInfo.IsSection && !_MyItemInfo.IsProcedure) && (_MyItemInfo.IsTable || _MyItemInfo.IsFigure))
|
if ((!_MyItemInfo.IsSection && !_MyItemInfo.IsProcedure) && (_MyItemInfo.IsTable || _MyItemInfo.IsFigure))
|
||||||
{
|
{
|
||||||
int newwidth = (int)_MyStepItem.TableWidth(Font, Text, true);
|
int newwidth = (int)_MyStepItem.TableWidth(Font, Text, false);
|
||||||
if (_MyStepItem.ItemWidth != newwidth)
|
if (_MyStepItem.ItemWidth != newwidth)
|
||||||
{
|
{
|
||||||
_MyStepItem.ItemWidth = newwidth;
|
_MyStepItem.ItemWidth = newwidth;
|
||||||
|
_MyStepItem.ItemLocation = _MyStepItem.TableLocation(_MyStepItem.MyParentStepItem, _MyStepItem.MyStepSectionLayoutData, newwidth);
|
||||||
|
|
||||||
}
|
}
|
||||||
// int typ = ((int)_MyItemInfo.MyContent.Type) % 10000;
|
|
||||||
// OutlineTable(_MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[typ].Type.IndexOf(@"Borderless")<0);
|
|
||||||
// FindAllLinks();
|
|
||||||
}
|
}
|
||||||
SelectAll();
|
SelectAll();
|
||||||
if (SelectionHangingIndent !=0) SelectionHangingIndent = 0;
|
if (SelectionHangingIndent !=0) SelectionHangingIndent = 0;
|
||||||
@ -268,7 +270,7 @@ namespace Volian.Controls.Library
|
|||||||
_InitializingRTB = false;
|
_InitializingRTB = false;
|
||||||
_MyItemInfo.MyConfig.PropertyChanged += new PropertyChangedEventHandler(MyConfig_PropertyChanged);
|
_MyItemInfo.MyConfig.PropertyChanged += new PropertyChangedEventHandler(MyConfig_PropertyChanged);
|
||||||
AdjustSizeForContents(!edit); // TODO: this is not quite right yet.
|
AdjustSizeForContents(!edit); // TODO: this is not quite right yet.
|
||||||
if (MyStepItem != null) MyStepItem.ChangeBar = MyStepItem.MyItemInfo.HasChangeBar();
|
if (MyStepItem != null) MyStepItem.ChangeBar = MyStepItem.MyItemInfo.HasChangeBar();
|
||||||
}
|
}
|
||||||
private bool _ProcessKeystrokes = true;
|
private bool _ProcessKeystrokes = true;
|
||||||
public bool ProcessKeystrokes
|
public bool ProcessKeystrokes
|
||||||
@ -380,9 +382,12 @@ namespace Volian.Controls.Library
|
|||||||
this.MouseDown -= new MouseEventHandler(StepRTB_MouseDown);
|
this.MouseDown -= new MouseEventHandler(StepRTB_MouseDown);
|
||||||
this.MouseLeave -= new EventHandler(StepRTB_MouseLeave);
|
this.MouseLeave -= new EventHandler(StepRTB_MouseLeave);
|
||||||
this.SelectionChanged -= new EventHandler(StepRTB_SelectionChanged);
|
this.SelectionChanged -= new EventHandler(StepRTB_SelectionChanged);
|
||||||
|
this.ContextMenuStripChanged -= new EventHandler(StepRTB_ContextMenuStripChanged);
|
||||||
|
this.RTBSelectionChanged -= new StepRTBEvent(StepRTB_RTBSelectionChanged);
|
||||||
}
|
}
|
||||||
private void AddEventHandlers()
|
private void AddEventHandlers()
|
||||||
{
|
{
|
||||||
|
// Always be sure to add the same event handlers to RemoveEventHandlers
|
||||||
BorderStyle = System.Windows.Forms.BorderStyle.None;
|
BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||||
this.DetectUrls = true;
|
this.DetectUrls = true;
|
||||||
ContentsResized += new ContentsResizedEventHandler(StepRTB_ContentsResized);
|
ContentsResized += new ContentsResizedEventHandler(StepRTB_ContentsResized);
|
||||||
@ -398,13 +403,11 @@ namespace Volian.Controls.Library
|
|||||||
this.ContextMenuStripChanged += new EventHandler(StepRTB_ContextMenuStripChanged);
|
this.ContextMenuStripChanged += new EventHandler(StepRTB_ContextMenuStripChanged);
|
||||||
this.RTBSelectionChanged += new StepRTBEvent(StepRTB_RTBSelectionChanged);
|
this.RTBSelectionChanged += new StepRTBEvent(StepRTB_RTBSelectionChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
void StepRTB_RTBSelectionChanged(object sender, EventArgs args)
|
void StepRTB_RTBSelectionChanged(object sender, EventArgs args)
|
||||||
{
|
{
|
||||||
//Console.WriteLine("RTBSelectionChanged id= {0}", MyItemInfo.ItemID);
|
//Console.WriteLine("RTBSelectionChanged id= {0}", MyItemInfo.ItemID);
|
||||||
if (!Focused) Focus();
|
if (!Focused) Focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
void StepRTB_ContextMenuStripChanged(object sender, EventArgs e)
|
void StepRTB_ContextMenuStripChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
//Console.WriteLine("********** StepRTB_ContextMenuStripChanged");
|
//Console.WriteLine("********** StepRTB_ContextMenuStripChanged");
|
||||||
|
@ -167,6 +167,7 @@ namespace Volian.Controls.Library
|
|||||||
_MyStepPanel.ItemShow();
|
_MyStepPanel.ItemShow();
|
||||||
_MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetUpdRoValBtn(_MyStepPanel.MyStepTabPanel.MyStepTabRibbon.NewerRoFst());
|
_MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetUpdRoValBtn(_MyStepPanel.MyStepTabPanel.MyStepTabRibbon.NewerRoFst());
|
||||||
_ShowingItem = false;
|
_ShowingItem = false;
|
||||||
|
_MyDisplayTabControl.SelectedDisplayTabItem = MyDisplayTabItem;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Occurs when the cursor moves onto or off of a link
|
/// Occurs when the cursor moves onto or off of a link
|
||||||
@ -284,6 +285,11 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
_MyDisplayTabControl.OnItemPaste(sender, args);
|
_MyDisplayTabControl.OnItemPaste(sender, args);
|
||||||
}
|
}
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return string.Format("StepTabPanel Procedure Item {0} {1}",
|
||||||
|
MyDisplayTabItem.MyItemInfo.ItemID, MyDisplayTabItem.MyItemInfo.DisplayNumber);
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user