Replace was not replacing the first instance, improved flow and general functionality of Find/Replace

This commit is contained in:
John Jenko 2014-06-30 13:45:22 +00:00
parent c9cdc35ff2
commit 25b536dea5
2 changed files with 88 additions and 79 deletions

View File

@ -93,10 +93,10 @@ namespace Volian.Controls.Library
// //
this.btnReplace.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; this.btnReplace.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnReplace.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.btnReplace.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnReplace.Location = new System.Drawing.Point(267, 183); this.btnReplace.Location = new System.Drawing.Point(200, 149);
this.btnReplace.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.btnReplace.Margin = new System.Windows.Forms.Padding(2);
this.btnReplace.Name = "btnReplace"; this.btnReplace.Name = "btnReplace";
this.btnReplace.Size = new System.Drawing.Size(75, 34); this.btnReplace.Size = new System.Drawing.Size(56, 28);
this.btnReplace.TabIndex = 9; this.btnReplace.TabIndex = 9;
this.btnReplace.Text = "Replace"; this.btnReplace.Text = "Replace";
this.btnReplace.Visible = false; this.btnReplace.Visible = false;
@ -107,10 +107,10 @@ namespace Volian.Controls.Library
this.btnFndRplDone.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; this.btnFndRplDone.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnFndRplDone.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.btnFndRplDone.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnFndRplDone.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.btnFndRplDone.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnFndRplDone.Location = new System.Drawing.Point(491, 183); this.btnFndRplDone.Location = new System.Drawing.Point(368, 149);
this.btnFndRplDone.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.btnFndRplDone.Margin = new System.Windows.Forms.Padding(2);
this.btnFndRplDone.Name = "btnFndRplDone"; this.btnFndRplDone.Name = "btnFndRplDone";
this.btnFndRplDone.Size = new System.Drawing.Size(75, 33); this.btnFndRplDone.Size = new System.Drawing.Size(56, 27);
this.btnFndRplDone.TabIndex = 11; this.btnFndRplDone.TabIndex = 11;
this.btnFndRplDone.Text = "Done"; this.btnFndRplDone.Text = "Done";
this.btnFndRplDone.Click += new System.EventHandler(this.btnFndRplDone_Click); this.btnFndRplDone.Click += new System.EventHandler(this.btnFndRplDone_Click);
@ -119,10 +119,10 @@ namespace Volian.Controls.Library
// //
this.btnFindNext.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; this.btnFindNext.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnFindNext.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.btnFindNext.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnFindNext.Location = new System.Drawing.Point(11, 183); this.btnFindNext.Location = new System.Drawing.Point(8, 149);
this.btnFindNext.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.btnFindNext.Margin = new System.Windows.Forms.Padding(2);
this.btnFindNext.Name = "btnFindNext"; this.btnFindNext.Name = "btnFindNext";
this.btnFindNext.Size = new System.Drawing.Size(75, 33); this.btnFindNext.Size = new System.Drawing.Size(56, 27);
this.btnFindNext.TabIndex = 7; this.btnFindNext.TabIndex = 7;
this.btnFindNext.Text = "Find Next"; this.btnFindNext.Text = "Find Next";
this.btnFindNext.Click += new System.EventHandler(this.btnFindNext_Click); this.btnFindNext.Click += new System.EventHandler(this.btnFindNext_Click);
@ -135,11 +135,11 @@ namespace Volian.Controls.Library
this.cmboReplaceText.DisplayMember = "Text"; this.cmboReplaceText.DisplayMember = "Text";
this.cmboReplaceText.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; this.cmboReplaceText.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
this.cmboReplaceText.FormattingEnabled = true; this.cmboReplaceText.FormattingEnabled = true;
this.cmboReplaceText.Location = new System.Drawing.Point(111, 50); this.cmboReplaceText.Location = new System.Drawing.Point(83, 41);
this.cmboReplaceText.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.cmboReplaceText.Margin = new System.Windows.Forms.Padding(2);
this.cmboReplaceText.MaxDropDownItems = 10; this.cmboReplaceText.MaxDropDownItems = 10;
this.cmboReplaceText.Name = "cmboReplaceText"; this.cmboReplaceText.Name = "cmboReplaceText";
this.cmboReplaceText.Size = new System.Drawing.Size(459, 23); this.cmboReplaceText.Size = new System.Drawing.Size(345, 21);
this.cmboReplaceText.TabIndex = 2; this.cmboReplaceText.TabIndex = 2;
this.cmboReplaceText.Visible = false; this.cmboReplaceText.Visible = false;
this.cmboReplaceText.WatermarkFont = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.cmboReplaceText.WatermarkFont = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
@ -151,13 +151,12 @@ namespace Volian.Controls.Library
// //
// //
// //
this.lblRplTxt.BackgroundStyle.Class = "";
this.lblRplTxt.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; this.lblRplTxt.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.lblRplTxt.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblRplTxt.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblRplTxt.Location = new System.Drawing.Point(5, 49); this.lblRplTxt.Location = new System.Drawing.Point(4, 40);
this.lblRplTxt.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.lblRplTxt.Margin = new System.Windows.Forms.Padding(2);
this.lblRplTxt.Name = "lblRplTxt"; this.lblRplTxt.Name = "lblRplTxt";
this.lblRplTxt.Size = new System.Drawing.Size(105, 28); this.lblRplTxt.Size = new System.Drawing.Size(79, 23);
this.lblRplTxt.TabIndex = 6; this.lblRplTxt.TabIndex = 6;
this.lblRplTxt.Text = "Replace Text:"; this.lblRplTxt.Text = "Replace Text:";
this.lblRplTxt.Visible = false; this.lblRplTxt.Visible = false;
@ -170,11 +169,11 @@ namespace Volian.Controls.Library
this.cmboFindText.DisplayMember = "Text"; this.cmboFindText.DisplayMember = "Text";
this.cmboFindText.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; this.cmboFindText.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
this.cmboFindText.FormattingEnabled = true; this.cmboFindText.FormattingEnabled = true;
this.cmboFindText.Location = new System.Drawing.Point(111, 10); this.cmboFindText.Location = new System.Drawing.Point(83, 8);
this.cmboFindText.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.cmboFindText.Margin = new System.Windows.Forms.Padding(2);
this.cmboFindText.MaxDropDownItems = 10; this.cmboFindText.MaxDropDownItems = 10;
this.cmboFindText.Name = "cmboFindText"; this.cmboFindText.Name = "cmboFindText";
this.cmboFindText.Size = new System.Drawing.Size(459, 23); this.cmboFindText.Size = new System.Drawing.Size(345, 21);
this.cmboFindText.TabIndex = 1; this.cmboFindText.TabIndex = 1;
this.cmboFindText.WatermarkFont = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.cmboFindText.WatermarkFont = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cmboFindText.WatermarkText = "Enter text to find"; this.cmboFindText.WatermarkText = "Enter text to find";
@ -186,13 +185,12 @@ namespace Volian.Controls.Library
// //
// //
// //
this.labelX3.BackgroundStyle.Class = "";
this.labelX3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; this.labelX3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.labelX3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.labelX3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelX3.Location = new System.Drawing.Point(29, 10); this.labelX3.Location = new System.Drawing.Point(22, 8);
this.labelX3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.labelX3.Margin = new System.Windows.Forms.Padding(2);
this.labelX3.Name = "labelX3"; this.labelX3.Name = "labelX3";
this.labelX3.Size = new System.Drawing.Size(75, 26); this.labelX3.Size = new System.Drawing.Size(56, 21);
this.labelX3.TabIndex = 8; this.labelX3.TabIndex = 8;
this.labelX3.Text = "Find Text: "; this.labelX3.Text = "Find Text: ";
// //
@ -200,12 +198,12 @@ namespace Volian.Controls.Library
// //
this.btnRplAll.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; this.btnRplAll.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnRplAll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.btnRplAll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnRplAll.Location = new System.Drawing.Point(348, 183); this.btnRplAll.Location = new System.Drawing.Point(261, 149);
this.btnRplAll.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.btnRplAll.Margin = new System.Windows.Forms.Padding(2);
this.btnRplAll.Name = "btnRplAll"; this.btnRplAll.Name = "btnRplAll";
this.btnRplAll.Size = new System.Drawing.Size(107, 34); this.btnRplAll.Size = new System.Drawing.Size(80, 28);
this.btnRplAll.TabIndex = 10; this.btnRplAll.TabIndex = 10;
this.btnRplAll.Text = "Replace All"; this.btnRplAll.Text = "Replace ...";
this.btnRplAll.Visible = false; this.btnRplAll.Visible = false;
this.btnRplAll.Click += new System.EventHandler(this.btnRplAll_Click); this.btnRplAll.Click += new System.EventHandler(this.btnRplAll_Click);
// //
@ -224,10 +222,10 @@ namespace Volian.Controls.Library
this.panelEx1.Controls.Add(this.cmboReplaceText); this.panelEx1.Controls.Add(this.cmboReplaceText);
this.panelEx1.Controls.Add(this.cmboFindText); this.panelEx1.Controls.Add(this.cmboFindText);
this.panelEx1.Dock = System.Windows.Forms.DockStyle.Top; this.panelEx1.Dock = System.Windows.Forms.DockStyle.Top;
this.panelEx1.Location = new System.Drawing.Point(0, 23); this.panelEx1.Location = new System.Drawing.Point(0, 19);
this.panelEx1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.panelEx1.Margin = new System.Windows.Forms.Padding(2);
this.panelEx1.Name = "panelEx1"; this.panelEx1.Name = "panelEx1";
this.panelEx1.Size = new System.Drawing.Size(583, 153); this.panelEx1.Size = new System.Drawing.Size(437, 124);
this.panelEx1.Style.Alignment = System.Drawing.StringAlignment.Center; this.panelEx1.Style.Alignment = System.Drawing.StringAlignment.Center;
this.panelEx1.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(223)))), ((int)(((byte)(237)))), ((int)(((byte)(254))))); this.panelEx1.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(223)))), ((int)(((byte)(237)))), ((int)(((byte)(254)))));
this.panelEx1.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(142)))), ((int)(((byte)(179)))), ((int)(((byte)(231))))); this.panelEx1.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(142)))), ((int)(((byte)(179)))), ((int)(((byte)(231)))));
@ -241,12 +239,13 @@ namespace Volian.Controls.Library
// //
this.contextMenuBar1.AntiAlias = true; this.contextMenuBar1.AntiAlias = true;
this.contextMenuBar1.DockSide = DevComponents.DotNetBar.eDockSide.Top; this.contextMenuBar1.DockSide = DevComponents.DotNetBar.eDockSide.Top;
this.contextMenuBar1.Font = new System.Drawing.Font("Segoe UI", 9F);
this.contextMenuBar1.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { this.contextMenuBar1.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
this.btnCmFndRpl}); this.btnCmFndRpl});
this.contextMenuBar1.Location = new System.Drawing.Point(153, 84); this.contextMenuBar1.Location = new System.Drawing.Point(115, 68);
this.contextMenuBar1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.contextMenuBar1.Margin = new System.Windows.Forms.Padding(2);
this.contextMenuBar1.Name = "contextMenuBar1"; this.contextMenuBar1.Name = "contextMenuBar1";
this.contextMenuBar1.Size = new System.Drawing.Size(75, 29); this.contextMenuBar1.Size = new System.Drawing.Size(56, 25);
this.contextMenuBar1.Stretch = true; this.contextMenuBar1.Stretch = true;
this.contextMenuBar1.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.contextMenuBar1.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.contextMenuBar1.TabIndex = 13; this.contextMenuBar1.TabIndex = 13;
@ -315,24 +314,26 @@ namespace Volian.Controls.Library
// //
// //
// //
this.galSymbols.BackgroundStyle.Class = "";
this.galSymbols.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; this.galSymbols.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.galSymbols.EnableGalleryPopup = false; this.galSymbols.EnableGalleryPopup = false;
this.galSymbols.MinimumSize = new System.Drawing.Size(150, 200); this.galSymbols.MinimumSize = new System.Drawing.Size(150, 200);
this.galSymbols.Name = "galSymbols"; this.galSymbols.Name = "galSymbols";
this.galSymbols.Text = "galleryContainer1"; this.galSymbols.Text = "galleryContainer1";
// //
//
//
this.galSymbols.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
//
// cbxReverse // cbxReverse
// //
// //
// //
// //
this.cbxReverse.BackgroundStyle.Class = "";
this.cbxReverse.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; this.cbxReverse.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.cbxReverse.Location = new System.Drawing.Point(11, 127); this.cbxReverse.Location = new System.Drawing.Point(8, 103);
this.cbxReverse.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.cbxReverse.Margin = new System.Windows.Forms.Padding(2);
this.cbxReverse.Name = "cbxReverse"; this.cbxReverse.Name = "cbxReverse";
this.cbxReverse.Size = new System.Drawing.Size(137, 23); this.cbxReverse.Size = new System.Drawing.Size(103, 19);
this.cbxReverse.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.cbxReverse.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.cbxReverse.TabIndex = 5; this.cbxReverse.TabIndex = 5;
this.cbxReverse.Text = "Reverse Find"; this.cbxReverse.Text = "Reverse Find";
@ -342,12 +343,11 @@ namespace Volian.Controls.Library
// //
// //
// //
this.cbxWholeWord.BackgroundStyle.Class = "";
this.cbxWholeWord.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; this.cbxWholeWord.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.cbxWholeWord.Location = new System.Drawing.Point(11, 103); this.cbxWholeWord.Location = new System.Drawing.Point(8, 84);
this.cbxWholeWord.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.cbxWholeWord.Margin = new System.Windows.Forms.Padding(2);
this.cbxWholeWord.Name = "cbxWholeWord"; this.cbxWholeWord.Name = "cbxWholeWord";
this.cbxWholeWord.Size = new System.Drawing.Size(125, 27); this.cbxWholeWord.Size = new System.Drawing.Size(94, 22);
this.cbxWholeWord.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.cbxWholeWord.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.cbxWholeWord.TabIndex = 4; this.cbxWholeWord.TabIndex = 4;
this.cbxWholeWord.Text = "Whole Word"; this.cbxWholeWord.Text = "Whole Word";
@ -357,12 +357,11 @@ namespace Volian.Controls.Library
// //
// //
// //
this.cbxCaseSensitive.BackgroundStyle.Class = "";
this.cbxCaseSensitive.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; this.cbxCaseSensitive.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.cbxCaseSensitive.Location = new System.Drawing.Point(11, 84); this.cbxCaseSensitive.Location = new System.Drawing.Point(8, 68);
this.cbxCaseSensitive.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.cbxCaseSensitive.Margin = new System.Windows.Forms.Padding(2);
this.cbxCaseSensitive.Name = "cbxCaseSensitive"; this.cbxCaseSensitive.Name = "cbxCaseSensitive";
this.cbxCaseSensitive.Size = new System.Drawing.Size(137, 23); this.cbxCaseSensitive.Size = new System.Drawing.Size(103, 19);
this.cbxCaseSensitive.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.cbxCaseSensitive.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.cbxCaseSensitive.TabIndex = 3; this.cbxCaseSensitive.TabIndex = 3;
this.cbxCaseSensitive.Text = "Case Sensitive"; this.cbxCaseSensitive.Text = "Case Sensitive";
@ -378,10 +377,10 @@ namespace Volian.Controls.Library
this.comboItem2, this.comboItem2,
this.comboItem3, this.comboItem3,
this.comboItem4}); this.comboItem4});
this.cmbScope.Location = new System.Drawing.Point(315, 103); this.cmbScope.Location = new System.Drawing.Point(236, 84);
this.cmbScope.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.cmbScope.Margin = new System.Windows.Forms.Padding(2);
this.cmbScope.Name = "cmbScope"; this.cmbScope.Name = "cmbScope";
this.cmbScope.Size = new System.Drawing.Size(248, 22); this.cmbScope.Size = new System.Drawing.Size(187, 22);
this.cmbScope.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.cmbScope.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.cmbScope.TabIndex = 6; this.cmbScope.TabIndex = 6;
this.cmbScope.Visible = false; this.cmbScope.Visible = false;
@ -407,13 +406,12 @@ namespace Volian.Controls.Library
// //
// //
// //
this.labelX1.BackgroundStyle.Class = "";
this.labelX1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; this.labelX1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.labelX1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.labelX1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelX1.Location = new System.Drawing.Point(253, 103); this.labelX1.Location = new System.Drawing.Point(190, 84);
this.labelX1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.labelX1.Margin = new System.Windows.Forms.Padding(2);
this.labelX1.Name = "labelX1"; this.labelX1.Name = "labelX1";
this.labelX1.Size = new System.Drawing.Size(56, 23); this.labelX1.Size = new System.Drawing.Size(42, 19);
this.labelX1.TabIndex = 12; this.labelX1.TabIndex = 12;
this.labelX1.Text = "Scope:"; this.labelX1.Text = "Scope:";
this.labelX1.Visible = false; this.labelX1.Visible = false;
@ -423,10 +421,10 @@ namespace Volian.Controls.Library
this.btnBookMrkAll.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; this.btnBookMrkAll.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnBookMrkAll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.btnBookMrkAll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnBookMrkAll.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; this.btnBookMrkAll.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnBookMrkAll.Location = new System.Drawing.Point(133, 183); this.btnBookMrkAll.Location = new System.Drawing.Point(100, 149);
this.btnBookMrkAll.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.btnBookMrkAll.Margin = new System.Windows.Forms.Padding(2);
this.btnBookMrkAll.Name = "btnBookMrkAll"; this.btnBookMrkAll.Name = "btnBookMrkAll";
this.btnBookMrkAll.Size = new System.Drawing.Size(93, 33); this.btnBookMrkAll.Size = new System.Drawing.Size(70, 27);
this.btnBookMrkAll.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.btnBookMrkAll.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnBookMrkAll.TabIndex = 8; this.btnBookMrkAll.TabIndex = 8;
this.btnBookMrkAll.Text = "Bookmark All"; this.btnBookMrkAll.Text = "Bookmark All";
@ -456,11 +454,11 @@ namespace Volian.Controls.Library
this.tabControl1.Controls.Add(this.tabControlPanel2); this.tabControl1.Controls.Add(this.tabControlPanel2);
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Top; this.tabControl1.Dock = System.Windows.Forms.DockStyle.Top;
this.tabControl1.Location = new System.Drawing.Point(0, 0); this.tabControl1.Location = new System.Drawing.Point(0, 0);
this.tabControl1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.tabControl1.Margin = new System.Windows.Forms.Padding(2);
this.tabControl1.Name = "tabControl1"; this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedTabFont = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.tabControl1.SelectedTabFont = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tabControl1.SelectedTabIndex = 0; this.tabControl1.SelectedTabIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(583, 23); this.tabControl1.Size = new System.Drawing.Size(437, 19);
this.tabControl1.Style = DevComponents.DotNetBar.eTabStripStyle.Office2007Document; this.tabControl1.Style = DevComponents.DotNetBar.eTabStripStyle.Office2007Document;
this.tabControl1.TabIndex = 14; this.tabControl1.TabIndex = 14;
this.tabControl1.TabLayoutType = DevComponents.DotNetBar.eTabLayoutType.FixedWithNavigationBox; this.tabControl1.TabLayoutType = DevComponents.DotNetBar.eTabLayoutType.FixedWithNavigationBox;
@ -471,11 +469,11 @@ namespace Volian.Controls.Library
// tabControlPanel1 // tabControlPanel1
// //
this.tabControlPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.tabControlPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControlPanel1.Location = new System.Drawing.Point(0, 24); this.tabControlPanel1.Location = new System.Drawing.Point(0, 22);
this.tabControlPanel1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.tabControlPanel1.Margin = new System.Windows.Forms.Padding(2);
this.tabControlPanel1.Name = "tabControlPanel1"; this.tabControlPanel1.Name = "tabControlPanel1";
this.tabControlPanel1.Padding = new System.Windows.Forms.Padding(1); this.tabControlPanel1.Padding = new System.Windows.Forms.Padding(1);
this.tabControlPanel1.Size = new System.Drawing.Size(583, 0); this.tabControlPanel1.Size = new System.Drawing.Size(437, 0);
this.tabControlPanel1.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(254))))); this.tabControlPanel1.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(254)))));
this.tabControlPanel1.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(157)))), ((int)(((byte)(188)))), ((int)(((byte)(227))))); this.tabControlPanel1.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(157)))), ((int)(((byte)(188)))), ((int)(((byte)(227)))));
this.tabControlPanel1.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; this.tabControlPanel1.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
@ -496,11 +494,11 @@ namespace Volian.Controls.Library
// tabControlPanel2 // tabControlPanel2
// //
this.tabControlPanel2.Dock = System.Windows.Forms.DockStyle.Fill; this.tabControlPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControlPanel2.Location = new System.Drawing.Point(0, 24); this.tabControlPanel2.Location = new System.Drawing.Point(0, 22);
this.tabControlPanel2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.tabControlPanel2.Margin = new System.Windows.Forms.Padding(2);
this.tabControlPanel2.Name = "tabControlPanel2"; this.tabControlPanel2.Name = "tabControlPanel2";
this.tabControlPanel2.Padding = new System.Windows.Forms.Padding(1); this.tabControlPanel2.Padding = new System.Windows.Forms.Padding(1);
this.tabControlPanel2.Size = new System.Drawing.Size(583, 0); this.tabControlPanel2.Size = new System.Drawing.Size(437, 0);
this.tabControlPanel2.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(254))))); this.tabControlPanel2.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(254)))));
this.tabControlPanel2.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(157)))), ((int)(((byte)(188)))), ((int)(((byte)(227))))); this.tabControlPanel2.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(157)))), ((int)(((byte)(188)))), ((int)(((byte)(227)))));
this.tabControlPanel2.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; this.tabControlPanel2.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
@ -521,11 +519,11 @@ namespace Volian.Controls.Library
// FindReplace // FindReplace
// //
this.AcceptButton = this.btnFindNext; this.AcceptButton = this.btnFindNext;
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.GradientInactiveCaption; this.BackColor = System.Drawing.SystemColors.GradientInactiveCaption;
this.CancelButton = this.btnFndRplDone; this.CancelButton = this.btnFndRplDone;
this.ClientSize = new System.Drawing.Size(583, 222); this.ClientSize = new System.Drawing.Size(437, 180);
this.Controls.Add(this.panelEx1); this.Controls.Add(this.panelEx1);
this.Controls.Add(this.tabControl1); this.Controls.Add(this.tabControl1);
this.Controls.Add(this.btnBookMrkAll); this.Controls.Add(this.btnBookMrkAll);
@ -533,10 +531,9 @@ namespace Volian.Controls.Library
this.Controls.Add(this.btnFindNext); this.Controls.Add(this.btnFindNext);
this.Controls.Add(this.btnFndRplDone); this.Controls.Add(this.btnFndRplDone);
this.Controls.Add(this.btnReplace); this.Controls.Add(this.btnReplace);
this.DoubleBuffered = true;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.Margin = new System.Windows.Forms.Padding(2);
this.Name = "FindReplace"; this.Name = "FindReplace";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Find and Replace"; this.Text = "Find and Replace";

View File

@ -14,7 +14,16 @@ namespace Volian.Controls.Library
private bool doingfind = false; private bool doingfind = false;
private bool found = false; private bool found = false;
private bool findingbookmarks = false; private bool findingbookmarks = false;
private bool IsFound
{
get
{
if (!cbxCaseSensitive.Checked)
return MyEditItem.MyStepRTB.SelectedText.ToUpper() == cmboFindText.Text.ToUpper();
else
return MyEditItem.MyStepRTB.SelectedText == cmboFindText.Text;
}
}
//private bool _offsetStartPos = false; //private bool _offsetStartPos = false;
private EditItem _MyEditItem; private EditItem _MyEditItem;
public EditItem MyEditItem public EditItem MyEditItem
@ -116,19 +125,22 @@ namespace Volian.Controls.Library
private void btnReplace_Click(object sender, EventArgs e) private void btnReplace_Click(object sender, EventArgs e)
{ {
if (!IsFound)
btnFindNext_Click(sender, e); btnFindNext_Click(sender, e);
if (found) // found is set in btnFindNext_Click() else
{
MyEditItem.ReplaceText(cmboReplaceText.Text, cmboFindText.Text, cbxCaseSensitive.Checked, cbxWholeWord.Checked, cbxReverse.Checked, false, null); MyEditItem.ReplaceText(cmboReplaceText.Text, cmboFindText.Text, cbxCaseSensitive.Checked, cbxWholeWord.Checked, cbxReverse.Checked, false, null);
found = false;
}
} }
private void btnRplAll_Click(object sender, EventArgs e) private void btnRplAll_Click(object sender, EventArgs e)
{ {
if (!IsFound)
btnFindNext_Click(sender, e); btnFindNext_Click(sender, e);
while (found) // found is set in btnFindNext_Click()
{
if (MyEditItem.ReplaceText(cmboReplaceText.Text, cmboFindText.Text, cbxCaseSensitive.Checked, cbxWholeWord.Checked, cbxReverse.Checked, true, this) == DialogResult.Cancel)
found = false;
else else
{
btnReplace_Click(sender, e);
btnFindNext_Click(sender, e); btnFindNext_Click(sender, e);
} }
} }
@ -136,8 +148,8 @@ namespace Volian.Controls.Library
private void btnBookMrkAll_Click(object sender, EventArgs e) private void btnBookMrkAll_Click(object sender, EventArgs e)
{ {
findingbookmarks = true; findingbookmarks = true;
btnFindNext_Click(sender, e); if (!IsFound) btnFindNext_Click(sender, e);
while (found) // found is set in btnFindNext_Click() while (IsFound) // found is set in btnFindNext_Click()
{ {
MyDisplayBookMarks.AddBookMark(MyEditItem.MyItemInfo); MyDisplayBookMarks.AddBookMark(MyEditItem.MyItemInfo);
btnFindNext_Click(sender, e); btnFindNext_Click(sender, e);