Correct cursor position after RO Insert
Correct dispose logic for transition destination ITEMs Correct cursor position after Transition Insert Correct logic to parse Transition Link Token Correct Save Config to dispose of ITEM Removed debug vlnStackTrace
This commit is contained in:
parent
fb3ed8d053
commit
dc7eb108cb
@ -17,6 +17,7 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
public partial class DisplayRO : UserControl
|
public partial class DisplayRO : UserControl
|
||||||
{
|
{
|
||||||
|
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
#region Properties
|
#region Properties
|
||||||
private DisplayTabControl _TabControl;
|
private DisplayTabControl _TabControl;
|
||||||
|
|
||||||
@ -494,15 +495,16 @@ namespace Volian.Controls.Library
|
|||||||
string linktxt = string.Format(@"#Link:ReferencedObject:<NewID> {0} {1}", padroid, _MyROFST.MyRODb.RODbID);
|
string linktxt = string.Format(@"#Link:ReferencedObject:<NewID> {0} {1}", padroid, _MyROFST.MyRODb.RODbID);
|
||||||
// Resolve symbols and scientific notation in the RO return value
|
// Resolve symbols and scientific notation in the RO return value
|
||||||
string valtxt = ConvertSymbolsAndStuff(selectedChld.value);
|
string valtxt = ConvertSymbolsAndStuff(selectedChld.value);
|
||||||
_MyRTB.InsertRO(valtxt, linktxt);
|
int ss = _MyRTB.SelectionStart; // Remember where the link is being added
|
||||||
//_MyRTB.Select(_MyRTB.SelectionStart + valtxt.Length + linktxt.Length, 0);
|
_MyRTB.InsertRO(valtxt, linktxt); // Insert the LINK
|
||||||
int ss = _MyRTB.SelectionStart;
|
_MyRTB.SaveText(); // Save the text with the LINK - This also moves the cursor to the end of the text
|
||||||
_MyRTB.SaveText();
|
// By selecting a starting position within a link, StepRTB (HandleSelectionChange) will select the link
|
||||||
//_MyRTB.Select(_MyRTB.SelectionStart + valtxt.Length + linktxt.Length, 0);
|
_MyRTB.Select(ss + 7 + valtxt.Length , 0);// Select the link, Try 7 for "<Start]" plus the length of the value
|
||||||
//_MyRTB.Select(_MyRTB.SelectionStart + valtxt.Length, 0);
|
//Console.WriteLine("'{0}'",_MyRTB.Text.Substring(_MyRTB.SelectionStart,_MyRTB.SelectionLength));
|
||||||
//_MyRTB.Select(_MyRTB.SelectionStart + 1, 0);
|
string linkText = _MyRTB.Text.Substring(_MyRTB.SelectionStart, _MyRTB.SelectionLength);
|
||||||
_MyRTB.Select(ss + valtxt.Length + linktxt.Length+1, 0);
|
if (_MyLog.IsInfoEnabled && (linkText.Contains("NewID") || linkText.Contains("CROUSGID")))
|
||||||
//_MyRTB.Select(ss, 0);
|
_MyLog.InfoFormat("ItemID {0}, LinkText '{1}'", _MyRTB.MyItemInfo.ItemID, linkText);
|
||||||
|
_MyRTB.Select(_MyRTB.SelectionStart + _MyRTB.SelectionLength, 0);// Move cursor to end of LINK
|
||||||
_MyRTB.Focus();
|
_MyRTB.Focus();
|
||||||
}
|
}
|
||||||
_MyRTB.inRoAdd = false;
|
_MyRTB.inRoAdd = false;
|
||||||
|
@ -294,8 +294,7 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
// If the previous character is a comma or a space then don't add a Hard Space
|
// If the previous character is a comma or a space then don't add a Hard Space
|
||||||
if (ind > 1 && (str[ind - 2] == ',' || str[ind - 2] == ' ')) return str;
|
if (ind > 1 && (str[ind - 2] == ',' || str[ind - 2] == ' ')) return str;
|
||||||
if (ind == -1)
|
if (ind <= 0) return str;
|
||||||
return str;
|
|
||||||
return str.Substring(0,ind - 1) + @"\u160?" + str.Substring(ind);
|
return str.Substring(0,ind - 1) + @"\u160?" + str.Substring(ind);
|
||||||
}
|
}
|
||||||
private bool StepTransition(int TransId)
|
private bool StepTransition(int TransId)
|
||||||
@ -561,18 +560,31 @@ namespace Volian.Controls.Library
|
|||||||
string[] tparts = linkstr.Split(" ".ToCharArray());
|
string[] tparts = linkstr.Split(" ".ToCharArray());
|
||||||
int type = System.Convert.ToInt32(tparts[0]);
|
int type = System.Convert.ToInt32(tparts[0]);
|
||||||
int tr1 = System.Convert.ToInt32(tparts[2]); // tparts[1] is token for tranid
|
int tr1 = System.Convert.ToInt32(tparts[2]); // tparts[1] is token for tranid
|
||||||
Item itm1 = Item.Get(tr1);
|
bool dispose1 = false;
|
||||||
|
Item itm1 = null;
|
||||||
|
bool dispose2 = false;
|
||||||
Item itm2 = null;
|
Item itm2 = null;
|
||||||
|
if (itm.ItemID != tr1)
|
||||||
|
{
|
||||||
|
dispose1 = true;
|
||||||
|
itm1 = Item.Get(tr1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
itm1 = itm; // a transition that points to itself should not dispose
|
||||||
if (dte.Type == E_TextElementType.TransitionRange)
|
if (dte.Type == E_TextElementType.TransitionRange)
|
||||||
{
|
{
|
||||||
|
dispose2 = true;
|
||||||
itm2 = Item.Get(System.Convert.ToInt32(tparts[3]));
|
itm2 = Item.Get(System.Convert.ToInt32(tparts[3]));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
itm2 = itm1;
|
itm2 = itm1;
|
||||||
ContentTransition ct = itm.MyContent.ContentTransitions.Add(itm1, itm2);
|
ContentTransition ct = itm.MyContent.ContentTransitions.Add(itm1, itm2);
|
||||||
|
//Console.WriteLine("CT {0},{1},{2},{3}", ct.TransitionID, itm.ItemID, itm.MyContent.MyContentUnique, itm.MyContent.ContentTransitions.Count);
|
||||||
ct.TranType = type;
|
ct.TranType = type;
|
||||||
l_dte.Link = l_dte.Link.Replace("<NewID>", string.Format("<CTID={0}>", ct.TransitionID));
|
l_dte.Link = l_dte.Link.Replace("<NewID>", string.Format("<CTID={0}>", ct.TransitionID));
|
||||||
l_dte.TextAndLink = l_dte.TextAndLink.Replace("<NewID>", string.Format("<CTID={0}>", ct.TransitionID));
|
l_dte.TextAndLink = l_dte.TextAndLink.Replace("<NewID>", string.Format("<CTID={0}>", ct.TransitionID));
|
||||||
|
if (dispose2) itm2.Dispose();
|
||||||
|
if (dispose1) itm1.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -597,32 +609,33 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
private void RtfToDisplayTextElements(string text)
|
private void RtfToDisplayTextElements(string text)
|
||||||
{
|
{
|
||||||
// get original text into displaytext elements for comparison for links:
|
// get original text into displaytext elements for comparison for links:
|
||||||
if (DisplayTextElementList == null)
|
if (DisplayTextElementList == null)
|
||||||
DisplayTextElementList = new List<displayTextElement>();
|
DisplayTextElementList = new List<displayTextElement>();
|
||||||
else
|
else
|
||||||
DisplayTextElementList.Clear();
|
DisplayTextElementList.Clear();
|
||||||
|
|
||||||
if (text == null || text == "") return;
|
if (text == null || text == "") return;
|
||||||
|
|
||||||
string noExtraRtfStr = text;
|
string noExtraRtfStr = text;
|
||||||
int startIndex = 0;
|
|
||||||
int index = -1;
|
int startIndex = 0;
|
||||||
|
int index = -1;
|
||||||
noExtraRtfStr = noExtraRtfStr.Replace(@"><", @">\v0 \v <");
|
noExtraRtfStr = noExtraRtfStr.Replace(@"><", @">\v0 \v <");
|
||||||
while ((index = FindTokenChar(noExtraRtfStr, startIndex)) > -1)
|
while ((index = FindTokenChar(noExtraRtfStr, startIndex)) > -1)
|
||||||
{
|
{
|
||||||
// Do any 'plain' text that preceeds the token.
|
// Do any 'plain' text that preceeds the token.
|
||||||
if (index > startIndex) DoTextElement(noExtraRtfStr, startIndex, index);
|
if (index > startIndex) DoTextElement(noExtraRtfStr, startIndex, index);
|
||||||
|
|
||||||
if (noExtraRtfStr[index + 1] == 'v')
|
if (noExtraRtfStr[index + 1] == 'v')
|
||||||
index = DoLink(noExtraRtfStr, index);
|
index = DoLink(noExtraRtfStr, index);
|
||||||
else
|
else
|
||||||
index = DoSymbol(noExtraRtfStr, startIndex, index);
|
index = DoSymbol(noExtraRtfStr, startIndex, index);
|
||||||
startIndex = index; // +1;
|
startIndex = index; // +1;
|
||||||
if (startIndex >= noExtraRtfStr.Length) break;
|
if (startIndex >= noExtraRtfStr.Length) break;
|
||||||
}
|
}
|
||||||
// Add any remaining text.
|
// Add any remaining text.
|
||||||
if (startIndex < noExtraRtfStr.Length) DoTextElement(noExtraRtfStr, startIndex, index);
|
if (startIndex < noExtraRtfStr.Length) DoTextElement(noExtraRtfStr, startIndex, index);
|
||||||
}
|
}
|
||||||
private string RtfToDbText(string text)
|
private string RtfToDbText(string text)
|
||||||
{
|
{
|
||||||
@ -1076,6 +1089,7 @@ namespace Volian.Controls.Library
|
|||||||
if (m.Success) return m.Groups[1].ToString()[0];
|
if (m.Success) return m.Groups[1].ToString()[0];
|
||||||
return '\0';
|
return '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
private int DoLinkElements(string text, int index, displayLinkElement vte)
|
private int DoLinkElements(string text, int index, displayLinkElement vte)
|
||||||
{
|
{
|
||||||
// Find the 'end comment' for this <START], can't count characters
|
// Find the 'end comment' for this <START], can't count characters
|
||||||
@ -1092,7 +1106,7 @@ namespace Volian.Controls.Library
|
|||||||
// Now get the link part. It can be terminated by a '\v0' or an [END>
|
// Now get the link part. It can be terminated by a '\v0' or an [END>
|
||||||
int endLinkIndxV = text.IndexOf(@"\v0 ", linkIndx);
|
int endLinkIndxV = text.IndexOf(@"\v0 ", linkIndx);
|
||||||
if (endLinkIndxV == -1) endLinkIndxV = text.IndexOf(@"\v0", linkIndx); // at end of string
|
if (endLinkIndxV == -1) endLinkIndxV = text.IndexOf(@"\v0", linkIndx); // at end of string
|
||||||
int endLinkIndxE = text.IndexOf(@"[END>", linkIndx);
|
int endLinkIndxE = text.IndexOf(@"[END>", linkIndx);
|
||||||
int endLinkIndx = (endLinkIndxV < endLinkIndxE) ? endLinkIndxV : endLinkIndxE;
|
int endLinkIndx = (endLinkIndxV < endLinkIndxE) ? endLinkIndxV : endLinkIndxE;
|
||||||
vte.Link = text.Substring(linkIndx + 6, endLinkIndx - linkIndx - 6); // 6 for #Link:
|
vte.Link = text.Substring(linkIndx + 6, endLinkIndx - linkIndx - 6); // 6 for #Link:
|
||||||
|
|
||||||
@ -1111,7 +1125,7 @@ namespace Volian.Controls.Library
|
|||||||
// Now get the entire text & link. Account for various ending possibilities:
|
// Now get the entire text & link. Account for various ending possibilities:
|
||||||
// ends with '\v0\'; ends with '\v0 '; ends with '\v0' (end of string);
|
// ends with '\v0\'; ends with '\v0 '; ends with '\v0' (end of string);
|
||||||
// ends with '[END>' if two in a row - will have <START]
|
// ends with '[END>' if two in a row - will have <START]
|
||||||
int endToken = (endLinkIndx == endLinkIndxE) ? endLinkIndx + 3 : text.IndexOf(@"[END>", endLinkIndx + 3); // get past end of link
|
int endToken = (endLinkIndx == endLinkIndxE)?endLinkIndx+3:text.IndexOf(@"[END>", endLinkIndx + 3); // get past end of link
|
||||||
int endComment = text.IndexOf(@"\v0", endToken);
|
int endComment = text.IndexOf(@"\v0", endToken);
|
||||||
|
|
||||||
int rettoken = 0;
|
int rettoken = 0;
|
||||||
@ -1131,7 +1145,6 @@ namespace Volian.Controls.Library
|
|||||||
DisplayTextElementList.Add(vte);
|
DisplayTextElementList.Add(vte);
|
||||||
return rettoken;
|
return rettoken;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int DoSymbol(string text, int startIndex, int index)
|
private int DoSymbol(string text, int startIndex, int index)
|
||||||
{
|
{
|
||||||
displayTextElement vte = new displayTextElement();
|
displayTextElement vte = new displayTextElement();
|
||||||
|
@ -14,6 +14,7 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
public partial class DisplayTransition : UserControl
|
public partial class DisplayTransition : UserControl
|
||||||
{
|
{
|
||||||
|
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
#region Properties
|
#region Properties
|
||||||
private int _TranFmtIndx = -1; // stores selected transition format
|
private int _TranFmtIndx = -1; // stores selected transition format
|
||||||
private ItemInfo _CurItemFrom; // stores what item transition is 'from'
|
private ItemInfo _CurItemFrom; // stores what item transition is 'from'
|
||||||
@ -30,6 +31,7 @@ namespace Volian.Controls.Library
|
|||||||
if (_CurTrans == value && _CurItemFrom == MyRTB.MyItemInfo) return;
|
if (_CurTrans == value && _CurItemFrom == MyRTB.MyItemInfo) return;
|
||||||
_CurItemFrom = MyRTB.MyItemInfo;
|
_CurItemFrom = MyRTB.MyItemInfo;
|
||||||
_TranFmtIndx = 0;
|
_TranFmtIndx = 0;
|
||||||
|
btnTranSave.Enabled = btnTranCancel.Enabled = true;
|
||||||
}
|
}
|
||||||
else // Modify a transition
|
else // Modify a transition
|
||||||
{
|
{
|
||||||
@ -409,15 +411,15 @@ namespace Volian.Controls.Library
|
|||||||
ItemInfo selitm = startitm;
|
ItemInfo selitm = startitm;
|
||||||
if (!nostep)
|
if (!nostep)
|
||||||
{
|
{
|
||||||
if (_CurTrans == null)
|
if (_CurTrans == null)
|
||||||
|
{
|
||||||
|
if (!startitm.IsHigh)
|
||||||
{
|
{
|
||||||
if (!startitm.IsHigh)
|
startitm = startitm.MyParent;
|
||||||
{
|
selitm = startitm;
|
||||||
startitm = startitm.MyParent;
|
|
||||||
selitm = startitm;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
selitm = null;
|
selitm = null;
|
||||||
E_TransUI etm = (E_TransUI)_CurItemFrom.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[listBoxTranFmt.SelectedIndex].TransUI;
|
E_TransUI etm = (E_TransUI)_CurItemFrom.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[listBoxTranFmt.SelectedIndex].TransUI;
|
||||||
@ -522,7 +524,7 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
cbTranSects.Enabled = false;
|
cbTranSects.Enabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for range - if no range, then range button/label & step tree selections should be
|
// check for range - if no range, then range button/label & step tree selections should be
|
||||||
// 'cleared/invisble'.
|
// 'cleared/invisble'.
|
||||||
btnTranRangeClear.Visible = _DoingRange;
|
btnTranRangeClear.Visible = _DoingRange;
|
||||||
@ -767,7 +769,7 @@ namespace Volian.Controls.Library
|
|||||||
if (selii != null) allowSave = true;
|
if (selii != null) allowSave = true;
|
||||||
}
|
}
|
||||||
if (!_DoingRange)
|
if (!_DoingRange)
|
||||||
{
|
{
|
||||||
SaveCancelEnabling(allowSave, selii);
|
SaveCancelEnabling(allowSave, selii);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -800,7 +802,6 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SaveCancelEnabling(bool allowSave, ItemInfo selii)
|
private void SaveCancelEnabling(bool allowSave, ItemInfo selii)
|
||||||
{
|
{
|
||||||
btnTranSave.Enabled = allowSave;
|
btnTranSave.Enabled = allowSave;
|
||||||
@ -934,9 +935,16 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
// Can I build the text right now?
|
// Can I build the text right now?
|
||||||
trantxt = TransitionText.GetResolvedText(_MyRTB.MyItemInfo, listBoxTranFmt.SelectedIndex,toItem,rangeItem ?? toItem);
|
trantxt = TransitionText.GetResolvedText(_MyRTB.MyItemInfo, listBoxTranFmt.SelectedIndex,toItem,rangeItem ?? toItem);
|
||||||
_MyRTB.InsertTran(trantxt, linktxt);
|
int ss = _MyRTB.SelectionStart;// Remember where the link is being added
|
||||||
_MyRTB.Select(_MyRTB.SelectionStart + trantxt.Length + linktxt.Length, 0);
|
_MyRTB.InsertTran(trantxt, linktxt);// Insert the LINK
|
||||||
_MyRTB.SaveText();
|
_MyRTB.SaveText();// Save the text with the LINK - This also moves the cursor to the end of the text
|
||||||
|
// By selecting a starting position within a link, StepRTB (HandleSelectionChange) will select the link
|
||||||
|
_MyRTB.Select(ss + 7 + trantxt.Length, 0);// Try 7 for <Start] and the length of the transition text
|
||||||
|
//Console.WriteLine("'{0}'",_MyRTB.Text.Substring(_MyRTB.SelectionStart,_MyRTB.SelectionLength));
|
||||||
|
string linkText = _MyRTB.Text.Substring(_MyRTB.SelectionStart, _MyRTB.SelectionLength);
|
||||||
|
if(_MyLog.IsInfoEnabled && (linkText.Contains("NewID") || linkText.Contains("CTID")))
|
||||||
|
_MyLog.InfoFormat("ItemID {0}, LinkText '{1}'", _MyRTB.MyItemInfo.ItemID, linkText);
|
||||||
|
_MyRTB.Select(_MyRTB.SelectionStart + _MyRTB.SelectionLength, 0);// Move cursor to end of LINK
|
||||||
_MyRTB.Focus();
|
_MyRTB.Focus();
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -43,9 +43,9 @@ namespace Volian.Controls.Library
|
|||||||
case "TransitionRange":
|
case "TransitionRange":
|
||||||
_MyParsedLinkType = (ParsedLinkType)Enum.Parse(_MyParsedLinkType.GetType(), m.Groups[2].Value);
|
_MyParsedLinkType = (ParsedLinkType)Enum.Parse(_MyParsedLinkType.GetType(), m.Groups[2].Value);
|
||||||
string[] subst = m.Groups[3].Value.Split(" ".ToCharArray());
|
string[] subst = m.Groups[3].Value.Split(" ".ToCharArray());
|
||||||
if (subst[0].IndexOf("CTID") > -1)
|
if (subst[1].IndexOf("CTID") > -1)
|
||||||
_MyTransitionInfo = null;
|
_MyTransitionInfo = null;
|
||||||
else if (subst[0].IndexOf("NewID") > -1)
|
else if (subst[1].IndexOf("NewID") > -1)
|
||||||
_MyTransitionInfo = null;
|
_MyTransitionInfo = null;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -678,9 +678,11 @@ namespace Volian.Controls.Library
|
|||||||
public void SaveConfig()
|
public void SaveConfig()
|
||||||
{
|
{
|
||||||
if (!_MyItemInfo.MyConfig.IsDirty) return;
|
if (!_MyItemInfo.MyConfig.IsDirty) return;
|
||||||
Item itm = _MyItemInfo.Get();
|
using (Item itm = _MyItemInfo.Get())
|
||||||
itm.MyContent.Config = _MyItemInfo.MyConfig.ToString();
|
{
|
||||||
itm.Save();
|
itm.MyContent.Config = _MyItemInfo.MyConfig.ToString();
|
||||||
|
itm.Save();
|
||||||
|
}
|
||||||
_MyItemInfo.MyConfig.IsDirty = false;
|
_MyItemInfo.MyConfig.IsDirty = false;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
@ -720,9 +722,7 @@ namespace Volian.Controls.Library
|
|||||||
_SelectedRtfSB.Append(@"{\f1\fnil\fcharset0 VESymbFix;}}{\colortbl ;\red255\green0\blue0;}");
|
_SelectedRtfSB.Append(@"{\f1\fnil\fcharset0 VESymbFix;}}{\colortbl ;\red255\green0\blue0;}");
|
||||||
_SelectedRtfSB.Append("\r\n");
|
_SelectedRtfSB.Append("\r\n");
|
||||||
// use styles to construct rtf commands to insert into next line (where \b, etc is)
|
// use styles to construct rtf commands to insert into next line (where \b, etc is)
|
||||||
//_SelectedRtfSB.Append(@"\viewkind4\uc1\pard\sl-240\slmult0" + sbbeg.ToString() + @"\fs" + Convert.ToInt32(this.Font.SizeInPoints * 2).ToString() + @" "); // \f0\fs" + this.Font.SizeInPoints * 2 + @" " + myDisplayTextElement.Text + @"}";
|
_SelectedRtfSB.Append(@"\viewkind4\uc1\pard\sl-240\slmult0" + sbbeg.ToString() + @"\fs" + Convert.ToInt32(this.Font.SizeInPoints * 2).ToString() + @" "); // \f0\fs" + this.Font.SizeInPoints * 2 + @" " + myDisplayTextElement.Text + @"}";
|
||||||
_SelectedRtfSB.Append(@"\viewkind4\uc1\sb240\slmult0\pard" + sbbeg.ToString() + @"\fs" + Convert.ToInt32(this.Font.SizeInPoints * 2).ToString() + @" "); // \f0\fs" + this.Font.SizeInPoints * 2 + @" " + myDisplayTextElement.Text + @"}";
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool FontIsFixed()
|
private bool FontIsFixed()
|
||||||
@ -1466,29 +1466,29 @@ namespace Volian.Controls.Library
|
|||||||
IsControlChar = true;
|
IsControlChar = true;
|
||||||
switch (e.KeyCode)
|
switch (e.KeyCode)
|
||||||
{
|
{
|
||||||
//case Keys.X: //ctrl-X
|
case Keys.X: //ctrl-X
|
||||||
//case Keys.C: //ctrl-C
|
case Keys.C: //ctrl-C
|
||||||
// // handle the clipboard copy and cut when a Transition or RO is selected
|
// handle the clipboard copy and cut when a Transition or RO is selected
|
||||||
// // For now, we are coping/cutting just the displayed text to the clipboard (like 16-bit VE-PROMS)
|
// For now, we are coping/cutting just the displayed text to the clipboard (like 16-bit VE-PROMS)
|
||||||
// Clipboard.SetText(GetSelectedDisplayableText());
|
Clipboard.SetText(GetSelectedDisplayableText());
|
||||||
// e.Handled = true;
|
e.Handled = true;
|
||||||
// e.SuppressKeyPress = true;
|
e.SuppressKeyPress = true;
|
||||||
// if (e.KeyCode == Keys.X) // cut to clipboard - delete the selected text
|
if (e.KeyCode == Keys.X) // cut to clipboard - delete the selected text
|
||||||
// HandleDeleteKeyWithSelectedText(e, null);
|
HandleDeleteKeyWithSelectedText(e, null);
|
||||||
// break;
|
break;
|
||||||
//case Keys.V:
|
case Keys.V:
|
||||||
// IDataObject iData = Clipboard.GetDataObject();
|
IDataObject iData = Clipboard.GetDataObject();
|
||||||
// if (!iData.GetDataPresent(DataFormats.Text) && !iData.GetDataPresent(DataFormats.Rtf))
|
if (!iData.GetDataPresent(DataFormats.Text) && !iData.GetDataPresent(DataFormats.Rtf))
|
||||||
// {
|
{
|
||||||
// MessageBox.Show("Cannot paste, text has special characters or symbols that will not paste correctly.");
|
MessageBox.Show("Cannot paste, text has special characters or symbols that will not paste correctly.");
|
||||||
// }
|
}
|
||||||
// else
|
else
|
||||||
// {
|
{
|
||||||
// Paste();
|
Paste();
|
||||||
// if (SelectionLength == 0) SelectionFont = MyStyleFont.WindowsFont;
|
if (SelectionLength == 0) SelectionFont = MyStyleFont.WindowsFont;
|
||||||
// }
|
}
|
||||||
// e.Handled = true;
|
e.Handled = true;
|
||||||
// return;
|
return;
|
||||||
case Keys.Home:
|
case Keys.Home:
|
||||||
StepRTB_HomeEndPressed(e);
|
StepRTB_HomeEndPressed(e);
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
@ -2346,6 +2346,7 @@ namespace Volian.Controls.Library
|
|||||||
@"\u9508", // HEX@"\u2524",// Right Tee - 16-bit char: '\xB4'
|
@"\u9508", // HEX@"\u2524",// Right Tee - 16-bit char: '\xB4'
|
||||||
@"\u9532", // HEX@"\u253c" // + Plus - 16-bit char: '\xC5'
|
@"\u9532", // HEX@"\u253c" // + Plus - 16-bit char: '\xC5'
|
||||||
};
|
};
|
||||||
|
|
||||||
private int MaxCharacterWidth()
|
private int MaxCharacterWidth()
|
||||||
{
|
{
|
||||||
// loop through lines and get the width in characters
|
// loop through lines and get the width in characters
|
||||||
|
@ -511,7 +511,6 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
ItemInfo ichld = MyItemInfo.Steps[0];
|
ItemInfo ichld = MyItemInfo.Steps[0];
|
||||||
btn.Click += new System.EventHandler(btnInsStep_Click);
|
btn.Click += new System.EventHandler(btnInsStep_Click);
|
||||||
//Volian.Base.Library.vlnStackTrace.ShowStackLocal("btn", 2, 10);
|
|
||||||
btn.Tag = string.Format("{0} {1}", fromtype, ichld.MyContent.Type - 20000);
|
btn.Tag = string.Format("{0} {1}", fromtype, ichld.MyContent.Type - 20000);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user