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

  1. '***********************************************************************
  2. '    FDT_Init.RLZ
  3. '
  4. '    Copyright ⌐ 1991-1992 Computer Associates International, Inc.
  5. '    All rights reserved.
  6. '
  7. '    FDT_Init, FDT_Reset, FDT_Exit, FDT_Congrat
  8. '
  9. '***********************************************************************
  10.  
  11. PROC FDT_Init ()
  12.     LOCAL    tv
  13.  
  14.     FormSelect(toolForm)
  15.     ToolOn(4)
  16.     FormSetProc(FDT_FormP)    ' was ToolProc
  17.     FormSelect(fdMain)
  18.     fdt_mainSize = FormQ(_Size)
  19.     FormSetObject(101, _CaptionLeft, "", 0, 0, 100pct, 100pct)
  20.     fdt_clientSize = FormQObject(101)[+_FQO_Left - 1][1:4]
  21.     FormModifyObject(101, _Close)
  22.     FormSetProc(FDT_FormP)    ' was MainProc
  23.  
  24.     MenuSelect(fdFileMenu)
  25.     MenuSetProc(FDT_MenuP)
  26.     MenuSelect(fdEditMenu)
  27.     MenuSetProc(FDT_MenuP)
  28.     MenuSelect(fdFormMenu)
  29.     MenuSetProc(FDT_MenuP)
  30.     MenuSelect(fdAlignMenu)
  31.     MenuSetProc(FDT_MenuP)
  32.     MenuSelect(%%browserMenu)
  33.     MenuSetProc(FDT_MenuP)
  34.     MenuSelect(_WindowMenu)
  35.     MenuControl(_Hide)
  36.     MenuSelect(_HelpMenu)
  37.     MenuControl(_Hide)
  38.  
  39.     FormSelect(fdt_guideF)
  40.     FormSetProc(FDT_HelpP)
  41.     HelpSetProc(FDT_HelpP)
  42.  
  43.     EXTERNAL "user" PROC MoveWindow (word, word, word, word, word, word) ALIAS 56
  44.  
  45.     fdt_clickF = FormQUnique
  46.     FormNew(fdt_clickF; "Click Guide", _HotClick)
  47.     FormSetObject(12, _Bitmap, QSys(_ProgDir) + "FDT_CLIK", 0, 0)
  48.     tv = FormQObject(12)
  49.     IF scaleSplash > 1 THEN
  50.         tv[_FQO_Width:_FQO_Height] = tv[_FQO_Width:_FQO_Height] * scaleSplash
  51.         FormSetObject(12, _Bitmap, QSys(_ProgDir) + "FDT_CLIK", 0, 0, tv[_FQO_Width], tv[_FQO_Height])
  52.     END IF
  53.     MoveWindow(tv[_Hwnd], -1, -1, tv[_FQO_Width], tv[_FQO_Height], 0)
  54.     ResizeForm(0, 0, tv[_FQO_Width] - 2, tv[_FQO_Height] - 2)
  55.     fdt_clickFHt = tv[_FQO_Height]
  56.     FormSetProc(FDT_ClickP)
  57.  
  58.     fdt_infoF = FormQUnique
  59.  
  60.     fdt_bigHelpF = FormQUnique
  61.  
  62. fdt_userCaptions = {"Plot", "Quit", "Charting Demonstration"}
  63. fdt_actionCode = {"ChartLine(Rnd(40))",  "FormControl(_Close)"}
  64.  
  65. fdt_steps = {"Place a button in the lower left area of the form."}
  66. fdt_steps = {fdt_steps, "Click on the Options... button in the Tool Palette."}
  67. fdt_steps = {fdt_steps, "Place a button in the lower right portion of the form."}
  68. fdt_steps = {fdt_steps, "Click on the Options... button in the Tool Palette."}
  69. fdt_steps = {fdt_steps, "Select the Caption tool from the Tool Palette."}
  70. fdt_steps = {fdt_steps, "Place a caption toward the top of the form."}
  71. fdt_steps = {fdt_steps, "Click on the Options... button in the Tool Palette."}
  72. fdt_steps = {fdt_steps, "Select the Chart tool from the Tool Palette."}
  73. fdt_steps = {fdt_steps, "Place a chart in the middle of the screen."}
  74. fdt_steps = {fdt_steps, "Position and size the chart so that the buttons and caption are not obscured."}
  75. fdt_steps = {fdt_steps, "Select Action item... from the Edit menu."}
  76. fdt_steps = {fdt_steps, "Click on the " + fdt_userCaptions[1] + " button."}
  77. fdt_steps = {fdt_steps, "Select Action item... from the Edit menu."}
  78. fdt_steps = {fdt_steps, "Click on the " + fdt_userCaptions[2] + " button."}
  79. fdt_steps = {fdt_steps, "Select Save... from the File menu."}
  80.  
  81.     fdt_state = 1
  82.     fdt_bigStep = 0
  83.     fdt_smallStep = 0
  84. END PROC
  85.  
  86.  
  87. PROC FDT_Reset (completed)
  88.     LOCAL    schedCmd, progName
  89.  
  90.     SetAppName("")
  91.     FormSelect(fdt_guideF)
  92.     FormControl(_Close)
  93.     FormSelect(fdt_clickF)
  94.     FormControl(_Close)
  95.     IF FormQ(_Exists; fdt_infoF) THEN
  96.         FormSelect(fdt_infoF)
  97.         FormControl(_Close)
  98.     END IF
  99.     IF FormQ(_Exists; fdt_bigHelpF) THEN
  100.         FormSelect(fdt_bigHelpF)
  101.         FormControl(_Close)
  102.     END IF
  103.     MenuSelect(_WindowMenu)
  104.     MenuControl(_Show)
  105.     MenuSelect(_HelpMenu)
  106.     MenuControl(_Show)
  107.     RESET _Sched
  108.  
  109.     IF completed THEN
  110.         progName = LCase$(fdOpenPath) + "apptutor.rlz"
  111.         FDT_Congrat()
  112.         RESET _Form + _Menu
  113.         FDT_Notes(progName)
  114.         IF SchedSet(SPRINT("RUN ""&""", progname), QDate()) THEN
  115.         END IF
  116.         RESET _ALL - _Form - _Sched
  117.     ELSE
  118.         ' Eliminate the rest of the Tutorial stuff, leaving FormDev intact.
  119.         FormSelect(fdMain)
  120.         FormSetProc(MainProc)
  121.         FormSelect(toolForm)
  122.         FormSetProc(ToolProc)
  123.  
  124.         MenuSelect(fdFileMenu)
  125.         MenuSetProc(menuprocFile)
  126.         MenuSelect(fdEditMenu)
  127.         MenuSetProc(menuprocEdit)
  128.         MenuSelect(fdFormMenu)
  129.         MenuSetProc(menuprocForm)
  130.         MenuSelect(fdAlignMenu)
  131.         MenuSetProc(menuprocAlign)
  132.         MenuSelect(%%browserMenu)
  133.         MenuSetProc(%%BrowMenuProc)
  134.  
  135.         InitVisualForms()        ' rebuild original fdVisoption
  136.  
  137.         IF fdt_fB THEN
  138.             FontSelect(fdt_fB)
  139.             FontControl(_Close)
  140.             FontSelect(fdt_fP)
  141.             FontControl(_Close)
  142.             FontSelect(fdt_mB)
  143.             FontControl(_Close)
  144.             FontSelect(fdt_mP)
  145.             FontControl(_Close)
  146.         END IF
  147.  
  148.         CLEAR    fdt_actionCode, fdt_bigHelpF, fdt_bigStep, fdt_c, fdt_clickF, fdt_clickFHt, fdt_clientSize
  149.         CLEAR    fdt_fB, fdt_fht, fdt_fP, fdt_frameV, fdt_guideF, fdt_infoF, fdt_mainSize, fdt_maxChartBot
  150.         CLEAR    fdt_mB, fdt_mP, fdt_smallStep, fdt_state, fdt_steps, fdt_toolSize, fdt_userCaptions
  151.  
  152.         CLEAR    FDT_Action, FDT_AISizeValues, FDT_BigHelpP, FDT_BigHilight
  153.         CLEAR    FDT_BigH_1, FDT_BigH_3, FDT_BigH_4, FDT_BigH_5, FDT_BigH_7
  154.         CLEAR    FDT_ClickShow, FDT_ClickMsg, FDT_ClickP, FDT_Congrat
  155.         CLEAR    FDT_DlgFW, FDT_DlgPoint, FDT_EnabButtons, FDT_Exit
  156.         CLEAR    FDT_FormP, FDT_Frame, FDT_Frame2, FDT_GuideMsg, FDT_HelpP, FDT_HideClicks
  157.         CLEAR    FDT_InitVisualForms, FDT_Lims, FDT_ModalDone, FDT_ModalStart
  158.         CLEAR    FDT_MenuP, FDT_NextCap, FDT_Notes, FDT_Overview, FDT_Preview
  159.         CLEAR    FDT_Reset, FDT_Save, FDT_ShowBigHelp, FDT_TypeIn
  160.  
  161.         ' Restore the original VisAIModal.
  162.         IF SchedSet("RUN ""MenuEdit""", QDate()) THEN
  163.         END IF
  164.     END IF
  165.     IF SchedSet("SchedControl(_Stop)", QDate()) THEN
  166.     END IF
  167.     SchedControl(_Start)
  168.     EXIT PROGRAM
  169. END PROC
  170.  
  171.  
  172. PROC FDT_Exit ()
  173.     LOCAL    s, tv, fht, fullWid, lf, sectPad, linePad
  174.     LOCAL    oldP, oldB
  175.     oldP = fdt_fP
  176.     oldB = fdt_fB
  177.     fdt_fP = fdt_mP
  178.     fdt_fB = fdt_mB
  179.  
  180.     FormNew(FormQUnique; "Exit", 0)
  181.     FormSetColor(fdt_c.back)
  182.     FormSetColor(fdt_c.back; _Field)
  183.     FormSetColor(fdt_c.text; _Text)
  184.     s = "You have chosen to Exit the FormDev tutorial "
  185.     FormSetObject(101, _CaptionLeft, s, fdt_fB, 0, 0)
  186.     tv = FormQObject(101)
  187.     fht = tv[_FQO_Height]
  188.     fullWid = tv[_FQO_Width] + 10
  189.     ResizeForm(0, 0, fullWid + 2 * fht, _Default)
  190.     sectPad = fht
  191.     linePad = fht\2
  192.  
  193.     s = s + "before you finished it.  Do you want to:"
  194.  
  195.     FormSetObject(101, _CaptionLeft, s, fdt_fB, fht, fht, fullWid, 2 * fht)
  196.  
  197.     s = "Leave the tutorial and explore FormDev"
  198.     FormSetObject(11, _OptionButton, s, fdt_fB, _Center, QB(101) + sectPad)
  199.     lf = FormQObject(11)[_FQO_Left]
  200.     FormSetObject(11, _OptionButton, "Return to the tutorial", fdt_fB, lf, QB(101) + sectPad; 1)
  201.     FormSetObject(12, _OptionButton, s, fdt_fB, lf, QB(11) + linePad)
  202.     FormSetObject(13, _OptionButton, "Leave the tutorial and FormDev", fdt_fB, lf, QB(12) + linePad)
  203.     FormSetObject(14, _OptionButton, "Close Realizer", fdt_fB, lf, QB(13) + linePad)
  204.  
  205.     FormSetObject(1, _DefButton, "OK", fdt_fB, _Center, QB(14) + sectPad)
  206.     ResizeForm(_Center, _Center, _Default, QB(1) + fht)
  207.     FDT_Frame()
  208.     fdt_fP = oldP
  209.     fdt_fB = oldB
  210.     IF FormWait() = 1 THEN
  211.         IF FormQNum(12) THEN
  212.             FormControl(_Close)
  213.             FDT_Reset(0)            ' does not come back
  214.         ELSEIF FormQNum(13) THEN
  215.             SetAppName("")
  216.             RESET
  217.             EXIT PROGRAM
  218.         ELSEIF FormQNum(14) THEN
  219.             SetAppName("")
  220.             RESET
  221.             EXIT SYSTEM
  222.         END IF
  223.     END IF
  224.     FormControl(_Close)
  225. END PROC
  226.  
  227.  
  228. PROC FDT_Congrat ()
  229.     LOCAL    s, tv, fht, fullWid, lfTx, wdTx, rsID
  230.     LOCAL    oldB, oldP
  231.  
  232.     oldB = fdt_fB
  233.     fdt_fB = fdt_mB
  234.     oldP = fdt_fP
  235.     fdt_fP = fdt_mP
  236.     FormNew(FormQUnique; "Congratulations", 0)
  237.     FormSetColor(fdt_c.back)
  238.     FormSetColor(fdt_c.back; _Field)
  239.     FormSetColor(fdt_c.text; _Text)
  240.  
  241.     s = "You have finished creating the simple Realizer application.  "
  242.     FormSetObject(101, _CaptionLeft, s, fdt_fP, 0, 0)
  243.     tv = FormQObject(101)
  244.     fht = tv[_FQO_Height]
  245.     fullWid = tv[_FQO_Width] + 2 * fht
  246.     ResizeForm(0, 0, fullWid, _Default)
  247.     lfTx = fht
  248.     wdTx = fullWid - 2 * fht
  249.  
  250.     FormSetObject(100, _CaptionCenter, "Congratulations!", fdt_fB, lfTx, fht, wdTx, _Default)
  251.  
  252.     rsID = 100
  253.     s = s + "When you click on OK, the tutorial will leave FormDev and run your application."
  254.     FDT_NextCap(-1, 3, s)
  255.  
  256.     s = "We hope that you have found this tutorial informative."
  257.     s = s + "  You can find more information on using Realizer in the manuals"
  258.     s = s + " and readme files that come with the system."
  259.     FDT_NextCap(-1, 3, s)
  260.  
  261.     FormSetObject(1, _DefButton, "OK", fdt_fB, _Center, QB(rsID) + fht)
  262.     ResizeForm(_Center, _Center, _Default, QB(1) + fht)
  263.     FDT_Frame()
  264.     fdt_fB = oldB
  265.     fdt_fP = oldP
  266.     IF FormWait() THEN
  267.     END IF
  268.     FormControl(_Close)
  269. END PROC
  270.  
  271.  
  272. PROC FDT_Notes (progName)
  273.     LOCAL    s, tv, fht, fullWid, lfTx, wdTx, rsID
  274.  
  275.     FormNew(FormQUnique(); "Notes from the Tutorial", _Title + _Minimize + _Close)
  276.     FormSetColor(fdt_c.back)
  277.     FormSetColor(fdt_c.back; _Field)
  278.     FormSetColor(fdt_c.text; _Text)
  279.  
  280.     s = "You can open the program from Realizer's File menu "
  281.     FormSetObject(101, _CaptionLeft, s, fdt_fP, 0, 0)
  282.     tv = FormQObject(101)
  283.     fht = tv[_FQO_Height]
  284.     fullWid = tv[_FQO_Width] + 2 * fht + 2
  285.     ResizeForm(0, 0, fullWid, _Default)
  286.     lfTx = fht
  287.     wdTx = fullWid - 2 * fht
  288.  
  289.     rsID = 100
  290.     s = "The program you created is in the file """ + progName + """."
  291.     FDT_NextCap(-1, 2, s)
  292.  
  293.     s = "You can open the program from Realizer's File menu or from FormDev's File menu."
  294.     FDT_NextCap(-1, 2, s)
  295.  
  296.     s = "To run FormDev, select Execute from Realizer's File menu and run """
  297.     s = s + fdRlzDir + "formdev.rlz""."
  298.     FDT_NextCap(-1, 2, s)
  299.  
  300.     ResizeForm(_Right, _Top, _Default, QB(rsID) + fht)
  301.     FDT_Frame()
  302.     FormControl(_Show)
  303. END PROC
  304.