| Hyderabad Jobs | Book Website | ![]() |
I Love Hyderabad | Hyderabad Colleges |
| Home | Business Emails | Hyderabad Classifieds | Contact Us | |
| 7 Wonders of Hyderabad | Web Hosting | Yellow Pages | Our Network | |
Mastering PowerBuilder
Editing Document In RTE ControlLike any other editable control such as Multiline Edit control, RTE has a lot of editable functions such as Cut(), Copy(), Clear(), Paste(). You can call SelectAll() to select all the content of the RTE control. Similarly Undo() function also. If you enable the popup menu for the RTE control, all these options will display on the popup menu and PowerBuilder will automatically execute the appropriate operation. However, if you do not want to show the popup menu and want to control through script then you can use the above functions. You can also search the RTE control using Find() and continue searching by calling FindNext(). Using these functions you can search in different directions i.e., forward/backward/all. You can make the search to find whole words only. You can also make the search case sensitive. These two functions Find() and FindNext() are not available on the RTE control popup menu. However FindAndReplace() function is missing for the RTE control. If you wish to provide this functionality to the user you need to write the code. The code you need to write is not that complex and you can even take the code from the example application. The following code finds and replaces all those that match the specified string. This code is taken from the Clicked event of the cb_ReplaceAll CommandButton on the w_rte_replace window. You can find this window in the pbexamw3.pbl library.
The above code is replacing all the occurrences of the specified string. Even though the code is so long the logic is very simple. The above code is calling Find() for the first time and calling FindNext() in a loop. As you might have seen in any word processor, when your search matches a string the matched string is selected and highlighted. Then calling ReplaceText() will replace that selected (highlighted) text.
|
| Copyright © 1996 - 2006 HamaraShehar.com Pvt. Ltd. All Rights Reserved.
Domain Registration, Website Design, Website Hosting by HamaraShehar.com |