Re: Replace Selected Text
- From: Brendan Murphy <bmurphy@xxxxxxxxxxxxxxxxxxxxx>
- To: ftcdev@xxxxxxxxxxxxx
- Date: Mon, 10 Nov 2008 11:06:20 -0600
Bob Keeney wrote:
Is there a function anywhere in the arsenal of FTC functions that
allows one to replace the currently selected text? If not, how
would you suggest going about it?
Not specifically yet, but here is the pseudo code to do such a thing.
inhibit updates
get the selection range (save the starting point)
delete the selected text
insert the replacement string
get the current insertion point
reselect the newly inserted text (original starting point to current
insertion point)
set the style attributes
restore updates
perform an update
How sophisticated you get with the setting of the style attributes
can get a little tricky depending on your requirements.
FTC Website:
http://www.truenorthsoftware.com/FormattedTextControl/FormattedTextControl.html
Set List Options (digest and vacation modes): www.freelists.org/list/ftcdev
List Archive: www.freelists.org/archives/ftcdev
Unsubscribe: Send email to ftcdev-request@xxxxxxxxxxxxx with "unsubscribe" in
the subject field.
Other related posts: