Section courante

A propos

Section administrative du site

 Langage  Installation  Elément  Tutoriel  Programmation  Emulateur  Annexe  Aide 
ABAP/4
Ada
Assembleur
Assembly & bytecode
ASP (Active Server Pages)
Basic
C
C++
C# (C Sharp)
Cobol
ColdFusion
Fortran
HTML
Java
JavaScript
LISP
Logo
LotusScript
Oberon
Pascal
Perl
PHP
PL/1
Prolog
Python
Rebol
REXX
Ruby
Rust
SAS
NoSQL
SQL
Swift
X++ (Axapta)
GNAT
SMALLAda
VHDL
Assembleur 370
Assembleur 1802
Assembleur 4004
Assembleur 6502
Assembleur 6800
Assembleur 68000
Assembleur 8080 et 8085
Assembleur 8089
Assembleur 80x86
Assembleur AGC4
Assembleur ARM
Assembleur DPS 8000
Assembleur i860
Assembleur Itanium
Assembleur MIPS
Assembleur PDP-11
Assembleur PowerPC
Assembleur RISC-V
Assembleur SPARC
Assembleur SuperH
Assembleur UNIVAC I
Assembleur VAX
Assembleur Z80
Assembleur Z8000
Assembleur z/Architecture
ASSEMBLER/MONITOR 64
Micol Assembler
GFA Assembler
A86
MASM (Macro Assembler)
TASM (Turbo Assembler)
CIL
Jasmin
LLVM
MSIL
Parrot
P-Code (PCode)
SWEET16
G-Pascal
ASP 1.0
ASP 2.0
ASP 3.0
ASP.NET
ASP.NET Core
ABasiC (Amiga)
Adam SmartBASIC
Altair BASIC
AmigaBASIC (Amiga)
AMOS Basic (Amiga)
Atari Basic (Atari 400, 600 XL, 800, 800XL)
Basic Apple II (Integer BASIC/APPLESOFT)
Basic Commodore 64 (CBM-BASIC)
Basic Commodore 128 (BASIC 7.0)
Basic Commodore VIC-20 (CBM-BASIC 2.0)
Basic Coco 1 (Color Basic)
Basic Coco 2 (Extended Color Basic)
Basic Coco 3 (Extended Color Basic 2.0)
BASICA (PC DOS)
Basic Pro
BBC BASIC
Blitz BASIC (Amiga)
DarkBASIC
Dartmouth BASIC
GFA-Basic (Atari ST/Amiga)
GWBASIC (MS-DOS)
Liberty BASIC
Locomotive BASIC (Amstrad CPC)
MSX-Basic
Omikron Basic (Atari ST)
Oric Extended Basic
Power Basic
Quick Basic/QBasic (MS-DOS)
Sinclair BASIC (ZX80, ZX81, ZX Spectrum)
ST BASIC (Atari ST)
Turbo Basic
Vintage BASIC
VBScript
Visual Basic (VB)
Visual Basic .NET (VB .NET)
Visual Basic pour DOS
Yabasic
BeckerBASIC
SIMONS' BASIC
Basic09 d'OS-9
Disk Extended Color Basic
Basic09 d'OS-9
Disk Extended Color Basic
Access
Excel
Visual Basic pour Windows
Visual Basic .NET pour Windows
C Shell Unix (csh)
C pour Amiga
C pour Atari ST
C pour DOS
C pour Falcon030
C pour GEMDOS (Atari ST)
C pour Linux
C pour PowerTV OS
C pour OS/2
C pour Unix
C pour Windows
Aztec C
CoCo-C
GNU C
HiSoft C
IBM C/2
Introl-C
Lattice C
Microsoft C
MinGW C
MSX-C
Open Watcom C
OS-9 C Compiler
Pure C
Quick C
Turbo C
HiSoft C for Atari ST
HiSoft C for CP/M (Amstrad CPC)
C++ pour OS/2
C++ pour Windows
Borland C++
C++Builder
IBM VisualAge C++
Intel C++
MinGW C++
Open Watcom C++
Symantec C++
Turbo C++
Visual C++
Visual C++ .NET
Watcom C++
Zortech C++
C# (C Sharp) pour Windows
Apple III Cobol
Microsoft Cobol
BlueDragon
Lucee
OpenBD
Railo
Smith Project
Microsoft Fortran
WATFOR-77
CSS
FBML
Open Graph
SVG
XML
XSL/XSLT
LESS
SASS
GCJ (GNU)
JSP
Jython
Visual J++
Node.js
TypeScript
AutoLISP
ACSLogo
LotusScript pour Windows
Amiga Oberon
Oberon .NET
Apple Pascal
Delphi/Kylix/Lazarus
Free Pascal
GNU Pascal
HighSpeed Pascal
IBM Personal Computer Pascal
Lisa Pascal
Maxon Pascal
MPW Pascal
OS-9 Pascal
OSS Personal Pascal
Pascal-86
Pascal du Cray Research
Pascal/VS
Pascal-XT
PURE Pascal
QuickPascal
RemObjets Chrome
Sun Pascal
THINK Pascal
Tiny Pascal (TRS-80)
Turbo Pascal
UCSD Pascal
VAX Pascal
Virtual Pascal
Turbo Pascal for CP/M-80
Turbo Pascal for DOS
Turbo Pascal for Macintosh
Turbo Pascal for Windows
CodeIgniter (Cadre d'application)
Drupal (Projet)
Joomla! (Projet)
Phalanger (PHP .NET)
phpBB (Projet)
Smarty (balise)
Twig (balise)
Symfony (Cadre d'application)
WordPress (Projet)
Zend (Cadre d'application)
PL360
PL/M-80
PL/M-86
Turbo Prolog
CPython
IronPython
Jython
PyPy
AREXX
Regina REXX
JMP
Btrieve
Cassandra
Clipper
CouchDB
dBASE
Hbase
Hypertable
MongoDB
Redis
Access
BigQuery
DB2
H2
Interbase
MySQL
Oracle
PostgreSQL
SAP HANA
SQL Server
Sybase
U-SQL
QuickPascal
Les remarques
Les opérateurs
Les instructions conditionnelles
Les instructions de boucles
Type de données
Référence des unités
Définition de fonction
Références de mots réservés (mots clefs)
Référence des procédures et des fonctions
Mise en route
Les premiers pas
Données et types de données
Opérateurs et expressions
Procédures et fonctions
Utilisation de fichiers et de répertoires
Programmation graphiques
Bonjour
Affichage
Astronomie
Biochimie
Conversion
Démonstration & Animation
Finance
Fractale
Géographie
Géométrie
Jeux & stratégies
Histoire
Mathématique
Médicale
Météorologie
Océanographie
Sport
Temps
Trigonométrie
Validation
«DRAW» du BASIC
Phase lunaire
Calcul du calcium corrigé
Calcul le taux d'alcoolémie
Bin,Hex,Base62,...
Animation d'étoile en 3 dimensions
IPaymt/Interet
NPer
PPaymt/Principal
Triangle de «Sierpinski»
Distance en Km entre deux longitudes et latitudes
Aire d'un cercle
Aire d'une surface de prisme rectangulaire
Aire d'un triangle
Distance entre deux points
Treillis
Frogger
L25
Nibbles
Tetris
Tours d'Hanois
Chiffre romain
Ackermann
Exp
Factoriel
Fibonacci
Log
Nombre premier
Odd
Random
Sqrt
Triangle Pascal
Hauteur utérine
Unité de mesure
Fréquence des vagues
Hockey
Année bissextile
Calendrier
Date de la Pâque
FirstDayOfMonth
Horloge à aiguille
ArcCos
ArcSin
Atn/ATan/ArcTan/ArcTangente
Cos
Sin
Courriel
DOSBox
PCE - PC Emulator
PCem
Table ASCII
RAM de l'IBM PC
Code d'erreur du Quick Pascal
QPU
Bibliographie
Préface
Notes légal
Dictionnaire
Recherche
  1. {----------------------------------------------------------------------
  2. Interface de l'unité MSGraph
  3. ----------------------------------------------------------------------}
  4.  
  5. UNIT MSGraph;
  6.  
  7. INTERFACE
  8.  
  9. USES    MSGrUtil;
  10.  
  11. CONST
  12.   { Paramètres de _SetVideoMode }
  13.   _MaxResMode   = -3;    { Mode graphique la plus haute résolution }
  14.   _MaxColorMode = -2;    { Mode graphique avec la plupart des couleurs }
  15.   _DefaultMode  = -1;    { Restaurer l'écran en mode d'origine }
  16.   _TextBW40     =  0;    { Texte de 40 colonnes, 16 gris }
  17.   _TextC40      =  1;    { Texte de 40 colonnes, couleur 16/8 }
  18.   _TextBW80     =  2;    { Texte de 80 colonnes, 16 gris }
  19.   _TextC80      =  3;    { Texte sur 80 colonnes, couleur 16/8 }
  20.   _MRes4Color   =  4;    { 320 x 200, 4 couleurs }
  21.   _MResNoColor  =  5;    { 320 x 200, 4 gris }
  22.   _HResBW       =  6;    { 640 x 200, noir et blanc }
  23.   _TextMono     =  7;    { Texte de 80 colonnes, noir et blanc }
  24.   _HercMono     =  8;    { 720 x 348, noir et blanc pour HGC }
  25.   _MRes16Color  = 13;    { 320 x 200, 16 couleurs }
  26.   _HRes16Color  = 14;    { 640 x 200, 16 couleurs }
  27.   _EResNoColor  = 15;    { 640 x 350, noir et blanc }
  28.   _EResColor    = 16;    { 640 x 350, 4 ou 16 couleurs }
  29.   _VRes2Color   = 17;    { 640 x 480, noir et blanc }
  30.   _VRes16Color  = 18;    { 640 x 480, 16 couleurs }
  31.   _MRes256Color = 19;    { 320 x 200, 256 couleurs }
  32.   _OResColor    = 64;    { 640 x 400, 1 des 16 couleurs (Olivetti) }
  33.  
  34.   { _Valeurs de l'adaptateur VideoConfig }
  35.   _MDPA = $0001;    { Monochrome Display Printer Adapter (MDPA) }
  36.   _CGA  = $0002;    { Color Graphics Adapter (CGA) }
  37.   _EGA  = $0004;    { Enhanced Graphics Adapter (EGA) }
  38.   _VGA  = $0008;    { Video Graphics Array (VGA) }
  39.   _MCGA = $0010;    { MultiColor Graphics Array (MCGA) }
  40.   _HGC  = $0020;    { Hercules Graphics Card (HGC) }
  41.   _OCGA = $0042;    { Olivetti Color Graphics Adapter (OCGA) }
  42.   _OEGA = $0044;    { Olivetti Enhanced Graphics Adapter (OEGA) }
  43.   _OVGA = $0048;    { Olivetti Video Graphics Array (OVGA) }
  44.  
  45.   { Valeurs du moniteur _VideoConfig }
  46.   _Mono        = $0001;    { Monochrome }
  47.   _Color       = $0002;    { Couleur ou couleur d'émulation améliorée }
  48.   _EnhColor    = $0004;    { Couleur améliorée }
  49.   _AnalogMono  = $0008;    { Monochrome analogique uniquement }
  50.   _AnalogColor = $0010;    { Couleur analogique uniquement }
  51.   _Analog      = $0018;    { Modes monochrome et couleur analogiques }
  52.  
  53.   { Paramètres de contrôle pour _Rectangle, _Ellipse et _Pie }
  54.   _GBorder       = 2;    { Dessiner le contour seulement }
  55.   _GFillInterior = 3;    { Remplir avec la couleur actuelle, remplir le masque }
  56.  
  57.   { Paramètres de contrôle pour _ClearScreen }
  58.   _GClearScreen = 0;
  59.   _GViewport    = 1;
  60.   _GWindow      = 2;
  61.  
  62.   { Directions pour _ScrollTextWindow }
  63.   _GScrollUp    =  1;
  64.   _GScrollDown  = -1;
  65.  
  66.   { Option max rows pour _SetTextRows et _SetVideoModeRows }
  67.   _MaxTextRows  = -1;
  68.  
  69.   { "Verbes d'action" pour _PutImage et _SetWriteMode }
  70.   _GPSET   = 3;
  71.   _GPRESET = 2;
  72.   _GAND    = 1;
  73.   _GOR     = 0;
  74.   _GXOR    = 4;
  75.  
  76.   { Valeurs de couleur universelles }
  77.   _Black        = $000000;
  78.   _Blue         = $2a0000;
  79.   _Green        = $002a00;
  80.   _Cyan         = $2a2a00;
  81.   _Red          = $00002a;
  82.   _Magenta      = $2a002a;
  83.   _Brown        = $00152a;
  84.   _White        = $2a2a2a;
  85.   _Gray         = $151515;
  86.   _LightBlue    = $3F1515;
  87.   _LightGreen   = $153f15;
  88.   _LightCyan    = $3f3f15;
  89.   _LightRed     = $15153f;
  90.   _LightMagenta = $3f153f;
  91.   _Yellow       = $153f3f;
  92.   _BrightWhite  = $3f3f3f;
  93.  
  94.   { Couleurs du mode _EResNoColor }
  95.   _ModeFOff     = 0;
  96.   _ModeFOffToOn = 1;
  97.   _ModeFOffToHi = 2;
  98.   _ModeFOnToOff = 3;
  99.   _ModeFOn      = 4;
  100.   _ModeFOnToHi  = 5;
  101.   _ModeFHiToOff = 6;
  102.   _ModeFHiToOn  = 7;
  103.   _ModeFHi      = 8;
  104.  
  105.   { Couleurs du mode _TextMono }
  106.   _Mode7Off = 0;
  107.   _Mode7On  = 1;
  108.   _Mode7Hi  = 2;
  109.  
  110.   { Valeurs de retour pour _GrStatus }
  111.   _GrOk                 =  0;
  112.   _GrError              = -1;
  113.   _GrModeNotSupported   = -2;
  114.   _GrNotInProperMode    = -3;
  115.   _GrInvalidParameter   = -4;
  116.   _GrFontFileNotFound   = -5;
  117.   _GrInvalidFontFile    = -6;
  118.   _GrCorruptedFontFile  = -7;
  119.   _GrInsufficientMemory = -8;
  120.   _GrInvalidImageBuffer = -9;
  121.   _GrNoOutput           =  1;
  122.   _GrClipped            =  2;
  123.   _GrParameterAltered   =  3;
  124.  
  125. TYPE
  126.   { Structure pour _GetVideoConfig visible pour l'utilisateur }
  127.   _VideoConfig = RECORD
  128.    NumXPixels    : Integer;    { Résolution horizontale }
  129.    NumYPixels    : Integer;    { Résolution verticale }
  130.    NumTextCols   : Integer;    { Colonnes de texte disponibles }
  131.    NumTextRows   : Integer;    { Lignes de texte disponibles }
  132.    NumColors     : Integer;    { Nombre de couleurs disponibles }
  133.    BitsPerPixel  : Integer;    { Bits par pixel }
  134.    NumVideoPages : Integer;    { Pages vidéo disponibles }
  135.    Mode          : Integer;    { Mode vidéo actuel }
  136.    Adapter       : Integer;    { Adaptateur actif }
  137.    Monitor       : Integer;    { Moniteur actif }
  138.    Memory        : Integer;    { Mémoire vidéo en K octets }
  139.   END;
  140.  
  141.   { Structure pour spécifier des motifs de remplissage }
  142.   _FillMask = ARRAY[0..7] OF Byte;
  143.  
  144.   { Valeur de retour de _GetViewCoord,.. }
  145.   _XYCoord = RECORD
  146.    xcoord : Integer;
  147.    ycoord : Integer;
  148.   END;
  149.  
  150.   { Structure pour la paire de coordonnées de fenêtre }
  151.   _WXYCoord = RECORD
  152.    wx : Double;    { Fenêtre x coordonnée }
  153.    wy : Double;    { Fenêtre y coordonnée }
  154.   END;
  155.  
  156.   { Structure pour _GetFontInfo }
  157.   _FontInfo = RECORD
  158.    FontType  : Integer;    { Bit 0 fixé=vecteur, effacé=bit map }
  159.    Ascent    : Integer;    { Pixels de haut en bas }
  160.    PixWidth  : Integer;    { Largeur en pixels, 0 = proportionnel }
  161.    PixHeight : Integer;    { Hauteur des caractères en pixels }
  162.    AvgWidth  : Integer;    { Largeur moyenne des caractères en pixels }
  163.    FileName  : CSTRING[80];{ Nom de fichier incluant le chemin }
  164.    FaceName  : CSTRING[31];{ Nom de la police de caractères }
  165.   END;
  166.  
  167. {------------------------------------------------------------------
  168. Procédures et fonctions MSGraph
  169. -------------------------------------------------------------------}
  170.  
  171. { Installation et configuration }
  172. Function _GrStatus:Integer;
  173. Function _SetVideoMode(mode:Integer):Integer;
  174. Function _SetVideoModeRows(mode,rows:Integer):Integer;
  175. Procedure _SetActivePage(page:Integer);
  176. Procedure _SetVisualPage(page:Integer);
  177. Function _GetActivePage:Integer;
  178. Function _GetVisualPage:Integer;
  179. Procedure _GetVideoConfig(VAR vc:_VideoConfig);
  180.  
  181. { Systèmes de coordonnées }
  182. Procedure _SetViewOrg(x,y:Integer;Var org:_XYCoord);
  183. Procedure _SetViewport(x1,y1,x2,y2:Integer);
  184. Procedure _SetClipRgn(x1,y1,x2,y2:Integer);
  185. Procedure _SetWindow(FInvert:Boolean; x1,y1,x2,y2:Double);
  186. Procedure _GetViewCoord(x,y:Integer;Var xy:_XYCoord);
  187. Procedure _GetViewCoord_w(x,y:Double;Var xy:_XYCoord);
  188. Procedure _GetViewCoord_wxy(Var wxy:_WXYCoord; Var xy:_XYCoord);
  189. Procedure _GetPhysCoord(x, y:Integer;Var xy:_XYCoord);
  190. Procedure _GetWindowCoord(x, y:Integer; Var wxy:_WXYCoord);
  191. Procedure _GetCurrentPosition(Var xy:_XYCoord);
  192. Procedure _GetCurrentPosition_wxy(Var wxy:_WXYCoord);
  193.  
  194. { Routines de sortie }
  195. Procedure _ClearScreen(area:Integer);
  196. Procedure _MoveTo(x,y:Integer);
  197. Procedure _MoveTo_w(wx,wy:Double);
  198. Procedure _LineTo(x,y:Integer);
  199. Procedure _LineTo_w(wx,xy:Double);
  200. Procedure _Rectangle(control,x1,y1,x2,y2:Integer);
  201. Procedure _Rectangle_w(control:Integer; wx1, wy1, wx2, wy2:Double);
  202. Procedure _Rectangle_wxy(control:Integer; Var wxy1,wxy2:_WXYCoord);
  203. Procedure _Ellipse(control,x1, y1, x2, y2:Integer);
  204. Procedure _Ellipse_w(Control:Integer; wx1, wy1, wx2, wy2:Double);
  205. Procedure _Ellipse_wxy(Control:Integer; VAR wxy1, wxy2:_WXYCoord);
  206. Procedure _Arc(x1, y1, x2, y2, x3, y3, x4, y4 : Integer);
  207. Procedure _Arc_wxy(Var wxy1, wxy2, wxy3, wxy4:_WXYCoord);
  208. Procedure _Pie(control, x1, y1, x2, y2, x3, y3, x4, y4:Integer);
  209. Procedure _Pie_wxy(control:Integer;Var wxy1, wxy2, wxy3, wxy4:_WXYCoord);
  210. Procedure _FloodFill(x, y, boundary:Integer);
  211. Procedure _FloodFill_w(wx, wy:Double; boundary:Integer);
  212.  
  213. { Informations sur le plus récent _Arc ou _Pie }
  214. Function _GetArcInfo(Var StartPoint, EndPoint, FillPoint:_XYCoord):Boolean;
  215.  
  216. { Routines de couleur de pixel }
  217. Procedure _SetPixel(x, y:Integer);
  218. Procedure _SetPixel_w(wx, wy:Double);
  219. Function _GetPixel(x, y:Integer):Integer;
  220. Function _GetPixel_w(wx, wy:Double):Integer;
  221.  
  222. { Routines de couleur de stylo, de style de ligne et de motif de remplissage }
  223. Procedure _SetColor(color:Integer);
  224. Function _GetColor:Integer;
  225. Procedure _SetLineStyle(style:Word);
  226. Function _GetLineStyle:Word;
  227. Procedure _SetWriteMode(wmode:Integer);
  228. Function _GetWriteMode:Integer;
  229. Procedure _SetFillMask(mask:_FillMask);
  230. Function _GetFillMask(Var mask:_FillMask):Boolean;
  231.  
  232. { Sélection de la couleur de fond }
  233. Procedure _SetBkColor(color:LongInt);
  234. Function _GetBkColor:LongInt;
  235.  
  236. { Routines pour définir une palette de couleurs }
  237. Function _RemapPalette( index:Integer;value:LongInt):LongInt;
  238. Procedure _RemapAllPalette(Var newpalette);
  239. Function _SelectPalette(Number:Integer):Integer;
  240.  
  241. { Fonctions de texte }
  242. Function _SetTextRows(rows:Integer):Integer;
  243. Procedure _SetTextWindow(r1,c1,r2,c2:Integer);
  244. Procedure _GetTextWindow(Var r1,c1,r2,c2:Integer);
  245. Procedure _ScrollTextWindow(Count:Integer);
  246. Procedure _OutMem(TextString:CSTRING;Length:Integer);
  247. Procedure _OutText(TextString:CSTRING );
  248. Function _WrapOn(Option:Boolean):Boolean;
  249. Function _DisplayCursor(Toggle:Boolean):Boolean;
  250.  
  251. { Routines d'attribut de curseur }
  252. Procedure _SetTextCursor(Attr:Word);
  253. Function _GetTextCursor:Word;
  254.  
  255. { Routines de position de texte en cours }
  256. Procedure _SetTextPosition(r, c:Integer);
  257. Procedure _GetTextPosition(Var r, c:Integer);
  258.  
  259. { Sélection de la couleur de fond }
  260. Procedure _SetTextColor(Color:Integer);
  261. Function _GetTextColor:Integer;
  262.  
  263. { Images d'écran }
  264. Procedure _GetImage(x1,y1,x2,y2:Integer;Var image);
  265. Procedure _GetImage_w(wx1,wy1,wx2,wy2:Double;Var image);
  266. Procedure _GetImage_wxy(VAR wxy1,wxy2:_WXYCoord;Var image);
  267. Procedure _PutImage(x,y:Integer;Var image;action:Integer);
  268. Procedure _PutImage_w(wx,wy:Double;Var image;action:Integer);
  269. Function _ImageSize(x1,y1,x2,y2:Integer):LongInt;
  270. Function _ImageSize_w(wx1,wy1,wx2,wy2:Double):LongInt;
  271. Function _ImageSize_wxy(VAR wxy1,wxy2:_WXYCoord):LongInt;
  272.  
  273. { Fonctions de polices de caractères }
  274. Function _RegisterFonts(pathname:CSTRING):Integer;
  275. Procedure _UnRegisterFonts;
  276. Function _SetFont(options:CSTRING):Integer;
  277. Procedure _OutGText(TextString:CSTRING);
  278. Function _GetGTextExtent(TextString:CSTRING):Integer;
  279. Function _GetFontInfo(Var FInfo:_FontInfo):Integer;
  280. Procedure _SetGTextVector(x,y:Integer);
  281. Procedure _GetGTextVector(Var x,y:Integer);


PARTAGER CETTE PAGE SUR
Dernière mise à jour : Dimanche, le 20 avril 2014