This commit is contained in:
parent
183026d98d
commit
4badbdba17
@ -122,7 +122,7 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
#if(DEBUG)
|
#if(DEBUG)
|
||||||
// TODO: This formatting should come from the format file
|
// TODO: This formatting should come from the format file
|
||||||
if (value.MyContent.Type == 20001)
|
if (value.MyContent.Type == 20002)
|
||||||
Circle = true;
|
Circle = true;
|
||||||
if (_TabFormat == "o ")
|
if (_TabFormat == "o ")
|
||||||
CheckOff = true;
|
CheckOff = true;
|
||||||
|
@ -293,6 +293,7 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
_SelectedStepRTB.BackColor = InactiveColor;
|
_SelectedStepRTB.BackColor = InactiveColor;
|
||||||
_SelectedStepRTB.SaveText(); // Save any changes to the text
|
_SelectedStepRTB.SaveText(); // Save any changes to the text
|
||||||
|
_SelectedStepRTB.SaveConfig(); // This may be redundant
|
||||||
}
|
}
|
||||||
_SelectedStepRTB = value;
|
_SelectedStepRTB = value;
|
||||||
if (_SelectedItemInfo.ItemID != value.MyItemInfo.ItemID)
|
if (_SelectedItemInfo.ItemID != value.MyItemInfo.ItemID)
|
||||||
|
@ -80,6 +80,7 @@ namespace Volian.Controls.Library
|
|||||||
//_InitializingRTB = false;
|
//_InitializingRTB = false;
|
||||||
_IsDirty = false;
|
_IsDirty = false;
|
||||||
ClearUndo();
|
ClearUndo();
|
||||||
|
_MyItemInfo.MyConfig.PropertyChanged += new PropertyChangedEventHandler(MyConfig_PropertyChanged);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -192,6 +193,11 @@ namespace Volian.Controls.Library
|
|||||||
//this.SelectionChanged += new EventHandler(DisplayRTB_SelectionChanged);
|
//this.SelectionChanged += new EventHandler(DisplayRTB_SelectionChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MyConfig_PropertyChanged(object sender, PropertyChangedEventArgs e)
|
||||||
|
{
|
||||||
|
SaveConfig();
|
||||||
|
}
|
||||||
|
|
||||||
private void StepRTB_Click(object sender, EventArgs e)
|
private void StepRTB_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (ReadOnly) return;
|
if (ReadOnly) return;
|
||||||
@ -252,6 +258,8 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
if (ReadOnly) return;
|
if (ReadOnly) return;
|
||||||
if (!_IsDirty) return;
|
if (!_IsDirty) return;
|
||||||
|
if (_IsDirty)
|
||||||
|
{
|
||||||
bool success = _origDisplayText.Save((RichTextBox)this);
|
bool success = _origDisplayText.Save((RichTextBox)this);
|
||||||
if (success)
|
if (success)
|
||||||
{
|
{
|
||||||
@ -259,6 +267,15 @@ namespace Volian.Controls.Library
|
|||||||
ClearUndo();
|
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
|
#endregion
|
||||||
#region AddRtfTextAndStyles
|
#region AddRtfTextAndStyles
|
||||||
private void AddRtfText(DisplayText myDisplayText)
|
private void AddRtfText(DisplayText myDisplayText)
|
||||||
@ -287,6 +304,7 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
private void AddSymbol(string str)
|
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 + @"}";
|
SelectedRtf = @"{\rtf1{\fonttbl{\f0\fcharset0 Arial Unicode MS;}}\f0\fs" + this.Font.SizeInPoints * 2 + " " + /* ConvertUnicodeChar(str) */ str + @"}";
|
||||||
}
|
}
|
||||||
private void AddRtfLink(displayLinkElement myDisplayLinkElement)
|
private void AddRtfLink(displayLinkElement myDisplayLinkElement)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user