home *** CD-ROM | disk | FTP | other *** search
- PROGRAM GSXDemo (INPUT, OUTPUT);
-
- CONST
- {$I a:gsxconst.pas }
-
- TYPE
- {$I a:gsxtype.pas }
-
- VAR
- {$I a:gsxvar.pas }
- Wahl: CHAR;
- i, j, Style, Index, MaxInx, Rows, Cols: INTEGER;
- angle, dummy: REAL;
-
- {$I A:gsxvdi.pas }
- {$I A:gsxlib1.pas }
-
- {---------------------------------------------------------------------------}
-
- PROCEDURE Pause (Count: INTEGER);
-
- VAR i, j: INTEGER;
-
- BEGIN
- FOR i := 0 TO Count DO
- j := MaxInt DIV 1000;
- END;
-
- {---------------------------------------------------------------------------}
-
- PROCEDURE ShowLineType (Style: Line_Types);
-
- VAR st: VDI_String;
-
- BEGIN
- Graph_Text(14000, 17000, 'Linienart:');
- Str(Style, st);
- Graph_Text(14000, 15000, st);
- END;
-
- {---------------------------------------------------------------------------}
-
- PROCEDURE ShowFillStyles (Style: Fill_Styles; Index: INTEGER);
-
- VAR st: VDI_String;
-
- BEGIN
- Graph_Text(14000, 19000, 'Fuellart:');
- Str(Style, st);
- Graph_Text(14000, 17000, st);
- Graph_Text(14000, 15000, 'Fuellmuster:');
- Str(Index, st);
- Graph_Text(14000, 13000, st);
- END;
-
- {---------------------------------------------------------------------------}
-
- PROCEDURE ShowMarkerType (Style: Marker_Types);
-
- VAR st: VDI_String;
-
- BEGIN
- Graph_Text(14000, 16000, 'Markierungszeichen:');
- Str(Style, st);
- Graph_Text(14000, 14000, st);
- END;
-
- {---------------------------------------------------------------------------}
-
- PROCEDURE Fillptsin;
-
- VAR i: INTEGER;
-
- BEGIN
- FOR i := 1 TO 100 DO
- ptsin[i] := Random(MaxInt);
- END;
-
- {---------------------------------------------------------------------------}
-
- BEGIN
- REPEAT
- WriteLn; WriteLn; WriteLn;
- WriteLn(' *********************************************');
- WriteLn(' * *');
- WriteLn(' * GSX-Grafik Demo *');
- WriteLn(' * *');
- WriteLn(' *********************************************');
- WriteLn; WriteLn; WriteLn;
- REPEAT
- Write('Waehlen sie das Ausgabegeraet:');
- Write('( A - Screen , B - Printer , C - Plotter ) : ');
- ReadLn(Wahl);
- UNTIL Wahl IN ['A'..'C','a'..'c'];
- CASE Wahl OF
- 'A','a' : Open_Workstation(Screen);
- 'B','b' : Open_Workstation(Printer);
- 'C','c' : Open_Workstation(Plotter)
- end;
- WriteLn(' Es folgen Informationen ueber das angewaehlte Geraet:');
- WriteLn; WriteLn;
- WriteLn(' exakt skalierendes Geraet : ', Scaling);
- WriteLn(' farbfaehig : ', ColorDevice);
- WriteLn(' Text kann gedreht werden : ', TextRotation);
- WriteLn(' Flaechen koennen gefuellt werden : ', AreaFill);
- WriteLn('Zeichen-Zellen Fuellung ist moeglich : ', CellArrays);
- Write(' horizontale Aufloesung : ',HRes);
- WriteLn(' vertikale Aufloesung : ',VRes);
- Write('Abmessungen eines Pixel : ');
- WriteLn(PixWidth, 'x', PixHeight, ' (x10^-6 m)');
- Write(' Anzahl Linienarten : ', Lines);
- WriteLn(' Anzahl Linienbreiten : ', LineWidths);
- Write('Anzahl Punktmarkerarten : ', Markers);
- WriteLn(' Anzahl Markergroessen : ', MarkerSizes);
- Write(' Anzahl Zeichensaetze : ', Fonts);
- WriteLn(' Anzahl Fuellmuster : ', Patterns);
- Write(' Anzahl Schraffuren : ', HatchStyles);
- WriteLn(' Anzahl vordef. Farben : ', Colors);
- Write(' Anzahl ZeichenMakros : ',GDPs);
- WriteLn(' Verfuegbare Farben : ',ColorsAvail);
- Write(' Steuergeraete : ', InputLocators);
- WriteLn(' Wertgeber : ', InputValuators);
- Write(' Funktionstasten : ', InputChoices);
- WriteLn(' Stringeingabe-Geraete : ', InputStrings);
- Write(' Geraetetyp : ');
- CASE WorkStationType OF
- OutOnly : WriteLn('nur Output');
- InpOnly : WriteLn('nur Input');
- InpOut : WriteLn('Input/Output');
- SegStore : WriteLn('Segmentspeicher');
- MetaOut : WriteLn('GKS Metafile Output')
- END;
- Write('Minimale Zeichenhoehe : ',MinCharHeight);
- WriteLn(' Maximale Zeichenhoehe : ',MaxCharHeight);
- Write('Minimale Zeilenbreite : ',MinLineWidth);
- WriteLn(' Maximale Zeilenbreite : ',MaxLineWidth);
- Write('Minimale Punktmarkerhoehe : ',MinMarkHeight);
- WriteLn(' Maximale Punktmarkerhoehe : ',MaxMarkHeight);
- Text_Resolution(Rows, Cols);
- WriteLn('Textaufloesung: ',Cols,'x',Rows);
- WriteLn; WriteLn;
- REPEAT
- Write('Anderes Geraet waehlen (j/n) ? ');
- ReadLn(Wahl)
- UNTIL Wahl IN ['j','J','n','N'];
- UNTIL Wahl IN ['n','N'];
-
- Open_Workstation(Screen);
- Enter_Graphics;
- i := Draw_Mode(Transparent);
- Graph_Text(6000, 15000,
- 'Es folgt eine Demonstration verschiedener Linientypen.');
- Pause(4000);
- FOR i := Solid TO Lines DO
- BEGIN
- Clear_Workstation;
- Style := Line_Type(i);
- Fillptsin;
- Poly_Line(50,ptsin);
- ShowLineType(Style);
- Pause(6000);
- END;
- Clear_Workstation;
- Graph_Text(6000, 15000,
- 'Es folgt ein Demonstration verschiedener Fuellmuster.');
- Pause(4000);
- FOR i := Hollow TO Hatch DO
- BEGIN
- Style := Fill_Style(i);
- IF Style IN [Pattern, Hatch] THEN
- BEGIN
- IF Style = Pattern THEN MaxInx := Patterns
- ELSE MaxInx := HatchStyles;
- FOR j := Vertical TO MaxInx DO
- BEGIN
- Index := Fill_Index(j);
- Fillptsin;
- Clear_Workstation;
- Poly_Fill(50,ptsin);
- ShowFillStyles(Style, Index);
- Pause(6000);
- END;
- END
- ELSE
- BEGIN
- Index := 0;
- Fillptsin;
- Clear_Workstation;
- Poly_Fill(50, ptsin);
- ShowFillStyles(Style, Index);
- Pause(6000);
- END;
- END;
- Clear_Workstation;
- Graph_Text(5000, 15000,
- 'Es folgt noch eine Demonstration der verschiedenen Punktmarker.');
- Pause(4000);
- Clear_Workstation;
- FOR i := Dot TO Markers DO
- BEGIN
- Clear_Workstation;
- Style := Marker_Type(i);
- Fillptsin;
- Poly_Marker(50, ptsin);
- ShowMarkerType(Style);
- Pause(6000);
- END;
- Close_Workstation;
- {
- Open_Workstation(Printer);
- Enter_Graphics;
- Text_Height(600, i, i, i, i);
- angle := 0.0;
- REPEAT
- dummy := Text_Direction(angle);
- Graph_Text(16383, 16383, ' GSX und Pascal');
- angle := angle + 90.0;
- UNTIL angle > 360.0;
- Update_Workstation;
-
- Exit_Graphics;
- Close_Workstation
- }
- END.