GaryFrost Posted February 20, 2006 Share Posted February 20, 2006 (edited) Put this together real quick, maybe someone will find it usefull.Edit: Added functionality to work with external edit controls (Only tested with notepad)Edit: a DUH on my part, forgot to decrement the occurance counter if string is replacedAdded: TestFind2.au3 example for external edit controlRemoved Attatchments: Submitted for beta UDFs to be added to GuiEdit Management on 2/22/06Garyhttp://www.autoitscript.com/fileman/users/gafrost/GuiCtrlEditFind.JPG Edited February 23, 2006 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
jaenster Posted February 20, 2006 Share Posted February 20, 2006 Sorry that i ask , but this is very simple :S if you wanna make this you spent 5 min time in it and you are done -jaenster Link to comment Share on other sites More sharing options...
GaryFrost Posted February 20, 2006 Author Share Posted February 20, 2006 Sorry that i ask , but this is very simple :S if you wanna make this you spent 5 min time in it and you are done Where is the question in that statement? SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
GaryFrost Posted February 21, 2006 Author Share Posted February 21, 2006 Tightened up the search some, and added a message box if not found Also added status bar for # of replacements made. See 1st post for source and test file SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Valuater Posted February 21, 2006 Share Posted February 21, 2006 that look nice Gary... I will definately use that thanks 8) Link to comment Share on other sites More sharing options...
NegativeNrG Posted February 21, 2006 Share Posted February 21, 2006 oh wow . ill also Use this script. Thanks. [size=20]My File Upload[/size]Register at my site and upload. Link to comment Share on other sites More sharing options...
GaryFrost Posted February 21, 2006 Author Share Posted February 21, 2006 Added functionality to work with external edit controls (Only tested with notepad) Example script updated also, tests autoit gui and notepad edit Enjoy. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Josbe Posted February 21, 2006 Share Posted February 21, 2006 @gafrost: Nice job. I noticed only a weird behavior, sometimes replacing, for example, "test" with "au3", the replace doesn't replace in order (line by line). Anyways, thanks. AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
WFC Posted February 22, 2006 Share Posted February 22, 2006 In _GuiCtrlEditFind.au3 file in the beta examples, the $b_replace parameter in the call is to the right of two optional parameters and is assigned as False. As a result you can never pass it a True to do a replace. I have attached a modified file with $b_replace moved to the 3rd parameter. Please see the lines commented with "***" to see other changes. I added _GUICtrlEditScroll($h_edit, $SB_SCROLLCARET) after both the search and replace functions in order to bring the cursor into view. As a cosmetic thing, I made the Find popup 200 pixels high so that the Close button is not partially chopped off. There is still a bug that I am looking into. When you do a find and replace, it doesn't always go to the next find string. Kind of jumps around and skips a few instances. Suggestions, not bugs: You might consider adding a Wrap/NoWrap box. You won't always want to wrap around and it would also be nice to know when you are done! Suggest putting this function in the GUIEdit.au3 include file. WFCGuiCtrlEditFind.au3 Link to comment Share on other sites More sharing options...
GaryFrost Posted February 22, 2006 Author Share Posted February 22, 2006 (edited) In _GuiCtrlEditFind.au3 file in the beta examples, the $b_replace parameter in the call is to the right of two optional parameters and is assigned as False. As a result you can never pass it a True to do a replace. I have attached a modified file with $b_replace moved to the 3rd parameter. Please see the lines commented with "***" to see other changes. I added _GUICtrlEditScroll($h_edit, $SB_SCROLLCARET) after both the search and replace functions in order to bring the cursor into view. As a cosmetic thing, I made the Find popup 200 pixels high so that the Close button is not partially chopped off. There is still a bug that I am looking into. When you do a find and replace, it doesn't always go to the next find string. Kind of jumps around and skips a few instances.Suggestions, not bugs: You might consider adding a Wrap/NoWrap box. You won't always want to wrap around and it would also be nice to know when you are done! Suggest putting this function in the GUIEdit.au3 include file.WFC 1st your posting a bug report to a scripts and scraps udf, i forgot to upload an updated example script to match the udf2nd there is a bug in the udf, but far as i can tell it's my bugthis should not have been posted in bug reports, but a reply added to that thread.See the thread in scripts and scraps, fixed Edited February 22, 2006 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
GaryFrost Posted February 22, 2006 Author Share Posted February 22, 2006 @gafrost: Nice job. I noticed only a weird behavior, sometimes replacing, for example, "test" with "au3", the replace doesn't replace in order (line by line).Anyways, thanks. Fixed see first post for scriptsa DUH on my part, forgot to decrement the occurance counter if string is replaced SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
jpm Posted February 22, 2006 Share Posted February 22, 2006 wrong bug report merge as suggested by gafrost Link to comment Share on other sites More sharing options...
cppman Posted February 22, 2006 Share Posted February 22, 2006 Great! This is nice... I was wondering if their are any UDF's for searching and replacing a string inside of a file...? Miva OS Project Link to comment Share on other sites More sharing options...
GaryFrost Posted February 22, 2006 Author Share Posted February 22, 2006 Great! This is nice... I was wondering if their are any UDF's for searching and replacing a string inside of a file...? Thanks, I'm still re-fining this one.try http://www.autoitscript.com/forum/index.php?showtopic=21797 SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
WFC Posted February 23, 2006 Share Posted February 23, 2006 1st your posting a bug report to a scripts and scraps udf, i forgot to upload an updated example script to match the udf2nd there is a bug in the udf, but far as i can tell it's my bugthis should not have been posted in bug reports, but a reply added to that thread.See the thread in scripts and scraps, fixedSorry Gary. I got it out of Examples folder and thought it was a part of AutoIt, but I remember now that I got it after asking about something like this and you were the one who pointed me to it. It seems to me that it would be a good UDF to add to the Includes. I added it in my program and left the _GUICtrlEditScroll's I had added to my "fix" file in the script I uploaded because I aways want the highlighted text to appear in the edit window. Now if it is put in the includes I will have to change the function name in my program so I can keep the one I am now using.The replace is indeed fixed. It works fine now. Thanks.\/\/FC Link to comment Share on other sites More sharing options...
GaryFrost Posted February 23, 2006 Author Share Posted February 23, 2006 Sorry Gary. I got it out of Examples folder and thought it was a part of AutoIt, but I remember now that I got it after asking about something like this and you were the one who pointed me to it. It seems to me that it would be a good UDF to add to the Includes. I added it in my program and left the _GUICtrlEditScroll's I had added to my "fix" file in the script I uploaded because I aways want the highlighted text to appear in the edit window. Now if it is put in the includes I will have to change the function name in my program so I can keep the one I am now using.The replace is indeed fixed. It works fine now. Thanks.\/\/FC Removed Attatchments: Submitted for beta UDFs to be added to GuiEdit Management on 2/22/06 (9am)Already had. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
WFC Posted February 23, 2006 Share Posted February 23, 2006 Removed Attatchments: Submitted for beta UDFs to be added to GuiEdit Management on 2/22/06 (9am)Already had.Great! Have you noticed that it sometimes misses a click on search? Click again and it will do it. Try testing with a file larger than the edit. If it finds a string after the part that is displayed, it doesn't scroll to it so that you can see it. I like to see what I have searched for. Any chance of a wrap option? WFC Link to comment Share on other sites More sharing options...
GaryFrost Posted February 23, 2006 Author Share Posted February 23, 2006 (edited) Great! Have you noticed that it sometimes misses a click on search? Click again and it will do it.Should be fixedTry testing with a file larger than the edit. If it finds a string after the part that is displayed, it doesn't scroll to it so that you can see it. I like to see what I have searched for. Auto Scrolls selected text into viewAny chance of a wrap option?If exact match is not turned on it auto wraps, other wise you'll get a message box stating it has reached the end of the document, just hit the find again and it will start from the beginning.Gary Edited February 23, 2006 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now