home *** CD-ROM | disk | FTP | other *** search
Wrap
'*********************************************************************** ' Preview.RLZ ' ' Copyright ⌐ 1991-1992 Computer Associates International, Inc. ' All rights reserved. ' '*********************************************************************** TRUE = 1 FALSE = 0 SetSys(_Size, {_Maximize}) RUN "Animate" FUNC FDT_Preview (b_firstTime) LOCAL preview_mode LOCAL title_delay, bmp_delay, read_delay, screen_delay LOCAL save_loadDir, save_macDir LOCAL fontHeading, fontHeadingHt, fontType, fontTypeHt LOCAL fontHilite, fontHiliteHt, fontSmall, fontSmallHt LOCAL fdtExists, selection, result LOCAL tf, thisOne, icon_name, s1, s2, maxRight LOCAL CRLF, rsID, lf, lfPct, tp, tpPct, frameNum preview_mode = 0 ' normal '' preview_mode = 1 ' automatic, does not show Next/Main Menu buttons. '' preview_mode = 2 ' test, Delay button instead of IDLE '' preview_mode = 3 ' blazes through delays, 1 BEEP per '' preview_mode = 4 ' blazing automatic title_delay = 2 bmp_delay = 3 read_delay = 6 screen_delay = 10 ' only matters when preview_mode = 1 CRLF = Chr$(13) + Chr$(10) FUNC QL (rsID) RETURN FormQObject(rsID)[_FQO_Left] END FUNC FUNC QT (rsID) RETURN FormQObject(rsID)[_FQO_Top] END FUNC FUNC QW (rsID) RETURN FormQObject(rsID)[_FQO_Width] END FUNC FUNC QH (rsID) RETURN FormQObject(rsID)[_FQO_Height] END FUNC FUNC QR (rsID) LOCAL v v = FormQObject(rsID) RETURN v[_FQO_Left] + v[_FQO_Width] END FUNC FUNC QB (rsID) LOCAL v v = FormQObject(rsID) RETURN v[_FQO_Top] + v[_FQO_Height] END FUNC PROC Delay (rsTime) LOCAL J SELECT CASE preview_mode CASE 0, 1 IDLE rsTime CASE 2 FormSetColor(_Turquoise; _Field) FormSetObject(10101, _Button, SPRINT("Delay P(0)", rsTime), _Right, _Bottom) IF FormWait() THEN END IF FormModifyObject(10101, _Close) CASE 3, 4 FOR J = 1 TO rsTime BEEP NEXT END SELECT END PROC PROC DoDelayCapt (capt) FormSetObject(rsID, _CaptionLeft, "- " + capt, fontType, lf, tpPct pct) rsID = rsID + 1 tpPct = tpPct + 7 Delay(1) END PROC PROC DelayBmp (rsID, bmName, lf, tp) FormSetObject(rsID, _Bitmap, bmName, lf, tp) FormModifyObject(rsID, _Gray) Delay(bmp_delay) END PROC PROC DoIcoCapt (bmName, capt) FormSetObject(rsID, _Bitmap, bmName, lfPct pct, tpPct pct) FormModifyObject(rsID, _Gray) FormSetObject(rsID+1, _CaptionLeft, capt, fontType, lfPct + 7 pct, tpPct + 1 pct) tpPct = tpPct + 10 rsID = rsID + 2 Delay(1) END PROC PROC BuildForm (rsID) FormNew(rsID; "", _Close) FormControl(_Size; _Center, _Center, 97pct, 95pct) FormSetColor(_Turquoise) FormSetColor(_Turquoise; _Field) FormSetObject(5, _CaptionLeft, "x", _Right, 0) maxRight = QR(5) FormSetObject(5, _Bitmap, icon_name, _Left, _Top, 50, 50) FormModifyObject(5, _Gray) FormSetObject(1, _Button, "x", 100pct, 100pct) 'focus eater FormControl(_Show) END PROC PROC RollStart (iconName) icon_name = iconName tf[1] = FormQUnique() tf[2] = FormQUnique() thisOne = tf[1] BuildForm(tf[1]) FormControl(_Show) END PROC FUNC RollWait (rw_mode) ' rw_mode 0: just Main Menu ' 1: Main Menu and Next, Closes form and returns 0 if user hits Main Menu. ' 2: just Main Menu, surrounded by a _Cyan _GroupBox LOCAL tv, extra, oldOne IF preview_mode = 1 OR preview_mode = 4 THEN Delay(screen_delay) ELSE FormSetColor(_Turquoise; _Field) IF rw_mode <> 1 THEN IF rw_mode = 0 THEN FormSetObject(1, _DefButton, "Main Menu", _Right, _Bottom) ELSE FormSetColor(_Cyan; _Field) FormSetObject(1, _DefButton, "Main Menu", 100pct, 100pct) tv = FormQObject(1) extra = tv[_FQO_Height] \ 2 FormSetObject(400, _GroupBox, "", _Right, _Bottom, tv[_FQO_Width] + 2 * extra, tv[_FQO_Height] + 2 * extra) tv = FormQObject(400) FormSetObject(1, _DefButton, "Main Menu", tv[_FQO_Left] + extra, tv[_FQO_Top] + extra) END IF IF FormWait() THEN END IF ELSE FormSetObject(2, _Button, "Main Menu", 100pct, 100pct) FormSetObject(1, _DefButton, "Next", _Right, _Bottom, QW(2), _Default) FormModifyObject(1, _SetFocus) FormModifyObject(2, _Normal, QL(1) - QW(1) - (QL(2) - QR(1)), _Bottom) IF FormWait() = 2 THEN FormControl(_Close) RETURN FALSE END IF END IF END IF IF rw_mode <> 1 THEN FormControl(_Close) RETURN TRUE ELSE oldOne = thisOne thisOne = IF thisOne = tf[1] THEN tf[2] ELSE tf[1] BuildForm(thisOne) FormSelect(oldOne) FormControl(_Close) FormSelect(thisOne) RETURN TRUE END IF END FUNC PROC CyanBox (rsID, font, lf, tp, nLines, sMeasure, sFull) LOCAL tv, wd, fht, ht FormSetObject(rsID, _CaptionLeft, sMeasure + " ", font, 100pct, 100pct) tv = FormQObject(rsID) wd = tv[_FQO_Width] fht = tv[_FQO_Height] ht = nLines * fht FormSetColor(_Cyan; _Field) FormSetObject(rsID, _GroupBox, "", lf, tp, wd + fht, ht + fht) tv = FormQObject(rsID) FormSetObject(rsID+1, _CaptionLeft, sFull, font, tv[_FQO_Left] + fht\2, tv[_FQO_Top] + 5*fht\12, wd, ht) FormSetColor(_Turquoise; _Field) END PROC PROC DoBmpCapt (bmName, capt) IF bmName = "" THEN rsID = 140 AnimateControl(_Start) ELSE FormSetObject(rsID, _Bitmap, bmName, lfPct pct, tpPct pct) FormModifyObject(rsID, _Gray) END IF FormSetObject(rsID+1, _CaptionLeft, capt, fontType, lfPct + 8 pct, tpPct + 1 pct) rsID = rsID + 2 lfPct = lfPct + 5 tpPct = tpPct + 13 Delay(1) END PROC FUNC MainMenu (focusButton) LOCAL result IF preview_mode = 1 OR preview_mode = 4 THEN IF focusButton = 120 THEN RETURN 100 ELSE RETURN focusButton END IF END IF FormNew(FormQUnique(); "", _Close) FormControl(_Size; _Center, _Center, 97 pct, 65 pct) FormSetColor(_Turquoise; _Background) FormSetColor(_Turquoise; _Field) FormSetObject(5, _Bitmap, "RlzIcon.BMP", _Left, _Top, 50, 50) FormModifyObject(5, _Gray) FormSetObject(10, _CaptionLeft, "Main Menu", fontHeading, _Center, 1 pct) s1 = "The Overviews will introduce you to some of Realizer's features." s2 = "The Tutorial will teach you how to build a simple application." FormSetObject(20, _CaptionLeft, s1, fontType, _Center, 19 pct) FormSetObject(30, _CaptionLeft, s2, fontType, QL(20), 27 pct) IF NOT QVar(fdt_steps) AND focusButton <> 120 THEN s1 = "Use the space bar to step through the Overviews in sequence." FormSetObject(40, _CaptionCenter, s1, fontHilite, QL(20), 36pct, QW(20), _Default) END IF PROC DoButtons (rsID, title, bmName, lf, tp) FormSetObject(rsID, _Button, title, lf pct, tp pct, 25 pct, _Default) FormSetObject(rsID+1, _BitmapButton, bmName, lf-7 pct, tp pct) FormModifyObject(rsID+1, _Gray) END PROC DoButtons(130, "Introduction", "RlzIcon.BMP", 20, 50) DoButtons(100, "Realizer Overview", "RlzIcon.BMP", 20, 70) DoButtons(110, "FormDev Overview", "FDevIcon.BMP", 60, 50) DoButtons(120, "FormDev Tutorial", "FDevIcon.BMP", 60, 70) IF NOT fdtExists THEN FormModifyObject(120, _Gray) END IF FormSetObject(2, _Button, "Quit", _Center, 88 pct, 15 pct, _Default) FormModifyObject(focusButton, _SetFocus) result = FormWait() IF result = 1 THEN result = FormQObject()[_FQO_ItemNum] END IF FormControl(_Close) RETURN result END FUNC PROC Intro () LOCAL wd RollStart("RlzIcon") FormSetObject(10, _CaptionLeft, "Welcome to Realizer...", fontHeading, 50 pct, 100 pct) FormSetObject(20, _CaptionLeft, " The Complete", fontType, 100 pct, 100 pct) wd = QW(10) + QW(20) FormModifyObject(10, _Gray, QL(10) - wd\2, 1pct) FormModifyObject(20, _Gray, QR(10), QT(10) + 2*fontTypeHt\3) s1 = "Application Development Environment for Windows." FormSetObject(30, _CaptionCenter, s1, fontType, _Center, QB(10) + fontTypeHt\5) Delay(title_delay) DelayBmp(101, "Chart2", _Left, 18 pct) DelayBmp(102, "Expense", 50 pct, 20 pct) DelayBmp(103, "Chart1", 2 pct, 55 pct) DelayBmp(104, "Sheet", 25 pct, 48 pct) CyanBox(200, fontHilite, _Right, _Center, 4, "professional Windows applications,", "Realizer makes it easy to build professional Windows applications, even if you know little about Windows or programming.") Delay(read_delay) FormModifyObject(200, _Close) FormModifyObject(201, _Close) s1 = "Realizer combines a structured superset of BASIC, " s2 = " visual interface design, and high-level building block tools, making it the easiest" s2 = s2 + " and most powerful Windows development system." CyanBox(200, fontHilite, 1 pct, 70 pct, 4, s1, s1 + s2) Delay(read_delay) IF RollWait(2) THEN END IF END PROC save_loadDir = QSys(_LoadDir) save_macDir = QSys(_MacroDir) IF QVar(fdt_steps) THEN fdtExists = 1 ELSE SetSys(_LoadDir, save_macDir) fdtExists = FileQ(FileQ("FD_TUTOR.RLZ", _Name), _Exists) END IF SetSys(_LoadDir, QSys(_ProgDir) + "Demos\Preview") SetSys(_MacroDir, QSys(_ProgDir) + "Demos\Preview") PROC DoFont (rsID, fontHt, fontName, fontSize, fontStyle) rsID = FontQUnique() FontNew(rsID; fontName, fontSize, fontStyle) FormSetObject(1, _CaptionLeft, "x", rsID, 0, 0) fontHt = QH(1) END PROC FormNew(FormQUnique()) DoFont(fontHeading, fontHeadingHt, "Helv", 24, _Bold) DoFont(fontType, fontTypeHt, "Helv", 12, _Bold) DoFont(fontHilite, fontHiliteHt, "Helv", 10, 0) DoFont(fontSmall, fontSmallHt, "Helv", 8, _Bold) FormControl(_Close) IF b_firstTime THEN selection = 130 b_firstTime = FALSE ELSE selection = MainMenu(120) END IF LOOP SELECT CASE selection CASE 100 ' Realizer overview RUN "RlzOver" selection = MainMenu(110) CASE 110 ' FormDev overview RUN "FDevOver" selection = MainMenu(120) CASE 120 ' FormDev Tutorial result = 12 EXIT LOOP CASE 130 ' Introduction Intro() selection = MainMenu(100) CASE 2 ' Quit result = 11 EXIT LOOP CASE ELSE selection = MainMenu(100) END SELECT END LOOP SetSys(_LoadDir, save_loadDir) SetSys(_MacroDir, save_macDir) FontSelect(fontHeading) FontControl(_Close) FontSelect(fontType) FontControl(_Close) FontSelect(fontHilite) FontControl(_Close) FontSelect(fontSmall) FontControl(_Close) RETURN result END FUNC LOCAL fdt_preview_first fdt_preview_first = 1 WHILE FDT_Preview(fdt_preview_first) = 12 fdt_preview_first = 0 RUN "FD_TUTOR" IF QVar(fdt_steps) THEN EXIT WHILE END IF END WHILE IF NOT QVar(fdt_steps) THEN RESET END IF