dragdata[html], clipboarddata[html] question

Jan Schenkel janschenkel at yahoo.com
Thu Jul 24 04:50:01 EDT 2003


--- Ron <rbarber at yhb.att.ne.jp> wrote:
> Hi Jan
> 
> >> The problem is that text dragged or copied from a
> >> fld will not maintain the
> >> textfont property correctly when the fld has the
> >> textfont set by script.
> >> Thus the dragdata[html] [rtf] and
> >> clipboarddata[html] [rtf] do not report
> >> the correct data either.
> >> 
> >> To reproduce this:
> >> set the textfont of fld 1 to "not the default
> font
> >> of the stack"
> >> set the text to mytext
> >> 
> >> Now, select some text and drag it to another fld,
> or
> >> copy and paste it. The
> >> resulting text is in the default font of the
> stack,
> >> not the textfont
> >> reported of the original fld.
> >> 
> >> Now, select all in fld 1. Explicitly set the
> >> textfont from the menu. Then
> >> drag or copy and paste. The textfont is correctly
> >> maintained (and reported
> >> in dragdata and clipboarddata)
> >> 
> 
> > I would say it behaves as expected : the rendering
> > hierarchy of Revolution checks the font settings
> all
> > the way back to the mainStack's textFont, textSize
> and
> > textStyle properties to ultimately decide how text
> > will look.
> > Thus when you set the htmlText of field 1 to the
> > htmlText of field 2, and the textFont setting in
> field
> > 1 is different from the textFont setting of field
> 2 ;
> > it will now be shown with the textFont of field 1,
> > except in those spots where the textFont was set
> at
> > chunk level.
> 
> I am aware of this procedure and use it to my
> advantage when setting the
> htmltext of flds. However, I think it is different
> from what I tried above.
> The textfont of dragged text does not maintain its
> textfont in my test. It
> will maintain its textfont when the text has been
> selected and changed
> explictly, but not when the fld's textfont was set
> by script. Try the test
> above and see what happens.
> 
> Thanks 
> Ron
> 

Hi Ron,

Did you use :
  set the textFont of field "Foobar" to "Arial"
Or did you use :
  set the textFont of char 1 to -1 of field "Foobar" \
      to "Arial"

In the first case, you're merely changing things in
the hierarchy ; in the second case, you're setting the
textFont of a chunk, and thus doing functionally the
same as selecting the entire text and changing the
font via the menu.
The textFont of a chunk is preserved when copying or
dragging. The textFont of the field is not. Sounds
like the way it should behave, though admittedly it
can be a disadvantage.

Jan Schenkel.

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com



More information about the use-livecode mailing list