This commit is contained in:
2011-03-29 17:30:09 +00:00
parent 7f22d62f00
commit 0d79abd34d
4 changed files with 95 additions and 69 deletions

View File

@@ -577,13 +577,15 @@ namespace Volian.Controls.Library
int sl = MyStepRTB.SelectionLength;
MyFlexGrid.StartEditing();
MyStepRTB.Select(ss, sl); // need to reset selection because startediting positions to end.
if (!MyStepRTB.ReadOnly)
if (MyStepRTB.ReadOnly)
{
string oldRtf = MyStepRTB.Rtf;
DialogResult dr = MyStepRTB.ReplaceText(rpltxt, fndstr, caseSensitive, matchWholeWord, reverse, prompt, fndrpldlg);
if (oldRtf != MyStepRTB.Rtf) MyFlexGrid[r, c] = MyStepRTB.Rtf;
if (dr == DialogResult.Yes || dr == DialogResult.Cancel) return dr;
MessageBox.Show("Cannot replace linked text!", "Find/Replace", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
return DialogResult.Yes;
}
string oldRtf = MyStepRTB.Rtf;
DialogResult dr = MyStepRTB.ReplaceText(rpltxt, fndstr, caseSensitive, matchWholeWord, reverse, prompt, fndrpldlg);
if (oldRtf != MyStepRTB.Rtf) MyFlexGrid[r, c] = MyStepRTB.Rtf;
if (dr == DialogResult.Yes || dr == DialogResult.Cancel) return dr;
}
c = c + 1;
if (c == w)
@@ -609,13 +611,15 @@ namespace Volian.Controls.Library
int sl = MyStepRTB.SelectionLength;
MyFlexGrid.StartEditing();
MyStepRTB.Select(ss, sl);
if (!MyStepRTB.ReadOnly)
if (MyStepRTB.ReadOnly)
{
string oldRtf = MyStepRTB.Rtf;
DialogResult dr = MyStepRTB.ReplaceText(rpltxt, fndstr, caseSensitive, matchWholeWord, reverse, prompt, fndrpldlg);
if (oldRtf != MyStepRTB.Rtf) MyFlexGrid[r, c] = MyStepRTB.Rtf;
if (dr == DialogResult.Yes || dr == DialogResult.Cancel) return dr;
MessageBox.Show("Cannot replace linked text!", "Find/Replace", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
return DialogResult.Yes;
}
string oldRtf = MyStepRTB.Rtf;
DialogResult dr = MyStepRTB.ReplaceText(rpltxt, fndstr, caseSensitive, matchWholeWord, reverse, prompt, fndrpldlg);
if (oldRtf != MyStepRTB.Rtf) MyFlexGrid[r, c] = MyStepRTB.Rtf;
if (dr == DialogResult.Yes || dr == DialogResult.Cancel) return dr;
}
c = c - 1;
if (c < 0)
@@ -636,6 +640,8 @@ namespace Volian.Controls.Library
}
public override bool FindText(string str, bool caseSensitive, bool matchWholeWord, bool reverse)
{
if (MyFlexGrid.Row < 0) MyFlexGrid.Row = (reverse) ? MyFlexGrid.Rows.Count - 1 : 0;
if (MyFlexGrid.Col < 0) MyFlexGrid.Col = (reverse) ? MyFlexGrid.Cols.Count - 1 : 0;
int r = MyFlexGrid.Row;
int c = MyFlexGrid.Col;
if (!reverse)