- Added tools to find Symbol Characters in Word Documents

- If the range does not have any characters return an empty string
Refresh Most Recent Items when the office button is pressed
Added OrdinalChanged Event
Used OrdinalChanged Event rather than MyContent.Changed Event when Ordinal is updated.
Use OrdinalChanged Event to update Tree Node
Refresh MRU list as items are added
Use OrdinalChanged Event to update Step Tab
- RTBFillIn changed to only update the RTB when the contents change
- AdjustSizeForContents changed to raise the HeightChanged event when the Height changes
Update the treeview tabs even if the step is not open.
This commit is contained in:
Rich
2010-12-01 20:03:06 +00:00
parent b3b3f5e518
commit bb3844538c
9 changed files with 174 additions and 30 deletions

View File

@@ -201,7 +201,6 @@ namespace Volian.Controls.Library
}
}
_InitializingRTB = true;
_SelectedRtfSB.Remove(0, _SelectedRtfSB.Length);
DisplayText vlntxt = new DisplayText(_MyItemInfo, EpMode, VwMode, !edit, FieldToEdit, true);
//if (_origDisplayText != null && vlntxt.StartText == _origDisplayText.StartText)
//{
@@ -222,9 +221,12 @@ namespace Volian.Controls.Library
// TODO: Release Mode
//Font = _origDisplayText.TextFont.WindowsFont; // font defined in plant's format
}
Text = ""; // Initialize text before add text
// RHM 20101201 - Don't reset the text. Calculate the text and compare it with the existing text in AddRTFText
//Text = ""; // Initialize text before add text
// IMPORTANT: SetLineSpacing must be set before Links, otherwise it
// was confusing the 'handle' of the rtf box.
//Console.WriteLine("'font',{0}", Font);
if(Text == "")SelectionFont = Font; // Initialize SelectionFont
RTBAPI.SetLineSpacing(this, RTBAPI.ParaSpacing.PFS_EXACT);
AddRtfText(vlntxt.StartText);
//AddRtfStyles();
@@ -714,14 +716,18 @@ namespace Volian.Controls.Library
#region AddRtfTextAndStyles
private void AddRtfText(string txt)
{
AddFontTable();
_RtfPrefix = _SelectedRtfSB.ToString();
_SelectedRtfSB.Append(txt);
SelectedRtf = _SelectedRtfSB.ToString() + "}";
StringBuilder selectedRtfSB = new StringBuilder();
AddFontTable(selectedRtfSB);
_RtfPrefix = selectedRtfSB.ToString();
selectedRtfSB.Append(txt);
string newRTF = selectedRtfSB.ToString() + "}";
SelectAll();
if (SelectedRtf != newRTF)
SelectedRtf = newRTF;
//SelectedRtf = selectedRtfSB.ToString() + "}";
FindAllLinks();
}
private StringBuilder _SelectedRtfSB = new StringBuilder();
private void AddFontTable()
private void AddFontTable(StringBuilder selectedRtfSB)
{
StringBuilder sbbeg = new StringBuilder();
StringBuilder sbend = new StringBuilder();
@@ -740,14 +746,14 @@ namespace Volian.Controls.Library
sbbeg.Append(@"\i");
sbend.Insert(0, @"\i0");
}
_SelectedRtfSB.Append(@"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset2 " + this.Font.FontFamily.Name + @";}"); //}\f0\fs" + this.Font.SizeInPoints * 2 + @" " + myDisplayTextElement.Text + @"}}";
selectedRtfSB.Append(@"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset2 " + this.Font.FontFamily.Name + @";}"); //}\f0\fs" + this.Font.SizeInPoints * 2 + @" " + myDisplayTextElement.Text + @"}}";
if (!FontIsFixed())
_SelectedRtfSB.Append(@"{\f1\fnil\fcharset0 Arial Unicode MS;}}{\colortbl ;\red255\green0\blue0;}");
selectedRtfSB.Append(@"{\f1\fnil\fcharset0 Arial Unicode MS;}}{\colortbl ;\red255\green0\blue0;}");
else
_SelectedRtfSB.Append(@"{\f1\fnil\fcharset0 VESymbFix;}}{\colortbl ;\red255\green0\blue0;}");
_SelectedRtfSB.Append("\r\n");
selectedRtfSB.Append(@"{\f1\fnil\fcharset0 VESymbFix;}}{\colortbl ;\red255\green0\blue0;}");
selectedRtfSB.Append("\r\n");
// 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 + @"}";
}
private bool FontIsFixed()
@@ -906,8 +912,10 @@ namespace Volian.Controls.Library
Size szNew = new Size(((Text != "" && adjustWidth) ? widthNew : (widthNew > Width ? widthNew : Width)), heightNew);
if (this.Size != szNew)
{
int heightOld = Height;
this.Size = szNew;
OnHeightChanged(this, new EventArgs());
if (heightOld != Height)
OnHeightChanged(this, new EventArgs());
}
}
}