Solved

Find/Replace Dialogs

Posted on 2001-09-12
7
206 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
delphi parse string to params 3 176
MS Access from Delphi 31 100
Can Live bindings change TGrid Cell Colour ? 1 61
migrate this code to work on android 1 45
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
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…

734 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