home *** CD-ROM | disk | FTP | other *** search
- '***********************************************************************
- ' FormDev: Forms.RLZ
- '
- ' Copyright ⌐ 1991-1992 Computer Associates International, Inc.
- ' All rights reserved.
- '
- '***********************************************************************
-
- PROC FormSizeForWidHt (freeID, desiredWid, desiredHt)
- LOCAL widHt
- ' Set the size of the current form to exactly contain object(s) whose total
- ' width and height are given.
- ' freeID is an available object id. Caller should _Close it if not re-used.
- FormSetObject(freeID, _Button, "x", 0, 0, 100pct, 100pct)
- widHt[1:2] = FormQObject(freeID)[_FQO_Width:_FQO_Height]
- widHt = FormQ(_Size)[+2] - widHt ' this is delta between FormQ(_Size) and a full-size object.
- FormSetObject(freeID, _Button, "x", 0, 0, desiredWid, desiredHt)
- widHt = FormQObject(freeID)[+(_FQO_Width - 1)] + widHt
- FormControl(_Size; _Default, _Default, widHt[1], widHt[2])
- END PROC
-
-
- PROC InitTool
- LOCAL bmdir, objInfo, scaleF, bmWid, bmHt
- LOCAL butHt, txtHt, xPos1, xPos2, i, yPos, yBut
-
- toolForm = FormQUnique
- FormNew(toolForm;" Tools", _Title + _HotClick)
- FormSetColor(_LightGray; _Background)
- bmdir = QSys(_ProgDir)
- FormSetObject(31001, _BitMapButton, bmdir + "Pal1.BMP", 0, 0)
- objInfo = FormQObject(31001)
-
- scaleF = IF _HPxlPerInch > 100 THEN 1.5 ELSE 1.0
- bmWid = objInfo[_FQO_Width] * scaleToolBmp
- bmHt = objInfo[_FQO_Height] * scaleToolBmp
-
- FormSetObject(1, _Button, "Options...", font_B, 0, 0)
- butHt = FormQObject(1)[_FQO_Height]
- FormSetObject(1, _CaptionLeft, "", font_B, 0, 0)
- txtHt = FormQObject(1)[_FQO_Height]
- FormControl(_Size; 10 pxl, 10 pxl)
- FormSizeForWidHt(1, bmWid * 2, bmHt * 8 + 3 + 3 * butHt + 4 * txtHt + 1)
- FormModifyObject(1, _Close)
-
- xPos1 = 0
- xPos2 = bmWid
- yPos = bmHt
-
- FormSetObject(29998, _Bitmap, bmdir + "White.BMP", 0, 0, 100pct, 100pct)
- FormSetColor(_LightGray; _Text)
- FormSetColor(_LightGray; _Field)
- FormSetObject(29999, _GroupBox, "", 0, 0, 100pct, 100pct)
- FormModifyObject(29999, _Gray)
- FormSetColor(_Tan; _Text)
- FormSetColor(_Tan; _Field)
- FormSetObject(30000, _GroupBox, "", xPos1, yPos * (3 - Ceil(3 / 2)), xPos2 * 2, 3)
- FormModifyObject(30000, _Gray)
-
- FormSetObject(31001, _BitMapButton, bmdir + "Pal1.BMP", xPos1, 0, bmWid, bmHt)
- FormSetObject(31002, _BitMapButton, bmdir + "Pal2.BMP", xPos2, 0, bmWid, bmHt)
- FormSetObject(32001, _BitMap, bmdir + "On1.BMP", 20 in, 0, bmWid, bmHt)
- FormModifyObject(32001, _Gray)
- FormSetObject(32002, _BitMap, bmdir + "On2.BMP", 20 in, 0, bmWid, bmHt)
- FormModifyObject(32002, _Gray)
-
- FOR i = 3 TO 16 STEP 2
- FormSetObject(31000 + i, _BitMapButton, SPrint("&PalP(0).BMP", bmdir, i), xPos1, yPos * (i - Ceil(i / 2)) + 3, bmWid, bmHt)
- FormSetObject(32000 + i, _BitMap, SPrint("&OnP(0).BMP", bmdir, i), 20 in, yPos * (i - Ceil(i / 2)) + 3, bmWid, bmHt)
- FormModifyObject(32000 + i, _Gray)
- FormSetObject(31000 + (i + 1), _BitMapButton, SPrint("&PalP(0).BMP", bmdir, i + 1), xPos2, yPos * (i - Ceil(i/2)) + 3, bmWid, bmHt)
- FormSetObject(32000 + (i + 1), _BitMap, SPrint("&OnP(0).BMP", bmdir, i + 1), 20 in, yPos * (i - Ceil(i/2)) + 3, bmWid, bmHt)
- FormModifyObject(32000 + (i + 1), _Gray)
- NEXT i
-
- FormSetColor(_Black; _Text)
- FormSetColor(_White; _Field)
- yBut = yPos * (17 - Ceil(17/2)) + 3
- FormSetObject(32762, _Button, "Options...", font_B, xPos1, yBut, xPos2 * 2, _Default)
- yBut = yBut + butHt + 1
-
- FormSetColor(_LightGray; _Field)
- FormSetColor(_Black; _Text)
- FormSetObject(32750, _CaptionLeft, "", font_B, 1.1, yBut, xPos2 * 2, _Default)
- yBut = yBut + txtHt
- FormSetObject(32751, _CaptionLeft, "Color", font_B, 1.1, yBut)
- yBut = yBut + txtHt
- FormSetObject(32752, _CaptionCenter, "Text", font_P, 0, yBut, 100pct, _Default)
- yBut = yBut + txtHt
- FormSetColor(_LightGray; _Field)
- FormSetColor(_Black; _Text)
- FormSetObject(32753, _CaptionLeft, "", font_P, 1.1, yBut, xPos2 * 2, _Default)
- yBut = yBut + txtHt
- FormSetObject(32760, _Button, "Color...", font_B, xPos1, yBut, xPos2 * 2, _Default)
- yBut = yBut + butHt
- FormSetObject(32761, _Button, "Font...", font_B, xPos1, yBut, xPos2 * 2, _Default)
-
- FormSetProc(ToolProc)
- currentOn = 0
- ToolOn(4)
- END PROC
-
-
- ' Option button form
- PROC InitVisualForms
- fdVisOption = FormQUnique
- FormNew(fdVisOption; "Item Attributes", _Title)
- FormControl(_Size; 52 pct, 35 pct, 46 pct, 62 pct)
-
- FormSetObject(31, _CaptionCenter, "Items", font_B, 5 pct, 25 pct, 56 pct, _Default)
- FormSetObject(30, _ListBox, "", font_P, 5 pct, 31 pct, 56 pct, 45 pct; ItemNames)
-
- FormSetObject(245, _Button, "Color...", font_B, 68 pct, 17 pct, 25 pct, _Default)
- FormSetObject(230, _Button, "Options...", font_B, 68 pct, 32 pct, 25 pct, _Default)
- FormSetObject(235, _Button, "Position...", font_B, 68 pct, 47 pct, 25 pct, _Default)
- FormSetObject(240, _Button, "Fonts...", font_B, 68 pct, 62 pct, 25 pct, _Default)
-
- FormSetObject(1 ,_DefButton, "OK", 8 pct, 84 pct)
- FormSetObject(2, _Button, "Cancel", 38 pct, 84 pct)
- FormSetObject(210, _Button ,"Delete", 68 pct, 84 pct)
-
- FormSetObject(5,_CaptionLeft, "Number:", font_B, 1.5 pct, 4 pct)
- FormSetObject(10,_TextBox, "", font_P, 19 pct, 3 pct, 13 pct, _Default)
- FormSetObject(15,_CaptionLeft, "Text:", font_B, 1.5 pct, 15 pct)
- FormSetObject(20,_TextBox, "", font_P,19 pct, 14 pct, 42 pct, _Default)
- FormSetObject(25, _CaptionLeft, "Total Items: 000", font_P, 70 pct, 1 pct, 39 pct, _Default)
-
- FormSetProc(ShutdownProc)
- END PROC
-