anilgkts / arduino

Automatically exported from code.google.com/p/arduino
Other
0 stars 0 forks source link

Find Previous and FindReplace dialog cleanup #825

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
As per processing issue 580 
<http://code.google.com/p/processing/issues/detail?id=580> which I also 
provided a patch for and which has been incorporated into processing since 
April 2011.

Find Previous is a commonly used command on Mac OS X

Attached is a diff that implements Find Previous, as well as cleaning up the 
Find dialog and adding the Wrap Around checkbox.

Please note that I am unfamiliar with the behaviour of Find dialogs on other 
platforms, so currently it implements it as it is typically implemented on Mac 
OS X (specifically modelled after textEdit).

Some issues which might need adjusting for other platforms:

* I have left the button ordered reversed (as the code previously did for 
Mac/non-Mac), but the position of the Previous button might nee adjustment.
* The EDGE (previously "BIG") and BUTTONGAP constants may need adjusting
* The semantics of replace are "replace the selection with the contents of the 
replace field", and so whether the search had been previously successful is 
irrelevant.  Clicking Replace three times will simply insert the replace text 
three times in a row.
* If a Find or Replace & Find, or Find Previous, or Replace All fails to find 
anything, then it beeps.  Replace All that finds at least one thing will not 
beep.

If there are adjustments to any of these that need to be different on other 
platforms, they could either be made after applying the patch, or if you let me 
know the exact behaviour differences, I am happy to implement them and resubmit 
a patch.

Note that this patch affects quite a substantial portion of FindReplace.java 
(especially because of the dialog creation cleanup), so it would be good to 
apply it before any other work on the file if possible, otherwise conflicts are 
likely to arise.

Original issue reported on code.google.com by pe...@stairways.com.au on 21 Feb 2012 at 5:10

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by dmel...@gmail.com on 22 Feb 2012 at 12:22

GoogleCodeExporter commented 9 years ago
https://github.com/arduino/Arduino/commit/0db8bdbbb09108dfabca5cfcf8353dba84fcc7
d6

Thank you for this!  Sorry it took so long to get incorporated.  

Original comment by dmel...@gmail.com on 2 Mar 2012 at 10:58