home *** CD-ROM | disk | FTP | other *** search
/ TestDrive Super Store 3.0 / TESTDRIVE_3.ISO / realizer / formdev / forms.rlz < prev    next >
Encoding:
Text File  |  1992-09-30  |  5.4 KB  |  130 lines

  1. '***********************************************************************
  2. '    FormDev: Forms.RLZ
  3. '
  4. '    Copyright ⌐ 1991-1992 Computer Associates International, Inc.
  5. '    All rights reserved.
  6. '
  7. '***********************************************************************
  8.  
  9. PROC FormSizeForWidHt (freeID, desiredWid, desiredHt)
  10.     LOCAL    widHt
  11.     ' Set the size of the current form to exactly contain object(s) whose total
  12.     ' width and height are given.
  13.     ' freeID is an available object id.  Caller should _Close it if not re-used.
  14.     FormSetObject(freeID, _Button, "x", 0, 0, 100pct, 100pct)
  15.     widHt[1:2] = FormQObject(freeID)[_FQO_Width:_FQO_Height]
  16.     widHt = FormQ(_Size)[+2] - widHt        ' this is delta between FormQ(_Size) and a full-size object.
  17.     FormSetObject(freeID, _Button, "x", 0, 0, desiredWid, desiredHt)
  18.     widHt = FormQObject(freeID)[+(_FQO_Width - 1)] + widHt
  19.     FormControl(_Size; _Default, _Default, widHt[1], widHt[2])
  20. END PROC
  21.  
  22.  
  23. PROC InitTool
  24.     LOCAL    bmdir, objInfo, scaleF, bmWid, bmHt
  25.     LOCAL    butHt, txtHt, xPos1, xPos2, i, yPos, yBut
  26.  
  27.     toolForm = FormQUnique
  28.     FormNew(toolForm;" Tools", _Title + _HotClick)
  29.     FormSetColor(_LightGray; _Background)
  30.     bmdir = QSys(_ProgDir)
  31.     FormSetObject(31001, _BitMapButton, bmdir + "Pal1.BMP", 0, 0)
  32.     objInfo = FormQObject(31001)
  33.  
  34.     scaleF = IF _HPxlPerInch > 100 THEN 1.5 ELSE 1.0
  35.     bmWid = objInfo[_FQO_Width] * scaleToolBmp
  36.     bmHt = objInfo[_FQO_Height] * scaleToolBmp
  37.  
  38.     FormSetObject(1, _Button, "Options...", font_B, 0, 0)
  39.     butHt = FormQObject(1)[_FQO_Height]
  40.     FormSetObject(1, _CaptionLeft, "", font_B, 0, 0)
  41.     txtHt = FormQObject(1)[_FQO_Height]
  42.     FormControl(_Size; 10 pxl, 10 pxl)
  43.     FormSizeForWidHt(1, bmWid * 2, bmHt * 8 + 3 + 3 * butHt + 4 * txtHt + 1)
  44.     FormModifyObject(1, _Close)
  45.  
  46.     xPos1 = 0
  47.     xPos2 = bmWid
  48.     yPos = bmHt
  49.  
  50.     FormSetObject(29998, _Bitmap, bmdir + "White.BMP", 0, 0, 100pct, 100pct)
  51.     FormSetColor(_LightGray; _Text)
  52.     FormSetColor(_LightGray; _Field)
  53.     FormSetObject(29999, _GroupBox, "", 0, 0, 100pct, 100pct)
  54.     FormModifyObject(29999, _Gray)
  55.     FormSetColor(_Tan; _Text)
  56.     FormSetColor(_Tan; _Field)
  57.     FormSetObject(30000, _GroupBox, "", xPos1, yPos * (3 - Ceil(3 / 2)), xPos2 * 2, 3)
  58.     FormModifyObject(30000, _Gray)
  59.  
  60.     FormSetObject(31001, _BitMapButton, bmdir + "Pal1.BMP", xPos1, 0, bmWid, bmHt)
  61.     FormSetObject(31002, _BitMapButton, bmdir + "Pal2.BMP", xPos2, 0, bmWid, bmHt)
  62.     FormSetObject(32001, _BitMap, bmdir + "On1.BMP", 20 in, 0, bmWid, bmHt)
  63.     FormModifyObject(32001, _Gray)
  64.     FormSetObject(32002, _BitMap, bmdir + "On2.BMP", 20 in, 0, bmWid, bmHt)
  65.     FormModifyObject(32002, _Gray)
  66.  
  67.     FOR i = 3 TO 16 STEP 2
  68.         FormSetObject(31000 + i, _BitMapButton, SPrint("&PalP(0).BMP", bmdir, i), xPos1, yPos * (i - Ceil(i / 2)) + 3, bmWid, bmHt)
  69.         FormSetObject(32000 + i, _BitMap, SPrint("&OnP(0).BMP", bmdir, i), 20 in, yPos * (i - Ceil(i / 2)) + 3, bmWid, bmHt)
  70.         FormModifyObject(32000 + i, _Gray)
  71.         FormSetObject(31000 + (i + 1), _BitMapButton, SPrint("&PalP(0).BMP", bmdir, i + 1), xPos2, yPos * (i - Ceil(i/2)) + 3, bmWid, bmHt)
  72.         FormSetObject(32000 + (i + 1), _BitMap, SPrint("&OnP(0).BMP", bmdir, i + 1), 20 in, yPos * (i - Ceil(i/2)) + 3, bmWid, bmHt)
  73.         FormModifyObject(32000 + (i + 1), _Gray)
  74.     NEXT i
  75.  
  76.     FormSetColor(_Black; _Text)
  77.     FormSetColor(_White; _Field)
  78.     yBut = yPos * (17 - Ceil(17/2)) + 3
  79.     FormSetObject(32762, _Button, "Options...", font_B, xPos1, yBut, xPos2 * 2, _Default)
  80.     yBut = yBut + butHt + 1
  81.  
  82.     FormSetColor(_LightGray; _Field)
  83.     FormSetColor(_Black; _Text)
  84.     FormSetObject(32750, _CaptionLeft, "", font_B, 1.1, yBut, xPos2 * 2, _Default)
  85.     yBut = yBut + txtHt
  86.     FormSetObject(32751, _CaptionLeft, "Color", font_B, 1.1, yBut)
  87.     yBut = yBut + txtHt
  88.     FormSetObject(32752, _CaptionCenter, "Text", font_P, 0, yBut, 100pct, _Default)
  89.     yBut = yBut + txtHt
  90.     FormSetColor(_LightGray; _Field)
  91.     FormSetColor(_Black; _Text)
  92.     FormSetObject(32753, _CaptionLeft, "", font_P, 1.1, yBut, xPos2 * 2, _Default)
  93.     yBut = yBut + txtHt
  94.     FormSetObject(32760, _Button, "Color...", font_B, xPos1, yBut, xPos2 * 2, _Default)
  95.     yBut = yBut + butHt
  96.     FormSetObject(32761, _Button, "Font...", font_B, xPos1, yBut, xPos2 * 2, _Default)
  97.  
  98.     FormSetProc(ToolProc)
  99.     currentOn = 0
  100.     ToolOn(4)
  101. END PROC
  102.  
  103.  
  104. ' Option button form
  105. PROC InitVisualForms
  106.     fdVisOption = FormQUnique
  107.     FormNew(fdVisOption; "Item Attributes", _Title)
  108.     FormControl(_Size; 52 pct, 35 pct, 46 pct, 62 pct)
  109.  
  110.     FormSetObject(31, _CaptionCenter, "Items", font_B, 5 pct, 25 pct, 56 pct, _Default)
  111.     FormSetObject(30, _ListBox, "", font_P, 5 pct, 31 pct, 56 pct, 45 pct; ItemNames)
  112.  
  113.     FormSetObject(245, _Button, "Color...", font_B, 68 pct, 17 pct, 25 pct, _Default)
  114.     FormSetObject(230, _Button, "Options...", font_B, 68 pct, 32 pct, 25 pct, _Default)
  115.     FormSetObject(235, _Button, "Position...", font_B, 68 pct, 47 pct, 25 pct, _Default)
  116.     FormSetObject(240, _Button, "Fonts...", font_B, 68 pct, 62 pct, 25 pct, _Default)
  117.  
  118.     FormSetObject(1 ,_DefButton, "OK", 8 pct, 84 pct)
  119.     FormSetObject(2, _Button, "Cancel", 38 pct, 84 pct)
  120.     FormSetObject(210, _Button ,"Delete", 68 pct, 84 pct)
  121.  
  122.     FormSetObject(5,_CaptionLeft, "Number:", font_B, 1.5 pct, 4 pct)
  123.     FormSetObject(10,_TextBox, "", font_P, 19 pct, 3 pct, 13 pct, _Default)
  124.     FormSetObject(15,_CaptionLeft, "Text:", font_B, 1.5 pct, 15 pct)
  125.     FormSetObject(20,_TextBox, "", font_P,19 pct, 14 pct, 42 pct, _Default)
  126.     FormSetObject(25, _CaptionLeft, "Total Items: 000", font_P, 70 pct, 1 pct, 39 pct, _Default)
  127.  
  128.     FormSetProc(ShutdownProc)
  129. END PROC
  130.