#100 Add Find and Clear buttons to i-search

closed
nobody
None
5
2014-08-19
2004-02-06
Tony Balinski
No

This patch adds a clear button to the interactive
search bar (labelled "<x") and turns the Find label (to
the right) into a button, activating a new search.
Since this new search uses the same callback as the
return key translation for the i-search text widget,
hold shift and clicking on the Find button will search
in reverse.

A sequence of mail at develop@nedit.org, starting
2003-08-25, discussed this patch - here's the first
message:
--------------
List: nedit-develop
Subject: Mouse usage with the interactive search bar
From: Tony Balinski <ajbj () free ! fr>
Date: 2003-08-25 14:13:44
[Download message RAW]

Much as I like the ISearch bar, I am an inveterate
mouse user, and find that the ISearch could support
mouse use better. In particular:

- I want to paste selected words from the main
window into the search bar, replacing text already there
- I want to invoke a search without having to hit
return

To this end I patched NEdit so that the Find: label
becomes a button which invokes the "activate" action of
the text widget, and I added a clear button (labelled
"<x") to empty the content of the text widget without
disturbing the current selection nor invoking a search.

Now, while perusing a file, I can now select some text,
clear the ISearch text box then paste my selection into
it to find the next occurrence; then find the next etc,
all with the mouse. I find this makes the ISearch much
more usable than before.

I think this could be a useful enhancement for others;
I'll submit a patch soon.

Tony
--------------
The original patch was sent out on that list on
2003-08-25. There was some discussion of button
placement, text and ergonomics. I would like this patch
integrated into the main line code, maybe with minor
modifications, because it has proved very useful to me.

Discussion

  • Tony Balinski
    Tony Balinski
    2004-02-06

    patch for i-search bar buttons

     
  • Tony Balinski
    Tony Balinski
    2004-02-06

    • summary: Add Find and Clear ("<x") buttons="" to="" i-search.="" --=""> Add Find and Clear buttons to i-search
     
  • Uwe Lehnert
    Uwe Lehnert
    2004-03-04

    Logged In: YES
    user_id=794103

    Since several months i'm using this patch (i.e. the original
    one posted to the list) without any problems. It's very handy
    and useful to me and my colleagues using NEdit. IMHO this
    patch should be integrated into CVS main line.

     
  • Tony Balinski
    Tony Balinski
    2004-03-16

    clear button does paste if clicked with MB2

     
    Attachments
  • Tony Balinski
    Tony Balinski
    2004-03-16

    Logged In: YES
    user_id=618141

    Here's a new version which allows the user to use mouse
    button 2 on the clear ("<x") button to clear-then-"paste"
    the current selection into the ISearch text area. Like the
    "Find" button, the clear button will invoke a search on the
    (new) text in a direction influenced by the shift/ctrl
    modifiers pressed when the mouse button is clicked.

     
  • Uwe Lehnert
    Uwe Lehnert
    2004-03-16

    Logged In: YES
    user_id=794103

    Just applied the version 2 of the patch. About top attachment
    of "statsLine" widget: i guess the former "opposite widget"
    attachment to window->statsLineColNo should be
    removed due to top attachment is now set to
    XmATTACH_FORM ?

    @@ -623,10 +640,11 @@
    ...
    XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET, /* */
    XmNtopWidget, window->statsLineColNo,
    + XmNtopAttachment, XmATTACH_FORM,
    ...

     
  • Tony Balinski
    Tony Balinski
    2004-03-16

    Logged In: YES
    user_id=618141

    Hmm: didn't notice that one! Not sure what to do: I'll have
    to check the attachments and see how it all behaves with
    setting/unsetting status bar, i-search bar and tab bar.

    Thanks for pointing it out (eagle-eyed!).

     
  • Tony Balinski
    Tony Balinski
    2004-03-18

    Logged In: YES
    user_id=618141

    Uwe, everyone, I have remade my patch after removing any
    changes in window.c which did not have anything to do with
    the new i-search bar buttons. Hopefully a candidate for
    inclusion in the main source tree?

     
  • Tony Balinski
    Tony Balinski
    2004-03-18

    removed non-relevant window.c changes

     
    Attachments
  • Tony Balinski
    Tony Balinski
    2004-03-30

    uses icons for the new i-search buttons

     
    Attachments
  • Tony Balinski
    Tony Balinski
    2004-03-30

    Logged In: YES
    user_id=618141

    By popular demand (sort of!) a version with little icons.
    The find button is supposed to look like a magnifying glass;
    the clear button like "|<" - hopefully that'll look
    reasonably clear to folks.

    If anyone has better two-tone icons of this size (to stay
    Xm1.2 compatible), let me know.

     
  • Tony Balinski
    Tony Balinski
    2004-04-06

    • status: open --> closed
     
  • Tony Balinski
    Tony Balinski
    2004-04-06

    Logged In: YES
    user_id=618141

    Now that it's been integrated into the standard (dev) source
    for 5.5, I have the pleasure of closing this patch!