This commit is contained in:
Kathy Ruffing 2008-11-19 14:06:23 +00:00
parent 183026d98d
commit 4badbdba17
3 changed files with 25 additions and 6 deletions

View File

@ -122,7 +122,7 @@ namespace Volian.Controls.Library
}
#if(DEBUG)
// TODO: This formatting should come from the format file
if (value.MyContent.Type == 20001)
if (value.MyContent.Type == 20002)
Circle = true;
if (_TabFormat == "o ")
CheckOff = true;

View File

@ -293,6 +293,7 @@ namespace Volian.Controls.Library
{
_SelectedStepRTB.BackColor = InactiveColor;
_SelectedStepRTB.SaveText(); // Save any changes to the text
_SelectedStepRTB.SaveConfig(); // This may be redundant
}
_SelectedStepRTB = value;
if (_SelectedItemInfo.ItemID != value.MyItemInfo.ItemID)

View File

@ -15,7 +15,7 @@ namespace Volian.Controls.Library
public partial class StepRTB : RichTextBox , IStepRTB
{
#region Properties and Variables
// use newer rich text box....
// use newer rich text box....
//[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
//static extern IntPtr LoadLibrary(string lpFileName);
//protected override CreateParams CreateParams
@ -80,6 +80,7 @@ namespace Volian.Controls.Library
//_InitializingRTB = false;
_IsDirty = false;
ClearUndo();
_MyItemInfo.MyConfig.PropertyChanged += new PropertyChangedEventHandler(MyConfig_PropertyChanged);
}
}
}
@ -192,6 +193,11 @@ namespace Volian.Controls.Library
//this.SelectionChanged += new EventHandler(DisplayRTB_SelectionChanged);
}
void MyConfig_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
SaveConfig();
}
private void StepRTB_Click(object sender, EventArgs e)
{
if (ReadOnly) return;
@ -252,13 +258,24 @@ namespace Volian.Controls.Library
{
if (ReadOnly) return;
if (!_IsDirty) return;
bool success = _origDisplayText.Save((RichTextBox)this);
if (success)
if (_IsDirty)
{
_IsDirty = false;
ClearUndo();
bool success = _origDisplayText.Save((RichTextBox)this);
if (success)
{
_IsDirty = false;
ClearUndo();
}
}
}
public void SaveConfig()
{
if (!_MyItemInfo.MyConfig.IsDirty) return;
Item itm = _MyItemInfo.Get();
itm.MyContent.Config = _MyItemInfo.MyConfig.ToString();
itm.Save();
_MyItemInfo.MyConfig.IsDirty = false;
}
#endregion
#region AddRtfTextAndStyles
private void AddRtfText(DisplayText myDisplayText)
@ -287,6 +304,7 @@ namespace Volian.Controls.Library
}
private void AddSymbol(string str)
{
MessageBox.Show(SelectedRtf);
SelectedRtf = @"{\rtf1{\fonttbl{\f0\fcharset0 Arial Unicode MS;}}\f0\fs" + this.Font.SizeInPoints * 2 + " " + /* ConvertUnicodeChar(str) */ str + @"}";
}
private void AddRtfLink(displayLinkElement myDisplayLinkElement)