B2021-052 allow for table cell text font size change when the text ends in a setpoint or transition link
This commit is contained in:
parent
814d26f713
commit
6d9a3f5f4e
@ -2628,14 +2628,16 @@ namespace Volian.Controls.Library
|
||||
// C2021-005 set the selected cell(s) or cell text to the passed in font size
|
||||
public void SetFontSize(float newSize)
|
||||
{
|
||||
if (SelectedText == null || SelectedText == "") // table cell selected
|
||||
if (SelectedText == null || SelectedText == "") // empty table cell selected
|
||||
Rtf = SetFontSizeReplace(Rtf, newSize);
|
||||
else
|
||||
{
|
||||
// table cell text selected
|
||||
int selst = SelectionStart;
|
||||
int selln = SelectionLength;
|
||||
SelectedRtf = SetFontSizeReplace(SelectedRtf, newSize); // set font size of seleted text
|
||||
string newrtf = SelectedRtf; //B2021-052 use a temporary variable to allow easy debugging
|
||||
newrtf = SetFontSizeReplace(newrtf, newSize); // changes the /fs## command in the rtf string
|
||||
SelectedRtf = newrtf;// replace the selected portion with the updated font size version of the rtf
|
||||
Select(selst, selln); // re-select the cell text
|
||||
}
|
||||
}
|
||||
@ -2823,7 +2825,7 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
// is this an allowable symbol/character:
|
||||
for (int j = 0; j < sl.Count; j++)
|
||||
{
|
||||
{
|
||||
if (sym == allowableSymbols[j])
|
||||
{
|
||||
sb = sb.Append((char)(Convert.ToInt32(allowableSymbols[j])));
|
||||
@ -2835,12 +2837,14 @@ namespace Volian.Controls.Library
|
||||
if (!didCharReplace)
|
||||
{
|
||||
sb = sb.Append("?");
|
||||
didCharReplace = true;
|
||||
didCharReplace = true;
|
||||
hasBadChar = true;
|
||||
}
|
||||
}
|
||||
if (!didCharReplace)
|
||||
sb = sb.Append(ptext[i]);
|
||||
}
|
||||
if (!didCharReplace)
|
||||
sb = sb.Append(ptext[i]);
|
||||
}
|
||||
ptext = sb.ToString();
|
||||
ptext = ptext.Replace("\u2013", "-"); // Replace EN Dash with hyphen
|
||||
|
@ -2561,7 +2561,7 @@ namespace Volian.Controls.Library
|
||||
else
|
||||
applyStyle(); // not in a grid, apply style to current step type
|
||||
}
|
||||
//C2021-005 the font size for the selected talbe cell(s)
|
||||
//C2021-005 the font size for the selected table cell(s)
|
||||
private float GetTableCellFontSize(SelectionOption selOpt)
|
||||
{
|
||||
// return 0 if there are multiple font sizes or just an invalid selection
|
||||
@ -2652,12 +2652,18 @@ namespace Volian.Controls.Library
|
||||
MyStepRTB.Select(0, 0);
|
||||
break;
|
||||
}
|
||||
MyStepRTB.SetFontSize(newSize);
|
||||
ChangeTableTextFontSize(newSize); // Apply font size to selected cells
|
||||
}
|
||||
MyFlexGrid.Select(cr);
|
||||
}
|
||||
else
|
||||
MyStepRTB.SetFontSize(newSize); // not in a grid, apply style to current step type
|
||||
{
|
||||
int ss = MyStepRTB.SelectionStart;
|
||||
int sl = MyStepRTB.SelectionLength;
|
||||
MyStepRTB.OnReturnToEditor(this, new EventArgs());
|
||||
MyStepRTB.Select(ss, sl);
|
||||
ChangeTableTextFontSize(newSize);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2671,10 +2677,37 @@ namespace Volian.Controls.Library
|
||||
int sl = MyStepRTB.SelectionLength;
|
||||
MyStepRTB.OnReturnToEditor(this, new EventArgs());
|
||||
MyStepRTB.Select(ss, sl);
|
||||
MyStepRTB.SetFontSize(newSize);
|
||||
ChangeTableTextFontSize(newSize);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// B2021-052 table cell text that ends with a link (RO or Transition) was not accepting a change in font size
|
||||
private void ChangeTableTextFontSize(float newSize)
|
||||
{
|
||||
int ss = MyStepRTB.SelectionStart;
|
||||
int sl = MyStepRTB.SelectionLength;
|
||||
bool addedSpace = false;
|
||||
// B2021-052 if the table cell text end with a link, then append a space to the end and reselect the text
|
||||
if ((sl == MyStepRTB.TextLength || MyStepRTB.SelectedText.EndsWith("[END>")) && MyStepRTB.Text.EndsWith("[END>"))
|
||||
{
|
||||
addedSpace = true;
|
||||
MyStepRTB.OnReturnToEditor(this, new EventArgs()); //reset and refocus to the table cell rtf edtior
|
||||
MyStepRTB.AppendText(" ");
|
||||
MyStepRTB.Select(ss, sl);
|
||||
}
|
||||
MyStepRTB.SetFontSize(newSize); // change the font size of the selection
|
||||
// B2021-052 if a space as added, remove the space
|
||||
if (addedSpace)
|
||||
{
|
||||
MyStepRTB.OnReturnToEditor(this, new EventArgs());
|
||||
MyStepRTB.Select(MyStepRTB.TextLength - 1, 1); // select the space at the end of the text
|
||||
MyStepRTB.SelectedText = ""; // remove the space
|
||||
MyStepRTB.Select(ss, sl);
|
||||
}
|
||||
}
|
||||
|
||||
private void ToggleBold()
|
||||
{
|
||||
RTBAPI.ToggleBold(!RTBAPI.IsBold(_MyStepRTB), _MyStepRTB, _MyStepRTB.SelectionLength == 0 ? RTBAPI.RTBSelection.SCF_DEFAULT : RTBAPI.RTBSelection.SCF_SELECTION);
|
||||
|
Loading…
x
Reference in New Issue
Block a user