home *** CD-ROM | disk | FTP | other *** search
- '***********************************************************************
- ' FDT_Over.RLZ
- '
- ' Copyright ⌐ 1991-1992 Computer Associates International, Inc.
- ' All rights reserved.
- '
- ' Code for the Overview and Instructions screens.
- '
- '***********************************************************************
-
- PROC FDT_Overview (b_instruct)
- LOCAL result, oldB, oldP
-
- PROC Overview ()
- LOCAL s, tv, fht, fullWid, lfTx, wdTx, rsID
-
- SetHourglass
- FormNew(FormQUnique; "Overview", 0)
- FormSetColor(fdt_c.back)
- FormSetColor(fdt_c.back; _Field)
-
- s = "6. Add code that handle clicks on the Quit button. "
- FormSetObject(101, _CaptionLeft, s, fdt_fP, 0, 0)
- tv = FormQObject(101)
- fht = tv[_FQO_Height]
- fullWid = tv[_FQO_Width] + 2 * fht + 2
- ResizeForm(0, 0, fullWid, _Default)
-
- lfTx = fht
- wdTx = fullWid - 2 * fht
-
- FormSetObject(101, _CaptionCenter, "Overview", fdt_fB, lfTx, fht, wdTx, _Default)
-
- s = "You are creating a program that charts random numbers. "
- s = s + "To do so, you will:"
- FormSetObject(102, _CaptionLeft, s, fdt_fP, lfTx, QB(101) + fht, wdTx, 2 * fht)
-
- rsID = 102
- FDT_NextCap(1, 1, "1. Place a Plot button in the form.")
- FDT_NextCap(2, 1, "2. Place a Quit button in the form.")
- FDT_NextCap(3, 1, "3. Place a chart title in the form.")
- FDT_NextCap(4, 1, "4. Place a chart in the form.")
- FDT_NextCap(5, 1, "5. Add code that handles clicks on the Plot button.")
- FDT_NextCap(6, 1, "6. Add code that handles clicks on the Quit button.")
- FDT_NextCap(7, 1, "7. Generate the program.")
- FormSetColor(fdt_c.text; _Text)
-
- FormSetObject(11, _Button, "Instructions", fdt_fB, 50pct, 100pct)
- tv = FormQObject(11)
- FormSetObject(1, _DefButton, "Continue", fdt_fB, tv[_FQO_Left] + fht, QB(rsID) + fht, tv[_FQO_Width], tv[_FQO_Height])
- FormModifyObject(11, _Normal, tv[_FQO_Left] - tv[_FQO_Width] - fht, QT(1))
-
- ResizeForm(_Center, _Center, _Default, QB(1) + fht)
- FDT_Frame()
-
- IF fdt_bigStep < 1 THEN
- FDT_GuideMsg(" ")
- END IF
- ResetHourglass
- FormModifyObject(1, _SetFocus)
- result = FormWait()
- FormControl(_Close)
- END PROC
-
- PROC Instructions ()
- LOCAL instForm, s, tv, fht, fullWid, lfTx, wdTx, sectPad, paraPad
- LOCAL htGb, bv, txv, gbShrink, lfGb, wdGb, lf, tp
-
- SetHourglass
- instForm = FormQUnique()
- FormNew(instForm; "Instructions", 0)
- FormSetColor(fdt_c.back)
- FormSetColor(fdt_c.back; _Field)
- FormSetColor(fdt_c.text; _Text)
-
- s = "The Status Bar, at the bottom of the screen, guides you through actions to perform. "
- FormSetObject(101, _CaptionLeft, s, fdt_fP, 0, 0)
- tv = FormQObject(101)
- fht = tv[_FQO_Height]
- fullWid = tv[_FQO_Width] + 2 * fht + 2
- ResizeForm(0, 0, fullWid, _Default)
- sectPad = fht
- paraPad = fht\2
- lfTx = fht
- wdTx = fullWid - 2 * fht
-
- FormSetObject(101, _CaptionCenter, "Instructions", fdt_fB, lfTx, fht, wdTx, _Default)
-
- FormSetObject(99, _CaptionLeft, "The Status Bar", fdt_fB, lfTx, QB(101) + paraPad)
- s = " appears at the bottom of the screen:"
- FormSetObject(102, _CaptionLeft, s, fdt_fP, QR(99), QB(101) + paraPad)
- FormSelect(fdt_guideF)
- htGb = FormQ(_Size)[4]
- bv = FormQObject(3)
- txv = FormQObject(11)
- gbShrink = htGb - txv[_FQO_Height] - 8
- FormSelect(instForm)
- FormSetColor(fdt_c.gBack; _Field)
- FormSetColor(_Black; _Text)
- lfGb = lfTx + fht
- wdGb = wdTx - 2 * fht
- FormSetObject(103, _GroupBox, "", lfGb, QB(102) + paraPad\2, wdGb, htGb - gbShrink)
- lf = QR(103) - bv[_FQO_Width] - 2
- tp = QT(103) + 2
- s = IF QVar(FDT_Preview) THEN "Main Menu" ELSE "Exit"
- FormSetObject(104, _Button, s, oldB, lf, tp, bv[_FQO_Width], bv[_FQO_Height] - gbShrink)
- lf = lf - bv[_FQO_Width] - 1
- FormSetObject(105, _Button, "Help", oldB, lf, tp, bv[_FQO_Width], bv[_FQO_Height] - gbShrink)
- FormSetColor(fdt_c.gText; _Text)
- FormSetObject(106, _CaptionCenter, "Guide message.", oldB, lfGb + 1, QT(103) + txv[_FQO_Top] + 1 - gbShrink\2, lf - lfGb - 2, txv[_FQO_Height])
- FormSetColor(fdt_c.back; _Field)
- FormSetColor(fdt_c.text; _Text)
- s = "The guide message describes the task you are currently performing."
- s = s + " Clicking on Help displays the Help screen. Clicking on "
- IF QVar(FDT_Preview) THEN
- s = s + "Main Menu brings up the Main Menu"
- ELSE
- s = s + "Exit brings up the Exit screen"
- END IF
- s = s + ", from which you may choose to leave the tutorial."
- FormSetObject(107, _CaptionLeft, s, fdt_fP, lfTx, QB(103) + paraPad\2, wdTx, 3 * fht)
- tp = QT(102)
- FDT_Frame2(1000, {lfTx, tp, wdTx, QB(107) - tp} + {-3, -2, 5, 4})
-
- FormSetColor(fdt_c.text; _Text)
- FormSetObject(131, _CaptionLeft, "The Overview screen,", fdt_fB, lfTx, QB(107) + sectPad)
- s = " which appears when you click on the Overview button,"
- FormSetObject(132, _CaptionLeft, s, fdt_fP, QR(131), QT(131))
- s = "shows all seven parts of the tutorial. The current part is highlighted in yellow."
- FormSetObject(133, _CaptionLeft, s, fdt_fP, lfTx, QB(131), wdTx, 1 * fht)
- tp = QT(131)
- FDT_Frame2(1010, {lfTx, tp, wdTx, QB(133) - tp} + {-3, -2, 5, 4})
-
- FormSetColor(fdt_c.text; _Text)
- FormSetObject(161, _CaptionLeft, "The Help screen,", fdt_fB, lfTx, QB(133) + sectPad)
- s = " which appears when you click on Help in the Status Bar,"
- FormSetObject(162, _CaptionLeft, s, fdt_fP, QR(161), QT(161))
- s = "shows the entire set of tasks for the part of the tutorial you are currently performing. "
- s = s + "The current task is highlighted in yellow. In addition, the Help screen provides access"
- s = s + " to the Overview screen and the Instructions screen (this screen)."
- FormSetObject(163, _CaptionLeft, s, fdt_fP, lfTx, QB(161), wdTx, 3 * fht)
- tp = QT(161)
- FDT_Frame2(1020, {lfTx, tp, wdTx, QB(163) - tp} + {-3, -2, 5, 4})
-
- FormSetColor(fdt_c.text; _Text)
- FormSetObject(301, _Bitmap, QSys(_ProgDir) + "FDT_CLIK", 100pct, 100pct)
- tv = FormQObject(301)
- tp = QB(163) + sectPad
- FormSetObject(302, _CaptionLeft, "The ", fdt_fB, lfTx, tp)
- FormModifyObject(301, _Normal, QR(302), tp)
- FormSetObject(303, _CaptionLeft, " picture,", fdt_fB, QR(301), tp)
- s = " which appears during the tutorial, indicates"
- FormSetObject(304, _CaptionLeft, s, fdt_fP, QR(303), tp)
- s = "a position at which you should click. Click in the area above the arrow."
- FormSetObject(305, _CaptionLeft, s, fdt_fP, lfTx, MAX(QB(302), QB(301)), wdTx, 1 * fht)
- FDT_Frame2(1030, {lfTx, tp, wdTx, QB(305) - tp} + {-3, -2, 5, 4})
-
- FormSetObject(11, _Button, "Instructions", fdt_fB, 50pct, 100pct)
- tv = FormQObject(11)
- FormSetObject(1, _DefButton, "Continue", fdt_fB, tv[_FQO_Left] + fht, QB(305) + fht, tv[_FQO_Width], tv[_FQO_Height])
- FormModifyObject(11, _Normal, "Overview", tv[_FQO_Left] - tv[_FQO_Width] - fht, QT(1))
-
- ResizeForm(_Center, _Center, _Default, QB(1) + fht)
- FDT_Frame()
-
- ResetHourglass
- LOOP
- s = ""
- FormModifyObject(1, _SetFocus)
- result = FormWait()
- SELECT CASE result
- CASE 104
- IF QVar(FDT_Preview) THEN
- s = "In the real status bar, the Main Menu button brings up the Main Menu."
- ELSE
- s = "In the real status bar, the Exit button brings up the Exit screen."
- END IF
- CASE 105
- s = "In the real status bar, the Help button brings up the Help screen."
- CASE 301
- s = "When you see the real ""click here"", click in the area above the arrow."
- END SELECT
- IF s = "" THEN
- EXIT LOOP
- ELSE
- BEEP
- INPUT s;
- END IF
- END LOOP
- FormControl(_Close)
- END PROC
-
- ' Actual start of FDT_Overview
- SetHourglass
- oldB = fdt_fB
- fdt_fB = fdt_mB
- oldP = fdt_fP
- fdt_fP = fdt_mP
-
- FDT_EnabButtons(_Gray)
- LOOP
- IF b_instruct THEN
- Instructions()
- ELSE
- Overview()
- END IF
- b_instruct = NOT b_instruct
- IF result < 10 THEN
- EXIT LOOP
- END IF
- END LOOP
- FDT_EnabButtons(_Normal)
- fdt_fP = oldP
- fdt_fB = oldB
- END PROC
-