home *** CD-ROM | disk | FTP | other *** search
/ TestDrive Super Store 2.3 / TESTDRIVE_2.ISO / realizer / fd_tutor.rlz < prev    next >
Encoding:
Text File  |  1992-09-30  |  4.4 KB  |  159 lines

  1. '***********************************************************************
  2. '    FD_Tutor.RLZ
  3. '
  4. '    Copyright ⌐ 1991-1992 Computer Associates International, Inc.
  5. '    All rights reserved.
  6. '
  7. '***********************************************************************
  8.  
  9. IF 1 THEN        ' Default to using "Helv".
  10.     LOCAL    fontSz
  11. ' make some small fonts for Help screens and most of the Tutorial.
  12.     fontSz = IF _HPxlPerInch > 100 THEN 10 ELSE 8
  13.     fdt_fB = FontQUnique()
  14.     FontNew(fdt_fB; "Helv", fontSz, _Bold)
  15.     fdt_fP = FontQUnique()
  16.     FontNew(fdt_fP; "Helv", fontSz)
  17. ' and some medium size fonts for Welcome, Instructions, etc.
  18.     fontSz = IF _HPxlPerInch > 100 THEN 12 ELSE 10
  19.     fdt_mB = FontQUnique()
  20.     FontNew(fdt_mB; "Helv", fontSz, _Bold)
  21.     fdt_mP = FontQUnique()
  22.     FontNew(fdt_mP; "Helv", fontSz)
  23. ELSE
  24.     fdt_fB = 0
  25.     fdt_fP = 0
  26.     fdt_mB = 0
  27.     fdt_mP = 0
  28. END IF
  29.  
  30. SetSys(_Size, {_Maximize})
  31. RUN "FormDev\FDT_Util"
  32.  
  33. fdt_c.back = _Turquoise
  34. fdt_c.lightLine = _LightGray
  35. fdt_c.darkLine = _Black
  36. fdt_c.text = _Black
  37. fdt_c.hiText = _Yellow
  38. fdt_c.gBack = _Blue
  39. fdt_c.gText = _Yellow
  40.  
  41. FUNC FDT_Welcome ()
  42.     LOCAL    s, tv, fht, lfTx, wdTx, fullWid, butWid, result, rsID
  43.     LOCAL    fdt_fP, fdt_fB
  44.  
  45.     fdt_fP = fdt_mP
  46.     fdt_fB = fdt_mB
  47.     FormNew(FormQUnique; "Welcome", 0)
  48.     s = "In this tutorial you will learn how to design user interfaces "
  49.     FormSetObject(101, _CaptionLeft, s, fdt_fP, 0, 0)
  50.     tv = FormQObject(101)
  51.     fht = tv[_FQO_Height]
  52.     fullWid = tv[_FQO_Width] + 2 * fht
  53.     ResizeForm(0, 0, fullWid, _Default)
  54.  
  55.     lfTx = fht
  56.     wdTx = fullWid - 2 * fht
  57.     butWid = 0.20 * fullWid
  58.  
  59.     FormSetColor(fdt_c.back)
  60.     FormSetColor(fdt_c.back; _Field)
  61.     FormSetObject(101, _CaptionCenter, "Welcome to the FormDev Tutorial", fdt_fB, lfTx, fht, wdTx, _Default)
  62.  
  63.     rsID = 101
  64.     s = s + "using FormDev.  You will create a simple Realizer application"
  65.     s = s + " that plots random numbers.  In the process, you will learn how to add"
  66.     s = s + " items to forms, associate code with items, and create a program."
  67.     FDT_NextCap(-1, 5, s)
  68.  
  69.     FormSetObject(1, _DefButton, "Begin", fdt_fB, lfTx, QB(rsID) + fht, butWid, _Default)
  70.     FormSetObject(2, _Button, "Cancel", fdt_fB, fullWid - lfTx - butWid, QT(1), butWid, _Default)
  71.  
  72.     ResizeForm(_Center, _Center, _Default, QB(2) + fht)
  73.     FDT_Frame()
  74.  
  75.     result = FormWait()
  76.     FormControl(_Close)
  77.  
  78.     RETURN result = 1
  79. END FUNC
  80.  
  81. PROC FDT_GuideInit ()
  82.     fdt_guideF = FormQUnique()
  83.     FormNew(fdt_guideF; "Guide Window", _HotClick)
  84.     FormControl(_Size; 0, _Bottom, 100pct, 10pct)
  85.     FormSetColor(fdt_c.gBack)
  86.     FormSetColor(fdt_c.gBack; _Field)
  87.     FormSetObject(3, _Button, "Help", fdt_fB, 76pct, _Top, 12pct, _Default)
  88.     FormSetObject(4, _Button, IF QVar(FDT_Preview) THEN "Main Menu" ELSE "Exit", fdt_fB, 88pct, _Top, 12pct, _Default)
  89.     FormControl(_Size; 0, _Bottom, 100pct, FormQObject(3)[_FQO_Height] + 4)
  90.     FormModifyObject(3, _Normal, FormQObject(3)[_FQO_Left] - 2, 1pxl)
  91.     FormModifyObject(4, _Normal, FormQObject(4)[_FQO_Left] - 1, 1pxl)
  92.     FormSetColor(fdt_c.gText; _Text)
  93.     FormSetObject(11, _CaptionCenter, " ", fdt_fB, 0, _Center, FormQObject(3)[_FQO_Left], _Default)
  94.     fdt_fht = FormQObject(11)[_FQO_Height]
  95.     FormControl(_Show)
  96. END PROC
  97.  
  98. PROC FDT_GuideAdjust ()
  99.     LOCAL    tv, gv, delta
  100.     FormSelect(toolForm)
  101.     tv = FormQ(_Size)
  102.     gv = FormQ(_Size; fdt_guideF)
  103.     delta = tv[2] + tv[4] + 1 - gv[2]
  104.     IF delta > 0 THEN
  105.         FormControl(_Size; _Default, MAX(0, tv[2] - delta))
  106.     END IF
  107.     fdt_toolSize = FormQ(_Size)
  108. END PROC
  109.  
  110. IF NOT FDT_Welcome() THEN
  111.     IF QVar(FDT_Preview) THEN
  112.         IF fdt_fB THEN
  113.             FontSelect(fdt_fB)
  114.             FontControl(_Close)
  115.             FontSelect(fdt_fP)
  116.             FontControl(_Close)
  117.             FontSelect(fdt_mB)
  118.             FontControl(_Close)
  119.             FontSelect(fdt_mP)
  120.             FontControl(_Close)
  121.         END IF
  122.         CLEAR    FDT_GuideAdjust, FDT_GuideInit, FDT_Welcome
  123.         CLEAR    fdt_fB, fdt_fP, fdt_mB, fdt_mP
  124.         CLEAR    fdt_c, FDT_Frame, FDT_Frame2, FDT_GuideMsg, FDT_NextCap
  125.         EXIT MACRO
  126.     ELSE
  127.         RESET
  128.         EXIT PROGRAM
  129.     END IF
  130. END IF
  131. FDT_GuideInit()
  132. FDT_GuideMsg("Please wait while FormDev is loaded from disk.")
  133.  
  134. RUN "FormDev"
  135.  
  136. SetHourglass
  137. SetAppName("FormDev Tutorial")
  138. FDT_GuideAdjust()
  139. FDT_GuideMsg("Please wait while the Tutorial is loaded from disk.")
  140. FormSelect(fdVisOption)
  141. FormControl(_Close)
  142. RUN "FDT_Act"
  143. RUN "FDT_BigH"
  144. RUN "FDT_Help"
  145. RUN "FDT_Init"
  146. RUN "FDT_Main"
  147. RUN "FDT_Opt"
  148. RUN "FDT_Over"
  149. FDT_Init()
  150. CLEAR FDT_Init, FDT_GuideInit, FDT_GuideAdjust, FDT_Welcome
  151.  
  152. FDT_Overview(0)        ' (kills hourglass)
  153.  
  154. BEEP
  155. fdt_bigStep = 1
  156. fdt_smallStep = 1
  157. FDT_GuideMsg()
  158. FDT_ClickShow()
  159.