home *** CD-ROM | disk | FTP | other *** search
- '***********************************************************************
- ' FDT_Main.RLZ
- '
- ' Copyright ⌐ 1991-1992 Computer Associates International, Inc.
- ' All rights reserved.
- '
- '***********************************************************************
-
- PROC FDT_BigHelpP (v)
- IF v[_Invoke] = _Close THEN
- EXIT PROC
- END IF
- SELECT CASE v[_ItemNum]
- CASE 7 ' Overview
- FDT_Overview(0)
- CASE 8 ' Instructions
- FDT_Overview(1)
- CASE 9 ' Continue
- FormSelect(fdt_bigHelpF)
- FormControl(_Close)
- END SELECT
- END PROC
-
- PROC FDT_HideClicks ()
- LOCAL tv, msg
-
- FormSelect(fdt_clickF)
- FormControl(_Hide)
- IF FormQ(_Exists; fdt_infoF) THEN
- FormSelect(fdt_infoF)
- FormControl(_Close)
- END IF
- IF FormQ(_Exists; fdt_bigHelpF) THEN
- FormSelect(fdt_bigHelpF)
- FormControl(_Close)
- END IF
- tv = QSys(_Size)
- IF tv[1] <> _Maximize OR EndValid(tv) <> 1 THEN
- BEEP
- INPUT "Please keep Realizer full-screen for this tutorial.";
- SetSys(_Size, {_Maximize})
- END IF
- IF Sum(fdt_toolSize <> FormQ(_Size; toolForm)) THEN
- BEEP
- INPUT "Please do not move the Tool Palette during this tutorial.";
- FormSelect(toolForm)
- FormControl(_Restore)
- FormControl(_Size; fdt_toolSize[1], fdt_toolSize[2], fdt_toolSize[3], fdt_toolSize[4])
- END IF
- IF Sum(fdt_mainSize <> FormQ(_Size; fdMain)) THEN
- BEEP
- INPUT "Please do not move or resize the form during this tutorial.";
- FormSelect(fdMain)
- FormControl(_Restore)
- FormControl(_Size; fdt_mainSize[1], fdt_mainSize[2], fdt_mainSize[3], fdt_mainSize[4])
- END IF
- IF fdt_state > 10 THEN
- FormSelect(fdMain)
- msg = ""
- tv = FormQObject(40)
- IF tv[_FQO_Top] < QB(30) THEN
- msg = "Please do not overlap the caption with the chart."
- ELSEIF tv[_FQO_Top] + tv[_FQO_Height] > fdt_maxChartBot THEN
- msg = "Please do not overlap the buttons with the chart."
- ELSEIF tv[_FQO_Height] < 0.3 * fdt_clientSize[4] OR tv[_FQO_Width] < 0.3 * fdt_clientSize[3] THEN
- msg = "Please do not make the chart so small."
- END IF
- IF msg <> "" THEN
- BEEP
- INPUT msg;
- tv[_FQO_Top] = MAX(tv[_FQO_Top], QB(30))
- tv[_FQO_Width] = MAX(tv[_FQO_Width], 0.301 * fdt_clientSize[3])
- tv[_FQO_Height] = MAX(tv[_FQO_Height], 0.301 * fdt_clientSize[4])
- tv[_FQO_Height] = MIN(tv[_FQO_Height], fdt_maxChartBot - QB(30))
- tv[_FQO_Left] = MIN(tv[_FQO_Left], fdt_clientSize[3] - tv[_FQO_Width])
- tv[_FQO_Top] = MIN(tv[_FQO_Top], fdt_maxChartBot - tv[_FQO_Height])
- FormModifyObject(40, _Normal, tv[_FQO_Left], tv[_FQO_Top], tv[_FQO_Width], tv[_FQO_Height])
- END IF
- END IF
- END PROC
-
- FUNC FDT_Lims ()
- LOCAL lims
- SELECT CASE fdt_state
- CASE 1
- lims = {0.0, 0.85, 0.2, 0.95}
- CASE 3
- lims = {0.7, 0.85, 0.95, 0.95}
- CASE 6
- lims = {0.1, 0.0, 0.8, 0.2}
- CASE 9
- lims = {0.0, 0.1, 0.1, 0.2}
- CASE ELSE
- RETURN 0
- END SELECT
- RETURN (lims * {fdt_clientSize[3:4], fdt_clientSize[3:4]})
- END FUNC
-
- PROC FDT_FormP (v)
- LOCAL tv
-
- IF v[_Invoke] = _Close THEN
- EXIT PROC
- END IF
-
- PROC GetTool (item_ID)
- IF Sum(v = {_Click, toolForm, item_ID}) >= 3 THEN
- ToolProc(v)
- fdt_smallStep = fdt_smallStep + 1
- fdt_state = fdt_state + 1
- FDT_GuideMsg()
- ELSE
- BEEP
- FDT_GuideMsg()
- END IF
- END PROC
-
- PROC GetOptions (rsID)
- LOCAL tv
- tv = FormQObject(rsID)
- IF Sum(fdt_frameV[_FQO_Width:_FQO_Height] <> tv) THEN
- INPUT "Please do not resize text or button items during this tutorial. The tutorial is using Options... to control these sizes.";
- FormModifyObject(rsID, _Normal, fdt_frameV[_FQO_Left], fdt_frameV[_FQO_Top], fdt_frameV[_FQO_Width], fdt_frameV[_FQO_Height])
- tv = FormQObject(rsID)
- END IF
- IF fdt_state < 5 AND tv[_FQO_Top] < 0.85 * fdt_clientSize[4] THEN
- INPUT "Please do not position the buttons that high on the form during this tutorial.";
- FormModifyObject(rsID, _Normal, tv[_FQO_Left], 0.85 * fdt_clientSize[4], fdt_frameV[_FQO_Width], fdt_frameV[_FQO_Height])
- END IF
- fdt_frameV = FormQObject(rsID)
- FormModifyObject(rsID, _SetFocus)
- IF Sum(v = {_Click, toolForm, 32762}) >= 3 THEN
- FDT_InitVisualForms()
- ToolProc(v)
- FormSelect(fdVisOption)
- FormControl(_Close)
- fdt_state = fdt_state + 1
- fdt_bigStep = fdt_bigStep + 1
- fdt_smallStep = 1
- FDT_GuideMsg()
- ELSE
- BEEP
- FDT_GuideMsg()
- END IF
- END PROC
-
- PROC GetDrop ()
- LOCAL x, y, lims, msg
-
- PROC AddMsg (s)
- IF msg = "" THEN
- msg = "A little bit " + s
- ELSE
- msg = msg + " and " + s
- END IF
- END PROC
-
- IF Sum(v = {_Click, fdMain, 32767}) >= 3 THEN
- x = v[_XPos]
- y = v[_YPos]
- lims = FDT_Lims()
- msg = ""
- IF y < lims[2] THEN
- AddMsg("lower")
- ELSEIF y > lims[4] THEN
- AddMsg("higher")
- END IF
- IF x < lims[1] THEN
- AddMsg("to the right")
- ELSEIF x > lims[3] THEN
- AddMsg("to the left")
- END IF
- IF msg = "" THEN
- fdt_state = fdt_state + 1
- fdt_smallStep = fdt_smallStep + 1
- MainProc(v)
- fdt_frameV = FormQObject()
- FDT_GuideMsg()
- IF fdt_state = 10 THEN
- FormSelect(fdMain)
- FormSetColor(fdt_c.gText; _Field)
- FormSetColor(fdt_c.gBack; _Text)
- 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")
- FormSetColor(_White; _Field)
- FormSetColor(_Black; _Text)
- END IF
- ELSE
- BEEP
- FDT_GuideMsg(msg + ".")
- END IF
- ELSE
- BEEP
- FDT_GuideMsg()
- END IF
- END PROC
-
- PROC GetActItem (asID)
- IF Sum(v = {_Click, fdMain, StrToItemID(asID)}) >= 3 THEN
- ToolOn(14) ' back to the chart
- FDT_Action(StrToNum(asID))
- fdt_state = fdt_state + 1
- fdt_bigStep = fdt_bigStep + 1
- fdt_smallStep = 1
- FDT_GuideMsg()
- ELSE
- BEEP
- FDT_GuideMsg()
- END IF
- END PROC
-
- FDT_HideClicks()
-
- FormSelect(fdMain)
- SELECT CASE fdt_state
- CASE 1, 3, 6, 9
- GetDrop()
- CASE 2
- GetOptions(10)
- CASE 4
- GetOptions(20)
- CASE 5
- fdt_maxChartBot = MIN(FormQObject(StrToItemID("1"))[_FQO_Top], FormQObject(StrToItemID("2"))[_FQO_Top])
- GetTool(31006)
- CASE 7
- GetOptions(30)
- CASE 8
- GetTool(31014)
- CASE 10
- IF Sum(v = {_Click, fdMain, 40}) >= 3 THEN
- FormSelect(fdMain)
- tv = FormQObject(40)
- IF tv[_FQO_Top] < QB(30) THEN
- BEEP
- FDT_GuideMsg("Please do not overlap the caption.")
- ELSEIF tv[_FQO_Top] + tv[_FQO_Height] > fdt_maxChartBot THEN
- BEEP
- FDT_GuideMsg("Please do not overlap the buttons.")
- ELSE
- fdt_state = fdt_state + 1
- fdt_bigStep = fdt_bigStep + 1
- fdt_smallStep = 1
- FDT_GuideMsg()
- FormSelect(fdMain)
- FormModifyObject(40, _SetColor, "Chart 40")
- END IF
- ELSE
- BEEP
- FDT_GuideMsg()
- END IF
- CASE 11, 13, 15, 16 ' These must happen at FDT_MenuP
- BEEP
- FDT_GuideMsg()
- CASE 12
- GetActItem("1")
- CASE 14
- GetActItem("2")
- END SELECT
- FDT_ClickShow()
- END PROC
-