This commit is contained in:
2011-02-18 18:59:46 +00:00
parent 729c39a503
commit 7704e926df
6 changed files with 493 additions and 95 deletions

View File

@@ -141,6 +141,22 @@ namespace Volian.Controls.Library
}
#endregion
#region Properties and Variables
public bool HasVScroll
{
get
{
return RTBAPI.HasVertScroll(this);
}
}
public bool HasHScroll
{
get
{
return RTBAPI.HasHorzScroll(this);
}
}
private bool _EditMode = true;
/// <summary>
/// Allows insert of links. If false, don't allow selection of links.
@@ -184,7 +200,7 @@ namespace Volian.Controls.Library
set { _FieldToEdit = value; }
}
private string _RtfPrefix; // contains Font table and styles (bold/underline/italics) for rtb from step style
public string RtfPrefix
public string RtfPrefixForSymbols
{
get
{
@@ -197,6 +213,19 @@ namespace Volian.Controls.Library
return _RtfPrefix + @"\f1\fs" + FormatFont.SizeInPoints * 2 + " ";
}
}
public string RtfPrefix
{
get
{
if (_RtfPrefix == null)
{
StringBuilder selectedRtfSB = new StringBuilder();
AddFontTable(selectedRtfSB, FormatFont, FontIsFixed(FormatFont));
_RtfPrefix = selectedRtfSB.ToString();
}
return _RtfPrefix;
}
}
// August 5, 2009 - KBR & RHM:
// Insert/Overwrite will be developed later if needed. various issues
// were found during initial development that made its scope larger than
@@ -783,6 +812,18 @@ namespace Volian.Controls.Library
FindAllLinks();
if (txt == "") SelectionFont = FormatFont;
}
public void SetTableGridCellRTFPrefix(Font myfont)
{
if (_FormatFont == null)
_FormatFont = myfont;
if (_RtfPrefix == null)
{
StringBuilder selectedRtfSB = new StringBuilder();
AddFontTable(selectedRtfSB, myfont, FontIsFixed(myfont));
_RtfPrefix = selectedRtfSB.ToString();
}
}
private static void AddFontTable(StringBuilder selectedRtfSB, Font myFont, bool isFixed)
{
StringBuilder sbbeg = new StringBuilder();
@@ -851,7 +892,7 @@ namespace Volian.Controls.Library
// See comments in AddRtf(string str) to explain the font style setting
RTBAPI.E_FontStyle fs = RTBAPI.GetFontStyle(this);
int position = SelectionStart;
SelectedRtf = RtfPrefix + str + @"}";
SelectedRtf = RtfPrefixForSymbols + str + @"}";
Select(position, 1);
RTBAPI.SetFontStyle(this, fs);
Select(position + 1, 0);
@@ -2555,14 +2596,14 @@ namespace Volian.Controls.Library
Select(rowOffset + col, 1);
string charToBeReplaced = SelectedText;
if (Text.Length > (rowOffset + col + 7) && Text.Substring(rowOffset + col + 1, 6) != "#Link:")
SelectedRtf = RtfPrefix + TableCharsU[tableCharIndx] + "?}";
SelectedRtf = RtfPrefixForSymbols + TableCharsU[tableCharIndx] + "?}";
else
{
SelectionStart++;
int lenComment = 1 + SelectionStart - (rowOffset + col);
//Console.WriteLine("{0},{1},{2}", rowOffset + col, SelectionStart, SelectionLength);
Select(rowOffset + col, 0);
SelectedRtf = RtfPrefix + TableCharsU[tableCharIndx] + "?}";
SelectedRtf = RtfPrefixForSymbols + TableCharsU[tableCharIndx] + "?}";
Select(rowOffset + col, lenComment);
//Console.WriteLine("'{0}',{1},{2},{3}", SelectedText, lenComment, SelectionLength, SelectionStart);
//Console.WriteLine("'{0}'", SelectedRtf);