Solved

Find/Replace Dialogs

Posted on 2001-09-12
7
207 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
Industry Leaders: 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

718 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