About the Find/Replace dialog

Topics: Developer Forum
Aug 25, 2006 at 2:11 PM
I've implemented a scintilla.net find/replace dialog for MyGeneration, so I may start helping out there. I do have a design question regarding that though. Is there a specific reason a Panel is preferred over a UserControl for the Find-Replace form? I find user controls much easier to work with because of the full design-time support. I would be happy to get something started there since I have a little experience there.
Coordinator
Aug 25, 2006 at 8:18 PM
Er, no, I was speaking generically.

UserControl is perfectly ok

G.
Aug 27, 2006 at 5:29 PM
Great - I'll check in what I've done so far tonight. It still needs a bit of work, but it's functional
Aug 30, 2006 at 11:19 AM
Hi Garrett,

On Aug 22th, I sent you a mail with some suggestions and an implementation for a Find/Replace dialog for scintilla.net. As I didn't get any answer, I guess you never received it. I can resend it if required, you might find some useful piece of code for the implementation commited a few days ago.

The other suggestion was about events handling and the use of OnXXXX() overridable functions in the ScintillaControl class to ease the overloading of handlers (consistent with regular Control class).

Regards,
Michael.
Coordinator
Aug 30, 2006 at 11:46 PM
Sorry-- I did get it, but I've been SWAMPED at work right now...

I'm a PM on a product that is getting awfully close to release... perhaps you've heard of it: ".NET 3.0" (actually, I'm on the CardSpace team, which is part of .NET 3.0).

G


Aug 31, 2006 at 6:05 PM
The Find & Replace dialogs are pretty much done. I unknowingly was trying to write the search functionality that scintilla already provided. Once I got more familiar with the API, this was really a pretty simple task. I am certain there is room for tweaking, but it is fully functional now. I've also integrated the forms into scide if anybody wants to help test.
Aug 31, 2006 at 8:24 PM
No problem. I sent the mails to the address you used to
write to me, but maybe the mails go discarded as spam.

Anyway, I looked at the current implementation and it
looks cleaner than mine. I can resend my code if still
required. I'll test the current code anyway.

Regards,
Michael.
Sep 2, 2006 at 8:26 AM
I tried the find/replace dialogs in the SCide project and have some comments:

1) the ESC key is not bound to the Cancel button, which would be difficult as the button is private in the FindControl class; nevertheless, there should be an easy way to bind it when embedding the control into a form

2) the "Wrap around" is disabled (but you know it, don't you?)

3) does it make sense to keep the "Transform backslash expressions" checkbox in the Find-only control

4) something that always annoy me in find/replace dialog is when the match is behind the dialog and you don't see it; the dialog should replace itself when the match is not visible

I addressed point 1, 2 and 4 in the code I wrote (sometimes with ugly code, though), just ask if you want it.

Nice job, I'll use it :-). Bye.
Michael.
Sep 3, 2006 at 1:35 AM
Thanks for helping me test! I've addressed all of your issues below:

1) the ESC key is not bound to the Cancel button, which would be difficult as the button is private in the FindControl class; nevertheless, there should be an easy way to bind it when embedding the control into a form

- I made the cancel button public and attached it to the form cancelbutton property

2) the "Wrap around" is disabled (but you know it, don't you?)

- I forgot to implement that feature. It should be working now.

3) does it make sense to keep the "Transform backslash expressions" checkbox in the Find-only control

- it makes sense to be able to search for multi-line strings, so I think we should keep it. I use that feature when I want to remove newlines that start with certain expressions, etc.

4) something that always annoy me in find/replace dialog is when the match is behind the dialog and you don't see it; the dialog should replace itself when the match is not visible

- In Scite, the find dialog disappears after you click the find button, and then you can press F3 after that to keep searching. In replace mode it does not move itself out of the way and i doesn't close. I have to agree with you though, I find that annoying as well.
Sep 3, 2006 at 7:47 AM
Like the Cancel button, shouldn't the Find button also be public such that it can be bound to the Enter key (not sure this is required as it seems to work already in the SCide example)?

Michael.
Sep 5, 2006 at 4:48 PM
I made all of the buttons public. thanks again for helping me test.