home *** CD-ROM | disk | FTP | other *** search
- **
- ** CLIPMENU.PRG Modified to run under DCLIPDGE.EXE
- **
- ** Main program for dGE Ver 2 demonstration
- **
- ** PROGMODE = 'R' .. rolling demo with timed pauses
- ** = 'M' .. menu driven
- **
- ** Define directory and operational mode
-
- set talk off
- set echo off
- set status off
- set bell off
- set scoreboard off
- set console off
-
- PROGMODE = 'M' && program mode
-
- clear
-
- videoid=0
- @ 3,17 SAY 'Enter Video Driver ID:'
- @ 5,17 SAY '3 = HERCULES mono'
- @ 6,17 SAY '4 = CGA mono'
- @ 7,17 SAY '5 = CGA color'
- @ 8,17 SAY '6 = EGA color'
- @ 9,17 SAY '7 = VGA color'
- @11,17 SAY 'Enter Selection ' GET videoid PICT '9' RANGE 3,7
- READ
- SETVIDEO(videoid)
-
- clear
- set colo to 2+/0
- @ 3,17 say 'Demonstration programs featuring dGE graphics'
- @ 5,10 say 'The all-purpose graphics library for database applicatons.'
- set colo to 7/0
- if PROGMODE = 'M'
- @ 8,18 say 'You will be presented with a menu of examples.'
- @ 10,15 say 'After each page is drawn hit any key to continue.'
- @ 14,19 say 'Some examples feature continuous displays.'
- @ 15,19 say 'These may be interrupted by a key-stroke'
- else
- @ 10,28 say 'This is a rolling demo'
- @ 12,8 say 'You may interrupt it by hitting any key after a screen is drawn'
- endif
- set colo to 2/0
- @ 20,19 say '(c) 1984,88 Bits Per Second Ltd, Brighton'
- set color to 7/0
-
- if file('DGEDEFS.PRG')
- DIRTYPE = 'S'
- else
- DIRTYPE = 'M'
- endif
-
- if DIRTYPE = 'M'
- DATADIR = '..\'
- CSDIR = '..\..\CSETS\'
- else
- DATADIR = '.\'
- CSDIR = '.\'
- endif
- * Set pauses according to demo type
- if PROGMODE = 'R'
- PAUSE1 = 0.25
- PAUSE5 = 2
- else
- PAUSE1 = 0
- PAUSE5 = 0
- endif
- PAUSEBANN = 5
- @ 23,18 say 'Loading and initialising data .. please wait'
-
- * Check for our demo data files
- if .not.file(DATADIR+'demodata.dbf').or..not.file(DATADIR+'dgepl.dbf')
- ? chr(7)+'Demonstration data files not found .. quitting'
- quit
- endif
- * Get the screen-driver identifier
- DRIVERID = getchar(2)
- * Intialise dGE variables and get DRIVERID
- if DIRTYPE = 'M'
- do ..\DGEDEFS
- else
- do DGEDEFS
- endif
- * Ensure dGE Version 2 on entry
- r = setver(2)
- * Check for driver loaded
- if .not.(DRIVERID $ '34567')
- ? 'SETDGE.COM has not been run .. aborting'
- quit
- endif
- * Warning if CGA colour
- if DRIVERID = '5'
- set console on
- clear
- @ 6,13 say 'WARNING !!! You have installed the CGA colour driver.'
- @ 10,11 say 'Owing to the reduced resolution of the CGA colour screen'
- @ 12,11 say 'text characters are extra wide.'
- @ 14,11 say 'This demonstration was not written for this mode and will'
- @ 16,11 say 'produce poorly-presented text.'
- @ 19,18 say 'Hit Q to quit or any other key to continue'
- r = inkey(0)
- if chr(r) $ 'qQ'
- quit
- endif
- set console off
- endif
- * Path for ch sets
- if DIRTYPE = 'M'
- if DRIVERID $ '367'
- CSDIR = CSDIR+'EGAHRC\'
- else
- CSDIR = CSDIR+'CGA\'
- endif
- endif
- * Load character sets
- r = loadcset(0, CSDIR+'STANDARD')
- r = loadcset(1, CSDIR+'THIN')
- * Display dGE banner page
- do DGEBANN
-
- chselect = 'A'
- noptions = 1
- if PROGMODE = 'R'
- r = sethires(0)
- endif
- do while chselect <> 'Q'
- r = setver(2)
- r = loadcset(1, CSDIR+'THIN')
- if PROGMODE = 'M'
- set console on
- clear
-
- @ 2,27 say 'dGE demonstration menu'
- if DRIVERID $ '567'
- @ 5,25 say 'A Pie charts and colour palette display'
- else
- @ 5,25 say 'A Pie charts'
- endif
- @ 6,25 say 'B Statistics functions'
- @ 7,25 say 'C Technical drawing'
- @ 8,25 say 'D Various graphs and charts'
- @ 9,25 say 'E X-Y graph styles'
- @ 10,25 say 'F Time-series graphs'
- @ 11,25 say 'G Polylines and vectors'
- @ 12,25 say 'H Polar graphs'
- @ 13,25 say 'I Axes and labels'
- @ 14,25 say 'J Shade and symbol library'
- @ 15,25 say 'K Fonts'
- @ 16,25 say 'L Simple X-Y Example'
- @ 17,25 say 'M Bar graph styles'
- @ 18,25 say 'N Interactive session'
- @ 19,25 say 'O Printing and plotting'
- @ 20,25 say 'Q Quit'
-
- @ 23,33 say 'Enter Option'
- chselect = ' '
- do while .not.(chselect $ 'ABCDEFGHIJKLMNOQ')
- chselect = upper(chr(inkey()))
- enddo
- * Quit
- if chselect = 'Q'
- loop
- endif
- set console off
- r = sethires(0)
- endif
-
- * Do selected demo program
- r = clrscreen()
- r = boxfill(0,0,1500,1000,BXNOFILL,GREY)
- r = boxfill(0,0,120,80,BXNOFILL,GREY)
- r = saystring(20,14,0,0,GREEN,"dGE")
-
- OBJRELEASE('ALL')
- do case
- case chselect = 'A'
- OBJLINK('DGE','PIES')
- do PIES
- case chselect = 'B'
- OBJLINK('DGE','STAT')
- do STAT
- case chselect = 'C'
- OBJLINK('DGE','TECH')
- do TECH
- case chselect = 'D'
- OBJLINK('DGE','PICTURE')
- do PICTURE
- case chselect = 'E'
- OBJLINK('DGE','XYS')
- do XYS
- case chselect = 'F'
- OBJLINK('DGE','TIMEHIST')
- do TIMEHIST
- case chselect = 'G'
- OBJLINK('DGE','POLYS')
- OBJLINK('DGE','SAILPLAN')
- do POLYS
- do SAILPLAN
- case chselect = 'H'
- OBJLINK('DGE','POLARS')
- do POLARS
- case chselect = 'I'
- OBJLINK('DGE','AXES')
- do AXES
- case chselect = 'J'
- OBJLINK('DGE','ICONSHDE')
- do ICONSHDE
- case chselect = 'K'
- OBJLINK('DGE','FONTS')
- do FONTS
- case chselect = 'L'
- OBJLINK('DGE','SIMPLEXY')
- do SIMPLEXY
- r = inkey(PAUSE5)
- OBJLINK('DGE','SXYTEXT')
- do SXYTEXT
- do SIMPLEXY
- case chselect = 'M'
- OBJLINK('DGE','BARS')
- do BARS
- case chselect = 'N'
- OBJLINK('DGE','INTERACT')
- do INTERACT
- case chselect = 'O'
- OBJLINK('DGE','HARDCOPY')
- do HARDCOPY
- endcase
- * wait for key pressed
- lpr = 0
- if .not.(chselect $ 'FO')
- lpr = inkey(PAUSE5)
- endif
-
- if PROGMODE = 'M'
- r = settext()
- else
- if lpr <> 0
- r = settext()
- chselect = 'Q'
- else
- chselect = chr( asc(chselect) + 1)
- if chselect = 'N'
- chselect = 'A'
- endif
- endif
- endif
- enddo
-
- clear
- RETURN