home *** CD-ROM | disk | FTP | other *** search
- '***********************************************************************
- ' FormDev: FormChar.RLZ
- '
- ' Copyright ⌐ 1991-1992 Computer Associates International, Inc.
- ' All rights reserved.
- '
- '***********************************************************************
-
- PROC FormCharRawVals
- LOCAL fstr
-
- fstr = UnitFormatStr(theform.units)
- FormModifyObject(230, _Normal, Sprint(fstr, theform.rawleft))
- FormModifyObject(240, _Normal, Sprint(fstr, theform.rawtop))
- FormModifyObject(250, _Normal, Sprint(fstr, theform.rawwidth))
- FormModifyObject(260, _Normal, Sprint(fstr, theform.rawheight))
- FormModifyObject(270 + theform.units; 1)
- END PROC
-
- FUNC FormCharModal
- LOCAL fdFormChar, sel, c, msg
-
- fdFormChar = FormQUnique
- FormNew(fdFormChar; "Form Characteristics", _Title)
- FormControl(_Size; _Center, _Center, 90 pct, 80 pct)
-
- FormSetObject(21, _CaptionLeft, "Form Name: ", 3 pct, 4 pct)
- FormSetObject(20, _TextBox, theform.name, 20 pct, 3 pct, 20 pct, _Default)
- FormSetObject(22, _CaptionLeft, "Form Title: ", 43 pct, 4 pct)
- FormSetObject(25, _TextBox, theform.title, 58 pct, 3 pct, 39 pct, _Default)
-
- FormSetObject(220, _GroupBox,"Dimensions", 3 pct, 13 pct, 45 pct, 75 pct)
- FormSetObject(231, _CaptionLeft,"Left", 5 pct, 22 pct)
- FormSetObject(230, _TextBox,"", 13 pct, 21 pct, 9 pct, _Default)
- FormSetObject(241, _CaptionLeft,"Top", 27 pct, 22 pct)
- FormSetObject(240, _TextBox,"", 36 pct, 21 pct, 9 pct, _Default)
- FormSetObject(251, _CaptionLeft,"Width", 5 pct, 33 pct)
- FormSetObject(250, _TextBox,"", 13 pct, 32 pct, 9 pct, _Default)
- FormSetObject(261, _CaptionLeft, "Height", 27 pct, 33 pct)
- FormSetObject(260, _TextBox, "", 36 pct, 32 pct, 9 pct, _Default)
-
- FormSetObject(279, _CaptionLeft, "Units for form:", 5 pct, 47 pct)
- FormSetObject(271, _OptionButton, "pxl", 8 pct, 53 pct; _Notify, 1, 4)
- FormSetObject(272, _OptionButton, "pct", 17 pct, 53 pct; _Notify, 0, 4)
- FormSetObject(273, _OptionButton, "in", 26 pct, 53 pct; _Notify, 0, 4)
- FormSetObject(274, _OptionButton, "mm", 35 pct, 53 pct; _Notify, 0, 4)
-
- FormSetObject(299, _CaptionLeft, "Units for items:", 5 pct, 64 pct)
- FormSetObject(291, _RadioButton, "same unit as form", 10 pct, 70 pct; 1, 2)
- FormSetObject(292, _RadioButton, "percentage of form", 10 pct, 78 pct; 0, 2)
- FormModifyObject(290 + theform.itemunits; 1)
- FormModifyObject(293 - theform.itemunits; 0)
-
- FormSetObject(101,_GroupBox, "Style", 50 pct, 13 pct, 23 pct, 75 pct)
- FormSetObject(100,_CheckBox,"Close", 52 pct, 21 pct; bitand(theform.style, _Close))
- FormSetObject(110,_CheckBox,"Frame", 52 pct, 29 pct; bitand(theform.style, _Frame))
- FormSetObject(120,_CheckBox,"Size", 52 pct, 37 pct; bitand(theform.style, _Size))
- FormSetObject(130,_CheckBox,"Title", 52 pct, 45 pct; bitand(theform.style, _Title))
- FormSetObject(140,_CheckBox,"Minimize", 52 pct, 53 pct; bitand(theform.style, _Minimize))
- FormSetObject(150,_CheckBox,"Context Enter", 52 pct, 67 pct; bitand(theform.style, _ContextEnter))
- FormSetObject(160,_CheckBox,"Hot Click", 52 pct, 75 pct; bitand(theform.style, _HotClick))
-
- FormSetObject(51, _GroupBox, "Type", 75 pct, 13 pct, 22 pct, 26 pct)
- FormSetObject(60, _RadioButton, "Modal", 77 pct, 20 pct; theform.type = 60, 3)
- FormSetObject(50, _RadioButton, "Modeless", 77 pct, 28 pct; theform.type = 50, 3)
-
- FormSetObject(4, _Button, "Color...", 77 pct, 43 pct, 18 pct, 9 pct)
- FormSetObject(3, _Button,"Setup...", 77 pct, 55 pct, 18 pct, 9 pct)
- FormSetObject(2, _Button,"Cancel", 77 pct, 67 pct, 18 pct, 9 pct)
- FormSetObject(1, _DefButton,"OK", 77 pct, 79 pct, 18 pct, 9 pct)
-
- FormSetColor(_Gray; _Field)
- FormSetObject(290, _GroupBox, "", 7 pct, 61 pct, 37 pct, 1 pct)
- FormSetObject(102, _GroupBox, "", 52 pct, 64 pct, 19 pct, 1 pct)
- FormSetObject(270, _GroupBox, "", 7 pct, 44 pct, 37 pct, 1 pct)
- FormSetColor(_White; _Field)
-
- FormCharRawVals
- LOOP
- FormSelect(fdFormChar)
- sel = FormWait
- SELECT CASE sel
- CASE 1 ' Ok
- IF ValidFormName(FormQStr(20)) THEN
- EXIT LOOP
- END IF
- FormSetFoc(20)
-
- CASE 2 ' Cancel
- FormControl(_Close)
- RETURN 0
-
- CASE 3 'Setup
- SetupModal
-
- CASE 4 'Color
- c = StdColor(theform.bgcolor, "Select a color for the form background")
- IF QVar(c, _Scalar) THEN
- IF c = 0 THEN
- EXIT SELECT
- END IF
- END IF
- theform.bgcolor = c
-
- CASE 271 TO 274
- theform.units = sel - 270
- RecalcRawFromPixels
- FormCharRawVals
- END SELECT
- END LOOP
- theform.rawleft = StrToNum(FormQStr(230))
- theform.rawtop = StrToNum(FormQStr(240))
- theform.rawwidth = StrToNum(FormQStr(250))
- theform.rawheight = StrToNum(FormQStr(260))
- RecalcPixelsFromRaw
- theform.name = FormQStr(20)
- theform.title = FormQStr(25)
-
- ' Get the style information.
- theform.style = FormQNum(120)*_Size + FormQNum(130)*_Title
- IF NOT theform.style THEN 'Cant mix frame and the previous two
- theform.style = FormQNum(110)*_Frame
- END IF
- theform.style = theform.style + FormQNum(100)*_Close
- theform.style = theform.style + FormQNum(140)*_Minimize
- theform.style = theform.style + FormQNum(150)*_ContextEnter
- theform.style = theform.style + FormQNum(160)*_HotClick
-
- ' Pull out the type information.
- theform.type = 50 * FormQNum(50) + 60 * FormQNum(60)
-
- 'Pull out item units
- theform.itemunits = 1 + FormQNum(292)
-
- MainFormCreate
- FormControl(_Show)
- FormSelect(fdFormChar)
- FormControl(_Close)
- RETURN 1
- END FUNC
-
-