home *** CD-ROM | disk | FTP | other *** search
/ TestDrive Super Store 2.3 / TESTDRIVE_2.ISO / realizer / demos / apps / dataview / dvform.rlz < prev    next >
Encoding:
Text File  |  1992-09-30  |  4.8 KB  |  146 lines

  1. '***********************************************************************
  2. '    DVForm.rlz                      
  3. '
  4. '    Executive Information System Demo
  5. '
  6. '    Copyright ⌐ 1991-1992 Computer Associates International, Inc.
  7. '    All rights reserved.
  8. '
  9. '***********************************************************************
  10.  
  11. RUN "StdArray"
  12. RUN "StdSys"
  13.  
  14. PROC MakeDV
  15.     LOCAL    font1
  16.  
  17.     formDV = FormQUnique
  18.     FormNew(formDV; "Realizer DataView", _Frame)
  19.     FormControl(_Size; _Center, _Center, 60 pct, 90 pct)
  20.  
  21.     font1 = FontQUnique
  22.     FontNew(font1; "Helv", 24, _Bold)
  23.  
  24.     FormSetObject(10, _CaptionLeft, "Realizer DataView", font1, 5 pct, 2 pct; _Blue)
  25.     FormSetObject(11, _GroupBox, "", 5 pct, 13 pct, 90 pct, 0.5 pct)
  26.     FormSetObject(12, _Bitmap, "Pharm.bmp", _Right, 15 pct) 
  27.     FormModifyObject(12, _Gray)
  28.     
  29.     FormSetObject(20, _GroupBox, "Segments", 3 pct, 15 pct, 33 pct, 30 pct)
  30.     FormSetObject(21, _OptionButton, "Hospital", 6 pct, 21 pct; 1, 2)
  31.     FormSetObject(22, _OptionButton, "Retail", 6 pct, 28 pct; 0, 2)
  32.     FormSetObject(23, _OptionButton, "Total", 6 pct, 35 pct; 0, 2)
  33.  
  34.     FormSetObject(30, _GroupBox, "Units of Sale", 40 pct, 15 pct, 35 pct, 24 pct)
  35.     FormSetObject(31, _OptionButton, "Dollars", 43 pct, 21 pct; 1, 1)
  36.     FormSetObject(32, _OptionButton, "Prescriptions", 43 pct, 28 pct; 0, 1)
  37.  
  38.     FormSetObject(41, _CaptionCenter, "Select a category or item:", 40 pct, 42 pct, 56 pct, _Default)
  39.     FormSetObject(40, _ListBox, "", 40 pct, 48 pct, 56 pct, 50 pct)
  40.  
  41.     FormSetObject(50, _BitmapButton, "Chart.bmp", 13 pct, 50 pct)
  42.     FormSetObject(60, _BitmapButton, "Report.bmp", 13 pct, 63 pct)
  43.     FormSetObject(70, _Button, "Help", 10 pct, 80 pct)
  44.     FormSetObject(80, _Button, "Quit", 10 pct, 90 pct)
  45.     FormSetProc(formprocDV)
  46.     FormControl(_Show)
  47. END PROC
  48.  
  49. PROC formprocDV(params)
  50.     LOCAL n
  51.  
  52.     FormSelect(params[_FormNum])
  53.     SELECT CASE params[_ItemNum]
  54.         CASE 40    'ListBox
  55.             n = list.itemnum[FormQNum(40)]
  56.             IF n < 0 THEN
  57.                 list.expand[n*-1] = Not(list.expand[n*-1])
  58.                 ListBuild(40, n)
  59.             END IF
  60.         CASE 50    'Chart
  61.             IF FormQNum(40) = 0 THEN
  62.                 EXIT PROC
  63.             END IF
  64.             ChartSales(list.itemnum[FormQNum(40)], FormQNum(31), IF FormQNum(21) THEN 1 ELSE (IF FormQNum(22) THEN 2 ELSE 3))
  65.         CASE 60    'Report
  66.             IF FormQNum(40) = 0 THEN
  67.                 EXIT PROC
  68.             END IF
  69.             ReportSales(list.itemnum[FormQNum(40)], FormQNum(31), IF FormQNum(21) THEN 1 ELSE (IF FormQNum(22) THEN 2 ELSE 3))
  70.         CASE 70    'Help
  71.             FormSelect(formDVHelp)
  72.             FormControl(_Show)
  73.         CASE 80    'Quit
  74.             RESET _All
  75.             EXIT PROGRAM
  76.     END SELECT
  77. END PROC
  78.  
  79. PROC ListBuild(id, catnum)
  80.     LOCAL  i, n, k, m
  81.  
  82.     CLEAR list.text
  83.     n = 1    
  84.     FOR i = 1 to EndValid(data.catname)
  85.         list.text[n] = data.catname[i]
  86.         list.itemnum[n] = -i
  87.         n = n + 1
  88.         IF list.expand[i] THEN
  89.             FOR k = 0 to data.catcount[i] -1 
  90.                 m = data.catindex[i] + k
  91.                 list.text[n+k] = "        " + data.itemname[m]
  92.                 list.itemnum[n+k] = m
  93.             NEXT k
  94.             n = n + data.catcount[i]
  95.         END IF
  96.     NEXT i
  97.     FormModifyObject(id, _Clear; list.text, _ListSelect, FirstMatch(list.itemnum, catnum))
  98. END PROC
  99.  
  100. PROC DVHelpInit
  101.     LOCAL    font1, font2, s, _EOLN
  102.  
  103.     _EOLN = Chr$(13) + Chr$(10)
  104.  
  105.     s = "This demonstration shows how Realizer can be used as a front end to display "
  106.     s = s + "data in a variety of ways.  The sales data for a fictional pharmaceutical company "
  107.     s = s + "can be broken down by category, sales division, and market segement." + _EOLN + _EOLN
  108.  
  109.     s = s + "The list box shows the major categories for the medical compounds sold by the "
  110.     s = s + "company.  If you double-click on one of these categories, its sub-categories will be "
  111.     s = s + "listed beneath in outline form." +_EOLN + _EOLN
  112.  
  113.     s = s + "Once you have selected a category, you can generate a sales report "
  114.     s = s + "or graph the data by pressing the corresponding graphic button. The "
  115.     s = s + "charts for the major categories are an example of ""hyper-charts.""  If you click on one of "
  116.     s = s + "the data lines, a chart showing the breakdown of the selected sub-category will be created." 
  117.  
  118.     font1 = FontQUnique
  119.     FontNew(font1; "helv", 28, _Bold)
  120.     formDVHelp = FormQUnique
  121.     font2 = FontQUnique
  122.     FontNew(font2; "helv", 8)
  123.     FormNew(formDVHelp; "About the Realizer DataView Demo", _Title + _Close + _HotClick)
  124.     FormControl(_Size; 5 pct, _Center, 50 pct, 80 pct)
  125.     FormSetColor(_Blue; _Text)
  126.     FormSetObject(10, _CaptionCenter, "Realizer DataView", font1, _Center, _Top)
  127.     FormSetColor(_Black; _Text)
  128.     FormSetObject(20, _CaptionLeft, s, font2, _Center, 15 pct, 90 pct, 80 pct)
  129.     FormSetObject(1, _DefButton, "OK", _Left, _Bottom)
  130.     FormSetObject(5, _Button, "Exit Demo", _Right, _Bottom)
  131.     FontControl(_Close)
  132.     FormSetProc(formprocDVHelp)
  133. END PROC
  134.  
  135. PROC formprocDVHelp(params)
  136.     FormSelect(params[_FormNum])
  137.     IF params[_ItemNum] = 5 THEN
  138.         RESET _All
  139.         EXIT PROGRAM
  140.     END IF
  141.     params[_UseRealizer] = 0
  142.     FormControl(_Hide)
  143. END PROC
  144.  
  145.  
  146.