Added functionality to the Import Word Content feature (Insert Ribbon in Debug Mode)
This commit is contained in:
parent
c973925790
commit
a0461e9a7a
@ -43,6 +43,18 @@
|
||||
this.ofd = new System.Windows.Forms.OpenFileDialog();
|
||||
this.btnNextIns = new DevComponents.DotNetBar.ButtonX();
|
||||
this.btnNextRpl = new DevComponents.DotNetBar.ButtonX();
|
||||
// C2019-021 New Buttons
|
||||
this.btnReplaceNext = new DevComponents.DotNetBar.ButtonX();
|
||||
this.btnInsertNext = new DevComponents.DotNetBar.ButtonX();
|
||||
this.btnAfter = new DevComponents.DotNetBar.ButtonX();
|
||||
this.btnSect = new DevComponents.DotNetBar.ButtonX();
|
||||
this.btnHigh = new DevComponents.DotNetBar.ButtonX();
|
||||
this.btnSEQ = new DevComponents.DotNetBar.ButtonX();
|
||||
this.btnParentAfter = new DevComponents.DotNetBar.ButtonX();
|
||||
this.btnSplit = new DevComponents.DotNetBar.ButtonX();
|
||||
this.btnPaste = new DevComponents.DotNetBar.ButtonX();
|
||||
this.tbxNumber = new DevComponents.DotNetBar.Controls.TextBoxX();
|
||||
this.labelX4 = new DevComponents.DotNetBar.LabelX();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// txbWordFile
|
||||
@ -117,7 +129,7 @@
|
||||
//
|
||||
this.txbLevel.Border.Class = "TextBoxBorder";
|
||||
this.txbLevel.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square;
|
||||
this.txbLevel.Location = new System.Drawing.Point(353, 58);
|
||||
this.txbLevel.Location = new System.Drawing.Point(301, 58);
|
||||
this.txbLevel.Name = "txbLevel";
|
||||
this.txbLevel.PreventEnterBeep = true;
|
||||
this.txbLevel.ReadOnly = true;
|
||||
@ -130,7 +142,7 @@
|
||||
//
|
||||
//
|
||||
this.labelX3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
|
||||
this.labelX3.Location = new System.Drawing.Point(312, 58);
|
||||
this.labelX3.Location = new System.Drawing.Point(260, 58);
|
||||
this.labelX3.Name = "labelX3";
|
||||
this.labelX3.Size = new System.Drawing.Size(35, 23);
|
||||
this.labelX3.TabIndex = 5;
|
||||
@ -179,7 +191,7 @@
|
||||
//
|
||||
this.btnPrev.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
|
||||
this.btnPrev.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
|
||||
this.btnPrev.Location = new System.Drawing.Point(461, 116);
|
||||
this.btnPrev.Location = new System.Drawing.Point(462, 113);
|
||||
this.btnPrev.Name = "btnPrev";
|
||||
this.btnPrev.Shortcuts.Add(DevComponents.DotNetBar.eShortcut.F11);
|
||||
this.btnPrev.Size = new System.Drawing.Size(84, 23);
|
||||
@ -192,7 +204,7 @@
|
||||
//
|
||||
this.btnNext.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
|
||||
this.btnNext.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
|
||||
this.btnNext.Location = new System.Drawing.Point(461, 145);
|
||||
this.btnNext.Location = new System.Drawing.Point(462, 142);
|
||||
this.btnNext.Name = "btnNext";
|
||||
this.btnNext.Shortcuts.Add(DevComponents.DotNetBar.eShortcut.F12);
|
||||
this.btnNext.Size = new System.Drawing.Size(84, 23);
|
||||
@ -210,33 +222,188 @@
|
||||
//
|
||||
this.btnNextIns.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
|
||||
this.btnNextIns.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
|
||||
this.btnNextIns.Location = new System.Drawing.Point(353, 200);
|
||||
this.btnNextIns.Location = new System.Drawing.Point(319, 3);
|
||||
this.btnNextIns.Name = "btnNextIns";
|
||||
this.btnNextIns.Shortcuts.Add(DevComponents.DotNetBar.eShortcut.F4);
|
||||
this.btnNextIns.Size = new System.Drawing.Size(102, 20);
|
||||
this.btnNextIns.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||
this.btnNextIns.TabIndex = 12;
|
||||
this.btnNextIns.Text = "Insert After (F4)";
|
||||
this.btnNextIns.Click += new System.EventHandler(this.btnNextIns_Click);
|
||||
this.btnNextIns.Visible = false;
|
||||
//this.btnNextIns.Click += new System.EventHandler(this.btnNextIns_Click);
|
||||
//
|
||||
// btnNextRpl
|
||||
//
|
||||
this.btnNextRpl.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
|
||||
this.btnNextRpl.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
|
||||
this.btnNextRpl.Location = new System.Drawing.Point(353, 174);
|
||||
this.btnNextRpl.Location = new System.Drawing.Point(211, 3);
|
||||
this.btnNextRpl.Name = "btnNextRpl";
|
||||
this.btnNextRpl.Shortcuts.Add(DevComponents.DotNetBar.eShortcut.F3);
|
||||
this.btnNextRpl.Size = new System.Drawing.Size(102, 20);
|
||||
this.btnNextRpl.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||
this.btnNextRpl.TabIndex = 13;
|
||||
this.btnNextRpl.Text = "Replace After (F3)";
|
||||
this.btnNextRpl.Click += new System.EventHandler(this.btnNextRpl_Click);
|
||||
this.btnNextRpl.Visible = false;
|
||||
//this.btnNextRpl.Click += new System.EventHandler(this.btnNextRpl_Click);
|
||||
//
|
||||
// btnReplaceNext
|
||||
//
|
||||
this.btnReplaceNext.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
|
||||
this.btnReplaceNext.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
|
||||
this.btnReplaceNext.Location = new System.Drawing.Point(462, 174);
|
||||
this.btnReplaceNext.Name = "btnReplaceNext";
|
||||
this.btnReplaceNext.Shortcuts.Add(DevComponents.DotNetBar.eShortcut.F3);
|
||||
this.btnReplaceNext.Size = new System.Drawing.Size(82, 20);
|
||||
this.btnReplaceNext.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||
this.btnReplaceNext.TabIndex = 15;
|
||||
this.btnReplaceNext.Text = "Replace Next";
|
||||
this.btnReplaceNext.Click += new System.EventHandler(this.btnReplaceNext_Click);
|
||||
//
|
||||
// btnInsertNext
|
||||
//
|
||||
this.btnInsertNext.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
|
||||
this.btnInsertNext.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
|
||||
this.btnInsertNext.Location = new System.Drawing.Point(462, 200);
|
||||
this.btnInsertNext.Name = "btnInsertNext";
|
||||
this.btnInsertNext.Shortcuts.Add(DevComponents.DotNetBar.eShortcut.F4);
|
||||
this.btnInsertNext.Size = new System.Drawing.Size(82, 20);
|
||||
this.btnInsertNext.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||
this.btnInsertNext.TabIndex = 14;
|
||||
this.btnInsertNext.Text = "Insert Next";
|
||||
this.btnInsertNext.Click += new System.EventHandler(this.btnInsertNext_Click);
|
||||
//
|
||||
// btnAfter
|
||||
//
|
||||
this.btnAfter.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
|
||||
this.btnAfter.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
|
||||
this.btnAfter.Location = new System.Drawing.Point(425, 174);
|
||||
this.btnAfter.Name = "btnAfter";
|
||||
this.btnAfter.Shortcuts.Add(DevComponents.DotNetBar.eShortcut.F3);
|
||||
this.btnAfter.Size = new System.Drawing.Size(31, 20);
|
||||
this.btnAfter.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||
this.btnAfter.TabIndex = 17;
|
||||
this.btnAfter.Text = "After";
|
||||
this.btnAfter.Click += new System.EventHandler(this.btnAfter_Click);
|
||||
//
|
||||
// btnSect
|
||||
//
|
||||
this.btnSect.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
|
||||
this.btnSect.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
|
||||
this.btnSect.Location = new System.Drawing.Point(230, 174);
|
||||
this.btnSect.Name = "btnSect";
|
||||
this.btnSect.Shortcuts.Add(DevComponents.DotNetBar.eShortcut.F3);
|
||||
this.btnSect.Size = new System.Drawing.Size(31, 20);
|
||||
this.btnSect.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||
this.btnSect.TabIndex = 18;
|
||||
this.btnSect.Text = "Sect";
|
||||
this.btnSect.Click += new System.EventHandler(this.btnSect_Click);
|
||||
//
|
||||
// btnHigh
|
||||
//
|
||||
this.btnHigh.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
|
||||
this.btnHigh.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
|
||||
this.btnHigh.Location = new System.Drawing.Point(351, 174);
|
||||
this.btnHigh.Name = "btnHigh";
|
||||
this.btnHigh.Shortcuts.Add(DevComponents.DotNetBar.eShortcut.F3);
|
||||
this.btnHigh.Size = new System.Drawing.Size(31, 20);
|
||||
this.btnHigh.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||
this.btnHigh.TabIndex = 19;
|
||||
this.btnHigh.Text = "High";
|
||||
this.btnHigh.Click += new System.EventHandler(this.btnHigh_Click);
|
||||
//
|
||||
// btnSEQ
|
||||
//
|
||||
this.btnSEQ.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
|
||||
this.btnSEQ.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
|
||||
this.btnSEQ.Location = new System.Drawing.Point(388, 174);
|
||||
this.btnSEQ.Name = "btnSEQ";
|
||||
this.btnSEQ.Shortcuts.Add(DevComponents.DotNetBar.eShortcut.F3);
|
||||
this.btnSEQ.Size = new System.Drawing.Size(31, 20);
|
||||
this.btnSEQ.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||
this.btnSEQ.TabIndex = 20;
|
||||
this.btnSEQ.Text = "Seq";
|
||||
this.btnSEQ.Click += new System.EventHandler(this.btnSEQ_Click);
|
||||
//
|
||||
// btnParentAfter
|
||||
//
|
||||
this.btnParentAfter.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
|
||||
this.btnParentAfter.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
|
||||
this.btnParentAfter.Location = new System.Drawing.Point(388, 200);
|
||||
this.btnParentAfter.Name = "btnParentAfter";
|
||||
this.btnParentAfter.Shortcuts.Add(DevComponents.DotNetBar.eShortcut.F3);
|
||||
this.btnParentAfter.Size = new System.Drawing.Size(68, 20);
|
||||
this.btnParentAfter.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||
this.btnParentAfter.TabIndex = 21;
|
||||
this.btnParentAfter.Text = "Parent After";
|
||||
this.btnParentAfter.Click += new System.EventHandler(this.btnParentAfter_Click);
|
||||
//
|
||||
// btnSplit
|
||||
//
|
||||
this.btnSplit.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
|
||||
this.btnSplit.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
|
||||
this.btnSplit.Location = new System.Drawing.Point(351, 200);
|
||||
this.btnSplit.Name = "btnSplit";
|
||||
this.btnSplit.Shortcuts.Add(DevComponents.DotNetBar.eShortcut.F3);
|
||||
this.btnSplit.Size = new System.Drawing.Size(31, 20);
|
||||
this.btnSplit.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||
this.btnSplit.TabIndex = 22;
|
||||
this.btnSplit.Text = "Split";
|
||||
this.btnSplit.Click += new System.EventHandler(this.btnSplit_Click);
|
||||
//
|
||||
// btnPaste
|
||||
//
|
||||
this.btnPaste.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
|
||||
this.btnPaste.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
|
||||
this.btnPaste.Location = new System.Drawing.Point(461, 226);
|
||||
this.btnPaste.Name = "btnPaste";
|
||||
this.btnPaste.Shortcuts.Add(DevComponents.DotNetBar.eShortcut.F3);
|
||||
this.btnPaste.Size = new System.Drawing.Size(83, 20);
|
||||
this.btnPaste.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||
this.btnPaste.TabIndex = 23;
|
||||
this.btnPaste.Text = "Paste";
|
||||
this.btnPaste.Click += new System.EventHandler(this.btnPaste_Click);
|
||||
//
|
||||
// tbxNumber
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
this.tbxNumber.Border.Class = "TextBoxBorder";
|
||||
this.tbxNumber.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square;
|
||||
this.tbxNumber.Location = new System.Drawing.Point(388, 58);
|
||||
this.tbxNumber.Name = "tbxNumber";
|
||||
this.tbxNumber.PreventEnterBeep = true;
|
||||
this.tbxNumber.Size = new System.Drawing.Size(56, 20);
|
||||
this.tbxNumber.TabIndex = 25;
|
||||
//
|
||||
// labelX4
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
this.labelX4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
|
||||
this.labelX4.Location = new System.Drawing.Point(343, 58);
|
||||
this.labelX4.Name = "labelX4";
|
||||
this.labelX4.Size = new System.Drawing.Size(51, 23);
|
||||
this.labelX4.TabIndex = 24;
|
||||
this.labelX4.Text = "Number:";
|
||||
//
|
||||
// frmImportWordContents
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(556, 226);
|
||||
this.ClientSize = new System.Drawing.Size(556, 272);
|
||||
this.Controls.Add(this.tbxNumber);
|
||||
this.Controls.Add(this.labelX4);
|
||||
this.Controls.Add(this.btnPaste);
|
||||
this.Controls.Add(this.btnSplit);
|
||||
this.Controls.Add(this.btnParentAfter);
|
||||
this.Controls.Add(this.btnSEQ);
|
||||
this.Controls.Add(this.btnHigh);
|
||||
this.Controls.Add(this.btnSect);
|
||||
this.Controls.Add(this.btnAfter);
|
||||
this.Controls.Add(this.btnReplaceNext);
|
||||
this.Controls.Add(this.btnInsertNext);
|
||||
this.Controls.Add(this.btnNextRpl);
|
||||
this.Controls.Add(this.btnNextIns);
|
||||
this.Controls.Add(this.btnNext);
|
||||
@ -278,5 +445,16 @@
|
||||
private System.Windows.Forms.OpenFileDialog ofd;
|
||||
private DevComponents.DotNetBar.ButtonX btnNextIns;
|
||||
private DevComponents.DotNetBar.ButtonX btnNextRpl;
|
||||
private DevComponents.DotNetBar.ButtonX btnReplaceNext;
|
||||
private DevComponents.DotNetBar.ButtonX btnInsertNext;
|
||||
private DevComponents.DotNetBar.ButtonX btnAfter;
|
||||
private DevComponents.DotNetBar.ButtonX btnSect;
|
||||
private DevComponents.DotNetBar.ButtonX btnHigh;
|
||||
private DevComponents.DotNetBar.ButtonX btnSEQ;
|
||||
private DevComponents.DotNetBar.ButtonX btnParentAfter;
|
||||
private DevComponents.DotNetBar.ButtonX btnSplit;
|
||||
private DevComponents.DotNetBar.ButtonX btnPaste;
|
||||
private DevComponents.DotNetBar.Controls.TextBoxX tbxNumber;
|
||||
private DevComponents.DotNetBar.LabelX labelX4;
|
||||
}
|
||||
}
|
@ -25,20 +25,20 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
_initializing = true;
|
||||
InitializeComponent();
|
||||
// C2019-021 Allow the Number field to be edited.
|
||||
txbWordFile.Text = Properties.Settings.Default.ImportWordFilePath;
|
||||
disableButtons();
|
||||
_initializing = false;
|
||||
btnOpen.Enabled = (txbWordFile.Text.Length > 0);
|
||||
}
|
||||
|
||||
|
||||
private void disableButtons()
|
||||
{
|
||||
btnOpen.Enabled = false;
|
||||
btnNext.Enabled = false;
|
||||
btnPage.Enabled = false;
|
||||
btnPrev.Enabled = false;
|
||||
}
|
||||
}
|
||||
private void ofd_FileOk(object sender, CancelEventArgs e)
|
||||
{
|
||||
_initializing = true;
|
||||
@ -86,65 +86,65 @@ namespace Volian.Controls.Library
|
||||
Properties.Settings.Default.ImportWordFilePath = txbWordFile.Text;
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
|
||||
private void btnPage_Click(object sender, EventArgs e)
|
||||
{
|
||||
_WordApp.Selection.MoveDown(LBWdUnits.wdScreen, 1, 0);
|
||||
}
|
||||
|
||||
private void btnPrev_Click(object sender, EventArgs e)
|
||||
{
|
||||
_WordApp.Selection.MoveUp(LBWdUnits.wdParagraph, 1, 0);
|
||||
_WordApp.Selection.MoveUp(LBWdUnits.wdParagraph, 1, 1);
|
||||
try
|
||||
{
|
||||
int idx = -1;
|
||||
if (_WordApp.Selection.Text.EndsWith("\t(\r") || _WordApp.Selection.Text.EndsWith("\t___\r"))
|
||||
idx = _WordApp.Selection.Text.LastIndexOf("\t");
|
||||
if (idx > 0)
|
||||
txbWrdText.Text = _WordApp.Selection.Text.Substring(0, idx);
|
||||
// C2019-021 Use generic function CopyWordText
|
||||
CopyWordText();
|
||||
if (txbWrdText.Text.TrimEnd("\r\n\f".ToCharArray()) == "")
|
||||
btnPrev_Click(sender, e);
|
||||
else
|
||||
txbWrdText.Text = _WordApp.Selection.Text;
|
||||
txbWrdText.Text = txbWrdText.Text.Replace('\xA0', ' '); // replace hard space with regular space
|
||||
txbWrdText.Text = txbWrdText.Text.Replace('\x0B', ' '); // replace hard return with regular space
|
||||
txvStyle.Text = _WordApp.Selection.Style.NameLocal;
|
||||
txbLevel.Text = _WordApp.Selection.Style.ListLevelNumber.ToString();
|
||||
Clipboard.SetText(txbWrdText.Text);
|
||||
Clipboard.SetText(txbWrdText.Text);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
|
||||
private void btnNext_Click(object sender, EventArgs e)
|
||||
{
|
||||
_WordApp.Selection.MoveDown(LBWdUnits.wdParagraph, 1, 0);
|
||||
_WordApp.Selection.MoveDown(LBWdUnits.wdParagraph, 1, 1);
|
||||
try
|
||||
{
|
||||
int idx = -1;
|
||||
if (_WordApp.Selection.Text.EndsWith("\t(\r") || _WordApp.Selection.Text.EndsWith("\t___\r"))
|
||||
idx = _WordApp.Selection.Text.LastIndexOf("\t");
|
||||
if (idx > 0)
|
||||
txbWrdText.Text = _WordApp.Selection.Text.Substring(0, idx);
|
||||
// C2019-021 Use Generic CopyWordText
|
||||
CopyWordText();
|
||||
// C2019-021If the word text only contains whitespace skip to next
|
||||
if (txbWrdText.Text.TrimEnd("\f\r\n".ToCharArray()) == "")
|
||||
btnNext_Click(sender, e);
|
||||
else
|
||||
txbWrdText.Text = _WordApp.Selection.Text;
|
||||
txbWrdText.Text = txbWrdText.Text.Replace('\xA0', ' '); // replace hard space with regular space
|
||||
txbWrdText.Text = txbWrdText.Text.Replace('\x0B', ' '); // replace hard return with regular space
|
||||
txbWrdText.Text = txbWrdText.Text.Replace("\t", " "); // replace tabs with 5 regular spaces
|
||||
|
||||
txvStyle.Text = _WordApp.Selection.Style.NameLocal;
|
||||
txbLevel.Text = _WordApp.Selection.Style.ListLevelNumber.ToString();
|
||||
Clipboard.SetText(txbWrdText.Text);
|
||||
Clipboard.SetText(txbWrdText.Text);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
|
||||
// C2019-021 Generic CopyWordText (Copy Text, Style and Number to fields on form)
|
||||
private void CopyWordText()
|
||||
{
|
||||
txvStyle.Text = _WordApp.Selection.Style.NameLocal;
|
||||
txbLevel.Text = _WordApp.Selection.Style.ListLevelNumber.ToString();
|
||||
tbxNumber.Text = _WordApp.Selection.Range.ListFormat.ListString;
|
||||
int idx = -1;
|
||||
if (_WordApp.Selection.Text.EndsWith("\t(\r") || _WordApp.Selection.Text.EndsWith("\t___\r"))
|
||||
idx = _WordApp.Selection.Text.LastIndexOf("\t");
|
||||
if (idx > 0)
|
||||
txbWrdText.Text = _WordApp.Selection.Text.Substring(0, idx);
|
||||
else
|
||||
txbWrdText.Text = _WordApp.Selection.Text;
|
||||
txbWrdText.Text = txbWrdText.Text.Replace('\xA0', ' '); // replace hard space with regular space
|
||||
txbWrdText.Text = txbWrdText.Text.Replace('\x0B', ' '); // replace hard return with regular space
|
||||
// C2019-021 Don't replace tabs
|
||||
//txbWrdText.Text = txbWrdText.Text.Replace("\t", " "); // replace tabs with 5 regular spaces
|
||||
}
|
||||
private void txbWordFile_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
btnOpen.Enabled = !_initializing;
|
||||
}
|
||||
|
||||
private void frmImportWordContents_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
try
|
||||
@ -157,34 +157,172 @@ namespace Volian.Controls.Library
|
||||
// incase user manually closed word
|
||||
}
|
||||
}
|
||||
|
||||
private void btnNextIns_Click(object sender, EventArgs e)
|
||||
//C2019-021 Remove old method.
|
||||
//private void btnNextIns_Click(object sender, EventArgs e)
|
||||
//{
|
||||
// if (MyStepRTB != null)
|
||||
// {
|
||||
// if (MyStepRTB.MyItemInfo.IsSection)
|
||||
// {
|
||||
// MyStepRTB.RtbSendKeys("^{DOWN}"); // <Ctrl><down arrow> - next edit window
|
||||
// MyStepRTB.RtbSendKeys("^+b"); // insert previous
|
||||
// }
|
||||
// else
|
||||
// MyStepRTB.RtbSendKeys("^+i"); // insert next (same type and level)
|
||||
// MyStepRTB.RtbSendKeys("^v"); // clipboard paste
|
||||
// Application.DoEvents();
|
||||
// }
|
||||
// this.Focus(); // set focus back to this form
|
||||
//}
|
||||
//private void btnNextRpl_Click(object sender, EventArgs e)
|
||||
//{
|
||||
// if (MyStepRTB != null)
|
||||
// {
|
||||
// MyStepRTB.RtbSendKeys("^{DOWN}"); // <Ctrl><down arrow> - next edit window
|
||||
// MyStepRTB.RtbSendKeys("^a"); // select all
|
||||
// MyStepRTB.RtbSendKeys("^v"); // clipboard paste
|
||||
// Application.DoEvents();
|
||||
// }
|
||||
// this.Focus(); // set focus back to this form
|
||||
//}
|
||||
// C2019-021 New function to replace the PROMS text with the word text and move to the next paragraph in word.
|
||||
private void btnReplaceNext_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (MyStepRTB != null)
|
||||
{
|
||||
if (MyStepRTB.MyItemInfo.IsSection)
|
||||
if (MyStepRTB.MyItemInfo.IsSection && tbxNumber.Text != "")
|
||||
{
|
||||
MyStepRTB.RtbSendKeys("^{DOWN}"); // <Ctrl><down arrow> - next edit window
|
||||
MyStepRTB.RtbSendKeys("^+b"); // insert previous
|
||||
using (VEPROMS.CSLA.Library.Item ii = MyStepRTB.MyItemInfo.Get())
|
||||
{
|
||||
ii.MyContent.Text = txbWrdText.Text.Trim("\r\n\f".ToCharArray());
|
||||
ii.MyContent.Number = tbxNumber.Text;
|
||||
ii.MyContent.Save();
|
||||
}
|
||||
EditItem ei = MyStepRTB.Parent as EditItem;
|
||||
ei.RefreshTab();
|
||||
}
|
||||
else
|
||||
MyStepRTB.RtbSendKeys("^+i"); // insert next (same type and level)
|
||||
MyStepRTB.RtbSendKeys("^v"); // clipboard paste
|
||||
Application.DoEvents();
|
||||
{
|
||||
MyStepRTB.Text = txbWrdText.Text.Trim("\r\n".ToCharArray());
|
||||
MyStepRTB.Select(MyStepRTB.TextLength, 0);
|
||||
}
|
||||
btnNext_Click(sender, e);
|
||||
}
|
||||
this.Focus(); // set focus back to this form
|
||||
}
|
||||
|
||||
private void btnNextRpl_Click(object sender, EventArgs e)
|
||||
// C2019-021 New function to insert the Word text into PROMS and move to the next paragraph in Word
|
||||
private void btnInsertNext_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (MyStepRTB != null)
|
||||
{
|
||||
MyStepRTB.RtbSendKeys("^{DOWN}"); // <Ctrl><down arrow> - next edit window
|
||||
MyStepRTB.RtbSendKeys("^a"); // select all
|
||||
MyStepRTB.RtbSendKeys("^v"); // clipboard paste
|
||||
Application.DoEvents();
|
||||
MyStepRTB.SelectedText = txbWrdText.Text.Trim("\r\n\f".ToCharArray());
|
||||
MyStepRTB.Select(MyStepRTB.TextLength, 0);
|
||||
btnNext_Click(sender, e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// C2019-021 New Function to create a after node in PROMS
|
||||
private void btnAfter_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (MyStepRTB != null)
|
||||
{
|
||||
EditItem ei = MyStepRTB.Parent as EditItem;
|
||||
if (ei != null)
|
||||
{
|
||||
ei.AddSiblingAfter();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// C2019-021 Add a New Section in PROMS (Default Type = 10000)
|
||||
private void btnSect_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (MyStepRTB != null)
|
||||
{
|
||||
EditItem ei = MyStepRTB.Parent as EditItem;
|
||||
if (ei.MyItemInfo.IsProcedure)
|
||||
{
|
||||
ei.AddChild(VEPROMS.CSLA.Library.E_FromType.Section, 10000);// TODO: Need Type for Procedure Steps
|
||||
return;
|
||||
}
|
||||
while (ei != null && !ei.MyItemInfo.IsSection)
|
||||
if(ei.MyParentEditItem != null)
|
||||
ei = ei.MyParentEditItem;
|
||||
else
|
||||
ei=ei.MyPreviousEditItem;
|
||||
if (ei != null)
|
||||
{
|
||||
ei.AddSiblingAfter();
|
||||
}
|
||||
}
|
||||
}
|
||||
// C201-021 New Function Add a new High level step
|
||||
private void btnHigh_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (MyStepRTB != null)
|
||||
{
|
||||
EditItem ei = MyStepRTB.Parent as EditItem;
|
||||
if (ei.MyItemInfo.IsSection)
|
||||
{
|
||||
ei.AddChild(VEPROMS.CSLA.Library.E_FromType.Step, 20002);
|
||||
return;
|
||||
}
|
||||
while (ei != null && !ei.MyItemInfo.IsHigh)
|
||||
if (ei.MyParentEditItem != null)
|
||||
ei = ei.MyParentEditItem;
|
||||
else
|
||||
ei = ei.MyPreviousEditItem;
|
||||
if (ei != null)
|
||||
{
|
||||
ei.AddSiblingAfter();
|
||||
}
|
||||
}
|
||||
}
|
||||
// C2019-021 New Function Add a new sequential substep
|
||||
private void btnSEQ_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (MyStepRTB != null)
|
||||
{
|
||||
EditItem ei = MyStepRTB.Parent as EditItem;
|
||||
ei.AddChild(VEPROMS.CSLA.Library.E_FromType.Step, 20001);
|
||||
}
|
||||
}
|
||||
// C2019-021 New Function Add a new parent step after
|
||||
private void btnParentAfter_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (MyStepRTB != null)
|
||||
{
|
||||
EditItem ei = MyStepRTB.Parent as EditItem;
|
||||
while (ei.MyPreviousEditItem != null)
|
||||
ei = ei.MyPreviousEditItem;
|
||||
if (ei != null && ei.MyParentEditItem != null)
|
||||
{
|
||||
ei.MyParentEditItem.AddSiblingAfter();
|
||||
}
|
||||
}
|
||||
}
|
||||
// C2019-021 New Function Split the text in the current proms window into two
|
||||
// The text before the selection is kept in the current PROMS window
|
||||
// The selected text is deleted
|
||||
// the text after the selection is cut to the clipboard
|
||||
private void btnSplit_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (MyStepRTB != null)
|
||||
{
|
||||
MyStepRTB.SelectedText = "";
|
||||
MyStepRTB.Select(MyStepRTB.SelectionStart, MyStepRTB.TextLength - MyStepRTB.SelectionStart);
|
||||
Clipboard.SetText(MyStepRTB.SelectedText);
|
||||
MyStepRTB.SelectedText = "";
|
||||
}
|
||||
}
|
||||
// C2019-021 New Function - Performs a paste in the current window
|
||||
private void btnPaste_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (MyStepRTB != null)
|
||||
{
|
||||
MyStepRTB.SelectedText = Clipboard.GetText();
|
||||
}
|
||||
this.Focus(); // set focus back to this form
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -112,12 +112,12 @@
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="ofd.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<metadata name="ofd.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
Loading…
x
Reference in New Issue
Block a user