home *** CD-ROM | disk | FTP | other *** search
/ TestDrive Super Store 3.0 / TESTDRIVE_3.ISO / realizer / formdev / fdt_over.rlz < prev    next >
Encoding:
Text File  |  1992-09-30  |  7.6 KB  |  216 lines

  1. '***********************************************************************
  2. '    FDT_Over.RLZ
  3. '
  4. '    Copyright ⌐ 1991-1992 Computer Associates International, Inc.
  5. '    All rights reserved.
  6. '
  7. '    Code for the Overview and Instructions screens.
  8. '
  9. '***********************************************************************
  10.  
  11. PROC FDT_Overview (b_instruct)
  12.     LOCAL    result, oldB, oldP
  13.  
  14. PROC Overview ()
  15.     LOCAL    s, tv, fht, fullWid, lfTx, wdTx, rsID
  16.  
  17.     SetHourglass
  18.     FormNew(FormQUnique; "Overview", 0)
  19.     FormSetColor(fdt_c.back)
  20.     FormSetColor(fdt_c.back; _Field)
  21.  
  22.     s = "6.  Add code that handle clicks on the Quit button.  "
  23.     FormSetObject(101, _CaptionLeft, s, fdt_fP, 0, 0)
  24.     tv = FormQObject(101)
  25.     fht = tv[_FQO_Height]
  26.     fullWid = tv[_FQO_Width] + 2 * fht + 2
  27.     ResizeForm(0, 0, fullWid, _Default)
  28.  
  29.     lfTx = fht
  30.     wdTx = fullWid - 2 * fht
  31.  
  32.     FormSetObject(101, _CaptionCenter, "Overview", fdt_fB, lfTx, fht, wdTx, _Default)
  33.  
  34.     s = "You are creating a program that charts random numbers.  "
  35.     s = s + "To do so, you will:"
  36.     FormSetObject(102, _CaptionLeft, s, fdt_fP, lfTx, QB(101) + fht, wdTx, 2 * fht)
  37.  
  38.     rsID = 102
  39.     FDT_NextCap(1, 1, "1.  Place a Plot button in the form.")
  40.     FDT_NextCap(2, 1, "2.  Place a Quit button in the form.")
  41.     FDT_NextCap(3, 1, "3.  Place a chart title in the form.")
  42.     FDT_NextCap(4, 1, "4.  Place a chart in the form.")
  43.     FDT_NextCap(5, 1, "5.  Add code that handles clicks on the Plot button.")
  44.     FDT_NextCap(6, 1, "6.  Add code that handles clicks on the Quit button.")
  45.     FDT_NextCap(7, 1, "7.  Generate the program.")
  46.     FormSetColor(fdt_c.text; _Text)
  47.  
  48.     FormSetObject(11, _Button, "Instructions", fdt_fB, 50pct, 100pct)
  49.     tv = FormQObject(11)
  50.     FormSetObject(1, _DefButton, "Continue", fdt_fB, tv[_FQO_Left] + fht, QB(rsID) + fht, tv[_FQO_Width], tv[_FQO_Height])
  51.     FormModifyObject(11, _Normal, tv[_FQO_Left] - tv[_FQO_Width] - fht, QT(1))
  52.  
  53.     ResizeForm(_Center, _Center, _Default, QB(1) + fht)
  54.     FDT_Frame()
  55.  
  56.     IF fdt_bigStep < 1 THEN
  57.         FDT_GuideMsg(" ")
  58.     END IF
  59.     ResetHourglass
  60.     FormModifyObject(1, _SetFocus)
  61.     result = FormWait()
  62.     FormControl(_Close)
  63. END PROC
  64.  
  65. PROC Instructions ()
  66.     LOCAL    instForm, s, tv, fht, fullWid, lfTx, wdTx, sectPad, paraPad
  67.     LOCAL    htGb, bv, txv, gbShrink, lfGb, wdGb, lf, tp
  68.  
  69.     SetHourglass
  70.     instForm = FormQUnique()
  71.     FormNew(instForm; "Instructions", 0)
  72.     FormSetColor(fdt_c.back)
  73.     FormSetColor(fdt_c.back; _Field)
  74.     FormSetColor(fdt_c.text; _Text)
  75.  
  76.     s = "The Status Bar, at the bottom of the screen, guides you through actions to perform.  "
  77.     FormSetObject(101, _CaptionLeft, s, fdt_fP, 0, 0)
  78.     tv = FormQObject(101)
  79.     fht = tv[_FQO_Height]
  80.     fullWid = tv[_FQO_Width] + 2 * fht + 2
  81.     ResizeForm(0, 0, fullWid, _Default)
  82.     sectPad = fht
  83.     paraPad = fht\2
  84.     lfTx = fht
  85.     wdTx = fullWid - 2 * fht
  86.  
  87.     FormSetObject(101, _CaptionCenter, "Instructions", fdt_fB, lfTx, fht, wdTx, _Default)
  88.  
  89.     FormSetObject(99, _CaptionLeft, "The Status Bar", fdt_fB, lfTx, QB(101) + paraPad)
  90.     s = " appears at the bottom of the screen:"
  91.     FormSetObject(102, _CaptionLeft, s, fdt_fP, QR(99), QB(101) + paraPad)
  92.     FormSelect(fdt_guideF)
  93.     htGb = FormQ(_Size)[4]
  94.     bv = FormQObject(3)
  95.     txv = FormQObject(11)
  96.     gbShrink = htGb - txv[_FQO_Height] - 8
  97.     FormSelect(instForm)
  98.     FormSetColor(fdt_c.gBack; _Field)
  99.     FormSetColor(_Black; _Text)
  100.     lfGb = lfTx + fht
  101.     wdGb = wdTx - 2 * fht
  102.     FormSetObject(103, _GroupBox, "", lfGb, QB(102) + paraPad\2, wdGb, htGb - gbShrink)
  103.     lf = QR(103) - bv[_FQO_Width] - 2
  104.     tp = QT(103) + 2
  105.     s = IF QVar(FDT_Preview) THEN "Main Menu" ELSE "Exit"
  106.     FormSetObject(104, _Button, s, oldB, lf, tp, bv[_FQO_Width], bv[_FQO_Height] - gbShrink)
  107.     lf = lf - bv[_FQO_Width] - 1
  108.     FormSetObject(105, _Button, "Help", oldB, lf, tp, bv[_FQO_Width], bv[_FQO_Height] - gbShrink)
  109.     FormSetColor(fdt_c.gText; _Text)
  110.     FormSetObject(106, _CaptionCenter, "Guide message.", oldB, lfGb + 1, QT(103) + txv[_FQO_Top] + 1 - gbShrink\2, lf - lfGb - 2, txv[_FQO_Height])
  111.     FormSetColor(fdt_c.back; _Field)
  112.     FormSetColor(fdt_c.text; _Text)
  113.     s = "The guide message describes the task you are currently performing."
  114.     s = s + " Clicking on Help displays the Help screen.  Clicking on "
  115.     IF QVar(FDT_Preview) THEN
  116.         s = s + "Main Menu brings up the Main Menu"
  117.     ELSE
  118.         s = s + "Exit brings up the Exit screen"
  119.     END IF
  120.     s = s + ", from which you may choose to leave the tutorial."
  121.     FormSetObject(107, _CaptionLeft, s, fdt_fP, lfTx, QB(103) + paraPad\2, wdTx, 3 * fht)
  122.     tp = QT(102)
  123.     FDT_Frame2(1000, {lfTx, tp, wdTx, QB(107) - tp} + {-3, -2, 5, 4})
  124.  
  125.     FormSetColor(fdt_c.text; _Text)
  126.     FormSetObject(131, _CaptionLeft, "The Overview screen,", fdt_fB, lfTx, QB(107) + sectPad)
  127.     s = " which appears when you click on the Overview button,"
  128.     FormSetObject(132, _CaptionLeft, s, fdt_fP, QR(131), QT(131))
  129.     s = "shows all seven parts of the tutorial.  The current part is highlighted in yellow."
  130.     FormSetObject(133, _CaptionLeft, s, fdt_fP, lfTx, QB(131), wdTx, 1 * fht)
  131.     tp = QT(131)
  132.     FDT_Frame2(1010, {lfTx, tp, wdTx, QB(133) - tp} + {-3, -2, 5, 4})
  133.  
  134.     FormSetColor(fdt_c.text; _Text)
  135.     FormSetObject(161, _CaptionLeft, "The Help screen,", fdt_fB, lfTx, QB(133) + sectPad)
  136.     s = " which appears when you click on Help in the Status Bar,"
  137.     FormSetObject(162, _CaptionLeft, s, fdt_fP, QR(161), QT(161))
  138.     s = "shows the entire set of tasks for the part of the tutorial you are currently performing.  "
  139.     s = s + "The current task is highlighted in yellow.  In addition, the Help screen provides access"
  140.     s = s + " to the Overview screen and the Instructions screen (this screen)."
  141.     FormSetObject(163, _CaptionLeft, s, fdt_fP, lfTx, QB(161), wdTx, 3 * fht)
  142.     tp = QT(161)
  143.     FDT_Frame2(1020, {lfTx, tp, wdTx, QB(163) - tp} + {-3, -2, 5, 4})
  144.  
  145.     FormSetColor(fdt_c.text; _Text)
  146.     FormSetObject(301, _Bitmap, QSys(_ProgDir) + "FDT_CLIK", 100pct, 100pct)
  147.     tv = FormQObject(301)
  148.     tp = QB(163) + sectPad
  149.     FormSetObject(302, _CaptionLeft, "The ", fdt_fB, lfTx, tp)
  150.     FormModifyObject(301, _Normal, QR(302), tp)
  151.     FormSetObject(303, _CaptionLeft, " picture,", fdt_fB, QR(301), tp)
  152.     s = " which appears during the tutorial, indicates"
  153.     FormSetObject(304, _CaptionLeft, s, fdt_fP, QR(303), tp)
  154.     s = "a position at which you should click.  Click in the area above the arrow."
  155.     FormSetObject(305, _CaptionLeft, s, fdt_fP, lfTx, MAX(QB(302), QB(301)), wdTx, 1 * fht)
  156.     FDT_Frame2(1030, {lfTx, tp, wdTx, QB(305) - tp} + {-3, -2, 5, 4})
  157.  
  158.     FormSetObject(11, _Button, "Instructions", fdt_fB, 50pct, 100pct)
  159.     tv = FormQObject(11)
  160.     FormSetObject(1, _DefButton, "Continue", fdt_fB, tv[_FQO_Left] + fht, QB(305) + fht, tv[_FQO_Width], tv[_FQO_Height])
  161.     FormModifyObject(11, _Normal, "Overview", tv[_FQO_Left] - tv[_FQO_Width] - fht, QT(1))
  162.  
  163.     ResizeForm(_Center, _Center, _Default, QB(1) + fht)
  164.     FDT_Frame()
  165.  
  166.     ResetHourglass
  167.     LOOP
  168.         s = ""
  169.         FormModifyObject(1, _SetFocus)
  170.         result = FormWait()
  171.         SELECT CASE result
  172.         CASE 104
  173.             IF QVar(FDT_Preview) THEN 
  174.                 s = "In the real status bar,  the Main Menu button brings up the Main Menu."
  175.             ELSE
  176.                 s = "In the real status bar, the Exit button brings up the Exit screen."
  177.             END IF
  178.         CASE 105
  179.             s = "In the real status bar, the Help button brings up the Help screen."
  180.         CASE 301
  181.             s = "When you see the real ""click here"", click in the area above the arrow."
  182.         END SELECT
  183.         IF s = "" THEN
  184.             EXIT LOOP
  185.         ELSE
  186.             BEEP
  187.             INPUT s;
  188.         END IF
  189.     END LOOP
  190.     FormControl(_Close)
  191. END PROC
  192.  
  193.     ' Actual start of FDT_Overview
  194.     SetHourglass
  195.     oldB = fdt_fB
  196.     fdt_fB = fdt_mB
  197.     oldP = fdt_fP
  198.     fdt_fP = fdt_mP
  199.  
  200.     FDT_EnabButtons(_Gray)
  201.     LOOP
  202.         IF b_instruct THEN
  203.             Instructions()
  204.         ELSE
  205.             Overview()
  206.         END IF
  207.         b_instruct = NOT b_instruct
  208.         IF result < 10 THEN
  209.             EXIT LOOP
  210.         END IF
  211.     END LOOP
  212.     FDT_EnabButtons(_Normal)
  213.     fdt_fP = oldP
  214.     fdt_fB = oldB
  215. END PROC
  216.