From 7ae70ffece16f1aca16db078688820e291c95d75 Mon Sep 17 00:00:00 2001 From: Nockiro Date: Sat, 12 Aug 2017 22:15:42 +0200 Subject: [PATCH] + added button to clear results in results tab --- PackedFileSearcher/FrmMain.Designer.cs | 29 ++++++++++++++----- PackedFileSearcher/FrmMain.cs | 14 ++++----- PackedFileSearcher/PackedFileSearcher.csproj | 1 + PackedFileSearcher/Properties/AssemblyInfo.cs | 4 +-- .../Properties/Resources.Designer.cs | 10 +++++++ PackedFileSearcher/Properties/Resources.resx | 7 +++-- 6 files changed, 46 insertions(+), 19 deletions(-) diff --git a/PackedFileSearcher/FrmMain.Designer.cs b/PackedFileSearcher/FrmMain.Designer.cs index 9d52a91..c3eca4f 100644 --- a/PackedFileSearcher/FrmMain.Designer.cs +++ b/PackedFileSearcher/FrmMain.Designer.cs @@ -31,11 +31,11 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmMain)); - System.Windows.Forms.ListViewItem listViewItem5 = new System.Windows.Forms.ListViewItem(new string[] { + System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem(new string[] { "MyGoodZip.zip", "%:\\WholyFolder", "Zip"}, -1); - System.Windows.Forms.ListViewItem listViewItem6 = new System.Windows.Forms.ListViewItem(new string[] { + System.Windows.Forms.ListViewItem listViewItem2 = new System.Windows.Forms.ListViewItem(new string[] { "TestZip2", "%:\\SomeOtherFolder"}, -1); this.toolStrip1 = new System.Windows.Forms.ToolStrip(); @@ -69,6 +69,7 @@ private void InitializeComponent() this.btn_search = new System.Windows.Forms.ToolStripButton(); this.tsm_searchText = new System.Windows.Forms.ToolStripTextBox(); this.btn_settings = new System.Windows.Forms.ToolStripButton(); + this.btn_clearResults = new System.Windows.Forms.ToolStripButton(); this.statusStrip1 = new System.Windows.Forms.StatusStrip(); this.pb_status = new System.Windows.Forms.ToolStripProgressBar(); this.lbl_status = new System.Windows.Forms.ToolStripStatusLabel(); @@ -143,8 +144,8 @@ private void InitializeComponent() this.lbl_caption.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline; this.lbl_caption.LinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192))))); this.lbl_caption.Name = "lbl_caption"; - this.lbl_caption.Size = new System.Drawing.Size(167, 32); - this.lbl_caption.Text = "Nockiro - Packed File Searcher"; + this.lbl_caption.Size = new System.Drawing.Size(191, 32); + this.lbl_caption.Text = "Nockiro - Packed File Searcher v1.1"; this.lbl_caption.Click += new System.EventHandler(this.lbl_caption_Click); // // toolStripSeparator2 @@ -192,6 +193,7 @@ private void InitializeComponent() this.tabControl.SelectedIndex = 0; this.tabControl.Size = new System.Drawing.Size(1388, 479); this.tabControl.TabIndex = 1; + this.tabControl.SelectedIndexChanged += new System.EventHandler(this.tabControl_SelectedIndexChanged); // // tb_intro // @@ -262,8 +264,8 @@ private void InitializeComponent() this.lv_files.Dock = System.Windows.Forms.DockStyle.Fill; this.lv_files.FullRowSelect = true; this.lv_files.Items.AddRange(new System.Windows.Forms.ListViewItem[] { - listViewItem5, - listViewItem6}); + listViewItem1, + listViewItem2}); this.lv_files.Location = new System.Drawing.Point(3, 3); this.lv_files.Name = "lv_files"; this.lv_files.ShowGroups = false; @@ -351,7 +353,8 @@ private void InitializeComponent() this.toolStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.btn_search, this.tsm_searchText, - this.btn_settings}); + this.btn_settings, + this.btn_clearResults}); this.toolStrip2.Location = new System.Drawing.Point(0, 35); this.toolStrip2.Name = "toolStrip2"; this.toolStrip2.Padding = new System.Windows.Forms.Padding(5, 0, 3, 0); @@ -398,6 +401,17 @@ private void InitializeComponent() this.btn_settings.Text = "Settings"; this.btn_settings.Click += new System.EventHandler(this.btn_settings_Click); // + // btn_clearResults + // + this.btn_clearResults.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; + this.btn_clearResults.Image = global::PackedFileSearcher.Properties.Resources.clear; + this.btn_clearResults.ImageTransparentColor = System.Drawing.Color.Magenta; + this.btn_clearResults.Margin = new System.Windows.Forms.Padding(0, 1, 4, 2); + this.btn_clearResults.Name = "btn_clearResults"; + this.btn_clearResults.Size = new System.Drawing.Size(91, 22); + this.btn_clearResults.Text = "Clear results"; + this.btn_clearResults.Click += new System.EventHandler(this.btn_clearResults_Click); + // // statusStrip1 // this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -515,6 +529,7 @@ private void InitializeComponent() private ToolStripButton btn_deletefile; private ToolStripButton btn_removeFiles; private ToolStripButton btn_settings; + private ToolStripButton btn_clearResults; } } diff --git a/PackedFileSearcher/FrmMain.cs b/PackedFileSearcher/FrmMain.cs index ff53c8b..1d5ee60 100644 --- a/PackedFileSearcher/FrmMain.cs +++ b/PackedFileSearcher/FrmMain.cs @@ -283,6 +283,8 @@ private void btn_abort_Click(object sender, EventArgs e) } } } + + private void btn_clearResults_Click(object sender, EventArgs e) => lv_results.Items.Clear(); #endregion #endregion @@ -316,15 +318,11 @@ private void tsm_searchText_Leave(object sender, EventArgs e) } #endregion - private void lv_results_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e) - { - btn_copyPath.Enabled = btn_extract.Enabled = btn_deletefile.Enabled = e.IsSelected; - } + private void lv_results_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e) => btn_copyPath.Enabled = btn_extract.Enabled = btn_deletefile.Enabled = e.IsSelected; - private void lv_results_Leave(object sender, EventArgs e) - { - btn_copyPath.Enabled = btn_extract.Enabled = btn_deletefile.Enabled = false; - } + private void lv_results_Leave(object sender, EventArgs e) => btn_copyPath.Enabled = btn_extract.Enabled = btn_deletefile.Enabled = false; + + private void tabControl_SelectedIndexChanged(object sender, EventArgs e) => btn_clearResults.Enabled = tabControl.SelectedIndex == 2; #endregion #region other listview events (double click, ..) diff --git a/PackedFileSearcher/PackedFileSearcher.csproj b/PackedFileSearcher/PackedFileSearcher.csproj index 30dd2c6..4458b95 100644 --- a/PackedFileSearcher/PackedFileSearcher.csproj +++ b/PackedFileSearcher/PackedFileSearcher.csproj @@ -136,6 +136,7 @@ + diff --git a/PackedFileSearcher/Properties/AssemblyInfo.cs b/PackedFileSearcher/Properties/AssemblyInfo.cs index da081ff..e7ead4b 100644 --- a/PackedFileSearcher/Properties/AssemblyInfo.cs +++ b/PackedFileSearcher/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.2.0")] -[assembly: AssemblyFileVersion("1.0.2.0")] +[assembly: AssemblyVersion("1.1.0.0")] +[assembly: AssemblyFileVersion("1.1.0.0")] diff --git a/PackedFileSearcher/Properties/Resources.Designer.cs b/PackedFileSearcher/Properties/Resources.Designer.cs index f28d5c2..27fe99d 100644 --- a/PackedFileSearcher/Properties/Resources.Designer.cs +++ b/PackedFileSearcher/Properties/Resources.Designer.cs @@ -80,6 +80,16 @@ internal static System.Drawing.Bitmap addfolder { } } + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap clear { + get { + object obj = ResourceManager.GetObject("clear", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. /// diff --git a/PackedFileSearcher/Properties/Resources.resx b/PackedFileSearcher/Properties/Resources.resx index d5c2511..e2df376 100644 --- a/PackedFileSearcher/Properties/Resources.resx +++ b/PackedFileSearcher/Properties/Resources.resx @@ -121,6 +121,9 @@ ..\ico\minus_2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\ico\settings_verysmall.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\ico\addfile.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -157,7 +160,7 @@ ..\ico\minus.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\ico\settings_verysmall.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\ico\clear.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file