Author Topic: ADW Modula Corner opened.  (Read 3193 times)

0 Members and 1 Guest are viewing this topic.

Offline Theo Gottwald

  • Administrator
  • Hero Member
  • *****
  • Posts: 964
    • it-berater
ADW Modula Corner opened.
« on: July 15, 2013, 10:14:26 PM »
This is my second choice as PB alternative, especially as it also supports x32 as well as x64 code.
The language is much cleaner then C(#++) to my taste, and the last update was this April. Means - they are working on it.
Also ITS FREE.

ADW-Modula

Version 2.74 - August 2, 2013

    Corrected ResEdit
    Added Unicode support to library
    Correction in debugger when using Generic modules
    Correction of usage of arrays in Generic modules
    WinShell.mod: multiple corrections
    64-bit code generation when using DIV and MOD on 8-bit values

Download ADWm2.74.zip  http://www.modula2.org/adwm2/ADWm2.74.zip

Download Setup FREE

Here is a Hint:
Running the Setup under Win7/x64 with UAC enabled, you have to start it as "Administrator" otehrwise the Setup will not be able to create the needed folders.
« Last Edit: August 07, 2013, 08:00:47 PM by Theo Gottwald »

Offline Richard Koch

  • Newbie
  • *
  • Posts: 23
wingraphics DEF
« Reply #1 on: August 03, 2013, 11:47:40 PM »
Code: [Select]
DEFINITION MODULE wingraphics;
FROM SYSTEM IMPORT LOC;
FROM WIN32 IMPORT *;
FROM WINGDI IMPORT BITMAPFILEHEADER,BITMAPINFOHEADER,RGBTRIPLE;

CONST
(*error codes*)
  grOK =   0;
  grNoInitGraph = - 1;
  grInvalidDriver = - 2;
  grInvalidMode = - 3;
  grNotWindow = - 4;
  grInvalidFont = - 5;
  grInvalidFontNum = - 6;
  grInvalidParam = - 7;
  grNoPalette = - 8;
  grNoOpenGL = - 9;
  grError = -10;
(*graphics drivers*)
  Detect = 0;
  D1bit = 1;
  D4bit = 2;
  D8bit = 3;
  NoPalette = 9;
  HercMono = D1bit;
  VGA = D4bit;
  SVGA = D8bit;
(*graphics modes*)
  m320x200 =  1;
  m640x200 =  2;
  m640x350 =  3;
  m640x480 =  4;
  m720x350 =  5;
  m800x600 =  6;
  m1024x768 =  7;
  m1280x1024 =  8;
  mDefault = 10;
  mMaximized = 11;
  mFullScr = 12;
  mCustom  = 13;
  HercMonoHi = m720x350;
  VGALo  = m640x200;
  VGAMed = m640x350;
  VGAHi  = m640x480;
(*update constants*)
  UpdateOff = 0;
  UpdateOn  = 1;
  UpdateNow = 2;
(*OpenGL drawing modes*)
  DirectOn  = TRUE;
  DirectOff = FALSE;

(*clipping constants*)
  ClipOn = TRUE;
  ClipOff = FALSE;
(*raster operation constants*)
  CopyPut =  0;
  XorPut  =  1;
  OrPut   =  2;
  AndPut  =  3;
  NotPut  =  4;
  NotOrPut =  5;
  InvBitOrPut =  6;
  InvScrAndPut =  7;
  TransPut =  8;
  MaskPut  =  9;
  BkgPut   = 10;
  NormalPut = CopyPut;
(*drawing modes on screen*)
  CopyMode =  0;
  XorMode  =  1;
  OrMode   =  2;
  AndMode  =  3;
  NotMode  =  4;
  NotScrMode =  5;
  NotXorMode =  6;
  NotOrMode  =  7;
  NotAndMode =  8;
  InvColAndMode =  9;
  InvColOrMode  = 10;
  InvScrAndMode = 11;
  InvScrOrMode  = 12;
  BlackMode = 13;
  WhiteMode = 14;
  EmptyMode = 15;
  Transparent = 00;
  Opaque    = 16;
(*drawing style for lines*)
  SolidLn   = 0;
  DottedLn  = 1;
  DashDotLn = 2;
  DashedLn  = 3;
  DashDotDotLn = 4;
  UserBitLn = 5;
  NullLn    = 6;
(*thick constants for lines*)
  NormWidth   = 1;
  DoubleWidth = 2;
  TripleWidth = 3;
  QuadWidth   = 4;
  ThickWidth  = TripleWidth;
(*filling patterns*)
  EmptyFill = 0;
  SolidFill = 1;
  LineFill  = 2;
  ColFill   = 3;
  HatchFill = 4;
  SlashFill = 5;
  BkSlashFill= 6;
  XHatchFill = 7;
  UserFill   = 8;
  NoFill     = 9;
(*Bar3D constants*)
  TopOn  = TRUE;
  TopOff = FALSE;
(*flood mode constants*)
  BorderFlood  = 0;
  SurfaceFlood = 1;
(*justify constants for text*)
  LeftText   = 0;
  CenterText = 1;
  RightText  = 2;
  TopText    = 0;
  BottomText = 1;
  BaselineText = 2;
(*direction constants for text*)
  HorizDir =  0;
  VertDir = 90;
(*font constants for text*)
  CourierNewFont   = 0;
  MSSansSerifFont  = 1;
  TimesNewRomanFont= 2;
  ArialFont   = 3;
  DefaultFont = CourierNewFont;
  ItalicFont  = 1000H;
  UnderlineFont = 0100H;
  BoldFont    = 0010H;

  UPARROW     = 72;
  DOWNARROW   = 80;
  LEFTARROW   = 75;
  RIGHTARROW  = 77;
  ESC         = 27;
  F1          = 59;
  F2          = 60;
  F3          = 61;
  F4          = 62;
  F5          = 63;
  F6          = 64;
  F7          = 65;
  F8          = 66;
  F9          = 67;
  F10         = 68;
  F11         = 133;
  F12         = 134;
  INS         = 82;
  DEL         = 83;
  HOME        = 71;
  ENDS        = 79;
  PAGEUP      = 73;
  PAGEDOWN    = 81;
  CENTER      = 53;

TYPE
  ViewPortType = RECORD
    x1,y1,x2,y2: INTEGER;
    clip       : BOOLEAN;
  END;
  AnimatType = RECORD
    bitHnd: HBITMAP;
    maskHnd:HBITMAP;
    bkgHnd: HBITMAP;
  END;
  IMAGE = RECORD
     bmiInfoHeader: BITMAPINFOHEADER;
     bmiFileHeader: BITMAPFILEHEADER;
     bmiBits      : POINTER TO ARRAY OF RGBTRIPLE;
  END;
  PaletteType = RECORD
     size  : INTEGER;
     colors: ARRAY[0..255] OF CARDINAL;
  END;
  PointType = POINT;
  ThreeDPointType = RECORD
    x,y,z: REAL;
  END;
  LineSettingsType = RECORD
    linestyle,pattern,thickness: CARDINAL;
  END;
  ArcCoordsType = RECORD
    x,y,xstart,ystart,xend,yend: INTEGER;
  END;
  FillSettingsType = RECORD
    pattern: CARDINAL;
    color  : CARDINAL;
  END;
  FillPatternType = ARRAY [1..8] OF LOC;
  TextSettingsType = RECORD
    font,direction,charsize,horiz,vert: CARDINAL;
  END;
(*keyboard & mouse hook variables*)
  WNDPROC = PROCEDURE(HWND, UINT, WPARAM, LPARAM): LRESULT;
  ProcHookType = WNDPROC;

(*alphabetical color names*)

VAR AliceBlue,AlizarinCrimson,Amber,Amethyst,AntiqueWhite,Aquamarine,Asparagus,Azure,
    Beige,Bisque,Bistre,BitterLemon,Black,BlanchedAlmond,BlazeOrange,Blue,
    BlueViolet,BondiBlue,Brass,BrightGreen,BrightTurquoise,BrightViolet,Bronze,Brown,
    Buff,Burgundy,BurlyWood,BurntOrange,BurntSienna,BurntUmber,CadetBlue,CamouflageGreen,
    Cardinal,Carmine,Carrot,Casper,Celadon,Cerise,Cerulean,CeruleanBlue,
    Chartreuse,Chocolate,Cinnamon,Cobalt,Copper,Coral,Corn,CornflowerBlue,
    Cornsilk,Cream,Crimson,Cyan,DarkBlue,DarkBrown,DarkCerulean,DarkChestnut,
    DarkCoral,DarkCyan,DarkGoldenrod,DarkGray,DarkGreen,DarkIndigo,DarkKhaki,DarkMagenta,
    DarkOlive,DarkOliveGreen,DarkOrange,DarkOrchid,DarkPastelGreen,DarkPink,DarkRed,DarkSalmon,
    DarkScarlet,DarkSeaGreen,DarkSlateBlue,DarkSlateGray,DarkSpringGreen,DarkTan,DarkTangerine,DarkTeaGreen,
    DarkTerraCotta,DarkTurquoise,DarkViolet,DeepPink,DeepSkyBlue,Denim,DimGray,DodgerBlue,
    Emerald,Eggplant,FernGreen,FireBrick,Flax,FloralWhite,ForestGreen,Fractal,
    Fuchsia,Gainsboro,Gamboge,GhostWhite,Gold,Goldenrod,Gray,GrayAsparagus,
    GrayTeaGreen,Green,GreenYellow,Heliotrope,Honeydew,HotPink,IndianRed,Indigo,
    InternationalKleinBlue,InternationalOrange,Ivory,Jade,Khaki,Lavender,LavenderBlush,LawnGreen,
    Lemon,LemonChiffon,LightBlue,LightBrown,LightCoral,LightCyan,LightGoldenrodYellow,LightGray,
    LightGreen,LightMagenta,LightPink,LightRed,LightSalmon,LightSeaGreen,LightSkyBlue,LightSlateGray,
    LightSteelBlue,LightYellow,Lilac,Lime,LimeGreen,Linen,Magenta,Malachite,
    Maroon,Mauve,MediumAquamarine,MediumBlue,MediumOrchid,MediumPurple,MediumSeaGreen,MediumSlateBlue,
    MediumSpringGreen,MediumTurquoise,MediumVioletRed,MidnightBlue,MintCream,MistyRose,Moccasin,MoneyGreen,
    Monza,MossGreen,MountbattenPink,Mustard,NavajoWhite,Navy,Ochre,OldGold,
    OldLace,Olive,OliveDrab,Orange,OrangeRed,Orchid,PaleBrown,PaleCarmine,
    PaleChestnut,PaleCornflowerBlue,PaleGoldenrod,PaleGreen,PaleMagenta,PaleMauve,PalePink,PaleSandyBrown,
    PaleTurquoise,PaleVioletRed,PapayaWhip,PastelGreen,PastelPink,Peach,PeachOrange,PeachPuff,
    PeachYellow,Pear,Periwinkle,PersianBlue,Peru,PineGreen,Pink,PinkOrange,
    Plum,PowderBlue,PrussianBlue,Puce,Pumpkin,Purple,RawUmber,Red,
    Reef,RobinEggBlue,RosyBrown,RoyalBlue,Russet,Rust,SaddleBrown,Saffron,
    Salmon,SandyBrown,Sangria,Sapphire,Scarlet,SchoolBusYellow,SeaGreen,SeaShell,
    SelectiveYellow,Sepia,Sienna,Silver,SkyBlue,SlateBlue,SlateGray,Snow,
    SpringGreen,SteelBlue,SwampGreen,Taupe,Tangerine,Teal,TeaGreen,Tenne,
    TerraCotta,Thistle,Tomato,Turquoise,Ultramarine,Vermilion,Violet,VioletEggplant,
    Viridian,Wheat,White,WhiteSmoke,Wisteria,Yellow,YellowGreen,Zinnwaldite: CARDINAL;

    KeyboardHook,MouseHook: ProcHookType;


(*initialization exported routines*)

(*Clears the entire graphics screen using ClearViewPort routine. See that routine for details. Current pointer is reset
  at (0,0), that is top-left corner of the screen.*)
PROCEDURE ClearDevice;
(*Closes the graphics window and releases all resources related to it. The parent console window is shown again in foreground
(if any). You can restore back the graphics window using SetGraphMode or InitGraph.*)
PROCEDURE CloseGraph;
(*It checks whether the user clicked the close button of the graphics window with the mouse. It is up to the programmer to
handle this request. Usually, CloseGraph routine must be invoked. If the window does not have a title bar such an event cannot
be recorded.
If WinCrt unit is included, a sequence of keystrokes #0#107 (Alt-F4) is also generated.*)
PROCEDURE CloseGraphRequest(): BOOLEAN;
(*Returns default values for graphics driver (driver) and mode (mode). These values equal driver=NoPalette and mode=mDefault.
That is, a window with all colors available and with default size. See InitGraph for a list of drivers and modes.*)
PROCEDURE DetectGraph(VAR driver,mode:INTEGER);
(*Returns the name of the selected graphics driver (and number of available colors). See InitGraph for a list of
graphics drivers.*)
PROCEDURE GetDriverName(VAR nam: ARRAY OF CHAR);
(*Returns the current (or last used) graphics mode. See InitGraph for a list of graphics modes.*)
PROCEDURE GetGraphMode(): INTEGER;
(*Returns the maximum valid mode number. This is always mFullScr. See InitGraph for more details. If you want to retrive user
screen dimensions (desktop dimensions) call GetModeRange.*)
PROCEDURE GetMaxMode(): INTEGER;
(*Returns the name of the specified graphics mode (mode). See InitGraph for a list of graphics modes.*)
PROCEDURE GetModeName(mode:INTEGER; VAR nam: ARRAY OF CHAR);
(*Contrary to BP, it returns the width and height, in pixels, of the user screen (desktop). That is, (width) contains the width
 and (height) contains the height. They do not depend on the (driver), which is a dummy argument. Using this routine you can
 learn about the dimensions of the user screen before calling InitGraph.*)
PROCEDURE GetModeRange(driver:INTEGER; VAR width,height:INTEGER);
(*Resets graphics settings to their default values for palette, line style, foreground and background colors, filling pattern
and style, text style and placement, viewport, write mode and aspect ratio. This routine is first used by InitGraph.*)
PROCEDURE GraphDefaults;
(*Tests if the graphics window is enabled. If so, you can perform graphics. Usually, after InitGraph, this routine returns
true and, after CloseGraph, it returns false.*)
PROCEDURE GraphEnabled(): BOOLEAN;
(*Returns a string describing the error (errorcode). This string can be used to let the user know what went wrong. We have the following types of error codes:
  grOk - no error
  grInvalidDriver - invalid graphics driver
  grInvalidMode - invalid graphics mode
  grNotWindow - creation of graphics window failed
  grNoInitGraph - graphics window not initialized
  grInvalidFont - invalid font selection
  grInvalidFontNum - invalid font number
  grInvalidParam - invalid parameter value
  grNoPalette - no palette available
  grNoOpenGL - OpenGL driver not initialized
  grError - general graphics error
Use GraphResult to return an error code.*)
PROCEDURE GraphErrorMsg(errorcode:INTEGER; VAR msg: ARRAY OF CHAR);
(*Returns an error code for the last graphics operation. If the returned value is zero (grOK), all went well. A value different
from zero means an error has occurred. Most of routines which draw something on screen, set or query some drawing attributes can
produce a GraphResult different from zero. Calling this routine once will reset the error code back to zero. GraphResult should
be used after InitGraph to discover initialization problems, since that routine may fail on some situations: graphics driver and
mode is not supported, or default fonts cannot be installed, or OpenGL driver cannot be initialized, etc.
Each error code has an associated error message. Use GraphErrorMsg to get this message. See that routine for a list
of error codes.*)
PROCEDURE GraphResult(): INTEGER;
PROCEDURE InitGraphics(WinX, WinY: INTEGER; title: ARRAY OF CHAR);
(*Initializes the graphics window. Graphics drivers (driver) are:
  D1bit - 2 colors
  D4bit - 16 colors
  D8bit - 256 colors
  Detect - routine DetectGraph is used
  NoPalette - no palette, all colors in the system are available
  HercMono=D1bit
  VGA=D4bit
  SVGA=D8bit
If you select a driver with palette, you get a limited number of available colors (the palette entries, 256 or less). See also
SetAllPalette. If NoPalette driver is selected then all colors generated by the system are available. Color names are mapped to
their pre-defined RGB values. If driver=Detect then InitGraph returns in (driver) and (mode) their default values given by
DetectGraph and initializes the graphics window.
Graphics modes (mode) are:
  m320x200 - 320 by 200 pixels
  m640x200 - 640 by 200 pixels
  m640x350 - and so on ...
  m640x480
  m720x350
  m800x600
  m1024x768
  m1280x1024
  mDefault - default size given by Windows system
  mMaximized - a maximized window (with caption bar)
  mFullScr - a full screen window (no caption bar)
  mCustom - a custom sized window (use SetWindowSize first to set its dimensions)
  HercMonoHi=m720x350
  VGALo=m640x200
  VGAMed=m640x350
  VGAHi=m640x480
All modes for which the graphics window fits into the screen (with or without a caption bar) are valid. The third argument
(title), if not empty, sets the title of the graphics window, otherwise this title is set to WinGraph version string (WinGraphVer).
The routine sets the attributes for the graphics window and creates a dedicated thread for messaging the window. Before
returning it sets the active page, installs several default fonts, invokes GraphDefaults to get default settings for drawings,
enables OpenGL driver (if conditional INIT_OPENGL is set in the source code) and hides the parent console window (if any and
if conditional HIDE_CONSOLE is set in the source code as well ). See GraphResult for possible failure problems.
Most of WinGraph routines do nothing useful before InitGraph is invoked. Anyway, the following ones do work:
  DetectGraph
  GetDefaultPalette
  GetNamesPalette
  GetMaxMode
  GetModeName
  GetModeRange
  GraphEnabled
  GraphErrorMsg
  GraphResult
  ImageSize
  InitGraph
  GetRGBColor
  GetRGBComponents
  SetGraphMode
  SetWindowSize
Use CloseGraph to close the graphics window.*)
PROCEDURE InitGraph(VAR driver,mode:INTEGER; title: ARRAY OF CHAR);
(*Checks whether OpenGL driver is initialized. If not, you are not able to perform OpenGL drawings. This can happen if
INIT_OPENGL conditional is not enabled in the source code, or the current selected graphics driver does not support OpenGL
initialization. D1bit graphics driver does not support OpenGL drawings. See InitGraph for a description of graphics drivers.
OpenGL driver can be initialized in two ways. See SetOpenGLMode for details.*)
PROCEDURE OpenGLEnabled(): BOOLEAN;
(*It is completely equivalent with CloseGraph. See that routine for details. Can be used in combination with SetGraphMode.*)
PROCEDURE RestoreCrtMode;
(*Sets the graphics window back on screen using graphics mode (mode) and the previous selected driver. All previous graphics
settings are lost. See InitGraph for details.
It should be used after CloseGraph or RestoreCRTMode.*)
PROCEDURE SetGraphMode(mode:INTEGER);
(*It changes the drawing mode for OpenGL routines. Argument (direct) is one of the following constants:
  DirectOff - OpenGL driver doesn't write directly on screen
  DirectOn - OpenGL driver writes directly on screen
In the first mode (DirectOff) all OpenGL drawings are performed into the OpenGL buffer. Because of that you must use OpenGL
specific command glFlush() to release this buffer into the active page after each frame. This mode is mainly used for static
OpenGL drawings when speed is not so important. In palette-based drivers the OpenGL drawings are affected by the selected palette.
This is the default mode.
In the second mode (DirectOn) all OpenGL drawings are performed directly on screen. That means high-speed graphics, but no
possibility to keep a copy of OpenGL output into the active page. This mode is mainly used for dynamic images when speed is
important. OpenGL drawings are not affected by the selected palette.
In both modes you must use UpdateGraph(UpdateNow) after each frame, in order to update the screen. When changing the OpenGL mode,
all previous OpenGL settings are lost.
You can mix OpenGL and WinGraph routines but this is usually not recommended. If you do so keep in mind the following: in
(DirectOff) mode WinGraph routines must be called after glFlush() is issued and UpdateGraph(UpdateOff) should be activated first
to avoid screen updates between commands; in (DirectOn) mode you can mix these routines as you want but screen flickering may appear.
Before calling OpenGL routines you should check with OpenGLEnabled if OpenGL driver is initialized. See that routine for more details.*)
PROCEDURE SetOpenGLMode(direct:BOOLEAN);
(*Sets the dimensions of the graphics window to be created by InitGraph. In this case you must use mCustom graphics mode. (width)
is the width and (height) is the height in pixels of the window client area. See InitGraph for more details.*)
PROCEDURE SetWindowSize(width,height:CARDINAL);
(*This routine is used to manage all graphics operations. By default, these operations are performed simultaneously onto the
graphics window and in memory (the current active page). However, you can change this behaviour with UpdateGraph. The meaning
of (bit) is the following:
  UpdateOff - graphics operations are not performed directly on screen, only on memory (you can gain some speed here)
  UpdateOn - graphics operations are also performed directly on screen (this is the default)
  UpdateNow - screen is updated with the content of the current active page right now; used in conjunction with UpdateOff.
This routine is useful to synchronize the output of several graphics operations, in order to reduce screen flickering. In
addition, you must use UpdateGraph(UpdateNow) to force updating the screen after each OpenGL frame. See SetOpenGLMode for details.
WinCrt routines
WinCrt unit adds keyboard support to WinGraph. Graphics window must be enabled with InitGraph in order to use this unit properly.*)
PROCEDURE UpdateGraph(bit:CARDINAL);

(*screen management exported routines*)

(*Clears the current viewport. The current background color is used as filling color. The pointer is set at (0,0),
that is top-left corner of the viewport. See also SetViewPort and SetBkColor for more details.*)
PROCEDURE ClearViewPort;
(*Frees the animation resources associated with the animation handle (anim). See GetAnim for more details.*)
PROCEDURE FreeAnim(VAR anim:AnimatType);
(*An animation structure contains a bitmap, its mask and a background image. With such a structure you can create transparent
bitmaps and animations, but you have no programmatic access to this structure.
GetAnim returns in variable (anim) the handle of an animation with a bitmap image taken from screen in the rectangle defined by
coordinates (x1,y1,x2,y2). A mask image is also created and room for background image is reserved. The system stores itself all
animation resources into memory. Use FreeAnim to release the memory after use. The (color) is the transparent color to be set.
This color is turned into black in the bitmap image and OR-ed with the screen color. Use PutAnim to place the animation back
on screen.*)
PROCEDURE GetAnim(x1,y1,x2,y2:INTEGER; color:CARDINAL; VAR anim:AnimatType);
(*An animation structure contains a bitmap, its mask and a background image. With such a structure you can create transparent
bitmaps and animations, but you have no programmatic access to this structure.
GetAnim returns in variable (anim) the handle of an animation with a bitmap image taken from screen in the rectangle defined
by coordinates (x1,y1,x2,y2). A mask image is also created and room for background image is reserved. The system stores itself
all animation resources into memory. Use FreeAnim to release the memory after use. The (color) is the transparent color to be
set. This color is turned into black in the bitmap image and OR-ed with the screen color. Use PutAnim to place the animation
back on screen.*)
PROCEDURE GetAspectRatio(VAR xasp,yasp:CARDINAL);
(*Places a copy of the screen area given by rectangle with coordinates (x1,y1,x2,y2) in the variable (bitmap). This variable
must have enough room to accomodate the image (use ImageSize to get the exact size). Afterwards the image can be put back on
screen using PutImage.
The format of bitmap is hardcoded to 24 bits per pixel, so it is driver independent. In fact (bitmap) will contain the complet
structure of a BMP image and can be saved on disk and loaded into your favourite image viewer.
See PutImage for more details.*)
PROCEDURE GetImage(x1,y1,x2,y2:INTEGER; VAR bitmap: IMAGE);
(*Returns the maximum x-coordinate (horizontal) in pixels. This equals the client area width minus 1. Maximum is placed on the
right side.*)
PROCEDURE GetMaxX(): INTEGER;
(*Returns the maximum y-coordinate (vertical) in pixels. This equals the client area height minus 1. Maximum is placed on the
bottom side.*)
PROCEDURE GetMaxY(): INTEGER;
(*Returns the current viewport and clipping settings in (viewport). You can change these settings using SetViewPort.*)
PROCEDURE GetViewSettings(VAR viewport:ViewPortType);
(*Returns the x-coordinate of the current position of the graphical pointer in pixels. It ranges between 0 and GetMaxX.
It increases from left to right.*)
PROCEDURE GetX(): INTEGER;
(*Returns the y-coordinate of the current position of the graphical pointer in pixels. It ranges between 0 and GetMaxY.
It increases from top to bottom.*)
PROCEDURE GetY(): INTEGER;
(*Returns the number of bytes needed to store the image from the rectangle defined by coordinates (x1,y1,x2,y2). It should be
used before calling GetImage and PutImage. See those routines for details.*)
PROCEDURE ImageSize(x1,y1,x2,y2:INTEGER): INTEGER;
(*PutAnim puts the animation with the specified handle (anim) on screen at given coordinates (x1,y1). Such an animation is
previously created with GetAnim. See that routine for more details. Argument (bit) determines how the animation will be placed.
Pre-defined values include those from PutImage routine and, in addition:
  TransPut - copies the animation to the screen with transparent color enabled
  MaskPut - copies the animation mask to the screen
  BkgPut - copies the animation background (taken from previous PutAnim) to the screen
In palette-based drivers the colors in the animation are mapped to the palette entries. Anyway, because the palette is just a
logical one, you should use UpdateGraph routine to assure that the animation on screen has the same color composition as appear
 in the active page. Due to same reason, raster operations do not perform well on such drivers.
PutAnim is usually faster than PutImage.*)
PROCEDURE PutAnim(x1,y1:INTEGER; VAR anim:AnimatType; bit:CARDINAL);
(*Places the image from (bitmap) on the screen at (x1,y1). Argument (bit) determines how the bitmap will be placed. Pre-defined
values are:
  CopyPut - copies the bitmap directly to the screen
  XorPut - combines the colors of the bitmap and the screen by using the logical XOR operator
  OrPut - combines the colors of the bitmap and the screen by using the logical OR operator
  AndPut - combines the colors of the bitmap and the screen by using the logical AND operator
  NotPut - copies the inverted bitmap to the screen
  NotOrPut - combines the colors of the bitmap and the screen by using the logical OR operator and then inverts the resultant color
  InvBitOrPut - combines the colors of the inverted bitmap with the colors of the screen by using the logical OR operator
  InvScrAndPut - combines the inverted colors of the screen with the colors of the bitmap by using the logical AND operator
  NormalPut=CopyPut
In palette-based drivers the colors in the bitmap are mapped to the palette entries. Anyway, because the palette is just a
logical one you should use UpdateGraph routine to assure that the bitmap on screen has the same color composition as appear in
the active page. Due to same reason, raster operations do not perform well on such drivers.
With PutImage you can put on screen any external BMP image having 24 bits format. See GetImage for more details.
If you want to perform animations please consider using PutAnim.*)
PROCEDURE PutImage(x1,y1:INTEGER; VAR bitmap: IMAGE; bit:CARDINAL);
(*Sets the active page where all drawings are performed. If different than visual page, these drawings do not appear on screen.
At least 4 active pages exist (starting with 0), but this number can be increased from the source code. This routine can be used
to create multiple outputs. See also SetVisualPage.
Programmatically, an active page is a memory copy of the graphics window. This copy is also used by the messaging thread to
refresh the graphics window as necessary.
You can use UpdateGraph routine to refresh the graphics window with the content of the current active page. This is useful if
drawings are not performed directly on the graphics window.*)
PROCEDURE SetActivePage(page:CARDINAL);
(*Sets the aspect ratio of the screen to the ratio given by xasp/yasp. It affects only routines for circular shapes. Does not
have a practical use other than backward compatibility with BP. Default values are (10000,10000). See also GetAspectRatio.*)
PROCEDURE SetAspectRatio(xasp,yasp:CARDINAL);
(*Sets the current output viewport to the rectangle defined by the top-left corner (x1,y1) and the bottom-right corner (x2,y2).
If (clip) is true, anything drawn outside the viewport will be clipped (not drawn). Coordinates specified after this call are
relative to the top-left corner of the viewport. Cursor position is reset to (0,0). The following clipping constants are defined:
  ClipOn = true
  ClipOff = false
OpenGL drawings are not bounded to the viewport.*)
PROCEDURE SetViewPort(x1,y1,x2,y2:INTEGER; clip:BOOLEAN);
(*Sets the visual page to be displayed onto the graphics window. For more info see SetActivePage routine. UpdateGraph uses this
routine to force screen refreshes.*)
PROCEDURE SetVisualPage(page:CARDINAL);
(*It specifies what binary operation is performed when drawing on screen. Argument (writemode) has two components. First
component is the foreground mix mode. It affects contours (including lines) and filled shapes (excluding Bar). Can be one of
the following pre-defined constants:
  CopyMode - pixels are simply copied onto the screen
  XorMode - pixels are combination of the drawing color and screen color, but not in both (logical XOR)
  OrMode - pixels are combination of the drawing color and screen color (logical OR)
  AndMode - pixels are combination of the colors common to both the drawing and screen (logical AND)
  NotMode - pixels are the inverse of the drawing color (logical NOT)
  NotScrMode - pixels are the inverse of the screen color
  NotXorMode - pixels are the inverse of the XorMode color
  NotOrMode - pixels are the inverse of the OrMode color
  NotAndMode - pixels are the inverse of the AndMode color
  InvColAndMode - pixels are combination of the colors common to both the screen and the inverse of drawing color
  InvColOrMode - pixels are combination of the screen color and the inverse of drawing color
  InvScrAndMode - pixels are combination of the colors common to both the drawing and the inverse of screen color
  InvScrOrMode - pixels are combination of the drawing color and the inverse of screen color
  BlackMode - pixels are always 0
  WhiteMode - pixels are always 1
  EmptyMode - screen pixels remain unchanged
  Second component is the background mix mode. It affects only texts. Can be one of the following two pre-defined constants:
  Transparent - screen remains untouched (as in BP graph unit)
  Opaque - screen is filled with the current background color before the text is drawn
Argument (writemode) is an OR-ed combination of the foreground and background mix modes. By default it equals CopyMode OR Transparent.
SetWriteMode does not perform well on palette-based drivers, especially if the palette was not retrived by GetSystemPalette
routine. Anyway, because the palette is just a logical one you must use UpdateGraph routine to assure that the screen has the
same color composition as the active page.
You can use InvertRect to perform logical NOT operations over the screen content.*)
PROCEDURE SetWriteMode(writemode:INTEGER);

(*color management exported routines*)

(*Returns the current background color. This is a palette entry for palette-based drivers and an absolute RGB color for
non-palette driver. Use SetBkColor to set a new color.*)
PROCEDURE GetBkColor(): CARDINAL;
(*Returns the current drawing color. This is a palette entry for palette-based drivers and an absolute RGB color for
non-palette driver. Use SetColor to set a new color.*)
PROCEDURE GetColor(): CARDINAL;
(*Returns default VGA palette with maximum of 256 colors. By default, in palette-based drivers, all color names are mapped to
entries into this palette. In this manner you get the same composition for each of 16 basic colors as in BP graph unit. To
retrive standard (real) composition for each color name you should use GetNamesPalette.*)
PROCEDURE GetDefaultPalette(VAR palette:PaletteType);
(*Returns the palette having entries the color names. It stores the standard composition for all color names defined by WinGraph.
In non-palette driver, color names are mapped to entries into this palette. This is not the default palette. The first color
entry in this palette is not Black. There is a total of 256 pre-defined color names. If you feel this is useless for you, or if
you want to retrive the legacy values of 16 color names as in BP, please recompile the source with conditional 256_COLOR_NAMES
disabled.*)
PROCEDURE GetNamesPalette(VAR palette:PaletteType);
(*Returns the highest color which can be set with SetColor or other routines that accept colors. Depending on palette, this
color is not always White. All colors between 0 and GetMaxColor are guarantied to be valid.
In palette-based drivers this function equals GetPaletteSize -1, otherwise it equals FFFFFFH.*)
PROCEDURE GetMaxColor(): CARDINAL;
(*Returns in (palette) the current palette. To retrive just the palette size use GetPaletteSize. See SetAllPalette for more
details on palettes.*)
PROCEDURE GetPalette(VAR palette:PaletteType);
(*Returns the maximum number of entries in the current palette. To retrive the entire palette structure use GetPalette. See
SetAllPalette for more details on palettes.*)
PROCEDURE GetPaletteSize(): INTEGER;
(*Gets the pixel color of the point at position (x,y). This is a palette entry for palette-based drivers and an absolute RGB
color for non-palette driver. To set a new color for the pixel use PutPixel.*)
PROCEDURE GetPixel(x,y:INTEGER): CARDINAL;
(*For non-palette driver it returns an absolute RGB color value. In palette-based drivers it returns the color (palette index)
 nearest to the specified RGB composition. See SetRGBPalette routine for a description of input parameters.
You can use it before InitGraph to create true color entries into a palette. Use GetRGBComponents to convert an absolute RGB
color backward into its RGB intensity components.*)
PROCEDURE GetRGBColor(r,g,b:CARDINAL): CARDINAL;
(*Returns the (Red,Green,Blue) intensity components of the color (color) in (r), (g), (b) variables. Their values range
between 0 and 255. For example, Black returns (0,0,0). See also GetRGBColor. Parameter (color) is a palette index in
palette-based drivers and a true RGB color for the non-palette driver. *)
PROCEDURE GetRGBComponents(color:CARDINAL; VAR r,g,b:CARDINAL);
(*Returns a maximum of 256 colors from Windows system palette. This is the palette initialized by the operating system at
start-up. You have no guaranty that this palette is the same across all systems. In fact, it's not.*)
PROCEDURE GetSystemPalette(VAR palette:PaletteType);
(*Sets the current palette to the specified one. (palette) is an untyped variable, usually pointing to a record of type
PaletteType. After changing the palette content, the colors on screen are updated instantly. To change just some entries into
the palette use SetRGBPalette.
The (size) field of PaletteType structure gives the number of colors in the palette and (colors) field should contain absolute
RGB color values. Such values can be generated with the GetRGBColor routine, before calling InitGraph.
Color names (Red, Green, ...) are not constants, but variables which are mapped to the nearest entries into the selected palette.
Depending on selected palette, the result is not always as their names suggest. See GetNamesPalette for more details.
Because the palette is just a logical one, changing the palette entries might require setting again foreground and background
colors. Otherwise, old colors outside the palette range could remain in use.*)
PROCEDURE SetAllPalette(VAR palette:PaletteType);
(*Sets the background color to (color). Check SetColor to learn about color values.
The background color is the color used to clear portions of the screen (or the entire viewport). It is also used as dual color
in filling patterns. SetBkColor affects only subsequent drawings. Default color is Black.*)
PROCEDURE SetBkColor(color:CARDINAL);
(*Sets the foreground color to (color). For palette-based drivers the value of (color) is an index into the palette. For
non-palette driver (color) stores a 24 bits RGB value encoded in hexadecimal form. The low-order byte contains a value for
the relative intensity of red, the second byte contains a value for green and the third byte contains a value for blue
(ex 0000FFH is Red). In both cases, pre-defined color names can be used instead of pure numbers. Consult InitGraph about graphics
drivers and the section Alphabetical color names. See GetNamesPalette routine for more details on colors.
The foreground color is the color used for drawing contours, lines and text. Other primitives have different ways to specify
the color. Default color is White.*)
PROCEDURE SetColor(color:CARDINAL);
(*Changes the (nrcolor)-th entry in the current palette with (color) value. This argument (color) is an index into the default
VGA palette, returned by GetDefaultPalette. It ranges between 0 and 255, so is not limited to the current palette size. To
change a palette entry with a true color use SetRGBPalette instead.*)
PROCEDURE SetPalette(nrcolor,color:CARDINAL);
(*Sets current palette entry (nrcolor) with an absolute RGB value: (r)-red, (g)-green, (b)-blue. These arguments range between
0 and 255. Color names are not mapped to the new palette entry. See SetAllPalette for details on palette operation.*)
PROCEDURE SetRGBPalette(nrcolor,r,g,b:CARDINAL);

(*drawing primitives exported routines*)

(*Draws part of a circle with center at (x,y), radius (radius), starting from angle (start), stopping at angle (stop).
These angles are measured counter-clockwise. It uses current foreground color. To draw an entire circle use Circle.*)
PROCEDURE Arc(x,y:INTEGER; start,stop,radius:CARDINAL);
(*Draws a complete circle with center at (x,y) and radius (radius). To draw part of a circle use Arc.
Circle is a particular case of Ellipse.*)
PROCEDURE Circle(x,y:INTEGER; radius:CARDINAL);
(*Draws one or more cubic Bezier curves, using the current foreground color. A Bezier curve is defined by two endpoints and
two control points in between. A number of 3N+1 vertices will define exactly N Bezier curves. The arguments are the same as in
DrawPoly. It can be used to draw irregular curves, but a particular case is a rotated ellipse. See RotEllipse for details.*)
PROCEDURE DrawBezier(nrpoints:CARDINAL; VAR polypoints: ARRAY OF PointType);
(*Draws a polygon with (nrpoints) corner points, using the current foreground color and line style. Argument (polypoints)
 should be an array of type PointType containing at least (nrpoints) records. No check is performed. The last corner point is
 not drawn. It is usually faster that using several LineTo calls.*)
PROCEDURE DrawPoly(nrpoints:CARDINAL; VAR polypoints: ARRAY OF PointType);
(*Draws part of an ellipse with center at (x,y). Arguments (xradius) and (yradius) are the horizontal and vertical radii of the
ellipse, (start) and (stop) are the starting and stopping angles of the arc of the ellipse. They are measured counter-clockwise
from the x-axis (3 o’clock is equal to 0 degrees). It uses current foreground color. To draw part of a circle use Arc.
To draw a rotated ellipse use RotEllipse.*)
PROCEDURE Ellipse(x,y:INTEGER; start,stop,xradius,yradius:CARDINAL);
(*An animation structure contains a bitmap, its mask and a background image. With such a structure you can create transparent
bitmaps and animations, but you have no programmatic access to this structure.
GetAnim returns in variable (anim) the handle of an animation with a bitmap image taken from screen in the rectangle defined
by coordinates (x1,y1,x2,y2). A mask image is also created and room for background image is reserved. The system stores itself
all animation resources into memory. Use FreeAnim to release the memory after use. The (color) is the transparent color to be
set. This color is turned into black in the bitmap image and OR-ed with the screen color. Use PutAnim to place the animation
back on screen.*)
PROCEDURE GetArcCoords(VAR arccoords:ArcCoordsType);
(*Returns the current line settings in (lineinfo). That is, line style, pattern and thickness, as set by SetLineStyle.*)
PROCEDURE GetLineSettings(VAR lineinfo:LineSettingsType);
(*Draws a line starting from (x1,y1) to (x2,y2), using the current foregroung color and line style. The current position is
moved to (x2,y2). See LineTo for more details.*)
PROCEDURE Line(x1,y1,x2,y2:INTEGER);
(*Draws a line starting from the current pointer position to the point (dx,dy), relative to the current position, using the
current foreground color and line style. The current position is moved to the endpoint of the line. See LineTo for more details.*)
PROCEDURE LineRel(dx,dy:INTEGER);
(*Draws a line starting from the current pointer position to the point (x,y), using the current foregroung color and line style.
The current position is moved to (x,y).
Use SetLineStyle routine to set the line attributes and SetColor to set its color. Use MoveTo to change the current pointer
position. To draw a line with absolute coordinates use Line routine instead.*)
PROCEDURE LineTo(x,y:INTEGER);
(*Moves the pointer to coordinates (dx,dy), relative to the current pointer position. See MoveTo for more details.*)
PROCEDURE MoveRel(dx,dy:INTEGER);
(*Moves the pointer to coordinates (x,y) which are viewport-relative. See SetViewPort for more details. Only the following
routines use or move the current pointer:
  ClearDevice
  ClearViewPort
  GraphDefaults
  Line
  LineRel
  LineTo
  MoveRel
  MoveTo
  OutText
  OutTextXY
  SetViewPort
No check is made regarding coordinates range.*)
PROCEDURE MoveTo(x,y:INTEGER);
(*Puts a point at position (x,y) using color (color). Check SetColor to learn about color values. Use GetPixel to retrive a
pixel color.*)
PROCEDURE PutPixel(x,y:INTEGER; color:CARDINAL);
(*Draws a rectangle defined by the top-left corner (x1,y1) and the bottom-right corner (x2,y2). It uses the current foreground
color and line style. To draw a filled rectangle use FillRect.
Rectangle is a particular case of DrawPoly.*)
PROCEDURE Rectangle(x1,y1,x2,y2:INTEGER);
(*Draws a rotated ellipse with center at (x,y). Arguments (xradius) and (yradius) are the horizontal and vertical radii of the
 ellipse, (rot) defines the rotation angle measured counter-clockwise in degrees. It uses current foreground color. It is
 implemented using DrawBezier.*)
PROCEDURE RotEllipse(x,y,rot:INTEGER; xradius,yradius:CARDINAL);
(*Sets the drawing style for lines. The (linestyle) is one of the following constants:
  SolidLn - solid line
  DashedLn - dashed line
  DottedLn - dotted line
  DashDotLn - alternating dashes and dots line
  DashDotDotLn - dashes and double dots line
  UserBitLn - user defined line
  NullLn - invisible line
  If UserBitLn is specified then (pattern) should contain the 16-bit pattern. In all another cases (pattern) is ignored. The
  parameter (thickness) indicates how thick the line should be:
  NormWidth - one pixel width
  DoubleWidth - two pixels width
  TripleWidth - three pixels width
  QuadWidth - four pixels width
  ThickWidth=TripleWidth
If (thickness) <> NormWidth then (linestyle) is ignored and the line is drawn solid, due to Windows GDI limitations.
(thickness) is ignored for UserBitLn style because of missing implementation. Use SetColor to set the line color.*)
PROCEDURE SetLineStyle(linestyle,pattern,thickness:CARDINAL);

(*filled drawings exported routines*)

(*Draws and fills a rectangle with opposite corners at (x1,y1) and (x2,y2), using the current fill style and color.
  This rectangle has no border. Use FillRect to draw a filled rectangle with border.*)
PROCEDURE Bar(x1,y1,x2,y2:INTEGER);
(*Draws and fills a 3-dimensional bar with opposite corners of the front facet at (x1,y1) and (x2,y2). It uses the
current foreground color. Only front facet is filled with the current fill style and color. Argument (depth) specifies
the number of pixels used to show the depth of the bar. If (top) is true, then a 3-dimensional top is drawn.
Its pre-defined values are
  TopOn = true
  TopOff = false
Use Bar to draw a 2-dimensional bar.*)
PROCEDURE Bar3D(x1,y1,x2,y2:INTEGER; depth:CARDINAL; top:BOOLEAN);
(*Draws and fills a chord (a region bounded by the intersection of an ellipse and a line segment - called a secant).
It uses the current foreground color and fill style. The arguments have the same meaning as in Ellipse. To draw a
sector of an ellipse use Sector.*)
PROCEDURE Chord(x,y:INTEGER; start,stop,xradius,yradius:CARDINAL);
(*Draws and fills an entire ellipse with center at (x,y). Arguments (xradius) and (yradius) are the horizontal and vertical
radii of the ellipse. It uses the current foreground color and fill style. To draw a sector of an ellipse use Sector.*)
PROCEDURE FillEllipse(x,y:INTEGER;xradius,yradius:CARDINAL);
(*Draws and fills a polygon, using the current foreground color, line and fill style. The arguments are the same as in DrawPoly.
The polygon is closed automatically by drawing a line from the last vertex to the first.*)
PROCEDURE FillPoly(nrpoints:CARDINAL; VAR polypoints: ARRAY OF PointType);
(*Draws and fills a rectangle, using the current foreground color, line and fill style. The arguments are the same as in Rectangle.
To draw a borderless rectangle use Bar instead.
FillRect is a particular case of FillPoly.*)
PROCEDURE FillRect(x1,y1,x2,y2:INTEGER);
(*Fills a region surrounding the point (x,y) until a color-condition is met. This condition depends on (color) and the flood mode.
This mode is set with SetFloodMode routine.
There are some reasons this routine might fail:
 (1) the filling could not be completed (out of memory) - unlikely
 (2) the specified point has the boundary color specified by the (color)
       parameter (in BorderFlood mode)
 (3) the specified point does not have the color specified by (color)
       parameter (in SurfaceFlood mode)
 (4) the point is outside the current viewport, that is, it is not visible
See SetFloodMode for details.*)
PROCEDURE FloodFill(x,y:INTEGER; color:CARDINAL);
(*Returns in (fillpattern) the current fill-pattern array. This was set using SetFillPattern routine.*)
PROCEDURE GetFillPattern(VAR fillpattern:FillPatternType);
(*Returns the current fill-settings in (fillinfo). This structure contains the fill pattern and color, as set by SetFillStyle routine*)
PROCEDURE GetFillSettings(VAR fillinfo:FillSettingsType);
(*Performs a logical NOT operation on the color values for each pixel in the specified rectangle defined by coordinates (x1,y1,x2,y2).
On monochrome driver, InvertRect makes white pixels black and black pixels white. On color drivers, the inversion depends on
how colors are generated. Calling InvertRect twice for the same rectangle restores the display to its previous colors. It does
not perform well on palette-based drivers. See also SetWriteMode.*)
PROCEDURE InvertRect(x1,y1,x2,y2:INTEGER);
(*Draws and fills a circular sector (a region bounded by the intersection of a circle and two radials - called pie slice).
It uses the current foreground color and fill style. The arguments have the same meaning as in Arc. To draw an entire disk
use FillEllipse.
PieSlice is a particular case of Sector*)
PROCEDURE PieSlice(x,y:INTEGER; start,stop,radius:CARDINAL);
(*Draws and fills a rectangle with rounded corners, using the current foreground color, fill style and color. The argument (r)
is the radius of a circle used to draw the corners. The other parameters are the same as in Rectangle.*)
PROCEDURE RoundRect(x1,y1,x2,y2,r:INTEGER);
(*Draws and fills an elliptical sector (a region bounded by the intersection of an ellipse and two radials). It uses the
current foreground color and fill style. The arguments have the same meaning as in Ellipse. To draw a sector of a circle use PieSlice.*)
PROCEDURE Sector(x,y:INTEGER; start,stop,xradius,yradius:CARDINAL);
(*Selects a user-defined fill pattern which will be used in SetFillStyle routine with UserFill hatch set. The pattern is an 8x8
raster, corresponding to the 64 bits in (fillpattern). Foreground pattern color is set to (color). Default is White. Background
pattern color is the background color selected by SetBkColor. Check SetColor to learn more about colors.
Before returning it calls SetFillStyle routine to put the pattern into effect.*)
PROCEDURE SetFillPattern(fillpattern:FillPatternType; color:CARDINAL);
(*Sets the filling pattern and color for filled drawings routines. Argument (pattern) can be one of the following constants:
  EmptyFill - background color hatch
  SolidFill - solid hatch
  LineFill - horizontal hatch
  ColFill - vertical hatch
  HatchFill - horizontal and vertical cross-hatch
  SlashFill - 45-degree upward, left-to-right hatch
  BkSlashFill - 45-degree downward, left-to-right hatch
  XHatchFill - 45-degree cross-hatch
  UserFill - user-defined hatch
  NoFill - no hatch
If (pattern) equals UserFill, the user-defined pattern set by SetFillPattern becomes the active pattern. In this case, the
argument (color) is ignored. Parameter (color) is used to fill the shapes. Default is White. Check SetColor to learn about
color values.*)
PROCEDURE SetFillStyle(pattern:CARDINAL; color:CARDINAL);
(*Sets the mode in witch flood-fills are performed with FloodFill routine. Argument (floodmode) has the following pre-defined
values:
  BorderFlood - the fill area is bounded by the color specified in FloodFill; filling begins at the specified point and continues
                in all directions until it reaches the color bounding the area; this is the default.
  SurfaceFlood - the fill area is defined by the color that is specified in FloodFill; filling begins at the specified point and
                 continues in all directions over all adjacent regions containing the specified color; this mode is useful for
                 filling areas with multicolored boundaries
See also FloodFill routine.*)
PROCEDURE SetFloodMode(floodmode:INTEGER);

(*text AND font handling exported routines*)

(*Retrieves some information about the current selected font. First argument contains the full registered name of the font
(ex. 'Courier New'). It is the same name used by routine InstallUserFont when the font was installed. Variables (width) and
(height) contain the maximum dimensions of the characters in the font. If you want to retrive the dimensions of specific
characters use TextWidth and TextHeight routines. Boolean argument (ttfont) specify if the technology of this font is a
TrueType one. If so, the text can be rotated on screen using SetTextStyle routine. Otherwise, it cannot be rotated.*)
PROCEDURE GetFontSettings(VAR fontname:ARRAY OF CHAR; VAR width,height:CARDINAL; VAR ttfont:BOOLEAN);
(*Returns the current font and text settings in argument (textinfo). This contains the font type, direction, magnification,
horizontal and vertical alignment, as set by SetTextStyle and SetTextJustify routines.*)
PROCEDURE GetTextSettings(VAR textinfo:TextSettingsType);
(*Installs a new font and returns its index into the installed font table. This index can be used with SetTextStyle to enable
the font for texts. The parameter (fontname) must be a valid family font name registered into the system (ex: ' Fixedsys').
The name IS case sensitive. If the font cannot be registered, InstallUserFont will return -1.
InitGraph installs several fonts using this routine. Default font is set to 'Courier New'. Other installed fonts are listed in
section Font constants for text. For more info about fonts see SetTextStyle.*)
PROCEDURE InstallUserFont(fontname: ARRAY OF CHAR): INTEGER;
(*Puts (textstring) on the screen, at the current pointer position, using the current font and text settings. The current
position is moved to the end of the text. Use SetTextStyle to change font style and SetTextJustify to change text alignment.
To put text on an absolute location use OutTextXY instead.*)
PROCEDURE OutText(textstring:ARRAY OF CHAR);
(*Puts (textstring) on the screen, at the coordinates (x,y), using the current font and text settings. The current position is
 moved to the end of the text. See OutText for more details.*)
PROCEDURE OutTextXY(x,y:INTEGER; textstring:ARRAY OF CHAR);
(*It controls the placement of new text, relative to the cursor position. Argument (horiz) controls horizontal placement, and
can be one of the following pre-defined constants:
  LeftText - text is set left of the pointer
  CenterText - text is set centered horizontally on the pointer
  RightText - text is set to the right of the pointer
  Argument (vert) controls the vertical placement of the text. Its value can be one of the following pre-defined constants:
  TopText - text is placed above the pointer
  BottomText - text is placed under the pointer
  BaselineText - text is placed relative to its base line
Default text placement is LeftText and TopText.*)
PROCEDURE SetTextJustify(horiz,vert:CARDINAL);
(*It controls the style of text to be put on the screen. Pre-defined constants for (font) are:
  CourierNewFont - Courier New font
  MSSansSerifFont - MS Sans Serif font
  TimesNewRomanFont - Times New Roman font
  ArialFont - Arial font
  DefaultFont=CourierNewFont
  Besides, any successfully installed user font can be used insted. See InstallUserFont for details. All these fonts can be OR-ed
  with the following additional styles to change their appearance:
  ItalicFont - italic font
  UnderlineFont - underlined font
  BoldFont - bold font
  Argument (direction) sets the direction of text. It can be any positive value in degrees or one of the following constants:
  HorizDir = 0
  VertDir = 90
Between 1 and 5, (charsize) represents the magnification of the characters with a standard font size of 8 pixels. Above 6 it
represents an absolute font size. Default is set to 16.
Be aware that some fonts (including pre-defined) do not support all these styles. See GetFontSettings routine for more details.
Use SetColor to set text color.*)
PROCEDURE SetTextStyle(font,direction,charsize:CARDINAL);
(*First argument (nCharExtra) sets the intercharacter spacing in text and the second one (nBreakExtra) sets the amount of space
reserved for break character. The other ones are dummy arguments (not used). This is a major incompatibility with BP graph unit.
Default values are zero.
See SetTextStyle for other text styles.*)
PROCEDURE SetUserCharSize(nCharExtra,nBreakExtra,dummy1,dummy2:CARDINAL);
(*Returns the height (in pixels) of the (textstring) in the current font style. This value might be altered by a call to
SetTextStyle or SetUserCharSize.*)
PROCEDURE TextHeight(textstring:ARRAY OF CHAR): CARDINAL;
(*Returns the width (in pixels) of the (textstring) in the current font style. This value might be altered by a call to
SetTextStyle or SetUserCharSize.*)
PROCEDURE TextWidth(textstring:ARRAY OF CHAR): CARDINAL;

PROCEDURE THREEDto2DAll(coords, pan, centre, position: ThreeDPointType; zoom: REAL; VAR sx,sy: REAL);
PROCEDURE THREEDto2D(coords: ThreeDPointType; zoom: REAL; VAR sx,sy: REAL);


(*caret format: block OR underline*)
VAR CaretBlock: BOOLEAN = TRUE;
(*caret blink rate in tenths OF a second*)
VAR BlinkRate: CARDINAL = 2;

(*keyboard exported routines*)
(*It delays the main thread a specified number of milliseconds (ms). Keyboard and mouse events are still recorded. You can use
this routine in a waiting loop (as Delay(10)), if you want your program not consume most of all CPU cycles. ReadBuf and ReadKey
routines are using this technique.
The specified number is an approximation, the result may be off a lot, if system load is high.*)
PROCEDURE Delay(ms:CARDINAL);
(*Scans the keyboard buffer and sees if a key has been pressed. If this is the case, true is returned. If not, false is returned.
The Shift, Alt and Ctrl keys are not reported. The key is not removed from the buffer, and can hence still be read after the
KeyPressed function has been called, using ReadKey routine.*)
PROCEDURE KeyPressed(): BOOLEAN;
(*Emulates the Read console routine for WinGraph. It creates a blinking caret and waits for the user to input several keys until
Enter key (#13) is pressed or a number of (maxchar) characters is reached. If (maxchar) is set to 0 at most 255 characters are
accepted. Argument (buf) will store the sequence of input characters. The accepted ASCII range is between ' '(space) to '~'(tilde).
Extended or function keys are ignored. Among usual edit keys only BackSpace is recognized.
The routine uses DefaultFont to write characters horizontally on screen and manage itself the placement and intercharacter spaces.
All other text styles specified by the user are accounted for.
Text is positioned at the current pixel location. The entire screen scrolls up if necessary. Next ReadBuf call places the caret
on new line.*)
PROCEDURE ReadBuf(VAR buf: ARRAY OF CHAR; maxchar:CARDINAL8);
(*Returns one key from the keyboard buffer. If an extended or function key has been pressed, then the zero ASCII code is returned
(#0). You can then read the scan code of the key with a second ReadKey call.
Most of the key codes from a DOS console are implemented in WinCrt, together with many other ones. See below for a full list.

Key              Normal    Shift     Ctrl      Alt
 ---------------------------------------------------------
 A                #97       #65       #1        #0#30
 B                #98       #66       #2        #0#48
 C                #99       #67       #3        #0#46
 D                #100      #68       #4        #0#32
 E                #101      #69       #5        #0#18
 F                #102      #70       #6        #0#33
 G                #103      #71       #7        #0#34
 H                #104      #72       #8        #0#35
 I                #105      #73       #9        #0#23
 J                #106      #74       #10       #0#36
 K                #107      #75       #11       #0#37
 L                #108      #76       #12       #0#38
 M                #109      #77       #13       #0#50
 N                #110      #78       #14       #0#49
 O                #111      #79       #15       #0#24
 P                #112      #80       #16       #0#25
 Q                #113      #81       #17       #0#16
 R                #114      #82       #18       #0#19
 S                #115      #83       #19       #0#31
 T                #116      #84       #20       #0#20
 U                #117      #85       #21       #0#22
 V                #118      #86       #22       #0#47
 W                #119      #87       #23       #0#17
 X                #120      #88       #24       #0#45
 Y                #121      #89       #25       #0#21
 Z                #122      #90       #26       #0#44

 0 )              #48       #41       #0#10     #0#1
« Last Edit: August 04, 2013, 11:09:08 AM by Theo Gottwald »

Offline Richard Koch

  • Newbie
  • *
  • Posts: 23
Re: ADW Modula Corner opened.
« Reply #2 on: August 05, 2013, 12:22:30 PM »
sorry that i posted part of this before. the file are a litte demo on how fast and easy one can convert pascal stuff to modula. ok - it needs to be cleaned ..., but it took me 2,5 hours to convert and start using.

Code: [Select]
This is my second choice as PB alternative, especially as it also supports x32 as well as x64 code.
what is your first choice?

Offline Theo Gottwald

  • Administrator
  • Hero Member
  • *****
  • Posts: 964
    • it-berater
Re: ADW Modula Corner opened.
« Reply #3 on: August 08, 2013, 10:20:50 AM »
Thats the point. And not everybody can do that.
Anyway, feel free to post updated include versions here.