realbasic-nug
[Top] [All Lists]

Re: object=object

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: object=object
From: Charles Yeomans <yeomans at desuetude dot com>
Date: Mon, 28 Feb 2005 18:05:02 -0500
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <20050228223500 dot 08C9E769E36 at lists dot realsoftware dot com>

On Feb 28, 2005, at 5:34 PM, Joseph Claeys wrote:

"For Mac builds, it would be EditField2.SetTextAndStyle EditField1.Text,
EditField1.TextStyleData." Charles Yeomans

So Win doesn't have that option?

Here is where I'm falling down:

I have a function that takes an editfield (or a string it's overloaded), a tag, and a dictionary. So it used to look like this and work just fine:

s=jp.TagReplace(s,"<<(.*)>>",FieldValues)

S is a textstring that is obtained from a text document and that might look
like this "<<firstname>> is a student at <<schoolname>> that began
<<grade>>" etc.  The dictionary has fields and values.  After running
through my TagReplace Function I get back a real nice string that has all
the values inserted ::pats himself on the back::

Now I'm passing an editfield... The original idea was that wouldn't have to deal with all that styled nonsense directly. The editfield is getting the same kind of string but from an rtf. Anyway it seems that I can only get back either the text or the style data unless I run it through the function
twice (or return an ADT that has a couple of properties).  So now I'm
staring at this:

StyleField.text=jp.TagReplace(StyleField,"<<(.*)>>",FieldValues).text

And wondering how to proceed... I don't see a single method that will give
me the style and the text in one fell swoop (I would have thought that
something called styledtext would do this - but no joy on that count).

Could someone set me straight?  I think I'm missing something really
fundamental because this seems doable without all the code gymnastics that I
keep seeing as possible solutions.


Don't replace the entire text of the EditField. Instead, use EditField.SelText to replace only the text that requires replacing. See <http://www.quantum-meruit.com/rb/Articles/ HowDoI.html#editFieldReplace>.

Charles Yeomans

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>