More improvements for searching

This commit is contained in:
KillzXGaming 2019-07-31 17:25:41 -04:00
parent 01d74e3839
commit d19aa09c32
6 changed files with 36 additions and 11 deletions

View file

@ -297,10 +297,7 @@ namespace FirstPlugin
Formats.Add(typeof(KCL));
Formats.Add(typeof(BFFNT));
Formats.Add(typeof(MSBT));
// Formats.Add(typeof(BFSAR));
Formats.Add(typeof(BARS));
Formats.Add(typeof(GFPAK));
Formats.Add(typeof(NUTEXB));
Formats.Add(typeof(NUT));
@ -309,8 +306,6 @@ namespace FirstPlugin
Formats.Add(typeof(PTCL));
Formats.Add(typeof(EFF));
Formats.Add(typeof(EFCF));
Formats.Add(typeof(NSP));
Formats.Add(typeof(BNSH));
Formats.Add(typeof(BFSHA));
@ -343,7 +338,6 @@ namespace FirstPlugin
Formats.Add(typeof(IGA_PAK));
Formats.Add(typeof(MKAGPDX_Model));
Formats.Add(typeof(GFBMDL));
Formats.Add(typeof(Turbo.Course_MapCamera_bin));
Formats.Add(typeof(SDF));
Formats.Add(typeof(IStorage));
@ -358,22 +352,23 @@ namespace FirstPlugin
Formats.Add(typeof(BFTTF));
Formats.Add(typeof(PACx30XL));
Formats.Add(typeof(BinGzArchive));
// Formats.Add(typeof(MSBP));
Formats.Add(typeof(ZAR));
// Formats.Add(typeof(ZSI));
Formats.Add(typeof(CTXB));
Formats.Add(typeof(G1T));
// Formats.Add(typeof(G1M));
Formats.Add(typeof(BFLYT));
// Formats.Add(typeof(GFA));
//Unfinished wip formats not ready for use
if (Runtime.DEVELOPER_DEBUG_MODE)
{
Formats.Add(typeof(XCI));
Formats.Add(typeof(BFLAN));
Formats.Add(typeof(BFLYT));
Formats.Add(typeof(XLINK));
Formats.Add(typeof(BFSAR));
Formats.Add(typeof(GFA));
Formats.Add(typeof(G1M));
Formats.Add(typeof(ZSI));
Formats.Add(typeof(MSBP));
}

View file

@ -37,11 +37,13 @@
this.stLabel1 = new Toolbox.Library.Forms.STLabel();
this.chkAutoSearch = new Toolbox.Library.Forms.STCheckBox();
this.listViewModeCB = new Toolbox.Library.Forms.STComboBox();
this.lblFoundEntries = new Toolbox.Library.Forms.STLabel();
this.contentContainer.SuspendLayout();
this.SuspendLayout();
//
// contentContainer
//
this.contentContainer.Controls.Add(this.lblFoundEntries);
this.contentContainer.Controls.Add(this.listViewModeCB);
this.contentContainer.Controls.Add(this.chkAutoSearch);
this.contentContainer.Controls.Add(this.stLabel1);
@ -59,6 +61,7 @@
this.contentContainer.Controls.SetChildIndex(this.stLabel1, 0);
this.contentContainer.Controls.SetChildIndex(this.chkAutoSearch, 0);
this.contentContainer.Controls.SetChildIndex(this.listViewModeCB, 0);
this.contentContainer.Controls.SetChildIndex(this.lblFoundEntries, 0);
//
// listViewCustom1
//
@ -157,6 +160,15 @@
this.listViewModeCB.TabIndex = 18;
this.listViewModeCB.SelectedIndexChanged += new System.EventHandler(this.listViewModeCB_SelectedIndexChanged);
//
// lblFoundEntries
//
this.lblFoundEntries.AutoSize = true;
this.lblFoundEntries.Location = new System.Drawing.Point(163, 372);
this.lblFoundEntries.Name = "lblFoundEntries";
this.lblFoundEntries.Size = new System.Drawing.Size(75, 13);
this.lblFoundEntries.TabIndex = 19;
this.lblFoundEntries.Text = "Found Entries:";
//
// SearchNodeForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -164,6 +176,7 @@
this.ClientSize = new System.Drawing.Size(408, 398);
this.Name = "SearchNodeForm";
this.Text = "Search Nodes";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.SearchNodeForm_FormClosed);
this.contentContainer.ResumeLayout(false);
this.contentContainer.PerformLayout();
this.ResumeLayout(false);
@ -181,5 +194,6 @@
private STCheckBox chkAutoSearch;
private STComboBox listViewModeCB;
private System.Windows.Forms.ColumnHeader columnHeader1;
private STLabel lblFoundEntries;
}
}

View file

@ -25,6 +25,7 @@ namespace Toolbox.Library.Forms
InitializeComponent();
treeView = tree;
treeView.HideSelection = false;
listViewCustom1.SmallImageList = TreeViewCustom.imgList;
listViewCustom1.LargeImageList = TreeViewCustom.imgList;
@ -52,8 +53,14 @@ namespace Toolbox.Library.Forms
UpdateSearchResults(searchTB.Text);
}
private int TotalNodeCount;
private void UpdateSearchResults(string text)
{
if (text == string.Empty)
return;
TotalNodeCount = 0;
listViewCustom1.BeginUpdate();
listViewCustom1.Items.Clear();
TreenodeLookup.Clear();
@ -62,6 +69,8 @@ namespace Toolbox.Library.Forms
RecurvsiveTreeNodeSearch(node, text);
listViewCustom1.EndUpdate();
lblFoundEntries.Text = $"Found Entries {TreenodeLookup.Count} of {TotalNodeCount}";
}
private void RecurvsiveTreeNodeSearch(TreeNode parentNode, string text)
@ -84,6 +93,8 @@ namespace Toolbox.Library.Forms
foreach (TreeNode node in parentNode.Nodes)
RecurvsiveTreeNodeSearch(node, text);
}
TotalNodeCount++;
}
private void listViewCustom1_DoubleClick(object sender, EventArgs e)
@ -110,5 +121,10 @@ namespace Toolbox.Library.Forms
private void chkMatchCase_CheckedChanged(object sender, EventArgs e) {
UpdateSearchResults(searchTB.Text);
}
private void SearchNodeForm_FormClosed(object sender, FormClosedEventArgs e)
{
treeView.HideSelection = true;
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 54 KiB