Solved

Find/Replace Dialogs

Posted on 2001-09-12
7
202 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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now