A set of six patches is attached which address Feature 1661. Specifically, the changes requested are implemented in patches #31 and #29 part (1), as described below. #16 implements an additional minor improvement, and #30 simply turns off the useless "gripper" that appears in the dialog. (This could also be used to remove the gripper in the toolbar.)
The other patches (15, 28, and the rest of 29) are merely cleanup. All patches are against the distributed Notepad++ 6.6.9 sources, and they should apply in sequence.
#15: simple whitespace patch for consistency within the file
#16: this un-checks the Highlight checkbox when the IncrFind dialog is hidden, because closing also un-highlights everything and having the box checked the next time you open it means you have to click it twice to do anything useful with it.
#28: replaces explicit calls to Win32's ::SetFocus with calls to the object's getFocus() method; replaces explicit call to SendMessage(NPPM_DMMSHOW, ...) with a call to the object's display() method; and cleans up some cruft.
#29: (1) Adds accelerator indicators to the checkboxes in the IncrFind dialog, so they can be triggered from the keyboard. (2) Substantially overhauls the WM_COMMAND processing for clarity: instead of four instances of FindOption and four calls to processFindNext(), there is only one, with the differences handled using flags. (3) removes the WM_MOVE handling, which does not appear to be needed for correct operation.
#30: Tweaks ToolBar to allow a user to not have a gripper in the rebar band; and turns off the gripper on the band containing IncrFind.
#31: Adds code to create a special accelerator table for the IncrFind dialog, which copies the accelerators from the main menu's Find Next, Find Previous, and Incremental Search menu items, and adds message-processing code to ensure the table gets used.
So: When the focus is on the IncrFind dialog, whatever accelerators are mapped to those functions in the main window perform the equivalent Incremental Search function:
- Find Next (e.g. F3) will repeat the incremental search forward
- Find Prev (e.g. Shift+F3) will repeat the incremental search backward
- Incremental Search (e.g. Ctrl+Alt+I) will return the focus to the search-text field if it has been moved to a checkbox or pushbutton in the dialog; if the focus is already on the search-text field, then it will repeat the incremental search forward.
Enter and Shift+Enter still work to repeat the search forward and backward.
Note that I don't use the default shortcuts for those functions; instead, I have
- Incremental Search = Ctrl+F
- Find Next = Ctrl+]
- Find Prev = Ctrl+[
Nice job. Incremental search works much better with your patches.
Committed in SVN
Not all patches are accepted, but the main feature is there.
Thank you for your patch.
Don