On Monday, July 30, 2001, at 04:10 AM, Pascal Bau wrote:

> Hi list,
>
> I noticed a strange behavior in flds, could somebody help me?
> Here it is: text fld, no scrolling, dontWrap is set to false.
> You have a string, one single full line, no wraped words, then you type
> space chars.
> The string scrolls to the left and dissappears, and if one types a
> return, a weird refreshing occurs, half the string overlaps the 
> other....
>
> Second strange thing: cursor at the end of the single line, I type an
> extra word, it gets wrapped, of course, to the next line; then select
> before that word (after last space char) and insert a return: nothing
> should change, isn't it? But the return  creates an empty line, and I 
> end
> with 3 lines, this only if cursor is set after the space char...
>
> Found that looking for a way to get the number of "displayed lines",
> what's the best way for doing that so far? Any suggestion will be very
> welcome!
> I need to "zoom" in and out a fld with styled text (any style, size,
> font), proportions must stay the same when the fld rect varies, am I
> understandable here?...
>
> Thank you for your feedback and help!
> Could somebody reply to this just to check this msg went through, I got
> no answer to previous attempt. Thanks!
>
> Pascal Bau
>
> PS version 2.4 B4, PowerBook G3, MacOS 9.0.4
>


Pascal,

First of all, thanks to all the users who responded to my request for 
help in trying to get the "displayed line count".  Turns out that the 
following command did the trick witht the help of a few extra lines of 
code:  formattedText

Below is one possible step of getting the information you need 
"displayed lines" Pascal.  You will see that I wrote this to deal with a 
number of fields that were in a group.  I first duplicated the group 
onto another stack.  I then did the work on the duplicated group because 
this will change the contents of the original.  You lose font attributes 
when you use the formattedText.  So, keep your original handy to set the 
attributes again when you are ready.

Hope this helps others who might be interested in this as well.


  --CONVERT THE TEXT IN EACH FIELD OVER TO FORMATTED TEXT
   put the num of flds of group "plan" into nFields
   repeat with y = 1 to nFields
     get the formattedText of fld y of group "plan"
     put it into fld y of group "plan"
   end repeat

   --EXTRA RETURNS ARE PLACED AND NEED TO BE REMOVED
   repeat with y = 1 to nFields
     put the num of lines of fld y into tLines
     repeat with x = 1 to tLines
       put the chartonum of line x of fld y of group "plan" of stack 
"print" into temp
       if temp is empty then delete line x of fld y of group "plan" of 
stack "print"
     end repeat
   end repeat

   --FONT STYLE IS LOST WHEN CONVERTING TEXT ABOVE
   --GO THROUGH EACH LINE AND RESTYLE THE TEXT TO THE ORIGINAL
   repeat with y = 1 to nFields
     put the num of words of fld y of group "plan" of stack "plan 
preview" into nWords
     repeat with x = 1 to nWords
       put the textStyle of word x of fld y of group "plan" of stack 
"plan preview" into tStyle
       put the textSize of word x of fld y of group "plan" of stack "plan 
preview" into tSize
       put the textFont of word x of fld y of group "plan" of stack "plan 
preview" into tFont
       --
       set the textStyle of word x of fld y of group "plan" of stack 
"print" to tStyle
       set the textSize of word x of fld y of group "plan" of stack 
"print" to tSize
       set the textFont of word x of fld y of group "plan" of stack 
"print" to tFont
     end repeat
   end repeat




-Mark Talluto

Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to