[futurebasic] Re: [FB] Change Styled Text Font/Size Question

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : May 1999 : Group Archive : Group : All Groups

From: Rick Brown <rbrown@...>
Date: Fri, 30 Apr 1999 22:33:16 -0500

tedd wrote:

> Hi gang:
>
> I want to change the text size and font of a styled edit field that has
> been previously created with another font and size.

You can use the EDIT TEXT statement to change the font, size, style, etc. in
either a "styled" edit field or an "unstyled" edit field.

If all the text in the field is to have a uniform font & style (at any given
time), then it would probably be easier to use a so-called "unstyled" edit
field.  The text in an "unstyled" field can actually be of any font, size,
style, etc.; its only limitation is that all pieces of the text must have the
same attributes.  Here's a demo that changes the font, size & style in an
"unstyled" field (better names for these would be "mono-styled" and
"multi-styled" fields).

LOCAL FN DoDialog
evnt = DIALOG(0)
id = DIALOG(1)
LONG IF evnt=_btnClick
  EDIT TEXT _geneva, 9,_italicBit%
END IF
END FN

WINDOW 1
TEXT _sysFont, 12,_ulineBit%
EDIT FIELD 1, "This is text", (10,10)-(100,30), _framed
BUTTON 1, _activeBtn, "Click Me", (10,50)-(100,70)
ON DIALOG FN DoDialog
DO
  HANDLEEVENTS
UNTIL _false
'---------------------

- Rick