home *** CD-ROM | disk | FTP | other *** search
- '***********************************************************************
- ' FD_Tutor.RLZ
- '
- ' Copyright ⌐ 1991-1992 Computer Associates International, Inc.
- ' All rights reserved.
- '
- '***********************************************************************
-
- IF 1 THEN ' Default to using "Helv".
- LOCAL fontSz
- ' make some small fonts for Help screens and most of the Tutorial.
- fontSz = IF _HPxlPerInch > 100 THEN 10 ELSE 8
- fdt_fB = FontQUnique()
- FontNew(fdt_fB; "Helv", fontSz, _Bold)
- fdt_fP = FontQUnique()
- FontNew(fdt_fP; "Helv", fontSz)
- ' and some medium size fonts for Welcome, Instructions, etc.
- fontSz = IF _HPxlPerInch > 100 THEN 12 ELSE 10
- fdt_mB = FontQUnique()
- FontNew(fdt_mB; "Helv", fontSz, _Bold)
- fdt_mP = FontQUnique()
- FontNew(fdt_mP; "Helv", fontSz)
- ELSE
- fdt_fB = 0
- fdt_fP = 0
- fdt_mB = 0
- fdt_mP = 0
- END IF
-
- SetSys(_Size, {_Maximize})
- RUN "FormDev\FDT_Util"
-
- fdt_c.back = _Turquoise
- fdt_c.lightLine = _LightGray
- fdt_c.darkLine = _Black
- fdt_c.text = _Black
- fdt_c.hiText = _Yellow
- fdt_c.gBack = _Blue
- fdt_c.gText = _Yellow
-
- FUNC FDT_Welcome ()
- LOCAL s, tv, fht, lfTx, wdTx, fullWid, butWid, result, rsID
- LOCAL fdt_fP, fdt_fB
-
- fdt_fP = fdt_mP
- fdt_fB = fdt_mB
- FormNew(FormQUnique; "Welcome", 0)
- s = "In this tutorial you will learn how to design user interfaces "
- FormSetObject(101, _CaptionLeft, s, fdt_fP, 0, 0)
- tv = FormQObject(101)
- fht = tv[_FQO_Height]
- fullWid = tv[_FQO_Width] + 2 * fht
- ResizeForm(0, 0, fullWid, _Default)
-
- lfTx = fht
- wdTx = fullWid - 2 * fht
- butWid = 0.20 * fullWid
-
- FormSetColor(fdt_c.back)
- FormSetColor(fdt_c.back; _Field)
- FormSetObject(101, _CaptionCenter, "Welcome to the FormDev Tutorial", fdt_fB, lfTx, fht, wdTx, _Default)
-
- rsID = 101
- s = s + "using FormDev. You will create a simple Realizer application"
- s = s + " that plots random numbers. In the process, you will learn how to add"
- s = s + " items to forms, associate code with items, and create a program."
- FDT_NextCap(-1, 5, s)
-
- FormSetObject(1, _DefButton, "Begin", fdt_fB, lfTx, QB(rsID) + fht, butWid, _Default)
- FormSetObject(2, _Button, "Cancel", fdt_fB, fullWid - lfTx - butWid, QT(1), butWid, _Default)
-
- ResizeForm(_Center, _Center, _Default, QB(2) + fht)
- FDT_Frame()
-
- result = FormWait()
- FormControl(_Close)
-
- RETURN result = 1
- END FUNC
-
- PROC FDT_GuideInit ()
- fdt_guideF = FormQUnique()
- FormNew(fdt_guideF; "Guide Window", _HotClick)
- FormControl(_Size; 0, _Bottom, 100pct, 10pct)
- FormSetColor(fdt_c.gBack)
- FormSetColor(fdt_c.gBack; _Field)
- FormSetObject(3, _Button, "Help", fdt_fB, 76pct, _Top, 12pct, _Default)
- FormSetObject(4, _Button, IF QVar(FDT_Preview) THEN "Main Menu" ELSE "Exit", fdt_fB, 88pct, _Top, 12pct, _Default)
- FormControl(_Size; 0, _Bottom, 100pct, FormQObject(3)[_FQO_Height] + 4)
- FormModifyObject(3, _Normal, FormQObject(3)[_FQO_Left] - 2, 1pxl)
- FormModifyObject(4, _Normal, FormQObject(4)[_FQO_Left] - 1, 1pxl)
- FormSetColor(fdt_c.gText; _Text)
- FormSetObject(11, _CaptionCenter, " ", fdt_fB, 0, _Center, FormQObject(3)[_FQO_Left], _Default)
- fdt_fht = FormQObject(11)[_FQO_Height]
- FormControl(_Show)
- END PROC
-
- PROC FDT_GuideAdjust ()
- LOCAL tv, gv, delta
- FormSelect(toolForm)
- tv = FormQ(_Size)
- gv = FormQ(_Size; fdt_guideF)
- delta = tv[2] + tv[4] + 1 - gv[2]
- IF delta > 0 THEN
- FormControl(_Size; _Default, MAX(0, tv[2] - delta))
- END IF
- fdt_toolSize = FormQ(_Size)
- END PROC
-
- IF NOT FDT_Welcome() THEN
- IF QVar(FDT_Preview) THEN
- IF fdt_fB THEN
- FontSelect(fdt_fB)
- FontControl(_Close)
- FontSelect(fdt_fP)
- FontControl(_Close)
- FontSelect(fdt_mB)
- FontControl(_Close)
- FontSelect(fdt_mP)
- FontControl(_Close)
- END IF
- CLEAR FDT_GuideAdjust, FDT_GuideInit, FDT_Welcome
- CLEAR fdt_fB, fdt_fP, fdt_mB, fdt_mP
- CLEAR fdt_c, FDT_Frame, FDT_Frame2, FDT_GuideMsg, FDT_NextCap
- EXIT MACRO
- ELSE
- RESET
- EXIT PROGRAM
- END IF
- END IF
- FDT_GuideInit()
- FDT_GuideMsg("Please wait while FormDev is loaded from disk.")
-
- RUN "FormDev"
-
- SetHourglass
- SetAppName("FormDev Tutorial")
- FDT_GuideAdjust()
- FDT_GuideMsg("Please wait while the Tutorial is loaded from disk.")
- FormSelect(fdVisOption)
- FormControl(_Close)
- RUN "FDT_Act"
- RUN "FDT_BigH"
- RUN "FDT_Help"
- RUN "FDT_Init"
- RUN "FDT_Main"
- RUN "FDT_Opt"
- RUN "FDT_Over"
- FDT_Init()
- CLEAR FDT_Init, FDT_GuideInit, FDT_GuideAdjust, FDT_Welcome
-
- FDT_Overview(0) ' (kills hourglass)
-
- BEEP
- fdt_bigStep = 1
- fdt_smallStep = 1
- FDT_GuideMsg()
- FDT_ClickShow()
-