This commit is contained in:
parent
edfc3d71b0
commit
ce3b1b4be9
@ -176,7 +176,7 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
public class RtfLine : List<RtfPiece>
|
public class RtfLine : List<RtfPiece>
|
||||||
{
|
{
|
||||||
private static Regex _RegRtfText = new Regex(@"((\\[^'u ]*)+( |$))?(<START\]|#Link.*?\[END>|\\'[0-9a-fA-F]{2}|\\u[0-9]*\?|[^\\]{1}|$|)");
|
private static Regex _RegRtfText = new Regex(@"((\\[^'u ]*|\\up[0-9]|\\ul0?)+( |$))?(<START\]|#Link.*?\[END>|\\'[0-9a-fA-F]{2}|\\u[0-9]*\?|[^\\]{1}|$|)");
|
||||||
public RtfLine(string text)
|
public RtfLine(string text)
|
||||||
{
|
{
|
||||||
MatchCollection matches = _RegRtfText.Matches(text);
|
MatchCollection matches = _RegRtfText.Matches(text);
|
||||||
@ -190,8 +190,11 @@ namespace Volian.Controls.Library
|
|||||||
//Console.WriteLine(text.Substring(nextIndex));
|
//Console.WriteLine(text.Substring(nextIndex));
|
||||||
}
|
}
|
||||||
nextIndex = match.Index + match.Length;
|
nextIndex = match.Index + match.Length;
|
||||||
if (match.Groups[2].ToString().Length + match.Groups[4].ToString().Length > 0)
|
string rtfPart = match.Groups[1].ToString();
|
||||||
this.Add(new RtfPiece(match.Groups[2].ToString(), match.Groups[4].ToString()));
|
if (match.Groups[1].ToString().TrimEnd(" ".ToCharArray()).Length + match.Groups[4].ToString().Length > 0)
|
||||||
|
this.Add(new RtfPiece(match.Groups[1].ToString().TrimEnd(" ".ToCharArray()), match.Groups[4].ToString()));
|
||||||
|
//if (match.Groups[1].ToString().Length + match.Groups[4].ToString().Length > 0)
|
||||||
|
// this.Add(new RtfPiece(match.Groups[1].ToString(), match.Groups[4].ToString()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public RtfLine(int width, string left, string fill, string right)
|
public RtfLine(int width, string left, string fill, string right)
|
||||||
|
@ -212,6 +212,7 @@ namespace Volian.Controls.Library
|
|||||||
Font = formatFont;
|
Font = formatFont;
|
||||||
else
|
else
|
||||||
Font = new Font(_MyFontFamily == null ? formatFont.FontFamily : _MyFontFamily, formatFont.Size, formatFont.Style);
|
Font = new Font(_MyFontFamily == null ? formatFont.FontFamily : _MyFontFamily, formatFont.Size, formatFont.Style);
|
||||||
|
//Font = new Font("Bookman Old Style", formatFont.Size, formatFont.Style);
|
||||||
#elif(RELEASE)
|
#elif(RELEASE)
|
||||||
Font = _origDisplayText.TextFont.WindowsFont; // font defined in plant's format
|
Font = _origDisplayText.TextFont.WindowsFont; // font defined in plant's format
|
||||||
#else //DEMO
|
#else //DEMO
|
||||||
@ -273,6 +274,8 @@ namespace Volian.Controls.Library
|
|||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
_origRTF = Rtf;
|
_origRTF = Rtf;
|
||||||
|
if (_MyItemInfo.ItemID == 74)
|
||||||
|
Console.WriteLine("'{0}'", Rtf);
|
||||||
_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.
|
||||||
@ -416,17 +419,22 @@ namespace Volian.Controls.Library
|
|||||||
void StepRTB_ContextMenuStripChanged(object sender, EventArgs e)
|
void StepRTB_ContextMenuStripChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
//Console.WriteLine("********** StepRTB_ContextMenuStripChanged");
|
//Console.WriteLine("********** StepRTB_ContextMenuStripChanged");
|
||||||
|
int sublocation = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Console.WriteLine("{0}", ContextMenuStrip.GetType().FullName);
|
//Console.WriteLine("{0}", ContextMenuStrip.GetType().FullName);
|
||||||
this.MyStepItem.MyStepPanel.MyStepTabPanel.MyStepTabRibbon.ClearContextMenu();
|
this.MyStepItem.MyStepPanel.MyStepTabPanel.MyStepTabRibbon.ClearContextMenu();
|
||||||
|
sublocation = 1;
|
||||||
_ContextMenuStripChanged = true;
|
_ContextMenuStripChanged = true;
|
||||||
|
sublocation = 2;
|
||||||
_ContextMenuStepRTB = this;
|
_ContextMenuStepRTB = this;
|
||||||
|
sublocation = 3;
|
||||||
_ContextMenuStrip = ContextMenuStrip;
|
_ContextMenuStrip = ContextMenuStrip;
|
||||||
|
sublocation = 4;
|
||||||
}
|
}
|
||||||
catch(Exception ex)
|
catch(Exception ex)
|
||||||
{
|
{
|
||||||
Console.WriteLine("{0} - {1}", ex.GetType().Name, ex.Message);
|
Console.WriteLine("StepRTB_ContextMenuStripChanged {0} - {1} [{2}]", ex.GetType().Name, ex.Message, sublocation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void SetUpStepRTB()
|
private void SetUpStepRTB()
|
||||||
@ -1682,8 +1690,11 @@ namespace Volian.Controls.Library
|
|||||||
case Keys.Enter:
|
case Keys.Enter:
|
||||||
if (!e.Control && !e.Shift && !e.Alt)
|
if (!e.Control && !e.Shift && !e.Alt)
|
||||||
{
|
{
|
||||||
e.Handled = true;
|
if (!MyStepItem.MyItemInfo.IsTablePart)
|
||||||
MyStepItem.MyStepPanel.MyStepTabPanel.MyStepTabRibbon.ProcessEnterKey();
|
{
|
||||||
|
e.Handled = true;
|
||||||
|
MyStepItem.MyStepPanel.MyStepTabPanel.MyStepTabRibbon.ProcessEnterKey();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user