Browse Source

remove search combobox from toolbar

pull/23/head
Siegfried Pammer 15 years ago
parent
commit
5c316b3a51
  1. 69
      src/AddIns/Misc/SearchAndReplace/Project/Commands/SearchToolbarCommands.cs
  2. 5
      src/AddIns/Misc/SearchAndReplace/Project/SearchAndReplace.addin
  3. 1
      src/AddIns/Misc/SearchAndReplace/Project/SearchAndReplace.csproj

69
src/AddIns/Misc/SearchAndReplace/Project/Commands/SearchToolbarCommands.cs

@ -1,69 +0,0 @@ @@ -1,69 +0,0 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Windows.Controls;
using ICSharpCode.Core;
using System.Windows.Input;
namespace SearchAndReplace
{
/// <summary>
/// Description of SearchToolbarCommands.
/// </summary>
public class FindComboBox : AbstractComboBoxCommand
{
ComboBox comboBox;
public FindComboBox()
{
}
void RefreshComboBox()
{
comboBox.Items.Clear();
foreach (string findItem in SearchOptions.FindPatterns) {
comboBox.Items.Add(findItem);
}
comboBox.Text = SearchOptions.FindPattern;
}
void OnKeyPress(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter) {
e.Handled = true;
CommitSearch();
}
}
void CommitSearch()
{
if (comboBox.Text.Length > 0) {
LoggingService.Debug("FindComboBox.CommitSearch()");
SearchOptions.DocumentIteratorType = DocumentIteratorType.CurrentDocument;
SearchOptions.FindPattern = comboBox.Text;
SearchReplaceManager.FindNext(null);
comboBox.Focus();
}
}
void SearchOptionsChanged(object sender, PropertyChangedEventArgs e)
{
if (e.Key == "FindPatterns") {
RefreshComboBox();
}
}
protected override void OnOwnerChanged(EventArgs e)
{
base.OnOwnerChanged(e);
comboBox = (ComboBox)base.ComboBox;
comboBox.IsEditable = true;
comboBox.KeyDown += OnKeyPress;
comboBox.Width = 130;
SearchOptions.Properties.PropertyChanged += new PropertyChangedEventHandler(SearchOptionsChanged);
RefreshComboBox();
}
}
}

5
src/AddIns/Misc/SearchAndReplace/Project/SearchAndReplace.addin

@ -56,11 +56,6 @@ @@ -56,11 +56,6 @@
icon = "Icons.16x16.FindIcon"
tooltip = "${res:MainWindow.Windows.ClassBrowser.CommitSearch.ToolTip}"
class = "SearchAndReplace.Find"/>
<ToolbarItem id = "FindComboBox"
type = "ComboBox"
tooltip = "${res:MainWindow.Windows.ClassBrowser.CommitSearch.ToolTip}"
class = "SearchAndReplace.FindComboBox"/>
</Path>
<!-- File extensions that should not be searched since they are not opened

1
src/AddIns/Misc/SearchAndReplace/Project/SearchAndReplace.csproj

@ -68,7 +68,6 @@ @@ -68,7 +68,6 @@
<Link>Configuration\GlobalAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Commands\SearchMainMenuCommands.cs" />
<Compile Include="Commands\SearchToolbarCommands.cs" />
<Compile Include="Configuration\AssemblyInfo.cs" />
<Compile Include="Engine\DocumentIterator\AllOpenDocumentIterator.cs" />
<Compile Include="Engine\DocumentIterator\CurrentDocumentIterator.cs" />

Loading…
Cancel
Save