[MonoDevelop] SearchBar patch

Jacob Ilsø Christensen jacobilsoe at gmail.com
Thu Sep 28 13:59:54 EDT 2006


Hi.

On 9/28/06, Rafael Teixeira <monoman at gmail.com> wrote:
> HI, inline
>
> On 9/26/06, Jacob Ilsø Christensen <jacobilsoe at gmail.com> wrote:
> > Hi.
> >
> > > > * Each open document has its own search bar. Do we want this?
> > >
> > > I don't think so. Like in FireFox, the search text and options should be
> > > global, and shouldn't change when you switch documents.
> >
> > I am not quite sure how to do this. The
> > MonoDevelop.SourceEditor.Gui.SourceEditorDisplayBinding class is used
> > as a DisplayBinding for text files. How do I make several instances
> > share the same SearchBar?
>
> Make the searchbar a global dockable panel that appears/hide when the
> active DisplayBinding exposes some searching service (implements some
> interface that does the real search/positioning).

Yes, I also thought about making the DisplayBinding classes implement
some interface. E.g.:

public interface ISearchable
{
  void Find(string stringToFind);
}

I am not sure what you mean about positioning. One could extend the
interface with e.g.:

void ShowSearchWidget(Widget searchWidget)

It would then be the responsibility of the DisplayBinding to decide
where to show the widget.

So hitting Ctrl+F would look at the current DisplayBinding. If it
implements ISearchable. The SearchBar widget will be given as argument
to ShowSearchWidget. Hitting search in the SearchBar would invoke Find
on the DisplayBinding.

But what should happen when changing to another DisplayBinding? Should
the search widget then be removed from the previous DisplayBinding and
added to the one now active?

The reason why I would like the DisplayBinding widget to decide where
the SearchBar should go is that I would like it to appear right at the
bottom of the source code. Like in e.g. Firefox.

What do you think?

> > I could add a static field on the SourceEditorDisplayBinding class but
> > that seems a bit ugly.
>
> As I said above it should be the other way around, so it doesn't have
> to know what the Search UI is.
>
> > Any good ideas?
>
> I hope the above one qualifies as such ...
>
> :)
>
> --
> Rafael "Monoman" Teixeira
> ---------------------------------------
> "The reasonable man adapts himself to the world; the unreasonable one
> persists in trying to adapt the world to himself. Therefore all
> progress depends on the unreasonable man." George Bernard Shaw
>


More information about the Monodevelop-list mailing list