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

  1. '***********************************************************************
  2. '    FDT_Main.RLZ
  3. '
  4. '    Copyright ⌐ 1991-1992 Computer Associates International, Inc.
  5. '    All rights reserved.
  6. '
  7. '***********************************************************************
  8.  
  9. PROC FDT_BigHelpP (v)
  10.     IF v[_Invoke] = _Close THEN
  11.         EXIT PROC
  12.     END IF
  13.     SELECT CASE v[_ItemNum]
  14.     CASE 7        ' Overview
  15.         FDT_Overview(0)
  16.     CASE 8        ' Instructions
  17.         FDT_Overview(1)
  18.     CASE 9        ' Continue
  19.         FormSelect(fdt_bigHelpF)
  20.         FormControl(_Close)
  21.     END SELECT
  22. END PROC
  23.  
  24. PROC FDT_HideClicks ()
  25.     LOCAL    tv, msg
  26.  
  27.     FormSelect(fdt_clickF)
  28.     FormControl(_Hide)
  29.     IF FormQ(_Exists; fdt_infoF) THEN
  30.         FormSelect(fdt_infoF)
  31.         FormControl(_Close)
  32.     END IF
  33.     IF FormQ(_Exists; fdt_bigHelpF) THEN
  34.         FormSelect(fdt_bigHelpF)
  35.         FormControl(_Close)
  36.     END IF
  37.     tv = QSys(_Size)
  38.     IF tv[1] <> _Maximize OR EndValid(tv) <> 1 THEN
  39.         BEEP
  40.         INPUT "Please keep Realizer full-screen for this tutorial.";
  41.         SetSys(_Size, {_Maximize})
  42.     END IF
  43.     IF Sum(fdt_toolSize <> FormQ(_Size; toolForm)) THEN
  44.         BEEP
  45.         INPUT "Please do not move the Tool Palette during this tutorial.";
  46.         FormSelect(toolForm)
  47.         FormControl(_Restore)
  48.         FormControl(_Size; fdt_toolSize[1], fdt_toolSize[2], fdt_toolSize[3], fdt_toolSize[4])
  49.     END IF
  50.     IF Sum(fdt_mainSize <> FormQ(_Size; fdMain)) THEN
  51.         BEEP
  52.         INPUT "Please do not move or resize the form during this tutorial.";
  53.         FormSelect(fdMain)
  54.         FormControl(_Restore)
  55.         FormControl(_Size; fdt_mainSize[1], fdt_mainSize[2], fdt_mainSize[3], fdt_mainSize[4])
  56.     END IF
  57.     IF fdt_state > 10 THEN
  58.         FormSelect(fdMain)
  59.         msg = ""
  60.         tv = FormQObject(40)
  61.         IF tv[_FQO_Top] < QB(30) THEN
  62.             msg = "Please do not overlap the caption with the chart."
  63.         ELSEIF tv[_FQO_Top] + tv[_FQO_Height] > fdt_maxChartBot THEN
  64.             msg = "Please do not overlap the buttons with the chart."
  65.         ELSEIF tv[_FQO_Height] < 0.3 * fdt_clientSize[4] OR tv[_FQO_Width] < 0.3 * fdt_clientSize[3] THEN
  66.             msg = "Please do not make the chart so small."
  67.         END IF
  68.         IF msg <> "" THEN
  69.             BEEP
  70.             INPUT msg;
  71.             tv[_FQO_Top] = MAX(tv[_FQO_Top], QB(30))
  72.             tv[_FQO_Width] = MAX(tv[_FQO_Width], 0.301 * fdt_clientSize[3])
  73.             tv[_FQO_Height] = MAX(tv[_FQO_Height], 0.301 * fdt_clientSize[4])
  74.             tv[_FQO_Height] = MIN(tv[_FQO_Height], fdt_maxChartBot - QB(30))
  75.             tv[_FQO_Left] = MIN(tv[_FQO_Left], fdt_clientSize[3] - tv[_FQO_Width])
  76.             tv[_FQO_Top] = MIN(tv[_FQO_Top], fdt_maxChartBot - tv[_FQO_Height])
  77.             FormModifyObject(40, _Normal, tv[_FQO_Left], tv[_FQO_Top], tv[_FQO_Width], tv[_FQO_Height])
  78.         END IF
  79.     END IF
  80. END PROC
  81.  
  82. FUNC FDT_Lims ()
  83.     LOCAL    lims
  84.     SELECT CASE fdt_state
  85.     CASE 1
  86.         lims = {0.0, 0.85, 0.2, 0.95}
  87.     CASE 3
  88.         lims = {0.7, 0.85, 0.95, 0.95}
  89.     CASE 6
  90.         lims = {0.1, 0.0, 0.8, 0.2}
  91.     CASE 9
  92.         lims = {0.0, 0.1, 0.1, 0.2}
  93.     CASE ELSE
  94.         RETURN 0
  95.     END SELECT
  96.     RETURN  (lims * {fdt_clientSize[3:4], fdt_clientSize[3:4]})
  97. END FUNC
  98.  
  99. PROC FDT_FormP (v)
  100.     LOCAL    tv
  101.  
  102.     IF v[_Invoke] = _Close THEN
  103.         EXIT PROC
  104.     END IF
  105.  
  106.     PROC GetTool (item_ID)
  107.         IF Sum(v = {_Click, toolForm, item_ID}) >= 3 THEN
  108.             ToolProc(v)
  109.             fdt_smallStep = fdt_smallStep + 1
  110.             fdt_state = fdt_state + 1
  111.             FDT_GuideMsg()
  112.         ELSE
  113.             BEEP
  114.             FDT_GuideMsg()
  115.         END IF
  116.     END PROC
  117.  
  118.     PROC GetOptions (rsID)
  119.         LOCAL    tv
  120.         tv = FormQObject(rsID)
  121.         IF Sum(fdt_frameV[_FQO_Width:_FQO_Height] <> tv) THEN
  122.             INPUT "Please do not resize text or button items during this tutorial.  The tutorial is using Options... to control these sizes.";
  123.             FormModifyObject(rsID, _Normal, fdt_frameV[_FQO_Left], fdt_frameV[_FQO_Top], fdt_frameV[_FQO_Width], fdt_frameV[_FQO_Height])
  124.             tv = FormQObject(rsID)
  125.         END IF
  126.         IF fdt_state < 5 AND tv[_FQO_Top] < 0.85 * fdt_clientSize[4] THEN
  127.             INPUT "Please do not position the buttons that high on the form during this tutorial.";
  128.             FormModifyObject(rsID, _Normal, tv[_FQO_Left], 0.85 * fdt_clientSize[4], fdt_frameV[_FQO_Width], fdt_frameV[_FQO_Height])
  129.         END IF
  130.         fdt_frameV = FormQObject(rsID)
  131.         FormModifyObject(rsID, _SetFocus)
  132.         IF Sum(v = {_Click, toolForm, 32762}) >= 3 THEN
  133.             FDT_InitVisualForms()
  134.             ToolProc(v)
  135.             FormSelect(fdVisOption)
  136.             FormControl(_Close)
  137.             fdt_state = fdt_state + 1
  138.             fdt_bigStep = fdt_bigStep + 1
  139.             fdt_smallStep = 1
  140.             FDT_GuideMsg()
  141.         ELSE
  142.             BEEP
  143.             FDT_GuideMsg()
  144.         END IF
  145.     END PROC
  146.  
  147.     PROC GetDrop ()
  148.         LOCAL    x, y, lims, msg
  149.  
  150.         PROC AddMsg (s)
  151.             IF msg = "" THEN
  152.                 msg = "A little bit " + s
  153.             ELSE
  154.                 msg = msg + " and " + s
  155.             END IF
  156.         END PROC
  157.  
  158.         IF Sum(v = {_Click, fdMain, 32767}) >= 3 THEN
  159.             x = v[_XPos]
  160.             y = v[_YPos]
  161.             lims = FDT_Lims()
  162.             msg = ""
  163.             IF y < lims[2] THEN
  164.                 AddMsg("lower")
  165.             ELSEIF y > lims[4] THEN
  166.                 AddMsg("higher")
  167.             END IF
  168.             IF x < lims[1] THEN
  169.                 AddMsg("to the right")
  170.             ELSEIF x > lims[3] THEN
  171.                 AddMsg("to the left")
  172.             END IF
  173.             IF msg = "" THEN
  174.                 fdt_state = fdt_state + 1
  175.                 fdt_smallStep = fdt_smallStep + 1
  176.                 MainProc(v)
  177.                 fdt_frameV = FormQObject()
  178.                 FDT_GuideMsg()
  179.                 IF fdt_state = 10 THEN
  180.                     FormSelect(fdMain)
  181.                     FormSetColor(fdt_c.gText; _Field)
  182.                     FormSetColor(fdt_c.gBack; _Text)
  183.                     FormModifyObject(40, _SetColor, "Chart 40"+Chr$(13)+Chr$(10)+"Drag on the border to resize"+Chr$(13)+Chr$(10)+"Drag in the middle to reposition")
  184.                     FormSetColor(_White; _Field)
  185.                     FormSetColor(_Black; _Text)
  186.                 END IF
  187.             ELSE
  188.                 BEEP
  189.                 FDT_GuideMsg(msg + ".")
  190.             END IF
  191.         ELSE
  192.             BEEP
  193.             FDT_GuideMsg()
  194.         END IF
  195.     END PROC
  196.  
  197.     PROC GetActItem (asID)
  198.         IF Sum(v = {_Click, fdMain, StrToItemID(asID)}) >= 3 THEN
  199.             ToolOn(14)            ' back to the chart
  200.             FDT_Action(StrToNum(asID))
  201.             fdt_state = fdt_state + 1
  202.             fdt_bigStep = fdt_bigStep + 1
  203.             fdt_smallStep = 1
  204.             FDT_GuideMsg()
  205.         ELSE
  206.             BEEP
  207.             FDT_GuideMsg()
  208.         END IF
  209.     END PROC
  210.  
  211.     FDT_HideClicks()
  212.  
  213.     FormSelect(fdMain)
  214.     SELECT CASE fdt_state
  215.     CASE 1, 3, 6, 9
  216.         GetDrop()
  217.     CASE 2
  218.         GetOptions(10)
  219.     CASE 4
  220.         GetOptions(20)
  221.     CASE 5
  222.         fdt_maxChartBot = MIN(FormQObject(StrToItemID("1"))[_FQO_Top], FormQObject(StrToItemID("2"))[_FQO_Top])
  223.         GetTool(31006)
  224.     CASE 7
  225.         GetOptions(30)
  226.     CASE 8
  227.         GetTool(31014)
  228.     CASE 10
  229.         IF Sum(v = {_Click, fdMain, 40}) >= 3 THEN
  230.             FormSelect(fdMain)
  231.             tv = FormQObject(40)
  232.             IF tv[_FQO_Top] < QB(30) THEN
  233.                 BEEP
  234.                 FDT_GuideMsg("Please do not overlap the caption.")
  235.             ELSEIF tv[_FQO_Top] + tv[_FQO_Height] > fdt_maxChartBot THEN
  236.                 BEEP
  237.                 FDT_GuideMsg("Please do not overlap the buttons.")
  238.             ELSE
  239.                 fdt_state = fdt_state + 1
  240.                 fdt_bigStep = fdt_bigStep + 1
  241.                 fdt_smallStep = 1
  242.                 FDT_GuideMsg()
  243.                 FormSelect(fdMain)
  244.                 FormModifyObject(40, _SetColor, "Chart 40")
  245.             END IF
  246.         ELSE
  247.             BEEP
  248.             FDT_GuideMsg()
  249.         END IF
  250.     CASE 11, 13, 15, 16        ' These must happen at FDT_MenuP
  251.         BEEP
  252.         FDT_GuideMsg()
  253.     CASE 12
  254.         GetActItem("1")
  255.     CASE 14
  256.         GetActItem("2")
  257.     END SELECT
  258.     FDT_ClickShow()
  259. END PROC
  260.