home *** CD-ROM | disk | FTP | other *** search
- '***********************************************************************
- ' FormDev: MainForm.RLZ
- '
- ' Copyright ⌐ 1991-1992 Computer Associates International, Inc.
- ' All rights reserved.
- '
- '***********************************************************************
-
- PROC MainFormNew
- LOCAL v
-
- theform.type = 50
- theform.name = "MyForm"
- theform.title = "Form1"
- theform.bgcolor = _White
- theform.init = ""
- theform.units = 1 'pixels
- theform.itemunits = 1 'same
- theform.style = _Close + _Minimize + _Title + _Size
- theform.saveflags = 8
- theform.bitmapdir = ""
- theform.linkdir = ""
-
- FormNew(fdMain)
- FormControl(_Size; 85/640, 20/442, 475/640, 375/442)
- v = FormQ(_Size)
- FormControl(_Close)
- theform.left = v[1]
- theform.top = v[2]
- theform.width = v[3]
- theform.height = v[4]
-
- theform.font = 0
- theform.fldC = ColorPack(_White)
- theform.txtC = ColorPack(_Black)
-
- SetupPaths
- viewForm = 1
-
- fdNumItems = 0
- fdNextItem = 10
- fdChanged = 0
- InitFonts
- CLEAR item
- END PROC
-
-
- PROC MainFormCreate
- FormNew(fdMain; theform.title, BitAnd(theform.style, _ALL - _HotClick - _Close) + _HotClick)
- FormSetColor(theform.bgcolor; _Background)
- FormSetColor(theform.bgcolor; _Field)
- FormSetColor(theform.bgcolor; _Text)
- FormSetObject(32767, _Bitmap, QSys(_ProgDir) + "White", 0, 0, 15in, 15in)
- FormSetObject(32766, _GroupBox, "", 0, 0, 15in, 15in)
- FormModifyObject(32766, _Gray)
- FormSetColor(_White; _Field)
- FormSetColor(_Black; _Text)
- FormSetProc(MainProc)
-
- FormControl(_Size; theform.left pxl, theform.top pxl, theform.width pxl, theform.height pxl)
- SetupPaths
- MenuEnable
- UpdateTool
- END PROC
-
-
- PROC MainFormLocate
- LOCAL iparams
-
- iparams = FormQ(_Size; fdMain)
- theform.left = iparams[1]
- theform.top = iparams[2]
- theform.width = iparams[3]
- theform.height = iparams[4]
- RecalcRawFromPixels
- MainClientLocate
- END PROC
-
-
- PROC MainClientLocate
- LOCAL fdTemp, iparams
-
- fdTemp = FormQ(_Selected)
- FormNew(FormQUnique; "", theform.style)
- FormControl(_Size; theform.left pxl, theform.top pxl, theform.width pxl, theform.height pxl)
- FormSetObject(10, _Frame, "", 0 pct, 0 pct, 100 pct, 100 pct)
- iparams = FormQObject(10)
- theform.cwidth = iparams[5]
- theform.cheight = iparams[6]
- FormControl(_Close)
- IF fdTemp THEN
- FormSelect(fdTemp)
- END IF
- END PROC
-
-
- FUNC MainFormResize(left, top, width, height)
- LOCAL sel, iparams
-
- FormNew(FormQUnique)
- FormControl(_Size; _Center, _Center, 100 pct, 100 pct)
- FormSetObject(10, _Frame, "Size and position the form." + Chr$(13) + Chr$(10) + "Press ENTER when finished.", left, top, width, height)
- LOOP
- SELECT CASE FormWait
- CASE 2 'Cancel
- FormControl(_Close)
- RETURN 0
- CASE 1 'ENTER
- EXIT LOOP
- END SELECT
- END LOOP
- iparams = FormQObject(10)
- theform.left = iparams[3]
- theform.top = iparams[4]
- theform.width = iparams[5]
- theform.height = iparams[6]
- RecalcRawFromPixels
- FormControl(_Close)
- RETURN 1
- END FUNC
-
-
- FUNC MainFormModify(modType, ..)
- ' modType signals which code segments in MainFormModify execute. Values are:
- ' 0 - Resize only.
- ' 1 - Modify Form only.
- ' 2 - Resize and Modify Form.
- ' optional parameters are current size of form in pixels
- '
- ' Returns 1 for OK and 0 for Cancel
-
- LOCAL rv
-
- IF (modType = 0) OR (modType = 2) THEN
- IF QNOptParams THEN 'Modify current form
- rv= MainFormResize(QOptParam(1), QOptParam(2), QOptParam(3), QOptParam(4))
- ELSE 'New form
- rv= MainFormResize(_Center, _Center, 90 pct, 90 pct)
- END IF
- IF rv = 0 THEN
- RETURN 0
- END IF
- IF (modType = 0) THEN
- MainFormCreate
- END IF
- ELSE
- theform.left = QOptParam(1)
- theform.top = QOptParam(2)
- theform.width = QOptParam(3)
- theform.height = QOptParam(4)
- RecalcRawFromPixels
- END IF
- IF (modType >= 1) THEN
- RETURN FormCharModal
- END IF
- RETURN 1
- END FUNC
-