home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / progpas / tegl6b.arj / INTROPAK.EXE / lha / TWCOMMON.DOC < prev    next >
Text File  |  1991-08-16  |  7KB  |  209 lines

  1. {-----------------------------------------------------------------------------}
  2. {               TEGL Windows ToolKit II                  }
  3. {          Copyright (C) 1990, 1991 TEGL Systems Corporation              }
  4. {                All Rights Reserved.                  }
  5. {-----------------------------------------------------------------------------}
  6. {$I switches.inc}
  7. UNIT twCommon;
  8.  
  9. INTERFACE
  10.  
  11.  
  12. USES
  13.   errorlog,
  14.   videochk,
  15.   tgi,
  16.   FastGrph,
  17.  
  18.   {$IFDEF NoGr}
  19.   TGraph,
  20.   {$ELSE}
  21.   graph,
  22.   {$ENDIF}
  23.  
  24.   TEGLFont,
  25.   winicons,
  26.   VirtMem,
  27.   TeglMain,
  28.   teglicon,
  29.   TeglUnit;
  30.  
  31. CONST
  32.   twMaxHeaderLen = 40;      { -- maximum header string length. }
  33.  
  34.   twMinX : Word = 100; { -- global initialization values for }
  35.   twMinY : Word = 60;  { -- for windows. Can be overridden. }
  36.   twMaxX : Word = 640;
  37.   twMaxY : Word = 480;
  38.  
  39.   twBorderColor  : Integer = Black;
  40.   twHeaderColor  : Integer = Yellow;
  41.   twFrameColor     : Integer = LightGray;
  42.   twFrameColor2  : Integer = DarkGray;
  43.   twFillColor     : Integer = White;
  44.   twTextColor     : Integer = Black;
  45.   twTextBackGround   : Integer = White;
  46.  
  47.   twThickness : Integer = 4;
  48.   twMoveable  : Boolean = TRUE;       {-- window are moveable by default }
  49.   twResize    : Boolean = TRUE;
  50.  
  51.   twBlockChar : word = 219;          {-- the block character is used for }
  52.                       {-- for blanking a character cell }
  53.                       {-- before writing a character to it.}
  54.  
  55.   twClipping   : Boolean = TRUE;       {-- graphics operations to be clipped }
  56.                       {-- within window. }
  57.  
  58.   {-- dialog CONSTANTS}
  59.   tdnothing    = 00;     {-- marker to break apart clusters }
  60.   tdlabel    = 01;
  61.   tdbutton    = 02;     {-- button, like OK or  CANCEL }
  62.   tdiconbutton    = 03;     {-- button, custom }
  63.   tdradiobutton = 04;     {-- radio buttons  ( )  ( )  (*) }
  64.   tdcheckbox    = 05;     {-- check boxes    [X]  [X]  [ ] }
  65.   tduserdefined = 06;     {-- actually they start here }
  66.  
  67. TYPE
  68.  
  69. {-- Standard frame drawing routine. }
  70.  
  71.      FrameDrawFunc = Procedure (x1,y1,x2,y2,thickness,
  72.        border,uppershade,lowershade,fill: Integer);
  73.  
  74. {-- Declare the type of float world coordinate system uses if it is }
  75. {-- defined. }
  76.  
  77. {$IFDEF twWorld}
  78.   {$IFDEF wcFloatLInt}
  79.     wcFloat = LongInt;
  80.     {$ELSE} {$IFDEF wcFloatReal}
  81.       wcFloat = Real;
  82.       {$ELSE} {$IFDEF wcRealSingle}
  83.     wcFloat = Single;
  84.     {$ELSE} {$IFDEF wcRealDouble}
  85.      wcFloat = Double;
  86.        {$ENDIF}
  87.       {$ENDIF}
  88.     {$ENDIF}
  89.   {$ENDIF}
  90. {$ENDIF}
  91.  
  92. twpoints = record  x1,y1,x2,y2 : Integer; end;
  93.  
  94.  
  95. graphVars = Record
  96.   x,y        : Integer;         { -- the CP }
  97.   Color     : Word;
  98.   BkColor    : Word;
  99.   LineSettings    : LineSettingsType;
  100.   TextSettings    : TextSettingsType;
  101.   FillSettings    : FillSettingsType;
  102.   FillPattern    : FillPatternType;
  103. END;
  104.  
  105. CONST
  106.   twHeaderFont : Pointer = NIL;
  107.   twDialogFont : Pointer = NIL;
  108.  
  109.   buth      : byte = 16;     { -- button height }
  110.   butw      : byte = 16;     { -- button width }
  111.   udslen  : byte = 16;     { -- slider length }
  112.   lrslen  : byte = 16;     { -- left right slider length }
  113.   resizeh : byte = 16;     { -- resize area height }
  114.   resizew : byte = 16;     { -- resize area width }
  115.  
  116. {..WFICON
  117. XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  118. XFXX0FXXXXXXXXXXXXXXXXXXXXX0    X    X
  119. XF0F0FXXXX0XXXXXXXXXXFXXXXX0 XX80 XX80XX
  120. XFXX0FXXXXXXXXXXXXXXXXXXXXX08XXX08XXX0XX
  121. XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  122. XFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX0X   XXX
  123. XFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX0X8XX0XX
  124. XFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX0XXXXXXX
  125. XFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX0X8XX0XX
  126. XFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX0X8XX0XX
  127. XFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX0X8XX0XX
  128. XFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX0X8XX0XX
  129. XFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX0X8XX0XX
  130. XFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX0X8XX0XX
  131. XFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX0X8XX0XX
  132. XFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX0X8XX0XX
  133. XFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX0X8XX0XX
  134. XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  135. X7XX08XXXXXXXXXXXXXXXXXXXXXX07XX0X7XX0XX
  136. X8XX08XXXXXXXXXXXXXXXXXXXXXX08XX0X8XX0XX
  137. XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  138.   XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  139.   XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  140. }
  141.    ImageWFICON : array [0..385] of byte =
  142.                 ($80,$01,
  143.                  $81,$01,$26,  $01,$02,  $82,$82,$0F,$04,  $05,$82,$00,
  144.                  $86,$82,$0F,$1B,  $1C,$82,$00,  $21,$02,  $26,$02,
  145.                  $01,$03,  $02,$83,$0F,  $03,$83,$00,  $04,$83,$0F,
  146.                  $05,$83,$00,  $86,$83,$0F,$0A,  $8B,$83,$00,$15,  $96,$83,$0F,$1B,
  147.                  $1C,$83,$00,  $9E,$03,$1F,  $20,$83,$08,  $21,$83,$00,
  148.                  $A3,$03,$24,  $25,$83,$08,  $A6,$83,$00,$28,  $01,$04,
  149.                  $82,$84,$0F,$04,  $05,$84,$00,  $86,$84,$0F,$1B,  $1C,$84,$00,
  150.                  $9D,$84,$08,$20,  $21,$84,$00,  $A2,$84,$08,$25,  $A6,$84,$00,$28,
  151.                  $81,$05,$28,  $01,$06,  $82,$86,$0F,$20,  $A1,$86,$00,$22,
  152.                  $A6,$06,$28,  $01,$07,  $82,$87,$0F,$20,  $A1,$87,$00,$22,
  153.                  $A3,$87,$08,$25,  $A6,$87,$00,$28,  $01,$08,  $82,$88,$0F,$20,
  154.                  $A1,$88,$00,$28,  $01,$09,  $82,$89,$0F,$20,  $A1,$89,$00,$22,
  155.                  $A3,$89,$08,$25,  $A6,$89,$00,$28,  $01,$0A,  $82,$8A,$0F,$20,
  156.                  $A1,$8A,$00,$22,  $A3,$8A,$08,$25,  $A6,$8A,$00,$28,  $01,$0B,
  157.                  $82,$8B,$0F,$20,  $A1,$8B,$00,$22,  $A3,$8B,$08,$25,  $A6,$8B,$00,$28,
  158.                  $01,$0C,  $82,$8C,$0F,$20,  $A1,$8C,$00,$22,  $A3,$8C,$08,$25,
  159.                  $A6,$8C,$00,$28,  $01,$0D,  $82,$8D,$0F,$20,  $A1,$8D,$00,$22,
  160.                  $A3,$8D,$08,$25,  $A6,$8D,$00,$28,  $01,$0E,  $82,$8E,$0F,$20,
  161.                  $A1,$8E,$00,$22,  $A3,$8E,$08,$25,  $A6,$8E,$00,$28,  $01,$0F,
  162.                  $82,$8F,$0F,$20,  $A1,$8F,$00,$22,  $A3,$8F,$08,$25,  $A6,$8F,$00,$28,
  163.                  $01,$10,  $82,$90,$0F,$20,  $A1,$90,$00,$22,  $A3,$90,$08,$25,
  164.                  $A6,$90,$00,$28,  $01,$11,  $82,$91,$0F,$20,  $A1,$91,$00,$22,
  165.                  $A3,$91,$08,$25,  $A6,$91,$00,$28,  $81,$12,$28,  $01,$13,
  166.                  $82,$93,$07,$04,  $05,$93,$00,  $86,$93,$08,$1C,  $1D,$93,$00,
  167.                  $9E,$93,$07,$20,  $A1,$93,$00,$22,  $A3,$93,$07,$25,  $A6,$93,$00,$28,
  168.                  $01,$14,  $82,$94,$08,$04,  $05,$94,$00,  $86,$94,$08,$1C,
  169.                  $1D,$94,$00,  $9E,$94,$08,$20,  $A1,$94,$00,$22,  $A3,$94,$08,$25,
  170.                  $A6,$94,$00,$28,  $81,$15,$28,  $83,$16,$28,  $83,$17,$28 );
  171.  
  172.  
  173. VAR
  174.   twlfbut : pointer;
  175.   twrtbut : pointer;
  176.   twupbut : pointer;
  177.   twdnbut : pointer;
  178.   twudbut : pointer;
  179.   twcrbut : pointer;
  180.  
  181.  
  182. function twExitOption(ifs : Imagestkptr; ms : msclickptr): Word;
  183. Procedure EmergencyExit;
  184. Procedure twEasyStart;
  185. Procedure twFit(VAR i,i1: Word; max : Word);
  186. Procedure twFitFrame(VAR x,y,width,height : Word);
  187. Procedure twSetGlobalButtonSize(width,height : byte);
  188. Procedure twSetGlobalButtonIcons(left,right,up,down,updown,corner : pointer);
  189. Procedure twSetGlobalSliderSize(updown,leftright : byte);
  190. Procedure twSetGlobalResizearea(width,height  :byte);
  191. Procedure twSetGlobalMinMax(minx_,miny_,maxx_,maxy_ : Word);
  192. Procedure DrawSliderBackGround(x1, y1, x2, y2 : Integer);
  193. Procedure ErrMess(x,y: Integer; s: String);
  194.  
  195. procedure lineset(x1,y1,x2,y2,c1,c2 : Integer);
  196. Procedure FilledRectangle(x,y,x1,y1,BorderColor,Fill,Color : Word);
  197.  
  198. Procedure StdBox(x1,y1,x2,y2,thickness,border,
  199.           edgefill,discard,fill: Integer);
  200. Procedure BevBox(x1,y1,x2,y2,thickness,border,
  201.           uppershade,lowershade,fill: Integer);
  202.  
  203. Procedure GetGraphSettings(VAR gs : graphVars);
  204. Procedure SetGraphSettings(VAR gs : graphVars);
  205. Procedure twSetDialogFont(Font : pointer);
  206. Procedure twSetHeaderFont(Font : pointer);
  207.  
  208. IMPLEMENTATION
  209.