This commit is contained in:
parent
8c5aac4885
commit
6634758e73
@ -119,7 +119,6 @@ namespace Volian.Controls.Library
|
|||||||
UpdateAnnotationGrid();
|
UpdateAnnotationGrid();
|
||||||
//_AnnotationSearch.UpdateAnnotationSearchResults(); // update the search results
|
//_AnnotationSearch.UpdateAnnotationSearchResults(); // update the search results
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnSaveAnnotation_Click(object sender, EventArgs e)
|
private void btnSaveAnnotation_Click(object sender, EventArgs e)
|
||||||
@ -244,6 +243,7 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
FindCurrentAnnotation(); // position to the grid row of the current annotation
|
FindCurrentAnnotation(); // position to the grid row of the current annotation
|
||||||
_LoadingGrid = false;
|
_LoadingGrid = false;
|
||||||
|
if (_Annotations == null || _Annotations.Count == 0) btnRemoveAnnotation.Enabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -183,8 +183,8 @@ namespace Volian.Controls.Library
|
|||||||
if (_SavCurROLink != null)
|
if (_SavCurROLink != null)
|
||||||
SavROLink = _SavCurROLink; ;
|
SavROLink = _SavCurROLink; ;
|
||||||
lbROId.Text = chld.appid;
|
lbROId.Text = chld.appid;
|
||||||
btnSaveRO.Enabled = ((_SavCurROLink == null) || !(chld.roid.Equals(SavROLink)));
|
btnSaveRO.Enabled = ((_SavCurROLink == null) || !(chld.roid.Substring(0, 12).ToLower().Equals(SavROLink.ROID.Substring(0, 12).ToLower())));
|
||||||
btnCancelRO.Enabled = ((_SavCurROLink != null) && !(chld.roid.Equals(SavROLink)));
|
btnCancelRO.Enabled = ((_SavCurROLink != null) && chld.roid.Substring(0, 12).ToLower() != SavROLink.ROID.Substring(0, 12).ToLower());
|
||||||
switch (chld.type)
|
switch (chld.type)
|
||||||
{
|
{
|
||||||
case 1: // standard (regular) text RO type
|
case 1: // standard (regular) text RO type
|
||||||
|
@ -42,7 +42,19 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
_MyRTB = value;
|
_MyRTB = value;
|
||||||
_CurItemInfo = MyRTB.MyItemInfo;
|
_CurItemInfo = MyRTB.MyItemInfo;
|
||||||
cbChgAll.Checked = !_CurItemInfo.IsHigh;
|
// only change all at level if all substeps are of same type
|
||||||
|
bool allSameType = true;
|
||||||
|
ItemInfo itmp = _CurItemInfo.FirstSibling;
|
||||||
|
while (itmp != null)
|
||||||
|
{
|
||||||
|
if (_CurItemInfo.MyContent.Type != itmp.MyContent.Type)
|
||||||
|
{
|
||||||
|
allSameType = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
itmp = itmp.NextItem;
|
||||||
|
}
|
||||||
|
cbChgAll.Checked = allSameType;
|
||||||
TagsFillIn();
|
TagsFillIn();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -244,6 +256,7 @@ namespace Volian.Controls.Library
|
|||||||
if (_Initalizing) return;
|
if (_Initalizing) return;
|
||||||
StepItem topStepItem = _MyRTB.MyStepItem;
|
StepItem topStepItem = _MyRTB.MyStepItem;
|
||||||
FormatData fmtdata = _CurItemInfo.ActiveFormat.PlantFormat.FormatData;
|
FormatData fmtdata = _CurItemInfo.ActiveFormat.PlantFormat.FormatData;
|
||||||
|
string msgBox = null;
|
||||||
if (cbChgAll.Checked)
|
if (cbChgAll.Checked)
|
||||||
{
|
{
|
||||||
ItemInfo startitm = _CurItemInfo.FirstSibling;
|
ItemInfo startitm = _CurItemInfo.FirstSibling;
|
||||||
@ -255,14 +268,18 @@ namespace Volian.Controls.Library
|
|||||||
cnt.Save();
|
cnt.Save();
|
||||||
startitm = (startitm.NextItemCount > 0 ? startitm.NextItems[0] : null);
|
startitm = (startitm.NextItemCount > 0 ? startitm.NextItems[0] : null);
|
||||||
}
|
}
|
||||||
|
msgBox = string.Format("All Step Types at this level were changed to {0}", listBoxStepTypes.Items[listBoxStepTypes.SelectedIndex]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Content cnt = Content.Get(_CurItemInfo.MyContent.ContentID);
|
Content cnt = Content.Get(_CurItemInfo.MyContent.ContentID);
|
||||||
cnt.Type = 20000 + fmtdata.StepDataList[_MyStepTypeInd[listBoxStepTypes.SelectedIndex]].Index;
|
cnt.Type = 20000 + fmtdata.StepDataList[_MyStepTypeInd[listBoxStepTypes.SelectedIndex]].Index;
|
||||||
cnt.Save();
|
cnt.Save();
|
||||||
|
msgBox = string.Format("This Step Type was changed to {0}", listBoxStepTypes.Items[listBoxStepTypes.SelectedIndex]);
|
||||||
}
|
}
|
||||||
topStepItem.SetAllTabs();
|
topStepItem.SetAllTabs();
|
||||||
|
MessageBox.Show(msgBox);
|
||||||
|
|
||||||
}
|
}
|
||||||
private void groupPanelCheckoff_VisibleChanged(object sender, EventArgs e)
|
private void groupPanelCheckoff_VisibleChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
@ -321,8 +321,7 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
string fnum = m.Groups[1].Value;
|
string fnum = m.Groups[1].Value;
|
||||||
string supnum = m.Groups[2].Value;
|
string supnum = m.Groups[2].Value;
|
||||||
//string newstr = string.Format(@"{0}x10\super {1}\nosupersub ", fnum, supnum);
|
string newstr = string.Format(@"{0}x10\up2 {1}\up0 ", fnum, supnum);
|
||||||
string newstr = string.Format(@"{0}x10\up3 {1}\up0 ", fnum, supnum);
|
|
||||||
retstr = retstr.Replace(m.Value, newstr);
|
retstr = retstr.Replace(m.Value, newstr);
|
||||||
}
|
}
|
||||||
return retstr;
|
return retstr;
|
||||||
@ -354,7 +353,6 @@ namespace Volian.Controls.Library
|
|||||||
RtfToDisplayTextElements(OriginalText);
|
RtfToDisplayTextElements(OriginalText);
|
||||||
List<displayLinkElement> origList = GetLinkList(DisplayTextElementList);
|
List<displayLinkElement> origList = GetLinkList(DisplayTextElementList);
|
||||||
// now get new text into displaytext elements for comparison for links:
|
// now get new text into displaytext elements for comparison for links:
|
||||||
//RtfToDisplayTextElements(rtb.Rtf);
|
|
||||||
RtfToDisplayTextElements(modtext);
|
RtfToDisplayTextElements(modtext);
|
||||||
// Compare ro/transition lists and delete or add any to the item for any ros/transitions that have been
|
// Compare ro/transition lists and delete or add any to the item for any ros/transitions that have been
|
||||||
// added/deleted or modified.
|
// added/deleted or modified.
|
||||||
@ -607,11 +605,10 @@ namespace Volian.Controls.Library
|
|||||||
|
|
||||||
if (text == null || text == "") return;
|
if (text == null || text == "") return;
|
||||||
|
|
||||||
//string noExtraRtfStr = RtfToDbText(text);
|
|
||||||
string noExtraRtfStr = text;
|
string noExtraRtfStr = text;
|
||||||
|
|
||||||
int startIndex = 0;
|
int startIndex = 0;
|
||||||
int index = -1;
|
int index = -1;
|
||||||
|
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.
|
||||||
@ -654,112 +651,6 @@ namespace Volian.Controls.Library
|
|||||||
|
|
||||||
return noExtraRtfStr;
|
return noExtraRtfStr;
|
||||||
}
|
}
|
||||||
//private string RemoveRtfStyles(string rtf)
|
|
||||||
//{
|
|
||||||
// string retval = rtf;
|
|
||||||
// // remove rtf commands for any styles that were added. Note that if
|
|
||||||
// // the entire item has a style, and also contains 'pieces' of text with
|
|
||||||
// // the same style, the underlying rtf box removes the embedded rtf commands,
|
|
||||||
// // for example, if the entire step is bolded, and 'THEN' has bold on/off
|
|
||||||
// // surrounding it, the rtf box removes the bold around the 'THEN'
|
|
||||||
// // These remove the command with a following space or the command alone,
|
|
||||||
// // either case may exist, because if there are rtf commands following the
|
|
||||||
// // style command, there will be no space character following the style command.
|
|
||||||
// if (((TextFont.Style & E_Style.Bold) > 0) || ((TextFont.Style & E_Style.MmBold) > 0))
|
|
||||||
// {
|
|
||||||
// retval = RemoveToken(retval, @"\\b0");
|
|
||||||
// retval = RemoveToken(retval, @"\\b");
|
|
||||||
// }
|
|
||||||
// if ((TextFont.Style & E_Style.Underline) > 0)
|
|
||||||
// {
|
|
||||||
// retval = RemoveToken(retval, @"\\ulnone");
|
|
||||||
// retval = RemoveToken(retval, @"\\ul");
|
|
||||||
// }
|
|
||||||
// if ((TextFont.Style & E_Style.Italics) > 0)
|
|
||||||
// {
|
|
||||||
// retval = RemoveToken(retval, @"\\i0");
|
|
||||||
// retval = RemoveToken(retval, @"\\i");
|
|
||||||
// }
|
|
||||||
// return retval;
|
|
||||||
//}
|
|
||||||
//private string RemoveToken(string str, string token)
|
|
||||||
//{
|
|
||||||
// // if this token is preceeded by another token and followed by a space
|
|
||||||
// // leave the preceeding token the ending space
|
|
||||||
// string retval = Regex.Replace(str, @"(\\[^ \\?\r\n\t]*)" + token + " ", "$1 ");
|
|
||||||
// if (retval != str)
|
|
||||||
// Console.WriteLine("leave the preceeding token the ending space");
|
|
||||||
// // otherwise replace the token optionally followed by a space
|
|
||||||
// retval = Regex.Replace(retval, token + " ?", "");
|
|
||||||
// return retval;
|
|
||||||
//}
|
|
||||||
//private static string StaticRemoveToken(string str, string token)
|
|
||||||
//{
|
|
||||||
// // if this token is preceeded by another token and followed by a space
|
|
||||||
// // leave the preceeding token the ending space
|
|
||||||
// string retval = Regex.Replace(str, @"(\\[^ \\?\r\n\t]*)" + token + " ", "$1 ");
|
|
||||||
// if (retval != str)
|
|
||||||
// Console.WriteLine("leave the preceeding token the ending space");
|
|
||||||
// // otherwise replace the token optionally followed by a space
|
|
||||||
// retval = Regex.Replace(retval, token + " ?", "");
|
|
||||||
// return retval;
|
|
||||||
//}
|
|
||||||
//public static string ReplaceRTFClause(Match m)
|
|
||||||
//{
|
|
||||||
// switch (m.Value[1])
|
|
||||||
// {
|
|
||||||
// case 'u':
|
|
||||||
// if (Regex.IsMatch(m.Value, @"\\u[0-9]+"))
|
|
||||||
// return m.Value; // Special Charcaters
|
|
||||||
// if (Regex.IsMatch(m.Value, @"\\ulnone"))
|
|
||||||
// return m.Value;
|
|
||||||
// if (Regex.IsMatch(m.Value, @"\\ul.*"))
|
|
||||||
// return m.Value; // Underline
|
|
||||||
// break;
|
|
||||||
// case '\'': // Special Character
|
|
||||||
// return m.Value;
|
|
||||||
// case 'b': // Bold
|
|
||||||
// return m.Value;
|
|
||||||
// case 's': // sub or super....
|
|
||||||
// if (m.Value == @"\sub") return m.Value;
|
|
||||||
// if (m.Value == @"\super") return m.Value;
|
|
||||||
// break;
|
|
||||||
// case 'n': // nosubsuper...
|
|
||||||
// if (m.Value == @"\nosupersub") return m.Value;
|
|
||||||
// break;
|
|
||||||
// case 'i': // Italics
|
|
||||||
// return m.Value;
|
|
||||||
// case '{': // look for escape for curly braces:
|
|
||||||
// return m.Value;
|
|
||||||
// case '}':
|
|
||||||
// return m.Value;
|
|
||||||
// case 'v': // save link hidden info
|
|
||||||
// if (m.Value == @"\v") return m.Value; // comment part of link
|
|
||||||
// // end comment may end in space or may end in '\' if another rtf command,
|
|
||||||
// // or may end at end of string. First check for space, keep it in string
|
|
||||||
// // if it is there.
|
|
||||||
// if (Regex.IsMatch(m.Value, @"\\v0 "))
|
|
||||||
// return m.Value;
|
|
||||||
// if (Regex.IsMatch(m.Value, @"\\v0"))
|
|
||||||
// return m.Value;
|
|
||||||
// break;
|
|
||||||
// case 'l':
|
|
||||||
// if (m.Value == @"\line") return m.Value;
|
|
||||||
// break;
|
|
||||||
// case 'p':
|
|
||||||
// if (m.Value == @"\par") return "\r\n";
|
|
||||||
// //if (m.Value == @"\protect")
|
|
||||||
// // return m.Value;
|
|
||||||
// //if (m.Value == @"\protect0")
|
|
||||||
// // return m.Value;
|
|
||||||
// if (m.Value.Length>=6 && m.Value.Substring(0,6) == "\\par\r\n") return m.Value.Replace("\r\n", " ");
|
|
||||||
// break;
|
|
||||||
// case 'f': // handle fonts separately because they may or may not have a space after them
|
|
||||||
// if (m.Value[2]>='0' && m.Value[2]<='9')return m.Value;
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// return "";//Strip All
|
|
||||||
//}
|
|
||||||
public static string StaticReplaceRTFClause(Match m)
|
public static string StaticReplaceRTFClause(Match m)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@ -785,13 +676,6 @@ namespace Volian.Controls.Library
|
|||||||
return token;
|
return token;
|
||||||
case 'b': // Bold
|
case 'b': // Bold
|
||||||
return token;
|
return token;
|
||||||
//case 's': // sub or super....
|
|
||||||
// if (Regex.IsMatch(token, @"^\\sub ?$")) return token;
|
|
||||||
// if (Regex.IsMatch(token, @"^\\super ?$")) return token;
|
|
||||||
// break;
|
|
||||||
//case 'n': // nosubsuper...
|
|
||||||
// if (Regex.IsMatch(token, @"^\\nosupersub ?$")) return token;
|
|
||||||
// break;
|
|
||||||
case 'i': // Italics
|
case 'i': // Italics
|
||||||
return token;
|
return token;
|
||||||
case '{': // look for escape for curly braces:
|
case '{': // look for escape for curly braces:
|
||||||
@ -990,7 +874,7 @@ namespace Volian.Controls.Library
|
|||||||
// followed by a non-underline or single quote, and if so, return it.
|
// followed by a non-underline or single quote, and if so, return it.
|
||||||
if (((txt[indx + 1] == 'u' && txt[indx + 2] != 'l')) || (txt[indx + 1] == '\'')) return indx;
|
if (((txt[indx + 1] == 'u' && txt[indx + 2] != 'l')) || (txt[indx + 1] == '\'')) return indx;
|
||||||
// see if link
|
// see if link
|
||||||
if (txt[indx + 1] == 'v') return indx;
|
if (txt[indx + 1] == 'v') return indx; //TODO - should have <START here too!
|
||||||
// Otherwise, get next index, must have been a slash or other rtf command.
|
// Otherwise, get next index, must have been a slash or other rtf command.
|
||||||
startIndex = indx + 1;
|
startIndex = indx + 1;
|
||||||
}
|
}
|
||||||
@ -1192,10 +1076,9 @@ 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 the <START], can't count characters
|
// Find the 'end comment' for this <START], can't count characters
|
||||||
// because there may be formatting characters such as \b or \ul before
|
// because there may be formatting characters such as \b or \ul before
|
||||||
// the \v0
|
// the \v0
|
||||||
int linkIndx = text.IndexOf(@"#Link", index);
|
int linkIndx = text.IndexOf(@"#Link", index);
|
||||||
@ -1228,7 +1111,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;
|
||||||
@ -1248,6 +1131,7 @@ 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();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user