Solved

Find/Replace Dialogs

Posted on 2001-09-12
7
205 Views
Last Modified: 2010-04-06
Can anyone help me by providing some code for implementing fully functional find and replace dialogs. By that I mean to use options for up down (especially when using find next), match case match word, replace one string at a time or replace all.

I have found some code that goes a long way towards it but does not implement the options fully, and I am having problems doing so. Not sure of copyright so wont post code here but this is url for code found http://www.elementkjournals.com/ddj/9803/ddj9831.htm

Cheers
Chris

ps please don't answer with code snippets and basics that I have allready ;)
0
Comment
Question by:xpher
  • 4
  • 2
7 Comments
 
LVL 6

Expert Comment

by:edey
ID: 6476743
perhaps you might want to mention, specificaly, which features you're missing yet?

GL
Mike
0
 
LVL 1

Author Comment

by:xpher
ID: 6478061
Hi

This is a quote from the article (url above):

'You can add some embellishments of your own to our example. In the Find dialog, selecting Up as the search direction resets the search to the beginning of the memo's text. Instead, the search could begin from the current cursor position and find the previous occurrence of the search string. Our replace logic assumes the user is going to replace every occurrence of the search string. Clicking our Replace dialog's Find Next button won't advance to the next occurrence unless the current one is replaced. Instead, replacing strings should be optional as the user searches the entire memo.'

Also the option of Match Whole Word only is not working ie if I set this option and search for tab it finds table and selects the letters tab. Find Next will not search up only down.

Hope this is clear.

Regards
Chris
0
 
LVL 4

Expert Comment

by:nestorua
ID: 6621685
HI, xpher,
I wrote some time ago FindDialog component for
as you said "full-functional finding".
To use it with TMemo or TRichedit you need only to link to them (in properties tab).
I can send it to you if you want, but print your E-Mail
address here.
If you'll like it new ReplaceDialog component can be written as well.
Sincerely,
Nestorua.
0
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
LVL 1

Author Comment

by:xpher
ID: 6623615
Hi Nestorua

Thanks I would like to take you up on the offer.
chrisfranks@btinternet.com

Regards
Chris
0
 
LVL 4

Accepted Solution

by:
nestorua earned 200 total points
ID: 6624182
Hi, Chris,
Send you my component TPSIFindDialog.
Place it in the Palette, put TMemo or TRichEdit on the form,
link the TPSIFindDialog with the Memo,
in the OnKeyDown event of the Memo
write the following: TheNameOfTPSIFindDialog.StandardKeyDown(Sender, Key, Shift).
That's all.
Now on the Ctrl+F you can open the FindDialog,
on F3 you can continue the searching.
If you see some errors or kind of wrong behavior,
inform me, please.
Sincerely,
Nestorua.
0
 
LVL 1

Author Comment

by:xpher
ID: 6632353
Hi Nestorua
Got the component (thanks) F3 (find next) does not seem to work. Also as a little aside the idea of minimizing the dialog is a little annoying as it is difficult to restore if want to search something else. But looking at your code is giving me a better understanding which I appreciate.
0
 
LVL 1

Author Comment

by:xpher
ID: 6647509
Hi Nestorua

Tried the new stuff you sent me. Can only get the Find Next to work if I put it in public declaration of your component.

I'm looking at the code to see what is going on and to try a replace aswell. Will be back 2 u as soon as.

Regards
Chris
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question