This commit is contained in:
Kathy Ruffing 2012-04-11 10:41:55 +00:00
parent 4137af4bb8
commit 10e0736193

View File

@ -443,26 +443,22 @@ namespace Volian.Controls.Library
int indchar = 0; int indchar = 0;
string indentToken = MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.IndentToken; string indentToken = MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.IndentToken;
if (indentToken == null || indentToken=="0") indentToken = "\x5"; if (indentToken == null || indentToken=="0") indentToken = "\x5";
// this line of code was moved before the find for the indent so that
// the window gets resized if the indent changes the height, i.e. more line(s) in window.
AddEventHandlers();
while ((indchar = Find(indentToken, indchar, RichTextBoxFinds.None)) >= 0) while ((indchar = Find(indentToken, indchar, RichTextBoxFinds.None)) >= 0)
{ {
Point indent = GetPositionFromCharIndex(indchar); Point indent = GetPositionFromCharIndex(indchar);
SelectionHangingIndent = indent.X; SelectionHangingIndent = indent.X;
indchar++; SelectedRtf = SelectedRtf.Replace(@"\'05","");
} }
AddEventHandlers();
} }
//else
//{
// if (MyRTBItem != null && (_MyItemInfo.IsTable || _MyItemInfo.IsFigure))
// {
// //MyRTBItem.ItemWidth = (int)MyRTBItem.TableWidth(Font, Text,false);
// MyRTBItem.ItemWidth = MyRTBItem.MyStepPanel.ToDisplay(MyRTBItem.MyStepSectionLayoutData.WidT);
// }
//}
OrigRTF = Rtf; OrigRTF = Rtf;
_InitializingRTB = false; _InitializingRTB = false;
AdjustSizeForContents(!ActiveMode); // TODO: this is not quite right yet. AdjustSizeForContents(!ActiveMode);
} }
private bool _ProcessKeystrokes = true; private bool _ProcessKeystrokes = true;
public bool ProcessKeystrokes public bool ProcessKeystrokes
@ -470,25 +466,6 @@ namespace Volian.Controls.Library
get { return _ProcessKeystrokes; } get { return _ProcessKeystrokes; }
set { _ProcessKeystrokes = value; } set { _ProcessKeystrokes = value; }
} }
//public EnterKeyHandler EnterKeyPressed;
//protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
//{
// const int WM_KEYDOWN = 0x100;
// const int WM_SYSKEYDOWN = 0x104;
// if ((msg.Msg == WM_KEYDOWN) || (msg.Msg == WM_SYSKEYDOWN))
// {
// switch (keyData)
// {
// case Keys.Control | Keys.V:
// // check for valid data to be inserted:
// return base.ProcessCmdKey(ref msg, keyData);
// default:
// return base.ProcessCmdKey(ref msg, keyData);
// }
// }
// return base.ProcessCmdKey(ref msg, keyData);
//}
private Point ScrollPos private Point ScrollPos
{ {
get { return RTBAPI.GetScrollLocation(this); } get { return RTBAPI.GetScrollLocation(this); }
@ -738,7 +715,7 @@ namespace Volian.Controls.Library
} }
public void InsertIndent(string indentToken) public void InsertIndent(string indentToken)
{ {
if (indentToken == null) indentToken = "\x5"; if (indentToken == null || indentToken == "0") indentToken = "\x5";
AddText(indentToken); AddText(indentToken);
} }
public void InsertText(string txt) public void InsertText(string txt)