[futurebasic] Carriage Returns in Edit Field

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 2002 : Group Archive : Group : All Groups

From: Robert Covington <artlythere@...>
Date: Fri, 13 Dec 2002 03:56:50 -0400
My type tool in Compositor only allows for one line (255 characters max) of
text right now, and I need to upgrade this because the polar bears in
Greenland need to enter more penguin and seal dingbat characters.

The problem for me, since I anti-alias it all to a final mask GWorld, is
that I will need to know ahead of time after the Apply Text button is
clicked how many separate lines of text were entered in the edit field, so
I can calculate the size of the needed destination world, along with each
line at a time to render it. I use USR FONTHeight or whatever it is, and
this works ok for my calcs, other than for clipping some Helvetica
characters on occasion at small sizes.

Now, is the proper method for adding carriage returns to add the return
character upon _efReturn event? Or is the trick simply to use a _framed
type edit field?  The current one I have is _framedNoCR

How then would I parse the edit field contents to get the total number of
lines/linefeeds/Carriage returns?

I guess my question is how do I get each individual single line from the
edit field, and also count the total number of lines in the field
(including empties, those between non-empty lines)

Text isn't my strong point right now.

Standard Runtime right now, PPC.

This is my edit field. Needs to be just _Framed I guess?

controlText$ = gText.ltxt$(wnd) // last string
EDIT FIELD -_TextEntry, controlText$, (21,238)-(336,314), _framedNoCR,
long if controlText$ <> ""
SETSELECT 0,32767 // works sometimes, sometimes no.
SETSELECT 32767,32767 // works sometimes, sometimes no.
End If

So, if I have in my edit field the below in principal...ah, how do I know I
have that... :) ??

This is a Test of Text <CR>
<CR> // must be figured in
This is my secondline, wow that's cool. <CR>
<blank = CR> // must be figured in
<blank = CR> // must be figured in
This is my third line, I don't know how to get it. <CR>
<blank = CR> // can be discarded
<blank = CR> // can be discarded

**<CR> = return key