BBC BASIC for Windows
IDE and Compiler >> Integrated Development Environment >> Find/Replace
http://bb4w.conforums.com/index.cgi?board=ide&action=display&num=1367475173

Find/Replace
Post by Matt on May 2nd, 2013, 06:12am

Hi Richard,

At the risk of starting a request slot, may I make two small requests if, and when, you decide to upgrade again.

The find/replace is a very useful tool, but it always appears in the same place each time it's opened - right over the text. I have to move it constantly to the right hand side of the screen to see more of what's happening. Is it possible to either have it placed there perminently or even at 'last position'?

Also, could it be possible to have it just scan a highlighted area. If I'm relacing a huge number of items, using the 'replace all' is ideal but will change all in the program rather than just those in, say, just a PROC? I know there are ways around this - copying the section to Notepad and use its find/replace, then copy back, but BB4W's is much easier.

I appreciate you have indicated before that you don't want to change anything unless it's neccessary, so please ignore this if you don't think it so. Thanks for your time and effort.

Matt
Re: Find/Replace
Post by admin on May 2nd, 2013, 08:37am

on May 2nd, 2013, 06:12am, Matt wrote:
Is it possible to either have it placed there perminently or even at 'last position'?

As you would expect, it uses the standard Windows FindText and ReplaceText API functions:

http://msdn.microsoft.com/en-gb/library/windows/desktop/ms646918.aspx
http://msdn.microsoft.com/en-gb/library/windows/desktop/ms646946.aspx

As far as I am aware there is no way to determine where these dialogue boxes are displayed; Windows decides that for itself. Since the functions return a window handle of the dialogue box it would be possible to move it after it is created, but you might well then see it momentarily appear in one location and then move to another, which I think could be disconcerting.

The functions do provide a 'hook' facility which allows you to intercept the initialisation of the dialogue box. It may be that this would enable changing its position without a visible glitch, but that would have to be investigated.

One might like to think that if opening a Find/Replace box at the 'last position' was a generally useful feature, Windows would do it automatically, or at least provide the option!

Quote:
Also, could it be possible to have it just scan a highlighted area.

I guess that would theoretically be possible, but how would one enable that mode of operation? Ideally it would need a checkbox to be added to the Find and Replace dialogue boxes, which again is quite a lot of work because it means providing a custom template rather than using the standard one.

In many years of extensive use of BB4W, including some very large applications, I can't say I've found either of those issues any more than a minor invonvenience. I'm not really motivated to put in the effort to address them, sorry. But I would be interested to know if others feel the same way as you.

Edit: I've just realised there's a major problem with searching only the selected region - Find/Replace uses the selection mechanism to highlight the found string! So as soon as the first occurrence has been found, there is no longer any record of where the selected region previously was! That rules it out, I'm afraid.

Richard.

Re: Find/Replace
Post by Matt on May 2nd, 2013, 4:20pm

Thanks for replying, Richard. Just thought I'd ask.

Matt.
Re: Find/Replace
Post by flamerz on May 2nd, 2013, 5:15pm

if you want to keep the Find window in a specified place you can install some 3rd party tool to do that (like Actual Window Guard).

i dont use it, but i checked with the trial and works.

good luck.
Re: Find/Replace
Post by admin on May 2nd, 2013, 9:44pm

on May 2nd, 2013, 5:15pm, flamerz wrote:
if you want to keep the Find window in a specified place you can install some 3rd party tool to do that (like Actual Window Guard).

That's a good suggestion.

Another idea possibly worth considering is to leave the Replace dialogue open 'continuously' throughout a session. Then you can position it anywhere you want and it should stay there until moved or closed. There's no actual need to open a new Replace dialogue to start a new search.

Richard.