[futurebasic] increasing/decreasing fontsize by one point in a styled edit

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

From: SVANVOORST@...
Date: Sat, 19 Jun 1999 11:14:19 EDT
bowerbird:

The following code will discriminate between styled and regular EF using 
TEHANDLE and change the font, size of selected text in the styled EF:

COMPILE 0, _caseInsensitive

LOCAL FN buildWnd
  WINDOW#1,"styledEFChngFont.demo",(0,0)-(500,200)
  PRINT%(30,30)"Select text in EF."
  TEXT _geneva,14
  EDIT FIELD#-1,"",(100,80)-(400,100),2,2         'negative ID
  EDIT$(1)="Styled EF containing multiFonts,styles."
  EDIT FIELD#2,"",(100,130)-(300,150),2,2
  EDIT$(2)="Regular EF, positive ID."
  EDIT FIELD(0)
END FN

LOCAL FN doDialog
  evnt=DIALOG(0)
  id=DIALOG(evnt)
  SELECT evnt
    CASE _wndClose
      END
    CASE _efClick
      efH&=TEHANDLE(id)
      size%=efH&..teSize%
      LONG IF size% < 0
        startPos = WINDOW(_selStart)
        endPos = WINDOW(_selEnd)
        EDIT TEXT _sysFont,13
        EDIT FIELD(0)
      END IF
  END SELECT
END FN

FN buildWnd
ON DIALOG FN doDialog
DO
  HANDLEEVENTS
UNTIL 0

Steve Van Voorst