After doing the standard due-dilligence (searching the archives and lists) I
cannot find any clear/current info on this one...
I am trying to use the StyledText object to store the formatting contained in
an EditField. I have tried a number of ways to remedy this, but I cannot
figure out why it wants to fight with me... I have a duplicate method that
will allocate a new StyledText object, then copy all of the StyleRuns from the
source object. It then steps through and copies all of the paragraph
alignments. However, if I set an editfield's styledtext property to my new
object, I get all the stylings, but I lose the alignment settings. Actually
worse, I don't lose them, it just makes everything the same as the last
alignment setting.
I have put debugging strings in to watch the alignments and start/length
properties of the get set and indeed it makes all of them the same as the last
setting.
Now for the kicker... If I create a slightly different version of the clone
routine that takes a source and target editfield, my same code (with the
prepended 'editfield.') doing the same functions as described above, works like
a champ.
So what's up with that? Why if a StyledText is hitched to an editfield does it
work, yet if I create a brand new styledtext object and set it up the same
exact way, do I lose the alignment functionality? Perhaps someone knows? This
is just annoying as even if I read from the editfield to write out the
style/alignment info (to XML using one of the public routines out there), I
won't be able to really read it back into a nice tight object, but rather have
to reparse the XML everytime I want to render it into an editfield (and
conversely, rebuild the XML everytime I want to store the contents of an
editfield). Isn't that what the StyledText object is supposed to do?
Any deeper insights into this craziness would be very appreciated so I may take
appropriate action in handling this... Thanks in advance.
_______________________________________________
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>
|